From 7837c072a7fce4712713a61d114cf4e466b218d1 Mon Sep 17 00:00:00 2001 From: Daybrush Date: Sat, 28 Oct 2023 15:03:31 +0900 Subject: [PATCH] Updates --- helper/release/0.52.0/dist/helper.cjs.js | 729 + helper/release/0.52.0/dist/helper.cjs.js.map | 1 + helper/release/0.52.0/dist/helper.esm.js | 711 + helper/release/0.52.0/dist/helper.esm.js.map | 1 + helper/release/0.52.0/dist/helper.js | 817 + helper/release/0.52.0/dist/helper.js.map | 1 + helper/release/0.52.0/dist/helper.min.js | 10 + helper/release/0.52.0/dist/helper.min.js.map | 1 + release/0.52.0/dist/moveable.cjs.js | 284 + release/0.52.0/dist/moveable.cjs.js.map | 1 + release/0.52.0/dist/moveable.esm.js | 243 + release/0.52.0/dist/moveable.esm.js.map | 1 + release/0.52.0/dist/moveable.js | 23581 +++++++++++++ release/0.52.0/dist/moveable.js.map | 1 + release/0.52.0/dist/moveable.min.js | 10 + release/0.52.0/dist/moveable.min.js.map | 1 + release/0.52.0/doc/EventEmitter.html | 2766 ++ release/0.52.0/doc/Moveable.Clippable.html | 3781 +++ release/0.52.0/doc/Moveable.Draggable.html | 4746 +++ release/0.52.0/doc/Moveable.Group.html | 718 + .../0.52.0/doc/Moveable.OriginDraggable.html | 3052 ++ release/0.52.0/doc/Moveable.Pinchable.html | 2971 ++ release/0.52.0/doc/Moveable.Resizable.html | 5993 ++++ release/0.52.0/doc/Moveable.Rotatable.html | 5584 +++ release/0.52.0/doc/Moveable.Roundable.html | 4064 +++ release/0.52.0/doc/Moveable.Scalable.html | 5511 +++ release/0.52.0/doc/Moveable.Scrollable.html | 1389 + release/0.52.0/doc/Moveable.Snappable.html | 6376 ++++ release/0.52.0/doc/Moveable.Warpable.html | 2716 ++ release/0.52.0/doc/Moveable.html | 28271 ++++++++++++++++ release/0.52.0/doc/global.html | 1770 + release/0.52.0/doc/index.html | 404 + ...ena_event-emitter_src_EventEmitter.ts.html | 292 + ...les_@scena_event-emitter_src_types.ts.html | 125 + ...ages_moveable_src_MoveableManager.tsx.html | 204 + ...eact-moveable_src_InitialMoveable.tsx.html | 449 + ..._react-moveable_src_MoveableGroup.tsx.html | 613 + ...eact-moveable_src_MoveableManager.tsx.html | 1518 + ...react-moveable_src_ables_Clickable.ts.html | 204 + ...eact-moveable_src_ables_Clippable.tsx.html | 1239 + ...react-moveable_src_ables_DragArea.tsx.html | 265 + ...eact-moveable_src_ables_Draggable.tsx.html | 681 + ...s_react-moveable_src_ables_Origin.tsx.html | 122 + ...oveable_src_ables_OriginDraggable.tsx.html | 433 + ..._react-moveable_src_ables_Padding.tsx.html | 159 + ...react-moveable_src_ables_Pinchable.ts.html | 374 + ...react-moveable_src_ables_Resizable.ts.html | 1104 + ...eact-moveable_src_ables_Rotatable.tsx.html | 1143 + ...eact-moveable_src_ables_Roundable.tsx.html | 985 + ..._react-moveable_src_ables_Scalable.ts.html | 890 + ...eact-moveable_src_ables_Scrollable.ts.html | 252 + ...eact-moveable_src_ables_Snappable.tsx.html | 1332 + ...react-moveable_src_ables_Warpable.tsx.html | 428 + ...-moveable_src_ables_edgeDraggable.tsx.html | 172 + .../packages_react-moveable_src_types.ts.html | 3557 ++ release/0.52.0/doc/scripts/custom.js | 12 + release/0.52.0/doc/scripts/linenumber.js | 25 + .../scripts/prettify/Apache-License-2.0.txt | 202 + .../0.52.0/doc/scripts/prettify/lang-css.js | 2 + .../0.52.0/doc/scripts/prettify/prettify.js | 28 + release/0.52.0/doc/scripts/search.js | 47 + release/0.52.0/doc/scripts/utils.min.js | 9 + release/0.52.0/doc/styles/custom.css | 0 release/0.52.0/doc/styles/daybrush.css | 185 + release/0.52.0/doc/styles/jsdoc.css | 679 + release/0.52.0/doc/styles/prettify.css | 79 + release/latest/dist/moveable.cjs.js | 2 +- release/latest/dist/moveable.esm.js | 2 +- release/latest/dist/moveable.js | 329 +- release/latest/dist/moveable.js.map | 2 +- release/latest/dist/moveable.min.js | 4 +- release/latest/doc/EventEmitter.html | 2 +- release/latest/doc/Moveable.Clippable.html | 10 +- release/latest/doc/Moveable.Draggable.html | 45 +- release/latest/doc/Moveable.Group.html | 4 +- .../latest/doc/Moveable.OriginDraggable.html | 10 +- release/latest/doc/Moveable.Pinchable.html | 16 +- release/latest/doc/Moveable.Resizable.html | 22 +- release/latest/doc/Moveable.Rotatable.html | 22 +- release/latest/doc/Moveable.Roundable.html | 16 +- release/latest/doc/Moveable.Scalable.html | 48 +- release/latest/doc/Moveable.Scrollable.html | 8 +- release/latest/doc/Moveable.Snappable.html | 137 +- release/latest/doc/Moveable.Warpable.html | 10 +- release/latest/doc/Moveable.html | 148 +- release/latest/doc/global.html | 4 +- release/latest/doc/index.html | 2 +- ...ena_event-emitter_src_EventEmitter.ts.html | 2 +- ...les_@scena_event-emitter_src_types.ts.html | 2 +- ...ages_moveable_src_MoveableManager.tsx.html | 2 +- ...eact-moveable_src_InitialMoveable.tsx.html | 2 +- ..._react-moveable_src_MoveableGroup.tsx.html | 2 +- ...eact-moveable_src_MoveableManager.tsx.html | 72 +- ...react-moveable_src_ables_Clickable.ts.html | 2 +- ...eact-moveable_src_ables_Clippable.tsx.html | 2 +- ...react-moveable_src_ables_DragArea.tsx.html | 2 +- ...eact-moveable_src_ables_Draggable.tsx.html | 39 +- ...s_react-moveable_src_ables_Origin.tsx.html | 2 +- ...oveable_src_ables_OriginDraggable.tsx.html | 2 +- ..._react-moveable_src_ables_Padding.tsx.html | 2 +- ...react-moveable_src_ables_Pinchable.ts.html | 2 +- ...react-moveable_src_ables_Resizable.ts.html | 2 +- ...eact-moveable_src_ables_Rotatable.tsx.html | 2 +- ...eact-moveable_src_ables_Roundable.tsx.html | 2 +- ..._react-moveable_src_ables_Scalable.ts.html | 11 +- ...eact-moveable_src_ables_Scrollable.ts.html | 2 +- ...eact-moveable_src_ables_Snappable.tsx.html | 3 +- ...react-moveable_src_ables_Warpable.tsx.html | 2 +- ...-moveable_src_ables_edgeDraggable.tsx.html | 2 +- .../packages_react-moveable_src_types.ts.html | 11 +- storybook/iframe.html | 2 +- storybook/main.c28e5f47.iframe.bundle.js | 1 + storybook/project.json | 2 +- .../vendors~main.f576d407.iframe.bundle.js | 3 + ...main.f576d407.iframe.bundle.js.LICENSE.txt | 127 + ...vendors~main.f576d407.iframe.bundle.js.map | 1 + 116 files changed, 125128 insertions(+), 337 deletions(-) create mode 100644 helper/release/0.52.0/dist/helper.cjs.js create mode 100644 helper/release/0.52.0/dist/helper.cjs.js.map create mode 100644 helper/release/0.52.0/dist/helper.esm.js create mode 100644 helper/release/0.52.0/dist/helper.esm.js.map create mode 100644 helper/release/0.52.0/dist/helper.js create mode 100644 helper/release/0.52.0/dist/helper.js.map create mode 100644 helper/release/0.52.0/dist/helper.min.js create mode 100644 helper/release/0.52.0/dist/helper.min.js.map create mode 100644 release/0.52.0/dist/moveable.cjs.js create mode 100644 release/0.52.0/dist/moveable.cjs.js.map create mode 100644 release/0.52.0/dist/moveable.esm.js create mode 100644 release/0.52.0/dist/moveable.esm.js.map create mode 100644 release/0.52.0/dist/moveable.js create mode 100644 release/0.52.0/dist/moveable.js.map create mode 100644 release/0.52.0/dist/moveable.min.js create mode 100644 release/0.52.0/dist/moveable.min.js.map create mode 100644 release/0.52.0/doc/EventEmitter.html create mode 100644 release/0.52.0/doc/Moveable.Clippable.html create mode 100644 release/0.52.0/doc/Moveable.Draggable.html create mode 100644 release/0.52.0/doc/Moveable.Group.html create mode 100644 release/0.52.0/doc/Moveable.OriginDraggable.html create mode 100644 release/0.52.0/doc/Moveable.Pinchable.html create mode 100644 release/0.52.0/doc/Moveable.Resizable.html create mode 100644 release/0.52.0/doc/Moveable.Rotatable.html create mode 100644 release/0.52.0/doc/Moveable.Roundable.html create mode 100644 release/0.52.0/doc/Moveable.Scalable.html create mode 100644 release/0.52.0/doc/Moveable.Scrollable.html create mode 100644 release/0.52.0/doc/Moveable.Snappable.html create mode 100644 release/0.52.0/doc/Moveable.Warpable.html create mode 100644 release/0.52.0/doc/Moveable.html create mode 100644 release/0.52.0/doc/global.html create mode 100644 release/0.52.0/doc/index.html create mode 100644 release/0.52.0/doc/node_modules_@scena_event-emitter_src_EventEmitter.ts.html create mode 100644 release/0.52.0/doc/node_modules_@scena_event-emitter_src_types.ts.html create mode 100644 release/0.52.0/doc/packages_moveable_src_MoveableManager.tsx.html create mode 100644 release/0.52.0/doc/packages_react-moveable_src_InitialMoveable.tsx.html create mode 100644 release/0.52.0/doc/packages_react-moveable_src_MoveableGroup.tsx.html create mode 100644 release/0.52.0/doc/packages_react-moveable_src_MoveableManager.tsx.html create mode 100644 release/0.52.0/doc/packages_react-moveable_src_ables_Clickable.ts.html create mode 100644 release/0.52.0/doc/packages_react-moveable_src_ables_Clippable.tsx.html create mode 100644 release/0.52.0/doc/packages_react-moveable_src_ables_DragArea.tsx.html create mode 100644 release/0.52.0/doc/packages_react-moveable_src_ables_Draggable.tsx.html create mode 100644 release/0.52.0/doc/packages_react-moveable_src_ables_Origin.tsx.html create mode 100644 release/0.52.0/doc/packages_react-moveable_src_ables_OriginDraggable.tsx.html create mode 100644 release/0.52.0/doc/packages_react-moveable_src_ables_Padding.tsx.html create mode 100644 release/0.52.0/doc/packages_react-moveable_src_ables_Pinchable.ts.html create mode 100644 release/0.52.0/doc/packages_react-moveable_src_ables_Resizable.ts.html create mode 100644 release/0.52.0/doc/packages_react-moveable_src_ables_Rotatable.tsx.html create mode 100644 release/0.52.0/doc/packages_react-moveable_src_ables_Roundable.tsx.html create mode 100644 release/0.52.0/doc/packages_react-moveable_src_ables_Scalable.ts.html create mode 100644 release/0.52.0/doc/packages_react-moveable_src_ables_Scrollable.ts.html create mode 100644 release/0.52.0/doc/packages_react-moveable_src_ables_Snappable.tsx.html create mode 100644 release/0.52.0/doc/packages_react-moveable_src_ables_Warpable.tsx.html create mode 100644 release/0.52.0/doc/packages_react-moveable_src_ables_edgeDraggable.tsx.html create mode 100644 release/0.52.0/doc/packages_react-moveable_src_types.ts.html create mode 100644 release/0.52.0/doc/scripts/custom.js create mode 100644 release/0.52.0/doc/scripts/linenumber.js create mode 100644 release/0.52.0/doc/scripts/prettify/Apache-License-2.0.txt create mode 100644 release/0.52.0/doc/scripts/prettify/lang-css.js create mode 100644 release/0.52.0/doc/scripts/prettify/prettify.js create mode 100644 release/0.52.0/doc/scripts/search.js create mode 100644 release/0.52.0/doc/scripts/utils.min.js create mode 100644 release/0.52.0/doc/styles/custom.css create mode 100644 release/0.52.0/doc/styles/daybrush.css create mode 100644 release/0.52.0/doc/styles/jsdoc.css create mode 100644 release/0.52.0/doc/styles/prettify.css create mode 100644 storybook/main.c28e5f47.iframe.bundle.js create mode 100644 storybook/vendors~main.f576d407.iframe.bundle.js create mode 100644 storybook/vendors~main.f576d407.iframe.bundle.js.LICENSE.txt create mode 100644 storybook/vendors~main.f576d407.iframe.bundle.js.map diff --git a/helper/release/0.52.0/dist/helper.cjs.js b/helper/release/0.52.0/dist/helper.cjs.js new file mode 100644 index 000000000..b6f8dbb05 --- /dev/null +++ b/helper/release/0.52.0/dist/helper.cjs.js @@ -0,0 +1,729 @@ +/* +Copyright (c) Daybrush +name: @moveable/helper +license: MIT +author: Daybrush +repository: https://github.com/daybrush/moveable/blob/master/packages/helper +version: 0.1.3 +*/ +'use strict'; + +var utils = require('@daybrush/utils'); + +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} + +var Child = /*#__PURE__*/ (function () { + function Child(parent) { + this.parent = parent; + this.type = "single"; + this.depth = 0; + this._scope = []; + if (parent) { + this.depth = parent.depth + 1; + } + } + Object.defineProperty(Child.prototype, "scope", { + get: function () { + var parent = this.parent; + if (!parent || parent.type === "root") { + return []; + } + return __spreadArray(__spreadArray([], __read(parent.scope), false), [parent.id], false); + }, + enumerable: false, + configurable: true + }); + return Child; +}()); +var SingleChild = /*#__PURE__*/ (function (_super) { + __extends(SingleChild, _super); + function SingleChild(parent, value) { + var _this = _super.call(this, parent) || this; + _this.value = value; + _this.type = "single"; + _this.isGroupElement = false; + return _this; + } + return SingleChild; +}(Child)); +var ArrayChild = /*#__PURE__*/ (function (_super) { + __extends(ArrayChild, _super); + function ArrayChild() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.type = "group"; + _this.value = []; + _this.id = ""; + _this.groupElement = null; + _this.map = new Map(); + return _this; + } + ArrayChild.prototype.compare = function (groups, checker) { + if (checker === void 0) { checker = 0; } + var elements = utils.deepFlat(groups); + var map = this.map; + var elementsLength = elements.length; + var mapSize = map.size; + var sizeDiff = mapSize - elementsLength; + // 1 this > groups + // 0 this = groups + // -1 this < groups + var count = elements.filter(function (element) { return map.has(element); }).length; + if ((checker > 0 && sizeDiff >= 0) || (checker === 0 && sizeDiff === 0)) { + return elementsLength === count; + } + else if (checker < 0 && sizeDiff <= 0) { + return mapSize === count; + } + return false; + }; + ArrayChild.prototype.has = function (target) { + return this.map.has(target); + }; + ArrayChild.prototype.contains = function (element) { + if (this.has(element)) { + return true; + } + return this.value.some(function (child) { + if (child.type === "group") { + return child.contains(element); + } + else { + return false; + } + }); + }; + ArrayChild.prototype.findContainedChild = function (element) { + return utils.find(this.value, function (child) { + if (child.type === "single") { + return child.value === element; + } + else { + return child.contains(element); + } + }); + }; + /** + * Exact group containing targets + */ + ArrayChild.prototype.findExactChild = function (target) { + var map = this.map; + if (!utils.isArray(target)) { + return map.get(target); + } + var flatted = utils.deepFlat(target); + var length = flatted.length; + var single = map.get(flatted[0]); + if (!single) { + return; + } + var parent = single.parent; + while (parent) { + if (parent.map.size >= length) { + return parent; + } + parent = parent.parent; + } + return; + }; + ArrayChild.prototype.findCommonParent = function (targets) { + var _this = this; + var depth = Infinity; + var childs = targets.map(function (target) { return _this.findExactChild(target); }); + childs.forEach(function (child) { + if (!child) { + return; + } + depth = Math.min(child.depth, depth); + }); + var _loop_1 = function () { + --depth; + childs = childs.map(function (child) { + var parent = child; + while (parent && parent.depth !== depth) { + parent = parent.parent; + } + return parent; + }); + var firstChild = childs.find(function (child) { return child; }); + if (!firstChild) { + return { value: this_1 }; + } + if (childs.every(function (child) { return !child || child === firstChild; })) { + return "break"; + } + }; + var this_1 = this; + while (depth) { + var state_1 = _loop_1(); + if (typeof state_1 === "object") + return state_1.value; + if (state_1 === "break") + break; + } + var commonParent = childs.find(function (child) { return child; }); + return commonParent || this; + }; + ArrayChild.prototype.findNextChild = function (target, range, isExact) { + var _this = this; + if (range === void 0) { range = this.toTargetGroups(); } + if (isExact === void 0) { isExact = true; } + var nextChild = null; + var length = range.length; + range.some(function (child) { + if (!isExact && length === 1 && utils.isArray(child)) { + nextChild = _this.findNextChild(target, child); + return nextChild; + } + var nextGroupChild = _this.findExactChild(child); + if (!nextGroupChild) { + return; + } + if ("map" in nextGroupChild) { + if (nextGroupChild.map.has(target)) { + nextChild = nextGroupChild; + return true; + } + } + }); + return nextChild; + }; + ArrayChild.prototype.findNextExactChild = function (target, selected, range) { + if (range === void 0) { range = this.toTargetGroups(); } + // [[1, 2]] => group([1, 2]) exact + // [[[1, 2], 3]] => group([1, 2]) + var nextChild = this.findNextChild(target, range, true); + if (!nextChild) { + return null; + } + if (nextChild.compare(selected, -1)) { + return nextChild; + } + return null; + }; + /** + * Finds a group that does not overlap within the range and includes the target. + */ + ArrayChild.prototype.findPureChild = function (target, range) { + var _this = this; + var nextGroupChild = null; + var childSelected = range.filter(function (element) { return _this.has(element); }); + if (!childSelected.length) { + return this; + } + this.value.some(function (nextChild) { + if (nextChild.type !== "single" && nextChild.has(target)) { + nextGroupChild = nextChild.findPureChild(target, childSelected); + if (nextGroupChild) { + return true; + } + } + }); + return nextGroupChild; + }; + ArrayChild.prototype.findNextPureChild = function (target, range) { + var nextChild = this.findNextChild(target); + if (nextChild) { + return nextChild.findPureChild(target, range); + } + return null; + }; + ArrayChild.prototype.getSingleChild = function () { + var _a; + var groupElement = this.groupElement; + if (groupElement) { + var singleChild = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.value.find(function (t) { return t.value === groupElement; }); + if (singleChild) { + return singleChild; + } + } + return null; + }; + ArrayChild.prototype.toTargetGroups = function () { + return this.value.map(function (child) { + if (child.type === "single") { + return child.value; + } + else { + return child.toTargetGroups(); + } + }); + }; + ArrayChild.prototype.findArrayChild = function (targets) { + var value = this.value; + var result = false; + if (this.type !== "root") { + result = value.every(function (child) { + if (child.type === "single") { + return targets.some(function (target) { return child.value === target; }); + } + else { + return targets.some(function (target) { + return utils.isArray(target) && child.findArrayChild(target); + }); + } + }); + // result = targets.every(target => { + // if (isArray(target)) { + // return value.some(child => { + // return child.type === "group" && child.findArrayChild(target); + // }); + // } else { + // return map.get(target); + // } + // }); + } + if (result && targets.length === value.length) { + return this; + } + else { + var childResult_1 = null; + value.some(function (child) { + if (child.type === "group") { + childResult_1 = child.findArrayChild(targets); + return childResult_1; + } + }); + return childResult_1; + } + }; + ArrayChild.prototype.groupByPerfect = function (selected) { + return this.value.filter(function (child) { + if (child.type !== "single") { + return child.compare(selected, -1); + } + return selected.indexOf(child.value) > -1; + }).map(function (child) { + if (child.type !== "single") { + var singleChild = child.getSingleChild(); + if (singleChild) { + return singleChild; + } + } + return child; + }); + }; + ArrayChild.prototype.add = function (targets) { + var _this = this; + var _a = this, value = _a.value, map = _a.map; + targets.forEach(function (child) { + if ("groupId" in child) { + var group = new ArrayChild(_this); + group.id = child.groupId; + value.push(group); + group.add(child.children); + } + else if (utils.isArray(child)) { + var group = new ArrayChild(_this); + value.push(group); + group.add(child); + } + else { + var element = "current" in child ? child.current : child; + var single = new SingleChild(_this, element); + value.push(single); + map.set(element, single); + } + }); + value.forEach(function (child) { + if (child.type === "single") { + map.set(child.value, child); + } + else { + child.map.forEach(function (nextChild, element) { + map.set(element, nextChild); + }); + } + }); + value.forEach(function (child) { + if (child.type !== "single") { + return; + } + // single + var singleElement = child.value; + var groupChild = value.find(function (child2) { + if (child2.type === "single") { + return; + } + var firstElement = __spreadArray([], __read(child2.map.keys()), false)[0]; + if (!firstElement) { + return; + } + return singleElement.contains(firstElement); + }); + child.isGroupElement = !!groupChild; + if (groupChild) { + groupChild.groupElement = child.value; + } + }); + return parent; + }; + return ArrayChild; +}(Child)); + +function toTargetList(raw) { + function targets(childs) { + if (childs === void 0) { childs = []; } + var arr = []; + childs.forEach(function (child) { + if (child.type === "single") { + arr.push(child.value); + } + else { + arr.push(targets(child.value)); + } + }); + return arr; + } + return { + raw: function () { return raw; }, + targets: function () { + return targets(this.raw()); + }, + flatten: function () { + return utils.deepFlat(this.targets()); + }, + }; +} +var GroupManager = /*#__PURE__*/ (function (_super) { + __extends(GroupManager, _super); + function GroupManager(targetGroups, targets) { + var _this = _super.call(this) || this; + _this.type = "root"; + _this._targets = []; + _this.set(targetGroups, targets); + return _this; + } + GroupManager.prototype.set = function (targetGroups, targets) { + var _this = this; + if (targets === void 0) { targets = []; } + this.map = new Map(); + this.value = []; + var map = this.map; + var value = this.value; + this.add(targetGroups); + targets.forEach(function (target) { + if (map.has(target)) { + return; + } + var single = new SingleChild(_this, target); + single.depth = 1; + value.push(single); + map.set(target, single); + }); + this._targets = targets; + }; + GroupManager.prototype.selectSubChilds = function (targets, target) { + var root = this; + var nextChild = root.findNextChild(target, targets, false); + var targetChild = root.map.get(target); + var nextChilds = []; + if (nextChild) { + nextChilds = [nextChild]; + } + else if (targetChild) { + nextChilds = [targetChild]; + } + else { + nextChilds = []; + } + return toTargetList(nextChilds); + }; + GroupManager.prototype.selectSingleChilds = function (targets, added, removed) { + var nextTargets = __spreadArray([], __read(targets), false); + // group can't be added, removed. + removed.forEach(function (element) { + var index = nextTargets.indexOf(element); + if (index > -1) { + nextTargets.splice(index, 1); + } + }); + // Targets can be added one by one + added.forEach(function (element) { + nextTargets.push(element); + }); + return toTargetList(this.toChilds(nextTargets)); + }; + GroupManager.prototype.selectCompletedChilds = function (targets, added, removed, continueSelect) { + var _this = this; + var nextTargets = __spreadArray([], __read(targets), false); + var startSelected = utils.deepFlat(nextTargets); + // group can be added, removed. + removed.forEach(function (element) { + // Single Target + var index = nextTargets.indexOf(element); + if (index > -1) { + // single target or group + nextTargets.splice(index, 1); + return; + } + // Group Target + var removedChild = continueSelect + // Finds the nearest child for element and nextTargets. + ? _this.findNextChild(element, nextTargets) + // Find the nearest exact child for element, all removed and nextTargets. + : _this.findNextExactChild(element, removed, nextTargets); + if (removedChild) { + var groupIndex = nextTargets.findIndex(function (target) { + return utils.isArray(target) && removedChild.compare(target); + }); + if (groupIndex > -1) { + nextTargets.splice(groupIndex, 1); + } + } + }); + added.forEach(function (element) { + var parentGroup = _this._findParentGroup(element, startSelected); + var nextChild = parentGroup.findContainedChild(element); + if ((nextChild === null || nextChild === void 0 ? void 0 : nextChild.type) === "group") { + var singleChild = nextChild.getSingleChild(); + if (singleChild) { + nextTargets.push(singleChild.value); + } + else { + nextTargets.push(nextChild.toTargetGroups()); + } + return; + } + nextTargets.push(element); + }); + return toTargetList(this.toChilds(nextTargets)); + }; + GroupManager.prototype.selectSameDepthChilds = function (targets, added, removed, continueSelect) { + var nextTargets = __spreadArray([], __read(targets), false); + var commonParent = this.findCommonParent(nextTargets); + removed.forEach(function (element) { + // Single Target + var index = nextTargets.indexOf(element); + if (index > -1) { + // single target or group + nextTargets.splice(index, 1); + return; + } + var removedChild = continueSelect + // Find the nearest exact child for element, all removed and nextTargets. + ? commonParent.findNextExactChild(element, removed, nextTargets) + // Finds the nearest child for element and nextTargets. + : commonParent.findNextChild(element, nextTargets, true); + if (removedChild) { + var groupIndex = nextTargets.findIndex(function (target) { + return utils.isArray(target) && removedChild.compare(target); + }); + if (groupIndex > -1) { + nextTargets.splice(groupIndex, 1); + } + } + }); + var addedChildren = commonParent.groupByPerfect(added); + addedChildren.forEach(function (child) { + if (child.type === "single") { + nextTargets.push(child.value); + } + else { + var groupIndex = nextTargets.findIndex(function (target) { + return utils.isArray(target) && child.compare(target, 1); + }); + if (groupIndex > -1) { + nextTargets.splice(groupIndex, 1); + } + nextTargets.push(child.toTargetGroups()); + } + }); + return toTargetList(this.toChilds(nextTargets)); + }; + GroupManager.prototype.toChilds = function (targets) { + var _this = this; + var childs = []; + targets.forEach(function (target) { + if (utils.isArray(target)) { + var arrayChild = _this.findArrayChild(target); + if (arrayChild) { + var singleChild = arrayChild.getSingleChild(); + if (singleChild) { + return singleChild; + } + childs.push(arrayChild); + } + } + else { + var single = _this.map.get(target); + if (single) { + childs.push(single); + } + else { + childs.push(new SingleChild(_this, target)); + } + } + }); + return childs; + }; + GroupManager.prototype.findChild = function (element, isAuto) { + var value = this.map.get(element); + if (isAuto) { + return value || new SingleChild(this, element); + } + return value; + }; + GroupManager.prototype.findArrayChildById = function (id) { + var value = null; + this.value.some(function find(child) { + if (child.type !== "single") { + if (child.id === id) { + value = child; + return true; + } + else { + return child.value.some(find); + } + } + }); + return value; + }; + GroupManager.prototype.group = function (targets, flatten) { + var _this = this; + var commonParent = this.findCommonParent(targets); + var groupChilds = targets.map(function (target) { + if (utils.isArray(target)) { + return _this.findArrayChild(target); + } + return _this.findChild(target); + }); + var isGroupable = groupChilds.every(function (child) { return (child === null || child === void 0 ? void 0 : child.parent) === commonParent; }); + if (!isGroupable) { + return null; + } + var group = new ArrayChild(commonParent); + var nextChilds = commonParent.value.filter(function (target) { return groupChilds.indexOf(target) === -1; }); + if (!nextChilds.length) { + return null; + } + nextChilds.unshift(group); + group.add(flatten ? utils.deepFlat(targets) : targets); + commonParent.value = nextChilds; + this.set(this.toTargetGroups(), this._targets); + return group.toTargetGroups(); + }; + GroupManager.prototype.ungroup = function (targets) { + var _this = this; + if (targets.length === 1 && utils.isArray(targets[0])) { + targets = targets[0]; + } + var commonParent = this.findCommonParent(targets); + var groupChilds = targets.map(function (target) { + if (utils.isArray(target)) { + return _this.findArrayChild(target); + } + return _this.findChild(target); + }); + if (commonParent.groupElement) { + return null; + } + // all children is targets + var isGroupable = commonParent.value.every(function (child) { return groupChilds.indexOf(child) > -1; }); + if (!isGroupable || commonParent === this) { + // has no group + return null; + } + var parent = commonParent.parent; + if (!parent) { + return null; + } + var nextChilds = parent.value.filter(function (target) { return target !== commonParent; }); + nextChilds.push.apply(nextChilds, __spreadArray([], __read(commonParent.value), false)); + parent.value = nextChilds; + this.set(this.toTargetGroups(), this._targets); + return commonParent.toTargetGroups(); + }; + GroupManager.prototype._findParentGroup = function (element, range) { + if (!range.length) { + return this; + } + var single = this.map.get(element); + if (!single) { + return this; + } + var parent = single.parent; + while (parent) { + if (range.some(function (element) { return parent.contains(element); })) { + return parent; + } + parent = parent.parent; + } + return this; + }; + return GroupManager; +}(ArrayChild)); + +var modules = { + __proto__: null, + ArrayChild: ArrayChild, + Child: Child, + GroupManager: GroupManager, + SingleChild: SingleChild, + toTargetList: toTargetList +}; + +module.exports = modules; + +exports.ArrayChild = ArrayChild; +exports.Child = Child; +exports.GroupManager = GroupManager; +exports.SingleChild = SingleChild; +exports.default = modules; +exports.toTargetList = toTargetList; +//# sourceMappingURL=helper.cjs.js.map diff --git a/helper/release/0.52.0/dist/helper.cjs.js.map b/helper/release/0.52.0/dist/helper.cjs.js.map new file mode 100644 index 000000000..f6417152e --- /dev/null +++ b/helper/release/0.52.0/dist/helper.cjs.js.map @@ -0,0 +1 @@ +{"version":3,"file":"helper.cjs.js","sources":["../src/groups.ts","../src/GroupManager.ts","../src/index.cjs.ts"],"sourcesContent":["import { isArray, deepFlat, find } from \"@daybrush/utils\";\nimport { GroupChild, TargetGroupsObject, TargetGroupsType } from \"./types\";\n\nexport class Child {\n public type: \"group\" | \"root\" | \"single\" = \"single\";\n public depth = 0;\n protected _scope: string[] = [];\n constructor(public parent?: ArrayChild) {\n if (parent) {\n this.depth = parent.depth + 1;\n }\n }\n\n public get scope(): string[] {\n const parent = this.parent;\n\n if (!parent || parent.type === \"root\") {\n return [];\n }\n return [...parent.scope, parent.id];\n }\n}\n\nexport class SingleChild extends Child {\n public type = \"single\" as const;\n public isGroupElement = false;\n constructor(parent: ArrayChild, public value: HTMLElement | SVGElement) {\n super(parent);\n }\n}\n\n\nexport class ArrayChild extends Child {\n public type: \"group\" | \"root\" = \"group\";\n public value: GroupChild[] = [];\n public id = \"\";\n public groupElement?: HTMLElement | SVGElement | null = null;\n public map: Map = new Map();\n\n public compare(groups: TargetGroupsType, checker: -1 | 0 | 1 = 0) {\n const elements = deepFlat(groups);\n const map = this.map;\n const elementsLength = elements.length;\n const mapSize = map.size;\n const sizeDiff = mapSize - elementsLength;\n\n // 1 this > groups\n // 0 this = groups\n // -1 this < groups\n const count = elements.filter(element => map.has(element)).length;\n\n if ((checker > 0 && sizeDiff >= 0) || (checker === 0 && sizeDiff === 0)) {\n return elementsLength === count;\n } else if (checker < 0 && sizeDiff <= 0) {\n return mapSize === count;\n }\n return false;\n }\n public has(target: HTMLElement | SVGElement) {\n return this.map.has(target);\n }\n public contains(element: HTMLElement | SVGElement): boolean {\n if (this.has(element)) {\n return true;\n }\n return this.value.some(child => {\n if (child.type === \"group\") {\n return child.contains(element);\n } else {\n return false;\n }\n });\n }\n public findContainedChild(element: HTMLElement | SVGElement) {\n return find(this.value, child => {\n if (child.type === \"single\") {\n return child.value === element;\n } else {\n return child.contains(element);\n }\n });\n }\n /**\n * Exact group containing targets\n */\n public findExactChild(target: TargetGroupsType[0]): GroupChild | undefined {\n const map = this.map;\n\n if (!isArray(target)) {\n return map.get(target);\n }\n const flatted = deepFlat(target);\n const length = flatted.length;\n const single = map.get(flatted[0]);\n\n if (!single) {\n return;\n }\n\n let parent: ArrayChild | undefined = single.parent;\n\n while (parent) {\n if (parent.map.size >= length) {\n return parent;\n }\n parent = parent.parent;\n }\n return;\n }\n public findCommonParent(targets: TargetGroupsType): ArrayChild {\n let depth = Infinity;\n let childs = targets.map(target => this.findExactChild(target));\n\n childs.forEach(child => {\n if (!child) {\n return;\n }\n depth = Math.min(child.depth, depth);\n });\n\n while (depth) {\n --depth;\n childs = childs.map(child => {\n let parent: GroupChild | undefined = child;\n\n while (parent && parent.depth !== depth) {\n parent = parent.parent;\n }\n\n return parent;\n });\n const firstChild = childs.find(child => child);\n\n if (!firstChild) {\n return this;\n }\n if (childs.every(child => !child || child === firstChild)) {\n break;\n }\n }\n const commonParent = childs.find(child => child) as ArrayChild;\n\n return commonParent || this;\n }\n public findNextChild(\n target: HTMLElement | SVGElement,\n range: TargetGroupsType = this.toTargetGroups(),\n isExact = true,\n ): ArrayChild | null {\n let nextChild: ArrayChild | null = null;\n\n const length = range.length;\n\n range.some(child => {\n if (!isExact && length === 1 && isArray(child)) {\n nextChild = this.findNextChild(target, child);\n return nextChild;\n }\n\n\n const nextGroupChild = this.findExactChild(child);\n\n if (!nextGroupChild) {\n return;\n }\n\n if (\"map\" in nextGroupChild) {\n if (nextGroupChild.map.has(target)) {\n nextChild = nextGroupChild;\n return true;\n }\n }\n });\n\n return nextChild;\n }\n public findNextExactChild(\n target: HTMLElement | SVGElement,\n selected: Array,\n range: TargetGroupsType = this.toTargetGroups(),\n ): ArrayChild | null {\n // [[1, 2]] => group([1, 2]) exact\n // [[[1, 2], 3]] => group([1, 2])\n const nextChild = this.findNextChild(target, range, true);\n\n if (!nextChild) {\n return null;\n }\n\n if (nextChild.compare(selected, -1)) {\n return nextChild;\n }\n return null;\n }\n /**\n * Finds a group that does not overlap within the range and includes the target.\n */\n public findPureChild(\n target: HTMLElement | SVGElement,\n range: Array,\n ): ArrayChild | null {\n let nextGroupChild: ArrayChild | null = null;\n\n const childSelected = range.filter(element => this.has(element));\n\n if (!childSelected.length) {\n return this;\n }\n\n this.value.some(nextChild => {\n if (nextChild.type !== \"single\" && nextChild.has(target)) {\n nextGroupChild = nextChild.findPureChild(target, childSelected);\n\n if (nextGroupChild) {\n return true;\n }\n }\n });\n\n return nextGroupChild;\n }\n public findNextPureChild(\n target: HTMLElement | SVGElement,\n range: Array,\n ): ArrayChild | null {\n const nextChild = this.findNextChild(target);\n\n if (nextChild) {\n return nextChild.findPureChild(target, range);\n }\n return null;\n }\n public getSingleChild(): SingleChild | null {\n const groupElement = this.groupElement;\n\n if (groupElement) {\n const singleChild = this.parent?.value.find(t => t.value === groupElement);\n\n if (singleChild) {\n return singleChild as SingleChild;\n }\n }\n return null;\n }\n public toTargetGroups(): TargetGroupsType {\n return this.value.map(child => {\n if (child.type === \"single\") {\n return child.value;\n } else {\n return child.toTargetGroups();\n }\n });\n }\n public findArrayChild(targets: TargetGroupsType): ArrayChild | null {\n const {\n value,\n } = this;\n\n let result = false;\n\n if (this.type !== \"root\") {\n result = value.every(child => {\n if (child.type === \"single\") {\n return targets.some(target => child.value === target);\n } else {\n return targets.some(target => {\n return isArray(target) && child.findArrayChild(target);\n });\n }\n });\n // result = targets.every(target => {\n // if (isArray(target)) {\n // return value.some(child => {\n // return child.type === \"group\" && child.findArrayChild(target);\n // });\n // } else {\n // return map.get(target);\n // }\n // });\n }\n\n if (result && targets.length === value.length) {\n return this;\n } else {\n let childResult: ArrayChild | null = null;\n\n value.some(child => {\n if (child.type === \"group\") {\n childResult = child.findArrayChild(targets);\n\n return childResult;\n }\n });\n\n return childResult;\n }\n }\n public groupByPerfect(selected: Array) {\n return this.value.filter(child => {\n if (child.type !== \"single\") {\n return child.compare(selected, -1);\n }\n return selected.indexOf(child.value) > -1;\n }).map(child => {\n if (child.type !== \"single\") {\n const singleChild = child.getSingleChild();\n\n if (singleChild) {\n return singleChild;\n }\n }\n return child;\n });\n }\n public add(targets: TargetGroupsObject) {\n const {\n value,\n map,\n } = this;\n\n targets.forEach(child => {\n if (\"groupId\" in child) {\n const group = new ArrayChild(this);\n\n group.id = child.groupId;\n value.push(group);\n group.add(child.children);\n } else if (isArray(child)) {\n const group = new ArrayChild(this);\n\n value.push(group);\n group.add(child);\n } else {\n const element = \"current\" in child ? child.current : child;\n const single = new SingleChild(this, element!);\n\n value.push(single);\n map.set(element!, single);\n }\n });\n\n value.forEach(child => {\n if (child.type === \"single\") {\n map.set(child.value, child);\n } else {\n child.map.forEach((nextChild, element) => {\n map.set(element, nextChild);\n });\n }\n });\n\n value.forEach(child => {\n if (child.type !== \"single\") {\n return;\n }\n // single\n const singleElement = child.value;\n const groupChild = value.find(child2 => {\n if (child2.type === \"single\") {\n return;\n }\n const firstElement = [...child2.map.keys()][0];\n\n if (!firstElement) {\n return;\n }\n\n return singleElement.contains(firstElement);\n });\n\n (child as SingleChild).isGroupElement = !!groupChild;\n\n if (groupChild) {\n (groupChild as ArrayChild).groupElement = child.value;\n }\n });\n return parent;\n }\n}\n","/* eslint-disable no-cond-assign */\nimport { deepFlat, isArray } from \"@daybrush/utils\";\nimport { ArrayChild, SingleChild } from \"./groups\";\nimport { GroupChild, TargetGroupsObject, TargetGroupsType, TargetList } from \"./types\";\n\n\nexport function toTargetList(raw: GroupChild[]): TargetList {\n function targets(childs: GroupChild[] = []) {\n const arr: TargetGroupsType = [];\n\n childs.forEach((child) => {\n if (child.type === \"single\") {\n arr.push(child.value);\n } else {\n arr.push(targets(child.value));\n }\n });\n\n return arr;\n }\n\n return {\n raw: () => raw,\n targets() {\n return targets(this.raw());\n },\n flatten() {\n return deepFlat(this.targets());\n },\n };\n}\n\nexport class GroupManager extends ArrayChild {\n public type = \"root\" as const;\n private _targets: Array = [];\n\n constructor(\n targetGroups: TargetGroupsType,\n targets?: Array,\n ) {\n super();\n this.set(targetGroups, targets);\n }\n public set(\n targetGroups: TargetGroupsObject,\n targets: Array = [],\n ) {\n this.map = new Map();\n this.value = [];\n\n const map = this.map;\n const value = this.value;\n\n this.add(targetGroups);\n targets.forEach(target => {\n if (map.has(target)) {\n return;\n }\n const single = new SingleChild(this, target);\n\n single.depth = 1;\n value.push(single);\n map.set(target, single);\n });\n this._targets = targets;\n }\n public selectSubChilds(targets: TargetGroupsType, target: HTMLElement | SVGElement) {\n const root = this;\n const nextChild = root.findNextChild(target, targets, false);\n const targetChild = root.map.get(target);\n\n let nextChilds: GroupChild[] = [];\n\n if (nextChild) {\n nextChilds = [nextChild];\n } else if (targetChild) {\n nextChilds = [targetChild];\n } else {\n nextChilds = [];\n }\n\n return toTargetList(nextChilds);\n }\n public selectSingleChilds(\n targets: TargetGroupsType,\n added: Array,\n removed: Array,\n ) {\n const nextTargets = [...targets];\n\n // group can't be added, removed.\n removed.forEach(element => {\n const index = nextTargets.indexOf(element);\n\n if (index > -1) {\n nextTargets.splice(index, 1);\n }\n });\n\n // Targets can be added one by one\n added.forEach(element => {\n nextTargets.push(element);\n });\n\n return toTargetList(this.toChilds(nextTargets));\n }\n public selectCompletedChilds(\n targets: TargetGroupsType,\n added: Array,\n removed: Array,\n continueSelect?: boolean,\n ) {\n const nextTargets = [...targets];\n const startSelected = deepFlat(nextTargets);\n\n // group can be added, removed.\n removed.forEach(element => {\n // Single Target\n const index = nextTargets.indexOf(element);\n\n if (index > -1) {\n // single target or group\n nextTargets.splice(index, 1);\n return;\n }\n // Group Target\n const removedChild = continueSelect\n // Finds the nearest child for element and nextTargets.\n ? this.findNextChild(element, nextTargets)\n // Find the nearest exact child for element, all removed and nextTargets.\n : this.findNextExactChild(element, removed, nextTargets);\n\n if (removedChild) {\n const groupIndex = nextTargets.findIndex(target => {\n return isArray(target) && removedChild.compare(target);\n });\n\n if (groupIndex > -1) {\n nextTargets.splice(groupIndex, 1);\n }\n }\n });\n\n added.forEach(element => {\n const parentGroup = this._findParentGroup(element, startSelected);\n const nextChild = parentGroup.findContainedChild(element);\n\n if (nextChild?.type === \"group\") {\n const singleChild = nextChild.getSingleChild();\n\n if (singleChild) {\n nextTargets.push(singleChild.value);\n } else {\n nextTargets.push(nextChild.toTargetGroups());\n }\n return;\n }\n nextTargets.push(element);\n });\n return toTargetList(this.toChilds(nextTargets));\n }\n public selectSameDepthChilds(\n targets: TargetGroupsType,\n added: Array,\n removed: Array,\n continueSelect?: boolean,\n ) {\n const nextTargets = [...targets];\n const commonParent = this.findCommonParent(nextTargets);\n\n removed.forEach(element => {\n // Single Target\n const index = nextTargets.indexOf(element);\n\n if (index > -1) {\n // single target or group\n nextTargets.splice(index, 1);\n return;\n }\n const removedChild = continueSelect\n // Find the nearest exact child for element, all removed and nextTargets.\n ? commonParent.findNextExactChild(element, removed, nextTargets)\n // Finds the nearest child for element and nextTargets.\n : commonParent.findNextChild(element, nextTargets, true);\n\n if (removedChild) {\n const groupIndex = nextTargets.findIndex(target => {\n return isArray(target) && removedChild.compare(target);\n });\n\n if (groupIndex > -1) {\n nextTargets.splice(groupIndex, 1);\n }\n }\n });\n const addedChildren = commonParent.groupByPerfect(added);\n\n addedChildren.forEach(child => {\n if (child.type === \"single\") {\n nextTargets.push(child.value);\n } else {\n const groupIndex = nextTargets.findIndex(target => {\n return isArray(target) && child.compare(target, 1);\n });\n\n if (groupIndex > -1) {\n nextTargets.splice(groupIndex, 1);\n }\n nextTargets.push(child.toTargetGroups());\n }\n });\n return toTargetList(this.toChilds(nextTargets));\n }\n public toChilds(targets: TargetGroupsType): GroupChild[] {\n const childs: GroupChild[] = [];\n\n targets.forEach(target => {\n if (isArray(target)) {\n const arrayChild = this.findArrayChild(target);\n\n if (arrayChild) {\n const singleChild = arrayChild.getSingleChild();\n\n if (singleChild) {\n return singleChild;\n }\n childs.push(arrayChild);\n }\n } else {\n const single = this.map.get(target);\n\n if (single) {\n childs.push(single);\n } else {\n childs.push(new SingleChild(this, target));\n }\n }\n });\n\n return childs;\n }\n public findChild(element: HTMLElement | SVGElement, isAuto: true): SingleChild | ArrayChild;\n public findChild(\n element: HTMLElement | SVGElement,\n isAuto?: boolean,\n ): SingleChild | ArrayChild | undefined;\n public findChild(\n element: HTMLElement | SVGElement,\n isAuto?: boolean,\n ): SingleChild | ArrayChild | undefined {\n const value = this.map.get(element);\n\n if (isAuto) {\n return value || new SingleChild(this, element);\n }\n return value;\n }\n public findArrayChildById(id: string): ArrayChild | null {\n let value: ArrayChild | null = null;\n\n this.value.some(function find(child: GroupChild) {\n if (child.type !== \"single\") {\n if (child.id === id) {\n value = child;\n return true;\n } else {\n return child.value.some(find);\n }\n }\n });\n\n return value;\n }\n public group(targets: TargetGroupsType, flatten?: boolean): TargetGroupsType | null {\n const commonParent = this.findCommonParent(targets);\n const groupChilds = targets.map(target => {\n if (isArray(target)) {\n return this.findArrayChild(target);\n }\n return this.findChild(target);\n });\n const isGroupable = groupChilds.every(child => child?.parent === commonParent);\n\n if (!isGroupable) {\n return null;\n }\n const group = new ArrayChild(commonParent);\n const nextChilds = commonParent.value.filter(target => groupChilds.indexOf(target) === -1);\n\n if (!nextChilds.length) {\n return null;\n }\n nextChilds.unshift(group);\n group.add(flatten ? deepFlat(targets) : targets);\n commonParent.value = nextChilds;\n\n this.set(this.toTargetGroups(), this._targets);\n\n return group.toTargetGroups();\n }\n public ungroup(targets: TargetGroupsType) {\n if (targets.length === 1 && isArray(targets[0])) {\n targets = targets[0];\n }\n const commonParent = this.findCommonParent(targets);\n const groupChilds = targets.map(target => {\n if (isArray(target)) {\n return this.findArrayChild(target);\n }\n return this.findChild(target);\n });\n\n if (commonParent.groupElement) {\n return null;\n }\n\n // all children is targets\n const isGroupable = commonParent.value.every(child => groupChilds.indexOf(child) > -1);\n\n if (!isGroupable || commonParent === this) {\n // has no group\n return null;\n }\n\n const parent = commonParent.parent;\n\n if (!parent) {\n return null;\n }\n const nextChilds = parent.value.filter(target => target !== commonParent);\n\n nextChilds.push(...commonParent.value);\n parent.value = nextChilds;\n\n this.set(this.toTargetGroups(), this._targets);\n return commonParent.toTargetGroups();\n }\n protected _findParentGroup(\n element: HTMLElement | SVGElement,\n range: Array,\n ) {\n if (!range.length) {\n return this;\n }\n const single = this.map.get(element);\n\n if (!single) {\n return this;\n }\n let parent: ArrayChild | undefined = single.parent;\n\n while (parent) {\n if (range.some(element => parent!.contains(element))) {\n return parent;\n }\n parent = parent.parent;\n }\n return this;\n }\n}\n","import * as modules from \"./index\";\n\n\nmodule.exports = modules;\nexport * from \"./index\";\nexport default modules;\n"],"names":["deepFlat","find","isArray"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAA,KAAA,kBAAA,YAAA;AAII,IAAA,SAAA,KAAA,CAAmB,MAAmB,EAAA;QAAnB,IAAM,CAAA,MAAA,GAAN,MAAM,CAAa;QAH/B,IAAI,CAAA,IAAA,GAAgC,QAAQ,CAAC;QAC7C,IAAK,CAAA,KAAA,GAAG,CAAC,CA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UAAA,OAAO,EAAI,EAAA,OAAA,MAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAzB,EAAyB,CAAC,EAAE;AAClD,gBAAA,OAAO,MAAM,CAAC;AACjB,aAAA;AACD,YAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AAC1B,SAAA;AACD,QAAA,OAAO,IAAI,CAAC;KACf,CAAA;IACL,OAAC,YAAA,CAAA;AAAD,CAvUA,CAAkC,UAAU,CAuU3C;;;;;;;;;;;ACpWD,MAAM,CAAC,OAAO,GAAG,OAAO;;;;;;;;;"} \ No newline at end of file diff --git a/helper/release/0.52.0/dist/helper.esm.js b/helper/release/0.52.0/dist/helper.esm.js new file mode 100644 index 000000000..6e4f3adcd --- /dev/null +++ b/helper/release/0.52.0/dist/helper.esm.js @@ -0,0 +1,711 @@ +/* +Copyright (c) Daybrush +name: @moveable/helper +license: MIT +author: Daybrush +repository: https://github.com/daybrush/moveable/blob/master/packages/helper +version: 0.1.3 +*/ +import { deepFlat, find, isArray } from '@daybrush/utils'; + +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} + +var Child = /*#__PURE__*/ (function () { + function Child(parent) { + this.parent = parent; + this.type = "single"; + this.depth = 0; + this._scope = []; + if (parent) { + this.depth = parent.depth + 1; + } + } + Object.defineProperty(Child.prototype, "scope", { + get: function () { + var parent = this.parent; + if (!parent || parent.type === "root") { + return []; + } + return __spreadArray(__spreadArray([], __read(parent.scope), false), [parent.id], false); + }, + enumerable: false, + configurable: true + }); + return Child; +}()); +var SingleChild = /*#__PURE__*/ (function (_super) { + __extends(SingleChild, _super); + function SingleChild(parent, value) { + var _this = _super.call(this, parent) || this; + _this.value = value; + _this.type = "single"; + _this.isGroupElement = false; + return _this; + } + return SingleChild; +}(Child)); +var ArrayChild = /*#__PURE__*/ (function (_super) { + __extends(ArrayChild, _super); + function ArrayChild() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.type = "group"; + _this.value = []; + _this.id = ""; + _this.groupElement = null; + _this.map = new Map(); + return _this; + } + ArrayChild.prototype.compare = function (groups, checker) { + if (checker === void 0) { checker = 0; } + var elements = deepFlat(groups); + var map = this.map; + var elementsLength = elements.length; + var mapSize = map.size; + var sizeDiff = mapSize - elementsLength; + // 1 this > groups + // 0 this = groups + // -1 this < groups + var count = elements.filter(function (element) { return map.has(element); }).length; + if ((checker > 0 && sizeDiff >= 0) || (checker === 0 && sizeDiff === 0)) { + return elementsLength === count; + } + else if (checker < 0 && sizeDiff <= 0) { + return mapSize === count; + } + return false; + }; + ArrayChild.prototype.has = function (target) { + return this.map.has(target); + }; + ArrayChild.prototype.contains = function (element) { + if (this.has(element)) { + return true; + } + return this.value.some(function (child) { + if (child.type === "group") { + return child.contains(element); + } + else { + return false; + } + }); + }; + ArrayChild.prototype.findContainedChild = function (element) { + return find(this.value, function (child) { + if (child.type === "single") { + return child.value === element; + } + else { + return child.contains(element); + } + }); + }; + /** + * Exact group containing targets + */ + ArrayChild.prototype.findExactChild = function (target) { + var map = this.map; + if (!isArray(target)) { + return map.get(target); + } + var flatted = deepFlat(target); + var length = flatted.length; + var single = map.get(flatted[0]); + if (!single) { + return; + } + var parent = single.parent; + while (parent) { + if (parent.map.size >= length) { + return parent; + } + parent = parent.parent; + } + return; + }; + ArrayChild.prototype.findCommonParent = function (targets) { + var _this = this; + var depth = Infinity; + var childs = targets.map(function (target) { return _this.findExactChild(target); }); + childs.forEach(function (child) { + if (!child) { + return; + } + depth = Math.min(child.depth, depth); + }); + var _loop_1 = function () { + --depth; + childs = childs.map(function (child) { + var parent = child; + while (parent && parent.depth !== depth) { + parent = parent.parent; + } + return parent; + }); + var firstChild = childs.find(function (child) { return child; }); + if (!firstChild) { + return { value: this_1 }; + } + if (childs.every(function (child) { return !child || child === firstChild; })) { + return "break"; + } + }; + var this_1 = this; + while (depth) { + var state_1 = _loop_1(); + if (typeof state_1 === "object") + return state_1.value; + if (state_1 === "break") + break; + } + var commonParent = childs.find(function (child) { return child; }); + return commonParent || this; + }; + ArrayChild.prototype.findNextChild = function (target, range, isExact) { + var _this = this; + if (range === void 0) { range = this.toTargetGroups(); } + if (isExact === void 0) { isExact = true; } + var nextChild = null; + var length = range.length; + range.some(function (child) { + if (!isExact && length === 1 && isArray(child)) { + nextChild = _this.findNextChild(target, child); + return nextChild; + } + var nextGroupChild = _this.findExactChild(child); + if (!nextGroupChild) { + return; + } + if ("map" in nextGroupChild) { + if (nextGroupChild.map.has(target)) { + nextChild = nextGroupChild; + return true; + } + } + }); + return nextChild; + }; + ArrayChild.prototype.findNextExactChild = function (target, selected, range) { + if (range === void 0) { range = this.toTargetGroups(); } + // [[1, 2]] => group([1, 2]) exact + // [[[1, 2], 3]] => group([1, 2]) + var nextChild = this.findNextChild(target, range, true); + if (!nextChild) { + return null; + } + if (nextChild.compare(selected, -1)) { + return nextChild; + } + return null; + }; + /** + * Finds a group that does not overlap within the range and includes the target. + */ + ArrayChild.prototype.findPureChild = function (target, range) { + var _this = this; + var nextGroupChild = null; + var childSelected = range.filter(function (element) { return _this.has(element); }); + if (!childSelected.length) { + return this; + } + this.value.some(function (nextChild) { + if (nextChild.type !== "single" && nextChild.has(target)) { + nextGroupChild = nextChild.findPureChild(target, childSelected); + if (nextGroupChild) { + return true; + } + } + }); + return nextGroupChild; + }; + ArrayChild.prototype.findNextPureChild = function (target, range) { + var nextChild = this.findNextChild(target); + if (nextChild) { + return nextChild.findPureChild(target, range); + } + return null; + }; + ArrayChild.prototype.getSingleChild = function () { + var _a; + var groupElement = this.groupElement; + if (groupElement) { + var singleChild = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.value.find(function (t) { return t.value === groupElement; }); + if (singleChild) { + return singleChild; + } + } + return null; + }; + ArrayChild.prototype.toTargetGroups = function () { + return this.value.map(function (child) { + if (child.type === "single") { + return child.value; + } + else { + return child.toTargetGroups(); + } + }); + }; + ArrayChild.prototype.findArrayChild = function (targets) { + var value = this.value; + var result = false; + if (this.type !== "root") { + result = value.every(function (child) { + if (child.type === "single") { + return targets.some(function (target) { return child.value === target; }); + } + else { + return targets.some(function (target) { + return isArray(target) && child.findArrayChild(target); + }); + } + }); + // result = targets.every(target => { + // if (isArray(target)) { + // return value.some(child => { + // return child.type === "group" && child.findArrayChild(target); + // }); + // } else { + // return map.get(target); + // } + // }); + } + if (result && targets.length === value.length) { + return this; + } + else { + var childResult_1 = null; + value.some(function (child) { + if (child.type === "group") { + childResult_1 = child.findArrayChild(targets); + return childResult_1; + } + }); + return childResult_1; + } + }; + ArrayChild.prototype.groupByPerfect = function (selected) { + return this.value.filter(function (child) { + if (child.type !== "single") { + return child.compare(selected, -1); + } + return selected.indexOf(child.value) > -1; + }).map(function (child) { + if (child.type !== "single") { + var singleChild = child.getSingleChild(); + if (singleChild) { + return singleChild; + } + } + return child; + }); + }; + ArrayChild.prototype.add = function (targets) { + var _this = this; + var _a = this, value = _a.value, map = _a.map; + targets.forEach(function (child) { + if ("groupId" in child) { + var group = new ArrayChild(_this); + group.id = child.groupId; + value.push(group); + group.add(child.children); + } + else if (isArray(child)) { + var group = new ArrayChild(_this); + value.push(group); + group.add(child); + } + else { + var element = "current" in child ? child.current : child; + var single = new SingleChild(_this, element); + value.push(single); + map.set(element, single); + } + }); + value.forEach(function (child) { + if (child.type === "single") { + map.set(child.value, child); + } + else { + child.map.forEach(function (nextChild, element) { + map.set(element, nextChild); + }); + } + }); + value.forEach(function (child) { + if (child.type !== "single") { + return; + } + // single + var singleElement = child.value; + var groupChild = value.find(function (child2) { + if (child2.type === "single") { + return; + } + var firstElement = __spreadArray([], __read(child2.map.keys()), false)[0]; + if (!firstElement) { + return; + } + return singleElement.contains(firstElement); + }); + child.isGroupElement = !!groupChild; + if (groupChild) { + groupChild.groupElement = child.value; + } + }); + return parent; + }; + return ArrayChild; +}(Child)); + +function toTargetList(raw) { + function targets(childs) { + if (childs === void 0) { childs = []; } + var arr = []; + childs.forEach(function (child) { + if (child.type === "single") { + arr.push(child.value); + } + else { + arr.push(targets(child.value)); + } + }); + return arr; + } + return { + raw: function () { return raw; }, + targets: function () { + return targets(this.raw()); + }, + flatten: function () { + return deepFlat(this.targets()); + }, + }; +} +var GroupManager = /*#__PURE__*/ (function (_super) { + __extends(GroupManager, _super); + function GroupManager(targetGroups, targets) { + var _this = _super.call(this) || this; + _this.type = "root"; + _this._targets = []; + _this.set(targetGroups, targets); + return _this; + } + GroupManager.prototype.set = function (targetGroups, targets) { + var _this = this; + if (targets === void 0) { targets = []; } + this.map = new Map(); + this.value = []; + var map = this.map; + var value = this.value; + this.add(targetGroups); + targets.forEach(function (target) { + if (map.has(target)) { + return; + } + var single = new SingleChild(_this, target); + single.depth = 1; + value.push(single); + map.set(target, single); + }); + this._targets = targets; + }; + GroupManager.prototype.selectSubChilds = function (targets, target) { + var root = this; + var nextChild = root.findNextChild(target, targets, false); + var targetChild = root.map.get(target); + var nextChilds = []; + if (nextChild) { + nextChilds = [nextChild]; + } + else if (targetChild) { + nextChilds = [targetChild]; + } + else { + nextChilds = []; + } + return toTargetList(nextChilds); + }; + GroupManager.prototype.selectSingleChilds = function (targets, added, removed) { + var nextTargets = __spreadArray([], __read(targets), false); + // group can't be added, removed. + removed.forEach(function (element) { + var index = nextTargets.indexOf(element); + if (index > -1) { + nextTargets.splice(index, 1); + } + }); + // Targets can be added one by one + added.forEach(function (element) { + nextTargets.push(element); + }); + return toTargetList(this.toChilds(nextTargets)); + }; + GroupManager.prototype.selectCompletedChilds = function (targets, added, removed, continueSelect) { + var _this = this; + var nextTargets = __spreadArray([], __read(targets), false); + var startSelected = deepFlat(nextTargets); + // group can be added, removed. + removed.forEach(function (element) { + // Single Target + var index = nextTargets.indexOf(element); + if (index > -1) { + // single target or group + nextTargets.splice(index, 1); + return; + } + // Group Target + var removedChild = continueSelect + // Finds the nearest child for element and nextTargets. + ? _this.findNextChild(element, nextTargets) + // Find the nearest exact child for element, all removed and nextTargets. + : _this.findNextExactChild(element, removed, nextTargets); + if (removedChild) { + var groupIndex = nextTargets.findIndex(function (target) { + return isArray(target) && removedChild.compare(target); + }); + if (groupIndex > -1) { + nextTargets.splice(groupIndex, 1); + } + } + }); + added.forEach(function (element) { + var parentGroup = _this._findParentGroup(element, startSelected); + var nextChild = parentGroup.findContainedChild(element); + if ((nextChild === null || nextChild === void 0 ? void 0 : nextChild.type) === "group") { + var singleChild = nextChild.getSingleChild(); + if (singleChild) { + nextTargets.push(singleChild.value); + } + else { + nextTargets.push(nextChild.toTargetGroups()); + } + return; + } + nextTargets.push(element); + }); + return toTargetList(this.toChilds(nextTargets)); + }; + GroupManager.prototype.selectSameDepthChilds = function (targets, added, removed, continueSelect) { + var nextTargets = __spreadArray([], __read(targets), false); + var commonParent = this.findCommonParent(nextTargets); + removed.forEach(function (element) { + // Single Target + var index = nextTargets.indexOf(element); + if (index > -1) { + // single target or group + nextTargets.splice(index, 1); + return; + } + var removedChild = continueSelect + // Find the nearest exact child for element, all removed and nextTargets. + ? commonParent.findNextExactChild(element, removed, nextTargets) + // Finds the nearest child for element and nextTargets. + : commonParent.findNextChild(element, nextTargets, true); + if (removedChild) { + var groupIndex = nextTargets.findIndex(function (target) { + return isArray(target) && removedChild.compare(target); + }); + if (groupIndex > -1) { + nextTargets.splice(groupIndex, 1); + } + } + }); + var addedChildren = commonParent.groupByPerfect(added); + addedChildren.forEach(function (child) { + if (child.type === "single") { + nextTargets.push(child.value); + } + else { + var groupIndex = nextTargets.findIndex(function (target) { + return isArray(target) && child.compare(target, 1); + }); + if (groupIndex > -1) { + nextTargets.splice(groupIndex, 1); + } + nextTargets.push(child.toTargetGroups()); + } + }); + return toTargetList(this.toChilds(nextTargets)); + }; + GroupManager.prototype.toChilds = function (targets) { + var _this = this; + var childs = []; + targets.forEach(function (target) { + if (isArray(target)) { + var arrayChild = _this.findArrayChild(target); + if (arrayChild) { + var singleChild = arrayChild.getSingleChild(); + if (singleChild) { + return singleChild; + } + childs.push(arrayChild); + } + } + else { + var single = _this.map.get(target); + if (single) { + childs.push(single); + } + else { + childs.push(new SingleChild(_this, target)); + } + } + }); + return childs; + }; + GroupManager.prototype.findChild = function (element, isAuto) { + var value = this.map.get(element); + if (isAuto) { + return value || new SingleChild(this, element); + } + return value; + }; + GroupManager.prototype.findArrayChildById = function (id) { + var value = null; + this.value.some(function find(child) { + if (child.type !== "single") { + if (child.id === id) { + value = child; + return true; + } + else { + return child.value.some(find); + } + } + }); + return value; + }; + GroupManager.prototype.group = function (targets, flatten) { + var _this = this; + var commonParent = this.findCommonParent(targets); + var groupChilds = targets.map(function (target) { + if (isArray(target)) { + return _this.findArrayChild(target); + } + return _this.findChild(target); + }); + var isGroupable = groupChilds.every(function (child) { return (child === null || child === void 0 ? void 0 : child.parent) === commonParent; }); + if (!isGroupable) { + return null; + } + var group = new ArrayChild(commonParent); + var nextChilds = commonParent.value.filter(function (target) { return groupChilds.indexOf(target) === -1; }); + if (!nextChilds.length) { + return null; + } + nextChilds.unshift(group); + group.add(flatten ? deepFlat(targets) : targets); + commonParent.value = nextChilds; + this.set(this.toTargetGroups(), this._targets); + return group.toTargetGroups(); + }; + GroupManager.prototype.ungroup = function (targets) { + var _this = this; + if (targets.length === 1 && isArray(targets[0])) { + targets = targets[0]; + } + var commonParent = this.findCommonParent(targets); + var groupChilds = targets.map(function (target) { + if (isArray(target)) { + return _this.findArrayChild(target); + } + return _this.findChild(target); + }); + if (commonParent.groupElement) { + return null; + } + // all children is targets + var isGroupable = commonParent.value.every(function (child) { return groupChilds.indexOf(child) > -1; }); + if (!isGroupable || commonParent === this) { + // has no group + return null; + } + var parent = commonParent.parent; + if (!parent) { + return null; + } + var nextChilds = parent.value.filter(function (target) { return target !== commonParent; }); + nextChilds.push.apply(nextChilds, __spreadArray([], __read(commonParent.value), false)); + parent.value = nextChilds; + this.set(this.toTargetGroups(), this._targets); + return commonParent.toTargetGroups(); + }; + GroupManager.prototype._findParentGroup = function (element, range) { + if (!range.length) { + return this; + } + var single = this.map.get(element); + if (!single) { + return this; + } + var parent = single.parent; + while (parent) { + if (range.some(function (element) { return parent.contains(element); })) { + return parent; + } + parent = parent.parent; + } + return this; + }; + return GroupManager; +}(ArrayChild)); + +export { ArrayChild, Child, GroupManager, SingleChild, toTargetList }; +//# sourceMappingURL=helper.esm.js.map diff --git a/helper/release/0.52.0/dist/helper.esm.js.map b/helper/release/0.52.0/dist/helper.esm.js.map new file mode 100644 index 000000000..1db89cda9 --- /dev/null +++ b/helper/release/0.52.0/dist/helper.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"helper.esm.js","sources":["../src/groups.ts","../src/GroupManager.ts"],"sourcesContent":["import { isArray, deepFlat, find } from \"@daybrush/utils\";\nimport { GroupChild, TargetGroupsObject, TargetGroupsType } from \"./types\";\n\nexport class Child {\n public type: \"group\" | \"root\" | \"single\" = \"single\";\n public depth = 0;\n protected _scope: string[] = [];\n constructor(public parent?: ArrayChild) {\n if (parent) {\n this.depth = parent.depth + 1;\n }\n }\n\n public get scope(): string[] {\n const parent = this.parent;\n\n if (!parent || parent.type === \"root\") {\n return [];\n }\n return [...parent.scope, parent.id];\n }\n}\n\nexport class SingleChild extends Child {\n public type = \"single\" as const;\n public isGroupElement = false;\n constructor(parent: ArrayChild, public value: HTMLElement | SVGElement) {\n super(parent);\n }\n}\n\n\nexport class ArrayChild extends Child {\n public type: \"group\" | \"root\" = \"group\";\n public value: GroupChild[] = [];\n public id = \"\";\n public groupElement?: HTMLElement | SVGElement | null = null;\n public map: Map = new Map();\n\n public compare(groups: TargetGroupsType, checker: -1 | 0 | 1 = 0) {\n const elements = deepFlat(groups);\n const map = this.map;\n const elementsLength = elements.length;\n const mapSize = map.size;\n const sizeDiff = mapSize - elementsLength;\n\n // 1 this > groups\n // 0 this = groups\n // -1 this < groups\n const count = elements.filter(element => map.has(element)).length;\n\n if ((checker > 0 && sizeDiff >= 0) || (checker === 0 && sizeDiff === 0)) {\n return elementsLength === count;\n } else if (checker < 0 && sizeDiff <= 0) {\n return mapSize === count;\n }\n return false;\n }\n public has(target: HTMLElement | SVGElement) {\n return this.map.has(target);\n }\n public contains(element: HTMLElement | SVGElement): boolean {\n if (this.has(element)) {\n return true;\n }\n return this.value.some(child => {\n if (child.type === \"group\") {\n return child.contains(element);\n } else {\n return false;\n }\n });\n }\n public findContainedChild(element: HTMLElement | SVGElement) {\n return find(this.value, child => {\n if (child.type === \"single\") {\n return child.value === element;\n } else {\n return child.contains(element);\n }\n });\n }\n /**\n * Exact group containing targets\n */\n public findExactChild(target: TargetGroupsType[0]): GroupChild | undefined {\n const map = this.map;\n\n if (!isArray(target)) {\n return map.get(target);\n }\n const flatted = deepFlat(target);\n const length = flatted.length;\n const single = map.get(flatted[0]);\n\n if (!single) {\n return;\n }\n\n let parent: ArrayChild | undefined = single.parent;\n\n while (parent) {\n if (parent.map.size >= length) {\n return parent;\n }\n parent = parent.parent;\n }\n return;\n }\n public findCommonParent(targets: TargetGroupsType): ArrayChild {\n let depth = Infinity;\n let childs = targets.map(target => this.findExactChild(target));\n\n childs.forEach(child => {\n if (!child) {\n return;\n }\n depth = Math.min(child.depth, depth);\n });\n\n while (depth) {\n --depth;\n childs = childs.map(child => {\n let parent: GroupChild | undefined = child;\n\n while (parent && parent.depth !== depth) {\n parent = parent.parent;\n }\n\n return parent;\n });\n const firstChild = childs.find(child => child);\n\n if (!firstChild) {\n return this;\n }\n if (childs.every(child => !child || child === firstChild)) {\n break;\n }\n }\n const commonParent = childs.find(child => child) as ArrayChild;\n\n return commonParent || this;\n }\n public findNextChild(\n target: HTMLElement | SVGElement,\n range: TargetGroupsType = this.toTargetGroups(),\n isExact = true,\n ): ArrayChild | null {\n let nextChild: ArrayChild | null = null;\n\n const length = range.length;\n\n range.some(child => {\n if (!isExact && length === 1 && isArray(child)) {\n nextChild = this.findNextChild(target, child);\n return nextChild;\n }\n\n\n const nextGroupChild = this.findExactChild(child);\n\n if (!nextGroupChild) {\n return;\n }\n\n if (\"map\" in nextGroupChild) {\n if (nextGroupChild.map.has(target)) {\n nextChild = nextGroupChild;\n return true;\n }\n }\n });\n\n return nextChild;\n }\n public findNextExactChild(\n target: HTMLElement | SVGElement,\n selected: Array,\n range: TargetGroupsType = this.toTargetGroups(),\n ): ArrayChild | null {\n // [[1, 2]] => group([1, 2]) exact\n // [[[1, 2], 3]] => group([1, 2])\n const nextChild = this.findNextChild(target, range, true);\n\n if (!nextChild) {\n return null;\n }\n\n if (nextChild.compare(selected, -1)) {\n return nextChild;\n }\n return null;\n }\n /**\n * Finds a group that does not overlap within the range and includes the target.\n */\n public findPureChild(\n target: HTMLElement | SVGElement,\n range: Array,\n ): ArrayChild | null {\n let nextGroupChild: ArrayChild | null = null;\n\n const childSelected = range.filter(element => this.has(element));\n\n if (!childSelected.length) {\n return this;\n }\n\n this.value.some(nextChild => {\n if (nextChild.type !== \"single\" && nextChild.has(target)) {\n nextGroupChild = nextChild.findPureChild(target, childSelected);\n\n if (nextGroupChild) {\n return true;\n }\n }\n });\n\n return nextGroupChild;\n }\n public findNextPureChild(\n target: HTMLElement | SVGElement,\n range: Array,\n ): ArrayChild | null {\n const nextChild = this.findNextChild(target);\n\n if (nextChild) {\n return nextChild.findPureChild(target, range);\n }\n return null;\n }\n public getSingleChild(): SingleChild | null {\n const groupElement = this.groupElement;\n\n if (groupElement) {\n const singleChild = this.parent?.value.find(t => t.value === groupElement);\n\n if (singleChild) {\n return singleChild as SingleChild;\n }\n }\n return null;\n }\n public toTargetGroups(): TargetGroupsType {\n return this.value.map(child => {\n if (child.type === \"single\") {\n return child.value;\n } else {\n return child.toTargetGroups();\n }\n });\n }\n public findArrayChild(targets: TargetGroupsType): ArrayChild | null {\n const {\n value,\n } = this;\n\n let result = false;\n\n if (this.type !== \"root\") {\n result = value.every(child => {\n if (child.type === \"single\") {\n return targets.some(target => child.value === target);\n } else {\n return targets.some(target => {\n return isArray(target) && child.findArrayChild(target);\n });\n }\n });\n // result = targets.every(target => {\n // if (isArray(target)) {\n // return value.some(child => {\n // return child.type === \"group\" && child.findArrayChild(target);\n // });\n // } else {\n // return map.get(target);\n // }\n // });\n }\n\n if (result && targets.length === value.length) {\n return this;\n } else {\n let childResult: ArrayChild | null = null;\n\n value.some(child => {\n if (child.type === \"group\") {\n childResult = child.findArrayChild(targets);\n\n return childResult;\n }\n });\n\n return childResult;\n }\n }\n public groupByPerfect(selected: Array) {\n return this.value.filter(child => {\n if (child.type !== \"single\") {\n return child.compare(selected, -1);\n }\n return selected.indexOf(child.value) > -1;\n }).map(child => {\n if (child.type !== \"single\") {\n const singleChild = child.getSingleChild();\n\n if (singleChild) {\n return singleChild;\n }\n }\n return child;\n });\n }\n public add(targets: TargetGroupsObject) {\n const {\n value,\n map,\n } = this;\n\n targets.forEach(child => {\n if (\"groupId\" in child) {\n const group = new ArrayChild(this);\n\n group.id = child.groupId;\n value.push(group);\n group.add(child.children);\n } else if (isArray(child)) {\n const group = new ArrayChild(this);\n\n value.push(group);\n group.add(child);\n } else {\n const element = \"current\" in child ? child.current : child;\n const single = new SingleChild(this, element!);\n\n value.push(single);\n map.set(element!, single);\n }\n });\n\n value.forEach(child => {\n if (child.type === \"single\") {\n map.set(child.value, child);\n } else {\n child.map.forEach((nextChild, element) => {\n map.set(element, nextChild);\n });\n }\n });\n\n value.forEach(child => {\n if (child.type !== \"single\") {\n return;\n }\n // single\n const singleElement = child.value;\n const groupChild = value.find(child2 => {\n if (child2.type === \"single\") {\n return;\n }\n const firstElement = [...child2.map.keys()][0];\n\n if (!firstElement) {\n return;\n }\n\n return singleElement.contains(firstElement);\n });\n\n (child as SingleChild).isGroupElement = !!groupChild;\n\n if (groupChild) {\n (groupChild as ArrayChild).groupElement = child.value;\n }\n });\n return parent;\n }\n}\n","/* eslint-disable no-cond-assign */\nimport { deepFlat, isArray } from \"@daybrush/utils\";\nimport { ArrayChild, SingleChild } from \"./groups\";\nimport { GroupChild, TargetGroupsObject, TargetGroupsType, TargetList } from \"./types\";\n\n\nexport function toTargetList(raw: GroupChild[]): TargetList {\n function targets(childs: GroupChild[] = []) {\n const arr: TargetGroupsType = [];\n\n childs.forEach((child) => {\n if (child.type === \"single\") {\n arr.push(child.value);\n } else {\n arr.push(targets(child.value));\n }\n });\n\n return arr;\n }\n\n return {\n raw: () => raw,\n targets() {\n return targets(this.raw());\n },\n flatten() {\n return deepFlat(this.targets());\n },\n };\n}\n\nexport class GroupManager extends ArrayChild {\n public type = \"root\" as const;\n private _targets: Array = [];\n\n constructor(\n targetGroups: TargetGroupsType,\n targets?: Array,\n ) {\n super();\n this.set(targetGroups, targets);\n }\n public set(\n targetGroups: TargetGroupsObject,\n targets: Array = [],\n ) {\n this.map = new Map();\n this.value = [];\n\n const map = this.map;\n const value = this.value;\n\n this.add(targetGroups);\n targets.forEach(target => {\n if (map.has(target)) {\n return;\n }\n const single = new SingleChild(this, target);\n\n single.depth = 1;\n value.push(single);\n map.set(target, single);\n });\n this._targets = targets;\n }\n public selectSubChilds(targets: TargetGroupsType, target: HTMLElement | SVGElement) {\n const root = this;\n const nextChild = root.findNextChild(target, targets, false);\n const targetChild = root.map.get(target);\n\n let nextChilds: GroupChild[] = [];\n\n if (nextChild) {\n nextChilds = [nextChild];\n } else if (targetChild) {\n nextChilds = [targetChild];\n } else {\n nextChilds = [];\n }\n\n return toTargetList(nextChilds);\n }\n public selectSingleChilds(\n targets: TargetGroupsType,\n added: Array,\n removed: Array,\n ) {\n const nextTargets = [...targets];\n\n // group can't be added, removed.\n removed.forEach(element => {\n const index = nextTargets.indexOf(element);\n\n if (index > -1) {\n nextTargets.splice(index, 1);\n }\n });\n\n // Targets can be added one by one\n added.forEach(element => {\n nextTargets.push(element);\n });\n\n return toTargetList(this.toChilds(nextTargets));\n }\n public selectCompletedChilds(\n targets: TargetGroupsType,\n added: Array,\n removed: Array,\n continueSelect?: boolean,\n ) {\n const nextTargets = [...targets];\n const startSelected = deepFlat(nextTargets);\n\n // group can be added, removed.\n removed.forEach(element => {\n // Single Target\n const index = nextTargets.indexOf(element);\n\n if (index > -1) {\n // single target or group\n nextTargets.splice(index, 1);\n return;\n }\n // Group Target\n const removedChild = continueSelect\n // Finds the nearest child for element and nextTargets.\n ? this.findNextChild(element, nextTargets)\n // Find the nearest exact child for element, all removed and nextTargets.\n : this.findNextExactChild(element, removed, nextTargets);\n\n if (removedChild) {\n const groupIndex = nextTargets.findIndex(target => {\n return isArray(target) && removedChild.compare(target);\n });\n\n if (groupIndex > -1) {\n nextTargets.splice(groupIndex, 1);\n }\n }\n });\n\n added.forEach(element => {\n const parentGroup = this._findParentGroup(element, startSelected);\n const nextChild = parentGroup.findContainedChild(element);\n\n if (nextChild?.type === \"group\") {\n const singleChild = nextChild.getSingleChild();\n\n if (singleChild) {\n nextTargets.push(singleChild.value);\n } else {\n nextTargets.push(nextChild.toTargetGroups());\n }\n return;\n }\n nextTargets.push(element);\n });\n return toTargetList(this.toChilds(nextTargets));\n }\n public selectSameDepthChilds(\n targets: TargetGroupsType,\n added: Array,\n removed: Array,\n continueSelect?: boolean,\n ) {\n const nextTargets = [...targets];\n const commonParent = this.findCommonParent(nextTargets);\n\n removed.forEach(element => {\n // Single Target\n const index = nextTargets.indexOf(element);\n\n if (index > -1) {\n // single target or group\n nextTargets.splice(index, 1);\n return;\n }\n const removedChild = continueSelect\n // Find the nearest exact child for element, all removed and nextTargets.\n ? commonParent.findNextExactChild(element, removed, nextTargets)\n // Finds the nearest child for element and nextTargets.\n : commonParent.findNextChild(element, nextTargets, true);\n\n if (removedChild) {\n const groupIndex = nextTargets.findIndex(target => {\n return isArray(target) && removedChild.compare(target);\n });\n\n if (groupIndex > -1) {\n nextTargets.splice(groupIndex, 1);\n }\n }\n });\n const addedChildren = commonParent.groupByPerfect(added);\n\n addedChildren.forEach(child => {\n if (child.type === \"single\") {\n nextTargets.push(child.value);\n } else {\n const groupIndex = nextTargets.findIndex(target => {\n return isArray(target) && child.compare(target, 1);\n });\n\n if (groupIndex > -1) {\n nextTargets.splice(groupIndex, 1);\n }\n nextTargets.push(child.toTargetGroups());\n }\n });\n return toTargetList(this.toChilds(nextTargets));\n }\n public toChilds(targets: TargetGroupsType): GroupChild[] {\n const childs: GroupChild[] = [];\n\n targets.forEach(target => {\n if (isArray(target)) {\n const arrayChild = this.findArrayChild(target);\n\n if (arrayChild) {\n const singleChild = arrayChild.getSingleChild();\n\n if (singleChild) {\n return singleChild;\n }\n childs.push(arrayChild);\n }\n } else {\n const single = this.map.get(target);\n\n if (single) {\n childs.push(single);\n } else {\n childs.push(new SingleChild(this, target));\n }\n }\n });\n\n return childs;\n }\n public findChild(element: HTMLElement | SVGElement, isAuto: true): SingleChild | ArrayChild;\n public findChild(\n element: HTMLElement | SVGElement,\n isAuto?: boolean,\n ): SingleChild | ArrayChild | undefined;\n public findChild(\n element: HTMLElement | SVGElement,\n isAuto?: boolean,\n ): SingleChild | ArrayChild | undefined {\n const value = this.map.get(element);\n\n if (isAuto) {\n return value || new SingleChild(this, element);\n }\n return value;\n }\n public findArrayChildById(id: string): ArrayChild | null {\n let value: ArrayChild | null = null;\n\n this.value.some(function find(child: GroupChild) {\n if (child.type !== \"single\") {\n if (child.id === id) {\n value = child;\n return true;\n } else {\n return child.value.some(find);\n }\n }\n });\n\n return value;\n }\n public group(targets: TargetGroupsType, flatten?: boolean): TargetGroupsType | null {\n const commonParent = this.findCommonParent(targets);\n const groupChilds = targets.map(target => {\n if (isArray(target)) {\n return this.findArrayChild(target);\n }\n return this.findChild(target);\n });\n const isGroupable = groupChilds.every(child => child?.parent === commonParent);\n\n if (!isGroupable) {\n return null;\n }\n const group = new ArrayChild(commonParent);\n const nextChilds = commonParent.value.filter(target => groupChilds.indexOf(target) === -1);\n\n if (!nextChilds.length) {\n return null;\n }\n nextChilds.unshift(group);\n group.add(flatten ? deepFlat(targets) : targets);\n commonParent.value = nextChilds;\n\n this.set(this.toTargetGroups(), this._targets);\n\n return group.toTargetGroups();\n }\n public ungroup(targets: TargetGroupsType) {\n if (targets.length === 1 && isArray(targets[0])) {\n targets = targets[0];\n }\n const commonParent = this.findCommonParent(targets);\n const groupChilds = targets.map(target => {\n if (isArray(target)) {\n return this.findArrayChild(target);\n }\n return this.findChild(target);\n });\n\n if (commonParent.groupElement) {\n return null;\n }\n\n // all children is targets\n const isGroupable = commonParent.value.every(child => groupChilds.indexOf(child) > -1);\n\n if (!isGroupable || commonParent === this) {\n // has no group\n return null;\n }\n\n const parent = commonParent.parent;\n\n if (!parent) {\n return null;\n }\n const nextChilds = parent.value.filter(target => target !== commonParent);\n\n nextChilds.push(...commonParent.value);\n parent.value = nextChilds;\n\n this.set(this.toTargetGroups(), this._targets);\n return commonParent.toTargetGroups();\n }\n protected _findParentGroup(\n element: HTMLElement | SVGElement,\n range: Array,\n ) {\n if (!range.length) {\n return this;\n }\n const single = this.map.get(element);\n\n if (!single) {\n return this;\n }\n let parent: ArrayChild | undefined = single.parent;\n\n while (parent) {\n if (range.some(element => parent!.contains(element))) {\n return parent;\n }\n parent = parent.parent;\n }\n return this;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAA,KAAA,kBAAA,YAAA;AAII,IAAA,SAAA,KAAA,CAAmB,MAAmB,EAAA;QAAnB,IAAM,CAAA,MAAA,GAAN,MAAM,CAAa;QAH/B,IAAI,CAAA,IAAA,GAAgC,QAAQ,CAAC;QAC7C,IAAK,CAAA,KAAA,GAAG,CAAC,CAAC;QACP,IAAM,CAAA,MAAA,GAAa,EAAE,CAAC;AAE5B,QAAA,IAAI,MAAM,EAAE;YACR,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC;AACjC,SAAA;KACJ;AAED,IAAA,MAAA,CAAA,cAAA,CAAW,KAAK,CAAA,SAAA,EAAA,OAAA,EAAA;AAAhB,QAAA,GAAA,EAAA,YAAA;AACI,YAAA,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;YAE3B,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,EAAE;AACnC,gBAAA,OAAO,EAAE,CAAC;AACb,aAAA;AACD,YAAA,OAAA,aAAA,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AC;QAE1E,UAAU,CAAC,IAAI,CAAf,KAAA,CAAA,UAAU,2BAAS,YAAY,CAAC,KAAK,CAAE,EAAA,KAAA,CAAA,CAAA,CAAA;AACvC,QAAA,MAAM,CAAC,KAAK,GAAG,UAAU,CAAC;AAE1B,QAAA,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC/C,QAAA,OAAO,YAAY,CAAC,cAAc,EAAE,CAAC;KACxC,CAAA;AACS,IAAA,YAAA,CAAA,SAAA,CAAA,gBAAgB,GAA1B,UACI,OAAiC,EACjC,KAAsC,EAAA;AAEtC,QAAA,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;AACf,YAAA,OAAO,IAAI,CAAC;AACf,SAAA;QACD,IAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAErC,IAAI,CAAC,MAAM,EAAE;AACT,YAAA,OAAO,IAAI,CAAC;AACf,SAAA;AACD,QAAA,IAAI,MAAM,GAA2B,MAAM,CAAC,MAAM,CAAC;AAEnD,QAAA,OAAO,MAAM,EAAE;AACX,YAAA,IAAI,KAAK,CAAC,IAAI,CAAC,UAAA,OAAO,EAAI,EAAA,OAAA,MAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAzB,EAAyB,CAAC,EAAE;AAClD,gBAAA,OAAO,MAAM,CAAC;AACjB,aAAA;AACD,YAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AAC1B,SAAA;AACD,QAAA,OAAO,IAAI,CAAC;KACf,CAAA;IACL,OAAC,YAAA,CAAA;AAAD,CAvUA,CAAkC,UAAU,CAuU3C;;;;"} \ No newline at end of file diff --git a/helper/release/0.52.0/dist/helper.js b/helper/release/0.52.0/dist/helper.js new file mode 100644 index 000000000..eb342e0ec --- /dev/null +++ b/helper/release/0.52.0/dist/helper.js @@ -0,0 +1,817 @@ +/* +Copyright (c) Daybrush +name: @moveable/helper +license: MIT +author: Daybrush +repository: https://github.com/daybrush/moveable/blob/master/packages/helper +version: 0.1.3 +*/ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.MoveableHelper = factory()); +})(this, (function () { 'use strict'; + + /****************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + /* global Reflect, Promise */ + + var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + + function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + } + + function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; + } + + function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); + } + + /* + Copyright (c) 2018 Daybrush + @name: @daybrush/utils + license: MIT + author: Daybrush + repository: https://github.com/daybrush/utils + @version 1.13.0 + */ + /** + * @namespace + * @name Consts + */ + /** + * get string "rgb" + * @memberof Color + * @example + import {RGB} from "@daybrush/utils"; + + console.log(RGB); // "rgb" + */ + /** + * Check the type that the value is isArray. + * @memberof Utils + * @param {string} value - Value to check the type + * @return {} true if the type is correct, false otherwise + * @example + import {isArray} from "@daybrush/utils"; + + console.log(isArray([])); // true + console.log(isArray({})); // false + console.log(isArray(undefined)); // false + console.log(isArray(null)); // false + */ + function isArray(value) { + return Array.isArray(value); + } + /** + * Returns the index of the first element in the array that satisfies the provided testing function. + * @function + * @memberof CrossBrowser + * @param - The array `findIndex` was called upon. + * @param - A function to execute on each value in the array until the function returns true, indicating that the satisfying element was found. + * @param - Returns defaultIndex if not found by the function. + * @example + import { findIndex } from "@daybrush/utils"; + + findIndex([{a: 1}, {a: 2}, {a: 3}, {a: 4}], ({ a }) => a === 2); // 1 + */ + function findIndex(arr, callback, defaultIndex) { + if (defaultIndex === void 0) { + defaultIndex = -1; + } + var length = arr.length; + for (var i = 0; i < length; ++i) { + if (callback(arr[i], i, arr)) { + return i; + } + } + return defaultIndex; + } + /** + * Returns the value of the first element in the array that satisfies the provided testing function. + * @function + * @memberof CrossBrowser + * @param - The array `find` was called upon. + * @param - A function to execute on each value in the array, + * @param - Returns defalutValue if not found by the function. + * @example + import { find } from "@daybrush/utils"; + + find([{a: 1}, {a: 2}, {a: 3}, {a: 4}], ({ a }) => a === 2); // {a: 2} + */ + function find(arr, callback, defalutValue) { + var index = findIndex(arr, callback); + return index > -1 ? arr[index] : defalutValue; + } + /** + * @function + * @memberof Utils + */ + function deepFlat(arr) { + return arr.reduce(function (prev, cur) { + if (isArray(cur)) { + prev.push.apply(prev, deepFlat(cur)); + } else { + prev.push(cur); + } + return prev; + }, []); + } + + var Child = /*#__PURE__*/ (function () { + function Child(parent) { + this.parent = parent; + this.type = "single"; + this.depth = 0; + this._scope = []; + if (parent) { + this.depth = parent.depth + 1; + } + } + Object.defineProperty(Child.prototype, "scope", { + get: function () { + var parent = this.parent; + if (!parent || parent.type === "root") { + return []; + } + return __spreadArray(__spreadArray([], __read(parent.scope), false), [parent.id], false); + }, + enumerable: false, + configurable: true + }); + return Child; + }()); + var SingleChild = /*#__PURE__*/ (function (_super) { + __extends(SingleChild, _super); + function SingleChild(parent, value) { + var _this = _super.call(this, parent) || this; + _this.value = value; + _this.type = "single"; + _this.isGroupElement = false; + return _this; + } + return SingleChild; + }(Child)); + var ArrayChild = /*#__PURE__*/ (function (_super) { + __extends(ArrayChild, _super); + function ArrayChild() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.type = "group"; + _this.value = []; + _this.id = ""; + _this.groupElement = null; + _this.map = new Map(); + return _this; + } + ArrayChild.prototype.compare = function (groups, checker) { + if (checker === void 0) { checker = 0; } + var elements = deepFlat(groups); + var map = this.map; + var elementsLength = elements.length; + var mapSize = map.size; + var sizeDiff = mapSize - elementsLength; + // 1 this > groups + // 0 this = groups + // -1 this < groups + var count = elements.filter(function (element) { return map.has(element); }).length; + if ((checker > 0 && sizeDiff >= 0) || (checker === 0 && sizeDiff === 0)) { + return elementsLength === count; + } + else if (checker < 0 && sizeDiff <= 0) { + return mapSize === count; + } + return false; + }; + ArrayChild.prototype.has = function (target) { + return this.map.has(target); + }; + ArrayChild.prototype.contains = function (element) { + if (this.has(element)) { + return true; + } + return this.value.some(function (child) { + if (child.type === "group") { + return child.contains(element); + } + else { + return false; + } + }); + }; + ArrayChild.prototype.findContainedChild = function (element) { + return find(this.value, function (child) { + if (child.type === "single") { + return child.value === element; + } + else { + return child.contains(element); + } + }); + }; + /** + * Exact group containing targets + */ + ArrayChild.prototype.findExactChild = function (target) { + var map = this.map; + if (!isArray(target)) { + return map.get(target); + } + var flatted = deepFlat(target); + var length = flatted.length; + var single = map.get(flatted[0]); + if (!single) { + return; + } + var parent = single.parent; + while (parent) { + if (parent.map.size >= length) { + return parent; + } + parent = parent.parent; + } + return; + }; + ArrayChild.prototype.findCommonParent = function (targets) { + var _this = this; + var depth = Infinity; + var childs = targets.map(function (target) { return _this.findExactChild(target); }); + childs.forEach(function (child) { + if (!child) { + return; + } + depth = Math.min(child.depth, depth); + }); + var _loop_1 = function () { + --depth; + childs = childs.map(function (child) { + var parent = child; + while (parent && parent.depth !== depth) { + parent = parent.parent; + } + return parent; + }); + var firstChild = childs.find(function (child) { return child; }); + if (!firstChild) { + return { value: this_1 }; + } + if (childs.every(function (child) { return !child || child === firstChild; })) { + return "break"; + } + }; + var this_1 = this; + while (depth) { + var state_1 = _loop_1(); + if (typeof state_1 === "object") + return state_1.value; + if (state_1 === "break") + break; + } + var commonParent = childs.find(function (child) { return child; }); + return commonParent || this; + }; + ArrayChild.prototype.findNextChild = function (target, range, isExact) { + var _this = this; + if (range === void 0) { range = this.toTargetGroups(); } + if (isExact === void 0) { isExact = true; } + var nextChild = null; + var length = range.length; + range.some(function (child) { + if (!isExact && length === 1 && isArray(child)) { + nextChild = _this.findNextChild(target, child); + return nextChild; + } + var nextGroupChild = _this.findExactChild(child); + if (!nextGroupChild) { + return; + } + if ("map" in nextGroupChild) { + if (nextGroupChild.map.has(target)) { + nextChild = nextGroupChild; + return true; + } + } + }); + return nextChild; + }; + ArrayChild.prototype.findNextExactChild = function (target, selected, range) { + if (range === void 0) { range = this.toTargetGroups(); } + // [[1, 2]] => group([1, 2]) exact + // [[[1, 2], 3]] => group([1, 2]) + var nextChild = this.findNextChild(target, range, true); + if (!nextChild) { + return null; + } + if (nextChild.compare(selected, -1)) { + return nextChild; + } + return null; + }; + /** + * Finds a group that does not overlap within the range and includes the target. + */ + ArrayChild.prototype.findPureChild = function (target, range) { + var _this = this; + var nextGroupChild = null; + var childSelected = range.filter(function (element) { return _this.has(element); }); + if (!childSelected.length) { + return this; + } + this.value.some(function (nextChild) { + if (nextChild.type !== "single" && nextChild.has(target)) { + nextGroupChild = nextChild.findPureChild(target, childSelected); + if (nextGroupChild) { + return true; + } + } + }); + return nextGroupChild; + }; + ArrayChild.prototype.findNextPureChild = function (target, range) { + var nextChild = this.findNextChild(target); + if (nextChild) { + return nextChild.findPureChild(target, range); + } + return null; + }; + ArrayChild.prototype.getSingleChild = function () { + var _a; + var groupElement = this.groupElement; + if (groupElement) { + var singleChild = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.value.find(function (t) { return t.value === groupElement; }); + if (singleChild) { + return singleChild; + } + } + return null; + }; + ArrayChild.prototype.toTargetGroups = function () { + return this.value.map(function (child) { + if (child.type === "single") { + return child.value; + } + else { + return child.toTargetGroups(); + } + }); + }; + ArrayChild.prototype.findArrayChild = function (targets) { + var value = this.value; + var result = false; + if (this.type !== "root") { + result = value.every(function (child) { + if (child.type === "single") { + return targets.some(function (target) { return child.value === target; }); + } + else { + return targets.some(function (target) { + return isArray(target) && child.findArrayChild(target); + }); + } + }); + // result = targets.every(target => { + // if (isArray(target)) { + // return value.some(child => { + // return child.type === "group" && child.findArrayChild(target); + // }); + // } else { + // return map.get(target); + // } + // }); + } + if (result && targets.length === value.length) { + return this; + } + else { + var childResult_1 = null; + value.some(function (child) { + if (child.type === "group") { + childResult_1 = child.findArrayChild(targets); + return childResult_1; + } + }); + return childResult_1; + } + }; + ArrayChild.prototype.groupByPerfect = function (selected) { + return this.value.filter(function (child) { + if (child.type !== "single") { + return child.compare(selected, -1); + } + return selected.indexOf(child.value) > -1; + }).map(function (child) { + if (child.type !== "single") { + var singleChild = child.getSingleChild(); + if (singleChild) { + return singleChild; + } + } + return child; + }); + }; + ArrayChild.prototype.add = function (targets) { + var _this = this; + var _a = this, value = _a.value, map = _a.map; + targets.forEach(function (child) { + if ("groupId" in child) { + var group = new ArrayChild(_this); + group.id = child.groupId; + value.push(group); + group.add(child.children); + } + else if (isArray(child)) { + var group = new ArrayChild(_this); + value.push(group); + group.add(child); + } + else { + var element = "current" in child ? child.current : child; + var single = new SingleChild(_this, element); + value.push(single); + map.set(element, single); + } + }); + value.forEach(function (child) { + if (child.type === "single") { + map.set(child.value, child); + } + else { + child.map.forEach(function (nextChild, element) { + map.set(element, nextChild); + }); + } + }); + value.forEach(function (child) { + if (child.type !== "single") { + return; + } + // single + var singleElement = child.value; + var groupChild = value.find(function (child2) { + if (child2.type === "single") { + return; + } + var firstElement = __spreadArray([], __read(child2.map.keys()), false)[0]; + if (!firstElement) { + return; + } + return singleElement.contains(firstElement); + }); + child.isGroupElement = !!groupChild; + if (groupChild) { + groupChild.groupElement = child.value; + } + }); + return parent; + }; + return ArrayChild; + }(Child)); + + function toTargetList(raw) { + function targets(childs) { + if (childs === void 0) { childs = []; } + var arr = []; + childs.forEach(function (child) { + if (child.type === "single") { + arr.push(child.value); + } + else { + arr.push(targets(child.value)); + } + }); + return arr; + } + return { + raw: function () { return raw; }, + targets: function () { + return targets(this.raw()); + }, + flatten: function () { + return deepFlat(this.targets()); + }, + }; + } + var GroupManager = /*#__PURE__*/ (function (_super) { + __extends(GroupManager, _super); + function GroupManager(targetGroups, targets) { + var _this = _super.call(this) || this; + _this.type = "root"; + _this._targets = []; + _this.set(targetGroups, targets); + return _this; + } + GroupManager.prototype.set = function (targetGroups, targets) { + var _this = this; + if (targets === void 0) { targets = []; } + this.map = new Map(); + this.value = []; + var map = this.map; + var value = this.value; + this.add(targetGroups); + targets.forEach(function (target) { + if (map.has(target)) { + return; + } + var single = new SingleChild(_this, target); + single.depth = 1; + value.push(single); + map.set(target, single); + }); + this._targets = targets; + }; + GroupManager.prototype.selectSubChilds = function (targets, target) { + var root = this; + var nextChild = root.findNextChild(target, targets, false); + var targetChild = root.map.get(target); + var nextChilds = []; + if (nextChild) { + nextChilds = [nextChild]; + } + else if (targetChild) { + nextChilds = [targetChild]; + } + else { + nextChilds = []; + } + return toTargetList(nextChilds); + }; + GroupManager.prototype.selectSingleChilds = function (targets, added, removed) { + var nextTargets = __spreadArray([], __read(targets), false); + // group can't be added, removed. + removed.forEach(function (element) { + var index = nextTargets.indexOf(element); + if (index > -1) { + nextTargets.splice(index, 1); + } + }); + // Targets can be added one by one + added.forEach(function (element) { + nextTargets.push(element); + }); + return toTargetList(this.toChilds(nextTargets)); + }; + GroupManager.prototype.selectCompletedChilds = function (targets, added, removed, continueSelect) { + var _this = this; + var nextTargets = __spreadArray([], __read(targets), false); + var startSelected = deepFlat(nextTargets); + // group can be added, removed. + removed.forEach(function (element) { + // Single Target + var index = nextTargets.indexOf(element); + if (index > -1) { + // single target or group + nextTargets.splice(index, 1); + return; + } + // Group Target + var removedChild = continueSelect + // Finds the nearest child for element and nextTargets. + ? _this.findNextChild(element, nextTargets) + // Find the nearest exact child for element, all removed and nextTargets. + : _this.findNextExactChild(element, removed, nextTargets); + if (removedChild) { + var groupIndex = nextTargets.findIndex(function (target) { + return isArray(target) && removedChild.compare(target); + }); + if (groupIndex > -1) { + nextTargets.splice(groupIndex, 1); + } + } + }); + added.forEach(function (element) { + var parentGroup = _this._findParentGroup(element, startSelected); + var nextChild = parentGroup.findContainedChild(element); + if ((nextChild === null || nextChild === void 0 ? void 0 : nextChild.type) === "group") { + var singleChild = nextChild.getSingleChild(); + if (singleChild) { + nextTargets.push(singleChild.value); + } + else { + nextTargets.push(nextChild.toTargetGroups()); + } + return; + } + nextTargets.push(element); + }); + return toTargetList(this.toChilds(nextTargets)); + }; + GroupManager.prototype.selectSameDepthChilds = function (targets, added, removed, continueSelect) { + var nextTargets = __spreadArray([], __read(targets), false); + var commonParent = this.findCommonParent(nextTargets); + removed.forEach(function (element) { + // Single Target + var index = nextTargets.indexOf(element); + if (index > -1) { + // single target or group + nextTargets.splice(index, 1); + return; + } + var removedChild = continueSelect + // Find the nearest exact child for element, all removed and nextTargets. + ? commonParent.findNextExactChild(element, removed, nextTargets) + // Finds the nearest child for element and nextTargets. + : commonParent.findNextChild(element, nextTargets, true); + if (removedChild) { + var groupIndex = nextTargets.findIndex(function (target) { + return isArray(target) && removedChild.compare(target); + }); + if (groupIndex > -1) { + nextTargets.splice(groupIndex, 1); + } + } + }); + var addedChildren = commonParent.groupByPerfect(added); + addedChildren.forEach(function (child) { + if (child.type === "single") { + nextTargets.push(child.value); + } + else { + var groupIndex = nextTargets.findIndex(function (target) { + return isArray(target) && child.compare(target, 1); + }); + if (groupIndex > -1) { + nextTargets.splice(groupIndex, 1); + } + nextTargets.push(child.toTargetGroups()); + } + }); + return toTargetList(this.toChilds(nextTargets)); + }; + GroupManager.prototype.toChilds = function (targets) { + var _this = this; + var childs = []; + targets.forEach(function (target) { + if (isArray(target)) { + var arrayChild = _this.findArrayChild(target); + if (arrayChild) { + var singleChild = arrayChild.getSingleChild(); + if (singleChild) { + return singleChild; + } + childs.push(arrayChild); + } + } + else { + var single = _this.map.get(target); + if (single) { + childs.push(single); + } + else { + childs.push(new SingleChild(_this, target)); + } + } + }); + return childs; + }; + GroupManager.prototype.findChild = function (element, isAuto) { + var value = this.map.get(element); + if (isAuto) { + return value || new SingleChild(this, element); + } + return value; + }; + GroupManager.prototype.findArrayChildById = function (id) { + var value = null; + this.value.some(function find(child) { + if (child.type !== "single") { + if (child.id === id) { + value = child; + return true; + } + else { + return child.value.some(find); + } + } + }); + return value; + }; + GroupManager.prototype.group = function (targets, flatten) { + var _this = this; + var commonParent = this.findCommonParent(targets); + var groupChilds = targets.map(function (target) { + if (isArray(target)) { + return _this.findArrayChild(target); + } + return _this.findChild(target); + }); + var isGroupable = groupChilds.every(function (child) { return (child === null || child === void 0 ? void 0 : child.parent) === commonParent; }); + if (!isGroupable) { + return null; + } + var group = new ArrayChild(commonParent); + var nextChilds = commonParent.value.filter(function (target) { return groupChilds.indexOf(target) === -1; }); + if (!nextChilds.length) { + return null; + } + nextChilds.unshift(group); + group.add(flatten ? deepFlat(targets) : targets); + commonParent.value = nextChilds; + this.set(this.toTargetGroups(), this._targets); + return group.toTargetGroups(); + }; + GroupManager.prototype.ungroup = function (targets) { + var _this = this; + if (targets.length === 1 && isArray(targets[0])) { + targets = targets[0]; + } + var commonParent = this.findCommonParent(targets); + var groupChilds = targets.map(function (target) { + if (isArray(target)) { + return _this.findArrayChild(target); + } + return _this.findChild(target); + }); + if (commonParent.groupElement) { + return null; + } + // all children is targets + var isGroupable = commonParent.value.every(function (child) { return groupChilds.indexOf(child) > -1; }); + if (!isGroupable || commonParent === this) { + // has no group + return null; + } + var parent = commonParent.parent; + if (!parent) { + return null; + } + var nextChilds = parent.value.filter(function (target) { return target !== commonParent; }); + nextChilds.push.apply(nextChilds, __spreadArray([], __read(commonParent.value), false)); + parent.value = nextChilds; + this.set(this.toTargetGroups(), this._targets); + return commonParent.toTargetGroups(); + }; + GroupManager.prototype._findParentGroup = function (element, range) { + if (!range.length) { + return this; + } + var single = this.map.get(element); + if (!single) { + return this; + } + var parent = single.parent; + while (parent) { + if (range.some(function (element) { return parent.contains(element); })) { + return parent; + } + parent = parent.parent; + } + return this; + }; + return GroupManager; + }(ArrayChild)); + + var modules = { + __proto__: null, + ArrayChild: ArrayChild, + Child: Child, + GroupManager: GroupManager, + SingleChild: SingleChild, + toTargetList: toTargetList + }; + + return modules; + +})); +//# sourceMappingURL=helper.js.map diff --git a/helper/release/0.52.0/dist/helper.js.map b/helper/release/0.52.0/dist/helper.js.map new file mode 100644 index 000000000..0ed068e39 --- /dev/null +++ b/helper/release/0.52.0/dist/helper.js.map @@ -0,0 +1 @@ +{"version":3,"file":"helper.js","sources":["../../../node_modules/@daybrush/utils/dist/utils.esm.js","../src/groups.ts","../src/GroupManager.ts"],"sourcesContent":["/*\nCopyright (c) 2018 Daybrush\n@name: @daybrush/utils\nlicense: MIT\nauthor: Daybrush\nrepository: https://github.com/daybrush/utils\n@version 1.13.0\n*/\n/**\n* @namespace\n* @name Consts\n*/\n/**\n* get string \"rgb\"\n* @memberof Color\n* @example\nimport {RGB} from \"@daybrush/utils\";\n\nconsole.log(RGB); // \"rgb\"\n*/\nvar RGB = \"rgb\";\n/**\n* get string \"rgba\"\n* @memberof Color\n* @example\nimport {RGBA} from \"@daybrush/utils\";\n\nconsole.log(RGBA); // \"rgba\"\n*/\nvar RGBA = \"rgba\";\n/**\n* get string \"hsl\"\n* @memberof Color\n* @example\nimport {HSL} from \"@daybrush/utils\";\n\nconsole.log(HSL); // \"hsl\"\n*/\nvar HSL = \"hsl\";\n/**\n* get string \"hsla\"\n* @memberof Color\n* @example\nimport {HSLA} from \"@daybrush/utils\";\n\nconsole.log(HSLA); // \"hsla\"\n*/\nvar HSLA = \"hsla\";\n/**\n* gets an array of color models.\n* @memberof Color\n* @example\nimport {COLOR_MODELS} from \"@daybrush/utils\";\n\nconsole.log(COLOR_MODELS); // [\"rgb\", \"rgba\", \"hsl\", \"hsla\"];\n*/\nvar COLOR_MODELS = [RGB, RGBA, HSL, HSLA];\n/**\n* get string \"function\"\n* @memberof Consts\n* @example\nimport {FUNCTION} from \"@daybrush/utils\";\n\nconsole.log(FUNCTION); // \"function\"\n*/\nvar FUNCTION = \"function\";\n/**\n* get string \"property\"\n* @memberof Consts\n* @example\nimport {PROPERTY} from \"@daybrush/utils\";\n\nconsole.log(PROPERTY); // \"property\"\n*/\nvar PROPERTY = \"property\";\n/**\n* get string \"array\"\n* @memberof Consts\n* @example\nimport {ARRAY} from \"@daybrush/utils\";\n\nconsole.log(ARRAY); // \"array\"\n*/\nvar ARRAY = \"array\";\n/**\n* get string \"object\"\n* @memberof Consts\n* @example\nimport {OBJECT} from \"@daybrush/utils\";\n\nconsole.log(OBJECT); // \"object\"\n*/\nvar OBJECT = \"object\";\n/**\n* get string \"string\"\n* @memberof Consts\n* @example\nimport {STRING} from \"@daybrush/utils\";\n\nconsole.log(STRING); // \"string\"\n*/\nvar STRING = \"string\";\n/**\n* get string \"number\"\n* @memberof Consts\n* @example\nimport {NUMBER} from \"@daybrush/utils\";\n\nconsole.log(NUMBER); // \"number\"\n*/\nvar NUMBER = \"number\";\n/**\n* get string \"undefined\"\n* @memberof Consts\n* @example\nimport {UNDEFINED} from \"@daybrush/utils\";\n\nconsole.log(UNDEFINED); // \"undefined\"\n*/\nvar UNDEFINED = \"undefined\";\n/**\n* Check whether the environment is window or node.js.\n* @memberof Consts\n* @example\nimport {IS_WINDOW} from \"@daybrush/utils\";\n\nconsole.log(IS_WINDOW); // false in node.js\nconsole.log(IS_WINDOW); // true in browser\n*/\nvar IS_WINDOW = typeof window !== UNDEFINED;\n/**\n* Check whether the environment is window or node.js.\n* @memberof Consts\n* @name document\n* @example\nimport {IS_WINDOW} from \"@daybrush/utils\";\n\nconsole.log(IS_WINDOW); // false in node.js\nconsole.log(IS_WINDOW); // true in browser\n*/\nvar doc = typeof document !== UNDEFINED && document; // FIXME: this type maybe false\nvar prefixes = [\"webkit\", \"ms\", \"moz\", \"o\"];\n/**\n * @namespace CrossBrowser\n */\n/**\n* Get a CSS property with a vendor prefix that supports cross browser.\n* @function\n* @param {string} property - A CSS property\n* @return {string} CSS property with cross-browser vendor prefix\n* @memberof CrossBrowser\n* @example\nimport {getCrossBrowserProperty} from \"@daybrush/utils\";\n\nconsole.log(getCrossBrowserProperty(\"transform\")); // \"transform\", \"-ms-transform\", \"-webkit-transform\"\nconsole.log(getCrossBrowserProperty(\"filter\")); // \"filter\", \"-webkit-filter\"\n*/\nvar getCrossBrowserProperty = /*#__PURE__*/function (property) {\n if (!doc) {\n return \"\";\n }\n var styles = (doc.body || doc.documentElement).style;\n var length = prefixes.length;\n if (typeof styles[property] !== UNDEFINED) {\n return property;\n }\n for (var i = 0; i < length; ++i) {\n var name = \"-\" + prefixes[i] + \"-\" + property;\n if (typeof styles[name] !== UNDEFINED) {\n return name;\n }\n }\n return \"\";\n};\n/**\n* get string \"transfrom\" with the vendor prefix.\n* @memberof CrossBrowser\n* @example\nimport {TRANSFORM} from \"@daybrush/utils\";\n\nconsole.log(TRANSFORM); // \"transform\", \"-ms-transform\", \"-webkit-transform\"\n*/\nvar TRANSFORM = /*#__PURE__*/getCrossBrowserProperty(\"transform\");\n/**\n* get string \"filter\" with the vendor prefix.\n* @memberof CrossBrowser\n* @example\nimport {FILTER} from \"@daybrush/utils\";\n\nconsole.log(FILTER); // \"filter\", \"-ms-filter\", \"-webkit-filter\"\n*/\nvar FILTER = /*#__PURE__*/getCrossBrowserProperty(\"filter\");\n/**\n* get string \"animation\" with the vendor prefix.\n* @memberof CrossBrowser\n* @example\nimport {ANIMATION} from \"@daybrush/utils\";\n\nconsole.log(ANIMATION); // \"animation\", \"-ms-animation\", \"-webkit-animation\"\n*/\nvar ANIMATION = /*#__PURE__*/getCrossBrowserProperty(\"animation\");\n/**\n* get string \"keyframes\" with the vendor prefix.\n* @memberof CrossBrowser\n* @example\nimport {KEYFRAMES} from \"@daybrush/utils\";\n\nconsole.log(KEYFRAMES); // \"keyframes\", \"-ms-keyframes\", \"-webkit-keyframes\"\n*/\nvar KEYFRAMES = /*#__PURE__*/ANIMATION.replace(\"animation\", \"keyframes\");\nvar OPEN_CLOSED_CHARACTERS = [{\n open: \"(\",\n close: \")\"\n}, {\n open: \"\\\"\",\n close: \"\\\"\"\n}, {\n open: \"'\",\n close: \"'\"\n}, {\n open: \"\\\\\\\"\",\n close: \"\\\\\\\"\"\n}, {\n open: \"\\\\'\",\n close: \"\\\\'\"\n}];\nvar TINY_NUM = 0.0000001;\nvar REVERSE_TINY_NUM = 1 / TINY_NUM;\nvar DEFAULT_UNIT_PRESETS = {\n \"cm\": function (pos) {\n return pos * 96 / 2.54;\n },\n \"mm\": function (pos) {\n return pos * 96 / 254;\n },\n \"in\": function (pos) {\n return pos * 96;\n },\n \"pt\": function (pos) {\n return pos * 96 / 72;\n },\n \"pc\": function (pos) {\n return pos * 96 / 6;\n },\n \"%\": function (pos, size) {\n return pos * size / 100;\n },\n \"vw\": function (pos, size) {\n if (size === void 0) {\n size = window.innerWidth;\n }\n return pos / 100 * size;\n },\n \"vh\": function (pos, size) {\n if (size === void 0) {\n size = window.innerHeight;\n }\n return pos / 100 * size;\n },\n \"vmax\": function (pos, size) {\n if (size === void 0) {\n size = Math.max(window.innerWidth, window.innerHeight);\n }\n return pos / 100 * size;\n },\n \"vmin\": function (pos, size) {\n if (size === void 0) {\n size = Math.min(window.innerWidth, window.innerHeight);\n }\n return pos / 100 * size;\n }\n};\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\nfunction __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];\n return r;\n}\n\n/**\n* @namespace\n* @name Utils\n*/\n/**\n * Returns the inner product of two numbers(`a1`, `a2`) by two criteria(`b1`, `b2`).\n * @memberof Utils\n * @param - The first number\n * @param - The second number\n * @param - The first number to base on the inner product\n * @param - The second number to base on the inner product\n * @return - Returns the inner product\nimport { dot } from \"@daybrush/utils\";\n\nconsole.log(dot(0, 15, 2, 3)); // 6\nconsole.log(dot(5, 15, 2, 3)); // 9\nconsole.log(dot(5, 15, 1, 1)); // 10\n */\nfunction dot(a1, a2, b1, b2) {\n return (a1 * b2 + a2 * b1) / (b1 + b2);\n}\n/**\n* Check the type that the value is undefined.\n* @memberof Utils\n* @param {string} value - Value to check the type\n* @return {boolean} true if the type is correct, false otherwise\n* @example\nimport {isUndefined} from \"@daybrush/utils\";\n\nconsole.log(isUndefined(undefined)); // true\nconsole.log(isUndefined(\"\")); // false\nconsole.log(isUndefined(1)); // false\nconsole.log(isUndefined(null)); // false\n*/\nfunction isUndefined(value) {\n return typeof value === UNDEFINED;\n}\n/**\n* Check the type that the value is object.\n* @memberof Utils\n* @param {string} value - Value to check the type\n* @return {} true if the type is correct, false otherwise\n* @example\nimport {isObject} from \"@daybrush/utils\";\n\nconsole.log(isObject({})); // true\nconsole.log(isObject(undefined)); // false\nconsole.log(isObject(\"\")); // false\nconsole.log(isObject(null)); // false\n*/\nfunction isObject(value) {\n return value && typeof value === OBJECT;\n}\n/**\n* Check the type that the value is isArray.\n* @memberof Utils\n* @param {string} value - Value to check the type\n* @return {} true if the type is correct, false otherwise\n* @example\nimport {isArray} from \"@daybrush/utils\";\n\nconsole.log(isArray([])); // true\nconsole.log(isArray({})); // false\nconsole.log(isArray(undefined)); // false\nconsole.log(isArray(null)); // false\n*/\nfunction isArray(value) {\n return Array.isArray(value);\n}\n/**\n* Check the type that the value is string.\n* @memberof Utils\n* @param {string} value - Value to check the type\n* @return {} true if the type is correct, false otherwise\n* @example\nimport {isString} from \"@daybrush/utils\";\n\nconsole.log(isString(\"1234\")); // true\nconsole.log(isString(undefined)); // false\nconsole.log(isString(1)); // false\nconsole.log(isString(null)); // false\n*/\nfunction isString(value) {\n return typeof value === STRING;\n}\nfunction isNumber(value) {\n return typeof value === NUMBER;\n}\n/**\n* Check the type that the value is function.\n* @memberof Utils\n* @param {string} value - Value to check the type\n* @return {} true if the type is correct, false otherwise\n* @example\nimport {isFunction} from \"@daybrush/utils\";\n\nconsole.log(isFunction(function a() {})); // true\nconsole.log(isFunction(() => {})); // true\nconsole.log(isFunction(\"1234\")); // false\nconsole.log(isFunction(1)); // false\nconsole.log(isFunction(null)); // false\n*/\nfunction isFunction(value) {\n return typeof value === FUNCTION;\n}\nfunction isEqualSeparator(character, separator) {\n var isCharacterSpace = character === \"\" || character == \" \";\n var isSeparatorSpace = separator === \"\" || separator == \" \";\n return isSeparatorSpace && isCharacterSpace || character === separator;\n}\nfunction findOpen(openCharacter, texts, index, length, openCloseCharacters) {\n var isIgnore = findIgnore(openCharacter, texts, index);\n if (!isIgnore) {\n return findClose(openCharacter, texts, index + 1, length, openCloseCharacters);\n }\n return index;\n}\nfunction findIgnore(character, texts, index) {\n if (!character.ignore) {\n return null;\n }\n var otherText = texts.slice(Math.max(index - 3, 0), index + 3).join(\"\");\n return new RegExp(character.ignore).exec(otherText);\n}\nfunction findClose(closeCharacter, texts, index, length, openCloseCharacters) {\n var _loop_1 = function (i) {\n var character = texts[i].trim();\n if (character === closeCharacter.close && !findIgnore(closeCharacter, texts, i)) {\n return {\n value: i\n };\n }\n var nextIndex = i;\n // re open\n var openCharacter = find(openCloseCharacters, function (_a) {\n var open = _a.open;\n return open === character;\n });\n if (openCharacter) {\n nextIndex = findOpen(openCharacter, texts, i, length, openCloseCharacters);\n }\n if (nextIndex === -1) {\n return out_i_1 = i, \"break\";\n }\n i = nextIndex;\n out_i_1 = i;\n };\n var out_i_1;\n for (var i = index; i < length; ++i) {\n var state_1 = _loop_1(i);\n i = out_i_1;\n if (typeof state_1 === \"object\") return state_1.value;\n if (state_1 === \"break\") break;\n }\n return -1;\n}\nfunction splitText(text, splitOptions) {\n var _a = isString(splitOptions) ? {\n separator: splitOptions\n } : splitOptions,\n _b = _a.separator,\n separator = _b === void 0 ? \",\" : _b,\n isSeparateFirst = _a.isSeparateFirst,\n isSeparateOnlyOpenClose = _a.isSeparateOnlyOpenClose,\n _c = _a.isSeparateOpenClose,\n isSeparateOpenClose = _c === void 0 ? isSeparateOnlyOpenClose : _c,\n _d = _a.openCloseCharacters,\n openCloseCharacters = _d === void 0 ? OPEN_CLOSED_CHARACTERS : _d;\n var openClosedText = openCloseCharacters.map(function (_a) {\n var open = _a.open,\n close = _a.close;\n if (open === close) {\n return open;\n }\n return open + \"|\" + close;\n }).join(\"|\");\n var regexText = \"(\\\\s*\" + separator + \"\\\\s*|\" + openClosedText + \"|\\\\s+)\";\n var regex = new RegExp(regexText, \"g\");\n var texts = text.split(regex).filter(function (chr) {\n return chr && chr !== \"undefined\";\n });\n var length = texts.length;\n var values = [];\n var tempValues = [];\n function resetTemp() {\n if (tempValues.length) {\n values.push(tempValues.join(\"\"));\n tempValues = [];\n return true;\n }\n return false;\n }\n var _loop_2 = function (i) {\n var character = texts[i].trim();\n var nextIndex = i;\n var openCharacter = find(openCloseCharacters, function (_a) {\n var open = _a.open;\n return open === character;\n });\n var closeCharacter = find(openCloseCharacters, function (_a) {\n var close = _a.close;\n return close === character;\n });\n if (openCharacter) {\n nextIndex = findOpen(openCharacter, texts, i, length, openCloseCharacters);\n if (nextIndex !== -1 && isSeparateOpenClose) {\n if (resetTemp() && isSeparateFirst) {\n return out_i_2 = i, \"break\";\n }\n values.push(texts.slice(i, nextIndex + 1).join(\"\"));\n i = nextIndex;\n if (isSeparateFirst) {\n return out_i_2 = i, \"break\";\n }\n return out_i_2 = i, \"continue\";\n }\n } else if (closeCharacter && !findIgnore(closeCharacter, texts, i)) {\n var nextOpenCloseCharacters = __spreadArrays(openCloseCharacters);\n nextOpenCloseCharacters.splice(openCloseCharacters.indexOf(closeCharacter), 1);\n return {\n value: splitText(text, {\n separator: separator,\n isSeparateFirst: isSeparateFirst,\n isSeparateOnlyOpenClose: isSeparateOnlyOpenClose,\n isSeparateOpenClose: isSeparateOpenClose,\n openCloseCharacters: nextOpenCloseCharacters\n })\n };\n } else if (isEqualSeparator(character, separator) && !isSeparateOnlyOpenClose) {\n resetTemp();\n if (isSeparateFirst) {\n return out_i_2 = i, \"break\";\n }\n return out_i_2 = i, \"continue\";\n }\n if (nextIndex === -1) {\n nextIndex = length - 1;\n }\n tempValues.push(texts.slice(i, nextIndex + 1).join(\"\"));\n i = nextIndex;\n out_i_2 = i;\n };\n var out_i_2;\n for (var i = 0; i < length; ++i) {\n var state_2 = _loop_2(i);\n i = out_i_2;\n if (typeof state_2 === \"object\") return state_2.value;\n if (state_2 === \"break\") break;\n }\n if (tempValues.length) {\n values.push(tempValues.join(\"\"));\n }\n return values;\n}\n/**\n* divide text by space.\n* @memberof Utils\n* @param {string} text - text to divide\n* @return {Array} divided texts\n* @example\nimport {spliceSpace} from \"@daybrush/utils\";\n\nconsole.log(splitSpace(\"a b c d e f g\"));\n// [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\"]\nconsole.log(splitSpace(\"'a,b' c 'd,e' f g\"));\n// [\"'a,b'\", \"c\", \"'d,e'\", \"f\", \"g\"]\n*/\nfunction splitSpace(text) {\n // divide comma(space)\n return splitText(text, \"\");\n}\n/**\n* divide text by comma.\n* @memberof Utils\n* @param {string} text - text to divide\n* @return {Array} divided texts\n* @example\nimport {splitComma} from \"@daybrush/utils\";\n\nconsole.log(splitComma(\"a,b,c,d,e,f,g\"));\n// [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\"]\nconsole.log(splitComma(\"'a,b',c,'d,e',f,g\"));\n// [\"'a,b'\", \"c\", \"'d,e'\", \"f\", \"g\"]\n*/\nfunction splitComma(text) {\n // divide comma(,)\n // \"[^\"]*\"|'[^']*'\n return splitText(text, \",\");\n}\n/**\n* divide text by bracket \"(\", \")\".\n* @memberof Utils\n* @param {string} text - text to divide\n* @return {object} divided texts\n* @example\nimport {splitBracket} from \"@daybrush/utils\";\n\nconsole.log(splitBracket(\"a(1, 2)\"));\n// {prefix: \"a\", value: \"1, 2\", suffix: \"\"}\nconsole.log(splitBracket(\"a(1, 2)b\"));\n// {prefix: \"a\", value: \"1, 2\", suffix: \"b\"}\n*/\nfunction splitBracket(text) {\n var matches = /([^(]*)\\(([\\s\\S]*)\\)([\\s\\S]*)/g.exec(text);\n if (!matches || matches.length < 4) {\n return {};\n } else {\n return {\n prefix: matches[1],\n value: matches[2],\n suffix: matches[3]\n };\n }\n}\n/**\n* divide text by number and unit.\n* @memberof Utils\n* @param {string} text - text to divide\n* @return {} divided texts\n* @example\nimport {splitUnit} from \"@daybrush/utils\";\n\nconsole.log(splitUnit(\"10px\"));\n// {prefix: \"\", value: 10, unit: \"px\"}\nconsole.log(splitUnit(\"-10px\"));\n// {prefix: \"\", value: -10, unit: \"px\"}\nconsole.log(splitUnit(\"a10%\"));\n// {prefix: \"a\", value: 10, unit: \"%\"}\n*/\nfunction splitUnit(text) {\n var matches = /^([^\\d|e|\\-|\\+]*)((?:\\d|\\.|-|e-|e\\+)+)(\\S*)$/g.exec(text);\n if (!matches) {\n return {\n prefix: \"\",\n unit: \"\",\n value: NaN\n };\n }\n var prefix = matches[1];\n var value = matches[2];\n var unit = matches[3];\n return {\n prefix: prefix,\n unit: unit,\n value: parseFloat(value)\n };\n}\n/**\n* transform strings to camel-case\n* @memberof Utils\n* @param {String} text - string\n* @return {String} camel-case string\n* @example\nimport {camelize} from \"@daybrush/utils\";\n\nconsole.log(camelize(\"transform-origin\")); // transformOrigin\nconsole.log(camelize(\"abcd_efg\")); // abcdEfg\nconsole.log(camelize(\"abcd efg\")); // abcdEfg\n*/\nfunction camelize(str) {\n return str.replace(/[\\s-_]+([^\\s-_])/g, function (all, letter) {\n return letter.toUpperCase();\n });\n}\n/**\n* transform a camelized string into a lowercased string.\n* @memberof Utils\n* @param {string} text - a camel-cased string\n* @param {string} [separator=\"-\"] - a separator\n* @return {string} a lowercased string\n* @example\nimport {decamelize} from \"@daybrush/utils\";\n\nconsole.log(decamelize(\"transformOrigin\")); // transform-origin\nconsole.log(decamelize(\"abcdEfg\", \"_\")); // abcd_efg\n*/\nfunction decamelize(str, separator) {\n if (separator === void 0) {\n separator = \"-\";\n }\n return str.replace(/([a-z])([A-Z])/g, function (all, letter, letter2) {\n return \"\" + letter + separator + letter2.toLowerCase();\n });\n}\n/**\n* transforms something in an array into an array.\n* @memberof Utils\n* @param - Array form\n* @return an array\n* @example\nimport {toArray} from \"@daybrush/utils\";\n\nconst arr1 = toArray(document.querySelectorAll(\".a\")); // Element[]\nconst arr2 = toArray(document.querySelectorAll(\".a\")); // HTMLElement[]\n*/\nfunction toArray(value) {\n return [].slice.call(value);\n}\n/**\n* Date.now() method\n* @memberof CrossBrowser\n* @return {number} milliseconds\n* @example\nimport {now} from \"@daybrush/utils\";\n\nconsole.log(now()); // 12121324241(milliseconds)\n*/\nfunction now() {\n return Date.now ? Date.now() : new Date().getTime();\n}\n/**\n* Returns the index of the first element in the array that satisfies the provided testing function.\n* @function\n* @memberof CrossBrowser\n* @param - The array `findIndex` was called upon.\n* @param - A function to execute on each value in the array until the function returns true, indicating that the satisfying element was found.\n* @param - Returns defaultIndex if not found by the function.\n* @example\nimport { findIndex } from \"@daybrush/utils\";\n\nfindIndex([{a: 1}, {a: 2}, {a: 3}, {a: 4}], ({ a }) => a === 2); // 1\n*/\nfunction findIndex(arr, callback, defaultIndex) {\n if (defaultIndex === void 0) {\n defaultIndex = -1;\n }\n var length = arr.length;\n for (var i = 0; i < length; ++i) {\n if (callback(arr[i], i, arr)) {\n return i;\n }\n }\n return defaultIndex;\n}\n/**\n* Returns the reverse direction index of the first element in the array that satisfies the provided testing function.\n* @function\n* @memberof CrossBrowser\n* @param - The array `findLastIndex` was called upon.\n* @param - A function to execute on each value in the array until the function returns true, indicating that the satisfying element was found.\n* @param - Returns defaultIndex if not found by the function.\n* @example\nimport { findLastIndex } from \"@daybrush/utils\";\n\nfindLastIndex([{a: 1}, {a: 2}, {a: 3}, {a: 4}], ({ a }) => a === 2); // 1\n*/\nfunction findLastIndex(arr, callback, defaultIndex) {\n if (defaultIndex === void 0) {\n defaultIndex = -1;\n }\n var length = arr.length;\n for (var i = length - 1; i >= 0; --i) {\n if (callback(arr[i], i, arr)) {\n return i;\n }\n }\n return defaultIndex;\n}\n/**\n* Returns the value of the reverse direction element in the array that satisfies the provided testing function.\n* @function\n* @memberof CrossBrowser\n* @param - The array `findLast` was called upon.\n* @param - A function to execute on each value in the array,\n* @param - Returns defalutValue if not found by the function.\n* @example\nimport { find } from \"@daybrush/utils\";\n\nfind([{a: 1}, {a: 2}, {a: 3}, {a: 4}], ({ a }) => a === 2); // {a: 2}\n*/\nfunction findLast(arr, callback, defalutValue) {\n var index = findLastIndex(arr, callback);\n return index > -1 ? arr[index] : defalutValue;\n}\n/**\n* Returns the value of the first element in the array that satisfies the provided testing function.\n* @function\n* @memberof CrossBrowser\n* @param - The array `find` was called upon.\n* @param - A function to execute on each value in the array,\n* @param - Returns defalutValue if not found by the function.\n* @example\nimport { find } from \"@daybrush/utils\";\n\nfind([{a: 1}, {a: 2}, {a: 3}, {a: 4}], ({ a }) => a === 2); // {a: 2}\n*/\nfunction find(arr, callback, defalutValue) {\n var index = findIndex(arr, callback);\n return index > -1 ? arr[index] : defalutValue;\n}\n/**\n* window.requestAnimationFrame() method with cross browser.\n* @function\n* @memberof CrossBrowser\n* @param {FrameRequestCallback} callback - The function to call when it's time to update your animation for the next repaint.\n* @return {number} id\n* @example\nimport {requestAnimationFrame} from \"@daybrush/utils\";\n\nrequestAnimationFrame((timestamp) => {\n console.log(timestamp);\n});\n*/\nvar requestAnimationFrame = /*#__PURE__*/function () {\n var firstTime = now();\n var raf = IS_WINDOW && (window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame);\n return raf ? raf.bind(window) : function (callback) {\n var currTime = now();\n var id = setTimeout(function () {\n callback(currTime - firstTime);\n }, 1000 / 60);\n return id;\n };\n}();\n/**\n* window.cancelAnimationFrame() method with cross browser.\n* @function\n* @memberof CrossBrowser\n* @param {number} handle - the id obtained through requestAnimationFrame method\n* @return {void}\n* @example\nimport { requestAnimationFrame, cancelAnimationFrame } from \"@daybrush/utils\";\n\nconst id = requestAnimationFrame((timestamp) => {\n console.log(timestamp);\n});\n\ncancelAnimationFrame(id);\n*/\nvar cancelAnimationFrame = /*#__PURE__*/function () {\n var caf = IS_WINDOW && (window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.msCancelAnimationFrame);\n return caf ? caf.bind(window) : function (handle) {\n clearTimeout(handle);\n };\n}();\n/**\n* @function\n* @memberof Utils\n*/\nfunction getKeys(obj) {\n return Object.keys(obj);\n}\n/**\n* @function\n* @memberof Utils\n*/\nfunction getValues(obj) {\n var keys = getKeys(obj);\n return keys.map(function (key) {\n return obj[key];\n });\n}\n/**\n* @function\n* @memberof Utils\n*/\nfunction getEntries(obj) {\n var keys = getKeys(obj);\n return keys.map(function (key) {\n return [key, obj[key]];\n });\n}\n/**\n* @function\n* @memberof Utils\n*/\nfunction sortOrders(keys, orders) {\n if (orders === void 0) {\n orders = [];\n }\n keys.sort(function (a, b) {\n var index1 = orders.indexOf(a);\n var index2 = orders.indexOf(b);\n if (index2 === -1 && index1 === -1) {\n return 0;\n }\n if (index1 === -1) {\n return 1;\n }\n if (index2 === -1) {\n return -1;\n }\n return index1 - index2;\n });\n}\n/**\n* convert unit size to px size\n* @function\n* @memberof Utils\n*/\nfunction convertUnitSize(pos, size) {\n var _a = splitUnit(pos),\n value = _a.value,\n unit = _a.unit;\n if (isObject(size)) {\n var sizeFunction = size[unit];\n if (sizeFunction) {\n if (isFunction(sizeFunction)) {\n return sizeFunction(value);\n } else if (DEFAULT_UNIT_PRESETS[unit]) {\n return DEFAULT_UNIT_PRESETS[unit](value, sizeFunction);\n }\n }\n } else if (unit === \"%\") {\n return value * size / 100;\n }\n if (DEFAULT_UNIT_PRESETS[unit]) {\n return DEFAULT_UNIT_PRESETS[unit](value);\n }\n return value;\n}\n/**\n* calculate between min, max\n* @function\n* @memberof Utils\n*/\nfunction between(value, min, max) {\n return Math.max(min, Math.min(value, max));\n}\nfunction checkBoundSize(targetSize, compareSize, isMax, ratio) {\n if (ratio === void 0) {\n ratio = targetSize[0] / targetSize[1];\n }\n return [[throttle(compareSize[0], TINY_NUM), throttle(compareSize[0] / ratio, TINY_NUM)], [throttle(compareSize[1] * ratio, TINY_NUM), throttle(compareSize[1], TINY_NUM)]].filter(function (size) {\n return size.every(function (value, i) {\n var defaultSize = compareSize[i];\n var throttledSize = throttle(defaultSize, TINY_NUM);\n return isMax ? value <= defaultSize || value <= throttledSize : value >= defaultSize || value >= throttledSize;\n });\n })[0] || targetSize;\n}\n/**\n* calculate bound size\n* @function\n* @memberof Utils\n*/\nfunction calculateBoundSize(size, minSize, maxSize, keepRatio) {\n if (!keepRatio) {\n return size.map(function (value, i) {\n return between(value, minSize[i], maxSize[i]);\n });\n }\n var width = size[0],\n height = size[1];\n var ratio = keepRatio === true ? width / height : keepRatio;\n // width : height = minWidth : minHeight;\n var _a = checkBoundSize(size, minSize, false, ratio),\n minWidth = _a[0],\n minHeight = _a[1];\n var _b = checkBoundSize(size, maxSize, true, ratio),\n maxWidth = _b[0],\n maxHeight = _b[1];\n if (width < minWidth || height < minHeight) {\n width = minWidth;\n height = minHeight;\n } else if (width > maxWidth || height > maxHeight) {\n width = maxWidth;\n height = maxHeight;\n }\n return [width, height];\n}\n/**\n* Add all the numbers.\n* @function\n* @memberof Utils\n*/\nfunction sum(nums) {\n var length = nums.length;\n var total = 0;\n for (var i = length - 1; i >= 0; --i) {\n total += nums[i];\n }\n return total;\n}\n/**\n* Average all numbers.\n* @function\n* @memberof Utils\n*/\nfunction average(nums) {\n var length = nums.length;\n var total = 0;\n for (var i = length - 1; i >= 0; --i) {\n total += nums[i];\n }\n return length ? total / length : 0;\n}\n/**\n* Get the angle of two points. (0 <= rad < 359)\n* @function\n* @memberof Utils\n*/\nfunction getRad(pos1, pos2) {\n var distX = pos2[0] - pos1[0];\n var distY = pos2[1] - pos1[1];\n var rad = Math.atan2(distY, distX);\n return rad >= 0 ? rad : rad + Math.PI * 2;\n}\n/**\n* Get the average point of all points.\n* @function\n* @memberof Utils\n*/\nfunction getCenterPoint(points) {\n return [0, 1].map(function (i) {\n return average(points.map(function (pos) {\n return pos[i];\n }));\n });\n}\n/**\n* Gets the direction of the shape.\n* @function\n* @memberof Utils\n*/\nfunction getShapeDirection(points) {\n var center = getCenterPoint(points);\n var pos1Rad = getRad(center, points[0]);\n var pos2Rad = getRad(center, points[1]);\n return pos1Rad < pos2Rad && pos2Rad - pos1Rad < Math.PI || pos1Rad > pos2Rad && pos2Rad - pos1Rad < -Math.PI ? 1 : -1;\n}\n/**\n* Get the distance between two points.\n* @function\n* @memberof Utils\n*/\nfunction getDist(a, b) {\n return Math.sqrt(Math.pow((b ? b[0] : 0) - a[0], 2) + Math.pow((b ? b[1] : 0) - a[1], 2));\n}\n/**\n* throttle number depending on the unit.\n* @function\n* @memberof Utils\n*/\nfunction throttle(num, unit) {\n if (!unit) {\n return num;\n }\n var reverseUnit = 1 / unit;\n return Math.round(num / unit) / reverseUnit;\n}\n/**\n* throttle number array depending on the unit.\n* @function\n* @memberof Utils\n*/\nfunction throttleArray(nums, unit) {\n nums.forEach(function (_, i) {\n nums[i] = throttle(nums[i], unit);\n });\n return nums;\n}\n/**\n* @function\n* @memberof Utils\n*/\nfunction counter(num) {\n var nums = [];\n for (var i = 0; i < num; ++i) {\n nums.push(i);\n }\n return nums;\n}\n/**\n* @function\n* @memberof Utils\n*/\nfunction replaceOnce(text, fromText, toText) {\n var isOnce = false;\n return text.replace(fromText, function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (isOnce) {\n return args[0];\n }\n isOnce = true;\n return isString(toText) ? toText : toText.apply(void 0, args);\n });\n}\n/**\n* @function\n* @memberof Utils\n*/\nfunction flat(arr) {\n return arr.reduce(function (prev, cur) {\n return prev.concat(cur);\n }, []);\n}\n/**\n* @function\n* @memberof Utils\n*/\nfunction deepFlat(arr) {\n return arr.reduce(function (prev, cur) {\n if (isArray(cur)) {\n prev.push.apply(prev, deepFlat(cur));\n } else {\n prev.push(cur);\n }\n return prev;\n }, []);\n}\n/**\n * @function\n * @memberof Utils\n */\nfunction pushSet(elements, element) {\n if (elements.indexOf(element) === -1) {\n elements.push(element);\n }\n}\n\n/**\n* @namespace\n* @name Color\n*/\n/**\n* Remove the # from the hex color.\n* @memberof Color\n* @param {} hex - hex color\n* @return {} hex color\n* @example\nimport {cutHex} from \"@daybrush/utils\";\n\nconsole.log(cutHex(\"#000000\")) // \"000000\"\n*/\nfunction cutHex(hex) {\n return hex.replace(\"#\", \"\");\n}\n/**\n* convert hex color to rgb color.\n* @memberof Color\n* @param {} hex - hex color\n* @return {} rgb color\n* @example\nimport {hexToRGBA} from \"@daybrush/utils\";\n\nconsole.log(hexToRGBA(\"#00000005\"));\n// [0, 0, 0, 1]\nconsole.log(hexToRGBA(\"#201045\"));\n// [32, 16, 69, 1]\n*/\nfunction hexToRGBA(hex) {\n var h = cutHex(hex);\n var r = parseInt(h.substring(0, 2), 16);\n var g = parseInt(h.substring(2, 4), 16);\n var b = parseInt(h.substring(4, 6), 16);\n var a = parseInt(h.substring(6, 8), 16) / 255;\n if (isNaN(a)) {\n a = 1;\n }\n return [r, g, b, a];\n}\n/**\n* convert 3(or 4)-digit hex color to 6(or 8)-digit hex color.\n* @memberof Color\n* @param {} hex - 3(or 4)-digit hex color\n* @return {} 6(or 8)-digit hex color\n* @example\nimport {toFullHex} from \"@daybrush/utils\";\n\nconsole.log(toFullHex(\"#123\")); // \"#112233\"\nconsole.log(toFullHex(\"#123a\")); // \"#112233aa\"\n*/\nfunction toFullHex(h) {\n var r = h.charAt(1);\n var g = h.charAt(2);\n var b = h.charAt(3);\n var a = h.charAt(4);\n var arr = [\"#\", r, r, g, g, b, b, a, a];\n return arr.join(\"\");\n}\n/**\n* convert hsl color to rgba color.\n* @memberof Color\n* @param {} hsl - hsl color(hue: 0 ~ 360, saturation: 0 ~ 1, lightness: 0 ~ 1, alpha: 0 ~ 1)\n* @return {} rgba color\n* @example\nimport {hslToRGBA} from \"@daybrush/utils\";\n\nconsole.log(hslToRGBA([150, 0.5, 0.4]));\n// [51, 153, 102, 1]\n*/\nfunction hslToRGBA(hsl) {\n var _a;\n var h = hsl[0];\n var s = hsl[1];\n var l = hsl[2];\n if (h < 0) {\n h += Math.floor((Math.abs(h) + 360) / 360) * 360;\n }\n h %= 360;\n var c = (1 - Math.abs(2 * l - 1)) * s;\n var x = c * (1 - Math.abs(h / 60 % 2 - 1));\n var m = l - c / 2;\n var rgb;\n if (h < 60) {\n rgb = [c, x, 0];\n } else if (h < 120) {\n rgb = [x, c, 0];\n } else if (h < 180) {\n rgb = [0, c, x];\n } else if (h < 240) {\n rgb = [0, x, c];\n } else if (h < 300) {\n rgb = [x, 0, c];\n } else if (h < 360) {\n rgb = [c, 0, x];\n } else {\n rgb = [0, 0, 0];\n }\n return [Math.round((rgb[0] + m) * 255), Math.round((rgb[1] + m) * 255), Math.round((rgb[2] + m) * 255), (_a = hsl[3]) !== null && _a !== void 0 ? _a : 1];\n}\n/**\n* convert string to rgba color.\n* @memberof Color\n* @param {} - 3-hex(#000), 4-hex(#0000) 6-hex(#000000), 8-hex(#00000000) or RGB(A), or HSL(A)\n* @return {} rgba color\n* @example\nimport {stringToRGBA} from \"@daybrush/utils\";\n\nconsole.log(stringToRGBA(\"#000000\")); // [0, 0, 0, 1]\nconsole.log(stringToRGBA(\"rgb(100, 100, 100)\")); // [100, 100, 100, 1]\nconsole.log(stringToRGBA(\"hsl(150, 0.5, 0.4)\")); // [51, 153, 102, 1]\n*/\nfunction stringToRGBA(color) {\n if (color.charAt(0) === \"#\") {\n if (color.length === 4 || color.length === 5) {\n return hexToRGBA(toFullHex(color));\n } else {\n return hexToRGBA(color);\n }\n } else if (color.indexOf(\"(\") !== -1) {\n // in bracket.\n var _a = splitBracket(color),\n prefix = _a.prefix,\n value = _a.value;\n if (!prefix || !value) {\n return undefined;\n }\n var arr = splitComma(value);\n var colorArr = [0, 0, 0, 1];\n var length = arr.length;\n switch (prefix) {\n case RGB:\n case RGBA:\n for (var i = 0; i < length; ++i) {\n colorArr[i] = parseFloat(arr[i]);\n }\n return colorArr;\n case HSL:\n case HSLA:\n for (var i = 0; i < length; ++i) {\n if (arr[i].indexOf(\"%\") !== -1) {\n colorArr[i] = parseFloat(arr[i]) / 100;\n } else {\n colorArr[i] = parseFloat(arr[i]);\n }\n }\n // hsl, hsla to rgba\n return hslToRGBA(colorArr);\n }\n }\n return undefined;\n}\n\n/**\n * Returns all element descendants of node that\n * match selectors.\n */\n/**\n * Checks if the specified class value exists in the element's class attribute.\n * @memberof DOM\n * @param - A DOMString containing one or more selectors to match\n * @param - If multi is true, a DOMString containing one or more selectors to match against.\n * @example\nimport {$} from \"@daybrush/utils\";\n\nconsole.log($(\"div\")); // div element\nconsole.log($(\"div\", true)); // [div, div] elements\n*/\nfunction $(selectors, multi) {\n if (!doc) {\n return multi ? [] : null;\n }\n return multi ? doc.querySelectorAll(selectors) : doc.querySelector(selectors);\n}\n/**\n* Checks if the specified class value exists in the element's class attribute.\n* @memberof DOM\n* @param element - target\n* @param className - the class name to search\n* @return {boolean} return false if the class is not found.\n* @example\nimport {hasClass} from \"@daybrush/utils\";\n\nconsole.log(hasClass(element, \"start\")); // true or false\n*/\nfunction hasClass(element, className) {\n if (element.classList) {\n return element.classList.contains(className);\n }\n return !!element.className.match(new RegExp(\"(\\\\s|^)\" + className + \"(\\\\s|$)\"));\n}\n/**\n* Add the specified class value. If these classe already exist in the element's class attribute they are ignored.\n* @memberof DOM\n* @param element - target\n* @param className - the class name to add\n* @example\nimport {addClass} from \"@daybrush/utils\";\n\naddClass(element, \"start\");\n*/\nfunction addClass(element, className) {\n if (element.classList) {\n element.classList.add(className);\n } else {\n element.className += \" \" + className;\n }\n}\n/**\n* Removes the specified class value.\n* @memberof DOM\n* @param element - target\n* @param className - the class name to remove\n* @example\nimport {removeClass} from \"@daybrush/utils\";\n\nremoveClass(element, \"start\");\n*/\nfunction removeClass(element, className) {\n if (element.classList) {\n element.classList.remove(className);\n } else {\n var reg = new RegExp(\"(\\\\s|^)\" + className + \"(\\\\s|$)\");\n element.className = element.className.replace(reg, \" \");\n }\n}\n/**\n* Gets the CSS properties from the element.\n* @memberof DOM\n* @param elements - elements\n* @param properites - the CSS properties\n* @return returns CSS properties and values.\n* @example\nimport {fromCSS} from \"@daybrush/utils\";\n\nconsole.log(fromCSS(element, [\"left\", \"opacity\", \"top\"])); // {\"left\": \"10px\", \"opacity\": 1, \"top\": \"10px\"}\n*/\nfunction fromCSS(elements, properties) {\n if (!elements || !properties || !properties.length) {\n return {};\n }\n var element;\n if (elements instanceof Element) {\n element = elements;\n } else if (elements.length) {\n element = elements[0];\n } else {\n return {};\n }\n var cssObject = {};\n var styles = getWindow(element).getComputedStyle(element);\n var length = properties.length;\n for (var i = 0; i < length; ++i) {\n cssObject[properties[i]] = styles[properties[i]];\n }\n return cssObject;\n}\n/**\n* Sets up a function that will be called whenever the specified event is delivered to the target\n* @memberof DOM\n* @param - event target\n* @param - A case-sensitive string representing the event type to listen for.\n* @param - The object which receives a notification (an object that implements the Event interface) when an event of the specified type occurs\n* @param - An options object that specifies characteristics about the event listener.\n* @example\nimport {addEvent} from \"@daybrush/utils\";\n\naddEvent(el, \"click\", e => {\n console.log(e);\n});\n*/\nfunction addEvent(el, type, listener, options) {\n el.addEventListener(type, listener, options);\n}\n/**\n* removes from the EventTarget an event listener previously registered with EventTarget.addEventListener()\n* @memberof DOM\n* @param - event target\n* @param - A case-sensitive string representing the event type to listen for.\n* @param - The EventListener function of the event handler to remove from the event target.\n* @param - An options object that specifies characteristics about the event listener.\n* @example\nimport {addEvent, removeEvent} from \"@daybrush/utils\";\nconst listener = e => {\n console.log(e);\n};\naddEvent(el, \"click\", listener);\nremoveEvent(el, \"click\", listener);\n*/\nfunction removeEvent(el, type, listener, options) {\n el.removeEventListener(type, listener, options);\n}\nfunction getDocument(el) {\n return (el === null || el === void 0 ? void 0 : el.ownerDocument) || doc;\n}\nfunction getDocumentElement(el) {\n return getDocument(el).documentElement;\n}\nfunction getDocumentBody(el) {\n return getDocument(el).body;\n}\nfunction getWindow(el) {\n var _a;\n return ((_a = el === null || el === void 0 ? void 0 : el.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView) || window;\n}\nfunction isWindow(val) {\n return val && \"postMessage\" in val && \"blur\" in val && \"self\" in val;\n}\nfunction isNode(el) {\n return isObject(el) && el.nodeName && el.nodeType && \"ownerDocument\" in el;\n}\n\nexport { RGB, RGBA, HSL, HSLA, COLOR_MODELS, FUNCTION, PROPERTY, ARRAY, OBJECT, STRING, NUMBER, UNDEFINED, IS_WINDOW, doc as document, getCrossBrowserProperty, TRANSFORM, FILTER, ANIMATION, KEYFRAMES, OPEN_CLOSED_CHARACTERS, TINY_NUM, REVERSE_TINY_NUM, DEFAULT_UNIT_PRESETS, cutHex, hexToRGBA, toFullHex, hslToRGBA, stringToRGBA, dot, isUndefined, isObject, isArray, isString, isNumber, isFunction, splitText, splitSpace, splitComma, splitBracket, splitUnit, camelize, decamelize, toArray, now, findIndex, findLastIndex, findLast, find, requestAnimationFrame, cancelAnimationFrame, getKeys, getValues, getEntries, sortOrders, convertUnitSize, between, checkBoundSize, calculateBoundSize, sum, average, getRad, getCenterPoint, getShapeDirection, getDist, throttle, throttleArray, counter, replaceOnce, flat, deepFlat, pushSet, $, hasClass, addClass, removeClass, fromCSS, addEvent, removeEvent, getDocument, getDocumentElement, getDocumentBody, getWindow, isWindow, isNode };\n//# sourceMappingURL=utils.esm.js.map\n","import { isArray, deepFlat, find } from \"@daybrush/utils\";\nimport { GroupChild, TargetGroupsObject, TargetGroupsType } from \"./types\";\n\nexport class Child {\n public type: \"group\" | \"root\" | \"single\" = \"single\";\n public depth = 0;\n protected _scope: string[] = [];\n constructor(public parent?: ArrayChild) {\n if (parent) {\n this.depth = parent.depth + 1;\n }\n }\n\n public get scope(): string[] {\n const parent = this.parent;\n\n if (!parent || parent.type === \"root\") {\n return [];\n }\n return [...parent.scope, parent.id];\n }\n}\n\nexport class SingleChild extends Child {\n public type = \"single\" as const;\n public isGroupElement = false;\n constructor(parent: ArrayChild, public value: HTMLElement | SVGElement) {\n super(parent);\n }\n}\n\n\nexport class ArrayChild extends Child {\n public type: \"group\" | \"root\" = \"group\";\n public value: GroupChild[] = [];\n public id = \"\";\n public groupElement?: HTMLElement | SVGElement | null = null;\n public map: Map = new Map();\n\n public compare(groups: TargetGroupsType, checker: -1 | 0 | 1 = 0) {\n const elements = deepFlat(groups);\n const map = this.map;\n const elementsLength = elements.length;\n const mapSize = map.size;\n const sizeDiff = mapSize - elementsLength;\n\n // 1 this > groups\n // 0 this = groups\n // -1 this < groups\n const count = elements.filter(element => map.has(element)).length;\n\n if ((checker > 0 && sizeDiff >= 0) || (checker === 0 && sizeDiff === 0)) {\n return elementsLength === count;\n } else if (checker < 0 && sizeDiff <= 0) {\n return mapSize === count;\n }\n return false;\n }\n public has(target: HTMLElement | SVGElement) {\n return this.map.has(target);\n }\n public contains(element: HTMLElement | SVGElement): boolean {\n if (this.has(element)) {\n return true;\n }\n return this.value.some(child => {\n if (child.type === \"group\") {\n return child.contains(element);\n } else {\n return false;\n }\n });\n }\n public findContainedChild(element: HTMLElement | SVGElement) {\n return find(this.value, child => {\n if (child.type === \"single\") {\n return child.value === element;\n } else {\n return child.contains(element);\n }\n });\n }\n /**\n * Exact group containing targets\n */\n public findExactChild(target: TargetGroupsType[0]): GroupChild | undefined {\n const map = this.map;\n\n if (!isArray(target)) {\n return map.get(target);\n }\n const flatted = deepFlat(target);\n const length = flatted.length;\n const single = map.get(flatted[0]);\n\n if (!single) {\n return;\n }\n\n let parent: ArrayChild | undefined = single.parent;\n\n while (parent) {\n if (parent.map.size >= length) {\n return parent;\n }\n parent = parent.parent;\n }\n return;\n }\n public findCommonParent(targets: TargetGroupsType): ArrayChild {\n let depth = Infinity;\n let childs = targets.map(target => this.findExactChild(target));\n\n childs.forEach(child => {\n if (!child) {\n return;\n }\n depth = Math.min(child.depth, depth);\n });\n\n while (depth) {\n --depth;\n childs = childs.map(child => {\n let parent: GroupChild | undefined = child;\n\n while (parent && parent.depth !== depth) {\n parent = parent.parent;\n }\n\n return parent;\n });\n const firstChild = childs.find(child => child);\n\n if (!firstChild) {\n return this;\n }\n if (childs.every(child => !child || child === firstChild)) {\n break;\n }\n }\n const commonParent = childs.find(child => child) as ArrayChild;\n\n return commonParent || this;\n }\n public findNextChild(\n target: HTMLElement | SVGElement,\n range: TargetGroupsType = this.toTargetGroups(),\n isExact = true,\n ): ArrayChild | null {\n let nextChild: ArrayChild | null = null;\n\n const length = range.length;\n\n range.some(child => {\n if (!isExact && length === 1 && isArray(child)) {\n nextChild = this.findNextChild(target, child);\n return nextChild;\n }\n\n\n const nextGroupChild = this.findExactChild(child);\n\n if (!nextGroupChild) {\n return;\n }\n\n if (\"map\" in nextGroupChild) {\n if (nextGroupChild.map.has(target)) {\n nextChild = nextGroupChild;\n return true;\n }\n }\n });\n\n return nextChild;\n }\n public findNextExactChild(\n target: HTMLElement | SVGElement,\n selected: Array,\n range: TargetGroupsType = this.toTargetGroups(),\n ): ArrayChild | null {\n // [[1, 2]] => group([1, 2]) exact\n // [[[1, 2], 3]] => group([1, 2])\n const nextChild = this.findNextChild(target, range, true);\n\n if (!nextChild) {\n return null;\n }\n\n if (nextChild.compare(selected, -1)) {\n return nextChild;\n }\n return null;\n }\n /**\n * Finds a group that does not overlap within the range and includes the target.\n */\n public findPureChild(\n target: HTMLElement | SVGElement,\n range: Array,\n ): ArrayChild | null {\n let nextGroupChild: ArrayChild | null = null;\n\n const childSelected = range.filter(element => this.has(element));\n\n if (!childSelected.length) {\n return this;\n }\n\n this.value.some(nextChild => {\n if (nextChild.type !== \"single\" && nextChild.has(target)) {\n nextGroupChild = nextChild.findPureChild(target, childSelected);\n\n if (nextGroupChild) {\n return true;\n }\n }\n });\n\n return nextGroupChild;\n }\n public findNextPureChild(\n target: HTMLElement | SVGElement,\n range: Array,\n ): ArrayChild | null {\n const nextChild = this.findNextChild(target);\n\n if (nextChild) {\n return nextChild.findPureChild(target, range);\n }\n return null;\n }\n public getSingleChild(): SingleChild | null {\n const groupElement = this.groupElement;\n\n if (groupElement) {\n const singleChild = this.parent?.value.find(t => t.value === groupElement);\n\n if (singleChild) {\n return singleChild as SingleChild;\n }\n }\n return null;\n }\n public toTargetGroups(): TargetGroupsType {\n return this.value.map(child => {\n if (child.type === \"single\") {\n return child.value;\n } else {\n return child.toTargetGroups();\n }\n });\n }\n public findArrayChild(targets: TargetGroupsType): ArrayChild | null {\n const {\n value,\n } = this;\n\n let result = false;\n\n if (this.type !== \"root\") {\n result = value.every(child => {\n if (child.type === \"single\") {\n return targets.some(target => child.value === target);\n } else {\n return targets.some(target => {\n return isArray(target) && child.findArrayChild(target);\n });\n }\n });\n // result = targets.every(target => {\n // if (isArray(target)) {\n // return value.some(child => {\n // return child.type === \"group\" && child.findArrayChild(target);\n // });\n // } else {\n // return map.get(target);\n // }\n // });\n }\n\n if (result && targets.length === value.length) {\n return this;\n } else {\n let childResult: ArrayChild | null = null;\n\n value.some(child => {\n if (child.type === \"group\") {\n childResult = child.findArrayChild(targets);\n\n return childResult;\n }\n });\n\n return childResult;\n }\n }\n public groupByPerfect(selected: Array) {\n return this.value.filter(child => {\n if (child.type !== \"single\") {\n return child.compare(selected, -1);\n }\n return selected.indexOf(child.value) > -1;\n }).map(child => {\n if (child.type !== \"single\") {\n const singleChild = child.getSingleChild();\n\n if (singleChild) {\n return singleChild;\n }\n }\n return child;\n });\n }\n public add(targets: TargetGroupsObject) {\n const {\n value,\n map,\n } = this;\n\n targets.forEach(child => {\n if (\"groupId\" in child) {\n const group = new ArrayChild(this);\n\n group.id = child.groupId;\n value.push(group);\n group.add(child.children);\n } else if (isArray(child)) {\n const group = new ArrayChild(this);\n\n value.push(group);\n group.add(child);\n } else {\n const element = \"current\" in child ? child.current : child;\n const single = new SingleChild(this, element!);\n\n value.push(single);\n map.set(element!, single);\n }\n });\n\n value.forEach(child => {\n if (child.type === \"single\") {\n map.set(child.value, child);\n } else {\n child.map.forEach((nextChild, element) => {\n map.set(element, nextChild);\n });\n }\n });\n\n value.forEach(child => {\n if (child.type !== \"single\") {\n return;\n }\n // single\n const singleElement = child.value;\n const groupChild = value.find(child2 => {\n if (child2.type === \"single\") {\n return;\n }\n const firstElement = [...child2.map.keys()][0];\n\n if (!firstElement) {\n return;\n }\n\n return singleElement.contains(firstElement);\n });\n\n (child as SingleChild).isGroupElement = !!groupChild;\n\n if (groupChild) {\n (groupChild as ArrayChild).groupElement = child.value;\n }\n });\n return parent;\n }\n}\n","/* eslint-disable no-cond-assign */\nimport { deepFlat, isArray } from \"@daybrush/utils\";\nimport { ArrayChild, SingleChild } from \"./groups\";\nimport { GroupChild, TargetGroupsObject, TargetGroupsType, TargetList } from \"./types\";\n\n\nexport function toTargetList(raw: GroupChild[]): TargetList {\n function targets(childs: GroupChild[] = []) {\n const arr: TargetGroupsType = [];\n\n childs.forEach((child) => {\n if (child.type === \"single\") {\n arr.push(child.value);\n } else {\n arr.push(targets(child.value));\n }\n });\n\n return arr;\n }\n\n return {\n raw: () => raw,\n targets() {\n return targets(this.raw());\n },\n flatten() {\n return deepFlat(this.targets());\n },\n };\n}\n\nexport class GroupManager extends ArrayChild {\n public type = \"root\" as const;\n private _targets: Array = [];\n\n constructor(\n targetGroups: TargetGroupsType,\n targets?: Array,\n ) {\n super();\n this.set(targetGroups, targets);\n }\n public set(\n targetGroups: TargetGroupsObject,\n targets: Array = [],\n ) {\n this.map = new Map();\n this.value = [];\n\n const map = this.map;\n const value = this.value;\n\n this.add(targetGroups);\n targets.forEach(target => {\n if (map.has(target)) {\n return;\n }\n const single = new SingleChild(this, target);\n\n single.depth = 1;\n value.push(single);\n map.set(target, single);\n });\n this._targets = targets;\n }\n public selectSubChilds(targets: TargetGroupsType, target: HTMLElement | SVGElement) {\n const root = this;\n const nextChild = root.findNextChild(target, targets, false);\n const targetChild = root.map.get(target);\n\n let nextChilds: GroupChild[] = [];\n\n if (nextChild) {\n nextChilds = [nextChild];\n } else if (targetChild) {\n nextChilds = [targetChild];\n } else {\n nextChilds = [];\n }\n\n return toTargetList(nextChilds);\n }\n public selectSingleChilds(\n targets: TargetGroupsType,\n added: Array,\n removed: Array,\n ) {\n const nextTargets = [...targets];\n\n // group can't be added, removed.\n removed.forEach(element => {\n const index = nextTargets.indexOf(element);\n\n if (index > -1) {\n nextTargets.splice(index, 1);\n }\n });\n\n // Targets can be added one by one\n added.forEach(element => {\n nextTargets.push(element);\n });\n\n return toTargetList(this.toChilds(nextTargets));\n }\n public selectCompletedChilds(\n targets: TargetGroupsType,\n added: Array,\n removed: Array,\n continueSelect?: boolean,\n ) {\n const nextTargets = [...targets];\n const startSelected = deepFlat(nextTargets);\n\n // group can be added, removed.\n removed.forEach(element => {\n // Single Target\n const index = nextTargets.indexOf(element);\n\n if (index > -1) {\n // single target or group\n nextTargets.splice(index, 1);\n return;\n }\n // Group Target\n const removedChild = continueSelect\n // Finds the nearest child for element and nextTargets.\n ? this.findNextChild(element, nextTargets)\n // Find the nearest exact child for element, all removed and nextTargets.\n : this.findNextExactChild(element, removed, nextTargets);\n\n if (removedChild) {\n const groupIndex = nextTargets.findIndex(target => {\n return isArray(target) && removedChild.compare(target);\n });\n\n if (groupIndex > -1) {\n nextTargets.splice(groupIndex, 1);\n }\n }\n });\n\n added.forEach(element => {\n const parentGroup = this._findParentGroup(element, startSelected);\n const nextChild = parentGroup.findContainedChild(element);\n\n if (nextChild?.type === \"group\") {\n const singleChild = nextChild.getSingleChild();\n\n if (singleChild) {\n nextTargets.push(singleChild.value);\n } else {\n nextTargets.push(nextChild.toTargetGroups());\n }\n return;\n }\n nextTargets.push(element);\n });\n return toTargetList(this.toChilds(nextTargets));\n }\n public selectSameDepthChilds(\n targets: TargetGroupsType,\n added: Array,\n removed: Array,\n continueSelect?: boolean,\n ) {\n const nextTargets = [...targets];\n const commonParent = this.findCommonParent(nextTargets);\n\n removed.forEach(element => {\n // Single Target\n const index = nextTargets.indexOf(element);\n\n if (index > -1) {\n // single target or group\n nextTargets.splice(index, 1);\n return;\n }\n const removedChild = continueSelect\n // Find the nearest exact child for element, all removed and nextTargets.\n ? commonParent.findNextExactChild(element, removed, nextTargets)\n // Finds the nearest child for element and nextTargets.\n : commonParent.findNextChild(element, nextTargets, true);\n\n if (removedChild) {\n const groupIndex = nextTargets.findIndex(target => {\n return isArray(target) && removedChild.compare(target);\n });\n\n if (groupIndex > -1) {\n nextTargets.splice(groupIndex, 1);\n }\n }\n });\n const addedChildren = commonParent.groupByPerfect(added);\n\n addedChildren.forEach(child => {\n if (child.type === \"single\") {\n nextTargets.push(child.value);\n } else {\n const groupIndex = nextTargets.findIndex(target => {\n return isArray(target) && child.compare(target, 1);\n });\n\n if (groupIndex > -1) {\n nextTargets.splice(groupIndex, 1);\n }\n nextTargets.push(child.toTargetGroups());\n }\n });\n return toTargetList(this.toChilds(nextTargets));\n }\n public toChilds(targets: TargetGroupsType): GroupChild[] {\n const childs: GroupChild[] = [];\n\n targets.forEach(target => {\n if (isArray(target)) {\n const arrayChild = this.findArrayChild(target);\n\n if (arrayChild) {\n const singleChild = arrayChild.getSingleChild();\n\n if (singleChild) {\n return singleChild;\n }\n childs.push(arrayChild);\n }\n } else {\n const single = this.map.get(target);\n\n if (single) {\n childs.push(single);\n } else {\n childs.push(new SingleChild(this, target));\n }\n }\n });\n\n return childs;\n }\n public findChild(element: HTMLElement | SVGElement, isAuto: true): SingleChild | ArrayChild;\n public findChild(\n element: HTMLElement | SVGElement,\n isAuto?: boolean,\n ): SingleChild | ArrayChild | undefined;\n public findChild(\n element: HTMLElement | SVGElement,\n isAuto?: boolean,\n ): SingleChild | ArrayChild | undefined {\n const value = this.map.get(element);\n\n if (isAuto) {\n return value || new SingleChild(this, element);\n }\n return value;\n }\n public findArrayChildById(id: string): ArrayChild | null {\n let value: ArrayChild | null = null;\n\n this.value.some(function find(child: GroupChild) {\n if (child.type !== \"single\") {\n if (child.id === id) {\n value = child;\n return true;\n } else {\n return child.value.some(find);\n }\n }\n });\n\n return value;\n }\n public group(targets: TargetGroupsType, flatten?: boolean): TargetGroupsType | null {\n const commonParent = this.findCommonParent(targets);\n const groupChilds = targets.map(target => {\n if (isArray(target)) {\n return this.findArrayChild(target);\n }\n return this.findChild(target);\n });\n const isGroupable = groupChilds.every(child => child?.parent === commonParent);\n\n if (!isGroupable) {\n return null;\n }\n const group = new ArrayChild(commonParent);\n const nextChilds = commonParent.value.filter(target => groupChilds.indexOf(target) === -1);\n\n if (!nextChilds.length) {\n return null;\n }\n nextChilds.unshift(group);\n group.add(flatten ? deepFlat(targets) : targets);\n commonParent.value = nextChilds;\n\n this.set(this.toTargetGroups(), this._targets);\n\n return group.toTargetGroups();\n }\n public ungroup(targets: TargetGroupsType) {\n if (targets.length === 1 && isArray(targets[0])) {\n targets = targets[0];\n }\n const commonParent = this.findCommonParent(targets);\n const groupChilds = targets.map(target => {\n if (isArray(target)) {\n return this.findArrayChild(target);\n }\n return this.findChild(target);\n });\n\n if (commonParent.groupElement) {\n return null;\n }\n\n // all children is targets\n const isGroupable = commonParent.value.every(child => groupChilds.indexOf(child) > -1);\n\n if (!isGroupable || commonParent === this) {\n // has no group\n return null;\n }\n\n const parent = commonParent.parent;\n\n if (!parent) {\n return null;\n }\n const nextChilds = parent.value.filter(target => target !== commonParent);\n\n nextChilds.push(...commonParent.value);\n parent.value = nextChilds;\n\n this.set(this.toTargetGroups(), this._targets);\n return commonParent.toTargetGroups();\n }\n protected _findParentGroup(\n element: HTMLElement | SVGElement,\n range: Array,\n ) {\n if (!range.length) {\n return this;\n }\n const single = this.map.get(element);\n\n if (!single) {\n return this;\n }\n let parent: ArrayChild | undefined = single.parent;\n\n while (parent) {\n if (range.some(element => parent!.contains(element))) {\n return parent;\n }\n parent = parent.parent;\n }\n return this;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC/C,QAAA,OAAO,YAAY,CAAC,cAAc,EAAE,CAAC;SACxC,CAAA;IACS,IAAA,YAAA,CAAA,SAAA,CAAA,gBAAgB,GAA1B,UACI,OAAiC,EACjC,KAAsC,EAAA;IAEtC,QAAA,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;IACf,YAAA,OAAO,IAAI,CAAC;IACf,SAAA;YACD,IAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAErC,IAAI,CAAC,MAAM,EAAE;IACT,YAAA,OAAO,IAAI,CAAC;IACf,SAAA;IACD,QAAA,IAAI,MAAM,GAA2B,MAAM,CAAC,MAAM,CAAC;IAEnD,QAAA,OAAO,MAAM,EAAE;IACX,YAAA,IAAI,KAAK,CAAC,IAAI,CAAC,UAAA,OAAO,EAAI,EAAA,OAAA,MAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAzB,EAAyB,CAAC,EAAE;IAClD,gBAAA,OAAO,MAAM,CAAC;IACjB,aAAA;IACD,YAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1B,SAAA;IACD,QAAA,OAAO,IAAI,CAAC;SACf,CAAA;QACL,OAAC,YAAA,CAAA;IAAD,CAvUA,CAAkC,UAAU,CAuU3C,CAAA;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0]} \ No newline at end of file diff --git a/helper/release/0.52.0/dist/helper.min.js b/helper/release/0.52.0/dist/helper.min.js new file mode 100644 index 000000000..1f4254c53 --- /dev/null +++ b/helper/release/0.52.0/dist/helper.min.js @@ -0,0 +1,10 @@ +/* +Copyright (c) Daybrush +name: @moveable/helper +license: MIT +author: Daybrush +repository: https://github.com/daybrush/moveable/blob/master/packages/helper +version: 0.1.3 +*/ +!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t="undefined"!=typeof globalThis?globalThis:t||self).MoveableHelper=n()}(this,(function(){"use strict";var t=function(n,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])},t(n,r)};function n(n,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function e(){this.constructor=n}t(n,r),n.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}function r(t,n){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var e,i,o=r.call(t),u=[];try{for(;(void 0===n||n-- >0)&&!(e=o.next()).done;)u.push(e.value)}catch(t){i={error:t}}finally{try{e&&!e.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return u}function e(t,n,r){if(r||2===arguments.length)for(var e,i=0,o=n.length;i0&&a>=0||0===n&&0===a?i===f:n<0&&a<=0&&u===f},u.prototype.has=function(t){return this.map.has(t)},u.prototype.contains=function(t){return!!this.has(t)||this.value.some((function(n){return"group"===n.type&&n.contains(t)}))},u.prototype.findContainedChild=function(t){return n=this.value,e=function(t,n,r){void 0===r&&(r=-1);for(var e=t.length,i=0;i-1?n[e]:r;var n,r,e},u.prototype.findExactChild=function(t){var n=this.map;if(!i(t))return n.get(t);var r=o(t),e=r.length,u=n.get(r[0]);if(u)for(var a=u.parent;a;){if(a.map.size>=e)return a;a=a.parent}},u.prototype.findCommonParent=function(t){var n=this,r=1/0,e=t.map((function(t){return n.findExactChild(t)}));e.forEach((function(t){t&&(r=Math.min(t.depth,r))}));for(var i=function(){--r;var t=(e=e.map((function(t){for(var n=t;n&&n.depth!==r;)n=n.parent;return n}))).find((function(t){return t}));return t?e.every((function(n){return!n||n===t}))?"break":void 0:{value:o}},o=this;r;){var u=i();if("object"==typeof u)return u.value;if("break"===u)break}return e.find((function(t){return t}))||this},u.prototype.findNextChild=function(t,n,r){var e=this;void 0===n&&(n=this.toTargetGroups()),void 0===r&&(r=!0);var o=null,u=n.length;return n.some((function(n){if(!r&&1===u&&i(n))return o=e.findNextChild(t,n);var a=e.findExactChild(n);return a&&"map"in a&&a.map.has(t)?(o=a,!0):void 0})),o},u.prototype.findNextExactChild=function(t,n,r){void 0===r&&(r=this.toTargetGroups());var e=this.findNextChild(t,r,!0);return e&&e.compare(n,-1)?e:null},u.prototype.findPureChild=function(t,n){var r=this,e=null,i=n.filter((function(t){return r.has(t)}));return i.length?(this.value.some((function(n){if("single"!==n.type&&n.has(t)&&(e=n.findPureChild(t,i)))return!0})),e):this},u.prototype.findNextPureChild=function(t,n){var r=this.findNextChild(t);return r?r.findPureChild(t,n):null},u.prototype.getSingleChild=function(){var t,n=this.groupElement;if(n){var r=null===(t=this.parent)||void 0===t?void 0:t.value.find((function(t){return t.value===n}));if(r)return r}return null},u.prototype.toTargetGroups=function(){return this.value.map((function(t){return"single"===t.type?t.value:t.toTargetGroups()}))},u.prototype.findArrayChild=function(t){var n=this.value,r=!1;if("root"!==this.type&&(r=n.every((function(n){return"single"===n.type?t.some((function(t){return n.value===t})):t.some((function(t){return i(t)&&n.findArrayChild(t)}))}))),r&&t.length===n.length)return this;var e=null;return n.some((function(n){if("group"===n.type)return e=n.findArrayChild(t)})),e},u.prototype.groupByPerfect=function(t){return this.value.filter((function(n){return"single"!==n.type?n.compare(t,-1):t.indexOf(n.value)>-1})).map((function(t){if("single"!==t.type){var n=t.getSingleChild();if(n)return n}return t}))},u.prototype.add=function(t){var n=this,o=this.value,f=this.map;return t.forEach((function(t){if("groupId"in t)(r=new u(n)).id=t.groupId,o.push(r),r.add(t.children);else if(i(t)){var r=new u(n);o.push(r),r.add(t)}else{var e="current"in t?t.current:t,l=new a(n,e);o.push(l),f.set(e,l)}})),o.forEach((function(t){"single"===t.type?f.set(t.value,t):t.map.forEach((function(t,n){f.set(n,t)}))})),o.forEach((function(t){if("single"===t.type){var n=t.value,i=o.find((function(t){if("single"!==t.type){var i=e([],r(t.map.keys()),!1)[0];if(i)return n.contains(i)}}));t.isGroupElement=!!i,i&&(i.groupElement=t.value)}})),parent},u}(u);function l(t){function n(t){void 0===t&&(t=[]);var r=[];return t.forEach((function(t){"single"===t.type?r.push(t.value):r.push(n(t.value))})),r}return{raw:function(){return t},targets:function(){return n(this.raw())},flatten:function(){return o(this.targets())}}}var p=function(t){function u(n,r){var e=t.call(this)||this;return e.type="root",e._targets=[],e.set(n,r),e}return n(u,t),u.prototype.set=function(t,n){var r=this;void 0===n&&(n=[]),this.map=new Map,this.value=[];var e=this.map,i=this.value;this.add(t),n.forEach((function(t){if(!e.has(t)){var n=new a(r,t);n.depth=1,i.push(n),e.set(t,n)}})),this._targets=n},u.prototype.selectSubChilds=function(t,n){var r=this.findNextChild(n,t,!1),e=this.map.get(n);return l(r?[r]:e?[e]:[])},u.prototype.selectSingleChilds=function(t,n,i){var o=e([],r(t),!1);return i.forEach((function(t){var n=o.indexOf(t);n>-1&&o.splice(n,1)})),n.forEach((function(t){o.push(t)})),l(this.toChilds(o))},u.prototype.selectCompletedChilds=function(t,n,u,a){var f=this,p=e([],r(t),!1),s=o(p);return u.forEach((function(t){var n=p.indexOf(t);if(n>-1)p.splice(n,1);else{var r=a?f.findNextChild(t,p):f.findNextExactChild(t,u,p);if(r){var e=p.findIndex((function(t){return i(t)&&r.compare(t)}));e>-1&&p.splice(e,1)}}})),n.forEach((function(t){var n=f._findParentGroup(t,s).findContainedChild(t);if("group"!==(null==n?void 0:n.type))p.push(t);else{var r=n.getSingleChild();r?p.push(r.value):p.push(n.toTargetGroups())}})),l(this.toChilds(p))},u.prototype.selectSameDepthChilds=function(t,n,o,u){var a=e([],r(t),!1),f=this.findCommonParent(a);return o.forEach((function(t){var n=a.indexOf(t);if(n>-1)a.splice(n,1);else{var r=u?f.findNextExactChild(t,o,a):f.findNextChild(t,a,!0);if(r){var e=a.findIndex((function(t){return i(t)&&r.compare(t)}));e>-1&&a.splice(e,1)}}})),f.groupByPerfect(n).forEach((function(t){if("single"===t.type)a.push(t.value);else{var n=a.findIndex((function(n){return i(n)&&t.compare(n,1)}));n>-1&&a.splice(n,1),a.push(t.toTargetGroups())}})),l(this.toChilds(a))},u.prototype.toChilds=function(t){var n=this,r=[];return t.forEach((function(t){if(i(t)){var e=n.findArrayChild(t);if(e){var o=e.getSingleChild();if(o)return o;r.push(e)}}else{var u=n.map.get(t);u?r.push(u):r.push(new a(n,t))}})),r},u.prototype.findChild=function(t,n){var r=this.map.get(t);return n?r||new a(this,t):r},u.prototype.findArrayChildById=function(t){var n=null;return this.value.some((function r(e){if("single"!==e.type)return e.id===t?(n=e,!0):e.value.some(r)})),n},u.prototype.group=function(t,n){var r=this,e=this.findCommonParent(t),u=t.map((function(t){return i(t)?r.findArrayChild(t):r.findChild(t)}));if(!u.every((function(t){return(null==t?void 0:t.parent)===e})))return null;var a=new f(e),l=e.value.filter((function(t){return-1===u.indexOf(t)}));return l.length?(l.unshift(a),a.add(n?o(t):t),e.value=l,this.set(this.toTargetGroups(),this._targets),a.toTargetGroups()):null},u.prototype.ungroup=function(t){var n=this;1===t.length&&i(t[0])&&(t=t[0]);var o=this.findCommonParent(t),u=t.map((function(t){return i(t)?n.findArrayChild(t):n.findChild(t)}));if(o.groupElement)return null;if(!o.value.every((function(t){return u.indexOf(t)>-1}))||o===this)return null;var a=o.parent;if(!a)return null;var f=a.value.filter((function(t){return t!==o}));return f.push.apply(f,e([],r(o.value),!1)),a.value=f,this.set(this.toTargetGroups(),this._targets),o.toTargetGroups()},u.prototype._findParentGroup=function(t,n){if(!n.length)return this;var r=this.map.get(t);if(!r)return this;for(var e=r.parent;e;){if(n.some((function(t){return e.contains(t)})))return e;e=e.parent}return this},u}(f);return{__proto__:null,ArrayChild:f,Child:u,GroupManager:p,SingleChild:a,toTargetList:l}})); +//# sourceMappingURL=helper.min.js.map diff --git a/helper/release/0.52.0/dist/helper.min.js.map b/helper/release/0.52.0/dist/helper.min.js.map new file mode 100644 index 000000000..f00fa6eb3 --- /dev/null +++ b/helper/release/0.52.0/dist/helper.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"helper.min.js","sources":[],"sourcesContent":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/release/0.52.0/dist/moveable.cjs.js b/release/0.52.0/dist/moveable.cjs.js new file mode 100644 index 000000000..6b13c9b56 --- /dev/null +++ b/release/0.52.0/dist/moveable.cjs.js @@ -0,0 +1,284 @@ +/* +Copyright (c) 2019 Daybrush +name: moveable +license: MIT +author: Daybrush +repository: https://github.com/daybrush/moveable/blob/master/packages/moveable +version: 0.52.0 +*/ +'use strict'; + +var frameworkUtils = require('framework-utils'); +var React = require('croact'); +var Moveable$1 = require('croact-moveable'); +var utils = require('@daybrush/utils'); +var EventEmitter = require('@scena/event-emitter'); + +function _interopNamespaceDefault(e) { + var n = Object.create(null); + if (e) { + Object.keys(e).forEach(function (k) { + if (k !== 'default') { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { return e[k]; } + }); + } + }); + } + n.default = e; + return n; +} + +var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React); + +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; + +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +var InnerMoveable = /*#__PURE__*/function (_super) { + __extends(InnerMoveable, _super); + + function InnerMoveable(props) { + var _this = _super.call(this, props) || this; + + _this.state = {}; + _this.state = _this.props; + return _this; + } + + var __proto = InnerMoveable.prototype; + + __proto.render = function () { + return React__namespace.createElement(Moveable$1, __assign({ + ref: frameworkUtils.ref(this, "moveable") + }, this.state)); + }; + + return InnerMoveable; +}(React__namespace.Component); + +var PROPERTIES = Moveable$1.MOVEABLE_PROPS; +var METHODS = Moveable$1.MOVEABLE_METHODS; +var EVENTS = Moveable$1.MOVEABLE_EVENTS; + +/** + * Moveable is Draggable! Resizable! Scalable! Rotatable! + * @sort 1 + * @alias Moveable + * @extends EventEmitter + */ + +var MoveableManager = /*#__PURE__*/function (_super) { + __extends(MoveableManager, _super); + /** + * + */ + + + function MoveableManager(parentElement, options) { + if (options === void 0) { + options = {}; + } + + var _this = _super.call(this) || this; + + _this.containerProvider = null; + _this.selfElement = null; + _this._warp = false; + + var nextOptions = __assign({}, options); + + var events = {}; + EVENTS.forEach(function (name) { + events[utils.camelize("on ".concat(name))] = function (e) { + return _this.trigger(name, e); + }; + }); + var selfElement; + + if (options.warpSelf) { + delete options.warpSelf; + _this._warp = true; + selfElement = parentElement; + } else { + selfElement = utils.getDocument(parentElement).createElement("div"); + parentElement.appendChild(selfElement); + } + + _this.containerProvider = React.renderSelf(React__namespace.createElement(InnerMoveable, __assign({ + ref: frameworkUtils.ref(_this, "innerMoveable") + }, nextOptions, events)), selfElement); + _this.selfElement = selfElement; + var target = nextOptions.target; + + if (utils.isArray(target) && target.length > 1) { + _this.updateRect(); + } + + return _this; + } + + var __proto = MoveableManager.prototype; + + __proto.setState = function (state, callback) { + this.innerMoveable.setState(state, callback); + }; + + __proto.forceUpdate = function (callback) { + this.innerMoveable.forceUpdate(callback); + }; + + __proto.dragStart = function (e) { + var innerMoveable = this.innerMoveable; + + if (innerMoveable.$_timer) { + this.forceUpdate(); + } + + this.getMoveable().dragStart(e); + }; + + __proto.destroy = function () { + var _a; + + var selfElement = this.selfElement; + React.renderSelf(null, selfElement, this.containerProvider); + + if (!this._warp) { + (_a = selfElement === null || selfElement === void 0 ? void 0 : selfElement.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(selfElement); + } + + this.containerProvider = null; + this.off(); + this.selfElement = null; + this.innerMoveable = null; + }; + + __proto.getMoveable = function () { + return this.innerMoveable.moveable; + }; + + MoveableManager = __decorate([frameworkUtils.Properties(METHODS, function (prototype, property) { + if (prototype[property]) { + return; + } + + prototype[property] = function () { + var args = []; + + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + + var self = this.getMoveable(); + + if (!self || !self[property]) { + return; + } + + return self[property].apply(self, args); + }; + }), frameworkUtils.Properties(PROPERTIES, function (prototype, property) { + Object.defineProperty(prototype, property, { + get: function () { + return this.getMoveable().props[property]; + }, + set: function (value) { + var _a; + + this.setState((_a = {}, _a[property] = value, _a)); + }, + enumerable: true, + configurable: true + }); + })], MoveableManager); + return MoveableManager; +}(EventEmitter); + +var Moveable = /*#__PURE__*/function (_super) { + __extends(Moveable, _super); + + function Moveable() { + return _super !== null && _super.apply(this, arguments) || this; + } + + return Moveable; +}(MoveableManager); + +function getElementInfo(target, container, rootContainer) { + return Moveable$1.getElementInfo(target, container, rootContainer); +} +function makeAble(name, able) { + return Moveable$1.makeAble(name, able); +} + +var modules = { + __proto__: null, + EVENTS: EVENTS, + METHODS: METHODS, + PROPERTIES: PROPERTIES, + default: Moveable, + getElementInfo: getElementInfo, + makeAble: makeAble +}; + +for (var name_1 in modules) { + Moveable[name_1] = modules[name_1]; +} + +module.exports = Moveable; + +exports.EVENTS = EVENTS; +exports.METHODS = METHODS; +exports.PROPERTIES = PROPERTIES; +exports.default = Moveable; +exports.getElementInfo = getElementInfo; +exports.makeAble = makeAble; +//# sourceMappingURL=moveable.cjs.js.map diff --git a/release/0.52.0/dist/moveable.cjs.js.map b/release/0.52.0/dist/moveable.cjs.js.map new file mode 100644 index 000000000..cab4aad2b --- /dev/null +++ b/release/0.52.0/dist/moveable.cjs.js.map @@ -0,0 +1 @@ +{"version":3,"file":"moveable.cjs.js","sources":["../src/InnerMoveable.tsx","../src/consts.ts","../src/MoveableManager.tsx","../src/Moveable.tsx","../src/utils.ts","../src/index.cjs.ts"],"sourcesContent":[null,null,null,null,null,null],"names":["InnerMoveable","_super","__extends","props","_this","call","state","render","React","Moveable","__assign","ref","Component","PROPERTIES","MOVEABLE_PROPS","METHODS","MOVEABLE_METHODS","EVENTS","MOVEABLE_EVENTS","MoveableManager","parentElement","options","containerProvider","selfElement","_warp","nextOptions","events","forEach","name","camelize","concat","e","trigger","warpSelf","getDocument","createElement","appendChild","renderSelf","target","isArray","length","updateRect","setState","callback","innerMoveable","forceUpdate","dragStart","$_timer","getMoveable","destroy","_a","removeChild","off","moveable","__decorate","Properties","prototype","property","args","_i","arguments","self","Object","defineProperty","get","set","value","enumerable","configurable","EventEmitter","getElementInfo","container","rootContainer","getElementInfoFunction","makeAble","able","makeAbleFunction","name_1","modules","module","exports"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAAA,aAAA,gBAAA,UAAAC,MAAA,EAAA;AAA2CC,EAAAA,SAAoB,CAAAF,aAAA,EAAAC,MAAA,CAApB,CAAA;;EAGvC,SAAAD,aAAA,CAAYG,KAAZ,EAAsB;IAAtB,IACIC,KAAA,GAAAH,MAAA,CAAAI,IAAA,CAAA,IAAA,EAAMF,KAAN,CAAA,IAEH,IAHD,CAAA;;IAFOC,KAAK,CAAAE,KAAL,GAAa,EAAb,CAAA;AAIHF,IAAAA,KAAI,CAACE,KAAL,GAAaF,KAAI,CAACD,KAAlB,CAAA;;AACH,GAAA;;AANL,EAAA,IAAA,OAAA,GAAA,aAAA,CAAA,SAAA,CAAA;;EAOW,OAAAI,CAAAA,MAAA,GAAP,YAAA;AACI,IAAA,OAAOC,8BAAA,CAACC,UAAD,EAASC,QAAA,CAAA;AAACC,MAAAA,GAAG,EAAEA,kBAAG,CAAC,IAAD,EAAO,UAAP,CAAA;AAAT,KAAA,EAAiC,IAAA,CAAKL,KAAtC,CAAT,CAAP,CAAA;GADG,CAAA;;AAGX,EAAA,OAACN,aAAD,CAAA;AAAC,CAVD,CAA2CQ,gBAAK,CAACI,SAAjD,CAAA;;ACEO,IAAMC,UAAU,GAAaC,0BAA7B;AACA,IAAMC,OAAO,GAAaC,4BAA1B;AACMC,IAAAA,MAAM,GAAaC;;ACIhC;;;;;AAKG;;AA4BH,IAAAC,eAAA,gBAAA,UAAAlB,MAAA,EAAA;AAA8BC,EAAAA,SAAsC,CAAAiB,eAAA,EAAAlB,MAAA,C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,IAAnB,EAAyB+C,IAAzB,CAAvB,CAAA;AACH;;;;;;;;;;;;ACbD,KAAK,IAAME,MAAX,IAAmBC,OAAnB,EAA4B;AACvBrE,EAAAA,QAAgB,CAACoE,MAAD,CAAhB,GAA0BC,OAAe,CAACD,MAAD,CAAzC,CAAA;AACJ,CAAA;;AAEDE,MAAM,CAACC,OAAP,GAAiBvE,QAAjB;;;;;;;;;"} \ No newline at end of file diff --git a/release/0.52.0/dist/moveable.esm.js b/release/0.52.0/dist/moveable.esm.js new file mode 100644 index 000000000..7cccdb3bc --- /dev/null +++ b/release/0.52.0/dist/moveable.esm.js @@ -0,0 +1,243 @@ +/* +Copyright (c) 2019 Daybrush +name: moveable +license: MIT +author: Daybrush +repository: https://github.com/daybrush/moveable/blob/master/packages/moveable +version: 0.52.0 +*/ +import { ref, Properties } from 'framework-utils'; +import * as React from 'croact'; +import { renderSelf } from 'croact'; +import Moveable$1, { MOVEABLE_PROPS, MOVEABLE_METHODS, MOVEABLE_EVENTS, getElementInfo as getElementInfo$1, makeAble as makeAble$1 } from 'croact-moveable'; +import { camelize, getDocument, isArray } from '@daybrush/utils'; +import EventEmitter from '@scena/event-emitter'; + +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; + +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +var InnerMoveable = /*#__PURE__*/function (_super) { + __extends(InnerMoveable, _super); + + function InnerMoveable(props) { + var _this = _super.call(this, props) || this; + + _this.state = {}; + _this.state = _this.props; + return _this; + } + + var __proto = InnerMoveable.prototype; + + __proto.render = function () { + return React.createElement(Moveable$1, __assign({ + ref: ref(this, "moveable") + }, this.state)); + }; + + return InnerMoveable; +}(React.Component); + +var PROPERTIES = MOVEABLE_PROPS; +var METHODS = MOVEABLE_METHODS; +var EVENTS = MOVEABLE_EVENTS; + +/** + * Moveable is Draggable! Resizable! Scalable! Rotatable! + * @sort 1 + * @alias Moveable + * @extends EventEmitter + */ + +var MoveableManager = /*#__PURE__*/function (_super) { + __extends(MoveableManager, _super); + /** + * + */ + + + function MoveableManager(parentElement, options) { + if (options === void 0) { + options = {}; + } + + var _this = _super.call(this) || this; + + _this.containerProvider = null; + _this.selfElement = null; + _this._warp = false; + + var nextOptions = __assign({}, options); + + var events = {}; + EVENTS.forEach(function (name) { + events[camelize("on ".concat(name))] = function (e) { + return _this.trigger(name, e); + }; + }); + var selfElement; + + if (options.warpSelf) { + delete options.warpSelf; + _this._warp = true; + selfElement = parentElement; + } else { + selfElement = getDocument(parentElement).createElement("div"); + parentElement.appendChild(selfElement); + } + + _this.containerProvider = renderSelf(React.createElement(InnerMoveable, __assign({ + ref: ref(_this, "innerMoveable") + }, nextOptions, events)), selfElement); + _this.selfElement = selfElement; + var target = nextOptions.target; + + if (isArray(target) && target.length > 1) { + _this.updateRect(); + } + + return _this; + } + + var __proto = MoveableManager.prototype; + + __proto.setState = function (state, callback) { + this.innerMoveable.setState(state, callback); + }; + + __proto.forceUpdate = function (callback) { + this.innerMoveable.forceUpdate(callback); + }; + + __proto.dragStart = function (e) { + var innerMoveable = this.innerMoveable; + + if (innerMoveable.$_timer) { + this.forceUpdate(); + } + + this.getMoveable().dragStart(e); + }; + + __proto.destroy = function () { + var _a; + + var selfElement = this.selfElement; + renderSelf(null, selfElement, this.containerProvider); + + if (!this._warp) { + (_a = selfElement === null || selfElement === void 0 ? void 0 : selfElement.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(selfElement); + } + + this.containerProvider = null; + this.off(); + this.selfElement = null; + this.innerMoveable = null; + }; + + __proto.getMoveable = function () { + return this.innerMoveable.moveable; + }; + + MoveableManager = __decorate([Properties(METHODS, function (prototype, property) { + if (prototype[property]) { + return; + } + + prototype[property] = function () { + var args = []; + + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + + var self = this.getMoveable(); + + if (!self || !self[property]) { + return; + } + + return self[property].apply(self, args); + }; + }), Properties(PROPERTIES, function (prototype, property) { + Object.defineProperty(prototype, property, { + get: function () { + return this.getMoveable().props[property]; + }, + set: function (value) { + var _a; + + this.setState((_a = {}, _a[property] = value, _a)); + }, + enumerable: true, + configurable: true + }); + })], MoveableManager); + return MoveableManager; +}(EventEmitter); + +var Moveable = /*#__PURE__*/function (_super) { + __extends(Moveable, _super); + + function Moveable() { + return _super !== null && _super.apply(this, arguments) || this; + } + + return Moveable; +}(MoveableManager); + +function getElementInfo(target, container, rootContainer) { + return getElementInfo$1(target, container, rootContainer); +} +function makeAble(name, able) { + return makeAble$1(name, able); +} + +export { EVENTS, METHODS, PROPERTIES, Moveable as default, getElementInfo, makeAble }; +//# sourceMappingURL=moveable.esm.js.map diff --git a/release/0.52.0/dist/moveable.esm.js.map b/release/0.52.0/dist/moveable.esm.js.map new file mode 100644 index 000000000..d29415508 --- /dev/null +++ b/release/0.52.0/dist/moveable.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"moveable.esm.js","sources":["../src/InnerMoveable.tsx","../src/consts.ts","../src/MoveableManager.tsx","../src/Moveable.tsx","../src/utils.ts"],"sourcesContent":["import * as React from \"react\";\nimport Moveable from \"react-moveable\";\nimport { ref } from \"framework-utils\";\n\nexport default class InnerMoveable extends React.Component {\n public state: any = {};\n public moveable!: Moveable;\n constructor(props: any) {\n super(props);\n this.state = this.props;\n }\n public render(): React.ReactNode {\n return ;\n }\n}\n","import {\n MOVEABLE_PROPS,\n MOVEABLE_METHODS,\n MOVEABLE_EVENTS,\n} from \"react-moveable\";\n\nexport const PROPERTIES: string[] = MOVEABLE_PROPS;\nexport const METHODS: string[] = MOVEABLE_METHODS;\nexport const EVENTS: string[] = MOVEABLE_EVENTS;\n","import { ref, Properties } from \"framework-utils\";\nimport * as React from \"react\";\nimport { renderSelf, ContainerProvider } from \"croact\";\nimport InnerMoveable from \"./InnerMoveable\";\nimport {\n MoveableInterface,\n MoveableOptions, MoveableProperties,\n} from \"react-moveable/types\";\nimport { camelize, getDocument, isArray } from \"@daybrush/utils\";\nimport { MoveableEventsParameters } from \"./types\";\nimport { PROPERTIES, EVENTS, METHODS } from \"./consts\";\nimport EventEmitter from \"@scena/event-emitter\";\n/**\n * Moveable is Draggable! Resizable! Scalable! Rotatable!\n * @sort 1\n * @alias Moveable\n * @extends EventEmitter\n */\n@Properties(METHODS, (prototype, property) => {\n if (prototype[property]) {\n return;\n }\n prototype[property] = function(...args: any[]) {\n const self = this.getMoveable();\n\n if (!self || !self[property]) {\n return;\n }\n return self[property](...args);\n };\n})\n@Properties(PROPERTIES, (prototype, property) => {\n Object.defineProperty(prototype, property, {\n get() {\n return this.getMoveable().props[property];\n },\n set(value) {\n this.setState({\n [property]: value,\n });\n },\n enumerable: true,\n configurable: true,\n });\n})\nclass MoveableManager extends EventEmitter {\n private innerMoveable!: InnerMoveable | null;\n private containerProvider: ContainerProvider | null = null;\n private selfElement: HTMLElement | null = null;\n private _warp = false;\n /**\n *\n */\n constructor(parentElement: HTMLElement, options: MoveableOptions = {}) {\n super();\n const nextOptions = { ...options };\n\n const events: any = {};\n\n EVENTS.forEach(name => {\n events[camelize(`on ${name}`)] = (e: any) => this.trigger(name, e);\n });\n let selfElement!: HTMLElement;\n\n if (options.warpSelf) {\n delete options.warpSelf;\n this._warp = true;\n selfElement = parentElement;\n } else {\n selfElement = getDocument(parentElement).createElement(\"div\");\n parentElement.appendChild(selfElement);\n }\n this.containerProvider = renderSelf(\n as any,\n selfElement,\n );\n\n this.selfElement = selfElement;\n const target = nextOptions.target!;\n if (isArray(target) && target.length > 1) {\n this.updateRect();\n }\n }\n public setState(state: Partial, callback?: () => any) {\n this.innerMoveable!.setState(state, callback);\n }\n public forceUpdate(callback?: () => any) {\n this.innerMoveable!.forceUpdate(callback);\n }\n public dragStart(e: MouseEvent | TouchEvent) {\n const innerMoveable = this.innerMoveable;\n if ((innerMoveable as any).$_timer) {\n this.forceUpdate();\n }\n this.getMoveable().dragStart(e);\n }\n public destroy() {\n const selfElement = this.selfElement!;\n\n renderSelf(\n null,\n selfElement!,\n this.containerProvider,\n );\n if (!this._warp) {\n selfElement?.parentElement?.removeChild(selfElement);\n }\n this.containerProvider = null;\n\n this.off();\n this.selfElement = null;\n this.innerMoveable = null;\n }\n private getMoveable() {\n return this.innerMoveable!.moveable;\n }\n}\n\ninterface MoveableManager extends MoveableInterface, MoveableProperties {\n}\n\nexport default MoveableManager;\n","import MoveableManager from \"./MoveableManager\";\n\nexport default class Moveable extends MoveableManager {}\n","import { Able, DefaultProps } from \"react-moveable/types\";\nimport { getElementInfo as getElementInfoFunction, makeAble as makeAbleFunction } from \"react-moveable\";\n\nexport function getElementInfo(\n target: SVGElement | HTMLElement,\n container?: SVGElement | HTMLElement | null,\n rootContainer?: SVGElement | HTMLElement | null | undefined,\n) {\n return getElementInfoFunction(target, container, rootContainer);\n};\nexport function makeAble<\n Name extends string,\n AbleObject extends Partial>,\n>(name: Name, able: AbleObject) {\n return makeAbleFunction(name, able);\n}\n"],"names":["InnerMoveable","_super","__extends","props","_this","call","state","render","React","Moveable","__assign","ref","Component","PROPERTIES","MOVEABLE_PROPS","METHODS","MOVEABLE_METHODS","EVENTS","MOVEABLE_EVENTS","MoveableManager","parentElement","options","containerProvider","selfElement","_warp","nextOptions","events","forEach","name","camelize","concat","e","trigger","warpSelf","getDocument","createElement","appendChild","renderSelf","target","isArray","length","updateRect","setState","callback","innerMoveable","forceUpdate","dragStart","$_timer","getMoveable","destroy","_a","removeChild","off","moveable","__decorate","Properties","prototype","property","args","_i","arguments","self","Object","defineProperty","get","set","value","enumerable","configurable","EventEmitter","getElementInfo","container","rootContainer","getElementInfoFunction","makeAble","able","makeAbleFunction"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAAA,aAAA,gBAAA,UAAAC,MAAA,EAAA;AAA2CC,EAAAA,SAAoB,CAAAF,aAAA,EAAAC,MAAA,CAApB,CAAA;;EAGvC,SAAAD,aAAA,CAAYG,KAAZ,EAAsB;IAAtB,IACIC,KAAA,GAAAH,MAAA,CAAAI,IAAA,CAAA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Q,EAAA,GAAA,EAAA,EACTA,EAAC,CAAAO,QAAA,CAAD,GAAYS,KADH,IAAb,EAAA,CAAA;OALmC;AASvCC,MAAAA,UAAU,EAAE,IAT2B;AAUvCC,MAAAA,YAAY,EAAE,IAAA;KAVlB,CAAA,CAAA;AAYH,GAbU,CAcU,CAAA,EAAfjD,eAAe,CAAf,CAAA;AA2EN,EAAA,OAACA,eAAD,CAAA;AAAC,CA3ED,CAA8BkD,YAA9B,CAAA;;AC3CA,IAAA5D,QAAA,gBAAA,UAAAR,MAAA,EAAA;AAAsCC,EAAAA,SAAe,CAAAO,QAAA,EAAAR,MAAA,CAAf,CAAA;;AAAtC,EAAA,SAAAQ,QAAA,GAAA;;AAAwD,GAAA;;AAAD,EAAA,OAACA,QAAD,CAAA;AAAvD,CAAA,CAAsCU,eAAtC;;SCCgBmD,eACZhC,QACAiC,WACAC,eAA2D;AAE3D,EAAA,OAAOC,gBAAsB,CAACnC,MAAD,EAASiC,SAAT,EAAoBC,aAApB,CAA7B,CAAA;AACH,CAAA;AACe,SAAAE,QAAA,CAGd9C,IAHc,EAGF+C,IAHE,EAGc;AAC1B,EAAA,OAAOC,UAAgB,CAAmBhD,IAAnB,EAAyB+C,IAAzB,CAAvB,CAAA;AACH;;;;"} \ No newline at end of file diff --git a/release/0.52.0/dist/moveable.js b/release/0.52.0/dist/moveable.js new file mode 100644 index 000000000..94281240b --- /dev/null +++ b/release/0.52.0/dist/moveable.js @@ -0,0 +1,23581 @@ +/* +Copyright (c) 2019 Daybrush +name: moveable +license: MIT +author: Daybrush +repository: https://github.com/daybrush/moveable/blob/master/packages/moveable +version: 0.52.0 +*/ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Moveable = factory()); +})(this, (function () { 'use strict'; + + /****************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + /* global Reflect, Promise */ + + var extendStatics$5 = function(d, b) { + extendStatics$5 = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics$5(d, b); + }; + + function __extends$5(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics$5(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + } + + var __assign$7 = function() { + __assign$7 = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign$7.apply(this, arguments); + }; + + function __decorate$1(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + } + + /* + Copyright (c) 2019 Daybrush + name: framework-utils + license: MIT + author: Daybrush + repository: git+https://github.com/daybrush/framework-utils.git + version: 1.1.0 + */ + function prefixNames(prefix) { + var classNames = []; + + for (var _i = 1; _i < arguments.length; _i++) { + classNames[_i - 1] = arguments[_i]; + } + + return classNames.map(function (className) { + return className.split(" ").map(function (name) { + return name ? "" + prefix + name : ""; + }).join(" "); + }).join(" "); + } + function prefixCSS(prefix, css) { + return css.replace(/([^}{]*){/gm, function (_, selector) { + return selector.replace(/\.([^{,\s\d.]+)/g, "." + prefix + "$1") + "{"; + }); + } + /* react */ + + function ref(target, name) { + return function (e) { + e && (target[name] = e); + }; + } + function refs(target, name, i) { + return function (e) { + e && (target[name][i] = e); + }; + } + /* Class Decorator */ + + function Properties(properties, action) { + return function (component) { + var prototype = component.prototype; + properties.forEach(function (property) { + action(prototype, property); + }); + }; + } + /* Property Decorator */ + + function withMethods(methods, duplicate) { + if (duplicate === void 0) { + duplicate = {}; + } + + return function (prototype, propertyName) { + methods.forEach(function (name) { + var methodName = duplicate[name] || name; + + if (methodName in prototype) { + return; + } + + prototype[methodName] = function () { + var _a; + + var args = []; + + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + + var result = (_a = this[propertyName])[name].apply(_a, args); + + if (result === this[propertyName]) { + return this; + } else { + return result; + } + }; + }); + }; + } + + /* + Copyright (c) 2018 Daybrush + @name: @daybrush/utils + license: MIT + author: Daybrush + repository: https://github.com/daybrush/utils + @version 1.13.0 + */ + /** + * @namespace + * @name Consts + */ + /** + * get string "rgb" + * @memberof Color + * @example + import {RGB} from "@daybrush/utils"; + + console.log(RGB); // "rgb" + */ + /** + * get string "function" + * @memberof Consts + * @example + import {FUNCTION} from "@daybrush/utils"; + + console.log(FUNCTION); // "function" + */ + var FUNCTION = "function"; + /** + * get string "object" + * @memberof Consts + * @example + import {OBJECT} from "@daybrush/utils"; + + console.log(OBJECT); // "object" + */ + var OBJECT = "object"; + /** + * get string "string" + * @memberof Consts + * @example + import {STRING} from "@daybrush/utils"; + + console.log(STRING); // "string" + */ + var STRING = "string"; + /** + * get string "number" + * @memberof Consts + * @example + import {NUMBER} from "@daybrush/utils"; + + console.log(NUMBER); // "number" + */ + var NUMBER = "number"; + /** + * get string "undefined" + * @memberof Consts + * @example + import {UNDEFINED} from "@daybrush/utils"; + + console.log(UNDEFINED); // "undefined" + */ + var UNDEFINED = "undefined"; + /** + * Check whether the environment is window or node.js. + * @memberof Consts + * @example + import {IS_WINDOW} from "@daybrush/utils"; + + console.log(IS_WINDOW); // false in node.js + console.log(IS_WINDOW); // true in browser + */ + var IS_WINDOW = typeof window !== UNDEFINED; + /** + * Check whether the environment is window or node.js. + * @memberof Consts + * @name document + * @example + import {IS_WINDOW} from "@daybrush/utils"; + + console.log(IS_WINDOW); // false in node.js + console.log(IS_WINDOW); // true in browser + */ + var doc = typeof document !== UNDEFINED && document; // FIXME: this type maybe false + var OPEN_CLOSED_CHARACTERS = [{ + open: "(", + close: ")" + }, { + open: "\"", + close: "\"" + }, { + open: "'", + close: "'" + }, { + open: "\\\"", + close: "\\\"" + }, { + open: "\\'", + close: "\\'" + }]; + var TINY_NUM$1 = 0.0000001; + var DEFAULT_UNIT_PRESETS = { + "cm": function (pos) { + return pos * 96 / 2.54; + }, + "mm": function (pos) { + return pos * 96 / 254; + }, + "in": function (pos) { + return pos * 96; + }, + "pt": function (pos) { + return pos * 96 / 72; + }, + "pc": function (pos) { + return pos * 96 / 6; + }, + "%": function (pos, size) { + return pos * size / 100; + }, + "vw": function (pos, size) { + if (size === void 0) { + size = window.innerWidth; + } + return pos / 100 * size; + }, + "vh": function (pos, size) { + if (size === void 0) { + size = window.innerHeight; + } + return pos / 100 * size; + }, + "vmax": function (pos, size) { + if (size === void 0) { + size = Math.max(window.innerWidth, window.innerHeight); + } + return pos / 100 * size; + }, + "vmin": function (pos, size) { + if (size === void 0) { + size = Math.min(window.innerWidth, window.innerHeight); + } + return pos / 100 * size; + } + }; + + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + function __spreadArrays$2() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; + return r; + } + + /** + * @namespace + * @name Utils + */ + /** + * Returns the inner product of two numbers(`a1`, `a2`) by two criteria(`b1`, `b2`). + * @memberof Utils + * @param - The first number + * @param - The second number + * @param - The first number to base on the inner product + * @param - The second number to base on the inner product + * @return - Returns the inner product + import { dot } from "@daybrush/utils"; + + console.log(dot(0, 15, 2, 3)); // 6 + console.log(dot(5, 15, 2, 3)); // 9 + console.log(dot(5, 15, 1, 1)); // 10 + */ + function dot(a1, a2, b1, b2) { + return (a1 * b2 + a2 * b1) / (b1 + b2); + } + /** + * Check the type that the value is undefined. + * @memberof Utils + * @param {string} value - Value to check the type + * @return {boolean} true if the type is correct, false otherwise + * @example + import {isUndefined} from "@daybrush/utils"; + + console.log(isUndefined(undefined)); // true + console.log(isUndefined("")); // false + console.log(isUndefined(1)); // false + console.log(isUndefined(null)); // false + */ + function isUndefined(value) { + return typeof value === UNDEFINED; + } + /** + * Check the type that the value is object. + * @memberof Utils + * @param {string} value - Value to check the type + * @return {} true if the type is correct, false otherwise + * @example + import {isObject} from "@daybrush/utils"; + + console.log(isObject({})); // true + console.log(isObject(undefined)); // false + console.log(isObject("")); // false + console.log(isObject(null)); // false + */ + function isObject(value) { + return value && typeof value === OBJECT; + } + /** + * Check the type that the value is isArray. + * @memberof Utils + * @param {string} value - Value to check the type + * @return {} true if the type is correct, false otherwise + * @example + import {isArray} from "@daybrush/utils"; + + console.log(isArray([])); // true + console.log(isArray({})); // false + console.log(isArray(undefined)); // false + console.log(isArray(null)); // false + */ + function isArray(value) { + return Array.isArray(value); + } + /** + * Check the type that the value is string. + * @memberof Utils + * @param {string} value - Value to check the type + * @return {} true if the type is correct, false otherwise + * @example + import {isString} from "@daybrush/utils"; + + console.log(isString("1234")); // true + console.log(isString(undefined)); // false + console.log(isString(1)); // false + console.log(isString(null)); // false + */ + function isString(value) { + return typeof value === STRING; + } + function isNumber(value) { + return typeof value === NUMBER; + } + /** + * Check the type that the value is function. + * @memberof Utils + * @param {string} value - Value to check the type + * @return {} true if the type is correct, false otherwise + * @example + import {isFunction} from "@daybrush/utils"; + + console.log(isFunction(function a() {})); // true + console.log(isFunction(() => {})); // true + console.log(isFunction("1234")); // false + console.log(isFunction(1)); // false + console.log(isFunction(null)); // false + */ + function isFunction(value) { + return typeof value === FUNCTION; + } + function isEqualSeparator(character, separator) { + var isCharacterSpace = character === "" || character == " "; + var isSeparatorSpace = separator === "" || separator == " "; + return isSeparatorSpace && isCharacterSpace || character === separator; + } + function findOpen(openCharacter, texts, index, length, openCloseCharacters) { + var isIgnore = findIgnore(openCharacter, texts, index); + if (!isIgnore) { + return findClose(openCharacter, texts, index + 1, length, openCloseCharacters); + } + return index; + } + function findIgnore(character, texts, index) { + if (!character.ignore) { + return null; + } + var otherText = texts.slice(Math.max(index - 3, 0), index + 3).join(""); + return new RegExp(character.ignore).exec(otherText); + } + function findClose(closeCharacter, texts, index, length, openCloseCharacters) { + var _loop_1 = function (i) { + var character = texts[i].trim(); + if (character === closeCharacter.close && !findIgnore(closeCharacter, texts, i)) { + return { + value: i + }; + } + var nextIndex = i; + // re open + var openCharacter = find$1(openCloseCharacters, function (_a) { + var open = _a.open; + return open === character; + }); + if (openCharacter) { + nextIndex = findOpen(openCharacter, texts, i, length, openCloseCharacters); + } + if (nextIndex === -1) { + return out_i_1 = i, "break"; + } + i = nextIndex; + out_i_1 = i; + }; + var out_i_1; + for (var i = index; i < length; ++i) { + var state_1 = _loop_1(i); + i = out_i_1; + if (typeof state_1 === "object") return state_1.value; + if (state_1 === "break") break; + } + return -1; + } + function splitText(text, splitOptions) { + var _a = isString(splitOptions) ? { + separator: splitOptions + } : splitOptions, + _b = _a.separator, + separator = _b === void 0 ? "," : _b, + isSeparateFirst = _a.isSeparateFirst, + isSeparateOnlyOpenClose = _a.isSeparateOnlyOpenClose, + _c = _a.isSeparateOpenClose, + isSeparateOpenClose = _c === void 0 ? isSeparateOnlyOpenClose : _c, + _d = _a.openCloseCharacters, + openCloseCharacters = _d === void 0 ? OPEN_CLOSED_CHARACTERS : _d; + var openClosedText = openCloseCharacters.map(function (_a) { + var open = _a.open, + close = _a.close; + if (open === close) { + return open; + } + return open + "|" + close; + }).join("|"); + var regexText = "(\\s*" + separator + "\\s*|" + openClosedText + "|\\s+)"; + var regex = new RegExp(regexText, "g"); + var texts = text.split(regex).filter(function (chr) { + return chr && chr !== "undefined"; + }); + var length = texts.length; + var values = []; + var tempValues = []; + function resetTemp() { + if (tempValues.length) { + values.push(tempValues.join("")); + tempValues = []; + return true; + } + return false; + } + var _loop_2 = function (i) { + var character = texts[i].trim(); + var nextIndex = i; + var openCharacter = find$1(openCloseCharacters, function (_a) { + var open = _a.open; + return open === character; + }); + var closeCharacter = find$1(openCloseCharacters, function (_a) { + var close = _a.close; + return close === character; + }); + if (openCharacter) { + nextIndex = findOpen(openCharacter, texts, i, length, openCloseCharacters); + if (nextIndex !== -1 && isSeparateOpenClose) { + if (resetTemp() && isSeparateFirst) { + return out_i_2 = i, "break"; + } + values.push(texts.slice(i, nextIndex + 1).join("")); + i = nextIndex; + if (isSeparateFirst) { + return out_i_2 = i, "break"; + } + return out_i_2 = i, "continue"; + } + } else if (closeCharacter && !findIgnore(closeCharacter, texts, i)) { + var nextOpenCloseCharacters = __spreadArrays$2(openCloseCharacters); + nextOpenCloseCharacters.splice(openCloseCharacters.indexOf(closeCharacter), 1); + return { + value: splitText(text, { + separator: separator, + isSeparateFirst: isSeparateFirst, + isSeparateOnlyOpenClose: isSeparateOnlyOpenClose, + isSeparateOpenClose: isSeparateOpenClose, + openCloseCharacters: nextOpenCloseCharacters + }) + }; + } else if (isEqualSeparator(character, separator) && !isSeparateOnlyOpenClose) { + resetTemp(); + if (isSeparateFirst) { + return out_i_2 = i, "break"; + } + return out_i_2 = i, "continue"; + } + if (nextIndex === -1) { + nextIndex = length - 1; + } + tempValues.push(texts.slice(i, nextIndex + 1).join("")); + i = nextIndex; + out_i_2 = i; + }; + var out_i_2; + for (var i = 0; i < length; ++i) { + var state_2 = _loop_2(i); + i = out_i_2; + if (typeof state_2 === "object") return state_2.value; + if (state_2 === "break") break; + } + if (tempValues.length) { + values.push(tempValues.join("")); + } + return values; + } + /** + * divide text by space. + * @memberof Utils + * @param {string} text - text to divide + * @return {Array} divided texts + * @example + import {spliceSpace} from "@daybrush/utils"; + + console.log(splitSpace("a b c d e f g")); + // ["a", "b", "c", "d", "e", "f", "g"] + console.log(splitSpace("'a,b' c 'd,e' f g")); + // ["'a,b'", "c", "'d,e'", "f", "g"] + */ + function splitSpace(text) { + // divide comma(space) + return splitText(text, ""); + } + /** + * divide text by comma. + * @memberof Utils + * @param {string} text - text to divide + * @return {Array} divided texts + * @example + import {splitComma} from "@daybrush/utils"; + + console.log(splitComma("a,b,c,d,e,f,g")); + // ["a", "b", "c", "d", "e", "f", "g"] + console.log(splitComma("'a,b',c,'d,e',f,g")); + // ["'a,b'", "c", "'d,e'", "f", "g"] + */ + function splitComma(text) { + // divide comma(,) + // "[^"]*"|'[^']*' + return splitText(text, ","); + } + /** + * divide text by bracket "(", ")". + * @memberof Utils + * @param {string} text - text to divide + * @return {object} divided texts + * @example + import {splitBracket} from "@daybrush/utils"; + + console.log(splitBracket("a(1, 2)")); + // {prefix: "a", value: "1, 2", suffix: ""} + console.log(splitBracket("a(1, 2)b")); + // {prefix: "a", value: "1, 2", suffix: "b"} + */ + function splitBracket(text) { + var matches = /([^(]*)\(([\s\S]*)\)([\s\S]*)/g.exec(text); + if (!matches || matches.length < 4) { + return {}; + } else { + return { + prefix: matches[1], + value: matches[2], + suffix: matches[3] + }; + } + } + /** + * divide text by number and unit. + * @memberof Utils + * @param {string} text - text to divide + * @return {} divided texts + * @example + import {splitUnit} from "@daybrush/utils"; + + console.log(splitUnit("10px")); + // {prefix: "", value: 10, unit: "px"} + console.log(splitUnit("-10px")); + // {prefix: "", value: -10, unit: "px"} + console.log(splitUnit("a10%")); + // {prefix: "a", value: 10, unit: "%"} + */ + function splitUnit(text) { + var matches = /^([^\d|e|\-|\+]*)((?:\d|\.|-|e-|e\+)+)(\S*)$/g.exec(text); + if (!matches) { + return { + prefix: "", + unit: "", + value: NaN + }; + } + var prefix = matches[1]; + var value = matches[2]; + var unit = matches[3]; + return { + prefix: prefix, + unit: unit, + value: parseFloat(value) + }; + } + /** + * transform strings to camel-case + * @memberof Utils + * @param {String} text - string + * @return {String} camel-case string + * @example + import {camelize} from "@daybrush/utils"; + + console.log(camelize("transform-origin")); // transformOrigin + console.log(camelize("abcd_efg")); // abcdEfg + console.log(camelize("abcd efg")); // abcdEfg + */ + function camelize(str) { + return str.replace(/[\s-_]+([^\s-_])/g, function (all, letter) { + return letter.toUpperCase(); + }); + } + /** + * transform a camelized string into a lowercased string. + * @memberof Utils + * @param {string} text - a camel-cased string + * @param {string} [separator="-"] - a separator + * @return {string} a lowercased string + * @example + import {decamelize} from "@daybrush/utils"; + + console.log(decamelize("transformOrigin")); // transform-origin + console.log(decamelize("abcdEfg", "_")); // abcd_efg + */ + function decamelize(str, separator) { + if (separator === void 0) { + separator = "-"; + } + return str.replace(/([a-z])([A-Z])/g, function (all, letter, letter2) { + return "" + letter + separator + letter2.toLowerCase(); + }); + } + /** + * Date.now() method + * @memberof CrossBrowser + * @return {number} milliseconds + * @example + import {now} from "@daybrush/utils"; + + console.log(now()); // 12121324241(milliseconds) + */ + function now() { + return Date.now ? Date.now() : new Date().getTime(); + } + /** + * Returns the index of the first element in the array that satisfies the provided testing function. + * @function + * @memberof CrossBrowser + * @param - The array `findIndex` was called upon. + * @param - A function to execute on each value in the array until the function returns true, indicating that the satisfying element was found. + * @param - Returns defaultIndex if not found by the function. + * @example + import { findIndex } from "@daybrush/utils"; + + findIndex([{a: 1}, {a: 2}, {a: 3}, {a: 4}], ({ a }) => a === 2); // 1 + */ + function findIndex(arr, callback, defaultIndex) { + if (defaultIndex === void 0) { + defaultIndex = -1; + } + var length = arr.length; + for (var i = 0; i < length; ++i) { + if (callback(arr[i], i, arr)) { + return i; + } + } + return defaultIndex; + } + /** + * Returns the value of the first element in the array that satisfies the provided testing function. + * @function + * @memberof CrossBrowser + * @param - The array `find` was called upon. + * @param - A function to execute on each value in the array, + * @param - Returns defalutValue if not found by the function. + * @example + import { find } from "@daybrush/utils"; + + find([{a: 1}, {a: 2}, {a: 3}, {a: 4}], ({ a }) => a === 2); // {a: 2} + */ + function find$1(arr, callback, defalutValue) { + var index = findIndex(arr, callback); + return index > -1 ? arr[index] : defalutValue; + } + /** + * window.requestAnimationFrame() method with cross browser. + * @function + * @memberof CrossBrowser + * @param {FrameRequestCallback} callback - The function to call when it's time to update your animation for the next repaint. + * @return {number} id + * @example + import {requestAnimationFrame} from "@daybrush/utils"; + + requestAnimationFrame((timestamp) => { + console.log(timestamp); + }); + */ + var requestAnimationFrame$1 = /*#__PURE__*/function () { + var firstTime = now(); + var raf = IS_WINDOW && (window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame); + return raf ? raf.bind(window) : function (callback) { + var currTime = now(); + var id = setTimeout(function () { + callback(currTime - firstTime); + }, 1000 / 60); + return id; + }; + }(); + /** + * window.cancelAnimationFrame() method with cross browser. + * @function + * @memberof CrossBrowser + * @param {number} handle - the id obtained through requestAnimationFrame method + * @return {void} + * @example + import { requestAnimationFrame, cancelAnimationFrame } from "@daybrush/utils"; + + const id = requestAnimationFrame((timestamp) => { + console.log(timestamp); + }); + + cancelAnimationFrame(id); + */ + var cancelAnimationFrame = /*#__PURE__*/function () { + var caf = IS_WINDOW && (window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.msCancelAnimationFrame); + return caf ? caf.bind(window) : function (handle) { + clearTimeout(handle); + }; + }(); + /** + * @function + * @memberof Utils + */ + function getKeys(obj) { + return Object.keys(obj); + } + /** + * @function + * @memberof Utils + */ + function getValues(obj) { + var keys = getKeys(obj); + return keys.map(function (key) { + return obj[key]; + }); + } + /** + * convert unit size to px size + * @function + * @memberof Utils + */ + function convertUnitSize(pos, size) { + var _a = splitUnit(pos), + value = _a.value, + unit = _a.unit; + if (isObject(size)) { + var sizeFunction = size[unit]; + if (sizeFunction) { + if (isFunction(sizeFunction)) { + return sizeFunction(value); + } else if (DEFAULT_UNIT_PRESETS[unit]) { + return DEFAULT_UNIT_PRESETS[unit](value, sizeFunction); + } + } + } else if (unit === "%") { + return value * size / 100; + } + if (DEFAULT_UNIT_PRESETS[unit]) { + return DEFAULT_UNIT_PRESETS[unit](value); + } + return value; + } + /** + * calculate between min, max + * @function + * @memberof Utils + */ + function between(value, min, max) { + return Math.max(min, Math.min(value, max)); + } + function checkBoundSize(targetSize, compareSize, isMax, ratio) { + if (ratio === void 0) { + ratio = targetSize[0] / targetSize[1]; + } + return [[throttle(compareSize[0], TINY_NUM$1), throttle(compareSize[0] / ratio, TINY_NUM$1)], [throttle(compareSize[1] * ratio, TINY_NUM$1), throttle(compareSize[1], TINY_NUM$1)]].filter(function (size) { + return size.every(function (value, i) { + var defaultSize = compareSize[i]; + var throttledSize = throttle(defaultSize, TINY_NUM$1); + return isMax ? value <= defaultSize || value <= throttledSize : value >= defaultSize || value >= throttledSize; + }); + })[0] || targetSize; + } + /** + * calculate bound size + * @function + * @memberof Utils + */ + function calculateBoundSize(size, minSize, maxSize, keepRatio) { + if (!keepRatio) { + return size.map(function (value, i) { + return between(value, minSize[i], maxSize[i]); + }); + } + var width = size[0], + height = size[1]; + var ratio = keepRatio === true ? width / height : keepRatio; + // width : height = minWidth : minHeight; + var _a = checkBoundSize(size, minSize, false, ratio), + minWidth = _a[0], + minHeight = _a[1]; + var _b = checkBoundSize(size, maxSize, true, ratio), + maxWidth = _b[0], + maxHeight = _b[1]; + if (width < minWidth || height < minHeight) { + width = minWidth; + height = minHeight; + } else if (width > maxWidth || height > maxHeight) { + width = maxWidth; + height = maxHeight; + } + return [width, height]; + } + /** + * Add all the numbers. + * @function + * @memberof Utils + */ + function sum(nums) { + var length = nums.length; + var total = 0; + for (var i = length - 1; i >= 0; --i) { + total += nums[i]; + } + return total; + } + /** + * Average all numbers. + * @function + * @memberof Utils + */ + function average(nums) { + var length = nums.length; + var total = 0; + for (var i = length - 1; i >= 0; --i) { + total += nums[i]; + } + return length ? total / length : 0; + } + /** + * Get the angle of two points. (0 <= rad < 359) + * @function + * @memberof Utils + */ + function getRad$1(pos1, pos2) { + var distX = pos2[0] - pos1[0]; + var distY = pos2[1] - pos1[1]; + var rad = Math.atan2(distY, distX); + return rad >= 0 ? rad : rad + Math.PI * 2; + } + /** + * Get the average point of all points. + * @function + * @memberof Utils + */ + function getCenterPoint(points) { + return [0, 1].map(function (i) { + return average(points.map(function (pos) { + return pos[i]; + })); + }); + } + /** + * Gets the direction of the shape. + * @function + * @memberof Utils + */ + function getShapeDirection(points) { + var center = getCenterPoint(points); + var pos1Rad = getRad$1(center, points[0]); + var pos2Rad = getRad$1(center, points[1]); + return pos1Rad < pos2Rad && pos2Rad - pos1Rad < Math.PI || pos1Rad > pos2Rad && pos2Rad - pos1Rad < -Math.PI ? 1 : -1; + } + /** + * Get the distance between two points. + * @function + * @memberof Utils + */ + function getDist$2(a, b) { + return Math.sqrt(Math.pow((b ? b[0] : 0) - a[0], 2) + Math.pow((b ? b[1] : 0) - a[1], 2)); + } + /** + * throttle number depending on the unit. + * @function + * @memberof Utils + */ + function throttle(num, unit) { + if (!unit) { + return num; + } + var reverseUnit = 1 / unit; + return Math.round(num / unit) / reverseUnit; + } + /** + * throttle number array depending on the unit. + * @function + * @memberof Utils + */ + function throttleArray(nums, unit) { + nums.forEach(function (_, i) { + nums[i] = throttle(nums[i], unit); + }); + return nums; + } + /** + * @function + * @memberof Utils + */ + function counter(num) { + var nums = []; + for (var i = 0; i < num; ++i) { + nums.push(i); + } + return nums; + } + /** + * @function + * @memberof Utils + */ + function flat$2(arr) { + return arr.reduce(function (prev, cur) { + return prev.concat(cur); + }, []); + } + /** + * @function + * @memberof Utils + */ + function pushSet(elements, element) { + if (elements.indexOf(element) === -1) { + elements.push(element); + } + } + /** + * Checks if the specified class value exists in the element's class attribute. + * @memberof DOM + * @param element - target + * @param className - the class name to search + * @return {boolean} return false if the class is not found. + * @example + import {hasClass} from "@daybrush/utils"; + + console.log(hasClass(element, "start")); // true or false + */ + function hasClass(element, className) { + if (element.classList) { + return element.classList.contains(className); + } + return !!element.className.match(new RegExp("(\\s|^)" + className + "(\\s|$)")); + } + /** + * Add the specified class value. If these classe already exist in the element's class attribute they are ignored. + * @memberof DOM + * @param element - target + * @param className - the class name to add + * @example + import {addClass} from "@daybrush/utils"; + + addClass(element, "start"); + */ + function addClass(element, className) { + if (element.classList) { + element.classList.add(className); + } else { + element.className += " " + className; + } + } + /** + * Removes the specified class value. + * @memberof DOM + * @param element - target + * @param className - the class name to remove + * @example + import {removeClass} from "@daybrush/utils"; + + removeClass(element, "start"); + */ + function removeClass(element, className) { + if (element.classList) { + element.classList.remove(className); + } else { + var reg = new RegExp("(\\s|^)" + className + "(\\s|$)"); + element.className = element.className.replace(reg, " "); + } + } + /** + * Sets up a function that will be called whenever the specified event is delivered to the target + * @memberof DOM + * @param - event target + * @param - A case-sensitive string representing the event type to listen for. + * @param - The object which receives a notification (an object that implements the Event interface) when an event of the specified type occurs + * @param - An options object that specifies characteristics about the event listener. + * @example + import {addEvent} from "@daybrush/utils"; + + addEvent(el, "click", e => { + console.log(e); + }); + */ + function addEvent(el, type, listener, options) { + el.addEventListener(type, listener, options); + } + /** + * removes from the EventTarget an event listener previously registered with EventTarget.addEventListener() + * @memberof DOM + * @param - event target + * @param - A case-sensitive string representing the event type to listen for. + * @param - The EventListener function of the event handler to remove from the event target. + * @param - An options object that specifies characteristics about the event listener. + * @example + import {addEvent, removeEvent} from "@daybrush/utils"; + const listener = e => { + console.log(e); + }; + addEvent(el, "click", listener); + removeEvent(el, "click", listener); + */ + function removeEvent(el, type, listener, options) { + el.removeEventListener(type, listener, options); + } + function getDocument(el) { + return (el === null || el === void 0 ? void 0 : el.ownerDocument) || doc; + } + function getDocumentElement(el) { + return getDocument(el).documentElement; + } + function getDocumentBody(el) { + return getDocument(el).body; + } + function getWindow(el) { + var _a; + return ((_a = el === null || el === void 0 ? void 0 : el.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView) || window; + } + function isWindow(val) { + return val && "postMessage" in val && "blur" in val && "self" in val; + } + function isNode(el) { + return isObject(el) && el.nodeName && el.nodeType && "ownerDocument" in el; + } + + /* + Copyright (c) 2019-present NAVER Corp. + name: @egjs/list-differ + license: MIT + author: NAVER Corp. + repository: https://github.com/naver/egjs-list-differ + version: 1.0.0 + */ + /* + egjs-list-differ + Copyright (c) 2019-present NAVER Corp. + MIT license + */ + var PolyMap = + /*#__PURE__*/ + function () { + function PolyMap() { + this.keys = []; + this.values = []; + } + + var __proto = PolyMap.prototype; + + __proto.get = function (key) { + return this.values[this.keys.indexOf(key)]; + }; + + __proto.set = function (key, value) { + var keys = this.keys; + var values = this.values; + var prevIndex = keys.indexOf(key); + var index = prevIndex === -1 ? keys.length : prevIndex; + keys[index] = key; + values[index] = value; + }; + + return PolyMap; + }(); + + /* + egjs-list-differ + Copyright (c) 2019-present NAVER Corp. + MIT license + */ + var HashMap = + /*#__PURE__*/ + function () { + function HashMap() { + this.object = {}; + } + + var __proto = HashMap.prototype; + + __proto.get = function (key) { + return this.object[key]; + }; + + __proto.set = function (key, value) { + this.object[key] = value; + }; + + return HashMap; + }(); + + /* + egjs-list-differ + Copyright (c) 2019-present NAVER Corp. + MIT license + */ + var SUPPORT_MAP = typeof Map === "function"; + + /* + egjs-list-differ + Copyright (c) 2019-present NAVER Corp. + MIT license + */ + var Link = + /*#__PURE__*/ + function () { + function Link() {} + + var __proto = Link.prototype; + + __proto.connect = function (prevLink, nextLink) { + this.prev = prevLink; + this.next = nextLink; + prevLink && (prevLink.next = this); + nextLink && (nextLink.prev = this); + }; + + __proto.disconnect = function () { + // In double linked list, diconnect the interconnected relationship. + var prevLink = this.prev; + var nextLink = this.next; + prevLink && (prevLink.next = nextLink); + nextLink && (nextLink.prev = prevLink); + }; + + __proto.getIndex = function () { + var link = this; + var index = -1; + + while (link) { + link = link.prev; + ++index; + } + + return index; + }; + + return Link; + }(); + + /* + egjs-list-differ + Copyright (c) 2019-present NAVER Corp. + MIT license + */ + + function orderChanged(changed, fixed) { + // It is roughly in the order of these examples. + // 4, 6, 0, 2, 1, 3, 5, 7 + var fromLinks = []; // 0, 1, 2, 3, 4, 5, 6, 7 + + var toLinks = []; + changed.forEach(function (_a) { + var from = _a[0], + to = _a[1]; + var link = new Link(); + fromLinks[from] = link; + toLinks[to] = link; + }); // `fromLinks` are connected to each other by double linked list. + + fromLinks.forEach(function (link, i) { + link.connect(fromLinks[i - 1]); + }); + return changed.filter(function (_, i) { + return !fixed[i]; + }).map(function (_a, i) { + var from = _a[0], + to = _a[1]; + + if (from === to) { + return [0, 0]; + } + + var fromLink = fromLinks[from]; + var toLink = toLinks[to - 1]; + var fromIndex = fromLink.getIndex(); // Disconnect the link connected to `fromLink`. + + fromLink.disconnect(); // Connect `fromLink` to the right of `toLink`. + + if (!toLink) { + fromLink.connect(undefined, fromLinks[0]); + } else { + fromLink.connect(toLink, toLink.next); + } + + var toIndex = fromLink.getIndex(); + return [fromIndex, toIndex]; + }); + } + + var Result = + /*#__PURE__*/ + function () { + function Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed) { + this.prevList = prevList; + this.list = list; + this.added = added; + this.removed = removed; + this.changed = changed; + this.maintained = maintained; + this.changedBeforeAdded = changedBeforeAdded; + this.fixed = fixed; + } + + var __proto = Result.prototype; + Object.defineProperty(__proto, "ordered", { + get: function () { + if (!this.cacheOrdered) { + this.caculateOrdered(); + } + + return this.cacheOrdered; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(__proto, "pureChanged", { + get: function () { + if (!this.cachePureChanged) { + this.caculateOrdered(); + } + + return this.cachePureChanged; + }, + enumerable: true, + configurable: true + }); + + __proto.caculateOrdered = function () { + var ordered = orderChanged(this.changedBeforeAdded, this.fixed); + var changed = this.changed; + var pureChanged = []; + this.cacheOrdered = ordered.filter(function (_a, i) { + var from = _a[0], + to = _a[1]; + var _b = changed[i], + fromBefore = _b[0], + toBefore = _b[1]; + + if (from !== to) { + pureChanged.push([fromBefore, toBefore]); + return true; + } + }); + this.cachePureChanged = pureChanged; + }; + + return Result; + }(); + + /** + * + * @memberof eg.ListDiffer + * @static + * @function + * @param - Previous List 이전 목록 + * @param - List to Update 업데이트 할 목록 + * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다. + * @return - Returns the diff between `prevList` and `list` `prevList`와 `list`의 다른 점을 반환한다. + * @example + * import { diff } from "@egjs/list-differ"; + * // script => eg.ListDiffer.diff + * const result = diff([0, 1, 2, 3, 4, 5], [7, 8, 0, 4, 3, 6, 2, 1], e => e); + * // List before update + * // [1, 2, 3, 4, 5] + * console.log(result.prevList); + * // Updated list + * // [4, 3, 6, 2, 1] + * console.log(result.list); + * // Index array of values added to `list` + * // [0, 1, 5] + * console.log(result.added); + * // Index array of values removed in `prevList` + * // [5] + * console.log(result.removed); + * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list` + * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]] + * console.log(result.changed); + * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>) + * // [[4, 3], [3, 4], [2, 6]] + * console.log(result.pureChanged); + * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>) + * // [[4, 1], [4, 2], [4, 3]] + * console.log(result.ordered); + * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved + * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]] + * console.log(result.maintained); + */ + + function diff$1(prevList, list, findKeyCallback) { + var mapClass = SUPPORT_MAP ? Map : findKeyCallback ? HashMap : PolyMap; + + var callback = findKeyCallback || function (e) { + return e; + }; + + var added = []; + var removed = []; + var maintained = []; + var prevKeys = prevList.map(callback); + var keys = list.map(callback); + var prevKeyMap = new mapClass(); + var keyMap = new mapClass(); + var changedBeforeAdded = []; + var fixed = []; + var removedMap = {}; + var changed = []; + var addedCount = 0; + var removedCount = 0; // Add prevKeys and keys to the hashmap. + + prevKeys.forEach(function (key, prevListIndex) { + prevKeyMap.set(key, prevListIndex); + }); + keys.forEach(function (key, listIndex) { + keyMap.set(key, listIndex); + }); // Compare `prevKeys` and `keys` and add them to `removed` if they are not in `keys`. + + prevKeys.forEach(function (key, prevListIndex) { + var listIndex = keyMap.get(key); // In prevList, but not in list, it is removed. + + if (typeof listIndex === "undefined") { + ++removedCount; + removed.push(prevListIndex); + } else { + removedMap[listIndex] = removedCount; + } + }); // Compare `prevKeys` and `keys` and add them to `added` if they are not in `prevKeys`. + + keys.forEach(function (key, listIndex) { + var prevListIndex = prevKeyMap.get(key); // In list, but not in prevList, it is added. + + if (typeof prevListIndex === "undefined") { + added.push(listIndex); + ++addedCount; + } else { + maintained.push([prevListIndex, listIndex]); + removedCount = removedMap[listIndex] || 0; + changedBeforeAdded.push([prevListIndex - removedCount, listIndex - addedCount]); + fixed.push(listIndex === prevListIndex); + + if (prevListIndex !== listIndex) { + changed.push([prevListIndex, listIndex]); + } + } + }); // Sort by ascending order of 'to(list's index). + + removed.reverse(); + return new Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed); + } + + /** + * A module that checks diff when values are added, removed, or changed in an array. + * @ko 배열 또는 오브젝트에서 값이 추가되거나 삭제되거나 순서가 변경사항을 체크하는 모듈입니다. + * @memberof eg + */ + + var ListDiffer = + /*#__PURE__*/ + function () { + /** + * @param - Initializing Data Array. 초기 설정할 데이터 배열. + * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다. + * @example + * import ListDiffer from "@egjs/list-differ"; + * // script => eg.ListDiffer + * const differ = new ListDiffer([0, 1, 2, 3, 4, 5], e => e); + * const result = differ.update([7, 8, 0, 4, 3, 6, 2, 1]); + * // List before update + * // [1, 2, 3, 4, 5] + * console.log(result.prevList); + * // Updated list + * // [4, 3, 6, 2, 1] + * console.log(result.list); + * // Index array of values added to `list`. + * // [0, 1, 5] + * console.log(result.added); + * // Index array of values removed in `prevList`. + * // [5] + * console.log(result.removed); + * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list`. + * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]] + * console.log(result.changed); + * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>) + * // [[4, 3], [3, 4], [2, 6]] + * console.log(result.pureChanged); + * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>) + * // [[4, 1], [4, 2], [4, 3]] + * console.log(result.ordered); + * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved. + * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]] + * console.log(result.maintained); + */ + function ListDiffer(list, findKeyCallback) { + if (list === void 0) { + list = []; + } + + this.findKeyCallback = findKeyCallback; + this.list = [].slice.call(list); + } + /** + * Update list. + * @ko 리스트를 업데이트를 합니다. + * @param - List to update 업데이트할 리스트 + * @return - Returns the results of an update from `prevList` to `list`. `prevList`에서 `list`로 업데이트한 결과를 반환한다. + */ + + + var __proto = ListDiffer.prototype; + + __proto.update = function (list) { + var newData = [].slice.call(list); + var result = diff$1(this.list, newData, this.findKeyCallback); + this.list = newData; + return result; + }; + + return ListDiffer; + }(); + + /* + Copyright (c) Daybrush + name: croact + license: MIT + author: Daybrush + repository: git+https://github.com/daybrush/croact.git + version: 1.0.4 + */ + + /****************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + /* global Reflect, Promise */ + + var extendStatics$4 = function(d, b) { + extendStatics$4 = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics$4(d, b); + }; + + function __extends$4(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics$4(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + } + + var __assign$6 = function() { + __assign$6 = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign$6.apply(this, arguments); + }; + + function __rest$2(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + } + + function __spreadArray$1(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); + } + + function fillKeys(keys) { + var index = 0; + return keys.map(function (key) { + return key == null ? "$compat".concat(++index) : "".concat(key); + }); + } + function flat$1(arr) { + var arr2 = []; + arr.forEach(function (el) { + arr2 = arr2.concat(isArray(el) ? flat$1(el) : el); + }); + return arr2; + } + function fillProps(props, defaultProps) { + if (!defaultProps) { + return props; + } + for (var name_1 in defaultProps) { + if (isUndefined(props[name_1])) { + props[name_1] = defaultProps[name_1]; + } + } + return props; + } + function isDiff(a, b) { + if (a === b) { + return false; + } + for (var i in a) { + if (!(i in b)) { + return true; + } + } + for (var i in b) { + if (a[i] !== b[i]) { + return true; + } + } + return false; + } + function getAttributes(props) { + var className = props.className, + otherProps = __rest$2(props, ["className"]); + if (className != null) { + otherProps.class = className; + } + delete otherProps.style; + delete otherProps.children; + return otherProps; + } + function splitProps(props) { + var attributes = {}; + var events = {}; + for (var name_2 in props) { + if (name_2.indexOf("on") === 0) { + events[name_2] = props[name_2]; + } else { + attributes[name_2] = props[name_2]; + } + } + return [attributes, events]; + } + function findContainerNode(provider) { + if (!provider) { + return null; + } + var base = provider.b; + if (isNode(base)) { + return base; + } + return findContainerNode(provider.c); + } + function removeNode(node) { + var parentNode = node.parentNode; + if (parentNode) { + parentNode.removeChild(node); + } + } + function executeHooks(hooks) { + hooks.forEach(function (hook) { + hook(); + }); + } + function renderFunctionComponent() { + return this.constructor(this.props, this.context); + } + + var hooksIndex = 0; + var Provider = /*#__PURE__*/function () { + function Provider( + /** + * Type + */ + t, + /** + * Depth + */ + d, + /** + * Key + */ + k, + /** + * index + */ + i, + /** + * Container + */ + c, + /** + * Ref + */ + ref, + /** + * Props + */ + ps) { + if (ps === void 0) { + ps = {}; + } + this.t = t; + this.d = d; + this.k = k; + this.i = i; + this.c = c; + this.ref = ref; + this.ps = ps; + this.typ = "prov"; + /** + * providers + */ + this._ps = []; + /** + * Contexts + */ + this._cs = {}; + /** + * Whether to hydrate + */ + this._hyd = null; + /** + * is self render + */ + this._sel = false; + } + var __proto = Provider.prototype; + __proto.s = function () { + return true; + }; + /** + * Update + */ + __proto.u = function (hooks, contexts, nextElement, nextState, isForceUpdate) { + var self = this; + var currentDepth = self.d; + var scheduledContexts = getValues(contexts).filter(function (context) { + return context.$_req; + }); + var scheduledSubs = flat$1(scheduledContexts.map(function (context) { + return context.$_subs; + })); + var isContextUpdate = find$1(scheduledSubs, function (provider) { + return provider.d === currentDepth; + }); + if (self.b && !isString(nextElement) && !isForceUpdate && !self.s(nextElement.props, nextState) && !isContextUpdate) { + var nextChildSubs = scheduledSubs.reduce(function (childs, sub) { + var depth = sub.d; + if (childs[0]) { + if (childs[0].d === depth) { + childs.push(sub); + } + } else if (depth > currentDepth) { + childs.push(sub); + } + return childs; + }, []); + nextChildSubs.forEach(function (child) { + // provider.container!, + // [provider], + // [provider.original], + // hooks, + // provider._cs, + // { ...self.state, ...self.$_state }, + // isForceUpdate, + renderProviders(child, child._ps, [child.o], hooks, contexts, true); + }); + return false; + } + self.o = nextElement; + self.ss(nextState); + // render + var prevProps = self.ps; + if (!isString(nextElement)) { + self.ps = nextElement.props; + self.ref = nextElement.ref; + } + setCurrentInstance(this); + self.r(hooks, contexts, self.b ? prevProps : {}, nextState); + return true; + }; + __proto.md = function () { + this.rr(); + }; + __proto.ss = function () { + return; + }; + __proto.ud = function () { + this.rr(); + }; + /** + * register refs + */ + __proto.rr = function () { + var self = this; + var ref = self.ref; + var fr = self.fr; + ref && ref(fr ? fr.current : self.b); + }; + return Provider; + }(); + function getCurrentInstance() { + return Object.__CROACT_CURRENT_INSTNACE__; + } + function getHooksIndex() { + return hooksIndex; + } + function setHooksInex(nextHooksIndex) { + hooksIndex = nextHooksIndex; + } + function setCurrentInstance(provider) { + Object.__CROACT_CURRENT_INSTNACE__ = provider; + hooksIndex = 0; + return provider; + } + + var Component = /*#__PURE__*/function () { + function Component(props, context) { + if (props === void 0) { + props = {}; + } + this.props = props; + this.context = context; + this.state = {}; + this.$_timer = 0; + this.$_state = {}; + this.$_subs = []; + this.$_cs = {}; + } + var __proto = Component.prototype; + __proto.render = function () { + return null; + }; + __proto.shouldComponentUpdate = function (props, state) { + return this.props !== props || this.state !== state; + }; + __proto.setState = function (state, callback, isForceUpdate) { + var self = this; + if (!self.$_timer) { + self.$_state = {}; + } + clearTimeout(self.$_timer); + self.$_timer = 0; + self.$_state = __assign$6(__assign$6({}, self.$_state), state); + if (!isForceUpdate) { + self.$_timer = window.setTimeout(function () { + self.$_timer = 0; + self.$_setState(callback, isForceUpdate); + }); + } else { + self.$_setState(callback, isForceUpdate); + } + return; + }; + __proto.forceUpdate = function (callback) { + this.setState({}, callback, true); + }; + __proto.componentDidMount = function () {}; + __proto.componentDidUpdate = function (prevProps, prevState) {}; + __proto.componentWillUnmount = function () {}; + __proto.$_setState = function (callback, isForceUpdate) { + var hooks = []; + var provider = this.$_p; + var isUpdate = renderProviders(provider.c, [provider], [provider.o], hooks, provider._cs, __assign$6(__assign$6({}, this.state), this.$_state), isForceUpdate); + if (isUpdate) { + if (callback) { + hooks.push(callback); + } + executeHooks(hooks); + setCurrentInstance(null); + } + }; + return Component; + }(); + var PureComponent = /*#__PURE__*/function (_super) { + __extends$4(PureComponent, _super); + function PureComponent() { + return _super !== null && _super.apply(this, arguments) || this; + } + var __proto = PureComponent.prototype; + __proto.shouldComponentUpdate = function (props, state) { + return isDiff(this.props, props) || isDiff(this.state, state); + }; + return PureComponent; + }(Component); + + function createRef(defaultValue) { + var refCallback = function (e) { + refCallback.current = e; + }; + refCallback.current = defaultValue; + return refCallback; + } + function forwardRef(func) { + func._fr = true; + return func; + } + + function createComponent(type, props, contextValue, self) { + var _a; + var base; + if ((_a = type === null || type === void 0 ? void 0 : type.prototype) === null || _a === void 0 ? void 0 : _a.render) { + base = new type(props, contextValue); + } else { + base = new Component(props, contextValue); + base.constructor = type; + if (type._fr) { + self.fr = createRef(); + base.render = function () { + return this.constructor(this.props, self.fr); + }; + } else { + base.render = renderFunctionComponent; + } + } + base.$_p = self; + return base; + } + var ComponentProvider = /*#__PURE__*/function (_super) { + __extends$4(ComponentProvider, _super); + function ComponentProvider(type, depth, key, index, container, ref, props) { + if (props === void 0) { + props = {}; + } + var _this = _super.call(this, type, depth, key, index, container, ref, fillProps(props, type.defaultProps)) || this; + _this.typ = "comp"; + /** + * Update shift effects + */ + _this._usefs = []; + /** + * Update effects + */ + _this._uefs = []; + /** + * Destroy effects + */ + _this._defs = []; + return _this; + } + var __proto = ComponentProvider.prototype; + __proto.s = function (nextProps, nextState) { + var base = this.b; + return base.shouldComponentUpdate(fillProps(nextProps, this.t.defaultProps), nextState || base.state) !== false; + }; + __proto.r = function (hooks, contexts, prevProps) { + var _a, _b; + var self = this; + var type = self.t; + self.ps = fillProps(self.ps, self.t.defaultProps); + var props = self.ps; + var isMount = !self.b; + var contextType = type.contextType; + var base = self.b; + var contextValue = contextType === null || contextType === void 0 ? void 0 : contextType.get(self); + self._cs = contexts; + if (isMount) { + base = createComponent(type, props, contextValue, self); + self.b = base; + } else { + base.props = props; + base.context = contextValue; + } + var prevState = base.state; + self._usefs = []; + self._uefs = []; + var template = base.render(); + if (((_b = (_a = template === null || template === void 0 ? void 0 : template.props) === null || _a === void 0 ? void 0 : _a.children) === null || _b === void 0 ? void 0 : _b.length) === 0) { + template.props.children = self.ps.children; + } + var nextContexts = __assign$6(__assign$6({}, contexts), base.$_cs); + renderProviders(self, self._ps, template ? [template] : [], hooks, nextContexts); + if (isMount) { + self._uefs.push(function () { + contextType === null || contextType === void 0 ? void 0 : contextType.register(self); + base.componentDidMount(); + }); + } else { + self._uefs.push(function () { + base.componentDidUpdate(prevProps, prevState); + }); + } + hooks.push(function () { + self._usefs.forEach(function (ef) { + ef(); + }); + if (isMount) { + self.md(); + } else { + self.ud(); + } + self._defs = self._uefs.map(function (ef) { + return ef(); + }); + }); + }; + __proto.ss = function (nextState) { + var base = this.b; + if (!base || !nextState) { + return; + } + base.state = nextState; + }; + __proto.un = function () { + var _a; + var self = this; + self._ps.forEach(function (provider) { + provider.un(); + }); + var type = self.t; + (_a = type.contextType) === null || _a === void 0 ? void 0 : _a.unregister(self); + clearTimeout(self.b.$_timer); + self._defs.forEach(function (def) { + def && def(); + }); + self.b.componentWillUnmount(); + }; + return ComponentProvider; + }(Provider); + + function diffAttributes(attrs1, attrs2, el) { + var _a = diffObject(getAttributes(attrs1), getAttributes(attrs2)), + added = _a.added, + removed = _a.removed, + changed = _a.changed; + for (var name_1 in added) { + el.setAttribute(name_1, added[name_1]); + } + for (var name_2 in changed) { + el.setAttribute(name_2, changed[name_2][1]); + } + for (var name_3 in removed) { + el.removeAttribute(name_3); + } + } + function diffEvents(events1, events2, provier) { + var _a = diffObject(events1, events2), + added = _a.added, + removed = _a.removed; + for (var name_4 in removed) { + provier.e(name_4, true); + } + for (var name_5 in added) { + provier.e(name_5); + } + } + function diffObject(a, b) { + var keys1 = getKeys(a); + var keys2 = getKeys(b); + var result = diff$1(keys1, keys2, function (key) { + return key; + }); + var added = {}; + var removed = {}; + var changed = {}; + result.added.forEach(function (index) { + var name = keys2[index]; + added[name] = b[name]; + }); + result.removed.forEach(function (index) { + var name = keys1[index]; + removed[name] = a[name]; + }); + result.maintained.forEach(function (_a) { + var index = _a[0]; + var name = keys1[index]; + var values = [a[name], b[name]]; + if (a[name] !== b[name]) { + changed[name] = values; + } + }); + return { + added: added, + removed: removed, + changed: changed + }; + } + function diffStyle(style1, style2, el) { + var style = el.style; + var _a = diffObject(style1, style2), + added = _a.added, + removed = _a.removed, + changed = _a.changed; + for (var beforeName in added) { + var name_6 = decamelize(beforeName, "-"); + style.setProperty(name_6, added[beforeName]); + } + for (var beforeName in changed) { + var name_7 = decamelize(beforeName, "-"); + style.setProperty(name_7, changed[beforeName][1]); + } + for (var beforeName in removed) { + var name_8 = decamelize(beforeName, "-"); + style.removeProperty(name_8); + } + } + function getNativeEventName(name) { + return name.replace(/^on/g, "").toLowerCase(); + } + var ElementProvider = /*#__PURE__*/function (_super) { + __extends$4(ElementProvider, _super); + function ElementProvider() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.typ = "elem"; + /** + * Events + */ + _this._es = {}; + /** + * is svg + */ + _this._svg = false; + return _this; + } + var __proto = ElementProvider.prototype; + __proto.e = function (name, isRemove) { + var self = this; + var events = self._es; + var base = self.b; + var eventName = getNativeEventName(name); + if (isRemove) { + removeEvent(base, eventName, events[name]); + delete events[name]; + } else { + events[name] = function (e) { + var _a, _b; + (_b = (_a = self.ps)[name]) === null || _b === void 0 ? void 0 : _b.call(_a, e); + }; + addEvent(base, eventName, events[name]); + } + }; + __proto.s = function (nextProps) { + return isDiff(this.ps, nextProps); + }; + __proto.r = function (hooks, contextValues, prevProps) { + var _a; + var self = this; + var isMount = !self.b; + var nextProps = self.ps; + if (isMount) { + var containerNode = findContainerNode(self.c); + var isSVG = false; + if (self._svg || self.t === "svg") { + isSVG = true; + } else { + isSVG = containerNode && containerNode.ownerSVGElement; + } + self._svg = isSVG; + var element = (_a = self._hyd) === null || _a === void 0 ? void 0 : _a.splice(0, 1)[0]; + var type = self.t; + if (element) { + self._hyd = [].slice.call(element.children || []); + } else { + var doc = getDocument(containerNode); + if (isSVG) { + element = doc.createElementNS("http://www.w3.org/2000/svg", type); + } else { + element = doc.createElement(type); + } + } + self.b = element; + } + renderProviders(self, self._ps, nextProps.children, hooks, contextValues); + var base = self.b; + var _b = splitProps(prevProps), + prevAttributes = _b[0], + prevEvents = _b[1]; + var _c = splitProps(nextProps), + nextAttributes = _c[0], + nextEvents = _c[1]; + diffAttributes(prevAttributes, nextAttributes, base); + diffEvents(prevEvents, nextEvents, self); + diffStyle(prevProps.style || {}, nextProps.style || {}, base); + hooks.push(function () { + if (isMount) { + self.md(); + } else { + self.ud(); + } + }); + return true; + }; + __proto.un = function () { + var self = this; + var events = self._es; + var base = self.b; + for (var name_9 in events) { + removeEvent(base, name_9, events[name_9]); + } + self._ps.forEach(function (provider) { + provider.un(); + }); + self._es = {}; + if (!self._sel) { + removeNode(base); + } + }; + return ElementProvider; + }(Provider); + + function findDOMNode(comp) { + if (!comp || isNode(comp)) { + return comp; + } + var providers = comp.$_p._ps; + if (!providers.length) { + return null; + } + return findDOMNode(providers[0].b); + } + function findNodeProvider(provider) { + if (!provider) { + return; + } + if (provider.b && isNode(provider.b)) { + return provider; + } + var providers = provider._ps; + if (!providers.length) { + return null; + } + return findNodeProvider(providers[0]); + } + function createElement(type, props) { + var children = []; + for (var _i = 2; _i < arguments.length; _i++) { + children[_i - 2] = arguments[_i]; + } + var _a = props || {}, + key = _a.key, + ref = _a.ref, + otherProps = __rest$2(_a, ["key", "ref"]); + return { + type: type, + key: key, + ref: ref, + props: __assign$6(__assign$6({}, otherProps), { + children: flat$2(children).filter(function (child) { + return child != null && child !== false; + }) + }) + }; + } + + var ContainerProvider = /*#__PURE__*/function (_super) { + __extends$4(ContainerProvider, _super); + function ContainerProvider(base, depth) { + if (depth === void 0) { + depth = 0; + } + var _this = _super.call(this, "container", depth, "container", 0, null) || this; + _this.typ = "container"; + _this.b = base; + return _this; + } + var __proto = ContainerProvider.prototype; + __proto.r = function () { + return true; + }; + __proto.un = function () { + return; + }; + return ContainerProvider; + }(Provider); + var TextProvider = /*#__PURE__*/function (_super) { + __extends$4(TextProvider, _super); + function TextProvider() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.typ = "text"; + return _this; + } + var __proto = TextProvider.prototype; + __proto.r = function (hooks) { + var _a; + var self = this; + var isMount = !self.b; + if (isMount) { + var containerNode = findContainerNode(self.c); + var b = (_a = self._hyd) === null || _a === void 0 ? void 0 : _a.splice(0, 1)[0]; + self.b = b || getDocument(containerNode).createTextNode(self.t.replace("text_", "")); + } + hooks.push(function () { + if (isMount) { + self.md(); + } else { + self.ud(); + } + }); + return true; + }; + __proto.un = function () { + removeNode(this.b); + }; + return TextProvider; + }(Provider); + function diffProviders(containerProvider, providers, children) { + var childrenKeys = children.map(function (p) { + return isString(p) ? null : p.key; + }); + var keys1 = fillKeys(providers.map(function (p) { + return p.k; + })); + var keys2 = fillKeys(childrenKeys); + var result = diff$1(keys1, keys2, function (key) { + return key; + }); + result.removed.forEach(function (index) { + providers.splice(index, 1)[0].un(); + }); + result.ordered.forEach(function (_a) { + var from = _a[0], + to = _a[1]; + var childrenProvider = providers.splice(from, 1)[0]; + providers.splice(to, 0, childrenProvider); + var el = findDOMNode(childrenProvider.b); + var next = findDOMNode(providers[to + 1] && providers[to + 1].b); + if (el) { + el.parentNode.insertBefore(el, next); + } + }); + result.added.forEach(function (index) { + providers.splice(index, 0, createProvider(children[index], childrenKeys[index], index, containerProvider)); + }); + var changed = result.maintained.filter(function (_a) { + _a[0]; + var to = _a[1]; + var el = children[to]; + var childProvider = providers[to]; + var type = isString(el) ? "text_".concat(el) : el.type; + if (type !== childProvider.t) { + childProvider.un(); + providers.splice(to, 1, createProvider(el, childrenKeys[to], to, containerProvider)); + return true; + } + childProvider.i = to; + return false; + }); + return __spreadArray$1(__spreadArray$1([], result.added, true), changed.map(function (_a) { + _a[0]; + var to = _a[1]; + return to; + }), true); + } + + function getNextSibiling(provider, childProvider) { + var childProviders = provider._ps; + var length = childProviders.length; + for (var i = childProvider.i + 1; i < length; ++i) { + var el = findDOMNode(childProviders[i].b); + if (el) { + return el; + } + } + return null; + } + function createProvider(el, key, index, containerProvider) { + var depth = containerProvider.d + 1; + if (isString(el) || isNumber(el)) { + return new TextProvider("text_".concat(el), depth, key, index, containerProvider, null, {}); + } + var type = el.type; + var providerClass = typeof type === "string" ? ElementProvider : ComponentProvider; + return new providerClass(type, depth, key, index, containerProvider, el.ref, el.props); + } + function renderProviders(containerProvider, providers, children, updatedHooks, nextContexts, nextState, isForceUpdate) { + var result = diffProviders(containerProvider, providers, children); + var hyd = containerProvider._hyd; + var updated = providers.filter(function (childProvider, i) { + childProvider._hyd = hyd; + return childProvider.u(updatedHooks, nextContexts, children[i], nextState, isForceUpdate); + }); + if (containerProvider.typ === "container" && containerProvider._sel) { + providers.forEach(function (provider) { + var nodeProvider = findNodeProvider(provider); + if (nodeProvider) { + nodeProvider._sel = true; + } + }); + } + containerProvider._hyd = null; + var containerNode = findContainerNode(containerProvider); + if (containerNode) { + result.reverse().forEach(function (index) { + var childProvider = providers[index]; + var el = findDOMNode(childProvider.b); + if (!el) { + return; + } + if (containerNode !== el && !el.parentNode) { + var nextElement = getNextSibiling(containerProvider, childProvider); + containerNode.insertBefore(el, nextElement); + } + }); + } + return updated.length > 0; + } + function renderProvider(element, container, provider, contexts) { + if (provider === void 0) { + provider = container.__CROACT__; + } + if (contexts === void 0) { + contexts = {}; + } + var isProvider = !!provider; + if (!provider) { + provider = new ContainerProvider(container); + } + var hooks = []; + renderProviders(provider, provider._ps, element ? [element] : [], hooks, contexts, undefined, undefined); + executeHooks(hooks); + setCurrentInstance(null); + if (!isProvider) { + container.__CROACT__ = provider; + } + return provider; + } + function renderSelf(element, self, containerProvider) { + if (!containerProvider && element) { + containerProvider = new ContainerProvider(self.parentElement); + containerProvider._hyd = [self]; + containerProvider._sel = true; + } + renderProvider(element, self, containerProvider); + return containerProvider; + } + + function checkHookInfo(info) { + var inst = getCurrentInstance(); + var hooks = inst._hs || (inst._hs = []); + var index = getHooksIndex(); + var prevHt = hooks[index]; + setHooksInex(index + 1); + if (prevHt) { + if (!isDiff(prevHt.deps, info.deps)) { + prevHt.updated = false; + return prevHt; + } + hooks[index] = info; + } else { + hooks.push(info); + } + info.value = info.func(); + info.updated = true; + return info; + } + function useMemo(defaultFunction, deps) { + var info = checkHookInfo({ + func: defaultFunction, + deps: deps + }); + return info.value; + } + function useRef(defaultValue) { + return useMemo(function () { + return createRef(defaultValue); + }, []); + } + function useEffect(effect, deps, unshift) { + var inst = getCurrentInstance(); + var info = checkHookInfo({ + func: function () { + return effect; + }, + deps: deps + }); + var effects = unshift ? inst._usefs : inst._uefs; + if (info.updated) { + effects.push(function () { + info.effect && info.effect(); + info.effect = effect(); + return info.effect; + }); + } else { + effects.push(function () { + return info.effect; + }); + } + } + function useImperativeHandle(ref, func, deps) { + useEffect(function () { + ref === null || ref === void 0 ? void 0 : ref(func()); + }, deps, true); + } + + /* + Copyright (c) 2015 NAVER Corp. + name: @egjs/agent + license: MIT + author: NAVER Corp. + repository: git+https://github.com/naver/agent.git + version: 2.4.2 + */ + function some(arr, callback) { + var length = arr.length; + + for (var i = 0; i < length; ++i) { + if (callback(arr[i], i)) { + return true; + } + } + + return false; + } + function find(arr, callback) { + var length = arr.length; + + for (var i = 0; i < length; ++i) { + if (callback(arr[i], i)) { + return arr[i]; + } + } + + return null; + } + function getUserAgentString(agent) { + var userAgent = agent; + + if (typeof userAgent === "undefined") { + if (typeof navigator === "undefined" || !navigator) { + return ""; + } + + userAgent = navigator.userAgent || ""; + } + + return userAgent.toLowerCase(); + } + function execRegExp(pattern, text) { + try { + return new RegExp(pattern, "g").exec(text); + } catch (e) { + return null; + } + } + function hasUserAgentData() { + if (typeof navigator === "undefined" || !navigator || !navigator.userAgentData) { + return false; + } + + var userAgentData = navigator.userAgentData; + var brands = userAgentData.brands || userAgentData.uaList; + return !!(brands && brands.length); + } + function findVersion(versionTest, userAgent) { + var result = execRegExp("(" + versionTest + ")((?:\\/|\\s|:)([0-9|\\.|_]+))", userAgent); + return result ? result[3] : ""; + } + function convertVersion(text) { + return text.replace(/_/g, "."); + } + function findPreset(presets, userAgent) { + var userPreset = null; + var version = "-1"; + some(presets, function (preset) { + var result = execRegExp("(" + preset.test + ")((?:\\/|\\s|:)([0-9|\\.|_]+))?", userAgent); + + if (!result || preset.brand) { + return false; + } + + userPreset = preset; + version = result[3] || "-1"; + + if (preset.versionAlias) { + version = preset.versionAlias; + } else if (preset.versionTest) { + version = findVersion(preset.versionTest.toLowerCase(), userAgent) || version; + } + + version = convertVersion(version); + return true; + }); + return { + preset: userPreset, + version: version + }; + } + function findPresetBrand(presets, brands) { + var brandInfo = { + brand: "", + version: "-1" + }; + some(presets, function (preset) { + var result = findBrand(brands, preset); + + if (!result) { + return false; + } + + brandInfo.brand = preset.id; + brandInfo.version = preset.versionAlias || result.version; + return brandInfo.version !== "-1"; + }); + return brandInfo; + } + function findBrand(brands, preset) { + return find(brands, function (_a) { + var brand = _a.brand; + return execRegExp("" + preset.test, brand.toLowerCase()); + }); + } + + var BROWSER_PRESETS = [{ + test: "phantomjs", + id: "phantomjs" + }, { + test: "whale", + id: "whale" + }, { + test: "edgios|edge|edg", + id: "edge" + }, { + test: "msie|trident|windows phone", + id: "ie", + versionTest: "iemobile|msie|rv" + }, { + test: "miuibrowser", + id: "miui browser" + }, { + test: "samsungbrowser", + id: "samsung internet" + }, { + test: "samsung", + id: "samsung internet", + versionTest: "version" + }, { + test: "chrome|crios", + id: "chrome" + }, { + test: "firefox|fxios", + id: "firefox" + }, { + test: "android", + id: "android browser", + versionTest: "version" + }, { + test: "safari|iphone|ipad|ipod", + id: "safari", + versionTest: "version" + }]; // chromium's engine(blink) is based on applewebkit 537.36. + + var CHROMIUM_PRESETS = [{ + test: "(?=.*applewebkit/(53[0-7]|5[0-2]|[0-4]))(?=.*\\schrome)", + id: "chrome", + versionTest: "chrome" + }, { + test: "chromium", + id: "chrome" + }, { + test: "whale", + id: "chrome", + versionAlias: "-1", + brand: true + }]; + var WEBKIT_PRESETS = [{ + test: "applewebkit", + id: "webkit", + versionTest: "applewebkit|safari" + }]; + var WEBVIEW_PRESETS = [{ + test: "(?=(iphone|ipad))(?!(.*version))", + id: "webview" + }, { + test: "(?=(android|iphone|ipad))(?=.*(naver|daum|; wv))", + id: "webview" + }, { + // test webview + test: "webview", + id: "webview" + }]; + var OS_PRESETS = [{ + test: "windows phone", + id: "windows phone" + }, { + test: "windows 2000", + id: "window", + versionAlias: "5.0" + }, { + test: "windows nt", + id: "window" + }, { + test: "win32|windows", + id: "window" + }, { + test: "iphone|ipad|ipod", + id: "ios", + versionTest: "iphone os|cpu os" + }, { + test: "macos|macintel|mac os x", + id: "mac" + }, { + test: "android|linux armv81", + id: "android" + }, { + test: "tizen", + id: "tizen" + }, { + test: "webos|web0s", + id: "webos" + }]; + + function isWebView(userAgent) { + return !!findPreset(WEBVIEW_PRESETS, userAgent).preset; + } + function getLegacyAgent(userAgent) { + var nextAgent = getUserAgentString(userAgent); + var isMobile = !!/mobi/g.exec(nextAgent); + var browser = { + name: "unknown", + version: "-1", + majorVersion: -1, + webview: isWebView(nextAgent), + chromium: false, + chromiumVersion: "-1", + webkit: false, + webkitVersion: "-1" + }; + var os = { + name: "unknown", + version: "-1", + majorVersion: -1 + }; + + var _a = findPreset(BROWSER_PRESETS, nextAgent), + browserPreset = _a.preset, + browserVersion = _a.version; + + var _b = findPreset(OS_PRESETS, nextAgent), + osPreset = _b.preset, + osVersion = _b.version; + + var chromiumPreset = findPreset(CHROMIUM_PRESETS, nextAgent); + browser.chromium = !!chromiumPreset.preset; + browser.chromiumVersion = chromiumPreset.version; + + if (!browser.chromium) { + var webkitPreset = findPreset(WEBKIT_PRESETS, nextAgent); + browser.webkit = !!webkitPreset.preset; + browser.webkitVersion = webkitPreset.version; + } + + if (osPreset) { + os.name = osPreset.id; + os.version = osVersion; + os.majorVersion = parseInt(osVersion, 10); + } + + if (browserPreset) { + browser.name = browserPreset.id; + browser.version = browserVersion; // Early whale bugs + + if (browser.webview && os.name === "ios" && browser.name !== "safari") { + browser.webview = false; + } + } + + browser.majorVersion = parseInt(browser.version, 10); + return { + browser: browser, + os: os, + isMobile: isMobile, + isHints: false + }; + } + + function getClientHintsAgent(osData) { + var userAgentData = navigator.userAgentData; + var brands = (userAgentData.uaList || userAgentData.brands).slice(); + var fullVersionList = osData && osData.fullVersionList; + var isMobile = userAgentData.mobile || false; + var firstBrand = brands[0]; + var platform = (osData && osData.platform || userAgentData.platform || navigator.platform).toLowerCase(); + var browser = { + name: firstBrand.brand, + version: firstBrand.version, + majorVersion: -1, + webkit: false, + webkitVersion: "-1", + chromium: false, + chromiumVersion: "-1", + webview: !!findPresetBrand(WEBVIEW_PRESETS, brands).brand || isWebView(getUserAgentString()) + }; + var os = { + name: "unknown", + version: "-1", + majorVersion: -1 + }; + browser.webkit = !browser.chromium && some(WEBKIT_PRESETS, function (preset) { + return findBrand(brands, preset); + }); + var chromiumBrand = findPresetBrand(CHROMIUM_PRESETS, brands); + browser.chromium = !!chromiumBrand.brand; + browser.chromiumVersion = chromiumBrand.version; + + if (!browser.chromium) { + var webkitBrand = findPresetBrand(WEBKIT_PRESETS, brands); + browser.webkit = !!webkitBrand.brand; + browser.webkitVersion = webkitBrand.version; + } + + var platfomResult = find(OS_PRESETS, function (preset) { + return new RegExp("" + preset.test, "g").exec(platform); + }); + os.name = platfomResult ? platfomResult.id : ""; + + if (osData) { + os.version = osData.platformVersion; + } + + if (fullVersionList && fullVersionList.length) { + var browserBrandByFullVersionList = findPresetBrand(BROWSER_PRESETS, fullVersionList); + browser.name = browserBrandByFullVersionList.brand || browser.name; + browser.version = browserBrandByFullVersionList.version || browser.version; + } else { + var browserBrand = findPresetBrand(BROWSER_PRESETS, brands); + browser.name = browserBrand.brand || browser.name; + browser.version = browserBrand.brand && osData ? osData.uaFullVersion : browserBrand.version; + } + + if (browser.webkit) { + os.name = isMobile ? "ios" : "mac"; + } + + if (os.name === "ios" && browser.webview) { + browser.version = "-1"; + } + + os.version = convertVersion(os.version); + browser.version = convertVersion(browser.version); + os.majorVersion = parseInt(os.version, 10); + browser.majorVersion = parseInt(browser.version, 10); + return { + browser: browser, + os: os, + isMobile: isMobile, + isHints: true + }; + } + /** + * Extracts browser and operating system information from the user agent string. + * @ko 유저 에이전트 문자열에서 브라우저와 운영체제 정보를 추출한다. + * @function eg.agent#agent + * @param - user agent string to parse 파싱할 유저에이전트 문자열 + * @return - agent Info 에이전트 정보 + * @example + import agent from "@egjs/agent"; + // eg.agent(); + const { os, browser, isMobile } = agent(); + */ + + function agent$1(userAgent) { + if (typeof userAgent === "undefined" && hasUserAgentData()) { + return getClientHintsAgent(); + } else { + return getLegacyAgent(userAgent); + } + } + + /* + Copyright (c) 2020 Daybrush + name: @scena/matrix + license: MIT + author: Daybrush + repository: git+https://github.com/daybrush/matrix + version: 1.1.1 + */ + + function add(matrix, inverseMatrix, startIndex, fromIndex, n, k) { + for (var i = 0; i < n; ++i) { + var x = startIndex + i * n; + var fromX = fromIndex + i * n; + matrix[x] += matrix[fromX] * k; + inverseMatrix[x] += inverseMatrix[fromX] * k; + } + } + + function swap(matrix, inverseMatrix, startIndex, fromIndex, n) { + for (var i = 0; i < n; ++i) { + var x = startIndex + i * n; + var fromX = fromIndex + i * n; + var v = matrix[x]; + var iv = inverseMatrix[x]; + matrix[x] = matrix[fromX]; + matrix[fromX] = v; + inverseMatrix[x] = inverseMatrix[fromX]; + inverseMatrix[fromX] = iv; + } + } + + function divide(matrix, inverseMatrix, startIndex, n, k) { + for (var i = 0; i < n; ++i) { + var x = startIndex + i * n; + matrix[x] /= k; + inverseMatrix[x] /= k; + } + } + /** + * + * @namespace Matrix + */ + + /** + * @memberof Matrix + */ + + + function ignoreDimension(matrix, m, n) { + if (n === void 0) { + n = Math.sqrt(matrix.length); + } + + var newMatrix = matrix.slice(); + + for (var i = 0; i < n; ++i) { + newMatrix[i * n + m - 1] = 0; + newMatrix[(m - 1) * n + i] = 0; + } + + newMatrix[(m - 1) * (n + 1)] = 1; + return newMatrix; + } + /** + * @memberof Matrix + */ + + function invert(matrix, n) { + if (n === void 0) { + n = Math.sqrt(matrix.length); + } + + var newMatrix = matrix.slice(); + var inverseMatrix = createIdentityMatrix(n); + + for (var i = 0; i < n; ++i) { + // diagonal + var identityIndex = n * i + i; + + if (!throttle(newMatrix[identityIndex], TINY_NUM$1)) { + // newMatrix[identityIndex] = 0; + for (var j = i + 1; j < n; ++j) { + if (newMatrix[n * i + j]) { + swap(newMatrix, inverseMatrix, i, j, n); + break; + } + } + } + + if (!throttle(newMatrix[identityIndex], TINY_NUM$1)) { + // no inverse matrix + return []; + } + + divide(newMatrix, inverseMatrix, i, n, newMatrix[identityIndex]); + + for (var j = 0; j < n; ++j) { + var targetStartIndex = j; + var targetIndex = j + i * n; + var target = newMatrix[targetIndex]; + + if (!throttle(target, TINY_NUM$1) || i === j) { + continue; + } + + add(newMatrix, inverseMatrix, targetStartIndex, i, n, -target); + } + } + + return inverseMatrix; + } + /** + * @memberof Matrix + */ + + function transpose(matrix, n) { + if (n === void 0) { + n = Math.sqrt(matrix.length); + } + + var newMatrix = []; + + for (var i = 0; i < n; ++i) { + for (var j = 0; j < n; ++j) { + newMatrix[j * n + i] = matrix[n * i + j]; + } + } + + return newMatrix; + } + /** + * @memberof Matrix + */ + + function getOrigin(matrix, n) { + if (n === void 0) { + n = Math.sqrt(matrix.length); + } + + var originMatrix = []; + var w = matrix[n * n - 1]; + + for (var i = 0; i < n - 1; ++i) { + originMatrix[i] = matrix[n * (n - 1) + i] / w; + } + + originMatrix[n - 1] = 0; + return originMatrix; + } + /** + * @memberof Matrix + */ + + function fromTranslation(pos, n) { + var newMatrix = createIdentityMatrix(n); + + for (var i = 0; i < n - 1; ++i) { + newMatrix[n * (n - 1) + i] = pos[i] || 0; + } + + return newMatrix; + } + /** + * @memberof Matrix + */ + + function convertPositionMatrix(matrix, n) { + var newMatrix = matrix.slice(); + + for (var i = matrix.length; i < n - 1; ++i) { + newMatrix[i] = 0; + } + + newMatrix[n - 1] = 1; + return newMatrix; + } + /** + * @memberof Matrix + */ + + function convertDimension(matrix, n, m) { + if (n === void 0) { + n = Math.sqrt(matrix.length); + } // n < m + + + if (n === m) { + return matrix; + } + + var newMatrix = createIdentityMatrix(m); + var length = Math.min(n, m); + + for (var i = 0; i < length - 1; ++i) { + for (var j = 0; j < length - 1; ++j) { + newMatrix[i * m + j] = matrix[i * n + j]; + } + + newMatrix[(i + 1) * m - 1] = matrix[(i + 1) * n - 1]; + newMatrix[(m - 1) * m + i] = matrix[(n - 1) * n + i]; + } + + newMatrix[m * m - 1] = matrix[n * n - 1]; + return newMatrix; + } + /** + * @memberof Matrix + */ + + function multiplies(n) { + var matrixes = []; + + for (var _i = 1; _i < arguments.length; _i++) { + matrixes[_i - 1] = arguments[_i]; + } + + var m = createIdentityMatrix(n); + matrixes.forEach(function (matrix) { + m = multiply(m, matrix, n); + }); + return m; + } + /** + * @memberof Matrix + */ + + function multiply(matrix, matrix2, n) { + if (n === void 0) { + n = Math.sqrt(matrix.length); + } + + var newMatrix = []; // 1 y: n + // 1 x: m + // 2 x: m + // 2 y: k + // n * m X m * k + + var m = matrix.length / n; + var k = matrix2.length / m; + + if (!m) { + return matrix2; + } else if (!k) { + return matrix; + } + + for (var i = 0; i < n; ++i) { + for (var j = 0; j < k; ++j) { + newMatrix[j * n + i] = 0; + + for (var l = 0; l < m; ++l) { + // m1 x: m(l), y: n(i) + // m2 x: k(j): y: m(l) + // nw x: n(i), y: k(j) + newMatrix[j * n + i] += matrix[l * n + i] * matrix2[j * m + l]; + } + } + } // n * k + + + return newMatrix; + } + /** + * @memberof Matrix + */ + + function plus(pos1, pos2) { + var length = Math.min(pos1.length, pos2.length); + var nextPos = pos1.slice(); + + for (var i = 0; i < length; ++i) { + nextPos[i] = nextPos[i] + pos2[i]; + } + + return nextPos; + } + /** + * @memberof Matrix + */ + + function minus(pos1, pos2) { + var length = Math.min(pos1.length, pos2.length); + var nextPos = pos1.slice(); + + for (var i = 0; i < length; ++i) { + nextPos[i] = nextPos[i] - pos2[i]; + } + + return nextPos; + } + /** + * @memberof Matrix + */ + + function convertCSStoMatrix(a, is2d) { + if (is2d === void 0) { + is2d = a.length === 6; + } + + if (is2d) { + return [a[0], a[1], 0, a[2], a[3], 0, a[4], a[5], 1]; + } + + return a; + } + /** + * @memberof Matrix + */ + + function convertMatrixtoCSS(a, is2d) { + if (is2d === void 0) { + is2d = a.length === 9; + } + + if (is2d) { + return [a[0], a[1], a[3], a[4], a[6], a[7]]; + } + + return a; + } + /** + * @memberof Matrix + */ + + function calculate(matrix, matrix2, n) { + if (n === void 0) { + n = matrix2.length; + } + + var result = multiply(matrix, matrix2, n); + var k = result[n - 1]; + return result.map(function (v) { + return v / k; + }); + } + /** + * @memberof Matrix + */ + + function rotateX3d(matrix, rad) { + return multiply(matrix, [1, 0, 0, 0, 0, Math.cos(rad), Math.sin(rad), 0, 0, -Math.sin(rad), Math.cos(rad), 0, 0, 0, 0, 1], 4); + } + /** + * @memberof Matrix + */ + + function rotateY3d(matrix, rad) { + return multiply(matrix, [Math.cos(rad), 0, -Math.sin(rad), 0, 0, 1, 0, 0, Math.sin(rad), 0, Math.cos(rad), 0, 0, 0, 0, 1], 4); + } + /** + * @memberof Matrix + */ + + function rotateZ3d(matrix, rad) { + return multiply(matrix, createRotateMatrix(rad, 4)); + } + /** + * @memberof Matrix + */ + + function scale3d(matrix, _a) { + var _b = _a[0], + sx = _b === void 0 ? 1 : _b, + _c = _a[1], + sy = _c === void 0 ? 1 : _c, + _d = _a[2], + sz = _d === void 0 ? 1 : _d; + return multiply(matrix, [sx, 0, 0, 0, 0, sy, 0, 0, 0, 0, sz, 0, 0, 0, 0, 1], 4); + } + /** + * @memberof Matrix + */ + + function rotate(pos, rad) { + return calculate(createRotateMatrix(rad, 3), convertPositionMatrix(pos, 3)); + } + /** + * @memberof Matrix + */ + + function translate3d(matrix, _a) { + var _b = _a[0], + tx = _b === void 0 ? 0 : _b, + _c = _a[1], + ty = _c === void 0 ? 0 : _c, + _d = _a[2], + tz = _d === void 0 ? 0 : _d; + return multiply(matrix, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, tx, ty, tz, 1], 4); + } + /** + * @memberof Matrix + */ + + function matrix3d(matrix1, matrix2) { + return multiply(matrix1, matrix2, 4); + } + /** + * @memberof Matrix + */ + + function createRotateMatrix(rad, n) { + var cos = Math.cos(rad); + var sin = Math.sin(rad); + var m = createIdentityMatrix(n); // cos -sin + // sin cos + + m[0] = cos; + m[1] = sin; + m[n] = -sin; + m[n + 1] = cos; + return m; + } + /** + * @memberof Matrix + */ + + function createIdentityMatrix(n) { + var length = n * n; + var matrix = []; + + for (var i = 0; i < length; ++i) { + matrix[i] = i % (n + 1) ? 0 : 1; + } + + return matrix; + } + /** + * @memberof Matrix + */ + + function createScaleMatrix(scale, n) { + var m = createIdentityMatrix(n); + var length = Math.min(scale.length, n - 1); + + for (var i = 0; i < length; ++i) { + m[(n + 1) * i] = scale[i]; + } + + return m; + } + /** + * @memberof Matrix + */ + + function createOriginMatrix(origin, n) { + var m = createIdentityMatrix(n); + var length = Math.min(origin.length, n - 1); + + for (var i = 0; i < length; ++i) { + m[n * (n - 1) + i] = origin[i]; + } + + return m; + } + /** + * @memberof Matrix + */ + + function createWarpMatrix(pos0, pos1, pos2, pos3, nextPos0, nextPos1, nextPos2, nextPos3) { + var x0 = pos0[0], + y0 = pos0[1]; + var x1 = pos1[0], + y1 = pos1[1]; + var x2 = pos2[0], + y2 = pos2[1]; + var x3 = pos3[0], + y3 = pos3[1]; + var u0 = nextPos0[0], + v0 = nextPos0[1]; + var u1 = nextPos1[0], + v1 = nextPos1[1]; + var u2 = nextPos2[0], + v2 = nextPos2[1]; + var u3 = nextPos3[0], + v3 = nextPos3[1]; + var matrix = [x0, 0, x1, 0, x2, 0, x3, 0, y0, 0, y1, 0, y2, 0, y3, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, x0, 0, x1, 0, x2, 0, x3, 0, y0, 0, y1, 0, y2, 0, y3, 0, 1, 0, 1, 0, 1, 0, 1, -u0 * x0, -v0 * x0, -u1 * x1, -v1 * x1, -u2 * x2, -v2 * x2, -u3 * x3, -v3 * x3, -u0 * y0, -v0 * y0, -u1 * y1, -v1 * y1, -u2 * y2, -v2 * y2, -u3 * y3, -v3 * y3]; + var inverseMatrix = invert(matrix, 8); + + if (!inverseMatrix.length) { + return []; + } + + var h = multiply(inverseMatrix, [u0, v0, u1, v1, u2, v2, u3, v3], 8); + h[8] = 1; + return convertDimension(transpose(h), 3, 4); + } + + /* + Copyright (c) 2019 Daybrush + name: css-to-mat + license: MIT + author: Daybrush + repository: git+https://github.com/daybrush/css-to-mat.git + version: 1.1.0 + */ + + /****************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + /* global Reflect, Promise */ + + + var __assign$5 = function() { + __assign$5 = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign$5.apply(this, arguments); + }; + + function createMatrix() { + return [ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1, + ]; + } + function parseMat(transform, size) { + if (size === void 0) { size = 0; } + return toMat(parse(transform, size)); + } + function calculateMatrixDist(matrix, pos) { + var res = calculate(matrix, [pos[0], pos[1] || 0, pos[2] || 0, 1], 4); + var w = res[3] || 1; + return [ + res[0] / w, + res[1] / w, + res[2] / w, + ]; + } + function toMat(matrixInfos) { + var target = createMatrix(); + matrixInfos.forEach(function (info) { + var matrixFunction = info.matrixFunction, functionValue = info.functionValue; + if (!matrixFunction) { + return; + } + target = matrixFunction(target, functionValue); + }); + return target; + } + function parse(transform, size) { + if (size === void 0) { size = 0; } + var transforms = isArray(transform) ? transform : splitSpace(transform); + return transforms.map(function (t) { + var _a = splitBracket(t), name = _a.prefix, value = _a.value; + var matrixFunction = null; + var functionName = name; + var functionValue = ""; + if (name === "translate" || name === "translateX" || name === "translate3d") { + var nextSize_1 = isObject(size) ? __assign$5(__assign$5({}, size), { "o%": size["%"] }) : { + "%": size, + "o%": size, + }; + var _b = splitComma(value).map(function (v, i) { + if (i === 0 && "x%" in nextSize_1) { + nextSize_1["%"] = size["x%"]; + } + else if (i === 1 && "y%" in nextSize_1) { + nextSize_1["%"] = size["y%"]; + } + else { + nextSize_1["%"] = size["o%"]; + } + return convertUnitSize(v, nextSize_1); + }), posX = _b[0], _c = _b[1], posY = _c === void 0 ? 0 : _c, _d = _b[2], posZ = _d === void 0 ? 0 : _d; + matrixFunction = translate3d; + functionValue = [posX, posY, posZ]; + } + else if (name === "translateY") { + var nextSize = isObject(size) ? __assign$5({ "%": size["y%"] }, size) : { + "%": size, + }; + var posY = convertUnitSize(value, nextSize); + matrixFunction = translate3d; + functionValue = [0, posY, 0]; + } + else if (name === "translateZ") { + var posZ = parseFloat(value); + matrixFunction = translate3d; + functionValue = [0, 0, posZ]; + } + else if (name === "scale" || name === "scale3d") { + var _e = splitComma(value).map(function (v) { return parseFloat(v); }), sx = _e[0], _f = _e[1], sy = _f === void 0 ? sx : _f, _g = _e[2], sz = _g === void 0 ? 1 : _g; + matrixFunction = scale3d; + functionValue = [sx, sy, sz]; + } + else if (name === "scaleX") { + var sx = parseFloat(value); + matrixFunction = scale3d; + functionValue = [sx, 1, 1]; + } + else if (name === "scaleY") { + var sy = parseFloat(value); + matrixFunction = scale3d; + functionValue = [1, sy, 1]; + } + else if (name === "scaleZ") { + var sz = parseFloat(value); + matrixFunction = scale3d; + functionValue = [1, 1, sz]; + } + else if (name === "rotate" || name === "rotateZ" || name === "rotateX" || name === "rotateY") { + var _h = splitUnit(value), unit = _h.unit, unitValue = _h.value; + var rad = unit === "rad" ? unitValue : unitValue * Math.PI / 180; + if (name === "rotate" || name === "rotateZ") { + functionName = "rotateZ"; + matrixFunction = rotateZ3d; + } + else if (name === "rotateX") { + matrixFunction = rotateX3d; + } + else if (name === "rotateY") { + matrixFunction = rotateY3d; + } + functionValue = rad; + } + else if (name === "matrix3d") { + matrixFunction = matrix3d; + functionValue = splitComma(value).map(function (v) { return parseFloat(v); }); + } + else if (name === "matrix") { + var m = splitComma(value).map(function (v) { return parseFloat(v); }); + matrixFunction = matrix3d; + functionValue = [ + m[0], m[1], 0, 0, + m[2], m[3], 0, 0, + 0, 0, 1, 0, + m[4], m[5], 0, 1, + ]; + } + else { + functionName = ""; + } + return { + name: name, + functionName: functionName, + value: value, + matrixFunction: matrixFunction, + functionValue: functionValue, + }; + }); + } + + /* + Copyright (c) 2019-present NAVER Corp. + name: @egjs/children-differ + license: MIT + author: NAVER Corp. + repository: https://github.com/naver/egjs-children-differ + version: 1.0.1 + */ + + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + + /* global Reflect, Promise */ + var extendStatics$3 = function (d, b) { + extendStatics$3 = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function (d, b) { + d.__proto__ = b; + } || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + }; + + return extendStatics$3(d, b); + }; + + function __extends$3(d, b) { + extendStatics$3(d, b); + + function __() { + this.constructor = d; + } + + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + } + + /* + egjs-children-differ + Copyright (c) 2019-present NAVER Corp. + MIT license + */ + var findKeyCallback = typeof Map === "function" ? undefined : function () { + var childrenCount = 0; + return function (el) { + return el.__DIFF_KEY__ || (el.__DIFF_KEY__ = ++childrenCount); + }; + }(); + + /** + * A module that checks diff when child are added, removed, or changed . + * @ko 자식 노드들에서 자식 노드가 추가되거나 삭제되거나 순서가 변경된 사항을 체크하는 모듈입니다. + * @memberof eg + * @extends eg.ListDiffer + */ + + var ChildrenDiffer = + /*#__PURE__*/ + function (_super) { + __extends$3(ChildrenDiffer, _super); + /** + * @param - Initializing Children 초기 설정할 자식 노드들 + */ + + + function ChildrenDiffer(list) { + if (list === void 0) { + list = []; + } + + return _super.call(this, list, findKeyCallback) || this; + } + + return ChildrenDiffer; + }(ListDiffer); + + /* + egjs-children-differ + Copyright (c) 2019-present NAVER Corp. + MIT license + */ + /** + * + * @memberof eg.ChildrenDiffer + * @static + * @function + * @param - Previous List 이전 목록 + * @param - List to Update 업데이트 할 목록 + * @return - Returns the diff between `prevList` and `list` `prevList`와 `list`의 다른 점을 반환한다. + * @example + * import { diff } from "@egjs/children-differ"; + * // script => eg.ChildrenDiffer.diff + * const result = diff([0, 1, 2, 3, 4, 5], [7, 8, 0, 4, 3, 6, 2, 1]); + * // List before update + * // [1, 2, 3, 4, 5] + * console.log(result.prevList); + * // Updated list + * // [4, 3, 6, 2, 1] + * console.log(result.list); + * // Index array of values added to `list` + * // [0, 1, 5] + * console.log(result.added); + * // Index array of values removed in `prevList` + * // [5] + * console.log(result.removed); + * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list` + * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]] + * console.log(result.changed); + * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>) + * // [[4, 3], [3, 4], [2, 6]] + * console.log(result.pureChanged); + * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>) + * // [[4, 1], [4, 2], [4, 3]] + * console.log(result.ordered); + * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved + * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]] + * console.log(result.maintained); + */ + + function diff(prevList, list) { + return diff$1(prevList, list, findKeyCallback); + } + + /* + Copyright (c) 2019 Daybrush + name: @scena/event-emitter + license: MIT + author: Daybrush + repository: git+https://github.com/daybrush/gesture.git + version: 1.0.5 + */ + + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + var __assign$4 = function () { + __assign$4 = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + + return t; + }; + + return __assign$4.apply(this, arguments); + }; + function __spreadArrays$1() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + + for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; + + return r; + } + + /** + * Implement EventEmitter on object or component. + */ + + var EventEmitter = + /*#__PURE__*/ + function () { + function EventEmitter() { + this._events = {}; + } + /** + * Add a listener to the registered event. + * @param - Name of the event to be added + * @param - listener function of the event to be added + * @example + * import EventEmitter from "@scena/event-emitter"; + * cosnt emitter = new EventEmitter(); + * + * // Add listener in "a" event + * emitter.on("a", () => { + * }); + * // Add listeners + * emitter.on({ + * a: () => {}, + * b: () => {}, + * }); + */ + + + var __proto = EventEmitter.prototype; + + __proto.on = function (eventName, listener) { + if (isObject(eventName)) { + for (var name in eventName) { + this.on(name, eventName[name]); + } + } else { + this._addEvent(eventName, listener, {}); + } + + return this; + }; + /** + * Remove listeners registered in the event target. + * @param - Name of the event to be removed + * @param - listener function of the event to be removed + * @example + * import EventEmitter from "@scena/event-emitter"; + * cosnt emitter = new EventEmitter(); + * + * // Remove all listeners. + * emitter.off(); + * + * // Remove all listeners in "A" event. + * emitter.off("a"); + * + * + * // Remove "listener" listener in "a" event. + * emitter.off("a", listener); + */ + + + __proto.off = function (eventName, listener) { + if (!eventName) { + this._events = {}; + } else if (isObject(eventName)) { + for (var name in eventName) { + this.off(name); + } + } else if (!listener) { + this._events[eventName] = []; + } else { + var events = this._events[eventName]; + + if (events) { + var index = findIndex(events, function (e) { + return e.listener === listener; + }); + + if (index > -1) { + events.splice(index, 1); + } + } + } + + return this; + }; + /** + * Add a disposable listener and Use promise to the registered event. + * @param - Name of the event to be added + * @param - disposable listener function of the event to be added + * @example + * import EventEmitter from "@scena/event-emitter"; + * cosnt emitter = new EventEmitter(); + * + * // Add a disposable listener in "a" event + * emitter.once("a", () => { + * }); + * + * // Use Promise + * emitter.once("a").then(e => { + * }); + */ + + + __proto.once = function (eventName, listener) { + var _this = this; + + if (listener) { + this._addEvent(eventName, listener, { + once: true + }); + } + + return new Promise(function (resolve) { + _this._addEvent(eventName, resolve, { + once: true + }); + }); + }; + /** + * Fires an event to call listeners. + * @param - Event name + * @param - Event parameter + * @return If false, stop the event. + * @example + * + * import EventEmitter from "@scena/event-emitter"; + * + * + * const emitter = new EventEmitter(); + * + * emitter.on("a", e => { + * }); + * + * + * emitter.emit("a", { + * a: 1, + * }); + */ + + + __proto.emit = function (eventName, param) { + var _this = this; + + if (param === void 0) { + param = {}; + } + + var events = this._events[eventName]; + + if (!eventName || !events) { + return true; + } + + var isStop = false; + param.eventType = eventName; + + param.stop = function () { + isStop = true; + }; + + param.currentTarget = this; + + __spreadArrays$1(events).forEach(function (info) { + info.listener(param); + + if (info.once) { + _this.off(eventName, info.listener); + } + }); + + return !isStop; + }; + /** + * Fires an event to call listeners. + * @param - Event name + * @param - Event parameter + * @return If false, stop the event. + * @example + * + * import EventEmitter from "@scena/event-emitter"; + * + * + * const emitter = new EventEmitter(); + * + * emitter.on("a", e => { + * }); + * + * + * emitter.emit("a", { + * a: 1, + * }); + */ + + /** + * Fires an event to call listeners. + * @param - Event name + * @param - Event parameter + * @return If false, stop the event. + * @example + * + * import EventEmitter from "@scena/event-emitter"; + * + * + * const emitter = new EventEmitter(); + * + * emitter.on("a", e => { + * }); + * + * // emit + * emitter.trigger("a", { + * a: 1, + * }); + */ + + + __proto.trigger = function (eventName, param) { + if (param === void 0) { + param = {}; + } + + return this.emit(eventName, param); + }; + + __proto._addEvent = function (eventName, listener, options) { + var events = this._events; + events[eventName] = events[eventName] || []; + var listeners = events[eventName]; + listeners.push(__assign$4({ + listener: listener + }, options)); + }; + + return EventEmitter; + }(); + + var EventEmitter$1 = EventEmitter; + + /* + Copyright (c) 2019 Daybrush + name: @scena/dragscroll + license: MIT + author: Daybrush + repository: git+https://github.com/daybrush/dragscroll.git + version: 1.4.0 + */ + + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + /* global Reflect, Promise */ + + var extendStatics$2 = function (d, b) { + extendStatics$2 = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function (d, b) { + d.__proto__ = b; + } || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + }; + return extendStatics$2(d, b); + }; + function __extends$2(d, b) { + extendStatics$2(d, b); + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + } + var __assign$3 = function () { + __assign$3 = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign$3.apply(this, arguments); + }; + + function getDefaultScrollPosition$1(e) { + var container = e.container; + if (container === document.body) { + return [container.scrollLeft || document.documentElement.scrollLeft, container.scrollTop || document.documentElement.scrollTop]; + } + return [container.scrollLeft, container.scrollTop]; + } + function checkDefaultScrollEvent(container, callback) { + container.addEventListener("scroll", callback); + return function () { + container.removeEventListener("scroll", callback); + }; + } + function getContainerElement(container) { + if (!container) { + return null; + } else if (isString(container)) { + return document.querySelector(container); + } + if (isFunction(container)) { + return container(); + } else if (container instanceof Element) { + return container; + } else if ("current" in container) { + return container.current; + } else if ("value" in container) { + return container.value; + } + } + /** + * @sort 1 + */ + var DragScroll = /*#__PURE__*/function (_super) { + __extends$2(DragScroll, _super); + function DragScroll() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._startRect = null; + _this._startPos = []; + _this._prevTime = 0; + _this._timer = 0; + _this._prevScrollPos = [0, 0]; + _this._isWait = false; + _this._flag = false; + _this._currentOptions = null; + _this._lock = false; + _this._unregister = null; + _this._onScroll = function () { + var options = _this._currentOptions; + if (_this._lock || !options) { + return; + } + _this.emit("scrollDrag", { + next: function (inputEvent) { + _this.checkScroll({ + container: options.container, + inputEvent: inputEvent + }); + } + }); + }; + return _this; + } + /** + */ + var __proto = DragScroll.prototype; + __proto.dragStart = function (e, options) { + var container = getContainerElement(options.container); + if (!container) { + this._flag = false; + return; + } + var top = 0; + var left = 0; + var width = 0; + var height = 0; + if (container === document.body) { + width = window.innerWidth; + height = window.innerHeight; + } else { + var rect = container.getBoundingClientRect(); + top = rect.top; + left = rect.left; + width = rect.width; + height = rect.height; + } + this._flag = true; + this._startPos = [e.clientX, e.clientY]; + this._startRect = { + top: top, + left: left, + width: width, + height: height + }; + this._prevScrollPos = this._getScrollPosition([0, 0], options); + this._currentOptions = options; + this._registerScrollEvent(options); + }; + __proto.drag = function (e, options) { + clearTimeout(this._timer); + if (!this._flag) { + return; + } + var clientX = e.clientX, + clientY = e.clientY; + var _a = options.threshold, + threshold = _a === void 0 ? 0 : _a; + var _b = this, + _startRect = _b._startRect, + _startPos = _b._startPos; + this._currentOptions = options; + var direction = [0, 0]; + if (_startRect.top > clientY - threshold) { + if (_startPos[1] > _startRect.top || clientY < _startPos[1]) { + direction[1] = -1; + } + } else if (_startRect.top + _startRect.height < clientY + threshold) { + if (_startPos[1] < _startRect.top + _startRect.height || clientY > _startPos[1]) { + direction[1] = 1; + } + } + if (_startRect.left > clientX - threshold) { + if (_startPos[0] > _startRect.left || clientX < _startPos[0]) { + direction[0] = -1; + } + } else if (_startRect.left + _startRect.width < clientX + threshold) { + if (_startPos[0] < _startRect.left + _startRect.width || clientX > _startPos[0]) { + direction[0] = 1; + } + } + if (!direction[0] && !direction[1]) { + return false; + } + return this._continueDrag(__assign$3(__assign$3({}, options), { + direction: direction, + inputEvent: e, + isDrag: true + })); + }; + /** + */ + __proto.checkScroll = function (options) { + var _this = this; + if (this._isWait) { + return false; + } + var _a = options.prevScrollPos, + prevScrollPos = _a === void 0 ? this._prevScrollPos : _a, + direction = options.direction, + _b = options.throttleTime, + throttleTime = _b === void 0 ? 0 : _b, + inputEvent = options.inputEvent, + isDrag = options.isDrag; + var nextScrollPos = this._getScrollPosition(direction || [0, 0], options); + var offsetX = nextScrollPos[0] - prevScrollPos[0]; + var offsetY = nextScrollPos[1] - prevScrollPos[1]; + var nextDirection = direction || [offsetX ? Math.abs(offsetX) / offsetX : 0, offsetY ? Math.abs(offsetY) / offsetY : 0]; + this._prevScrollPos = nextScrollPos; + this._lock = false; + if (!offsetX && !offsetY) { + return false; + } + /** + * @event DragScroll#move + */ + this.emit("move", { + offsetX: nextDirection[0] ? offsetX : 0, + offsetY: nextDirection[1] ? offsetY : 0, + inputEvent: inputEvent + }); + if (throttleTime && isDrag) { + clearTimeout(this._timer); + this._timer = window.setTimeout(function () { + _this._continueDrag(options); + }, throttleTime); + } + return true; + }; + /** + * + */ + __proto.dragEnd = function () { + this._flag = false; + this._lock = false; + clearTimeout(this._timer); + this._unregisterScrollEvent(); + }; + __proto._getScrollPosition = function (direction, options) { + var container = options.container, + _a = options.getScrollPosition, + getScrollPosition = _a === void 0 ? getDefaultScrollPosition$1 : _a; + return getScrollPosition({ + container: getContainerElement(container), + direction: direction + }); + }; + __proto._continueDrag = function (options) { + var _this = this; + var _a; + var container = options.container, + direction = options.direction, + throttleTime = options.throttleTime, + useScroll = options.useScroll, + isDrag = options.isDrag, + inputEvent = options.inputEvent; + if (!this._flag || isDrag && this._isWait) { + return; + } + var nowTime = now(); + var distTime = Math.max(throttleTime + this._prevTime - nowTime, 0); + if (distTime > 0) { + clearTimeout(this._timer); + this._timer = window.setTimeout(function () { + _this._continueDrag(options); + }, distTime); + return false; + } + this._prevTime = nowTime; + var prevScrollPos = this._getScrollPosition(direction, options); + this._prevScrollPos = prevScrollPos; + if (isDrag) { + this._isWait = true; + } + // unregister native scroll event + if (!useScroll) { + this._lock = true; + } + var param = { + container: getContainerElement(container), + direction: direction, + inputEvent: inputEvent + }; + (_a = options.requestScroll) === null || _a === void 0 ? void 0 : _a.call(options, param); + /** + * @event DragScroll#scroll + */ + this.emit("scroll", param); + this._isWait = false; + return useScroll || this.checkScroll(__assign$3(__assign$3({}, options), { + prevScrollPos: prevScrollPos, + direction: direction, + inputEvent: inputEvent + })); + }; + __proto._registerScrollEvent = function (options) { + this._unregisterScrollEvent(); + var checkScrollEvent = options.checkScrollEvent; + if (!checkScrollEvent) { + return; + } + var callback = checkScrollEvent === true ? checkDefaultScrollEvent : checkScrollEvent; + var container = getContainerElement(options.container); + if (checkScrollEvent === true && (container === document.body || container === document.documentElement)) { + this._unregister = checkDefaultScrollEvent(window, this._onScroll); + } else { + this._unregister = callback(container, this._onScroll); + } + }; + __proto._unregisterScrollEvent = function () { + var _a; + (_a = this._unregister) === null || _a === void 0 ? void 0 : _a.call(this); + this._unregister = null; + }; + return DragScroll; + }(EventEmitter$1); + + var DragScroll$1 = DragScroll; + + /* + Copyright (c) 2020 Daybrush + name: overlap-area + license: MIT + author: Daybrush + repository: git+https://github.com/daybrush/overlap-area.git + version: 1.1.0 + */ + + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + + for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; + + return r; + } + + function tinyThrottle(num) { + return throttle(num, TINY_NUM$1); + } + function isSameConstants(linearConstants1, linearConstants2) { + return linearConstants1.every(function (v, i) { + return tinyThrottle(v - linearConstants2[i]) === 0; + }); + } + function isSamePoint(point1, point2) { + return !tinyThrottle(point1[0] - point2[0]) && !tinyThrottle(point1[1] - point2[1]); + } + + /** + * @namespace OverlapArea + */ + + /** + * Gets the size of a shape (polygon) made of points. + * @memberof OverlapArea + */ + + function getAreaSize(points) { + if (points.length < 3) { + return 0; + } + + return Math.abs(sum(points.map(function (point, i) { + var nextPoint = points[i + 1] || points[0]; + return point[0] * nextPoint[1] - nextPoint[0] * point[1]; + }))) / 2; + } + /** + * Get points that fit the rect, + * @memberof OverlapArea + */ + + function fitPoints(points, rect) { + var width = rect.width, + height = rect.height, + left = rect.left, + top = rect.top; + + var _a = getMinMaxs(points), + minX = _a.minX, + minY = _a.minY, + maxX = _a.maxX, + maxY = _a.maxY; + + var ratioX = width / (maxX - minX); + var ratioY = height / (maxY - minY); + return points.map(function (point) { + return [left + (point[0] - minX) * ratioX, top + (point[1] - minY) * ratioY]; + }); + } + /** + * Get the minimum and maximum points of the points. + * @memberof OverlapArea + */ + + function getMinMaxs(points) { + var xs = points.map(function (point) { + return point[0]; + }); + var ys = points.map(function (point) { + return point[1]; + }); + return { + minX: Math.min.apply(Math, xs), + minY: Math.min.apply(Math, ys), + maxX: Math.max.apply(Math, xs), + maxY: Math.max.apply(Math, ys) + }; + } + /** + * Whether the point is in shape + * @param - point pos + * @param - shape points + * @param - whether to check except line + * @memberof OverlapArea + */ + + function isInside(pos, points, excludeLine) { + var x = pos[0], + y = pos[1]; + + var _a = getMinMaxs(points), + minX = _a.minX, + maxX = _a.maxX; + + var xLine = [[minX, y], [maxX, y]]; + var xLinearConstants = getLinearConstants(xLine[0], xLine[1]); + var lines = convertLines(points); + var intersectionPosInfos = []; + lines.forEach(function (line) { + var linearConstants = getLinearConstants(line[0], line[1]); + var standardPoint = line[0]; + + if (isSameConstants(xLinearConstants, linearConstants)) { + intersectionPosInfos.push({ + pos: pos, + line: line, + type: "line" + }); + } else { + var xPoints = getPointsOnLines(getIntersectionPointsByConstants(xLinearConstants, linearConstants), [xLine, line]); + xPoints.forEach(function (point) { + if (line.some(function (linePoint) { + return isSamePoint(linePoint, point); + })) { + intersectionPosInfos.push({ + pos: point, + line: line, + type: "point" + }); + } else if (tinyThrottle(standardPoint[1] - y) !== 0) { + intersectionPosInfos.push({ + pos: point, + line: line, + type: "intersection" + }); + } + }); + } + }); + + if (!excludeLine) { + // on line + if (find$1(intersectionPosInfos, function (p) { + return p[0] === x; + })) { + return true; + } + } + + var intersectionCount = 0; + var xMap = {}; + intersectionPosInfos.forEach(function (_a) { + var pos = _a.pos, + type = _a.type, + line = _a.line; + + if (pos[0] > x) { + return; + } + + if (type === "intersection") { + ++intersectionCount; + } else if (type === "line") { + return; + } else if (type === "point") { + var point = find$1(line, function (linePoint) { + return linePoint[1] !== y; + }); + var prevValue = xMap[pos[0]]; + var nextValue = point[1] > y ? 1 : -1; + + if (!prevValue) { + xMap[pos[0]] = nextValue; + } else if (prevValue !== nextValue) { + ++intersectionCount; + } + } + }); + return intersectionCount % 2 === 1; + } + /** + * Get the coefficient of the linear function. [a, b, c] (ax + by + c = 0) + * @return [a, b, c] + * @memberof OverlapArea + */ + + function getLinearConstants(point1, point2) { + var x1 = point1[0], + y1 = point1[1]; + var x2 = point2[0], + y2 = point2[1]; // ax + by + c = 0 + // [a, b, c] + + var dx = x2 - x1; + var dy = y2 - y1; + + if (Math.abs(dx) < TINY_NUM$1) { + dx = 0; + } + + if (Math.abs(dy) < TINY_NUM$1) { + dy = 0; + } // b > 0 + // ax + by + c = 0 + + + var a = 0; + var b = 0; + var c = 0; + + if (!dx) { + if (dy) { + // -x + 1 = 0 + a = -1; + c = x1; + } + } else if (!dy) { + // y - 1 = 0 + b = 1; + c = -y1; + } else { + // y = -a(x - x1) + y1 + // ax + y + a * x1 - y1 = 0 + a = -dy / dx; + b = 1; + c = -a * x1 - y1; + } + + return [a, b, c]; + } + /** + * Get intersection points with linear functions. + * @memberof OverlapArea + */ + + function getIntersectionPointsByConstants(linearConstants1, linearConstants2) { + var a1 = linearConstants1[0], + b1 = linearConstants1[1], + c1 = linearConstants1[2]; + var a2 = linearConstants2[0], + b2 = linearConstants2[1], + c2 = linearConstants2[2]; + var isZeroA = a1 === 0 && a2 === 0; + var isZeroB = b1 === 0 && b2 === 0; + var results = []; + + if (isZeroA && isZeroB) { + return []; + } else if (isZeroA) { + // b1 * y + c1 = 0 + // b2 * y + c2 = 0 + var y1 = -c1 / b1; + var y2 = -c2 / b2; + + if (y1 !== y2) { + return []; + } else { + return [[-Infinity, y1], [Infinity, y1]]; + } + } else if (isZeroB) { + // a1 * x + c1 = 0 + // a2 * x + c2 = 0 + var x1 = -c1 / a1; + var x2 = -c2 / a2; + + if (x1 !== x2) { + return []; + } else { + return [[x1, -Infinity], [x1, Infinity]]; + } + } else if (a1 === 0) { + // b1 * y + c1 = 0 + // y = - c1 / b1; + // a2 * x + b2 * y + c2 = 0 + var y = -c1 / b1; + var x = -(b2 * y + c2) / a2; + results = [[x, y]]; + } else if (a2 === 0) { + // b2 * y + c2 = 0 + // y = - c2 / b2; + // a1 * x + b1 * y + c1 = 0 + var y = -c2 / b2; + var x = -(b1 * y + c1) / a1; + results = [[x, y]]; + } else if (b1 === 0) { + // a1 * x + c1 = 0 + // x = - c1 / a1; + // a2 * x + b2 * y + c2 = 0 + var x = -c1 / a1; + var y = -(a2 * x + c2) / b2; + results = [[x, y]]; + } else if (b2 === 0) { + // a2 * x + c2 = 0 + // x = - c2 / a2; + // a1 * x + b1 * y + c1 = 0 + var x = -c2 / a2; + var y = -(a1 * x + c1) / b1; + results = [[x, y]]; + } else { + // a1 * x + b1 * y + c1 = 0 + // a2 * x + b2 * y + c2 = 0 + // b2 * a1 * x + b2 * b1 * y + b2 * c1 = 0 + // b1 * a2 * x + b1 * b2 * y + b1 * c2 = 0 + // (b2 * a1 - b1 * a2) * x = (b1 * c2 - b2 * c1) + var x = (b1 * c2 - b2 * c1) / (b2 * a1 - b1 * a2); + var y = -(a1 * x + c1) / b1; + results = [[x, y]]; + } + + return results.map(function (result) { + return [result[0], result[1]]; + }); + } + /** + * Get the points on the lines (between two points). + * @memberof OverlapArea + */ + + function getPointsOnLines(points, lines) { + var minMaxs = lines.map(function (line) { + return [0, 1].map(function (order) { + return [Math.min(line[0][order], line[1][order]), Math.max(line[0][order], line[1][order])]; + }); + }); + var results = []; + + if (points.length === 2) { + var _a = points[0], + x = _a[0], + y = _a[1]; + + if (!tinyThrottle(x - points[1][0])) { + /// Math.max(minY1, minY2) + var top = Math.max.apply(Math, minMaxs.map(function (minMax) { + return minMax[1][0]; + })); /// Math.min(maxY1, miax2) + + var bottom = Math.min.apply(Math, minMaxs.map(function (minMax) { + return minMax[1][1]; + })); + + if (tinyThrottle(top - bottom) > 0) { + return []; + } + + results = [[x, top], [x, bottom]]; + } else if (!tinyThrottle(y - points[1][1])) { + /// Math.max(minY1, minY2) + var left = Math.max.apply(Math, minMaxs.map(function (minMax) { + return minMax[0][0]; + })); /// Math.min(maxY1, miax2) + + var right = Math.min.apply(Math, minMaxs.map(function (minMax) { + return minMax[0][1]; + })); + + if (tinyThrottle(left - right) > 0) { + return []; + } + + results = [[left, y], [right, y]]; + } + } + + if (!results.length) { + results = points.filter(function (point) { + var pointX = point[0], + pointY = point[1]; + return minMaxs.every(function (minMax) { + return 0 <= tinyThrottle(pointX - minMax[0][0]) && 0 <= tinyThrottle(minMax[0][1] - pointX) && 0 <= tinyThrottle(pointY - minMax[1][0]) && 0 <= tinyThrottle(minMax[1][1] - pointY); + }); + }); + } + + return results.map(function (result) { + return [tinyThrottle(result[0]), tinyThrottle(result[1])]; + }); + } + /** + * Convert two points into lines. + * @function + * @memberof OverlapArea + */ + + function convertLines(points) { + return __spreadArrays(points.slice(1), [points[0]]).map(function (point, i) { + return [points[i], point]; + }); + } + + function getOverlapPointInfos(points1, points2) { + var targetPoints1 = points1.slice(); + var targetPoints2 = points2.slice(); + + if (getShapeDirection(targetPoints1) === -1) { + targetPoints1.reverse(); + } + + if (getShapeDirection(targetPoints2) === -1) { + targetPoints2.reverse(); + } + + var lines1 = convertLines(targetPoints1); + var lines2 = convertLines(targetPoints2); + var linearConstantsList1 = lines1.map(function (line1) { + return getLinearConstants(line1[0], line1[1]); + }); + var linearConstantsList2 = lines2.map(function (line2) { + return getLinearConstants(line2[0], line2[1]); + }); + var overlapInfos = []; + linearConstantsList1.forEach(function (linearConstants1, i) { + var line1 = lines1[i]; + var linePointInfos = []; + linearConstantsList2.forEach(function (linearConstants2, j) { + var intersectionPoints = getIntersectionPointsByConstants(linearConstants1, linearConstants2); + var points = getPointsOnLines(intersectionPoints, [line1, lines2[j]]); + linePointInfos.push.apply(linePointInfos, points.map(function (pos) { + return { + index1: i, + index2: j, + pos: pos, + type: "intersection" + }; + })); + }); + linePointInfos.sort(function (a, b) { + return getDist$2(line1[0], a.pos) - getDist$2(line1[0], b.pos); + }); + overlapInfos.push.apply(overlapInfos, linePointInfos); + + if (isInside(line1[1], targetPoints2)) { + overlapInfos.push({ + index1: i, + index2: -1, + pos: line1[1], + type: "inside" + }); + } + }); + lines2.forEach(function (line2, i) { + if (!isInside(line2[1], targetPoints1)) { + return; + } + + var isNext = false; + var index = findIndex(overlapInfos, function (_a) { + var index2 = _a.index2; + + if (index2 === i) { + isNext = true; + return false; + } + + if (isNext) { + return true; + } + + return false; + }); + + if (index === -1) { + isNext = false; + index = findIndex(overlapInfos, function (_a) { + var index1 = _a.index1, + index2 = _a.index2; + + if (index1 === -1 && index2 + 1 === i) { + isNext = true; + return false; + } + + if (isNext) { + return true; + } + + return false; + }); + } + + if (index === -1) { + overlapInfos.push({ + index1: -1, + index2: i, + pos: line2[1], + type: "inside" + }); + } else { + overlapInfos.splice(index, 0, { + index1: -1, + index2: i, + pos: line2[1], + type: "inside" + }); + } + }); + var pointMap = {}; + return overlapInfos.filter(function (_a) { + var pos = _a.pos; + var key = pos[0] + "x" + pos[1]; + + if (pointMap[key]) { + return false; + } + + pointMap[key] = true; + return true; + }); + } + /** + * Get the points of the overlapped part of two shapes. + * @function + * @memberof OverlapArea + */ + + + function getOverlapPoints(points1, points2) { + var infos = getOverlapPointInfos(points1, points2); + return infos.map(function (_a) { + var pos = _a.pos; + return pos; + }); + } + /** + * Gets the size of the overlapped part of two shapes. + * @function + * @memberof OverlapArea + */ + + function getOverlapSize(points1, points2) { + var points = getOverlapPoints(points1, points2); + return getAreaSize(points); + } + + /* + Copyright (c) 2019 Daybrush + name: gesto + license: MIT + author: Daybrush + repository: git+https://github.com/daybrush/gesto.git + version: 1.19.0 + */ + + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + /* global Reflect, Promise */ + + var extendStatics$1 = function(d, b) { + extendStatics$1 = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics$1(d, b); + }; + + function __extends$1(d, b) { + extendStatics$1(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + } + + var __assign$2 = function() { + __assign$2 = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign$2.apply(this, arguments); + }; + + function getRad(pos1, pos2) { + var distX = pos2[0] - pos1[0]; + var distY = pos2[1] - pos1[1]; + var rad = Math.atan2(distY, distX); + return rad >= 0 ? rad : rad + Math.PI * 2; + } + function getRotatiion(touches) { + return getRad([ + touches[0].clientX, + touches[0].clientY, + ], [ + touches[1].clientX, + touches[1].clientY, + ]) / Math.PI * 180; + } + function isMultiTouch(e) { + return e.touches && e.touches.length >= 2; + } + function getEventClients(e) { + if (!e) { + return []; + } + if (e.touches) { + return getClients(e.touches); + } + else { + return [getClient(e)]; + } + } + function isMouseEvent(e) { + return e && (e.type.indexOf("mouse") > -1 || "button" in e); + } + function getPosition(clients, prevClients, startClients) { + var length = startClients.length; + var _a = getAverageClient(clients, length), clientX = _a.clientX, clientY = _a.clientY, originalClientX = _a.originalClientX, originalClientY = _a.originalClientY; + var _b = getAverageClient(prevClients, length), prevX = _b.clientX, prevY = _b.clientY; + var _c = getAverageClient(startClients, length), startX = _c.clientX, startY = _c.clientY; + var deltaX = clientX - prevX; + var deltaY = clientY - prevY; + var distX = clientX - startX; + var distY = clientY - startY; + return { + clientX: originalClientX, + clientY: originalClientY, + deltaX: deltaX, + deltaY: deltaY, + distX: distX, + distY: distY, + }; + } + function getDist$1(clients) { + return Math.sqrt(Math.pow(clients[0].clientX - clients[1].clientX, 2) + + Math.pow(clients[0].clientY - clients[1].clientY, 2)); + } + function getClients(touches) { + var length = Math.min(touches.length, 2); + var clients = []; + for (var i = 0; i < length; ++i) { + clients.push(getClient(touches[i])); + } + return clients; + } + function getClient(e) { + return { + clientX: e.clientX, + clientY: e.clientY, + }; + } + function getAverageClient(clients, length) { + if (length === void 0) { length = clients.length; } + var sumClient = { + clientX: 0, + clientY: 0, + originalClientX: 0, + originalClientY: 0, + }; + for (var i = 0; i < length; ++i) { + var client = clients[i]; + sumClient.originalClientX += "originalClientX" in client ? client.originalClientX : client.clientX; + sumClient.originalClientY += "originalClientY" in client ? client.originalClientY : client.clientY; + sumClient.clientX += client.clientX; + sumClient.clientY += client.clientY; + } + if (!length) { + return sumClient; + } + return { + clientX: sumClient.clientX / length, + clientY: sumClient.clientY / length, + originalClientX: sumClient.originalClientX / length, + originalClientY: sumClient.originalClientY / length, + }; + } + + var ClientStore = /*#__PURE__*/ (function () { + function ClientStore(clients) { + this.prevClients = []; + this.startClients = []; + this.movement = 0; + this.length = 0; + this.startClients = clients; + this.prevClients = clients; + this.length = clients.length; + } + ClientStore.prototype.getAngle = function (clients) { + if (clients === void 0) { clients = this.prevClients; } + return getRotatiion(clients); + }; + ClientStore.prototype.getRotation = function (clients) { + if (clients === void 0) { clients = this.prevClients; } + return getRotatiion(clients) - getRotatiion(this.startClients); + }; + ClientStore.prototype.getPosition = function (clients, isAdd) { + if (clients === void 0) { clients = this.prevClients; } + var position = getPosition(clients || this.prevClients, this.prevClients, this.startClients); + var deltaX = position.deltaX, deltaY = position.deltaY; + this.movement += Math.sqrt(deltaX * deltaX + deltaY * deltaY); + this.prevClients = clients; + return position; + }; + ClientStore.prototype.getPositions = function (clients) { + if (clients === void 0) { clients = this.prevClients; } + var prevClients = this.prevClients; + return this.startClients.map(function (startClient, i) { return getPosition([clients[i]], [prevClients[i]], [startClient]); }); + }; + ClientStore.prototype.getMovement = function (clients) { + var movement = this.movement; + if (!clients) { + return movement; + } + var currentClient = getAverageClient(clients, this.length); + var prevClient = getAverageClient(this.prevClients, this.length); + var deltaX = currentClient.clientX - prevClient.clientX; + var deltaY = currentClient.clientY - prevClient.clientY; + return Math.sqrt(deltaX * deltaX + deltaY * deltaY) + movement; + }; + ClientStore.prototype.getDistance = function (clients) { + if (clients === void 0) { clients = this.prevClients; } + return getDist$1(clients); + }; + ClientStore.prototype.getScale = function (clients) { + if (clients === void 0) { clients = this.prevClients; } + return getDist$1(clients) / getDist$1(this.startClients); + }; + ClientStore.prototype.move = function (deltaX, deltaY) { + this.startClients.forEach(function (client) { + client.clientX -= deltaX; + client.clientY -= deltaY; + }); + this.prevClients.forEach(function (client) { + client.clientX -= deltaX; + client.clientY -= deltaY; + }); + }; + return ClientStore; + }()); + + var INPUT_TAGNAMES = ["textarea", "input"]; + /** + * You can set up drag, pinch events in any browser. + */ + var Gesto = /*#__PURE__*/ (function (_super) { + __extends$1(Gesto, _super); + /** + * + */ + function Gesto(targets, options) { + if (options === void 0) { options = {}; } + var _this = _super.call(this) || this; + _this.options = {}; + _this.flag = false; + _this.pinchFlag = false; + _this.data = {}; + _this.isDrag = false; + _this.isPinch = false; + _this.clientStores = []; + _this.targets = []; + _this.prevTime = 0; + _this.doubleFlag = false; + _this._useMouse = false; + _this._useTouch = false; + _this._useDrag = false; + _this._dragFlag = false; + _this._isTrusted = false; + _this._isMouseEvent = false; + _this._isSecondaryButton = false; + _this._preventMouseEvent = false; + _this._prevInputEvent = null; + _this._isDragAPI = false; + _this._isIdle = true; + _this._window = window; + _this.onDragStart = function (e, isTrusted) { + if (isTrusted === void 0) { isTrusted = true; } + if (!_this.flag && e.cancelable === false) { + return; + } + var isDragAPI = e.type.indexOf("drag") >= -1; + if (_this.flag && isDragAPI) { + return; + } + _this._isDragAPI = true; + var _a = _this.options, container = _a.container, pinchOutside = _a.pinchOutside, preventWheelClick = _a.preventWheelClick, preventRightClick = _a.preventRightClick, preventDefault = _a.preventDefault, checkInput = _a.checkInput, dragFocusedInput = _a.dragFocusedInput, preventClickEventOnDragStart = _a.preventClickEventOnDragStart, preventClickEventOnDrag = _a.preventClickEventOnDrag, preventClickEventByCondition = _a.preventClickEventByCondition; + var useTouch = _this._useTouch; + var isDragStart = !_this.flag; + _this._isSecondaryButton = e.which === 3 || e.button === 2; + if ((preventWheelClick && (e.which === 2 || e.button === 1)) + || (preventRightClick && (e.which === 3 || e.button === 2))) { + _this.stop(); + return false; + } + if (isDragStart) { + var activeElement = _this._window.document.activeElement; + var target = e.target; + if (target) { + var tagName = target.tagName.toLowerCase(); + var hasInput = INPUT_TAGNAMES.indexOf(tagName) > -1; + var hasContentEditable = target.isContentEditable; + if (hasInput || hasContentEditable) { + if (checkInput || (!dragFocusedInput && activeElement === target)) { + // force false or already focused. + return false; + } + // no focus + if (activeElement && (activeElement === target + || (hasContentEditable && activeElement.isContentEditable && activeElement.contains(target)))) { + if (dragFocusedInput) { + target.blur(); + } + else { + return false; + } + } + } + else if ((preventDefault || e.type === "touchstart") && activeElement) { + var activeTagName = activeElement.tagName.toLowerCase(); + if (activeElement.isContentEditable || INPUT_TAGNAMES.indexOf(activeTagName) > -1) { + activeElement.blur(); + } + } + if (preventClickEventOnDragStart || preventClickEventOnDrag || preventClickEventByCondition) { + addEvent(_this._window, "click", _this._onClick, true); + } + } + _this.clientStores = [new ClientStore(getEventClients(e))]; + _this._isIdle = false; + _this.flag = true; + _this.isDrag = false; + _this._isTrusted = isTrusted; + _this._dragFlag = true; + _this._prevInputEvent = e; + _this.data = {}; + _this.doubleFlag = now() - _this.prevTime < 200; + _this._isMouseEvent = isMouseEvent(e); + if (!_this._isMouseEvent && _this._preventMouseEvent) { + _this._preventMouseEvent = false; + } + var result = _this._preventMouseEvent || _this.emit("dragStart", __assign$2(__assign$2({ data: _this.data, datas: _this.data, inputEvent: e, isMouseEvent: _this._isMouseEvent, isSecondaryButton: _this._isSecondaryButton, isTrusted: isTrusted, isDouble: _this.doubleFlag }, _this.getCurrentStore().getPosition()), { preventDefault: function () { + e.preventDefault(); + }, preventDrag: function () { + _this._dragFlag = false; + } })); + if (result === false) { + _this.stop(); + } + if (_this._isMouseEvent && _this.flag && preventDefault) { + e.preventDefault(); + } + } + if (!_this.flag) { + return false; + } + var timer = 0; + if (isDragStart) { + _this._attchDragEvent(); + // wait pinch + if (useTouch && pinchOutside) { + timer = setTimeout(function () { + addEvent(container, "touchstart", _this.onDragStart, { + passive: false + }); + }); + } + } + else if (useTouch && pinchOutside) { + // pinch is occured + removeEvent(container, "touchstart", _this.onDragStart); + } + if (_this.flag && isMultiTouch(e)) { + clearTimeout(timer); + if (isDragStart && (e.touches.length !== e.changedTouches.length)) { + return; + } + if (!_this.pinchFlag) { + _this.onPinchStart(e); + } + } + }; + _this.onDrag = function (e, isScroll) { + if (!_this.flag) { + return; + } + var preventDefault = _this.options.preventDefault; + if (!_this._isMouseEvent && preventDefault) { + e.preventDefault(); + } + _this._prevInputEvent = e; + var clients = getEventClients(e); + var result = _this.moveClients(clients, e, false); + if (_this._dragFlag) { + if (_this.pinchFlag || result.deltaX || result.deltaY) { + var dragResult = _this._preventMouseEvent || _this.emit("drag", __assign$2(__assign$2({}, result), { isScroll: !!isScroll, inputEvent: e })); + if (dragResult === false) { + _this.stop(); + return; + } + } + if (_this.pinchFlag) { + _this.onPinch(e, clients); + } + } + _this.getCurrentStore().getPosition(clients, true); + }; + _this.onDragEnd = function (e) { + if (!_this.flag) { + return; + } + var _a = _this.options, pinchOutside = _a.pinchOutside, container = _a.container, preventClickEventOnDrag = _a.preventClickEventOnDrag, preventClickEventOnDragStart = _a.preventClickEventOnDragStart, preventClickEventByCondition = _a.preventClickEventByCondition; + var isDrag = _this.isDrag; + if (preventClickEventOnDrag || preventClickEventOnDragStart || preventClickEventByCondition) { + requestAnimationFrame(function () { + _this._allowClickEvent(); + }); + } + if (!preventClickEventByCondition && !preventClickEventOnDragStart && preventClickEventOnDrag && !isDrag) { + _this._allowClickEvent(); + } + if (_this._useTouch && pinchOutside) { + removeEvent(container, "touchstart", _this.onDragStart); + } + if (_this.pinchFlag) { + _this.onPinchEnd(e); + } + var clients = (e === null || e === void 0 ? void 0 : e.touches) ? getEventClients(e) : []; + var clientsLength = clients.length; + if (clientsLength === 0 || !_this.options.keepDragging) { + _this.flag = false; + } + else { + _this._addStore(new ClientStore(clients)); + } + var position = _this._getPosition(); + var currentTime = now(); + var isDouble = !isDrag && _this.doubleFlag; + _this._prevInputEvent = null; + _this.prevTime = isDrag || isDouble ? 0 : currentTime; + if (!_this.flag) { + _this._dettachDragEvent(); + _this._preventMouseEvent || _this.emit("dragEnd", __assign$2({ data: _this.data, datas: _this.data, isDouble: isDouble, isDrag: isDrag, isClick: !isDrag, isMouseEvent: _this._isMouseEvent, isSecondaryButton: _this._isSecondaryButton, inputEvent: e, isTrusted: _this._isTrusted }, position)); + _this.clientStores = []; + if (!_this._isMouseEvent) { + _this._preventMouseEvent = true; + requestAnimationFrame(function () { + requestAnimationFrame(function () { + _this._preventMouseEvent = false; + }); + }); + } + _this._isIdle = true; + } + }; + _this.onBlur = function () { + _this.onDragEnd(); + }; + _this._allowClickEvent = function () { + removeEvent(_this._window, "click", _this._onClick, true); + }; + _this._onClick = function (e) { + _this._allowClickEvent(); + _this._preventMouseEvent = false; + var preventClickEventByCondition = _this.options.preventClickEventByCondition; + if (preventClickEventByCondition === null || preventClickEventByCondition === void 0 ? void 0 : preventClickEventByCondition(e)) { + return; + } + e.stopPropagation(); + e.preventDefault(); + }; + _this._onContextMenu = function (e) { + var options = _this.options; + if (!options.preventRightClick) { + e.preventDefault(); + } + else { + _this.onDragEnd(e); + } + }; + _this._passCallback = function () { }; + var elements = [].concat(targets); + var firstTarget = elements[0]; + _this._window = firstTarget && !("document" in firstTarget) ? getWindow(firstTarget) : window; + _this.options = __assign$2({ checkInput: false, container: firstTarget && !("document" in firstTarget) ? getWindow(firstTarget) : firstTarget, preventRightClick: true, preventWheelClick: true, preventClickEventOnDragStart: false, preventClickEventOnDrag: false, preventClickEventByCondition: null, preventDefault: true, checkWindowBlur: false, keepDragging: false, pinchThreshold: 0, events: ["touch", "mouse"] }, options); + var _a = _this.options, container = _a.container, events = _a.events, checkWindowBlur = _a.checkWindowBlur; + _this._useDrag = events.indexOf("drag") > -1; + _this._useTouch = events.indexOf("touch") > -1; + _this._useMouse = events.indexOf("mouse") > -1; + _this.targets = elements; + if (_this._useDrag) { + elements.forEach(function (el) { + addEvent(el, "dragstart", _this.onDragStart); + }); + } + if (_this._useMouse) { + elements.forEach(function (el) { + addEvent(el, "mousedown", _this.onDragStart); + addEvent(el, "mousemove", _this._passCallback); + }); + addEvent(container, "contextmenu", _this._onContextMenu); + } + if (checkWindowBlur) { + addEvent(getWindow(), "blur", _this.onBlur); + } + if (_this._useTouch) { + var passive_1 = { + passive: false, + }; + elements.forEach(function (el) { + addEvent(el, "touchstart", _this.onDragStart, passive_1); + addEvent(el, "touchmove", _this._passCallback, passive_1); + }); + } + return _this; + } + /** + * Stop Gesto's drag events. + */ + Gesto.prototype.stop = function () { + this.isDrag = false; + this.data = {}; + this.clientStores = []; + this.pinchFlag = false; + this.doubleFlag = false; + this.prevTime = 0; + this.flag = false; + this._isIdle = true; + this._allowClickEvent(); + this._dettachDragEvent(); + this._isDragAPI = false; + }; + /** + * The total moved distance + */ + Gesto.prototype.getMovement = function (clients) { + return this.getCurrentStore().getMovement(clients) + this.clientStores.slice(1).reduce(function (prev, cur) { + return prev + cur.movement; + }, 0); + }; + /** + * Whether to drag + */ + Gesto.prototype.isDragging = function () { + return this.isDrag; + }; + /** + * Whether the operation of gesto is finished and is in idle state + */ + Gesto.prototype.isIdle = function () { + return this._isIdle; + }; + /** + * Whether to start drag + */ + Gesto.prototype.isFlag = function () { + return this.flag; + }; + /** + * Whether to start pinch + */ + Gesto.prototype.isPinchFlag = function () { + return this.pinchFlag; + }; + /** + * Whether to start double click + */ + Gesto.prototype.isDoubleFlag = function () { + return this.doubleFlag; + }; + /** + * Whether to pinch + */ + Gesto.prototype.isPinching = function () { + return this.isPinch; + }; + /** + * If a scroll event occurs, it is corrected by the scroll distance. + */ + Gesto.prototype.scrollBy = function (deltaX, deltaY, e, isCallDrag) { + if (isCallDrag === void 0) { isCallDrag = true; } + if (!this.flag) { + return; + } + this.clientStores[0].move(deltaX, deltaY); + isCallDrag && this.onDrag(e, true); + }; + /** + * Create a virtual drag event. + */ + Gesto.prototype.move = function (_a, inputEvent) { + var deltaX = _a[0], deltaY = _a[1]; + var store = this.getCurrentStore(); + var nextClients = store.prevClients; + return this.moveClients(nextClients.map(function (_a) { + var clientX = _a.clientX, clientY = _a.clientY; + return { + clientX: clientX + deltaX, + clientY: clientY + deltaY, + originalClientX: clientX, + originalClientY: clientY, + }; + }), inputEvent, true); + }; + /** + * The dragStart event is triggered by an external event. + */ + Gesto.prototype.triggerDragStart = function (e) { + this.onDragStart(e, false); + }; + /** + * Set the event data while dragging. + */ + Gesto.prototype.setEventData = function (data) { + var currentData = this.data; + for (var name_1 in data) { + currentData[name_1] = data[name_1]; + } + return this; + }; + /** + * Set the event data while dragging. + * Use `setEventData` + * @deprecated + */ + Gesto.prototype.setEventDatas = function (data) { + return this.setEventData(data); + }; + /** + * Get the current event state while dragging. + */ + Gesto.prototype.getCurrentEvent = function (inputEvent) { + if (inputEvent === void 0) { inputEvent = this._prevInputEvent; } + return __assign$2(__assign$2({ data: this.data, datas: this.data }, this._getPosition()), { movement: this.getMovement(), isDrag: this.isDrag, isPinch: this.isPinch, isScroll: false, inputEvent: inputEvent }); + }; + /** + * Get & Set the event data while dragging. + */ + Gesto.prototype.getEventData = function () { + return this.data; + }; + /** + * Get & Set the event data while dragging. + * Use getEventData method + * @depreacated + */ + Gesto.prototype.getEventDatas = function () { + return this.data; + }; + /** + * Unset Gesto + */ + Gesto.prototype.unset = function () { + var _this = this; + var targets = this.targets; + var container = this.options.container; + this.off(); + removeEvent(this._window, "blur", this.onBlur); + if (this._useDrag) { + targets.forEach(function (el) { + removeEvent(el, "dragstart", _this.onDragStart); + }); + } + if (this._useMouse) { + targets.forEach(function (target) { + removeEvent(target, "mousedown", _this.onDragStart); + }); + removeEvent(container, "contextmenu", this._onContextMenu); + } + if (this._useTouch) { + targets.forEach(function (target) { + removeEvent(target, "touchstart", _this.onDragStart); + }); + removeEvent(container, "touchstart", this.onDragStart); + } + this._prevInputEvent = null; + this._allowClickEvent(); + this._dettachDragEvent(); + }; + Gesto.prototype.onPinchStart = function (e) { + var _this = this; + var pinchThreshold = this.options.pinchThreshold; + if (this.isDrag && this.getMovement() > pinchThreshold) { + return; + } + var store = new ClientStore(getEventClients(e)); + this.pinchFlag = true; + this._addStore(store); + var result = this.emit("pinchStart", __assign$2(__assign$2({ data: this.data, datas: this.data, angle: store.getAngle(), touches: this.getCurrentStore().getPositions() }, store.getPosition()), { inputEvent: e, isTrusted: this._isTrusted, preventDefault: function () { + e.preventDefault(); + }, preventDrag: function () { + _this._dragFlag = false; + } })); + if (result === false) { + this.pinchFlag = false; + } + }; + Gesto.prototype.onPinch = function (e, clients) { + if (!this.flag || !this.pinchFlag || clients.length < 2) { + return; + } + var store = this.getCurrentStore(); + this.isPinch = true; + this.emit("pinch", __assign$2(__assign$2({ data: this.data, datas: this.data, movement: this.getMovement(clients), angle: store.getAngle(clients), rotation: store.getRotation(clients), touches: store.getPositions(clients), scale: store.getScale(clients), distance: store.getDistance(clients) }, store.getPosition(clients)), { inputEvent: e, isTrusted: this._isTrusted })); + }; + Gesto.prototype.onPinchEnd = function (e) { + if (!this.pinchFlag) { + return; + } + var isPinch = this.isPinch; + this.isPinch = false; + this.pinchFlag = false; + var store = this.getCurrentStore(); + this.emit("pinchEnd", __assign$2(__assign$2({ data: this.data, datas: this.data, isPinch: isPinch, touches: store.getPositions() }, store.getPosition()), { inputEvent: e })); + }; + Gesto.prototype.getCurrentStore = function () { + return this.clientStores[0]; + }; + Gesto.prototype.moveClients = function (clients, inputEvent, isAdd) { + var position = this._getPosition(clients, isAdd); + var isPrevDrag = this.isDrag; + if (position.deltaX || position.deltaY) { + this.isDrag = true; + } + var isFirstDrag = false; + if (!isPrevDrag && this.isDrag) { + isFirstDrag = true; + } + return __assign$2(__assign$2({ data: this.data, datas: this.data }, position), { movement: this.getMovement(clients), isDrag: this.isDrag, isPinch: this.isPinch, isScroll: false, isMouseEvent: this._isMouseEvent, isSecondaryButton: this._isSecondaryButton, inputEvent: inputEvent, isTrusted: this._isTrusted, isFirstDrag: isFirstDrag }); + }; + Gesto.prototype._addStore = function (store) { + this.clientStores.splice(0, 0, store); + }; + Gesto.prototype._getPosition = function (clients, isAdd) { + var store = this.getCurrentStore(); + var position = store.getPosition(clients, isAdd); + var _a = this.clientStores.slice(1).reduce(function (prev, cur) { + var storePosition = cur.getPosition(); + prev.distX += storePosition.distX; + prev.distY += storePosition.distY; + return prev; + }, position), distX = _a.distX, distY = _a.distY; + return __assign$2(__assign$2({}, position), { distX: distX, distY: distY }); + }; + Gesto.prototype._attchDragEvent = function () { + var win = this._window; + var container = this.options.container; + var passive = { + passive: false + }; + if (this._isDragAPI) { + addEvent(container, "dragover", this.onDrag, passive); + addEvent(win, "dragend", this.onDragEnd); + } + if (this._useMouse) { + addEvent(container, "mousemove", this.onDrag); + addEvent(win, "mouseup", this.onDragEnd); + } + if (this._useTouch) { + addEvent(container, "touchmove", this.onDrag, passive); + addEvent(win, "touchend", this.onDragEnd, passive); + addEvent(win, "touchcancel", this.onDragEnd, passive); + } + }; + Gesto.prototype._dettachDragEvent = function () { + var win = this._window; + var container = this.options.container; + if (this._isDragAPI) { + removeEvent(container, "dragover", this.onDrag); + removeEvent(win, "dragend", this.onDragEnd); + } + if (this._useMouse) { + removeEvent(container, "mousemove", this.onDrag); + removeEvent(win, "mouseup", this.onDragEnd); + } + if (this._useTouch) { + removeEvent(container, "touchstart", this.onDragStart); + removeEvent(container, "touchmove", this.onDrag); + removeEvent(win, "touchend", this.onDragEnd); + removeEvent(win, "touchcancel", this.onDragEnd); + } + }; + return Gesto; + }(EventEmitter$1)); + + /* + Copyright (c) Daybrush + name: css-styled + license: MIT + author: Daybrush + repository: git+https://github.com/daybrush/css-styled.git + version: 1.0.8 + */ + + function hash(str) { + var hash = 5381, + i = str.length; + + while(i) { + hash = (hash * 33) ^ str.charCodeAt(--i); + } + + /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed + * integers. Since we want the results to be always positive, convert the + * signed int to an unsigned by doing an unsigned bitshift. */ + return hash >>> 0; + } + + var stringHash = hash; + + function getHash(str) { + return stringHash(str).toString(36); + } + function getShadowRoot$1(parentElement) { + if (parentElement && parentElement.getRootNode) { + var rootNode = parentElement.getRootNode(); + if (rootNode.nodeType === 11) { + return rootNode; + } + } + return; + } + function replaceStyle(className, css, options) { + if (options.original) { + return css; + } + return css.replace(/([^};{\s}][^};{]*|^\s*){/mg, function (_, selector) { + var trimmedSelector = selector.trim(); + return (trimmedSelector ? splitComma(trimmedSelector) : [""]).map(function (subSelector) { + var trimmedSubSelector = subSelector.trim(); + if (trimmedSubSelector.indexOf("@") === 0) { + return trimmedSubSelector; + } else if (trimmedSubSelector.indexOf(":global") > -1) { + return trimmedSubSelector.replace(/\:global/g, ""); + } else if (trimmedSubSelector.indexOf(":host") > -1) { + return "".concat(trimmedSubSelector.replace(/\:host/g, ".".concat(className))); + } else if (trimmedSubSelector) { + return ".".concat(className, " ").concat(trimmedSubSelector); + } else { + return ".".concat(className); + } + }).join(", ") + " {"; + }); + } + function injectStyle(className, css, options, el, shadowRoot) { + var doc = getDocument(el); + var style = doc.createElement("style"); + style.setAttribute("type", "text/css"); + style.setAttribute("data-styled-id", className); + style.setAttribute("data-styled-count", "1"); + if (options.nonce) { + style.setAttribute("nonce", options.nonce); + } + style.innerHTML = replaceStyle(className, css, options); + (shadowRoot || doc.head || doc.body).appendChild(style); + return style; + } + + /** + * Create an styled object that can be defined and inserted into the css. + * @param - css styles + */ + function styled$1(css) { + var injectClassName = "rCS" + getHash(css); + return { + className: injectClassName, + inject: function (el, options) { + if (options === void 0) { + options = {}; + } + var shadowRoot = getShadowRoot$1(el); + var styleElement = (shadowRoot || el.ownerDocument || document).querySelector("style[data-styled-id=\"".concat(injectClassName, "\"]")); + if (!styleElement) { + styleElement = injectStyle(injectClassName, css, options, el, shadowRoot); + } else { + var count = parseFloat(styleElement.getAttribute("data-styled-count")) || 0; + styleElement.setAttribute("data-styled-count", "".concat(count + 1)); + } + return { + destroy: function () { + var _a; + var injectCount = parseFloat(styleElement.getAttribute("data-styled-count")) || 0; + if (injectCount <= 1) { + if (styleElement.remove) { + styleElement.remove(); + } else { + (_a = styleElement.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(styleElement); + } + styleElement = null; + } else { + styleElement.setAttribute("data-styled-count", "".concat(injectCount - 1)); + } + } + }; + } + }; + } + + /* + Copyright (c) 2019 Daybrush + name: react-css-styled + license: MIT + author: Daybrush + repository: https://github.com/daybrush/css-styled/tree/master/packages/react-css-styled + version: 1.1.9 + */ + var __assign$1 = function () { + __assign$1 = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign$1.apply(this, arguments); + }; + function __rest$1(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; + } + return t; + } + function styled(Tag, css) { + var injector = styled$1(css); + var cssId = injector.className; + return forwardRef(function (props, ref) { + var _a = props.className, + className = _a === void 0 ? "" : _a; + props.cspNonce; + var attributes = __rest$1(props, ["className", "cspNonce"]); + var targetRef = useRef(); + useImperativeHandle(ref, function () { + return targetRef.current; + }, []); + useEffect(function () { + var injectResult = injector.inject(targetRef.current, { + nonce: props.cspNonce + }); + return function () { + injectResult.destroy(); + }; + }, []); + return createElement(Tag, __assign$1({ + "ref": targetRef, + "data-styled-id": cssId, + "className": "".concat(className, " ").concat(cssId) + }, attributes)); + }); + } + + /* + Copyright (c) 2019 Daybrush + name: react-moveable + license: MIT + author: Daybrush + repository: https://github.com/daybrush/moveable/blob/master/packages/react-moveable + version: 0.55.0 + */ + /****************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + + /* global Reflect, Promise */ + + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function (d, b) { + d.__proto__ = b; + } || function (d, b) { + for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; + }; + + return extendStatics(d, b); + }; + + function __extends(d, b) { + if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + + function __() { + this.constructor = d; + } + + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + } + + var __assign = function () { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + + return t; + }; + + return __assign.apply(this, arguments); + }; + + function __rest(s, e) { + var t = {}; + + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; + + if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; + } + return t; + } + + function __decorate(decorators, target, key, desc) { + var c = arguments.length, + r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, + d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + } + + function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, + m = s && o[s], + i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { + value: o && o[i++], + done: !o + }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + } + + function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), + r, + ar = [], + e; + + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } catch (error) { + e = { + error: error + }; + } finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } finally { + if (e) throw e.error; + } + } + + return ar; + } + + function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); + } + + function makeAble$1(name, able) { + return __assign({ + events: [], + props: [], + name: name + }, able); + } + + var DIRECTIONS4 = ["n", "w", "s", "e"]; + var DIRECTIONS = ["n", "w", "s", "e", "nw", "ne", "sw", "se"]; + + function getSVGCursor(scale, degree) { + return "data:image/svg+xml;utf8,"); + } + + function getCursorCSS(degree) { + var x1 = getSVGCursor(1, degree); // const x2 = getSVGCursor(2, degree); + + var degree45 = Math.round(degree / 45) * 45 % 180; + var defaultCursor = "ns-resize"; + + if (degree45 === 135) { + defaultCursor = "nwse-resize"; + } else if (degree45 === 45) { + defaultCursor = "nesw-resize"; + } else if (degree45 === 90) { + defaultCursor = "ew-resize"; + } // tslint:disable-next-line: max-line-length + + + return "cursor:".concat(defaultCursor, ";cursor: url('").concat(x1, "') 16 16, ").concat(defaultCursor, ";"); + } + + var agent = agent$1(); + var IS_WEBKIT = agent.browser.webkit; + + var IS_WEBKIT605 = IS_WEBKIT && function () { + var navi = typeof window === "undefined" ? { + userAgent: "" + } : window.navigator; + var res = /applewebkit\/([^\s]+)/g.exec(navi.userAgent.toLowerCase()); + return res ? parseFloat(res[1]) < 605 : false; + }(); + + var browserName = agent.browser.name; + var browserVersion = parseInt(agent.browser.version, 10); + var IS_CHROME = browserName === "chrome"; + var IS_CHROMIUM = agent.browser.chromium; + var chromiumVersion = parseInt(agent.browser.chromiumVersion, 10) || 0; + var IS_CHROMIUM109 = IS_CHROME && browserVersion >= 109 || IS_CHROMIUM && chromiumVersion >= 109; + var IS_FIREFOX = browserName === "firefox"; + var IS_SAFARI_ABOVE15 = parseInt(agent.browser.webkitVersion, 10) >= 612 || browserVersion >= 15; + var PREFIX = "moveable-"; + var directionCSS = DIRECTIONS.map(function (dir) { + var top = ""; + var left = ""; + var originX = "center"; + var originY = "center"; + var offset = "calc(var(--moveable-control-padding, 20) * -1px)"; + + if (dir.indexOf("n") > -1) { + top = "top: ".concat(offset, ";"); + originY = "bottom"; + } + + if (dir.indexOf("s") > -1) { + top = "top: 0px;"; + originY = "top"; + } + + if (dir.indexOf("w") > -1) { + left = "left: ".concat(offset, ";"); + originX = "right"; + } + + if (dir.indexOf("e") > -1) { + left = "left: 0px;"; + originX = "left"; + } + + return ".around-control[data-direction*=\"".concat(dir, "\"] {\n ").concat(left).concat(top, "\n transform-origin: ").concat(originX, " ").concat(originY, ";\n }"); + }).join("\n"); + var MOVEABLE_CSS = "\n{\nposition: absolute;\nwidth: 1px;\nheight: 1px;\nleft: 0;\ntop: 0;\nz-index: 3000;\n--moveable-color: #4af;\n--zoom: 1;\n--zoompx: 1px;\n--moveable-line-padding: 0;\n--moveable-control-padding: 0;\nwill-change: transform;\noutline: 1px solid transparent;\n}\n.control-box {\nz-index: 0;\n}\n.line, .control {\nposition: absolute;\nleft: 0;\ntop: 0;\nwill-change: transform;\n}\n.control {\nwidth: 14px;\nheight: 14px;\nborder-radius: 50%;\nborder: 2px solid #fff;\nbox-sizing: border-box;\nbackground: #4af;\nbackground: var(--moveable-color);\nmargin-top: -7px;\nmargin-left: -7px;\nborder: 2px solid #fff;\nz-index: 10;\n}\n.around-control {\nposition: absolute;\nwill-change: transform;\nwidth: calc(var(--moveable-control-padding, 20) * 1px);\nheight: calc(var(--moveable-control-padding, 20) * 1px);\nleft: calc(var(--moveable-control-padding, 20) * -0.5px);\ntop: calc(var(--moveable-control-padding, 20) * -0.5px);\nbox-sizing: border-box;\nbackground: transparent;\nz-index: 8;\ncursor: alias;\ntransform-origin: center center;\n}\n".concat(directionCSS, "\n.padding {\nposition: absolute;\ntop: 0px;\nleft: 0px;\nwidth: 100px;\nheight: 100px;\ntransform-origin: 0 0;\n}\n.line {\nwidth: 1px;\nheight: 1px;\nbackground: #4af;\nbackground: var(--moveable-color);\ntransform-origin: 0px 50%;\n}\n.line.edge {\nz-index: 1;\nbackground: transparent;\n}\n.line.dashed {\nbox-sizing: border-box;\nbackground: transparent;\n}\n.line.dashed.horizontal {\nborder-top: 1px dashed #4af;\nborder-top-color: #4af;\nborder-top-color: var(--moveable-color);\n}\n.line.dashed.vertical {\nborder-left: 1px dashed #4af;\nborder-left-color: #4af;\nborder-left-color: var(--moveable-color);\n}\n.line.vertical {\ntransform: translateX(-50%);\n}\n.line.horizontal {\ntransform: translateY(-50%);\n}\n.line.vertical.bold {\nwidth: 2px;\n}\n.line.horizontal.bold {\nheight: 2px;\n}\n\n.control.origin {\nborder-color: #f55;\nbackground: #fff;\nwidth: 12px;\nheight: 12px;\nmargin-top: -6px;\nmargin-left: -6px;\npointer-events: none;\n}\n").concat([0, 15, 30, 45, 60, 75, 90, 105, 120, 135, 150, 165].map(function (degree) { + return "\n.direction[data-rotation=\"".concat(degree, "\"], :global .view-control-rotation").concat(degree, " {\n").concat(getCursorCSS(degree), "\n}\n"); + }).join("\n"), "\n\n.line.direction:before {\ncontent: \"\";\nposition: absolute;\nwidth: 100%;\nheight: calc(var(--moveable-line-padding, 0) * 1px);\nbottom: 0;\nleft: 0;\n}\n.group {\nz-index: -1;\n}\n.area {\nposition: absolute;\n}\n.area-pieces {\nposition: absolute;\ntop: 0;\nleft: 0;\ndisplay: none;\n}\n.area.avoid, .area.pass {\npointer-events: none;\n}\n.area.avoid+.area-pieces {\ndisplay: block;\n}\n.area-piece {\nposition: absolute;\n}\n\n").concat(IS_WEBKIT605 ? ":global svg *:before {\ncontent:\"\";\ntransform-origin: inherit;\n}" : "", "\n"); + var NEARBY_POS = [[0, 1, 2], [1, 0, 3], [2, 0, 3], [3, 1, 2]]; + var FLOAT_POINT_NUM = 0.0001; + var TINY_NUM = 0.0000001; + var MIN_SCALE = 0.000000001; + var MAX_NUM = Math.pow(10, 10); + var MIN_NUM = -MAX_NUM; + var DIRECTION_REGION_TO_DIRECTION = { + n: [0, -1], + e: [1, 0], + s: [0, 1], + w: [-1, 0], + nw: [-1, -1], + ne: [1, -1], + sw: [-1, 1], + se: [1, 1] + }; + var DIRECTION_INDEXES = { + n: [0, 1], + e: [1, 3], + s: [3, 2], + w: [2, 0], + nw: [0], + ne: [1], + sw: [2], + se: [3] + }; + var DIRECTION_ROTATIONS = { + n: 0, + s: 180, + w: 270, + e: 90, + nw: 315, + ne: 45, + sw: 225, + se: 135 + }; + var MOVEABLE_METHODS = ["isMoveableElement", "updateRect", "updateTarget", "destroy", "dragStart", "isInside", "hitTest", "setState", "getRect", "request", "isDragging", "getManager", "forceUpdate", "waitToChangeTarget", "updateSelectors", "getTargets", "stopDrag", "getControlBoxElement", "getMoveables", "getDragElement"]; + + function setCustomDrag(e, state, delta, isPinch, isConvert, ableName) { + var _a, _b; + + if (ableName === void 0) { + ableName = "draggable"; + } + + var result = (_b = (_a = state.gestos[ableName]) === null || _a === void 0 ? void 0 : _a.move(delta, e.inputEvent)) !== null && _b !== void 0 ? _b : {}; + var datas = result.originalDatas || result.datas; + var ableDatas = datas[ableName] || (datas[ableName] = {}); + return __assign(__assign({}, isConvert ? convertDragDist(state, result) : result), { + isPinch: !!isPinch, + parentEvent: true, + datas: ableDatas, + originalDatas: e.originalDatas + }); + } + + var CustomGesto = /*#__PURE__*/function () { + function CustomGesto(ableName) { + var _a; + + if (ableName === void 0) { + ableName = "draggable"; + } + + this.ableName = ableName; + this.prevX = 0; + this.prevY = 0; + this.startX = 0; + this.startY = 0; + this.isDrag = false; + this.isFlag = false; + this.datas = { + draggable: {} + }; + this.datas = (_a = {}, _a[ableName] = {}, _a); + } + + var __proto = CustomGesto.prototype; + + __proto.dragStart = function (client, e) { + this.isDrag = false; + this.isFlag = false; + var originalDatas = e.originalDatas; + this.datas = originalDatas; + + if (!originalDatas[this.ableName]) { + originalDatas[this.ableName] = {}; + } + + return __assign(__assign({}, this.move(client, e.inputEvent)), { + type: "dragstart" + }); + }; + + __proto.drag = function (client, inputEvent) { + return this.move([client[0] - this.prevX, client[1] - this.prevY], inputEvent); + }; + + __proto.move = function (delta, inputEvent) { + var clientX; + var clientY; + var isFirstDrag = false; + + if (!this.isFlag) { + this.prevX = delta[0]; + this.prevY = delta[1]; + this.startX = delta[0]; + this.startY = delta[1]; + clientX = delta[0]; + clientY = delta[1]; + this.isFlag = true; + } else { + var isPrevDrag = this.isDrag; + clientX = this.prevX + delta[0]; + clientY = this.prevY + delta[1]; + + if (delta[0] || delta[1]) { + this.isDrag = true; + } + + if (!isPrevDrag && this.isDrag) { + isFirstDrag = true; + } + } + + this.prevX = clientX; + this.prevY = clientY; + return { + type: "drag", + clientX: clientX, + clientY: clientY, + inputEvent: inputEvent, + isFirstDrag: isFirstDrag, + isDrag: this.isDrag, + distX: clientX - this.startX, + distY: clientY - this.startY, + deltaX: delta[0], + deltaY: delta[1], + datas: this.datas[this.ableName], + originalDatas: this.datas, + parentEvent: true, + parentGesto: this + }; + }; + + return CustomGesto; + }(); + + function calculateElementPosition(matrix, origin, width, height) { + var is3d = matrix.length === 16; + var n = is3d ? 4 : 3; + var poses = calculatePoses(matrix, width, height, n); + + var _a = __read(poses, 4), + _b = __read(_a[0], 2), + x1 = _b[0], + y1 = _b[1], + _c = __read(_a[1], 2), + x2 = _c[0], + y2 = _c[1], + _d = __read(_a[2], 2), + x3 = _d[0], + y3 = _d[1], + _e = __read(_a[3], 2), + x4 = _e[0], + y4 = _e[1]; + + var _f = __read(calculatePosition(matrix, origin, n), 2), + originX = _f[0], + originY = _f[1]; + + var left = Math.min(x1, x2, x3, x4); + var top = Math.min(y1, y2, y3, y4); + var right = Math.max(x1, x2, x3, x4); + var bottom = Math.max(y1, y2, y3, y4); + x1 = x1 - left || 0; + x2 = x2 - left || 0; + x3 = x3 - left || 0; + x4 = x4 - left || 0; + y1 = y1 - top || 0; + y2 = y2 - top || 0; + y3 = y3 - top || 0; + y4 = y4 - top || 0; + originX = originX - left || 0; + originY = originY - top || 0; + var sx = matrix[0]; + var sy = matrix[n + 1]; + var direction = sign(sx * sy); + return { + left: left, + top: top, + right: right, + bottom: bottom, + origin: [originX, originY], + pos1: [x1, y1], + pos2: [x2, y2], + pos3: [x3, y3], + pos4: [x4, y4], + direction: direction + }; + } + + function calculatePointerDist(moveable, e) { + var clientX = e.clientX, + clientY = e.clientY, + datas = e.datas; + var _a = moveable.state, + moveableClientRect = _a.moveableClientRect, + rootMatrix = _a.rootMatrix, + is3d = _a.is3d, + pos1 = _a.pos1; + var left = moveableClientRect.left, + top = moveableClientRect.top; + var n = is3d ? 4 : 3; + + var _b = __read(minus(calculateInversePosition(rootMatrix, [clientX - left, clientY - top], n), pos1), 2), + posX = _b[0], + posY = _b[1]; + + var _c = __read(getDragDist({ + datas: datas, + distX: posX, + distY: posY + }), 2), + distX = _c[0], + distY = _c[1]; + + return [distX, distY]; + } + + function setDragStart(moveable, _a) { + var datas = _a.datas; + var _b = moveable.state, + allMatrix = _b.allMatrix, + beforeMatrix = _b.beforeMatrix, + is3d = _b.is3d, + left = _b.left, + top = _b.top, + origin = _b.origin, + offsetMatrix = _b.offsetMatrix, + targetMatrix = _b.targetMatrix, + transformOrigin = _b.transformOrigin; + var n = is3d ? 4 : 3; + datas.is3d = is3d; + datas.matrix = allMatrix; + datas.targetMatrix = targetMatrix; + datas.beforeMatrix = beforeMatrix; + datas.offsetMatrix = offsetMatrix; + datas.transformOrigin = transformOrigin; + datas.inverseMatrix = invert(allMatrix, n); + datas.inverseBeforeMatrix = invert(beforeMatrix, n); + datas.absoluteOrigin = convertPositionMatrix(plus([left, top], origin), n); + datas.startDragBeforeDist = calculate(datas.inverseBeforeMatrix, datas.absoluteOrigin, n); + datas.startDragDist = calculate(datas.inverseMatrix, datas.absoluteOrigin, n); + } + + function getTransformDirection(e) { + return calculateElementPosition(e.datas.beforeTransform, [50, 50], 100, 100).direction; + } + + function resolveTransformEvent(moveable, event, functionName) { + var datas = event.datas, + originalDatas = event.originalDatas.beforeRenderable; + var index = datas.transformIndex; + var nextTransforms = originalDatas.nextTransforms; + var length = nextTransforms.length; + var nextTransformAppendedIndexes = originalDatas.nextTransformAppendedIndexes; + var nextIndex = -1; + + if (index === -1) { + // translate => rotate => scale + if (functionName === "translate") { + nextIndex = 0; + } else if (functionName === "rotate") { + nextIndex = findIndex(nextTransforms, function (text) { + return text.match(/scale\(/g); + }); + } + + if (nextIndex === -1) { + nextIndex = nextTransforms.length; + } + + datas.transformIndex = nextIndex; + } else if (find$1(nextTransformAppendedIndexes, function (info) { + return info.index === index && info.functionName === functionName; + })) { + nextIndex = index; + } else { + nextIndex = index + nextTransformAppendedIndexes.filter(function (info) { + return info.index < index; + }).length; + } + + var result = convertTransformInfo(nextTransforms, moveable.state, nextIndex); + var targetFunction = result.targetFunction; + var matFunctionName = functionName === "rotate" ? "rotateZ" : functionName; + datas.beforeFunctionTexts = result.beforeFunctionTexts; + datas.afterFunctionTexts = result.afterFunctionTexts; + datas.beforeTransform = result.beforeFunctionMatrix; + datas.beforeTransform2 = result.beforeFunctionMatrix2; + datas.targetTansform = result.targetFunctionMatrix; + datas.afterTransform = result.afterFunctionMatrix; + datas.afterTransform2 = result.afterFunctionMatrix2; + datas.targetAllTransform = result.allFunctionMatrix; + + if (targetFunction.functionName === matFunctionName) { + datas.afterFunctionTexts.splice(0, 1); + datas.isAppendTransform = false; + } else if (length > nextIndex) { + datas.isAppendTransform = true; + originalDatas.nextTransformAppendedIndexes = __spreadArray(__spreadArray([], __read(nextTransformAppendedIndexes), false), [{ + functionName: functionName, + index: nextIndex, + isAppend: true + }], false); + } + } + + function convertTransformFormat(datas, value, dist) { + return "".concat(datas.beforeFunctionTexts.join(" "), " ").concat(datas.isAppendTransform ? dist : value, " ").concat(datas.afterFunctionTexts.join(" ")); + } + + function getTransformDist(_a) { + var datas = _a.datas, + distX = _a.distX, + distY = _a.distY; + + var _b = __read(getBeforeDragDist({ + datas: datas, + distX: distX, + distY: distY + }), 2), + bx = _b[0], + by = _b[1]; // B * [tx, ty] * A = [bx, by] * targetMatrix; + // [tx, ty] = B-1 * [bx, by] * targetMatrix * A-1 * [0, 0]; + + + var res = getTransfromMatrix(datas, fromTranslation([bx, by], 4)); + return calculate(res, convertPositionMatrix([0, 0, 0], 4), 4); + } + + function getTransfromMatrix(datas, targetMatrix, isAfter) { + var beforeTransform = datas.beforeTransform, + afterTransform = datas.afterTransform, + beforeTransform2 = datas.beforeTransform2, + afterTransform2 = datas.afterTransform2, + targetAllTransform = datas.targetAllTransform; // B * afterTargetMatrix * A = (targetMatrix * targetAllTransform) + // afterTargetMatrix = B-1 * targetMatrix * targetAllTransform * A-1 + // nextTargetMatrix = (targetMatrix * targetAllTransform) + + var nextTargetMatrix = isAfter ? multiply(targetAllTransform, targetMatrix, 4) : multiply(targetMatrix, targetAllTransform, 4); // res1 = B-1 * nextTargetMatrix + + var res1 = multiply(invert(isAfter ? beforeTransform2 : beforeTransform, 4), nextTargetMatrix, 4); // res3 = res2 * A-1 + + var afterTargetMatrix = multiply(res1, invert(isAfter ? afterTransform2 : afterTransform, 4), 4); + return afterTargetMatrix; + } + + function getBeforeDragDist(_a) { + var datas = _a.datas, + distX = _a.distX, + distY = _a.distY; // TT = BT + + var inverseBeforeMatrix = datas.inverseBeforeMatrix, + is3d = datas.is3d, + startDragBeforeDist = datas.startDragBeforeDist, + absoluteOrigin = datas.absoluteOrigin; + var n = is3d ? 4 : 3; // ABS_ORIGIN * [distX, distY] = BM * (ORIGIN + [tx, ty]) + // BM -1 * ABS_ORIGIN * [distX, distY] - ORIGIN = [tx, ty] + + return minus(calculate(inverseBeforeMatrix, plus(absoluteOrigin, [distX, distY]), n), startDragBeforeDist); + } + + function getDragDist(_a, isBefore) { + var datas = _a.datas, + distX = _a.distX, + distY = _a.distY; + var inverseBeforeMatrix = datas.inverseBeforeMatrix, + inverseMatrix = datas.inverseMatrix, + is3d = datas.is3d, + startDragBeforeDist = datas.startDragBeforeDist, + startDragDist = datas.startDragDist, + absoluteOrigin = datas.absoluteOrigin; + var n = is3d ? 4 : 3; + return minus(calculate(isBefore ? inverseBeforeMatrix : inverseMatrix, plus(absoluteOrigin, [distX, distY]), n), isBefore ? startDragBeforeDist : startDragDist); + } + + function getInverseDragDist(_a, isBefore) { + var datas = _a.datas, + distX = _a.distX, + distY = _a.distY; + var beforeMatrix = datas.beforeMatrix, + matrix = datas.matrix, + is3d = datas.is3d, + startDragBeforeDist = datas.startDragBeforeDist, + startDragDist = datas.startDragDist, + absoluteOrigin = datas.absoluteOrigin; + var n = is3d ? 4 : 3; + return minus(calculate(isBefore ? beforeMatrix : matrix, plus(isBefore ? startDragBeforeDist : startDragDist, [distX, distY]), n), absoluteOrigin); + } + + function calculateTransformOrigin(transformOrigin, width, height, prevWidth, prevHeight, prevOrigin) { + if (prevWidth === void 0) { + prevWidth = width; + } + + if (prevHeight === void 0) { + prevHeight = height; + } + + if (prevOrigin === void 0) { + prevOrigin = [0, 0]; + } + + if (!transformOrigin) { + return prevOrigin; + } + + return transformOrigin.map(function (pos, i) { + var _a = splitUnit(pos), + value = _a.value, + unit = _a.unit; + + var prevSize = i ? prevHeight : prevWidth; + var size = i ? height : width; + + if (pos === "%" || isNaN(value)) { + // no value but % + var measureRatio = prevSize ? prevOrigin[i] / prevSize : 0; + return size * measureRatio; + } else if (unit !== "%") { + return value; + } + + return size * value / 100; + }); + } + + function getPosIndexesByDirection(direction) { + var indexes = []; + + if (direction[1] >= 0) { + if (direction[0] >= 0) { + indexes.push(3); + } + + if (direction[0] <= 0) { + indexes.push(2); + } + } + + if (direction[1] <= 0) { + if (direction[0] >= 0) { + indexes.push(1); + } + + if (direction[0] <= 0) { + indexes.push(0); + } + } + + return indexes; + } + + function getPosesByDirection(poses, direction) { + /* + [-1, -1](pos1) [0, -1](pos1,pos2) [1, -1](pos2) + [-1, 0](pos1, pos3) [1, 0](pos2, pos4) + [-1, 1](pos3) [0, 1](pos3, pos4) [1, 1](pos4) + */ + return getPosIndexesByDirection(direction).map(function (index) { + return poses[index]; + }); + } + + function getPosBySingleDirection(poses, direction) { + var ratio = (direction + 1) / 2; + return [dot(poses[0][0], poses[1][0], ratio, 1 - ratio), dot(poses[0][1], poses[1][1], ratio, 1 - ratio)]; + } + + function getPosByDirection(poses, direction) { + var top = getPosBySingleDirection([poses[0], poses[1]], direction[0]); + var bottom = getPosBySingleDirection([poses[2], poses[3]], direction[0]); + return getPosBySingleDirection([top, bottom], direction[1]); + } + + function getDist(startPos, matrix, width, height, n, fixedDirection) { + var poses = calculatePoses(matrix, width, height, n); + var fixedPos = getPosByDirection(poses, fixedDirection); + var distX = startPos[0] - fixedPos[0]; + var distY = startPos[1] - fixedPos[1]; + return [distX, distY]; + } + + function getNextMatrix(offsetMatrix, targetMatrix, origin, n) { + return multiply(offsetMatrix, getAbsoluteMatrix(targetMatrix, n, origin), n); + } + + function getNextTransformMatrix(state, datas, transform, isAllTransform) { + var transformOrigin = state.transformOrigin, + offsetMatrix = state.offsetMatrix, + is3d = state.is3d; + var n = is3d ? 4 : 3; + var targetTransform; + + if (isString(transform)) { + var beforeTransform = datas.beforeTransform, + afterTransform = datas.afterTransform; + + if (isAllTransform) { + targetTransform = convertDimension(parseMat(transform), 4, n); + } else { + targetTransform = convertDimension(multiply(multiply(beforeTransform, parseMat([transform]), 4), afterTransform, 4), 4, n); + } + } else { + targetTransform = transform; + } + + return getNextMatrix(offsetMatrix, targetTransform, transformOrigin, n); + } + + function scaleMatrix(state, scale) { + var transformOrigin = state.transformOrigin, + offsetMatrix = state.offsetMatrix, + is3d = state.is3d, + targetMatrix = state.targetMatrix, + targetAllTransform = state.targetAllTransform; + var n = is3d ? 4 : 3; + return getNextMatrix(offsetMatrix, multiply(targetAllTransform || targetMatrix, createScaleMatrix(scale, n), n), transformOrigin, n); + } + + function fillTransformStartEvent(moveable, e) { + var originalDatas = getBeforeRenderableDatas(e); + return { + setTransform: function (transform, index) { + if (index === void 0) { + index = -1; + } + + originalDatas.startTransforms = isArray(transform) ? transform : splitSpace(transform); + setTransformIndex(moveable, e, index); + }, + setTransformIndex: function (index) { + setTransformIndex(moveable, e, index); + } + }; + } + + function setDefaultTransformIndex(moveable, e, property) { + var originalDatas = getBeforeRenderableDatas(e); + var startTransforms = originalDatas.startTransforms; + setTransformIndex(moveable, e, findIndex(startTransforms, function (func) { + return func.indexOf("".concat(property, "(")) === 0; + })); + } + + function setTransformIndex(moveable, e, index) { + var originalDatas = getBeforeRenderableDatas(e); + var datas = e.datas; + datas.transformIndex = index; + + if (index === -1) { + return; + } + + var transform = originalDatas.startTransforms[index]; + + if (!transform) { + return; + } + + var state = moveable.state; + var info = parse([transform], { + "x%": function (v) { + return v / 100 * state.offsetWidth; + }, + "y%": function (v) { + return v / 100 * state.offsetHeight; + } + }); + datas.startValue = info[0].functionValue; + } + + function fillOriginalTransform(e, transform) { + var originalDatas = getBeforeRenderableDatas(e); + originalDatas.nextTransforms = splitSpace(transform); // originalDatas.nextTargetMatrix = parseMat(transform); + } + + function getBeforeRenderableDatas(e) { + return e.originalDatas.beforeRenderable; + } + + function getNextTransforms(e) { + var originalDatas = e.originalDatas.beforeRenderable; + return originalDatas.nextTransforms; + } + + function getNextTransformText(e) { + return (getNextTransforms(e) || []).join(" "); + } + + function getNextStyle(e) { + return getBeforeRenderableDatas(e).nextStyle; + } + + function fillTransformEvent(moveable, nextTransform, delta, isPinch, e) { + fillOriginalTransform(e, nextTransform); + var drag = Draggable.drag(moveable, setCustomDrag(e, moveable.state, delta, isPinch, false)); + var afterTransform = drag ? drag.transform : nextTransform; + return __assign(__assign({ + transform: nextTransform, + drag: drag + }, fillCSSObject({ + transform: afterTransform + }, e)), { + afterTransform: afterTransform + }); + } + + function getTranslateFixedPosition(moveable, transform, fixedDirection, fixedOffset, datas, isAllTransform) { + var nextMatrix = getNextTransformMatrix(moveable.state, datas, transform, isAllTransform); + var nextFixedPosition = getDirectionOffset(moveable, fixedDirection, fixedOffset, nextMatrix); + return nextFixedPosition; + } + + function getTranslateDist(moveable, transform, fixedDirection, fixedPosition, fixedOffset, datas, isAllTransform) { + var nextFixedPosition = getTranslateFixedPosition(moveable, transform, fixedDirection, fixedOffset, datas, isAllTransform); + var state = moveable.state; + var left = state.left, + top = state.top; + var groupable = moveable.props.groupable; + var groupLeft = groupable ? left : 0; + var groupTop = groupable ? top : 0; + var dist = minus(fixedPosition, nextFixedPosition); + return minus(dist, [groupLeft, groupTop]); + } + + function getScaleDist(moveable, transform, fixedDirection, fixedPosition, fixedOffset, datas, isAllTransform) { + var dist = getTranslateDist(moveable, transform, fixedDirection, fixedPosition, fixedOffset, datas, isAllTransform); + return dist; + } + + function getDirectionByPos(pos, width, height) { + return [width ? -1 + pos[0] / (width / 2) : 0, height ? -1 + pos[1] / (height / 2) : 0]; + } + + function getDirectionOffset(moveable, fixedDirection, fixedOffset, nextMatrix) { + if (nextMatrix === void 0) { + nextMatrix = moveable.state.allMatrix; + } + + var _a = moveable.state, + width = _a.width, + height = _a.height, + is3d = _a.is3d; + var n = is3d ? 4 : 3; + var fixedOffsetPosition = [width / 2 * (1 + fixedDirection[0]) + fixedOffset[0], height / 2 * (1 + fixedDirection[1]) + fixedOffset[1]]; + return calculatePosition(nextMatrix, fixedOffsetPosition, n); + } + + function getRotateDist(moveable, rotateDist, datas) { + var fixedDirection = datas.fixedDirection; + var fixedPosition = datas.fixedPosition; + var fixedOffset = datas.fixedOffset; + return getTranslateDist(moveable, "rotate(".concat(rotateDist, "deg)"), fixedDirection, fixedPosition, fixedOffset, datas); + } + + function getResizeDist(moveable, width, height, fixedPosition, transformOrigin, datas) { + var groupable = moveable.props.groupable; + var state = moveable.state; + var prevOrigin = state.transformOrigin, + offsetMatrix = state.offsetMatrix, + is3d = state.is3d, + prevWidth = state.width, + prevHeight = state.height, + left = state.left, + top = state.top; + var fixedDirection = datas.fixedDirection; + var targetMatrix = datas.nextTargetMatrix || state.targetMatrix; + var n = is3d ? 4 : 3; + var nextOrigin = calculateTransformOrigin(transformOrigin, width, height, prevWidth, prevHeight, prevOrigin); + var groupLeft = groupable ? left : 0; + var groupTop = groupable ? top : 0; + var nextMatrix = getNextMatrix(offsetMatrix, targetMatrix, nextOrigin, n); + var dist = getDist(fixedPosition, nextMatrix, width, height, n, fixedDirection); + return minus(dist, [groupLeft, groupTop]); + } + + function getAbsolutePosition(moveable, direction) { + return getPosByDirection(getAbsolutePosesByState(moveable.state), direction); + } + + function getGestoData(moveable, ableName) { + var targetGesto = moveable.targetGesto; + var controlGesto = moveable.controlGesto; + var data; + + if (targetGesto === null || targetGesto === void 0 ? void 0 : targetGesto.isFlag()) { + data = targetGesto.getEventData()[ableName]; + } + + if (!data && (controlGesto === null || controlGesto === void 0 ? void 0 : controlGesto.isFlag())) { + data = controlGesto.getEventData()[ableName]; + } + + return data || {}; + } + + function getShadowRoot(parentElement) { + if (parentElement && parentElement.getRootNode) { + var rootNode = parentElement.getRootNode(); + + if (rootNode.nodeType === 11) { + return rootNode; + } + } + + return; + } + + function getIndividualTransforms(getStyle) { + var scale = getStyle("scale"); + var rotate = getStyle("rotate"); + var translate = getStyle("translate"); + var individualTransforms = []; + + if (translate && translate !== "0px" && translate !== "none") { + individualTransforms.push("translate(".concat(translate.split(/\s+/).join(","), ")")); + } + + if (rotate && rotate !== "1" && rotate !== "none") { + individualTransforms.push("rotate(".concat(rotate, ")")); + } + + if (scale && scale !== "1" && scale !== "none") { + individualTransforms.push("scale(".concat(scale.split(/\s+/).join(","), ")")); + } + + return individualTransforms; + } + + function getMatrixStackInfo(target, container, checkContainer) { + var el = target; + var matrixes = []; + var documentElement = getDocumentElement(target) || getDocumentBody(target); + var requestEnd = !checkContainer && target === container || target === documentElement; + var isEnd = requestEnd; + var is3d = false; + var n = 3; + var transformOrigin; + var targetTransformOrigin; + var targetMatrix; + var hasFixed = false; + var offsetContainer = getOffsetInfo(container, container, true).offsetParent; + var zoom = 1; + + while (el && !isEnd) { + isEnd = requestEnd; + var getStyle = getCachedStyle(el); + var position = getStyle("position"); + var transform = getElementTransform(el); + var isFixed = position === "fixed"; + var individualTransforms = getIndividualTransforms(getStyle); + var matrix = convertCSStoMatrix(getTransformMatrix(transform)); + var offsetParent = void 0; + var isOffsetEnd = false; + var isStatic = false; + var parentClientLeft = 0; + var parentClientTop = 0; + var fixedClientLeft = 0; + var fixedClientTop = 0; + var fixedInfo = { + hasTransform: false, + fixedContainer: null + }; + + if (isFixed) { + hasFixed = true; + fixedInfo = getPositionFixedInfo(el); + offsetContainer = fixedInfo.fixedContainer; + } // convert 3 to 4 + + + var length_1 = matrix.length; + + if (!is3d && (length_1 === 16 || individualTransforms.length)) { + is3d = true; + n = 4; + convert3DMatrixes(matrixes); + + if (targetMatrix) { + targetMatrix = convertDimension(targetMatrix, 3, 4); + } + } + + if (is3d && length_1 === 9) { + matrix = convertDimension(matrix, 3, 4); + } + + var _a = getOffsetPosInfo(el, target), + tagName = _a.tagName, + hasOffset = _a.hasOffset, + isSVG = _a.isSVG, + origin_1 = _a.origin, + targetOrigin = _a.targetOrigin, + offsetPos = _a.offset; + + var _b = __read(offsetPos, 2), + offsetLeft = _b[0], + offsetTop = _b[1]; + + if (tagName === "svg" && !target.ownerSVGElement && targetMatrix) { + // scale matrix for svg's SVGElements. + matrixes.push({ + type: "target", + target: el, + matrix: getSVGMatrix(el, n) + }); + matrixes.push({ + type: "offset", + target: el, + matrix: createIdentityMatrix(n) + }); + } + + var targetZoom = parseFloat(getStyle("zoom")) || 1; + + if (isFixed) { + offsetParent = fixedInfo.fixedContainer; + isOffsetEnd = true; + } else { + var offsetInfo = getOffsetInfo(el, container, false, true, getStyle); + var offsetZoom = offsetInfo.offsetZoom; + offsetParent = offsetInfo.offsetParent; + isOffsetEnd = offsetInfo.isEnd; + isStatic = offsetInfo.isStatic; + zoom *= offsetZoom; + + if ((offsetInfo.isCustomElement || offsetZoom !== 1) && isStatic) { + offsetLeft -= offsetParent.offsetLeft; + offsetTop -= offsetParent.offsetTop; + } else if (IS_FIREFOX || IS_CHROMIUM109) { + var parentSlotElement = offsetInfo.parentSlotElement; + + if (parentSlotElement) { + var customOffsetParent = offsetParent; + var customOffsetLeft = 0; + var customOffsetTop = 0; + + while (customOffsetParent) { + if (!getShadowRoot(customOffsetParent)) { + break; + } + + customOffsetLeft += customOffsetParent.offsetLeft; + customOffsetTop += customOffsetParent.offsetTop; + customOffsetParent = customOffsetParent.offsetParent; + } + + offsetLeft -= customOffsetLeft; + offsetTop -= customOffsetTop; + } + } + } + + if (IS_WEBKIT && !IS_SAFARI_ABOVE15 && hasOffset && !isSVG && isStatic && (position === "relative" || position === "static")) { + offsetLeft -= offsetParent.offsetLeft; + offsetTop -= offsetParent.offsetTop; + requestEnd = requestEnd || isOffsetEnd; + } + + if (isFixed) { + if (hasOffset && fixedInfo.hasTransform) { + // border + fixedClientLeft = offsetParent.clientLeft; + fixedClientTop = offsetParent.clientTop; + } + } else { + if (hasOffset && offsetContainer !== offsetParent) { + // border + parentClientLeft = offsetParent.clientLeft; + parentClientTop = offsetParent.clientTop; + } + + if (hasOffset && offsetParent === documentElement) { + var margin = getBodyOffset(el, false); + offsetLeft += margin[0]; + offsetTop += margin[1]; + } + } + + matrixes.push({ + type: "target", + target: el, + matrix: getAbsoluteMatrix(matrix, n, origin_1) + }); + + if (individualTransforms.length) { + matrixes.push({ + type: "offset", + target: el, + matrix: createIdentityMatrix(n) + }); + matrixes.push({ + type: "target", + target: el, + matrix: getAbsoluteMatrix(parseMat(individualTransforms), n, origin_1) + }); + } + + if (hasOffset) { + var isElementTarget = el === target; + var scrollLeft = isElementTarget ? 0 : el.scrollLeft; + var scrollTop = isElementTarget ? 0 : el.scrollTop; + matrixes.push({ + type: "offset", + target: el, + matrix: createOriginMatrix([offsetLeft - scrollLeft + parentClientLeft - fixedClientLeft, offsetTop - scrollTop + parentClientTop - fixedClientTop], n) + }); + } else { + // svg + matrixes.push({ + type: "offset", + target: el, + origin: origin_1 + }); + } // transform으로 계산되지 않는 zoom을 위한 (0, 0) 을 기준 matrix 추가. + + + if (targetZoom !== 1) { + matrixes.push({ + type: "zoom", + target: el, + matrix: getAbsoluteMatrix(createScaleMatrix([targetZoom, targetZoom], n), n, [0, 0]) + }); + } + + if (!targetMatrix) { + targetMatrix = matrix; + } + + if (!transformOrigin) { + transformOrigin = origin_1; + } + + if (!targetTransformOrigin) { + targetTransformOrigin = targetOrigin; + } + + if (isEnd || isFixed) { + break; + } else { + el = offsetParent; + requestEnd = isOffsetEnd; + } + + if (!checkContainer || el === documentElement) { + isEnd = requestEnd; + } + } + + if (!targetMatrix) { + targetMatrix = createIdentityMatrix(n); + } + + if (!transformOrigin) { + transformOrigin = [0, 0]; + } + + if (!targetTransformOrigin) { + targetTransformOrigin = [0, 0]; + } + + return { + zoom: zoom, + offsetContainer: offsetContainer, + matrixes: matrixes, + targetMatrix: targetMatrix, + transformOrigin: transformOrigin, + targetOrigin: targetTransformOrigin, + is3d: is3d, + hasFixed: hasFixed + }; + } + + var cacheStyleMap = null; + var clientRectStyleMap = null; + var matrixContainerInfos = null; + + function setStoreCache(useCache) { + if (useCache) { + if (window.Map) { + cacheStyleMap = new Map(); + clientRectStyleMap = new Map(); + } + + matrixContainerInfos = []; + } else { + cacheStyleMap = null; + matrixContainerInfos = null; + clientRectStyleMap = null; + } + } + + function getCachedClientRect(el) { + var clientRect = clientRectStyleMap === null || clientRectStyleMap === void 0 ? void 0 : clientRectStyleMap.get(el); + + if (clientRect) { + return clientRect; + } + + var nextClientRect = getClientRect(el, true); + + if (clientRectStyleMap) { + clientRectStyleMap.set(el, nextClientRect); + } + + return nextClientRect; + } + + function getCachedMatrixContainerInfo(target, container) { + if (matrixContainerInfos) { + var result_1 = find$1(matrixContainerInfos, function (info) { + return info[0][0] == target && info[0][1] == container; + }); + + if (result_1) { + return result_1[1]; + } + } + + var result = getMatrixStackInfo(target, container, true); + + if (matrixContainerInfos) { + matrixContainerInfos.push([[target, container], result]); + } + + return result; + } + + function getCachedStyle(element) { + var cache = cacheStyleMap === null || cacheStyleMap === void 0 ? void 0 : cacheStyleMap.get(element); + + if (!cache) { + var nextStyle_1 = getWindow(element).getComputedStyle(element); + + if (!cacheStyleMap) { + return function (property) { + return nextStyle_1[property]; + }; + } + + cache = { + style: nextStyle_1, + cached: {} + }; + cacheStyleMap.set(element, cache); + } + + var cached = cache.cached; + var style = cache.style; + return function (property) { + if (!(property in cached)) { + cached[property] = style[property]; + } + + return cached[property]; + }; + } + + function fillChildEvents(moveable, name, e) { + var datas = e.originalDatas; + datas.groupable = datas.groupable || {}; + var groupableDatas = datas.groupable; + groupableDatas.childDatas = groupableDatas.childDatas || []; + var childDatas = groupableDatas.childDatas; + return moveable.moveables.map(function (_, i) { + childDatas[i] = childDatas[i] || {}; + childDatas[i][name] = childDatas[i][name] || {}; + return __assign(__assign({}, e), { + isRequestChild: true, + datas: childDatas[i][name], + originalDatas: childDatas[i] + }); + }); + } + + function triggerChildGesto(moveable, able, type, delta, e, isConvert, ableName) { + var isStart = !!type.match(/Start$/g); + var isEnd = !!type.match(/End$/g); + var isPinch = e.isPinch; + var datas = e.datas; + var events = fillChildEvents(moveable, able.name, e); + var moveables = moveable.moveables; + var childEvents = []; + var eventParams = events.map(function (ev, i) { + var childMoveable = moveables[i]; + var state = childMoveable.state; + var gestos = state.gestos; + var childEvent = ev; + + if (isStart) { + childEvent = new CustomGesto(ableName).dragStart(delta, ev); + childEvents.push(childEvent); + } else { + if (!gestos[ableName]) { + gestos[ableName] = datas.childGestos[i]; + } + + if (!gestos[ableName]) { + return; + } + + childEvent = setCustomDrag(ev, state, delta, isPinch, isConvert, ableName); + childEvents.push(childEvent); + } + + var result = able[type](childMoveable, __assign(__assign({}, childEvent), { + parentFlag: true + })); + + if (isEnd) { + gestos[ableName] = null; + } + + return result; + }); + + if (isStart) { + datas.childGestos = moveables.map(function (child) { + return child.state.gestos[ableName]; + }); + } + + return { + eventParams: eventParams, + childEvents: childEvents + }; + } + + function triggerChildAbles(moveable, able, type, e, eachEvent, callback) { + if (eachEvent === void 0) { + eachEvent = function (_, ev) { + return ev; + }; + } + + var isEnd = !!type.match(/End$/g); + var events = fillChildEvents(moveable, able.name, e); + var moveables = moveable.moveables; + var childs = events.map(function (ev, i) { + var childMoveable = moveables[i]; + var childEvent = ev; + childEvent = eachEvent(childMoveable, ev); + var result = able[type](childMoveable, __assign(__assign({}, childEvent), { + parentFlag: true + })); + result && callback && callback(childMoveable, ev, result, i); + + if (isEnd) { + childMoveable.state.gestos = {}; + } + + return result; + }); + return childs; + } + + function startChildDist(moveable, child, parentDatas, childEvent) { + var fixedDirection = parentDatas.fixedDirection; + var fixedPosition = parentDatas.fixedPosition; + var startPositions = childEvent.datas.startPositions || getAbsolutePosesByState(child.state); + var pos = getPosByDirection(startPositions, fixedDirection); + + var _a = __read(calculate(createRotateMatrix(-moveable.rotation / 180 * Math.PI, 3), [pos[0] - fixedPosition[0], pos[1] - fixedPosition[1], 1], 3), 2), + originalX = _a[0], + originalY = _a[1]; + + childEvent.datas.originalX = originalX; + childEvent.datas.originalY = originalY; + return childEvent; + } + + function renderDirectionControlsByInfos(moveable, ableName, renderDirections, React) { + var _a = moveable.getState(), + renderPoses = _a.renderPoses, + rotationRad = _a.rotation, + direction = _a.direction; + + var zoom = getProps(moveable.props, ableName).zoom; + var degRotation = absDegree(rotationRad / Math.PI * 180); + var directionMap = {}; + var renderState = moveable.renderState; + + if (!renderState.renderDirectionMap) { + renderState.renderDirectionMap = {}; + } + + var renderDirectionMap = renderState.renderDirectionMap; + renderDirections.forEach(function (_a) { + var dir = _a.dir; + directionMap[dir] = true; + }); + var directionSign = sign(direction); + return renderDirections.map(function (_a) { + var data = _a.data, + classNames = _a.classNames, + dir = _a.dir; + var indexes = DIRECTION_INDEXES[dir]; + + if (!indexes || !directionMap[dir]) { + return null; + } + + renderDirectionMap[dir] = true; + var directionRotation = (throttle(degRotation, 15) + directionSign * DIRECTION_ROTATIONS[dir] + 720) % 180; + var dataAttrs = {}; + getKeys(data).forEach(function (name) { + dataAttrs["data-".concat(name)] = data[name]; + }); + return React.createElement("div", __assign({ + className: prefix.apply(void 0, __spreadArray(["control", "direction", dir, ableName], __read(classNames), false)), + "data-rotation": directionRotation, + "data-direction": dir + }, dataAttrs, { + key: "direction-".concat(dir), + style: getControlTransform.apply(void 0, __spreadArray([rotationRad, zoom], __read(indexes.map(function (index) { + return renderPoses[index]; + })), false)) + })); + }); + } + + function renderDirectionControls(moveable, defaultDirections, ableName, React) { + var _a = getProps(moveable.props, ableName), + _b = _a.renderDirections, + directions = _b === void 0 ? defaultDirections : _b, + displayAroundControls = _a.displayAroundControls; + + if (!directions) { + return []; + } + + var renderDirections = directions === true ? DIRECTIONS : directions; + return __spreadArray(__spreadArray([], __read(displayAroundControls ? renderAroundControls(moveable, React, ableName, renderDirections) : []), false), __read(renderDirectionControlsByInfos(moveable, ableName, renderDirections.map(function (dir) { + return { + data: {}, + classNames: [], + dir: dir + }; + }), React)), false); + } + + function renderLine(React, direction, pos1, pos2, zoom, key) { + var classNames = []; + + for (var _i = 6; _i < arguments.length; _i++) { + classNames[_i - 6] = arguments[_i]; + } + + var rad = getRad$1(pos1, pos2); + var rotation = direction ? throttle(rad / Math.PI * 180, 15) % 180 : -1; + return React.createElement("div", { + key: "line-".concat(key), + className: prefix.apply(void 0, __spreadArray(["line", "direction", direction ? "edge" : "", direction], __read(classNames), false)), + "data-rotation": rotation, + "data-line-key": key, + "data-direction": direction, + style: getLineStyle(pos1, pos2, zoom, rad) + }); + } + + function renderEdgeLines(React, ableName, edge, poses, zoom) { + var directions = edge === true ? DIRECTIONS4 : edge; + return directions.map(function (direction, i) { + var _a = __read(DIRECTION_INDEXES[direction], 2), + index1 = _a[0], + index2 = _a[1]; + + if (index2 == null) { + return; + } + + return renderLine(React, direction, poses[index1], poses[index2], zoom, "".concat(ableName, "Edge").concat(i), ableName); + }).filter(Boolean); + } + + function getRenderDirections(ableName) { + return function (moveable, React) { + var edge = getProps(moveable.props, ableName).edge; + + if (edge && (edge === true || edge.length)) { + return __spreadArray(__spreadArray([], __read(renderEdgeLines(React, ableName, edge, moveable.getState().renderPoses, moveable.props.zoom)), false), __read(renderDiagonalDirections(moveable, ableName, React)), false); + } + + return renderAllDirections(moveable, ableName, React); + }; + } + + function renderAllDirections(moveable, ableName, React) { + return renderDirectionControls(moveable, DIRECTIONS, ableName, React); + } + + function renderDiagonalDirections(moveable, ableName, React) { + return renderDirectionControls(moveable, ["nw", "ne", "sw", "se"], ableName, React); + } + + function renderAroundControls(moveable, React, ableName, renderDirections) { + var renderState = moveable.renderState; + + if (!renderState.renderDirectionMap) { + renderState.renderDirectionMap = {}; + } + + var _a = moveable.getState(), + renderPoses = _a.renderPoses, + rotationRad = _a.rotation, + direction = _a.direction; + + var renderDirectionMap = renderState.renderDirectionMap; + var zoom = moveable.props.zoom; + var directionSign = sign(direction); + var degRotation = rotationRad / Math.PI * 180; + return (renderDirections || getKeys(renderDirectionMap)).map(function (dir) { + var indexes = DIRECTION_INDEXES[dir]; + + if (!indexes) { + return null; + } + + var directionRotation = (throttle(degRotation, 15) + directionSign * DIRECTION_ROTATIONS[dir] + 720) % 180; + var classNames = ["around-control"]; + + if (ableName) { + classNames.push("direction", ableName); + } + + return React.createElement("div", { + className: prefix.apply(void 0, __spreadArray([], __read(classNames), false)), + "data-rotation": directionRotation, + "data-direction": dir, + key: "direction-around-".concat(dir), + style: getControlTransform.apply(void 0, __spreadArray([rotationRad, zoom], __read(indexes.map(function (index) { + return renderPoses[index]; + })), false)) + }); + }); + } + + function checkBoundPoses(bounds, verticalPoses, horizontalPoses) { + var _a = bounds || {}, + _b = _a.position, + position = _b === void 0 ? "client" : _b, + _c = _a.left, + left = _c === void 0 ? -Infinity : _c, + _d = _a.top, + top = _d === void 0 ? -Infinity : _d, + _e = _a.right, + right = _e === void 0 ? Infinity : _e, + _f = _a.bottom, + bottom = _f === void 0 ? Infinity : _f; + + var nextBounds = { + position: position, + left: left, + top: top, + right: right, + bottom: bottom + }; + return { + vertical: checkBounds(nextBounds, verticalPoses, true), + horizontal: checkBounds(nextBounds, horizontalPoses, false) + }; + } + + function getBounds(moveable, externalBounds) { + var _a = moveable.state, + _b = _a.containerClientRect, + containerHeight = _b.clientHeight, + containerWidth = _b.clientWidth, + clientLeft = _b.clientLeft, + clientTop = _b.clientTop, + _c = _a.snapOffset, + snapOffsetLeft = _c.left, + snapOffsetTop = _c.top, + snapOffsetRight = _c.right, + snapOffsetBottom = _c.bottom; + var bounds = externalBounds || moveable.props.bounds || {}; + var position = bounds.position || "client"; + var isCSS = position === "css"; + var _d = bounds.left, + left = _d === void 0 ? -Infinity : _d, + _e = bounds.top, + top = _e === void 0 ? -Infinity : _e; + var _f = bounds.right, + right = _f === void 0 ? isCSS ? -Infinity : Infinity : _f, + _g = bounds.bottom, + bottom = _g === void 0 ? isCSS ? -Infinity : Infinity : _g; + + if (isCSS) { + right = containerWidth + snapOffsetRight - snapOffsetLeft - right; + bottom = containerHeight + snapOffsetBottom - snapOffsetTop - bottom; + } + + return { + left: left + snapOffsetLeft - clientLeft, + right: right + snapOffsetLeft - clientLeft, + top: top + snapOffsetTop - clientTop, + bottom: bottom + snapOffsetTop - clientTop + }; + } + + function checkBoundKeepRatio(moveable, startPos, endPos) { + var _a = getBounds(moveable), + left = _a.left, + top = _a.top, + right = _a.right, + bottom = _a.bottom; + + var _b = __read(endPos, 2), + endX = _b[0], + endY = _b[1]; + + var _c = __read(minus(endPos, startPos), 2), + dx = _c[0], + dy = _c[1]; + + if (abs(dx) < TINY_NUM) { + dx = 0; + } + + if (abs(dy) < TINY_NUM) { + dy = 0; + } + + var isBottom = dy > 0; + var isRight = dx > 0; + var verticalInfo = { + isBound: false, + offset: 0, + pos: 0 + }; + var horizontalInfo = { + isBound: false, + offset: 0, + pos: 0 + }; + + if (dx === 0 && dy === 0) { + return { + vertical: verticalInfo, + horizontal: horizontalInfo + }; + } else if (dx === 0) { + if (isBottom) { + if (bottom < endY) { + horizontalInfo.pos = bottom; + horizontalInfo.offset = endY - bottom; + } + } else { + if (top > endY) { + horizontalInfo.pos = top; + horizontalInfo.offset = endY - top; + } + } + } else if (dy === 0) { + if (isRight) { + if (right < endX) { + verticalInfo.pos = right; + verticalInfo.offset = endX - right; + } + } else { + if (left > endX) { + verticalInfo.pos = left; + verticalInfo.offset = endX - left; + } + } + } else { + // y - y1 = a * (x - x1) + var a = dy / dx; + var b = endPos[1] - a * endX; + var y = 0; + var x = 0; + var isBound = false; + + if (isRight && right <= endX) { + y = a * right + b; + x = right; + isBound = true; + } else if (!isRight && endX <= left) { + y = a * left + b; + x = left; + isBound = true; + } + + if (isBound) { + if (y < top || y > bottom) { + isBound = false; + } + } + + if (!isBound) { + if (isBottom && bottom <= endY) { + y = bottom; + x = (y - b) / a; + isBound = true; + } else if (!isBottom && endY <= top) { + y = top; + x = (y - b) / a; + isBound = true; + } + } + + if (isBound) { + verticalInfo.isBound = true; + verticalInfo.pos = x; + verticalInfo.offset = endX - x; + horizontalInfo.isBound = true; + horizontalInfo.pos = y; + horizontalInfo.offset = endY - y; + } + } + + return { + vertical: verticalInfo, + horizontal: horizontalInfo + }; + } + + function checkBounds(bounds, poses, isVertical) { + // 0 [100 - 200] 300 + var startBoundPos = bounds[isVertical ? "left" : "top"]; + var endBoundPos = bounds[isVertical ? "right" : "bottom"]; // 450 + + var minPos = Math.min.apply(Math, __spreadArray([], __read(poses), false)); + var maxPos = Math.max.apply(Math, __spreadArray([], __read(poses), false)); + var boundInfos = []; + + if (startBoundPos + 1 > minPos) { + boundInfos.push({ + direction: "start", + isBound: true, + offset: minPos - startBoundPos, + pos: startBoundPos + }); + } + + if (endBoundPos - 1 < maxPos) { + boundInfos.push({ + direction: "end", + isBound: true, + offset: maxPos - endBoundPos, + pos: endBoundPos + }); + } + + if (!boundInfos.length) { + boundInfos.push({ + isBound: false, + offset: 0, + pos: 0 + }); + } + + return boundInfos.sort(function (a, b) { + return abs(b.offset) - abs(a.offset); + }); + } + + function isBoundRotate$1(relativePoses, boundRect, rad) { + var nextPoses = rad ? relativePoses.map(function (pos) { + return rotate(pos, rad); + }) : relativePoses; + return nextPoses.some(function (pos) { + return pos[0] < boundRect.left && abs(pos[0] - boundRect.left) > 0.1 || pos[0] > boundRect.right && abs(pos[0] - boundRect.right) > 0.1 || pos[1] < boundRect.top && abs(pos[1] - boundRect.top) > 0.1 || pos[1] > boundRect.bottom && abs(pos[1] - boundRect.bottom) > 0.1; + }); + } + + function boundRotate(vec, boundPos, index) { + var r = getDistSize(vec); + var nextPos = Math.sqrt(r * r - boundPos * boundPos) || 0; + return [nextPos, -nextPos].sort(function (a, b) { + return abs(a - vec[index ? 0 : 1]) - abs(b - vec[index ? 0 : 1]); + }).map(function (pos) { + return getRad$1([0, 0], index ? [pos, boundPos] : [boundPos, pos]); + }); + } + + function checkRotateBounds(moveable, prevPoses, nextPoses, origin, rotation) { + if (!moveable.props.bounds) { + return []; + } + + var rad = rotation * Math.PI / 180; + + var _a = getBounds(moveable), + left = _a.left, + top = _a.top, + right = _a.right, + bottom = _a.bottom; + + var relativeLeft = left - origin[0]; + var relativeRight = right - origin[0]; + var relativeTop = top - origin[1]; + var relativeBottom = bottom - origin[1]; + var boundRect = { + left: relativeLeft, + top: relativeTop, + right: relativeRight, + bottom: relativeBottom + }; + + if (!isBoundRotate$1(nextPoses, boundRect, 0)) { + return []; + } + + var result = []; + [[relativeLeft, 0], [relativeRight, 0], [relativeTop, 1], [relativeBottom, 1]].forEach(function (_a) { + var _b = __read(_a, 2), + boundPos = _b[0], + index = _b[1]; + + nextPoses.forEach(function (nextPos) { + var relativeRad1 = getRad$1([0, 0], nextPos); + result.push.apply(result, __spreadArray([], __read(boundRotate(nextPos, boundPos, index).map(function (relativeRad2) { + return rad + relativeRad2 - relativeRad1; + }).filter(function (nextRad) { + return !isBoundRotate$1(prevPoses, boundRect, nextRad); + }).map(function (nextRad) { + return throttle(nextRad * 180 / Math.PI, TINY_NUM); + })), false)); + }); + }); + return result; + } + + var VERTICAL_NAMES = ["left", "right", "center"]; + var HORIZONTAL_NAMES = ["top", "bottom", "middle"]; + var SNAP_SKIP_NAMES_MAP = { + "left": "start", + "right": "end", + "center": "center", + "top": "start", + "bottom": "end", + "middle": "center" + }; + var VERTICAL_NAMES_MAP = { + start: "left", + end: "right", + center: "center" + }; + var HORIZONTAL_NAMES_MAP = { + start: "top", + end: "bottom", + center: "middle" + }; + + function getInitialBounds() { + return { + left: false, + top: false, + right: false, + bottom: false + }; + } + + function hasGuidelines(moveable, ableName) { + var _a = moveable.props, + snappable = _a.snappable, + bounds = _a.bounds, + innerBounds = _a.innerBounds, + verticalGuidelines = _a.verticalGuidelines, + horizontalGuidelines = _a.horizontalGuidelines, + snapGridWidth = _a.snapGridWidth, + snapGridHeight = _a.snapGridHeight, + _b = moveable.state, + guidelines = _b.guidelines, + enableSnap = _b.enableSnap; + + if (!snappable || !enableSnap || ableName && snappable !== true && snappable.indexOf(ableName) < 0) { + return false; + } + + if (snapGridWidth || snapGridHeight || bounds || innerBounds || guidelines && guidelines.length || verticalGuidelines && verticalGuidelines.length || horizontalGuidelines && horizontalGuidelines.length) { + return true; + } + + return false; + } + + function getSnapDirections(snapDirections) { + if (snapDirections === false) { + return {}; + } else if (snapDirections === true || !snapDirections) { + return { + left: true, + right: true, + top: true, + bottom: true + }; + } + + return snapDirections; + } + + function mapSnapDirectionPoses(snapDirections, snapPoses) { + var nextSnapDirections = getSnapDirections(snapDirections); + var nextSnapPoses = {}; + + for (var name_1 in nextSnapDirections) { + if (name_1 in snapPoses && nextSnapDirections[name_1]) { + nextSnapPoses[name_1] = snapPoses[name_1]; + } + } + + return nextSnapPoses; + } + + function splitSnapDirectionPoses(snapDirections, snapPoses) { + var nextSnapPoses = mapSnapDirectionPoses(snapDirections, snapPoses); + var horizontalNames = HORIZONTAL_NAMES.filter(function (name) { + return name in nextSnapPoses; + }); + var verticalNames = VERTICAL_NAMES.filter(function (name) { + return name in nextSnapPoses; + }); + return { + horizontalNames: horizontalNames, + verticalNames: verticalNames, + horizontal: horizontalNames.map(function (name) { + return nextSnapPoses[name]; + }), + vertical: verticalNames.map(function (name) { + return nextSnapPoses[name]; + }) + }; + } + + function calculateContainerPos(rootMatrix, containerRect, n) { + var clientPos = calculatePosition(rootMatrix, [containerRect.clientLeft, containerRect.clientTop], n); + return [containerRect.left + clientPos[0], containerRect.top + clientPos[1]]; + } + + function solveLineConstants(_a) { + var _b = __read(_a, 2), + point1 = _b[0], + point2 = _b[1]; + + var dx = point2[0] - point1[0]; + var dy = point2[1] - point1[1]; + + if (Math.abs(dx) < TINY_NUM$1) { + dx = 0; + } + + if (Math.abs(dy) < TINY_NUM$1) { + dy = 0; + } // b > 0 + // ax + by + c = 0 + + + var a = 0; + var b = 0; + var c = 0; + + if (!dx) { + // -x + 1 = 0 + a = -1; + c = point1[0]; + } else if (!dy) { + // y - 1 = 0 + b = 1; + c = -point1[1]; + } else { + // y = -a(x - x1) + y1 + // ax + y + a * x1 - y1 = 0 + a = -dy / dx; + b = 1; + c = a * point1[0] - point1[1]; + } + + return [a, b, c].map(function (v) { + return throttle(v, TINY_NUM$1); + }); + } + + function checkMoveableSnapPoses(moveable, posesX, posesY, dirXs, dirYs, customSnapThreshold) { + var _a; + + if (dirXs === void 0) { + dirXs = []; + } + + if (dirYs === void 0) { + dirYs = []; + } + + var props = moveable.props; + var snapThresholdMultiples = ((_a = moveable.state.snapThresholdInfo) === null || _a === void 0 ? void 0 : _a.multiples) || [1, 1]; + var snapThreshold = selectValue(customSnapThreshold, props.snapThreshold, 5); + return checkSnapPoses(moveable.state.guidelines, posesX, posesY, dirXs, dirYs, snapThreshold, snapThresholdMultiples); + } + + function checkSnapPoses(guidelines, posesX, posesY, dirXs, dirYs, snapThreshold, multiples) { + return { + vertical: checkSnap(guidelines, "vertical", posesX, snapThreshold * multiples[0], dirXs), + horizontal: checkSnap(guidelines, "horizontal", posesY, snapThreshold * multiples[1], dirYs) + }; + } + + function checkSnapKeepRatio(moveable, startPos, endPos) { + var _a = __read(endPos, 2), + endX = _a[0], + endY = _a[1]; + + var _b = __read(startPos, 2), + startX = _b[0], + startY = _b[1]; + + var _c = __read(minus(endPos, startPos), 2), + dx = _c[0], + dy = _c[1]; + + var isBottom = dy > 0; + var isRight = dx > 0; + dx = getTinyDist(dx); + dy = getTinyDist(dy); + var verticalInfo = { + isSnap: false, + offset: 0, + pos: 0 + }; + var horizontalInfo = { + isSnap: false, + offset: 0, + pos: 0 + }; + + if (dx === 0 && dy === 0) { + return { + vertical: verticalInfo, + horizontal: horizontalInfo + }; + } + + var _d = checkMoveableSnapPoses(moveable, dx ? [endX] : [], dy ? [endY] : []), + verticalSnapInfo = _d.vertical, + horizontalSnapInfo = _d.horizontal; + + verticalSnapInfo.posInfos.filter(function (_a) { + var pos = _a.pos; + return isRight ? pos >= startX : pos <= startX; + }); + horizontalSnapInfo.posInfos.filter(function (_a) { + var pos = _a.pos; + return isBottom ? pos >= startY : pos <= startY; + }); + verticalSnapInfo.isSnap = verticalSnapInfo.posInfos.length > 0; + horizontalSnapInfo.isSnap = horizontalSnapInfo.posInfos.length > 0; + + var _e = getNearestSnapGuidelineInfo(verticalSnapInfo), + isVerticalSnap = _e.isSnap, + verticalGuideline = _e.guideline; + + var _f = getNearestSnapGuidelineInfo(horizontalSnapInfo), + isHorizontalSnap = _f.isSnap, + horizontalGuideline = _f.guideline; + + var horizontalPos = isHorizontalSnap ? horizontalGuideline.pos[1] : 0; + var verticalPos = isVerticalSnap ? verticalGuideline.pos[0] : 0; + + if (dx === 0) { + if (isHorizontalSnap) { + horizontalInfo.isSnap = true; + horizontalInfo.pos = horizontalGuideline.pos[1]; + horizontalInfo.offset = endY - horizontalInfo.pos; + } + } else if (dy === 0) { + if (isVerticalSnap) { + verticalInfo.isSnap = true; + verticalInfo.pos = verticalPos; + verticalInfo.offset = endX - verticalPos; + } + } else { + // y - y1 = a * (x - x1) + var a = dy / dx; + var b = endPos[1] - a * endX; + var y = 0; + var x = 0; + var isSnap = false; + + if (isVerticalSnap) { + x = verticalPos; + y = a * x + b; + isSnap = true; + } else if (isHorizontalSnap) { + y = horizontalPos; + x = (y - b) / a; + isSnap = true; + } + + if (isSnap) { + verticalInfo.isSnap = true; + verticalInfo.pos = x; + verticalInfo.offset = endX - x; + horizontalInfo.isSnap = true; + horizontalInfo.pos = y; + horizontalInfo.offset = endY - y; + } + } + + return { + vertical: verticalInfo, + horizontal: horizontalInfo + }; + } + + function getStringDirection(dir) { + var stringDirection = ""; + + if (dir === -1 || dir === "top" || dir === "left") { + stringDirection = "start"; + } else if (dir === 0 || dir === "center" || dir === "middle") { + stringDirection = "center"; + } else if (dir === 1 || dir === "right" || dir === "bottom") { + stringDirection = "end"; + } + + return stringDirection; + } + + function checkSnaps(moveable, rect, customSnapThreshold) { + var poses = splitSnapDirectionPoses(moveable.props.snapDirections, rect); + var result = checkMoveableSnapPoses(moveable, poses.vertical, poses.horizontal, poses.verticalNames.map(function (name) { + return getStringDirection(name); + }), poses.horizontalNames.map(function (name) { + return getStringDirection(name); + }), customSnapThreshold); + var horizontalDirection = getStringDirection(poses.horizontalNames[result.horizontal.index]); + var verticalDirection = getStringDirection(poses.verticalNames[result.vertical.index]); + return { + vertical: __assign(__assign({}, result.vertical), { + direction: verticalDirection + }), + horizontal: __assign(__assign({}, result.horizontal), { + direction: horizontalDirection + }) + }; + } + + function getNearestSnapGuidelineInfo(snapInfo) { + var isSnap = snapInfo.isSnap; + + if (!isSnap) { + return { + isSnap: false, + offset: 0, + dist: -1, + pos: 0, + guideline: null + }; + } + + var posInfo = snapInfo.posInfos[0]; + var guidelineInfo = posInfo.guidelineInfos[0]; + var offset = guidelineInfo.offset; + var dist = guidelineInfo.dist; + var guideline = guidelineInfo.guideline; + return { + isSnap: isSnap, + offset: offset, + dist: dist, + pos: posInfo.pos, + guideline: guideline + }; + } + + function checkSnap(guidelines, targetType, targetPoses, snapThreshold, dirs) { + var _a, _b; + + if (dirs === void 0) { + dirs = []; + } + + if (!guidelines || !guidelines.length) { + return { + isSnap: false, + index: -1, + direction: "", + posInfos: [] + }; + } + + var isVertical = targetType === "vertical"; + var posType = isVertical ? 0 : 1; + var snapPosInfos = targetPoses.map(function (targetPos, index) { + var direction = dirs[index] || ""; + var guidelineInfos = guidelines.map(function (guideline) { + var pos = guideline.pos; + var offset = targetPos - pos[posType]; + return { + offset: offset, + dist: abs(offset), + guideline: guideline, + direction: direction + }; + }).filter(function (_a) { + var guideline = _a.guideline, + dist = _a.dist; + var type = guideline.type; + + if (type !== targetType || dist > snapThreshold) { + return false; + } + + return true; + }).sort(function (a, b) { + return a.dist - b.dist; + }); + return { + pos: targetPos, + index: index, + guidelineInfos: guidelineInfos, + direction: direction + }; + }).filter(function (snapPosInfo) { + return snapPosInfo.guidelineInfos.length > 0; + }).sort(function (a, b) { + return a.guidelineInfos[0].dist - b.guidelineInfos[0].dist; + }); + var isSnap = snapPosInfos.length > 0; + return { + isSnap: isSnap, + index: isSnap ? snapPosInfos[0].index : -1, + direction: (_b = (_a = snapPosInfos[0]) === null || _a === void 0 ? void 0 : _a.direction) !== null && _b !== void 0 ? _b : "", + posInfos: snapPosInfos + }; + } + + function getSnapInfosByDirection(moveable, // pos1 pos2 pos3 pos4 + poses, snapDirection, snapThreshold) { + if (snapThreshold === void 0) { + snapThreshold = 1; + } + + var dirs = []; + + if (snapDirection[0] && snapDirection[1]) { + dirs = [snapDirection, [-snapDirection[0], snapDirection[1]], [snapDirection[0], -snapDirection[1]]]; + } else if (!snapDirection[0] && !snapDirection[1]) { + [[-1, -1], [1, -1], [1, 1], [-1, 1]].forEach(function (dir, i, arr) { + var nextDir = arr[i + 1] || arr[0]; + dirs.push(dir); + dirs.push([(dir[0] + nextDir[0]) / 2, (dir[1] + nextDir[1]) / 2]); + }); + } else { + if (moveable.props.keepRatio) { + dirs.push([-1, -1], [-1, 1], [1, -1], [1, 1], snapDirection); + } else { + dirs.push.apply(dirs, __spreadArray([], __read(getPosesByDirection([[-1, -1], [1, -1], [-1, -1], [1, 1]], snapDirection)), false)); + + if (dirs.length > 1) { + dirs.push([(dirs[0][0] + dirs[1][0]) / 2, (dirs[0][1] + dirs[1][1]) / 2]); + } + } + } + + var nextPoses = dirs.map(function (dir) { + return getPosByDirection(poses, dir); + }); + var xs = nextPoses.map(function (pos) { + return pos[0]; + }); + var ys = nextPoses.map(function (pos) { + return pos[1]; + }); + var result = checkMoveableSnapPoses(moveable, xs, ys, dirs.map(function (dir) { + return getStringDirection(dir[0]); + }), dirs.map(function (dir) { + return getStringDirection(dir[1]); + }), snapThreshold); + var verticalDirection = getStringDirection(dirs.map(function (dir) { + return dir[0]; + })[result.vertical.index]); + var horizontalDirection = getStringDirection(dirs.map(function (dir) { + return dir[1]; + })[result.horizontal.index]); + return { + vertical: __assign(__assign({}, result.vertical), { + direction: verticalDirection + }), + horizontal: __assign(__assign({}, result.horizontal), { + direction: horizontalDirection + }) + }; + } + + function checkSnapBoundPriority(a, b) { + var aDist = abs(a.offset); + var bDist = abs(b.offset); + + if (a.isBound && b.isBound) { + return bDist - aDist; + } else if (a.isBound) { + return -1; + } else if (b.isBound) { + return 1; + } else if (a.isSnap && b.isSnap) { + return bDist - aDist; + } else if (a.isSnap) { + return -1; + } else if (b.isSnap) { + return 1; + } else if (aDist < TINY_NUM) { + return 1; + } else if (bDist < TINY_NUM) { + return -1; + } + + return aDist - bDist; + } + + function getNearOffsetInfo(offsets, index) { + return offsets.slice().sort(function (a, b) { + var aSign = a.sign[index]; + var bSign = b.sign[index]; + var aOffset = a.offset[index]; + var bOffset = b.offset[index]; // -1 The positions of a and b do not change. + // 1 The positions of a and b are reversed. + + if (!aSign) { + return 1; + } else if (!bSign) { + return -1; + } + + return checkSnapBoundPriority({ + isBound: a.isBound, + isSnap: a.isSnap, + offset: aOffset + }, { + isBound: b.isBound, + isSnap: b.isSnap, + offset: bOffset + }); + })[0]; + } + + function getCheckSnapDirections(direction, fixedDirection, keepRatio) { + var directions = []; // const fixedDirection = [-direction[0], -direction[1]]; + + if (keepRatio) { + if (abs(fixedDirection[0]) !== 1 || abs(fixedDirection[1]) !== 1) { + directions.push([fixedDirection, [-1, -1]], [fixedDirection, [-1, 1]], [fixedDirection, [1, -1]], [fixedDirection, [1, 1]]); + } else { + directions.push([fixedDirection, [direction[0], -direction[1]]], [fixedDirection, [-direction[0], direction[1]]]); + } + + directions.push([fixedDirection, direction]); + } else { + if (direction[0] && direction[1] || !direction[0] && !direction[1]) { + var endDirection_1 = direction[0] ? direction : [1, 1]; + [1, -1].forEach(function (signX) { + [1, -1].forEach(function (signY) { + var nextDirection = [signX * endDirection_1[0], signY * endDirection_1[1]]; + + if (fixedDirection[0] === nextDirection[0] && fixedDirection[1] === nextDirection[1]) { + return; + } + + directions.push([fixedDirection, nextDirection]); + }); + }); + } else if (direction[0]) { + var signs = abs(fixedDirection[0]) === 1 ? [1] : [1, -1]; + signs.forEach(function (sign) { + directions.push([[fixedDirection[0], -1], [sign * direction[0], -1]], [[fixedDirection[0], 0], [sign * direction[0], 0]], [[fixedDirection[0], 1], [sign * direction[0], 1]]); + }); + } else if (direction[1]) { + var signs = abs(fixedDirection[1]) === 1 ? [1] : [1, -1]; + signs.forEach(function (sign) { + directions.push([[-1, fixedDirection[1]], [-1, sign * direction[1]]], [[0, fixedDirection[1]], [0, sign * direction[1]]], [[1, fixedDirection[1]], [1, sign * direction[1]]]); + }); + } + } + + return directions; + } + + function isStartLine(dot, line) { + // l o => true + // o l => false + var cx = average([line[0][0], line[1][0]]); + var cy = average([line[0][1], line[1][1]]); + return { + vertical: cx <= dot[0], + horizontal: cy <= dot[1] + }; + } + + function hitTestLine(dot, _a) { + var _b = __read(_a, 2), + pos1 = _b[0], + pos2 = _b[1]; + + var dx = pos2[0] - pos1[0]; + var dy = pos2[1] - pos1[1]; + + if (abs(dx) < TINY_NUM) { + dx = 0; + } + + if (abs(dy) < TINY_NUM) { + dy = 0; + } + + var test1; + var test2; + + if (!dx) { + test1 = pos1[0]; + test2 = dot[0]; + } else if (!dy) { + test1 = pos1[1]; + test2 = dot[1]; + } else { + var a = dy / dx; // y = a * (x - pos1) + pos1 + + test1 = a * (dot[0] - pos1[0]) + pos1[1]; + test2 = dot[1]; + } + + return test1 - test2; + } + + function isSameStartLine(dots, line, centerSign, error) { + if (error === void 0) { + error = TINY_NUM; + } + + return dots.every(function (dot) { + var value = hitTestLine(dot, line); + var sign = value <= 0; + return sign === centerSign || abs(value) <= error; + }); + } + + function checkInnerBoundDot(pos, start, end, isStart, threshold) { + if (threshold === void 0) { + threshold = 0; + } + + if (isStart && start - threshold <= pos || !isStart && pos <= end + threshold) { + // false 402 565 602 => 37 ([0, 37]) + // true 400 524.9712603540036 600 => 124 ([124, 0]) + // true 400 410 600 => 10 ([10, 0]) + return { + isBound: true, + offset: isStart ? start - pos : end - pos + }; + } + + return { + isBound: false, + offset: 0 + }; + } + + function checkInnerBound(moveable, _a) { + var line = _a.line, + centerSign = _a.centerSign, + verticalSign = _a.verticalSign, + horizontalSign = _a.horizontalSign, + lineConstants = _a.lineConstants; + var bounds = moveable.props.innerBounds; + + if (!bounds) { + return { + isAllBound: false, + isBound: false, + isVerticalBound: false, + isHorizontalBound: false, + offset: [0, 0] + }; + } + + var left = bounds.left, + top = bounds.top, + width = bounds.width, + height = bounds.height; + var leftLine = [[left, top], [left, top + height]]; + var topLine = [[left, top], [left + width, top]]; + var rightLine = [[left + width, top], [left + width, top + height]]; + var bottomLine = [[left, top + height], [left + width, top + height]]; + + if (isSameStartLine([[left, top], [left + width, top], [left, top + height], [left + width, top + height]], line, centerSign)) { + return { + isAllBound: false, + isBound: false, + isVerticalBound: false, + isHorizontalBound: false, + offset: [0, 0] + }; + } // test vertical + + + var topBoundInfo = checkLineBoundCollision(line, lineConstants, topLine, verticalSign); + var bottomBoundInfo = checkLineBoundCollision(line, lineConstants, bottomLine, verticalSign); // test horizontal + + var leftBoundInfo = checkLineBoundCollision(line, lineConstants, leftLine, horizontalSign); + var rightBoundInfo = checkLineBoundCollision(line, lineConstants, rightLine, horizontalSign); + var isAllVerticalBound = topBoundInfo.isBound && bottomBoundInfo.isBound; + var isVerticalBound = topBoundInfo.isBound || bottomBoundInfo.isBound; + var isAllHorizontalBound = leftBoundInfo.isBound && rightBoundInfo.isBound; + var isHorizontalBound = leftBoundInfo.isBound || rightBoundInfo.isBound; + var verticalOffset = maxOffset(topBoundInfo.offset, bottomBoundInfo.offset); + var horizontalOffset = maxOffset(leftBoundInfo.offset, rightBoundInfo.offset); + var offset = [0, 0]; + var isBound = false; + var isAllBound = false; + + if (abs(horizontalOffset) < abs(verticalOffset)) { + offset = [verticalOffset, 0]; + isBound = isVerticalBound; + isAllBound = isAllVerticalBound; + } else { + offset = [0, horizontalOffset]; + isBound = isHorizontalBound; + isAllBound = isAllHorizontalBound; + } + + return { + isAllBound: isAllBound, + isVerticalBound: isVerticalBound, + isHorizontalBound: isHorizontalBound, + isBound: isBound, + offset: offset + }; + } + + function checkLineBoundCollision(line, _a, boundLine, isStart, threshold, isRender) { + var _b = __read(_a, 2), + a = _b[0], + b = _b[1]; + + var dot1 = line[0]; // const dot2 = line[1]; + + var boundDot1 = boundLine[0]; + var boundDot2 = boundLine[1]; // const dy1 = getTinyDist(dot2[1] - dot1[1]); + // const dx1 = getTinyDist(dot2[0] - dot1[0]); + + var dy2 = getTinyDist(boundDot2[1] - boundDot1[1]); + var dx2 = getTinyDist(boundDot2[0] - boundDot1[0]); + var hasDx = b; + var hasDy = a; + var slope = -a / b; // lineConstants + // ax + by + c = 0 + // dx2 or dy2 is zero + + if (!dx2) { + // vertical + // by + c = 0 + if (isRender && !hasDy) { + // 90deg + return { + isBound: false, + offset: 0 + }; + } else if (hasDx) { + // ax + by + c = 0 + // const y = dy1 ? dy1 / dx1 * (boundDot1[0] - dot1[0]) + dot1[1] : dot1[1]; + var y = slope * (boundDot1[0] - dot1[0]) + dot1[1]; // boundDot1[1] <= y <= boundDot2[1] + + return checkInnerBoundDot(y, boundDot1[1], boundDot2[1], isStart, threshold); + } else { + // ax + c = 0 + var offset = boundDot1[0] - dot1[0]; + var isBound = abs(offset) <= (threshold || 0); + return { + isBound: isBound, + offset: isBound ? offset : 0 + }; + } + } else if (!dy2) { + // horizontal + if (isRender && !hasDx) { + // 90deg + return { + isBound: false, + offset: 0 + }; + } else if (hasDy) { + // y = a * (x - x1) + y1 + // x = (y - y1) / a + x1 + // const a = dy1 / dx1; + // const x = dx1 ? (boundDot1[1] - dot1[1]) / a + dot1[0] : dot1[0]; + var x = (boundDot1[1] - dot1[1]) / slope + dot1[0]; // boundDot1[0] <= x && x <= boundDot2[0] + + return checkInnerBoundDot(x, boundDot1[0], boundDot2[0], isStart, threshold); + } else { + var offset = boundDot1[1] - dot1[1]; + var isBound = abs(offset) <= (threshold || 0); + return { + isBound: isBound, + offset: isBound ? offset : 0 + }; + } + } + + return { + isBound: false, + offset: 0 + }; + } + + function getInnerBoundInfo(moveable, lineInfos, datas) { + return lineInfos.map(function (info) { + var _a = checkInnerBound(moveable, info), + isBound = _a.isBound, + offset = _a.offset, + isVerticalBound = _a.isVerticalBound, + isHorizontalBound = _a.isHorizontalBound; + + var multiple = info.multiple; + var sizeOffset = getDragDist({ + datas: datas, + distX: offset[0], + distY: offset[1] + }).map(function (size, i) { + return size * (multiple[i] ? 2 / multiple[i] : 0); + }); + return { + sign: multiple, + isBound: isBound, + isVerticalBound: isVerticalBound, + isHorizontalBound: isHorizontalBound, + isSnap: false, + offset: sizeOffset + }; + }); + } + + function getInnerBoundDragInfo(moveable, poses, datas) { + var _a; + + var lines = getCheckInnerBoundLineInfos(moveable, poses, [0, 0], false).map(function (info) { + return __assign(__assign({}, info), { + multiple: info.multiple.map(function (dir) { + return abs(dir) * 2; + }) + }); + }); + var innerBoundInfo = getInnerBoundInfo(moveable, lines, datas); + var widthOffsetInfo = getNearOffsetInfo(innerBoundInfo, 0); + var heightOffsetInfo = getNearOffsetInfo(innerBoundInfo, 1); + var verticalOffset = 0; + var horizontalOffset = 0; + var isVerticalBound = widthOffsetInfo.isVerticalBound || heightOffsetInfo.isVerticalBound; + var isHorizontalBound = widthOffsetInfo.isHorizontalBound || heightOffsetInfo.isHorizontalBound; + + if (isVerticalBound || isHorizontalBound) { + _a = __read(getInverseDragDist({ + datas: datas, + distX: -widthOffsetInfo.offset[0], + distY: -heightOffsetInfo.offset[1] + }), 2), verticalOffset = _a[0], horizontalOffset = _a[1]; + } + + return { + vertical: { + isBound: isVerticalBound, + offset: verticalOffset + }, + horizontal: { + isBound: isHorizontalBound, + offset: horizontalOffset + } + }; + } + + function getCheckSnapLineDirections(direction, keepRatio) { + var lineDirections = []; + var x = direction[0]; + var y = direction[1]; + + if (x && y) { + lineDirections.push([[0, y * 2], direction, [-x, y]], [[x * 2, 0], direction, [x, -y]]); + } else if (x) { + // vertcal + lineDirections.push([[x * 2, 0], [x, 1], [x, -1]]); + + if (keepRatio) { + lineDirections.push([[0, -1], [x, -1], [-x, -1]], [[0, 1], [x, 1], [-x, 1]]); + } + } else if (y) { + // horizontal + lineDirections.push([[0, y * 2], [1, y], [-1, y]]); + + if (keepRatio) { + lineDirections.push([[-1, 0], [-1, y], [-1, -y]], [[1, 0], [1, y], [1, -y]]); + } + } else { + // [0, 0] to all direction + lineDirections.push([[-1, 0], [-1, -1], [-1, 1]], [[1, 0], [1, -1], [1, 1]], [[0, -1], [-1, -1], [1, -1]], [[0, 1], [-1, 1], [1, 1]]); + } + + return lineDirections; + } + + function getCheckInnerBoundLineInfos(moveable, poses, direction, keepRatio) { + var _a = moveable.state, + allMatrix = _a.allMatrix, + is3d = _a.is3d; + var virtualPoses = calculatePoses(allMatrix, 100, 100, is3d ? 4 : 3); + var center = getPosByDirection(virtualPoses, [0, 0]); + return getCheckSnapLineDirections(direction, keepRatio).map(function (_a) { + var _b = __read(_a, 3), + multiple = _b[0], + dir1 = _b[1], + dir2 = _b[2]; + + var virtualLine = [getPosByDirection(virtualPoses, dir1), getPosByDirection(virtualPoses, dir2)]; + var lineConstants = solveLineConstants(virtualLine); + + var _c = isStartLine(center, virtualLine), + verticalSign = _c.vertical, + horizontalSign = _c.horizontal; + + var centerSign = hitTestLine(center, virtualLine) <= 0; + return { + multiple: multiple, + centerSign: centerSign, + verticalSign: verticalSign, + horizontalSign: horizontalSign, + lineConstants: lineConstants, + line: [getPosByDirection(poses, dir1), getPosByDirection(poses, dir2)] + }; + }); + } + + function isBoundRotate(relativePoses, boundDots, center, rad) { + var nextPoses = rad ? relativePoses.map(function (pos) { + return rotate(pos, rad); + }) : relativePoses; + return [[nextPoses[0], nextPoses[1]], [nextPoses[1], nextPoses[3]], [nextPoses[3], nextPoses[2]], [nextPoses[2], nextPoses[0]]].some(function (line) { + var centerSign = hitTestLine(center, line) <= 0; + return !isSameStartLine(boundDots, line, centerSign); + }); + } + + function getDistPointLine(_a) { + // x = 0, y = 0 + // d = (ax + by + c) / root(a2 + b2) + var _b = __read(_a, 2), + pos1 = _b[0], + pos2 = _b[1]; + + var dx = pos2[0] - pos1[0]; + var dy = pos2[1] - pos1[1]; + + if (!dx) { + return abs(pos1[0]); + } + + if (!dy) { + return abs(pos1[1]); + } // y - y1 = a(x - x1) + // 0 = ax -y + -a * x1 + y1 + + + var a = dy / dx; + return abs((-a * pos1[0] + pos1[1]) / Math.sqrt(Math.pow(a, 2) + 1)); + } + + function solveReverseLine(_a) { + var _b = __read(_a, 2), + pos1 = _b[0], + pos2 = _b[1]; + + var dx = pos2[0] - pos1[0]; + var dy = pos2[1] - pos1[1]; + + if (!dx) { + return [pos1[0], 0]; + } + + if (!dy) { + return [0, pos1[1]]; + } + + var a = dy / dx; // y - y1 = a (x - x1) + // y = ax - a * x1 + y1 + + var b = -a * pos1[0] + pos1[1]; // y = ax + b = -1/a x + // x = -b / (a + 1 / a) + // y = b / (1 + 1 / a^2) + + return [-b / (a + 1 / a), b / (a * a + 1)]; + } + + function checkRotateInnerBounds(moveable, prevPoses, nextPoses, origin, rotation) { + var bounds = moveable.props.innerBounds; + var rad = rotation * Math.PI / 180; + + if (!bounds) { + return []; + } + + var left = bounds.left, + top = bounds.top, + width = bounds.width, + height = bounds.height; + var relativeLeft = left - origin[0]; + var relativeRight = left + width - origin[0]; + var relativeTop = top - origin[1]; + var relativeBottom = top + height - origin[1]; + var dots = [[relativeLeft, relativeTop], [relativeRight, relativeTop], [relativeLeft, relativeBottom], [relativeRight, relativeBottom]]; + var center = getPosByDirection(nextPoses, [0, 0]); + + if (!isBoundRotate(nextPoses, dots, center, 0)) { + return []; + } + + var result = []; + var dotInfos = dots.map(function (dot) { + return [getDistSize(dot), getRad$1([0, 0], dot)]; + }); + [[nextPoses[0], nextPoses[1]], [nextPoses[1], nextPoses[3]], [nextPoses[3], nextPoses[2]], [nextPoses[2], nextPoses[0]]].forEach(function (line) { + var lineRad = getRad$1([0, 0], solveReverseLine(line)); + var lineDist = getDistPointLine(line); + result.push.apply(result, __spreadArray([], __read(dotInfos.filter(function (_a) { + var _b = __read(_a, 1), + dotDist = _b[0]; + + return dotDist && lineDist <= dotDist; + }).map(function (_a) { + var _b = __read(_a, 2), + dotDist = _b[0], + dotRad = _b[1]; + + var distRad = Math.acos(dotDist ? lineDist / dotDist : 0); + var nextRad1 = dotRad + distRad; + var nextRad2 = dotRad - distRad; + return [rad + nextRad1 - lineRad, rad + nextRad2 - lineRad]; + }).reduce(function (prev, cur) { + prev.push.apply(prev, __spreadArray([], __read(cur), false)); + return prev; + }, []).filter(function (nextRad) { + return !isBoundRotate(prevPoses, dots, center, nextRad); + }).map(function (nextRad) { + return throttle(nextRad * 180 / Math.PI, TINY_NUM); + })), false)); + }); + return result; + } + + function checkInnerBoundPoses(moveable) { + var innerBounds = moveable.props.innerBounds; + var boundMap = getInitialBounds(); + + if (!innerBounds) { + return { + boundMap: boundMap, + vertical: [], + horizontal: [] + }; + } + + var _a = moveable.getRect(), + pos1 = _a.pos1, + pos2 = _a.pos2, + pos3 = _a.pos3, + pos4 = _a.pos4; + + var poses = [pos1, pos2, pos3, pos4]; + var center = getPosByDirection(poses, [0, 0]); + var left = innerBounds.left, + top = innerBounds.top, + width = innerBounds.width, + height = innerBounds.height; + var leftLine = [[left, top], [left, top + height]]; + var topLine = [[left, top], [left + width, top]]; + var rightLine = [[left + width, top], [left + width, top + height]]; + var bottomLine = [[left, top + height], [left + width, top + height]]; + var lineInfos = getCheckInnerBoundLineInfos(moveable, poses, [0, 0], false); + var horizontalPoses = []; + var verticalPoses = []; + lineInfos.forEach(function (lineInfo) { + var line = lineInfo.line, + lineConstants = lineInfo.lineConstants; + + var _a = isStartLine(center, line), + isHorizontalStart = _a.horizontal, + isVerticalStart = _a.vertical; // test vertical + + + var topBoundInfo = checkLineBoundCollision(line, lineConstants, topLine, isVerticalStart, 1, true); + var bottomBoundInfo = checkLineBoundCollision(line, lineConstants, bottomLine, isVerticalStart, 1, true); // test horizontal + + var leftBoundInfo = checkLineBoundCollision(line, lineConstants, leftLine, isHorizontalStart, 1, true); + var rightBoundInfo = checkLineBoundCollision(line, lineConstants, rightLine, isHorizontalStart, 1, true); + + if (topBoundInfo.isBound && !boundMap.top) { + horizontalPoses.push(top); + boundMap.top = true; + } + + if (bottomBoundInfo.isBound && !boundMap.bottom) { + horizontalPoses.push(top + height); + boundMap.bottom = true; + } + + if (leftBoundInfo.isBound && !boundMap.left) { + verticalPoses.push(left); + boundMap.left = true; + } + + if (rightBoundInfo.isBound && !boundMap.right) { + verticalPoses.push(left + width); + boundMap.right = true; + } + }); + return { + boundMap: boundMap, + horizontal: horizontalPoses, + vertical: verticalPoses + }; + } + + function solveEquation(pos1, pos2, snapOffset, isVertical) { + var dx = pos2[0] - pos1[0]; + var dy = pos2[1] - pos1[1]; + + if (abs(dx) < TINY_NUM$1) { + dx = 0; + } + + if (abs(dy) < TINY_NUM$1) { + dy = 0; + } + + if (!dx) { + // y = 0 * x + b + // only horizontal + if (!isVertical) { + return [0, snapOffset]; + } + + return [0, 0]; + } + + if (!dy) { + // only vertical + if (isVertical) { + return [snapOffset, 0]; + } + + return [0, 0]; + } // y = ax + b + + + var a = dy / dx; + var b = pos1[1] - a * pos1[0]; + + if (isVertical) { + // y = a * x + b + var y = a * (pos2[0] + snapOffset) + b; + return [snapOffset, y - pos2[1]]; + } else { + // x = (y - b) / a + var x = (pos2[1] + snapOffset - b) / a; + return [x - pos2[0], snapOffset]; + } + } + + function solveNextOffset(pos1, pos2, offset, isVertical, datas) { + var sizeOffset = solveEquation(pos1, pos2, offset, isVertical); + + if (!sizeOffset) { + return { + isOutside: false, + offset: [0, 0] + }; + } + + var size = getDist$2(pos1, pos2); + var dist1 = getDist$2(sizeOffset, pos1); + var dist2 = getDist$2(sizeOffset, pos2); + var isOutside = dist1 > size || dist2 > size; + + var _a = __read(getDragDist({ + datas: datas, + distX: sizeOffset[0], + distY: sizeOffset[1] + }), 2), + widthOffset = _a[0], + heightOffset = _a[1]; + + return { + offset: [widthOffset, heightOffset], + isOutside: isOutside + }; + } + + function getSnapBound(boundInfo, snapInfo) { + if (boundInfo.isBound) { + return boundInfo.offset; + } else if (snapInfo.isSnap) { + return getNearestSnapGuidelineInfo(snapInfo).offset; + } + + return 0; + } + + function checkThrottleDragRotate(throttleDragRotate, _a, _b, _c, _d) { + var _e = __read(_a, 2), + distX = _e[0], + distY = _e[1]; + + var _f = __read(_b, 2), + isVerticalBound = _f[0], + isHorizontalBound = _f[1]; + + var _g = __read(_c, 2), + isVerticalSnap = _g[0], + isHorizontalSnap = _g[1]; + + var _h = __read(_d, 2), + verticalOffset = _h[0], + horizontalOffset = _h[1]; + + var offsetX = -verticalOffset; + var offsetY = -horizontalOffset; + + if (throttleDragRotate && distX && distY) { + offsetX = 0; + offsetY = 0; + var adjustPoses = []; + + if (isVerticalBound && isHorizontalBound) { + adjustPoses.push([0, horizontalOffset], [verticalOffset, 0]); + } else if (isVerticalBound) { + adjustPoses.push([verticalOffset, 0]); + } else if (isHorizontalBound) { + adjustPoses.push([0, horizontalOffset]); + } else if (isVerticalSnap && isHorizontalSnap) { + adjustPoses.push([0, horizontalOffset], [verticalOffset, 0]); + } else if (isVerticalSnap) { + adjustPoses.push([verticalOffset, 0]); + } else if (isHorizontalSnap) { + adjustPoses.push([0, horizontalOffset]); + } + + if (adjustPoses.length) { + adjustPoses.sort(function (a, b) { + return getDistSize(minus([distX, distY], a)) - getDistSize(minus([distX, distY], b)); + }); + var adjustPos = adjustPoses[0]; + + if (adjustPos[0] && abs(distX) > TINY_NUM$1) { + offsetX = -adjustPos[0]; + offsetY = distY * abs(distX + offsetX) / abs(distX) - distY; + } else if (adjustPos[1] && abs(distY) > TINY_NUM$1) { + var prevDistY = distY; + offsetY = -adjustPos[1]; + offsetX = distX * abs(distY + offsetY) / abs(prevDistY) - distX; + } + + if (throttleDragRotate && isHorizontalBound && isVerticalBound) { + if (abs(offsetX) > TINY_NUM$1 && abs(offsetX) < abs(verticalOffset)) { + var scale = abs(verticalOffset) / abs(offsetX); + offsetX *= scale; + offsetY *= scale; + } else if (abs(offsetY) > TINY_NUM$1 && abs(offsetY) < abs(horizontalOffset)) { + var scale = abs(horizontalOffset) / abs(offsetY); + offsetX *= scale; + offsetY *= scale; + } else { + offsetX = maxOffset(-verticalOffset, offsetX); + offsetY = maxOffset(-horizontalOffset, offsetY); + } + } + } + } else { + offsetX = distX || isVerticalBound ? -verticalOffset : 0; + offsetY = distY || isHorizontalBound ? -horizontalOffset : 0; + } + + return [offsetX, offsetY]; + } + + function checkSnapBoundsDrag(moveable, distX, distY, throttleDragRotate, ignoreSnap, datas) { + if (!hasGuidelines(moveable, "draggable")) { + return [{ + isSnap: false, + isBound: false, + offset: 0 + }, { + isSnap: false, + isBound: false, + offset: 0 + }]; + } + + var poses = getAbsolutePoses(datas.absolutePoses, [distX, distY]); + + var _a = getRect(poses), + left = _a.left, + right = _a.right, + top = _a.top, + bottom = _a.bottom; + + var boundPoses = { + horizontal: poses.map(function (pos) { + return pos[1]; + }), + vertical: poses.map(function (pos) { + return pos[0]; + }) + }; + var snapDirections = getSnapDirections(moveable.props.snapDirections); + var snapPoses = splitSnapDirectionPoses(snapDirections, { + left: left, + right: right, + top: top, + bottom: bottom, + center: (left + right) / 2, + middle: (top + bottom) / 2 + }); + + var _b = checkMoveableSnapBounds(moveable, ignoreSnap, snapPoses, boundPoses), + verticalSnapBoundInfo = _b.vertical, + horizontalSnapBoundInfo = _b.horizontal; + + var _c = getInnerBoundDragInfo(moveable, poses, datas), + verticalInnerBoundInfo = _c.vertical, + horizontalInnerBoundInfo = _c.horizontal; + + var isVerticalSnap = verticalSnapBoundInfo.isSnap; + var isHorizontalSnap = horizontalSnapBoundInfo.isSnap; + var isVerticalBound = verticalSnapBoundInfo.isBound || verticalInnerBoundInfo.isBound; + var isHorizontalBound = horizontalSnapBoundInfo.isBound || horizontalInnerBoundInfo.isBound; + var verticalOffset = maxOffset(verticalSnapBoundInfo.offset, verticalInnerBoundInfo.offset); + var horizontalOffset = maxOffset(horizontalSnapBoundInfo.offset, horizontalInnerBoundInfo.offset); + + var _d = __read(checkThrottleDragRotate(throttleDragRotate, [distX, distY], [isVerticalBound, isHorizontalBound], [isVerticalSnap, isHorizontalSnap], [verticalOffset, horizontalOffset]), 2), + offsetX = _d[0], + offsetY = _d[1]; + + return [{ + isBound: isVerticalBound, + isSnap: isVerticalSnap, + offset: offsetX + }, { + isBound: isHorizontalBound, + isSnap: isHorizontalSnap, + offset: offsetY + }]; + } + + function checkMoveableSnapBounds(moveable, ignoreSnap, poses, boundPoses) { + if (boundPoses === void 0) { + boundPoses = poses; + } + + var _a = checkBoundPoses(getBounds(moveable), boundPoses.vertical, boundPoses.horizontal), + horizontalBoundInfos = _a.horizontal, + verticalBoundInfos = _a.vertical; + + var _b = ignoreSnap ? { + horizontal: { + isSnap: false, + index: -1 + }, + vertical: { + isSnap: false, + index: -1 + } + } : checkMoveableSnapPoses(moveable, poses.vertical, poses.horizontal), + horizontalSnapInfo = _b.horizontal, + verticalSnapInfo = _b.vertical; + + var horizontalOffset = getSnapBound(horizontalBoundInfos[0], horizontalSnapInfo); + var verticalOffset = getSnapBound(verticalBoundInfos[0], verticalSnapInfo); + var horizontalDist = abs(horizontalOffset); + var verticalDist = abs(verticalOffset); + return { + horizontal: { + isBound: horizontalBoundInfos[0].isBound, + isSnap: horizontalSnapInfo.isSnap, + snapIndex: horizontalSnapInfo.index, + offset: horizontalOffset, + dist: horizontalDist, + bounds: horizontalBoundInfos, + snap: horizontalSnapInfo + }, + vertical: { + isBound: verticalBoundInfos[0].isBound, + isSnap: verticalSnapInfo.isSnap, + snapIndex: verticalSnapInfo.index, + offset: verticalOffset, + dist: verticalDist, + bounds: verticalBoundInfos, + snap: verticalSnapInfo + } + }; + } + + function checkSnapBounds(guideines, bounds, posesX, posesY, snapThreshold, multiples) { + if (multiples === void 0) { + multiples = [1, 1]; + } + + var _a = checkBoundPoses(bounds, posesX, posesY), + horizontalBoundInfos = _a.horizontal, + verticalBoundInfos = _a.vertical; // options.isRequest ? { + // horizontal: { isSnap: false, index: -1 } as SnapInfo, + // vertical: { isSnap: false, index: -1 } as SnapInfo, + // } : + + + var _b = checkSnapPoses(guideines, posesX, posesY, [], [], snapThreshold, multiples), + horizontalSnapInfo = _b.horizontal, + verticalSnapInfo = _b.vertical; + + var horizontalOffset = getSnapBound(horizontalBoundInfos[0], horizontalSnapInfo); + var verticalOffset = getSnapBound(verticalBoundInfos[0], verticalSnapInfo); + var horizontalDist = abs(horizontalOffset); + var verticalDist = abs(verticalOffset); + return { + horizontal: { + isBound: horizontalBoundInfos[0].isBound, + isSnap: horizontalSnapInfo.isSnap, + snapIndex: horizontalSnapInfo.index, + offset: horizontalOffset, + dist: horizontalDist, + bounds: horizontalBoundInfos, + snap: horizontalSnapInfo + }, + vertical: { + isBound: verticalBoundInfos[0].isBound, + isSnap: verticalSnapInfo.isSnap, + snapIndex: verticalSnapInfo.index, + offset: verticalOffset, + dist: verticalDist, + bounds: verticalBoundInfos, + snap: verticalSnapInfo + } + }; + } + + function checkSnapRightLine(startPos, endPos, snapBoundInfo, keepRatio) { + var rad = getRad$1(startPos, endPos) / Math.PI * 180; + var _a = snapBoundInfo.vertical, + isVerticalBound = _a.isBound, + isVerticalSnap = _a.isSnap, + verticalDist = _a.dist, + _b = snapBoundInfo.horizontal, + isHorizontalBound = _b.isBound, + isHorizontalSnap = _b.isSnap, + horizontalDist = _b.dist; + var rad180 = rad % 180; + var isHorizontalLine = rad180 < 3 || rad180 > 177; + var isVerticalLine = rad180 > 87 && rad180 < 93; + + if (horizontalDist < verticalDist) { + if (isVerticalBound || isVerticalSnap && !isVerticalLine && (!keepRatio || !isHorizontalLine)) { + return "vertical"; + } + } + + if (isHorizontalBound || isHorizontalSnap && !isHorizontalLine && (!keepRatio || !isVerticalLine)) { + return "horizontal"; + } + + return ""; + } + + function getSnapBoundInfo(moveable, poses, directions, keepRatio, isRequest, datas) { + return directions.map(function (_a) { + var _b = __read(_a, 2), + startDirection = _b[0], + endDirection = _b[1]; + + var otherStartPos = getPosByDirection(poses, startDirection); + var otherEndPos = getPosByDirection(poses, endDirection); + var snapBoundInfo = keepRatio ? checkSnapBoundsKeepRatio(moveable, otherStartPos, otherEndPos, isRequest) : checkMoveableSnapBounds(moveable, isRequest, { + vertical: [otherEndPos[0]], + horizontal: [otherEndPos[1]] + }); + var _c = snapBoundInfo.horizontal, + // dist: otherHorizontalDist, + otherHorizontalOffset = _c.offset, + isOtherHorizontalBound = _c.isBound, + isOtherHorizontalSnap = _c.isSnap, + _d = snapBoundInfo.vertical, + // dist: otherVerticalDist, + otherVerticalOffset = _d.offset, + isOtherVerticalBound = _d.isBound, + isOtherVerticalSnap = _d.isSnap; + var multiple = minus(endDirection, startDirection); + + if (!otherVerticalOffset && !otherHorizontalOffset) { + return { + isBound: isOtherVerticalBound || isOtherHorizontalBound, + isSnap: isOtherVerticalSnap || isOtherHorizontalSnap, + sign: multiple, + offset: [0, 0] + }; + } + + var snapLine = checkSnapRightLine(otherStartPos, otherEndPos, snapBoundInfo, keepRatio); + + if (!snapLine) { + return { + sign: multiple, + isBound: false, + isSnap: false, + offset: [0, 0] + }; + } + + var isVertical = snapLine === "vertical"; + var sizeOffset = [0, 0]; + + if (!keepRatio && abs(endDirection[0]) === 1 && abs(endDirection[1]) === 1 && startDirection[0] !== endDirection[0] && startDirection[1] !== endDirection[1]) { + sizeOffset = getDragDist({ + datas: datas, + distX: -otherVerticalOffset, + distY: -otherHorizontalOffset + }); + } else { + sizeOffset = solveNextOffset(otherStartPos, otherEndPos, -(isVertical ? otherVerticalOffset : otherHorizontalOffset), isVertical, datas).offset; + } + + sizeOffset = sizeOffset.map(function (size, i) { + return size * (multiple[i] ? 2 / multiple[i] : 0); + }); + return { + sign: multiple, + isBound: isVertical ? isOtherVerticalBound : isOtherHorizontalBound, + isSnap: isVertical ? isOtherVerticalSnap : isOtherHorizontalSnap, + offset: sizeOffset + }; + }); + } + + function getSnapBoundOffset(boundInfo, snapInfo) { + if (boundInfo.isBound) { + return boundInfo.offset; + } else if (snapInfo.isSnap) { + return snapInfo.offset; + } + + return 0; + } + + function checkSnapBoundsKeepRatio(moveable, startPos, endPos, isRequest) { + var _a = checkBoundKeepRatio(moveable, startPos, endPos), + horizontalBoundInfo = _a.horizontal, + verticalBoundInfo = _a.vertical; + + var _b = isRequest ? { + horizontal: { + isSnap: false + }, + vertical: { + isSnap: false + } + } : checkSnapKeepRatio(moveable, startPos, endPos), + horizontalSnapInfo = _b.horizontal, + verticalSnapInfo = _b.vertical; + + var horizontalOffset = getSnapBoundOffset(horizontalBoundInfo, horizontalSnapInfo); + var verticalOffset = getSnapBoundOffset(verticalBoundInfo, verticalSnapInfo); + var horizontalDist = abs(horizontalOffset); + var verticalDist = abs(verticalOffset); + return { + horizontal: { + isBound: horizontalBoundInfo.isBound, + isSnap: horizontalSnapInfo.isSnap, + offset: horizontalOffset, + dist: horizontalDist + }, + vertical: { + isBound: verticalBoundInfo.isBound, + isSnap: verticalSnapInfo.isSnap, + offset: verticalOffset, + dist: verticalDist + } + }; + } + + function checkMaxBounds(moveable, poses, direction, fixedPosition, datas) { + var fixedDirection = [-direction[0], -direction[1]]; + var _a = moveable.state, + width = _a.width, + height = _a.height; + var bounds = moveable.props.bounds; + var maxWidth = Infinity; + var maxHeight = Infinity; + + if (bounds) { + var directions = [[direction[0], -direction[1]], [-direction[0], direction[1]]]; + var _b = bounds.left, + left_1 = _b === void 0 ? -Infinity : _b, + _c = bounds.top, + top_1 = _c === void 0 ? -Infinity : _c, + _d = bounds.right, + right_1 = _d === void 0 ? Infinity : _d, + _e = bounds.bottom, + bottom_1 = _e === void 0 ? Infinity : _e; + directions.forEach(function (otherDirection) { + var isCheckVertical = otherDirection[0] !== fixedDirection[0]; + var isCheckHorizontal = otherDirection[1] !== fixedDirection[1]; + var otherPos = getPosByDirection(poses, otherDirection); + var deg = getRad$1(fixedPosition, otherPos) * 360 / Math.PI; + + if (isCheckHorizontal) { + var nextOtherPos = otherPos.slice(); + + if (abs(deg - 360) < 2 || abs(deg - 180) < 2) { + nextOtherPos[1] = fixedPosition[1]; + } + + var _a = solveNextOffset(fixedPosition, nextOtherPos, (fixedPosition[1] < otherPos[1] ? bottom_1 : top_1) - otherPos[1], false, datas), + _b = __read(_a.offset, 2), + heightOffset = _b[1], + isHeightOutside = _a.isOutside; + + if (!isNaN(heightOffset)) { + maxHeight = height + (isHeightOutside ? 1 : -1) * abs(heightOffset); + } + } + + if (isCheckVertical) { + var nextOtherPos = otherPos.slice(); + + if (abs(deg - 90) < 2 || abs(deg - 270) < 2) { + nextOtherPos[0] = fixedPosition[0]; + } + + var _c = solveNextOffset(fixedPosition, nextOtherPos, (fixedPosition[0] < otherPos[0] ? right_1 : left_1) - otherPos[0], true, datas), + _d = __read(_c.offset, 1), + widthOffset = _d[0], + isWidthOutside = _c.isOutside; + + if (!isNaN(widthOffset)) { + maxWidth = width + (isWidthOutside ? 1 : -1) * abs(widthOffset); + } + } + }); + } + + return { + maxWidth: maxWidth, + maxHeight: maxHeight + }; + } + /** + * @namespace Draggable + * @memberof Moveable + * @description Draggable refers to the ability to drag and move targets. + */ + + + var Draggable = { + name: "draggable", + props: ["draggable", "throttleDrag", "throttleDragRotate", "hideThrottleDragRotateLine", "startDragRotate", "edgeDraggable"], + events: ["dragStart", "drag", "dragEnd", "dragGroupStart", "dragGroup", "dragGroupEnd"], + requestStyle: function () { + return ["left", "top", "right", "bottom"]; + }, + requestChildStyle: function () { + return ["left", "top", "right", "bottom"]; + }, + render: function (moveable, React) { + var _a = moveable.props, + hideThrottleDragRotateLine = _a.hideThrottleDragRotateLine, + throttleDragRotate = _a.throttleDragRotate, + zoom = _a.zoom; + + var _b = moveable.getState(), + dragInfo = _b.dragInfo, + beforeOrigin = _b.beforeOrigin; + + if (hideThrottleDragRotateLine || !throttleDragRotate || !dragInfo) { + return []; + } + + var dist = dragInfo.dist; + + if (!dist[0] && !dist[1]) { + return []; + } + + var width = getDistSize(dist); + var rad = getRad$1(dist, [0, 0]); + return [React.createElement("div", { + className: prefix("line", "horizontal", "dragline", "dashed"), + key: "dragRotateGuideline", + style: { + width: "".concat(width, "px"), + transform: "translate(".concat(beforeOrigin[0], "px, ").concat(beforeOrigin[1], "px) rotate(").concat(rad, "rad) scaleY(").concat(zoom, ")") + } + })]; + }, + dragStart: function (moveable, e) { + var datas = e.datas, + parentEvent = e.parentEvent, + parentGesto = e.parentGesto; + var state = moveable.state; + var gestos = state.gestos, + style = state.style; + + if (gestos.draggable) { + return false; + } + + gestos.draggable = parentGesto || moveable.targetGesto; + datas.datas = {}; + datas.left = parseFloat(style.left || "") || 0; + datas.top = parseFloat(style.top || "") || 0; + datas.bottom = parseFloat(style.bottom || "") || 0; + datas.right = parseFloat(style.right || "") || 0; + datas.startValue = [0, 0]; + setDragStart(moveable, e); + setDefaultTransformIndex(moveable, e, "translate"); + startCheckSnapDrag(moveable, datas); + datas.prevDist = [0, 0]; + datas.prevBeforeDist = [0, 0]; + datas.isDrag = false; + datas.deltaOffset = [0, 0]; + var params = fillParams(moveable, e, __assign({ + set: function (translate) { + datas.startValue = translate; + } + }, fillTransformStartEvent(moveable, e))); + var result = parentEvent || triggerEvent(moveable, "onDragStart", params); + + if (result !== false) { + datas.isDrag = true; + moveable.state.dragInfo = { + startRect: moveable.getRect(), + dist: [0, 0] + }; + } else { + gestos.draggable = null; + datas.isPinch = false; + } + + return datas.isDrag ? params : false; + }, + drag: function (moveable, e) { + if (!e) { + return; + } + + resolveTransformEvent(moveable, e, "translate"); + var datas = e.datas, + parentEvent = e.parentEvent, + parentFlag = e.parentFlag, + isPinch = e.isPinch, + deltaOffset = e.deltaOffset, + useSnap = e.useSnap, + isRequest = e.isRequest, + isGroup = e.isGroup, + parentThrottleDrag = e.parentThrottleDrag; + var distX = e.distX, + distY = e.distY; + var isDrag = datas.isDrag, + prevDist = datas.prevDist, + prevBeforeDist = datas.prevBeforeDist, + startValue = datas.startValue; + + if (!isDrag) { + return; + } + + if (deltaOffset) { + distX += deltaOffset[0]; + distY += deltaOffset[1]; + } + + var props = moveable.props; + var parentMoveable = props.parentMoveable; + var throttleDrag = isGroup ? 0 : props.throttleDrag || parentThrottleDrag || 0; + var throttleDragRotate = parentEvent ? 0 : props.throttleDragRotate || 0; + var dragRotateRad = 0; + var isVerticalSnap = false; + var isVerticalBound = false; + var isHorizontalSnap = false; + var isHorizontalBound = false; + + if (!parentEvent && throttleDragRotate > 0 && (distX || distY)) { + var startDragRotate = props.startDragRotate || 0; + var deg = throttle(startDragRotate + getRad$1([0, 0], [distX, distY]) * 180 / Math.PI, throttleDragRotate) - startDragRotate; + var ry = distY * Math.abs(Math.cos((deg - 90) / 180 * Math.PI)); + var rx = distX * Math.abs(Math.cos(deg / 180 * Math.PI)); + var r = getDistSize([rx, ry]); + dragRotateRad = deg * Math.PI / 180; + distX = r * Math.cos(dragRotateRad); + distY = r * Math.sin(dragRotateRad); + } + + if (!isPinch && !parentEvent && !parentFlag) { + var _a = __read(checkSnapBoundsDrag(moveable, distX, distY, throttleDragRotate, !useSnap && isRequest || deltaOffset, datas), 2), + verticalInfo = _a[0], + horizontalInfo = _a[1]; + + isVerticalSnap = verticalInfo.isSnap; + isVerticalBound = verticalInfo.isBound; + isHorizontalSnap = horizontalInfo.isSnap; + isHorizontalBound = horizontalInfo.isBound; + var verticalOffset = verticalInfo.offset; + var horizontalOffset = horizontalInfo.offset; + distX += verticalOffset; + distY += horizontalOffset; + } + + var beforeTranslate = plus(getBeforeDragDist({ + datas: datas, + distX: distX, + distY: distY + }), startValue); + var translate = plus(getTransformDist({ + datas: datas, + distX: distX, + distY: distY + }), startValue); + throttleArray(translate, TINY_NUM); + throttleArray(beforeTranslate, TINY_NUM); + + if (!throttleDragRotate) { + if (!isVerticalSnap && !isVerticalBound) { + translate[0] = throttle(translate[0], throttleDrag); + beforeTranslate[0] = throttle(beforeTranslate[0], throttleDrag); + } + + if (!isHorizontalSnap && !isHorizontalBound) { + translate[1] = throttle(translate[1], throttleDrag); + beforeTranslate[1] = throttle(beforeTranslate[1], throttleDrag); + } + } + + var beforeDist = minus(beforeTranslate, startValue); + var dist = minus(translate, startValue); + var delta = minus(dist, prevDist); + var beforeDelta = minus(beforeDist, prevBeforeDist); + datas.prevDist = dist; + datas.prevBeforeDist = beforeDist; + datas.passDelta = delta; //distX - (datas.passDistX || 0); + // datas.passDeltaY = distY - (datas.passDistY || 0); + + datas.passDist = dist; //distX; + // datas.passDistY = distY; + + var left = datas.left + beforeDist[0]; + var top = datas.top + beforeDist[1]; + var right = datas.right - beforeDist[0]; + var bottom = datas.bottom - beforeDist[1]; + var nextTransform = convertTransformFormat(datas, "translate(".concat(translate[0], "px, ").concat(translate[1], "px)"), "translate(".concat(dist[0], "px, ").concat(dist[1], "px)")); + fillOriginalTransform(e, nextTransform); + moveable.state.dragInfo.dist = parentEvent ? [0, 0] : dist; + + if (!parentEvent && !parentMoveable && delta.every(function (num) { + return !num; + }) && beforeDelta.some(function (num) { + return !num; + })) { + return; + } + + var _b = moveable.state, + width = _b.width, + height = _b.height; + var params = fillParams(moveable, e, __assign({ + transform: nextTransform, + dist: dist, + delta: delta, + translate: translate, + beforeDist: beforeDist, + beforeDelta: beforeDelta, + beforeTranslate: beforeTranslate, + left: left, + top: top, + right: right, + bottom: bottom, + width: width, + height: height, + isPinch: isPinch + }, fillCSSObject({ + transform: nextTransform + }, e))); + !parentEvent && triggerEvent(moveable, "onDrag", params); + return params; + }, + dragAfter: function (moveable, e) { + var datas = e.datas; + var deltaOffset = datas.deltaOffset; + + if (deltaOffset[0] || deltaOffset[1]) { + datas.deltaOffset = [0, 0]; + return this.drag(moveable, __assign(__assign({}, e), { + deltaOffset: deltaOffset + })); + } + + return false; + }, + dragEnd: function (moveable, e) { + var parentEvent = e.parentEvent, + datas = e.datas; + moveable.state.dragInfo = null; + + if (!datas.isDrag) { + return; + } + + datas.isDrag = false; + var param = fillEndParams(moveable, e, {}); + !parentEvent && triggerEvent(moveable, "onDragEnd", param); + return param; + }, + dragGroupStart: function (moveable, e) { + var _a, _b; + + var datas = e.datas, + clientX = e.clientX, + clientY = e.clientY; + var params = this.dragStart(moveable, e); + + if (!params) { + return false; + } + + var _c = triggerChildGesto(moveable, this, "dragStart", [clientX || 0, clientY || 0], e, false, "draggable"), + childEvents = _c.childEvents, + eventParams = _c.eventParams; + + var nextParams = __assign(__assign({}, params), { + targets: moveable.props.targets, + events: eventParams + }); + + var result = triggerEvent(moveable, "onDragGroupStart", nextParams); + datas.isDrag = result !== false; // find data.startValue and based on first child moveable + + var startValue = (_b = (_a = childEvents[0]) === null || _a === void 0 ? void 0 : _a.datas.startValue) !== null && _b !== void 0 ? _b : [0, 0]; + datas.throttleOffset = [startValue[0] % 1, startValue[1] % 1]; + return datas.isDrag ? params : false; + }, + dragGroup: function (moveable, e) { + var datas = e.datas; + + if (!datas.isDrag) { + return; + } + + var params = this.drag(moveable, __assign(__assign({}, e), { + parentThrottleDrag: moveable.props.throttleDrag + })); + var passDelta = e.datas.passDelta; + var eventParams = triggerChildGesto(moveable, this, "drag", passDelta, e, false, "draggable").eventParams; + + if (!params) { + return; + } + + var nextParams = __assign({ + targets: moveable.props.targets, + events: eventParams + }, params); + + triggerEvent(moveable, "onDragGroup", nextParams); + return nextParams; + }, + dragGroupEnd: function (moveable, e) { + var isDrag = e.isDrag, + datas = e.datas; + + if (!datas.isDrag) { + return; + } + + this.dragEnd(moveable, e); + var eventParams = triggerChildGesto(moveable, this, "dragEnd", [0, 0], e, false, "draggable").eventParams; + triggerEvent(moveable, "onDragGroupEnd", fillEndParams(moveable, e, { + targets: moveable.props.targets, + events: eventParams + })); + return isDrag; + }, + + /** + * @method Moveable.Draggable#request + * @param {object} [e] - the draggable's request parameter + * @param {number} [e.x] - x position + * @param {number} [e.y] - y position + * @param {number} [e.deltaX] - X number to move + * @param {number} [e.deltaY] - Y number to move + * @return {Moveable.Requester} Moveable Requester + * @example + * // Instantly Request (requestStart - request - requestEnd) + * // Use Relative Value + * moveable.request("draggable", { deltaX: 10, deltaY: 10 }, true); + * // Use Absolute Value + * moveable.request("draggable", { x: 200, y: 100 }, true); + * + * // requestStart + * const requester = moveable.request("draggable"); + * + * // request + * // Use Relative Value + * requester.request({ deltaX: 10, deltaY: 10 }); + * requester.request({ deltaX: 10, deltaY: 10 }); + * requester.request({ deltaX: 10, deltaY: 10 }); + * // Use Absolute Value + * moveable.request("draggable", { x: 200, y: 100 }); + * moveable.request("draggable", { x: 220, y: 100 }); + * moveable.request("draggable", { x: 240, y: 100 }); + * + * // requestEnd + * requester.requestEnd(); + */ + request: function (moveable) { + var datas = {}; + var rect = moveable.getRect(); + var distX = 0; + var distY = 0; + var useSnap = false; + return { + isControl: false, + requestStart: function (e) { + useSnap = e.useSnap; + return { + datas: datas, + useSnap: useSnap + }; + }, + request: function (e) { + if ("x" in e) { + distX = e.x - rect.left; + } else if ("deltaX" in e) { + distX += e.deltaX; + } + + if ("y" in e) { + distY = e.y - rect.top; + } else if ("deltaY" in e) { + distY += e.deltaY; + } + + return { + datas: datas, + distX: distX, + distY: distY, + useSnap: useSnap + }; + }, + requestEnd: function () { + return { + datas: datas, + isDrag: true, + useSnap: useSnap + }; + } + }; + }, + unset: function (moveable) { + moveable.state.gestos.draggable = null; + moveable.state.dragInfo = null; + } + }; + /** + * Whether or not target can be dragged. (default: false) + * @name Moveable.Draggable#draggable + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * moveable.draggable = true; + */ + + /** + * throttle of x, y when drag. + * @name Moveable.Draggable#throttleDrag + * @default 0 + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * moveable.throttleDrag = 1; + */ + + /** + * throttle of angle of x, y when drag. + * @name Moveable.Draggable#throttleDragRotate + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * moveable.throttleDragRotate = 45; + */ + + /** + * start angle of throttleDragRotate of x, y when drag. + * @name Moveable.Draggable#startDragRotate + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * // 45, 135, 225, 315 + * moveable.throttleDragRotate = 90; + * moveable.startDragRotate = 45; + */ + + /** + * When the drag starts, the dragStart event is called. + * @memberof Moveable.Draggable + * @event dragStart + * @param {Moveable.Draggable.OnDragStart} - Parameters for the dragStart event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { draggable: true }); + * moveable.on("dragStart", ({ target }) => { + * console.log(target); + * }); + */ + + /** + * When dragging, the drag event is called. + * @memberof Moveable.Draggable + * @event drag + * @param {Moveable.Draggable.OnDrag} - Parameters for the drag event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { draggable: true }); + * moveable.on("drag", ({ target, transform }) => { + * target.style.transform = transform; + * }); + */ + + /** + * When the drag finishes, the dragEnd event is called. + * @memberof Moveable.Draggable + * @event dragEnd + * @param {Moveable.Draggable.OnDragEnd} - Parameters for the dragEnd event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { draggable: true }); + * moveable.on("dragEnd", ({ target, isDrag }) => { + * console.log(target, isDrag); + * }); + */ + + /** + * When the group drag starts, the `dragGroupStart` event is called. + * @memberof Moveable.Draggable + * @event dragGroupStart + * @param {Moveable.Draggable.OnDragGroupStart} - Parameters for the `dragGroupStart` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: [].slice.call(document.querySelectorAll(".target")), + * draggable: true + * }); + * moveable.on("dragGroupStart", ({ targets }) => { + * console.log("onDragGroupStart", targets); + * }); + */ + + /** + * When the group drag, the `dragGroup` event is called. + * @memberof Moveable.Draggable + * @event dragGroup + * @param {Moveable.Draggable.OnDragGroup} - Parameters for the `dragGroup` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: [].slice.call(document.querySelectorAll(".target")), + * draggable: true + * }); + * moveable.on("dragGroup", ({ targets, events }) => { + * console.log("onDragGroup", targets); + * events.forEach(ev => { + * // drag event + * console.log("onDrag left, top", ev.left, ev.top); + * // ev.target!.style.left = `${ev.left}px`; + * // ev.target!.style.top = `${ev.top}px`; + * console.log("onDrag translate", ev.dist); + * ev.target!.style.transform = ev.transform;) + * }); + * }); + */ + + /** + * When the group drag finishes, the `dragGroupEnd` event is called. + * @memberof Moveable.Draggable + * @event dragGroupEnd + * @param {Moveable.Draggable.OnDragGroupEnd} - Parameters for the `dragGroupEnd` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: [].slice.call(document.querySelectorAll(".target")), + * draggable: true + * }); + * moveable.on("dragGroupEnd", ({ targets, isDrag }) => { + * console.log("onDragGroupEnd", targets, isDrag); + * }); + */ + + function getFixedDirectionInfo(startPositions, fixedDirection) { + var fixedPosition = getPosByDirection(startPositions, fixedDirection); + var fixedOffset = [0, 0]; + return { + fixedPosition: fixedPosition, + fixedDirection: fixedDirection, + fixedOffset: fixedOffset + }; + } + + function getOffsetFixedDirectionInfo(state, fixedDirection) { + // for start + var allMatrix = state.allMatrix, + is3d = state.is3d, + width = state.width, + height = state.height; + var n = is3d ? 4 : 3; + var nextFixedOffset = [width / 2 * (1 + fixedDirection[0]), height / 2 * (1 + fixedDirection[1])]; + var fixedPosition = calculatePosition(allMatrix, nextFixedOffset, n); + var fixedOffset = [0, 0]; + return { + fixedPosition: fixedPosition, + fixedDirection: fixedDirection, + fixedOffset: fixedOffset + }; + } + + function getOffsetFixedPositionInfo(state, offsetFixedPosition) { + // for start + var allMatrix = state.allMatrix, + is3d = state.is3d, + width = state.width, + height = state.height; + var n = is3d ? 4 : 3; + var fixedDirection = getDirectionByPos(offsetFixedPosition, width, height); + var nextFixedPosition = calculatePosition(allMatrix, offsetFixedPosition, n); + var fixedOffset = [width ? 0 : offsetFixedPosition[0], height ? 0 : offsetFixedPosition[1]]; + return { + fixedPosition: nextFixedPosition, + fixedDirection: fixedDirection, + fixedOffset: fixedOffset + }; + } + /** + * @namespace Resizable + * @memberof Moveable + * @description Resizable indicates whether the target's width and height can be increased or decreased. + */ + + + var directionCondition$2 = getDirectionCondition("resizable"); + var Resizable = { + name: "resizable", + ableGroup: "size", + canPinch: true, + props: ["resizable", "throttleResize", "renderDirections", "displayAroundControls", "keepRatio", "resizeFormat", "keepRatioFinally", "edge", "checkResizableError"], + events: ["resizeStart", "beforeResize", "resize", "resizeEnd", "resizeGroupStart", "beforeResizeGroup", "resizeGroup", "resizeGroupEnd"], + render: getRenderDirections("resizable"), + dragControlCondition: directionCondition$2, + viewClassName: getDirectionViewClassName("resizable"), + dragControlStart: function (moveable, e) { + var _a; + + var inputEvent = e.inputEvent, + isPinch = e.isPinch, + isGroup = e.isGroup, + parentDirection = e.parentDirection, + parentGesto = e.parentGesto, + datas = e.datas, + parentFixedDirection = e.parentFixedDirection, + parentEvent = e.parentEvent; + var direction = getTotalDirection(parentDirection, isPinch, inputEvent, datas); + var state = moveable.state; + var target = state.target, + width = state.width, + height = state.height, + gestos = state.gestos; + + if (!direction || !target) { + return false; + } + + if (gestos.resizable) { + return false; + } + + gestos.resizable = parentGesto || moveable.controlGesto; + !isPinch && setDragStart(moveable, e); + datas.datas = {}; + datas.direction = direction; + datas.startOffsetWidth = width; + datas.startOffsetHeight = height; + datas.prevWidth = 0; + datas.prevHeight = 0; + datas.minSize = [0, 0]; + datas.startWidth = state.inlineCSSWidth || state.cssWidth; + datas.startHeight = state.inlineCSSHeight || state.cssHeight; + datas.maxSize = [Infinity, Infinity]; + + if (!isGroup) { + datas.minSize = [state.minOffsetWidth, state.minOffsetHeight]; + datas.maxSize = [state.maxOffsetWidth, state.maxOffsetHeight]; + } + + var transformOrigin = moveable.props.transformOrigin || "% %"; + datas.transformOrigin = transformOrigin && isString(transformOrigin) ? transformOrigin.split(" ") : transformOrigin; + datas.startOffsetMatrix = state.offsetMatrix; + datas.startTransformOrigin = state.transformOrigin; + datas.isWidth = (_a = e === null || e === void 0 ? void 0 : e.parentIsWidth) !== null && _a !== void 0 ? _a : !direction[0] && !direction[1] || direction[0] || !direction[1]; + + function setRatio(ratio) { + datas.ratio = ratio && isFinite(ratio) ? ratio : 0; + } + + datas.startPositions = getAbsolutePosesByState(moveable.state); + + function setFixedDirection(fixedDirection) { + var result = getFixedDirectionInfo(datas.startPositions, fixedDirection); + datas.fixedDirection = result.fixedDirection; + datas.fixedPosition = result.fixedPosition; + datas.fixedOffset = result.fixedOffset; + } + + function setFixedPosition(fixedPosition) { + var result = getOffsetFixedPositionInfo(moveable.state, fixedPosition); + datas.fixedDirection = result.fixedDirection; + datas.fixedPosition = result.fixedPosition; + datas.fixedOffset = result.fixedOffset; + } + + function setMin(minSize) { + datas.minSize = [convertUnitSize("".concat(minSize[0]), 0) || 0, convertUnitSize("".concat(minSize[1]), 0) || 0]; + } + + function setMax(maxSize) { + var nextMaxSize = [maxSize[0] || Infinity, maxSize[1] || Infinity]; + + if (!isNumber(nextMaxSize[0]) || isFinite(nextMaxSize[0])) { + nextMaxSize[0] = convertUnitSize("".concat(nextMaxSize[0]), 0) || Infinity; + } + + if (!isNumber(nextMaxSize[1]) || isFinite(nextMaxSize[1])) { + nextMaxSize[1] = convertUnitSize("".concat(nextMaxSize[1]), 0) || Infinity; + } + + datas.maxSize = nextMaxSize; + } + + setRatio(width / height); + setFixedDirection(parentFixedDirection || [-direction[0], -direction[1]]); + datas.setFixedDirection = setFixedDirection; + datas.setFixedPosition = setFixedPosition; + datas.setMin = setMin; + datas.setMax = setMax; + var params = fillParams(moveable, e, { + direction: direction, + startRatio: datas.ratio, + set: function (_a) { + var _b = __read(_a, 2), + startWidth = _b[0], + startHeight = _b[1]; + + datas.startWidth = startWidth; + datas.startHeight = startHeight; + }, + setMin: setMin, + setMax: setMax, + setRatio: setRatio, + setFixedDirection: setFixedDirection, + setFixedPosition: setFixedPosition, + setOrigin: function (origin) { + datas.transformOrigin = origin; + }, + dragStart: Draggable.dragStart(moveable, new CustomGesto().dragStart([0, 0], e)) + }); + var result = parentEvent || triggerEvent(moveable, "onResizeStart", params); + datas.startFixedDirection = datas.fixedDirection; + datas.startFixedPosition = datas.fixedPosition; + + if (result !== false) { + datas.isResize = true; + moveable.state.snapRenderInfo = { + request: e.isRequest, + direction: direction + }; + } + + return datas.isResize ? params : false; + }, + dragControl: function (moveable, e) { + var _a; + + var datas = e.datas, + parentFlag = e.parentFlag, + isPinch = e.isPinch, + parentKeepRatio = e.parentKeepRatio, + dragClient = e.dragClient, + parentDist = e.parentDist, + useSnap = e.useSnap, + isRequest = e.isRequest, + isGroup = e.isGroup, + parentEvent = e.parentEvent, + resolveMatrix = e.resolveMatrix; + var isResize = datas.isResize, + transformOrigin = datas.transformOrigin, + startWidth = datas.startWidth, + startHeight = datas.startHeight, + prevWidth = datas.prevWidth, + prevHeight = datas.prevHeight, + minSize = datas.minSize, + maxSize = datas.maxSize, + ratio = datas.ratio, + startOffsetWidth = datas.startOffsetWidth, + startOffsetHeight = datas.startOffsetHeight, + isWidth = datas.isWidth; + + if (!isResize) { + return; + } + + if (resolveMatrix) { + var is3d = moveable.state.is3d; + var startOffsetMatrix = datas.startOffsetMatrix, + startTransformOrigin = datas.startTransformOrigin; + var n = is3d ? 4 : 3; + var targetMatrix = parseMat(getNextTransforms(e)); + var targetN = Math.sqrt(targetMatrix.length); + + if (n !== targetN) { + targetMatrix = convertDimension(targetMatrix, targetN, n); + } + + var nextAllMatrix = getNextMatrix(startOffsetMatrix, targetMatrix, startTransformOrigin, n); + var poses = calculatePoses(nextAllMatrix, startOffsetWidth, startOffsetHeight, n); + datas.startPositions = poses; + datas.nextTargetMatrix = targetMatrix; + datas.nextAllMatrix = nextAllMatrix; + } + + var props = getProps(moveable.props, "resizable"); + var resizeFormat = props.resizeFormat, + _b = props.throttleResize, + throttleResize = _b === void 0 ? parentFlag ? 0 : 1 : _b, + parentMoveable = props.parentMoveable, + keepRatioFinally = props.keepRatioFinally; + var direction = datas.direction; + var sizeDirection = direction; + var distWidth = 0; + var distHeight = 0; + + if (!direction[0] && !direction[1]) { + sizeDirection = [1, 1]; + } + + var keepRatio = ratio && (parentKeepRatio != null ? parentKeepRatio : props.keepRatio) || false; + + function getNextBoundingSize() { + var fixedDirection = datas.fixedDirection; + var nextSize = getOffsetSizeDist(sizeDirection, keepRatio, datas, e); + distWidth = nextSize.distWidth; + distHeight = nextSize.distHeight; + var nextWidth = sizeDirection[0] - fixedDirection[0] || keepRatio ? Math.max(startOffsetWidth + distWidth, TINY_NUM) : startOffsetWidth; + var nextHeight = sizeDirection[1] - fixedDirection[1] || keepRatio ? Math.max(startOffsetHeight + distHeight, TINY_NUM) : startOffsetHeight; + + if (keepRatio && startOffsetWidth && startOffsetHeight) { + // startOffsetWidth : startOffsetHeight = nextWidth : nextHeight + if (isWidth) { + nextHeight = nextWidth / ratio; + } else { + nextWidth = nextHeight * ratio; + } + } + + return [nextWidth, nextHeight]; + } + + var _c = __read(getNextBoundingSize(), 2), + boundingWidth = _c[0], + boundingHeight = _c[1]; + + if (!parentEvent) { + datas.setFixedDirection(datas.fixedDirection); + triggerEvent(moveable, "onBeforeResize", fillParams(moveable, e, { + startFixedDirection: datas.startFixedDirection, + startFixedPosition: datas.startFixedPosition, + setFixedDirection: function (nextFixedDirection) { + var _a; + + datas.setFixedDirection(nextFixedDirection); + _a = __read(getNextBoundingSize(), 2), boundingWidth = _a[0], boundingHeight = _a[1]; + return [boundingWidth, boundingHeight]; + }, + setFixedPosition: function (nextFixedPosition) { + var _a; + + datas.setFixedPosition(nextFixedPosition); + _a = __read(getNextBoundingSize(), 2), boundingWidth = _a[0], boundingHeight = _a[1]; + return [boundingWidth, boundingHeight]; + }, + boundingWidth: boundingWidth, + boundingHeight: boundingHeight, + setSize: function (size) { + var _a; + + _a = __read(size, 2), boundingWidth = _a[0], boundingHeight = _a[1]; + } + }, true)); + } + + var fixedPosition = dragClient; + + if (!dragClient) { + if (!parentFlag && isPinch) { + fixedPosition = getAbsolutePosition(moveable, [0, 0]); + } else { + fixedPosition = datas.fixedPosition; + } + } + + var snapDist = [0, 0]; + + if (!isPinch) { + snapDist = checkSnapResize(moveable, boundingWidth, boundingHeight, direction, fixedPosition, !useSnap && isRequest, datas); + } + + if (parentDist) { + !parentDist[0] && (snapDist[0] = 0); + !parentDist[1] && (snapDist[1] = 0); + } + + function computeSize() { + var _a; + + if (resizeFormat) { + _a = __read(resizeFormat([boundingWidth, boundingHeight]), 2), boundingWidth = _a[0], boundingHeight = _a[1]; + } + + boundingWidth = throttle(boundingWidth, throttleResize); + boundingHeight = throttle(boundingHeight, throttleResize); + } + + if (keepRatio) { + if (sizeDirection[0] && sizeDirection[1] && snapDist[0] && snapDist[1]) { + if (abs(snapDist[0]) > abs(snapDist[1])) { + snapDist[1] = 0; + } else { + snapDist[0] = 0; + } + } + + var isNoSnap = !snapDist[0] && !snapDist[1]; + + if (isNoSnap) { + // pre-compute before maintaining the ratio + computeSize(); + } + + if (sizeDirection[0] && !sizeDirection[1] || snapDist[0] && !snapDist[1] || isNoSnap && isWidth) { + boundingWidth += snapDist[0]; + boundingHeight = boundingWidth / ratio; + } else if (!sizeDirection[0] && sizeDirection[1] || !snapDist[0] && snapDist[1] || isNoSnap && !isWidth) { + boundingHeight += snapDist[1]; + boundingWidth = boundingHeight * ratio; + } + } else { + boundingWidth += snapDist[0]; + boundingHeight += snapDist[1]; + boundingWidth = Math.max(0, boundingWidth); + boundingHeight = Math.max(0, boundingHeight); + } + + _a = __read(calculateBoundSize([boundingWidth, boundingHeight], minSize, maxSize, keepRatio ? ratio : false), 2), boundingWidth = _a[0], boundingHeight = _a[1]; + computeSize(); + + if (keepRatio && (isGroup || keepRatioFinally)) { + if (isWidth) { + boundingHeight = boundingWidth / ratio; + } else { + boundingWidth = boundingHeight * ratio; + } + } + + distWidth = boundingWidth - startOffsetWidth; + distHeight = boundingHeight - startOffsetHeight; + var delta = [distWidth - prevWidth, distHeight - prevHeight]; + datas.prevWidth = distWidth; + datas.prevHeight = distHeight; + var inverseDelta = getResizeDist(moveable, boundingWidth, boundingHeight, fixedPosition, transformOrigin, datas); + + if (!parentMoveable && delta.every(function (num) { + return !num; + }) && inverseDelta.every(function (num) { + return !num; + })) { + return; + } + + var drag = Draggable.drag(moveable, setCustomDrag(e, moveable.state, inverseDelta, !!isPinch, false, "draggable")); + var transform = drag.transform; + var nextWidth = startWidth + distWidth; + var nextHeight = startHeight + distHeight; + var params = fillParams(moveable, e, __assign({ + width: nextWidth, + height: nextHeight, + offsetWidth: Math.round(boundingWidth), + offsetHeight: Math.round(boundingHeight), + startRatio: ratio, + boundingWidth: boundingWidth, + boundingHeight: boundingHeight, + direction: direction, + dist: [distWidth, distHeight], + delta: delta, + isPinch: !!isPinch, + drag: drag + }, fillAfterTransform({ + style: { + width: "".concat(nextWidth, "px"), + height: "".concat(nextHeight, "px") + }, + transform: transform + }, drag, e))); + !parentEvent && triggerEvent(moveable, "onResize", params); + return params; + }, + dragControlAfter: function (moveable, e) { + var datas = e.datas; + var isResize = datas.isResize, + startOffsetWidth = datas.startOffsetWidth, + startOffsetHeight = datas.startOffsetHeight, + prevWidth = datas.prevWidth, + prevHeight = datas.prevHeight; + + if (!isResize || moveable.props.checkResizableError === false) { + return; + } + + var _a = moveable.state, + width = _a.width, + height = _a.height; + var errorWidth = width - (startOffsetWidth + prevWidth); + var errorHeight = height - (startOffsetHeight + prevHeight); + var isErrorWidth = abs(errorWidth) > 3; + var isErrorHeight = abs(errorHeight) > 3; + + if (isErrorWidth) { + datas.startWidth += errorWidth; + datas.startOffsetWidth += errorWidth; + datas.prevWidth += errorWidth; + } + + if (isErrorHeight) { + datas.startHeight += errorHeight; + datas.startOffsetHeight += errorHeight; + datas.prevHeight += errorHeight; + } + + if (isErrorWidth || isErrorHeight) { + return this.dragControl(moveable, e); + } + }, + dragControlEnd: function (moveable, e) { + var datas = e.datas, + parentEvent = e.parentEvent; + + if (!datas.isResize) { + return; + } + + datas.isResize = false; + var params = fillEndParams(moveable, e, {}); + !parentEvent && triggerEvent(moveable, "onResizeEnd", params); + return params; + }, + dragGroupControlCondition: directionCondition$2, + dragGroupControlStart: function (moveable, e) { + var datas = e.datas; + var params = this.dragControlStart(moveable, __assign(__assign({}, e), { + isGroup: true + })); + + if (!params) { + return false; + } + + var originalEvents = fillChildEvents(moveable, "resizable", e); + var parentStartOffsetWidth = datas.startOffsetWidth, + parentStartOffsetHeight = datas.startOffsetHeight; + + function updateGroupMin() { + var originalMinSize = datas.minSize; + originalEvents.forEach(function (ev) { + var _a = ev.datas, + childMinSize = _a.minSize, + childStartOffsetWidth = _a.startOffsetWidth, + childStartOffsetHeight = _a.startOffsetHeight; + var parentMinWidth = parentStartOffsetWidth * (childStartOffsetWidth ? childMinSize[0] / childStartOffsetWidth : 0); + var parentMinHeight = parentStartOffsetHeight * (childStartOffsetHeight ? childMinSize[1] / childStartOffsetHeight : 0); + originalMinSize[0] = Math.max(originalMinSize[0], parentMinWidth); + originalMinSize[1] = Math.max(originalMinSize[1], parentMinHeight); + }); + } + + function updateGroupMax() { + var originalMaxSize = datas.maxSize; + originalEvents.forEach(function (ev) { + var _a = ev.datas, + childMaxSize = _a.maxSize, + childStartOffsetWidth = _a.startOffsetWidth, + childStartOffsetHeight = _a.startOffsetHeight; + var parentMaxWidth = parentStartOffsetWidth * (childStartOffsetWidth ? childMaxSize[0] / childStartOffsetWidth : 0); + var parentMaxHeight = parentStartOffsetHeight * (childStartOffsetHeight ? childMaxSize[1] / childStartOffsetHeight : 0); + originalMaxSize[0] = Math.min(originalMaxSize[0], parentMaxWidth); + originalMaxSize[1] = Math.min(originalMaxSize[1], parentMaxHeight); + }); + } + + var events = triggerChildAbles(moveable, this, "dragControlStart", e, function (child, ev) { + return startChildDist(moveable, child, datas, ev); + }); + updateGroupMin(); + updateGroupMax(); + + var setFixedDirection = function (fixedDirection) { + params.setFixedDirection(fixedDirection); + events.forEach(function (ev, i) { + ev.setFixedDirection(fixedDirection); + startChildDist(moveable, ev.moveable, datas, originalEvents[i]); + }); + }; + + datas.setFixedDirection = setFixedDirection; + + var nextParams = __assign(__assign({}, params), { + targets: moveable.props.targets, + events: events.map(function (ev) { + return __assign(__assign({}, ev), { + setMin: function (minSize) { + ev.setMin(minSize); + updateGroupMin(); + }, + setMax: function (maxSize) { + ev.setMax(maxSize); + updateGroupMax(); + } + }); + }), + setFixedDirection: setFixedDirection, + setMin: function (minSize) { + params.setMin(minSize); + updateGroupMin(); + }, + setMax: function (maxSize) { + params.setMax(maxSize); + updateGroupMax(); + } + }); + + var result = triggerEvent(moveable, "onResizeGroupStart", nextParams); + datas.isResize = result !== false; + return datas.isResize ? params : false; + }, + dragGroupControl: function (moveable, e) { + var datas = e.datas; + + if (!datas.isResize) { + return; + } + + var props = getProps(moveable.props, "resizable"); + catchEvent(moveable, "onBeforeResize", function (parentEvent) { + triggerEvent(moveable, "onBeforeResizeGroup", fillParams(moveable, e, __assign(__assign({}, parentEvent), { + targets: props.targets + }), true)); + }); + var params = this.dragControl(moveable, __assign(__assign({}, e), { + isGroup: true + })); + + if (!params) { + return; + } + + var boundingWidth = params.boundingWidth, + boundingHeight = params.boundingHeight, + dist = params.dist; + var keepRatio = props.keepRatio; + var parentScale = [boundingWidth / (boundingWidth - dist[0]), boundingHeight / (boundingHeight - dist[1])]; + var fixedPosition = datas.fixedPosition; + var events = triggerChildAbles(moveable, this, "dragControl", e, function (_, ev) { + var _a = __read(calculate(createRotateMatrix(moveable.rotation / 180 * Math.PI, 3), [ev.datas.originalX * parentScale[0], ev.datas.originalY * parentScale[1], 1], 3), 2), + clientX = _a[0], + clientY = _a[1]; + + return __assign(__assign({}, ev), { + parentDist: null, + parentScale: parentScale, + dragClient: plus(fixedPosition, [clientX, clientY]), + parentKeepRatio: keepRatio + }); + }); + + var nextParams = __assign({ + targets: props.targets, + events: events + }, params); + + triggerEvent(moveable, "onResizeGroup", nextParams); + return nextParams; + }, + dragGroupControlEnd: function (moveable, e) { + var isDrag = e.isDrag, + datas = e.datas; + + if (!datas.isResize) { + return; + } + + this.dragControlEnd(moveable, e); + var events = triggerChildAbles(moveable, this, "dragControlEnd", e); + var nextParams = fillEndParams(moveable, e, { + targets: moveable.props.targets, + events: events + }); + triggerEvent(moveable, "onResizeGroupEnd", nextParams); + return isDrag; + }, + + /** + * @method Moveable.Resizable#request + * @param {Moveable.Resizable.ResizableRequestParam} e - the Resizable's request parameter + * @return {Moveable.Requester} Moveable Requester + * @example + * // Instantly Request (requestStart - request - requestEnd) + * // Use Relative Value + * moveable.request("resizable", { deltaWidth: 10, deltaHeight: 10 }, true); + * + * // Use Absolute Value + * moveable.request("resizable", { offsetWidth: 100, offsetHeight: 100 }, true); + * + * // requestStart + * const requester = moveable.request("resizable"); + * + * // request + * // Use Relative Value + * requester.request({ deltaWidth: 10, deltaHeight: 10 }); + * requester.request({ deltaWidth: 10, deltaHeight: 10 }); + * requester.request({ deltaWidth: 10, deltaHeight: 10 }); + * + * // Use Absolute Value + * moveable.request("resizable", { offsetWidth: 100, offsetHeight: 100 }); + * moveable.request("resizable", { offsetWidth: 110, offsetHeight: 100 }); + * moveable.request("resizable", { offsetWidth: 120, offsetHeight: 100 }); + * + * // requestEnd + * requester.requestEnd(); + */ + request: function (moveable) { + var datas = {}; + var distWidth = 0; + var distHeight = 0; + var useSnap = false; + var rect = moveable.getRect(); + return { + isControl: true, + requestStart: function (e) { + var _a; + + useSnap = e.useSnap; + return { + datas: datas, + parentDirection: e.direction || [1, 1], + parentIsWidth: (_a = e === null || e === void 0 ? void 0 : e.horizontal) !== null && _a !== void 0 ? _a : true, + useSnap: useSnap + }; + }, + request: function (e) { + if ("offsetWidth" in e) { + distWidth = e.offsetWidth - rect.offsetWidth; + } else if ("deltaWidth" in e) { + distWidth += e.deltaWidth; + } + + if ("offsetHeight" in e) { + distHeight = e.offsetHeight - rect.offsetHeight; + } else if ("deltaHeight" in e) { + distHeight += e.deltaHeight; + } + + return { + datas: datas, + parentDist: [distWidth, distHeight], + parentKeepRatio: e.keepRatio, + useSnap: useSnap + }; + }, + requestEnd: function () { + return { + datas: datas, + isDrag: true, + useSnap: useSnap + }; + } + }; + }, + unset: function (moveable) { + moveable.state.gestos.resizable = null; + } + }; + /** + * Whether or not target can be resized. + * @name Moveable.Resizable#resizable + * @default false + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * resizable: false, + * }); + * + * moveable.resizable = true; + */ + + /** + * throttle of width, height when resize. If throttleResize is set to less than 1, the target may shake. + * @name Moveable.Resizable#throttleResize + * @default 1 + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * resizable: true, + * throttleResize: 1, + * }); + * + * moveable.throttleResize = 0; + */ + + /** + * When resize or scale, keeps a ratio of the width, height. + * @name Moveable.Resizable#keepRatio + * @default false + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * resizable: true, + * }); + * + * moveable.keepRatio = true; + */ + + /** + * Set directions to show the control box. + * @name Moveable.Resizable#renderDirections + * @default ["n", "nw", "ne", "s", "se", "sw", "e", "w"] + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * resizable: true, + * renderDirections: ["n", "nw", "ne", "s", "se", "sw", "e", "w"], + * }); + * + * moveable.renderDirections = ["nw", "ne", "sw", "se"]; + */ + + /** + * Function to convert size for resize + * @name Moveable.Resizable#resizeFormat + * @default oneself + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * resizable: true, + * resizeFormat: v => v, + * }); + * + * moveable.resizeFormat = (size: number[]) => ([Math.trunc(size[0]), Math.trunc(size[1])]; + */ + + /** + * When the resize starts, the resizeStart event is called. + * @memberof Moveable.Resizable + * @event resizeStart + * @param {Moveable.Resizable.OnResizeStart} - Parameters for the resizeStart event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { resizable: true }); + * moveable.on("resizeStart", ({ target }) => { + * console.log(target); + * }); + */ + + /** + * When resizing, `beforeResize` is called before `resize` occurs. In `beforeResize`, you can get and set the pre-value before resizing. + * @memberof Moveable.Resizable + * @event beforeResize + * @param {Moveable.Resizable.OnBeforeResize} - Parameters for the `beforeResize` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { resizable: true }); + * moveable.on("beforeResize", ({ setFixedDirection }) => { + * if (shiftKey) { + * setFixedDirection([0, 0]); + * } + * }); + * moveable.on("resize", ({ target, width, height, drag }) => { + * target.style.width = `${width}px`; + * target.style.height = `${height}px`; + * target.style.transform = drag.transform; + * }); + */ + + /** + * When resizing, the resize event is called. + * @memberof Moveable.Resizable + * @event resize + * @param {Moveable.Resizable.OnResize} - Parameters for the resize event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { resizable: true }); + * moveable.on("resize", ({ target, width, height }) => { + * target.style.width = `${e.width}px`; + * target.style.height = `${e.height}px`; + * }); + */ + + /** + * When the resize finishes, the resizeEnd event is called. + * @memberof Moveable.Resizable + * @event resizeEnd + * @param {Moveable.Resizable.OnResizeEnd} - Parameters for the resizeEnd event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { resizable: true }); + * moveable.on("resizeEnd", ({ target, isDrag }) => { + * console.log(target, isDrag); + * }); + */ + + /** + * When the group resize starts, the `resizeGroupStart` event is called. + * @memberof Moveable.Resizable + * @event resizeGroupStart + * @param {Moveable.Resizable.OnResizeGroupStart} - Parameters for the `resizeGroupStart` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: [].slice.call(document.querySelectorAll(".target")), + * resizable: true + * }); + * moveable.on("resizeGroupStart", ({ targets }) => { + * console.log("onResizeGroupStart", targets); + * }); + */ + + /** + * When the group resize, the `resizeGroup` event is called. + * @memberof Moveable.Resizable + * @event resizeGroup + * @param {Moveable.Resizable.onResizeGroup} - Parameters for the `resizeGroup` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: [].slice.call(document.querySelectorAll(".target")), + * resizable: true + * }); + * moveable.on("resizeGroup", ({ targets, events }) => { + * console.log("onResizeGroup", targets); + * events.forEach(ev => { + * const offset = [ + * direction[0] < 0 ? -ev.delta[0] : 0, + * direction[1] < 0 ? -ev.delta[1] : 0, + * ]; + * // ev.drag is a drag event that occurs when the group resize. + * const left = offset[0] + ev.drag.beforeDist[0]; + * const top = offset[1] + ev.drag.beforeDist[1]; + * const width = ev.width; + * const top = ev.top; + * }); + * }); + */ + + /** + * When the group resize finishes, the `resizeGroupEnd` event is called. + * @memberof Moveable.Resizable + * @event resizeGroupEnd + * @param {Moveable.Resizable.OnResizeGroupEnd} - Parameters for the `resizeGroupEnd` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: [].slice.call(document.querySelectorAll(".target")), + * resizable: true + * }); + * moveable.on("resizeGroupEnd", ({ targets, isDrag }) => { + * console.log("onResizeGroupEnd", targets, isDrag); + * }); + */ + + /** + * @namespace Rotatable + * @memberof Moveable + * @description Rotatable indicates whether the target can be rotated. + */ + + function setRotateStartInfo(moveable, datas, clientX, clientY, rect) { + var groupable = moveable.props.groupable; + var state = moveable.state; + var n = state.is3d ? 4 : 3; + var origin = datas.origin; + var nextOrigin = calculatePosition(moveable.state.rootMatrix, // TO-DO #710 + minus([origin[0], origin[1]], groupable ? [0, 0] : [state.left, state.top]), n); + var startAbsoluteOrigin = plus([rect.left, rect.top], nextOrigin); + datas.startAbsoluteOrigin = startAbsoluteOrigin; + datas.prevDeg = getRad$1(startAbsoluteOrigin, [clientX, clientY]) / Math.PI * 180; + datas.defaultDeg = datas.prevDeg; + datas.prevSnapDeg = 0; + datas.loop = 0; + datas.startDist = getDist$2(startAbsoluteOrigin, [clientX, clientY]); + } + + function getAbsoluteDist(deg, direction, datas) { + var defaultDeg = datas.defaultDeg, + prevDeg = datas.prevDeg; + var normalizedPrevDeg = prevDeg % 360; + var loop = Math.floor(prevDeg / 360); + + if (normalizedPrevDeg < 0) { + normalizedPrevDeg += 360; + } + + if (normalizedPrevDeg > deg && normalizedPrevDeg > 270 && deg < 90) { + // 360 => 0 + ++loop; + } else if (normalizedPrevDeg < deg && normalizedPrevDeg < 90 && deg > 270) { + // 0 => 360 + --loop; + } + + var dist = direction * (loop * 360 + deg - defaultDeg); + datas.prevDeg = defaultDeg + dist; + return dist; + } + + function getAbsoluteDistByClient(clientX, clientY, direction, datas) { + return getAbsoluteDist(getRad$1(datas.startAbsoluteOrigin, [clientX, clientY]) / Math.PI * 180, direction, datas); + } + + function getRotateInfo(moveable, moveableRect, datas, dist, startValue, checkSnap) { + var _a = moveable.props.throttleRotate, + throttleRotate = _a === void 0 ? 0 : _a; + var prevSnapDeg = datas.prevSnapDeg; + var snapRotation = 0; + var isSnap = false; + + if (checkSnap) { + var result = checkSnapRotate(moveable, moveableRect, dist, startValue + dist); + isSnap = result.isSnap; + snapRotation = startValue + result.dist; + } + + if (!isSnap) { + snapRotation = throttle(startValue + dist, throttleRotate); + } + + var snapDeg = snapRotation - startValue; + datas.prevSnapDeg = snapDeg; + return [snapDeg - prevSnapDeg, snapDeg, snapRotation]; + } + + function getRotationPositions(rotationPosition, _a, direction) { + var _b = __read(_a, 4), + pos1 = _b[0], + pos2 = _b[1], + pos3 = _b[2], + pos4 = _b[3]; + + if (rotationPosition === "none") { + return []; + } + + if (isArray(rotationPosition)) { + return rotationPosition.map(function (child) { + return getRotationPositions(child, [pos1, pos2, pos3, pos4], direction)[0]; + }); + } + + var _c = __read((rotationPosition || "top").split("-"), 2), + dir1 = _c[0], + dir2 = _c[1]; + + var radPoses = [pos1, pos2]; + + if (dir1 === "left") { + radPoses = [pos3, pos1]; + } else if (dir1 === "right") { + radPoses = [pos2, pos4]; + } else if (dir1 === "bottom") { + radPoses = [pos4, pos3]; + } + + var pos = [(radPoses[0][0] + radPoses[1][0]) / 2, (radPoses[0][1] + radPoses[1][1]) / 2]; + var rad = getRotationRad(radPoses, direction); + + if (dir2) { + var isStart = dir2 === "top" || dir2 === "left"; + var isReverse = dir1 === "bottom" || dir1 === "left"; + pos = radPoses[isStart && !isReverse || !isStart && isReverse ? 0 : 1]; + } + + return [[pos, rad]]; + } + + function dragControlCondition(moveable, e) { + if (e.isRequest) { + return e.requestAble === "rotatable"; + } + + var target = e.inputEvent.target; + + if (hasClass(target, prefix("rotation-control")) || moveable.props.rotateAroundControls && hasClass(target, prefix("around-control")) || hasClass(target, prefix("control")) && hasClass(target, prefix("rotatable"))) { + return true; + } + + var rotationTarget = moveable.props.rotationTarget; + + if (rotationTarget) { + return getRefTargets(rotationTarget, true).some(function (element) { + if (!element) { + return false; + } + + return target === element || target.contains(element); + }); + } + + return false; + } + + var css = ".rotation {\nposition: absolute;\nheight: 40px;\nwidth: 1px;\ntransform-origin: 50% 100%;\nheight: calc(40px * var(--zoom));\ntop: auto;\nleft: 0;\nbottom: 100%;\nwill-change: transform;\n}\n.rotation .rotation-line {\ndisplay: block;\nwidth: 100%;\nheight: 100%;\ntransform-origin: 50% 50%;\n}\n.rotation .rotation-control {\nborder-color: #4af;\nborder-color: var(--moveable-color);\nbackground:#fff;\ncursor: alias;\n}\n:global .view-rotation-dragging, .rotatable.direction.control {\ncursor: alias;\n}\n.rotatable.direction.control.move {\ncursor: move;\n}\n"; + var Rotatable = { + name: "rotatable", + canPinch: true, + props: ["rotatable", "rotationPosition", "throttleRotate", "renderDirections", "rotationTarget", "rotateAroundControls", "edge", "resolveAblesWithRotatable", "displayAroundControls"], + events: ["rotateStart", "beforeRotate", "rotate", "rotateEnd", "rotateGroupStart", "beforeRotateGroup", "rotateGroup", "rotateGroupEnd"], + css: [css], + viewClassName: function (moveable) { + if (!moveable.isDragging("rotatable")) { + return ""; + } + + return prefix("view-rotation-dragging"); + }, + render: function (moveable, React) { + var _a = getProps(moveable.props, "rotatable"), + rotatable = _a.rotatable, + rotationPosition = _a.rotationPosition, + zoom = _a.zoom, + renderDirections = _a.renderDirections, + rotateAroundControls = _a.rotateAroundControls, + resolveAblesWithRotatable = _a.resolveAblesWithRotatable; + + var _b = moveable.getState(), + renderPoses = _b.renderPoses, + direction = _b.direction; + + if (!rotatable) { + return null; + } + + var positions = getRotationPositions(rotationPosition, renderPoses, direction); + var jsxs = []; + positions.forEach(function (_a, i) { + var _b = __read(_a, 2), + pos = _b[0], + rad = _b[1]; + + jsxs.push(React.createElement("div", { + key: "rotation".concat(i), + className: prefix("rotation"), + style: { + // tslint:disable-next-line: max-line-length + transform: "translate(-50%) translate(".concat(pos[0], "px, ").concat(pos[1], "px) rotate(").concat(rad, "rad)") + } + }, React.createElement("div", { + className: prefix("line rotation-line"), + style: { + transform: "scaleX(".concat(zoom, ")") + } + }), React.createElement("div", { + className: prefix("control rotation-control"), + style: { + transform: "translate(0.5px) scale(".concat(zoom, ")") + } + }))); + }); + + if (renderDirections) { + var ables = getKeys(resolveAblesWithRotatable || {}); + var resolveMap_1 = {}; + ables.forEach(function (name) { + resolveAblesWithRotatable[name].forEach(function (direction) { + resolveMap_1[direction] = name; + }); + }); + var directionControlInfos = []; + + if (isArray(renderDirections)) { + directionControlInfos = renderDirections.map(function (dir) { + var able = resolveMap_1[dir]; + return { + data: able ? { + resolve: able + } : {}, + classNames: able ? ["move"] : [], + dir: dir + }; + }); + } + + jsxs.push.apply(jsxs, __spreadArray([], __read(renderDirectionControlsByInfos(moveable, "rotatable", directionControlInfos, React)), false)); + } + + if (rotateAroundControls) { + jsxs.push.apply(jsxs, __spreadArray([], __read(renderAroundControls(moveable, React)), false)); + } + + return jsxs; + }, + dragControlCondition: dragControlCondition, + dragControlStart: function (moveable, e) { + var _a; + + var _b; + + var datas = e.datas, + clientX = e.clientX, + clientY = e.clientY, + parentRotate = e.parentRotate, + parentFlag = e.parentFlag, + isPinch = e.isPinch, + isRequest = e.isRequest; + var state = moveable.state; + var target = state.target, + left = state.left, + top = state.top, + direction = state.direction, + beforeDirection = state.beforeDirection, + targetTransform = state.targetTransform, + moveableClientRect = state.moveableClientRect, + offsetMatrix = state.offsetMatrix, + targetMatrix = state.targetMatrix, + allMatrix = state.allMatrix, + width = state.width, + height = state.height; + + if (!isRequest && !target) { + return false; + } + + var rect = moveable.getRect(); + datas.rect = rect; + datas.transform = targetTransform; + datas.left = left; + datas.top = top; + + var setFixedPosition = function (fixedPosition) { + var result = getOffsetFixedPositionInfo(moveable.state, fixedPosition); + datas.fixedDirection = result.fixedDirection; + datas.fixedOffset = result.fixedOffset; + datas.fixedPosition = result.fixedPosition; + + if (resizeStart) { + resizeStart.setFixedPosition(fixedPosition); + } + }; + + var setFixedDirection = function (fixedDirection) { + var result = getOffsetFixedDirectionInfo(moveable.state, fixedDirection); + datas.fixedDirection = result.fixedDirection; + datas.fixedOffset = result.fixedOffset; + datas.fixedPosition = result.fixedPosition; + + if (resizeStart) { + resizeStart.setFixedDirection(fixedDirection); + } + }; + + var startClientX = clientX; + var startClientY = clientY; + + if (isRequest || isPinch || parentFlag) { + var externalRotate = parentRotate || 0; + datas.beforeInfo = { + origin: rect.beforeOrigin, + prevDeg: externalRotate, + defaultDeg: externalRotate, + prevSnapDeg: 0, + startDist: 0 + }; + datas.afterInfo = __assign(__assign({}, datas.beforeInfo), { + origin: rect.origin + }); + datas.absoluteInfo = __assign(__assign({}, datas.beforeInfo), { + origin: rect.origin, + startValue: externalRotate + }); + } else { + var inputTarget = (_b = e.inputEvent) === null || _b === void 0 ? void 0 : _b.target; + + if (inputTarget) { + var regionDirection = inputTarget.getAttribute("data-direction") || ""; + var controlDirection = DIRECTION_REGION_TO_DIRECTION[regionDirection]; + + if (controlDirection) { + datas.isControl = true; + datas.isAroundControl = hasClass(inputTarget, prefix("around-control")); + datas.controlDirection = controlDirection; + var resolve = inputTarget.getAttribute("data-resolve"); + + if (resolve) { + datas.resolveAble = resolve; + } + + var clientPoses = calculateMoveableClientPositions(state.rootMatrix, state.renderPoses, moveableClientRect); + _a = __read(getPosByDirection(clientPoses, controlDirection), 2), startClientX = _a[0], startClientY = _a[1]; + } + } + + datas.beforeInfo = { + origin: rect.beforeOrigin + }; + datas.afterInfo = { + origin: rect.origin + }; + datas.absoluteInfo = { + origin: rect.origin, + startValue: rect.rotation + }; + var originalFixedPosition_1 = setFixedPosition; + + setFixedPosition = function (fixedPosition) { + var n = state.is3d ? 4 : 3; + + var _a = __read(plus(getOrigin(targetMatrix, n), fixedPosition), 2), + originX = _a[0], + originY = _a[1]; + + var fixedBeforeOrigin = calculate(offsetMatrix, convertPositionMatrix([originX, originY], n)); + var fixedAfterOrigin = calculate(allMatrix, convertPositionMatrix([fixedPosition[0], fixedPosition[1]], n)); + originalFixedPosition_1(fixedPosition); + var posDelta = state.posDelta; + datas.beforeInfo.origin = minus(fixedBeforeOrigin, posDelta); + datas.afterInfo.origin = minus(fixedAfterOrigin, posDelta); + datas.absoluteInfo.origin = minus(fixedAfterOrigin, posDelta); + setRotateStartInfo(moveable, datas.beforeInfo, startClientX, startClientY, moveableClientRect); + setRotateStartInfo(moveable, datas.afterInfo, startClientX, startClientY, moveableClientRect); + setRotateStartInfo(moveable, datas.absoluteInfo, startClientX, startClientY, moveableClientRect); + }; + + setFixedDirection = function (fixedDirection) { + var fixedPosition = getPosByDirection([[0, 0], [width, 0], [0, height], [width, height]], fixedDirection); + setFixedPosition(fixedPosition); + }; + } + + datas.startClientX = startClientX; + datas.startClientY = startClientY; + datas.direction = direction; + datas.beforeDirection = beforeDirection; + datas.startValue = 0; + datas.datas = {}; + setDefaultTransformIndex(moveable, e, "rotate"); + var dragStart = false; + var resizeStart = false; + + if (datas.isControl && datas.resolveAble) { + var resolveAble = datas.resolveAble; + + if (resolveAble === "resizable") { + resizeStart = Resizable.dragControlStart(moveable, __assign(__assign({}, new CustomGesto("resizable").dragStart([0, 0], e)), { + parentPosition: datas.controlPosition, + parentFixedPosition: datas.fixedPosition + })); + } + } + + if (!resizeStart) { + dragStart = Draggable.dragStart(moveable, new CustomGesto().dragStart([0, 0], e)); + } + + setFixedPosition(getTotalOrigin(moveable)); + var params = fillParams(moveable, e, __assign(__assign({ + set: function (rotatation) { + datas.startValue = rotatation * Math.PI / 180; + }, + setFixedDirection: setFixedDirection, + setFixedPosition: setFixedPosition + }, fillTransformStartEvent(moveable, e)), { + dragStart: dragStart, + resizeStart: resizeStart + })); + var result = triggerEvent(moveable, "onRotateStart", params); + datas.isRotate = result !== false; + state.snapRenderInfo = { + request: e.isRequest + }; + return datas.isRotate ? params : false; + }, + dragControl: function (moveable, e) { + var _a, _b, _c; + + var datas = e.datas, + clientDistX = e.clientDistX, + clientDistY = e.clientDistY, + parentRotate = e.parentRotate, + parentFlag = e.parentFlag, + isPinch = e.isPinch, + groupDelta = e.groupDelta, + resolveMatrix = e.resolveMatrix; + var beforeDirection = datas.beforeDirection, + beforeInfo = datas.beforeInfo, + afterInfo = datas.afterInfo, + absoluteInfo = datas.absoluteInfo, + isRotate = datas.isRotate, + startValue = datas.startValue, + rect = datas.rect, + startClientX = datas.startClientX, + startClientY = datas.startClientY; + + if (!isRotate) { + return; + } + + resolveTransformEvent(moveable, e, "rotate"); + var targetDirection = getTransformDirection(e); + var direction = beforeDirection * targetDirection; + var parentMoveable = moveable.props.parentMoveable; + var beforeDelta = 0; + var beforeDist; + var beforeRotation; + var delta = 0; + var dist; + var rotation; + var absoluteDelta = 0; + var absoluteDist; + var absoluteRotation; + var startRotation = 180 / Math.PI * startValue; + var absoluteStartRotation = absoluteInfo.startValue; + var isSnap = false; + var nextClientX = startClientX + clientDistX; + var nextClientY = startClientY + clientDistY; + + if (!parentFlag && "parentDist" in e) { + var parentDist = e.parentDist; + beforeDist = parentDist; + dist = parentDist; + absoluteDist = parentDist; + } else if (isPinch || parentFlag) { + beforeDist = getAbsoluteDist(parentRotate, beforeDirection, beforeInfo); + dist = getAbsoluteDist(parentRotate, direction, afterInfo); + absoluteDist = getAbsoluteDist(parentRotate, direction, absoluteInfo); + } else { + beforeDist = getAbsoluteDistByClient(nextClientX, nextClientY, beforeDirection, beforeInfo); + dist = getAbsoluteDistByClient(nextClientX, nextClientY, direction, afterInfo); + absoluteDist = getAbsoluteDistByClient(nextClientX, nextClientY, direction, absoluteInfo); + isSnap = true; + } + + beforeRotation = startRotation + beforeDist; + rotation = startRotation + dist; + absoluteRotation = absoluteStartRotation + absoluteDist; + triggerEvent(moveable, "onBeforeRotate", fillParams(moveable, e, { + beforeRotation: beforeRotation, + rotation: rotation, + absoluteRotation: absoluteRotation, + setRotation: function (nextRotation) { + dist = nextRotation - startRotation; + beforeDist = dist; + absoluteDist = dist; + } + }, true)); + _a = __read(getRotateInfo(moveable, rect, beforeInfo, beforeDist, startRotation, isSnap), 3), beforeDelta = _a[0], beforeDist = _a[1], beforeRotation = _a[2]; + _b = __read(getRotateInfo(moveable, rect, afterInfo, dist, startRotation, isSnap), 3), delta = _b[0], dist = _b[1], rotation = _b[2]; + _c = __read(getRotateInfo(moveable, rect, absoluteInfo, absoluteDist, absoluteStartRotation, isSnap), 3), absoluteDelta = _c[0], absoluteDist = _c[1], absoluteRotation = _c[2]; + + if (!absoluteDelta && !delta && !beforeDelta && !parentMoveable && !resolveMatrix) { + return; + } + + var nextTransform = convertTransformFormat(datas, "rotate(".concat(rotation, "deg)"), "rotate(".concat(dist, "deg)")); + + if (resolveMatrix) { + datas.fixedPosition = getTranslateFixedPosition(moveable, datas.targetAllTransform, datas.fixedDirection, datas.fixedOffset, datas); + } + + var inverseDist = getRotateDist(moveable, dist, datas); + var inverseDelta = minus(plus(groupDelta || [0, 0], inverseDist), datas.prevInverseDist || [0, 0]); + datas.prevInverseDist = inverseDist; + datas.requestValue = null; + var dragEvent = fillTransformEvent(moveable, nextTransform, inverseDelta, isPinch, e); + var transformEvent = dragEvent; + var parentDistance = getDist$2([nextClientX, nextClientY], absoluteInfo.startAbsoluteOrigin) - absoluteInfo.startDist; + var resize = undefined; + + if (datas.resolveAble === "resizable") { + var resizeEvent = Resizable.dragControl(moveable, __assign(__assign({}, setCustomDrag(e, moveable.state, [e.deltaX, e.deltaY], !!isPinch, false, "resizable")), { + resolveMatrix: true, + parentDistance: parentDistance + })); + + if (resizeEvent) { + resize = resizeEvent; + transformEvent = fillAfterTransform(transformEvent, resizeEvent, e); + } + } + + var params = fillParams(moveable, e, __assign(__assign({ + delta: delta, + dist: dist, + rotate: rotation, + rotation: rotation, + beforeDist: beforeDist, + beforeDelta: beforeDelta, + beforeRotate: beforeRotation, + beforeRotation: beforeRotation, + absoluteDist: absoluteDist, + absoluteDelta: absoluteDelta, + absoluteRotate: absoluteRotation, + absoluteRotation: absoluteRotation, + isPinch: !!isPinch, + resize: resize + }, dragEvent), transformEvent)); + triggerEvent(moveable, "onRotate", params); + return params; + }, + dragControlEnd: function (moveable, e) { + var datas = e.datas; + + if (!datas.isRotate) { + return; + } + + datas.isRotate = false; + var params = fillEndParams(moveable, e, {}); + triggerEvent(moveable, "onRotateEnd", params); + return params; + }, + dragGroupControlCondition: dragControlCondition, + dragGroupControlStart: function (moveable, e) { + var datas = e.datas; + var _a = moveable.state, + parentLeft = _a.left, + parentTop = _a.top, + parentBeforeOrigin = _a.beforeOrigin; + var params = this.dragControlStart(moveable, e); + + if (!params) { + return false; + } + + params.set(datas.beforeDirection * moveable.rotation); + var events = triggerChildAbles(moveable, this, "dragControlStart", e, function (child, ev) { + var _a = child.state, + left = _a.left, + top = _a.top, + beforeOrigin = _a.beforeOrigin; + var childClient = plus(minus([left, top], [parentLeft, parentTop]), minus(beforeOrigin, parentBeforeOrigin)); + ev.datas.startGroupClient = childClient; + ev.datas.groupClient = childClient; + return __assign(__assign({}, ev), { + parentRotate: 0 + }); + }); + + var nextParams = __assign(__assign({}, params), { + targets: moveable.props.targets, + events: events + }); + + var result = triggerEvent(moveable, "onRotateGroupStart", nextParams); + datas.isRotate = result !== false; + return datas.isRotate ? params : false; + }, + dragGroupControl: function (moveable, e) { + var datas = e.datas; + + if (!datas.isRotate) { + return; + } + + catchEvent(moveable, "onBeforeRotate", function (parentEvent) { + triggerEvent(moveable, "onBeforeRotateGroup", fillParams(moveable, e, __assign(__assign({}, parentEvent), { + targets: moveable.props.targets + }), true)); + }); + var params = this.dragControl(moveable, e); + + if (!params) { + return; + } + + var direction = datas.beforeDirection; + var parentRotate = params.beforeDist; + var rad = parentRotate / 180 * Math.PI; + var events = triggerChildAbles(moveable, this, "dragControl", e, function (_, ev) { + var startGroupClient = ev.datas.startGroupClient; + + var _a = __read(ev.datas.groupClient, 2), + prevClientX = _a[0], + prevClientY = _a[1]; + + var _b = __read(rotate(startGroupClient, rad * direction), 2), + clientX = _b[0], + clientY = _b[1]; + + var delta = [clientX - prevClientX, clientY - prevClientY]; + ev.datas.groupClient = [clientX, clientY]; + return __assign(__assign({}, ev), { + parentRotate: parentRotate, + groupDelta: delta + }); + }); + moveable.rotation = direction * params.beforeRotation; + + var nextParams = __assign({ + targets: moveable.props.targets, + events: events, + set: function (rotation) { + moveable.rotation = rotation; + }, + setGroupRotation: function (rotation) { + moveable.rotation = rotation; + } + }, params); + + triggerEvent(moveable, "onRotateGroup", nextParams); + return nextParams; + }, + dragGroupControlEnd: function (moveable, e) { + var isDrag = e.isDrag, + datas = e.datas; + + if (!datas.isRotate) { + return; + } + + this.dragControlEnd(moveable, e); + var events = triggerChildAbles(moveable, this, "dragControlEnd", e); + var nextParams = fillEndParams(moveable, e, { + targets: moveable.props.targets, + events: events + }); + triggerEvent(moveable, "onRotateGroupEnd", nextParams); + return isDrag; + }, + + /** + * @method Moveable.Rotatable#request + * @param {object} [e] - the Resizable's request parameter + * @param {number} [e.deltaRotate=0] - delta number of rotation + * @param {number} [e.rotate=0] - absolute number of moveable's rotation + * @return {Moveable.Requester} Moveable Requester + * @example + * // Instantly Request (requestStart - request - requestEnd) + * moveable.request("rotatable", { deltaRotate: 10 }, true); + * + * * moveable.request("rotatable", { rotate: 10 }, true); + * + * // requestStart + * const requester = moveable.request("rotatable"); + * + * // request + * requester.request({ deltaRotate: 10 }); + * requester.request({ deltaRotate: 10 }); + * requester.request({ deltaRotate: 10 }); + * + * requester.request({ rotate: 10 }); + * requester.request({ rotate: 20 }); + * requester.request({ rotate: 30 }); + * + * // requestEnd + * requester.requestEnd(); + */ + request: function (moveable) { + var datas = {}; + var distRotate = 0; + var startRotation = moveable.getRotation(); + return { + isControl: true, + requestStart: function () { + return { + datas: datas + }; + }, + request: function (e) { + if ("deltaRotate" in e) { + distRotate += e.deltaRotate; + } else if ("rotate" in e) { + distRotate = e.rotate - startRotation; + } + + return { + datas: datas, + parentDist: distRotate + }; + }, + requestEnd: function () { + return { + datas: datas, + isDrag: true + }; + } + }; + } + }; + /** + * Whether or not target can be rotated. (default: false) + * @name Moveable.Rotatable#rotatable + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * moveable.rotatable = true; + */ + + /** + * You can specify the position of the rotation. (default: "top") + * @name Moveable.Rotatable#rotationPosition + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * rotationPosition: "top", + * }); + * + * moveable.rotationPosition = "bottom" + */ + + /** + * throttle of angle(degree) when rotate. + * @name Moveable.Rotatable#throttleRotate + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * moveable.throttleRotate = 1; + */ + + /** + * When the rotate starts, the rotateStart event is called. + * @memberof Moveable.Rotatable + * @event rotateStart + * @param {Moveable.Rotatable.OnRotateStart} - Parameters for the rotateStart event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { rotatable: true }); + * moveable.on("rotateStart", ({ target }) => { + * console.log(target); + * }); + */ + + /** + * When rotating, the rotate event is called. + * @memberof Moveable.Rotatable + * @event rotate + * @param {Moveable.Rotatable.OnRotate} - Parameters for the rotate event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { rotatable: true }); + * moveable.on("rotate", ({ target, transform, dist }) => { + * target.style.transform = transform; + * }); + */ + + /** + * When the rotate finishes, the rotateEnd event is called. + * @memberof Moveable.Rotatable + * @event rotateEnd + * @param {Moveable.Rotatable.OnRotateEnd} - Parameters for the rotateEnd event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { rotatable: true }); + * moveable.on("rotateEnd", ({ target, isDrag }) => { + * console.log(target, isDrag); + * }); + */ + + /** + * When the group rotate starts, the `rotateGroupStart` event is called. + * @memberof Moveable.Rotatable + * @event rotateGroupStart + * @param {Moveable.Rotatable.OnRotateGroupStart} - Parameters for the `rotateGroupStart` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: [].slice.call(document.querySelectorAll(".target")), + * rotatable: true + * }); + * moveable.on("rotateGroupStart", ({ targets }) => { + * console.log("onRotateGroupStart", targets); + * }); + */ + + /** + * When the group rotate, the `rotateGroup` event is called. + * @memberof Moveable.Rotatable + * @event rotateGroup + * @param {Moveable.Rotatable.OnRotateGroup} - Parameters for the `rotateGroup` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: [].slice.call(document.querySelectorAll(".target")), + * rotatable: true + * }); + * moveable.on("rotateGroup", ({ targets, events }) => { + * console.log("onRotateGroup", targets); + * events.forEach(ev => { + * const target = ev.target; + * // ev.drag is a drag event that occurs when the group rotate. + * const left = ev.drag.beforeDist[0]; + * const top = ev.drag.beforeDist[1]; + * const deg = ev.beforeDist; + * }); + * }); + */ + + /** + * When the group rotate finishes, the `rotateGroupEnd` event is called. + * @memberof Moveable.Rotatable + * @event rotateGroupEnd + * @param {Moveable.Rotatable.OnRotateGroupEnd} - Parameters for the `rotateGroupEnd` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: [].slice.call(document.querySelectorAll(".target")), + * rotatable: true + * }); + * moveable.on("rotateGroupEnd", ({ targets, isDrag }) => { + * console.log("onRotateGroupEnd", targets, isDrag); + * }); + */ + + function renderGuideline(info, React) { + var _a; + + var direction = info.direction, + classNames = info.classNames, + size = info.size, + pos = info.pos, + zoom = info.zoom, + key = info.key; + var isHorizontal = direction === "horizontal"; + var scaleType = isHorizontal ? "Y" : "X"; // const scaleType2 = isHorizontal ? "Y" : "X"; + + return React.createElement("div", { + key: key, + className: classNames.join(" "), + style: (_a = {}, _a[isHorizontal ? "width" : "height"] = "".concat(size), _a.transform = "translate(".concat(pos[0], ", ").concat(pos[1], ") translate").concat(scaleType, "(-50%) scale").concat(scaleType, "(").concat(zoom, ")"), _a) + }); + } + + function renderInnerGuideline(info, React) { + return renderGuideline(__assign(__assign({}, info), { + classNames: __spreadArray([prefix("line", "guideline", info.direction)], __read(info.classNames), false).filter(function (className) { + return className; + }), + size: info.size || "".concat(info.sizeValue, "px"), + pos: info.pos || info.posValue.map(function (v) { + return "".concat(throttle(v, 0.1), "px"); + }) + }), React); + } + + function renderSnapPoses(moveable, direction, snapPoses, minPos, targetPos, size, index, React) { + var zoom = moveable.props.zoom; + return snapPoses.map(function (_a, i) { + var type = _a.type, + pos = _a.pos; + var renderPos = [0, 0]; + renderPos[index] = minPos; + renderPos[index ? 0 : 1] = -targetPos + pos; + return renderInnerGuideline({ + key: "".concat(direction, "TargetGuideline").concat(i), + classNames: [prefix("target", "bold", type)], + posValue: renderPos, + sizeValue: size, + zoom: zoom, + direction: direction + }, React); + }); + } + + function renderGuidelines(moveable, type, guidelines, targetPos, targetRect, React) { + var _a = moveable.props, + zoom = _a.zoom, + isDisplayInnerSnapDigit = _a.isDisplayInnerSnapDigit; + var mainNames = type === "horizontal" ? VERTICAL_NAMES_MAP : HORIZONTAL_NAMES_MAP; + var targetStart = targetRect[mainNames.start]; + var targetEnd = targetRect[mainNames.end]; + return guidelines.filter(function (_a) { + var hide = _a.hide, + elementRect = _a.elementRect; + + if (hide) { + return false; + } + + if (isDisplayInnerSnapDigit && elementRect) { + // inner + var rect = elementRect.rect; + + if (rect[mainNames.start] <= targetStart && targetEnd <= rect[mainNames.end]) { + return false; + } + } + + return true; + }).map(function (guideline, i) { + var pos = guideline.pos, + size = guideline.size, + element = guideline.element, + className = guideline.className; + var renderPos = [-targetPos[0] + pos[0], -targetPos[1] + pos[1]]; + return renderInnerGuideline({ + key: "".concat(type, "-default-guideline-").concat(i), + classNames: element ? [prefix("bold"), className] : [prefix("normal"), className], + direction: type, + posValue: renderPos, + sizeValue: size, + zoom: zoom + }, React); + }); + } + + function renderDigitLine(moveable, type, lineType, index, gap, renderPos, className, React) { + var _a; + + var _b = moveable.props, + _c = _b.snapDigit, + snapDigit = _c === void 0 ? 0 : _c, + _d = _b.isDisplaySnapDigit, + isDisplaySnapDigit = _d === void 0 ? true : _d, + _e = _b.snapDistFormat, + snapDistFormat = _e === void 0 ? function (v, type) { + // Type can be used render different values. + if (type === 'vertical') { + return v; + } + + return v; + } : _e, + zoom = _b.zoom; + var scaleType = type === "horizontal" ? "X" : "Y"; + var sizeName = type === "vertical" ? "height" : "width"; + var absGap = Math.abs(gap); + var snapSize = isDisplaySnapDigit ? parseFloat(absGap.toFixed(snapDigit)) : 0; + return React.createElement("div", { + key: "".concat(type, "-").concat(lineType, "-guideline-").concat(index), + className: prefix("guideline-group", type), + style: (_a = { + left: "".concat(renderPos[0], "px"), + top: "".concat(renderPos[1], "px") + }, _a[sizeName] = "".concat(absGap, "px"), _a) + }, renderInnerGuideline({ + direction: type, + classNames: [prefix(lineType), className], + size: "100%", + posValue: [0, 0], + sizeValue: absGap, + zoom: zoom + }, React), React.createElement("div", { + className: prefix("size-value", "gap"), + style: { + transform: "translate".concat(scaleType, "(-50%) scale(").concat(zoom, ")") + } + }, snapSize > 0 ? snapDistFormat(snapSize, type) : "")); + } + + function groupByElementGuidelines(type, guidelines, targetRect, isDisplayInnerSnapDigit) { + var index = type === "vertical" ? 0 : 1; + var otherIndex = type === "vertical" ? 1 : 0; + var names = index ? VERTICAL_NAMES_MAP : HORIZONTAL_NAMES_MAP; + var targetStart = targetRect[names.start]; + var targetEnd = targetRect[names.end]; + return groupBy(guidelines, function (guideline) { + return guideline.pos[index]; + }).map(function (nextGuidelines) { + var start = []; + var end = []; + var inner = []; + nextGuidelines.forEach(function (guideline) { + var _a, _b; + + var element = guideline.element; + var rect = guideline.elementRect.rect; + + if (rect[names.end] < targetStart) { + start.push(guideline); + } else if (targetEnd < rect[names.start]) { + end.push(guideline); + } else if (rect[names.start] <= targetStart && targetEnd <= rect[names.end] && isDisplayInnerSnapDigit) { + var pos = guideline.pos; + var elementRect1 = { + element: element, + rect: __assign(__assign({}, rect), (_a = {}, _a[names.end] = rect[names.start], _a)) + }; + var elementRect2 = { + element: element, + rect: __assign(__assign({}, rect), (_b = {}, _b[names.start] = rect[names.end], _b)) + }; + var nextPos1 = [0, 0]; + var nextPos2 = [0, 0]; + nextPos1[index] = pos[index]; + nextPos1[otherIndex] = pos[otherIndex]; + nextPos2[index] = pos[index]; + nextPos2[otherIndex] = pos[otherIndex] + guideline.size; + start.push({ + type: type, + pos: nextPos1, + size: 0, + elementRect: elementRect1, + direction: "", + elementDirection: "end" + }); + end.push({ + type: type, + pos: nextPos2, + size: 0, + elementRect: elementRect2, + direction: "", + elementDirection: "start" + }); // inner.push(guideline); + } + }); + start.sort(function (a, b) { + return b.pos[otherIndex] - a.pos[otherIndex]; + }); + end.sort(function (a, b) { + return a.pos[otherIndex] - b.pos[otherIndex]; + }); + return { + total: nextGuidelines, + start: start, + end: end, + inner: inner + }; + }); + } + + function renderDashedGuidelines(moveable, guidelines, targetPos, targetRect, React) { + var isDisplayInnerSnapDigit = moveable.props.isDisplayInnerSnapDigit; + var rendered = []; + ["vertical", "horizontal"].forEach(function (type) { + var nextGuidelines = guidelines.filter(function (guideline) { + return guideline.type === type; + }); + var index = type === "vertical" ? 1 : 0; + var otherIndex = index ? 0 : 1; + var groups = groupByElementGuidelines(type, nextGuidelines, targetRect, isDisplayInnerSnapDigit); + var mainNames = index ? HORIZONTAL_NAMES_MAP : VERTICAL_NAMES_MAP; + var sideNames = index ? VERTICAL_NAMES_MAP : HORIZONTAL_NAMES_MAP; + var targetStart = targetRect[mainNames.start]; + var targetEnd = targetRect[mainNames.end]; + groups.forEach(function (_a) { + var total = _a.total, + start = _a.start, + end = _a.end, + inner = _a.inner; + var sidePos = targetPos[otherIndex] + total[0].pos[otherIndex] - targetRect[sideNames.start]; + var prevRect = targetRect; + start.forEach(function (guideline) { + var nextRect = guideline.elementRect.rect; + var size = prevRect[mainNames.start] - nextRect[mainNames.end]; + + if (size > 0) { + var renderPos = [0, 0]; + renderPos[index] = targetPos[index] + prevRect[mainNames.start] - targetStart - size; + renderPos[otherIndex] = sidePos; + rendered.push(renderDigitLine(moveable, type, "dashed", rendered.length, size, renderPos, guideline.className, React)); + } + + prevRect = nextRect; + }); + prevRect = targetRect; + end.forEach(function (guideline) { + var nextRect = guideline.elementRect.rect; + var size = nextRect[mainNames.start] - prevRect[mainNames.end]; + + if (size > 0) { + var renderPos = [0, 0]; + renderPos[index] = targetPos[index] + prevRect[mainNames.end] - targetStart; + renderPos[otherIndex] = sidePos; + rendered.push(renderDigitLine(moveable, type, "dashed", rendered.length, size, renderPos, guideline.className, React)); + } + + prevRect = nextRect; + }); + inner.forEach(function (guideline) { + var nextRect = guideline.elementRect.rect; + var size1 = targetStart - nextRect[mainNames.start]; + var size2 = nextRect[mainNames.end] - targetEnd; + var renderPos1 = [0, 0]; + var renderPos2 = [0, 0]; + renderPos1[index] = targetPos[index] - size1; + renderPos1[otherIndex] = sidePos; + renderPos2[index] = targetPos[index] + targetEnd - targetStart; + renderPos2[otherIndex] = sidePos; + rendered.push(renderDigitLine(moveable, type, "dashed", rendered.length, size1, renderPos1, guideline.className, React)); + rendered.push(renderDigitLine(moveable, type, "dashed", rendered.length, size2, renderPos2, guideline.className, React)); + }); + }); + }); + return rendered; + } + + function renderGapGuidelines(moveable, guidelines, targetPos, targetRect, React) { + var rendered = []; + ["horizontal", "vertical"].forEach(function (type) { + var nextGuidelines = guidelines.filter(function (guideline) { + return guideline.type === type; + }).slice(0, 1); + var index = type === "vertical" ? 0 : 1; + var otherIndex = index ? 0 : 1; + var mainNames = index ? HORIZONTAL_NAMES_MAP : VERTICAL_NAMES_MAP; + var sideNames = index ? VERTICAL_NAMES_MAP : HORIZONTAL_NAMES_MAP; + var targetStart = targetRect[mainNames.start]; + var targetEnd = targetRect[mainNames.end]; + var targetSideStart = targetRect[sideNames.start]; + var targetSideEnd = targetRect[sideNames.end]; + nextGuidelines.forEach(function (_a) { + var gap = _a.gap, + gapRects = _a.gapRects; + var sideStartPos = Math.max.apply(Math, __spreadArray([targetSideStart], __read(gapRects.map(function (_a) { + var rect = _a.rect; + return rect[sideNames.start]; + })), false)); + var sideEndPos = Math.min.apply(Math, __spreadArray([targetSideEnd], __read(gapRects.map(function (_a) { + var rect = _a.rect; + return rect[sideNames.end]; + })), false)); + var sideCenterPos = (sideStartPos + sideEndPos) / 2; + + if (sideStartPos === sideEndPos || sideCenterPos === (targetSideStart + targetSideEnd) / 2) { + return; + } + + gapRects.forEach(function (_a) { + var rect = _a.rect, + className = _a.className; + var renderPos = [targetPos[0], targetPos[1]]; + + if (rect[mainNames.end] < targetStart) { + renderPos[index] += rect[mainNames.end] - targetStart; + } else if (targetEnd < rect[mainNames.start]) { + renderPos[index] += rect[mainNames.start] - targetStart - gap; + } else { + return; + } + + renderPos[otherIndex] += sideCenterPos - targetSideStart; + rendered.push(renderDigitLine(moveable, index ? "vertical" : "horizontal", "gap", rendered.length, gap, renderPos, className, React)); + }); + }); + }); + return rendered; + } + + function getTotalGuidelines(moveable) { + var _a, _b; + + var state = moveable.state; + var containerClientRect = state.containerClientRect, + hasFixed = state.hasFixed; + var overflow = containerClientRect.overflow, + containerHeight = containerClientRect.scrollHeight, + containerWidth = containerClientRect.scrollWidth, + containerClientHeight = containerClientRect.clientHeight, + containerClientWidth = containerClientRect.clientWidth, + clientLeft = containerClientRect.clientLeft, + clientTop = containerClientRect.clientTop; + var _c = moveable.props, + _d = _c.snapGap, + snapGap = _d === void 0 ? true : _d, + verticalGuidelines = _c.verticalGuidelines, + horizontalGuidelines = _c.horizontalGuidelines, + _e = _c.snapThreshold, + snapThreshold = _e === void 0 ? 5 : _e, + _f = _c.maxSnapElementGuidelineDistance, + maxSnapElementGuidelineDistance = _f === void 0 ? Infinity : _f, + isDisplayGridGuidelines = _c.isDisplayGridGuidelines; + + var _g = getRect(getAbsolutePosesByState(moveable.state)), + top = _g.top, + left = _g.left, + bottom = _g.bottom, + right = _g.right; + + var targetRect = { + top: top, + left: left, + bottom: bottom, + right: right, + center: (left + right) / 2, + middle: (top + bottom) / 2 + }; + var elementGuidelines = getElementGuidelines(moveable); + + var totalGuidelines = __spreadArray([], __read(elementGuidelines), false); + + var snapThresholdMultiples = ((_b = (_a = state.snapThresholdInfo) === null || _a === void 0 ? void 0 : _a.multiples) !== null && _b !== void 0 ? _b : [1, 1]).map(function (n) { + return n * snapThreshold; + }); + + if (snapGap) { + totalGuidelines.push.apply(totalGuidelines, __spreadArray([], __read(getGapGuidelines(moveable, targetRect, snapThresholdMultiples)), false)); + } + + var snapOffset = __assign({}, state.snapOffset || { + left: 0, + top: 0, + bottom: 0, + right: 0 + }); + + totalGuidelines.push.apply(totalGuidelines, __spreadArray([], __read(getGridGuidelines(moveable, overflow ? containerWidth : containerClientWidth, overflow ? containerHeight : containerClientHeight, clientLeft, clientTop, snapOffset, isDisplayGridGuidelines)), false)); + + if (hasFixed) { + var left_1 = containerClientRect.left, + top_1 = containerClientRect.top; + snapOffset.left += left_1; + snapOffset.top += top_1; + snapOffset.right += left_1; + snapOffset.bottom += top_1; + } + + totalGuidelines.push.apply(totalGuidelines, __spreadArray([], __read(getDefaultGuidelines(horizontalGuidelines || false, verticalGuidelines || false, overflow ? containerWidth : containerClientWidth, overflow ? containerHeight : containerClientHeight, clientLeft, clientTop, snapOffset)), false)); + totalGuidelines = totalGuidelines.filter(function (_a) { + var element = _a.element, + elementRect = _a.elementRect, + type = _a.type; + + if (!element || !elementRect) { + return true; + } + + var rect = elementRect.rect; + return checkBetweenRects(targetRect, rect, type, maxSnapElementGuidelineDistance); + }); + return totalGuidelines; + } + + function getGapGuidelines(moveable, targetRect, snapThresholds) { + var _a = moveable.props, + _b = _a.maxSnapElementGuidelineDistance, + maxSnapElementGuidelineDistance = _b === void 0 ? Infinity : _b, + _c = _a.maxSnapElementGapDistance, + maxSnapElementGapDistance = _c === void 0 ? Infinity : _c; + var elementRects = moveable.state.elementRects; + var gapGuidelines = []; + [["vertical", VERTICAL_NAMES_MAP, HORIZONTAL_NAMES_MAP], ["horizontal", HORIZONTAL_NAMES_MAP, VERTICAL_NAMES_MAP]].forEach(function (_a) { + var _b = __read(_a, 3), + type = _b[0], + mainNames = _b[1], + sideNames = _b[2]; + + var targetStart = targetRect[mainNames.start]; + var targetEnd = targetRect[mainNames.end]; + var targetCenter = targetRect[mainNames.center]; + var targetStart2 = targetRect[sideNames.start]; + var targetEnd2 = targetRect[sideNames.end]; // element : moveable + + var snapThresholdMap = { + left: snapThresholds[0], + top: snapThresholds[1] + }; + + function getDist(elementRect) { + var rect = elementRect.rect; + var snapThreshold = snapThresholdMap[mainNames.start]; + + if (rect[mainNames.end] < targetStart + snapThreshold) { + return targetStart - rect[mainNames.end]; + } else if (targetEnd - snapThreshold < rect[mainNames.start]) { + return rect[mainNames.start] - targetEnd; + } else { + return -1; + } + } + + var nextElementRects = elementRects.filter(function (elementRect) { + var rect = elementRect.rect; + + if (rect[sideNames.start] > targetEnd2 || rect[sideNames.end] < targetStart2) { + return false; + } + + return getDist(elementRect) > 0; + }).sort(function (a, b) { + return getDist(a) - getDist(b); + }); + var groups = []; + nextElementRects.forEach(function (snapRect1) { + nextElementRects.forEach(function (snapRect2) { + if (snapRect1 === snapRect2) { + return; + } + + var rect1 = snapRect1.rect; + var rect2 = snapRect2.rect; + var rect1Start = rect1[sideNames.start]; + var rect1End = rect1[sideNames.end]; + var rect2Start = rect2[sideNames.start]; + var rect2End = rect2[sideNames.end]; + + if (rect1Start > rect2End || rect2Start > rect1End) { + return; + } + + groups.push([snapRect1, snapRect2]); + }); + }); + groups.forEach(function (_a) { + var _b = __read(_a, 2), + snapRect1 = _b[0], + snapRect2 = _b[1]; + + var rect1 = snapRect1.rect; + var rect2 = snapRect2.rect; + var rect1Start = rect1[mainNames.start]; + var rect1End = rect1[mainNames.end]; + var rect2Start = rect2[mainNames.start]; + var rect2End = rect2[mainNames.end]; + var snapThreshold = snapThresholdMap[mainNames.start]; + var gap = 0; + var pos = 0; + var isStart = false; + var isCenter = false; + var isEnd = false; + + if (rect1End <= targetStart && targetEnd <= rect2Start) { + // (l)element1(r) : (l)target(r) : (l)element2(r) + isCenter = true; + gap = (rect2Start - rect1End - (targetEnd - targetStart)) / 2; + pos = rect1End + gap + (targetEnd - targetStart) / 2; + + if (abs(pos - targetCenter) > snapThreshold) { + return; + } + } else if (rect1End < rect2Start && rect2End < targetStart + snapThreshold) { + // (l)element1(r) : (l)element2(r) : (l)target + isStart = true; + gap = rect2Start - rect1End; + pos = rect2End + gap; + + if (abs(pos - targetStart) > snapThreshold) { + return; + } + } else if (rect1End < rect2Start && targetEnd - snapThreshold < rect1Start) { + // target(r) : (l)element1(r) : (l)element2(r) + isEnd = true; + gap = rect2Start - rect1End; + pos = rect1Start - gap; + + if (abs(pos - targetEnd) > snapThreshold) { + return; + } + } else { + return; + } + + if (!gap) { + return; + } + + if (!checkBetweenRects(targetRect, rect2, type, maxSnapElementGuidelineDistance)) { + return; + } + + if (gap > maxSnapElementGapDistance) { + return; + } + + gapGuidelines.push({ + type: type, + pos: type === "vertical" ? [pos, 0] : [0, pos], + element: snapRect2.element, + size: 0, + className: snapRect2.className, + isStart: isStart, + isCenter: isCenter, + isEnd: isEnd, + gap: gap, + hide: true, + gapRects: [snapRect1, snapRect2], + direction: "", + elementDirection: "" + }); + }); + }); + return gapGuidelines; + } + + function startGridGroupGuidelines(moveable, clientLeft, clientTop, snapOffset) { + var _a, _b; + + var props = moveable.props; + var state = moveable.state; + var snapGridAll = props.snapGridAll; + var _c = props.snapGridWidth, + snapGridWidth = _c === void 0 ? 0 : _c, + _d = props.snapGridHeight, + snapGridHeight = _d === void 0 ? 0 : _d; + var snapRenderInfo = state.snapRenderInfo; + var hasDirection = snapRenderInfo && (((_a = snapRenderInfo.direction) === null || _a === void 0 ? void 0 : _a[0]) || ((_b = snapRenderInfo.direction) === null || _b === void 0 ? void 0 : _b[1])); + var moveables = moveable.moveables; // snap group's all child to grid. + + if (snapGridAll && moveables && hasDirection && (snapGridWidth || snapGridHeight)) { + if (state.snapThresholdInfo) { + return; + } + + state.snapThresholdInfo = { + multiples: [1, 1], + offset: [0, 0] + }; + var rect_1 = moveable.getRect(); + var children_1 = rect_1.children; + var direction = snapRenderInfo.direction; + + if (children_1) { + var result = direction.map(function (dir, i) { + var _a = i === 0 ? { + snapSize: snapGridWidth, + posName: "left", + sizeName: "width", + clientOffset: snapOffset.left - clientLeft + } : { + snapSize: snapGridHeight, + posName: "top", + sizeName: "height", + clientOffset: snapOffset.top - clientTop + }, + snapSize = _a.snapSize, + posName = _a.posName, + sizeName = _a.sizeName, + clientOffset = _a.clientOffset; + + if (!snapSize) { + return { + dir: dir, + multiple: 1, + snapSize: snapSize, + snapOffset: 0 + }; + } + + var rectSize = rect_1[sizeName]; + var rectPos = rect_1[posName]; // 사이즈보다 만약 작다면 어떻게 해야되죠? + + var childSizes = flat$2(children_1.map(function (child) { + return [child[posName] - rectPos, child[sizeName], rectSize - child[sizeName] - child[posName] + rectPos]; + })).filter(function (v) { + return v; + }).sort(function (a, b) { + return a - b; + }); + var firstChildSize = childSizes[0]; + var childSnapSizes = childSizes.map(function (size) { + return throttle(size / firstChildSize, 0.1) * snapSize; + }); + var n = 1; + var rectRatio = throttle(rectSize / firstChildSize, 0.1); + + for (n = 1; n <= 10; ++n) { + if (childSnapSizes.every(function (childSize) { + return childSize * n % 1 === 0; + })) { + break; + } + } // dir 1 (fixed -1) + // dir 0 (fixed 0) + // dir -1 (fixed 1) + + + var ratio = (-dir + 1) / 2; + var offsetPos = dot(rectPos - clientOffset, rectPos - clientOffset + rectSize, ratio, 1 - ratio); + return { + multiple: rectRatio * n, + dir: dir, + snapSize: snapSize, + snapOffset: Math.round(offsetPos / snapSize) + }; + }); + var multiples = result.map(function (r) { + return r.multiple || 1; + }); + state.snapThresholdInfo.multiples = multiples; + state.snapThresholdInfo.offset = result.map(function (r) { + return r.snapOffset; + }); + result.forEach(function (r, i) { + if (r.snapSize) ; + }); + } + } else { + state.snapThresholdInfo = null; + } + } + + function getGridGuidelines(moveable, containerWidth, containerHeight, clientLeft, clientTop, snapOffset, isDisplayGridGuidelines) { + if (clientLeft === void 0) { + clientLeft = 0; + } + + if (clientTop === void 0) { + clientTop = 0; + } + + var props = moveable.props; + var state = moveable.state; + var _a = props.snapGridWidth, + snapGridWidth = _a === void 0 ? 0 : _a, + _b = props.snapGridHeight, + snapGridHeight = _b === void 0 ? 0 : _b; + var guidelines = []; + var snapOffsetLeft = snapOffset.left, + snapOffsetTop = snapOffset.top; + var startOffset = [0, 0]; + startGridGroupGuidelines(moveable, clientLeft, clientTop, snapOffset); + var snapThresholdInfo = state.snapThresholdInfo; + var defaultSnapGridWidth = snapGridWidth; + var defaultSnapGridHeight = snapGridHeight; + + if (snapThresholdInfo) { + snapGridWidth *= snapThresholdInfo.multiples[0] || 1; + snapGridHeight *= snapThresholdInfo.multiples[1] || 1; + startOffset = snapThresholdInfo.offset; + } + + if (snapGridHeight) { + var pushGuideline = function (pos) { + guidelines.push({ + type: "horizontal", + pos: [snapOffsetLeft, throttle(startOffset[1] * defaultSnapGridHeight + pos - clientTop + snapOffsetTop, 0.1)], + className: prefix("grid-guideline"), + size: containerWidth, + hide: !isDisplayGridGuidelines, + direction: "", + grid: true + }); + }; + + for (var pos = 0; pos <= containerHeight * 2; pos += snapGridHeight) { + pushGuideline(pos); + } + + for (var pos = -snapGridHeight; pos >= -containerHeight; pos -= snapGridHeight) { + pushGuideline(pos); + } + } + + if (snapGridWidth) { + var pushGuideline = function (pos) { + guidelines.push({ + type: "vertical", + pos: [throttle(startOffset[0] * defaultSnapGridWidth + pos - clientLeft + snapOffsetLeft, 0.1), snapOffsetTop], + className: prefix("grid-guideline"), + size: containerHeight, + hide: !isDisplayGridGuidelines, + direction: "", + grid: true + }); + }; + + for (var pos = 0; pos <= containerWidth * 2; pos += snapGridWidth) { + pushGuideline(pos); + } + + for (var pos = -snapGridWidth; pos >= -containerWidth; pos -= snapGridWidth) { + pushGuideline(pos); + } + } + + return guidelines; + } + + function checkBetweenRects(rect1, rect2, type, distance) { + if (type === "horizontal") { + return abs(rect1.right - rect2.left) <= distance || abs(rect1.left - rect2.right) <= distance || rect1.left <= rect2.right && rect2.left <= rect1.right; + } else if (type === "vertical") { + return abs(rect1.bottom - rect2.top) <= distance || abs(rect1.top - rect2.bottom) <= distance || rect1.top <= rect2.bottom && rect2.top <= rect1.bottom; + } + + return true; + } + + function getElementGuidelines(moveable) { + var state = moveable.state; + var _a = moveable.props.elementGuidelines, + elementGuidelines = _a === void 0 ? [] : _a; + + if (!elementGuidelines.length) { + state.elementRects = []; + return []; + } + + var prevValues = (state.elementRects || []).filter(function (snapRect) { + return !snapRect.refresh; + }); + var nextElementGuidelines = elementGuidelines.map(function (el) { + if (isObject(el) && "element" in el) { + return __assign(__assign({}, el), { + element: getRefTarget(el.element, true) + }); + } + + return { + element: getRefTarget(el, true) + }; + }).filter(function (value) { + return value.element; + }); + + var _b = diff(prevValues.map(function (v) { + return v.element; + }), nextElementGuidelines.map(function (v) { + return v.element; + })), + maintained = _b.maintained, + added = _b.added; + + var nextValues = []; + maintained.forEach(function (_a) { + var _b = __read(_a, 2), + prevIndex = _b[0], + nextIndex = _b[1]; + + nextValues[nextIndex] = prevValues[prevIndex]; + }); + getSnapElementRects(moveable, added.map(function (index) { + return nextElementGuidelines[index]; + })).map(function (rect, i) { + nextValues[added[i]] = rect; + }); + state.elementRects = nextValues; + var elementSnapDirections = getSnapDirections(moveable.props.elementSnapDirections); + var nextGuidelines = []; + nextValues.forEach(function (snapRect) { + var element = snapRect.element, + _a = snapRect.top, + topValue = _a === void 0 ? elementSnapDirections.top : _a, + _b = snapRect.left, + leftValue = _b === void 0 ? elementSnapDirections.left : _b, + _c = snapRect.right, + rightValue = _c === void 0 ? elementSnapDirections.right : _c, + _d = snapRect.bottom, + bottomValue = _d === void 0 ? elementSnapDirections.bottom : _d, + _e = snapRect.center, + centerValue = _e === void 0 ? elementSnapDirections.center : _e, + _f = snapRect.middle, + middleValue = _f === void 0 ? elementSnapDirections.middle : _f, + className = snapRect.className, + rect = snapRect.rect; + + var _g = splitSnapDirectionPoses({ + top: topValue, + right: rightValue, + left: leftValue, + bottom: bottomValue, + center: centerValue, + middle: middleValue + }, rect), + horizontal = _g.horizontal, + vertical = _g.vertical, + horizontalNames = _g.horizontalNames, + verticalNames = _g.verticalNames; + + var rectTop = rect.top; + var rectLeft = rect.left; + var width = rect.right - rectLeft; + var height = rect.bottom - rectTop; + var sizes = [width, height]; + vertical.forEach(function (pos, i) { + nextGuidelines.push({ + type: "vertical", + element: element, + pos: [throttle(pos, 0.1), rectTop], + size: height, + sizes: sizes, + className: className, + elementRect: snapRect, + elementDirection: SNAP_SKIP_NAMES_MAP[verticalNames[i]] || verticalNames[i], + direction: "" + }); + }); + horizontal.forEach(function (pos, i) { + nextGuidelines.push({ + type: "horizontal", + element: element, + pos: [rectLeft, throttle(pos, 0.1)], + size: width, + sizes: sizes, + className: className, + elementRect: snapRect, + elementDirection: SNAP_SKIP_NAMES_MAP[horizontalNames[i]] || horizontalNames[i], + direction: "" + }); + }); + }); + return nextGuidelines; + } + + function getObjectGuidelines(guidelines, containerSize) { + return guidelines ? guidelines.map(function (info) { + var posGuideline = isObject(info) ? info : { + pos: info + }; + var pos = posGuideline.pos; + + if (isNumber(pos)) { + return posGuideline; + } else { + return __assign(__assign({}, posGuideline), { + pos: convertUnitSize(pos, containerSize) + }); + } + }) : []; + } + + function getDefaultGuidelines(horizontalGuidelines, verticalGuidelines, width, height, clientLeft, clientTop, snapOffset) { + if (clientLeft === void 0) { + clientLeft = 0; + } + + if (clientTop === void 0) { + clientTop = 0; + } + + if (snapOffset === void 0) { + snapOffset = { + left: 0, + top: 0, + right: 0, + bottom: 0 + }; + } + + var guidelines = []; + var snapOffsetLeft = snapOffset.left, + snapOffsetTop = snapOffset.top, + snapOffsetBottom = snapOffset.bottom, + snapOffsetRight = snapOffset.right; + var snapWidth = width + snapOffsetRight - snapOffsetLeft; + var snapHeight = height + snapOffsetBottom - snapOffsetTop; + getObjectGuidelines(horizontalGuidelines, snapHeight).forEach(function (posInfo) { + guidelines.push({ + type: "horizontal", + pos: [snapOffsetLeft, throttle(posInfo.pos - clientTop + snapOffsetTop, 0.1)], + size: snapWidth, + className: posInfo.className, + direction: "" + }); + }); + getObjectGuidelines(verticalGuidelines, snapWidth).forEach(function (posInfo) { + guidelines.push({ + type: "vertical", + pos: [throttle(posInfo.pos - clientLeft + snapOffsetLeft, 0.1), snapOffsetTop], + size: snapHeight, + className: posInfo.className, + direction: "" + }); + }); + return guidelines; + } + + function getSnapElementRects(moveable, values) { + if (!values.length) { + return []; + } + + var groupable = moveable.props.groupable; + var state = moveable.state; + var containerClientRect = state.containerClientRect, + // targetClientRect: { + // top: clientTop, + // left: clientLeft, + // }, + rootMatrix = state.rootMatrix, + is3d = state.is3d, + offsetDelta = state.offsetDelta; + var n = is3d ? 4 : 3; + + var _a = __read(calculateContainerPos(rootMatrix, containerClientRect, n), 2), + containerLeft = _a[0], + containerTop = _a[1]; // const poses = getAbsolutePosesByState(state); + // const { + // minX: targetLeft, + // minY: targetTop, + // } = getMinMaxs(poses); + // const [distLeft, distTop] = minus([targetLeft, targetTop], calculateInversePosition(rootMatrix, [ + // clientLeft - containerLeft, + // clientTop - containerTop, + // ], n)).map(pos => roundSign(pos)); + + + var offsetLeft = groupable ? 0 : offsetDelta[0]; + var offsetTop = groupable ? 0 : offsetDelta[1]; + return values.map(function (value) { + var rect = value.element.getBoundingClientRect(); + var left = rect.left - containerLeft - offsetLeft; + var top = rect.top - containerTop - offsetTop; + var bottom = top + rect.height; + var right = left + rect.width; + + var _a = __read(calculateInversePosition(rootMatrix, [left, top], n), 2), + elementLeft = _a[0], + elementTop = _a[1]; + + var _b = __read(calculateInversePosition(rootMatrix, [right, bottom], n), 2), + elementRight = _b[0], + elementBottom = _b[1]; + + return __assign(__assign({}, value), { + rect: { + left: elementLeft, + right: elementRight, + top: elementTop, + bottom: elementBottom, + center: (elementLeft + elementRight) / 2, + middle: (elementTop + elementBottom) / 2 + } + }); + }); + } + + function checkSnapInfo(moveable) { + var state = moveable.state; + var container = state.container; + var snapContainer = moveable.props.snapContainer || container; + + if (state.snapContainer === snapContainer && state.guidelines && state.guidelines.length) { + return false; + } + + var containerClientRect = state.containerClientRect; + var snapOffset = { + left: 0, + top: 0, + bottom: 0, + right: 0 + }; + + if (container !== snapContainer) { + var snapContainerTarget = getRefTarget(snapContainer, true); + + if (snapContainerTarget) { + var snapContainerRect = getClientRect(snapContainerTarget); + var offset1 = getDragDistByState(state, [snapContainerRect.left - containerClientRect.left, snapContainerRect.top - containerClientRect.top]); + var offset2 = getDragDistByState(state, [snapContainerRect.right - containerClientRect.right, snapContainerRect.bottom - containerClientRect.bottom]); + snapOffset.left = throttle(offset1[0], 0.00001); + snapOffset.top = throttle(offset1[1], 0.00001); + snapOffset.right = throttle(offset2[0], 0.00001); + snapOffset.bottom = throttle(offset2[1], 0.00001); + } + } + + state.snapContainer = snapContainer; + state.snapOffset = snapOffset; + state.guidelines = getTotalGuidelines(moveable); + state.enableSnap = true; + return true; + } + + function getNextFixedPoses(matrix, width, height, fixedDirection, fixedPos, is3d) { + var nextPoses = calculatePoses(matrix, width, height, is3d ? 4 : 3); + var nextFixedPos = getPosByDirection(nextPoses, fixedDirection); + return getAbsolutePoses(nextPoses, minus(fixedPos, nextFixedPos)); + } + + function normalized(value) { + return value ? value / abs(value) : 0; + } + + function getSizeOffsetInfo(moveable, poses, direction, keepRatio, isRequest, datas) { + var fixedDirection = datas.fixedDirection; + var directions = getCheckSnapDirections(direction, fixedDirection, keepRatio); + var innerBoundLineInfos = getCheckInnerBoundLineInfos(moveable, poses, direction, keepRatio); + + var offsets = __spreadArray(__spreadArray([], __read(getSnapBoundInfo(moveable, poses, directions, keepRatio, isRequest, datas)), false), __read(getInnerBoundInfo(moveable, innerBoundLineInfos, datas)), false); + + var widthOffsetInfo = getNearOffsetInfo(offsets, 0); + var heightOffsetInfo = getNearOffsetInfo(offsets, 1); + return { + width: { + isBound: widthOffsetInfo.isBound, + offset: widthOffsetInfo.offset[0] + }, + height: { + isBound: heightOffsetInfo.isBound, + offset: heightOffsetInfo.offset[1] + } + }; + } + + function recheckSizeByTwoDirection(moveable, poses, width, height, maxWidth, maxHeight, direction, isRequest, datas) { + var snapPos = getPosByDirection(poses, direction); + + var _a = checkMoveableSnapBounds(moveable, isRequest, { + vertical: [snapPos[0]], + horizontal: [snapPos[1]] + }), + horizontalOffset = _a.horizontal.offset, + verticalOffset = _a.vertical.offset; + + if (throttle(verticalOffset, FLOAT_POINT_NUM) || throttle(horizontalOffset, FLOAT_POINT_NUM)) { + var _b = __read(getDragDist({ + datas: datas, + distX: -verticalOffset, + distY: -horizontalOffset + }), 2), + nextWidthOffset = _b[0], + nextHeightOffset = _b[1]; + + var nextWidth = Math.min(maxWidth || Infinity, width + direction[0] * nextWidthOffset); + var nextHeight = Math.min(maxHeight || Infinity, height + direction[1] * nextHeightOffset); + return [nextWidth - width, nextHeight - height]; + } + + return [0, 0]; + } + + function checkSizeDist(moveable, getNextPoses, width, height, direction, fixedPosition, isRequest, datas) { + var poses = getAbsolutePosesByState(moveable.state); + var keepRatio = moveable.props.keepRatio; + var widthOffset = 0; + var heightOffset = 0; + + for (var i = 0; i < 2; ++i) { + var nextPoses = getNextPoses(widthOffset, heightOffset); + + var _a = getSizeOffsetInfo(moveable, nextPoses, direction, keepRatio, isRequest, datas), + widthOffsetInfo = _a.width, + heightOffsetInfo = _a.height; + + var isWidthBound = widthOffsetInfo.isBound; + var isHeightBound = heightOffsetInfo.isBound; + var nextWidthOffset = widthOffsetInfo.offset; + var nextHeightOffset = heightOffsetInfo.offset; + + if (i === 1) { + if (!isWidthBound) { + nextWidthOffset = 0; + } + + if (!isHeightBound) { + nextHeightOffset = 0; + } + } + + if (i === 0 && isRequest && !isWidthBound && !isHeightBound) { + return [0, 0]; + } + + if (keepRatio) { + var widthDist = abs(nextWidthOffset) * (width ? 1 / width : 1); + var heightDist = abs(nextHeightOffset) * (height ? 1 / height : 1); + var isGetWidthOffset = isWidthBound && isHeightBound ? widthDist < heightDist : isHeightBound || !isWidthBound && widthDist < heightDist; + + if (isGetWidthOffset) { + // width : height = ? : heightOffset + nextWidthOffset = width * nextHeightOffset / height; + } else { + // width : height = widthOffset : ? + nextHeightOffset = height * nextWidthOffset / width; + } + } + + widthOffset += nextWidthOffset; + heightOffset += nextHeightOffset; + } + + if (!keepRatio && direction[0] && direction[1]) { + var _b = checkMaxBounds(moveable, poses, direction, fixedPosition, datas), + maxWidth = _b.maxWidth, + maxHeight = _b.maxHeight; + + var _c = __read(recheckSizeByTwoDirection(moveable, getNextPoses(widthOffset, heightOffset).map(function (pos) { + return pos.map(function (p) { + return throttle(p, FLOAT_POINT_NUM); + }); + }), width + widthOffset, height + heightOffset, maxWidth, maxHeight, direction, isRequest, datas), 2), + nextWidthOffset = _c[0], + nextHeightOffset = _c[1]; + + widthOffset += nextWidthOffset; + heightOffset += nextHeightOffset; + } + + return [widthOffset, heightOffset]; + } + + function absDegree(deg) { + if (deg < 0) { + deg = deg % 360 + 360; + } + + deg %= 360; + return deg; + } + + function bumpDegree(baseDeg, snapDeg) { + // baseDeg -80 + // snapDeg 270 + // return -90 + snapDeg = absDegree(snapDeg); + var count = Math.floor(baseDeg / 360); + var deg1 = count * 360 + 360 - snapDeg; + var deg2 = count * 360 + snapDeg; + return abs(baseDeg - deg1) < abs(baseDeg - deg2) ? deg1 : deg2; + } + + function getMinDegreeDistance(deg1, deg2) { + deg1 = absDegree(deg1); + deg2 = absDegree(deg2); + var deg3 = absDegree(deg1 - deg2); + return Math.min(deg3, 360 - deg3); + } + + function checkSnapRotate(moveable, rect, dist, rotation) { + var _a; + + var props = moveable.props; + var snapRotationThreshold = (_a = props[NAME_snapRotationThreshold]) !== null && _a !== void 0 ? _a : 5; + var snapRotationDegrees = props[NAME_snapRotationDegrees]; + + if (hasGuidelines(moveable, "rotatable")) { + var pos1 = rect.pos1, + pos2 = rect.pos2, + pos3 = rect.pos3, + pos4 = rect.pos4, + origin2_1 = rect.origin; + var rad_1 = dist * Math.PI / 180; + var prevPoses = [pos1, pos2, pos3, pos4].map(function (pos) { + return minus(pos, origin2_1); + }); + var nextPoses = prevPoses.map(function (pos) { + return rotate(pos, rad_1); + }); // console.log(moveable.state.left, moveable.state.top, moveable.state.origin); + // console.log(pos1, pos2, pos3, pos4, origin, rad, prevPoses, nextPoses); + + var result = __spreadArray(__spreadArray([], __read(checkRotateBounds(moveable, prevPoses, nextPoses, origin2_1, dist)), false), __read(checkRotateInnerBounds(moveable, prevPoses, nextPoses, origin2_1, dist)), false); + + result.sort(function (a, b) { + return abs(a - dist) - abs(b - dist); + }); + var isSnap = result.length > 0; + + if (isSnap) { + return { + isSnap: isSnap, + dist: isSnap ? result[0] : dist + }; + } + } + + if ((snapRotationDegrees === null || snapRotationDegrees === void 0 ? void 0 : snapRotationDegrees.length) && snapRotationThreshold) { + var sorted = snapRotationDegrees.slice().sort(function (a, b) { + return getMinDegreeDistance(a, rotation) - getMinDegreeDistance(b, rotation); + }); + var firstDegree = sorted[0]; + + if (getMinDegreeDistance(firstDegree, rotation) <= snapRotationThreshold) { + return { + isSnap: true, + dist: dist + bumpDegree(rotation, firstDegree) - rotation + }; + } + } + + return { + isSnap: false, + dist: dist + }; + } + + function checkSnapResize(moveable, width, height, direction, fixedPosition, isRequest, datas) { + if (!hasGuidelines(moveable, "resizable")) { + return [0, 0]; + } + + var fixedDirection = datas.fixedDirection, + nextAllMatrix = datas.nextAllMatrix; + var _a = moveable.state, + allMatrix = _a.allMatrix, + is3d = _a.is3d; + return checkSizeDist(moveable, function (widthOffset, heightOffset) { + return getNextFixedPoses(nextAllMatrix || allMatrix, width + widthOffset, height + heightOffset, fixedDirection, fixedPosition, is3d); + }, width, height, direction, fixedPosition, isRequest, datas); + } + + function checkSnapScale(moveable, scale, direction, isRequest, datas) { + if (!hasGuidelines(moveable, "scalable")) { + return [0, 0]; + } + + var startOffsetWidth = datas.startOffsetWidth, + startOffsetHeight = datas.startOffsetHeight, + fixedPosition = datas.fixedPosition, + fixedDirection = datas.fixedDirection, + is3d = datas.is3d; + var sizeDist = checkSizeDist(moveable, function (widthOffset, heightOffset) { + return getNextFixedPoses(scaleMatrix(datas, plus(scale, [widthOffset / startOffsetWidth, heightOffset / startOffsetHeight])), startOffsetWidth, startOffsetHeight, fixedDirection, fixedPosition, is3d); + }, startOffsetWidth, startOffsetHeight, direction, fixedPosition, isRequest, datas); + return [sizeDist[0] / startOffsetWidth, sizeDist[1] / startOffsetHeight]; + } + + function startCheckSnapDrag(moveable, datas) { + datas.absolutePoses = getAbsolutePosesByState(moveable.state); + } + + function getSnapGuidelines(posInfos) { + var guidelines = []; + posInfos.forEach(function (posInfo) { + posInfo.guidelineInfos.forEach(function (_a) { + var guideline = _a.guideline; + + if (find$1(guidelines, function (info) { + return info.guideline === guideline; + })) { + return; + } + + guideline.direction = ""; + guidelines.push({ + guideline: guideline, + posInfo: posInfo + }); + }); + }); + return guidelines.map(function (_a) { + var guideline = _a.guideline, + posInfo = _a.posInfo; + return __assign(__assign({}, guideline), { + direction: posInfo.direction + }); + }); + } + + function addBoundGuidelines(moveable, verticalPoses, horizontalPoses, verticalSnapPoses, horizontalSnapPoses, externalBounds) { + var _a = checkBoundPoses(getBounds(moveable, externalBounds), verticalPoses, horizontalPoses), + verticalBoundInfos = _a.vertical, + horizontalBoundInfos = _a.horizontal; + + var boundMap = getInitialBounds(); + verticalBoundInfos.forEach(function (info) { + if (info.isBound) { + if (info.direction === "start") { + boundMap.left = true; + } + + if (info.direction === "end") { + boundMap.right = true; + } + + verticalSnapPoses.push({ + type: "bounds", + pos: info.pos + }); + } + }); + horizontalBoundInfos.forEach(function (info) { + if (info.isBound) { + if (info.direction === "start") { + boundMap.top = true; + } + + if (info.direction === "end") { + boundMap.bottom = true; + } + + horizontalSnapPoses.push({ + type: "bounds", + pos: info.pos + }); + } + }); + + var _b = checkInnerBoundPoses(moveable), + innerBoundMap = _b.boundMap, + verticalInnerBoundPoses = _b.vertical, + horizontalInnerBoundPoses = _b.horizontal; + + verticalInnerBoundPoses.forEach(function (innerPos) { + if (findIndex(verticalSnapPoses, function (_a) { + var type = _a.type, + pos = _a.pos; + return type === "bounds" && pos === innerPos; + }) >= 0) { + return; + } + + verticalSnapPoses.push({ + type: "bounds", + pos: innerPos + }); + }); + horizontalInnerBoundPoses.forEach(function (innerPos) { + if (findIndex(horizontalSnapPoses, function (_a) { + var type = _a.type, + pos = _a.pos; + return type === "bounds" && pos === innerPos; + }) >= 0) { + return; + } + + horizontalSnapPoses.push({ + type: "bounds", + pos: innerPos + }); + }); + return { + boundMap: boundMap, + innerBoundMap: innerBoundMap + }; + } + + var directionCondition$1 = getDirectionCondition("", ["resizable", "scalable"]); + var NAME_snapRotationThreshold = "snapRotationThreshold"; + var NAME_snapRotationDegrees = "snapRotationDegrees"; + /** + * @namespace Moveable.Snappable + * @description Whether or not target can be snapped to the guideline. (default: false) + * @sort 2 + */ + + var Snappable = { + name: "snappable", + dragRelation: "strong", + props: ["snappable", "snapContainer", "snapDirections", "elementSnapDirections", "snapGap", "snapGridWidth", "snapGridHeight", "isDisplaySnapDigit", "isDisplayInnerSnapDigit", "isDisplayGridGuidelines", "snapDigit", "snapThreshold", "snapRenderThreshold", "snapGridAll", NAME_snapRotationThreshold, NAME_snapRotationDegrees, "horizontalGuidelines", "verticalGuidelines", "elementGuidelines", "bounds", "innerBounds", "snapDistFormat", "maxSnapElementGuidelineDistance", "maxSnapElementGapDistance"], + events: ["snap", "bound"], + css: [":host {\n--bounds-color: #d66;\n}\n.guideline {\npointer-events: none;\nz-index: 2;\n}\n.guideline.bounds {\nbackground: #d66;\nbackground: var(--bounds-color);\n}\n.guideline-group {\nposition: absolute;\ntop: 0;\nleft: 0;\n}\n.guideline-group .size-value {\nposition: absolute;\ncolor: #f55;\nfont-size: 12px;\nfont-size: calc(12px * var(--zoom));\nfont-weight: bold;\n}\n.guideline-group.horizontal .size-value {\ntransform-origin: 50% 100%;\ntransform: translateX(-50%);\nleft: 50%;\nbottom: 5px;\nbottom: calc(2px + 3px * var(--zoom));\n}\n.guideline-group.vertical .size-value {\ntransform-origin: 0% 50%;\ntop: 50%;\ntransform: translateY(-50%);\nleft: 5px;\nleft: calc(2px + 3px * var(--zoom));\n}\n.guideline.gap {\nbackground: #f55;\n}\n.size-value.gap {\ncolor: #f55;\n}\n"], + render: function (moveable, React) { + var state = moveable.state; + var targetTop = state.top, + targetLeft = state.left, + pos1 = state.pos1, + pos2 = state.pos2, + pos3 = state.pos3, + pos4 = state.pos4, + snapRenderInfo = state.snapRenderInfo; + var _a = moveable.props.snapRenderThreshold, + snapRenderThreshold = _a === void 0 ? 1 : _a; + + if (!snapRenderInfo || !snapRenderInfo.render || !hasGuidelines(moveable, "")) { + // reset store + watchValue(moveable, "boundMap", getInitialBounds(), function (v) { + return JSON.stringify(v); + }); + watchValue(moveable, "innerBoundMap", getInitialBounds(), function (v) { + return JSON.stringify(v); + }); + return []; + } + + state.guidelines = getTotalGuidelines(moveable); + var minLeft = Math.min(pos1[0], pos2[0], pos3[0], pos4[0]); + var minTop = Math.min(pos1[1], pos2[1], pos3[1], pos4[1]); + var externalPoses = snapRenderInfo.externalPoses || []; + var poses = getAbsolutePosesByState(moveable.state); + var verticalSnapPoses = []; + var horizontalSnapPoses = []; + var verticalGuidelines = []; + var horizontalGuidelines = []; + var snapInfos = []; + + var _b = getRect(poses), + width = _b.width, + height = _b.height, + top = _b.top, + left = _b.left, + bottom = _b.bottom, + right = _b.right; + + var targetRect = { + left: left, + right: right, + top: top, + bottom: bottom, + center: (left + right) / 2, + middle: (top + bottom) / 2 + }; + var hasExternalPoses = externalPoses.length > 0; + var externalRect = hasExternalPoses ? getRect(externalPoses) : {}; + + if (!snapRenderInfo.request) { + if (snapRenderInfo.direction) { + snapInfos.push(getSnapInfosByDirection(moveable, poses, snapRenderInfo.direction, snapRenderThreshold)); + } + + if (snapRenderInfo.snap) { + var rect = getRect(poses); + + if (snapRenderInfo.center) { + rect.middle = (rect.top + rect.bottom) / 2; + rect.center = (rect.left + rect.right) / 2; + } + + snapInfos.push(checkSnaps(moveable, rect, snapRenderThreshold)); + } + + if (hasExternalPoses) { + if (snapRenderInfo.center) { + externalRect.middle = (externalRect.top + externalRect.bottom) / 2; + externalRect.center = (externalRect.left + externalRect.right) / 2; + } + + snapInfos.push(checkSnaps(moveable, externalRect, snapRenderThreshold)); + } + + snapInfos.forEach(function (snapInfo) { + var verticalPosInfos = snapInfo.vertical.posInfos, + horizontalPosInfos = snapInfo.horizontal.posInfos; + verticalSnapPoses.push.apply(verticalSnapPoses, __spreadArray([], __read(verticalPosInfos.filter(function (_a) { + var guidelineInfos = _a.guidelineInfos; + return guidelineInfos.some(function (_a) { + var guideline = _a.guideline; + return !guideline.hide; + }); + }).map(function (posInfo) { + return { + type: "snap", + pos: posInfo.pos + }; + })), false)); + horizontalSnapPoses.push.apply(horizontalSnapPoses, __spreadArray([], __read(horizontalPosInfos.filter(function (_a) { + var guidelineInfos = _a.guidelineInfos; + return guidelineInfos.some(function (_a) { + var guideline = _a.guideline; + return !guideline.hide; + }); + }).map(function (posInfo) { + return { + type: "snap", + pos: posInfo.pos + }; + })), false)); + verticalGuidelines.push.apply(verticalGuidelines, __spreadArray([], __read(getSnapGuidelines(verticalPosInfos)), false)); + horizontalGuidelines.push.apply(horizontalGuidelines, __spreadArray([], __read(getSnapGuidelines(horizontalPosInfos)), false)); + }); + } + + var _c = addBoundGuidelines(moveable, [left, right], [top, bottom], verticalSnapPoses, horizontalSnapPoses), + boundMap = _c.boundMap, + innerBoundMap = _c.innerBoundMap; + + if (hasExternalPoses) { + addBoundGuidelines(moveable, [externalRect.left, externalRect.right], [externalRect.top, externalRect.bottom], verticalSnapPoses, horizontalSnapPoses, snapRenderInfo.externalBounds); + } + + var allGuidelines = __spreadArray(__spreadArray([], __read(verticalGuidelines), false), __read(horizontalGuidelines), false); + + var elementGuidelines = allGuidelines.filter(function (guideline) { + return guideline.element && !guideline.gapRects; + }); + var gapGuidelines = allGuidelines.filter(function (guideline) { + return guideline.gapRects; + }).sort(function (a, b) { + return a.gap - b.gap; + }); + triggerEvent(moveable, "onSnap", { + guidelines: allGuidelines.filter(function (_a) { + var element = _a.element; + return !element; + }), + elements: elementGuidelines, + gaps: gapGuidelines + }, true); + var nextBoundMap = watchValue(moveable, "boundMap", boundMap, function (v) { + return JSON.stringify(v); + }, getInitialBounds()); + var nextInnerBoundMap = watchValue(moveable, "innerBoundMap", innerBoundMap, function (v) { + return JSON.stringify(v); + }, getInitialBounds()); + + if (boundMap === nextBoundMap || innerBoundMap === nextInnerBoundMap) { + triggerEvent(moveable, "onBound", { + bounds: boundMap, + innerBounds: innerBoundMap + }, true); + } // verticalSnapPoses. + + + return __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(renderDashedGuidelines(moveable, elementGuidelines, [minLeft, minTop], targetRect, React)), false), __read(renderGapGuidelines(moveable, gapGuidelines, [minLeft, minTop], targetRect, React)), false), __read(renderGuidelines(moveable, "horizontal", horizontalGuidelines, [targetLeft, targetTop], targetRect, React)), false), __read(renderGuidelines(moveable, "vertical", verticalGuidelines, [targetLeft, targetTop], targetRect, React)), false), __read(renderSnapPoses(moveable, "horizontal", horizontalSnapPoses, minLeft, targetTop, width, 0, React)), false), __read(renderSnapPoses(moveable, "vertical", verticalSnapPoses, minTop, targetLeft, height, 1, React)), false); + }, + dragStart: function (moveable, e) { + moveable.state.snapRenderInfo = { + request: e.isRequest, + snap: true, + center: true + }; + checkSnapInfo(moveable); + }, + drag: function (moveable) { + var state = moveable.state; + + if (!checkSnapInfo(moveable)) { + state.guidelines = getTotalGuidelines(moveable); + } + + if (state.snapRenderInfo) { + state.snapRenderInfo.render = true; + } + }, + pinchStart: function (moveable) { + this.unset(moveable); + }, + dragEnd: function (moveable) { + this.unset(moveable); + }, + dragControlCondition: function (moveable, e) { + if (directionCondition$1(moveable, e) || dragControlCondition(moveable, e)) { + return true; + } + + if (!e.isRequest && e.inputEvent) { + return hasClass(e.inputEvent.target, prefix("snap-control")); + } + }, + dragControlStart: function (moveable) { + moveable.state.snapRenderInfo = null; + checkSnapInfo(moveable); + }, + dragControl: function (moveable) { + this.drag(moveable); + }, + dragControlEnd: function (moveable) { + this.unset(moveable); + }, + dragGroupStart: function (moveable, e) { + this.dragStart(moveable, e); + }, + dragGroup: function (moveable) { + this.drag(moveable); + }, + dragGroupEnd: function (moveable) { + this.unset(moveable); + }, + dragGroupControlStart: function (moveable) { + moveable.state.snapRenderInfo = null; + checkSnapInfo(moveable); + }, + dragGroupControl: function (moveable) { + this.drag(moveable); + }, + dragGroupControlEnd: function (moveable) { + this.unset(moveable); + }, + unset: function (moveable) { + var state = moveable.state; + state.enableSnap = false; + state.guidelines = []; + state.snapRenderInfo = null; + state.elementRects = []; + } + }; + /** + * Whether or not target can be snapped to the guideline. (default: false) + * @name Moveable.Snappable#snappable + * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions} + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * moveable.snappable = true; + */ + + /** + * A snap container that is the basis for snap, bounds, and innerBounds. (default: null = container) + * @name Moveable.Snappable#snapContainer + * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions} + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.querySelector(".container")); + * + * moveable.snapContainer = document.body; + */ + + /** + * You can specify the directions to snap to the target. (default: { left: true, top: true, right: true, bottom: true }) + * @name Moveable.Snappable#snapDirections + * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions} + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * snappable: true, + * snapDirections: true, + * }); + * // snap center + * moveable.snapDirections = { left: true, top: true, right: true, bottom: true, center: true, middle: true }; + */ + + /** + * You can specify the snap directions of elements. (default: { left: true, ftrue, right: true, bottom: true }) + * @name Moveable.Snappable#elementSnapDirections + * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions} + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * snappable: true, + * elementSnapDirections: true, + * }); + * // snap center + * moveable.elementSnapDirections = { left: true, top: true, right: true, bottom: true, center: true, middle: true }; + */ + + /** + * When you drag, make the gap snap in the element guidelines. (default: true) + * @name Moveable.Snappable#snapGap + * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions} + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * snappable: true, + * snapElement: true, + * snapGap: true, + * }); + * + * moveable.snapGap = false; + */ + + /** + * Distance value that can snap to guidelines. (default: 5) + * @name Moveable.Snappable#snapThreshold + * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions} + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * moveable.snapThreshold = 5; + */ + + /** + * Add guidelines in the horizontal direction. (default: []) + * @name Moveable.Snappable#horizontalGuidelines + * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions} + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * moveable.horizontalGuidelines = [100, 200, 500]; + */ + + /** + * Add guidelines in the vertical direction. (default: []) + * @name Moveable.Snappable#verticalGuidelines + * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions} + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * moveable.verticalGuidelines = [100, 200, 500]; + */ + + /** + * Add guidelines for the element. (default: []) + * @name Moveable.Snappable#elementGuidelines + * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions} + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * moveable.elementGuidelines = [ + * document.querySelector(".element"), + * ]; + */ + + /** + * You can set up boundaries. + * @name Moveable.Snappable#bounds + * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions} + * @default null + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * moveable.bounds = { left: 0, right: 1000, top: 0, bottom: 1000}; + */ + + /** + * You can set up inner boundaries. + * @name Moveable.Snappable#innerBounds + * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions} + * @default null + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * moveable.innerBounds = { left: 500, top: 500, width: 100, height: 100}; + */ + + /** + * snap distance digits (default: 0) + * @name Moveable.Snappable#snapDigit + * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions} + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * moveable.snapDigit = 0 + */ + + /** + * If width size is greater than 0, you can vertical snap to the grid. (default: 0) + * @name Moveable.Snappable#snapGridWidth + * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions} + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * moveable.snapGridWidth = 5; + */ + + /** + * If height size is greater than 0, you can horizontal snap to the grid. (default: 0) + * @name Moveable.Snappable#snapGridHeight + * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions} + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * moveable.snapGridHeight = 5; + */ + + /** + * Whether to show snap distance (default: true) + * @name Moveable.Snappable#isDisplaySnapDigit + * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions} + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * moveable.isDisplaySnapDigit = true; + */ + + /** + * Whether to show element inner snap distance (default: false) + * @name Moveable.Snappable#isDisplayInnerSnapDigit + * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions} + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * moveable.isDisplayInnerSnapDigit = true; + */ + + /** + * You can set the text format of the distance shown in the guidelines. (default: self) + * @name Moveable.Snappable#snapDistFormat + * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions} + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * snappable: true, + * snapDistFormat: (v, type) => v, + * }); + * moveable.snapDistFormat = (v, type) => `${v}px`; + */ + + /** + * When you drag or dragControl, the `snap` event is called. + * @memberof Moveable.Snappable + * @event snap + * @param {Moveable.Snappable.OnSnap} - Parameters for the `snap` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * snappable: true + * }); + * moveable.on("snap", e => { + * console.log("onSnap", e); + * }); + */ + + function multiply2(pos1, pos2) { + return [pos1[0] * pos2[0], pos1[1] * pos2[1]]; + } + + function prefix() { + var classNames = []; + + for (var _i = 0; _i < arguments.length; _i++) { + classNames[_i] = arguments[_i]; + } + + return prefixNames.apply(void 0, __spreadArray([PREFIX], __read(classNames), false)); + } + + function defaultSync(fn) { + fn(); + } + + function getTransformMatrix(transform) { + if (!transform || transform === "none") { + return [1, 0, 0, 1, 0, 0]; + } + + if (isObject(transform)) { + return transform; + } + + return parseMat(transform); + } + + function getAbsoluteMatrix(matrix, n, origin) { + return multiplies(n, createOriginMatrix(origin, n), matrix, createOriginMatrix(origin.map(function (a) { + return -a; + }), n)); + } + + function measureSVGSize(el, unit, isHorizontal) { + if (unit === "%") { + var viewBox = getSVGViewBox(el.ownerSVGElement); + return viewBox[isHorizontal ? "width" : "height"] / 100; + } + + return 1; + } + + function getBeforeTransformOrigin(el) { + var relativeOrigin = getTransformOrigin(getComputedStyle(el, ":before")); + return relativeOrigin.map(function (o, i) { + var _a = splitUnit(o), + value = _a.value, + unit = _a.unit; + + return value * measureSVGSize(el, unit, i === 0); + }); + } + + function getTransformOriginArray(transformOrigin) { + return transformOrigin ? transformOrigin.split(" ") : ["0", "0"]; + } + + function getTransformOrigin(style) { + return getTransformOriginArray(style.transformOrigin); + } + + function getElementTransform(target) { + var getStyle = getCachedStyle(target); + var computedTransform = getStyle("transform"); + + if (computedTransform && computedTransform !== "none") { + return computedTransform; + } + + if ("transform" in target) { + var list = target.transform; + var baseVal = list.baseVal; + + if (!baseVal) { + return ""; + } + + var length_1 = baseVal.length; + + if (!length_1) { + return ""; + } + + var matrixes = []; + + var _loop_1 = function (i) { + var matrix = baseVal[i].matrix; + matrixes.push("matrix(".concat(["a", "b", "c", "d", "e", "f"].map(function (chr) { + return matrix[chr]; + }).join(", "), ")")); + }; + + for (var i = 0; i < length_1; ++i) { + _loop_1(i); + } + + return matrixes.join(" "); + } + + return ""; + } + + function getOffsetInfo(el, lastParent, isParent, checkZoom, getTargetStyle) { + var _a, _b; + + var documentElement = getDocumentElement(el) || getDocumentBody(el); + var hasSlot = false; + var target; + var parentSlotElement; + + if (!el || isParent) { + target = el; + } else { + var assignedSlotParentElement = (_a = el === null || el === void 0 ? void 0 : el.assignedSlot) === null || _a === void 0 ? void 0 : _a.parentElement; + var parentElement = el.parentElement; + + if (assignedSlotParentElement) { + hasSlot = true; + parentSlotElement = parentElement; + target = assignedSlotParentElement; + } else { + target = parentElement; + } + } + + var isCustomElement = false; + var isEnd = el === lastParent || target === lastParent; + var position = "relative"; + var offsetZoom = 1; + var targetZoom = parseFloat(getTargetStyle === null || getTargetStyle === void 0 ? void 0 : getTargetStyle("zoom")) || 1; + var targetPosition = getTargetStyle === null || getTargetStyle === void 0 ? void 0 : getTargetStyle("position"); + + while (target && target !== documentElement) { + if (lastParent === target) { + isEnd = true; + } + + var getStyle = getCachedStyle(target); + var tagName = target.tagName.toLowerCase(); + var transform = getElementTransform(target); + var willChange = getStyle("willChange"); + var zoom = parseFloat(getStyle("zoom")) || 1; + position = getStyle("position"); + + if (checkZoom && zoom !== 1) { + offsetZoom = zoom; + break; + } + + if ( // offsetParent is the parentElement if the target's zoom is not 1 and not absolute. + !isParent && checkZoom && targetZoom !== 1 && targetPosition && targetPosition !== "absolute" || tagName === "svg" || position !== "static" || transform && transform !== "none" || willChange === "transform") { + break; + } + + var slotParentNode = (_b = el === null || el === void 0 ? void 0 : el.assignedSlot) === null || _b === void 0 ? void 0 : _b.parentNode; + var targetParentNode = target.parentNode; + + if (slotParentNode) { + hasSlot = true; + parentSlotElement = targetParentNode; + } + + var parentNode = targetParentNode; + + if (parentNode && parentNode.nodeType === 11) { + // Shadow Root + target = parentNode.host; + isCustomElement = true; + position = getCachedStyle(target)("position"); + break; + } + + target = parentNode; + position = "relative"; + } + + return { + offsetZoom: offsetZoom, + hasSlot: hasSlot, + parentSlotElement: parentSlotElement, + isCustomElement: isCustomElement, + isStatic: position === "static", + isEnd: isEnd || !target || target === documentElement, + offsetParent: target || documentElement + }; + } + + function getOffsetPosInfo(el, target) { + var _a; + + var tagName = el.tagName.toLowerCase(); + var offsetLeft = el.offsetLeft; + var offsetTop = el.offsetTop; + var getStyle = getCachedStyle(el); // svg + + var isSVG = isUndefined(offsetLeft); + var hasOffset = !isSVG; + var origin; + var targetOrigin; // inner svg element + + if (!hasOffset && (tagName !== "svg" || target.ownerSVGElement)) { + origin = IS_WEBKIT605 ? getBeforeTransformOrigin(el) : getTransformOriginArray(getStyle("transformOrigin")).map(function (pos) { + return parseFloat(pos); + }); + targetOrigin = origin.slice(); + hasOffset = true; + + if (tagName === "svg") { + offsetLeft = 0; + offsetTop = 0; + } else { + _a = __read(getSVGGraphicsOffset(el, origin, el === target && target.tagName.toLowerCase() === "g"), 4), offsetLeft = _a[0], offsetTop = _a[1], origin[0] = _a[2], origin[1] = _a[3]; + } + } else { + origin = getTransformOriginArray(getStyle("transformOrigin")).map(function (pos) { + return parseFloat(pos); + }); + targetOrigin = origin.slice(); + } + + return { + tagName: tagName, + isSVG: isSVG, + hasOffset: hasOffset, + offset: [offsetLeft || 0, offsetTop || 0], + origin: origin, + targetOrigin: targetOrigin + }; + } + + function getBodyOffset(el, isSVG) { + var getStyle = getCachedStyle(el); + var getBodyStyle = getCachedStyle(getDocumentBody(el)); + var bodyPosition = getBodyStyle("position"); + + if (!isSVG && (!bodyPosition || bodyPosition === "static")) { + return [0, 0]; + } + + var marginLeft = parseInt(getBodyStyle("marginLeft"), 10); + var marginTop = parseInt(getBodyStyle("marginTop"), 10); + + if (getStyle("position") === "absolute") { + if (getStyle("top") !== "auto" || getStyle("bottom") !== "auto") { + marginTop = 0; + } + + if (getStyle("left") !== "auto" || getStyle("right") !== "auto") { + marginLeft = 0; + } + } + + return [marginLeft, marginTop]; + } + + function convert3DMatrixes(matrixes) { + matrixes.forEach(function (info) { + var matrix = info.matrix; + + if (matrix) { + info.matrix = convertDimension(matrix, 3, 4); + } + }); + } + + function getPositionFixedInfo(el) { + var fixedContainer = el.parentElement; + var hasTransform = false; + var body = getDocumentBody(el); + + while (fixedContainer) { + var transform = getComputedStyle(fixedContainer).transform; + + if (transform && transform !== "none") { + hasTransform = true; + break; + } + + if (fixedContainer === body) { + break; + } + + fixedContainer = fixedContainer.parentElement; + } + + return { + fixedContainer: fixedContainer || body, + hasTransform: hasTransform + }; + } + + function makeMatrixCSS(matrix, is3d) { + if (is3d === void 0) { + is3d = matrix.length > 9; + } + + return "".concat(is3d ? "matrix3d" : "matrix", "(").concat(convertMatrixtoCSS(matrix, !is3d).join(","), ")"); + } + + function getSVGViewBox(el) { + var clientWidth = el.clientWidth; + var clientHeight = el.clientHeight; + + if (!el) { + return { + x: 0, + y: 0, + width: 0, + height: 0, + clientWidth: clientWidth, + clientHeight: clientHeight + }; + } + + var viewBox = el.viewBox; + var baseVal = viewBox && viewBox.baseVal || { + x: 0, + y: 0, + width: 0, + height: 0 + }; + return { + x: baseVal.x, + y: baseVal.y, + width: baseVal.width || clientWidth, + height: baseVal.height || clientHeight, + clientWidth: clientWidth, + clientHeight: clientHeight + }; + } + + function getSVGMatrix(el, n) { + var _a; + + var _b = getSVGViewBox(el), + viewBoxWidth = _b.width, + viewBoxHeight = _b.height, + clientWidth = _b.clientWidth, + clientHeight = _b.clientHeight; + + var scaleX = clientWidth / viewBoxWidth; + var scaleY = clientHeight / viewBoxHeight; + var preserveAspectRatio = el.preserveAspectRatio.baseVal; // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/preserveAspectRatio + + var align = preserveAspectRatio.align; // 1 : meet 2: slice + + var meetOrSlice = preserveAspectRatio.meetOrSlice; + var svgOrigin = [0, 0]; + var scale = [scaleX, scaleY]; + var translate = [0, 0]; + + if (align !== 1) { + var xAlign = (align - 2) % 3; + var yAlign = Math.floor((align - 2) / 3); + svgOrigin[0] = viewBoxWidth * xAlign / 2; + svgOrigin[1] = viewBoxHeight * yAlign / 2; + var scaleDimension = meetOrSlice === 2 ? Math.max(scaleY, scaleX) : Math.min(scaleX, scaleY); + scale[0] = scaleDimension; + scale[1] = scaleDimension; + translate[0] = (clientWidth - viewBoxWidth) / 2 * xAlign; + translate[1] = (clientHeight - viewBoxHeight) / 2 * yAlign; + } + + var scaleMatrix = createScaleMatrix(scale, n); + _a = __read(translate, 2), scaleMatrix[n * (n - 1)] = _a[0], scaleMatrix[n * (n - 1) + 1] = _a[1]; + return getAbsoluteMatrix(scaleMatrix, n, svgOrigin); + } + + function getSVGGraphicsOffset(el, origin, isGTarget) { + if (!el.getBBox || !isGTarget && el.tagName.toLowerCase() === "g") { + return [0, 0, 0, 0]; + } + + var getStyle = getCachedStyle(el); + var isFillBox = getStyle("transform-box") === "fill-box"; + var bbox = el.getBBox(); + var viewBox = getSVGViewBox(el.ownerSVGElement); + var left = bbox.x - viewBox.x; + var top = bbox.y - viewBox.y; + var originX = isFillBox ? origin[0] : origin[0] - left; + var originY = isFillBox ? origin[1] : origin[1] - top; + return [left, top, originX, originY]; + } + + function calculatePosition(matrix, pos, n) { + return calculate(matrix, convertPositionMatrix(pos, n), n); + } + + function calculatePoses(matrix, width, height, n) { + return [[0, 0], [width, 0], [0, height], [width, height]].map(function (pos) { + return calculatePosition(matrix, pos, n); + }); + } + + function getRect(poses) { + var posesX = poses.map(function (pos) { + return pos[0]; + }); + var posesY = poses.map(function (pos) { + return pos[1]; + }); + var left = Math.min.apply(Math, __spreadArray([], __read(posesX), false)); + var top = Math.min.apply(Math, __spreadArray([], __read(posesY), false)); + var right = Math.max.apply(Math, __spreadArray([], __read(posesX), false)); + var bottom = Math.max.apply(Math, __spreadArray([], __read(posesY), false)); + var rectWidth = right - left; + var rectHeight = bottom - top; + return { + left: left, + top: top, + right: right, + bottom: bottom, + width: rectWidth, + height: rectHeight + }; + } + + function calculateRect(matrix, width, height, n) { + var poses = calculatePoses(matrix, width, height, n); + return getRect(poses); + } + + function getSVGOffset(offsetInfo, targetInfo, container, n, beforeMatrix) { + var _a; + + var target = offsetInfo.target; + var origin = offsetInfo.origin; + var targetMatrix = targetInfo.matrix; + + var _b = getSize(target), + width = _b.offsetWidth, + height = _b.offsetHeight; + + var containerClientRect = container.getBoundingClientRect(); + var margin = [0, 0]; + + if (container === getDocumentBody(container)) { + margin = getBodyOffset(target, true); + } + + var rect = target.getBoundingClientRect(); + var rectLeft = rect.left - containerClientRect.left + container.scrollLeft - (container.clientLeft || 0) + margin[0]; + var rectTop = rect.top - containerClientRect.top + container.scrollTop - (container.clientTop || 0) + margin[1]; + var rectWidth = rect.width; + var rectHeight = rect.height; + var mat = multiplies(n, beforeMatrix, targetMatrix); + + var _c = calculateRect(mat, width, height, n), + prevLeft = _c.left, + prevTop = _c.top, + prevWidth = _c.width, + prevHeight = _c.height; + + var posOrigin = calculatePosition(mat, origin, n); + var prevOrigin = minus(posOrigin, [prevLeft, prevTop]); + var rectOrigin = [rectLeft + prevOrigin[0] * rectWidth / prevWidth, rectTop + prevOrigin[1] * rectHeight / prevHeight]; + var offset = [0, 0]; + var count = 0; + + while (++count < 10) { + var inverseBeforeMatrix = invert(beforeMatrix, n); + _a = __read(minus(calculatePosition(inverseBeforeMatrix, rectOrigin, n), calculatePosition(inverseBeforeMatrix, posOrigin, n)), 2), offset[0] = _a[0], offset[1] = _a[1]; + var mat2 = multiplies(n, beforeMatrix, createOriginMatrix(offset, n), targetMatrix); + + var _d = calculateRect(mat2, width, height, n), + nextLeft = _d.left, + nextTop = _d.top; + + var distLeft = nextLeft - rectLeft; + var distTop = nextTop - rectTop; + + if (abs(distLeft) < 2 && abs(distTop) < 2) { + break; + } + + rectOrigin[0] -= distLeft; + rectOrigin[1] -= distTop; + } + + return offset.map(function (p) { + return Math.round(p); + }); + } + + function calculateMoveableClientPositions(rootMatrix, poses, rootClientRect) { + var is3d = rootMatrix.length === 16; + var n = is3d ? 4 : 3; + var rootPoses = poses.map(function (pos) { + return calculatePosition(rootMatrix, pos, n); + }); + var left = rootClientRect.left, + top = rootClientRect.top; + return rootPoses.map(function (pos) { + return [pos[0] + left, pos[1] + top]; + }); + } + + function getDistSize(vec) { + return Math.sqrt(vec[0] * vec[0] + vec[1] * vec[1]); + } + + function getDiagonalSize(pos1, pos2) { + return getDistSize([pos2[0] - pos1[0], pos2[1] - pos1[1]]); + } + + function getLineStyle(pos1, pos2, zoom, rad) { + if (zoom === void 0) { + zoom = 1; + } + + if (rad === void 0) { + rad = getRad$1(pos1, pos2); + } + + var width = getDiagonalSize(pos1, pos2); + return { + transform: "translateY(-50%) translate(".concat(pos1[0], "px, ").concat(pos1[1], "px) rotate(").concat(rad, "rad) scaleY(").concat(zoom, ")"), + width: "".concat(width, "px") + }; + } + + function getControlTransform(rotation, zoom) { + var poses = []; + + for (var _i = 2; _i < arguments.length; _i++) { + poses[_i - 2] = arguments[_i]; + } + + var length = poses.length; + var x = poses.reduce(function (prev, pos) { + return prev + pos[0]; + }, 0) / length; + var y = poses.reduce(function (prev, pos) { + return prev + pos[1]; + }, 0) / length; + return { + transform: "translateZ(0px) translate(".concat(x, "px, ").concat(y, "px) rotate(").concat(rotation, "rad) scale(").concat(zoom, ")") + }; + } + + function getProps(props, ableName) { + var self = props[ableName]; + + if (isObject(self)) { + return __assign(__assign({}, props), self); + } + + return props; + } + + function getSize(target) { + var hasOffset = target && !isUndefined(target.offsetWidth); + var offsetWidth = 0; + var offsetHeight = 0; + var clientWidth = 0; + var clientHeight = 0; + var cssWidth = 0; + var cssHeight = 0; + var contentWidth = 0; + var contentHeight = 0; + var minWidth = 0; + var minHeight = 0; + var minOffsetWidth = 0; + var minOffsetHeight = 0; + var maxWidth = Infinity; + var maxHeight = Infinity; + var maxOffsetWidth = Infinity; + var maxOffsetHeight = Infinity; + var inlineCSSWidth = 0; + var inlineCSSHeight = 0; + var svg = false; + + if (target) { + if (!hasOffset && target.ownerSVGElement) { + // check svg elements + var bbox = target.getBBox(); + svg = true; + offsetWidth = bbox.width; + offsetHeight = bbox.height; + cssWidth = offsetWidth; + cssHeight = offsetHeight; + contentWidth = offsetWidth; + contentHeight = offsetHeight; + clientWidth = offsetWidth; + clientHeight = offsetHeight; + } else { + // check html elements + var getStyle = getCachedStyle(target); + var targetStyle = target.style; + var boxSizing = getStyle("boxSizing") === "border-box"; + var borderLeft = parseFloat(getStyle("borderLeftWidth")) || 0; + var borderRight = parseFloat(getStyle("borderRightWidth")) || 0; + var borderTop = parseFloat(getStyle("borderTopWidth")) || 0; + var borderBottom = parseFloat(getStyle("borderBottomWidth")) || 0; + var paddingLeft = parseFloat(getStyle("paddingLeft")) || 0; + var paddingRight = parseFloat(getStyle("paddingRight")) || 0; + var paddingTop = parseFloat(getStyle("paddingTop")) || 0; + var paddingBottom = parseFloat(getStyle("paddingBottom")) || 0; + var horizontalPadding = paddingLeft + paddingRight; + var verticalPadding = paddingTop + paddingBottom; + var horizontalBorder = borderLeft + borderRight; + var verticalBorder = borderTop + borderBottom; + var horizontalOffset = horizontalPadding + horizontalBorder; + var verticalOffset = verticalPadding + verticalBorder; + var position = getStyle("position"); + var containerWidth = 0; + var containerHeight = 0; // SVGSVGElement, HTMLElement + + if ("clientLeft" in target) { + var parentElement = null; + + if (position === "absolute") { + var offsetInfo = getOffsetInfo(target, getDocumentBody(target)); + parentElement = offsetInfo.offsetParent; + } else { + parentElement = target.parentElement; + } + + if (parentElement) { + var getParentStyle = getCachedStyle(parentElement); + containerWidth = parseFloat(getParentStyle("width")); + containerHeight = parseFloat(getParentStyle("height")); + } + } + + minWidth = Math.max(horizontalPadding, convertUnitSize(getStyle("minWidth"), containerWidth) || 0); + minHeight = Math.max(verticalPadding, convertUnitSize(getStyle("minHeight"), containerHeight) || 0); + maxWidth = convertUnitSize(getStyle("maxWidth"), containerWidth); + maxHeight = convertUnitSize(getStyle("maxHeight"), containerHeight); + + if (isNaN(maxWidth)) { + maxWidth = Infinity; + } + + if (isNaN(maxHeight)) { + maxHeight = Infinity; + } + + inlineCSSWidth = convertUnitSize(targetStyle.width, 0) || 0; + inlineCSSHeight = convertUnitSize(targetStyle.height, 0) || 0; + cssWidth = parseFloat(getStyle("width")) || 0; + cssHeight = parseFloat(getStyle("height")) || 0; + contentWidth = abs(cssWidth - inlineCSSWidth) < 1 ? between(minWidth, inlineCSSWidth || cssWidth, maxWidth) : cssWidth; + contentHeight = abs(cssHeight - inlineCSSHeight) < 1 ? between(minHeight, inlineCSSHeight || cssHeight, maxHeight) : cssHeight; + offsetWidth = contentWidth; + offsetHeight = contentHeight; + clientWidth = contentWidth; + clientHeight = contentHeight; + + if (boxSizing) { + maxOffsetWidth = maxWidth; + maxOffsetHeight = maxHeight; + minOffsetWidth = minWidth; + minOffsetHeight = minHeight; + contentWidth = offsetWidth - horizontalOffset; + contentHeight = offsetHeight - verticalOffset; + } else { + maxOffsetWidth = maxWidth + horizontalOffset; + maxOffsetHeight = maxHeight + verticalOffset; + minOffsetWidth = minWidth + horizontalOffset; + minOffsetHeight = minHeight + verticalOffset; + offsetWidth = contentWidth + horizontalOffset; + offsetHeight = contentHeight + verticalOffset; + } + + clientWidth = contentWidth + horizontalPadding; + clientHeight = contentHeight + verticalPadding; + } + } + + return { + svg: svg, + offsetWidth: offsetWidth, + offsetHeight: offsetHeight, + clientWidth: clientWidth, + clientHeight: clientHeight, + contentWidth: contentWidth, + contentHeight: contentHeight, + inlineCSSWidth: inlineCSSWidth, + inlineCSSHeight: inlineCSSHeight, + cssWidth: cssWidth, + cssHeight: cssHeight, + minWidth: minWidth, + minHeight: minHeight, + maxWidth: maxWidth, + maxHeight: maxHeight, + minOffsetWidth: minOffsetWidth, + minOffsetHeight: minOffsetHeight, + maxOffsetWidth: maxOffsetWidth, + maxOffsetHeight: maxOffsetHeight + }; + } + + function getRotationRad(poses, direction) { + return getRad$1(direction > 0 ? poses[0] : poses[1], direction > 0 ? poses[1] : poses[0]); + } + + function resetClientRect() { + return { + left: 0, + top: 0, + width: 0, + height: 0, + right: 0, + bottom: 0, + clientLeft: 0, + clientTop: 0, + clientWidth: 0, + clientHeight: 0, + scrollWidth: 0, + scrollHeight: 0 + }; + } + + function getExtendsRect(el, rect) { + var isRoot = el === getDocumentBody(el) || el === getDocumentElement(el); + var extendsRect = { + clientLeft: el.clientLeft, + clientTop: el.clientTop, + clientWidth: el.clientWidth, + clientHeight: el.clientHeight, + scrollWidth: el.scrollWidth, + scrollHeight: el.scrollHeight, + overflow: false + }; + + if (isRoot) { + extendsRect.clientHeight = Math.max(rect.height, extendsRect.clientHeight); + extendsRect.scrollHeight = Math.max(rect.height, extendsRect.scrollHeight); + } + + extendsRect.overflow = getCachedStyle(el)("overflow") !== "visible"; + return __assign(__assign({}, rect), extendsRect); + } + + function getClientRectByPosition(position, base, el, isExtends) { + var left = position.left, + right = position.right, + top = position.top, + bottom = position.bottom; + var baseTop = base.top; + var baseLeft = base.left; + var rect = { + left: baseLeft + left, + top: baseTop + top, + right: baseLeft + right, + bottom: baseTop + bottom, + width: right - left, + height: bottom - top + }; + + if (el && isExtends) { + return getExtendsRect(el, rect); + } + + return rect; + } + + function getClientRect(el, isExtends) { + var left = 0; + var top = 0; + var width = 0; + var height = 0; // let isRoot = false; + + if (el) { + var clientRect = el.getBoundingClientRect(); + left = clientRect.left; + top = clientRect.top; + width = clientRect.width; + height = clientRect.height; + } + + var rect = { + left: left, + top: top, + width: width, + height: height, + right: left + width, + bottom: top + height + }; + + if (el && isExtends) { + return getExtendsRect(el, rect); + } + + return rect; + } + + function getTotalOrigin(moveable) { + var _a = moveable.props, + groupable = _a.groupable, + svgOrigin = _a.svgOrigin; + + var _b = moveable.getState(), + offsetWidth = _b.offsetWidth, + offsetHeight = _b.offsetHeight, + svg = _b.svg, + transformOrigin = _b.transformOrigin; + + if (!groupable && svg && svgOrigin) { + return convertTransformOriginArray(svgOrigin, offsetWidth, offsetHeight); + } + + return transformOrigin; + } + + function getTotalDirection(parentDirection, isPinch, inputEvent, datas) { + var direction; + + if (parentDirection) { + direction = parentDirection; + } else if (isPinch) { + direction = [0, 0]; + } else { + var target = inputEvent.target; + direction = getDirection(target, datas); + } + + return direction; + } + + function getDirection(target, datas) { + if (!target) { + return; + } + + var deg = target.getAttribute("data-rotation") || ""; + var direciton = target.getAttribute("data-direction"); + datas.deg = deg; + + if (!direciton) { + return; + } + + var dir = [0, 0]; + direciton.indexOf("w") > -1 && (dir[0] = -1); + direciton.indexOf("e") > -1 && (dir[0] = 1); + direciton.indexOf("n") > -1 && (dir[1] = -1); + direciton.indexOf("s") > -1 && (dir[1] = 1); + return dir; + } + + function getAbsolutePoses(poses, dist) { + return [plus(dist, poses[0]), plus(dist, poses[1]), plus(dist, poses[2]), plus(dist, poses[3])]; + } + + function getAbsolutePosesByState(_a) { + var left = _a.left, + top = _a.top, + pos1 = _a.pos1, + pos2 = _a.pos2, + pos3 = _a.pos3, + pos4 = _a.pos4; + return getAbsolutePoses([pos1, pos2, pos3, pos4], [left, top]); + } + + function unsetAbles(self, isControl) { + self[isControl ? "controlAbles" : "targetAbles"].forEach(function (able) { + able.unset && able.unset(self); + }); + } + + function unsetGesto(self, isControl) { + var gestoName = isControl ? "controlGesto" : "targetGesto"; + var gesto = self[gestoName]; + + if ((gesto === null || gesto === void 0 ? void 0 : gesto.isIdle()) === false) { + unsetAbles(self, isControl); + } + + gesto === null || gesto === void 0 ? void 0 : gesto.unset(); + self[gestoName] = null; + } + + function fillCSSObject(style, resolvedEvent) { + if (resolvedEvent) { + var originalDatas = getBeforeRenderableDatas(resolvedEvent); + originalDatas.nextStyle = __assign(__assign({}, originalDatas.nextStyle), style); + } + + return { + style: style, + cssText: getKeys(style).map(function (name) { + return "".concat(decamelize(name, "-"), ": ").concat(style[name], ";"); + }).join("") + }; + } + + function fillAfterTransform(prevEvent, nextEvent, resolvedEvent) { + var afterTransform = nextEvent.afterTransform || nextEvent.transform; + return __assign(__assign({}, fillCSSObject(__assign(__assign(__assign({}, prevEvent.style), nextEvent.style), { + transform: afterTransform + }), resolvedEvent)), { + afterTransform: afterTransform, + transform: prevEvent.transform + }); + } + + function fillParams(moveable, e, params, isBeforeEvent) { + var datas = e.datas; + + if (!datas.datas) { + datas.datas = {}; + } + + var nextParams = __assign(__assign({}, params), { + target: moveable.state.target, + clientX: e.clientX, + clientY: e.clientY, + inputEvent: e.inputEvent, + currentTarget: moveable, + moveable: moveable, + datas: datas.datas, + isRequest: e.isRequest, + isRequestChild: e.isRequestChild, + isFirstDrag: !!e.isFirstDrag, + isTrusted: e.isTrusted !== false, + stopAble: function () { + datas.isEventStart = false; + }, + stopDrag: function () { + var _a; + + (_a = e.stop) === null || _a === void 0 ? void 0 : _a.call(e); + } + }); + + if (!datas.isStartEvent) { + datas.isStartEvent = true; + } else if (!isBeforeEvent) { + datas.lastEvent = nextParams; + } + + return nextParams; + } + + function fillEndParams(moveable, e, params) { + var datas = e.datas; + var isDrag = "isDrag" in params ? params.isDrag : e.isDrag; + + if (!datas.datas) { + datas.datas = {}; + } + + return __assign(__assign({ + isDrag: isDrag + }, params), { + moveable: moveable, + target: moveable.state.target, + clientX: e.clientX, + clientY: e.clientY, + inputEvent: e.inputEvent, + currentTarget: moveable, + lastEvent: datas.lastEvent, + isDouble: e.isDouble, + datas: datas.datas, + isFirstDrag: !!e.isFirstDrag + }); + } + + function catchEvent(moveable, name, callback) { + moveable._emitter.on(name, callback); + } + + function triggerEvent(moveable, name, params, isManager, isRequest) { + return moveable.triggerEvent(name, params, isManager, isRequest); + } + + function getComputedStyle(el, pseudoElt) { + return getWindow(el).getComputedStyle(el, pseudoElt); + } + + function filterAbles(ables, methods, triggerAblesSimultaneously) { + var enabledAbles = {}; + var ableGroups = {}; + return ables.filter(function (able) { + var name = able.name; + + if (enabledAbles[name] || !methods.some(function (method) { + return able[method]; + })) { + return false; + } + + if (!triggerAblesSimultaneously && able.ableGroup) { + if (ableGroups[able.ableGroup]) { + return false; + } + + ableGroups[able.ableGroup] = true; + } + + enabledAbles[name] = true; + return true; + }); + } + + function equals(a1, a2) { + return a1 === a2 || a1 == null && a2 == null; + } + + function selectValue() { + var values = []; + + for (var _i = 0; _i < arguments.length; _i++) { + values[_i] = arguments[_i]; + } + + var length = values.length - 1; + + for (var i = 0; i < length; ++i) { + var value = values[i]; + + if (!isUndefined(value)) { + return value; + } + } + + return values[length]; + } + + function groupBy(arr, func) { + var groups = []; + var groupKeys = []; + arr.forEach(function (el, index) { + var groupKey = func(el, index, arr); + var keyIndex = groupKeys.indexOf(groupKey); + var group = groups[keyIndex] || []; + + if (keyIndex === -1) { + groupKeys.push(groupKey); + groups.push(group); + } + + group.push(el); + }); + return groups; + } + + function groupByMap(arr, func) { + var groups = []; + var groupKeys = {}; + arr.forEach(function (el, index) { + var groupKey = func(el, index, arr); + var group = groupKeys[groupKey]; + + if (!group) { + group = []; + groupKeys[groupKey] = group; + groups.push(group); + } + + group.push(el); + }); + return groups; + } + + function flat(arr) { + return arr.reduce(function (prev, cur) { + return prev.concat(cur); + }, []); + } + + function maxOffset() { + var args = []; + + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + + args.sort(function (a, b) { + return abs(b) - abs(a); + }); + return args[0]; + } + + function calculateInversePosition(matrix, pos, n) { + return calculate(invert(matrix, n), convertPositionMatrix(pos, n), n); + } + + function convertDragDist(state, e) { + var _a; + + var is3d = state.is3d, + rootMatrix = state.rootMatrix; + var n = is3d ? 4 : 3; + _a = __read(calculateInversePosition(rootMatrix, [e.distX, e.distY], n), 2), e.distX = _a[0], e.distY = _a[1]; + return e; + } + + function calculatePadding(matrix, pos, added, n) { + if (!added[0] && !added[1]) { + return pos; + } + + var xAdded = calculatePosition(matrix, [normalized(added[0] || 1), 0], n); + var yAdded = calculatePosition(matrix, [0, normalized(added[1] || 1)], n); + var nextAdded = calculatePosition(matrix, [added[0] / getDistSize(xAdded), added[1] / getDistSize(yAdded)], n); + return plus(pos, nextAdded); + } + + function convertCSSSize(value, size, isRelative) { + return isRelative ? "".concat(value / size * 100, "%") : "".concat(value, "px"); + } + + function getTinyDist(v) { + return abs(v) <= TINY_NUM ? 0 : v; + } + + function getDirectionViewClassName(ableName) { + return function (moveable) { + if (!moveable.isDragging(ableName)) { + return ""; + } + + var data = getGestoData(moveable, ableName); + var deg = data.deg; + + if (!deg) { + return ""; + } + + return prefix("view-control-rotation".concat(deg)); + }; + } + + function getDirectionCondition(ableName, checkAbles) { + if (checkAbles === void 0) { + checkAbles = [ableName]; + } + + return function (moveable, e) { + if (e.isRequest) { + if (checkAbles.some(function (name) { + return e.requestAble === name; + })) { + return e.parentDirection; + } else { + return false; + } + } + + var target = e.inputEvent.target; + return hasClass(target, prefix("direction")) && (!ableName || hasClass(target, prefix(ableName))); + }; + } + + function convertTransformInfo(transforms, state, index) { + var _a; + + var matrixInfos = parse(transforms, { + "x%": function (v) { + return v / 100 * state.offsetWidth; + }, + "y%": function (v) { + return v / 100 * state.offsetHeight; + } + }); + var beforeFunctionTexts = transforms.slice(0, index < 0 ? undefined : index); + var beforeFunctionTexts2 = transforms.slice(0, index < 0 ? undefined : index + 1); + var targetFunctionText = transforms[index] || ""; + var afterFunctionTexts = index < 0 ? [] : transforms.slice(index); + var afterFunctionTexts2 = index < 0 ? [] : transforms.slice(index + 1); + var beforeFunctions = matrixInfos.slice(0, index < 0 ? undefined : index); + var beforeFunctions2 = matrixInfos.slice(0, index < 0 ? undefined : index + 1); + var targetFunction = (_a = matrixInfos[index]) !== null && _a !== void 0 ? _a : parse([""])[0]; + var afterFunctions = index < 0 ? [] : matrixInfos.slice(index); + var afterFunctions2 = index < 0 ? [] : matrixInfos.slice(index + 1); + var targetFunctions = targetFunction ? [targetFunction] : []; + var beforeFunctionMatrix = toMat(beforeFunctions); + var beforeFunctionMatrix2 = toMat(beforeFunctions2); + var afterFunctionMatrix = toMat(afterFunctions); + var afterFunctionMatrix2 = toMat(afterFunctions2); + var allFunctionMatrix = multiply(beforeFunctionMatrix, afterFunctionMatrix, 4); + return { + transforms: transforms, + beforeFunctionMatrix: beforeFunctionMatrix, + beforeFunctionMatrix2: beforeFunctionMatrix2, + targetFunctionMatrix: toMat(targetFunctions), + afterFunctionMatrix: afterFunctionMatrix, + afterFunctionMatrix2: afterFunctionMatrix2, + allFunctionMatrix: allFunctionMatrix, + beforeFunctions: beforeFunctions, + beforeFunctions2: beforeFunctions2, + targetFunction: targetFunctions[0], + afterFunctions: afterFunctions, + afterFunctions2: afterFunctions2, + beforeFunctionTexts: beforeFunctionTexts, + beforeFunctionTexts2: beforeFunctionTexts2, + targetFunctionText: targetFunctionText, + afterFunctionTexts: afterFunctionTexts, + afterFunctionTexts2: afterFunctionTexts2 + }; + } + + function isArrayFormat(arr) { + if (!arr || !isObject(arr)) { + return false; + } + + if (isNode(arr)) { + return false; + } + + return isArray(arr) || "length" in arr; + } + + function getRefTarget(target, isSelector) { + if (!target) { + return null; + } + + if (isNode(target)) { + return target; + } + + if (isString(target)) { + if (isSelector) { + return document.querySelector(target); + } + + return target; + } + + if (isFunction(target)) { + return target(); + } + + if (isWindow(target)) { + return target; + } + + if ("current" in target) { + return target.current; + } + + return target; + } + + function getRefTargets(targets, isSelector) { + if (!targets) { + return []; + } + + var userTargets = isArrayFormat(targets) ? [].slice.call(targets) : [targets]; + return userTargets.reduce(function (prev, target) { + if (isString(target) && isSelector) { + return __spreadArray(__spreadArray([], __read(prev), false), __read([].slice.call(document.querySelectorAll(target))), false); + } + + if (isArray(target)) { + prev.push(getRefTargets(target, isSelector)); + } else { + prev.push(getRefTarget(target, isSelector)); + } + + return prev; + }, []); + } + + function getAbsoluteRotation(pos1, pos2, direction) { + var deg = getRad$1(pos1, pos2) / Math.PI * 180; + deg = direction >= 0 ? deg : 180 - deg; + deg = deg >= 0 ? deg : 360 + deg; + return deg; + } + + function getDragDistByState(state, dist) { + var rootMatrix = state.rootMatrix, + is3d = state.is3d; + var n = is3d ? 4 : 3; + var inverseMatrix = invert(rootMatrix, n); + + if (!is3d) { + inverseMatrix = convertDimension(inverseMatrix, 3, 4); + } + + inverseMatrix[12] = 0; + inverseMatrix[13] = 0; + inverseMatrix[14] = 0; + return calculateMatrixDist(inverseMatrix, dist); + } + + function getSizeDistByDist(startSize, dist, ratio, direction, keepRatio) { + var _a = __read(startSize, 2), + startOffsetWidth = _a[0], + startOffsetHeight = _a[1]; + + var distWidth = 0; + var distHeight = 0; + + if (keepRatio && startOffsetWidth && startOffsetHeight) { + var rad = getRad$1([0, 0], dist); + var standardRad = getRad$1([0, 0], direction); + var size = getDistSize(dist); + var signSize = Math.cos(rad - standardRad) * size; + + if (!direction[0]) { + // top, bottom + distHeight = signSize; + distWidth = distHeight * ratio; + } else if (!direction[1]) { + // left, right + distWidth = signSize; + distHeight = distWidth / ratio; + } else { + // two-way + var startWidthSize = direction[0] * startOffsetWidth; + var startHeightSize = direction[1] * startOffsetHeight; + var secondRad = Math.atan2(startWidthSize + dist[0], startHeightSize + dist[1]); + var firstRad = Math.atan2(startWidthSize, startHeightSize); + + if (secondRad < 0) { + secondRad += Math.PI * 2; + } + + if (firstRad < 0) { + firstRad += Math.PI * 2; + } + + var rad_1 = 0; + + if (abs(secondRad - firstRad) < Math.PI / 2 || abs(secondRad - firstRad) > Math.PI / 2 * 3) { + rad_1 = secondRad - firstRad; + } else { + firstRad += Math.PI; + rad_1 = secondRad - firstRad; + } + + if (rad_1 > Math.PI * 2) { + rad_1 -= Math.PI * 2; + } else if (rad_1 > Math.PI) { + rad_1 = 2 * Math.PI - rad_1; + } else if (rad_1 < -Math.PI) { + rad_1 = -2 * Math.PI - rad_1; + } // 180 + // -1, -1, // 1, -1 + // 270 90 + // -1, 1 // 1, 1 + // 0 + + + var distSize = getDistSize([startWidthSize + dist[0], startHeightSize + dist[1]]) * Math.cos(rad_1); + distWidth = distSize * Math.sin(firstRad) - startWidthSize; + distHeight = distSize * Math.cos(firstRad) - startHeightSize; + + if (direction[0] < 0) { + distWidth *= -1; + } + + if (direction[1] < 0) { + distHeight *= -1; + } + } + } else { + distWidth = direction[0] * dist[0]; + distHeight = direction[1] * dist[1]; + } + + return [distWidth, distHeight]; + } + + function getOffsetSizeDist(sizeDirection, keepRatio, datas, e) { + var _a; + + var ratio = datas.ratio, + startOffsetWidth = datas.startOffsetWidth, + startOffsetHeight = datas.startOffsetHeight; + var distWidth = 0; + var distHeight = 0; + var distX = e.distX, + distY = e.distY, + pinchScale = e.pinchScale, + parentDistance = e.parentDistance, + parentDist = e.parentDist, + parentScale = e.parentScale; + var startFixedDirection = datas.fixedDirection; + var directionsDists = [0, 1].map(function (index) { + return abs(sizeDirection[index] - startFixedDirection[index]); + }); + var directionRatios = [0, 1].map(function (index) { + var dist = directionsDists[index]; + + if (dist !== 0) { + dist = 2 / dist; + } + + return dist; + }); + + if (parentDist) { + distWidth = parentDist[0]; + distHeight = parentDist[1]; + + if (keepRatio) { + if (!distWidth) { + distWidth = distHeight * ratio; + } else if (!distHeight) { + distHeight = distWidth / ratio; + } + } + } else if (isNumber(pinchScale)) { + distWidth = (pinchScale - 1) * startOffsetWidth; + distHeight = (pinchScale - 1) * startOffsetHeight; + } else if (parentScale) { + distWidth = (parentScale[0] - 1) * startOffsetWidth; + distHeight = (parentScale[1] - 1) * startOffsetHeight; + } else if (parentDistance) { + var scaleX = startOffsetWidth * directionsDists[0]; + var scaleY = startOffsetHeight * directionsDists[1]; + var ratioDistance = getDistSize([scaleX, scaleY]); + distWidth = parentDistance / ratioDistance * scaleX * directionRatios[0]; + distHeight = parentDistance / ratioDistance * scaleY * directionRatios[1]; + } else { + var dist_1 = getDragDist({ + datas: datas, + distX: distX, + distY: distY + }); + dist_1 = directionRatios.map(function (ratio, i) { + return dist_1[i] * ratio; + }); + _a = __read(getSizeDistByDist([startOffsetWidth, startOffsetHeight], dist_1, ratio, sizeDirection, keepRatio), 2), distWidth = _a[0], distHeight = _a[1]; + } + + return { + // direction, + // sizeDirection, + distWidth: distWidth, + distHeight: distHeight + }; + } + + function convertTransformUnit(origin, xy) { + if (xy) { + if (origin === "left") { + return { + x: "0%", + y: "50%" + }; + } else if (origin === "top") { + return { + x: "50%", + y: "50%" + }; + } else if (origin === "center") { + return { + x: "50%", + y: "50%" + }; + } else if (origin === "right") { + return { + x: "100%", + y: "50%" + }; + } else if (origin === "bottom") { + return { + x: "50%", + y: "100%" + }; + } + + var _a = __read(origin.split(" "), 2), + left = _a[0], + right = _a[1]; + + var leftOrigin = convertTransformUnit(left || ""); + var rightOrigin = convertTransformUnit(right || ""); + + var originObject = __assign(__assign({}, leftOrigin), rightOrigin); + + var nextOriginObject = { + x: "50%", + y: "50%" + }; + + if (originObject.x) { + nextOriginObject.x = originObject.x; + } + + if (originObject.y) { + nextOriginObject.y = originObject.y; + } + + if (originObject.value) { + if (originObject.x && !originObject.y) { + nextOriginObject.y = originObject.value; + } + + if (!originObject.x && originObject.y) { + nextOriginObject.x = originObject.value; + } + } + + return nextOriginObject; + } + + if (origin === "left") { + return { + x: "0%" + }; + } + + if (origin === "right") { + return { + x: "100%" + }; + } + + if (origin === "top") { + return { + y: "0%" + }; + } + + if (origin === "bottom") { + return { + y: "100%" + }; + } + + if (!origin) { + return {}; + } + + if (origin === "center") { + return { + value: "50%" + }; + } + + return { + value: origin + }; + } + + function convertTransformOriginArray(transformOrigin, width, height) { + var _a = convertTransformUnit(transformOrigin, true), + x = _a.x, + y = _a.y; + + return [convertUnitSize(x, width) || 0, convertUnitSize(y, height) || 0]; + } + + function rotatePosesInfo(poses, origin, rad) { + var prevPoses = poses.map(function (pos) { + return minus(pos, origin); + }); + var nextPoses = prevPoses.map(function (pos) { + return rotate(pos, rad); + }); + return { + prev: prevPoses, + next: nextPoses, + result: nextPoses.map(function (pos) { + return plus(pos, origin); + }) + }; + } + + function isDeepArrayEquals(arr1, arr2) { + return arr1.length === arr2.length && arr1.every(function (value1, i) { + var value2 = arr2[i]; + var isArray1 = isArray(value1); + var isArray2 = isArray(value2); + + if (isArray1 && isArray2) { + return isDeepArrayEquals(value1, value2); + } else if (!isArray1 && !isArray2) { + return value1 === value2; + } + + return false; + }); + } + + function watchValue(moveable, property, nextValue, valueKey, defaultValue) { + var store = moveable._store; + var prevValue = store[property]; + + if (!(property in store)) { + if (defaultValue != null) { + store[property] = defaultValue; + prevValue = defaultValue; + } else { + store[property] = nextValue; + return nextValue; + } + } + + if (prevValue === nextValue || valueKey(prevValue) === valueKey(nextValue)) { + return prevValue; + } + + store[property] = nextValue; + return nextValue; + } + + function sign(value) { + return value >= 0 ? 1 : -1; + } + + function abs(value) { + return Math.abs(value); + } + + function countEach(count, callback) { + return counter(count).map(function (index) { + return callback(index); + }); + } + + function getPaddingBox(padding) { + if (isNumber(padding)) { + return { + top: padding, + left: padding, + right: padding, + bottom: padding + }; + } + + return { + left: padding.left || 0, + top: padding.top || 0, + right: padding.right || 0, + bottom: padding.bottom || 0 + }; + } + /** + * @namespace Moveable.Pinchable + * @description Whether or not target can be pinched with draggable, resizable, scalable, rotatable (default: false) + */ + + + var Pinchable = makeAble$1("pinchable", { + props: ["pinchable"], + events: ["pinchStart", "pinch", "pinchEnd", "pinchGroupStart", "pinchGroup", "pinchGroupEnd"], + dragStart: function () { + return true; + }, + pinchStart: function (moveable, e) { + var datas = e.datas, + targets = e.targets, + angle = e.angle, + originalDatas = e.originalDatas; + var _a = moveable.props, + pinchable = _a.pinchable, + ables = _a.ables; + + if (!pinchable) { + return false; + } + + var eventName = "onPinch".concat(targets ? "Group" : "", "Start"); + var controlEventName = "drag".concat(targets ? "Group" : "", "ControlStart"); + var pinchAbles = (pinchable === true ? moveable.controlAbles : ables.filter(function (able) { + return pinchable.indexOf(able.name) > -1; + })).filter(function (able) { + return able.canPinch && able[controlEventName]; + }); + var params = fillParams(moveable, e, {}); + + if (targets) { + params.targets = targets; + } + + var result = triggerEvent(moveable, eventName, params); + datas.isPinch = result !== false; + datas.ables = pinchAbles; + var isPinch = datas.isPinch; + + if (!isPinch) { + return false; + } + + pinchAbles.forEach(function (able) { + originalDatas[able.name] = originalDatas[able.name] || {}; + + if (!able[controlEventName]) { + return; + } + + var ableEvent = __assign(__assign({}, e), { + datas: originalDatas[able.name], + parentRotate: angle, + isPinch: true + }); + + able[controlEventName](moveable, ableEvent); + }); + moveable.state.snapRenderInfo = { + request: e.isRequest, + direction: [0, 0] + }; + return isPinch; + }, + pinch: function (moveable, e) { + var datas = e.datas, + pinchScale = e.scale, + distance = e.distance, + originalDatas = e.originalDatas, + inputEvent = e.inputEvent, + targets = e.targets, + angle = e.angle; + + if (!datas.isPinch) { + return; + } + + var parentDistance = distance * (1 - 1 / pinchScale); + var params = fillParams(moveable, e, {}); + + if (targets) { + params.targets = targets; + } + + var eventName = "onPinch".concat(targets ? "Group" : ""); + triggerEvent(moveable, eventName, params); + var ables = datas.ables; + var controlEventName = "drag".concat(targets ? "Group" : "", "Control"); + ables.forEach(function (able) { + if (!able[controlEventName]) { + return; + } + + able[controlEventName](moveable, __assign(__assign({}, e), { + datas: originalDatas[able.name], + inputEvent: inputEvent, + resolveMatrix: true, + pinchScale: pinchScale, + parentDistance: parentDistance, + parentRotate: angle, + isPinch: true + })); + }); + return params; + }, + pinchEnd: function (moveable, e) { + var datas = e.datas, + isPinch = e.isPinch, + inputEvent = e.inputEvent, + targets = e.targets, + originalDatas = e.originalDatas; + + if (!datas.isPinch) { + return; + } + + var eventName = "onPinch".concat(targets ? "Group" : "", "End"); + var params = fillEndParams(moveable, e, { + isDrag: isPinch + }); + + if (targets) { + params.targets = targets; + } + + triggerEvent(moveable, eventName, params); + var ables = datas.ables; + var controlEventName = "drag".concat(targets ? "Group" : "", "ControlEnd"); + ables.forEach(function (able) { + if (!able[controlEventName]) { + return; + } + + able[controlEventName](moveable, __assign(__assign({}, e), { + isDrag: isPinch, + datas: originalDatas[able.name], + inputEvent: inputEvent, + isPinch: true + })); + }); + return isPinch; + }, + pinchGroupStart: function (moveable, e) { + return this.pinchStart(moveable, __assign(__assign({}, e), { + targets: moveable.props.targets + })); + }, + pinchGroup: function (moveable, e) { + return this.pinch(moveable, __assign(__assign({}, e), { + targets: moveable.props.targets + })); + }, + pinchGroupEnd: function (moveable, e) { + return this.pinchEnd(moveable, __assign(__assign({}, e), { + targets: moveable.props.targets + })); + } + }); + /** + * Whether or not target can be pinched with draggable, resizable, scalable, rotatable (default: false) + * @name Moveable.Pinchable#pinchable + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * moveable.pinchable = true; + */ + + /** + * When the pinch starts, the pinchStart event is called with part of scaleStart, rotateStart, resizeStart + * @memberof Moveable.Pinchable + * @event pinchStart + * @param {Moveable.Pinchable.OnPinchStart} - Parameters for the pinchStart event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * rotatable: true, + * scalable: true, + * pinchable: true, // ["rotatable", "scalable"] + * }); + * moveable.on("pinchStart", ({ target }) => { + * console.log(target); + * }); + * moveable.on("rotateStart", ({ target }) => { + * console.log(target); + * }); + * moveable.on("scaleStart", ({ target }) => { + * console.log(target); + * }); + */ + + /** + * When pinching, the pinch event is called with part of scale, rotate, resize + * @memberof Moveable.Pinchable + * @event pinch + * @param {Moveable.Pinchable.OnPinch} - Parameters for the pinch event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * rotatable: true, + * scalable: true, + * pinchable: true, // ["rotatable", "scalable"] + * }); + * moveable.on("pinch", ({ target }) => { + * console.log(target); + * }); + * moveable.on("rotate", ({ target }) => { + * console.log(target); + * }); + * moveable.on("scale", ({ target }) => { + * console.log(target); + * }); + */ + + /** + * When the pinch finishes, the pinchEnd event is called. + * @memberof Moveable.Pinchable + * @event pinchEnd + * @param {Moveable.Pinchable.OnPinchEnd} - Parameters for the pinchEnd event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * rotatable: true, + * scalable: true, + * pinchable: true, // ["rotatable", "scalable"] + * }); + * moveable.on("pinchEnd", ({ target }) => { + * console.log(target); + * }); + * moveable.on("rotateEnd", ({ target }) => { + * console.log(target); + * }); + * moveable.on("scaleEnd", ({ target }) => { + * console.log(target); + * }); + */ + + /** + * When the group pinch starts, the `pinchGroupStart` event is called. + * @memberof Moveable.Pinchable + * @event pinchGroupStart + * @param {Moveable.Pinchable.OnPinchGroupStart} - Parameters for the `pinchGroupStart` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: [].slice.call(document.querySelectorAll(".target")), + * pinchable: true + * }); + * moveable.on("pinchGroupStart", ({ targets }) => { + * console.log("onPinchGroupStart", targets); + * }); + */ + + /** + * When the group pinch, the `pinchGroup` event is called. + * @memberof Moveable.Pinchable + * @event pinchGroup + * @param {Moveable.Pinchable.OnPinchGroup} - Parameters for the `pinchGroup` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: [].slice.call(document.querySelectorAll(".target")), + * pinchable: true + * }); + * moveable.on("pinchGroup", ({ targets, events }) => { + * console.log("onPinchGroup", targets); + * }); + */ + + /** + * When the group pinch finishes, the `pinchGroupEnd` event is called. + * @memberof Moveable.Pinchable + * @event pinchGroupEnd + * @param {Moveable.Pinchable.OnPinchGroupEnd} - Parameters for the `pinchGroupEnd` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: [].slice.call(document.querySelectorAll(".target")), + * pinchable: true + * }); + * moveable.on("pinchGroupEnd", ({ targets, isDrag }) => { + * console.log("onPinchGroupEnd", targets, isDrag); + * }); + */ + + var directionCondition = getDirectionCondition("scalable"); + /** + * @namespace Scalable + * @memberof Moveable + * @description Scalable indicates whether the target's x and y can be scale of transform. + */ + + var Scalable = { + name: "scalable", + ableGroup: "size", + canPinch: true, + props: ["scalable", "throttleScale", "renderDirections", "keepRatio", "edge", "displayAroundControls"], + events: ["scaleStart", "beforeScale", "scale", "scaleEnd", "scaleGroupStart", "beforeScaleGroup", "scaleGroup", "scaleGroupEnd"], + render: getRenderDirections("scalable"), + dragControlCondition: directionCondition, + viewClassName: getDirectionViewClassName("scalable"), + dragControlStart: function (moveable, e) { + var datas = e.datas, + isPinch = e.isPinch, + inputEvent = e.inputEvent, + parentDirection = e.parentDirection; + var direction = getTotalDirection(parentDirection, isPinch, inputEvent, datas); + var _a = moveable.state, + width = _a.width, + height = _a.height, + targetTransform = _a.targetTransform, + target = _a.target, + pos1 = _a.pos1, + pos2 = _a.pos2, + pos4 = _a.pos4; + + if (!direction || !target) { + return false; + } + + if (!isPinch) { + setDragStart(moveable, e); + } + + datas.datas = {}; + datas.transform = targetTransform; + datas.prevDist = [1, 1]; + datas.direction = direction; + datas.startOffsetWidth = width; + datas.startOffsetHeight = height; + datas.startValue = [1, 1]; // const scaleWidth = getDist(pos1, pos2); + // const scaleHeight = getDist(pos2, pos4); + + var isWidth = !direction[0] && !direction[1] || direction[0] || !direction[1]; // datas.scaleWidth = scaleWidth; + // datas.scaleHeight = scaleHeight; + // datas.scaleXRatio = scaleWidth / width; + // datas.scaleYRatio = scaleHeight / height; + + setDefaultTransformIndex(moveable, e, "scale"); + datas.isWidth = isWidth; + + function setRatio(ratio) { + datas.ratio = ratio && isFinite(ratio) ? ratio : 0; + } + + datas.startPositions = getAbsolutePosesByState(moveable.state); + + function setFixedDirection(fixedDirection) { + var result = getFixedDirectionInfo(datas.startPositions, fixedDirection); + datas.fixedDirection = result.fixedDirection; + datas.fixedPosition = result.fixedPosition; + datas.fixedOffset = result.fixedOffset; + } + + datas.setFixedDirection = setFixedDirection; + setRatio(getDist$2(pos1, pos2) / getDist$2(pos2, pos4)); + setFixedDirection([-direction[0], -direction[1]]); + + var setMinScaleSize = function (min) { + datas.minScaleSize = min; + }; + + var setMaxScaleSize = function (max) { + datas.maxScaleSize = max; + }; // const setMinScale = (min: number[]) => { + // }; + // const setMaxScale = (max: number[]) => { + // }; + + + setMinScaleSize([-Infinity, -Infinity]); + setMaxScaleSize([Infinity, Infinity]); + var params = fillParams(moveable, e, __assign(__assign({ + direction: direction, + set: function (scale) { + datas.startValue = scale; + }, + setRatio: setRatio, + setFixedDirection: setFixedDirection, + setMinScaleSize: setMinScaleSize, + setMaxScaleSize: setMaxScaleSize + }, fillTransformStartEvent(moveable, e)), { + dragStart: Draggable.dragStart(moveable, new CustomGesto().dragStart([0, 0], e)) + })); + var result = triggerEvent(moveable, "onScaleStart", params); + datas.startFixedDirection = datas.fixedDirection; + + if (result !== false) { + datas.isScale = true; + moveable.state.snapRenderInfo = { + request: e.isRequest, + direction: direction + }; + } + + return datas.isScale ? params : false; + }, + dragControl: function (moveable, e) { + resolveTransformEvent(moveable, e, "scale"); + var datas = e.datas, + parentKeepRatio = e.parentKeepRatio, + parentFlag = e.parentFlag, + isPinch = e.isPinch, + dragClient = e.dragClient, + isRequest = e.isRequest, + useSnap = e.useSnap, + resolveMatrix = e.resolveMatrix; + var prevDist = datas.prevDist, + direction = datas.direction, + startOffsetWidth = datas.startOffsetWidth, + startOffsetHeight = datas.startOffsetHeight, + isScale = datas.isScale, + startValue = datas.startValue, + isWidth = datas.isWidth, + ratio = datas.ratio; + + if (!isScale) { + return false; + } + + var props = moveable.props; + var throttleScale = props.throttleScale, + parentMoveable = props.parentMoveable; + var sizeDirection = direction; + + if (!direction[0] && !direction[1]) { + sizeDirection = [1, 1]; + } + + var keepRatio = ratio && (parentKeepRatio != null ? parentKeepRatio : props.keepRatio) || false; + var state = moveable.state; + var tempScaleValue = [startValue[0], startValue[1]]; + + function getNextScale() { + var _a = getOffsetSizeDist(sizeDirection, keepRatio, datas, e), + distWidth = _a.distWidth, + distHeight = _a.distHeight; + + var distX = startOffsetWidth ? (startOffsetWidth + distWidth) / startOffsetWidth : 1; + var distY = startOffsetHeight ? (startOffsetHeight + distHeight) / startOffsetHeight : 1; + + if (!startValue[0]) { + tempScaleValue[0] = distWidth / startOffsetWidth; + } + + if (!startValue[1]) { + tempScaleValue[1] = distHeight / startOffsetHeight; + } + + var scaleX = (sizeDirection[0] || keepRatio ? distX : 1) * tempScaleValue[0]; + var scaleY = (sizeDirection[1] || keepRatio ? distY : 1) * tempScaleValue[1]; + + if (scaleX === 0) { + scaleX = sign(prevDist[0]) * MIN_SCALE; + } + + if (scaleY === 0) { + scaleY = sign(prevDist[1]) * MIN_SCALE; + } + + return [scaleX, scaleY]; + } + + var scale = getNextScale(); + + if (!isPinch && moveable.props.groupable) { + var snapRenderInfo = state.snapRenderInfo || {}; + var stateDirection = snapRenderInfo.direction; + + if (isArray(stateDirection) && (stateDirection[0] || stateDirection[1])) { + state.snapRenderInfo = { + direction: direction, + request: e.isRequest + }; + } + } + + triggerEvent(moveable, "onBeforeScale", fillParams(moveable, e, { + scale: scale, + setFixedDirection: function (nextFixedDirection) { + datas.setFixedDirection(nextFixedDirection); + scale = getNextScale(); + return scale; + }, + startFixedDirection: datas.startFixedDirection, + setScale: function (nextScale) { + scale = nextScale; + } + }, true)); + var dist = [scale[0] / tempScaleValue[0], scale[1] / tempScaleValue[1]]; + var fixedPosition = dragClient; + var snapDist = [0, 0]; + var distSign = sign(dist[0] * dist[1]); + var isSelfPinch = !dragClient && !parentFlag && isPinch; + + if (isSelfPinch || resolveMatrix) { + fixedPosition = getTranslateFixedPosition(moveable, datas.targetAllTransform, [0, 0], [0, 0], datas); + } else if (!dragClient) { + fixedPosition = datas.fixedPosition; + } + + if (!isPinch) { + snapDist = checkSnapScale(moveable, dist, direction, !useSnap && isRequest, datas); + } + + if (keepRatio) { + if (sizeDirection[0] && sizeDirection[1] && snapDist[0] && snapDist[1]) { + if (Math.abs(snapDist[0] * startOffsetWidth) > Math.abs(snapDist[1] * startOffsetHeight)) { + snapDist[1] = 0; + } else { + snapDist[0] = 0; + } + } + + var isNoSnap = !snapDist[0] && !snapDist[1]; + + if (isNoSnap) { + // throttle scale value (not absolute scale size) + if (isWidth) { + dist[0] = throttle(dist[0] * tempScaleValue[0], throttleScale) / tempScaleValue[0]; + } else { + dist[1] = throttle(dist[1] * tempScaleValue[1], throttleScale) / tempScaleValue[1]; + } + } + + if (sizeDirection[0] && !sizeDirection[1] || snapDist[0] && !snapDist[1] || isNoSnap && isWidth) { + dist[0] += snapDist[0]; + var snapHeight = startOffsetWidth * dist[0] * tempScaleValue[0] / ratio; + dist[1] = sign(distSign * dist[0]) * abs(snapHeight / startOffsetHeight / tempScaleValue[1]); + } else if (!sizeDirection[0] && sizeDirection[1] || !snapDist[0] && snapDist[1] || isNoSnap && !isWidth) { + dist[1] += snapDist[1]; + var snapWidth = startOffsetHeight * dist[1] * tempScaleValue[1] * ratio; + dist[0] = sign(distSign * dist[1]) * abs(snapWidth / startOffsetWidth / tempScaleValue[0]); + } + } else { + dist[0] += snapDist[0]; + dist[1] += snapDist[1]; + + if (!snapDist[0]) { + dist[0] = throttle(dist[0] * tempScaleValue[0], throttleScale) / tempScaleValue[0]; + } + + if (!snapDist[1]) { + dist[1] = throttle(dist[1] * tempScaleValue[1], throttleScale) / tempScaleValue[1]; + } + } + + if (dist[0] === 0) { + dist[0] = sign(prevDist[0]) * MIN_SCALE; + } + + if (dist[1] === 0) { + dist[1] = sign(prevDist[1]) * MIN_SCALE; + } + + scale = multiply2(dist, [tempScaleValue[0], tempScaleValue[1]]); + var startOffsetSize = [startOffsetWidth, startOffsetHeight]; + var scaleSize = [startOffsetWidth * scale[0], startOffsetHeight * scale[1]]; + scaleSize = calculateBoundSize(scaleSize, datas.minScaleSize, datas.maxScaleSize, keepRatio ? ratio : false); // if (keepRatio && (isGroup || keepRatioFinally)) { + // if (isWidth) { + // boundingHeight = boundingWidth / ratio; + // } else { + // boundingWidth = boundingHeight * ratio; + // } + // } + + scale = countEach(2, function (i) { + return startOffsetSize[i] ? scaleSize[i] / startOffsetSize[i] : scaleSize[i]; + }); + dist = countEach(2, function (i) { + return scale[i] / tempScaleValue[i]; + }); + var delta = countEach(2, function (i) { + return prevDist[i] ? dist[i] / prevDist[i] : dist[i]; + }); + var distText = "scale(".concat(dist.join(", "), ")"); + var scaleText = "scale(".concat(scale.join(", "), ")"); + var nextTransform = convertTransformFormat(datas, scaleText, distText); + var isZeroScale = !startValue[0] || !startValue[1]; + var inverseDist = getScaleDist(moveable, isZeroScale ? scaleText : distText, datas.fixedDirection, fixedPosition, datas.fixedOffset, datas, isZeroScale); + var inverseDelta = isSelfPinch ? inverseDist : minus(inverseDist, datas.prevInverseDist || [0, 0]); + datas.prevDist = dist; + datas.prevInverseDist = inverseDist; + + if (scale[0] === prevDist[0] && scale[1] === prevDist[1] && inverseDelta.every(function (num) { + return !num; + }) && !parentMoveable && !isSelfPinch) { + return false; + } + + var params = fillParams(moveable, e, __assign({ + offsetWidth: startOffsetWidth, + offsetHeight: startOffsetHeight, + direction: direction, + scale: scale, + dist: dist, + delta: delta, + isPinch: !!isPinch + }, fillTransformEvent(moveable, nextTransform, inverseDelta, isPinch, e))); + triggerEvent(moveable, "onScale", params); + return params; + }, + dragControlEnd: function (moveable, e) { + var datas = e.datas; + + if (!datas.isScale) { + return false; + } + + datas.isScale = false; + var scaleEndParam = fillEndParams(moveable, e, {}); + triggerEvent(moveable, "onScaleEnd", scaleEndParam); + return scaleEndParam; + }, + dragGroupControlCondition: directionCondition, + dragGroupControlStart: function (moveable, e) { + var datas = e.datas; + var params = this.dragControlStart(moveable, e); + + if (!params) { + return false; + } + + var originalEvents = fillChildEvents(moveable, "resizable", e); + datas.moveableScale = moveable.scale; + var events = triggerChildAbles(moveable, this, "dragControlStart", e, function (child, ev) { + return startChildDist(moveable, child, datas, ev); + }); + + var setFixedDirection = function (fixedDirection) { + params.setFixedDirection(fixedDirection); + events.forEach(function (ev, i) { + ev.setFixedDirection(fixedDirection); + startChildDist(moveable, ev.moveable, datas, originalEvents[i]); + }); + }; + + datas.setFixedDirection = setFixedDirection; + + var nextParams = __assign(__assign({}, params), { + targets: moveable.props.targets, + events: events, + setFixedDirection: setFixedDirection + }); + + var result = triggerEvent(moveable, "onScaleGroupStart", nextParams); + datas.isScale = result !== false; + return datas.isScale ? nextParams : false; + }, + dragGroupControl: function (moveable, e) { + var datas = e.datas; + + if (!datas.isScale) { + return; + } + + catchEvent(moveable, "onBeforeScale", function (parentEvent) { + triggerEvent(moveable, "onBeforeScaleGroup", fillParams(moveable, e, __assign(__assign({}, parentEvent), { + targets: moveable.props.targets + }), true)); + }); + var params = this.dragControl(moveable, e); + + if (!params) { + return; + } + + var dist = params.dist; + var moveableScale = datas.moveableScale; + moveable.scale = [dist[0] * moveableScale[0], dist[1] * moveableScale[1]]; + var keepRatio = moveable.props.keepRatio; + var fixedPosition = datas.fixedPosition; + var events = triggerChildAbles(moveable, this, "dragControl", e, function (_, ev) { + var _a = __read(calculate(createRotateMatrix(moveable.rotation / 180 * Math.PI, 3), [ev.datas.originalX * dist[0], ev.datas.originalY * dist[1], 1], 3), 2), + clientX = _a[0], + clientY = _a[1]; + + return __assign(__assign({}, ev), { + parentDist: null, + parentScale: dist, + parentKeepRatio: keepRatio, + // recalculate child fixed position for parent group's dragging. + dragClient: plus(fixedPosition, [clientX, clientY]) + }); + }); + + var nextParams = __assign({ + targets: moveable.props.targets, + events: events + }, params); + + triggerEvent(moveable, "onScaleGroup", nextParams); + return nextParams; + }, + dragGroupControlEnd: function (moveable, e) { + var isDrag = e.isDrag, + datas = e.datas; + + if (!datas.isScale) { + return; + } + + this.dragControlEnd(moveable, e); + var events = triggerChildAbles(moveable, this, "dragControlEnd", e); + var nextParams = fillEndParams(moveable, e, { + targets: moveable.props.targets, + events: events + }); + triggerEvent(moveable, "onScaleGroupEnd", nextParams); + return isDrag; + }, + + /** + * @method Moveable.Scalable#request + * @param {Moveable.Scalable.ScalableRequestParam} e - the Scalable's request parameter + * @return {Moveable.Requester} Moveable Requester + * @example + * // Instantly Request (requestStart - request - requestEnd) + * moveable.request("scalable", { deltaWidth: 10, deltaHeight: 10 }, true); + * + * // requestStart + * const requester = moveable.request("scalable"); + * + * // request + * requester.request({ deltaWidth: 10, deltaHeight: 10 }); + * requester.request({ deltaWidth: 10, deltaHeight: 10 }); + * requester.request({ deltaWidth: 10, deltaHeight: 10 }); + * + * // requestEnd + * requester.requestEnd(); + */ + request: function () { + var datas = {}; + var distWidth = 0; + var distHeight = 0; + var useSnap = false; + return { + isControl: true, + requestStart: function (e) { + useSnap = e.useSnap; + return { + datas: datas, + parentDirection: e.direction || [1, 1], + useSnap: useSnap + }; + }, + request: function (e) { + distWidth += e.deltaWidth; + distHeight += e.deltaHeight; + return { + datas: datas, + parentDist: [distWidth, distHeight], + parentKeepRatio: e.keepRatio, + useSnap: useSnap + }; + }, + requestEnd: function () { + return { + datas: datas, + isDrag: true, + useSnap: useSnap + }; + } + }; + } + }; + /** + * Whether or not target can scaled. + * + * @name Moveable.Scalable#scalable + * @default false + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * moveable.scalable = true; + */ + + /** + * throttle of scaleX, scaleY when scale. + * @name Moveable.Scalable#throttleScale + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * moveable.throttleScale = 0.1; + */ + + /** + * Set directions to show the control box. (default: ["n", "nw", "ne", "s", "se", "sw", "e", "w"]) + * @name Moveable.Scalable#renderDirections + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * scalable: true, + * renderDirections: ["n", "nw", "ne", "s", "se", "sw", "e", "w"], + * }); + * + * moveable.renderDirections = ["nw", "ne", "sw", "se"]; + */ + + /** + * When resize or scale, keeps a ratio of the width, height. (default: false) + * @name Moveable.Scalable#keepRatio + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * scalable: true, + * }); + * + * moveable.keepRatio = true; + */ + + /** + * When the scale starts, the scaleStart event is called. + * @memberof Moveable.Scalable + * @event scaleStart + * @param {Moveable.Scalable.OnScaleStart} - Parameters for the scaleStart event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { scalable: true }); + * moveable.on("scaleStart", ({ target }) => { + * console.log(target); + * }); + */ + + /** + * When scaling, `beforeScale` is called before `scale` occurs. In `beforeScale`, you can get and set the pre-value before scaling. + * @memberof Moveable.Scalable + * @event beforeScale + * @param {Moveable.Scalable.OnBeforeScale} - Parameters for the `beforeScale` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { scalable: true }); + * moveable.on("beforeScale", ({ setFixedDirection }) => { + * if (shiftKey) { + * setFixedDirection([0, 0]); + * } + * }); + * moveable.on("scale", ({ target, transform, dist }) => { + * target.style.transform = transform; + * }); + */ + + /** + * When scaling, the `scale` event is called. + * @memberof Moveable.Scalable + * @event scale + * @param {Moveable.Scalable.OnScale} - Parameters for the `scale` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { scalable: true }); + * moveable.on("scale", ({ target, transform, dist }) => { + * target.style.transform = transform; + * }); + */ + + /** + * When the scale finishes, the `scaleEnd` event is called. + * @memberof Moveable.Scalable + * @event scaleEnd + * @param {Moveable.Scalable.OnScaleEnd} - Parameters for the `scaleEnd` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { scalable: true }); + * moveable.on("scaleEnd", ({ target, isDrag }) => { + * console.log(target, isDrag); + * }); + */ + + /** + * When the group scale starts, the `scaleGroupStart` event is called. + * @memberof Moveable.Scalable + * @event scaleGroupStart + * @param {Moveable.Scalable.OnScaleGroupStart} - Parameters for the `scaleGroupStart` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: [].slice.call(document.querySelectorAll(".target")), + * scalable: true + * }); + * moveable.on("scaleGroupStart", ({ targets }) => { + * console.log("onScaleGroupStart", targets); + * }); + */ + + /** + * When the group scale, the `scaleGroup` event is called. + * @memberof Moveable.Scalable + * @event scaleGroup + * @param {Moveable.Scalable.OnScaleGroup} - Parameters for the `scaleGroup` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: [].slice.call(document.querySelectorAll(".target")), + * scalable: true + * }); + * moveable.on("scaleGroup", ({ targets, events }) => { + * console.log("onScaleGroup", targets); + * events.forEach(ev => { + * const target = ev.target; + * // ev.drag is a drag event that occurs when the group scale. + * const left = ev.drag.beforeDist[0]; + * const top = ev.drag.beforeDist[1]; + * const scaleX = ev.scale[0]; + * const scaleY = ev.scale[1]; + * }); + * }); + */ + + /** + * When the group scale finishes, the `scaleGroupEnd` event is called. + * @memberof Moveable.Scalable + * @event scaleGroupEnd + * @param {Moveable.Scalable.OnScaleGroupEnd} - Parameters for the `scaleGroupEnd` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: [].slice.call(document.querySelectorAll(".target")), + * scalable: true + * }); + * moveable.on("scaleGroupEnd", ({ targets, isDrag }) => { + * console.log("onScaleGroupEnd", targets, isDrag); + * }); + */ + + function getMiddleLinePos(pos1, pos2) { + return pos1.map(function (pos, i) { + return dot(pos, pos2[i], 1, 2); + }); + } + + function getTriangleRad(pos1, pos2, pos3) { + // pos1 Rad + var rad1 = getRad$1(pos1, pos2); + var rad2 = getRad$1(pos1, pos3); + var rad = rad2 - rad1; + return rad >= 0 ? rad : rad + 2 * Math.PI; + } + + function isValidPos(poses1, poses2) { + var rad1 = getTriangleRad(poses1[0], poses1[1], poses1[2]); + var rad2 = getTriangleRad(poses2[0], poses2[1], poses2[2]); + var pi = Math.PI; + + if (rad1 >= pi && rad2 <= pi || rad1 <= pi && rad2 >= pi) { + return false; + } + + return true; + } + /** + * @namespace Moveable.Warpable + * @description Warpable indicates whether the target can be warped(distorted, bented). + */ + + + var Warpable = { + name: "warpable", + ableGroup: "size", + props: ["warpable", "renderDirections", "edge", "displayAroundControls"], + events: ["warpStart", "warp", "warpEnd"], + viewClassName: getDirectionViewClassName("warpable"), + render: function (moveable, React) { + var _a = moveable.props, + resizable = _a.resizable, + scalable = _a.scalable, + warpable = _a.warpable, + zoom = _a.zoom; + + if (resizable || scalable || !warpable) { + return []; + } + + var _b = moveable.state, + pos1 = _b.pos1, + pos2 = _b.pos2, + pos3 = _b.pos3, + pos4 = _b.pos4; + var linePosFrom1 = getMiddleLinePos(pos1, pos2); + var linePosFrom2 = getMiddleLinePos(pos2, pos1); + var linePosFrom3 = getMiddleLinePos(pos1, pos3); + var linePosFrom4 = getMiddleLinePos(pos3, pos1); + var linePosTo1 = getMiddleLinePos(pos3, pos4); + var linePosTo2 = getMiddleLinePos(pos4, pos3); + var linePosTo3 = getMiddleLinePos(pos2, pos4); + var linePosTo4 = getMiddleLinePos(pos4, pos2); + return __spreadArray([React.createElement("div", { + className: prefix("line"), + key: "middeLine1", + style: getLineStyle(linePosFrom1, linePosTo1, zoom) + }), React.createElement("div", { + className: prefix("line"), + key: "middeLine2", + style: getLineStyle(linePosFrom2, linePosTo2, zoom) + }), React.createElement("div", { + className: prefix("line"), + key: "middeLine3", + style: getLineStyle(linePosFrom3, linePosTo3, zoom) + }), React.createElement("div", { + className: prefix("line"), + key: "middeLine4", + style: getLineStyle(linePosFrom4, linePosTo4, zoom) + })], __read(renderAllDirections(moveable, "warpable", React)), false); + }, + dragControlCondition: function (moveable, e) { + if (e.isRequest) { + return false; + } + + var target = e.inputEvent.target; + return hasClass(target, prefix("direction")) && hasClass(target, prefix("warpable")); + }, + dragControlStart: function (moveable, e) { + var datas = e.datas, + inputEvent = e.inputEvent; + var target = moveable.props.target; + var inputTarget = inputEvent.target; + var direction = getDirection(inputTarget, datas); + + if (!direction || !target) { + return false; + } + + var state = moveable.state; + var transformOrigin = state.transformOrigin, + is3d = state.is3d, + targetTransform = state.targetTransform, + targetMatrix = state.targetMatrix, + width = state.width, + height = state.height, + left = state.left, + top = state.top; + datas.datas = {}; + datas.targetTransform = targetTransform; + datas.warpTargetMatrix = is3d ? targetMatrix : convertDimension(targetMatrix, 3, 4); + datas.targetInverseMatrix = ignoreDimension(invert(datas.warpTargetMatrix, 4), 3, 4); + datas.direction = direction; + datas.left = left; + datas.top = top; + datas.poses = [[0, 0], [width, 0], [0, height], [width, height]].map(function (p) { + return minus(p, transformOrigin); + }); + datas.nextPoses = datas.poses.map(function (_a) { + var _b = __read(_a, 2), + x = _b[0], + y = _b[1]; + + return calculate(datas.warpTargetMatrix, [x, y, 0, 1], 4); + }); + datas.startValue = createIdentityMatrix(4); + datas.prevMatrix = createIdentityMatrix(4); + datas.absolutePoses = getAbsolutePosesByState(state); + datas.posIndexes = getPosIndexesByDirection(direction); + setDragStart(moveable, e); + setDefaultTransformIndex(moveable, e, "matrix3d"); + state.snapRenderInfo = { + request: e.isRequest, + direction: direction + }; + var params = fillParams(moveable, e, __assign({ + set: function (matrix) { + datas.startValue = matrix; + } + }, fillTransformStartEvent(moveable, e))); + var result = triggerEvent(moveable, "onWarpStart", params); + + if (result !== false) { + datas.isWarp = true; + } + + return datas.isWarp; + }, + dragControl: function (moveable, e) { + var datas = e.datas, + isRequest = e.isRequest; + var distX = e.distX, + distY = e.distY; + var targetInverseMatrix = datas.targetInverseMatrix, + prevMatrix = datas.prevMatrix, + isWarp = datas.isWarp, + startValue = datas.startValue, + poses = datas.poses, + posIndexes = datas.posIndexes, + absolutePoses = datas.absolutePoses; + + if (!isWarp) { + return false; + } + + resolveTransformEvent(moveable, e, "matrix3d"); + + if (hasGuidelines(moveable, "warpable")) { + var selectedPoses = posIndexes.map(function (index) { + return absolutePoses[index]; + }); + + if (selectedPoses.length > 1) { + selectedPoses.push([(selectedPoses[0][0] + selectedPoses[1][0]) / 2, (selectedPoses[0][1] + selectedPoses[1][1]) / 2]); + } + + var _a = checkMoveableSnapBounds(moveable, isRequest, { + horizontal: selectedPoses.map(function (pos) { + return pos[1] + distY; + }), + vertical: selectedPoses.map(function (pos) { + return pos[0] + distX; + }) + }), + horizontalSnapInfo = _a.horizontal, + verticalSnapInfo = _a.vertical; + + distY -= horizontalSnapInfo.offset; + distX -= verticalSnapInfo.offset; + } + + var dist = getDragDist({ + datas: datas, + distX: distX, + distY: distY + }, true); + var nextPoses = datas.nextPoses.slice(); + posIndexes.forEach(function (index) { + nextPoses[index] = plus(nextPoses[index], dist); + }); + + if (!NEARBY_POS.every(function (nearByPoses) { + return isValidPos(nearByPoses.map(function (i) { + return poses[i]; + }), nearByPoses.map(function (i) { + return nextPoses[i]; + })); + })) { + return false; + } + + var h = createWarpMatrix(poses[0], poses[2], poses[1], poses[3], nextPoses[0], nextPoses[2], nextPoses[1], nextPoses[3]); + + if (!h.length) { + return false; + } // B * A * M + + + var afterMatrix = multiply(targetInverseMatrix, h, 4); // B * M * A + + var matrix = getTransfromMatrix(datas, afterMatrix, true); + var delta = multiply(invert(prevMatrix, 4), matrix, 4); + datas.prevMatrix = matrix; + var totalMatrix = multiply(startValue, matrix, 4); + var nextTransform = convertTransformFormat(datas, "matrix3d(".concat(totalMatrix.join(", "), ")"), "matrix3d(".concat(matrix.join(", "), ")")); + fillOriginalTransform(e, nextTransform); + triggerEvent(moveable, "onWarp", fillParams(moveable, e, __assign({ + delta: delta, + matrix: totalMatrix, + dist: matrix, + multiply: multiply, + transform: nextTransform + }, fillCSSObject({ + transform: nextTransform + }, e)))); + return true; + }, + dragControlEnd: function (moveable, e) { + var datas = e.datas, + isDrag = e.isDrag; + + if (!datas.isWarp) { + return false; + } + + datas.isWarp = false; + triggerEvent(moveable, "onWarpEnd", fillEndParams(moveable, e, {})); + return isDrag; + } + }; + /** + * Whether or not target can be warped. (default: false) + * @name Moveable.Warpable#warpable + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * moveable.warpable = true; + */ + + /** + * Set directions to show the control box. (default: ["n", "nw", "ne", "s", "se", "sw", "e", "w"]) + * @name Moveable.Warpable#renderDirections + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * warpable: true, + * renderDirections: ["n", "nw", "ne", "s", "se", "sw", "e", "w"], + * }); + * + * moveable.renderDirections = ["nw", "ne", "sw", "se"]; + */ + + /** + * When the warp starts, the warpStart event is called. + * @memberof Moveable.Warpable + * @event warpStart + * @param {Moveable.Warpable.OnWarpStart} - Parameters for the warpStart event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { warpable: true }); + * moveable.on("warpStart", ({ target }) => { + * console.log(target); + * }); + */ + + /** + * When warping, the warp event is called. + * @memberof Moveable.Warpable + * @event warp + * @param {Moveable.Warpable.OnWarp} - Parameters for the warp event + * @example + * import Moveable from "moveable"; + * let matrix = [ + * 1, 0, 0, 0, + * 0, 1, 0, 0, + * 0, 0, 1, 0, + * 0, 0, 0, 1, + * ]; + * const moveable = new Moveable(document.body, { warpable: true }); + * moveable.on("warp", ({ target, transform, delta, multiply }) => { + * // target.style.transform = transform; + * matrix = multiply(matrix, delta); + * target.style.transform = `matrix3d(${matrix.join(",")})`; + * }); + */ + + /** + * When the warp finishes, the warpEnd event is called. + * @memberof Moveable.Warpable + * @event warpEnd + * @param {Moveable.Warpable.OnWarpEnd} - Parameters for the warpEnd event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { warpable: true }); + * moveable.on("warpEnd", ({ target, isDrag }) => { + * console.log(target, isDrag); + * }); + */ + + var AREA_PIECES = /*#__PURE__*/prefix("area-pieces"); + var AREA_PIECE = /*#__PURE__*/prefix("area-piece"); + var AVOID = /*#__PURE__*/prefix("avoid"); + var VIEW_DRAGGING = prefix("view-dragging"); + + function restoreStyle(moveable) { + var el = moveable.areaElement; + + if (!el) { + return; + } + + var _a = moveable.state, + width = _a.width, + height = _a.height; + removeClass(el, AVOID); + el.style.cssText += "left: 0px; top: 0px; width: ".concat(width, "px; height: ").concat(height, "px"); + } + + function renderPieces(React) { + return React.createElement("div", { + key: "area_pieces", + className: AREA_PIECES + }, React.createElement("div", { + className: AREA_PIECE + }), React.createElement("div", { + className: AREA_PIECE + }), React.createElement("div", { + className: AREA_PIECE + }), React.createElement("div", { + className: AREA_PIECE + })); + } + + var DragArea = { + name: "dragArea", + props: ["dragArea", "passDragArea"], + events: ["click", "clickGroup"], + render: function (moveable, React) { + var _a = moveable.props, + target = _a.target, + dragArea = _a.dragArea, + groupable = _a.groupable, + passDragArea = _a.passDragArea; + + var _b = moveable.getState(), + width = _b.width, + height = _b.height, + renderPoses = _b.renderPoses; + + var className = passDragArea ? prefix("area", "pass") : prefix("area"); + + if (groupable) { + return [React.createElement("div", { + key: "area", + ref: ref(moveable, "areaElement"), + className: className + }), renderPieces(React)]; + } + + if (!target || !dragArea) { + return []; + } + + var h = createWarpMatrix([0, 0], [width, 0], [0, height], [width, height], renderPoses[0], renderPoses[1], renderPoses[2], renderPoses[3]); + var transform = h.length ? makeMatrixCSS(h, true) : "none"; + return [React.createElement("div", { + key: "area", + ref: ref(moveable, "areaElement"), + className: className, + style: { + top: "0px", + left: "0px", + width: "".concat(width, "px"), + height: "".concat(height, "px"), + transformOrigin: "0 0", + transform: transform + } + }), renderPieces(React)]; + }, + dragStart: function (moveable, _a) { + var datas = _a.datas, + clientX = _a.clientX, + clientY = _a.clientY, + inputEvent = _a.inputEvent; + + if (!inputEvent) { + return false; + } + + datas.isDragArea = false; + var areaElement = moveable.areaElement; + var state = moveable.state; + var moveableClientRect = state.moveableClientRect, + renderPoses = state.renderPoses, + rootMatrix = state.rootMatrix, + is3d = state.is3d; + var left = moveableClientRect.left, + top = moveableClientRect.top; + + var _b = getRect(renderPoses), + relativeLeft = _b.left, + relativeTop = _b.top, + width = _b.width, + height = _b.height; + + var n = is3d ? 4 : 3; + + var _c = __read(calculateInversePosition(rootMatrix, [clientX - left, clientY - top], n), 2), + posX = _c[0], + posY = _c[1]; + + posX -= relativeLeft; + posY -= relativeTop; + var rects = [{ + left: relativeLeft, + top: relativeTop, + width: width, + height: posY - 10 + }, { + left: relativeLeft, + top: relativeTop, + width: posX - 10, + height: height + }, { + left: relativeLeft, + top: relativeTop + posY + 10, + width: width, + height: height - posY - 10 + }, { + left: relativeLeft + posX + 10, + top: relativeTop, + width: width - posX - 10, + height: height + }]; + var children = [].slice.call(areaElement.nextElementSibling.children); + rects.forEach(function (rect, i) { + children[i].style.cssText = "left: ".concat(rect.left, "px;top: ").concat(rect.top, "px; width: ").concat(rect.width, "px; height: ").concat(rect.height, "px;"); + }); + addClass(areaElement, AVOID); + state.disableNativeEvent = true; + return; + }, + drag: function (moveable, _a) { + var datas = _a.datas, + inputEvent = _a.inputEvent; + this.enableNativeEvent(moveable); + + if (!inputEvent) { + return false; + } + + if (!datas.isDragArea) { + datas.isDragArea = true; + restoreStyle(moveable); + } + }, + dragEnd: function (moveable, e) { + this.enableNativeEvent(moveable); + var inputEvent = e.inputEvent, + datas = e.datas; + + if (!inputEvent) { + return false; + } + + if (!datas.isDragArea) { + restoreStyle(moveable); + } + }, + dragGroupStart: function (moveable, e) { + return this.dragStart(moveable, e); + }, + dragGroup: function (moveable, e) { + return this.drag(moveable, e); + }, + dragGroupEnd: function (moveable, e) { + return this.dragEnd(moveable, e); + }, + unset: function (moveable) { + restoreStyle(moveable); + moveable.state.disableNativeEvent = false; + }, + enableNativeEvent: function (moveable) { + var state = moveable.state; + + if (state.disableNativeEvent) { + requestAnimationFrame$1(function () { + state.disableNativeEvent = false; + }); + } + } + }; + /** + * Add an event to the moveable area instead of the target for stopPropagation. (default: false, true in group) + * @name Moveable#dragArea + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * dragArea: false, + * }); + */ + + /** + * Set `pointerEvents: none;` css to pass events in dragArea. (default: false) + * @name Moveable#passDragArea + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * dragArea: false, + * }); + */ + + var Origin = makeAble$1("origin", { + props: ["origin", "svgOrigin"], + render: function (moveable, React) { + var _a = moveable.props, + zoom = _a.zoom, + svgOrigin = _a.svgOrigin, + groupable = _a.groupable; + + var _b = moveable.getState(), + beforeOrigin = _b.beforeOrigin, + rotation = _b.rotation, + svg = _b.svg, + allMatrix = _b.allMatrix, + is3d = _b.is3d, + left = _b.left, + top = _b.top, + offsetWidth = _b.offsetWidth, + offsetHeight = _b.offsetHeight; + + var originStyle; + + if (!groupable && svg && svgOrigin) { + var _c = __read(convertTransformOriginArray(svgOrigin, offsetWidth, offsetHeight), 2), + originX = _c[0], + originY = _c[1]; + + var n = is3d ? 4 : 3; + var result = calculatePosition(allMatrix, [originX, originY], n); + originStyle = getControlTransform(rotation, zoom, minus(result, [left, top])); + } else { + originStyle = getControlTransform(rotation, zoom, beforeOrigin); + } + + return [React.createElement("div", { + className: prefix("control", "origin"), + style: originStyle, + key: "beforeOrigin" + })]; + } + }); + /** + * Whether or not the origin controlbox will be visible or not (default: true) + * @name Moveable#origin + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * moveable.origin = true; + */ + + function getDefaultScrollPosition(e) { + var scrollContainer = e.scrollContainer; + return [scrollContainer.scrollLeft, scrollContainer.scrollTop]; + } + /** + * @namespace Moveable.Scrollable + * @description Whether or not target can be scrolled to the scroll container (default: false) + */ + + + var Scrollable = { + name: "scrollable", + canPinch: true, + props: ["scrollable", "scrollContainer", "scrollThreshold", "scrollThrottleTime", "getScrollPosition", "scrollOptions"], + events: ["scroll", "scrollGroup"], + dragRelation: "strong", + dragStart: function (moveable, e) { + var props = moveable.props; + var _a = props.scrollContainer, + scrollContainer = _a === void 0 ? moveable.getContainer() : _a, + scrollOptions = props.scrollOptions; + var dragScroll = new DragScroll$1(); + var scrollContainerElement = getRefTarget(scrollContainer, true); + e.datas.dragScroll = dragScroll; + moveable.state.dragScroll = dragScroll; + var gestoName = e.isControl ? "controlGesto" : "targetGesto"; + var targets = e.targets; + dragScroll.on("scroll", function (_a) { + var container = _a.container, + direction = _a.direction; + var params = fillParams(moveable, e, { + scrollContainer: container, + direction: direction + }); + var eventName = targets ? "onScrollGroup" : "onScroll"; + + if (targets) { + params.targets = targets; + } + + triggerEvent(moveable, eventName, params); + }).on("move", function (_a) { + var offsetX = _a.offsetX, + offsetY = _a.offsetY, + inputEvent = _a.inputEvent; + moveable[gestoName].scrollBy(offsetX, offsetY, inputEvent.inputEvent, false); + }).on("scrollDrag", function (_a) { + var next = _a.next; + next(moveable[gestoName].getCurrentEvent()); + }); + dragScroll.dragStart(e, __assign({ + container: scrollContainerElement + }, scrollOptions)); + }, + checkScroll: function (moveable, e) { + var dragScroll = e.datas.dragScroll; + + if (!dragScroll) { + return; + } + + var _a = moveable.props, + _b = _a.scrollContainer, + scrollContainer = _b === void 0 ? moveable.getContainer() : _b, + _c = _a.scrollThreshold, + scrollThreshold = _c === void 0 ? 0 : _c, + _d = _a.scrollThrottleTime, + scrollThrottleTime = _d === void 0 ? 0 : _d, + _e = _a.getScrollPosition, + getScrollPosition = _e === void 0 ? getDefaultScrollPosition : _e, + scrollOptions = _a.scrollOptions; + dragScroll.drag(e, __assign({ + container: scrollContainer, + threshold: scrollThreshold, + throttleTime: scrollThrottleTime, + getScrollPosition: function (ev) { + return getScrollPosition({ + scrollContainer: ev.container, + direction: ev.direction + }); + } + }, scrollOptions)); + return true; + }, + drag: function (moveable, e) { + return this.checkScroll(moveable, e); + }, + dragEnd: function (moveable, e) { + e.datas.dragScroll.dragEnd(); + e.datas.dragScroll = null; + }, + dragControlStart: function (moveable, e) { + return this.dragStart(moveable, __assign(__assign({}, e), { + isControl: true + })); + }, + dragControl: function (moveable, e) { + return this.drag(moveable, e); + }, + dragControlEnd: function (moveable, e) { + return this.dragEnd(moveable, e); + }, + dragGroupStart: function (moveable, e) { + return this.dragStart(moveable, __assign(__assign({}, e), { + targets: moveable.props.targets + })); + }, + dragGroup: function (moveable, e) { + return this.drag(moveable, __assign(__assign({}, e), { + targets: moveable.props.targets + })); + }, + dragGroupEnd: function (moveable, e) { + return this.dragEnd(moveable, __assign(__assign({}, e), { + targets: moveable.props.targets + })); + }, + dragGroupControlStart: function (moveable, e) { + return this.dragStart(moveable, __assign(__assign({}, e), { + targets: moveable.props.targets, + isControl: true + })); + }, + dragGroupControl: function (moveable, e) { + return this.drag(moveable, __assign(__assign({}, e), { + targets: moveable.props.targets + })); + }, + dragGroupControEnd: function (moveable, e) { + return this.dragEnd(moveable, __assign(__assign({}, e), { + targets: moveable.props.targets + })); + }, + unset: function (moveable) { + var _a; + + var state = moveable.state; + (_a = state.dragScroll) === null || _a === void 0 ? void 0 : _a.dragEnd(); + state.dragScroll = null; + } + }; + /** + * When the drag cursor leaves the scrollContainer, the `scroll` event occur to scroll. + * @memberof Moveable.Scrollable + * @event scroll + * @param {Moveable.Scrollable.OnScroll} - Parameters for the `scroll` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: document.querySelector(".target"), + * }); + * moveable.on("scroll", ({ scrollContainer, direction }) => { + * scrollContainer.scrollLeft += direction[0] * 10; + * scrollContainer.scrollTop += direction[1] * 10; + * }); + */ + + /** + * When the drag cursor leaves the scrollContainer, the `scrollGroup` event occur to scroll in group. + * @memberof Moveable.Scrollable + * @event scrollGroup + * @param {Moveable.Scrollable.OnScrollGroup} - Parameters for the `scrollGroup` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: [].slice.call(document.querySelectorAll(".target")), + * }); + * moveable.on("scroll", ({ scrollContainer, direction }) => { + * scrollContainer.scrollLeft += direction[0] * 10; + * scrollContainer.scrollTop += direction[1] * 10; + * }); + */ + + var Default = { + name: "", + props: ["target", "dragTargetSelf", "dragTarget", "dragContainer", "container", "warpSelf", "rootContainer", "useResizeObserver", "useMutationObserver", "zoom", "dragFocusedInput", "transformOrigin", "ables", "className", "pinchThreshold", "pinchOutside", "triggerAblesSimultaneously", "checkInput", "cspNonce", "translateZ", "hideDefaultLines", "props", "flushSync", "stopPropagation", "preventClickEventOnDrag", "preventClickDefault", "viewContainer", "persistData", "useAccuratePosition", "firstRenderState", "linePadding", "controlPadding", "preventDefault", "requestStyles"], + events: ["changeTargets"] + }; + var Padding = makeAble$1("padding", { + props: ["padding"], + render: function (moveable, React) { + var props = moveable.props; + + if (props.dragArea) { + return []; + } + + var _a = getPaddingBox(props.padding || {}), + left = _a.left, + top = _a.top, + right = _a.right, + bottom = _a.bottom; + + var _b = moveable.getState(), + renderPoses = _b.renderPoses, + pos1 = _b.pos1, + pos2 = _b.pos2, + pos3 = _b.pos3, + pos4 = _b.pos4; + + var poses = [pos1, pos2, pos3, pos4]; + var paddingDirections = []; + + if (left > 0) { + paddingDirections.push([0, 2]); + } + + if (top > 0) { + paddingDirections.push([0, 1]); + } + + if (right > 0) { + paddingDirections.push([1, 3]); + } + + if (bottom > 0) { + paddingDirections.push([2, 3]); + } + + return paddingDirections.map(function (_a, i) { + var _b = __read(_a, 2), + dir1 = _b[0], + dir2 = _b[1]; + + var paddingPos1 = poses[dir1]; + var paddingPos2 = poses[dir2]; + var paddingPos3 = renderPoses[dir1]; + var paddingPos4 = renderPoses[dir2]; + var h = createWarpMatrix([0, 0], [100, 0], [0, 100], [100, 100], paddingPos1, paddingPos2, paddingPos3, paddingPos4); + + if (!h.length) { + return undefined; + } + + return React.createElement("div", { + key: "padding".concat(i), + className: prefix("padding"), + style: { + transform: makeMatrixCSS(h, true) + } + }); + }); + } + }); + /** + * Add padding around the target to increase the drag area. + * @name Moveable#padding + * @default null + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: document.querySelector(".target"), + * padding: { left: 0, top: 0, right: 0, bottom: 0 }, + * }); + * moveable.padding = { left: 10, top: 10, right: 10, bottom: 10 }, + * moveable.updateRect(); + */ + + var RADIUS_DIRECTIONS = ["nw", "ne", "se", "sw"]; + + function calculateRatio(values, size) { + var sumSize = values[0] + values[1]; + var sumRatio = sumSize > size ? size / sumSize : 1; + values[0] *= sumRatio; + values[1] = size - values[1] * sumRatio; + return values; + } + + var HORIZONTAL_RADIUS_ORDER = [1, 2, 5, 6]; + var VERTICAL_RADIUS_ORDER = [0, 3, 4, 7]; + var HORIZONTAL_RADIUS_DIRECTIONS = [1, -1, -1, 1]; + var VERTICAL_RADIUS_DIRECTIONS = [1, 1, -1, -1]; + + function getRadiusStyles(nextPoses, isRelative, width, height, left, top, right, bottom) { + if (left === void 0) { + left = 0; + } + + if (top === void 0) { + top = 0; + } + + if (right === void 0) { + right = width; + } + + if (bottom === void 0) { + bottom = height; + } + + var clipStyles = []; + var isVertical = false; + var radiusPoses = nextPoses.filter(function (pos) { + return !pos.virtual; + }); + var raws = radiusPoses.map(function (posInfo) { + var horizontal = posInfo.horizontal, + vertical = posInfo.vertical, + pos = posInfo.pos; + + if (vertical && !isVertical) { + isVertical = true; + clipStyles.push("/"); + } + + if (isVertical) { + var rawPos = Math.max(0, vertical === 1 ? pos[1] - top : bottom - pos[1]); + clipStyles.push(convertCSSSize(rawPos, height, isRelative)); + return rawPos; + } else { + var rawPos = Math.max(0, horizontal === 1 ? pos[0] - left : right - pos[0]); + clipStyles.push(convertCSSSize(rawPos, width, isRelative)); + return rawPos; + } + }); + return { + radiusPoses: radiusPoses, + styles: clipStyles, + raws: raws + }; + } + + function getRadiusRange(controlPoses) { + // [start, length] + var horizontalRange = [0, 0]; + var verticalRange = [0, 0]; + var length = controlPoses.length; + + for (var i = 0; i < length; ++i) { + var clipPose = controlPoses[i]; + + if (!clipPose.sub) { + continue; + } + + if (clipPose.horizontal) { + if (horizontalRange[1] === 0) { + horizontalRange[0] = i; + } + + horizontalRange[1] = i - horizontalRange[0] + 1; + verticalRange[0] = i + 1; + } + + if (clipPose.vertical) { + if (verticalRange[1] === 0) { + verticalRange[0] = i; + } + + verticalRange[1] = i - verticalRange[0] + 1; + } + } + + return { + horizontalRange: horizontalRange, + verticalRange: verticalRange + }; + } + + function getRadiusValues(values, width, height, left, top, minCounts, full) { + var _a, _b, _c, _d; + + if (minCounts === void 0) { + minCounts = [0, 0]; + } + + if (full === void 0) { + full = false; + } + + var splitIndex = values.indexOf("/"); + var splitLength = (splitIndex > -1 ? values.slice(0, splitIndex) : values).length; + var horizontalValues = values.slice(0, splitLength); + var verticalValues = values.slice(splitLength + 1); + var horizontalValuesLength = horizontalValues.length; + var verticalValuesLength = verticalValues.length; + var hasVerticalValues = verticalValuesLength > 0; + + var _e = __read(horizontalValues, 4), + _f = _e[0], + nwValue = _f === void 0 ? "0px" : _f, + _g = _e[1], + neValue = _g === void 0 ? nwValue : _g, + _h = _e[2], + seValue = _h === void 0 ? nwValue : _h, + _j = _e[3], + swValue = _j === void 0 ? neValue : _j; + + var _k = __read(verticalValues, 4), + _l = _k[0], + wnValue = _l === void 0 ? nwValue : _l, + _m = _k[1], + enValue = _m === void 0 ? hasVerticalValues ? wnValue : neValue : _m, + _o = _k[2], + esValue = _o === void 0 ? hasVerticalValues ? wnValue : seValue : _o, + _p = _k[3], + wsValue = _p === void 0 ? hasVerticalValues ? enValue : swValue : _p; + + var horizontalRawPoses = [nwValue, neValue, seValue, swValue].map(function (pos) { + return convertUnitSize(pos, width); + }); + var verticalRawPoses = [wnValue, enValue, esValue, wsValue].map(function (pos) { + return convertUnitSize(pos, height); + }); + var horizontalPoses = horizontalRawPoses.slice(); + var verticalPoses = verticalRawPoses.slice(); + _a = __read(calculateRatio([horizontalPoses[0], horizontalPoses[1]], width), 2), horizontalPoses[0] = _a[0], horizontalPoses[1] = _a[1]; + _b = __read(calculateRatio([horizontalPoses[3], horizontalPoses[2]], width), 2), horizontalPoses[3] = _b[0], horizontalPoses[2] = _b[1]; + _c = __read(calculateRatio([verticalPoses[0], verticalPoses[3]], height), 2), verticalPoses[0] = _c[0], verticalPoses[3] = _c[1]; + _d = __read(calculateRatio([verticalPoses[1], verticalPoses[2]], height), 2), verticalPoses[1] = _d[0], verticalPoses[2] = _d[1]; + var nextHorizontalPoses = full ? horizontalPoses : horizontalPoses.slice(0, Math.max(minCounts[0], horizontalValuesLength)); + var nextVerticalPoses = full ? verticalPoses : verticalPoses.slice(0, Math.max(minCounts[1], verticalValuesLength)); + return __spreadArray(__spreadArray([], __read(nextHorizontalPoses.map(function (pos, i) { + var direction = RADIUS_DIRECTIONS[i]; + return { + virtual: i >= horizontalValuesLength, + horizontal: HORIZONTAL_RADIUS_DIRECTIONS[i], + vertical: 0, + pos: [left + pos, top + (VERTICAL_RADIUS_DIRECTIONS[i] === -1 ? height : 0)], + sub: true, + raw: horizontalRawPoses[i], + direction: direction + }; + })), false), __read(nextVerticalPoses.map(function (pos, i) { + var direction = RADIUS_DIRECTIONS[i]; + return { + virtual: i >= verticalValuesLength, + horizontal: 0, + vertical: VERTICAL_RADIUS_DIRECTIONS[i], + pos: [left + (HORIZONTAL_RADIUS_DIRECTIONS[i] === -1 ? width : 0), top + pos], + sub: true, + raw: verticalRawPoses[i], + direction: direction + }; + })), false); + } + + function removeRadiusPos(controlPoses, poses, index, startIndex, length) { + if (length === void 0) { + length = poses.length; + } + + var _a = getRadiusRange(controlPoses.slice(startIndex)), + horizontalRange = _a.horizontalRange, + verticalRange = _a.verticalRange; + + var radiuslIndex = index - startIndex; + var deleteCount = 0; + + if (radiuslIndex === 0) { + deleteCount = length; + } else if (radiuslIndex > 0 && radiuslIndex < horizontalRange[1]) { + deleteCount = horizontalRange[1] - radiuslIndex; + } else if (radiuslIndex >= verticalRange[0]) { + deleteCount = verticalRange[0] + verticalRange[1] - radiuslIndex; + } else { + return; + } + + controlPoses.splice(index, deleteCount); + poses.splice(index, deleteCount); + } + + function addRadiusPos(controlPoses, poses, startIndex, horizontalIndex, verticalIndex, distX, distY, right, bottom, left, top) { + if (left === void 0) { + left = 0; + } + + if (top === void 0) { + top = 0; + } + + var _a = getRadiusRange(controlPoses.slice(startIndex)), + horizontalRange = _a.horizontalRange, + verticalRange = _a.verticalRange; + + if (horizontalIndex > -1) { + var radiusX = HORIZONTAL_RADIUS_DIRECTIONS[horizontalIndex] === 1 ? distX - left : right - distX; + + for (var i = horizontalRange[1]; i <= horizontalIndex; ++i) { + var y = VERTICAL_RADIUS_DIRECTIONS[i] === 1 ? top : bottom; + var x = 0; + + if (horizontalIndex === i) { + x = distX; + } else if (i === 0) { + x = left + radiusX; + } else if (HORIZONTAL_RADIUS_DIRECTIONS[i] === -1) { + x = right - (poses[startIndex][0] - left); + } + + controlPoses.splice(startIndex + i, 0, { + horizontal: HORIZONTAL_RADIUS_DIRECTIONS[i], + vertical: 0, + pos: [x, y] + }); + poses.splice(startIndex + i, 0, [x, y]); + + if (i === 0) { + break; + } + } + } else if (verticalIndex > -1) { + var radiusY = VERTICAL_RADIUS_DIRECTIONS[verticalIndex] === 1 ? distY - top : bottom - distY; + + if (horizontalRange[1] === 0 && verticalRange[1] === 0) { + var pos = [left + radiusY, top]; + controlPoses.push({ + horizontal: HORIZONTAL_RADIUS_DIRECTIONS[0], + vertical: 0, + pos: pos + }); + poses.push(pos); + } + + var startVerticalIndex = verticalRange[0]; + + for (var i = verticalRange[1]; i <= verticalIndex; ++i) { + var x = HORIZONTAL_RADIUS_DIRECTIONS[i] === 1 ? left : right; + var y = 0; + + if (verticalIndex === i) { + y = distY; + } else if (i === 0) { + y = top + radiusY; + } else if (VERTICAL_RADIUS_DIRECTIONS[i] === 1) { + y = poses[startIndex + startVerticalIndex][1]; + } else if (VERTICAL_RADIUS_DIRECTIONS[i] === -1) { + y = bottom - (poses[startIndex + startVerticalIndex][1] - top); + } + + controlPoses.push({ + horizontal: 0, + vertical: VERTICAL_RADIUS_DIRECTIONS[i], + pos: [x, y] + }); + poses.push([x, y]); + + if (i === 0) { + break; + } + } + } + } + + function splitRadiusPoses(controlPoses, raws) { + if (raws === void 0) { + raws = controlPoses.map(function (pos) { + return pos.raw; + }); + } + + var horizontals = controlPoses.map(function (pos, i) { + return pos.horizontal ? raws[i] : null; + }).filter(function (pos) { + return pos != null; + }); + var verticals = controlPoses.map(function (pos, i) { + return pos.vertical ? raws[i] : null; + }).filter(function (pos) { + return pos != null; + }); + return { + horizontals: horizontals, + verticals: verticals + }; + } + + var CLIP_DIRECTIONS = [[0, -1, "n"], [1, 0, "e"]]; + var CLIP_RECT_DIRECTIONS = [[-1, -1, "nw"], [0, -1, "n"], [1, -1, "ne"], [1, 0, "e"], [1, 1, "se"], [0, 1, "s"], [-1, 1, "sw"], [-1, 0, "w"]]; // 1 2 5 6 0 3 4 7 + // 0 1 2 3 4 5 6 7 + + function getClipStyles(moveable, clipPath, poses) { + var clipRelative = moveable.props.clipRelative; + var _a = moveable.state, + width = _a.width, + height = _a.height; + var _b = clipPath, + clipType = _b.type, + clipPoses = _b.poses; + var isRect = clipType === "rect"; + var isCircle = clipType === "circle"; + + if (clipType === "polygon") { + return poses.map(function (pos) { + return "".concat(convertCSSSize(pos[0], width, clipRelative), " ").concat(convertCSSSize(pos[1], height, clipRelative)); + }); + } else if (isRect || clipType === "inset") { + var top_1 = poses[1][1]; + var right = poses[3][0]; + var left = poses[7][0]; + var bottom = poses[5][1]; + + if (isRect) { + return [top_1, right, bottom, left].map(function (pos) { + return "".concat(pos, "px"); + }); + } + + var clipStyles = [top_1, width - right, height - bottom, left].map(function (pos, i) { + return convertCSSSize(pos, i % 2 ? width : height, clipRelative); + }); + + if (poses.length > 8) { + var _c = __read(minus(poses[4], poses[0]), 2), + subWidth = _c[0], + subHeight = _c[1]; + + clipStyles.push.apply(clipStyles, __spreadArray(["round"], __read(getRadiusStyles(clipPoses.slice(8).map(function (info, i) { + return __assign(__assign({}, info), { + pos: poses[i] + }); + }), clipRelative, subWidth, subHeight, left, top_1, right, bottom).styles), false)); + } + + return clipStyles; + } else if (isCircle || clipType === "ellipse") { + var center = poses[0]; + var ry = convertCSSSize(abs(poses[1][1] - center[1]), isCircle ? Math.sqrt((width * width + height * height) / 2) : height, clipRelative); + var clipStyles = isCircle ? [ry] : [convertCSSSize(abs(poses[2][0] - center[0]), width, clipRelative), ry]; + clipStyles.push("at", convertCSSSize(center[0], width, clipRelative), convertCSSSize(center[1], height, clipRelative)); + return clipStyles; + } + } + + function getRectPoses(top, right, bottom, left) { + var xs = [left, (left + right) / 2, right]; + var ys = [top, (top + bottom) / 2, bottom]; + return CLIP_RECT_DIRECTIONS.map(function (_a) { + var _b = __read(_a, 3), + dirx = _b[0], + diry = _b[1], + dir = _b[2]; + + var x = xs[dirx + 1]; + var y = ys[diry + 1]; + return { + vertical: abs(diry), + horizontal: abs(dirx), + direction: dir, + pos: [x, y] + }; + }); + } + + function getControlSize(controlPoses) { + var xRange = [Infinity, -Infinity]; + var yRange = [Infinity, -Infinity]; + controlPoses.forEach(function (_a) { + var pos = _a.pos; + xRange[0] = Math.min(xRange[0], pos[0]); + xRange[1] = Math.max(xRange[1], pos[0]); + yRange[0] = Math.min(yRange[0], pos[1]); + yRange[1] = Math.max(yRange[1], pos[1]); + }); + return [abs(xRange[1] - xRange[0]), abs(yRange[1] - yRange[0])]; + } + + function getClipPath(target, width, height, defaultClip, customClip) { + var _a, _b, _c, _d, _e, _f, _g, _h, _j; + + if (!target) { + return; + } + + var clipText = customClip; + + if (!clipText) { + var getStyle = getCachedStyle(target); + var clipPath = getStyle("clipPath"); + clipText = clipPath !== "none" ? clipPath : getStyle("clip"); + } + + if (!clipText || clipText === "none" || clipText === "auto") { + clipText = defaultClip; + + if (!clipText) { + return; + } + } + + var _k = splitBracket(clipText), + _l = _k.prefix, + clipPrefix = _l === void 0 ? clipText : _l, + _m = _k.value, + value = _m === void 0 ? "" : _m; + + var isCircle = clipPrefix === "circle"; + var splitter = " "; + + if (clipPrefix === "polygon") { + var values = splitComma(value || "0% 0%, 100% 0%, 100% 100%, 0% 100%"); + splitter = ","; + var poses = values.map(function (pos) { + var _a = __read(pos.split(" "), 2), + xPos = _a[0], + yPos = _a[1]; + + return { + vertical: 1, + horizontal: 1, + pos: [convertUnitSize(xPos, width), convertUnitSize(yPos, height)] + }; + }); + var minMaxs = getMinMaxs(poses.map(function (pos) { + return pos.pos; + })); + return { + type: clipPrefix, + clipText: clipText, + poses: poses, + splitter: splitter, + left: minMaxs.minX, + right: minMaxs.maxX, + top: minMaxs.minY, + bottom: minMaxs.maxY + }; + } else if (isCircle || clipPrefix === "ellipse") { + var xPos = ""; + var yPos = ""; + var radiusX_1 = 0; + var radiusY_1 = 0; + var values = splitSpace(value); + + if (isCircle) { + var radius = ""; + _a = __read(values, 4), _b = _a[0], radius = _b === void 0 ? "50%" : _b, _c = _a[2], xPos = _c === void 0 ? "50%" : _c, _d = _a[3], yPos = _d === void 0 ? "50%" : _d; + radiusX_1 = convertUnitSize(radius, Math.sqrt((width * width + height * height) / 2)); + radiusY_1 = radiusX_1; + } else { + var xRadius = ""; + var yRadius = ""; + _e = __read(values, 5), _f = _e[0], xRadius = _f === void 0 ? "50%" : _f, _g = _e[1], yRadius = _g === void 0 ? "50%" : _g, _h = _e[3], xPos = _h === void 0 ? "50%" : _h, _j = _e[4], yPos = _j === void 0 ? "50%" : _j; + radiusX_1 = convertUnitSize(xRadius, width); + radiusY_1 = convertUnitSize(yRadius, height); + } + + var centerPos_1 = [convertUnitSize(xPos, width), convertUnitSize(yPos, height)]; + + var poses = __spreadArray([{ + vertical: 1, + horizontal: 1, + pos: centerPos_1, + direction: "nesw" + }], __read(CLIP_DIRECTIONS.slice(0, isCircle ? 1 : 2).map(function (dir) { + return { + vertical: abs(dir[1]), + horizontal: dir[0], + direction: dir[2], + sub: true, + pos: [centerPos_1[0] + dir[0] * radiusX_1, centerPos_1[1] + dir[1] * radiusY_1] + }; + })), false); + + return { + type: clipPrefix, + clipText: clipText, + radiusX: radiusX_1, + radiusY: radiusY_1, + left: centerPos_1[0] - radiusX_1, + top: centerPos_1[1] - radiusY_1, + right: centerPos_1[0] + radiusX_1, + bottom: centerPos_1[1] + radiusY_1, + poses: poses, + splitter: splitter + }; + } else if (clipPrefix === "inset") { + var values = splitSpace(value || "0 0 0 0"); + var roundIndex = values.indexOf("round"); + var rectLength = (roundIndex > -1 ? values.slice(0, roundIndex) : values).length; + var radiusValues = values.slice(rectLength + 1); + + var _o = __read(values.slice(0, rectLength), 4), + topValue = _o[0], + _p = _o[1], + rightValue = _p === void 0 ? topValue : _p, + _q = _o[2], + bottomValue = _q === void 0 ? topValue : _q, + _r = _o[3], + leftValue = _r === void 0 ? rightValue : _r; + + var _s = __read([topValue, bottomValue].map(function (pos) { + return convertUnitSize(pos, height); + }), 2), + top_2 = _s[0], + bottom = _s[1]; + + var _t = __read([leftValue, rightValue].map(function (pos) { + return convertUnitSize(pos, width); + }), 2), + left = _t[0], + right = _t[1]; + + var nextRight = width - right; + var nextBottom = height - bottom; + var radiusPoses = getRadiusValues(radiusValues, nextRight - left, nextBottom - top_2, left, top_2); + + var poses = __spreadArray(__spreadArray([], __read(getRectPoses(top_2, nextRight, nextBottom, left)), false), __read(radiusPoses), false); + + return { + type: "inset", + clipText: clipText, + poses: poses, + top: top_2, + left: left, + right: nextRight, + bottom: nextBottom, + radius: radiusValues, + splitter: splitter + }; + } else if (clipPrefix === "rect") { + // top right bottom left + var values = splitComma(value || "0px, ".concat(width, "px, ").concat(height, "px, 0px")); + splitter = ","; + + var _u = __read(values.map(function (pos) { + var posValue = splitUnit(pos).value; + return posValue; + }), 4), + top_3 = _u[0], + right = _u[1], + bottom = _u[2], + left = _u[3]; + + var poses = getRectPoses(top_3, right, bottom, left); + return { + type: "rect", + clipText: clipText, + poses: poses, + top: top_3, + right: right, + bottom: bottom, + left: left, + values: values, + splitter: splitter + }; + } + + return; + } + + function moveControlPos(controlPoses, index, dist, isRect, keepRatio) { + var _a = controlPoses[index], + direction = _a.direction, + sub = _a.sub; + var dists = controlPoses.map(function () { + return [0, 0]; + }); + var directions = direction ? direction.split("") : []; + + if (isRect && index < 8) { + var verticalDirections = directions.filter(function (dir) { + return dir === "w" || dir === "e"; + }); + var horizontalDirections = directions.filter(function (dir) { + return dir === "n" || dir === "s"; + }); + var verticalDirection_1 = verticalDirections[0]; + var horizontalDirection_1 = horizontalDirections[0]; + dists[index] = dist; + + var _b = __read(getControlSize(controlPoses), 2), + width = _b[0], + height = _b[1]; + + var ratio = width && height ? width / height : 0; + + if (ratio && keepRatio) { + // 0 1 2 + // 7 3 + // 6 5 4 + var fixedIndex = (index + 4) % 8; + var fixedPosition = controlPoses[fixedIndex].pos; + var sizeDirection = [0, 0]; + + if (direction.indexOf("w") > -1) { + sizeDirection[0] = -1; + } else if (direction.indexOf("e") > -1) { + sizeDirection[0] = 1; + } + + if (direction.indexOf("n") > -1) { + sizeDirection[1] = -1; + } else if (direction.indexOf("s") > -1) { + sizeDirection[1] = 1; + } + + var nextDist = getSizeDistByDist([width, height], dist, ratio, sizeDirection, true); + var nextWidth = width + nextDist[0]; + var nextHeight = height + nextDist[1]; + var top_1 = fixedPosition[1]; + var bottom = fixedPosition[1]; + var left = fixedPosition[0]; + var right = fixedPosition[0]; + + if (sizeDirection[0] === -1) { + left = right - nextWidth; + } else if (sizeDirection[0] === 1) { + right = left + nextWidth; + } else { + left = left - nextWidth / 2; + right = right + nextWidth / 2; + } + + if (sizeDirection[1] === -1) { + top_1 = bottom - nextHeight; + } else if (sizeDirection[1] === 1) { + bottom = top_1 + nextHeight; + } else { + top_1 = bottom - nextHeight / 2; + bottom = top_1 + nextHeight; + } + + var nextControlPoses_1 = getRectPoses(top_1, right, bottom, left); + controlPoses.forEach(function (controlPose, i) { + dists[i][0] = nextControlPoses_1[i].pos[0] - controlPose.pos[0]; + dists[i][1] = nextControlPoses_1[i].pos[1] - controlPose.pos[1]; + }); + } else { + controlPoses.forEach(function (controlPose, i) { + var controlDir = controlPose.direction; + + if (!controlDir) { + return; + } + + if (controlDir.indexOf(verticalDirection_1) > -1) { + dists[i][0] = dist[0]; + } + + if (controlDir.indexOf(horizontalDirection_1) > -1) { + dists[i][1] = dist[1]; + } + }); + + if (verticalDirection_1) { + dists[1][0] = dist[0] / 2; + dists[5][0] = dist[0] / 2; + } + + if (horizontalDirection_1) { + dists[3][1] = dist[1] / 2; + dists[7][1] = dist[1] / 2; + } + } + } else if (direction && !sub) { + directions.forEach(function (dir) { + var isVertical = dir === "n" || dir === "s"; + controlPoses.forEach(function (controlPose, i) { + var dirDir = controlPose.direction, + dirHorizontal = controlPose.horizontal, + dirVertical = controlPose.vertical; + + if (!dirDir || dirDir.indexOf(dir) === -1) { + return; + } + + dists[i] = [isVertical || !dirHorizontal ? 0 : dist[0], !isVertical || !dirVertical ? 0 : dist[1]]; + }); + }); + } else { + dists[index] = dist; + } + + return dists; + } + + function addClipPath(moveable, e) { + var _a = __read(calculatePointerDist(moveable, e), 2), + distX = _a[0], + distY = _a[1]; + + var _b = e.datas, + clipPath = _b.clipPath, + clipIndex = _b.clipIndex; + var _c = clipPath, + clipType = _c.type, + clipPoses = _c.poses, + splitter = _c.splitter; + var poses = clipPoses.map(function (pos) { + return pos.pos; + }); + + if (clipType === "polygon") { + poses.splice(clipIndex, 0, [distX, distY]); + } else if (clipType === "inset") { + var horizontalIndex = HORIZONTAL_RADIUS_ORDER.indexOf(clipIndex); + var verticalIndex = VERTICAL_RADIUS_ORDER.indexOf(clipIndex); + var length_1 = clipPoses.length; + addRadiusPos(clipPoses, poses, 8, horizontalIndex, verticalIndex, distX, distY, poses[4][0], poses[4][1], poses[0][0], poses[0][1]); + + if (length_1 === clipPoses.length) { + return; + } + } else { + return; + } + + var clipStyles = getClipStyles(moveable, clipPath, poses); + var clipStyle = "".concat(clipType, "(").concat(clipStyles.join(splitter), ")"); + triggerEvent(moveable, "onClip", fillParams(moveable, e, __assign({ + clipEventType: "added", + clipType: clipType, + poses: poses, + clipStyles: clipStyles, + clipStyle: clipStyle, + distX: 0, + distY: 0 + }, fillCSSObject({ + clipPath: clipStyle + }, e)))); + } + + function removeClipPath(moveable, e) { + var _a = e.datas, + clipPath = _a.clipPath, + clipIndex = _a.clipIndex; + var _b = clipPath, + clipType = _b.type, + clipPoses = _b.poses, + splitter = _b.splitter; + var poses = clipPoses.map(function (pos) { + return pos.pos; + }); + var length = poses.length; + + if (clipType === "polygon") { + clipPoses.splice(clipIndex, 1); + poses.splice(clipIndex, 1); + } else if (clipType === "inset") { + if (clipIndex < 8) { + return; + } + + removeRadiusPos(clipPoses, poses, clipIndex, 8, length); + + if (length === clipPoses.length) { + return; + } + } else { + return; + } + + var clipStyles = getClipStyles(moveable, clipPath, poses); + var clipStyle = "".concat(clipType, "(").concat(clipStyles.join(splitter), ")"); + triggerEvent(moveable, "onClip", fillParams(moveable, e, __assign({ + clipEventType: "removed", + clipType: clipType, + poses: poses, + clipStyles: clipStyles, + clipStyle: clipStyle, + distX: 0, + distY: 0 + }, fillCSSObject({ + clipPath: clipStyle + }, e)))); + } + /** + * @namespace Moveable.Clippable + * @description Whether to clip the target. + */ + + + var Clippable = { + name: "clippable", + props: ["clippable", "defaultClipPath", "customClipPath", "keepRatio", "clipRelative", "clipArea", "dragWithClip", "clipTargetBounds", "clipVerticalGuidelines", "clipHorizontalGuidelines", "clipSnapThreshold"], + events: ["clipStart", "clip", "clipEnd"], + css: [".control.clip-control {\nbackground: #6d6;\ncursor: pointer;\n}\n.control.clip-control.clip-radius {\nbackground: #d66;\n}\n.line.clip-line {\nbackground: #6e6;\ncursor: move;\nz-index: 1;\n}\n.clip-area {\nposition: absolute;\ntop: 0;\nleft: 0;\n}\n.clip-ellipse {\nposition: absolute;\ncursor: move;\nborder: 1px solid #6d6;\nborder: var(--zoompx) solid #6d6;\nborder-radius: 50%;\ntransform-origin: 0px 0px;\n}", ":host {\n--bounds-color: #d66;\n}", ".guideline {\npointer-events: none;\nz-index: 2;\n}", ".line.guideline.bounds {\nbackground: #d66;\nbackground: var(--bounds-color);\n}"], + render: function (moveable, React) { + var _a = moveable.props, + customClipPath = _a.customClipPath, + defaultClipPath = _a.defaultClipPath, + clipArea = _a.clipArea, + zoom = _a.zoom, + groupable = _a.groupable; + + var _b = moveable.getState(), + target = _b.target, + width = _b.width, + height = _b.height, + allMatrix = _b.allMatrix, + is3d = _b.is3d, + left = _b.left, + top = _b.top, + pos1 = _b.pos1, + pos2 = _b.pos2, + pos3 = _b.pos3, + pos4 = _b.pos4, + clipPathState = _b.clipPathState, + snapBoundInfos = _b.snapBoundInfos, + rotationRad = _b.rotation; + + if (!target || groupable) { + return []; + } + + var clipPath = getClipPath(target, width, height, defaultClipPath || "inset", clipPathState || customClipPath); + + if (!clipPath) { + return []; + } + + var n = is3d ? 4 : 3; + var type = clipPath.type; + var clipPoses = clipPath.poses; + var poses = clipPoses.map(function (pos) { + // return [x, y]; + var calculatedPos = calculatePosition(allMatrix, pos.pos, n); + return [calculatedPos[0] - left, calculatedPos[1] - top]; + }); + var controls = []; + var lines = []; + var isRect = type === "rect"; + var isInset = type === "inset"; + var isPolygon = type === "polygon"; + + if (isRect || isInset || isPolygon) { + var linePoses_1 = isInset ? poses.slice(0, 8) : poses; + lines = linePoses_1.map(function (to, i) { + var from = i === 0 ? linePoses_1[linePoses_1.length - 1] : linePoses_1[i - 1]; + var rad = getRad$1(from, to); + var dist = getDiagonalSize(from, to); + return React.createElement("div", { + key: "clipLine".concat(i), + className: prefix("line", "clip-line", "snap-control"), + "data-clip-index": i, + style: { + width: "".concat(dist, "px"), + transform: "translate(".concat(from[0], "px, ").concat(from[1], "px) rotate(").concat(rad, "rad) scaleY(").concat(zoom, ")") + } + }); + }); + } + + controls = poses.map(function (pos, i) { + return React.createElement("div", { + key: "clipControl".concat(i), + className: prefix("control", "clip-control", "snap-control"), + "data-clip-index": i, + style: { + transform: "translate(".concat(pos[0], "px, ").concat(pos[1], "px) rotate(").concat(rotationRad, "rad) scale(").concat(zoom, ")") + } + }); + }); + + if (isInset) { + controls.push.apply(controls, __spreadArray([], __read(poses.slice(8).map(function (pos, i) { + return React.createElement("div", { + key: "clipRadiusControl".concat(i), + className: prefix("control", "clip-control", "clip-radius", "snap-control"), + "data-clip-index": 8 + i, + style: { + transform: "translate(".concat(pos[0], "px, ").concat(pos[1], "px) rotate(").concat(rotationRad, "rad) scale(").concat(zoom, ")") + } + }); + })), false)); + } + + if (type === "circle" || type === "ellipse") { + var clipLeft = clipPath.left, + clipTop = clipPath.top, + radiusX = clipPath.radiusX, + radiusY = clipPath.radiusY; + + var _c = __read(minus(calculatePosition(allMatrix, [clipLeft, clipTop], n), calculatePosition(allMatrix, [0, 0], n)), 2), + distLeft = _c[0], + distTop = _c[1]; + + var ellipseClipPath = "none"; + + if (!clipArea) { + var piece = Math.max(10, radiusX / 5, radiusY / 5); + var areaPoses = []; + + for (var i = 0; i <= piece; ++i) { + var rad = Math.PI * 2 / piece * i; + areaPoses.push([radiusX + (radiusX - zoom) * Math.cos(rad), radiusY + (radiusY - zoom) * Math.sin(rad)]); + } + + areaPoses.push([radiusX, -2]); + areaPoses.push([-2, -2]); + areaPoses.push([-2, radiusY * 2 + 2]); + areaPoses.push([radiusX * 2 + 2, radiusY * 2 + 2]); + areaPoses.push([radiusX * 2 + 2, -2]); + areaPoses.push([radiusX, -2]); + ellipseClipPath = "polygon(".concat(areaPoses.map(function (pos) { + return "".concat(pos[0], "px ").concat(pos[1], "px"); + }).join(", "), ")"); + } + + controls.push(React.createElement("div", { + key: "clipEllipse", + className: prefix("clip-ellipse", "snap-control"), + style: { + width: "".concat(radiusX * 2, "px"), + height: "".concat(radiusY * 2, "px"), + clipPath: ellipseClipPath, + transform: "translate(".concat(-left + distLeft, "px, ").concat(-top + distTop, "px) ").concat(makeMatrixCSS(allMatrix)) + } + })); + } + + if (clipArea) { + var _d = getRect(__spreadArray([pos1, pos2, pos3, pos4], __read(poses), false)), + allWidth = _d.width, + allHeight = _d.height, + allLeft_1 = _d.left, + allTop_1 = _d.top; + + if (isPolygon || isRect || isInset) { + var areaPoses = isInset ? poses.slice(0, 8) : poses; + controls.push(React.createElement("div", { + key: "clipArea", + className: prefix("clip-area", "snap-control"), + style: { + width: "".concat(allWidth, "px"), + height: "".concat(allHeight, "px"), + transform: "translate(".concat(allLeft_1, "px, ").concat(allTop_1, "px)"), + clipPath: "polygon(".concat(areaPoses.map(function (pos) { + return "".concat(pos[0] - allLeft_1, "px ").concat(pos[1] - allTop_1, "px"); + }).join(", "), ")") + } + })); + } + } + + if (snapBoundInfos) { + ["vertical", "horizontal"].forEach(function (directionType) { + var info = snapBoundInfos[directionType]; + var isHorizontal = directionType === "horizontal"; + + if (info.isSnap) { + lines.push.apply(lines, __spreadArray([], __read(info.snap.posInfos.map(function (_a, i) { + var pos = _a.pos; + var snapPos1 = minus(calculatePosition(allMatrix, isHorizontal ? [0, pos] : [pos, 0], n), [left, top]); + var snapPos2 = minus(calculatePosition(allMatrix, isHorizontal ? [width, pos] : [pos, height], n), [left, top]); + return renderLine(React, "", snapPos1, snapPos2, zoom, "clip".concat(directionType, "snap").concat(i), "guideline"); + })), false)); + } + + if (info.isBound) { + lines.push.apply(lines, __spreadArray([], __read(info.bounds.map(function (_a, i) { + var pos = _a.pos; + var snapPos1 = minus(calculatePosition(allMatrix, isHorizontal ? [0, pos] : [pos, 0], n), [left, top]); + var snapPos2 = minus(calculatePosition(allMatrix, isHorizontal ? [width, pos] : [pos, height], n), [left, top]); + return renderLine(React, "", snapPos1, snapPos2, zoom, "clip".concat(directionType, "bounds").concat(i), "guideline", "bounds", "bold"); + })), false)); + } + }); + } + + return __spreadArray(__spreadArray([], __read(controls), false), __read(lines), false); + }, + dragControlCondition: function (moveable, e) { + return e.inputEvent && (e.inputEvent.target.getAttribute("class") || "").indexOf("clip") > -1; + }, + dragStart: function (moveable, e) { + var props = moveable.props; + var _a = props.dragWithClip, + dragWithClip = _a === void 0 ? true : _a; + + if (dragWithClip) { + return false; + } + + return this.dragControlStart(moveable, e); + }, + drag: function (moveable, e) { + return this.dragControl(moveable, __assign(__assign({}, e), { + isDragTarget: true + })); + }, + dragEnd: function (moveable, e) { + return this.dragControlEnd(moveable, e); + }, + dragControlStart: function (moveable, e) { + var state = moveable.state; + var _a = moveable.props, + defaultClipPath = _a.defaultClipPath, + customClipPath = _a.customClipPath; + var target = state.target, + width = state.width, + height = state.height; + var inputTarget = e.inputEvent ? e.inputEvent.target : null; + var className = inputTarget && inputTarget.getAttribute("class") || ""; + var datas = e.datas; + var clipPath = getClipPath(target, width, height, defaultClipPath || "inset", customClipPath); + + if (!clipPath) { + return false; + } + + var clipText = clipPath.clipText, + type = clipPath.type, + poses = clipPath.poses; + var result = triggerEvent(moveable, "onClipStart", fillParams(moveable, e, { + clipType: type, + clipStyle: clipText, + poses: poses.map(function (pos) { + return pos.pos; + }) + })); + + if (result === false) { + datas.isClipStart = false; + return false; + } + + datas.isControl = className && className.indexOf("clip-control") > -1; + datas.isLine = className.indexOf("clip-line") > -1; + datas.isArea = className.indexOf("clip-area") > -1 || className.indexOf("clip-ellipse") > -1; + datas.clipIndex = inputTarget ? parseInt(inputTarget.getAttribute("data-clip-index"), 10) : -1; + datas.clipPath = clipPath; + datas.isClipStart = true; + state.clipPathState = clipText; + setDragStart(moveable, e); + return true; + }, + dragControl: function (moveable, e) { + var _a, _b, _c; + + var datas = e.datas, + originalDatas = e.originalDatas, + isDragTarget = e.isDragTarget; + + if (!datas.isClipStart) { + return false; + } + + var _d = datas, + isControl = _d.isControl, + isLine = _d.isLine, + isArea = _d.isArea, + clipIndex = _d.clipIndex, + clipPath = _d.clipPath; + + if (!clipPath) { + return false; + } + + var props = getProps(moveable.props, "clippable"); + var keepRatio = props.keepRatio; + var distX = 0; + var distY = 0; + var originalDraggable = originalDatas.draggable; + var originalDist = getDragDist(e); + + if (isDragTarget && originalDraggable) { + _a = __read(originalDraggable.prevBeforeDist, 2), distX = _a[0], distY = _a[1]; + } else { + _b = __read(originalDist, 2), distX = _b[0], distY = _b[1]; + } + + var firstDist = [distX, distY]; + var state = moveable.state; + var width = state.width, + height = state.height; + var isDragWithTarget = !isArea && !isControl && !isLine; + var clipType = clipPath.type, + clipPoses = clipPath.poses, + splitter = clipPath.splitter; + var poses = clipPoses.map(function (pos) { + return pos.pos; + }); + + if (isDragWithTarget) { + distX = -distX; + distY = -distY; + } + + var isAll = !isControl || clipPoses[clipIndex].direction === "nesw"; + var isRect = clipType === "inset" || clipType === "rect"; + var dists = clipPoses.map(function () { + return [0, 0]; + }); + + if (isControl && !isAll) { + var _e = clipPoses[clipIndex], + horizontal = _e.horizontal, + vertical = _e.vertical; + var dist = [distX * abs(horizontal), distY * abs(vertical)]; + dists = moveControlPos(clipPoses, clipIndex, dist, isRect, keepRatio); + } else if (isAll) { + dists = poses.map(function () { + return [distX, distY]; + }); + } + + var nextPoses = poses.map(function (pos, i) { + return plus(pos, dists[i]); + }); + + var guidePoses = __spreadArray([], __read(nextPoses), false); + + state.snapBoundInfos = null; + var isCircle = clipPath.type === "circle"; + var isEllipse = clipPath.type === "ellipse"; + + if (isCircle || isEllipse) { + var guideRect = getRect(nextPoses); + var ry = abs(guideRect.bottom - guideRect.top); + var rx = abs(isEllipse ? guideRect.right - guideRect.left : ry); + var bottom = nextPoses[0][1] + ry; + var left = nextPoses[0][0] - rx; + var right = nextPoses[0][0] + rx; // right + + if (isCircle) { + guidePoses.push([right, guideRect.bottom]); + dists.push([1, 0]); + } // bottom + + + guidePoses.push([guideRect.left, bottom]); + dists.push([0, 1]); // left + + guidePoses.push([left, guideRect.bottom]); + dists.push([1, 0]); + } + + var guidelines = getDefaultGuidelines((props.clipHorizontalGuidelines || []).map(function (v) { + return convertUnitSize("".concat(v), height); + }), (props.clipVerticalGuidelines || []).map(function (v) { + return convertUnitSize("".concat(v), width); + }), width, height); + var guideXPoses = []; + var guideYPoses = []; + + if (isCircle || isEllipse) { + guideXPoses = [guidePoses[4][0], guidePoses[2][0]]; + guideYPoses = [guidePoses[1][1], guidePoses[3][1]]; + } else if (isRect) { + var rectPoses = [guidePoses[0], guidePoses[2], guidePoses[4], guidePoses[6]]; + var rectDists_1 = [dists[0], dists[2], dists[4], dists[6]]; + guideXPoses = rectPoses.filter(function (_, i) { + return rectDists_1[i][0]; + }).map(function (pos) { + return pos[0]; + }); + guideYPoses = rectPoses.filter(function (_, i) { + return rectDists_1[i][1]; + }).map(function (pos) { + return pos[1]; + }); + } else { + guideXPoses = guidePoses.filter(function (_, i) { + return dists[i][0]; + }).map(function (pos) { + return pos[0]; + }); + guideYPoses = guidePoses.filter(function (_, i) { + return dists[i][1]; + }).map(function (pos) { + return pos[1]; + }); + } + + var boundDelta = [0, 0]; + + var _f = checkSnapBounds(guidelines, props.clipTargetBounds && { + left: 0, + top: 0, + right: width, + bottom: height + }, guideXPoses, guideYPoses, 5), + horizontalSnapInfo = _f.horizontal, + verticalSnapInfo = _f.vertical; + + var snapOffsetY = horizontalSnapInfo.offset; + var snapOffsetX = verticalSnapInfo.offset; + + if (horizontalSnapInfo.isBound) { + boundDelta[1] += snapOffsetY; + } + + if (verticalSnapInfo.isBound) { + boundDelta[0] += snapOffsetX; + } + + if ((isEllipse || isCircle) && dists[0][0] === 0 && dists[0][1] === 0) { + var guideRect = getRect(nextPoses); + var cy = guideRect.bottom - guideRect.top; + var cx = isEllipse ? guideRect.right - guideRect.left : cy; + var distSnapX = verticalSnapInfo.isBound ? abs(snapOffsetX) : verticalSnapInfo.snapIndex === 0 ? -snapOffsetX : snapOffsetX; + var distSnapY = horizontalSnapInfo.isBound ? abs(snapOffsetY) : horizontalSnapInfo.snapIndex === 0 ? -snapOffsetY : snapOffsetY; + cx -= distSnapX; + cy -= distSnapY; + + if (isCircle) { + cy = checkSnapBoundPriority(verticalSnapInfo, horizontalSnapInfo) > 0 ? cy : cx; + cx = cy; + } + + var center = guidePoses[0]; + guidePoses[1][1] = center[1] - cy; + guidePoses[2][0] = center[0] + cx; + guidePoses[3][1] = center[1] + cy; + guidePoses[4][0] = center[0] - cx; + } else if (isRect && keepRatio && isControl) { + var _g = __read(getControlSize(clipPoses), 2), + width_1 = _g[0], + height_1 = _g[1]; + + var ratio = width_1 && height_1 ? width_1 / height_1 : 0; + var clipPose = clipPoses[clipIndex]; + var direction = clipPose.direction || ""; + var top_2 = guidePoses[1][1]; + var bottom = guidePoses[5][1]; + var left = guidePoses[7][0]; + var right = guidePoses[3][0]; + + if (abs(snapOffsetY) <= abs(snapOffsetX)) { + snapOffsetY = sign(snapOffsetY) * abs(snapOffsetX) / ratio; + } else { + snapOffsetX = sign(snapOffsetX) * abs(snapOffsetY) * ratio; + } + + if (direction.indexOf("w") > -1) { + left -= snapOffsetX; + } else if (direction.indexOf("e") > -1) { + right -= snapOffsetX; + } else { + left += snapOffsetX / 2; + right -= snapOffsetX / 2; + } + + if (direction.indexOf("n") > -1) { + top_2 -= snapOffsetY; + } else if (direction.indexOf("s") > -1) { + bottom -= snapOffsetY; + } else { + top_2 += snapOffsetY / 2; + bottom -= snapOffsetY / 2; + } + + var nextControlPoses_2 = getRectPoses(top_2, right, bottom, left); + guidePoses.forEach(function (pos, i) { + var _a; + + _a = __read(nextControlPoses_2[i].pos, 2), pos[0] = _a[0], pos[1] = _a[1]; + }); + } else { + guidePoses.forEach(function (pos, j) { + var dist = dists[j]; + + if (dist[0]) { + pos[0] -= snapOffsetX; + } + + if (dist[1]) { + pos[1] -= snapOffsetY; + } + }); + } + + var nextClipStyles = getClipStyles(moveable, clipPath, nextPoses); + var clipStyle = "".concat(clipType, "(").concat(nextClipStyles.join(splitter), ")"); + state.clipPathState = clipStyle; + + if (isCircle || isEllipse) { + guideXPoses = [guidePoses[4][0], guidePoses[2][0]]; + guideYPoses = [guidePoses[1][1], guidePoses[3][1]]; + } else if (isRect) { + var rectPoses = [guidePoses[0], guidePoses[2], guidePoses[4], guidePoses[6]]; + guideXPoses = rectPoses.map(function (pos) { + return pos[0]; + }); + guideYPoses = rectPoses.map(function (pos) { + return pos[1]; + }); + } else { + guideXPoses = guidePoses.map(function (pos) { + return pos[0]; + }); + guideYPoses = guidePoses.map(function (pos) { + return pos[1]; + }); + } + + state.snapBoundInfos = checkSnapBounds(guidelines, props.clipTargetBounds && { + left: 0, + top: 0, + right: width, + bottom: height + }, guideXPoses, guideYPoses, 1); + + if (originalDraggable) { + var is3d = state.is3d, + allMatrix = state.allMatrix; + var n = is3d ? 4 : 3; + var dragDist = boundDelta; + + if (isDragTarget) { + dragDist = [firstDist[0] + boundDelta[0] - originalDist[0], firstDist[1] + boundDelta[1] - originalDist[1]]; + } + + originalDraggable.deltaOffset = multiply(allMatrix, [dragDist[0], dragDist[1], 0, 0], n); + } + + triggerEvent(moveable, "onClip", fillParams(moveable, e, __assign({ + clipEventType: "changed", + clipType: clipType, + poses: nextPoses, + clipStyle: clipStyle, + clipStyles: nextClipStyles, + distX: distX, + distY: distY + }, fillCSSObject((_c = {}, _c[clipType === "rect" ? "clip" : "clipPath"] = clipStyle, _c), e)))); + return true; + }, + dragControlEnd: function (moveable, e) { + this.unset(moveable); + var isDrag = e.isDrag, + datas = e.datas, + isDouble = e.isDouble; + var isLine = datas.isLine, + isClipStart = datas.isClipStart, + isControl = datas.isControl; + + if (!isClipStart) { + return false; + } + + triggerEvent(moveable, "onClipEnd", fillEndParams(moveable, e, {})); + + if (isDouble) { + if (isControl) { + removeClipPath(moveable, e); + } else if (isLine) { + // add + addClipPath(moveable, e); + } + } + + return isDouble || isDrag; + }, + unset: function (moveable) { + moveable.state.clipPathState = ""; + moveable.state.snapBoundInfos = null; + } + }; + /** + * Whether to clip the target. (default: false) + * @name Moveable.Clippable#clippable + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * clippable: true, + * defaultClipPath: "inset", + * customClipPath: "", + * clipRelative: false, + * clipArea: false, + * dragWithClip: true, + * }); + * moveable.on("clipStart", e => { + * console.log(e); + * }).on("clip", e => { + * if (e.clipType === "rect") { + * e.target.style.clip = e.clipStyle; + * } else { + * e.target.style.clipPath = e.clipStyle; + * } + * }).on("clipEnd", e => { + * console.log(e); + * }); + */ + + /** + * If clippath is not set, the default value can be set. (defaultClipPath < style < customClipPath < dragging clipPath) + * @name Moveable.Clippable#defaultClipPath + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * clippable: true, + * defaultClipPath: "inset", + * customClipPath: "", + * clipRelative: false, + * clipArea: false, + * dragWithClip: true, + * }); + * moveable.on("clipStart", e => { + * console.log(e); + * }).on("clip", e => { + * if (e.clipType === "rect") { + * e.target.style.clip = e.clipStyle; + * } else { + * e.target.style.clipPath = e.clipStyle; + * } + * }).on("clipEnd", e => { + * console.log(e); + * }); + */ + + /** + * % Can be used instead of the absolute px (`rect` not possible) (default: false) + * @name Moveable.Clippable#clipRelative + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * clippable: true, + * defaultClipPath: "inset", + * customClipPath: "", + * clipRelative: false, + * clipArea: false, + * dragWithClip: true, + * }); + * moveable.on("clipStart", e => { + * console.log(e); + * }).on("clip", e => { + * if (e.clipType === "rect") { + * e.target.style.clip = e.clipStyle; + * } else { + * e.target.style.clipPath = e.clipStyle; + * } + * }).on("clipEnd", e => { + * console.log(e); + * }); + */ + + /** + * You can force the custom clipPath. (defaultClipPath < style < customClipPath < dragging clipPath) + * @name Moveable.Clippable#customClipPath + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * clippable: true, + * defaultClipPath: "inset", + * customClipPath: "", + * clipRelative: false, + * clipArea: false, + * dragWithClip: true, + * }); + * moveable.on("clipStart", e => { + * console.log(e); + * }).on("clip", e => { + * if (e.clipType === "rect") { + * e.target.style.clip = e.clipStyle; + * } else { + * e.target.style.clipPath = e.clipStyle; + * } + * }).on("clipEnd", e => { + * console.log(e); + * }); + */ + + /** + * When dragging the target, the clip also moves. (default: true) + * @name Moveable.Clippable#dragWithClip + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * clippable: true, + * defaultClipPath: "inset", + * customClipPath: "", + * clipRelative: false, + * clipArea: false, + * dragWithClip: true, + * }); + * moveable.on("clipStart", e => { + * console.log(e); + * }).on("clip", e => { + * if (e.clipType === "rect") { + * e.target.style.clip = e.clipStyle; + * } else { + * e.target.style.clipPath = e.clipStyle; + * } + * }).on("clipEnd", e => { + * console.log(e); + * }); + */ + + /** + * You can drag the clip by setting clipArea. + * @name Moveable.Clippable#clipArea + * @default false + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * clippable: true, + * defaultClipPath: "inset", + * customClipPath: "", + * clipRelative: false, + * clipArea: false, + * dragWithClip: true, + * }); + * moveable.on("clipStart", e => { + * console.log(e); + * }).on("clip", e => { + * if (e.clipType === "rect") { + * e.target.style.clip = e.clipStyle; + * } else { + * e.target.style.clipPath = e.clipStyle; + * } + * }).on("clipEnd", e => { + * console.log(e); + * }); + */ + + /** + * Whether the clip is bound to the target. + * @name Moveable.Clippable#clipTargetBounds + * @default false + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * clippable: true, + * defaultClipPath: "inset", + * customClipPath: "", + * clipRelative: false, + * clipArea: false, + * dragWithClip: true, + * clipTargetBounds: true, + * }); + * moveable.on("clipStart", e => { + * console.log(e); + * }).on("clip", e => { + * if (e.clipType === "rect") { + * e.target.style.clip = e.clipStyle; + * } else { + * e.target.style.clipPath = e.clipStyle; + * } + * }).on("clipEnd", e => { + * console.log(e); + * }); + */ + + /** + * Add clip guidelines in the vertical direction. + * @name Moveable.Clippable#clipVerticalGuidelines + * @default 0 + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * clippable: true, + * defaultClipPath: "inset", + * customClipPath: "", + * clipRelative: false, + * clipArea: false, + * dragWithClip: true, + * clipVerticalGuidelines: [0, 100, 200], + * clipHorizontalGuidelines: [0, 100, 200], + * clipSnapThreshold: 5, + * }); + */ + + /** + * Add clip guidelines in the horizontal direction. + * @name Moveable.Clippable#clipHorizontalGuidelines + * @default [] + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * clippable: true, + * defaultClipPath: "inset", + * customClipPath: "", + * clipRelative: false, + * clipArea: false, + * dragWithClip: true, + * clipVerticalGuidelines: [0, 100, 200], + * clipHorizontalGuidelines: [0, 100, 200], + * clipSnapThreshold: 5, + * }); + */ + + /** + * istance value that can snap to clip guidelines. + * @name Moveable.Clippable#clipSnapThreshold + * @default 5 + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * clippable: true, + * defaultClipPath: "inset", + * customClipPath: "", + * clipRelative: false, + * clipArea: false, + * dragWithClip: true, + * clipVerticalGuidelines: [0, 100, 200], + * clipHorizontalGuidelines: [0, 100, 200], + * clipSnapThreshold: 5, + * }); + */ + + /** + * When drag start the clip area or controls, the `clipStart` event is called. + * @memberof Moveable.Clippable + * @event clipStart + * @param {Moveable.Clippable.OnClipStart} - Parameters for the `clipStart` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * clippable: true, + * defaultClipPath: "inset", + * customClipPath: "", + * clipRelative: false, + * clipArea: false, + * dragWithClip: true, + * }); + * moveable.on("clipStart", e => { + * console.log(e); + * }).on("clip", e => { + * if (e.clipType === "rect") { + * e.target.style.clip = e.clipStyle; + * } else { + * e.target.style.clipPath = e.clipStyle; + * } + * }).on("clipEnd", e => { + * console.log(e); + * }); + */ + + /** + * When drag the clip area or controls, the `clip` event is called. + * @memberof Moveable.Clippable + * @event clip + * @param {Moveable.Clippable.OnClip} - Parameters for the `clip` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * clippable: true, + * defaultClipPath: "inset", + * customClipPath: "", + * clipRelative: false, + * clipArea: false, + * dragWithClip: true, + * }); + * moveable.on("clipStart", e => { + * console.log(e); + * }).on("clip", e => { + * if (e.clipType === "rect") { + * e.target.style.clip = e.clipStyle; + * } else { + * e.target.style.clipPath = e.clipStyle; + * } + * }).on("clipEnd", e => { + * console.log(e); + * }); + */ + + /** + * When drag end the clip area or controls, the `clipEnd` event is called. + * @memberof Moveable.Clippable + * @event clipEnd + * @param {Moveable.Clippable.OnClipEnd} - Parameters for the `clipEnd` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * clippable: true, + * defaultClipPath: "inset", + * customClipPath: "", + * clipRelative: false, + * clipArea: false, + * dragWithClip: true, + * }); + * moveable.on("clipStart", e => { + * console.log(e); + * }).on("clip", e => { + * if (e.clipType === "rect") { + * e.target.style.clip = e.clipStyle; + * } else { + * e.target.style.clipPath = e.clipStyle; + * } + * }).on("clipEnd", e => { + * console.log(e); + * }); + */ + + /** + * @namespace OriginDraggable + * @memberof Moveable + * @description Whether to drag origin (default: false) + */ + + var OriginDraggable = { + name: "originDraggable", + props: ["originDraggable", "originRelative"], + events: ["dragOriginStart", "dragOrigin", "dragOriginEnd"], + css: [":host[data-able-origindraggable] .control.origin {\npointer-events: auto;\n}"], + dragControlCondition: function (_, e) { + if (e.isRequest) { + return e.requestAble === "originDraggable"; + } + + return hasClass(e.inputEvent.target, prefix("origin")); + }, + dragControlStart: function (moveable, e) { + var datas = e.datas; + setDragStart(moveable, e); + var params = fillParams(moveable, e, { + dragStart: Draggable.dragStart(moveable, new CustomGesto().dragStart([0, 0], e)) + }); + var result = triggerEvent(moveable, "onDragOriginStart", params); + datas.startOrigin = moveable.state.transformOrigin; + datas.startTargetOrigin = moveable.state.targetOrigin; + datas.prevOrigin = [0, 0]; + datas.isDragOrigin = true; + + if (result === false) { + datas.isDragOrigin = false; + return false; + } + + return params; + }, + dragControl: function (moveable, e) { + var datas = e.datas, + isPinch = e.isPinch, + isRequest = e.isRequest; + + if (!datas.isDragOrigin) { + return false; + } + + var _a = __read(getDragDist(e), 2), + distX = _a[0], + distY = _a[1]; + + var state = moveable.state; + var width = state.width, + height = state.height, + offsetMatrix = state.offsetMatrix, + targetMatrix = state.targetMatrix, + is3d = state.is3d; + var _b = moveable.props.originRelative, + originRelative = _b === void 0 ? true : _b; + var n = is3d ? 4 : 3; + var dist = [distX, distY]; + + if (isRequest) { + var distOrigin = e.distOrigin; + + if (distOrigin[0] || distOrigin[1]) { + dist = distOrigin; + } + } + + var origin = plus(datas.startOrigin, dist); + var targetOrigin = plus(datas.startTargetOrigin, dist); + var delta = minus(dist, datas.prevOrigin); + var nextMatrix = getNextMatrix(offsetMatrix, targetMatrix, origin, n); + var rect = moveable.getRect(); + var nextRect = getRect(calculatePoses(nextMatrix, width, height, n)); + var dragDelta = [rect.left - nextRect.left, rect.top - nextRect.top]; + datas.prevOrigin = dist; + var transformOrigin = [convertCSSSize(targetOrigin[0], width, originRelative), convertCSSSize(targetOrigin[1], height, originRelative)].join(" "); + var result = Draggable.drag(moveable, setCustomDrag(e, moveable.state, dragDelta, !!isPinch, false)); + var params = fillParams(moveable, e, __assign(__assign({ + width: width, + height: height, + origin: origin, + dist: dist, + delta: delta, + transformOrigin: transformOrigin, + drag: result + }, fillCSSObject({ + transformOrigin: transformOrigin, + transform: result.transform + }, e)), { + afterTransform: result.transform + })); + triggerEvent(moveable, "onDragOrigin", params); + return params; + }, + dragControlEnd: function (moveable, e) { + var datas = e.datas; + + if (!datas.isDragOrigin) { + return false; + } + + triggerEvent(moveable, "onDragOriginEnd", fillEndParams(moveable, e, {})); + return true; + }, + dragGroupControlCondition: function (moveable, e) { + return this.dragControlCondition(moveable, e); + }, + dragGroupControlStart: function (moveable, e) { + var params = this.dragControlStart(moveable, e); + + if (!params) { + return false; + } + + return true; + }, + dragGroupControl: function (moveable, e) { + var params = this.dragControl(moveable, e); + + if (!params) { + return false; + } + + moveable.transformOrigin = params.transformOrigin; + return true; + }, + + /** + * @method Moveable.OriginDraggable#request + * @param {object} e - the OriginDraggable's request parameter + * @param {number} [e.x] - x position + * @param {number} [e.y] - y position + * @param {number} [e.deltaX] - x number to move + * @param {number} [e.deltaY] - y number to move + * @param {array} [e.deltaOrigin] - left, top number to move transform-origin + * @param {array} [e.origin] - transform-origin position + * @param {number} [e.isInstant] - Whether to execute the request instantly + * @return {Moveable.Requester} Moveable Requester + * @example + * // Instantly Request (requestStart - request - requestEnd) + * // Use Relative Value + * moveable.request("originDraggable", { deltaX: 10, deltaY: 10 }, true); + * // Use Absolute Value + * moveable.request("originDraggable", { x: 200, y: 100 }, true); + * // Use Transform Value + * moveable.request("originDraggable", { deltaOrigin: [10, 0] }, true); + * moveable.request("originDraggable", { origin: [100, 0] }, true); + * // requestStart + * const requester = moveable.request("originDraggable"); + * + * // request + * // Use Relative Value + * requester.request({ deltaX: 10, deltaY: 10 }); + * requester.request({ deltaX: 10, deltaY: 10 }); + * requester.request({ deltaX: 10, deltaY: 10 }); + * // Use Absolute Value + * moveable.request("originDraggable", { x: 200, y: 100 }); + * moveable.request("originDraggable", { x: 220, y: 100 }); + * moveable.request("originDraggable", { x: 240, y: 100 }); + * + * // requestEnd + * requester.requestEnd(); + */ + request: function (moveable) { + var datas = {}; + var rect = moveable.getRect(); + var distX = 0; + var distY = 0; + var transformOrigin = rect.transformOrigin; + var distOrigin = [0, 0]; + return { + isControl: true, + requestStart: function () { + return { + datas: datas + }; + }, + request: function (e) { + if ("deltaOrigin" in e) { + distOrigin[0] += e.deltaOrigin[0]; + distOrigin[1] += e.deltaOrigin[1]; + } else if ("origin" in e) { + distOrigin[0] = e.origin[0] - transformOrigin[0]; + distOrigin[1] = e.origin[1] - transformOrigin[1]; + } else { + if ("x" in e) { + distX = e.x - rect.left; + } else if ("deltaX" in e) { + distX += e.deltaX; + } + + if ("y" in e) { + distY = e.y - rect.top; + } else if ("deltaY" in e) { + distY += e.deltaY; + } + } + + return { + datas: datas, + distX: distX, + distY: distY, + distOrigin: distOrigin + }; + }, + requestEnd: function () { + return { + datas: datas, + isDrag: true + }; + } + }; + } + }; + /** + * Whether to drag origin (default: false) + * @name Moveable.OriginDraggable#originDraggable + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * originDraggable: true, + * }); + * let translate = [0, 0]; + * moveable.on("dragOriginStart", e => { + * e.dragStart && e.dragStart.set(translate); + * }).on("dragOrigin", e => { + * translate = e.drag.beforeTranslate; + * e.target.style.cssText + * = `transform-origin: ${e.transformOrigin};` + * + `transform: translate(${translate[0]}px, ${translate[1]}px)`; + * }).on("dragOriginEnd", e => { + * console.log(e); + * }); + */ + + /** + * % Can be used instead of the absolute px (default: true) + * @name Moveable.OriginDraggable#originRelative + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * originDraggable: true, + * originRelative: false, + * }); + * moveable.originRelative = true; + */ + + /** + * When drag start the origin, the `dragOriginStart` event is called. + * @memberof Moveable.OriginDraggable + * @event dragOriginStart + * @param {Moveable.OriginDraggable.OnDragOriginStart} - Parameters for the `dragOriginStart` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * originDraggable: true, + * }); + * let translate = [0, 0]; + * moveable.on("dragOriginStart", e => { + * e.dragStart && e.dragStart.set(translate); + * }).on("dragOrigin", e => { + * translate = e.drag.beforeTranslate; + * e.target.style.cssText + * = `transform-origin: ${e.transformOrigin};` + * + `transform: translate(${translate[0]}px, ${translate[1]}px)`; + * }).on("dragOriginEnd", e => { + * console.log(e); + * }); + */ + + /** + * When drag the origin, the `dragOrigin` event is called. + * @memberof Moveable.OriginDraggable + * @event dragOrigin + * @param {Moveable.OriginDraggable.OnDragOrigin} - Parameters for the `dragOrigin` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * originDraggable: true, + * }); + * let translate = [0, 0]; + * moveable.on("dragOriginStart", e => { + * e.dragStart && e.dragStart.set(translate); + * }).on("dragOrigin", e => { + * translate = e.drag.beforeTranslate; + * e.target.style.cssText + * = `transform-origin: ${e.transformOrigin};` + * + `transform: translate(${translate[0]}px, ${translate[1]}px)`; + * }).on("dragOriginEnd", e => { + * console.log(e); + * }); + */ + + /** + * When drag end the origin, the `dragOriginEnd` event is called. + * @memberof Moveable.OriginDraggable + * @event dragOriginEnd + * @param {Moveable.OriginDraggable.OnDragOriginEnd} - Parameters for the `dragOriginEnd` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * originDraggable: true, + * }); + * let translate = [0, 0]; + * moveable.on("dragOriginStart", e => { + * e.dragStart && e.dragStart.set(translate); + * }).on("dragOrigin", e => { + * translate = e.drag.beforeTranslate; + * e.target.style.cssText + * = `transform-origin: ${e.transformOrigin};` + * + `transform: translate(${translate[0]}px, ${translate[1]}px)`; + * }).on("dragOriginEnd", e => { + * console.log(e); + * }); + */ + + function addBorderRadiusByLine(controlPoses, lineIndex, distX, distY) { + // lineIndex + // 0 top + // 1 right + // 2 bottom + // 3 left + var horizontalsLength = controlPoses.filter(function (_a) { + var virtual = _a.virtual, + horizontal = _a.horizontal; + return horizontal && !virtual; + }).length; + var verticalsLength = controlPoses.filter(function (_a) { + var virtual = _a.virtual, + vertical = _a.vertical; + return vertical && !virtual; + }).length; + var controlIndex = -1; //top + + if (lineIndex === 0) { + if (horizontalsLength === 0) { + controlIndex = 0; + } else if (horizontalsLength === 1) { + controlIndex = 1; + } + } // bottom + + + if (lineIndex === 2) { + if (horizontalsLength <= 2) { + controlIndex = 2; + } else if (horizontalsLength <= 3) { + controlIndex = 3; + } + } // left + + + if (lineIndex === 3) { + if (verticalsLength === 0) { + controlIndex = 4; + } else if (verticalsLength < 4) { + controlIndex = 7; + } + } // right + + + if (lineIndex === 1) { + if (verticalsLength <= 1) { + controlIndex = 5; + } else if (verticalsLength <= 2) { + controlIndex = 6; + } + } + + if (controlIndex === -1 || !controlPoses[controlIndex].virtual) { + return; + } + + var controlPoseInfo = controlPoses[controlIndex]; + addBorderRadius(controlPoses, controlIndex); + + if (controlIndex < 4) { + controlPoseInfo.pos[0] = distX; + } else { + controlPoseInfo.pos[1] = distY; + } + } + + function addBorderRadius(controlPoses, index) { + if (index < 4) { + controlPoses.slice(0, index + 1).forEach(function (info) { + info.virtual = false; + }); + } else { + if (controlPoses[0].virtual) { + controlPoses[0].virtual = false; + } + + controlPoses.slice(4, index + 1).forEach(function (info) { + info.virtual = false; + }); + } + } + + function removeBorderRadius(controlPoses, index) { + if (index < 4) { + controlPoses.slice(index, 4).forEach(function (info) { + info.virtual = true; + }); + } else { + controlPoses.slice(index).forEach(function (info) { + info.virtual = true; + }); + } + } + + function getBorderRadius(borderRadius, width, height, minCounts, full) { + if (minCounts === void 0) { + minCounts = [0, 0]; + } + + var values = []; + + if (!borderRadius || borderRadius === "0px") { + values = []; + } else { + values = splitSpace(borderRadius); + } + + return getRadiusValues(values, width, height, 0, 0, minCounts, full); + } + + function triggerRoundEvent(moveable, e, dist, delta, nextPoses) { + var state = moveable.state; + var width = state.width, + height = state.height; + + var _a = getRadiusStyles(nextPoses, moveable.props.roundRelative, width, height), + raws = _a.raws, + styles = _a.styles, + radiusPoses = _a.radiusPoses; + + var _b = splitRadiusPoses(radiusPoses, raws), + horizontals = _b.horizontals, + verticals = _b.verticals; + + var borderRadius = styles.join(" "); + state.borderRadiusState = borderRadius; + var params = fillParams(moveable, e, __assign({ + horizontals: horizontals, + verticals: verticals, + borderRadius: borderRadius, + width: width, + height: height, + delta: delta, + dist: dist + }, fillCSSObject({ + borderRadius: borderRadius + }, e))); + triggerEvent(moveable, "onRound", params); + return params; + } + + function getStyleBorderRadius(moveable) { + var _a, _b; + + var style = moveable.getState().style; + var borderRadius = style.borderRadius || ""; + + if (!borderRadius && moveable.props.groupable) { + var firstMoveable = moveable.moveables[0]; + var firstTarget = moveable.getTargets()[0]; + + if (firstTarget) { + if ((firstMoveable === null || firstMoveable === void 0 ? void 0 : firstMoveable.props.target) === firstTarget) { + borderRadius = (_b = (_a = moveable.moveables[0]) === null || _a === void 0 ? void 0 : _a.state.style.borderRadius) !== null && _b !== void 0 ? _b : ""; + style.borderRadius = borderRadius; + } else { + borderRadius = getComputedStyle(firstTarget).borderRadius; + style.borderRadius = borderRadius; + } + } + } + + return borderRadius; + } + /** + * @namespace Moveable.Roundable + * @description Whether to show and drag or double click border-radius + */ + + + var Roundable = { + name: "roundable", + props: ["roundable", "roundRelative", "minRoundControls", "maxRoundControls", "roundClickable", "roundPadding", "isDisplayShadowRoundControls"], + events: ["roundStart", "round", "roundEnd", "roundGroupStart", "roundGroup", "roundGroupEnd"], + css: [".control.border-radius {\nbackground: #d66;\ncursor: pointer;\nz-index: 3;\n}", ".control.border-radius.vertical {\nbackground: #d6d;\nz-index: 2;\n}", ".control.border-radius.virtual {\nopacity: 0.5;\nz-index: 1;\n}", ":host.round-line-clickable .line.direction {\ncursor: pointer;\n}"], + className: function (moveable) { + var roundClickable = moveable.props.roundClickable; + return roundClickable === true || roundClickable === "line" ? prefix("round-line-clickable") : ""; + }, + requestStyle: function () { + return ["borderRadius"]; + }, + requestChildStyle: function () { + return ["borderRadius"]; + }, + render: function (moveable, React) { + var _a = moveable.getState(), + target = _a.target, + width = _a.width, + height = _a.height, + allMatrix = _a.allMatrix, + is3d = _a.is3d, + left = _a.left, + top = _a.top, + borderRadiusState = _a.borderRadiusState; + + var _b = moveable.props, + _c = _b.minRoundControls, + minRoundControls = _c === void 0 ? [0, 0] : _c, + _d = _b.maxRoundControls, + maxRoundControls = _d === void 0 ? [4, 4] : _d, + zoom = _b.zoom, + _e = _b.roundPadding, + roundPadding = _e === void 0 ? 0 : _e, + isDisplayShadowRoundControls = _b.isDisplayShadowRoundControls, + groupable = _b.groupable; + + if (!target) { + return null; + } + + var borderRadius = borderRadiusState || getStyleBorderRadius(moveable); + var n = is3d ? 4 : 3; + var radiusValues = getBorderRadius(borderRadius, width, height, minRoundControls, true); + + if (!radiusValues) { + return null; + } + + var verticalCount = 0; + var horizontalCount = 0; + var basePos = groupable ? [0, 0] : [left, top]; + return radiusValues.map(function (v, i) { + var horizontal = v.horizontal; + var vertical = v.vertical; + var direction = v.direction || ""; + + var originalPos = __spreadArray([], __read(v.pos), false); + + horizontalCount += Math.abs(horizontal); + verticalCount += Math.abs(vertical); + + if (horizontal && direction.indexOf("n") > -1) { + originalPos[1] -= roundPadding; + } + + if (vertical && direction.indexOf("w") > -1) { + originalPos[0] -= roundPadding; + } + + if (horizontal && direction.indexOf("s") > -1) { + originalPos[1] += roundPadding; + } + + if (vertical && direction.indexOf("e") > -1) { + originalPos[0] += roundPadding; + } + + var pos = minus(calculatePosition(allMatrix, originalPos, n), basePos); + var isDisplayVerticalShadow = isDisplayShadowRoundControls && isDisplayShadowRoundControls !== "horizontal"; + var isDisplay = v.vertical ? verticalCount <= maxRoundControls[1] && (isDisplayVerticalShadow || !v.virtual) : horizontalCount <= maxRoundControls[0] && (isDisplayShadowRoundControls || !v.virtual); + return React.createElement("div", { + key: "borderRadiusControl".concat(i), + className: prefix("control", "border-radius", v.vertical ? "vertical" : "", v.virtual ? "virtual" : ""), + "data-radius-index": i, + style: { + display: isDisplay ? "block" : "none", + transform: "translate(".concat(pos[0], "px, ").concat(pos[1], "px) scale(").concat(zoom, ")") + } + }); + }); + }, + dragControlCondition: function (moveable, e) { + if (!e.inputEvent || e.isRequest) { + return false; + } + + var className = e.inputEvent.target.getAttribute("class") || ""; + return className.indexOf("border-radius") > -1 || className.indexOf("moveable-line") > -1 && className.indexOf("moveable-direction") > -1; + }, + dragGroupControlCondition: function (moveable, e) { + return this.dragControlCondition(moveable, e); + }, + dragControlStart: function (moveable, e) { + var inputEvent = e.inputEvent, + datas = e.datas; + var inputTarget = inputEvent.target; + var className = inputTarget.getAttribute("class") || ""; + var isControl = className.indexOf("border-radius") > -1; + var isLine = className.indexOf("moveable-line") > -1 && className.indexOf("moveable-direction") > -1; + var controlIndex = isControl ? parseInt(inputTarget.getAttribute("data-radius-index"), 10) : -1; + var lineIndex = -1; + + if (isLine) { + var indexAttr = inputTarget.getAttribute("data-line-key") || ""; + + if (indexAttr) { + lineIndex = parseInt(indexAttr.replace(/render-line-/g, ""), 10); + + if (isNaN(lineIndex)) { + lineIndex = -1; + } + } + } + + if (!isControl && !isLine) { + return false; + } + + var params = fillParams(moveable, e, {}); + var result = triggerEvent(moveable, "onRoundStart", params); + + if (result === false) { + return false; + } + + datas.lineIndex = lineIndex; + datas.controlIndex = controlIndex; + datas.isControl = isControl; + datas.isLine = isLine; + setDragStart(moveable, e); + var _a = moveable.props, + roundRelative = _a.roundRelative, + _b = _a.minRoundControls, + minRoundControls = _b === void 0 ? [0, 0] : _b; + var state = moveable.state; + var width = state.width, + height = state.height; + datas.isRound = true; + datas.prevDist = [0, 0]; + var borderRadius = getStyleBorderRadius(moveable); + var controlPoses = getBorderRadius(borderRadius || "", width, height, minRoundControls, true) || []; + datas.controlPoses = controlPoses; + state.borderRadiusState = getRadiusStyles(controlPoses, roundRelative, width, height).styles.join(" "); + return params; + }, + dragControl: function (moveable, e) { + var datas = e.datas; + var controlPoses = datas.controlPoses; + + if (!datas.isRound || !datas.isControl || !controlPoses.length) { + return false; + } + + var index = datas.controlIndex; + + var _a = __read(getDragDist(e), 2), + distX = _a[0], + distY = _a[1]; + + var dist = [distX, distY]; + var delta = minus(dist, datas.prevDist); + var _b = moveable.props.maxRoundControls, + maxRoundControls = _b === void 0 ? [4, 4] : _b; + var _c = moveable.state, + width = _c.width, + height = _c.height; + var selectedControlPose = controlPoses[index]; + var selectedVertical = selectedControlPose.vertical; + var selectedHorizontal = selectedControlPose.horizontal; // 0: [0, 1, 2, 3] maxCount === 1 + // 0: [0, 2] maxCount === 2 + // 1: [1, 3] maxCount === 2 + // 0: [0] maxCount === 3 + // 1: [1, 3] maxCount === 3 + + var dists = controlPoses.map(function (pose) { + var horizontal = pose.horizontal, + vertical = pose.vertical; + var poseDist = [horizontal * selectedHorizontal * dist[0], vertical * selectedVertical * dist[1]]; + + if (horizontal) { + if (maxRoundControls[0] === 1) { + return poseDist; + } else if (maxRoundControls[0] < 4 && horizontal !== selectedHorizontal) { + return poseDist; + } + } else if (maxRoundControls[1] === 0) { + poseDist[1] = vertical * selectedHorizontal * dist[0] / width * height; + return poseDist; + } else if (selectedVertical) { + if (maxRoundControls[1] === 1) { + return poseDist; + } else if (maxRoundControls[1] < 4 && vertical !== selectedVertical) { + return poseDist; + } + } + + return [0, 0]; + }); + dists[index] = dist; + var nextPoses = controlPoses.map(function (info, i) { + return __assign(__assign({}, info), { + pos: plus(info.pos, dists[i]) + }); + }); + + if (index < 4) { + nextPoses.slice(0, index + 1).forEach(function (info) { + info.virtual = false; + }); + } else { + nextPoses.slice(4, index + 1).forEach(function (info) { + info.virtual = false; + }); + } + + datas.prevDist = [distX, distY]; + return triggerRoundEvent(moveable, e, dist, delta, nextPoses); + }, + dragControlEnd: function (moveable, e) { + var state = moveable.state; + state.borderRadiusState = ""; + var datas = e.datas, + isDouble = e.isDouble; + + if (!datas.isRound) { + return false; + } + + var isControl = datas.isControl, + controlIndex = datas.controlIndex, + isLine = datas.isLine, + lineIndex = datas.lineIndex; + var controlPoses = datas.controlPoses; + var length = controlPoses.filter(function (_a) { + var virtual = _a.virtual; + return virtual; + }).length; + var _a = moveable.props.roundClickable, + roundClickable = _a === void 0 ? true : _a; + + if (isDouble && roundClickable) { + if (isControl && (roundClickable === true || roundClickable === "control")) { + removeBorderRadius(controlPoses, controlIndex); + } else if (isLine && (roundClickable === true || roundClickable === "line")) { + var _b = __read(calculatePointerDist(moveable, e), 2), + distX = _b[0], + distY = _b[1]; + + addBorderRadiusByLine(controlPoses, lineIndex, distX, distY); + } + + if (length !== controlPoses.filter(function (_a) { + var virtual = _a.virtual; + return virtual; + }).length) { + triggerRoundEvent(moveable, e, [0, 0], [0, 0], controlPoses); + } + } + + var params = fillEndParams(moveable, e, {}); + triggerEvent(moveable, "onRoundEnd", params); + state.borderRadiusState = ""; + return params; + }, + dragGroupControlStart: function (moveable, e) { + var result = this.dragControlStart(moveable, e); + + if (!result) { + return false; + } + + var moveables = moveable.moveables; + var targets = moveable.props.targets; + var events = fillChildEvents(moveable, "roundable", e); + + var nextParams = __assign({ + targets: moveable.props.targets, + events: events.map(function (ev, i) { + return __assign(__assign({}, ev), { + target: targets[i], + moveable: moveables[i], + currentTarget: moveables[i] + }); + }) + }, result); + + triggerEvent(moveable, "onRoundGroupStart", nextParams); + return result; + }, + dragGroupControl: function (moveable, e) { + var result = this.dragControl(moveable, e); + + if (!result) { + return false; + } + + var moveables = moveable.moveables; + var targets = moveable.props.targets; + var events = fillChildEvents(moveable, "roundable", e); + + var nextParams = __assign({ + targets: moveable.props.targets, + events: events.map(function (ev, i) { + return __assign(__assign(__assign({}, ev), { + target: targets[i], + moveable: moveables[i], + currentTarget: moveables[i] + }), fillCSSObject({ + borderRadius: result.borderRadius + }, ev)); + }) + }, result); + + triggerEvent(moveable, "onRoundGroup", nextParams); + return nextParams; + }, + dragGroupControlEnd: function (moveable, e) { + var moveables = moveable.moveables; + var targets = moveable.props.targets; + var events = fillChildEvents(moveable, "roundable", e); + catchEvent(moveable, "onRound", function (parentEvent) { + var nextParams = __assign({ + targets: moveable.props.targets, + events: events.map(function (ev, i) { + return __assign(__assign(__assign({}, ev), { + target: targets[i], + moveable: moveables[i], + currentTarget: moveables[i] + }), fillCSSObject({ + borderRadius: parentEvent.borderRadius + }, ev)); + }) + }, parentEvent); + + triggerEvent(moveable, "onRoundGroup", nextParams); + }); + var result = this.dragControlEnd(moveable, e); + + if (!result) { + return false; + } + + var nextParams = __assign({ + targets: moveable.props.targets, + events: events.map(function (ev, i) { + var _a; + + return __assign(__assign({}, ev), { + target: targets[i], + moveable: moveables[i], + currentTarget: moveables[i], + lastEvent: (_a = ev.datas) === null || _a === void 0 ? void 0 : _a.lastEvent + }); + }) + }, result); + + triggerEvent(moveable, "onRoundGroupEnd", nextParams); + return nextParams; + }, + unset: function (moveable) { + moveable.state.borderRadiusState = ""; + } + }; + /** + * Whether to show and drag or double click border-radius, (default: false) + * @name Moveable.Roundable#roundable + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * roundable: true, + * roundRelative: false, + * }); + * moveable.on("roundStart", e => { + * console.log(e); + * }).on("round", e => { + * e.target.style.borderRadius = e.borderRadius; + * }).on("roundEnd", e => { + * console.log(e); + * }); + */ + + /** + * % Can be used instead of the absolute px + * @name Moveable.Roundable#roundRelative + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * roundable: true, + * roundRelative: false, + * }); + * moveable.on("roundStart", e => { + * console.log(e); + * }).on("round", e => { + * e.target.style.borderRadius = e.borderRadius; + * }).on("roundEnd", e => { + * console.log(e); + * }); + */ + + /** + * Minimum number of round controls. It moves in proportion by control. [horizontal, vertical] (default: [0, 0]) + * @name Moveable.Roundable#minRoundControls + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * roundable: true, + * roundRelative: false, + * minRoundControls: [0, 0], + * }); + * moveable.minRoundControls = [1, 0]; + */ + + /** + * Maximum number of round controls. It moves in proportion by control. [horizontal, vertical] (default: [4, 4]) + * @name Moveable.Roundable#maxRoundControls + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * roundable: true, + * roundRelative: false, + * maxRoundControls: [4, 4], + * }); + * moveable.maxRoundControls = [1, 0]; + */ + + /** + * Whether you can add/delete round controls by double-clicking a line or control. + * @name Moveable.Roundable#roundClickable + * @default true + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * roundable: true, + * roundRelative: false, + * roundClickable: true, + * }); + * moveable.roundClickable = false; + */ + + /** + * Whether to show a round control that does not actually exist as a shadow + * @name Moveable.Roundable#isDisplayShadowRoundControls + * @default false + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * roundable: true, + * isDisplayShadowRoundControls: false, + * }); + * moveable.isDisplayShadowRoundControls = true; + */ + + /** + * The padding value of the position of the round control + * @name Moveable.Roundable#roundPadding + * @default false + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * roundable: true, + * roundPadding: 0, + * }); + * moveable.roundPadding = 15; + */ + + /** + * When drag start the clip area or controls, the `roundStart` event is called. + * @memberof Moveable.Roundable + * @event roundStart + * @param {Moveable.Roundable.OnRoundStart} - Parameters for the `roundStart` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * roundable: true, + * roundRelative: false, + * }); + * moveable.on("roundStart", e => { + * console.log(e); + * }).on("round", e => { + * e.target.style.borderRadius = e.borderRadius; + * }).on("roundEnd", e => { + * console.log(e); + * }); + */ + + /** + * When drag or double click the border area or controls, the `round` event is called. + * @memberof Moveable.Roundable + * @event round + * @param {Moveable.Roundable.OnRound} - Parameters for the `round` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * roundable: true, + * roundRelative: false, + * }); + * moveable.on("roundStart", e => { + * console.log(e); + * }).on("round", e => { + * e.target.style.borderRadius = e.borderRadius; + * }).on("roundEnd", e => { + * console.log(e); + * }); + */ + + /** + * When drag end the border area or controls, the `roundEnd` event is called. + * @memberof Moveable.Roundable + * @event roundEnd + * @param {Moveable.Roundable.onRoundEnd} - Parameters for the `roundEnd` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * roundable: true, + * roundRelative: false, + * }); + * moveable.on("roundStart", e => { + * console.log(e); + * }).on("round", e => { + * e.target.style.borderRadius = e.borderRadius; + * }).on("roundEnd", e => { + * console.log(e); + * }); + */ + + /** + * When drag start the clip area or controls, the `roundGroupStart` event is called. + * @memberof Moveable.Roundable + * @event roundGroupStart + * @param {Moveable.Roundable.OnRoundGroupStart} - Parameters for the `roundGroupStart` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * targets: [target1, target2, target3], + * roundable: true, + * }); + * moveable.on("roundGroupStart", e => { + * console.log(e.targets); + * }).on("roundGroup", e => { + * e.events.forEach(ev => { + * ev.target.style.cssText += ev.cssText; + * }); + * }).on("roundGroupEnd", e => { + * console.log(e); + * }); + */ + + /** + * When drag or double click the border area or controls, the `roundGroup` event is called. + * @memberof Moveable.Roundable + * @event roundGroup + * @param {Moveable.Roundable.OnRoundGroup} - Parameters for the `roundGroup` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * targets: [target1, target2, target3], + * roundable: true, + * }); + * moveable.on("roundGroupStart", e => { + * console.log(e.targets); + * }).on("roundGroup", e => { + * e.events.forEach(ev => { + * ev.target.style.cssText += ev.cssText; + * }); + * }).on("roundGroupEnd", e => { + * console.log(e); + * }); + */ + + /** + * When drag end the border area or controls, the `roundGroupEnd` event is called. + * @memberof Moveable.Roundable + * @event roundGroupEnd + * @param {Moveable.Roundable.onRoundGroupEnd} - Parameters for the `roundGroupEnd` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * targets: [target1, target2, target3], + * roundable: true, + * }); + * moveable.on("roundGroupStart", e => { + * console.log(e.targets); + * }).on("roundGroup", e => { + * e.events.forEach(ev => { + * ev.target.style.cssText += ev.cssText; + * }); + * }).on("roundGroupEnd", e => { + * console.log(e); + * }); + */ + + function isIdentityMatrix(matrix, is3d) { + var n = is3d ? 4 : 3; + var identityMatrix = createIdentityMatrix(n); + var value = "matrix".concat(is3d ? "3d" : "", "(").concat(identityMatrix.join(","), ")"); + return matrix === value || matrix === "matrix(1,0,0,1,0,0)"; + } + + var BeforeRenderable = { + isPinch: true, + name: "beforeRenderable", + props: [], + events: ["beforeRenderStart", "beforeRender", "beforeRenderEnd", "beforeRenderGroupStart", "beforeRenderGroup", "beforeRenderGroupEnd"], + dragRelation: "weak", + setTransform: function (moveable, e) { + var _a = moveable.state, + is3d = _a.is3d, + targetMatrix = _a.targetMatrix, + inlineTransform = _a.inlineTransform; + var cssMatrix = is3d ? "matrix3d(".concat(targetMatrix.join(","), ")") : "matrix(".concat(convertMatrixtoCSS(targetMatrix, true), ")"); + var startTransform = !inlineTransform || inlineTransform === "none" ? cssMatrix : inlineTransform; + e.datas.startTransforms = isIdentityMatrix(startTransform, is3d) ? [] : splitSpace(startTransform); + }, + resetStyle: function (e) { + var datas = e.datas; + datas.nextStyle = {}; + datas.nextTransforms = e.datas.startTransforms; + datas.nextTransformAppendedIndexes = []; + }, + fillDragStartParams: function (moveable, e) { + return fillParams(moveable, e, { + setTransform: function (transform) { + e.datas.startTransforms = isArray(transform) ? transform : splitSpace(transform); + }, + isPinch: !!e.isPinch + }); + }, + fillDragParams: function (moveable, e) { + return fillParams(moveable, e, { + isPinch: !!e.isPinch + }); + }, + dragStart: function (moveable, e) { + this.setTransform(moveable, e); + this.resetStyle(e); + triggerEvent(moveable, "onBeforeRenderStart", this.fillDragStartParams(moveable, e)); + }, + drag: function (moveable, e) { + if (!e.datas.startTransforms) { + this.setTransform(moveable, e); + } + + this.resetStyle(e); + triggerEvent(moveable, "onBeforeRender", fillParams(moveable, e, { + isPinch: !!e.isPinch + })); + }, + dragEnd: function (moveable, e) { + if (!e.datas.startTransforms) { + this.setTransform(moveable, e); + this.resetStyle(e); + } + + triggerEvent(moveable, "onBeforeRenderEnd", fillParams(moveable, e, { + isPinch: !!e.isPinch, + isDrag: e.isDrag + })); + }, + dragGroupStart: function (moveable, e) { + var _this = this; + + this.dragStart(moveable, e); + var events = fillChildEvents(moveable, "beforeRenderable", e); + var moveables = moveable.moveables; + var params = events.map(function (childEvent, i) { + var childMoveable = moveables[i]; + + _this.setTransform(childMoveable, childEvent); + + _this.resetStyle(childEvent); + + return _this.fillDragStartParams(childMoveable, childEvent); + }); + triggerEvent(moveable, "onBeforeRenderGroupStart", fillParams(moveable, e, { + isPinch: !!e.isPinch, + targets: moveable.props.targets, + setTransform: function () {}, + events: params + })); + }, + dragGroup: function (moveable, e) { + var _this = this; + + this.drag(moveable, e); + var events = fillChildEvents(moveable, "beforeRenderable", e); + var moveables = moveable.moveables; + var params = events.map(function (childEvent, i) { + var childMoveable = moveables[i]; + + _this.resetStyle(childEvent); + + return _this.fillDragParams(childMoveable, childEvent); + }); + triggerEvent(moveable, "onBeforeRenderGroup", fillParams(moveable, e, { + isPinch: !!e.isPinch, + targets: moveable.props.targets, + events: params + })); + }, + dragGroupEnd: function (moveable, e) { + this.dragEnd(moveable, e); + triggerEvent(moveable, "onBeforeRenderGroupEnd", fillParams(moveable, e, { + isPinch: !!e.isPinch, + isDrag: e.isDrag, + targets: moveable.props.targets + })); + }, + dragControlStart: function (moveable, e) { + return this.dragStart(moveable, e); + }, + dragControl: function (moveable, e) { + return this.drag(moveable, e); + }, + dragControlEnd: function (moveable, e) { + return this.dragEnd(moveable, e); + }, + dragGroupControlStart: function (moveable, e) { + return this.dragGroupStart(moveable, e); + }, + dragGroupControl: function (moveable, e) { + return this.dragGroup(moveable, e); + }, + dragGroupControlEnd: function (moveable, e) { + return this.dragGroupEnd(moveable, e); + } + }; + var Renderable = { + name: "renderable", + props: [], + events: ["renderStart", "render", "renderEnd", "renderGroupStart", "renderGroup", "renderGroupEnd"], + dragRelation: "weak", + dragStart: function (moveable, e) { + triggerEvent(moveable, "onRenderStart", fillParams(moveable, e, { + isPinch: !!e.isPinch + })); + }, + drag: function (moveable, e) { + triggerEvent(moveable, "onRender", this.fillDragParams(moveable, e)); + }, + dragAfter: function (moveable, e) { + return this.drag(moveable, e); + }, + dragEnd: function (moveable, e) { + triggerEvent(moveable, "onRenderEnd", this.fillDragEndParams(moveable, e)); + }, + dragGroupStart: function (moveable, e) { + triggerEvent(moveable, "onRenderGroupStart", fillParams(moveable, e, { + isPinch: !!e.isPinch, + targets: moveable.props.targets + })); + }, + dragGroup: function (moveable, e) { + var _this = this; + + var events = fillChildEvents(moveable, "beforeRenderable", e); + var moveables = moveable.moveables; + var params = events.map(function (childEvent, i) { + var childMoveable = moveables[i]; + return _this.fillDragParams(childMoveable, childEvent); + }); + triggerEvent(moveable, "onRenderGroup", fillParams(moveable, e, __assign(__assign({ + isPinch: !!e.isPinch, + targets: moveable.props.targets, + transform: getNextTransformText(e), + transformObject: {} + }, fillCSSObject(getNextStyle(e))), { + events: params + }))); + }, + dragGroupEnd: function (moveable, e) { + var _this = this; + + var events = fillChildEvents(moveable, "beforeRenderable", e); + var moveables = moveable.moveables; + var params = events.map(function (childEvent, i) { + var childMoveable = moveables[i]; + return _this.fillDragEndParams(childMoveable, childEvent); + }); + triggerEvent(moveable, "onRenderGroupEnd", fillParams(moveable, e, __assign({ + isPinch: !!e.isPinch, + isDrag: e.isDrag, + targets: moveable.props.targets, + events: params, + transformObject: {}, + transform: getNextTransformText(e) + }, fillCSSObject(getNextStyle(e))))); + }, + dragControlStart: function (moveable, e) { + return this.dragStart(moveable, e); + }, + dragControl: function (moveable, e) { + return this.drag(moveable, e); + }, + dragControlAfter: function (moveable, e) { + return this.dragAfter(moveable, e); + }, + dragControlEnd: function (moveable, e) { + return this.dragEnd(moveable, e); + }, + dragGroupControlStart: function (moveable, e) { + return this.dragGroupStart(moveable, e); + }, + dragGroupControl: function (moveable, e) { + return this.dragGroup(moveable, e); + }, + dragGroupControlEnd: function (moveable, e) { + return this.dragGroupEnd(moveable, e); + }, + fillDragParams: function (moveable, e) { + var transformObject = {}; + parse(getNextTransforms(e) || []).forEach(function (matrixInfo) { + transformObject[matrixInfo.name] = matrixInfo.functionValue; + }); + return fillParams(moveable, e, __assign({ + isPinch: !!e.isPinch, + transformObject: transformObject, + transform: getNextTransformText(e) + }, fillCSSObject(getNextStyle(e)))); + }, + fillDragEndParams: function (moveable, e) { + var transformObject = {}; + parse(getNextTransforms(e) || []).forEach(function (matrixInfo) { + transformObject[matrixInfo.name] = matrixInfo.functionValue; + }); + return fillParams(moveable, e, __assign({ + isPinch: !!e.isPinch, + isDrag: e.isDrag, + transformObject: transformObject, + transform: getNextTransformText(e) + }, fillCSSObject(getNextStyle(e)))); + } + }; + + function triggerAble(moveable, moveableAbles, eventOperations, eventAffix, eventType, e, requestInstant) { + // pre setting + e.clientDistX = e.distX; + e.clientDistY = e.distY; + var isStart = eventType === "Start"; + var isEnd = eventType === "End"; + var isAfter = eventType === "After"; + var target = moveable.state.target; + var isRequest = e.isRequest; + var isControl = eventAffix.indexOf("Control") > -1; + + if (!target || isStart && isControl && !isRequest && moveable.areaElement === e.inputEvent.target) { + return false; + } + + var ables = __spreadArray([], __read(moveableAbles), false); + + if (isRequest) { + var requestAble_1 = e.requestAble; + + if (!ables.some(function (able) { + return able.name === requestAble_1; + })) { + ables.push.apply(ables, __spreadArray([], __read(moveable.props.ables.filter(function (able) { + return able.name === requestAble_1; + })), false)); + } + } + + if (!ables.length || ables.every(function (able) { + return able.dragRelation; + })) { + return false; + } // "drag" "Control" "After" + + + var inputEvent = e.inputEvent; + var inputTarget; + + if (isEnd && inputEvent) { + inputTarget = document.elementFromPoint(e.clientX, e.clientY) || inputEvent.target; + } + + var isDragStop = false; + + var stop = function () { + var _a; + + isDragStop = true; + (_a = e.stop) === null || _a === void 0 ? void 0 : _a.call(e); + }; + + var isFirstStart = isStart && (!moveable.targetGesto || !moveable.controlGesto || !moveable.targetGesto.isFlag() || !moveable.controlGesto.isFlag()); + + if (isFirstStart) { + moveable.updateRect(eventType, true, false); + } // trigger ables + + + var datas = e.datas; + var gestoType = isControl ? "controlGesto" : "targetGesto"; + var prevGesto = moveable[gestoType]; + + var trigger = function (able, eventName, conditionName) { + if (!(eventName in able) || prevGesto !== moveable[gestoType]) { + return false; + } + + var ableName = able.name; + var nextDatas = datas[ableName] || (datas[ableName] = {}); + + if (isStart) { + nextDatas.isEventStart = !conditionName || !able[conditionName] || able[conditionName](moveable, e); + } + + if (!nextDatas.isEventStart) { + return false; + } + + var result = able[eventName](moveable, __assign(__assign({}, e), { + stop: stop, + datas: nextDatas, + originalDatas: datas, + inputTarget: inputTarget + })); + + moveable._emitter.off(); + + if (isStart && result === false) { + nextDatas.isEventStart = false; + } + + return result; + }; // unset ables for first drag start + + + if (isFirstStart) { + ables.forEach(function (able) { + able.unset && able.unset(moveable); + }); + } // BeforeRenderable + + + trigger(BeforeRenderable, "drag".concat(eventAffix).concat(eventType)); + var forceEndedCount = 0; + var updatedCount = 0; + eventOperations.forEach(function (eventOperation) { + if (isDragStop) { + return false; + } + + var eventName = "".concat(eventOperation).concat(eventAffix).concat(eventType); + var conditionName = "".concat(eventOperation).concat(eventAffix, "Condition"); + + if (eventType === "" && !isRequest) { + // Convert distX, distY + convertDragDist(moveable.state, e); + } // const isGroup = eventAffix.indexOf("Group") > -1; + + + var eventAbles = ables.filter(function (able) { + return able[eventName]; + }); + eventAbles = eventAbles.filter(function (able, i) { + return able.name && eventAbles.indexOf(able) === i; + }); + var results = eventAbles.filter(function (able) { + return trigger(able, eventName, conditionName); + }); + var isUpdate = results.length; // end ables + + if (isDragStop) { + ++forceEndedCount; + } + + if (isUpdate) { + ++updatedCount; + } + + if (!isDragStop && isStart && eventAbles.length && !isUpdate) { + forceEndedCount += eventAbles.filter(function (able) { + var ableName = able.name; + var nextDatas = datas[ableName]; + + if (nextDatas.isEventStart) { + if (able.dragRelation === "strong") { + return false; + } // stop drag + + + return true; + } // pre stop drag + + + return false; + }).length ? 1 : 0; + } + }); + + if (!isAfter || updatedCount) { + trigger(Renderable, "drag".concat(eventAffix).concat(eventType)); + } // stop gesto condition + + + var isForceEnd = prevGesto !== moveable[gestoType] || forceEndedCount === eventOperations.length; + + if (isEnd || isDragStop || isForceEnd) { + moveable.state.gestos = {}; + + if (moveable.moveables) { + moveable.moveables.forEach(function (childMoveable) { + childMoveable.state.gestos = {}; + }); + } + + ables.forEach(function (able) { + able.unset && able.unset(moveable); + }); + } + + if (isStart && !isForceEnd && !isRequest && updatedCount && moveable.props.preventDefault) { + e === null || e === void 0 ? void 0 : e.preventDefault(); + } + + if (moveable.isUnmounted || isForceEnd) { + return false; + } + + if (!isStart && updatedCount && !requestInstant || isEnd) { + var flushSync = moveable.props.flushSync || defaultSync; + flushSync(function () { + moveable.updateRect(isEnd ? eventType : "", true, false); + moveable.forceUpdate(); + }); + } + + if (!isStart && !isEnd && !isAfter && updatedCount && !requestInstant) { + triggerAble(moveable, moveableAbles, eventOperations, eventAffix, eventType + "After", e); + } + + return true; + } + + function checkMoveableTarget(moveable) { + return function (e) { + var _a; + + var eventTarget = e.inputEvent.target; + var areaElement = moveable.areaElement; + var dragTargetElement = moveable._dragTarget; + + if (!dragTargetElement || ((_a = moveable.controlGesto) === null || _a === void 0 ? void 0 : _a.isFlag())) { + return false; + } + + return eventTarget === dragTargetElement || dragTargetElement.contains(eventTarget) || eventTarget === areaElement || !moveable.isMoveableElement(eventTarget) && !moveable.controlBox.contains(eventTarget) || hasClass(eventTarget, "moveable-area") || hasClass(eventTarget, "moveable-padding") || hasClass(eventTarget, "moveable-edgeDraggable"); + }; + } + + function getTargetAbleGesto(moveable, moveableTarget, eventAffix) { + var controlBox = moveable.controlBox; + var targets = []; + var props = moveable.props; + var dragArea = props.dragArea; + var target = moveable.state.target; + var dragTarget = props.dragTarget; + targets.push(controlBox); + + if (!dragArea || dragTarget) { + targets.push(moveableTarget); + } + + if (!dragArea && dragTarget && target && moveableTarget !== target && props.dragTargetSelf) { + targets.push(target); + } + + return getAbleGesto(moveable, targets, "targetAbles", eventAffix, { + dragStart: checkMoveableTarget(moveable), + pinchStart: checkMoveableTarget(moveable) + }); + } + + function getAbleGesto(moveable, target, ableType, eventAffix, conditionFunctions) { + if (conditionFunctions === void 0) { + conditionFunctions = {}; + } + + var isTargetAbles = ableType === "targetAbles"; + var _a = moveable.props, + pinchOutside = _a.pinchOutside, + pinchThreshold = _a.pinchThreshold, + preventClickEventOnDrag = _a.preventClickEventOnDrag, + preventClickDefault = _a.preventClickDefault, + checkInput = _a.checkInput, + dragFocusedInput = _a.dragFocusedInput, + _b = _a.preventDefault, + preventDefault = _b === void 0 ? true : _b, + dragContaienrOption = _a.dragContainer; + var dragContainer = getRefTarget(dragContaienrOption, true); + var options = { + preventDefault: preventDefault, + preventRightClick: true, + preventWheelClick: true, + container: dragContainer || getWindow(moveable.getControlBoxElement()), + pinchThreshold: pinchThreshold, + pinchOutside: pinchOutside, + preventClickEventOnDrag: isTargetAbles ? preventClickEventOnDrag : false, + preventClickEventOnDragStart: isTargetAbles ? preventClickDefault : false, + preventClickEventByCondition: isTargetAbles ? null : function (e) { + return moveable.controlBox.contains(e.target); + }, + checkInput: isTargetAbles ? checkInput : false, + dragFocusedInput: dragFocusedInput + }; + var gesto = new Gesto(target, options); + var isControl = eventAffix === "Control"; + ["drag", "pinch"].forEach(function (eventOperation) { + ["Start", "", "End"].forEach(function (eventType) { + gesto.on("".concat(eventOperation).concat(eventType), function (e) { + var _a; + + var eventName = e.eventType; + var isPinchScheduled = eventOperation === "drag" && e.isPinch; + + if (conditionFunctions[eventName] && !conditionFunctions[eventName](e)) { + e.stop(); + return; + } + + if (isPinchScheduled) { + return; + } + + var eventOperations = eventOperation === "drag" ? [eventOperation] : ["drag", eventOperation]; + + var moveableAbles = __spreadArray([], __read(moveable[ableType]), false); + + var result = triggerAble(moveable, moveableAbles, eventOperations, eventAffix, eventType, e); + + if (!result) { + e.stop(); + } else if (moveable.props.stopPropagation || eventType === "Start" && isControl) { + (_a = e === null || e === void 0 ? void 0 : e.inputEvent) === null || _a === void 0 ? void 0 : _a.stopPropagation(); + } + }); + }); + }); + return gesto; + } + + var EventManager = /*#__PURE__*/function () { + function EventManager(target, moveable, eventName) { + var _this = this; + + this.target = target; + this.moveable = moveable; + this.eventName = eventName; + this.ables = []; + + this._onEvent = function (e) { + var eventName = _this.eventName; + var moveable = _this.moveable; + + if (moveable.state.disableNativeEvent) { + return; + } + + _this.ables.forEach(function (able) { + able[eventName](moveable, { + inputEvent: e + }); + }); + }; + + target.addEventListener(eventName.toLowerCase(), this._onEvent); + } + + var __proto = EventManager.prototype; + + __proto.setAbles = function (ables) { + this.ables = ables; + }; + + __proto.destroy = function () { + this.target.removeEventListener(this.eventName.toLowerCase(), this._onEvent); + this.target = null; + this.moveable = null; + }; + + return EventManager; + }(); + + function calculateMatrixStack(target, container, rootContainer, isAbsolute3d) { + var _a; + + if (rootContainer === void 0) { + rootContainer = container; + } + + var _b = getMatrixStackInfo(target, container), + matrixes = _b.matrixes, + is3d = _b.is3d, + prevTargetMatrix = _b.targetMatrix, + transformOrigin = _b.transformOrigin, + targetOrigin = _b.targetOrigin, + offsetContainer = _b.offsetContainer, + hasFixed = _b.hasFixed, + containerZoom = _b.zoom; // prevMatrix + + + var _c = getCachedMatrixContainerInfo(offsetContainer, rootContainer), + rootMatrixes = _c.matrixes, + isRoot3d = _c.is3d, + offsetRootContainer = _c.offsetContainer, + rootZoom = _c.zoom; // prevRootMatrix + // if (rootContainer === document.body) { + // console.log(offsetContainer, rootContainer, rootMatrixes); + // } + + + var isNext3d = isAbsolute3d || isRoot3d || is3d; + var n = isNext3d ? 4 : 3; + var isSVGGraphicElement = target.tagName.toLowerCase() !== "svg" && "ownerSVGElement" in target; + var targetMatrix = prevTargetMatrix; // let allMatrix = prevMatrix ? convertDimension(prevMatrix, prevN!, n) : createIdentityMatrix(n); + // let rootMatrix = prevRootMatrix ? convertDimension(prevRootMatrix, prevN!, n) : createIdentityMatrix(n); + // let beforeMatrix = prevMatrix ? convertDimension(prevMatrix, prevN!, n) : createIdentityMatrix(n); + + var allMatrix = createIdentityMatrix(n); + var rootMatrix = createIdentityMatrix(n); + var beforeMatrix = createIdentityMatrix(n); + var offsetMatrix = createIdentityMatrix(n); + var length = matrixes.length; + var nextRootMatrixes = rootMatrixes.map(function (info) { + return __assign(__assign({}, info), { + matrix: info.matrix ? __spreadArray([], __read(info.matrix), false) : undefined + }); + }).reverse(); + matrixes.reverse(); + + if (!is3d && isNext3d) { + targetMatrix = convertDimension(targetMatrix, 3, 4); + convert3DMatrixes(matrixes); + } + + if (!isRoot3d && isNext3d) { + convert3DMatrixes(nextRootMatrixes); + } // rootMatrix = (...) -> container -> offset -> absolute -> offset -> absolute(targetMatrix) + // rootMatrixBeforeOffset = lastOffsetMatrix -> (...) -> container + // beforeMatrix = (... -> container -> offset -> absolute) -> offset -> absolute(targetMatrix) + // offsetMatrix = (... -> container -> offset -> absolute -> offset) -> absolute(targetMatrix) + + + nextRootMatrixes.forEach(function (info) { + rootMatrix = multiply(rootMatrix, info.matrix, n); + }); + var originalRootContainer = rootContainer || getDocumentBody(target); + var endContainer = ((_a = nextRootMatrixes[0]) === null || _a === void 0 ? void 0 : _a.target) || getOffsetInfo(originalRootContainer, originalRootContainer, true).offsetParent; + var rootMatrixBeforeOffset = nextRootMatrixes.slice(1).reduce(function (matrix, info) { + return multiply(matrix, info.matrix, n); + }, createIdentityMatrix(n)); + matrixes.forEach(function (info, i) { + if (length - 2 === i) { + // length - 3 + beforeMatrix = allMatrix.slice(); + } + + if (length - 1 === i) { + // length - 2 + offsetMatrix = allMatrix.slice(); + } // calculate for SVGElement + + + if (!info.matrix) { + var nextInfo = matrixes[i + 1]; + var offset = getSVGOffset(info, nextInfo, endContainer, n, multiply(rootMatrixBeforeOffset, allMatrix, n)); + info.matrix = createOriginMatrix(offset, n); + } + + allMatrix = multiply(allMatrix, info.matrix, n); + }); + var isMatrix3d = !isSVGGraphicElement && is3d; + + if (!targetMatrix) { + targetMatrix = createIdentityMatrix(isMatrix3d ? 4 : 3); + } + + var targetTransform = makeMatrixCSS(isSVGGraphicElement && targetMatrix.length === 16 ? convertDimension(targetMatrix, 4, 3) : targetMatrix, isMatrix3d); + var originalRootMatrix = rootMatrix; + rootMatrix = ignoreDimension(rootMatrix, n, n); + return { + hasZoom: containerZoom !== 1 || rootZoom !== 1, + hasFixed: hasFixed, + matrixes: matrixes, + rootMatrix: rootMatrix, + originalRootMatrix: originalRootMatrix, + beforeMatrix: beforeMatrix, + offsetMatrix: offsetMatrix, + allMatrix: allMatrix, + targetMatrix: targetMatrix, + targetTransform: targetTransform, + inlineTransform: target.style.transform, + transformOrigin: transformOrigin, + targetOrigin: targetOrigin, + is3d: isNext3d, + offsetContainer: offsetContainer, + offsetRootContainer: offsetRootContainer + }; + } + + function calculateElementInfo(target, container, rootContainer, isAbsolute3d) { + if (rootContainer === void 0) { + rootContainer = container; + } + + var width = 0; + var height = 0; + var rotation = 0; + var allResult = {}; + var sizes = getSize(target); + + if (target) { + width = sizes.offsetWidth; + height = sizes.offsetHeight; + } + + if (target) { + var result = calculateMatrixStack(target, container, rootContainer, isAbsolute3d); + var position = calculateElementPosition(result.allMatrix, result.transformOrigin, width, height); + allResult = __assign(__assign({}, result), position); + var rotationPosition = calculateElementPosition(result.allMatrix, [50, 50], 100, 100); + rotation = getRotationRad([rotationPosition.pos1, rotationPosition.pos2], rotationPosition.direction); + } + + var n = isAbsolute3d ? 4 : 3; + return __assign(__assign(__assign({ + hasZoom: false, + width: width, + height: height, + rotation: rotation + }, sizes), { + originalRootMatrix: createIdentityMatrix(n), + rootMatrix: createIdentityMatrix(n), + beforeMatrix: createIdentityMatrix(n), + offsetMatrix: createIdentityMatrix(n), + allMatrix: createIdentityMatrix(n), + targetMatrix: createIdentityMatrix(n), + targetTransform: "", + inlineTransform: "", + transformOrigin: [0, 0], + targetOrigin: [0, 0], + is3d: !!isAbsolute3d, + left: 0, + top: 0, + right: 0, + bottom: 0, + origin: [0, 0], + pos1: [0, 0], + pos2: [0, 0], + pos3: [0, 0], + pos4: [0, 0], + direction: 1, + hasFixed: false, + offsetContainer: null, + offsetRootContainer: null, + matrixes: [] + }), allResult); + } + + function getElementInfo$1(target, container, rootContainer) { + if (rootContainer === void 0) { + rootContainer = container; + } + + return calculateElementInfo(target, container, rootContainer, true); + } + + function getMoveableTargetInfo(moveableElement, target, container, parentContainer, rootContainer, requestStyles) { + if (requestStyles === void 0) { + requestStyles = []; + } + + var beforeDirection = 1; + var beforeOrigin = [0, 0]; + var targetClientRect = resetClientRect(); + var moveableClientRect = resetClientRect(); + var containerClientRect = resetClientRect(); + var rootContainerClientRect = resetClientRect(); + var offsetDelta = [0, 0]; + var style = {}; + var result = calculateElementInfo(target, container, rootContainer, true); + + if (target) { + var getStyle_1 = getCachedStyle(target); + requestStyles.forEach(function (name) { + style[name] = getStyle_1(name); + }); + var n = result.is3d ? 4 : 3; + var beforePosition = calculateElementPosition(result.offsetMatrix, plus(result.transformOrigin, getOrigin(result.targetMatrix, n)), result.width, result.height); + beforeDirection = beforePosition.direction; + beforeOrigin = plus(beforePosition.origin, [beforePosition.left - result.left, beforePosition.top - result.top]); + rootContainerClientRect = getClientRect(result.offsetRootContainer); + var offsetContainer = getOffsetInfo(parentContainer, parentContainer, true).offsetParent || result.offsetRootContainer; + + if (result.hasZoom) { + var absoluteTargetPosition = calculateElementPosition(multiply(result.originalRootMatrix, result.allMatrix), result.transformOrigin, result.width, result.height); + var absoluteContainerPosition = calculateElementPosition(result.originalRootMatrix, getTransformOriginArray(getCachedStyle(offsetContainer)("transformOrigin")).map(function (pos) { + return parseFloat(pos); + }), offsetContainer.offsetWidth, offsetContainer.offsetHeight); + targetClientRect = getClientRectByPosition(absoluteTargetPosition, rootContainerClientRect); + containerClientRect = getClientRectByPosition(absoluteContainerPosition, rootContainerClientRect, offsetContainer, true); + + if (moveableElement) { + var left = absoluteTargetPosition.left; + var top_1 = absoluteTargetPosition.top; + moveableClientRect = getClientRectByPosition({ + left: left, + top: top_1, + bottom: top_1, + right: top_1 + }, rootContainerClientRect); + } + } else { + targetClientRect = getClientRect(target); + containerClientRect = getCachedClientRect(offsetContainer); + + if (moveableElement) { + moveableClientRect = getClientRect(moveableElement); + } + + var containerClientRectLeft = containerClientRect.left, + containerClientRectTop = containerClientRect.top, + containterClientLeft = containerClientRect.clientLeft, + containerClientTop = containerClientRect.clientTop; + var clientDelta = [targetClientRect.left - containerClientRectLeft, targetClientRect.top - containerClientRectTop]; + offsetDelta = minus(calculateInversePosition(result.rootMatrix, clientDelta, 4), [containterClientLeft + result.left, containerClientTop + result.top]); + } + } + + return __assign({ + targetClientRect: targetClientRect, + containerClientRect: containerClientRect, + moveableClientRect: moveableClientRect, + rootContainerClientRect: rootContainerClientRect, + beforeDirection: beforeDirection, + beforeOrigin: beforeOrigin, + originalBeforeOrigin: beforeOrigin, + target: target, + style: style, + offsetDelta: offsetDelta + }, result); + } + + function getPersistState(rect) { + var pos1 = rect.pos1, + pos2 = rect.pos2, + pos3 = rect.pos3, + pos4 = rect.pos4; + + if (!pos1 || !pos2 || !pos3 || !pos4) { + return null; + } + + var minPos = getMinMaxs([pos1, pos2, pos3, pos4]); + var posDelta = [minPos.minX, minPos.minY]; + var origin = minus(rect.origin, posDelta); + pos1 = minus(pos1, posDelta); + pos2 = minus(pos2, posDelta); + pos3 = minus(pos3, posDelta); + pos4 = minus(pos4, posDelta); + return __assign(__assign({}, rect), { + left: rect.left, + top: rect.top, + posDelta: posDelta, + pos1: pos1, + pos2: pos2, + pos3: pos3, + pos4: pos4, + origin: origin, + beforeOrigin: origin, + // originalBeforeOrigin: origin, + isPersisted: true + }); + } + + var MoveableManager$1 = /*#__PURE__*/function (_super) { + __extends(MoveableManager, _super); + + function MoveableManager() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.state = __assign({ + container: null, + gestos: {}, + renderLines: [[[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]]], + renderPoses: [[0, 0], [0, 0], [0, 0], [0, 0]], + disableNativeEvent: false, + posDelta: [0, 0] + }, getMoveableTargetInfo(null)); + _this.renderState = {}; + _this.enabledAbles = []; + _this.targetAbles = []; + _this.controlAbles = []; + _this.rotation = 0; + _this.scale = [1, 1]; + _this.isMoveableMounted = false; + _this.isUnmounted = false; + _this.events = { + "mouseEnter": null, + "mouseLeave": null + }; + _this._emitter = new EventEmitter$1(); + _this._prevOriginalDragTarget = null; + _this._originalDragTarget = null; + _this._prevDragTarget = null; + _this._dragTarget = null; + _this._prevPropTarget = null; + _this._propTarget = null; + _this._prevDragArea = false; + _this._isPropTargetChanged = false; + _this._hasFirstTarget = false; + _this._reiszeObserver = null; + _this._observerId = 0; + _this._mutationObserver = null; + _this._rootContainer = null; + _this._viewContainer = null; + _this._viewClassNames = []; + _this._store = {}; + + _this.checkUpdateRect = function () { + if (_this.isDragging()) { + return; + } + + var parentMoveable = _this.props.parentMoveable; + + if (parentMoveable) { + parentMoveable.checkUpdateRect(); + return; + } + + cancelAnimationFrame(_this._observerId); + _this._observerId = requestAnimationFrame$1(function () { + if (_this.isDragging()) { + return; + } + + _this.updateRect(); + }); + }; + + _this._onPreventClick = function (e) { + e.stopPropagation(); + e.preventDefault(); // removeEvent(window, "click", this._onPreventClick, true); + }; + + return _this; + } + + var __proto = MoveableManager.prototype; + + __proto.render = function () { + var props = this.props; + var state = this.getState(); + var parentPosition = props.parentPosition, + className = props.className, + propsTarget = props.target, + zoom = props.zoom, + cspNonce = props.cspNonce, + translateZ = props.translateZ, + ControlBoxElement = props.cssStyled, + groupable = props.groupable, + linePadding = props.linePadding, + controlPadding = props.controlPadding; + + this._checkUpdateRootContainer(); + + this.checkUpdate(); + this.updateRenderPoses(); + + var _a = __read(parentPosition || [0, 0], 2), + parentLeft = _a[0], + parentTop = _a[1]; + + var left = state.left, + top = state.top, + stateTarget = state.target, + direction = state.direction, + hasFixed = state.hasFixed, + offsetDelta = state.offsetDelta; + var groupTargets = props.targets; + var isDragging = this.isDragging(); + var ableAttributes = {}; + this.getEnabledAbles().forEach(function (able) { + ableAttributes["data-able-".concat(able.name.toLowerCase())] = true; + }); + + var ableClassName = this._getAbleClassName(); + + var isDisplay = groupTargets && groupTargets.length && (stateTarget || groupable) || propsTarget || !this._hasFirstTarget && this.state.isPersisted; + var isVisible = this.controlBox || this.props.firstRenderState || this.props.persistData; + var translate = [left - parentLeft, top - parentTop]; + + if (!groupable && props.useAccuratePosition) { + translate[0] += offsetDelta[0]; + translate[1] += offsetDelta[1]; + } + + var style = { + "position": hasFixed ? "fixed" : "absolute", + "display": isDisplay ? "block" : "none", + "visibility": isVisible ? "visible" : "hidden", + "transform": "translate3d(".concat(translate[0], "px, ").concat(translate[1], "px, ").concat(translateZ, ")"), + "--zoom": zoom, + "--zoompx": "".concat(zoom, "px") + }; + + if (linePadding) { + style["--moveable-line-padding"] = linePadding; + } + + if (controlPadding) { + style["--moveable-control-padding"] = controlPadding; + } + + return createElement(ControlBoxElement, __assign({ + cspNonce: cspNonce, + ref: ref(this, "controlBox"), + className: "".concat(prefix("control-box", direction === -1 ? "reverse" : "", isDragging ? "dragging" : ""), " ").concat(ableClassName, " ").concat(className) + }, ableAttributes, { + onClick: this._onPreventClick, + style: style + }), this.renderAbles(), this._renderLines()); + }; + + __proto.componentDidMount = function () { + this.isMoveableMounted = true; + this.isUnmounted = false; + var props = this.props; + var parentMoveable = props.parentMoveable, + container = props.container; + + this._checkUpdateRootContainer(); + + this._checkUpdateViewContainer(); + + this._updateTargets(); + + this._updateNativeEvents(); + + this._updateEvents(); + + this.updateCheckInput(); + + this._updateObserver(this.props); + + if (!container && !parentMoveable && !this.state.isPersisted) { + this.updateRect("", false, false); + this.forceUpdate(); + } + }; + + __proto.componentDidUpdate = function (prevProps) { + this._checkUpdateRootContainer(); + + this._checkUpdateViewContainer(); + + this._updateNativeEvents(); + + this._updateTargets(); + + this._updateEvents(); + + this.updateCheckInput(); + + this._updateObserver(prevProps); + }; + + __proto.componentWillUnmount = function () { + var _a, _b; + + this.isMoveableMounted = false; + this.isUnmounted = true; + + this._emitter.off(); + + (_a = this._reiszeObserver) === null || _a === void 0 ? void 0 : _a.disconnect(); + (_b = this._mutationObserver) === null || _b === void 0 ? void 0 : _b.disconnect(); + var viewContainer = this._viewContainer; + + if (viewContainer) { + this._changeAbleViewClassNames([]); + } + + unsetGesto(this, false); + unsetGesto(this, true); + var events = this.events; + + for (var name_1 in events) { + var manager = events[name_1]; + manager && manager.destroy(); + } + }; + + __proto.getTargets = function () { + var target = this.props.target; + return target ? [target] : []; + }; + /** + * Get the able used in MoveableManager. + * @method Moveable#getAble + * @param - able name + */ + + + __proto.getAble = function (ableName) { + var ables = this.props.ables || []; + return find$1(ables, function (able) { + return able.name === ableName; + }); + }; + + __proto.getContainer = function () { + var _a = this.props, + parentMoveable = _a.parentMoveable, + wrapperMoveable = _a.wrapperMoveable, + container = _a.container; + return container || wrapperMoveable && wrapperMoveable.getContainer() || parentMoveable && parentMoveable.getContainer() || this.controlBox.parentElement; + }; + /** + * Returns the element of the control box. + * @method Moveable#getControlBoxElement + */ + + + __proto.getControlBoxElement = function () { + return this.controlBox; + }; + /** + * Target element to be dragged in moveable + * @method Moveable#getDragElement + */ + + + __proto.getDragElement = function () { + return this._dragTarget; + }; + /** + * Check if the target is an element included in the moveable. + * @method Moveable#isMoveableElement + * @param - the target + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * window.addEventListener("click", e => { + * if (!moveable.isMoveableElement(e.target)) { + * moveable.target = e.target; + * } + * }); + */ + + + __proto.isMoveableElement = function (target) { + var _a; + + return target && (((_a = target.getAttribute) === null || _a === void 0 ? void 0 : _a.call(target, "class")) || "").indexOf(PREFIX) > -1; + }; + /** + * You can drag start the Moveable through the external `MouseEvent`or `TouchEvent`. (Angular: ngDragStart) + * @method Moveable#dragStart + * @param - external `MouseEvent`or `TouchEvent` + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * document.body.addEventListener("mousedown", e => { + * if (!moveable.isMoveableElement(e.target)) { + * moveable.dragStart(e); + * } + * }); + */ + + + __proto.dragStart = function (e) { + var targetGesto = this.targetGesto; + var controlGesto = this.controlGesto; + + if (targetGesto && checkMoveableTarget(this)({ + inputEvent: e + })) { + if (!targetGesto.isFlag()) { + targetGesto.triggerDragStart(e); + } + } else if (controlGesto && this.isMoveableElement(e.target)) { + if (!controlGesto.isFlag()) { + controlGesto.triggerDragStart(e); + } + } + + return this; + }; + /** + * Hit test an element or rect on a moveable target. + * (100% = 100) + * @method Moveable#hitTest + * @param - element or rect to test + * @return - Get hit test rate (rate > 0 is hitted) + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * document.body.addEventListener("mousedown", e => { + * if (moveable.hitTest(e.target) > 0) { + * console.log("hiited"); + * } + * }); + */ + + + __proto.hitTest = function (el) { + var _a = this.state, + target = _a.target, + pos1 = _a.pos1, + pos2 = _a.pos2, + pos3 = _a.pos3, + pos4 = _a.pos4, + targetClientRect = _a.targetClientRect; + + if (!target) { + return 0; + } + + var rect; + + if (isNode(el)) { + var clientRect = el.getBoundingClientRect(); + rect = { + left: clientRect.left, + top: clientRect.top, + width: clientRect.width, + height: clientRect.height + }; + } else { + rect = __assign({ + width: 0, + height: 0 + }, el); + } + + var rectLeft = rect.left, + rectTop = rect.top, + rectWidth = rect.width, + rectHeight = rect.height; + var points = fitPoints([pos1, pos2, pos4, pos3], targetClientRect); + var size = getOverlapSize(points, [[rectLeft, rectTop], [rectLeft + rectWidth, rectTop], [rectLeft + rectWidth, rectTop + rectHeight], [rectLeft, rectTop + rectHeight]]); + var totalSize = getAreaSize(points); + + if (!size || !totalSize) { + return 0; + } + + return Math.min(100, size / totalSize * 100); + }; + /** + * Whether the coordinates are inside Moveable + * @method Moveable#isInside + * @param - x coordinate + * @param - y coordinate + * @return - True if the coordinate is in moveable or false + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * document.body.addEventListener("mousedown", e => { + * if (moveable.isInside(e.clientX, e.clientY)) { + * console.log("inside"); + * } + * }); + */ + + + __proto.isInside = function (clientX, clientY) { + var _a = this.state, + target = _a.target, + pos1 = _a.pos1, + pos2 = _a.pos2, + pos3 = _a.pos3, + pos4 = _a.pos4, + targetClientRect = _a.targetClientRect; + + if (!target) { + return false; + } + + return isInside([clientX, clientY], fitPoints([pos1, pos2, pos4, pos3], targetClientRect)); + }; + /** + * If the width, height, left, and top of all elements change, update the shape of the moveable. + * @method Moveable#updateRect + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * window.addEventListener("resize", e => { + * moveable.updateRect(); + * }); + */ + + + __proto.updateRect = function (type, isTarget, isSetState) { + if (isSetState === void 0) { + isSetState = true; + } + + var props = this.props; + var isSingle = !props.parentPosition && !props.wrapperMoveable; + + if (isSingle) { + setStoreCache(true); + } + + var parentMoveable = props.parentMoveable; + var state = this.state; + var target = state.target || props.target; + var container = this.getContainer(); + var rootContainer = parentMoveable ? parentMoveable._rootContainer : this._rootContainer; + var nextState = getMoveableTargetInfo(this.controlBox, target, container, container, rootContainer || container, this._getRequestStyles()); + + if (!target && this._hasFirstTarget && props.persistData) { + var persistState = getPersistState(props.persistData); + + for (var name_2 in persistState) { + nextState[name_2] = persistState[name_2]; + } + } + + if (isSingle) { + setStoreCache(); + } + + this.updateState(nextState, parentMoveable ? false : isSetState); + }; + /** + * Check if the moveable state is being dragged. + * @method Moveable#isDragging + * @param - If you want to check if able is dragging, specify ableName. + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * // false + * console.log(moveable.isDragging()); + * + * moveable.on("drag", () => { + * // true + * console.log(moveable.isDragging()); + * }); + */ + + + __proto.isDragging = function (ableName) { + var _a, _b; + + var targetGesto = this.targetGesto; + var controlGesto = this.controlGesto; + + if (targetGesto === null || targetGesto === void 0 ? void 0 : targetGesto.isFlag()) { + if (!ableName) { + return true; + } + + var data = targetGesto.getEventData(); + return !!((_a = data[ableName]) === null || _a === void 0 ? void 0 : _a.isEventStart); + } + + if (controlGesto === null || controlGesto === void 0 ? void 0 : controlGesto.isFlag()) { + if (!ableName) { + return true; + } + + var data = controlGesto.getEventData(); + return !!((_b = data[ableName]) === null || _b === void 0 ? void 0 : _b.isEventStart); + } + + return false; + }; + /** + * If the width, height, left, and top of the only target change, update the shape of the moveable. + * Use `.updateRect()` method + * @method Moveable#updateTarget + * @deprecated + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * moveable.updateTarget(); + */ + + + __proto.updateTarget = function (type) { + this.updateRect(type, true); + }; + /** + * You can get the vertex information, position and offset size information of the target based on the container. + * @method Moveable#getRect + * @return - The Rect Info + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * const rectInfo = moveable.getRect(); + */ + + + __proto.getRect = function () { + var state = this.state; + var poses = getAbsolutePosesByState(this.state); + + var _a = __read(poses, 4), + pos1 = _a[0], + pos2 = _a[1], + pos3 = _a[2], + pos4 = _a[3]; + + var rect = getRect(poses); + var offsetWidth = state.width, + offsetHeight = state.height; + var width = rect.width, + height = rect.height, + left = rect.left, + top = rect.top; + var statePos = [state.left, state.top]; + var origin = plus(statePos, state.origin); + var beforeOrigin = plus(statePos, state.beforeOrigin); + var transformOrigin = state.transformOrigin; + return { + width: width, + height: height, + left: left, + top: top, + pos1: pos1, + pos2: pos2, + pos3: pos3, + pos4: pos4, + offsetWidth: offsetWidth, + offsetHeight: offsetHeight, + beforeOrigin: beforeOrigin, + origin: origin, + transformOrigin: transformOrigin, + rotation: this.getRotation() + }; + }; + /** + * Get a manager that manages the moveable's state and props. + * @method Moveable#getManager + * @return - The Rect Info + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * const manager = moveable.getManager(); // real moveable class instance + */ + + + __proto.getManager = function () { + return this; + }; + /** + * You can stop the dragging currently in progress through a method from outside. + * @method Moveable#stopDrag + * @return - The Rect Info + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * moveable.stopDrag(); + */ + + + __proto.stopDrag = function (type) { + if (!type || type === "target") { + var gesto = this.targetGesto; + + if ((gesto === null || gesto === void 0 ? void 0 : gesto.isIdle()) === false) { + unsetAbles(this, false); + } + + gesto === null || gesto === void 0 ? void 0 : gesto.stop(); + } + + if (!type || type === "control") { + var gesto = this.controlGesto; + + if ((gesto === null || gesto === void 0 ? void 0 : gesto.isIdle()) === false) { + unsetAbles(this, true); + } + + gesto === null || gesto === void 0 ? void 0 : gesto.stop(); + } + }; + + __proto.getRotation = function () { + var _a = this.state, + pos1 = _a.pos1, + pos2 = _a.pos2, + direction = _a.direction; + return getAbsoluteRotation(pos1, pos2, direction); + }; + /** + * Request able through a method rather than an event. + * At the moment of execution, requestStart is executed, + * and then request and requestEnd can be executed through Requester. + * @method Moveable#request + * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Draggable.html#request|Draggable Requester} + * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Resizable.html#request|Resizable Requester} + * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Scalable.html#request|Scalable Requester} + * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Rotatable.html#request|Rotatable Requester} + * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.OriginDraggable.html#request|OriginDraggable Requester} + * @param - ableName + * @param - request to be able params. + * @param - If isInstant is true, request and requestEnd are executed immediately. + * @return - Able Requester. If there is no request in able, nothing will work. + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * // Instantly Request (requestStart - request - requestEnd) + * moveable.request("draggable", { deltaX: 10, deltaY: 10 }, true); + * + * // Start move + * const requester = moveable.request("draggable"); + * requester.request({ deltaX: 10, deltaY: 10 }); + * requester.request({ deltaX: 10, deltaY: 10 }); + * requester.request({ deltaX: 10, deltaY: 10 }); + * requester.requestEnd(); + */ + + + __proto.request = function (ableName, param, isInstant) { + if (param === void 0) { + param = {}; + } + + var self = this; + var props = self.props; + var manager = props.parentMoveable || props.wrapperMoveable || self; + var allAbles = manager.props.ables; + var groupable = props.groupable; + var requsetAble = find$1(allAbles, function (able) { + return able.name === ableName; + }); + + if (this.isDragging() || !requsetAble || !requsetAble.request) { + return { + request: function () { + return this; + }, + requestEnd: function () { + return this; + } + }; + } + + var ableRequester = requsetAble.request(self); + var requestInstant = isInstant || param.isInstant; + var ableType = ableRequester.isControl ? "controlAbles" : "targetAbles"; + var eventAffix = "".concat(groupable ? "Group" : "").concat(ableRequester.isControl ? "Control" : ""); + + var moveableAbles = __spreadArray([], __read(manager[ableType]), false); + + var requester = { + request: function (ableParam) { + triggerAble(self, moveableAbles, ["drag"], eventAffix, "", __assign(__assign({}, ableRequester.request(ableParam)), { + requestAble: ableName, + isRequest: true + }), requestInstant); + return requester; + }, + requestEnd: function () { + triggerAble(self, moveableAbles, ["drag"], eventAffix, "End", __assign(__assign({}, ableRequester.requestEnd()), { + requestAble: ableName, + isRequest: true + }), requestInstant); + return requester; + } + }; + triggerAble(self, moveableAbles, ["drag"], eventAffix, "Start", __assign(__assign({}, ableRequester.requestStart(param)), { + requestAble: ableName, + isRequest: true + }), requestInstant); + return requestInstant ? requester.request(param).requestEnd() : requester; + }; + /** + * moveable is the top level that manages targets + * `Single`: MoveableManager instance + * `Group`: MoveableGroup instance + * `IndividualGroup`: MoveableIndividaulGroup instance + * Returns leaf target MoveableManagers. + */ + + + __proto.getMoveables = function () { + return [this]; + }; + /** + * Remove the Moveable object and the events. + * @method Moveable#destroy + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * + * moveable.destroy(); + */ + + + __proto.destroy = function () { + this.componentWillUnmount(); + }; + + __proto.updateRenderPoses = function () { + var state = this.getState(); + var props = this.props; + var padding = props.padding; + var originalBeforeOrigin = state.originalBeforeOrigin, + transformOrigin = state.transformOrigin, + allMatrix = state.allMatrix, + is3d = state.is3d, + pos1 = state.pos1, + pos2 = state.pos2, + pos3 = state.pos3, + pos4 = state.pos4, + stateLeft = state.left, + stateTop = state.top, + isPersisted = state.isPersisted; + var zoom = props.zoom || 1; + + if (!padding && zoom <= 1) { + state.renderPoses = [pos1, pos2, pos3, pos4]; + state.renderLines = [[pos1, pos2], [pos2, pos4], [pos4, pos3], [pos3, pos1]]; + return; + } + + var _a = getPaddingBox(padding || {}), + left = _a.left, + top = _a.top, + bottom = _a.bottom, + right = _a.right; + + var n = is3d ? 4 : 3; // const clipPathInfo = getClipPath( + // props.target, + // offsetWidth, + // offsetHeight, + // ); + // if (clipPathInfo) { + // left -= Math.max(0, clipPathInfo.left); + // top -= Math.max(0, clipPathInfo.top); + // bottom -= Math.max(0, offsetHeight - clipPathInfo.bottom); + // right -= Math.max(0, offsetWidth - clipPathInfo.right); + // } + + var absoluteOrigin = []; + + if (isPersisted) { + absoluteOrigin = transformOrigin; + } else if (this.controlBox && props.groupable) { + absoluteOrigin = originalBeforeOrigin; + } else { + absoluteOrigin = plus(originalBeforeOrigin, [stateLeft, stateTop]); + } + + var nextMatrix = multiplies(n, createOriginMatrix(absoluteOrigin.map(function (v) { + return -v; + }), n), allMatrix, createOriginMatrix(transformOrigin, n)); + var renderPos1 = calculatePadding(nextMatrix, pos1, [-left, -top], n); + var renderPos2 = calculatePadding(nextMatrix, pos2, [right, -top], n); + var renderPos3 = calculatePadding(nextMatrix, pos3, [-left, bottom], n); + var renderPos4 = calculatePadding(nextMatrix, pos4, [right, bottom], n); + state.renderPoses = [renderPos1, renderPos2, renderPos3, renderPos4]; + state.renderLines = [[renderPos1, renderPos2], [renderPos2, renderPos4], [renderPos4, renderPos3], [renderPos3, renderPos1]]; + + if (zoom) { + var zoomOffset = zoom / 2; + state.renderLines = [[calculatePadding(nextMatrix, pos1, [-left - zoomOffset, -top], n), calculatePadding(nextMatrix, pos2, [right + zoomOffset, -top], n)], [calculatePadding(nextMatrix, pos2, [right, -top - zoomOffset], n), calculatePadding(nextMatrix, pos4, [right, bottom + zoomOffset], n)], [calculatePadding(nextMatrix, pos4, [right + zoomOffset, bottom], n), calculatePadding(nextMatrix, pos3, [-left - zoomOffset, bottom], n)], [calculatePadding(nextMatrix, pos3, [-left, bottom + zoomOffset], n), calculatePadding(nextMatrix, pos1, [-left, -top - zoomOffset], n)]]; + } + }; + + __proto.checkUpdate = function () { + this._isPropTargetChanged = false; + var _a = this.props, + target = _a.target, + container = _a.container, + parentMoveable = _a.parentMoveable; + var _b = this.state, + stateTarget = _b.target, + stateContainer = _b.container; + + if (!stateTarget && !target) { + return; + } + + this.updateAbles(); + var isTargetChanged = !equals(stateTarget, target); + var isChanged = isTargetChanged || !equals(stateContainer, container); + + if (!isChanged) { + return; + } + + var moveableContainer = container || this.controlBox; + + if (moveableContainer) { + this.unsetAbles(); + } + + this.updateState({ + target: target, + container: container + }); + + if (!parentMoveable && moveableContainer) { + this.updateRect("End", false, false); + } + + this._isPropTargetChanged = isTargetChanged; + }; + + __proto.waitToChangeTarget = function () { + return new Promise(function () {}); + }; + + __proto.triggerEvent = function (name, e) { + var props = this.props; + + this._emitter.trigger(name, e); + + if (props.parentMoveable && e.isRequest && !e.isRequestChild) { + return props.parentMoveable.triggerEvent(name, e, true); + } + + var callback = props[name]; + return callback && callback(e); + }; + + __proto.useCSS = function (tag, css) { + var customStyleMap = this.props.customStyledMap; + var key = tag + css; + + if (!customStyleMap[key]) { + customStyleMap[key] = styled(tag, css); + } + + return customStyleMap[key]; + }; + + __proto.getState = function () { + var _a; + + var props = this.props; + + if (props.target || ((_a = props.targets) === null || _a === void 0 ? void 0 : _a.length)) { + this._hasFirstTarget = true; + } + + var hasControlBox = this.controlBox; + var persistData = props.persistData; + var firstRenderState = props.firstRenderState; + + if (firstRenderState && !hasControlBox) { + return firstRenderState; + } + + if (!this._hasFirstTarget && persistData) { + var persistState = getPersistState(persistData); + + if (persistState) { + this.updateState(persistState, false); + return this.state; + } + } + + this.state.isPersisted = false; + return this.state; + }; + + __proto.updateSelectors = function () {}; + + __proto.unsetAbles = function () { + var _this = this; + + this.targetAbles.forEach(function (able) { + if (able.unset) { + able.unset(_this); + } + }); + }; + + __proto.updateAbles = function (ables, eventAffix) { + if (ables === void 0) { + ables = this.props.ables; + } + + if (eventAffix === void 0) { + eventAffix = ""; + } + + var props = this.props; + var triggerAblesSimultaneously = props.triggerAblesSimultaneously; + var enabledAbles = this.getEnabledAbles(ables); + var dragStart = "drag".concat(eventAffix, "Start"); + var pinchStart = "pinch".concat(eventAffix, "Start"); + var dragControlStart = "drag".concat(eventAffix, "ControlStart"); + var targetAbles = filterAbles(enabledAbles, [dragStart, pinchStart], triggerAblesSimultaneously); + var controlAbles = filterAbles(enabledAbles, [dragControlStart], triggerAblesSimultaneously); + this.enabledAbles = enabledAbles; + this.targetAbles = targetAbles; + this.controlAbles = controlAbles; + }; + + __proto.updateState = function (nextState, isSetState) { + if (isSetState) { + if (this.isUnmounted) { + return; + } + + this.setState(nextState); + } else { + var state = this.state; + + for (var name_3 in nextState) { + state[name_3] = nextState[name_3]; + } + } + }; + + __proto.getEnabledAbles = function (ables) { + if (ables === void 0) { + ables = this.props.ables; + } + + var props = this.props; + return ables.filter(function (able) { + return able && (able.always && props[able.name] !== false || props[able.name]); + }); + }; + + __proto.renderAbles = function () { + var _this = this; + + var props = this.props; + var triggerAblesSimultaneously = props.triggerAblesSimultaneously; + var Renderer = { + createElement: createElement + }; + this.renderState = {}; + return groupByMap(flat(filterAbles(this.getEnabledAbles(), ["render"], triggerAblesSimultaneously).map(function (_a) { + var render = _a.render; + return render(_this, Renderer) || []; + })).filter(function (el) { + return el; + }), function (_a) { + var key = _a.key; + return key; + }).map(function (group) { + return group[0]; + }); + }; + + __proto.updateCheckInput = function () { + this.targetGesto && (this.targetGesto.options.checkInput = this.props.checkInput); + }; + + __proto._getRequestStyles = function () { + var styleNames = this.getEnabledAbles().reduce(function (names, able) { + var _a, _b; + + var ableStyleNames = (_b = (_a = able.requestStyle) === null || _a === void 0 ? void 0 : _a.call(able)) !== null && _b !== void 0 ? _b : []; + return __spreadArray(__spreadArray([], __read(names), false), __read(ableStyleNames), false); + }, __spreadArray([], __read(this.props.requestStyles || []), false)); + return styleNames; + }; + + __proto._updateObserver = function (prevProps) { + this._updateResizeObserver(prevProps); + + this._updateMutationObserver(prevProps); + }; + + __proto._updateEvents = function () { + var controlBoxElement = this.controlBox; + var hasTargetAble = this.targetAbles.length; + var hasControlAble = this.controlAbles.length; + var target = this._dragTarget; + + var isUnset = !hasTargetAble && this.targetGesto || this._isTargetChanged(true); + + if (isUnset) { + unsetGesto(this, false); + this.updateState({ + gestos: {} + }); + } + + if (!hasControlAble) { + unsetGesto(this, true); + } + + if (target && hasTargetAble && !this.targetGesto) { + this.targetGesto = getTargetAbleGesto(this, target, ""); + } + + if (!this.controlGesto && hasControlAble) { + this.controlGesto = getAbleGesto(this, controlBoxElement, "controlAbles", "Control"); + } + }; + + __proto._updateTargets = function () { + var props = this.props; + this._prevPropTarget = this._propTarget; + this._prevDragTarget = this._dragTarget; + this._prevOriginalDragTarget = this._originalDragTarget; + this._prevDragArea = props.dragArea; + this._propTarget = props.target; + this._originalDragTarget = props.dragTarget || props.target; + this._dragTarget = getRefTarget(this._originalDragTarget, true); + }; + + __proto._renderLines = function () { + var props = this.props; + var _a = props, + zoom = _a.zoom, + hideDefaultLines = _a.hideDefaultLines, + hideChildMoveableDefaultLines = _a.hideChildMoveableDefaultLines, + parentMoveable = _a.parentMoveable; + + if (hideDefaultLines || parentMoveable && hideChildMoveableDefaultLines) { + return []; + } + + var state = this.getState(); + var Renderer = { + createElement: createElement + }; + return state.renderLines.map(function (line, i) { + return renderLine(Renderer, "", line[0], line[1], zoom, "render-line-".concat(i)); + }); + }; + + __proto._isTargetChanged = function (useDragArea) { + var props = this.props; + var nextTarget = props.dragTarget || props.target; + var prevTarget = this._prevOriginalDragTarget; + var prevDragArea = this._prevDragArea; + var dragArea = props.dragArea; // check target without dragArea + + var isDragTargetChanged = !dragArea && prevTarget !== nextTarget; + var isDragAreaChanged = (useDragArea || dragArea) && prevDragArea !== dragArea; + return isDragTargetChanged || isDragAreaChanged || this._prevPropTarget != this._propTarget; + }; + + __proto._updateNativeEvents = function () { + var _this = this; + + var props = this.props; + var target = props.dragArea ? this.areaElement : this.state.target; + var events = this.events; + var eventKeys = getKeys(events); + + if (this._isTargetChanged()) { + for (var eventName in events) { + var manager = events[eventName]; + manager && manager.destroy(); + events[eventName] = null; + } + } + + if (!target) { + return; + } + + var enabledAbles = this.enabledAbles; + eventKeys.forEach(function (eventName) { + var ables = filterAbles(enabledAbles, [eventName]); + var hasAbles = ables.length > 0; + var manager = events[eventName]; + + if (!hasAbles) { + if (manager) { + manager.destroy(); + events[eventName] = null; + } + + return; + } + + if (!manager) { + manager = new EventManager(target, _this, eventName); + events[eventName] = manager; + } + + manager.setAbles(ables); + }); + }; + + __proto._checkUpdateRootContainer = function () { + var rootContainer = this.props.rootContainer; + + if (!this._rootContainer && rootContainer) { + this._rootContainer = getRefTarget(rootContainer, true); + } + }; + + __proto._checkUpdateViewContainer = function () { + var viewContainerOption = this.props.viewContainer; + + if (!this._viewContainer && viewContainerOption) { + this._viewContainer = getRefTarget(viewContainerOption, true); + } + + var viewContainer = this._viewContainer; + + if (viewContainer) { + this._changeAbleViewClassNames(__spreadArray(__spreadArray([], __read(this._getAbleViewClassNames()), false), [this.isDragging() ? VIEW_DRAGGING : ""], false)); + } + }; + + __proto._changeAbleViewClassNames = function (classNames) { + var viewContainer = this._viewContainer; + var nextClassNames = groupBy(classNames.filter(Boolean), function (el) { + return el; + }).map(function (_a) { + var _b = __read(_a, 1), + className = _b[0]; + + return className; + }); + var prevClassNames = this._viewClassNames; + + var _a = diff$1(prevClassNames, nextClassNames), + removed = _a.removed, + added = _a.added; + + removed.forEach(function (index) { + removeClass(viewContainer, prevClassNames[index]); + }); + added.forEach(function (index) { + addClass(viewContainer, nextClassNames[index]); + }); + this._viewClassNames = nextClassNames; + }; + + __proto._getAbleViewClassNames = function () { + var _this = this; + + return (this.getEnabledAbles().map(function (able) { + var _a; + + return ((_a = able.viewClassName) === null || _a === void 0 ? void 0 : _a.call(able, _this)) || ""; + }).join(" ") + " ".concat(this._getAbleClassName("-view"))).split(/\s+/g); + }; + + __proto._getAbleClassName = function (classPrefix) { + var _this = this; + + if (classPrefix === void 0) { + classPrefix = ""; + } + + var ables = this.getEnabledAbles(); + var targetGesto = this.targetGesto; + var controlGesto = this.controlGesto; + var targetGestoData = (targetGesto === null || targetGesto === void 0 ? void 0 : targetGesto.isFlag()) ? targetGesto.getEventData() : {}; + var controlGestoData = (controlGesto === null || controlGesto === void 0 ? void 0 : controlGesto.isFlag()) ? controlGesto.getEventData() : {}; + return ables.map(function (able) { + var _a, _b, _c; + + var name = able.name; + var className = ((_a = able.className) === null || _a === void 0 ? void 0 : _a.call(able, _this)) || ""; + + if (((_b = targetGestoData[name]) === null || _b === void 0 ? void 0 : _b.isEventStart) || ((_c = controlGestoData[name]) === null || _c === void 0 ? void 0 : _c.isEventStart)) { + className += " ".concat(prefix("".concat(name).concat(classPrefix, "-dragging"))); + } + + return className.trim(); + }).filter(Boolean).join(" "); + }; + + __proto._updateResizeObserver = function (prevProps) { + var _a; + + var props = this.props; + var target = props.target; + var win = getWindow(this.getControlBoxElement()); + + if (!win.ResizeObserver || !target || !props.useResizeObserver) { + (_a = this._reiszeObserver) === null || _a === void 0 ? void 0 : _a.disconnect(); + return; + } + + if (prevProps.target === target && this._reiszeObserver) { + return; + } + + var observer = new win.ResizeObserver(this.checkUpdateRect); + observer.observe(target, { + box: "border-box" + }); + this._reiszeObserver = observer; + }; + + __proto._updateMutationObserver = function (prevProps) { + var _this = this; + + var _a; + + var props = this.props; + var target = props.target; + var win = getWindow(this.getControlBoxElement()); + + if (!win.MutationObserver || !target || !props.useMutationObserver) { + (_a = this._mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect(); + return; + } + + if (prevProps.target === target && this._mutationObserver) { + return; + } + + var observer = new win.MutationObserver(function (records) { + var e_1, _a; + + try { + for (var records_1 = __values(records), records_1_1 = records_1.next(); !records_1_1.done; records_1_1 = records_1.next()) { + var mutation = records_1_1.value; + + if (mutation.type === "attributes" && mutation.attributeName === "style") { + _this.checkUpdateRect(); + } + } + } catch (e_1_1) { + e_1 = { + error: e_1_1 + }; + } finally { + try { + if (records_1_1 && !records_1_1.done && (_a = records_1.return)) _a.call(records_1); + } finally { + if (e_1) throw e_1.error; + } + } + }); + observer.observe(target, { + attributes: true + }); + this._mutationObserver = observer; + }; + + MoveableManager.defaultProps = { + dragTargetSelf: false, + target: null, + dragTarget: null, + container: null, + rootContainer: null, + origin: true, + parentMoveable: null, + wrapperMoveable: null, + isWrapperMounted: false, + parentPosition: null, + warpSelf: false, + svgOrigin: "", + dragContainer: null, + useResizeObserver: false, + useMutationObserver: false, + preventDefault: true, + linePadding: 0, + controlPadding: 0, + ables: [], + pinchThreshold: 20, + dragArea: false, + passDragArea: false, + transformOrigin: "", + className: "", + zoom: 1, + triggerAblesSimultaneously: false, + padding: {}, + pinchOutside: true, + checkInput: false, + dragFocusedInput: false, + groupable: false, + hideDefaultLines: false, + cspNonce: "", + translateZ: 0, + cssStyled: null, + customStyledMap: {}, + props: {}, + stopPropagation: false, + preventClickDefault: false, + preventClickEventOnDrag: true, + flushSync: defaultSync, + firstRenderState: null, + persistData: null, + viewContainer: null, + requestStyles: [], + useAccuratePosition: false + }; + return MoveableManager; + }(PureComponent); + /** + * The target to indicate Moveable Control Box. + * @name Moveable#target + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * moveable.target = document.querySelector(".target"); + */ + + /** + * Zooms in the elements of a moveable. + * @name Moveable#zoom + * @default 1 + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * moveable.zoom = 2; + */ + + /** + * Whether the target size is detected and updated whenever it changes. + * @name Moveable#useResizeObserver + * @default false + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * moveable.useResizeObserver = true; + */ + + /** + * Resize, Scale Events at edges + * @name Moveable#edge + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * moveable.edge = true; + */ + + /** + * You can specify the className of the moveable controlbox. + * @name Moveable#className + * @default "" + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * className: "", + * }); + * + * moveable.className = "moveable1"; + */ + + /** + * The target(s) to drag Moveable target(s) + * @name Moveable#dragTarget + * @default target + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body); + * moveable.target = document.querySelector(".target"); + * moveable.dragTarget = document.querySelector(".dragTarget"); + */ + + /** + * `renderStart` event occurs at the first start of all events. + * @memberof Moveable + * @event renderStart + * @param {Moveable.OnRenderStart} - Parameters for the `renderStart` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: document.querySelector(".target"), + * }); + * moveable.on("renderStart", ({ target }) => { + * console.log("onRenderStart", target); + * }); + */ + + /** + * `render` event occurs before the target is drawn on the screen. + * @memberof Moveable + * @event render + * @param {Moveable.OnRender} - Parameters for the `render` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: document.querySelector(".target"), + * }); + * moveable.on("render", ({ target }) => { + * console.log("onRender", target); + * }); + */ + + /** + * `renderEnd` event occurs at the end of all events. + * @memberof Moveable + * @event renderEnd + * @param {Moveable.OnRenderEnd} - Parameters for the `renderEnd` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: document.querySelector(".target"), + * }); + * moveable.on("renderEnd", ({ target }) => { + * console.log("onRenderEnd", target); + * }); + */ + + /** + * `renderGroupStart` event occurs at the first start of all events in group. + * @memberof Moveable + * @event renderGroupStart + * @param {Moveable.OnRenderGroupStart} - Parameters for the `renderGroupStart` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: [].slice.call(document.querySelectorAll(".target")), + * }); + * moveable.on("renderGroupStart", ({ targets }) => { + * console.log("onRenderGroupStart", targets); + * }); + */ + + /** + * `renderGroup` event occurs before the target is drawn on the screen in group. + * @memberof Moveable + * @event renderGroup + * @param {Moveable.OnRenderGroup} - Parameters for the `renderGroup` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: [].slice.call(document.querySelectorAll(".target")), + * }); + * moveable.on("renderGroup", ({ targets }) => { + * console.log("onRenderGroup", targets); + * }); + */ + + /** + * `renderGroupEnd` event occurs at the end of all events in group. + * @memberof Moveable + * @event renderGroupEnd + * @param {Moveable.OnRenderGroupEnd} - Parameters for the `renderGroupEnd` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: [].slice.call(document.querySelectorAll(".target")), + * }); + * moveable.on("renderGroupEnd", ({ targets }) => { + * console.log("onRenderGroupEnd", targets); + * }); + */ + + + var Groupable = { + name: "groupable", + props: ["defaultGroupRotate", "useDefaultGroupRotate", "defaultGroupOrigin", "groupable", "groupableProps", "targetGroups", "hideChildMoveableDefaultLines"], + events: [], + render: function (moveable, React) { + var _a; + + var props = moveable.props; + var targets = props.targets || []; + + var _b = moveable.getState(), + left = _b.left, + top = _b.top, + isPersisted = _b.isPersisted; + + var zoom = props.zoom || 1; + var renderGroupRects = moveable.renderGroupRects; + var persistDatChildren = ((_a = props.persistData) === null || _a === void 0 ? void 0 : _a.children) || []; + + if (isPersisted) { + targets = persistDatChildren.map(function () { + return null; + }); + } else { + persistDatChildren = []; + } + + var parentPosition = watchValue(moveable, "parentPosition", [left, top], function (styles) { + return styles.join(","); + }); + var requestStyles = watchValue(moveable, "requestStyles", moveable.getRequestChildStyles(), function (styles) { + return styles.join(","); + }); + moveable.moveables = moveable.moveables.slice(0, targets.length); + return __spreadArray(__spreadArray([], __read(targets.map(function (target, i) { + return React.createElement(MoveableManager$1, { + key: "moveable" + i, + ref: refs(moveable, "moveables", i), + target: target, + origin: false, + requestStyles: requestStyles, + cssStyled: props.cssStyled, + customStyledMap: props.customStyledMap, + useResizeObserver: props.useResizeObserver, + useMutationObserver: props.useMutationObserver, + hideChildMoveableDefaultLines: props.hideChildMoveableDefaultLines, + parentMoveable: moveable, + parentPosition: [left, top], + persistData: persistDatChildren[i], + zoom: zoom + }); + })), false), __read(flat(renderGroupRects.map(function (_a, i) { + var pos1 = _a.pos1, + pos2 = _a.pos2, + pos3 = _a.pos3, + pos4 = _a.pos4; + var poses = [pos1, pos2, pos3, pos4]; + return [[0, 1], [1, 3], [3, 2], [2, 0]].map(function (_a, j) { + var _b = __read(_a, 2), + from = _b[0], + to = _b[1]; + + return renderLine(React, "", minus(poses[from], parentPosition), minus(poses[to], parentPosition), zoom, "group-rect-".concat(i, "-").concat(j)); + }); + }))), false); + } + }; + var Clickable = makeAble$1("clickable", { + props: ["clickable"], + events: ["click", "clickGroup"], + always: true, + dragRelation: "weak", + // eslint-disable-next-line @typescript-eslint/no-unused-vars + dragStart: function () { + return; + }, + dragControlStart: function () { + return; + }, + dragGroupStart: function (moveable, e) { + e.datas.inputTarget = e.inputEvent && e.inputEvent.target; + }, + dragEnd: function (moveable, e) { + var target = moveable.props.target; + var inputEvent = e.inputEvent; + var inputTarget = e.inputTarget; + var isMoveableElement = moveable.isMoveableElement(inputTarget); + var containsElement = !isMoveableElement && moveable.controlBox.contains(inputTarget); + + if (!inputEvent || !inputTarget || e.isDrag || moveable.isMoveableElement(inputTarget) || containsElement // External event duplicate target or dragAreaElement + ) { + return; + } + + var containsTarget = target.contains(inputTarget); + triggerEvent(moveable, "onClick", fillParams(moveable, e, { + isDouble: e.isDouble, + inputTarget: inputTarget, + isTarget: target === inputTarget, + moveableTarget: moveable.props.target, + containsTarget: containsTarget + })); + }, + dragGroupEnd: function (moveable, e) { + var inputEvent = e.inputEvent; + var inputTarget = e.inputTarget; + + if (!inputEvent || !inputTarget || e.isDrag || moveable.isMoveableElement(inputTarget) // External event duplicate target or dragAreaElement + || e.datas.inputTarget === inputTarget) { + return; + } + + var targets = moveable.props.targets; + var targetIndex = targets.indexOf(inputTarget); + var isTarget = targetIndex > -1; + var containsTarget = false; + + if (targetIndex === -1) { + targetIndex = findIndex(targets, function (parentTarget) { + return parentTarget.contains(inputTarget); + }); + containsTarget = targetIndex > -1; + } + + triggerEvent(moveable, "onClickGroup", fillParams(moveable, e, { + isDouble: e.isDouble, + targets: targets, + inputTarget: inputTarget, + targetIndex: targetIndex, + isTarget: isTarget, + containsTarget: containsTarget, + moveableTarget: targets[targetIndex] + })); + }, + dragControlEnd: function (moveable, e) { + this.dragEnd(moveable, e); + }, + dragGroupControlEnd: function (moveable, e) { + this.dragEnd(moveable, e); + } + }); + /** + * When you click on the element, the `click` event is called. + * @memberof Moveable + * @event click + * @param {Moveable.OnClick} - Parameters for the `click` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: document.querySelector(".target"), + * }); + * moveable.on("click", ({ hasTarget, containsTarget, targetIndex }) => { + * // If you click on an element other than the target and not included in the target, index is -1. + * console.log("onClickGroup", target, hasTarget, containsTarget, targetIndex); + * }); + */ + + /** + * When you click on the element inside the group, the `clickGroup` event is called. + * @memberof Moveable + * @event clickGroup + * @param {Moveable.OnClickGroup} - Parameters for the `clickGroup` event + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: [].slice.call(document.querySelectorAll(".target")), + * }); + * moveable.on("clickGroup", ({ inputTarget, isTarget, containsTarget, targetIndex }) => { + * // If you click on an element other than the target and not included in the target, index is -1. + * console.log("onClickGroup", inputTarget, isTarget, containsTarget, targetIndex); + * }); + */ + + function getDraggableEvent(e) { + var datas = e.originalDatas.draggable; + + if (!datas) { + e.originalDatas.draggable = {}; + datas = e.originalDatas.draggable; + } + + return __assign(__assign({}, e), { + datas: datas + }); + } + + var edgeDraggable = makeAble$1("edgeDraggable", { + css: [".edge.edgeDraggable.line {\ncursor: move;\n}"], + render: function (moveable, React) { + var props = moveable.props; + var edge = props.edgeDraggable; + + if (!edge) { + return []; + } + + return renderEdgeLines(React, "edgeDraggable", edge, moveable.getState().renderPoses, props.zoom); + }, + dragCondition: function (moveable, e) { + var _a; + + var props = moveable.props; + var target = (_a = e.inputEvent) === null || _a === void 0 ? void 0 : _a.target; + + if (!props.edgeDraggable || !target) { + return false; + } + + return !props.draggable && hasClass(target, prefix("direction")) && hasClass(target, prefix("edge")) && hasClass(target, prefix("edgeDraggable")); + }, + dragStart: function (moveable, e) { + return Draggable.dragStart(moveable, getDraggableEvent(e)); + }, + drag: function (moveable, e) { + return Draggable.drag(moveable, getDraggableEvent(e)); + }, + dragEnd: function (moveable, e) { + return Draggable.dragEnd(moveable, getDraggableEvent(e)); + }, + dragGroupCondition: function (moveable, e) { + var _a; + + var props = moveable.props; + var target = (_a = e.inputEvent) === null || _a === void 0 ? void 0 : _a.target; + + if (!props.edgeDraggable || !target) { + return false; + } + + return !props.draggable && hasClass(target, prefix("direction")) && hasClass(target, prefix("line")); + }, + dragGroupStart: function (moveable, e) { + return Draggable.dragGroupStart(moveable, getDraggableEvent(e)); + }, + dragGroup: function (moveable, e) { + return Draggable.dragGroup(moveable, getDraggableEvent(e)); + }, + dragGroupEnd: function (moveable, e) { + return Draggable.dragGroupEnd(moveable, getDraggableEvent(e)); + }, + unset: function (moveable) { + return Draggable.unset(moveable); + } + }); + /** + * Whether to move by dragging the edge line (default: false) + * @name Moveable.Draggable#edgeDraggable + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * draggable: true, + * edgeDraggable: false, + * }); + * + * moveable.edgeDraggable = true; + */ + + var IndividualGroupable = { + name: "individualGroupable", + props: ["individualGroupable", "individualGroupableProps"], + events: [] + }; + var MOVEABLE_ABLES = [BeforeRenderable, Default, Snappable, Pinchable, Draggable, edgeDraggable, Resizable, Scalable, Warpable, Rotatable, Scrollable, Padding, Origin, OriginDraggable, Clippable, Roundable, Groupable, IndividualGroupable, Clickable, DragArea, Renderable]; + var MOVEABLE_EVENTS = /*#__PURE__*/MOVEABLE_ABLES.reduce(function (current, able) { + (able.events || []).forEach(function (name) { + pushSet(current, name); + }); + return current; + }, []); + var MOVEABLE_PROPS = /*#__PURE__*/MOVEABLE_ABLES.reduce(function (current, able) { + (able.props || []).forEach(function (name) { + pushSet(current, name); + }); + return current; + }, []); + + function solveConstantsDistance(_a, pos) { + var _b = __read(_a, 3), + a = _b[0], + b = _b[1], + c = _b[2]; + + return (a * pos[0] + b * pos[1] + c) / Math.sqrt(a * a + b * b); + } + + function solveC(_a, pos) { + var _b = __read(_a, 2), + a = _b[0], + b = _b[1]; // ax + by + c = 0 + // -ax -by; + + + return -a * pos[0] - b * pos[1]; + } + + function getMaxPos(poses, index) { + return Math.max.apply(Math, __spreadArray([], __read(poses.map(function (_a) { + var _b = __read(_a, 4), + pos1 = _b[0], + pos2 = _b[1], + pos3 = _b[2], + pos4 = _b[3]; + + return Math.max(pos1[index], pos2[index], pos3[index], pos4[index]); + })), false)); + } + + function getMinPos(poses, index) { + return Math.min.apply(Math, __spreadArray([], __read(poses.map(function (_a) { + var _b = __read(_a, 4), + pos1 = _b[0], + pos2 = _b[1], + pos3 = _b[2], + pos4 = _b[3]; + + return Math.min(pos1[index], pos2[index], pos3[index], pos4[index]); + })), false)); + } + + function getGroupRect(parentPoses, rotation) { + var _a, _b, _c; + + var pos1 = [0, 0]; + var pos2 = [0, 0]; + var pos3 = [0, 0]; + var pos4 = [0, 0]; + var width = 0; + var height = 0; + + if (!parentPoses.length) { + return { + pos1: pos1, + pos2: pos2, + pos3: pos3, + pos4: pos4, + minX: 0, + minY: 0, + maxX: 0, + maxY: 0, + width: width, + height: height, + rotation: rotation + }; + } + + var fixedRotation = throttle(rotation, TINY_NUM); + + if (fixedRotation % 90) { + var rad = fixedRotation / 180 * Math.PI; + var a1_1 = Math.tan(rad); + var a2_1 = -1 / a1_1; // ax = y // -ax + y = 0 // 0 => 1 + // -ax = y // ax + y = 0 // 0 => 3 + + var a1MinMax_1 = [MAX_NUM, MIN_NUM]; + var a1MinMaxPos_1 = [[0, 0], [0, 0]]; + var a2MinMax_1 = [MAX_NUM, MIN_NUM]; + var a2MinMaxPos_1 = [[0, 0], [0, 0]]; + parentPoses.forEach(function (poses) { + poses.forEach(function (pos) { + // const b1 = pos[1] - a1 * pos[0]; + // const b2 = pos[1] - a2 * pos[0]; + var a1Dist = solveConstantsDistance([-a1_1, 1, 0], pos); + var a2Dist = solveConstantsDistance([-a2_1, 1, 0], pos); + + if (a1MinMax_1[0] > a1Dist) { + a1MinMaxPos_1[0] = pos; + a1MinMax_1[0] = a1Dist; + } + + if (a1MinMax_1[1] < a1Dist) { + a1MinMaxPos_1[1] = pos; + a1MinMax_1[1] = a1Dist; + } + + if (a2MinMax_1[0] > a2Dist) { + a2MinMaxPos_1[0] = pos; + a2MinMax_1[0] = a2Dist; + } + + if (a2MinMax_1[1] < a2Dist) { + a2MinMaxPos_1[1] = pos; + a2MinMax_1[1] = a2Dist; + } + }); + }); + + var _d = __read(a1MinMaxPos_1, 2), + a1MinPos = _d[0], + a1MaxPos = _d[1]; + + var _e = __read(a2MinMaxPos_1, 2), + a2MinPos = _e[0], + a2MaxPos = _e[1]; + + var minHorizontalLine = [-a1_1, 1, solveC([-a1_1, 1], a1MinPos)]; + var maxHorizontalLine = [-a1_1, 1, solveC([-a1_1, 1], a1MaxPos)]; + var minVerticalLine = [-a2_1, 1, solveC([-a2_1, 1], a2MinPos)]; + var maxVerticalLine = [-a2_1, 1, solveC([-a2_1, 1], a2MaxPos)]; + _a = __read([[minHorizontalLine, minVerticalLine], [minHorizontalLine, maxVerticalLine], [maxHorizontalLine, minVerticalLine], [maxHorizontalLine, maxVerticalLine]].map(function (_a) { + var _b = __read(_a, 2), + line1 = _b[0], + line2 = _b[1]; + + return getIntersectionPointsByConstants(line1, line2)[0]; + }), 4), pos1 = _a[0], pos2 = _a[1], pos3 = _a[2], pos4 = _a[3]; + width = a2MinMax_1[1] - a2MinMax_1[0]; + height = a1MinMax_1[1] - a1MinMax_1[0]; + } else { + var minX_1 = getMinPos(parentPoses, 0); + var minY_1 = getMinPos(parentPoses, 1); + var maxX_1 = getMaxPos(parentPoses, 0); + var maxY_1 = getMaxPos(parentPoses, 1); + pos1 = [minX_1, minY_1]; + pos2 = [maxX_1, minY_1]; + pos3 = [minX_1, maxY_1]; + pos4 = [maxX_1, maxY_1]; + width = maxX_1 - minX_1; + height = maxY_1 - minY_1; + + if (fixedRotation % 180) { + // 0 + // 1 2 + // 3 4 + // 90 + // 3 1 + // 4 2 + // 180 + // 4 3 + // 2 1 + // 270 + // 2 4 + // 1 3 + // 1, 2, 3,4 = 3 1 4 2 + var changedX = [pos3, pos1, pos4, pos2]; + _b = __read(changedX, 4), pos1 = _b[0], pos2 = _b[1], pos3 = _b[2], pos4 = _b[3]; + width = maxY_1 - minY_1; + height = maxX_1 - minX_1; + } + } + + if (fixedRotation % 360 > 180) { + // 1 2 4 3 + // 3 4 2 1 + var changedX = [pos4, pos3, pos2, pos1]; + _c = __read(changedX, 4), pos1 = _c[0], pos2 = _c[1], pos3 = _c[2], pos4 = _c[3]; + } + + var _f = getMinMaxs([pos1, pos2, pos3, pos4]), + minX = _f.minX, + minY = _f.minY, + maxX = _f.maxX, + maxY = _f.maxY; + + return { + pos1: pos1, + pos2: pos2, + pos3: pos3, + pos4: pos4, + width: width, + height: height, + minX: minX, + minY: minY, + maxX: maxX, + maxY: maxY, + rotation: rotation + }; + } + + function findMoveableGroups(moveables, childTargetGroups) { + var groups = childTargetGroups.map(function (targetGroup) { + if (isArray(targetGroup)) { + var childMoveableGroups = findMoveableGroups(moveables, targetGroup); + var length_1 = childMoveableGroups.length; + + if (length_1 > 1) { + return childMoveableGroups; + } else if (length_1 === 1) { + return childMoveableGroups[0]; + } else { + return null; + } + } else { + var checked = find$1(moveables, function (_a) { + var manager = _a.manager; + return manager.props.target === targetGroup; + }); + + if (checked) { + checked.finded = true; + return checked.manager; + } + + return null; + } + }).filter(Boolean); + + if (groups.length === 1 && isArray(groups[0])) { + return groups[0]; + } + + return groups; + } + /** + * @namespace Moveable.Group + * @description You can make targets moveable. + */ + + + var MoveableGroup = /*#__PURE__*/function (_super) { + __extends(MoveableGroup, _super); + + function MoveableGroup() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.differ = new ChildrenDiffer(); + _this.moveables = []; + _this.transformOrigin = "50% 50%"; + _this.renderGroupRects = []; + _this._targetGroups = []; + _this._hasFirstTargets = false; + return _this; + } + + var __proto = MoveableGroup.prototype; + + __proto.componentDidMount = function () { + _super.prototype.componentDidMount.call(this); + }; + + __proto.checkUpdate = function () { + this._isPropTargetChanged = false; + this.updateAbles(); + }; + + __proto.getTargets = function () { + return this.props.targets; + }; + + __proto.updateRect = function (type, isTarget, isSetState) { + var _a; + + if (isSetState === void 0) { + isSetState = true; + } + + var state = this.state; + + if (!this.controlBox || state.isPersisted) { + return; + } + + setStoreCache(true); + this.moveables.forEach(function (moveable) { + moveable.updateRect(type, false, false); + }); + var props = this.props; + var moveables = this.moveables; + var target = state.target || props.target; + var checkeds = moveables.map(function (moveable) { + return { + finded: false, + manager: moveable + }; + }); + var targetGroups = this.props.targetGroups || []; + var moveableGroups = findMoveableGroups(checkeds, targetGroups); + var useDefaultGroupRotate = props.useDefaultGroupRotate; + moveableGroups.push.apply(moveableGroups, __spreadArray([], __read(checkeds.filter(function (_a) { + var finded = _a.finded; + return !finded; + }).map(function (_a) { + var manager = _a.manager; + return manager; + })), false)); + var renderGroupRects = []; + var isReset = !isTarget || type !== "" && props.updateGroup; + var defaultGroupRotate = props.defaultGroupRotate || 0; + + if (!this._hasFirstTargets) { + var persistedRoatation = (_a = props.persistData) === null || _a === void 0 ? void 0 : _a.rotation; + + if (persistedRoatation != null) { + defaultGroupRotate = persistedRoatation; + } + } + + function getMoveableGroupRect(group, parentRotation, isRoot) { + var posesRotations = group.map(function (moveable) { + if (isArray(moveable)) { + var rect = getMoveableGroupRect(moveable, parentRotation); + var poses = [rect.pos1, rect.pos2, rect.pos3, rect.pos4]; + renderGroupRects.push(rect); + return { + poses: poses, + rotation: rect.rotation + }; + } else { + return { + poses: getAbsolutePosesByState(moveable.state), + rotation: moveable.getRotation() + }; + } + }); + var rotations = posesRotations.map(function (_a) { + var rotation = _a.rotation; + return rotation; + }); + var groupRotation = 0; + var firstRotation = rotations[0]; + var isSameRotation = rotations.every(function (nextRotation) { + return Math.abs(firstRotation - nextRotation) < 0.1; + }); + + if (isReset) { + groupRotation = !useDefaultGroupRotate && isSameRotation ? firstRotation : defaultGroupRotate; + } else { + groupRotation = !useDefaultGroupRotate && !isRoot && isSameRotation ? firstRotation : parentRotation; + } + + var groupPoses = posesRotations.map(function (_a) { + var poses = _a.poses; + return poses; + }); + var groupRect = getGroupRect(groupPoses, groupRotation); + return groupRect; + } + + var rootGroupRect = getMoveableGroupRect(moveableGroups, this.rotation, true); + + if (isReset) { + // reset rotataion + this.rotation = rootGroupRect.rotation; + this.transformOrigin = props.defaultGroupOrigin || "50% 50%"; + this.scale = [1, 1]; + } + + this._targetGroups = targetGroups; + this.renderGroupRects = renderGroupRects; + var transformOrigin = this.transformOrigin; + var rotation = this.rotation; + var scale = this.scale; + var width = rootGroupRect.width, + height = rootGroupRect.height, + minX = rootGroupRect.minX, + minY = rootGroupRect.minY; + var posesInfo = rotatePosesInfo([[0, 0], [width, 0], [0, height], [width, height]], convertTransformOriginArray(transformOrigin, width, height), this.rotation / 180 * Math.PI); + + var _b = getMinMaxs(posesInfo.result), + deltaX = _b.minX, + deltaY = _b.minY; + + var rotateScale = " rotate(".concat(rotation, "deg)") + " scale(".concat(sign(scale[0]), ", ").concat(sign(scale[1]), ")"); + var transform = "translate(".concat(-deltaX, "px, ").concat(-deltaY, "px)").concat(rotateScale); + this.controlBox.style.transform = "translate3d(".concat(minX, "px, ").concat(minY, "px, ").concat(this.props.translateZ || 0, ")"); + target.style.cssText += "left:0px;top:0px;" + "transform-origin:".concat(transformOrigin, ";") + "width:".concat(width, "px;height:").concat(height, "px;") + "transform: ".concat(transform); + state.width = width; + state.height = height; + var container = this.getContainer(); + var info = getMoveableTargetInfo(this.controlBox, target, this.controlBox, this.getContainer(), this._rootContainer || container, []); + var pos = [info.left, info.top]; + + var _c = __read(getAbsolutePosesByState(info), 4), + pos1 = _c[0], + pos2 = _c[1], + pos3 = _c[2], + pos4 = _c[3]; // info.left + info.pos(1 ~ 4) + + + var minPos = getMinMaxs([pos1, pos2, pos3, pos4]); + var delta = [minPos.minX, minPos.minY]; + var direction = sign(scale[0] * scale[1]); + info.pos1 = minus(pos1, delta); + info.pos2 = minus(pos2, delta); + info.pos3 = minus(pos3, delta); + info.pos4 = minus(pos4, delta); // info.left = info.left + delta[0]; + // info.top = info.top + delta[1]; + + info.left = minX - info.left + delta[0]; + info.top = minY - info.top + delta[1]; + info.origin = minus(plus(pos, info.origin), delta); + info.beforeOrigin = minus(plus(pos, info.beforeOrigin), delta); + info.originalBeforeOrigin = plus(pos, info.originalBeforeOrigin); + info.transformOrigin = minus(plus(pos, info.transformOrigin), delta); + target.style.transform = "translate(".concat(-deltaX - delta[0], "px, ").concat(-deltaY - delta[1], "px)") + rotateScale; + setStoreCache(); + this.updateState(__assign(__assign({}, info), { + posDelta: delta, + direction: direction, + beforeDirection: direction + }), isSetState); + }; + + __proto.getRect = function () { + return __assign(__assign({}, _super.prototype.getRect.call(this)), { + children: this.moveables.map(function (child) { + return child.getRect(); + }) + }); + }; + + __proto.triggerEvent = function (name, e, isManager) { + if (isManager || name.indexOf("Group") > -1) { + return _super.prototype.triggerEvent.call(this, name, e); + } else { + this._emitter.trigger(name, e); + } + }; + + __proto.getRequestChildStyles = function () { + var styleNames = this.getEnabledAbles().reduce(function (names, able) { + var _a, _b; + + var ableStyleNames = (_b = (_a = able.requestChildStyle) === null || _a === void 0 ? void 0 : _a.call(able)) !== null && _b !== void 0 ? _b : []; + return __spreadArray(__spreadArray([], __read(names), false), __read(ableStyleNames), false); + }, []); + return styleNames; + }; + + __proto.getMoveables = function () { + return __spreadArray([], __read(this.moveables), false); + }; + + __proto.updateAbles = function () { + _super.prototype.updateAbles.call(this, __spreadArray(__spreadArray([], __read(this.props.ables), false), [Groupable], false), "Group"); + }; + + __proto._updateTargets = function () { + _super.prototype._updateTargets.call(this); + + this._originalDragTarget = this.props.dragTarget || this.areaElement; + this._dragTarget = getRefTarget(this._originalDragTarget, true); + }; + + __proto._updateEvents = function () { + var state = this.state; + var props = this.props; + var prevTarget = this._prevDragTarget; + var nextTarget = props.dragTarget || this.areaElement; + var targets = props.targets; + + var _a = this.differ.update(targets), + added = _a.added, + changed = _a.changed, + removed = _a.removed; + + var isTargetChanged = added.length || removed.length; + + if (isTargetChanged || this._prevOriginalDragTarget !== this._originalDragTarget) { + unsetGesto(this, false); + unsetGesto(this, true); + this.updateState({ + gestos: {} + }); + } + + if (prevTarget !== nextTarget) { + state.target = null; + } + + if (!state.target) { + state.target = this.areaElement; + this.controlBox.style.display = "block"; + } + + if (state.target) { + if (!this.targetGesto) { + this.targetGesto = getTargetAbleGesto(this, this._dragTarget, "Group"); + } + + if (!this.controlGesto) { + this.controlGesto = getAbleGesto(this, this.controlBox, "controlAbles", "GroupControl"); + } + } + + var isContainerChanged = !equals(state.container, props.container); + + if (isContainerChanged) { + state.container = props.container; + } + + if (isContainerChanged || isTargetChanged || this.transformOrigin !== (props.defaultGroupOrigin || "50% 50%") || changed.length || targets.length && !isDeepArrayEquals(this._targetGroups, props.targetGroups || [])) { + this.updateRect(); + this._hasFirstTargets = true; + } + + this._isPropTargetChanged = !!isTargetChanged; + }; + + __proto._updateObserver = function () {}; + + MoveableGroup.defaultProps = __assign(__assign({}, MoveableManager$1.defaultProps), { + transformOrigin: ["50%", "50%"], + groupable: true, + dragArea: true, + keepRatio: true, + targets: [], + defaultGroupRotate: 0, + defaultGroupOrigin: "50% 50%" + }); + return MoveableGroup; + }(MoveableManager$1); + /** + * @namespace Moveable.IndividualGroup + * @description Create targets individually, not as a group.Create targets individually, not as a group. + */ + + + var MoveableIndividualGroup = /*#__PURE__*/function (_super) { + __extends(MoveableIndividualGroup, _super); + + function MoveableIndividualGroup() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.moveables = []; + return _this; + } + + var __proto = MoveableIndividualGroup.prototype; + + __proto.render = function () { + var _this = this; + + var _a; + + var props = this.props; + var cspNonce = props.cspNonce, + ControlBoxElement = props.cssStyled, + persistData = props.persistData; + var targets = props.targets || []; + var length = targets.length; + var canPersist = this.isUnmounted || !length; + var persistDatChildren = (_a = persistData === null || persistData === void 0 ? void 0 : persistData.children) !== null && _a !== void 0 ? _a : []; + + if (canPersist && !length && persistDatChildren.length) { + targets = persistDatChildren.map(function () { + return null; + }); + } else if (!canPersist) { + persistDatChildren = []; + } + + return createElement(ControlBoxElement, { + cspNonce: cspNonce, + ref: ref(this, "controlBox"), + className: prefix("control-box") + }, targets.map(function (target, i) { + var _a, _b; + + var individualProps = (_b = (_a = props.individualGroupableProps) === null || _a === void 0 ? void 0 : _a.call(props, target, i)) !== null && _b !== void 0 ? _b : {}; + return createElement(MoveableManager$1, __assign({ + key: "moveable" + i, + ref: refs(_this, "moveables", i) + }, props, individualProps, { + target: target, + wrapperMoveable: _this, + isWrapperMounted: _this.isMoveableMounted, + persistData: persistDatChildren[i] + })); + })); + }; + + __proto.componentDidMount = function () {}; + + __proto.componentDidUpdate = function () {}; + + __proto.getTargets = function () { + return this.props.targets; + }; + + __proto.updateRect = function (type, isTarget, isSetState) { + if (isSetState === void 0) { + isSetState = true; + } + + setStoreCache(true); + this.moveables.forEach(function (moveable) { + moveable.updateRect(type, isTarget, isSetState); + }); + setStoreCache(); + }; + + __proto.getRect = function () { + return __assign(__assign({}, _super.prototype.getRect.call(this)), { + children: this.moveables.map(function (child) { + return child.getRect(); + }) + }); + }; + + __proto.request = function (ableName, param, isInstant) { + if (param === void 0) { + param = {}; + } + + var results = this.moveables.map(function (m) { + return m.request(ableName, __assign(__assign({}, param), { + isInstant: false + }), false); + }); + var requestInstant = isInstant || param.isInstant; + var requester = { + request: function (ableParam) { + results.forEach(function (r) { + return r.request(ableParam); + }); + return this; + }, + requestEnd: function () { + results.forEach(function (r) { + return r.requestEnd(); + }); + return this; + } + }; + return requestInstant ? requester.request(param).requestEnd() : requester; + }; + + __proto.dragStart = function (e) { + var inputTarget = e.target; + var childMoveable = find$1(this.moveables, function (child) { + var target = child.getTargets()[0]; + var controlBoxElement = child.getControlBoxElement(); + var dragElement = child.getDragElement(); + + if (!target || !dragElement) { + return false; + } + + return dragElement === inputTarget || dragElement.contains(inputTarget) || dragElement !== target && target === inputTarget || target.contains(inputTarget) || controlBoxElement === inputTarget || controlBoxElement.contains(inputTarget); + }); + + if (childMoveable) { + childMoveable.dragStart(e); + } + + return this; + }; + + __proto.hitTest = function () { + return 0; + }; + + __proto.isInside = function () { + return false; + }; + + __proto.isDragging = function () { + return false; + }; + + __proto.getDragElement = function () { + return null; + }; + + __proto.getMoveables = function () { + return __spreadArray([], __read(this.moveables), false); + }; + + __proto.updateRenderPoses = function () {}; + + __proto.checkUpdate = function () {}; + + __proto.triggerEvent = function () {}; + + __proto.updateAbles = function () {}; + + __proto._updateEvents = function () {}; + + __proto._updateObserver = function () {}; + + return MoveableIndividualGroup; + }(MoveableManager$1); + + function getElementTargets(refTargets, selectorMap) { + var elementTargets = []; + refTargets.forEach(function (target) { + if (!target) { + return; + } + + if (isString(target)) { + if (selectorMap[target]) { + elementTargets.push.apply(elementTargets, __spreadArray([], __read(selectorMap[target]), false)); + } + + return; + } + + if (isArray(target)) { + elementTargets.push.apply(elementTargets, __spreadArray([], __read(getElementTargets(target, selectorMap)), false)); + } else { + elementTargets.push(target); + } + }); + return elementTargets; + } + + function getTargetGroups(refTargets, selectorMap) { + var targetGroups = []; + refTargets.forEach(function (target) { + if (!target) { + return; + } + + if (isString(target)) { + if (selectorMap[target]) { + targetGroups.push.apply(targetGroups, __spreadArray([], __read(selectorMap[target]), false)); + } + + return; + } + + if (isArray(target)) { + targetGroups.push(getTargetGroups(target, selectorMap)); + } else { + targetGroups.push(target); + } + }); + return targetGroups; + } + + function compareRefTargets(prevRefTargets, nextRefTargets) { + return prevRefTargets.length !== nextRefTargets.length || prevRefTargets.some(function (target, i) { + var nextTarget = nextRefTargets[i]; + + if (!target && !nextTarget) { + return false; + } else if (target != nextTarget) { + if (isArray(target) && isArray(nextTarget)) { + return compareRefTargets(target, nextTarget); + } + + return true; + } + + return false; + }); + } + + var InitialMoveable = /*#__PURE__*/function (_super) { + __extends(InitialMoveable, _super); + + function InitialMoveable() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.refTargets = []; + _this.selectorMap = {}; + _this._differ = new ChildrenDiffer(); + _this._elementTargets = []; + _this._tmpRefTargets = []; + _this._tmpSelectorMap = {}; + _this._onChangeTargets = null; + return _this; + } + + var __proto = InitialMoveable.prototype; + + InitialMoveable.makeStyled = function () { + var cssMap = {}; + var ables = this.getTotalAbles(); + ables.forEach(function (_a) { + var css = _a.css; + + if (!css) { + return; + } + + css.forEach(function (text) { + cssMap[text] = true; + }); + }); + var style = getKeys(cssMap).join("\n"); + this.defaultStyled = styled("div", prefixCSS(PREFIX, MOVEABLE_CSS + style)); + }; + + InitialMoveable.getTotalAbles = function () { + return __spreadArray([Default, Groupable, IndividualGroupable, DragArea], __read(this.defaultAbles), false); + }; + + __proto.render = function () { + var _a; + + var moveableContructor = this.constructor; + + if (!moveableContructor.defaultStyled) { + moveableContructor.makeStyled(); + } + + var _b = this.props, + userAbles = _b.ables, + userProps = _b.props, + props = __rest(_b, ["ables", "props"]); + + var _c = __read(this._updateRefs(true), 2), + refTargets = _c[0], + nextSelectorMap = _c[1]; + + var elementTargets = getElementTargets(refTargets, nextSelectorMap); + var isGroup = elementTargets.length > 1; + var totalAbles = moveableContructor.getTotalAbles(); + + var ables = __spreadArray(__spreadArray([], __read(totalAbles), false), __read(userAbles || []), false); + + var nextProps = __assign(__assign(__assign({}, props), userProps || {}), { + ables: ables, + cssStyled: moveableContructor.defaultStyled, + customStyledMap: moveableContructor.customStyledMap + }); + + this._elementTargets = elementTargets; + var firstRenderState = null; + var prevMoveable = this.moveable; + var persistData = props.persistData; + + if (persistData === null || persistData === void 0 ? void 0 : persistData.children) { + isGroup = true; + } // Even one child is treated as a group if individualGroupable is enabled. #867 + + + if (props.individualGroupable) { + return createElement(MoveableIndividualGroup, __assign({ + key: "individual-group", + ref: ref(this, "moveable") + }, nextProps, { + target: null, + targets: elementTargets + })); + } + + if (isGroup) { + var targetGroups = getTargetGroups(refTargets, nextSelectorMap); // manager + + if (prevMoveable && !prevMoveable.props.groupable && !prevMoveable.props.individualGroupable) { + var target = prevMoveable.props.target; + + if (target && elementTargets.indexOf(target) > -1) { + firstRenderState = __assign({}, prevMoveable.state); + } + } + + return createElement(MoveableGroup, __assign({ + key: "group", + ref: ref(this, "moveable") + }, nextProps, (_a = props.groupableProps) !== null && _a !== void 0 ? _a : {}, { + target: null, + targets: elementTargets, + targetGroups: targetGroups, + firstRenderState: firstRenderState + })); + } else { + var target_1 = elementTargets[0]; // manager + + if (prevMoveable && (prevMoveable.props.groupable || prevMoveable.props.individualGroupable)) { + var moveables = prevMoveable.moveables || []; + var prevTargetMoveable = find$1(moveables, function (mv) { + return mv.props.target === target_1; + }); + + if (prevTargetMoveable) { + firstRenderState = __assign({}, prevTargetMoveable.state); + } + } + + return createElement(MoveableManager$1, __assign({ + key: "single", + ref: ref(this, "moveable") + }, nextProps, { + target: target_1, + firstRenderState: firstRenderState + })); + } + }; + + __proto.componentDidMount = function () { + this._checkChangeTargets(); + }; + + __proto.componentDidUpdate = function () { + this._checkChangeTargets(); + }; + + __proto.componentWillUnmount = function () { + this.selectorMap = {}; + this.refTargets = []; + }; + /** + * Get targets set in moveable through target or targets of props. + * @method Moveable#getTargets + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: [targetRef, ".target", document.querySelectorAll(".target")], + * }); + * + * console.log(moveable.getTargets()); + */ + + + __proto.getTargets = function () { + var _a, _b; + + return (_b = (_a = this.moveable) === null || _a === void 0 ? void 0 : _a.getTargets()) !== null && _b !== void 0 ? _b : []; + }; + /** + * If the element list corresponding to the selector among the targets is changed, it is updated. + * @method Moveable#updateSelectors + * @example + * import Moveable from "moveable"; + * + * const moveable = new Moveable(document.body, { + * target: ".target", + * }); + * + * moveable.updateSelectors(); + */ + + + __proto.updateSelectors = function () { + this.selectorMap = {}; + + this._updateRefs(); + }; + /** + * User changes target and waits for target to change. + * @method Moveable#waitToChangeTarget + * @story combination-with-other-components--components-selecto + * @example + * document.querySelector(".target").addEventListener("mousedown", e => { + * moveable.waitToChangeTarget().then(() => { + * moveable.dragStart(e.currentTarget); + * }); + * moveable.target = e.currentTarget; + * }); + */ + + + __proto.waitToChangeTarget = function () { + // let resolvePromise: (e: OnChangeTarget) => void; + var _this = this; // this._onChangeTargets = () => { + // this._onChangeTargets = null; + // resolvePromise({ + // moveable: this.getManager(), + // targets: this._elementTargets, + // }); + // }; + // return new Promise(resolve => { + // resolvePromise = resolve; + // }); + + + var resolvePromise; + + this._onChangeTargets = function () { + _this._onChangeTargets = null; + resolvePromise(); + }; + + return new Promise(function (resolve) { + resolvePromise = resolve; + }); + }; + + __proto.waitToChangeTargets = function () { + return this.waitToChangeTarget(); + }; + + __proto.getManager = function () { + return this.moveable; + }; + + __proto.getMoveables = function () { + return this.moveable.getMoveables(); + }; + + __proto.getDragElement = function () { + return this.moveable.getDragElement(); + }; + + __proto._updateRefs = function (isRender) { + var prevRefTargets = this.refTargets; + var nextRefTargets = getRefTargets(this.props.target || this.props.targets); + var isBrowser = typeof document !== "undefined"; + var isUpdate = compareRefTargets(prevRefTargets, nextRefTargets); + var selectorMap = this.selectorMap; + var nextSelectorMap = {}; + this.refTargets.forEach(function updateSelectorMap(target) { + if (isString(target)) { + var selectorTarget = selectorMap[target]; + + if (selectorTarget) { + nextSelectorMap[target] = selectorMap[target]; + } else if (isBrowser) { + isUpdate = true; + nextSelectorMap[target] = [].slice.call(document.querySelectorAll(target)); + } + } else if (isArray(target)) { + target.forEach(updateSelectorMap); + } + }); + this._tmpRefTargets = nextRefTargets; + this._tmpSelectorMap = nextSelectorMap; + return [nextRefTargets, nextSelectorMap, !isRender && isUpdate]; + }; + + __proto._checkChangeTargets = function () { + var _a, _b, _c; + + this.refTargets = this._tmpRefTargets; + this.selectorMap = this._tmpSelectorMap; + + var _d = this._differ.update(this._elementTargets), + added = _d.added, + removed = _d.removed; + + var isTargetChanged = added.length || removed.length; + + if (isTargetChanged) { + (_b = (_a = this.props).onChangeTargets) === null || _b === void 0 ? void 0 : _b.call(_a, { + moveable: this.moveable, + targets: this._elementTargets + }); + (_c = this._onChangeTargets) === null || _c === void 0 ? void 0 : _c.call(this); + } + + var _e = __read(this._updateRefs(), 3), + refTargets = _e[0], + selectorMap = _e[1], + isUpdate = _e[2]; + + this.refTargets = refTargets; + this.selectorMap = selectorMap; + + if (isUpdate) { + this.forceUpdate(); + } + }; + + InitialMoveable.defaultAbles = []; + InitialMoveable.customStyledMap = {}; + InitialMoveable.defaultStyled = null; + + __decorate([withMethods(MOVEABLE_METHODS)], InitialMoveable.prototype, "moveable", void 0); + + return InitialMoveable; + }(PureComponent); + + var Moveable$1 = /*#__PURE__*/function (_super) { + __extends(Moveable, _super); + + function Moveable() { + return _super !== null && _super.apply(this, arguments) || this; + } + + Moveable.defaultAbles = MOVEABLE_ABLES; + return Moveable; + }(InitialMoveable); + + var InnerMoveable = /*#__PURE__*/function (_super) { + __extends$5(InnerMoveable, _super); + + function InnerMoveable(props) { + var _this = _super.call(this, props) || this; + + _this.state = {}; + _this.state = _this.props; + return _this; + } + + var __proto = InnerMoveable.prototype; + + __proto.render = function () { + return createElement(Moveable$1, __assign$7({ + ref: ref(this, "moveable") + }, this.state)); + }; + + return InnerMoveable; + }(Component); + + var PROPERTIES = MOVEABLE_PROPS; + var METHODS = MOVEABLE_METHODS; + var EVENTS = MOVEABLE_EVENTS; + + /** + * Moveable is Draggable! Resizable! Scalable! Rotatable! + * @sort 1 + * @alias Moveable + * @extends EventEmitter + */ + + var MoveableManager = /*#__PURE__*/function (_super) { + __extends$5(MoveableManager, _super); + /** + * + */ + + + function MoveableManager(parentElement, options) { + if (options === void 0) { + options = {}; + } + + var _this = _super.call(this) || this; + + _this.containerProvider = null; + _this.selfElement = null; + _this._warp = false; + + var nextOptions = __assign$7({}, options); + + var events = {}; + EVENTS.forEach(function (name) { + events[camelize("on ".concat(name))] = function (e) { + return _this.trigger(name, e); + }; + }); + var selfElement; + + if (options.warpSelf) { + delete options.warpSelf; + _this._warp = true; + selfElement = parentElement; + } else { + selfElement = getDocument(parentElement).createElement("div"); + parentElement.appendChild(selfElement); + } + + _this.containerProvider = renderSelf(createElement(InnerMoveable, __assign$7({ + ref: ref(_this, "innerMoveable") + }, nextOptions, events)), selfElement); + _this.selfElement = selfElement; + var target = nextOptions.target; + + if (isArray(target) && target.length > 1) { + _this.updateRect(); + } + + return _this; + } + + var __proto = MoveableManager.prototype; + + __proto.setState = function (state, callback) { + this.innerMoveable.setState(state, callback); + }; + + __proto.forceUpdate = function (callback) { + this.innerMoveable.forceUpdate(callback); + }; + + __proto.dragStart = function (e) { + var innerMoveable = this.innerMoveable; + + if (innerMoveable.$_timer) { + this.forceUpdate(); + } + + this.getMoveable().dragStart(e); + }; + + __proto.destroy = function () { + var _a; + + var selfElement = this.selfElement; + renderSelf(null, selfElement, this.containerProvider); + + if (!this._warp) { + (_a = selfElement === null || selfElement === void 0 ? void 0 : selfElement.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(selfElement); + } + + this.containerProvider = null; + this.off(); + this.selfElement = null; + this.innerMoveable = null; + }; + + __proto.getMoveable = function () { + return this.innerMoveable.moveable; + }; + + MoveableManager = __decorate$1([Properties(METHODS, function (prototype, property) { + if (prototype[property]) { + return; + } + + prototype[property] = function () { + var args = []; + + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + + var self = this.getMoveable(); + + if (!self || !self[property]) { + return; + } + + return self[property].apply(self, args); + }; + }), Properties(PROPERTIES, function (prototype, property) { + Object.defineProperty(prototype, property, { + get: function () { + return this.getMoveable().props[property]; + }, + set: function (value) { + var _a; + + this.setState((_a = {}, _a[property] = value, _a)); + }, + enumerable: true, + configurable: true + }); + })], MoveableManager); + return MoveableManager; + }(EventEmitter$1); + + var Moveable = /*#__PURE__*/function (_super) { + __extends$5(Moveable, _super); + + function Moveable() { + return _super !== null && _super.apply(this, arguments) || this; + } + + return Moveable; + }(MoveableManager); + + function getElementInfo(target, container, rootContainer) { + return getElementInfo$1(target, container, rootContainer); + } + function makeAble(name, able) { + return makeAble$1(name, able); + } + + var modules = { + __proto__: null, + EVENTS: EVENTS, + METHODS: METHODS, + PROPERTIES: PROPERTIES, + default: Moveable, + getElementInfo: getElementInfo, + makeAble: makeAble + }; + + for (var name_1 in modules) { + Moveable[name_1] = modules[name_1]; + } + + return Moveable; + +})); +//# sourceMappingURL=moveable.js.map diff --git a/release/0.52.0/dist/moveable.js.map b/release/0.52.0/dist/moveable.js.map new file mode 100644 index 000000000..9c09d71f8 --- /dev/null +++ b/release/0.52.0/dist/moveable.js.map @@ -0,0 +1 @@ +{"version":3,"file":"moveable.js","sources":["../../react-moveable/dist/moveable.esm.js","../src/InnerMoveable.tsx","../src/consts.ts","../src/MoveableManager.tsx","../src/Moveable.tsx","../src/utils.ts","../src/index.umd.ts"],"sourcesContent":["/*\nCopyright (c) 2019 Daybrush\nname: react-moveable\nlicense: MIT\nauthor: Daybrush\nrepository: https://github.com/daybrush/moveable/blob/master/packages/react-moveable\nversion: 0.55.0\n*/\nimport getAgent from '@egjs/agent';\nimport { prefixNames, ref, refs, prefixCSS, withMethods } from 'framework-utils';\nimport { findIndex, find, isArray, splitSpace, splitUnit, dot, isString, getDocumentElement, getDocumentBody, getWindow, throttle, getKeys, getRad, TINY_NUM as TINY_NUM$1, average, getDist as getDist$1, throttleArray, calculateBoundSize, convertUnitSize, isNumber, hasClass, isObject, flat as flat$1, decamelize, isNode, isFunction, isWindow, counter, isUndefined, between, addClass, requestAnimationFrame, removeClass, splitBracket, splitComma, cancelAnimationFrame, pushSet } from '@daybrush/utils';\nimport { minus, invert, convertPositionMatrix, plus, calculate, fromTranslation, multiply, convertDimension, createScaleMatrix, convertCSStoMatrix, createIdentityMatrix, createOriginMatrix, createRotateMatrix, rotate, getOrigin, multiplies, convertMatrixtoCSS, ignoreDimension, createWarpMatrix } from '@scena/matrix';\nimport { parse, parseMat, toMat, calculateMatrixDist } from 'css-to-mat';\nimport ChildrenDiffer, { diff } from '@egjs/children-differ';\nimport DragScroll from '@scena/dragscroll';\nimport { getMinMaxs, fitPoints, getOverlapSize, getAreaSize, isInside, getIntersectionPointsByConstants } from 'overlap-area';\nimport * as React from 'react';\nimport { createElement } from 'react';\nimport Gesto from 'gesto';\nimport { styled } from 'react-css-styled';\nimport EventEmitter from '@scena/event-emitter';\nimport { diff as diff$1 } from '@egjs/list-differ';\n\n/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nfunction __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nfunction __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nfunction __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nfunction __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\n\nfunction makeAble(name, able) {\r\n return __assign({ events: [], props: [], name: name }, able);\r\n}\n\nvar DIRECTIONS4 = [\"n\", \"w\", \"s\", \"e\"];\r\nvar DIRECTIONS = [\"n\", \"w\", \"s\", \"e\", \"nw\", \"ne\", \"sw\", \"se\"];\r\nfunction getSVGCursor(scale, degree) {\r\n return \"data:image/svg+xml;utf8,\");\r\n}\r\nfunction getCursorCSS(degree) {\r\n var x1 = getSVGCursor(1, degree);\r\n // const x2 = getSVGCursor(2, degree);\r\n var degree45 = (Math.round(degree / 45) * 45) % 180;\r\n var defaultCursor = \"ns-resize\";\r\n if (degree45 === 135) {\r\n defaultCursor = \"nwse-resize\";\r\n }\r\n else if (degree45 === 45) {\r\n defaultCursor = \"nesw-resize\";\r\n }\r\n else if (degree45 === 90) {\r\n defaultCursor = \"ew-resize\";\r\n }\r\n // tslint:disable-next-line: max-line-length\r\n return \"cursor:\".concat(defaultCursor, \";cursor: url('\").concat(x1, \"') 16 16, \").concat(defaultCursor, \";\");\r\n}\r\nvar agent = getAgent();\r\nvar IS_WEBKIT = agent.browser.webkit;\r\nvar IS_WEBKIT605 = IS_WEBKIT && (function () {\r\n var navi = typeof window === \"undefined\" ? { userAgent: \"\" } : window.navigator;\r\n var res = /applewebkit\\/([^\\s]+)/g.exec(navi.userAgent.toLowerCase());\r\n return res ? parseFloat(res[1]) < 605 : false;\r\n})();\r\nvar browserName = agent.browser.name;\r\nvar browserVersion = parseInt(agent.browser.version, 10);\r\nvar IS_CHROME = browserName === \"chrome\";\r\nvar IS_CHROMIUM = agent.browser.chromium;\r\nvar chromiumVersion = parseInt(agent.browser.chromiumVersion, 10) || 0;\r\nvar IS_CHROMIUM109 = (IS_CHROME && browserVersion >= 109)\r\n || (IS_CHROMIUM && chromiumVersion >= 109);\r\nvar IS_FIREFOX = browserName === \"firefox\";\r\nvar IS_SAFARI_ABOVE15 = parseInt(agent.browser.webkitVersion, 10) >= 612\r\n || browserVersion >= 15;\r\nvar PREFIX = \"moveable-\";\r\nvar directionCSS = DIRECTIONS.map(function (dir) {\r\n var top = \"\";\r\n var left = \"\";\r\n var originX = \"center\";\r\n var originY = \"center\";\r\n var offset = \"calc(var(--moveable-control-padding, 20) * -1px)\";\r\n if (dir.indexOf(\"n\") > -1) {\r\n top = \"top: \".concat(offset, \";\");\r\n originY = \"bottom\";\r\n }\r\n if (dir.indexOf(\"s\") > -1) {\r\n top = \"top: 0px;\";\r\n originY = \"top\";\r\n }\r\n if (dir.indexOf(\"w\") > -1) {\r\n left = \"left: \".concat(offset, \";\");\r\n originX = \"right\";\r\n }\r\n if (dir.indexOf(\"e\") > -1) {\r\n left = \"left: 0px;\";\r\n originX = \"left\";\r\n }\r\n return \".around-control[data-direction*=\\\"\".concat(dir, \"\\\"] {\\n \").concat(left).concat(top, \"\\n transform-origin: \").concat(originX, \" \").concat(originY, \";\\n }\");\r\n}).join(\"\\n\");\r\nvar MOVEABLE_CSS = \"\\n{\\nposition: absolute;\\nwidth: 1px;\\nheight: 1px;\\nleft: 0;\\ntop: 0;\\nz-index: 3000;\\n--moveable-color: #4af;\\n--zoom: 1;\\n--zoompx: 1px;\\n--moveable-line-padding: 0;\\n--moveable-control-padding: 0;\\nwill-change: transform;\\noutline: 1px solid transparent;\\n}\\n.control-box {\\nz-index: 0;\\n}\\n.line, .control {\\nposition: absolute;\\nleft: 0;\\ntop: 0;\\nwill-change: transform;\\n}\\n.control {\\nwidth: 14px;\\nheight: 14px;\\nborder-radius: 50%;\\nborder: 2px solid #fff;\\nbox-sizing: border-box;\\nbackground: #4af;\\nbackground: var(--moveable-color);\\nmargin-top: -7px;\\nmargin-left: -7px;\\nborder: 2px solid #fff;\\nz-index: 10;\\n}\\n.around-control {\\nposition: absolute;\\nwill-change: transform;\\nwidth: calc(var(--moveable-control-padding, 20) * 1px);\\nheight: calc(var(--moveable-control-padding, 20) * 1px);\\nleft: calc(var(--moveable-control-padding, 20) * -0.5px);\\ntop: calc(var(--moveable-control-padding, 20) * -0.5px);\\nbox-sizing: border-box;\\nbackground: transparent;\\nz-index: 8;\\ncursor: alias;\\ntransform-origin: center center;\\n}\\n\".concat(directionCSS, \"\\n.padding {\\nposition: absolute;\\ntop: 0px;\\nleft: 0px;\\nwidth: 100px;\\nheight: 100px;\\ntransform-origin: 0 0;\\n}\\n.line {\\nwidth: 1px;\\nheight: 1px;\\nbackground: #4af;\\nbackground: var(--moveable-color);\\ntransform-origin: 0px 50%;\\n}\\n.line.edge {\\nz-index: 1;\\nbackground: transparent;\\n}\\n.line.dashed {\\nbox-sizing: border-box;\\nbackground: transparent;\\n}\\n.line.dashed.horizontal {\\nborder-top: 1px dashed #4af;\\nborder-top-color: #4af;\\nborder-top-color: var(--moveable-color);\\n}\\n.line.dashed.vertical {\\nborder-left: 1px dashed #4af;\\nborder-left-color: #4af;\\nborder-left-color: var(--moveable-color);\\n}\\n.line.vertical {\\ntransform: translateX(-50%);\\n}\\n.line.horizontal {\\ntransform: translateY(-50%);\\n}\\n.line.vertical.bold {\\nwidth: 2px;\\n}\\n.line.horizontal.bold {\\nheight: 2px;\\n}\\n\\n.control.origin {\\nborder-color: #f55;\\nbackground: #fff;\\nwidth: 12px;\\nheight: 12px;\\nmargin-top: -6px;\\nmargin-left: -6px;\\npointer-events: none;\\n}\\n\").concat([0, 15, 30, 45, 60, 75, 90, 105, 120, 135, 150, 165].map(function (degree) { return \"\\n.direction[data-rotation=\\\"\".concat(degree, \"\\\"], :global .view-control-rotation\").concat(degree, \" {\\n\").concat(getCursorCSS(degree), \"\\n}\\n\"); }).join(\"\\n\"), \"\\n\\n.line.direction:before {\\ncontent: \\\"\\\";\\nposition: absolute;\\nwidth: 100%;\\nheight: calc(var(--moveable-line-padding, 0) * 1px);\\nbottom: 0;\\nleft: 0;\\n}\\n.group {\\nz-index: -1;\\n}\\n.area {\\nposition: absolute;\\n}\\n.area-pieces {\\nposition: absolute;\\ntop: 0;\\nleft: 0;\\ndisplay: none;\\n}\\n.area.avoid, .area.pass {\\npointer-events: none;\\n}\\n.area.avoid+.area-pieces {\\ndisplay: block;\\n}\\n.area-piece {\\nposition: absolute;\\n}\\n\\n\").concat(IS_WEBKIT605 ? \":global svg *:before {\\ncontent:\\\"\\\";\\ntransform-origin: inherit;\\n}\" : \"\", \"\\n\");\r\nvar NEARBY_POS = [\r\n [0, 1, 2],\r\n [1, 0, 3],\r\n [2, 0, 3],\r\n [3, 1, 2],\r\n];\r\nvar FLOAT_POINT_NUM = 0.0001;\r\nvar TINY_NUM = 0.0000001;\r\nvar MIN_SCALE = 0.000000001;\r\nvar MAX_NUM = Math.pow(10, 10);\r\nvar MIN_NUM = -MAX_NUM;\r\nvar DIRECTION_REGION_TO_DIRECTION = {\r\n n: [0, -1],\r\n e: [1, 0],\r\n s: [0, 1],\r\n w: [-1, 0],\r\n nw: [-1, -1],\r\n ne: [1, -1],\r\n sw: [-1, 1],\r\n se: [1, 1],\r\n};\r\nvar DIRECTION_INDEXES = {\r\n n: [0, 1],\r\n e: [1, 3],\r\n s: [3, 2],\r\n w: [2, 0],\r\n nw: [0],\r\n ne: [1],\r\n sw: [2],\r\n se: [3],\r\n};\r\nvar DIRECTION_ROTATIONS = {\r\n n: 0,\r\n s: 180,\r\n w: 270,\r\n e: 90,\r\n nw: 315,\r\n ne: 45,\r\n sw: 225,\r\n se: 135,\r\n};\r\nvar MOVEABLE_METHODS = [\r\n \"isMoveableElement\",\r\n \"updateRect\",\r\n \"updateTarget\",\r\n \"destroy\",\r\n \"dragStart\",\r\n \"isInside\",\r\n \"hitTest\",\r\n \"setState\",\r\n \"getRect\",\r\n \"request\",\r\n \"isDragging\",\r\n \"getManager\",\r\n \"forceUpdate\",\r\n \"waitToChangeTarget\",\r\n \"updateSelectors\",\r\n \"getTargets\",\r\n \"stopDrag\",\r\n \"getControlBoxElement\",\r\n \"getMoveables\",\r\n \"getDragElement\",\r\n];\n\nfunction setCustomDrag(e, state, delta, isPinch, isConvert, ableName) {\r\n var _a, _b;\r\n if (ableName === void 0) { ableName = \"draggable\"; }\r\n var result = (_b = (_a = state.gestos[ableName]) === null || _a === void 0 ? void 0 : _a.move(delta, e.inputEvent)) !== null && _b !== void 0 ? _b : {};\r\n var datas = result.originalDatas || result.datas;\r\n var ableDatas = datas[ableName] || (datas[ableName] = {});\r\n return __assign(__assign({}, (isConvert ? convertDragDist(state, result) : result)), { isPinch: !!isPinch, parentEvent: true, datas: ableDatas, originalDatas: e.originalDatas });\r\n}\r\nvar CustomGesto = /*#__PURE__*/ (function () {\r\n function CustomGesto(ableName) {\r\n var _a;\r\n if (ableName === void 0) { ableName = \"draggable\"; }\r\n this.ableName = ableName;\r\n this.prevX = 0;\r\n this.prevY = 0;\r\n this.startX = 0;\r\n this.startY = 0;\r\n this.isDrag = false;\r\n this.isFlag = false;\r\n this.datas = {\r\n draggable: {},\r\n };\r\n this.datas = (_a = {},\r\n _a[ableName] = {},\r\n _a);\r\n }\r\n CustomGesto.prototype.dragStart = function (client, e) {\r\n this.isDrag = false;\r\n this.isFlag = false;\r\n var originalDatas = e.originalDatas;\r\n this.datas = originalDatas;\r\n if (!originalDatas[this.ableName]) {\r\n originalDatas[this.ableName] = {};\r\n }\r\n return __assign(__assign({}, this.move(client, e.inputEvent)), { type: \"dragstart\" });\r\n };\r\n CustomGesto.prototype.drag = function (client, inputEvent) {\r\n return this.move([\r\n client[0] - this.prevX,\r\n client[1] - this.prevY,\r\n ], inputEvent);\r\n };\r\n CustomGesto.prototype.move = function (delta, inputEvent) {\r\n var clientX;\r\n var clientY;\r\n var isFirstDrag = false;\r\n if (!this.isFlag) {\r\n this.prevX = delta[0];\r\n this.prevY = delta[1];\r\n this.startX = delta[0];\r\n this.startY = delta[1];\r\n clientX = delta[0];\r\n clientY = delta[1];\r\n this.isFlag = true;\r\n }\r\n else {\r\n var isPrevDrag = this.isDrag;\r\n clientX = this.prevX + delta[0];\r\n clientY = this.prevY + delta[1];\r\n if (delta[0] || delta[1]) {\r\n this.isDrag = true;\r\n }\r\n if (!isPrevDrag && this.isDrag) {\r\n isFirstDrag = true;\r\n }\r\n }\r\n this.prevX = clientX;\r\n this.prevY = clientY;\r\n return {\r\n type: \"drag\",\r\n clientX: clientX,\r\n clientY: clientY,\r\n inputEvent: inputEvent,\r\n isFirstDrag: isFirstDrag,\r\n isDrag: this.isDrag,\r\n distX: clientX - this.startX,\r\n distY: clientY - this.startY,\r\n deltaX: delta[0],\r\n deltaY: delta[1],\r\n datas: this.datas[this.ableName],\r\n originalDatas: this.datas,\r\n parentEvent: true,\r\n parentGesto: this,\r\n };\r\n };\r\n return CustomGesto;\r\n}());\n\nfunction calculateElementPosition(matrix, origin, width, height) {\r\n var is3d = matrix.length === 16;\r\n var n = is3d ? 4 : 3;\r\n var poses = calculatePoses(matrix, width, height, n);\r\n var _a = __read(poses, 4), _b = __read(_a[0], 2), x1 = _b[0], y1 = _b[1], _c = __read(_a[1], 2), x2 = _c[0], y2 = _c[1], _d = __read(_a[2], 2), x3 = _d[0], y3 = _d[1], _e = __read(_a[3], 2), x4 = _e[0], y4 = _e[1];\r\n var _f = __read(calculatePosition(matrix, origin, n), 2), originX = _f[0], originY = _f[1];\r\n var left = Math.min(x1, x2, x3, x4);\r\n var top = Math.min(y1, y2, y3, y4);\r\n var right = Math.max(x1, x2, x3, x4);\r\n var bottom = Math.max(y1, y2, y3, y4);\r\n x1 = (x1 - left) || 0;\r\n x2 = (x2 - left) || 0;\r\n x3 = (x3 - left) || 0;\r\n x4 = (x4 - left) || 0;\r\n y1 = (y1 - top) || 0;\r\n y2 = (y2 - top) || 0;\r\n y3 = (y3 - top) || 0;\r\n y4 = (y4 - top) || 0;\r\n originX = (originX - left) || 0;\r\n originY = (originY - top) || 0;\r\n var sx = matrix[0];\r\n var sy = matrix[n + 1];\r\n var direction = sign(sx * sy);\r\n return {\r\n left: left,\r\n top: top,\r\n right: right,\r\n bottom: bottom,\r\n origin: [originX, originY],\r\n pos1: [x1, y1],\r\n pos2: [x2, y2],\r\n pos3: [x3, y3],\r\n pos4: [x4, y4],\r\n direction: direction,\r\n };\r\n}\n\nfunction calculatePointerDist(moveable, e) {\r\n var clientX = e.clientX, clientY = e.clientY, datas = e.datas;\r\n var _a = moveable.state, moveableClientRect = _a.moveableClientRect, rootMatrix = _a.rootMatrix, is3d = _a.is3d, pos1 = _a.pos1;\r\n var left = moveableClientRect.left, top = moveableClientRect.top;\r\n var n = is3d ? 4 : 3;\r\n var _b = __read(minus(calculateInversePosition(rootMatrix, [clientX - left, clientY - top], n), pos1), 2), posX = _b[0], posY = _b[1];\r\n var _c = __read(getDragDist({ datas: datas, distX: posX, distY: posY }), 2), distX = _c[0], distY = _c[1];\r\n return [distX, distY];\r\n}\r\nfunction setDragStart(moveable, _a) {\r\n var datas = _a.datas;\r\n var _b = moveable.state, allMatrix = _b.allMatrix, beforeMatrix = _b.beforeMatrix, is3d = _b.is3d, left = _b.left, top = _b.top, origin = _b.origin, offsetMatrix = _b.offsetMatrix, targetMatrix = _b.targetMatrix, transformOrigin = _b.transformOrigin;\r\n var n = is3d ? 4 : 3;\r\n datas.is3d = is3d;\r\n datas.matrix = allMatrix;\r\n datas.targetMatrix = targetMatrix;\r\n datas.beforeMatrix = beforeMatrix;\r\n datas.offsetMatrix = offsetMatrix;\r\n datas.transformOrigin = transformOrigin;\r\n datas.inverseMatrix = invert(allMatrix, n);\r\n datas.inverseBeforeMatrix = invert(beforeMatrix, n);\r\n datas.absoluteOrigin = convertPositionMatrix(plus([left, top], origin), n);\r\n datas.startDragBeforeDist = calculate(datas.inverseBeforeMatrix, datas.absoluteOrigin, n);\r\n datas.startDragDist = calculate(datas.inverseMatrix, datas.absoluteOrigin, n);\r\n}\r\nfunction getTransformDirection(e) {\r\n return calculateElementPosition(e.datas.beforeTransform, [50, 50], 100, 100).direction;\r\n}\r\nfunction resolveTransformEvent(moveable, event, functionName) {\r\n var datas = event.datas, originalDatas = event.originalDatas.beforeRenderable;\r\n var index = datas.transformIndex;\r\n var nextTransforms = originalDatas.nextTransforms;\r\n var length = nextTransforms.length;\r\n var nextTransformAppendedIndexes = originalDatas.nextTransformAppendedIndexes;\r\n var nextIndex = -1;\r\n if (index === -1) {\r\n // translate => rotate => scale\r\n if (functionName === \"translate\") {\r\n nextIndex = 0;\r\n }\r\n else if (functionName === \"rotate\") {\r\n nextIndex = findIndex(nextTransforms, function (text) { return text.match(/scale\\(/g); });\r\n }\r\n if (nextIndex === -1) {\r\n nextIndex = nextTransforms.length;\r\n }\r\n datas.transformIndex = nextIndex;\r\n }\r\n else if (find(nextTransformAppendedIndexes, function (info) { return info.index === index && info.functionName === functionName; })) {\r\n nextIndex = index;\r\n }\r\n else {\r\n nextIndex = index + nextTransformAppendedIndexes.filter(function (info) { return info.index < index; }).length;\r\n }\r\n var result = convertTransformInfo(nextTransforms, moveable.state, nextIndex);\r\n var targetFunction = result.targetFunction;\r\n var matFunctionName = functionName === \"rotate\" ? \"rotateZ\" : functionName;\r\n datas.beforeFunctionTexts = result.beforeFunctionTexts;\r\n datas.afterFunctionTexts = result.afterFunctionTexts;\r\n datas.beforeTransform = result.beforeFunctionMatrix;\r\n datas.beforeTransform2 = result.beforeFunctionMatrix2;\r\n datas.targetTansform = result.targetFunctionMatrix;\r\n datas.afterTransform = result.afterFunctionMatrix;\r\n datas.afterTransform2 = result.afterFunctionMatrix2;\r\n datas.targetAllTransform = result.allFunctionMatrix;\r\n if (targetFunction.functionName === matFunctionName) {\r\n datas.afterFunctionTexts.splice(0, 1);\r\n datas.isAppendTransform = false;\r\n }\r\n else if (length > nextIndex) {\r\n datas.isAppendTransform = true;\r\n originalDatas.nextTransformAppendedIndexes = __spreadArray(__spreadArray([], __read(nextTransformAppendedIndexes), false), [{\r\n functionName: functionName,\r\n index: nextIndex,\r\n isAppend: true,\r\n }], false);\r\n }\r\n}\r\nfunction convertTransformFormat(datas, value, dist) {\r\n return \"\".concat(datas.beforeFunctionTexts.join(\" \"), \" \").concat(datas.isAppendTransform ? dist : value, \" \").concat(datas.afterFunctionTexts.join(\" \"));\r\n}\r\nfunction getTransformDist(_a) {\r\n var datas = _a.datas, distX = _a.distX, distY = _a.distY;\r\n var _b = __read(getBeforeDragDist({ datas: datas, distX: distX, distY: distY }), 2), bx = _b[0], by = _b[1];\r\n // B * [tx, ty] * A = [bx, by] * targetMatrix;\r\n // [tx, ty] = B-1 * [bx, by] * targetMatrix * A-1 * [0, 0];\r\n var res = getTransfromMatrix(datas, fromTranslation([bx, by], 4));\r\n return calculate(res, convertPositionMatrix([0, 0, 0], 4), 4);\r\n}\r\nfunction getTransfromMatrix(datas, targetMatrix, isAfter) {\r\n var beforeTransform = datas.beforeTransform, afterTransform = datas.afterTransform, beforeTransform2 = datas.beforeTransform2, afterTransform2 = datas.afterTransform2, targetAllTransform = datas.targetAllTransform;\r\n // B * afterTargetMatrix * A = (targetMatrix * targetAllTransform)\r\n // afterTargetMatrix = B-1 * targetMatrix * targetAllTransform * A-1\r\n // nextTargetMatrix = (targetMatrix * targetAllTransform)\r\n var nextTargetMatrix = isAfter\r\n ? multiply(targetAllTransform, targetMatrix, 4)\r\n : multiply(targetMatrix, targetAllTransform, 4);\r\n // res1 = B-1 * nextTargetMatrix\r\n var res1 = multiply(invert(isAfter ? beforeTransform2 : beforeTransform, 4), nextTargetMatrix, 4);\r\n // res3 = res2 * A-1\r\n var afterTargetMatrix = multiply(res1, invert(isAfter ? afterTransform2 : afterTransform, 4), 4);\r\n return afterTargetMatrix;\r\n}\r\nfunction getBeforeDragDist(_a) {\r\n var datas = _a.datas, distX = _a.distX, distY = _a.distY;\r\n // TT = BT\r\n var inverseBeforeMatrix = datas.inverseBeforeMatrix, is3d = datas.is3d, startDragBeforeDist = datas.startDragBeforeDist, absoluteOrigin = datas.absoluteOrigin;\r\n var n = is3d ? 4 : 3;\r\n // ABS_ORIGIN * [distX, distY] = BM * (ORIGIN + [tx, ty])\r\n // BM -1 * ABS_ORIGIN * [distX, distY] - ORIGIN = [tx, ty]\r\n return minus(calculate(inverseBeforeMatrix, plus(absoluteOrigin, [distX, distY]), n), startDragBeforeDist);\r\n}\r\nfunction getDragDist(_a, isBefore) {\r\n var datas = _a.datas, distX = _a.distX, distY = _a.distY;\r\n var inverseBeforeMatrix = datas.inverseBeforeMatrix, inverseMatrix = datas.inverseMatrix, is3d = datas.is3d, startDragBeforeDist = datas.startDragBeforeDist, startDragDist = datas.startDragDist, absoluteOrigin = datas.absoluteOrigin;\r\n var n = is3d ? 4 : 3;\r\n return minus(calculate(isBefore ? inverseBeforeMatrix : inverseMatrix, plus(absoluteOrigin, [distX, distY]), n), isBefore ? startDragBeforeDist : startDragDist);\r\n}\r\nfunction getInverseDragDist(_a, isBefore) {\r\n var datas = _a.datas, distX = _a.distX, distY = _a.distY;\r\n var beforeMatrix = datas.beforeMatrix, matrix = datas.matrix, is3d = datas.is3d, startDragBeforeDist = datas.startDragBeforeDist, startDragDist = datas.startDragDist, absoluteOrigin = datas.absoluteOrigin;\r\n var n = is3d ? 4 : 3;\r\n return minus(calculate(isBefore ? beforeMatrix : matrix, plus(isBefore ? startDragBeforeDist : startDragDist, [distX, distY]), n), absoluteOrigin);\r\n}\r\nfunction calculateTransformOrigin(transformOrigin, width, height, prevWidth, prevHeight, prevOrigin) {\r\n if (prevWidth === void 0) { prevWidth = width; }\r\n if (prevHeight === void 0) { prevHeight = height; }\r\n if (prevOrigin === void 0) { prevOrigin = [0, 0]; }\r\n if (!transformOrigin) {\r\n return prevOrigin;\r\n }\r\n return transformOrigin.map(function (pos, i) {\r\n var _a = splitUnit(pos), value = _a.value, unit = _a.unit;\r\n var prevSize = (i ? prevHeight : prevWidth);\r\n var size = (i ? height : width);\r\n if (pos === \"%\" || isNaN(value)) {\r\n // no value but %\r\n var measureRatio = prevSize ? prevOrigin[i] / prevSize : 0;\r\n return size * measureRatio;\r\n }\r\n else if (unit !== \"%\") {\r\n return value;\r\n }\r\n return size * value / 100;\r\n });\r\n}\r\nfunction getPosIndexesByDirection(direction) {\r\n var indexes = [];\r\n if (direction[1] >= 0) {\r\n if (direction[0] >= 0) {\r\n indexes.push(3);\r\n }\r\n if (direction[0] <= 0) {\r\n indexes.push(2);\r\n }\r\n }\r\n if (direction[1] <= 0) {\r\n if (direction[0] >= 0) {\r\n indexes.push(1);\r\n }\r\n if (direction[0] <= 0) {\r\n indexes.push(0);\r\n }\r\n }\r\n return indexes;\r\n}\r\nfunction getPosesByDirection(poses, direction) {\r\n /*\r\n [-1, -1](pos1) [0, -1](pos1,pos2) [1, -1](pos2)\r\n [-1, 0](pos1, pos3) [1, 0](pos2, pos4)\r\n [-1, 1](pos3) [0, 1](pos3, pos4) [1, 1](pos4)\r\n */\r\n return getPosIndexesByDirection(direction).map(function (index) { return poses[index]; });\r\n}\r\nfunction getPosBySingleDirection(poses, direction) {\r\n var ratio = (direction + 1) / 2;\r\n return [\r\n dot(poses[0][0], poses[1][0], ratio, 1 - ratio),\r\n dot(poses[0][1], poses[1][1], ratio, 1 - ratio),\r\n ];\r\n}\r\nfunction getPosByDirection(poses, direction) {\r\n var top = getPosBySingleDirection([poses[0], poses[1]], direction[0]);\r\n var bottom = getPosBySingleDirection([poses[2], poses[3]], direction[0]);\r\n return getPosBySingleDirection([top, bottom], direction[1]);\r\n}\r\nfunction getDist(startPos, matrix, width, height, n, fixedDirection) {\r\n var poses = calculatePoses(matrix, width, height, n);\r\n var fixedPos = getPosByDirection(poses, fixedDirection);\r\n var distX = startPos[0] - fixedPos[0];\r\n var distY = startPos[1] - fixedPos[1];\r\n return [distX, distY];\r\n}\r\nfunction getNextMatrix(offsetMatrix, targetMatrix, origin, n) {\r\n return multiply(offsetMatrix, getAbsoluteMatrix(targetMatrix, n, origin), n);\r\n}\r\nfunction getNextTransformMatrix(state, datas, transform, isAllTransform) {\r\n var transformOrigin = state.transformOrigin, offsetMatrix = state.offsetMatrix, is3d = state.is3d;\r\n var n = is3d ? 4 : 3;\r\n var targetTransform;\r\n if (isString(transform)) {\r\n var beforeTransform = datas.beforeTransform, afterTransform = datas.afterTransform;\r\n if (isAllTransform) {\r\n targetTransform = convertDimension(parseMat(transform), 4, n);\r\n }\r\n else {\r\n targetTransform = convertDimension(multiply(multiply(beforeTransform, parseMat([transform]), 4), afterTransform, 4), 4, n);\r\n }\r\n }\r\n else {\r\n targetTransform = transform;\r\n }\r\n return getNextMatrix(offsetMatrix, targetTransform, transformOrigin, n);\r\n}\r\nfunction scaleMatrix(state, scale) {\r\n var transformOrigin = state.transformOrigin, offsetMatrix = state.offsetMatrix, is3d = state.is3d, targetMatrix = state.targetMatrix, targetAllTransform = state.targetAllTransform;\r\n var n = is3d ? 4 : 3;\r\n return getNextMatrix(offsetMatrix, multiply(targetAllTransform || targetMatrix, createScaleMatrix(scale, n), n), transformOrigin, n);\r\n}\r\nfunction fillTransformStartEvent(moveable, e) {\r\n var originalDatas = getBeforeRenderableDatas(e);\r\n return {\r\n setTransform: function (transform, index) {\r\n if (index === void 0) { index = -1; }\r\n originalDatas.startTransforms = isArray(transform) ? transform : splitSpace(transform);\r\n setTransformIndex(moveable, e, index);\r\n },\r\n setTransformIndex: function (index) {\r\n setTransformIndex(moveable, e, index);\r\n },\r\n };\r\n}\r\nfunction setDefaultTransformIndex(moveable, e, property) {\r\n var originalDatas = getBeforeRenderableDatas(e);\r\n var startTransforms = originalDatas.startTransforms;\r\n setTransformIndex(moveable, e, findIndex(startTransforms, function (func) { return func.indexOf(\"\".concat(property, \"(\")) === 0; }));\r\n}\r\nfunction setTransformIndex(moveable, e, index) {\r\n var originalDatas = getBeforeRenderableDatas(e);\r\n var datas = e.datas;\r\n datas.transformIndex = index;\r\n if (index === -1) {\r\n return;\r\n }\r\n var transform = originalDatas.startTransforms[index];\r\n if (!transform) {\r\n return;\r\n }\r\n var state = moveable.state;\r\n var info = parse([transform], {\r\n \"x%\": function (v) { return v / 100 * state.offsetWidth; },\r\n \"y%\": function (v) { return v / 100 * state.offsetHeight; },\r\n });\r\n datas.startValue = info[0].functionValue;\r\n}\r\nfunction fillOriginalTransform(e, transform) {\r\n var originalDatas = getBeforeRenderableDatas(e);\r\n originalDatas.nextTransforms = splitSpace(transform);\r\n // originalDatas.nextTargetMatrix = parseMat(transform);\r\n}\r\nfunction getBeforeRenderableDatas(e) {\r\n return e.originalDatas.beforeRenderable;\r\n}\r\nfunction getNextTransforms(e) {\r\n var originalDatas = e.originalDatas.beforeRenderable;\r\n return originalDatas.nextTransforms;\r\n}\r\nfunction getNextTransformText(e) {\r\n return (getNextTransforms(e) || []).join(\" \");\r\n}\r\nfunction getNextStyle(e) {\r\n return getBeforeRenderableDatas(e).nextStyle;\r\n}\r\nfunction fillTransformEvent(moveable, nextTransform, delta, isPinch, e) {\r\n fillOriginalTransform(e, nextTransform);\r\n var drag = Draggable.drag(moveable, setCustomDrag(e, moveable.state, delta, isPinch, false));\r\n var afterTransform = drag ? drag.transform : nextTransform;\r\n return __assign(__assign({ transform: nextTransform, drag: drag }, fillCSSObject({\r\n transform: afterTransform,\r\n }, e)), { afterTransform: afterTransform });\r\n}\r\nfunction getTranslateFixedPosition(moveable, transform, fixedDirection, fixedOffset, datas, isAllTransform) {\r\n var nextMatrix = getNextTransformMatrix(moveable.state, datas, transform, isAllTransform);\r\n var nextFixedPosition = getDirectionOffset(moveable, fixedDirection, fixedOffset, nextMatrix);\r\n return nextFixedPosition;\r\n}\r\nfunction getTranslateDist(moveable, transform, fixedDirection, fixedPosition, fixedOffset, datas, isAllTransform) {\r\n var nextFixedPosition = getTranslateFixedPosition(moveable, transform, fixedDirection, fixedOffset, datas, isAllTransform);\r\n var state = moveable.state;\r\n var left = state.left, top = state.top;\r\n var groupable = moveable.props.groupable;\r\n var groupLeft = groupable ? left : 0;\r\n var groupTop = groupable ? top : 0;\r\n var dist = minus(fixedPosition, nextFixedPosition);\r\n return minus(dist, [groupLeft, groupTop]);\r\n}\r\nfunction getScaleDist(moveable, transform, fixedDirection, fixedPosition, fixedOffset, datas, isAllTransform) {\r\n var dist = getTranslateDist(moveable, transform, fixedDirection, fixedPosition, fixedOffset, datas, isAllTransform);\r\n return dist;\r\n}\r\nfunction getDirectionByPos(pos, width, height) {\r\n return [\r\n width ? -1 + pos[0] / (width / 2) : 0,\r\n height ? -1 + pos[1] / (height / 2) : 0,\r\n ];\r\n}\r\nfunction getDirectionOffset(moveable, fixedDirection, fixedOffset, nextMatrix) {\r\n if (nextMatrix === void 0) { nextMatrix = moveable.state.allMatrix; }\r\n var _a = moveable.state, width = _a.width, height = _a.height, is3d = _a.is3d;\r\n var n = is3d ? 4 : 3;\r\n var fixedOffsetPosition = [\r\n width / 2 * (1 + fixedDirection[0]) + fixedOffset[0],\r\n height / 2 * (1 + fixedDirection[1]) + fixedOffset[1],\r\n ];\r\n return calculatePosition(nextMatrix, fixedOffsetPosition, n);\r\n}\r\nfunction getRotateDist(moveable, rotateDist, datas) {\r\n var fixedDirection = datas.fixedDirection;\r\n var fixedPosition = datas.fixedPosition;\r\n var fixedOffset = datas.fixedOffset;\r\n return getTranslateDist(moveable, \"rotate(\".concat(rotateDist, \"deg)\"), fixedDirection, fixedPosition, fixedOffset, datas);\r\n}\r\nfunction getResizeDist(moveable, width, height, fixedPosition, transformOrigin, datas) {\r\n var groupable = moveable.props.groupable;\r\n var state = moveable.state;\r\n var prevOrigin = state.transformOrigin, offsetMatrix = state.offsetMatrix, is3d = state.is3d, prevWidth = state.width, prevHeight = state.height, left = state.left, top = state.top;\r\n var fixedDirection = datas.fixedDirection;\r\n var targetMatrix = datas.nextTargetMatrix || state.targetMatrix;\r\n var n = is3d ? 4 : 3;\r\n var nextOrigin = calculateTransformOrigin(transformOrigin, width, height, prevWidth, prevHeight, prevOrigin);\r\n var groupLeft = groupable ? left : 0;\r\n var groupTop = groupable ? top : 0;\r\n var nextMatrix = getNextMatrix(offsetMatrix, targetMatrix, nextOrigin, n);\r\n var dist = getDist(fixedPosition, nextMatrix, width, height, n, fixedDirection);\r\n return minus(dist, [groupLeft, groupTop]);\r\n}\r\nfunction getAbsolutePosition(moveable, direction) {\r\n return getPosByDirection(getAbsolutePosesByState(moveable.state), direction);\r\n}\n\nfunction getGestoData(moveable, ableName) {\r\n var targetGesto = moveable.targetGesto;\r\n var controlGesto = moveable.controlGesto;\r\n var data;\r\n if (targetGesto === null || targetGesto === void 0 ? void 0 : targetGesto.isFlag()) {\r\n data = targetGesto.getEventData()[ableName];\r\n }\r\n if (!data && (controlGesto === null || controlGesto === void 0 ? void 0 : controlGesto.isFlag())) {\r\n data = controlGesto.getEventData()[ableName];\r\n }\r\n return data || {};\r\n}\n\nfunction getShadowRoot(parentElement) {\r\n if (parentElement && parentElement.getRootNode) {\r\n var rootNode = parentElement.getRootNode();\r\n if (rootNode.nodeType === 11) {\r\n return rootNode;\r\n }\r\n }\r\n return;\r\n}\r\nfunction getIndividualTransforms(getStyle) {\r\n var scale = getStyle(\"scale\");\r\n var rotate = getStyle(\"rotate\");\r\n var translate = getStyle(\"translate\");\r\n var individualTransforms = [];\r\n if (translate && translate !== \"0px\" && translate !== \"none\") {\r\n individualTransforms.push(\"translate(\".concat(translate.split(/\\s+/).join(\",\"), \")\"));\r\n }\r\n if (rotate && rotate !== \"1\" && rotate !== \"none\") {\r\n individualTransforms.push(\"rotate(\".concat(rotate, \")\"));\r\n }\r\n if (scale && scale !== \"1\" && scale !== \"none\") {\r\n individualTransforms.push(\"scale(\".concat(scale.split(/\\s+/).join(\",\"), \")\"));\r\n }\r\n return individualTransforms;\r\n}\r\nfunction getMatrixStackInfo(target, container, checkContainer) {\r\n var el = target;\r\n var matrixes = [];\r\n var documentElement = getDocumentElement(target) || getDocumentBody(target);\r\n var requestEnd = !checkContainer && target === container || target === documentElement;\r\n var isEnd = requestEnd;\r\n var is3d = false;\r\n var n = 3;\r\n var transformOrigin;\r\n var targetTransformOrigin;\r\n var targetMatrix;\r\n var hasFixed = false;\r\n var offsetContainer = getOffsetInfo(container, container, true).offsetParent;\r\n var zoom = 1;\r\n while (el && !isEnd) {\r\n isEnd = requestEnd;\r\n var getStyle = getCachedStyle(el);\r\n var position = getStyle(\"position\");\r\n var transform = getElementTransform(el);\r\n var isFixed = position === \"fixed\";\r\n var individualTransforms = getIndividualTransforms(getStyle);\r\n var matrix = convertCSStoMatrix(getTransformMatrix(transform));\r\n var offsetParent = void 0;\r\n var isOffsetEnd = false;\r\n var isStatic = false;\r\n var parentClientLeft = 0;\r\n var parentClientTop = 0;\r\n var fixedClientLeft = 0;\r\n var fixedClientTop = 0;\r\n var fixedInfo = {\r\n hasTransform: false,\r\n fixedContainer: null,\r\n };\r\n if (isFixed) {\r\n hasFixed = true;\r\n fixedInfo = getPositionFixedInfo(el);\r\n offsetContainer = fixedInfo.fixedContainer;\r\n }\r\n // convert 3 to 4\r\n var length_1 = matrix.length;\r\n if (!is3d && (length_1 === 16 || individualTransforms.length)) {\r\n is3d = true;\r\n n = 4;\r\n convert3DMatrixes(matrixes);\r\n if (targetMatrix) {\r\n targetMatrix = convertDimension(targetMatrix, 3, 4);\r\n }\r\n }\r\n if (is3d && length_1 === 9) {\r\n matrix = convertDimension(matrix, 3, 4);\r\n }\r\n var _a = getOffsetPosInfo(el, target), tagName = _a.tagName, hasOffset = _a.hasOffset, isSVG = _a.isSVG, origin_1 = _a.origin, targetOrigin = _a.targetOrigin, offsetPos = _a.offset;\r\n var _b = __read(offsetPos, 2), offsetLeft = _b[0], offsetTop = _b[1];\r\n if (tagName === \"svg\" && !target.ownerSVGElement && targetMatrix) {\r\n // scale matrix for svg's SVGElements.\r\n matrixes.push({\r\n type: \"target\",\r\n target: el,\r\n matrix: getSVGMatrix(el, n),\r\n });\r\n matrixes.push({\r\n type: \"offset\",\r\n target: el,\r\n matrix: createIdentityMatrix(n),\r\n });\r\n }\r\n var targetZoom = parseFloat(getStyle(\"zoom\")) || 1;\r\n if (isFixed) {\r\n offsetParent = fixedInfo.fixedContainer;\r\n isOffsetEnd = true;\r\n }\r\n else {\r\n var offsetInfo = getOffsetInfo(el, container, false, true, getStyle);\r\n var offsetZoom = offsetInfo.offsetZoom;\r\n offsetParent = offsetInfo.offsetParent;\r\n isOffsetEnd = offsetInfo.isEnd;\r\n isStatic = offsetInfo.isStatic;\r\n zoom *= offsetZoom;\r\n if ((offsetInfo.isCustomElement || offsetZoom !== 1) && isStatic) {\r\n offsetLeft -= offsetParent.offsetLeft;\r\n offsetTop -= offsetParent.offsetTop;\r\n }\r\n else if (IS_FIREFOX || IS_CHROMIUM109) {\r\n var parentSlotElement = offsetInfo.parentSlotElement;\r\n if (parentSlotElement) {\r\n var customOffsetParent = offsetParent;\r\n var customOffsetLeft = 0;\r\n var customOffsetTop = 0;\r\n while (customOffsetParent) {\r\n if (!getShadowRoot(customOffsetParent)) {\r\n break;\r\n }\r\n customOffsetLeft += customOffsetParent.offsetLeft;\r\n customOffsetTop += customOffsetParent.offsetTop;\r\n customOffsetParent = customOffsetParent.offsetParent;\r\n }\r\n offsetLeft -= customOffsetLeft;\r\n offsetTop -= customOffsetTop;\r\n }\r\n }\r\n }\r\n if (IS_WEBKIT && !IS_SAFARI_ABOVE15\r\n && hasOffset && !isSVG && isStatic\r\n && (position === \"relative\" || position === \"static\")) {\r\n offsetLeft -= offsetParent.offsetLeft;\r\n offsetTop -= offsetParent.offsetTop;\r\n requestEnd = requestEnd || isOffsetEnd;\r\n }\r\n if (isFixed) {\r\n if (hasOffset && fixedInfo.hasTransform) {\r\n // border\r\n fixedClientLeft = offsetParent.clientLeft;\r\n fixedClientTop = offsetParent.clientTop;\r\n }\r\n }\r\n else {\r\n if (hasOffset && offsetContainer !== offsetParent) {\r\n // border\r\n parentClientLeft = offsetParent.clientLeft;\r\n parentClientTop = offsetParent.clientTop;\r\n }\r\n if (hasOffset && offsetParent === documentElement) {\r\n var margin = getBodyOffset(el, false);\r\n offsetLeft += margin[0];\r\n offsetTop += margin[1];\r\n }\r\n }\r\n matrixes.push({\r\n type: \"target\",\r\n target: el,\r\n matrix: getAbsoluteMatrix(matrix, n, origin_1),\r\n });\r\n if (individualTransforms.length) {\r\n matrixes.push({\r\n type: \"offset\",\r\n target: el,\r\n matrix: createIdentityMatrix(n),\r\n });\r\n matrixes.push({\r\n type: \"target\",\r\n target: el,\r\n matrix: getAbsoluteMatrix(parseMat(individualTransforms), n, origin_1),\r\n });\r\n }\r\n if (hasOffset) {\r\n var isElementTarget = el === target;\r\n var scrollLeft = isElementTarget ? 0 : el.scrollLeft;\r\n var scrollTop = isElementTarget ? 0 : el.scrollTop;\r\n matrixes.push({\r\n type: \"offset\",\r\n target: el,\r\n matrix: createOriginMatrix([\r\n offsetLeft - scrollLeft + parentClientLeft - fixedClientLeft,\r\n offsetTop - scrollTop + parentClientTop - fixedClientTop,\r\n ], n),\r\n });\r\n }\r\n else {\r\n // svg\r\n matrixes.push({\r\n type: \"offset\",\r\n target: el,\r\n origin: origin_1,\r\n });\r\n }\r\n // transform으로 계산되지 않는 zoom을 위한 (0, 0) 을 기준 matrix 추가.\r\n if (targetZoom !== 1) {\r\n matrixes.push({\r\n type: \"zoom\",\r\n target: el,\r\n matrix: getAbsoluteMatrix(createScaleMatrix([targetZoom, targetZoom], n), n, [0, 0]),\r\n });\r\n }\r\n if (!targetMatrix) {\r\n targetMatrix = matrix;\r\n }\r\n if (!transformOrigin) {\r\n transformOrigin = origin_1;\r\n }\r\n if (!targetTransformOrigin) {\r\n targetTransformOrigin = targetOrigin;\r\n }\r\n if (isEnd || isFixed) {\r\n break;\r\n }\r\n else {\r\n el = offsetParent;\r\n requestEnd = isOffsetEnd;\r\n }\r\n if (!checkContainer || el === documentElement) {\r\n isEnd = requestEnd;\r\n }\r\n }\r\n if (!targetMatrix) {\r\n targetMatrix = createIdentityMatrix(n);\r\n }\r\n if (!transformOrigin) {\r\n transformOrigin = [0, 0];\r\n }\r\n if (!targetTransformOrigin) {\r\n targetTransformOrigin = [0, 0];\r\n }\r\n return {\r\n zoom: zoom,\r\n offsetContainer: offsetContainer,\r\n matrixes: matrixes,\r\n targetMatrix: targetMatrix,\r\n transformOrigin: transformOrigin,\r\n targetOrigin: targetTransformOrigin,\r\n is3d: is3d,\r\n hasFixed: hasFixed,\r\n };\r\n}\n\nvar cacheStyleMap = null;\r\nvar clientRectStyleMap = null;\r\nvar matrixContainerInfos = null;\r\nfunction setStoreCache(useCache) {\r\n if (useCache) {\r\n if (window.Map) {\r\n cacheStyleMap = new Map();\r\n clientRectStyleMap = new Map();\r\n }\r\n matrixContainerInfos = [];\r\n }\r\n else {\r\n cacheStyleMap = null;\r\n matrixContainerInfos = null;\r\n clientRectStyleMap = null;\r\n }\r\n}\r\nfunction getCachedClientRect(el) {\r\n var clientRect = clientRectStyleMap === null || clientRectStyleMap === void 0 ? void 0 : clientRectStyleMap.get(el);\r\n if (clientRect) {\r\n return clientRect;\r\n }\r\n var nextClientRect = getClientRect(el, true);\r\n if (clientRectStyleMap) {\r\n clientRectStyleMap.set(el, nextClientRect);\r\n }\r\n return nextClientRect;\r\n}\r\nfunction getCachedMatrixContainerInfo(target, container) {\r\n if (matrixContainerInfos) {\r\n var result_1 = find(matrixContainerInfos, function (info) { return info[0][0] == target && info[0][1] == container; });\r\n if (result_1) {\r\n return result_1[1];\r\n }\r\n }\r\n var result = getMatrixStackInfo(target, container, true);\r\n if (matrixContainerInfos) {\r\n matrixContainerInfos.push([[target, container], result]);\r\n }\r\n return result;\r\n}\r\nfunction getCachedStyle(element) {\r\n var cache = cacheStyleMap === null || cacheStyleMap === void 0 ? void 0 : cacheStyleMap.get(element);\r\n if (!cache) {\r\n var nextStyle_1 = getWindow(element).getComputedStyle(element);\r\n if (!cacheStyleMap) {\r\n return function (property) {\r\n return nextStyle_1[property];\r\n };\r\n }\r\n cache = {\r\n style: nextStyle_1,\r\n cached: {},\r\n };\r\n cacheStyleMap.set(element, cache);\r\n }\r\n var cached = cache.cached;\r\n var style = cache.style;\r\n return function (property) {\r\n if (!(property in cached)) {\r\n cached[property] = style[property];\r\n }\r\n return cached[property];\r\n };\r\n}\n\nfunction fillChildEvents(moveable, name, e) {\r\n var datas = e.originalDatas;\r\n datas.groupable = datas.groupable || {};\r\n var groupableDatas = datas.groupable;\r\n groupableDatas.childDatas = groupableDatas.childDatas || [];\r\n var childDatas = groupableDatas.childDatas;\r\n return moveable.moveables.map(function (_, i) {\r\n childDatas[i] = childDatas[i] || {};\r\n childDatas[i][name] = childDatas[i][name] || {};\r\n return __assign(__assign({}, e), { isRequestChild: true, datas: childDatas[i][name], originalDatas: childDatas[i] });\r\n });\r\n}\r\nfunction triggerChildGesto(moveable, able, type, delta, e, isConvert, ableName) {\r\n var isStart = !!type.match(/Start$/g);\r\n var isEnd = !!type.match(/End$/g);\r\n var isPinch = e.isPinch;\r\n var datas = e.datas;\r\n var events = fillChildEvents(moveable, able.name, e);\r\n var moveables = moveable.moveables;\r\n var childEvents = [];\r\n var eventParams = events.map(function (ev, i) {\r\n var childMoveable = moveables[i];\r\n var state = childMoveable.state;\r\n var gestos = state.gestos;\r\n var childEvent = ev;\r\n if (isStart) {\r\n childEvent = new CustomGesto(ableName).dragStart(delta, ev);\r\n childEvents.push(childEvent);\r\n }\r\n else {\r\n if (!gestos[ableName]) {\r\n gestos[ableName] = datas.childGestos[i];\r\n }\r\n if (!gestos[ableName]) {\r\n return;\r\n }\r\n childEvent = setCustomDrag(ev, state, delta, isPinch, isConvert, ableName);\r\n childEvents.push(childEvent);\r\n }\r\n var result = able[type](childMoveable, __assign(__assign({}, childEvent), { parentFlag: true }));\r\n if (isEnd) {\r\n gestos[ableName] = null;\r\n }\r\n return result;\r\n });\r\n if (isStart) {\r\n datas.childGestos = moveables.map(function (child) { return child.state.gestos[ableName]; });\r\n }\r\n return {\r\n eventParams: eventParams,\r\n childEvents: childEvents,\r\n };\r\n}\r\nfunction triggerChildAbles(moveable, able, type, e, eachEvent, callback) {\r\n if (eachEvent === void 0) { eachEvent = function (_, ev) { return ev; }; }\r\n var isEnd = !!type.match(/End$/g);\r\n var events = fillChildEvents(moveable, able.name, e);\r\n var moveables = moveable.moveables;\r\n var childs = events.map(function (ev, i) {\r\n var childMoveable = moveables[i];\r\n var childEvent = ev;\r\n childEvent = eachEvent(childMoveable, ev);\r\n var result = able[type](childMoveable, __assign(__assign({}, childEvent), { parentFlag: true }));\r\n result && callback && callback(childMoveable, ev, result, i);\r\n if (isEnd) {\r\n childMoveable.state.gestos = {};\r\n }\r\n return result;\r\n });\r\n return childs;\r\n}\r\nfunction startChildDist(moveable, child, parentDatas, childEvent) {\r\n var fixedDirection = parentDatas.fixedDirection;\r\n var fixedPosition = parentDatas.fixedPosition;\r\n var startPositions = childEvent.datas.startPositions || getAbsolutePosesByState(child.state);\r\n var pos = getPosByDirection(startPositions, fixedDirection);\r\n var _a = __read(calculate(createRotateMatrix(-moveable.rotation / 180 * Math.PI, 3), [pos[0] - fixedPosition[0], pos[1] - fixedPosition[1], 1], 3), 2), originalX = _a[0], originalY = _a[1];\r\n childEvent.datas.originalX = originalX;\r\n childEvent.datas.originalY = originalY;\r\n return childEvent;\r\n}\n\nfunction renderDirectionControlsByInfos(moveable, ableName, renderDirections, React) {\r\n var _a = moveable.getState(), renderPoses = _a.renderPoses, rotationRad = _a.rotation, direction = _a.direction;\r\n var zoom = getProps(moveable.props, ableName).zoom;\r\n var degRotation = absDegree(rotationRad / Math.PI * 180);\r\n var directionMap = {};\r\n var renderState = moveable.renderState;\r\n if (!renderState.renderDirectionMap) {\r\n renderState.renderDirectionMap = {};\r\n }\r\n var renderDirectionMap = renderState.renderDirectionMap;\r\n renderDirections.forEach(function (_a) {\r\n var dir = _a.dir;\r\n directionMap[dir] = true;\r\n });\r\n var directionSign = sign(direction);\r\n return renderDirections.map(function (_a) {\r\n var data = _a.data, classNames = _a.classNames, dir = _a.dir;\r\n var indexes = DIRECTION_INDEXES[dir];\r\n if (!indexes || !directionMap[dir]) {\r\n return null;\r\n }\r\n renderDirectionMap[dir] = true;\r\n var directionRotation = (throttle(degRotation, 15) + directionSign * DIRECTION_ROTATIONS[dir] + 720) % 180;\r\n var dataAttrs = {};\r\n getKeys(data).forEach(function (name) {\r\n dataAttrs[\"data-\".concat(name)] = data[name];\r\n });\r\n return (React.createElement(\"div\", __assign({ className: prefix.apply(void 0, __spreadArray([\"control\", \"direction\", dir, ableName], __read(classNames), false)), \"data-rotation\": directionRotation, \"data-direction\": dir }, dataAttrs, { key: \"direction-\".concat(dir), style: getControlTransform.apply(void 0, __spreadArray([rotationRad, zoom], __read(indexes.map(function (index) { return renderPoses[index]; })), false)) })));\r\n });\r\n}\r\nfunction renderDirectionControls(moveable, defaultDirections, ableName, React) {\r\n var _a = getProps(moveable.props, ableName), _b = _a.renderDirections, directions = _b === void 0 ? defaultDirections : _b, displayAroundControls = _a.displayAroundControls;\r\n if (!directions) {\r\n return [];\r\n }\r\n var renderDirections = directions === true ? DIRECTIONS : directions;\r\n return __spreadArray(__spreadArray([], __read((displayAroundControls ? renderAroundControls(moveable, React, ableName, renderDirections) : [])), false), __read(renderDirectionControlsByInfos(moveable, ableName, renderDirections.map(function (dir) {\r\n return {\r\n data: {},\r\n classNames: [],\r\n dir: dir,\r\n };\r\n }), React)), false);\r\n}\r\nfunction renderLine(React, direction, pos1, pos2, zoom, key) {\r\n var classNames = [];\r\n for (var _i = 6; _i < arguments.length; _i++) {\r\n classNames[_i - 6] = arguments[_i];\r\n }\r\n var rad = getRad(pos1, pos2);\r\n var rotation = direction ? (throttle(rad / Math.PI * 180, 15)) % 180 : -1;\r\n return React.createElement(\"div\", { key: \"line-\".concat(key), className: prefix.apply(void 0, __spreadArray([\"line\", \"direction\", direction ? \"edge\" : \"\", direction], __read(classNames), false)), \"data-rotation\": rotation, \"data-line-key\": key, \"data-direction\": direction, style: getLineStyle(pos1, pos2, zoom, rad) });\r\n}\r\nfunction renderEdgeLines(React, ableName, edge, poses, zoom) {\r\n var directions = edge === true ? DIRECTIONS4 : edge;\r\n return directions.map(function (direction, i) {\r\n var _a = __read(DIRECTION_INDEXES[direction], 2), index1 = _a[0], index2 = _a[1];\r\n if (index2 == null) {\r\n return;\r\n }\r\n return renderLine(React, direction, poses[index1], poses[index2], zoom, \"\".concat(ableName, \"Edge\").concat(i), ableName);\r\n }).filter(Boolean);\r\n}\r\nfunction getRenderDirections(ableName) {\r\n return function (moveable, React) {\r\n var edge = getProps(moveable.props, ableName).edge;\r\n if (edge && (edge === true || edge.length)) {\r\n return __spreadArray(__spreadArray([], __read(renderEdgeLines(React, ableName, edge, moveable.getState().renderPoses, moveable.props.zoom)), false), __read(renderDiagonalDirections(moveable, ableName, React)), false);\r\n }\r\n return renderAllDirections(moveable, ableName, React);\r\n };\r\n}\r\nfunction renderAllDirections(moveable, ableName, React) {\r\n return renderDirectionControls(moveable, DIRECTIONS, ableName, React);\r\n}\r\nfunction renderDiagonalDirections(moveable, ableName, React) {\r\n return renderDirectionControls(moveable, [\"nw\", \"ne\", \"sw\", \"se\"], ableName, React);\r\n}\r\nfunction renderAroundControls(moveable, React, ableName, renderDirections) {\r\n var renderState = moveable.renderState;\r\n if (!renderState.renderDirectionMap) {\r\n renderState.renderDirectionMap = {};\r\n }\r\n var _a = moveable.getState(), renderPoses = _a.renderPoses, rotationRad = _a.rotation, direction = _a.direction;\r\n var renderDirectionMap = renderState.renderDirectionMap;\r\n var zoom = moveable.props.zoom;\r\n var directionSign = sign(direction);\r\n var degRotation = rotationRad / Math.PI * 180;\r\n return (renderDirections || getKeys(renderDirectionMap)).map(function (dir) {\r\n var indexes = DIRECTION_INDEXES[dir];\r\n if (!indexes) {\r\n return null;\r\n }\r\n var directionRotation = (throttle(degRotation, 15) + directionSign * DIRECTION_ROTATIONS[dir] + 720) % 180;\r\n var classNames = [\"around-control\"];\r\n if (ableName) {\r\n classNames.push(\"direction\", ableName);\r\n }\r\n return (React.createElement(\"div\", { className: prefix.apply(void 0, __spreadArray([], __read(classNames), false)), \"data-rotation\": directionRotation, \"data-direction\": dir, key: \"direction-around-\".concat(dir), style: getControlTransform.apply(void 0, __spreadArray([rotationRad, zoom], __read(indexes.map(function (index) { return renderPoses[index]; })), false)) }));\r\n });\r\n}\n\nfunction checkBoundPoses(bounds, verticalPoses, horizontalPoses) {\r\n var _a = bounds || {}, _b = _a.position, position = _b === void 0 ? \"client\" : _b, _c = _a.left, left = _c === void 0 ? -Infinity : _c, _d = _a.top, top = _d === void 0 ? -Infinity : _d, _e = _a.right, right = _e === void 0 ? Infinity : _e, _f = _a.bottom, bottom = _f === void 0 ? Infinity : _f;\r\n var nextBounds = {\r\n position: position,\r\n left: left,\r\n top: top,\r\n right: right,\r\n bottom: bottom,\r\n };\r\n return {\r\n vertical: checkBounds(nextBounds, verticalPoses, true),\r\n horizontal: checkBounds(nextBounds, horizontalPoses, false),\r\n };\r\n}\r\nfunction getBounds(moveable, externalBounds) {\r\n var _a = moveable.state, _b = _a.containerClientRect, containerHeight = _b.clientHeight, containerWidth = _b.clientWidth, clientLeft = _b.clientLeft, clientTop = _b.clientTop, _c = _a.snapOffset, snapOffsetLeft = _c.left, snapOffsetTop = _c.top, snapOffsetRight = _c.right, snapOffsetBottom = _c.bottom;\r\n var bounds = externalBounds || moveable.props.bounds || {};\r\n var position = bounds.position || \"client\";\r\n var isCSS = position === \"css\";\r\n var _d = bounds.left, left = _d === void 0 ? -Infinity : _d, _e = bounds.top, top = _e === void 0 ? -Infinity : _e;\r\n var _f = bounds.right, right = _f === void 0 ? isCSS ? -Infinity : Infinity : _f, _g = bounds.bottom, bottom = _g === void 0 ? isCSS ? -Infinity : Infinity : _g;\r\n if (isCSS) {\r\n right = containerWidth + snapOffsetRight - snapOffsetLeft - right;\r\n bottom = containerHeight + snapOffsetBottom - snapOffsetTop - bottom;\r\n }\r\n return {\r\n left: left + snapOffsetLeft - clientLeft,\r\n right: right + snapOffsetLeft - clientLeft,\r\n top: top + snapOffsetTop - clientTop,\r\n bottom: bottom + snapOffsetTop - clientTop,\r\n };\r\n}\r\nfunction checkBoundKeepRatio(moveable, startPos, endPos) {\r\n var _a = getBounds(moveable), left = _a.left, top = _a.top, right = _a.right, bottom = _a.bottom;\r\n var _b = __read(endPos, 2), endX = _b[0], endY = _b[1];\r\n var _c = __read(minus(endPos, startPos), 2), dx = _c[0], dy = _c[1];\r\n if (abs(dx) < TINY_NUM) {\r\n dx = 0;\r\n }\r\n if (abs(dy) < TINY_NUM) {\r\n dy = 0;\r\n }\r\n var isBottom = dy > 0;\r\n var isRight = dx > 0;\r\n var verticalInfo = {\r\n isBound: false,\r\n offset: 0,\r\n pos: 0,\r\n };\r\n var horizontalInfo = {\r\n isBound: false,\r\n offset: 0,\r\n pos: 0,\r\n };\r\n if (dx === 0 && dy === 0) {\r\n return {\r\n vertical: verticalInfo,\r\n horizontal: horizontalInfo,\r\n };\r\n }\r\n else if (dx === 0) {\r\n if (isBottom) {\r\n if (bottom < endY) {\r\n horizontalInfo.pos = bottom;\r\n horizontalInfo.offset = endY - bottom;\r\n }\r\n }\r\n else {\r\n if (top > endY) {\r\n horizontalInfo.pos = top;\r\n horizontalInfo.offset = endY - top;\r\n }\r\n }\r\n }\r\n else if (dy === 0) {\r\n if (isRight) {\r\n if (right < endX) {\r\n verticalInfo.pos = right;\r\n verticalInfo.offset = endX - right;\r\n }\r\n }\r\n else {\r\n if (left > endX) {\r\n verticalInfo.pos = left;\r\n verticalInfo.offset = endX - left;\r\n }\r\n }\r\n }\r\n else {\r\n // y - y1 = a * (x - x1)\r\n var a = dy / dx;\r\n var b = endPos[1] - a * endX;\r\n var y = 0;\r\n var x = 0;\r\n var isBound = false;\r\n if (isRight && right <= endX) {\r\n y = a * right + b;\r\n x = right;\r\n isBound = true;\r\n }\r\n else if (!isRight && endX <= left) {\r\n y = a * left + b;\r\n x = left;\r\n isBound = true;\r\n }\r\n if (isBound) {\r\n if (y < top || y > bottom) {\r\n isBound = false;\r\n }\r\n }\r\n if (!isBound) {\r\n if (isBottom && bottom <= endY) {\r\n y = bottom;\r\n x = (y - b) / a;\r\n isBound = true;\r\n }\r\n else if (!isBottom && endY <= top) {\r\n y = top;\r\n x = (y - b) / a;\r\n isBound = true;\r\n }\r\n }\r\n if (isBound) {\r\n verticalInfo.isBound = true;\r\n verticalInfo.pos = x;\r\n verticalInfo.offset = endX - x;\r\n horizontalInfo.isBound = true;\r\n horizontalInfo.pos = y;\r\n horizontalInfo.offset = endY - y;\r\n }\r\n }\r\n return {\r\n vertical: verticalInfo,\r\n horizontal: horizontalInfo,\r\n };\r\n}\r\nfunction checkBounds(bounds, poses, isVertical) {\r\n // 0 [100 - 200] 300\r\n var startBoundPos = bounds[isVertical ? \"left\" : \"top\"];\r\n var endBoundPos = bounds[isVertical ? \"right\" : \"bottom\"];\r\n // 450\r\n var minPos = Math.min.apply(Math, __spreadArray([], __read(poses), false));\r\n var maxPos = Math.max.apply(Math, __spreadArray([], __read(poses), false));\r\n var boundInfos = [];\r\n if (startBoundPos + 1 > minPos) {\r\n boundInfos.push({\r\n direction: \"start\",\r\n isBound: true,\r\n offset: minPos - startBoundPos,\r\n pos: startBoundPos,\r\n });\r\n }\r\n if (endBoundPos - 1 < maxPos) {\r\n boundInfos.push({\r\n direction: \"end\",\r\n isBound: true,\r\n offset: maxPos - endBoundPos,\r\n pos: endBoundPos,\r\n });\r\n }\r\n if (!boundInfos.length) {\r\n boundInfos.push({\r\n isBound: false,\r\n offset: 0,\r\n pos: 0,\r\n });\r\n }\r\n return boundInfos.sort(function (a, b) { return abs(b.offset) - abs(a.offset); });\r\n}\r\nfunction isBoundRotate$1(relativePoses, boundRect, rad) {\r\n var nextPoses = rad ? relativePoses.map(function (pos) { return rotate(pos, rad); }) : relativePoses;\r\n return nextPoses.some(function (pos) {\r\n return (pos[0] < boundRect.left && abs(pos[0] - boundRect.left) > 0.1)\r\n || (pos[0] > boundRect.right && abs(pos[0] - boundRect.right) > 0.1)\r\n || (pos[1] < boundRect.top && abs(pos[1] - boundRect.top) > 0.1)\r\n || (pos[1] > boundRect.bottom && abs(pos[1] - boundRect.bottom) > 0.1);\r\n });\r\n}\r\nfunction boundRotate(vec, boundPos, index) {\r\n var r = getDistSize(vec);\r\n var nextPos = Math.sqrt(r * r - boundPos * boundPos) || 0;\r\n return [nextPos, -nextPos].sort(function (a, b) {\r\n return abs(a - vec[index ? 0 : 1]) - abs(b - vec[index ? 0 : 1]);\r\n }).map(function (pos) {\r\n return getRad([0, 0], index ? [pos, boundPos] : [boundPos, pos]);\r\n });\r\n}\r\nfunction checkRotateBounds(moveable, prevPoses, nextPoses, origin, rotation) {\r\n if (!moveable.props.bounds) {\r\n return [];\r\n }\r\n var rad = rotation * Math.PI / 180;\r\n var _a = getBounds(moveable), left = _a.left, top = _a.top, right = _a.right, bottom = _a.bottom;\r\n var relativeLeft = left - origin[0];\r\n var relativeRight = right - origin[0];\r\n var relativeTop = top - origin[1];\r\n var relativeBottom = bottom - origin[1];\r\n var boundRect = {\r\n left: relativeLeft,\r\n top: relativeTop,\r\n right: relativeRight,\r\n bottom: relativeBottom,\r\n };\r\n if (!isBoundRotate$1(nextPoses, boundRect, 0)) {\r\n return [];\r\n }\r\n var result = [];\r\n [\r\n [relativeLeft, 0],\r\n [relativeRight, 0],\r\n [relativeTop, 1],\r\n [relativeBottom, 1],\r\n ].forEach(function (_a) {\r\n var _b = __read(_a, 2), boundPos = _b[0], index = _b[1];\r\n nextPoses.forEach(function (nextPos) {\r\n var relativeRad1 = getRad([0, 0], nextPos);\r\n result.push.apply(result, __spreadArray([], __read(boundRotate(nextPos, boundPos, index)\r\n .map(function (relativeRad2) { return rad + relativeRad2 - relativeRad1; })\r\n .filter(function (nextRad) { return !isBoundRotate$1(prevPoses, boundRect, nextRad); })\r\n .map(function (nextRad) { return throttle(nextRad * 180 / Math.PI, TINY_NUM); })), false));\r\n });\r\n });\r\n return result;\r\n}\n\nvar VERTICAL_NAMES = [\"left\", \"right\", \"center\"];\r\nvar HORIZONTAL_NAMES = [\"top\", \"bottom\", \"middle\"];\r\nvar SNAP_SKIP_NAMES_MAP = {\r\n \"left\": \"start\",\r\n \"right\": \"end\",\r\n \"center\": \"center\",\r\n \"top\": \"start\",\r\n \"bottom\": \"end\",\r\n \"middle\": \"center\",\r\n};\r\nvar VERTICAL_NAMES_MAP = {\r\n start: \"left\",\r\n end: \"right\",\r\n center: \"center\",\r\n};\r\nvar HORIZONTAL_NAMES_MAP = {\r\n start: \"top\",\r\n end: \"bottom\",\r\n center: \"middle\",\r\n};\r\nfunction getInitialBounds() {\r\n return {\r\n left: false,\r\n top: false,\r\n right: false,\r\n bottom: false,\r\n };\r\n}\r\nfunction hasGuidelines(moveable, ableName) {\r\n var _a = moveable.props, snappable = _a.snappable, bounds = _a.bounds, innerBounds = _a.innerBounds, verticalGuidelines = _a.verticalGuidelines, horizontalGuidelines = _a.horizontalGuidelines, snapGridWidth = _a.snapGridWidth, snapGridHeight = _a.snapGridHeight, _b = moveable.state, guidelines = _b.guidelines, enableSnap = _b.enableSnap;\r\n if (!snappable ||\r\n !enableSnap ||\r\n (ableName && snappable !== true && snappable.indexOf(ableName) < 0)) {\r\n return false;\r\n }\r\n if (snapGridWidth ||\r\n snapGridHeight ||\r\n bounds ||\r\n innerBounds ||\r\n (guidelines && guidelines.length) ||\r\n (verticalGuidelines && verticalGuidelines.length) ||\r\n (horizontalGuidelines && horizontalGuidelines.length)) {\r\n return true;\r\n }\r\n return false;\r\n}\r\nfunction getSnapDirections(snapDirections) {\r\n if (snapDirections === false) {\r\n return {};\r\n }\r\n else if (snapDirections === true || !snapDirections) {\r\n return { left: true, right: true, top: true, bottom: true };\r\n }\r\n return snapDirections;\r\n}\r\nfunction mapSnapDirectionPoses(snapDirections, snapPoses) {\r\n var nextSnapDirections = getSnapDirections(snapDirections);\r\n var nextSnapPoses = {};\r\n for (var name_1 in nextSnapDirections) {\r\n if (name_1 in snapPoses && nextSnapDirections[name_1]) {\r\n nextSnapPoses[name_1] = snapPoses[name_1];\r\n }\r\n }\r\n return nextSnapPoses;\r\n}\r\nfunction splitSnapDirectionPoses(snapDirections, snapPoses) {\r\n var nextSnapPoses = mapSnapDirectionPoses(snapDirections, snapPoses);\r\n var horizontalNames = HORIZONTAL_NAMES.filter(function (name) { return name in nextSnapPoses; });\r\n var verticalNames = VERTICAL_NAMES.filter(function (name) { return name in nextSnapPoses; });\r\n return {\r\n horizontalNames: horizontalNames,\r\n verticalNames: verticalNames,\r\n horizontal: horizontalNames.map(function (name) { return nextSnapPoses[name]; }),\r\n vertical: verticalNames.map(function (name) { return nextSnapPoses[name]; }),\r\n };\r\n}\r\nfunction calculateContainerPos(rootMatrix, containerRect, n) {\r\n var clientPos = calculatePosition(rootMatrix, [containerRect.clientLeft, containerRect.clientTop], n);\r\n return [\r\n containerRect.left + clientPos[0],\r\n containerRect.top + clientPos[1],\r\n ];\r\n}\r\nfunction solveLineConstants(_a) {\r\n var _b = __read(_a, 2), point1 = _b[0], point2 = _b[1];\r\n var dx = point2[0] - point1[0];\r\n var dy = point2[1] - point1[1];\r\n if (Math.abs(dx) < TINY_NUM$1) {\r\n dx = 0;\r\n }\r\n if (Math.abs(dy) < TINY_NUM$1) {\r\n dy = 0;\r\n }\r\n // b > 0\r\n // ax + by + c = 0\r\n var a = 0;\r\n var b = 0;\r\n var c = 0;\r\n if (!dx) {\r\n // -x + 1 = 0\r\n a = -1;\r\n c = point1[0];\r\n }\r\n else if (!dy) {\r\n // y - 1 = 0\r\n b = 1;\r\n c = -point1[1];\r\n }\r\n else {\r\n // y = -a(x - x1) + y1\r\n // ax + y + a * x1 - y1 = 0\r\n a = -dy / dx;\r\n b = 1;\r\n c = a * point1[0] - point1[1];\r\n }\r\n return [a, b, c].map(function (v) { return throttle(v, TINY_NUM$1); });\r\n}\n\nfunction checkMoveableSnapPoses(moveable, posesX, posesY, dirXs, dirYs, customSnapThreshold) {\r\n var _a;\r\n if (dirXs === void 0) { dirXs = []; }\r\n if (dirYs === void 0) { dirYs = []; }\r\n var props = moveable.props;\r\n var snapThresholdMultiples = ((_a = moveable.state.snapThresholdInfo) === null || _a === void 0 ? void 0 : _a.multiples) || [1, 1];\r\n var snapThreshold = selectValue(customSnapThreshold, props.snapThreshold, 5);\r\n return checkSnapPoses(moveable.state.guidelines, posesX, posesY, dirXs, dirYs, snapThreshold, snapThresholdMultiples);\r\n}\r\nfunction checkSnapPoses(guidelines, posesX, posesY, dirXs, dirYs, snapThreshold, multiples) {\r\n return {\r\n vertical: checkSnap(guidelines, \"vertical\", posesX, snapThreshold * multiples[0], dirXs),\r\n horizontal: checkSnap(guidelines, \"horizontal\", posesY, snapThreshold * multiples[1], dirYs),\r\n };\r\n}\r\nfunction checkSnapKeepRatio(moveable, startPos, endPos) {\r\n var _a = __read(endPos, 2), endX = _a[0], endY = _a[1];\r\n var _b = __read(startPos, 2), startX = _b[0], startY = _b[1];\r\n var _c = __read(minus(endPos, startPos), 2), dx = _c[0], dy = _c[1];\r\n var isBottom = dy > 0;\r\n var isRight = dx > 0;\r\n dx = getTinyDist(dx);\r\n dy = getTinyDist(dy);\r\n var verticalInfo = {\r\n isSnap: false,\r\n offset: 0,\r\n pos: 0,\r\n };\r\n var horizontalInfo = {\r\n isSnap: false,\r\n offset: 0,\r\n pos: 0,\r\n };\r\n if (dx === 0 && dy === 0) {\r\n return {\r\n vertical: verticalInfo,\r\n horizontal: horizontalInfo,\r\n };\r\n }\r\n var _d = checkMoveableSnapPoses(moveable, dx ? [endX] : [], dy ? [endY] : []), verticalSnapInfo = _d.vertical, horizontalSnapInfo = _d.horizontal;\r\n verticalSnapInfo.posInfos.filter(function (_a) {\r\n var pos = _a.pos;\r\n return isRight ? pos >= startX : pos <= startX;\r\n });\r\n horizontalSnapInfo.posInfos.filter(function (_a) {\r\n var pos = _a.pos;\r\n return isBottom ? pos >= startY : pos <= startY;\r\n });\r\n verticalSnapInfo.isSnap = verticalSnapInfo.posInfos.length > 0;\r\n horizontalSnapInfo.isSnap = horizontalSnapInfo.posInfos.length > 0;\r\n var _e = getNearestSnapGuidelineInfo(verticalSnapInfo), isVerticalSnap = _e.isSnap, verticalGuideline = _e.guideline;\r\n var _f = getNearestSnapGuidelineInfo(horizontalSnapInfo), isHorizontalSnap = _f.isSnap, horizontalGuideline = _f.guideline;\r\n var horizontalPos = isHorizontalSnap ? horizontalGuideline.pos[1] : 0;\r\n var verticalPos = isVerticalSnap ? verticalGuideline.pos[0] : 0;\r\n if (dx === 0) {\r\n if (isHorizontalSnap) {\r\n horizontalInfo.isSnap = true;\r\n horizontalInfo.pos = horizontalGuideline.pos[1];\r\n horizontalInfo.offset = endY - horizontalInfo.pos;\r\n }\r\n }\r\n else if (dy === 0) {\r\n if (isVerticalSnap) {\r\n verticalInfo.isSnap = true;\r\n verticalInfo.pos = verticalPos;\r\n verticalInfo.offset = endX - verticalPos;\r\n }\r\n }\r\n else {\r\n // y - y1 = a * (x - x1)\r\n var a = dy / dx;\r\n var b = endPos[1] - a * endX;\r\n var y = 0;\r\n var x = 0;\r\n var isSnap = false;\r\n if (isVerticalSnap) {\r\n x = verticalPos;\r\n y = a * x + b;\r\n isSnap = true;\r\n }\r\n else if (isHorizontalSnap) {\r\n y = horizontalPos;\r\n x = (y - b) / a;\r\n isSnap = true;\r\n }\r\n if (isSnap) {\r\n verticalInfo.isSnap = true;\r\n verticalInfo.pos = x;\r\n verticalInfo.offset = endX - x;\r\n horizontalInfo.isSnap = true;\r\n horizontalInfo.pos = y;\r\n horizontalInfo.offset = endY - y;\r\n }\r\n }\r\n return {\r\n vertical: verticalInfo,\r\n horizontal: horizontalInfo,\r\n };\r\n}\r\nfunction getStringDirection(dir) {\r\n var stringDirection = \"\";\r\n if (dir === -1 || dir === \"top\" || dir === \"left\") {\r\n stringDirection = \"start\";\r\n }\r\n else if (dir === 0 || dir === \"center\" || dir === \"middle\") {\r\n stringDirection = \"center\";\r\n }\r\n else if (dir === 1 || dir === \"right\" || dir === \"bottom\") {\r\n stringDirection = \"end\";\r\n }\r\n return stringDirection;\r\n}\r\nfunction checkSnaps(moveable, rect, customSnapThreshold) {\r\n var poses = splitSnapDirectionPoses(moveable.props.snapDirections, rect);\r\n var result = checkMoveableSnapPoses(moveable, poses.vertical, poses.horizontal, poses.verticalNames.map(function (name) { return getStringDirection(name); }), poses.horizontalNames.map(function (name) { return getStringDirection(name); }), customSnapThreshold);\r\n var horizontalDirection = getStringDirection(poses.horizontalNames[result.horizontal.index]);\r\n var verticalDirection = getStringDirection(poses.verticalNames[result.vertical.index]);\r\n return {\r\n vertical: __assign(__assign({}, result.vertical), { direction: verticalDirection }),\r\n horizontal: __assign(__assign({}, result.horizontal), { direction: horizontalDirection }),\r\n };\r\n}\r\nfunction getNearestSnapGuidelineInfo(snapInfo) {\r\n var isSnap = snapInfo.isSnap;\r\n if (!isSnap) {\r\n return {\r\n isSnap: false,\r\n offset: 0,\r\n dist: -1,\r\n pos: 0,\r\n guideline: null,\r\n };\r\n }\r\n var posInfo = snapInfo.posInfos[0];\r\n var guidelineInfo = posInfo.guidelineInfos[0];\r\n var offset = guidelineInfo.offset;\r\n var dist = guidelineInfo.dist;\r\n var guideline = guidelineInfo.guideline;\r\n return {\r\n isSnap: isSnap,\r\n offset: offset,\r\n dist: dist,\r\n pos: posInfo.pos,\r\n guideline: guideline,\r\n };\r\n}\r\nfunction checkSnap(guidelines, targetType, targetPoses, snapThreshold, dirs) {\r\n var _a, _b;\r\n if (dirs === void 0) { dirs = []; }\r\n if (!guidelines || !guidelines.length) {\r\n return {\r\n isSnap: false,\r\n index: -1,\r\n direction: \"\",\r\n posInfos: [],\r\n };\r\n }\r\n var isVertical = targetType === \"vertical\";\r\n var posType = isVertical ? 0 : 1;\r\n var snapPosInfos = targetPoses.map(function (targetPos, index) {\r\n var direction = dirs[index] || \"\";\r\n var guidelineInfos = guidelines.map(function (guideline) {\r\n var pos = guideline.pos;\r\n var offset = targetPos - pos[posType];\r\n return {\r\n offset: offset,\r\n dist: abs(offset),\r\n guideline: guideline,\r\n direction: direction,\r\n };\r\n }).filter(function (_a) {\r\n var guideline = _a.guideline, dist = _a.dist;\r\n var type = guideline.type;\r\n if (type !== targetType\r\n || dist > snapThreshold) {\r\n return false;\r\n }\r\n return true;\r\n }).sort(function (a, b) { return a.dist - b.dist; });\r\n return {\r\n pos: targetPos,\r\n index: index,\r\n guidelineInfos: guidelineInfos,\r\n direction: direction,\r\n };\r\n }).filter(function (snapPosInfo) {\r\n return snapPosInfo.guidelineInfos.length > 0;\r\n }).sort(function (a, b) {\r\n return a.guidelineInfos[0].dist - b.guidelineInfos[0].dist;\r\n });\r\n var isSnap = snapPosInfos.length > 0;\r\n return {\r\n isSnap: isSnap,\r\n index: isSnap ? snapPosInfos[0].index : -1,\r\n direction: (_b = (_a = snapPosInfos[0]) === null || _a === void 0 ? void 0 : _a.direction) !== null && _b !== void 0 ? _b : \"\",\r\n posInfos: snapPosInfos,\r\n };\r\n}\r\nfunction getSnapInfosByDirection(moveable, \r\n// pos1 pos2 pos3 pos4\r\nposes, snapDirection, snapThreshold) {\r\n if (snapThreshold === void 0) { snapThreshold = 1; }\r\n var dirs = [];\r\n if (snapDirection[0] && snapDirection[1]) {\r\n dirs = [\r\n snapDirection,\r\n [-snapDirection[0], snapDirection[1]],\r\n [snapDirection[0], -snapDirection[1]],\r\n ];\r\n }\r\n else if (!snapDirection[0] && !snapDirection[1]) {\r\n [\r\n [-1, -1],\r\n [1, -1],\r\n [1, 1],\r\n [-1, 1],\r\n ].forEach(function (dir, i, arr) {\r\n var nextDir = (arr[i + 1] || arr[0]);\r\n dirs.push(dir);\r\n dirs.push([\r\n (dir[0] + nextDir[0]) / 2,\r\n (dir[1] + nextDir[1]) / 2,\r\n ]);\r\n });\r\n }\r\n else {\r\n if (moveable.props.keepRatio) {\r\n dirs.push([-1, -1], [-1, 1], [1, -1], [1, 1], snapDirection);\r\n }\r\n else {\r\n dirs.push.apply(dirs, __spreadArray([], __read(getPosesByDirection([\r\n [-1, -1],\r\n [1, -1],\r\n [-1, -1],\r\n [1, 1],\r\n ], snapDirection)), false));\r\n if (dirs.length > 1) {\r\n dirs.push([\r\n (dirs[0][0] + dirs[1][0]) / 2,\r\n (dirs[0][1] + dirs[1][1]) / 2,\r\n ]);\r\n }\r\n }\r\n }\r\n var nextPoses = dirs.map(function (dir) { return getPosByDirection(poses, dir); });\r\n var xs = nextPoses.map(function (pos) { return pos[0]; });\r\n var ys = nextPoses.map(function (pos) { return pos[1]; });\r\n var result = checkMoveableSnapPoses(moveable, xs, ys, dirs.map(function (dir) { return getStringDirection(dir[0]); }), dirs.map(function (dir) { return getStringDirection(dir[1]); }), snapThreshold);\r\n var verticalDirection = getStringDirection(dirs.map(function (dir) { return dir[0]; })[result.vertical.index]);\r\n var horizontalDirection = getStringDirection(dirs.map(function (dir) { return dir[1]; })[result.horizontal.index]);\r\n return {\r\n vertical: __assign(__assign({}, result.vertical), { direction: verticalDirection }),\r\n horizontal: __assign(__assign({}, result.horizontal), { direction: horizontalDirection }),\r\n };\r\n}\r\nfunction checkSnapBoundPriority(a, b) {\r\n var aDist = abs(a.offset);\r\n var bDist = abs(b.offset);\r\n if (a.isBound && b.isBound) {\r\n return bDist - aDist;\r\n }\r\n else if (a.isBound) {\r\n return -1;\r\n }\r\n else if (b.isBound) {\r\n return 1;\r\n }\r\n else if (a.isSnap && b.isSnap) {\r\n return bDist - aDist;\r\n }\r\n else if (a.isSnap) {\r\n return -1;\r\n }\r\n else if (b.isSnap) {\r\n return 1;\r\n }\r\n else if (aDist < TINY_NUM) {\r\n return 1;\r\n }\r\n else if (bDist < TINY_NUM) {\r\n return -1;\r\n }\r\n return aDist - bDist;\r\n}\r\nfunction getNearOffsetInfo(offsets, index) {\r\n return offsets.slice().sort(function (a, b) {\r\n var aSign = a.sign[index];\r\n var bSign = b.sign[index];\r\n var aOffset = a.offset[index];\r\n var bOffset = b.offset[index];\r\n // -1 The positions of a and b do not change.\r\n // 1 The positions of a and b are reversed.\r\n if (!aSign) {\r\n return 1;\r\n }\r\n else if (!bSign) {\r\n return -1;\r\n }\r\n return checkSnapBoundPriority({ isBound: a.isBound, isSnap: a.isSnap, offset: aOffset }, { isBound: b.isBound, isSnap: b.isSnap, offset: bOffset });\r\n })[0];\r\n}\r\nfunction getCheckSnapDirections(direction, fixedDirection, keepRatio) {\r\n var directions = [];\r\n // const fixedDirection = [-direction[0], -direction[1]];\r\n if (keepRatio) {\r\n if (abs(fixedDirection[0]) !== 1 || abs(fixedDirection[1]) !== 1) {\r\n directions.push([fixedDirection, [-1, -1]], [fixedDirection, [-1, 1]], [fixedDirection, [1, -1]], [fixedDirection, [1, 1]]);\r\n }\r\n else {\r\n directions.push([fixedDirection, [direction[0], -direction[1]]], [fixedDirection, [-direction[0], direction[1]]]);\r\n }\r\n directions.push([fixedDirection, direction]);\r\n }\r\n else {\r\n if ((direction[0] && direction[1]) || (!direction[0] && !direction[1])) {\r\n var endDirection_1 = direction[0] ? direction : [1, 1];\r\n [1, -1].forEach(function (signX) {\r\n [1, -1].forEach(function (signY) {\r\n var nextDirection = [signX * endDirection_1[0], signY * endDirection_1[1]];\r\n if (fixedDirection[0] === nextDirection[0]\r\n && fixedDirection[1] === nextDirection[1]) {\r\n return;\r\n }\r\n directions.push([fixedDirection, nextDirection]);\r\n });\r\n });\r\n }\r\n else if (direction[0]) {\r\n var signs = abs(fixedDirection[0]) === 1 ? [1] : [1, -1];\r\n signs.forEach(function (sign) {\r\n directions.push([\r\n [fixedDirection[0], -1],\r\n [sign * direction[0], -1],\r\n ], [\r\n [fixedDirection[0], 0],\r\n [sign * direction[0], 0],\r\n ], [\r\n [fixedDirection[0], 1],\r\n [sign * direction[0], 1],\r\n ]);\r\n });\r\n }\r\n else if (direction[1]) {\r\n var signs = abs(fixedDirection[1]) === 1 ? [1] : [1, -1];\r\n signs.forEach(function (sign) {\r\n directions.push([\r\n [-1, fixedDirection[1]],\r\n [-1, sign * direction[1]],\r\n ], [\r\n [0, fixedDirection[1]],\r\n [0, sign * direction[1]],\r\n ], [\r\n [1, fixedDirection[1]],\r\n [1, sign * direction[1]],\r\n ]);\r\n });\r\n }\r\n }\r\n return directions;\r\n}\n\nfunction isStartLine(dot, line) {\r\n // l o => true\r\n // o l => false\r\n var cx = average([line[0][0], line[1][0]]);\r\n var cy = average([line[0][1], line[1][1]]);\r\n return {\r\n vertical: cx <= dot[0],\r\n horizontal: cy <= dot[1],\r\n };\r\n}\r\nfunction hitTestLine(dot, _a) {\r\n var _b = __read(_a, 2), pos1 = _b[0], pos2 = _b[1];\r\n var dx = pos2[0] - pos1[0];\r\n var dy = pos2[1] - pos1[1];\r\n if (abs(dx) < TINY_NUM) {\r\n dx = 0;\r\n }\r\n if (abs(dy) < TINY_NUM) {\r\n dy = 0;\r\n }\r\n var test1;\r\n var test2;\r\n if (!dx) {\r\n test1 = pos1[0];\r\n test2 = dot[0];\r\n }\r\n else if (!dy) {\r\n test1 = pos1[1];\r\n test2 = dot[1];\r\n }\r\n else {\r\n var a = dy / dx;\r\n // y = a * (x - pos1) + pos1\r\n test1 = a * (dot[0] - pos1[0]) + pos1[1];\r\n test2 = dot[1];\r\n }\r\n return test1 - test2;\r\n}\r\nfunction isSameStartLine(dots, line, centerSign, error) {\r\n if (error === void 0) { error = TINY_NUM; }\r\n return dots.every(function (dot) {\r\n var value = hitTestLine(dot, line);\r\n var sign = value <= 0;\r\n return sign === centerSign || abs(value) <= error;\r\n });\r\n}\r\nfunction checkInnerBoundDot(pos, start, end, isStart, threshold) {\r\n if (threshold === void 0) { threshold = 0; }\r\n if ((isStart && start - threshold <= pos)\r\n || (!isStart && pos <= end + threshold)) {\r\n // false 402 565 602 => 37 ([0, 37])\r\n // true 400 524.9712603540036 600 => 124 ([124, 0])\r\n // true 400 410 600 => 10 ([10, 0])\r\n return {\r\n isBound: true,\r\n offset: isStart ? start - pos : end - pos,\r\n };\r\n }\r\n return {\r\n isBound: false,\r\n offset: 0,\r\n };\r\n}\r\nfunction checkInnerBound(moveable, _a) {\r\n var line = _a.line, centerSign = _a.centerSign, verticalSign = _a.verticalSign, horizontalSign = _a.horizontalSign, lineConstants = _a.lineConstants;\r\n var bounds = moveable.props.innerBounds;\r\n if (!bounds) {\r\n return {\r\n isAllBound: false,\r\n isBound: false,\r\n isVerticalBound: false,\r\n isHorizontalBound: false,\r\n offset: [0, 0],\r\n };\r\n }\r\n var left = bounds.left, top = bounds.top, width = bounds.width, height = bounds.height;\r\n var leftLine = [[left, top], [left, top + height]];\r\n var topLine = [[left, top], [left + width, top]];\r\n var rightLine = [[left + width, top], [left + width, top + height]];\r\n var bottomLine = [[left, top + height], [left + width, top + height]];\r\n if (isSameStartLine([\r\n [left, top],\r\n [left + width, top],\r\n [left, top + height],\r\n [left + width, top + height],\r\n ], line, centerSign)) {\r\n return {\r\n isAllBound: false,\r\n isBound: false,\r\n isVerticalBound: false,\r\n isHorizontalBound: false,\r\n offset: [0, 0],\r\n };\r\n }\r\n // test vertical\r\n var topBoundInfo = checkLineBoundCollision(line, lineConstants, topLine, verticalSign);\r\n var bottomBoundInfo = checkLineBoundCollision(line, lineConstants, bottomLine, verticalSign);\r\n // test horizontal\r\n var leftBoundInfo = checkLineBoundCollision(line, lineConstants, leftLine, horizontalSign);\r\n var rightBoundInfo = checkLineBoundCollision(line, lineConstants, rightLine, horizontalSign);\r\n var isAllVerticalBound = topBoundInfo.isBound && bottomBoundInfo.isBound;\r\n var isVerticalBound = topBoundInfo.isBound || bottomBoundInfo.isBound;\r\n var isAllHorizontalBound = leftBoundInfo.isBound && rightBoundInfo.isBound;\r\n var isHorizontalBound = leftBoundInfo.isBound || rightBoundInfo.isBound;\r\n var verticalOffset = maxOffset(topBoundInfo.offset, bottomBoundInfo.offset);\r\n var horizontalOffset = maxOffset(leftBoundInfo.offset, rightBoundInfo.offset);\r\n var offset = [0, 0];\r\n var isBound = false;\r\n var isAllBound = false;\r\n if (abs(horizontalOffset) < abs(verticalOffset)) {\r\n offset = [verticalOffset, 0];\r\n isBound = isVerticalBound;\r\n isAllBound = isAllVerticalBound;\r\n }\r\n else {\r\n offset = [0, horizontalOffset];\r\n isBound = isHorizontalBound;\r\n isAllBound = isAllHorizontalBound;\r\n }\r\n return {\r\n isAllBound: isAllBound,\r\n isVerticalBound: isVerticalBound,\r\n isHorizontalBound: isHorizontalBound,\r\n isBound: isBound,\r\n offset: offset,\r\n };\r\n}\r\nfunction checkLineBoundCollision(line, _a, boundLine, isStart, threshold, isRender) {\r\n var _b = __read(_a, 2), a = _b[0], b = _b[1];\r\n var dot1 = line[0];\r\n // const dot2 = line[1];\r\n var boundDot1 = boundLine[0];\r\n var boundDot2 = boundLine[1];\r\n // const dy1 = getTinyDist(dot2[1] - dot1[1]);\r\n // const dx1 = getTinyDist(dot2[0] - dot1[0]);\r\n var dy2 = getTinyDist(boundDot2[1] - boundDot1[1]);\r\n var dx2 = getTinyDist(boundDot2[0] - boundDot1[0]);\r\n var hasDx = b;\r\n var hasDy = a;\r\n var slope = -a / b;\r\n // lineConstants\r\n // ax + by + c = 0\r\n // dx2 or dy2 is zero\r\n if (!dx2) {\r\n // vertical\r\n // by + c = 0\r\n if (isRender && !hasDy) {\r\n // 90deg\r\n return {\r\n isBound: false,\r\n offset: 0,\r\n };\r\n }\r\n else if (hasDx) {\r\n // ax + by + c = 0\r\n // const y = dy1 ? dy1 / dx1 * (boundDot1[0] - dot1[0]) + dot1[1] : dot1[1];\r\n var y = slope * (boundDot1[0] - dot1[0]) + dot1[1];\r\n // boundDot1[1] <= y <= boundDot2[1]\r\n return checkInnerBoundDot(y, boundDot1[1], boundDot2[1], isStart, threshold);\r\n }\r\n else {\r\n // ax + c = 0\r\n var offset = boundDot1[0] - dot1[0];\r\n var isBound = abs(offset) <= (threshold || 0);\r\n return {\r\n isBound: isBound,\r\n offset: isBound ? offset : 0,\r\n };\r\n }\r\n }\r\n else if (!dy2) {\r\n // horizontal\r\n if (isRender && !hasDx) {\r\n // 90deg\r\n return {\r\n isBound: false,\r\n offset: 0,\r\n };\r\n }\r\n else if (hasDy) {\r\n // y = a * (x - x1) + y1\r\n // x = (y - y1) / a + x1\r\n // const a = dy1 / dx1;\r\n // const x = dx1 ? (boundDot1[1] - dot1[1]) / a + dot1[0] : dot1[0];\r\n var x = (boundDot1[1] - dot1[1]) / slope + dot1[0];\r\n // boundDot1[0] <= x && x <= boundDot2[0]\r\n return checkInnerBoundDot(x, boundDot1[0], boundDot2[0], isStart, threshold);\r\n }\r\n else {\r\n var offset = boundDot1[1] - dot1[1];\r\n var isBound = abs(offset) <= (threshold || 0);\r\n return {\r\n isBound: isBound,\r\n offset: isBound ? offset : 0,\r\n };\r\n }\r\n }\r\n return {\r\n isBound: false,\r\n offset: 0,\r\n };\r\n}\r\nfunction getInnerBoundInfo(moveable, lineInfos, datas) {\r\n return lineInfos.map(function (info) {\r\n var _a = checkInnerBound(moveable, info), isBound = _a.isBound, offset = _a.offset, isVerticalBound = _a.isVerticalBound, isHorizontalBound = _a.isHorizontalBound;\r\n var multiple = info.multiple;\r\n var sizeOffset = getDragDist({\r\n datas: datas,\r\n distX: offset[0],\r\n distY: offset[1],\r\n }).map(function (size, i) { return size * (multiple[i] ? 2 / multiple[i] : 0); });\r\n return {\r\n sign: multiple,\r\n isBound: isBound,\r\n isVerticalBound: isVerticalBound,\r\n isHorizontalBound: isHorizontalBound,\r\n isSnap: false,\r\n offset: sizeOffset,\r\n };\r\n });\r\n}\r\nfunction getInnerBoundDragInfo(moveable, poses, datas) {\r\n var _a;\r\n var lines = getCheckInnerBoundLineInfos(moveable, poses, [0, 0], false).map(function (info) {\r\n return __assign(__assign({}, info), { multiple: info.multiple.map(function (dir) { return abs(dir) * 2; }) });\r\n });\r\n var innerBoundInfo = getInnerBoundInfo(moveable, lines, datas);\r\n var widthOffsetInfo = getNearOffsetInfo(innerBoundInfo, 0);\r\n var heightOffsetInfo = getNearOffsetInfo(innerBoundInfo, 1);\r\n var verticalOffset = 0;\r\n var horizontalOffset = 0;\r\n var isVerticalBound = widthOffsetInfo.isVerticalBound || heightOffsetInfo.isVerticalBound;\r\n var isHorizontalBound = widthOffsetInfo.isHorizontalBound || heightOffsetInfo.isHorizontalBound;\r\n if (isVerticalBound || isHorizontalBound) {\r\n _a = __read(getInverseDragDist({\r\n datas: datas,\r\n distX: -widthOffsetInfo.offset[0],\r\n distY: -heightOffsetInfo.offset[1],\r\n }), 2), verticalOffset = _a[0], horizontalOffset = _a[1];\r\n }\r\n return {\r\n vertical: {\r\n isBound: isVerticalBound,\r\n offset: verticalOffset,\r\n },\r\n horizontal: {\r\n isBound: isHorizontalBound,\r\n offset: horizontalOffset,\r\n },\r\n };\r\n}\r\nfunction getCheckSnapLineDirections(direction, keepRatio) {\r\n var lineDirections = [];\r\n var x = direction[0];\r\n var y = direction[1];\r\n if (x && y) {\r\n lineDirections.push([[0, y * 2], direction, [-x, y]], [[x * 2, 0], direction, [x, -y]]);\r\n }\r\n else if (x) {\r\n // vertcal\r\n lineDirections.push([[x * 2, 0], [x, 1], [x, -1]]);\r\n if (keepRatio) {\r\n lineDirections.push([[0, -1], [x, -1], [-x, -1]], [[0, 1], [x, 1], [-x, 1]]);\r\n }\r\n }\r\n else if (y) {\r\n // horizontal\r\n lineDirections.push([[0, y * 2], [1, y], [-1, y]]);\r\n if (keepRatio) {\r\n lineDirections.push([[-1, 0], [-1, y], [-1, -y]], [[1, 0], [1, y], [1, -y]]);\r\n }\r\n }\r\n else {\r\n // [0, 0] to all direction\r\n lineDirections.push([[-1, 0], [-1, -1], [-1, 1]], [[1, 0], [1, -1], [1, 1]], [[0, -1], [-1, -1], [1, -1]], [[0, 1], [-1, 1], [1, 1]]);\r\n }\r\n return lineDirections;\r\n}\r\nfunction getCheckInnerBoundLineInfos(moveable, poses, direction, keepRatio) {\r\n var _a = moveable.state, allMatrix = _a.allMatrix, is3d = _a.is3d;\r\n var virtualPoses = calculatePoses(allMatrix, 100, 100, is3d ? 4 : 3);\r\n var center = getPosByDirection(virtualPoses, [0, 0]);\r\n return getCheckSnapLineDirections(direction, keepRatio).map(function (_a) {\r\n var _b = __read(_a, 3), multiple = _b[0], dir1 = _b[1], dir2 = _b[2];\r\n var virtualLine = [\r\n getPosByDirection(virtualPoses, dir1),\r\n getPosByDirection(virtualPoses, dir2),\r\n ];\r\n var lineConstants = solveLineConstants(virtualLine);\r\n var _c = isStartLine(center, virtualLine), verticalSign = _c.vertical, horizontalSign = _c.horizontal;\r\n var centerSign = hitTestLine(center, virtualLine) <= 0;\r\n return {\r\n multiple: multiple,\r\n centerSign: centerSign,\r\n verticalSign: verticalSign,\r\n horizontalSign: horizontalSign,\r\n lineConstants: lineConstants,\r\n line: [\r\n getPosByDirection(poses, dir1),\r\n getPosByDirection(poses, dir2),\r\n ],\r\n };\r\n });\r\n}\r\nfunction isBoundRotate(relativePoses, boundDots, center, rad) {\r\n var nextPoses = rad ? relativePoses.map(function (pos) { return rotate(pos, rad); }) : relativePoses;\r\n return [\r\n [nextPoses[0], nextPoses[1]],\r\n [nextPoses[1], nextPoses[3]],\r\n [nextPoses[3], nextPoses[2]],\r\n [nextPoses[2], nextPoses[0]],\r\n ].some(function (line) {\r\n var centerSign = hitTestLine(center, line) <= 0;\r\n return !isSameStartLine(boundDots, line, centerSign);\r\n });\r\n}\r\nfunction getDistPointLine(_a) {\r\n // x = 0, y = 0\r\n // d = (ax + by + c) / root(a2 + b2)\r\n var _b = __read(_a, 2), pos1 = _b[0], pos2 = _b[1];\r\n var dx = pos2[0] - pos1[0];\r\n var dy = pos2[1] - pos1[1];\r\n if (!dx) {\r\n return abs(pos1[0]);\r\n }\r\n if (!dy) {\r\n return abs(pos1[1]);\r\n }\r\n // y - y1 = a(x - x1)\r\n // 0 = ax -y + -a * x1 + y1\r\n var a = dy / dx;\r\n return abs((-a * pos1[0] + pos1[1]) / Math.sqrt(Math.pow(a, 2) + 1));\r\n}\r\nfunction solveReverseLine(_a) {\r\n var _b = __read(_a, 2), pos1 = _b[0], pos2 = _b[1];\r\n var dx = pos2[0] - pos1[0];\r\n var dy = pos2[1] - pos1[1];\r\n if (!dx) {\r\n return [pos1[0], 0];\r\n }\r\n if (!dy) {\r\n return [0, pos1[1]];\r\n }\r\n var a = dy / dx;\r\n // y - y1 = a (x - x1)\r\n // y = ax - a * x1 + y1\r\n var b = -a * pos1[0] + pos1[1];\r\n // y = ax + b = -1/a x\r\n // x = -b / (a + 1 / a)\r\n // y = b / (1 + 1 / a^2)\r\n return [\r\n -b / (a + 1 / a),\r\n b / ((a * a) + 1),\r\n ];\r\n}\r\nfunction checkRotateInnerBounds(moveable, prevPoses, nextPoses, origin, rotation) {\r\n var bounds = moveable.props.innerBounds;\r\n var rad = rotation * Math.PI / 180;\r\n if (!bounds) {\r\n return [];\r\n }\r\n var left = bounds.left, top = bounds.top, width = bounds.width, height = bounds.height;\r\n var relativeLeft = left - origin[0];\r\n var relativeRight = left + width - origin[0];\r\n var relativeTop = top - origin[1];\r\n var relativeBottom = top + height - origin[1];\r\n var dots = [\r\n [relativeLeft, relativeTop],\r\n [relativeRight, relativeTop],\r\n [relativeLeft, relativeBottom],\r\n [relativeRight, relativeBottom],\r\n ];\r\n var center = getPosByDirection(nextPoses, [0, 0]);\r\n if (!isBoundRotate(nextPoses, dots, center, 0)) {\r\n return [];\r\n }\r\n var result = [];\r\n var dotInfos = dots.map(function (dot) { return [\r\n getDistSize(dot),\r\n getRad([0, 0], dot),\r\n ]; });\r\n [\r\n [nextPoses[0], nextPoses[1]],\r\n [nextPoses[1], nextPoses[3]],\r\n [nextPoses[3], nextPoses[2]],\r\n [nextPoses[2], nextPoses[0]],\r\n ].forEach(function (line) {\r\n var lineRad = getRad([0, 0], solveReverseLine(line));\r\n var lineDist = getDistPointLine(line);\r\n result.push.apply(result, __spreadArray([], __read(dotInfos\r\n .filter(function (_a) {\r\n var _b = __read(_a, 1), dotDist = _b[0];\r\n return dotDist && lineDist <= dotDist;\r\n })\r\n .map(function (_a) {\r\n var _b = __read(_a, 2), dotDist = _b[0], dotRad = _b[1];\r\n var distRad = Math.acos(dotDist ? lineDist / dotDist : 0);\r\n var nextRad1 = dotRad + distRad;\r\n var nextRad2 = dotRad - distRad;\r\n return [\r\n rad + nextRad1 - lineRad,\r\n rad + nextRad2 - lineRad,\r\n ];\r\n })\r\n .reduce(function (prev, cur) {\r\n prev.push.apply(prev, __spreadArray([], __read(cur), false));\r\n return prev;\r\n }, [])\r\n .filter(function (nextRad) { return !isBoundRotate(prevPoses, dots, center, nextRad); })\r\n .map(function (nextRad) { return throttle(nextRad * 180 / Math.PI, TINY_NUM); })), false));\r\n });\r\n return result;\r\n}\r\nfunction checkInnerBoundPoses(moveable) {\r\n var innerBounds = moveable.props.innerBounds;\r\n var boundMap = getInitialBounds();\r\n if (!innerBounds) {\r\n return {\r\n boundMap: boundMap,\r\n vertical: [],\r\n horizontal: [],\r\n };\r\n }\r\n var _a = moveable.getRect(), pos1 = _a.pos1, pos2 = _a.pos2, pos3 = _a.pos3, pos4 = _a.pos4;\r\n var poses = [pos1, pos2, pos3, pos4];\r\n var center = getPosByDirection(poses, [0, 0]);\r\n var left = innerBounds.left, top = innerBounds.top, width = innerBounds.width, height = innerBounds.height;\r\n var leftLine = [[left, top], [left, top + height]];\r\n var topLine = [[left, top], [left + width, top]];\r\n var rightLine = [[left + width, top], [left + width, top + height]];\r\n var bottomLine = [[left, top + height], [left + width, top + height]];\r\n var lineInfos = getCheckInnerBoundLineInfos(moveable, poses, [0, 0], false);\r\n var horizontalPoses = [];\r\n var verticalPoses = [];\r\n lineInfos.forEach(function (lineInfo) {\r\n var line = lineInfo.line, lineConstants = lineInfo.lineConstants;\r\n var _a = isStartLine(center, line), isHorizontalStart = _a.horizontal, isVerticalStart = _a.vertical;\r\n // test vertical\r\n var topBoundInfo = checkLineBoundCollision(line, lineConstants, topLine, isVerticalStart, 1, true);\r\n var bottomBoundInfo = checkLineBoundCollision(line, lineConstants, bottomLine, isVerticalStart, 1, true);\r\n // test horizontal\r\n var leftBoundInfo = checkLineBoundCollision(line, lineConstants, leftLine, isHorizontalStart, 1, true);\r\n var rightBoundInfo = checkLineBoundCollision(line, lineConstants, rightLine, isHorizontalStart, 1, true);\r\n if (topBoundInfo.isBound && !boundMap.top) {\r\n horizontalPoses.push(top);\r\n boundMap.top = true;\r\n }\r\n if (bottomBoundInfo.isBound && !boundMap.bottom) {\r\n horizontalPoses.push(top + height);\r\n boundMap.bottom = true;\r\n }\r\n if (leftBoundInfo.isBound && !boundMap.left) {\r\n verticalPoses.push(left);\r\n boundMap.left = true;\r\n }\r\n if (rightBoundInfo.isBound && !boundMap.right) {\r\n verticalPoses.push(left + width);\r\n boundMap.right = true;\r\n }\r\n });\r\n return {\r\n boundMap: boundMap,\r\n horizontal: horizontalPoses,\r\n vertical: verticalPoses,\r\n };\r\n}\n\nfunction solveEquation(pos1, pos2, snapOffset, isVertical) {\r\n var dx = pos2[0] - pos1[0];\r\n var dy = pos2[1] - pos1[1];\r\n if (abs(dx) < TINY_NUM$1) {\r\n dx = 0;\r\n }\r\n if (abs(dy) < TINY_NUM$1) {\r\n dy = 0;\r\n }\r\n if (!dx) {\r\n // y = 0 * x + b\r\n // only horizontal\r\n if (!isVertical) {\r\n return [0, snapOffset];\r\n }\r\n return [0, 0];\r\n }\r\n if (!dy) {\r\n // only vertical\r\n if (isVertical) {\r\n return [snapOffset, 0];\r\n }\r\n return [0, 0];\r\n }\r\n // y = ax + b\r\n var a = dy / dx;\r\n var b = pos1[1] - a * pos1[0];\r\n if (isVertical) {\r\n // y = a * x + b\r\n var y = a * (pos2[0] + snapOffset) + b;\r\n return [snapOffset, y - pos2[1]];\r\n }\r\n else {\r\n // x = (y - b) / a\r\n var x = (pos2[1] + snapOffset - b) / a;\r\n return [x - pos2[0], snapOffset];\r\n }\r\n}\r\nfunction solveNextOffset(pos1, pos2, offset, isVertical, datas) {\r\n var sizeOffset = solveEquation(pos1, pos2, offset, isVertical);\r\n if (!sizeOffset) {\r\n return {\r\n isOutside: false,\r\n offset: [0, 0],\r\n };\r\n }\r\n var size = getDist$1(pos1, pos2);\r\n var dist1 = getDist$1(sizeOffset, pos1);\r\n var dist2 = getDist$1(sizeOffset, pos2);\r\n var isOutside = dist1 > size || dist2 > size;\r\n var _a = __read(getDragDist({\r\n datas: datas,\r\n distX: sizeOffset[0],\r\n distY: sizeOffset[1],\r\n }), 2), widthOffset = _a[0], heightOffset = _a[1];\r\n return {\r\n offset: [widthOffset, heightOffset],\r\n isOutside: isOutside,\r\n };\r\n}\r\nfunction getSnapBound(boundInfo, snapInfo) {\r\n if (boundInfo.isBound) {\r\n return boundInfo.offset;\r\n }\r\n else if (snapInfo.isSnap) {\r\n return getNearestSnapGuidelineInfo(snapInfo).offset;\r\n }\r\n return 0;\r\n}\r\nfunction checkThrottleDragRotate(throttleDragRotate, _a, _b, _c, _d) {\r\n var _e = __read(_a, 2), distX = _e[0], distY = _e[1];\r\n var _f = __read(_b, 2), isVerticalBound = _f[0], isHorizontalBound = _f[1];\r\n var _g = __read(_c, 2), isVerticalSnap = _g[0], isHorizontalSnap = _g[1];\r\n var _h = __read(_d, 2), verticalOffset = _h[0], horizontalOffset = _h[1];\r\n var offsetX = -verticalOffset;\r\n var offsetY = -horizontalOffset;\r\n if (throttleDragRotate && distX && distY) {\r\n offsetX = 0;\r\n offsetY = 0;\r\n var adjustPoses = [];\r\n if (isVerticalBound && isHorizontalBound) {\r\n adjustPoses.push([0, horizontalOffset], [verticalOffset, 0]);\r\n }\r\n else if (isVerticalBound) {\r\n adjustPoses.push([verticalOffset, 0]);\r\n }\r\n else if (isHorizontalBound) {\r\n adjustPoses.push([0, horizontalOffset]);\r\n }\r\n else if (isVerticalSnap && isHorizontalSnap) {\r\n adjustPoses.push([0, horizontalOffset], [verticalOffset, 0]);\r\n }\r\n else if (isVerticalSnap) {\r\n adjustPoses.push([verticalOffset, 0]);\r\n }\r\n else if (isHorizontalSnap) {\r\n adjustPoses.push([0, horizontalOffset]);\r\n }\r\n if (adjustPoses.length) {\r\n adjustPoses.sort(function (a, b) {\r\n return (getDistSize(minus([distX, distY], a)) -\r\n getDistSize(minus([distX, distY], b)));\r\n });\r\n var adjustPos = adjustPoses[0];\r\n if (adjustPos[0] && abs(distX) > TINY_NUM$1) {\r\n offsetX = -adjustPos[0];\r\n offsetY =\r\n (distY * abs(distX + offsetX)) / abs(distX) -\r\n distY;\r\n }\r\n else if (adjustPos[1] && abs(distY) > TINY_NUM$1) {\r\n var prevDistY = distY;\r\n offsetY = -adjustPos[1];\r\n offsetX =\r\n (distX * abs(distY + offsetY)) / abs(prevDistY) -\r\n distX;\r\n }\r\n if (throttleDragRotate && isHorizontalBound && isVerticalBound) {\r\n if (abs(offsetX) > TINY_NUM$1 &&\r\n abs(offsetX) < abs(verticalOffset)) {\r\n var scale = abs(verticalOffset) / abs(offsetX);\r\n offsetX *= scale;\r\n offsetY *= scale;\r\n }\r\n else if (abs(offsetY) > TINY_NUM$1 &&\r\n abs(offsetY) < abs(horizontalOffset)) {\r\n var scale = abs(horizontalOffset) / abs(offsetY);\r\n offsetX *= scale;\r\n offsetY *= scale;\r\n }\r\n else {\r\n offsetX = maxOffset(-verticalOffset, offsetX);\r\n offsetY = maxOffset(-horizontalOffset, offsetY);\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n offsetX = distX || isVerticalBound ? -verticalOffset : 0;\r\n offsetY = distY || isHorizontalBound ? -horizontalOffset : 0;\r\n }\r\n return [offsetX, offsetY];\r\n}\r\nfunction checkSnapBoundsDrag(moveable, distX, distY, throttleDragRotate, ignoreSnap, datas) {\r\n if (!hasGuidelines(moveable, \"draggable\")) {\r\n return [\r\n {\r\n isSnap: false,\r\n isBound: false,\r\n offset: 0,\r\n },\r\n {\r\n isSnap: false,\r\n isBound: false,\r\n offset: 0,\r\n },\r\n ];\r\n }\r\n var poses = getAbsolutePoses(datas.absolutePoses, [distX, distY]);\r\n var _a = getRect(poses), left = _a.left, right = _a.right, top = _a.top, bottom = _a.bottom;\r\n var boundPoses = {\r\n horizontal: poses.map(function (pos) { return pos[1]; }),\r\n vertical: poses.map(function (pos) { return pos[0]; }),\r\n };\r\n var snapDirections = getSnapDirections(moveable.props.snapDirections);\r\n var snapPoses = splitSnapDirectionPoses(snapDirections, {\r\n left: left,\r\n right: right,\r\n top: top,\r\n bottom: bottom,\r\n center: (left + right) / 2,\r\n middle: (top + bottom) / 2,\r\n });\r\n var _b = checkMoveableSnapBounds(moveable, ignoreSnap, snapPoses, boundPoses), verticalSnapBoundInfo = _b.vertical, horizontalSnapBoundInfo = _b.horizontal;\r\n var _c = getInnerBoundDragInfo(moveable, poses, datas), verticalInnerBoundInfo = _c.vertical, horizontalInnerBoundInfo = _c.horizontal;\r\n var isVerticalSnap = verticalSnapBoundInfo.isSnap;\r\n var isHorizontalSnap = horizontalSnapBoundInfo.isSnap;\r\n var isVerticalBound = verticalSnapBoundInfo.isBound || verticalInnerBoundInfo.isBound;\r\n var isHorizontalBound = horizontalSnapBoundInfo.isBound || horizontalInnerBoundInfo.isBound;\r\n var verticalOffset = maxOffset(verticalSnapBoundInfo.offset, verticalInnerBoundInfo.offset);\r\n var horizontalOffset = maxOffset(horizontalSnapBoundInfo.offset, horizontalInnerBoundInfo.offset);\r\n var _d = __read(checkThrottleDragRotate(throttleDragRotate, [distX, distY], [isVerticalBound, isHorizontalBound], [isVerticalSnap, isHorizontalSnap], [verticalOffset, horizontalOffset]), 2), offsetX = _d[0], offsetY = _d[1];\r\n return [\r\n {\r\n isBound: isVerticalBound,\r\n isSnap: isVerticalSnap,\r\n offset: offsetX,\r\n },\r\n {\r\n isBound: isHorizontalBound,\r\n isSnap: isHorizontalSnap,\r\n offset: offsetY,\r\n },\r\n ];\r\n}\r\nfunction checkMoveableSnapBounds(moveable, ignoreSnap, poses, boundPoses) {\r\n if (boundPoses === void 0) { boundPoses = poses; }\r\n var _a = checkBoundPoses(getBounds(moveable), boundPoses.vertical, boundPoses.horizontal), horizontalBoundInfos = _a.horizontal, verticalBoundInfos = _a.vertical;\r\n var _b = ignoreSnap ? {\r\n horizontal: { isSnap: false, index: -1 },\r\n vertical: { isSnap: false, index: -1 },\r\n } : checkMoveableSnapPoses(moveable, poses.vertical, poses.horizontal), horizontalSnapInfo = _b.horizontal, verticalSnapInfo = _b.vertical;\r\n var horizontalOffset = getSnapBound(horizontalBoundInfos[0], horizontalSnapInfo);\r\n var verticalOffset = getSnapBound(verticalBoundInfos[0], verticalSnapInfo);\r\n var horizontalDist = abs(horizontalOffset);\r\n var verticalDist = abs(verticalOffset);\r\n return {\r\n horizontal: {\r\n isBound: horizontalBoundInfos[0].isBound,\r\n isSnap: horizontalSnapInfo.isSnap,\r\n snapIndex: horizontalSnapInfo.index,\r\n offset: horizontalOffset,\r\n dist: horizontalDist,\r\n bounds: horizontalBoundInfos,\r\n snap: horizontalSnapInfo,\r\n },\r\n vertical: {\r\n isBound: verticalBoundInfos[0].isBound,\r\n isSnap: verticalSnapInfo.isSnap,\r\n snapIndex: verticalSnapInfo.index,\r\n offset: verticalOffset,\r\n dist: verticalDist,\r\n bounds: verticalBoundInfos,\r\n snap: verticalSnapInfo,\r\n },\r\n };\r\n}\r\nfunction checkSnapBounds(guideines, bounds, posesX, posesY, snapThreshold, multiples) {\r\n if (multiples === void 0) { multiples = [1, 1]; }\r\n var _a = checkBoundPoses(bounds, posesX, posesY), horizontalBoundInfos = _a.horizontal, verticalBoundInfos = _a.vertical;\r\n // options.isRequest ? {\r\n // horizontal: { isSnap: false, index: -1 } as SnapInfo,\r\n // vertical: { isSnap: false, index: -1 } as SnapInfo,\r\n // } :\r\n var _b = checkSnapPoses(guideines, posesX, posesY, [], [], snapThreshold, multiples), horizontalSnapInfo = _b.horizontal, verticalSnapInfo = _b.vertical;\r\n var horizontalOffset = getSnapBound(horizontalBoundInfos[0], horizontalSnapInfo);\r\n var verticalOffset = getSnapBound(verticalBoundInfos[0], verticalSnapInfo);\r\n var horizontalDist = abs(horizontalOffset);\r\n var verticalDist = abs(verticalOffset);\r\n return {\r\n horizontal: {\r\n isBound: horizontalBoundInfos[0].isBound,\r\n isSnap: horizontalSnapInfo.isSnap,\r\n snapIndex: horizontalSnapInfo.index,\r\n offset: horizontalOffset,\r\n dist: horizontalDist,\r\n bounds: horizontalBoundInfos,\r\n snap: horizontalSnapInfo,\r\n },\r\n vertical: {\r\n isBound: verticalBoundInfos[0].isBound,\r\n isSnap: verticalSnapInfo.isSnap,\r\n snapIndex: verticalSnapInfo.index,\r\n offset: verticalOffset,\r\n dist: verticalDist,\r\n bounds: verticalBoundInfos,\r\n snap: verticalSnapInfo,\r\n },\r\n };\r\n}\r\nfunction checkSnapRightLine(startPos, endPos, snapBoundInfo, keepRatio) {\r\n var rad = (getRad(startPos, endPos) / Math.PI) * 180;\r\n var _a = snapBoundInfo.vertical, isVerticalBound = _a.isBound, isVerticalSnap = _a.isSnap, verticalDist = _a.dist, _b = snapBoundInfo.horizontal, isHorizontalBound = _b.isBound, isHorizontalSnap = _b.isSnap, horizontalDist = _b.dist;\r\n var rad180 = rad % 180;\r\n var isHorizontalLine = rad180 < 3 || rad180 > 177;\r\n var isVerticalLine = rad180 > 87 && rad180 < 93;\r\n if (horizontalDist < verticalDist) {\r\n if (isVerticalBound ||\r\n (isVerticalSnap &&\r\n !isVerticalLine &&\r\n (!keepRatio || !isHorizontalLine))) {\r\n return \"vertical\";\r\n }\r\n }\r\n if (isHorizontalBound ||\r\n (isHorizontalSnap &&\r\n !isHorizontalLine &&\r\n (!keepRatio || !isVerticalLine))) {\r\n return \"horizontal\";\r\n }\r\n return \"\";\r\n}\r\nfunction getSnapBoundInfo(moveable, poses, directions, keepRatio, isRequest, datas) {\r\n return directions.map(function (_a) {\r\n var _b = __read(_a, 2), startDirection = _b[0], endDirection = _b[1];\r\n var otherStartPos = getPosByDirection(poses, startDirection);\r\n var otherEndPos = getPosByDirection(poses, endDirection);\r\n var snapBoundInfo = keepRatio\r\n ? checkSnapBoundsKeepRatio(moveable, otherStartPos, otherEndPos, isRequest)\r\n : checkMoveableSnapBounds(moveable, isRequest, {\r\n vertical: [otherEndPos[0]],\r\n horizontal: [otherEndPos[1]],\r\n });\r\n var _c = snapBoundInfo.horizontal, \r\n // dist: otherHorizontalDist,\r\n otherHorizontalOffset = _c.offset, isOtherHorizontalBound = _c.isBound, isOtherHorizontalSnap = _c.isSnap, _d = snapBoundInfo.vertical, \r\n // dist: otherVerticalDist,\r\n otherVerticalOffset = _d.offset, isOtherVerticalBound = _d.isBound, isOtherVerticalSnap = _d.isSnap;\r\n var multiple = minus(endDirection, startDirection);\r\n if (!otherVerticalOffset && !otherHorizontalOffset) {\r\n return {\r\n isBound: isOtherVerticalBound || isOtherHorizontalBound,\r\n isSnap: isOtherVerticalSnap || isOtherHorizontalSnap,\r\n sign: multiple,\r\n offset: [0, 0],\r\n };\r\n }\r\n var snapLine = checkSnapRightLine(otherStartPos, otherEndPos, snapBoundInfo, keepRatio);\r\n if (!snapLine) {\r\n return {\r\n sign: multiple,\r\n isBound: false,\r\n isSnap: false,\r\n offset: [0, 0],\r\n };\r\n }\r\n var isVertical = snapLine === \"vertical\";\r\n var sizeOffset = [0, 0];\r\n if (!keepRatio\r\n && abs(endDirection[0]) === 1\r\n && abs(endDirection[1]) === 1\r\n && startDirection[0] !== endDirection[0]\r\n && startDirection[1] !== endDirection[1]) {\r\n sizeOffset = getDragDist({\r\n datas: datas,\r\n distX: -otherVerticalOffset,\r\n distY: -otherHorizontalOffset,\r\n });\r\n }\r\n else {\r\n sizeOffset = solveNextOffset(otherStartPos, otherEndPos, -(isVertical ? otherVerticalOffset : otherHorizontalOffset), isVertical, datas).offset;\r\n }\r\n sizeOffset = sizeOffset.map(function (size, i) { return size * (multiple[i] ? 2 / multiple[i] : 0); });\r\n return {\r\n sign: multiple,\r\n isBound: isVertical ? isOtherVerticalBound : isOtherHorizontalBound,\r\n isSnap: isVertical ? isOtherVerticalSnap : isOtherHorizontalSnap,\r\n offset: sizeOffset,\r\n };\r\n });\r\n}\r\nfunction getSnapBoundOffset(boundInfo, snapInfo) {\r\n if (boundInfo.isBound) {\r\n return boundInfo.offset;\r\n }\r\n else if (snapInfo.isSnap) {\r\n return snapInfo.offset;\r\n }\r\n return 0;\r\n}\r\nfunction checkSnapBoundsKeepRatio(moveable, startPos, endPos, isRequest) {\r\n var _a = checkBoundKeepRatio(moveable, startPos, endPos), horizontalBoundInfo = _a.horizontal, verticalBoundInfo = _a.vertical;\r\n var _b = isRequest ? {\r\n horizontal: { isSnap: false },\r\n vertical: { isSnap: false },\r\n } : checkSnapKeepRatio(moveable, startPos, endPos), horizontalSnapInfo = _b.horizontal, verticalSnapInfo = _b.vertical;\r\n var horizontalOffset = getSnapBoundOffset(horizontalBoundInfo, horizontalSnapInfo);\r\n var verticalOffset = getSnapBoundOffset(verticalBoundInfo, verticalSnapInfo);\r\n var horizontalDist = abs(horizontalOffset);\r\n var verticalDist = abs(verticalOffset);\r\n return {\r\n horizontal: {\r\n isBound: horizontalBoundInfo.isBound,\r\n isSnap: horizontalSnapInfo.isSnap,\r\n offset: horizontalOffset,\r\n dist: horizontalDist,\r\n },\r\n vertical: {\r\n isBound: verticalBoundInfo.isBound,\r\n isSnap: verticalSnapInfo.isSnap,\r\n offset: verticalOffset,\r\n dist: verticalDist,\r\n },\r\n };\r\n}\r\nfunction checkMaxBounds(moveable, poses, direction, fixedPosition, datas) {\r\n var fixedDirection = [-direction[0], -direction[1]];\r\n var _a = moveable.state, width = _a.width, height = _a.height;\r\n var bounds = moveable.props.bounds;\r\n var maxWidth = Infinity;\r\n var maxHeight = Infinity;\r\n if (bounds) {\r\n var directions = [\r\n [direction[0], -direction[1]],\r\n [-direction[0], direction[1]],\r\n ];\r\n var _b = bounds.left, left_1 = _b === void 0 ? -Infinity : _b, _c = bounds.top, top_1 = _c === void 0 ? -Infinity : _c, _d = bounds.right, right_1 = _d === void 0 ? Infinity : _d, _e = bounds.bottom, bottom_1 = _e === void 0 ? Infinity : _e;\r\n directions.forEach(function (otherDirection) {\r\n var isCheckVertical = otherDirection[0] !== fixedDirection[0];\r\n var isCheckHorizontal = otherDirection[1] !== fixedDirection[1];\r\n var otherPos = getPosByDirection(poses, otherDirection);\r\n var deg = (getRad(fixedPosition, otherPos) * 360) / Math.PI;\r\n if (isCheckHorizontal) {\r\n var nextOtherPos = otherPos.slice();\r\n if (abs(deg - 360) < 2 || abs(deg - 180) < 2) {\r\n nextOtherPos[1] = fixedPosition[1];\r\n }\r\n var _a = solveNextOffset(fixedPosition, nextOtherPos, (fixedPosition[1] < otherPos[1] ? bottom_1 : top_1) -\r\n otherPos[1], false, datas), _b = __read(_a.offset, 2), heightOffset = _b[1], isHeightOutside = _a.isOutside;\r\n if (!isNaN(heightOffset)) {\r\n maxHeight = height + (isHeightOutside ? 1 : -1) * abs(heightOffset);\r\n }\r\n }\r\n if (isCheckVertical) {\r\n var nextOtherPos = otherPos.slice();\r\n if (abs(deg - 90) < 2 || abs(deg - 270) < 2) {\r\n nextOtherPos[0] = fixedPosition[0];\r\n }\r\n var _c = solveNextOffset(fixedPosition, nextOtherPos, (fixedPosition[0] < otherPos[0] ? right_1 : left_1) - otherPos[0], true, datas), _d = __read(_c.offset, 1), widthOffset = _d[0], isWidthOutside = _c.isOutside;\r\n if (!isNaN(widthOffset)) {\r\n maxWidth = width + (isWidthOutside ? 1 : -1) * abs(widthOffset);\r\n }\r\n }\r\n });\r\n }\r\n return {\r\n maxWidth: maxWidth,\r\n maxHeight: maxHeight,\r\n };\r\n}\n\n/**\r\n * @namespace Draggable\r\n * @memberof Moveable\r\n * @description Draggable refers to the ability to drag and move targets.\r\n */\r\nvar Draggable = {\r\n name: \"draggable\",\r\n props: [\r\n \"draggable\",\r\n \"throttleDrag\",\r\n \"throttleDragRotate\",\r\n \"hideThrottleDragRotateLine\",\r\n \"startDragRotate\",\r\n \"edgeDraggable\",\r\n ],\r\n events: [\r\n \"dragStart\",\r\n \"drag\",\r\n \"dragEnd\",\r\n \"dragGroupStart\",\r\n \"dragGroup\",\r\n \"dragGroupEnd\",\r\n ],\r\n requestStyle: function () {\r\n return [\"left\", \"top\", \"right\", \"bottom\"];\r\n },\r\n requestChildStyle: function () {\r\n return [\"left\", \"top\", \"right\", \"bottom\"];\r\n },\r\n render: function (moveable, React) {\r\n var _a = moveable.props, hideThrottleDragRotateLine = _a.hideThrottleDragRotateLine, throttleDragRotate = _a.throttleDragRotate, zoom = _a.zoom;\r\n var _b = moveable.getState(), dragInfo = _b.dragInfo, beforeOrigin = _b.beforeOrigin;\r\n if (hideThrottleDragRotateLine || !throttleDragRotate || !dragInfo) {\r\n return [];\r\n }\r\n var dist = dragInfo.dist;\r\n if (!dist[0] && !dist[1]) {\r\n return [];\r\n }\r\n var width = getDistSize(dist);\r\n var rad = getRad(dist, [0, 0]);\r\n return [React.createElement(\"div\", { className: prefix(\"line\", \"horizontal\", \"dragline\", \"dashed\"), key: \"dragRotateGuideline\", style: {\r\n width: \"\".concat(width, \"px\"),\r\n transform: \"translate(\".concat(beforeOrigin[0], \"px, \").concat(beforeOrigin[1], \"px) rotate(\").concat(rad, \"rad) scaleY(\").concat(zoom, \")\"),\r\n } })];\r\n },\r\n dragStart: function (moveable, e) {\r\n var datas = e.datas, parentEvent = e.parentEvent, parentGesto = e.parentGesto;\r\n var state = moveable.state;\r\n var gestos = state.gestos, style = state.style;\r\n if (gestos.draggable) {\r\n return false;\r\n }\r\n gestos.draggable = parentGesto || moveable.targetGesto;\r\n datas.datas = {};\r\n datas.left = parseFloat(style.left || \"\") || 0;\r\n datas.top = parseFloat(style.top || \"\") || 0;\r\n datas.bottom = parseFloat(style.bottom || \"\") || 0;\r\n datas.right = parseFloat(style.right || \"\") || 0;\r\n datas.startValue = [0, 0];\r\n setDragStart(moveable, e);\r\n setDefaultTransformIndex(moveable, e, \"translate\");\r\n startCheckSnapDrag(moveable, datas);\r\n datas.prevDist = [0, 0];\r\n datas.prevBeforeDist = [0, 0];\r\n datas.isDrag = false;\r\n datas.deltaOffset = [0, 0];\r\n var params = fillParams(moveable, e, __assign({ set: function (translate) {\r\n datas.startValue = translate;\r\n } }, fillTransformStartEvent(moveable, e)));\r\n var result = parentEvent || triggerEvent(moveable, \"onDragStart\", params);\r\n if (result !== false) {\r\n datas.isDrag = true;\r\n moveable.state.dragInfo = {\r\n startRect: moveable.getRect(),\r\n dist: [0, 0],\r\n };\r\n }\r\n else {\r\n gestos.draggable = null;\r\n datas.isPinch = false;\r\n }\r\n return datas.isDrag ? params : false;\r\n },\r\n drag: function (moveable, e) {\r\n if (!e) {\r\n return;\r\n }\r\n resolveTransformEvent(moveable, e, \"translate\");\r\n var datas = e.datas, parentEvent = e.parentEvent, parentFlag = e.parentFlag, isPinch = e.isPinch, deltaOffset = e.deltaOffset, useSnap = e.useSnap, isRequest = e.isRequest, isGroup = e.isGroup, parentThrottleDrag = e.parentThrottleDrag;\r\n var distX = e.distX, distY = e.distY;\r\n var isDrag = datas.isDrag, prevDist = datas.prevDist, prevBeforeDist = datas.prevBeforeDist, startValue = datas.startValue;\r\n if (!isDrag) {\r\n return;\r\n }\r\n if (deltaOffset) {\r\n distX += deltaOffset[0];\r\n distY += deltaOffset[1];\r\n }\r\n var props = moveable.props;\r\n var parentMoveable = props.parentMoveable;\r\n var throttleDrag = isGroup ? 0 : (props.throttleDrag || parentThrottleDrag || 0);\r\n var throttleDragRotate = parentEvent ? 0 : (props.throttleDragRotate || 0);\r\n var dragRotateRad = 0;\r\n var isVerticalSnap = false;\r\n var isVerticalBound = false;\r\n var isHorizontalSnap = false;\r\n var isHorizontalBound = false;\r\n if (!parentEvent && throttleDragRotate > 0 && (distX || distY)) {\r\n var startDragRotate = props.startDragRotate || 0;\r\n var deg = throttle(startDragRotate + getRad([0, 0], [distX, distY]) * 180 / Math.PI, throttleDragRotate)\r\n - startDragRotate;\r\n var ry = distY * Math.abs(Math.cos((deg - 90) / 180 * Math.PI));\r\n var rx = distX * Math.abs(Math.cos(deg / 180 * Math.PI));\r\n var r = getDistSize([rx, ry]);\r\n dragRotateRad = deg * Math.PI / 180;\r\n distX = r * Math.cos(dragRotateRad);\r\n distY = r * Math.sin(dragRotateRad);\r\n }\r\n if (!isPinch && !parentEvent && !parentFlag) {\r\n var _a = __read(checkSnapBoundsDrag(moveable, distX, distY, throttleDragRotate, (!useSnap && isRequest) || deltaOffset, datas), 2), verticalInfo = _a[0], horizontalInfo = _a[1];\r\n isVerticalSnap = verticalInfo.isSnap;\r\n isVerticalBound = verticalInfo.isBound;\r\n isHorizontalSnap = horizontalInfo.isSnap;\r\n isHorizontalBound = horizontalInfo.isBound;\r\n var verticalOffset = verticalInfo.offset;\r\n var horizontalOffset = horizontalInfo.offset;\r\n distX += verticalOffset;\r\n distY += horizontalOffset;\r\n }\r\n var beforeTranslate = plus(getBeforeDragDist({ datas: datas, distX: distX, distY: distY }), startValue);\r\n var translate = plus(getTransformDist({ datas: datas, distX: distX, distY: distY }), startValue);\r\n throttleArray(translate, TINY_NUM);\r\n throttleArray(beforeTranslate, TINY_NUM);\r\n if (!throttleDragRotate) {\r\n if (!isVerticalSnap && !isVerticalBound) {\r\n translate[0] = throttle(translate[0], throttleDrag);\r\n beforeTranslate[0] = throttle(beforeTranslate[0], throttleDrag);\r\n }\r\n if (!isHorizontalSnap && !isHorizontalBound) {\r\n translate[1] = throttle(translate[1], throttleDrag);\r\n beforeTranslate[1] = throttle(beforeTranslate[1], throttleDrag);\r\n }\r\n }\r\n var beforeDist = minus(beforeTranslate, startValue);\r\n var dist = minus(translate, startValue);\r\n var delta = minus(dist, prevDist);\r\n var beforeDelta = minus(beforeDist, prevBeforeDist);\r\n datas.prevDist = dist;\r\n datas.prevBeforeDist = beforeDist;\r\n datas.passDelta = delta; //distX - (datas.passDistX || 0);\r\n // datas.passDeltaY = distY - (datas.passDistY || 0);\r\n datas.passDist = dist; //distX;\r\n // datas.passDistY = distY;\r\n var left = datas.left + beforeDist[0];\r\n var top = datas.top + beforeDist[1];\r\n var right = datas.right - beforeDist[0];\r\n var bottom = datas.bottom - beforeDist[1];\r\n var nextTransform = convertTransformFormat(datas, \"translate(\".concat(translate[0], \"px, \").concat(translate[1], \"px)\"), \"translate(\".concat(dist[0], \"px, \").concat(dist[1], \"px)\"));\r\n fillOriginalTransform(e, nextTransform);\r\n moveable.state.dragInfo.dist = parentEvent ? [0, 0] : dist;\r\n if (!parentEvent && !parentMoveable && delta.every(function (num) { return !num; }) && beforeDelta.some(function (num) { return !num; })) {\r\n return;\r\n }\r\n var _b = moveable.state, width = _b.width, height = _b.height;\r\n var params = fillParams(moveable, e, __assign({ transform: nextTransform, dist: dist, delta: delta, translate: translate, beforeDist: beforeDist, beforeDelta: beforeDelta, beforeTranslate: beforeTranslate, left: left, top: top, right: right, bottom: bottom, width: width, height: height, isPinch: isPinch }, fillCSSObject({\r\n transform: nextTransform,\r\n }, e)));\r\n !parentEvent && triggerEvent(moveable, \"onDrag\", params);\r\n return params;\r\n },\r\n dragAfter: function (moveable, e) {\r\n var datas = e.datas;\r\n var deltaOffset = datas.deltaOffset;\r\n if (deltaOffset[0] || deltaOffset[1]) {\r\n datas.deltaOffset = [0, 0];\r\n return this.drag(moveable, __assign(__assign({}, e), { deltaOffset: deltaOffset }));\r\n }\r\n return false;\r\n },\r\n dragEnd: function (moveable, e) {\r\n var parentEvent = e.parentEvent, datas = e.datas;\r\n moveable.state.dragInfo = null;\r\n if (!datas.isDrag) {\r\n return;\r\n }\r\n datas.isDrag = false;\r\n var param = fillEndParams(moveable, e, {});\r\n !parentEvent && triggerEvent(moveable, \"onDragEnd\", param);\r\n return param;\r\n },\r\n dragGroupStart: function (moveable, e) {\r\n var _a, _b;\r\n var datas = e.datas, clientX = e.clientX, clientY = e.clientY;\r\n var params = this.dragStart(moveable, e);\r\n if (!params) {\r\n return false;\r\n }\r\n var _c = triggerChildGesto(moveable, this, \"dragStart\", [\r\n clientX || 0,\r\n clientY || 0,\r\n ], e, false, \"draggable\"), childEvents = _c.childEvents, eventParams = _c.eventParams;\r\n var nextParams = __assign(__assign({}, params), { targets: moveable.props.targets, events: eventParams });\r\n var result = triggerEvent(moveable, \"onDragGroupStart\", nextParams);\r\n datas.isDrag = result !== false;\r\n // find data.startValue and based on first child moveable\r\n var startValue = (_b = (_a = childEvents[0]) === null || _a === void 0 ? void 0 : _a.datas.startValue) !== null && _b !== void 0 ? _b : [0, 0];\r\n datas.throttleOffset = [startValue[0] % 1, startValue[1] % 1];\r\n return datas.isDrag ? params : false;\r\n },\r\n dragGroup: function (moveable, e) {\r\n var datas = e.datas;\r\n if (!datas.isDrag) {\r\n return;\r\n }\r\n var params = this.drag(moveable, __assign(__assign({}, e), { parentThrottleDrag: moveable.props.throttleDrag }));\r\n var passDelta = e.datas.passDelta;\r\n var eventParams = triggerChildGesto(moveable, this, \"drag\", passDelta, e, false, \"draggable\").eventParams;\r\n if (!params) {\r\n return;\r\n }\r\n var nextParams = __assign({ targets: moveable.props.targets, events: eventParams }, params);\r\n triggerEvent(moveable, \"onDragGroup\", nextParams);\r\n return nextParams;\r\n },\r\n dragGroupEnd: function (moveable, e) {\r\n var isDrag = e.isDrag, datas = e.datas;\r\n if (!datas.isDrag) {\r\n return;\r\n }\r\n this.dragEnd(moveable, e);\r\n var eventParams = triggerChildGesto(moveable, this, \"dragEnd\", [0, 0], e, false, \"draggable\").eventParams;\r\n triggerEvent(moveable, \"onDragGroupEnd\", fillEndParams(moveable, e, {\r\n targets: moveable.props.targets,\r\n events: eventParams,\r\n }));\r\n return isDrag;\r\n },\r\n /**\r\n * @method Moveable.Draggable#request\r\n * @param {object} [e] - the draggable's request parameter\r\n * @param {number} [e.x] - x position\r\n * @param {number} [e.y] - y position\r\n * @param {number} [e.deltaX] - X number to move\r\n * @param {number} [e.deltaY] - Y number to move\r\n * @return {Moveable.Requester} Moveable Requester\r\n * @example\r\n\n * // Instantly Request (requestStart - request - requestEnd)\r\n * // Use Relative Value\r\n * moveable.request(\"draggable\", { deltaX: 10, deltaY: 10 }, true);\r\n * // Use Absolute Value\r\n * moveable.request(\"draggable\", { x: 200, y: 100 }, true);\r\n *\r\n * // requestStart\r\n * const requester = moveable.request(\"draggable\");\r\n *\r\n * // request\r\n * // Use Relative Value\r\n * requester.request({ deltaX: 10, deltaY: 10 });\r\n * requester.request({ deltaX: 10, deltaY: 10 });\r\n * requester.request({ deltaX: 10, deltaY: 10 });\r\n * // Use Absolute Value\r\n * moveable.request(\"draggable\", { x: 200, y: 100 });\r\n * moveable.request(\"draggable\", { x: 220, y: 100 });\r\n * moveable.request(\"draggable\", { x: 240, y: 100 });\r\n *\r\n * // requestEnd\r\n * requester.requestEnd();\r\n */\r\n request: function (moveable) {\r\n var datas = {};\r\n var rect = moveable.getRect();\r\n var distX = 0;\r\n var distY = 0;\r\n var useSnap = false;\r\n return {\r\n isControl: false,\r\n requestStart: function (e) {\r\n useSnap = e.useSnap;\r\n return { datas: datas, useSnap: useSnap };\r\n },\r\n request: function (e) {\r\n if (\"x\" in e) {\r\n distX = e.x - rect.left;\r\n }\r\n else if (\"deltaX\" in e) {\r\n distX += e.deltaX;\r\n }\r\n if (\"y\" in e) {\r\n distY = e.y - rect.top;\r\n }\r\n else if (\"deltaY\" in e) {\r\n distY += e.deltaY;\r\n }\r\n return { datas: datas, distX: distX, distY: distY, useSnap: useSnap };\r\n },\r\n requestEnd: function () {\r\n return { datas: datas, isDrag: true, useSnap: useSnap };\r\n },\r\n };\r\n },\r\n unset: function (moveable) {\r\n moveable.state.gestos.draggable = null;\r\n moveable.state.dragInfo = null;\r\n },\r\n};\r\n/**\r\n * Whether or not target can be dragged. (default: false)\r\n * @name Moveable.Draggable#draggable\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.draggable = true;\r\n */\r\n/**\r\n * throttle of x, y when drag.\r\n * @name Moveable.Draggable#throttleDrag\r\n * @default 0\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.throttleDrag = 1;\r\n */\r\n/**\r\n* throttle of angle of x, y when drag.\r\n* @name Moveable.Draggable#throttleDragRotate\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body);\r\n*\r\n* moveable.throttleDragRotate = 45;\r\n*/\r\n/**\r\n* start angle of throttleDragRotate of x, y when drag.\r\n* @name Moveable.Draggable#startDragRotate\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body);\r\n*\r\n* // 45, 135, 225, 315\r\n* moveable.throttleDragRotate = 90;\r\n* moveable.startDragRotate = 45;\r\n*/\r\n/**\r\n * When the drag starts, the dragStart event is called.\r\n * @memberof Moveable.Draggable\r\n * @event dragStart\r\n * @param {Moveable.Draggable.OnDragStart} - Parameters for the dragStart event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { draggable: true });\r\n * moveable.on(\"dragStart\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n */\r\n/**\r\n * When dragging, the drag event is called.\r\n * @memberof Moveable.Draggable\r\n * @event drag\r\n * @param {Moveable.Draggable.OnDrag} - Parameters for the drag event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { draggable: true });\r\n * moveable.on(\"drag\", ({ target, transform }) => {\r\n * target.style.transform = transform;\r\n * });\r\n */\r\n/**\r\n * When the drag finishes, the dragEnd event is called.\r\n * @memberof Moveable.Draggable\r\n * @event dragEnd\r\n * @param {Moveable.Draggable.OnDragEnd} - Parameters for the dragEnd event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { draggable: true });\r\n * moveable.on(\"dragEnd\", ({ target, isDrag }) => {\r\n * console.log(target, isDrag);\r\n * });\r\n */\r\n/**\r\n* When the group drag starts, the `dragGroupStart` event is called.\r\n* @memberof Moveable.Draggable\r\n* @event dragGroupStart\r\n* @param {Moveable.Draggable.OnDragGroupStart} - Parameters for the `dragGroupStart` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* target: [].slice.call(document.querySelectorAll(\".target\")),\r\n* draggable: true\r\n* });\r\n* moveable.on(\"dragGroupStart\", ({ targets }) => {\r\n* console.log(\"onDragGroupStart\", targets);\r\n* });\r\n*/\r\n/**\r\n* When the group drag, the `dragGroup` event is called.\r\n* @memberof Moveable.Draggable\r\n* @event dragGroup\r\n* @param {Moveable.Draggable.OnDragGroup} - Parameters for the `dragGroup` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* target: [].slice.call(document.querySelectorAll(\".target\")),\r\n* draggable: true\r\n* });\r\n* moveable.on(\"dragGroup\", ({ targets, events }) => {\r\n* console.log(\"onDragGroup\", targets);\r\n* events.forEach(ev => {\r\n* // drag event\r\n* console.log(\"onDrag left, top\", ev.left, ev.top);\r\n* // ev.target!.style.left = `${ev.left}px`;\r\n* // ev.target!.style.top = `${ev.top}px`;\r\n* console.log(\"onDrag translate\", ev.dist);\r\n* ev.target!.style.transform = ev.transform;)\r\n* });\r\n* });\r\n*/\r\n/**\r\n * When the group drag finishes, the `dragGroupEnd` event is called.\r\n * @memberof Moveable.Draggable\r\n * @event dragGroupEnd\r\n * @param {Moveable.Draggable.OnDragGroupEnd} - Parameters for the `dragGroupEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * draggable: true\r\n * });\r\n * moveable.on(\"dragGroupEnd\", ({ targets, isDrag }) => {\r\n * console.log(\"onDragGroupEnd\", targets, isDrag);\r\n * });\r\n */\n\nfunction getFixedDirectionInfo(startPositions, fixedDirection) {\r\n var fixedPosition = getPosByDirection(startPositions, fixedDirection);\r\n var fixedOffset = [0, 0];\r\n return {\r\n fixedPosition: fixedPosition,\r\n fixedDirection: fixedDirection,\r\n fixedOffset: fixedOffset,\r\n };\r\n}\r\nfunction getOffsetFixedDirectionInfo(state, fixedDirection) {\r\n // for start\r\n var allMatrix = state.allMatrix, is3d = state.is3d, width = state.width, height = state.height;\r\n var n = is3d ? 4 : 3;\r\n var nextFixedOffset = [\r\n width / 2 * (1 + fixedDirection[0]),\r\n height / 2 * (1 + fixedDirection[1]),\r\n ];\r\n var fixedPosition = calculatePosition(allMatrix, nextFixedOffset, n);\r\n var fixedOffset = [0, 0];\r\n return {\r\n fixedPosition: fixedPosition,\r\n fixedDirection: fixedDirection,\r\n fixedOffset: fixedOffset,\r\n };\r\n}\r\nfunction getOffsetFixedPositionInfo(state, offsetFixedPosition) {\r\n // for start\r\n var allMatrix = state.allMatrix, is3d = state.is3d, width = state.width, height = state.height;\r\n var n = is3d ? 4 : 3;\r\n var fixedDirection = getDirectionByPos(offsetFixedPosition, width, height);\r\n var nextFixedPosition = calculatePosition(allMatrix, offsetFixedPosition, n);\r\n var fixedOffset = [\r\n width ? 0 : offsetFixedPosition[0],\r\n height ? 0 : offsetFixedPosition[1],\r\n ];\r\n return {\r\n fixedPosition: nextFixedPosition,\r\n fixedDirection: fixedDirection,\r\n fixedOffset: fixedOffset,\r\n };\r\n}\n\n/**\r\n * @namespace Resizable\r\n * @memberof Moveable\r\n * @description Resizable indicates whether the target's width and height can be increased or decreased.\r\n */\r\nvar directionCondition$2 = getDirectionCondition(\"resizable\");\r\nvar Resizable = {\r\n name: \"resizable\",\r\n ableGroup: \"size\",\r\n canPinch: true,\r\n props: [\r\n \"resizable\",\r\n \"throttleResize\",\r\n \"renderDirections\",\r\n \"displayAroundControls\",\r\n \"keepRatio\",\r\n \"resizeFormat\",\r\n \"keepRatioFinally\",\r\n \"edge\",\r\n \"checkResizableError\",\r\n ],\r\n events: [\r\n \"resizeStart\",\r\n \"beforeResize\",\r\n \"resize\",\r\n \"resizeEnd\",\r\n \"resizeGroupStart\",\r\n \"beforeResizeGroup\",\r\n \"resizeGroup\",\r\n \"resizeGroupEnd\",\r\n ],\r\n render: getRenderDirections(\"resizable\"),\r\n dragControlCondition: directionCondition$2,\r\n viewClassName: getDirectionViewClassName(\"resizable\"),\r\n dragControlStart: function (moveable, e) {\r\n var _a;\r\n var inputEvent = e.inputEvent, isPinch = e.isPinch, isGroup = e.isGroup, parentDirection = e.parentDirection, parentGesto = e.parentGesto, datas = e.datas, parentFixedDirection = e.parentFixedDirection, parentEvent = e.parentEvent;\r\n var direction = getTotalDirection(parentDirection, isPinch, inputEvent, datas);\r\n var state = moveable.state;\r\n var target = state.target, width = state.width, height = state.height, gestos = state.gestos;\r\n if (!direction || !target) {\r\n return false;\r\n }\r\n if (gestos.resizable) {\r\n return false;\r\n }\r\n gestos.resizable = parentGesto || moveable.controlGesto;\r\n !isPinch && setDragStart(moveable, e);\r\n datas.datas = {};\r\n datas.direction = direction;\r\n datas.startOffsetWidth = width;\r\n datas.startOffsetHeight = height;\r\n datas.prevWidth = 0;\r\n datas.prevHeight = 0;\r\n datas.minSize = [0, 0];\r\n datas.startWidth = state.inlineCSSWidth || state.cssWidth;\r\n datas.startHeight = state.inlineCSSHeight || state.cssHeight;\r\n datas.maxSize = [Infinity, Infinity];\r\n if (!isGroup) {\r\n datas.minSize = [\r\n state.minOffsetWidth,\r\n state.minOffsetHeight,\r\n ];\r\n datas.maxSize = [\r\n state.maxOffsetWidth,\r\n state.maxOffsetHeight,\r\n ];\r\n }\r\n var transformOrigin = moveable.props.transformOrigin || \"% %\";\r\n datas.transformOrigin = transformOrigin && isString(transformOrigin)\r\n ? transformOrigin.split(\" \")\r\n : transformOrigin;\r\n datas.startOffsetMatrix = state.offsetMatrix;\r\n datas.startTransformOrigin = state.transformOrigin;\r\n datas.isWidth = (_a = e === null || e === void 0 ? void 0 : e.parentIsWidth) !== null && _a !== void 0 ? _a : ((!direction[0] && !direction[1]) || direction[0] || !direction[1]);\r\n function setRatio(ratio) {\r\n datas.ratio = ratio && isFinite(ratio) ? ratio : 0;\r\n }\r\n datas.startPositions = getAbsolutePosesByState(moveable.state);\r\n function setFixedDirection(fixedDirection) {\r\n var result = getFixedDirectionInfo(datas.startPositions, fixedDirection);\r\n datas.fixedDirection = result.fixedDirection;\r\n datas.fixedPosition = result.fixedPosition;\r\n datas.fixedOffset = result.fixedOffset;\r\n }\r\n function setFixedPosition(fixedPosition) {\r\n var result = getOffsetFixedPositionInfo(moveable.state, fixedPosition);\r\n datas.fixedDirection = result.fixedDirection;\r\n datas.fixedPosition = result.fixedPosition;\r\n datas.fixedOffset = result.fixedOffset;\r\n }\r\n function setMin(minSize) {\r\n datas.minSize = [\r\n convertUnitSize(\"\".concat(minSize[0]), 0) || 0,\r\n convertUnitSize(\"\".concat(minSize[1]), 0) || 0,\r\n ];\r\n }\r\n function setMax(maxSize) {\r\n var nextMaxSize = [\r\n maxSize[0] || Infinity,\r\n maxSize[1] || Infinity,\r\n ];\r\n if (!isNumber(nextMaxSize[0]) || isFinite(nextMaxSize[0])) {\r\n nextMaxSize[0] = convertUnitSize(\"\".concat(nextMaxSize[0]), 0) || Infinity;\r\n }\r\n if (!isNumber(nextMaxSize[1]) || isFinite(nextMaxSize[1])) {\r\n nextMaxSize[1] = convertUnitSize(\"\".concat(nextMaxSize[1]), 0) || Infinity;\r\n }\r\n datas.maxSize = nextMaxSize;\r\n }\r\n setRatio(width / height);\r\n setFixedDirection(parentFixedDirection || [-direction[0], -direction[1]]);\r\n datas.setFixedDirection = setFixedDirection;\r\n datas.setFixedPosition = setFixedPosition;\r\n datas.setMin = setMin;\r\n datas.setMax = setMax;\r\n var params = fillParams(moveable, e, {\r\n direction: direction,\r\n startRatio: datas.ratio,\r\n set: function (_a) {\r\n var _b = __read(_a, 2), startWidth = _b[0], startHeight = _b[1];\r\n datas.startWidth = startWidth;\r\n datas.startHeight = startHeight;\r\n },\r\n setMin: setMin,\r\n setMax: setMax,\r\n setRatio: setRatio,\r\n setFixedDirection: setFixedDirection,\r\n setFixedPosition: setFixedPosition,\r\n setOrigin: function (origin) {\r\n datas.transformOrigin = origin;\r\n },\r\n dragStart: Draggable.dragStart(moveable, new CustomGesto().dragStart([0, 0], e)),\r\n });\r\n var result = parentEvent || triggerEvent(moveable, \"onResizeStart\", params);\r\n datas.startFixedDirection = datas.fixedDirection;\r\n datas.startFixedPosition = datas.fixedPosition;\r\n if (result !== false) {\r\n datas.isResize = true;\r\n moveable.state.snapRenderInfo = {\r\n request: e.isRequest,\r\n direction: direction,\r\n };\r\n }\r\n return datas.isResize ? params : false;\r\n },\r\n dragControl: function (moveable, e) {\r\n var _a;\r\n var datas = e.datas, parentFlag = e.parentFlag, isPinch = e.isPinch, parentKeepRatio = e.parentKeepRatio, dragClient = e.dragClient, parentDist = e.parentDist, useSnap = e.useSnap, isRequest = e.isRequest, isGroup = e.isGroup, parentEvent = e.parentEvent, resolveMatrix = e.resolveMatrix;\r\n var isResize = datas.isResize, transformOrigin = datas.transformOrigin, startWidth = datas.startWidth, startHeight = datas.startHeight, prevWidth = datas.prevWidth, prevHeight = datas.prevHeight, minSize = datas.minSize, maxSize = datas.maxSize, ratio = datas.ratio, startOffsetWidth = datas.startOffsetWidth, startOffsetHeight = datas.startOffsetHeight, isWidth = datas.isWidth;\r\n if (!isResize) {\r\n return;\r\n }\r\n if (resolveMatrix) {\r\n var is3d = moveable.state.is3d;\r\n var startOffsetMatrix = datas.startOffsetMatrix, startTransformOrigin = datas.startTransformOrigin;\r\n var n = is3d ? 4 : 3;\r\n var targetMatrix = parseMat(getNextTransforms(e));\r\n var targetN = Math.sqrt(targetMatrix.length);\r\n if (n !== targetN) {\r\n targetMatrix = convertDimension(targetMatrix, targetN, n);\r\n }\r\n var nextAllMatrix = getNextMatrix(startOffsetMatrix, targetMatrix, startTransformOrigin, n);\r\n var poses = calculatePoses(nextAllMatrix, startOffsetWidth, startOffsetHeight, n);\r\n datas.startPositions = poses;\r\n datas.nextTargetMatrix = targetMatrix;\r\n datas.nextAllMatrix = nextAllMatrix;\r\n }\r\n var props = getProps(moveable.props, \"resizable\");\r\n var resizeFormat = props.resizeFormat, _b = props.throttleResize, throttleResize = _b === void 0 ? parentFlag ? 0 : 1 : _b, parentMoveable = props.parentMoveable, keepRatioFinally = props.keepRatioFinally;\r\n var direction = datas.direction;\r\n var sizeDirection = direction;\r\n var distWidth = 0;\r\n var distHeight = 0;\r\n if (!direction[0] && !direction[1]) {\r\n sizeDirection = [1, 1];\r\n }\r\n var keepRatio = (ratio && (parentKeepRatio != null ? parentKeepRatio : props.keepRatio)) || false;\r\n function getNextBoundingSize() {\r\n var fixedDirection = datas.fixedDirection;\r\n var nextSize = getOffsetSizeDist(sizeDirection, keepRatio, datas, e);\r\n distWidth = nextSize.distWidth;\r\n distHeight = nextSize.distHeight;\r\n var nextWidth = (sizeDirection[0] - fixedDirection[0]) || keepRatio\r\n ? Math.max(startOffsetWidth + distWidth, TINY_NUM) : startOffsetWidth;\r\n var nextHeight = (sizeDirection[1] - fixedDirection[1]) || keepRatio\r\n ? Math.max(startOffsetHeight + distHeight, TINY_NUM) : startOffsetHeight;\r\n if (keepRatio && startOffsetWidth && startOffsetHeight) {\r\n // startOffsetWidth : startOffsetHeight = nextWidth : nextHeight\r\n if (isWidth) {\r\n nextHeight = nextWidth / ratio;\r\n }\r\n else {\r\n nextWidth = nextHeight * ratio;\r\n }\r\n }\r\n return [nextWidth, nextHeight];\r\n }\r\n var _c = __read(getNextBoundingSize(), 2), boundingWidth = _c[0], boundingHeight = _c[1];\r\n if (!parentEvent) {\r\n datas.setFixedDirection(datas.fixedDirection);\r\n triggerEvent(moveable, \"onBeforeResize\", fillParams(moveable, e, {\r\n startFixedDirection: datas.startFixedDirection,\r\n startFixedPosition: datas.startFixedPosition,\r\n setFixedDirection: function (nextFixedDirection) {\r\n var _a;\r\n datas.setFixedDirection(nextFixedDirection);\r\n _a = __read(getNextBoundingSize(), 2), boundingWidth = _a[0], boundingHeight = _a[1];\r\n return [boundingWidth, boundingHeight];\r\n },\r\n setFixedPosition: function (nextFixedPosition) {\r\n var _a;\r\n datas.setFixedPosition(nextFixedPosition);\r\n _a = __read(getNextBoundingSize(), 2), boundingWidth = _a[0], boundingHeight = _a[1];\r\n return [boundingWidth, boundingHeight];\r\n },\r\n boundingWidth: boundingWidth,\r\n boundingHeight: boundingHeight,\r\n setSize: function (size) {\r\n var _a;\r\n _a = __read(size, 2), boundingWidth = _a[0], boundingHeight = _a[1];\r\n },\r\n }, true));\r\n }\r\n var fixedPosition = dragClient;\r\n if (!dragClient) {\r\n if (!parentFlag && isPinch) {\r\n fixedPosition = getAbsolutePosition(moveable, [0, 0]);\r\n }\r\n else {\r\n fixedPosition = datas.fixedPosition;\r\n }\r\n }\r\n var snapDist = [0, 0];\r\n if (!isPinch) {\r\n snapDist = checkSnapResize(moveable, boundingWidth, boundingHeight, direction, fixedPosition, !useSnap && isRequest, datas);\r\n }\r\n if (parentDist) {\r\n !parentDist[0] && (snapDist[0] = 0);\r\n !parentDist[1] && (snapDist[1] = 0);\r\n }\r\n function computeSize() {\r\n var _a;\r\n if (resizeFormat) {\r\n _a = __read(resizeFormat([boundingWidth, boundingHeight]), 2), boundingWidth = _a[0], boundingHeight = _a[1];\r\n }\r\n boundingWidth = throttle(boundingWidth, throttleResize);\r\n boundingHeight = throttle(boundingHeight, throttleResize);\r\n }\r\n if (keepRatio) {\r\n if (sizeDirection[0] && sizeDirection[1] && snapDist[0] && snapDist[1]) {\r\n if (abs(snapDist[0]) > abs(snapDist[1])) {\r\n snapDist[1] = 0;\r\n }\r\n else {\r\n snapDist[0] = 0;\r\n }\r\n }\r\n var isNoSnap = !snapDist[0] && !snapDist[1];\r\n if (isNoSnap) {\r\n // pre-compute before maintaining the ratio\r\n computeSize();\r\n }\r\n if ((sizeDirection[0] && !sizeDirection[1])\r\n || (snapDist[0] && !snapDist[1])\r\n || (isNoSnap && isWidth)) {\r\n boundingWidth += snapDist[0];\r\n boundingHeight = boundingWidth / ratio;\r\n }\r\n else if ((!sizeDirection[0] && sizeDirection[1])\r\n || (!snapDist[0] && snapDist[1])\r\n || (isNoSnap && !isWidth)) {\r\n boundingHeight += snapDist[1];\r\n boundingWidth = boundingHeight * ratio;\r\n }\r\n }\r\n else {\r\n boundingWidth += snapDist[0];\r\n boundingHeight += snapDist[1];\r\n boundingWidth = Math.max(0, boundingWidth);\r\n boundingHeight = Math.max(0, boundingHeight);\r\n }\r\n _a = __read(calculateBoundSize([boundingWidth, boundingHeight], minSize, maxSize, keepRatio ? ratio : false), 2), boundingWidth = _a[0], boundingHeight = _a[1];\r\n computeSize();\r\n if (keepRatio && (isGroup || keepRatioFinally)) {\r\n if (isWidth) {\r\n boundingHeight = boundingWidth / ratio;\r\n }\r\n else {\r\n boundingWidth = boundingHeight * ratio;\r\n }\r\n }\r\n distWidth = boundingWidth - startOffsetWidth;\r\n distHeight = boundingHeight - startOffsetHeight;\r\n var delta = [distWidth - prevWidth, distHeight - prevHeight];\r\n datas.prevWidth = distWidth;\r\n datas.prevHeight = distHeight;\r\n var inverseDelta = getResizeDist(moveable, boundingWidth, boundingHeight, fixedPosition, transformOrigin, datas);\r\n if (!parentMoveable && delta.every(function (num) { return !num; }) && inverseDelta.every(function (num) { return !num; })) {\r\n return;\r\n }\r\n var drag = Draggable.drag(moveable, setCustomDrag(e, moveable.state, inverseDelta, !!isPinch, false, \"draggable\"));\r\n var transform = drag.transform;\r\n var nextWidth = startWidth + distWidth;\r\n var nextHeight = startHeight + distHeight;\r\n var params = fillParams(moveable, e, __assign({ width: nextWidth, height: nextHeight, offsetWidth: Math.round(boundingWidth), offsetHeight: Math.round(boundingHeight), startRatio: ratio, boundingWidth: boundingWidth, boundingHeight: boundingHeight, direction: direction, dist: [distWidth, distHeight], delta: delta, isPinch: !!isPinch, drag: drag }, fillAfterTransform({\r\n style: {\r\n width: \"\".concat(nextWidth, \"px\"),\r\n height: \"\".concat(nextHeight, \"px\"),\r\n },\r\n transform: transform,\r\n }, drag, e)));\r\n !parentEvent && triggerEvent(moveable, \"onResize\", params);\r\n return params;\r\n },\r\n dragControlAfter: function (moveable, e) {\r\n var datas = e.datas;\r\n var isResize = datas.isResize, startOffsetWidth = datas.startOffsetWidth, startOffsetHeight = datas.startOffsetHeight, prevWidth = datas.prevWidth, prevHeight = datas.prevHeight;\r\n if (!isResize || moveable.props.checkResizableError === false) {\r\n return;\r\n }\r\n var _a = moveable.state, width = _a.width, height = _a.height;\r\n var errorWidth = width - (startOffsetWidth + prevWidth);\r\n var errorHeight = height - (startOffsetHeight + prevHeight);\r\n var isErrorWidth = abs(errorWidth) > 3;\r\n var isErrorHeight = abs(errorHeight) > 3;\r\n if (isErrorWidth) {\r\n datas.startWidth += errorWidth;\r\n datas.startOffsetWidth += errorWidth;\r\n datas.prevWidth += errorWidth;\r\n }\r\n if (isErrorHeight) {\r\n datas.startHeight += errorHeight;\r\n datas.startOffsetHeight += errorHeight;\r\n datas.prevHeight += errorHeight;\r\n }\r\n if (isErrorWidth || isErrorHeight) {\r\n return this.dragControl(moveable, e);\r\n }\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n var datas = e.datas, parentEvent = e.parentEvent;\r\n if (!datas.isResize) {\r\n return;\r\n }\r\n datas.isResize = false;\r\n var params = fillEndParams(moveable, e, {});\r\n !parentEvent && triggerEvent(moveable, \"onResizeEnd\", params);\r\n return params;\r\n },\r\n dragGroupControlCondition: directionCondition$2,\r\n dragGroupControlStart: function (moveable, e) {\r\n var datas = e.datas;\r\n var params = this.dragControlStart(moveable, __assign(__assign({}, e), { isGroup: true }));\r\n if (!params) {\r\n return false;\r\n }\r\n var originalEvents = fillChildEvents(moveable, \"resizable\", e);\r\n var parentStartOffsetWidth = datas.startOffsetWidth, parentStartOffsetHeight = datas.startOffsetHeight;\r\n function updateGroupMin() {\r\n var originalMinSize = datas.minSize;\r\n originalEvents.forEach(function (ev) {\r\n var _a = ev.datas, childMinSize = _a.minSize, childStartOffsetWidth = _a.startOffsetWidth, childStartOffsetHeight = _a.startOffsetHeight;\r\n var parentMinWidth = parentStartOffsetWidth\r\n * (childStartOffsetWidth ? childMinSize[0] / childStartOffsetWidth : 0);\r\n var parentMinHeight = parentStartOffsetHeight\r\n * (childStartOffsetHeight ? childMinSize[1] / childStartOffsetHeight : 0);\r\n originalMinSize[0] = Math.max(originalMinSize[0], parentMinWidth);\r\n originalMinSize[1] = Math.max(originalMinSize[1], parentMinHeight);\r\n });\r\n }\r\n function updateGroupMax() {\r\n var originalMaxSize = datas.maxSize;\r\n originalEvents.forEach(function (ev) {\r\n var _a = ev.datas, childMaxSize = _a.maxSize, childStartOffsetWidth = _a.startOffsetWidth, childStartOffsetHeight = _a.startOffsetHeight;\r\n var parentMaxWidth = parentStartOffsetWidth\r\n * (childStartOffsetWidth ? childMaxSize[0] / childStartOffsetWidth : 0);\r\n var parentMaxHeight = parentStartOffsetHeight\r\n * (childStartOffsetHeight ? childMaxSize[1] / childStartOffsetHeight : 0);\r\n originalMaxSize[0] = Math.min(originalMaxSize[0], parentMaxWidth);\r\n originalMaxSize[1] = Math.min(originalMaxSize[1], parentMaxHeight);\r\n });\r\n }\r\n var events = triggerChildAbles(moveable, this, \"dragControlStart\", e, function (child, ev) {\r\n return startChildDist(moveable, child, datas, ev);\r\n });\r\n updateGroupMin();\r\n updateGroupMax();\r\n var setFixedDirection = function (fixedDirection) {\r\n params.setFixedDirection(fixedDirection);\r\n events.forEach(function (ev, i) {\r\n ev.setFixedDirection(fixedDirection);\r\n startChildDist(moveable, ev.moveable, datas, originalEvents[i]);\r\n });\r\n };\r\n datas.setFixedDirection = setFixedDirection;\r\n var nextParams = __assign(__assign({}, params), { targets: moveable.props.targets, events: events.map(function (ev) {\r\n return __assign(__assign({}, ev), { setMin: function (minSize) {\r\n ev.setMin(minSize);\r\n updateGroupMin();\r\n }, setMax: function (maxSize) {\r\n ev.setMax(maxSize);\r\n updateGroupMax();\r\n } });\r\n }), setFixedDirection: setFixedDirection, setMin: function (minSize) {\r\n params.setMin(minSize);\r\n updateGroupMin();\r\n }, setMax: function (maxSize) {\r\n params.setMax(maxSize);\r\n updateGroupMax();\r\n } });\r\n var result = triggerEvent(moveable, \"onResizeGroupStart\", nextParams);\r\n datas.isResize = result !== false;\r\n return datas.isResize ? params : false;\r\n },\r\n dragGroupControl: function (moveable, e) {\r\n var datas = e.datas;\r\n if (!datas.isResize) {\r\n return;\r\n }\r\n var props = getProps(moveable.props, \"resizable\");\r\n catchEvent(moveable, \"onBeforeResize\", function (parentEvent) {\r\n triggerEvent(moveable, \"onBeforeResizeGroup\", fillParams(moveable, e, __assign(__assign({}, parentEvent), { targets: props.targets }), true));\r\n });\r\n var params = this.dragControl(moveable, __assign(__assign({}, e), { isGroup: true }));\r\n if (!params) {\r\n return;\r\n }\r\n var boundingWidth = params.boundingWidth, boundingHeight = params.boundingHeight, dist = params.dist;\r\n var keepRatio = props.keepRatio;\r\n var parentScale = [\r\n boundingWidth / (boundingWidth - dist[0]),\r\n boundingHeight / (boundingHeight - dist[1]),\r\n ];\r\n var fixedPosition = datas.fixedPosition;\r\n var events = triggerChildAbles(moveable, this, \"dragControl\", e, function (_, ev) {\r\n var _a = __read(calculate(createRotateMatrix(moveable.rotation / 180 * Math.PI, 3), [\r\n ev.datas.originalX * parentScale[0],\r\n ev.datas.originalY * parentScale[1],\r\n 1,\r\n ], 3), 2), clientX = _a[0], clientY = _a[1];\r\n return __assign(__assign({}, ev), { parentDist: null, parentScale: parentScale, dragClient: plus(fixedPosition, [clientX, clientY]), parentKeepRatio: keepRatio });\r\n });\r\n var nextParams = __assign({ targets: props.targets, events: events }, params);\r\n triggerEvent(moveable, \"onResizeGroup\", nextParams);\r\n return nextParams;\r\n },\r\n dragGroupControlEnd: function (moveable, e) {\r\n var isDrag = e.isDrag, datas = e.datas;\r\n if (!datas.isResize) {\r\n return;\r\n }\r\n this.dragControlEnd(moveable, e);\r\n var events = triggerChildAbles(moveable, this, \"dragControlEnd\", e);\r\n var nextParams = fillEndParams(moveable, e, {\r\n targets: moveable.props.targets,\r\n events: events,\r\n });\r\n triggerEvent(moveable, \"onResizeGroupEnd\", nextParams);\r\n return isDrag;\r\n },\r\n /**\r\n * @method Moveable.Resizable#request\r\n * @param {Moveable.Resizable.ResizableRequestParam} e - the Resizable's request parameter\r\n * @return {Moveable.Requester} Moveable Requester\r\n * @example\r\n\n * // Instantly Request (requestStart - request - requestEnd)\r\n * // Use Relative Value\r\n * moveable.request(\"resizable\", { deltaWidth: 10, deltaHeight: 10 }, true);\r\n *\r\n * // Use Absolute Value\r\n * moveable.request(\"resizable\", { offsetWidth: 100, offsetHeight: 100 }, true);\r\n *\r\n * // requestStart\r\n * const requester = moveable.request(\"resizable\");\r\n *\r\n * // request\r\n * // Use Relative Value\r\n * requester.request({ deltaWidth: 10, deltaHeight: 10 });\r\n * requester.request({ deltaWidth: 10, deltaHeight: 10 });\r\n * requester.request({ deltaWidth: 10, deltaHeight: 10 });\r\n *\r\n * // Use Absolute Value\r\n * moveable.request(\"resizable\", { offsetWidth: 100, offsetHeight: 100 });\r\n * moveable.request(\"resizable\", { offsetWidth: 110, offsetHeight: 100 });\r\n * moveable.request(\"resizable\", { offsetWidth: 120, offsetHeight: 100 });\r\n *\r\n * // requestEnd\r\n * requester.requestEnd();\r\n */\r\n request: function (moveable) {\r\n var datas = {};\r\n var distWidth = 0;\r\n var distHeight = 0;\r\n var useSnap = false;\r\n var rect = moveable.getRect();\r\n return {\r\n isControl: true,\r\n requestStart: function (e) {\r\n var _a;\r\n useSnap = e.useSnap;\r\n return {\r\n datas: datas,\r\n parentDirection: e.direction || [1, 1],\r\n parentIsWidth: (_a = e === null || e === void 0 ? void 0 : e.horizontal) !== null && _a !== void 0 ? _a : true,\r\n useSnap: useSnap,\r\n };\r\n },\r\n request: function (e) {\r\n if (\"offsetWidth\" in e) {\r\n distWidth = e.offsetWidth - rect.offsetWidth;\r\n }\r\n else if (\"deltaWidth\" in e) {\r\n distWidth += e.deltaWidth;\r\n }\r\n if (\"offsetHeight\" in e) {\r\n distHeight = e.offsetHeight - rect.offsetHeight;\r\n }\r\n else if (\"deltaHeight\" in e) {\r\n distHeight += e.deltaHeight;\r\n }\r\n return {\r\n datas: datas,\r\n parentDist: [distWidth, distHeight],\r\n parentKeepRatio: e.keepRatio,\r\n useSnap: useSnap,\r\n };\r\n },\r\n requestEnd: function () {\r\n return { datas: datas, isDrag: true, useSnap: useSnap };\r\n },\r\n };\r\n },\r\n unset: function (moveable) {\r\n moveable.state.gestos.resizable = null;\r\n },\r\n};\r\n/**\r\n * Whether or not target can be resized.\r\n * @name Moveable.Resizable#resizable\r\n * @default false\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * resizable: false,\r\n * });\r\n *\r\n * moveable.resizable = true;\r\n */\r\n/**\r\n * throttle of width, height when resize. If throttleResize is set to less than 1, the target may shake.\r\n * @name Moveable.Resizable#throttleResize\r\n * @default 1\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * resizable: true,\r\n * throttleResize: 1,\r\n * });\r\n *\r\n * moveable.throttleResize = 0;\r\n */\r\n/**\r\n * When resize or scale, keeps a ratio of the width, height.\r\n * @name Moveable.Resizable#keepRatio\r\n * @default false\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * resizable: true,\r\n * });\r\n *\r\n * moveable.keepRatio = true;\r\n */\r\n/**\r\n * Set directions to show the control box.\r\n * @name Moveable.Resizable#renderDirections\r\n * @default [\"n\", \"nw\", \"ne\", \"s\", \"se\", \"sw\", \"e\", \"w\"]\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * resizable: true,\r\n * renderDirections: [\"n\", \"nw\", \"ne\", \"s\", \"se\", \"sw\", \"e\", \"w\"],\r\n * });\r\n *\r\n * moveable.renderDirections = [\"nw\", \"ne\", \"sw\", \"se\"];\r\n */\r\n/**\r\n * Function to convert size for resize\r\n * @name Moveable.Resizable#resizeFormat\r\n * @default oneself\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * resizable: true,\r\n * resizeFormat: v => v,\r\n * });\r\n *\r\n * moveable.resizeFormat = (size: number[]) => ([Math.trunc(size[0]), Math.trunc(size[1])];\r\n */\r\n/**\r\n * When the resize starts, the resizeStart event is called.\r\n * @memberof Moveable.Resizable\r\n * @event resizeStart\r\n * @param {Moveable.Resizable.OnResizeStart} - Parameters for the resizeStart event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { resizable: true });\r\n * moveable.on(\"resizeStart\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n */\r\n/**\r\n * When resizing, `beforeResize` is called before `resize` occurs. In `beforeResize`, you can get and set the pre-value before resizing.\r\n * @memberof Moveable.Resizable\r\n * @event beforeResize\r\n * @param {Moveable.Resizable.OnBeforeResize} - Parameters for the `beforeResize` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { resizable: true });\r\n * moveable.on(\"beforeResize\", ({ setFixedDirection }) => {\r\n * if (shiftKey) {\r\n * setFixedDirection([0, 0]);\r\n * }\r\n * });\r\n * moveable.on(\"resize\", ({ target, width, height, drag }) => {\r\n * target.style.width = `${width}px`;\r\n * target.style.height = `${height}px`;\r\n * target.style.transform = drag.transform;\r\n * });\r\n */\r\n/**\r\n * When resizing, the resize event is called.\r\n * @memberof Moveable.Resizable\r\n * @event resize\r\n * @param {Moveable.Resizable.OnResize} - Parameters for the resize event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { resizable: true });\r\n * moveable.on(\"resize\", ({ target, width, height }) => {\r\n * target.style.width = `${e.width}px`;\r\n * target.style.height = `${e.height}px`;\r\n * });\r\n */\r\n/**\r\n * When the resize finishes, the resizeEnd event is called.\r\n * @memberof Moveable.Resizable\r\n * @event resizeEnd\r\n * @param {Moveable.Resizable.OnResizeEnd} - Parameters for the resizeEnd event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { resizable: true });\r\n * moveable.on(\"resizeEnd\", ({ target, isDrag }) => {\r\n * console.log(target, isDrag);\r\n * });\r\n */\r\n/**\r\n* When the group resize starts, the `resizeGroupStart` event is called.\r\n* @memberof Moveable.Resizable\r\n* @event resizeGroupStart\r\n* @param {Moveable.Resizable.OnResizeGroupStart} - Parameters for the `resizeGroupStart` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* target: [].slice.call(document.querySelectorAll(\".target\")),\r\n* resizable: true\r\n* });\r\n* moveable.on(\"resizeGroupStart\", ({ targets }) => {\r\n* console.log(\"onResizeGroupStart\", targets);\r\n* });\r\n*/\r\n/**\r\n* When the group resize, the `resizeGroup` event is called.\r\n* @memberof Moveable.Resizable\r\n* @event resizeGroup\r\n* @param {Moveable.Resizable.onResizeGroup} - Parameters for the `resizeGroup` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* target: [].slice.call(document.querySelectorAll(\".target\")),\r\n* resizable: true\r\n* });\r\n* moveable.on(\"resizeGroup\", ({ targets, events }) => {\r\n* console.log(\"onResizeGroup\", targets);\r\n* events.forEach(ev => {\r\n* const offset = [\r\n* direction[0] < 0 ? -ev.delta[0] : 0,\r\n* direction[1] < 0 ? -ev.delta[1] : 0,\r\n* ];\r\n* // ev.drag is a drag event that occurs when the group resize.\r\n* const left = offset[0] + ev.drag.beforeDist[0];\r\n* const top = offset[1] + ev.drag.beforeDist[1];\r\n* const width = ev.width;\r\n* const top = ev.top;\r\n* });\r\n* });\r\n*/\r\n/**\r\n * When the group resize finishes, the `resizeGroupEnd` event is called.\r\n * @memberof Moveable.Resizable\r\n * @event resizeGroupEnd\r\n * @param {Moveable.Resizable.OnResizeGroupEnd} - Parameters for the `resizeGroupEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * resizable: true\r\n * });\r\n * moveable.on(\"resizeGroupEnd\", ({ targets, isDrag }) => {\r\n * console.log(\"onResizeGroupEnd\", targets, isDrag);\r\n * });\r\n */\n\n/**\r\n * @namespace Rotatable\r\n * @memberof Moveable\r\n * @description Rotatable indicates whether the target can be rotated.\r\n */\r\nfunction setRotateStartInfo(moveable, datas, clientX, clientY, rect) {\r\n var groupable = moveable.props.groupable;\r\n var state = moveable.state;\r\n var n = state.is3d ? 4 : 3;\r\n var origin = datas.origin;\r\n var nextOrigin = calculatePosition(moveable.state.rootMatrix, \r\n // TO-DO #710\r\n minus([origin[0], origin[1]], groupable ? [0, 0] : [state.left, state.top]), n);\r\n var startAbsoluteOrigin = plus([rect.left, rect.top], nextOrigin);\r\n datas.startAbsoluteOrigin = startAbsoluteOrigin;\r\n datas.prevDeg = getRad(startAbsoluteOrigin, [clientX, clientY]) / Math.PI * 180;\r\n datas.defaultDeg = datas.prevDeg;\r\n datas.prevSnapDeg = 0;\r\n datas.loop = 0;\r\n datas.startDist = getDist$1(startAbsoluteOrigin, [clientX, clientY]);\r\n}\r\nfunction getAbsoluteDist(deg, direction, datas) {\r\n var defaultDeg = datas.defaultDeg, prevDeg = datas.prevDeg;\r\n var normalizedPrevDeg = prevDeg % 360;\r\n var loop = Math.floor(prevDeg / 360);\r\n if (normalizedPrevDeg < 0) {\r\n normalizedPrevDeg += 360;\r\n }\r\n if (normalizedPrevDeg > deg && normalizedPrevDeg > 270 && deg < 90) {\r\n // 360 => 0\r\n ++loop;\r\n }\r\n else if (normalizedPrevDeg < deg && normalizedPrevDeg < 90 && deg > 270) {\r\n // 0 => 360\r\n --loop;\r\n }\r\n var dist = direction * (loop * 360 + deg - defaultDeg);\r\n datas.prevDeg = defaultDeg + dist;\r\n return dist;\r\n}\r\nfunction getAbsoluteDistByClient(clientX, clientY, direction, datas) {\r\n return getAbsoluteDist(getRad(datas.startAbsoluteOrigin, [clientX, clientY]) / Math.PI * 180, direction, datas);\r\n}\r\nfunction getRotateInfo(moveable, moveableRect, datas, dist, startValue, checkSnap) {\r\n var _a = moveable.props.throttleRotate, throttleRotate = _a === void 0 ? 0 : _a;\r\n var prevSnapDeg = datas.prevSnapDeg;\r\n var snapRotation = 0;\r\n var isSnap = false;\r\n if (checkSnap) {\r\n var result = checkSnapRotate(moveable, moveableRect, dist, startValue + dist);\r\n isSnap = result.isSnap;\r\n snapRotation = startValue + result.dist;\r\n }\r\n if (!isSnap) {\r\n snapRotation = throttle(startValue + dist, throttleRotate);\r\n }\r\n var snapDeg = snapRotation - startValue;\r\n datas.prevSnapDeg = snapDeg;\r\n return [snapDeg - prevSnapDeg, snapDeg, snapRotation];\r\n}\r\nfunction getRotationPositions(rotationPosition, _a, direction) {\r\n var _b = __read(_a, 4), pos1 = _b[0], pos2 = _b[1], pos3 = _b[2], pos4 = _b[3];\r\n if (rotationPosition === \"none\") {\r\n return [];\r\n }\r\n if (isArray(rotationPosition)) {\r\n return rotationPosition.map(function (child) { return getRotationPositions(child, [pos1, pos2, pos3, pos4], direction)[0]; });\r\n }\r\n var _c = __read((rotationPosition || \"top\").split(\"-\"), 2), dir1 = _c[0], dir2 = _c[1];\r\n var radPoses = [pos1, pos2];\r\n if (dir1 === \"left\") {\r\n radPoses = [pos3, pos1];\r\n }\r\n else if (dir1 === \"right\") {\r\n radPoses = [pos2, pos4];\r\n }\r\n else if (dir1 === \"bottom\") {\r\n radPoses = [pos4, pos3];\r\n }\r\n var pos = [\r\n (radPoses[0][0] + radPoses[1][0]) / 2,\r\n (radPoses[0][1] + radPoses[1][1]) / 2,\r\n ];\r\n var rad = getRotationRad(radPoses, direction);\r\n if (dir2) {\r\n var isStart = dir2 === \"top\" || dir2 === \"left\";\r\n var isReverse = dir1 === \"bottom\" || dir1 === \"left\";\r\n pos = radPoses[(isStart && !isReverse) || (!isStart && isReverse) ? 0 : 1];\r\n }\r\n return [[pos, rad]];\r\n}\r\nfunction dragControlCondition(moveable, e) {\r\n if (e.isRequest) {\r\n return e.requestAble === \"rotatable\";\r\n }\r\n var target = e.inputEvent.target;\r\n if (hasClass(target, prefix(\"rotation-control\"))\r\n || (moveable.props.rotateAroundControls && hasClass(target, prefix(\"around-control\")))\r\n || (hasClass(target, prefix(\"control\")) && hasClass(target, prefix(\"rotatable\")))) {\r\n return true;\r\n }\r\n var rotationTarget = moveable.props.rotationTarget;\r\n if (rotationTarget) {\r\n return getRefTargets(rotationTarget, true).some(function (element) {\r\n if (!element) {\r\n return false;\r\n }\r\n return target === element || target.contains(element);\r\n });\r\n }\r\n return false;\r\n}\r\nvar css = \".rotation {\\nposition: absolute;\\nheight: 40px;\\nwidth: 1px;\\ntransform-origin: 50% 100%;\\nheight: calc(40px * var(--zoom));\\ntop: auto;\\nleft: 0;\\nbottom: 100%;\\nwill-change: transform;\\n}\\n.rotation .rotation-line {\\ndisplay: block;\\nwidth: 100%;\\nheight: 100%;\\ntransform-origin: 50% 50%;\\n}\\n.rotation .rotation-control {\\nborder-color: #4af;\\nborder-color: var(--moveable-color);\\nbackground:#fff;\\ncursor: alias;\\n}\\n:global .view-rotation-dragging, .rotatable.direction.control {\\ncursor: alias;\\n}\\n.rotatable.direction.control.move {\\ncursor: move;\\n}\\n\";\r\nvar Rotatable = {\r\n name: \"rotatable\",\r\n canPinch: true,\r\n props: [\r\n \"rotatable\",\r\n \"rotationPosition\",\r\n \"throttleRotate\",\r\n \"renderDirections\",\r\n \"rotationTarget\",\r\n \"rotateAroundControls\",\r\n \"edge\",\r\n \"resolveAblesWithRotatable\",\r\n \"displayAroundControls\",\r\n ],\r\n events: [\r\n \"rotateStart\",\r\n \"beforeRotate\",\r\n \"rotate\",\r\n \"rotateEnd\",\r\n \"rotateGroupStart\",\r\n \"beforeRotateGroup\",\r\n \"rotateGroup\",\r\n \"rotateGroupEnd\",\r\n ],\r\n css: [css],\r\n viewClassName: function (moveable) {\r\n if (!moveable.isDragging(\"rotatable\")) {\r\n return \"\";\r\n }\r\n return prefix(\"view-rotation-dragging\");\r\n },\r\n render: function (moveable, React) {\r\n var _a = getProps(moveable.props, \"rotatable\"), rotatable = _a.rotatable, rotationPosition = _a.rotationPosition, zoom = _a.zoom, renderDirections = _a.renderDirections, rotateAroundControls = _a.rotateAroundControls, resolveAblesWithRotatable = _a.resolveAblesWithRotatable;\r\n var _b = moveable.getState(), renderPoses = _b.renderPoses, direction = _b.direction;\r\n if (!rotatable) {\r\n return null;\r\n }\r\n var positions = getRotationPositions(rotationPosition, renderPoses, direction);\r\n var jsxs = [];\r\n positions.forEach(function (_a, i) {\r\n var _b = __read(_a, 2), pos = _b[0], rad = _b[1];\r\n jsxs.push(React.createElement(\"div\", { key: \"rotation\".concat(i), className: prefix(\"rotation\"), style: {\r\n // tslint:disable-next-line: max-line-length\r\n transform: \"translate(-50%) translate(\".concat(pos[0], \"px, \").concat(pos[1], \"px) rotate(\").concat(rad, \"rad)\"),\r\n } },\r\n React.createElement(\"div\", { className: prefix(\"line rotation-line\"), style: {\r\n transform: \"scaleX(\".concat(zoom, \")\"),\r\n } }),\r\n React.createElement(\"div\", { className: prefix(\"control rotation-control\"), style: {\r\n transform: \"translate(0.5px) scale(\".concat(zoom, \")\"),\r\n } })));\r\n });\r\n if (renderDirections) {\r\n var ables = getKeys(resolveAblesWithRotatable || {});\r\n var resolveMap_1 = {};\r\n ables.forEach(function (name) {\r\n resolveAblesWithRotatable[name].forEach(function (direction) {\r\n resolveMap_1[direction] = name;\r\n });\r\n });\r\n var directionControlInfos = [];\r\n if (isArray(renderDirections)) {\r\n directionControlInfos = renderDirections.map(function (dir) {\r\n var able = resolveMap_1[dir];\r\n return {\r\n data: able ? { resolve: able } : {},\r\n classNames: able ? [\"move\"] : [],\r\n dir: dir,\r\n };\r\n });\r\n }\r\n jsxs.push.apply(jsxs, __spreadArray([], __read(renderDirectionControlsByInfos(moveable, \"rotatable\", directionControlInfos, React)), false));\r\n }\r\n if (rotateAroundControls) {\r\n jsxs.push.apply(jsxs, __spreadArray([], __read(renderAroundControls(moveable, React)), false));\r\n }\r\n return jsxs;\r\n },\r\n dragControlCondition: dragControlCondition,\r\n dragControlStart: function (moveable, e) {\r\n var _a;\r\n var _b;\r\n var datas = e.datas, clientX = e.clientX, clientY = e.clientY, parentRotate = e.parentRotate, parentFlag = e.parentFlag, isPinch = e.isPinch, isRequest = e.isRequest;\r\n var state = moveable.state;\r\n var target = state.target, left = state.left, top = state.top, direction = state.direction, beforeDirection = state.beforeDirection, targetTransform = state.targetTransform, moveableClientRect = state.moveableClientRect, offsetMatrix = state.offsetMatrix, targetMatrix = state.targetMatrix, allMatrix = state.allMatrix, width = state.width, height = state.height;\r\n if (!isRequest && !target) {\r\n return false;\r\n }\r\n var rect = moveable.getRect();\r\n datas.rect = rect;\r\n datas.transform = targetTransform;\r\n datas.left = left;\r\n datas.top = top;\r\n var setFixedPosition = function (fixedPosition) {\r\n var result = getOffsetFixedPositionInfo(moveable.state, fixedPosition);\r\n datas.fixedDirection = result.fixedDirection;\r\n datas.fixedOffset = result.fixedOffset;\r\n datas.fixedPosition = result.fixedPosition;\r\n if (resizeStart) {\r\n resizeStart.setFixedPosition(fixedPosition);\r\n }\r\n };\r\n var setFixedDirection = function (fixedDirection) {\r\n var result = getOffsetFixedDirectionInfo(moveable.state, fixedDirection);\r\n datas.fixedDirection = result.fixedDirection;\r\n datas.fixedOffset = result.fixedOffset;\r\n datas.fixedPosition = result.fixedPosition;\r\n if (resizeStart) {\r\n resizeStart.setFixedDirection(fixedDirection);\r\n }\r\n };\r\n var startClientX = clientX;\r\n var startClientY = clientY;\r\n if (isRequest || isPinch || parentFlag) {\r\n var externalRotate = parentRotate || 0;\r\n datas.beforeInfo = {\r\n origin: rect.beforeOrigin,\r\n prevDeg: externalRotate,\r\n defaultDeg: externalRotate,\r\n prevSnapDeg: 0,\r\n startDist: 0,\r\n };\r\n datas.afterInfo = __assign(__assign({}, datas.beforeInfo), { origin: rect.origin });\r\n datas.absoluteInfo = __assign(__assign({}, datas.beforeInfo), { origin: rect.origin, startValue: externalRotate });\r\n }\r\n else {\r\n var inputTarget = (_b = e.inputEvent) === null || _b === void 0 ? void 0 : _b.target;\r\n if (inputTarget) {\r\n var regionDirection = inputTarget.getAttribute(\"data-direction\") || \"\";\r\n var controlDirection = DIRECTION_REGION_TO_DIRECTION[regionDirection];\r\n if (controlDirection) {\r\n datas.isControl = true;\r\n datas.isAroundControl = hasClass(inputTarget, prefix(\"around-control\"));\r\n datas.controlDirection = controlDirection;\r\n var resolve = inputTarget.getAttribute(\"data-resolve\");\r\n if (resolve) {\r\n datas.resolveAble = resolve;\r\n }\r\n var clientPoses = calculateMoveableClientPositions(state.rootMatrix, state.renderPoses, moveableClientRect);\r\n _a = __read(getPosByDirection(clientPoses, controlDirection), 2), startClientX = _a[0], startClientY = _a[1];\r\n }\r\n }\r\n datas.beforeInfo = { origin: rect.beforeOrigin };\r\n datas.afterInfo = { origin: rect.origin };\r\n datas.absoluteInfo = {\r\n origin: rect.origin,\r\n startValue: rect.rotation,\r\n };\r\n var originalFixedPosition_1 = setFixedPosition;\r\n setFixedPosition = function (fixedPosition) {\r\n var n = state.is3d ? 4 : 3;\r\n var _a = __read(plus(getOrigin(targetMatrix, n), fixedPosition), 2), originX = _a[0], originY = _a[1];\r\n var fixedBeforeOrigin = calculate(offsetMatrix, convertPositionMatrix([originX, originY], n));\r\n var fixedAfterOrigin = calculate(allMatrix, convertPositionMatrix([fixedPosition[0], fixedPosition[1]], n));\r\n originalFixedPosition_1(fixedPosition);\r\n var posDelta = state.posDelta;\r\n datas.beforeInfo.origin = minus(fixedBeforeOrigin, posDelta);\r\n datas.afterInfo.origin = minus(fixedAfterOrigin, posDelta);\r\n datas.absoluteInfo.origin = minus(fixedAfterOrigin, posDelta);\r\n setRotateStartInfo(moveable, datas.beforeInfo, startClientX, startClientY, moveableClientRect);\r\n setRotateStartInfo(moveable, datas.afterInfo, startClientX, startClientY, moveableClientRect);\r\n setRotateStartInfo(moveable, datas.absoluteInfo, startClientX, startClientY, moveableClientRect);\r\n };\r\n setFixedDirection = function (fixedDirection) {\r\n var fixedPosition = getPosByDirection([\r\n [0, 0],\r\n [width, 0],\r\n [0, height],\r\n [width, height],\r\n ], fixedDirection);\r\n setFixedPosition(fixedPosition);\r\n };\r\n }\r\n datas.startClientX = startClientX;\r\n datas.startClientY = startClientY;\r\n datas.direction = direction;\r\n datas.beforeDirection = beforeDirection;\r\n datas.startValue = 0;\r\n datas.datas = {};\r\n setDefaultTransformIndex(moveable, e, \"rotate\");\r\n var dragStart = false;\r\n var resizeStart = false;\r\n if (datas.isControl && datas.resolveAble) {\r\n var resolveAble = datas.resolveAble;\r\n if (resolveAble === \"resizable\") {\r\n resizeStart = Resizable.dragControlStart(moveable, __assign(__assign({}, (new CustomGesto(\"resizable\").dragStart([0, 0], e))), { parentPosition: datas.controlPosition, parentFixedPosition: datas.fixedPosition }));\r\n }\r\n }\r\n if (!resizeStart) {\r\n dragStart = Draggable.dragStart(moveable, new CustomGesto().dragStart([0, 0], e));\r\n }\r\n setFixedPosition(getTotalOrigin(moveable));\r\n var params = fillParams(moveable, e, __assign(__assign({ set: function (rotatation) {\r\n datas.startValue = rotatation * Math.PI / 180;\r\n }, setFixedDirection: setFixedDirection, setFixedPosition: setFixedPosition }, fillTransformStartEvent(moveable, e)), { dragStart: dragStart, resizeStart: resizeStart }));\r\n var result = triggerEvent(moveable, \"onRotateStart\", params);\r\n datas.isRotate = result !== false;\r\n state.snapRenderInfo = {\r\n request: e.isRequest,\r\n };\r\n return datas.isRotate ? params : false;\r\n },\r\n dragControl: function (moveable, e) {\r\n var _a, _b, _c;\r\n var datas = e.datas, clientDistX = e.clientDistX, clientDistY = e.clientDistY, parentRotate = e.parentRotate, parentFlag = e.parentFlag, isPinch = e.isPinch, groupDelta = e.groupDelta, resolveMatrix = e.resolveMatrix;\r\n var beforeDirection = datas.beforeDirection, beforeInfo = datas.beforeInfo, afterInfo = datas.afterInfo, absoluteInfo = datas.absoluteInfo, isRotate = datas.isRotate, startValue = datas.startValue, rect = datas.rect, startClientX = datas.startClientX, startClientY = datas.startClientY;\r\n if (!isRotate) {\r\n return;\r\n }\r\n resolveTransformEvent(moveable, e, \"rotate\");\r\n var targetDirection = getTransformDirection(e);\r\n var direction = beforeDirection * targetDirection;\r\n var parentMoveable = moveable.props.parentMoveable;\r\n var beforeDelta = 0;\r\n var beforeDist;\r\n var beforeRotation;\r\n var delta = 0;\r\n var dist;\r\n var rotation;\r\n var absoluteDelta = 0;\r\n var absoluteDist;\r\n var absoluteRotation;\r\n var startRotation = 180 / Math.PI * startValue;\r\n var absoluteStartRotation = absoluteInfo.startValue;\r\n var isSnap = false;\r\n var nextClientX = startClientX + clientDistX;\r\n var nextClientY = startClientY + clientDistY;\r\n if (!parentFlag && \"parentDist\" in e) {\r\n var parentDist = e.parentDist;\r\n beforeDist = parentDist;\r\n dist = parentDist;\r\n absoluteDist = parentDist;\r\n }\r\n else if (isPinch || parentFlag) {\r\n beforeDist = getAbsoluteDist(parentRotate, beforeDirection, beforeInfo);\r\n dist = getAbsoluteDist(parentRotate, direction, afterInfo);\r\n absoluteDist = getAbsoluteDist(parentRotate, direction, absoluteInfo);\r\n }\r\n else {\r\n beforeDist = getAbsoluteDistByClient(nextClientX, nextClientY, beforeDirection, beforeInfo);\r\n dist = getAbsoluteDistByClient(nextClientX, nextClientY, direction, afterInfo);\r\n absoluteDist = getAbsoluteDistByClient(nextClientX, nextClientY, direction, absoluteInfo);\r\n isSnap = true;\r\n }\r\n beforeRotation = startRotation + beforeDist;\r\n rotation = startRotation + dist;\r\n absoluteRotation = absoluteStartRotation + absoluteDist;\r\n triggerEvent(moveable, \"onBeforeRotate\", fillParams(moveable, e, {\r\n beforeRotation: beforeRotation,\r\n rotation: rotation,\r\n absoluteRotation: absoluteRotation,\r\n setRotation: function (nextRotation) {\r\n dist = nextRotation - startRotation;\r\n beforeDist = dist;\r\n absoluteDist = dist;\r\n },\r\n }, true));\r\n _a = __read(getRotateInfo(moveable, rect, beforeInfo, beforeDist, startRotation, isSnap), 3), beforeDelta = _a[0], beforeDist = _a[1], beforeRotation = _a[2];\r\n _b = __read(getRotateInfo(moveable, rect, afterInfo, dist, startRotation, isSnap), 3), delta = _b[0], dist = _b[1], rotation = _b[2];\r\n _c = __read(getRotateInfo(moveable, rect, absoluteInfo, absoluteDist, absoluteStartRotation, isSnap), 3), absoluteDelta = _c[0], absoluteDist = _c[1], absoluteRotation = _c[2];\r\n if (!absoluteDelta && !delta && !beforeDelta && !parentMoveable && !resolveMatrix) {\r\n return;\r\n }\r\n var nextTransform = convertTransformFormat(datas, \"rotate(\".concat(rotation, \"deg)\"), \"rotate(\".concat(dist, \"deg)\"));\r\n if (resolveMatrix) {\r\n datas.fixedPosition = getTranslateFixedPosition(moveable, datas.targetAllTransform, datas.fixedDirection, datas.fixedOffset, datas);\r\n }\r\n var inverseDist = getRotateDist(moveable, dist, datas);\r\n var inverseDelta = minus(plus(groupDelta || [0, 0], inverseDist), datas.prevInverseDist || [0, 0]);\r\n datas.prevInverseDist = inverseDist;\r\n datas.requestValue = null;\r\n var dragEvent = fillTransformEvent(moveable, nextTransform, inverseDelta, isPinch, e);\r\n var transformEvent = dragEvent;\r\n var parentDistance = getDist$1([nextClientX, nextClientY], absoluteInfo.startAbsoluteOrigin) - absoluteInfo.startDist;\r\n var resize = undefined;\r\n if (datas.resolveAble === \"resizable\") {\r\n var resizeEvent = Resizable.dragControl(moveable, __assign(__assign({}, setCustomDrag(e, moveable.state, [e.deltaX, e.deltaY], !!isPinch, false, \"resizable\")), { resolveMatrix: true, parentDistance: parentDistance }));\r\n if (resizeEvent) {\r\n resize = resizeEvent;\r\n transformEvent = fillAfterTransform(transformEvent, resizeEvent, e);\r\n }\r\n }\r\n var params = fillParams(moveable, e, __assign(__assign({ delta: delta, dist: dist, rotate: rotation, rotation: rotation, beforeDist: beforeDist, beforeDelta: beforeDelta, beforeRotate: beforeRotation, beforeRotation: beforeRotation, absoluteDist: absoluteDist, absoluteDelta: absoluteDelta, absoluteRotate: absoluteRotation, absoluteRotation: absoluteRotation, isPinch: !!isPinch, resize: resize }, dragEvent), transformEvent));\r\n triggerEvent(moveable, \"onRotate\", params);\r\n return params;\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n var datas = e.datas;\r\n if (!datas.isRotate) {\r\n return;\r\n }\r\n datas.isRotate = false;\r\n var params = fillEndParams(moveable, e, {});\r\n triggerEvent(moveable, \"onRotateEnd\", params);\r\n return params;\r\n },\r\n dragGroupControlCondition: dragControlCondition,\r\n dragGroupControlStart: function (moveable, e) {\r\n var datas = e.datas;\r\n var _a = moveable.state, parentLeft = _a.left, parentTop = _a.top, parentBeforeOrigin = _a.beforeOrigin;\r\n var params = this.dragControlStart(moveable, e);\r\n if (!params) {\r\n return false;\r\n }\r\n params.set(datas.beforeDirection * moveable.rotation);\r\n var events = triggerChildAbles(moveable, this, \"dragControlStart\", e, function (child, ev) {\r\n var _a = child.state, left = _a.left, top = _a.top, beforeOrigin = _a.beforeOrigin;\r\n var childClient = plus(minus([left, top], [parentLeft, parentTop]), minus(beforeOrigin, parentBeforeOrigin));\r\n ev.datas.startGroupClient = childClient;\r\n ev.datas.groupClient = childClient;\r\n return __assign(__assign({}, ev), { parentRotate: 0 });\r\n });\r\n var nextParams = __assign(__assign({}, params), { targets: moveable.props.targets, events: events });\r\n var result = triggerEvent(moveable, \"onRotateGroupStart\", nextParams);\r\n datas.isRotate = result !== false;\r\n return datas.isRotate ? params : false;\r\n },\r\n dragGroupControl: function (moveable, e) {\r\n var datas = e.datas;\r\n if (!datas.isRotate) {\r\n return;\r\n }\r\n catchEvent(moveable, \"onBeforeRotate\", function (parentEvent) {\r\n triggerEvent(moveable, \"onBeforeRotateGroup\", fillParams(moveable, e, __assign(__assign({}, parentEvent), { targets: moveable.props.targets }), true));\r\n });\r\n var params = this.dragControl(moveable, e);\r\n if (!params) {\r\n return;\r\n }\r\n var direction = datas.beforeDirection;\r\n var parentRotate = params.beforeDist;\r\n var rad = parentRotate / 180 * Math.PI;\r\n var events = triggerChildAbles(moveable, this, \"dragControl\", e, function (_, ev) {\r\n var startGroupClient = ev.datas.startGroupClient;\r\n var _a = __read(ev.datas.groupClient, 2), prevClientX = _a[0], prevClientY = _a[1];\r\n var _b = __read(rotate(startGroupClient, rad * direction), 2), clientX = _b[0], clientY = _b[1];\r\n var delta = [clientX - prevClientX, clientY - prevClientY];\r\n ev.datas.groupClient = [clientX, clientY];\r\n return __assign(__assign({}, ev), { parentRotate: parentRotate, groupDelta: delta });\r\n });\r\n moveable.rotation = direction * params.beforeRotation;\r\n var nextParams = __assign({ targets: moveable.props.targets, events: events, set: function (rotation) {\r\n moveable.rotation = rotation;\r\n }, setGroupRotation: function (rotation) {\r\n moveable.rotation = rotation;\r\n } }, params);\r\n triggerEvent(moveable, \"onRotateGroup\", nextParams);\r\n return nextParams;\r\n },\r\n dragGroupControlEnd: function (moveable, e) {\r\n var isDrag = e.isDrag, datas = e.datas;\r\n if (!datas.isRotate) {\r\n return;\r\n }\r\n this.dragControlEnd(moveable, e);\r\n var events = triggerChildAbles(moveable, this, \"dragControlEnd\", e);\r\n var nextParams = fillEndParams(moveable, e, {\r\n targets: moveable.props.targets,\r\n events: events,\r\n });\r\n triggerEvent(moveable, \"onRotateGroupEnd\", nextParams);\r\n return isDrag;\r\n },\r\n /**\r\n * @method Moveable.Rotatable#request\r\n * @param {object} [e] - the Resizable's request parameter\r\n * @param {number} [e.deltaRotate=0] - delta number of rotation\r\n * @param {number} [e.rotate=0] - absolute number of moveable's rotation\r\n * @return {Moveable.Requester} Moveable Requester\r\n * @example\r\n\n * // Instantly Request (requestStart - request - requestEnd)\r\n * moveable.request(\"rotatable\", { deltaRotate: 10 }, true);\r\n *\r\n * * moveable.request(\"rotatable\", { rotate: 10 }, true);\r\n *\r\n * // requestStart\r\n * const requester = moveable.request(\"rotatable\");\r\n *\r\n * // request\r\n * requester.request({ deltaRotate: 10 });\r\n * requester.request({ deltaRotate: 10 });\r\n * requester.request({ deltaRotate: 10 });\r\n *\r\n * requester.request({ rotate: 10 });\r\n * requester.request({ rotate: 20 });\r\n * requester.request({ rotate: 30 });\r\n *\r\n * // requestEnd\r\n * requester.requestEnd();\r\n */\r\n request: function (moveable) {\r\n var datas = {};\r\n var distRotate = 0;\r\n var startRotation = moveable.getRotation();\r\n return {\r\n isControl: true,\r\n requestStart: function () {\r\n return { datas: datas };\r\n },\r\n request: function (e) {\r\n if (\"deltaRotate\" in e) {\r\n distRotate += e.deltaRotate;\r\n }\r\n else if (\"rotate\" in e) {\r\n distRotate = e.rotate - startRotation;\r\n }\r\n return { datas: datas, parentDist: distRotate };\r\n },\r\n requestEnd: function () {\r\n return { datas: datas, isDrag: true };\r\n },\r\n };\r\n },\r\n};\r\n/**\r\n * Whether or not target can be rotated. (default: false)\r\n * @name Moveable.Rotatable#rotatable\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.rotatable = true;\r\n */\r\n/**\r\n * You can specify the position of the rotation. (default: \"top\")\r\n * @name Moveable.Rotatable#rotationPosition\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * rotationPosition: \"top\",\r\n * });\r\n *\r\n * moveable.rotationPosition = \"bottom\"\r\n */\r\n/**\r\n * throttle of angle(degree) when rotate.\r\n * @name Moveable.Rotatable#throttleRotate\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.throttleRotate = 1;\r\n */\r\n/**\r\n * When the rotate starts, the rotateStart event is called.\r\n * @memberof Moveable.Rotatable\r\n * @event rotateStart\r\n * @param {Moveable.Rotatable.OnRotateStart} - Parameters for the rotateStart event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { rotatable: true });\r\n * moveable.on(\"rotateStart\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n */\r\n/**\r\n* When rotating, the rotate event is called.\r\n* @memberof Moveable.Rotatable\r\n* @event rotate\r\n* @param {Moveable.Rotatable.OnRotate} - Parameters for the rotate event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, { rotatable: true });\r\n* moveable.on(\"rotate\", ({ target, transform, dist }) => {\r\n* target.style.transform = transform;\r\n* });\r\n*/\r\n/**\r\n * When the rotate finishes, the rotateEnd event is called.\r\n * @memberof Moveable.Rotatable\r\n * @event rotateEnd\r\n * @param {Moveable.Rotatable.OnRotateEnd} - Parameters for the rotateEnd event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { rotatable: true });\r\n * moveable.on(\"rotateEnd\", ({ target, isDrag }) => {\r\n * console.log(target, isDrag);\r\n * });\r\n */\r\n/**\r\n * When the group rotate starts, the `rotateGroupStart` event is called.\r\n * @memberof Moveable.Rotatable\r\n * @event rotateGroupStart\r\n * @param {Moveable.Rotatable.OnRotateGroupStart} - Parameters for the `rotateGroupStart` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * rotatable: true\r\n * });\r\n * moveable.on(\"rotateGroupStart\", ({ targets }) => {\r\n * console.log(\"onRotateGroupStart\", targets);\r\n * });\r\n */\r\n/**\r\n* When the group rotate, the `rotateGroup` event is called.\r\n* @memberof Moveable.Rotatable\r\n* @event rotateGroup\r\n* @param {Moveable.Rotatable.OnRotateGroup} - Parameters for the `rotateGroup` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* target: [].slice.call(document.querySelectorAll(\".target\")),\r\n* rotatable: true\r\n* });\r\n* moveable.on(\"rotateGroup\", ({ targets, events }) => {\r\n* console.log(\"onRotateGroup\", targets);\r\n* events.forEach(ev => {\r\n* const target = ev.target;\r\n* // ev.drag is a drag event that occurs when the group rotate.\r\n* const left = ev.drag.beforeDist[0];\r\n* const top = ev.drag.beforeDist[1];\r\n* const deg = ev.beforeDist;\r\n* });\r\n* });\r\n*/\r\n/**\r\n * When the group rotate finishes, the `rotateGroupEnd` event is called.\r\n * @memberof Moveable.Rotatable\r\n * @event rotateGroupEnd\r\n * @param {Moveable.Rotatable.OnRotateGroupEnd} - Parameters for the `rotateGroupEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * rotatable: true\r\n * });\r\n * moveable.on(\"rotateGroupEnd\", ({ targets, isDrag }) => {\r\n * console.log(\"onRotateGroupEnd\", targets, isDrag);\r\n * });\r\n */\n\nfunction renderGuideline(info, React) {\r\n var _a;\r\n var direction = info.direction, classNames = info.classNames, size = info.size, pos = info.pos, zoom = info.zoom, key = info.key;\r\n var isHorizontal = direction === \"horizontal\";\r\n var scaleType = isHorizontal ? \"Y\" : \"X\";\r\n // const scaleType2 = isHorizontal ? \"Y\" : \"X\";\r\n return React.createElement(\"div\", {\r\n key: key,\r\n className: classNames.join(\" \"),\r\n style: (_a = {},\r\n _a[isHorizontal ? \"width\" : \"height\"] = \"\".concat(size),\r\n _a.transform = \"translate(\".concat(pos[0], \", \").concat(pos[1], \") translate\").concat(scaleType, \"(-50%) scale\").concat(scaleType, \"(\").concat(zoom, \")\"),\r\n _a),\r\n });\r\n}\r\nfunction renderInnerGuideline(info, React) {\r\n return renderGuideline(__assign(__assign({}, info), { classNames: __spreadArray([\r\n prefix(\"line\", \"guideline\", info.direction)\r\n ], __read(info.classNames), false).filter(function (className) { return className; }), size: info.size || \"\".concat(info.sizeValue, \"px\"), pos: info.pos || info.posValue.map(function (v) { return \"\".concat(throttle(v, 0.1), \"px\"); }) }), React);\r\n}\r\nfunction renderSnapPoses(moveable, direction, snapPoses, minPos, targetPos, size, index, React) {\r\n var zoom = moveable.props.zoom;\r\n return snapPoses.map(function (_a, i) {\r\n var type = _a.type, pos = _a.pos;\r\n var renderPos = [0, 0];\r\n renderPos[index] = minPos;\r\n renderPos[index ? 0 : 1] = -targetPos + pos;\r\n return renderInnerGuideline({\r\n key: \"\".concat(direction, \"TargetGuideline\").concat(i),\r\n classNames: [prefix(\"target\", \"bold\", type)],\r\n posValue: renderPos,\r\n sizeValue: size,\r\n zoom: zoom,\r\n direction: direction,\r\n }, React);\r\n });\r\n}\r\nfunction renderGuidelines(moveable, type, guidelines, targetPos, targetRect, React) {\r\n var _a = moveable.props, zoom = _a.zoom, isDisplayInnerSnapDigit = _a.isDisplayInnerSnapDigit;\r\n var mainNames = type === \"horizontal\" ? VERTICAL_NAMES_MAP : HORIZONTAL_NAMES_MAP;\r\n var targetStart = targetRect[mainNames.start];\r\n var targetEnd = targetRect[mainNames.end];\r\n return guidelines.filter(function (_a) {\r\n var hide = _a.hide, elementRect = _a.elementRect;\r\n if (hide) {\r\n return false;\r\n }\r\n if (isDisplayInnerSnapDigit && elementRect) {\r\n // inner\r\n var rect = elementRect.rect;\r\n if (rect[mainNames.start] <= targetStart && targetEnd <= rect[mainNames.end]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }).map(function (guideline, i) {\r\n var pos = guideline.pos, size = guideline.size, element = guideline.element, className = guideline.className;\r\n var renderPos = [\r\n -targetPos[0] + pos[0],\r\n -targetPos[1] + pos[1],\r\n ];\r\n return renderInnerGuideline({\r\n key: \"\".concat(type, \"-default-guideline-\").concat(i),\r\n classNames: element ? [prefix(\"bold\"), className] : [prefix(\"normal\"), className],\r\n direction: type,\r\n posValue: renderPos,\r\n sizeValue: size,\r\n zoom: zoom,\r\n }, React);\r\n });\r\n}\r\nfunction renderDigitLine(moveable, type, lineType, index, gap, renderPos, className, React) {\r\n var _a;\r\n var _b = moveable.props, _c = _b.snapDigit, snapDigit = _c === void 0 ? 0 : _c, _d = _b.isDisplaySnapDigit, isDisplaySnapDigit = _d === void 0 ? true : _d, _e = _b.snapDistFormat, snapDistFormat = _e === void 0 ? function (v, type) {\r\n // Type can be used render different values.\r\n if (type === 'vertical') {\r\n return v;\r\n }\r\n return v;\r\n } : _e, zoom = _b.zoom;\r\n var scaleType = type === \"horizontal\" ? \"X\" : \"Y\";\r\n var sizeName = type === \"vertical\" ? \"height\" : \"width\";\r\n var absGap = Math.abs(gap);\r\n var snapSize = isDisplaySnapDigit\r\n ? parseFloat(absGap.toFixed(snapDigit))\r\n : 0;\r\n return React.createElement(\"div\", { key: \"\".concat(type, \"-\").concat(lineType, \"-guideline-\").concat(index), className: prefix(\"guideline-group\", type), style: (_a = {\r\n left: \"\".concat(renderPos[0], \"px\"),\r\n top: \"\".concat(renderPos[1], \"px\")\r\n },\r\n _a[sizeName] = \"\".concat(absGap, \"px\"),\r\n _a) },\r\n renderInnerGuideline({\r\n direction: type,\r\n classNames: [prefix(lineType), className],\r\n size: \"100%\",\r\n posValue: [0, 0],\r\n sizeValue: absGap,\r\n zoom: zoom,\r\n }, React),\r\n React.createElement(\"div\", { className: prefix(\"size-value\", \"gap\"), style: {\r\n transform: \"translate\".concat(scaleType, \"(-50%) scale(\").concat(zoom, \")\"),\r\n } }, snapSize > 0 ? snapDistFormat(snapSize, type) : \"\"));\r\n}\r\nfunction groupByElementGuidelines(type, guidelines, targetRect, isDisplayInnerSnapDigit) {\r\n var index = type === \"vertical\" ? 0 : 1;\r\n var otherIndex = type === \"vertical\" ? 1 : 0;\r\n var names = index ? VERTICAL_NAMES_MAP : HORIZONTAL_NAMES_MAP;\r\n var targetStart = targetRect[names.start];\r\n var targetEnd = targetRect[names.end];\r\n return groupBy(guidelines, function (guideline) {\r\n return guideline.pos[index];\r\n }).map(function (nextGuidelines) {\r\n var start = [];\r\n var end = [];\r\n var inner = [];\r\n nextGuidelines.forEach(function (guideline) {\r\n var _a, _b;\r\n var element = guideline.element;\r\n var rect = guideline.elementRect.rect;\r\n if (rect[names.end] < targetStart) {\r\n start.push(guideline);\r\n }\r\n else if (targetEnd < rect[names.start]) {\r\n end.push(guideline);\r\n }\r\n else if (rect[names.start] <= targetStart && targetEnd <= rect[names.end] && isDisplayInnerSnapDigit) {\r\n var pos = guideline.pos;\r\n var elementRect1 = { element: element, rect: __assign(__assign({}, rect), (_a = {}, _a[names.end] = rect[names.start], _a)) };\r\n var elementRect2 = { element: element, rect: __assign(__assign({}, rect), (_b = {}, _b[names.start] = rect[names.end], _b)) };\r\n var nextPos1 = [0, 0];\r\n var nextPos2 = [0, 0];\r\n nextPos1[index] = pos[index];\r\n nextPos1[otherIndex] = pos[otherIndex];\r\n nextPos2[index] = pos[index];\r\n nextPos2[otherIndex] = pos[otherIndex] + guideline.size;\r\n start.push({\r\n type: type,\r\n pos: nextPos1,\r\n size: 0,\r\n elementRect: elementRect1,\r\n direction: \"\",\r\n elementDirection: \"end\",\r\n });\r\n end.push({\r\n type: type,\r\n pos: nextPos2,\r\n size: 0,\r\n elementRect: elementRect2,\r\n direction: \"\",\r\n elementDirection: \"start\",\r\n });\r\n // inner.push(guideline);\r\n }\r\n });\r\n start.sort(function (a, b) {\r\n return b.pos[otherIndex] - a.pos[otherIndex];\r\n });\r\n end.sort(function (a, b) {\r\n return a.pos[otherIndex] - b.pos[otherIndex];\r\n });\r\n return {\r\n total: nextGuidelines,\r\n start: start,\r\n end: end,\r\n inner: inner,\r\n };\r\n });\r\n}\r\nfunction renderDashedGuidelines(moveable, guidelines, targetPos, targetRect, React) {\r\n var isDisplayInnerSnapDigit = moveable.props.isDisplayInnerSnapDigit;\r\n var rendered = [];\r\n [\"vertical\", \"horizontal\"].forEach(function (type) {\r\n var nextGuidelines = guidelines.filter(function (guideline) { return guideline.type === type; });\r\n var index = type === \"vertical\" ? 1 : 0;\r\n var otherIndex = index ? 0 : 1;\r\n var groups = groupByElementGuidelines(type, nextGuidelines, targetRect, isDisplayInnerSnapDigit);\r\n var mainNames = index ? HORIZONTAL_NAMES_MAP : VERTICAL_NAMES_MAP;\r\n var sideNames = index ? VERTICAL_NAMES_MAP : HORIZONTAL_NAMES_MAP;\r\n var targetStart = targetRect[mainNames.start];\r\n var targetEnd = targetRect[mainNames.end];\r\n groups.forEach(function (_a) {\r\n var total = _a.total, start = _a.start, end = _a.end, inner = _a.inner;\r\n var sidePos = targetPos[otherIndex] + total[0].pos[otherIndex] - targetRect[sideNames.start];\r\n var prevRect = targetRect;\r\n start.forEach(function (guideline) {\r\n var nextRect = guideline.elementRect.rect;\r\n var size = prevRect[mainNames.start] - nextRect[mainNames.end];\r\n if (size > 0) {\r\n var renderPos = [0, 0];\r\n renderPos[index] = targetPos[index] + prevRect[mainNames.start] - targetStart - size;\r\n renderPos[otherIndex] = sidePos;\r\n rendered.push(renderDigitLine(moveable, type, \"dashed\", rendered.length, size, renderPos, guideline.className, React));\r\n }\r\n prevRect = nextRect;\r\n });\r\n prevRect = targetRect;\r\n end.forEach(function (guideline) {\r\n var nextRect = guideline.elementRect.rect;\r\n var size = nextRect[mainNames.start] - prevRect[mainNames.end];\r\n if (size > 0) {\r\n var renderPos = [0, 0];\r\n renderPos[index] = targetPos[index] + prevRect[mainNames.end] - targetStart;\r\n renderPos[otherIndex] = sidePos;\r\n rendered.push(renderDigitLine(moveable, type, \"dashed\", rendered.length, size, renderPos, guideline.className, React));\r\n }\r\n prevRect = nextRect;\r\n });\r\n inner.forEach(function (guideline) {\r\n var nextRect = guideline.elementRect.rect;\r\n var size1 = targetStart - nextRect[mainNames.start];\r\n var size2 = nextRect[mainNames.end] - targetEnd;\r\n var renderPos1 = [0, 0];\r\n var renderPos2 = [0, 0];\r\n renderPos1[index] = targetPos[index] - size1;\r\n renderPos1[otherIndex] = sidePos;\r\n renderPos2[index] = targetPos[index] + targetEnd - targetStart;\r\n renderPos2[otherIndex] = sidePos;\r\n rendered.push(renderDigitLine(moveable, type, \"dashed\", rendered.length, size1, renderPos1, guideline.className, React));\r\n rendered.push(renderDigitLine(moveable, type, \"dashed\", rendered.length, size2, renderPos2, guideline.className, React));\r\n });\r\n });\r\n });\r\n return rendered;\r\n}\r\nfunction renderGapGuidelines(moveable, guidelines, targetPos, targetRect, React) {\r\n var rendered = [];\r\n [\"horizontal\", \"vertical\"].forEach(function (type) {\r\n var nextGuidelines = guidelines.filter(function (guideline) { return guideline.type === type; }).slice(0, 1);\r\n var index = type === \"vertical\" ? 0 : 1;\r\n var otherIndex = index ? 0 : 1;\r\n var mainNames = index ? HORIZONTAL_NAMES_MAP : VERTICAL_NAMES_MAP;\r\n var sideNames = index ? VERTICAL_NAMES_MAP : HORIZONTAL_NAMES_MAP;\r\n var targetStart = targetRect[mainNames.start];\r\n var targetEnd = targetRect[mainNames.end];\r\n var targetSideStart = targetRect[sideNames.start];\r\n var targetSideEnd = targetRect[sideNames.end];\r\n nextGuidelines.forEach(function (_a) {\r\n var gap = _a.gap, gapRects = _a.gapRects;\r\n var sideStartPos = Math.max.apply(Math, __spreadArray([targetSideStart], __read(gapRects.map(function (_a) {\r\n var rect = _a.rect;\r\n return rect[sideNames.start];\r\n })), false));\r\n var sideEndPos = Math.min.apply(Math, __spreadArray([targetSideEnd], __read(gapRects.map(function (_a) {\r\n var rect = _a.rect;\r\n return rect[sideNames.end];\r\n })), false));\r\n var sideCenterPos = (sideStartPos + sideEndPos) / 2;\r\n if (sideStartPos === sideEndPos || sideCenterPos === (targetSideStart + targetSideEnd) / 2) {\r\n return;\r\n }\r\n gapRects.forEach(function (_a) {\r\n var rect = _a.rect, className = _a.className;\r\n var renderPos = [targetPos[0], targetPos[1]];\r\n if (rect[mainNames.end] < targetStart) {\r\n renderPos[index] += rect[mainNames.end] - targetStart;\r\n }\r\n else if (targetEnd < rect[mainNames.start]) {\r\n renderPos[index] += rect[mainNames.start] - targetStart - gap;\r\n }\r\n else {\r\n return;\r\n }\r\n renderPos[otherIndex] += sideCenterPos - targetSideStart;\r\n rendered.push(renderDigitLine(moveable, index ? \"vertical\" : \"horizontal\", \"gap\", rendered.length, gap, renderPos, className, React));\r\n });\r\n });\r\n });\r\n return rendered;\r\n}\n\nfunction getTotalGuidelines(moveable) {\r\n var _a, _b;\r\n var state = moveable.state;\r\n var containerClientRect = state.containerClientRect, hasFixed = state.hasFixed;\r\n var overflow = containerClientRect.overflow, containerHeight = containerClientRect.scrollHeight, containerWidth = containerClientRect.scrollWidth, containerClientHeight = containerClientRect.clientHeight, containerClientWidth = containerClientRect.clientWidth, clientLeft = containerClientRect.clientLeft, clientTop = containerClientRect.clientTop;\r\n var _c = moveable.props, _d = _c.snapGap, snapGap = _d === void 0 ? true : _d, verticalGuidelines = _c.verticalGuidelines, horizontalGuidelines = _c.horizontalGuidelines, _e = _c.snapThreshold, snapThreshold = _e === void 0 ? 5 : _e, _f = _c.maxSnapElementGuidelineDistance, maxSnapElementGuidelineDistance = _f === void 0 ? Infinity : _f, isDisplayGridGuidelines = _c.isDisplayGridGuidelines;\r\n var _g = getRect(getAbsolutePosesByState(moveable.state)), top = _g.top, left = _g.left, bottom = _g.bottom, right = _g.right;\r\n var targetRect = { top: top, left: left, bottom: bottom, right: right, center: (left + right) / 2, middle: (top + bottom) / 2 };\r\n var elementGuidelines = getElementGuidelines(moveable);\r\n var totalGuidelines = __spreadArray([], __read(elementGuidelines), false);\r\n var snapThresholdMultiples = ((_b = (_a = state.snapThresholdInfo) === null || _a === void 0 ? void 0 : _a.multiples) !== null && _b !== void 0 ? _b : [1, 1]).map(function (n) { return n * snapThreshold; });\r\n if (snapGap) {\r\n totalGuidelines.push.apply(totalGuidelines, __spreadArray([], __read(getGapGuidelines(moveable, targetRect, snapThresholdMultiples)), false));\r\n }\r\n var snapOffset = __assign({}, (state.snapOffset || {\r\n left: 0,\r\n top: 0,\r\n bottom: 0,\r\n right: 0,\r\n }));\r\n totalGuidelines.push.apply(totalGuidelines, __spreadArray([], __read(getGridGuidelines(moveable, overflow ? containerWidth : containerClientWidth, overflow ? containerHeight : containerClientHeight, clientLeft, clientTop, snapOffset, isDisplayGridGuidelines)), false));\r\n if (hasFixed) {\r\n var left_1 = containerClientRect.left, top_1 = containerClientRect.top;\r\n snapOffset.left += left_1;\r\n snapOffset.top += top_1;\r\n snapOffset.right += left_1;\r\n snapOffset.bottom += top_1;\r\n }\r\n totalGuidelines.push.apply(totalGuidelines, __spreadArray([], __read(getDefaultGuidelines(horizontalGuidelines || false, verticalGuidelines || false, overflow ? containerWidth : containerClientWidth, overflow ? containerHeight : containerClientHeight, clientLeft, clientTop, snapOffset)), false));\r\n totalGuidelines = totalGuidelines.filter(function (_a) {\r\n var element = _a.element, elementRect = _a.elementRect, type = _a.type;\r\n if (!element || !elementRect) {\r\n return true;\r\n }\r\n var rect = elementRect.rect;\r\n return checkBetweenRects(targetRect, rect, type, maxSnapElementGuidelineDistance);\r\n });\r\n return totalGuidelines;\r\n}\r\nfunction getGapGuidelines(moveable, targetRect, snapThresholds) {\r\n var _a = moveable.props, _b = _a.maxSnapElementGuidelineDistance, maxSnapElementGuidelineDistance = _b === void 0 ? Infinity : _b, _c = _a.maxSnapElementGapDistance, maxSnapElementGapDistance = _c === void 0 ? Infinity : _c;\r\n var elementRects = moveable.state.elementRects;\r\n var gapGuidelines = [];\r\n [\r\n [\"vertical\", VERTICAL_NAMES_MAP, HORIZONTAL_NAMES_MAP],\r\n [\"horizontal\", HORIZONTAL_NAMES_MAP, VERTICAL_NAMES_MAP],\r\n ].forEach(function (_a) {\r\n var _b = __read(_a, 3), type = _b[0], mainNames = _b[1], sideNames = _b[2];\r\n var targetStart = targetRect[mainNames.start];\r\n var targetEnd = targetRect[mainNames.end];\r\n var targetCenter = targetRect[mainNames.center];\r\n var targetStart2 = targetRect[sideNames.start];\r\n var targetEnd2 = targetRect[sideNames.end];\r\n // element : moveable\r\n var snapThresholdMap = {\r\n left: snapThresholds[0],\r\n top: snapThresholds[1],\r\n };\r\n function getDist(elementRect) {\r\n var rect = elementRect.rect;\r\n var snapThreshold = snapThresholdMap[mainNames.start];\r\n if (rect[mainNames.end] < targetStart + snapThreshold) {\r\n return targetStart - rect[mainNames.end];\r\n }\r\n else if (targetEnd - snapThreshold < rect[mainNames.start]) {\r\n return rect[mainNames.start] - targetEnd;\r\n }\r\n else {\r\n return -1;\r\n }\r\n }\r\n var nextElementRects = elementRects.filter(function (elementRect) {\r\n var rect = elementRect.rect;\r\n if (rect[sideNames.start] > targetEnd2 || rect[sideNames.end] < targetStart2) {\r\n return false;\r\n }\r\n return getDist(elementRect) > 0;\r\n }).sort(function (a, b) {\r\n return getDist(a) - getDist(b);\r\n });\r\n var groups = [];\r\n nextElementRects.forEach(function (snapRect1) {\r\n nextElementRects.forEach(function (snapRect2) {\r\n if (snapRect1 === snapRect2) {\r\n return;\r\n }\r\n var rect1 = snapRect1.rect;\r\n var rect2 = snapRect2.rect;\r\n var rect1Start = rect1[sideNames.start];\r\n var rect1End = rect1[sideNames.end];\r\n var rect2Start = rect2[sideNames.start];\r\n var rect2End = rect2[sideNames.end];\r\n if (rect1Start > rect2End || rect2Start > rect1End) {\r\n return;\r\n }\r\n groups.push([snapRect1, snapRect2]);\r\n });\r\n });\r\n groups.forEach(function (_a) {\r\n var _b = __read(_a, 2), snapRect1 = _b[0], snapRect2 = _b[1];\r\n var rect1 = snapRect1.rect;\r\n var rect2 = snapRect2.rect;\r\n var rect1Start = rect1[mainNames.start];\r\n var rect1End = rect1[mainNames.end];\r\n var rect2Start = rect2[mainNames.start];\r\n var rect2End = rect2[mainNames.end];\r\n var snapThreshold = snapThresholdMap[mainNames.start];\r\n var gap = 0;\r\n var pos = 0;\r\n var isStart = false;\r\n var isCenter = false;\r\n var isEnd = false;\r\n if (rect1End <= targetStart && targetEnd <= rect2Start) {\r\n // (l)element1(r) : (l)target(r) : (l)element2(r)\r\n isCenter = true;\r\n gap = ((rect2Start - rect1End) - (targetEnd - targetStart)) / 2;\r\n pos = rect1End + gap + (targetEnd - targetStart) / 2;\r\n if (abs(pos - targetCenter) > snapThreshold) {\r\n return;\r\n }\r\n }\r\n else if (rect1End < rect2Start && rect2End < targetStart + snapThreshold) {\r\n // (l)element1(r) : (l)element2(r) : (l)target\r\n isStart = true;\r\n gap = rect2Start - rect1End;\r\n pos = rect2End + gap;\r\n if (abs(pos - targetStart) > snapThreshold) {\r\n return;\r\n }\r\n }\r\n else if (rect1End < rect2Start && targetEnd - snapThreshold < rect1Start) {\r\n // target(r) : (l)element1(r) : (l)element2(r)\r\n isEnd = true;\r\n gap = rect2Start - rect1End;\r\n pos = rect1Start - gap;\r\n if (abs(pos - targetEnd) > snapThreshold) {\r\n return;\r\n }\r\n }\r\n else {\r\n return;\r\n }\r\n if (!gap) {\r\n return;\r\n }\r\n if (!checkBetweenRects(targetRect, rect2, type, maxSnapElementGuidelineDistance)) {\r\n return;\r\n }\r\n if (gap > maxSnapElementGapDistance) {\r\n return;\r\n }\r\n gapGuidelines.push({\r\n type: type,\r\n pos: type === \"vertical\" ? [pos, 0] : [0, pos],\r\n element: snapRect2.element,\r\n size: 0,\r\n className: snapRect2.className,\r\n isStart: isStart,\r\n isCenter: isCenter,\r\n isEnd: isEnd,\r\n gap: gap,\r\n hide: true,\r\n gapRects: [snapRect1, snapRect2],\r\n direction: \"\",\r\n elementDirection: \"\",\r\n });\r\n });\r\n });\r\n return gapGuidelines;\r\n}\r\nfunction startGridGroupGuidelines(moveable, clientLeft, clientTop, snapOffset) {\r\n var _a, _b;\r\n var props = moveable.props;\r\n var state = moveable.state;\r\n var snapGridAll = props.snapGridAll;\r\n var _c = props.snapGridWidth, snapGridWidth = _c === void 0 ? 0 : _c, _d = props.snapGridHeight, snapGridHeight = _d === void 0 ? 0 : _d;\r\n var snapRenderInfo = state.snapRenderInfo;\r\n var hasDirection = snapRenderInfo && (((_a = snapRenderInfo.direction) === null || _a === void 0 ? void 0 : _a[0]) || ((_b = snapRenderInfo.direction) === null || _b === void 0 ? void 0 : _b[1]));\r\n var moveables = moveable.moveables;\r\n // snap group's all child to grid.\r\n if (snapGridAll\r\n && moveables\r\n && hasDirection\r\n && (snapGridWidth || snapGridHeight)) {\r\n if (state.snapThresholdInfo) {\r\n return;\r\n }\r\n state.snapThresholdInfo = {\r\n multiples: [1, 1],\r\n offset: [0, 0],\r\n };\r\n var rect_1 = moveable.getRect();\r\n var children_1 = rect_1.children;\r\n var direction = snapRenderInfo.direction;\r\n if (children_1) {\r\n var result = direction.map(function (dir, i) {\r\n var _a = i === 0 ? {\r\n snapSize: snapGridWidth,\r\n posName: \"left\",\r\n sizeName: \"width\",\r\n clientOffset: snapOffset.left - clientLeft,\r\n } : {\r\n snapSize: snapGridHeight,\r\n posName: \"top\",\r\n sizeName: \"height\",\r\n clientOffset: snapOffset.top - clientTop,\r\n }, snapSize = _a.snapSize, posName = _a.posName, sizeName = _a.sizeName, clientOffset = _a.clientOffset;\r\n if (!snapSize) {\r\n return {\r\n dir: dir,\r\n multiple: 1,\r\n snapSize: snapSize,\r\n snapOffset: 0,\r\n };\r\n }\r\n var rectSize = rect_1[sizeName];\r\n var rectPos = rect_1[posName];\r\n // 사이즈보다 만약 작다면 어떻게 해야되죠?\r\n var childSizes = flat$1(children_1.map(function (child) {\r\n return [\r\n (child[posName] - rectPos),\r\n (child[sizeName]),\r\n (rectSize - child[sizeName] - child[posName] + rectPos),\r\n ];\r\n })).filter(function (v) { return v; }).sort(function (a, b) {\r\n return a - b;\r\n });\r\n var firstChildSize = childSizes[0];\r\n var childSnapSizes = childSizes.map(function (size) { return throttle(size / firstChildSize, 0.1) * snapSize; });\r\n var n = 1;\r\n var rectRatio = throttle(rectSize / firstChildSize, 0.1);\r\n for (n = 1; n <= 10; ++n) {\r\n if (childSnapSizes.every(function (childSize) {\r\n return childSize * n % 1 === 0;\r\n })) {\r\n break;\r\n }\r\n }\r\n // dir 1 (fixed -1)\r\n // dir 0 (fixed 0)\r\n // dir -1 (fixed 1)\r\n var ratio = (-dir + 1) / 2;\r\n var offsetPos = dot(rectPos - clientOffset, rectPos - clientOffset + rectSize, ratio, 1 - ratio);\r\n return {\r\n multiple: rectRatio * n,\r\n dir: dir,\r\n snapSize: snapSize,\r\n snapOffset: Math.round(offsetPos / snapSize),\r\n };\r\n });\r\n var multiples = result.map(function (r) { return r.multiple || 1; });\r\n state.snapThresholdInfo.multiples = multiples;\r\n state.snapThresholdInfo.offset = result.map(function (r) { return r.snapOffset; });\r\n result.forEach(function (r, i) {\r\n if (r.snapSize) ;\r\n });\r\n }\r\n }\r\n else {\r\n state.snapThresholdInfo = null;\r\n }\r\n}\r\nfunction getGridGuidelines(moveable, containerWidth, containerHeight, clientLeft, clientTop, snapOffset, isDisplayGridGuidelines) {\r\n if (clientLeft === void 0) { clientLeft = 0; }\r\n if (clientTop === void 0) { clientTop = 0; }\r\n var props = moveable.props;\r\n var state = moveable.state;\r\n var _a = props.snapGridWidth, snapGridWidth = _a === void 0 ? 0 : _a, _b = props.snapGridHeight, snapGridHeight = _b === void 0 ? 0 : _b;\r\n var guidelines = [];\r\n var snapOffsetLeft = snapOffset.left, snapOffsetTop = snapOffset.top;\r\n var startOffset = [0, 0];\r\n startGridGroupGuidelines(moveable, clientLeft, clientTop, snapOffset);\r\n var snapThresholdInfo = state.snapThresholdInfo;\r\n var defaultSnapGridWidth = snapGridWidth;\r\n var defaultSnapGridHeight = snapGridHeight;\r\n if (snapThresholdInfo) {\r\n snapGridWidth *= snapThresholdInfo.multiples[0] || 1;\r\n snapGridHeight *= snapThresholdInfo.multiples[1] || 1;\r\n startOffset = snapThresholdInfo.offset;\r\n }\r\n if (snapGridHeight) {\r\n var pushGuideline = function (pos) {\r\n guidelines.push({\r\n type: \"horizontal\",\r\n pos: [\r\n snapOffsetLeft,\r\n throttle(startOffset[1] * defaultSnapGridHeight + pos - clientTop + snapOffsetTop, 0.1),\r\n ],\r\n className: prefix(\"grid-guideline\"),\r\n size: containerWidth,\r\n hide: !isDisplayGridGuidelines,\r\n direction: \"\",\r\n grid: true,\r\n });\r\n };\r\n for (var pos = 0; pos <= containerHeight * 2; pos += snapGridHeight) {\r\n pushGuideline(pos);\r\n }\r\n for (var pos = -snapGridHeight; pos >= -containerHeight; pos -= snapGridHeight) {\r\n pushGuideline(pos);\r\n }\r\n }\r\n if (snapGridWidth) {\r\n var pushGuideline = function (pos) {\r\n guidelines.push({\r\n type: \"vertical\",\r\n pos: [\r\n throttle(startOffset[0] * defaultSnapGridWidth + pos - clientLeft + snapOffsetLeft, 0.1),\r\n snapOffsetTop,\r\n ],\r\n className: prefix(\"grid-guideline\"),\r\n size: containerHeight,\r\n hide: !isDisplayGridGuidelines,\r\n direction: \"\",\r\n grid: true,\r\n });\r\n };\r\n for (var pos = 0; pos <= containerWidth * 2; pos += snapGridWidth) {\r\n pushGuideline(pos);\r\n }\r\n for (var pos = -snapGridWidth; pos >= -containerWidth; pos -= snapGridWidth) {\r\n pushGuideline(pos);\r\n }\r\n }\r\n return guidelines;\r\n}\r\nfunction checkBetweenRects(rect1, rect2, type, distance) {\r\n if (type === \"horizontal\") {\r\n return abs(rect1.right - rect2.left) <= distance\r\n || abs(rect1.left - rect2.right) <= distance\r\n || rect1.left <= rect2.right && rect2.left <= rect1.right;\r\n }\r\n else if (type === \"vertical\") {\r\n return abs(rect1.bottom - rect2.top) <= distance\r\n || abs(rect1.top - rect2.bottom) <= distance\r\n || rect1.top <= rect2.bottom && rect2.top <= rect1.bottom;\r\n }\r\n return true;\r\n}\r\nfunction getElementGuidelines(moveable) {\r\n var state = moveable.state;\r\n var _a = moveable.props.elementGuidelines, elementGuidelines = _a === void 0 ? [] : _a;\r\n if (!elementGuidelines.length) {\r\n state.elementRects = [];\r\n return [];\r\n }\r\n var prevValues = (state.elementRects || []).filter(function (snapRect) { return !snapRect.refresh; });\r\n var nextElementGuidelines = elementGuidelines.map(function (el) {\r\n if (isObject(el) && \"element\" in el) {\r\n return __assign(__assign({}, el), { element: getRefTarget(el.element, true) });\r\n }\r\n return {\r\n element: getRefTarget(el, true),\r\n };\r\n }).filter(function (value) {\r\n return value.element;\r\n });\r\n var _b = diff(prevValues.map(function (v) { return v.element; }), nextElementGuidelines.map(function (v) { return v.element; })), maintained = _b.maintained, added = _b.added;\r\n var nextValues = [];\r\n maintained.forEach(function (_a) {\r\n var _b = __read(_a, 2), prevIndex = _b[0], nextIndex = _b[1];\r\n nextValues[nextIndex] = prevValues[prevIndex];\r\n });\r\n getSnapElementRects(moveable, added.map(function (index) { return nextElementGuidelines[index]; })).map(function (rect, i) {\r\n nextValues[added[i]] = rect;\r\n });\r\n state.elementRects = nextValues;\r\n var elementSnapDirections = getSnapDirections(moveable.props.elementSnapDirections);\r\n var nextGuidelines = [];\r\n nextValues.forEach(function (snapRect) {\r\n var element = snapRect.element, _a = snapRect.top, topValue = _a === void 0 ? elementSnapDirections.top : _a, _b = snapRect.left, leftValue = _b === void 0 ? elementSnapDirections.left : _b, _c = snapRect.right, rightValue = _c === void 0 ? elementSnapDirections.right : _c, _d = snapRect.bottom, bottomValue = _d === void 0 ? elementSnapDirections.bottom : _d, _e = snapRect.center, centerValue = _e === void 0 ? elementSnapDirections.center : _e, _f = snapRect.middle, middleValue = _f === void 0 ? elementSnapDirections.middle : _f, className = snapRect.className, rect = snapRect.rect;\r\n var _g = splitSnapDirectionPoses({\r\n top: topValue,\r\n right: rightValue,\r\n left: leftValue,\r\n bottom: bottomValue,\r\n center: centerValue,\r\n middle: middleValue,\r\n }, rect), horizontal = _g.horizontal, vertical = _g.vertical, horizontalNames = _g.horizontalNames, verticalNames = _g.verticalNames;\r\n var rectTop = rect.top;\r\n var rectLeft = rect.left;\r\n var width = rect.right - rectLeft;\r\n var height = rect.bottom - rectTop;\r\n var sizes = [width, height];\r\n vertical.forEach(function (pos, i) {\r\n nextGuidelines.push({\r\n type: \"vertical\",\r\n element: element,\r\n pos: [\r\n throttle(pos, 0.1),\r\n rectTop,\r\n ], size: height,\r\n sizes: sizes,\r\n className: className,\r\n elementRect: snapRect,\r\n elementDirection: SNAP_SKIP_NAMES_MAP[verticalNames[i]] || verticalNames[i],\r\n direction: \"\",\r\n });\r\n });\r\n horizontal.forEach(function (pos, i) {\r\n nextGuidelines.push({\r\n type: \"horizontal\",\r\n element: element,\r\n pos: [\r\n rectLeft,\r\n throttle(pos, 0.1),\r\n ],\r\n size: width,\r\n sizes: sizes,\r\n className: className,\r\n elementRect: snapRect,\r\n elementDirection: SNAP_SKIP_NAMES_MAP[horizontalNames[i]] || horizontalNames[i],\r\n direction: \"\",\r\n });\r\n });\r\n });\r\n return nextGuidelines;\r\n}\r\nfunction getObjectGuidelines(guidelines, containerSize) {\r\n return guidelines ? guidelines.map(function (info) {\r\n var posGuideline = isObject(info) ? info : { pos: info };\r\n var pos = posGuideline.pos;\r\n if (isNumber(pos)) {\r\n return posGuideline;\r\n }\r\n else {\r\n return __assign(__assign({}, posGuideline), { pos: convertUnitSize(pos, containerSize) });\r\n }\r\n }) : [];\r\n}\r\nfunction getDefaultGuidelines(horizontalGuidelines, verticalGuidelines, width, height, clientLeft, clientTop, snapOffset) {\r\n if (clientLeft === void 0) { clientLeft = 0; }\r\n if (clientTop === void 0) { clientTop = 0; }\r\n if (snapOffset === void 0) { snapOffset = { left: 0, top: 0, right: 0, bottom: 0 }; }\r\n var guidelines = [];\r\n var snapOffsetLeft = snapOffset.left, snapOffsetTop = snapOffset.top, snapOffsetBottom = snapOffset.bottom, snapOffsetRight = snapOffset.right;\r\n var snapWidth = width + snapOffsetRight - snapOffsetLeft;\r\n var snapHeight = height + snapOffsetBottom - snapOffsetTop;\r\n getObjectGuidelines(horizontalGuidelines, snapHeight).forEach(function (posInfo) {\r\n guidelines.push({\r\n type: \"horizontal\",\r\n pos: [\r\n snapOffsetLeft,\r\n throttle(posInfo.pos - clientTop + snapOffsetTop, 0.1),\r\n ],\r\n size: snapWidth,\r\n className: posInfo.className,\r\n direction: \"\",\r\n });\r\n });\r\n getObjectGuidelines(verticalGuidelines, snapWidth).forEach(function (posInfo) {\r\n guidelines.push({\r\n type: \"vertical\",\r\n pos: [\r\n throttle(posInfo.pos - clientLeft + snapOffsetLeft, 0.1),\r\n snapOffsetTop,\r\n ],\r\n size: snapHeight,\r\n className: posInfo.className,\r\n direction: \"\",\r\n });\r\n });\r\n return guidelines;\r\n}\r\nfunction getSnapElementRects(moveable, values) {\r\n if (!values.length) {\r\n return [];\r\n }\r\n var groupable = moveable.props.groupable;\r\n var state = moveable.state;\r\n var containerClientRect = state.containerClientRect, \r\n // targetClientRect: {\r\n // top: clientTop,\r\n // left: clientLeft,\r\n // },\r\n rootMatrix = state.rootMatrix, is3d = state.is3d, offsetDelta = state.offsetDelta;\r\n var n = is3d ? 4 : 3;\r\n var _a = __read(calculateContainerPos(rootMatrix, containerClientRect, n), 2), containerLeft = _a[0], containerTop = _a[1];\r\n // const poses = getAbsolutePosesByState(state);\r\n // const {\r\n // minX: targetLeft,\r\n // minY: targetTop,\r\n // } = getMinMaxs(poses);\r\n // const [distLeft, distTop] = minus([targetLeft, targetTop], calculateInversePosition(rootMatrix, [\r\n // clientLeft - containerLeft,\r\n // clientTop - containerTop,\r\n // ], n)).map(pos => roundSign(pos));\r\n var offsetLeft = groupable ? 0 : offsetDelta[0];\r\n var offsetTop = groupable ? 0 : offsetDelta[1];\r\n return values.map(function (value) {\r\n var rect = value.element.getBoundingClientRect();\r\n var left = rect.left - containerLeft - offsetLeft;\r\n var top = rect.top - containerTop - offsetTop;\r\n var bottom = top + rect.height;\r\n var right = left + rect.width;\r\n var _a = __read(calculateInversePosition(rootMatrix, [left, top], n), 2), elementLeft = _a[0], elementTop = _a[1];\r\n var _b = __read(calculateInversePosition(rootMatrix, [right, bottom], n), 2), elementRight = _b[0], elementBottom = _b[1];\r\n return __assign(__assign({}, value), { rect: {\r\n left: elementLeft,\r\n right: elementRight,\r\n top: elementTop,\r\n bottom: elementBottom,\r\n center: (elementLeft + elementRight) / 2,\r\n middle: (elementTop + elementBottom) / 2,\r\n } });\r\n });\r\n}\n\nfunction checkSnapInfo(moveable) {\r\n var state = moveable.state;\r\n var container = state.container;\r\n var snapContainer = moveable.props.snapContainer || container;\r\n if (state.snapContainer === snapContainer && state.guidelines && state.guidelines.length) {\r\n return false;\r\n }\r\n var containerClientRect = state.containerClientRect;\r\n var snapOffset = {\r\n left: 0,\r\n top: 0,\r\n bottom: 0,\r\n right: 0,\r\n };\r\n if (container !== snapContainer) {\r\n var snapContainerTarget = getRefTarget(snapContainer, true);\r\n if (snapContainerTarget) {\r\n var snapContainerRect = getClientRect(snapContainerTarget);\r\n var offset1 = getDragDistByState(state, [\r\n snapContainerRect.left - containerClientRect.left,\r\n snapContainerRect.top - containerClientRect.top,\r\n ]);\r\n var offset2 = getDragDistByState(state, [\r\n snapContainerRect.right - containerClientRect.right,\r\n snapContainerRect.bottom - containerClientRect.bottom,\r\n ]);\r\n snapOffset.left = throttle(offset1[0], 0.00001);\r\n snapOffset.top = throttle(offset1[1], 0.00001);\r\n snapOffset.right = throttle(offset2[0], 0.00001);\r\n snapOffset.bottom = throttle(offset2[1], 0.00001);\r\n }\r\n }\r\n state.snapContainer = snapContainer;\r\n state.snapOffset = snapOffset;\r\n state.guidelines = getTotalGuidelines(moveable);\r\n state.enableSnap = true;\r\n return true;\r\n}\r\nfunction getNextFixedPoses(matrix, width, height, fixedDirection, fixedPos, is3d) {\r\n var nextPoses = calculatePoses(matrix, width, height, is3d ? 4 : 3);\r\n var nextFixedPos = getPosByDirection(nextPoses, fixedDirection);\r\n return getAbsolutePoses(nextPoses, minus(fixedPos, nextFixedPos));\r\n}\r\nfunction normalized(value) {\r\n return value ? value / abs(value) : 0;\r\n}\r\nfunction getSizeOffsetInfo(moveable, poses, direction, keepRatio, isRequest, datas) {\r\n var fixedDirection = datas.fixedDirection;\r\n var directions = getCheckSnapDirections(direction, fixedDirection, keepRatio);\r\n var innerBoundLineInfos = getCheckInnerBoundLineInfos(moveable, poses, direction, keepRatio);\r\n var offsets = __spreadArray(__spreadArray([], __read(getSnapBoundInfo(moveable, poses, directions, keepRatio, isRequest, datas)), false), __read(getInnerBoundInfo(moveable, innerBoundLineInfos, datas)), false);\r\n var widthOffsetInfo = getNearOffsetInfo(offsets, 0);\r\n var heightOffsetInfo = getNearOffsetInfo(offsets, 1);\r\n return {\r\n width: {\r\n isBound: widthOffsetInfo.isBound,\r\n offset: widthOffsetInfo.offset[0],\r\n },\r\n height: {\r\n isBound: heightOffsetInfo.isBound,\r\n offset: heightOffsetInfo.offset[1],\r\n },\r\n };\r\n}\r\nfunction recheckSizeByTwoDirection(moveable, poses, width, height, maxWidth, maxHeight, direction, isRequest, datas) {\r\n var snapPos = getPosByDirection(poses, direction);\r\n var _a = checkMoveableSnapBounds(moveable, isRequest, {\r\n vertical: [snapPos[0]],\r\n horizontal: [snapPos[1]],\r\n }), horizontalOffset = _a.horizontal.offset, verticalOffset = _a.vertical.offset;\r\n if (throttle(verticalOffset, FLOAT_POINT_NUM) || throttle(horizontalOffset, FLOAT_POINT_NUM)) {\r\n var _b = __read(getDragDist({\r\n datas: datas,\r\n distX: -verticalOffset,\r\n distY: -horizontalOffset,\r\n }), 2), nextWidthOffset = _b[0], nextHeightOffset = _b[1];\r\n var nextWidth = Math.min(maxWidth || Infinity, width + direction[0] * nextWidthOffset);\r\n var nextHeight = Math.min(maxHeight || Infinity, height + direction[1] * nextHeightOffset);\r\n return [nextWidth - width, nextHeight - height];\r\n }\r\n return [0, 0];\r\n}\r\nfunction checkSizeDist(moveable, getNextPoses, width, height, direction, fixedPosition, isRequest, datas) {\r\n var poses = getAbsolutePosesByState(moveable.state);\r\n var keepRatio = moveable.props.keepRatio;\r\n var widthOffset = 0;\r\n var heightOffset = 0;\r\n for (var i = 0; i < 2; ++i) {\r\n var nextPoses = getNextPoses(widthOffset, heightOffset);\r\n var _a = getSizeOffsetInfo(moveable, nextPoses, direction, keepRatio, isRequest, datas), widthOffsetInfo = _a.width, heightOffsetInfo = _a.height;\r\n var isWidthBound = widthOffsetInfo.isBound;\r\n var isHeightBound = heightOffsetInfo.isBound;\r\n var nextWidthOffset = widthOffsetInfo.offset;\r\n var nextHeightOffset = heightOffsetInfo.offset;\r\n if (i === 1) {\r\n if (!isWidthBound) {\r\n nextWidthOffset = 0;\r\n }\r\n if (!isHeightBound) {\r\n nextHeightOffset = 0;\r\n }\r\n }\r\n if (i === 0 && isRequest && !isWidthBound && !isHeightBound) {\r\n return [0, 0];\r\n }\r\n if (keepRatio) {\r\n var widthDist = abs(nextWidthOffset) * (width ? 1 / width : 1);\r\n var heightDist = abs(nextHeightOffset) * (height ? 1 / height : 1);\r\n var isGetWidthOffset = isWidthBound && isHeightBound\r\n ? widthDist < heightDist\r\n : isHeightBound ||\r\n (!isWidthBound && widthDist < heightDist);\r\n if (isGetWidthOffset) {\r\n // width : height = ? : heightOffset\r\n nextWidthOffset = (width * nextHeightOffset) / height;\r\n }\r\n else {\r\n // width : height = widthOffset : ?\r\n nextHeightOffset = (height * nextWidthOffset) / width;\r\n }\r\n }\r\n widthOffset += nextWidthOffset;\r\n heightOffset += nextHeightOffset;\r\n }\r\n if (!keepRatio && direction[0] && direction[1]) {\r\n var _b = checkMaxBounds(moveable, poses, direction, fixedPosition, datas), maxWidth = _b.maxWidth, maxHeight = _b.maxHeight;\r\n var _c = __read(recheckSizeByTwoDirection(moveable, getNextPoses(widthOffset, heightOffset).map(function (pos) { return pos.map(function (p) { return throttle(p, FLOAT_POINT_NUM); }); }), width + widthOffset, height + heightOffset, maxWidth, maxHeight, direction, isRequest, datas), 2), nextWidthOffset = _c[0], nextHeightOffset = _c[1];\r\n widthOffset += nextWidthOffset;\r\n heightOffset += nextHeightOffset;\r\n }\r\n return [widthOffset, heightOffset];\r\n}\r\nfunction absDegree(deg) {\r\n if (deg < 0) {\r\n deg = deg % 360 + 360;\r\n }\r\n deg %= 360;\r\n return deg;\r\n}\r\nfunction bumpDegree(baseDeg, snapDeg) {\r\n // baseDeg -80\r\n // snapDeg 270\r\n // return -90\r\n snapDeg = absDegree(snapDeg);\r\n var count = Math.floor(baseDeg / 360);\r\n var deg1 = count * 360 + 360 - snapDeg;\r\n var deg2 = count * 360 + snapDeg;\r\n return abs(baseDeg - deg1) < abs(baseDeg - deg2) ? deg1 : deg2;\r\n}\r\nfunction getMinDegreeDistance(deg1, deg2) {\r\n deg1 = absDegree(deg1);\r\n deg2 = absDegree(deg2);\r\n var deg3 = absDegree(deg1 - deg2);\r\n return Math.min(deg3, 360 - deg3);\r\n}\r\nfunction checkSnapRotate(moveable, rect, dist, rotation) {\r\n var _a;\r\n var props = moveable.props;\r\n var snapRotationThreshold = (_a = props[NAME_snapRotationThreshold]) !== null && _a !== void 0 ? _a : 5;\r\n var snapRotationDegrees = props[NAME_snapRotationDegrees];\r\n if (hasGuidelines(moveable, \"rotatable\")) {\r\n var pos1 = rect.pos1, pos2 = rect.pos2, pos3 = rect.pos3, pos4 = rect.pos4, origin2_1 = rect.origin;\r\n var rad_1 = (dist * Math.PI) / 180;\r\n var prevPoses = [pos1, pos2, pos3, pos4].map(function (pos) { return minus(pos, origin2_1); });\r\n var nextPoses = prevPoses.map(function (pos) { return rotate(pos, rad_1); });\r\n // console.log(moveable.state.left, moveable.state.top, moveable.state.origin);\r\n // console.log(pos1, pos2, pos3, pos4, origin, rad, prevPoses, nextPoses);\r\n var result = __spreadArray(__spreadArray([], __read(checkRotateBounds(moveable, prevPoses, nextPoses, origin2_1, dist)), false), __read(checkRotateInnerBounds(moveable, prevPoses, nextPoses, origin2_1, dist)), false);\r\n result.sort(function (a, b) { return abs(a - dist) - abs(b - dist); });\r\n var isSnap = result.length > 0;\r\n if (isSnap) {\r\n return {\r\n isSnap: isSnap,\r\n dist: isSnap ? result[0] : dist,\r\n };\r\n }\r\n }\r\n if ((snapRotationDegrees === null || snapRotationDegrees === void 0 ? void 0 : snapRotationDegrees.length) && snapRotationThreshold) {\r\n var sorted = snapRotationDegrees.slice().sort(function (a, b) {\r\n return getMinDegreeDistance(a, rotation) - getMinDegreeDistance(b, rotation);\r\n });\r\n var firstDegree = sorted[0];\r\n if (getMinDegreeDistance(firstDegree, rotation) <= snapRotationThreshold) {\r\n return {\r\n isSnap: true,\r\n dist: dist + bumpDegree(rotation, firstDegree) - rotation,\r\n };\r\n }\r\n }\r\n return {\r\n isSnap: false,\r\n dist: dist,\r\n };\r\n}\r\nfunction checkSnapResize(moveable, width, height, direction, fixedPosition, isRequest, datas) {\r\n if (!hasGuidelines(moveable, \"resizable\")) {\r\n return [0, 0];\r\n }\r\n var fixedDirection = datas.fixedDirection, nextAllMatrix = datas.nextAllMatrix;\r\n var _a = moveable.state, allMatrix = _a.allMatrix, is3d = _a.is3d;\r\n return checkSizeDist(moveable, function (widthOffset, heightOffset) {\r\n return getNextFixedPoses(nextAllMatrix || allMatrix, width + widthOffset, height + heightOffset, fixedDirection, fixedPosition, is3d);\r\n }, width, height, direction, fixedPosition, isRequest, datas);\r\n}\r\nfunction checkSnapScale(moveable, scale, direction, isRequest, datas) {\r\n if (!hasGuidelines(moveable, \"scalable\")) {\r\n return [0, 0];\r\n }\r\n var startOffsetWidth = datas.startOffsetWidth, startOffsetHeight = datas.startOffsetHeight, fixedPosition = datas.fixedPosition, fixedDirection = datas.fixedDirection, is3d = datas.is3d;\r\n var sizeDist = checkSizeDist(moveable, function (widthOffset, heightOffset) {\r\n return getNextFixedPoses(scaleMatrix(datas, plus(scale, [widthOffset / startOffsetWidth, heightOffset / startOffsetHeight])), startOffsetWidth, startOffsetHeight, fixedDirection, fixedPosition, is3d);\r\n }, startOffsetWidth, startOffsetHeight, direction, fixedPosition, isRequest, datas);\r\n return [sizeDist[0] / startOffsetWidth, sizeDist[1] / startOffsetHeight];\r\n}\r\nfunction startCheckSnapDrag(moveable, datas) {\r\n datas.absolutePoses = getAbsolutePosesByState(moveable.state);\r\n}\r\nfunction getSnapGuidelines(posInfos) {\r\n var guidelines = [];\r\n posInfos.forEach(function (posInfo) {\r\n posInfo.guidelineInfos.forEach(function (_a) {\r\n var guideline = _a.guideline;\r\n if (find(guidelines, function (info) { return info.guideline === guideline; })) {\r\n return;\r\n }\r\n guideline.direction = \"\";\r\n guidelines.push({ guideline: guideline, posInfo: posInfo });\r\n });\r\n });\r\n return guidelines.map(function (_a) {\r\n var guideline = _a.guideline, posInfo = _a.posInfo;\r\n return __assign(__assign({}, guideline), { direction: posInfo.direction });\r\n });\r\n}\r\nfunction addBoundGuidelines(moveable, verticalPoses, horizontalPoses, verticalSnapPoses, horizontalSnapPoses, externalBounds) {\r\n var _a = checkBoundPoses(getBounds(moveable, externalBounds), verticalPoses, horizontalPoses), verticalBoundInfos = _a.vertical, horizontalBoundInfos = _a.horizontal;\r\n var boundMap = getInitialBounds();\r\n verticalBoundInfos.forEach(function (info) {\r\n if (info.isBound) {\r\n if (info.direction === \"start\") {\r\n boundMap.left = true;\r\n }\r\n if (info.direction === \"end\") {\r\n boundMap.right = true;\r\n }\r\n verticalSnapPoses.push({\r\n type: \"bounds\",\r\n pos: info.pos,\r\n });\r\n }\r\n });\r\n horizontalBoundInfos.forEach(function (info) {\r\n if (info.isBound) {\r\n if (info.direction === \"start\") {\r\n boundMap.top = true;\r\n }\r\n if (info.direction === \"end\") {\r\n boundMap.bottom = true;\r\n }\r\n horizontalSnapPoses.push({\r\n type: \"bounds\",\r\n pos: info.pos,\r\n });\r\n }\r\n });\r\n var _b = checkInnerBoundPoses(moveable), innerBoundMap = _b.boundMap, verticalInnerBoundPoses = _b.vertical, horizontalInnerBoundPoses = _b.horizontal;\r\n verticalInnerBoundPoses.forEach(function (innerPos) {\r\n if (findIndex(verticalSnapPoses, function (_a) {\r\n var type = _a.type, pos = _a.pos;\r\n return type === \"bounds\" && pos === innerPos;\r\n }) >= 0) {\r\n return;\r\n }\r\n verticalSnapPoses.push({\r\n type: \"bounds\",\r\n pos: innerPos,\r\n });\r\n });\r\n horizontalInnerBoundPoses.forEach(function (innerPos) {\r\n if (findIndex(horizontalSnapPoses, function (_a) {\r\n var type = _a.type, pos = _a.pos;\r\n return type === \"bounds\" && pos === innerPos;\r\n }) >= 0) {\r\n return;\r\n }\r\n horizontalSnapPoses.push({\r\n type: \"bounds\",\r\n pos: innerPos,\r\n });\r\n });\r\n return {\r\n boundMap: boundMap,\r\n innerBoundMap: innerBoundMap,\r\n };\r\n}\r\nvar directionCondition$1 = getDirectionCondition(\"\", [\"resizable\", \"scalable\"]);\r\nvar NAME_snapRotationThreshold = \"snapRotationThreshold\";\r\nvar NAME_snapRotationDegrees = \"snapRotationDegrees\";\r\n/**\r\n * @namespace Moveable.Snappable\r\n * @description Whether or not target can be snapped to the guideline. (default: false)\r\n * @sort 2\r\n */\r\nvar Snappable = {\r\n name: \"snappable\",\r\n dragRelation: \"strong\",\r\n props: [\r\n \"snappable\",\r\n \"snapContainer\",\r\n \"snapDirections\",\r\n \"elementSnapDirections\",\r\n \"snapGap\",\r\n \"snapGridWidth\",\r\n \"snapGridHeight\",\r\n \"isDisplaySnapDigit\",\r\n \"isDisplayInnerSnapDigit\",\r\n \"isDisplayGridGuidelines\",\r\n \"snapDigit\",\r\n \"snapThreshold\",\r\n \"snapRenderThreshold\",\r\n \"snapGridAll\",\r\n NAME_snapRotationThreshold,\r\n NAME_snapRotationDegrees,\r\n \"horizontalGuidelines\",\r\n \"verticalGuidelines\",\r\n \"elementGuidelines\",\r\n \"bounds\",\r\n \"innerBounds\",\r\n \"snapDistFormat\",\r\n \"maxSnapElementGuidelineDistance\",\r\n \"maxSnapElementGapDistance\",\r\n ],\r\n events: [\"snap\", \"bound\"],\r\n css: [\r\n \":host {\\n--bounds-color: #d66;\\n}\\n.guideline {\\npointer-events: none;\\nz-index: 2;\\n}\\n.guideline.bounds {\\nbackground: #d66;\\nbackground: var(--bounds-color);\\n}\\n.guideline-group {\\nposition: absolute;\\ntop: 0;\\nleft: 0;\\n}\\n.guideline-group .size-value {\\nposition: absolute;\\ncolor: #f55;\\nfont-size: 12px;\\nfont-size: calc(12px * var(--zoom));\\nfont-weight: bold;\\n}\\n.guideline-group.horizontal .size-value {\\ntransform-origin: 50% 100%;\\ntransform: translateX(-50%);\\nleft: 50%;\\nbottom: 5px;\\nbottom: calc(2px + 3px * var(--zoom));\\n}\\n.guideline-group.vertical .size-value {\\ntransform-origin: 0% 50%;\\ntop: 50%;\\ntransform: translateY(-50%);\\nleft: 5px;\\nleft: calc(2px + 3px * var(--zoom));\\n}\\n.guideline.gap {\\nbackground: #f55;\\n}\\n.size-value.gap {\\ncolor: #f55;\\n}\\n\",\r\n ],\r\n render: function (moveable, React) {\r\n var state = moveable.state;\r\n var targetTop = state.top, targetLeft = state.left, pos1 = state.pos1, pos2 = state.pos2, pos3 = state.pos3, pos4 = state.pos4, snapRenderInfo = state.snapRenderInfo;\r\n var _a = moveable.props.snapRenderThreshold, snapRenderThreshold = _a === void 0 ? 1 : _a;\r\n if (!snapRenderInfo || !snapRenderInfo.render || !hasGuidelines(moveable, \"\")) {\r\n // reset store\r\n watchValue(moveable, \"boundMap\", getInitialBounds(), function (v) { return JSON.stringify(v); });\r\n watchValue(moveable, \"innerBoundMap\", getInitialBounds(), function (v) { return JSON.stringify(v); });\r\n return [];\r\n }\r\n state.guidelines = getTotalGuidelines(moveable);\r\n var minLeft = Math.min(pos1[0], pos2[0], pos3[0], pos4[0]);\r\n var minTop = Math.min(pos1[1], pos2[1], pos3[1], pos4[1]);\r\n var externalPoses = snapRenderInfo.externalPoses || [];\r\n var poses = getAbsolutePosesByState(moveable.state);\r\n var verticalSnapPoses = [];\r\n var horizontalSnapPoses = [];\r\n var verticalGuidelines = [];\r\n var horizontalGuidelines = [];\r\n var snapInfos = [];\r\n var _b = getRect(poses), width = _b.width, height = _b.height, top = _b.top, left = _b.left, bottom = _b.bottom, right = _b.right;\r\n var targetRect = { left: left, right: right, top: top, bottom: bottom, center: (left + right) / 2, middle: (top + bottom) / 2 };\r\n var hasExternalPoses = externalPoses.length > 0;\r\n var externalRect = hasExternalPoses\r\n ? getRect(externalPoses)\r\n : {};\r\n if (!snapRenderInfo.request) {\r\n if (snapRenderInfo.direction) {\r\n snapInfos.push(getSnapInfosByDirection(moveable, poses, snapRenderInfo.direction, snapRenderThreshold));\r\n }\r\n if (snapRenderInfo.snap) {\r\n var rect = getRect(poses);\r\n if (snapRenderInfo.center) {\r\n rect.middle = (rect.top + rect.bottom) / 2;\r\n rect.center = (rect.left + rect.right) / 2;\r\n }\r\n snapInfos.push(checkSnaps(moveable, rect, snapRenderThreshold));\r\n }\r\n if (hasExternalPoses) {\r\n if (snapRenderInfo.center) {\r\n externalRect.middle =\r\n (externalRect.top + externalRect.bottom) / 2;\r\n externalRect.center =\r\n (externalRect.left + externalRect.right) / 2;\r\n }\r\n snapInfos.push(checkSnaps(moveable, externalRect, snapRenderThreshold));\r\n }\r\n snapInfos.forEach(function (snapInfo) {\r\n var verticalPosInfos = snapInfo.vertical.posInfos, horizontalPosInfos = snapInfo.horizontal.posInfos;\r\n verticalSnapPoses.push.apply(verticalSnapPoses, __spreadArray([], __read(verticalPosInfos.filter(function (_a) {\r\n var guidelineInfos = _a.guidelineInfos;\r\n return guidelineInfos.some(function (_a) {\r\n var guideline = _a.guideline;\r\n return !guideline.hide;\r\n });\r\n }).map(function (posInfo) { return ({\r\n type: \"snap\",\r\n pos: posInfo.pos,\r\n }); })), false));\r\n horizontalSnapPoses.push.apply(horizontalSnapPoses, __spreadArray([], __read(horizontalPosInfos.filter(function (_a) {\r\n var guidelineInfos = _a.guidelineInfos;\r\n return guidelineInfos.some(function (_a) {\r\n var guideline = _a.guideline;\r\n return !guideline.hide;\r\n });\r\n }).map(function (posInfo) { return ({\r\n type: \"snap\",\r\n pos: posInfo.pos,\r\n }); })), false));\r\n verticalGuidelines.push.apply(verticalGuidelines, __spreadArray([], __read(getSnapGuidelines(verticalPosInfos)), false));\r\n horizontalGuidelines.push.apply(horizontalGuidelines, __spreadArray([], __read(getSnapGuidelines(horizontalPosInfos)), false));\r\n });\r\n }\r\n var _c = addBoundGuidelines(moveable, [left, right], [top, bottom], verticalSnapPoses, horizontalSnapPoses), boundMap = _c.boundMap, innerBoundMap = _c.innerBoundMap;\r\n if (hasExternalPoses) {\r\n addBoundGuidelines(moveable, [externalRect.left, externalRect.right], [externalRect.top, externalRect.bottom], verticalSnapPoses, horizontalSnapPoses, snapRenderInfo.externalBounds);\r\n }\r\n var allGuidelines = __spreadArray(__spreadArray([], __read(verticalGuidelines), false), __read(horizontalGuidelines), false);\r\n var elementGuidelines = allGuidelines.filter(function (guideline) { return guideline.element && !guideline.gapRects; });\r\n var gapGuidelines = allGuidelines.filter(function (guideline) { return guideline.gapRects; }).sort(function (a, b) {\r\n return a.gap - b.gap;\r\n });\r\n triggerEvent(moveable, \"onSnap\", {\r\n guidelines: allGuidelines.filter(function (_a) {\r\n var element = _a.element;\r\n return !element;\r\n }),\r\n elements: elementGuidelines,\r\n gaps: gapGuidelines,\r\n }, true);\r\n var nextBoundMap = watchValue(moveable, \"boundMap\", boundMap, function (v) { return JSON.stringify(v); }, getInitialBounds());\r\n var nextInnerBoundMap = watchValue(moveable, \"innerBoundMap\", innerBoundMap, function (v) { return JSON.stringify(v); }, getInitialBounds());\r\n if (boundMap === nextBoundMap || innerBoundMap === nextInnerBoundMap) {\r\n triggerEvent(moveable, \"onBound\", {\r\n bounds: boundMap,\r\n innerBounds: innerBoundMap,\r\n }, true);\r\n }\r\n // verticalSnapPoses.\r\n return __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(renderDashedGuidelines(moveable, elementGuidelines, [minLeft, minTop], targetRect, React)), false), __read(renderGapGuidelines(moveable, gapGuidelines, [minLeft, minTop], targetRect, React)), false), __read(renderGuidelines(moveable, \"horizontal\", horizontalGuidelines, [targetLeft, targetTop], targetRect, React)), false), __read(renderGuidelines(moveable, \"vertical\", verticalGuidelines, [targetLeft, targetTop], targetRect, React)), false), __read(renderSnapPoses(moveable, \"horizontal\", horizontalSnapPoses, minLeft, targetTop, width, 0, React)), false), __read(renderSnapPoses(moveable, \"vertical\", verticalSnapPoses, minTop, targetLeft, height, 1, React)), false);\r\n },\r\n dragStart: function (moveable, e) {\r\n moveable.state.snapRenderInfo = {\r\n request: e.isRequest,\r\n snap: true,\r\n center: true,\r\n };\r\n checkSnapInfo(moveable);\r\n },\r\n drag: function (moveable) {\r\n var state = moveable.state;\r\n if (!checkSnapInfo(moveable)) {\r\n state.guidelines = getTotalGuidelines(moveable);\r\n }\r\n if (state.snapRenderInfo) {\r\n state.snapRenderInfo.render = true;\r\n }\r\n },\r\n pinchStart: function (moveable) {\r\n this.unset(moveable);\r\n },\r\n dragEnd: function (moveable) {\r\n this.unset(moveable);\r\n },\r\n dragControlCondition: function (moveable, e) {\r\n if (directionCondition$1(moveable, e) || dragControlCondition(moveable, e)) {\r\n return true;\r\n }\r\n if (!e.isRequest && e.inputEvent) {\r\n return hasClass(e.inputEvent.target, prefix(\"snap-control\"));\r\n }\r\n },\r\n dragControlStart: function (moveable) {\r\n moveable.state.snapRenderInfo = null;\r\n checkSnapInfo(moveable);\r\n },\r\n dragControl: function (moveable) {\r\n this.drag(moveable);\r\n },\r\n dragControlEnd: function (moveable) {\r\n this.unset(moveable);\r\n },\r\n dragGroupStart: function (moveable, e) {\r\n this.dragStart(moveable, e);\r\n },\r\n dragGroup: function (moveable) {\r\n this.drag(moveable);\r\n },\r\n dragGroupEnd: function (moveable) {\r\n this.unset(moveable);\r\n },\r\n dragGroupControlStart: function (moveable) {\r\n moveable.state.snapRenderInfo = null;\r\n checkSnapInfo(moveable);\r\n },\r\n dragGroupControl: function (moveable) {\r\n this.drag(moveable);\r\n },\r\n dragGroupControlEnd: function (moveable) {\r\n this.unset(moveable);\r\n },\r\n unset: function (moveable) {\r\n var state = moveable.state;\r\n state.enableSnap = false;\r\n state.guidelines = [];\r\n state.snapRenderInfo = null;\r\n state.elementRects = [];\r\n },\r\n};\r\n/**\r\n * Whether or not target can be snapped to the guideline. (default: false)\r\n * @name Moveable.Snappable#snappable\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.snappable = true;\r\n */\r\n/**\r\n * A snap container that is the basis for snap, bounds, and innerBounds. (default: null = container)\r\n * @name Moveable.Snappable#snapContainer\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.querySelector(\".container\"));\r\n *\r\n * moveable.snapContainer = document.body;\r\n */\r\n/**\r\n * You can specify the directions to snap to the target. (default: { left: true, top: true, right: true, bottom: true })\r\n * @name Moveable.Snappable#snapDirections\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * snappable: true,\r\n * snapDirections: true,\r\n * });\r\n * // snap center\r\n * moveable.snapDirections = { left: true, top: true, right: true, bottom: true, center: true, middle: true };\r\n */\r\n/**\r\n * You can specify the snap directions of elements. (default: { left: true, ftrue, right: true, bottom: true })\r\n * @name Moveable.Snappable#elementSnapDirections\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * snappable: true,\r\n * elementSnapDirections: true,\r\n * });\r\n * // snap center\r\n * moveable.elementSnapDirections = { left: true, top: true, right: true, bottom: true, center: true, middle: true };\r\n */\r\n/**\r\n * When you drag, make the gap snap in the element guidelines. (default: true)\r\n * @name Moveable.Snappable#snapGap\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * snappable: true,\r\n * snapElement: true,\r\n * snapGap: true,\r\n * });\r\n *\r\n * moveable.snapGap = false;\r\n */\r\n/**\r\n * Distance value that can snap to guidelines. (default: 5)\r\n * @name Moveable.Snappable#snapThreshold\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.snapThreshold = 5;\r\n */\r\n/**\r\n * Add guidelines in the horizontal direction. (default: [])\r\n * @name Moveable.Snappable#horizontalGuidelines\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.horizontalGuidelines = [100, 200, 500];\r\n */\r\n/**\r\n * Add guidelines in the vertical direction. (default: [])\r\n * @name Moveable.Snappable#verticalGuidelines\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.verticalGuidelines = [100, 200, 500];\r\n */\r\n/**\r\n * Add guidelines for the element. (default: [])\r\n * @name Moveable.Snappable#elementGuidelines\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.elementGuidelines = [\r\n * document.querySelector(\".element\"),\r\n * ];\r\n */\r\n/**\r\n * You can set up boundaries.\r\n * @name Moveable.Snappable#bounds\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @default null\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.bounds = { left: 0, right: 1000, top: 0, bottom: 1000};\r\n */\r\n/**\r\n * You can set up inner boundaries.\r\n * @name Moveable.Snappable#innerBounds\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @default null\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.innerBounds = { left: 500, top: 500, width: 100, height: 100};\r\n */\r\n/**\r\n * snap distance digits (default: 0)\r\n * @name Moveable.Snappable#snapDigit\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.snapDigit = 0\r\n */\r\n/**\r\n * If width size is greater than 0, you can vertical snap to the grid. (default: 0)\r\n * @name Moveable.Snappable#snapGridWidth\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.snapGridWidth = 5;\r\n */\r\n/**\r\n * If height size is greater than 0, you can horizontal snap to the grid. (default: 0)\r\n * @name Moveable.Snappable#snapGridHeight\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.snapGridHeight = 5;\r\n */\r\n/**\r\n * Whether to show snap distance (default: true)\r\n * @name Moveable.Snappable#isDisplaySnapDigit\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.isDisplaySnapDigit = true;\r\n */\r\n/**\r\n * Whether to show element inner snap distance (default: false)\r\n * @name Moveable.Snappable#isDisplayInnerSnapDigit\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.isDisplayInnerSnapDigit = true;\r\n */\r\n/**\r\n * You can set the text format of the distance shown in the guidelines. (default: self)\r\n * @name Moveable.Snappable#snapDistFormat\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * snappable: true,\r\n * snapDistFormat: (v, type) => v,\r\n * });\r\n * moveable.snapDistFormat = (v, type) => `${v}px`;\r\n */\r\n/**\r\n * When you drag or dragControl, the `snap` event is called.\r\n * @memberof Moveable.Snappable\r\n * @event snap\r\n * @param {Moveable.Snappable.OnSnap} - Parameters for the `snap` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * snappable: true\r\n * });\r\n * moveable.on(\"snap\", e => {\r\n * console.log(\"onSnap\", e);\r\n * });\r\n */\n\nfunction multiply2(pos1, pos2) {\r\n return [\r\n pos1[0] * pos2[0],\r\n pos1[1] * pos2[1],\r\n ];\r\n}\r\nfunction prefix() {\r\n var classNames = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n classNames[_i] = arguments[_i];\r\n }\r\n return prefixNames.apply(void 0, __spreadArray([PREFIX], __read(classNames), false));\r\n}\r\nfunction defaultSync(fn) {\r\n fn();\r\n}\r\nfunction getTransformMatrix(transform) {\r\n if (!transform || transform === \"none\") {\r\n return [1, 0, 0, 1, 0, 0];\r\n }\r\n if (isObject(transform)) {\r\n return transform;\r\n }\r\n return parseMat(transform);\r\n}\r\nfunction getAbsoluteMatrix(matrix, n, origin) {\r\n return multiplies(n, createOriginMatrix(origin, n), matrix, createOriginMatrix(origin.map(function (a) { return -a; }), n));\r\n}\r\nfunction measureSVGSize(el, unit, isHorizontal) {\r\n if (unit === \"%\") {\r\n var viewBox = getSVGViewBox(el.ownerSVGElement);\r\n return viewBox[isHorizontal ? \"width\" : \"height\"] / 100;\r\n }\r\n return 1;\r\n}\r\nfunction getBeforeTransformOrigin(el) {\r\n var relativeOrigin = getTransformOrigin(getComputedStyle(el, \":before\"));\r\n return relativeOrigin.map(function (o, i) {\r\n var _a = splitUnit(o), value = _a.value, unit = _a.unit;\r\n return value * measureSVGSize(el, unit, i === 0);\r\n });\r\n}\r\nfunction getTransformOriginArray(transformOrigin) {\r\n return transformOrigin ? transformOrigin.split(\" \") : [\"0\", \"0\"];\r\n}\r\nfunction getTransformOrigin(style) {\r\n return getTransformOriginArray(style.transformOrigin);\r\n}\r\nfunction getElementTransform(target) {\r\n var getStyle = getCachedStyle(target);\r\n var computedTransform = getStyle(\"transform\");\r\n if (computedTransform && computedTransform !== \"none\") {\r\n return computedTransform;\r\n }\r\n if (\"transform\" in target) {\r\n var list = target.transform;\r\n var baseVal = list.baseVal;\r\n if (!baseVal) {\r\n return \"\";\r\n }\r\n var length_1 = baseVal.length;\r\n if (!length_1) {\r\n return \"\";\r\n }\r\n var matrixes = [];\r\n var _loop_1 = function (i) {\r\n var matrix = baseVal[i].matrix;\r\n matrixes.push(\"matrix(\".concat([\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"].map(function (chr) { return matrix[chr]; }).join(\", \"), \")\"));\r\n };\r\n for (var i = 0; i < length_1; ++i) {\r\n _loop_1(i);\r\n }\r\n return matrixes.join(\" \");\r\n }\r\n return \"\";\r\n}\r\nfunction getOffsetInfo(el, lastParent, isParent, checkZoom, getTargetStyle) {\r\n var _a, _b;\r\n var documentElement = getDocumentElement(el) || getDocumentBody(el);\r\n var hasSlot = false;\r\n var target;\r\n var parentSlotElement;\r\n if (!el || isParent) {\r\n target = el;\r\n }\r\n else {\r\n var assignedSlotParentElement = (_a = el === null || el === void 0 ? void 0 : el.assignedSlot) === null || _a === void 0 ? void 0 : _a.parentElement;\r\n var parentElement = el.parentElement;\r\n if (assignedSlotParentElement) {\r\n hasSlot = true;\r\n parentSlotElement = parentElement;\r\n target = assignedSlotParentElement;\r\n }\r\n else {\r\n target = parentElement;\r\n }\r\n }\r\n var isCustomElement = false;\r\n var isEnd = el === lastParent || target === lastParent;\r\n var position = \"relative\";\r\n var offsetZoom = 1;\r\n var targetZoom = parseFloat(getTargetStyle === null || getTargetStyle === void 0 ? void 0 : getTargetStyle(\"zoom\")) || 1;\r\n var targetPosition = getTargetStyle === null || getTargetStyle === void 0 ? void 0 : getTargetStyle(\"position\");\r\n while (target && target !== documentElement) {\r\n if (lastParent === target) {\r\n isEnd = true;\r\n }\r\n var getStyle = getCachedStyle(target);\r\n var tagName = target.tagName.toLowerCase();\r\n var transform = getElementTransform(target);\r\n var willChange = getStyle(\"willChange\");\r\n var zoom = parseFloat(getStyle(\"zoom\")) || 1;\r\n position = getStyle(\"position\");\r\n if (checkZoom && zoom !== 1) {\r\n offsetZoom = zoom;\r\n break;\r\n }\r\n if (\r\n // offsetParent is the parentElement if the target's zoom is not 1 and not absolute.\r\n !isParent && checkZoom && targetZoom !== 1 && targetPosition && targetPosition !== \"absolute\"\r\n || tagName === \"svg\"\r\n || position !== \"static\"\r\n || (transform && transform !== \"none\")\r\n || willChange === \"transform\") {\r\n break;\r\n }\r\n var slotParentNode = (_b = el === null || el === void 0 ? void 0 : el.assignedSlot) === null || _b === void 0 ? void 0 : _b.parentNode;\r\n var targetParentNode = target.parentNode;\r\n if (slotParentNode) {\r\n hasSlot = true;\r\n parentSlotElement = targetParentNode;\r\n }\r\n var parentNode = targetParentNode;\r\n if (parentNode && parentNode.nodeType === 11) {\r\n // Shadow Root\r\n target = parentNode.host;\r\n isCustomElement = true;\r\n position = getCachedStyle(target)(\"position\");\r\n break;\r\n }\r\n target = parentNode;\r\n position = \"relative\";\r\n }\r\n return {\r\n offsetZoom: offsetZoom,\r\n hasSlot: hasSlot,\r\n parentSlotElement: parentSlotElement,\r\n isCustomElement: isCustomElement,\r\n isStatic: position === \"static\",\r\n isEnd: isEnd || !target || target === documentElement,\r\n offsetParent: target || documentElement,\r\n };\r\n}\r\nfunction getOffsetPosInfo(el, target) {\r\n var _a;\r\n var tagName = el.tagName.toLowerCase();\r\n var offsetLeft = el.offsetLeft;\r\n var offsetTop = el.offsetTop;\r\n var getStyle = getCachedStyle(el);\r\n // svg\r\n var isSVG = isUndefined(offsetLeft);\r\n var hasOffset = !isSVG;\r\n var origin;\r\n var targetOrigin;\r\n // inner svg element\r\n if (!hasOffset && (tagName !== \"svg\" || target.ownerSVGElement)) {\r\n origin = IS_WEBKIT605\r\n ? getBeforeTransformOrigin(el)\r\n : getTransformOriginArray(getStyle(\"transformOrigin\")).map(function (pos) { return parseFloat(pos); });\r\n targetOrigin = origin.slice();\r\n hasOffset = true;\r\n if (tagName === \"svg\") {\r\n offsetLeft = 0;\r\n offsetTop = 0;\r\n }\r\n else {\r\n _a = __read(getSVGGraphicsOffset(el, origin, el === target && target.tagName.toLowerCase() === \"g\"), 4), offsetLeft = _a[0], offsetTop = _a[1], origin[0] = _a[2], origin[1] = _a[3];\r\n }\r\n }\r\n else {\r\n origin = getTransformOriginArray(getStyle(\"transformOrigin\")).map(function (pos) { return parseFloat(pos); });\r\n targetOrigin = origin.slice();\r\n }\r\n return {\r\n tagName: tagName,\r\n isSVG: isSVG,\r\n hasOffset: hasOffset,\r\n offset: [offsetLeft || 0, offsetTop || 0],\r\n origin: origin,\r\n targetOrigin: targetOrigin,\r\n };\r\n}\r\nfunction getBodyOffset(el, isSVG) {\r\n var getStyle = getCachedStyle(el);\r\n var getBodyStyle = getCachedStyle(getDocumentBody(el));\r\n var bodyPosition = getBodyStyle(\"position\");\r\n if (!isSVG && (!bodyPosition || bodyPosition === \"static\")) {\r\n return [0, 0];\r\n }\r\n var marginLeft = parseInt(getBodyStyle(\"marginLeft\"), 10);\r\n var marginTop = parseInt(getBodyStyle(\"marginTop\"), 10);\r\n if (getStyle(\"position\") === \"absolute\") {\r\n if (getStyle(\"top\") !== \"auto\" || getStyle(\"bottom\") !== \"auto\") {\r\n marginTop = 0;\r\n }\r\n if (getStyle(\"left\") !== \"auto\" || getStyle(\"right\") !== \"auto\") {\r\n marginLeft = 0;\r\n }\r\n }\r\n return [marginLeft, marginTop];\r\n}\r\nfunction convert3DMatrixes(matrixes) {\r\n matrixes.forEach(function (info) {\r\n var matrix = info.matrix;\r\n if (matrix) {\r\n info.matrix = convertDimension(matrix, 3, 4);\r\n }\r\n });\r\n}\r\nfunction getPositionFixedInfo(el) {\r\n var fixedContainer = el.parentElement;\r\n var hasTransform = false;\r\n var body = getDocumentBody(el);\r\n while (fixedContainer) {\r\n var transform = getComputedStyle(fixedContainer).transform;\r\n if (transform && transform !== \"none\") {\r\n hasTransform = true;\r\n break;\r\n }\r\n if (fixedContainer === body) {\r\n break;\r\n }\r\n fixedContainer = fixedContainer.parentElement;\r\n }\r\n return {\r\n fixedContainer: fixedContainer || body,\r\n hasTransform: hasTransform,\r\n };\r\n}\r\nfunction makeMatrixCSS(matrix, is3d) {\r\n if (is3d === void 0) { is3d = matrix.length > 9; }\r\n return \"\".concat(is3d ? \"matrix3d\" : \"matrix\", \"(\").concat(convertMatrixtoCSS(matrix, !is3d).join(\",\"), \")\");\r\n}\r\nfunction getSVGViewBox(el) {\r\n var clientWidth = el.clientWidth;\r\n var clientHeight = el.clientHeight;\r\n if (!el) {\r\n return { x: 0, y: 0, width: 0, height: 0, clientWidth: clientWidth, clientHeight: clientHeight };\r\n }\r\n var viewBox = el.viewBox;\r\n var baseVal = (viewBox && viewBox.baseVal) || { x: 0, y: 0, width: 0, height: 0 };\r\n return {\r\n x: baseVal.x,\r\n y: baseVal.y,\r\n width: baseVal.width || clientWidth,\r\n height: baseVal.height || clientHeight,\r\n clientWidth: clientWidth,\r\n clientHeight: clientHeight,\r\n };\r\n}\r\nfunction getSVGMatrix(el, n) {\r\n var _a;\r\n var _b = getSVGViewBox(el), viewBoxWidth = _b.width, viewBoxHeight = _b.height, clientWidth = _b.clientWidth, clientHeight = _b.clientHeight;\r\n var scaleX = clientWidth / viewBoxWidth;\r\n var scaleY = clientHeight / viewBoxHeight;\r\n var preserveAspectRatio = el.preserveAspectRatio.baseVal;\r\n // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/preserveAspectRatio\r\n var align = preserveAspectRatio.align;\r\n // 1 : meet 2: slice\r\n var meetOrSlice = preserveAspectRatio.meetOrSlice;\r\n var svgOrigin = [0, 0];\r\n var scale = [scaleX, scaleY];\r\n var translate = [0, 0];\r\n if (align !== 1) {\r\n var xAlign = (align - 2) % 3;\r\n var yAlign = Math.floor((align - 2) / 3);\r\n svgOrigin[0] = viewBoxWidth * xAlign / 2;\r\n svgOrigin[1] = viewBoxHeight * yAlign / 2;\r\n var scaleDimension = meetOrSlice === 2 ? Math.max(scaleY, scaleX) : Math.min(scaleX, scaleY);\r\n scale[0] = scaleDimension;\r\n scale[1] = scaleDimension;\r\n translate[0] = (clientWidth - viewBoxWidth) / 2 * xAlign;\r\n translate[1] = (clientHeight - viewBoxHeight) / 2 * yAlign;\r\n }\r\n var scaleMatrix = createScaleMatrix(scale, n);\r\n _a = __read(translate, 2), scaleMatrix[n * (n - 1)] = _a[0], scaleMatrix[n * (n - 1) + 1] = _a[1];\r\n return getAbsoluteMatrix(scaleMatrix, n, svgOrigin);\r\n}\r\nfunction getSVGGraphicsOffset(el, origin, isGTarget) {\r\n if (!el.getBBox || !isGTarget && el.tagName.toLowerCase() === \"g\") {\r\n return [0, 0, 0, 0];\r\n }\r\n var getStyle = getCachedStyle(el);\r\n var isFillBox = getStyle(\"transform-box\") === \"fill-box\";\r\n var bbox = el.getBBox();\r\n var viewBox = getSVGViewBox(el.ownerSVGElement);\r\n var left = bbox.x - viewBox.x;\r\n var top = bbox.y - viewBox.y;\r\n var originX = isFillBox ? origin[0] : origin[0] - left;\r\n var originY = isFillBox ? origin[1] : origin[1] - top;\r\n return [left, top, originX, originY];\r\n}\r\nfunction calculatePosition(matrix, pos, n) {\r\n return calculate(matrix, convertPositionMatrix(pos, n), n);\r\n}\r\nfunction calculatePoses(matrix, width, height, n) {\r\n return [[0, 0], [width, 0], [0, height], [width, height]].map(function (pos) { return calculatePosition(matrix, pos, n); });\r\n}\r\nfunction getRect(poses) {\r\n var posesX = poses.map(function (pos) { return pos[0]; });\r\n var posesY = poses.map(function (pos) { return pos[1]; });\r\n var left = Math.min.apply(Math, __spreadArray([], __read(posesX), false));\r\n var top = Math.min.apply(Math, __spreadArray([], __read(posesY), false));\r\n var right = Math.max.apply(Math, __spreadArray([], __read(posesX), false));\r\n var bottom = Math.max.apply(Math, __spreadArray([], __read(posesY), false));\r\n var rectWidth = right - left;\r\n var rectHeight = bottom - top;\r\n return {\r\n left: left,\r\n top: top,\r\n right: right,\r\n bottom: bottom,\r\n width: rectWidth,\r\n height: rectHeight,\r\n };\r\n}\r\nfunction calculateRect(matrix, width, height, n) {\r\n var poses = calculatePoses(matrix, width, height, n);\r\n return getRect(poses);\r\n}\r\nfunction getSVGOffset(offsetInfo, targetInfo, container, n, beforeMatrix) {\r\n var _a;\r\n var target = offsetInfo.target;\r\n var origin = offsetInfo.origin;\r\n var targetMatrix = targetInfo.matrix;\r\n var _b = getSize(target), width = _b.offsetWidth, height = _b.offsetHeight;\r\n var containerClientRect = container.getBoundingClientRect();\r\n var margin = [0, 0];\r\n if (container === getDocumentBody(container)) {\r\n margin = getBodyOffset(target, true);\r\n }\r\n var rect = target.getBoundingClientRect();\r\n var rectLeft = rect.left - containerClientRect.left + container.scrollLeft\r\n - (container.clientLeft || 0) + margin[0];\r\n var rectTop = rect.top - containerClientRect.top + container.scrollTop\r\n - (container.clientTop || 0) + margin[1];\r\n var rectWidth = rect.width;\r\n var rectHeight = rect.height;\r\n var mat = multiplies(n, beforeMatrix, targetMatrix);\r\n var _c = calculateRect(mat, width, height, n), prevLeft = _c.left, prevTop = _c.top, prevWidth = _c.width, prevHeight = _c.height;\r\n var posOrigin = calculatePosition(mat, origin, n);\r\n var prevOrigin = minus(posOrigin, [prevLeft, prevTop]);\r\n var rectOrigin = [\r\n rectLeft + prevOrigin[0] * rectWidth / prevWidth,\r\n rectTop + prevOrigin[1] * rectHeight / prevHeight,\r\n ];\r\n var offset = [0, 0];\r\n var count = 0;\r\n while (++count < 10) {\r\n var inverseBeforeMatrix = invert(beforeMatrix, n);\r\n _a = __read(minus(calculatePosition(inverseBeforeMatrix, rectOrigin, n), calculatePosition(inverseBeforeMatrix, posOrigin, n)), 2), offset[0] = _a[0], offset[1] = _a[1];\r\n var mat2 = multiplies(n, beforeMatrix, createOriginMatrix(offset, n), targetMatrix);\r\n var _d = calculateRect(mat2, width, height, n), nextLeft = _d.left, nextTop = _d.top;\r\n var distLeft = nextLeft - rectLeft;\r\n var distTop = nextTop - rectTop;\r\n if (abs(distLeft) < 2 && abs(distTop) < 2) {\r\n break;\r\n }\r\n rectOrigin[0] -= distLeft;\r\n rectOrigin[1] -= distTop;\r\n }\r\n return offset.map(function (p) { return Math.round(p); });\r\n}\r\nfunction calculateMoveableClientPositions(rootMatrix, poses, rootClientRect) {\r\n var is3d = rootMatrix.length === 16;\r\n var n = is3d ? 4 : 3;\r\n var rootPoses = poses.map(function (pos) { return calculatePosition(rootMatrix, pos, n); });\r\n var left = rootClientRect.left, top = rootClientRect.top;\r\n return rootPoses.map(function (pos) {\r\n return [pos[0] + left, pos[1] + top];\r\n });\r\n}\r\nfunction getDistSize(vec) {\r\n return Math.sqrt(vec[0] * vec[0] + vec[1] * vec[1]);\r\n}\r\nfunction getDiagonalSize(pos1, pos2) {\r\n return getDistSize([\r\n pos2[0] - pos1[0],\r\n pos2[1] - pos1[1],\r\n ]);\r\n}\r\nfunction getLineStyle(pos1, pos2, zoom, rad) {\r\n if (zoom === void 0) { zoom = 1; }\r\n if (rad === void 0) { rad = getRad(pos1, pos2); }\r\n var width = getDiagonalSize(pos1, pos2);\r\n return {\r\n transform: \"translateY(-50%) translate(\".concat(pos1[0], \"px, \").concat(pos1[1], \"px) rotate(\").concat(rad, \"rad) scaleY(\").concat(zoom, \")\"),\r\n width: \"\".concat(width, \"px\"),\r\n };\r\n}\r\nfunction getControlTransform(rotation, zoom) {\r\n var poses = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n poses[_i - 2] = arguments[_i];\r\n }\r\n var length = poses.length;\r\n var x = poses.reduce(function (prev, pos) { return prev + pos[0]; }, 0) / length;\r\n var y = poses.reduce(function (prev, pos) { return prev + pos[1]; }, 0) / length;\r\n return {\r\n transform: \"translateZ(0px) translate(\".concat(x, \"px, \").concat(y, \"px) rotate(\").concat(rotation, \"rad) scale(\").concat(zoom, \")\"),\r\n };\r\n}\r\nfunction getProps(props, ableName) {\r\n var self = props[ableName];\r\n if (isObject(self)) {\r\n return __assign(__assign({}, props), self);\r\n }\r\n return props;\r\n}\r\nfunction getSize(target) {\r\n var hasOffset = target && !isUndefined(target.offsetWidth);\r\n var offsetWidth = 0;\r\n var offsetHeight = 0;\r\n var clientWidth = 0;\r\n var clientHeight = 0;\r\n var cssWidth = 0;\r\n var cssHeight = 0;\r\n var contentWidth = 0;\r\n var contentHeight = 0;\r\n var minWidth = 0;\r\n var minHeight = 0;\r\n var minOffsetWidth = 0;\r\n var minOffsetHeight = 0;\r\n var maxWidth = Infinity;\r\n var maxHeight = Infinity;\r\n var maxOffsetWidth = Infinity;\r\n var maxOffsetHeight = Infinity;\r\n var inlineCSSWidth = 0;\r\n var inlineCSSHeight = 0;\r\n var svg = false;\r\n if (target) {\r\n if (!hasOffset && target.ownerSVGElement) {\r\n // check svg elements\r\n var bbox = target.getBBox();\r\n svg = true;\r\n offsetWidth = bbox.width;\r\n offsetHeight = bbox.height;\r\n cssWidth = offsetWidth;\r\n cssHeight = offsetHeight;\r\n contentWidth = offsetWidth;\r\n contentHeight = offsetHeight;\r\n clientWidth = offsetWidth;\r\n clientHeight = offsetHeight;\r\n }\r\n else {\r\n // check html elements\r\n var getStyle = getCachedStyle(target);\r\n var targetStyle = target.style;\r\n var boxSizing = getStyle(\"boxSizing\") === \"border-box\";\r\n var borderLeft = parseFloat(getStyle(\"borderLeftWidth\")) || 0;\r\n var borderRight = parseFloat(getStyle(\"borderRightWidth\")) || 0;\r\n var borderTop = parseFloat(getStyle(\"borderTopWidth\")) || 0;\r\n var borderBottom = parseFloat(getStyle(\"borderBottomWidth\")) || 0;\r\n var paddingLeft = parseFloat(getStyle(\"paddingLeft\")) || 0;\r\n var paddingRight = parseFloat(getStyle(\"paddingRight\")) || 0;\r\n var paddingTop = parseFloat(getStyle(\"paddingTop\")) || 0;\r\n var paddingBottom = parseFloat(getStyle(\"paddingBottom\")) || 0;\r\n var horizontalPadding = paddingLeft + paddingRight;\r\n var verticalPadding = paddingTop + paddingBottom;\r\n var horizontalBorder = borderLeft + borderRight;\r\n var verticalBorder = borderTop + borderBottom;\r\n var horizontalOffset = horizontalPadding + horizontalBorder;\r\n var verticalOffset = verticalPadding + verticalBorder;\r\n var position = getStyle(\"position\");\r\n var containerWidth = 0;\r\n var containerHeight = 0;\r\n // SVGSVGElement, HTMLElement\r\n if (\"clientLeft\" in target) {\r\n var parentElement = null;\r\n if (position === \"absolute\") {\r\n var offsetInfo = getOffsetInfo(target, getDocumentBody(target));\r\n parentElement = offsetInfo.offsetParent;\r\n }\r\n else {\r\n parentElement = target.parentElement;\r\n }\r\n if (parentElement) {\r\n var getParentStyle = getCachedStyle(parentElement);\r\n containerWidth = parseFloat(getParentStyle(\"width\"));\r\n containerHeight = parseFloat(getParentStyle(\"height\"));\r\n }\r\n }\r\n minWidth = Math.max(horizontalPadding, convertUnitSize(getStyle(\"minWidth\"), containerWidth) || 0);\r\n minHeight = Math.max(verticalPadding, convertUnitSize(getStyle(\"minHeight\"), containerHeight) || 0);\r\n maxWidth = convertUnitSize(getStyle(\"maxWidth\"), containerWidth);\r\n maxHeight = convertUnitSize(getStyle(\"maxHeight\"), containerHeight);\r\n if (isNaN(maxWidth)) {\r\n maxWidth = Infinity;\r\n }\r\n if (isNaN(maxHeight)) {\r\n maxHeight = Infinity;\r\n }\r\n inlineCSSWidth = convertUnitSize(targetStyle.width, 0) || 0;\r\n inlineCSSHeight = convertUnitSize(targetStyle.height, 0) || 0;\r\n cssWidth = parseFloat(getStyle(\"width\")) || 0;\r\n cssHeight = parseFloat(getStyle(\"height\")) || 0;\r\n contentWidth = abs(cssWidth - inlineCSSWidth) < 1\r\n ? between(minWidth, inlineCSSWidth || cssWidth, maxWidth)\r\n : cssWidth;\r\n contentHeight = abs(cssHeight - inlineCSSHeight) < 1\r\n ? between(minHeight, inlineCSSHeight || cssHeight, maxHeight)\r\n : cssHeight;\r\n offsetWidth = contentWidth;\r\n offsetHeight = contentHeight;\r\n clientWidth = contentWidth;\r\n clientHeight = contentHeight;\r\n if (boxSizing) {\r\n maxOffsetWidth = maxWidth;\r\n maxOffsetHeight = maxHeight;\r\n minOffsetWidth = minWidth;\r\n minOffsetHeight = minHeight;\r\n contentWidth = offsetWidth - horizontalOffset;\r\n contentHeight = offsetHeight - verticalOffset;\r\n }\r\n else {\r\n maxOffsetWidth = maxWidth + horizontalOffset;\r\n maxOffsetHeight = maxHeight + verticalOffset;\r\n minOffsetWidth = minWidth + horizontalOffset;\r\n minOffsetHeight = minHeight + verticalOffset;\r\n offsetWidth = contentWidth + horizontalOffset;\r\n offsetHeight = contentHeight + verticalOffset;\r\n }\r\n clientWidth = contentWidth + horizontalPadding;\r\n clientHeight = contentHeight + verticalPadding;\r\n }\r\n }\r\n return {\r\n svg: svg,\r\n offsetWidth: offsetWidth,\r\n offsetHeight: offsetHeight,\r\n clientWidth: clientWidth,\r\n clientHeight: clientHeight,\r\n contentWidth: contentWidth,\r\n contentHeight: contentHeight,\r\n inlineCSSWidth: inlineCSSWidth,\r\n inlineCSSHeight: inlineCSSHeight,\r\n cssWidth: cssWidth,\r\n cssHeight: cssHeight,\r\n minWidth: minWidth,\r\n minHeight: minHeight,\r\n maxWidth: maxWidth,\r\n maxHeight: maxHeight,\r\n minOffsetWidth: minOffsetWidth,\r\n minOffsetHeight: minOffsetHeight,\r\n maxOffsetWidth: maxOffsetWidth,\r\n maxOffsetHeight: maxOffsetHeight,\r\n };\r\n}\r\nfunction getRotationRad(poses, direction) {\r\n return getRad(direction > 0 ? poses[0] : poses[1], direction > 0 ? poses[1] : poses[0]);\r\n}\r\nfunction resetClientRect() {\r\n return {\r\n left: 0, top: 0,\r\n width: 0, height: 0,\r\n right: 0,\r\n bottom: 0,\r\n clientLeft: 0, clientTop: 0,\r\n clientWidth: 0, clientHeight: 0,\r\n scrollWidth: 0, scrollHeight: 0,\r\n };\r\n}\r\nfunction getExtendsRect(el, rect) {\r\n var isRoot = el === getDocumentBody(el) || el === getDocumentElement(el);\r\n var extendsRect = {\r\n clientLeft: el.clientLeft,\r\n clientTop: el.clientTop,\r\n clientWidth: el.clientWidth,\r\n clientHeight: el.clientHeight,\r\n scrollWidth: el.scrollWidth,\r\n scrollHeight: el.scrollHeight,\r\n overflow: false,\r\n };\r\n if (isRoot) {\r\n extendsRect.clientHeight = Math.max(rect.height, extendsRect.clientHeight);\r\n extendsRect.scrollHeight = Math.max(rect.height, extendsRect.scrollHeight);\r\n }\r\n extendsRect.overflow = getCachedStyle(el)(\"overflow\") !== \"visible\";\r\n return __assign(__assign({}, rect), extendsRect);\r\n}\r\nfunction getClientRectByPosition(position, base, el, isExtends) {\r\n var left = position.left, right = position.right, top = position.top, bottom = position.bottom;\r\n var baseTop = base.top;\r\n var baseLeft = base.left;\r\n var rect = {\r\n left: baseLeft + left,\r\n top: baseTop + top,\r\n right: baseLeft + right,\r\n bottom: baseTop + bottom,\r\n width: right - left,\r\n height: bottom - top,\r\n };\r\n if (el && isExtends) {\r\n return getExtendsRect(el, rect);\r\n }\r\n return rect;\r\n}\r\nfunction getClientRect(el, isExtends) {\r\n var left = 0;\r\n var top = 0;\r\n var width = 0;\r\n var height = 0;\r\n // let isRoot = false;\r\n if (el) {\r\n var clientRect = el.getBoundingClientRect();\r\n left = clientRect.left;\r\n top = clientRect.top;\r\n width = clientRect.width;\r\n height = clientRect.height;\r\n }\r\n var rect = {\r\n left: left,\r\n top: top,\r\n width: width,\r\n height: height,\r\n right: left + width,\r\n bottom: top + height,\r\n };\r\n if (el && isExtends) {\r\n return getExtendsRect(el, rect);\r\n }\r\n return rect;\r\n}\r\nfunction getTotalOrigin(moveable) {\r\n var _a = moveable.props, groupable = _a.groupable, svgOrigin = _a.svgOrigin;\r\n var _b = moveable.getState(), offsetWidth = _b.offsetWidth, offsetHeight = _b.offsetHeight, svg = _b.svg, transformOrigin = _b.transformOrigin;\r\n if (!groupable && svg && svgOrigin) {\r\n return convertTransformOriginArray(svgOrigin, offsetWidth, offsetHeight);\r\n }\r\n return transformOrigin;\r\n}\r\nfunction getTotalDirection(parentDirection, isPinch, inputEvent, datas) {\r\n var direction;\r\n if (parentDirection) {\r\n direction = parentDirection;\r\n }\r\n else if (isPinch) {\r\n direction = [0, 0];\r\n }\r\n else {\r\n var target = inputEvent.target;\r\n direction = getDirection(target, datas);\r\n }\r\n return direction;\r\n}\r\nfunction getDirection(target, datas) {\r\n if (!target) {\r\n return;\r\n }\r\n var deg = target.getAttribute(\"data-rotation\") || \"\";\r\n var direciton = target.getAttribute(\"data-direction\");\r\n datas.deg = deg;\r\n if (!direciton) {\r\n return;\r\n }\r\n var dir = [0, 0];\r\n (direciton.indexOf(\"w\") > -1) && (dir[0] = -1);\r\n (direciton.indexOf(\"e\") > -1) && (dir[0] = 1);\r\n (direciton.indexOf(\"n\") > -1) && (dir[1] = -1);\r\n (direciton.indexOf(\"s\") > -1) && (dir[1] = 1);\r\n return dir;\r\n}\r\nfunction getAbsolutePoses(poses, dist) {\r\n return [\r\n plus(dist, poses[0]),\r\n plus(dist, poses[1]),\r\n plus(dist, poses[2]),\r\n plus(dist, poses[3]),\r\n ];\r\n}\r\nfunction getAbsolutePosesByState(_a) {\r\n var left = _a.left, top = _a.top, pos1 = _a.pos1, pos2 = _a.pos2, pos3 = _a.pos3, pos4 = _a.pos4;\r\n return getAbsolutePoses([pos1, pos2, pos3, pos4], [left, top]);\r\n}\r\nfunction unsetAbles(self, isControl) {\r\n self[isControl ? \"controlAbles\" : \"targetAbles\"].forEach(function (able) {\r\n able.unset && able.unset(self);\r\n });\r\n}\r\nfunction unsetGesto(self, isControl) {\r\n var gestoName = isControl ? \"controlGesto\" : \"targetGesto\";\r\n var gesto = self[gestoName];\r\n if ((gesto === null || gesto === void 0 ? void 0 : gesto.isIdle()) === false) {\r\n unsetAbles(self, isControl);\r\n }\r\n gesto === null || gesto === void 0 ? void 0 : gesto.unset();\r\n self[gestoName] = null;\r\n}\r\nfunction fillCSSObject(style, resolvedEvent) {\r\n if (resolvedEvent) {\r\n var originalDatas = getBeforeRenderableDatas(resolvedEvent);\r\n originalDatas.nextStyle = __assign(__assign({}, originalDatas.nextStyle), style);\r\n }\r\n return {\r\n style: style,\r\n cssText: getKeys(style).map(function (name) { return \"\".concat(decamelize(name, \"-\"), \": \").concat(style[name], \";\"); }).join(\"\"),\r\n };\r\n}\r\nfunction fillAfterTransform(prevEvent, nextEvent, resolvedEvent) {\r\n var afterTransform = nextEvent.afterTransform || nextEvent.transform;\r\n return __assign(__assign({}, fillCSSObject(__assign(__assign(__assign({}, prevEvent.style), nextEvent.style), { transform: afterTransform }), resolvedEvent)), { afterTransform: afterTransform, transform: prevEvent.transform });\r\n}\r\nfunction fillParams(moveable, e, params, isBeforeEvent) {\r\n var datas = e.datas;\r\n if (!datas.datas) {\r\n datas.datas = {};\r\n }\r\n var nextParams = __assign(__assign({}, params), { target: moveable.state.target, clientX: e.clientX, clientY: e.clientY, inputEvent: e.inputEvent, currentTarget: moveable, moveable: moveable, datas: datas.datas, isRequest: e.isRequest, isRequestChild: e.isRequestChild, isFirstDrag: !!e.isFirstDrag, isTrusted: e.isTrusted !== false, stopAble: function () {\r\n datas.isEventStart = false;\r\n }, stopDrag: function () {\r\n var _a;\r\n (_a = e.stop) === null || _a === void 0 ? void 0 : _a.call(e);\r\n } });\r\n if (!datas.isStartEvent) {\r\n datas.isStartEvent = true;\r\n }\r\n else if (!isBeforeEvent) {\r\n datas.lastEvent = nextParams;\r\n }\r\n return nextParams;\r\n}\r\nfunction fillEndParams(moveable, e, params) {\r\n var datas = e.datas;\r\n var isDrag = \"isDrag\" in params ? params.isDrag : e.isDrag;\r\n if (!datas.datas) {\r\n datas.datas = {};\r\n }\r\n return __assign(__assign({ isDrag: isDrag }, params), { moveable: moveable, target: moveable.state.target, clientX: e.clientX, clientY: e.clientY, inputEvent: e.inputEvent, currentTarget: moveable, lastEvent: datas.lastEvent, isDouble: e.isDouble, datas: datas.datas, isFirstDrag: !!e.isFirstDrag });\r\n}\r\nfunction catchEvent(moveable, name, callback) {\r\n moveable._emitter.on(name, callback);\r\n}\r\nfunction triggerEvent(moveable, name, params, isManager, isRequest) {\r\n return moveable.triggerEvent(name, params, isManager, isRequest);\r\n}\r\nfunction getComputedStyle(el, pseudoElt) {\r\n return getWindow(el).getComputedStyle(el, pseudoElt);\r\n}\r\nfunction filterAbles(ables, methods, triggerAblesSimultaneously) {\r\n var enabledAbles = {};\r\n var ableGroups = {};\r\n return ables.filter(function (able) {\r\n var name = able.name;\r\n if (enabledAbles[name] || !methods.some(function (method) { return able[method]; })) {\r\n return false;\r\n }\r\n if (!triggerAblesSimultaneously && able.ableGroup) {\r\n if (ableGroups[able.ableGroup]) {\r\n return false;\r\n }\r\n ableGroups[able.ableGroup] = true;\r\n }\r\n enabledAbles[name] = true;\r\n return true;\r\n });\r\n}\r\nfunction equals(a1, a2) {\r\n return a1 === a2 || (a1 == null && a2 == null);\r\n}\r\nfunction selectValue() {\r\n var values = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n values[_i] = arguments[_i];\r\n }\r\n var length = values.length - 1;\r\n for (var i = 0; i < length; ++i) {\r\n var value = values[i];\r\n if (!isUndefined(value)) {\r\n return value;\r\n }\r\n }\r\n return values[length];\r\n}\r\nfunction groupBy(arr, func) {\r\n var groups = [];\r\n var groupKeys = [];\r\n arr.forEach(function (el, index) {\r\n var groupKey = func(el, index, arr);\r\n var keyIndex = groupKeys.indexOf(groupKey);\r\n var group = groups[keyIndex] || [];\r\n if (keyIndex === -1) {\r\n groupKeys.push(groupKey);\r\n groups.push(group);\r\n }\r\n group.push(el);\r\n });\r\n return groups;\r\n}\r\nfunction groupByMap(arr, func) {\r\n var groups = [];\r\n var groupKeys = {};\r\n arr.forEach(function (el, index) {\r\n var groupKey = func(el, index, arr);\r\n var group = groupKeys[groupKey];\r\n if (!group) {\r\n group = [];\r\n groupKeys[groupKey] = group;\r\n groups.push(group);\r\n }\r\n group.push(el);\r\n });\r\n return groups;\r\n}\r\nfunction flat(arr) {\r\n return arr.reduce(function (prev, cur) {\r\n return prev.concat(cur);\r\n }, []);\r\n}\r\nfunction maxOffset() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n args.sort(function (a, b) { return abs(b) - abs(a); });\r\n return args[0];\r\n}\r\nfunction calculateInversePosition(matrix, pos, n) {\r\n return calculate(invert(matrix, n), convertPositionMatrix(pos, n), n);\r\n}\r\nfunction convertDragDist(state, e) {\r\n var _a;\r\n var is3d = state.is3d, rootMatrix = state.rootMatrix;\r\n var n = is3d ? 4 : 3;\r\n _a = __read(calculateInversePosition(rootMatrix, [e.distX, e.distY], n), 2), e.distX = _a[0], e.distY = _a[1];\r\n return e;\r\n}\r\nfunction calculatePadding(matrix, pos, added, n) {\r\n if (!added[0] && !added[1]) {\r\n return pos;\r\n }\r\n var xAdded = calculatePosition(matrix, [normalized(added[0] || 1), 0], n);\r\n var yAdded = calculatePosition(matrix, [0, normalized(added[1] || 1)], n);\r\n var nextAdded = calculatePosition(matrix, [\r\n added[0] / getDistSize(xAdded),\r\n added[1] / getDistSize(yAdded),\r\n ], n);\r\n return plus(pos, nextAdded);\r\n}\r\nfunction convertCSSSize(value, size, isRelative) {\r\n return isRelative ? \"\".concat(value / size * 100, \"%\") : \"\".concat(value, \"px\");\r\n}\r\nfunction getTinyDist(v) {\r\n return abs(v) <= TINY_NUM ? 0 : v;\r\n}\r\nfunction getDirectionViewClassName(ableName) {\r\n return function (moveable) {\r\n if (!moveable.isDragging(ableName)) {\r\n return \"\";\r\n }\r\n var data = getGestoData(moveable, ableName);\r\n var deg = data.deg;\r\n if (!deg) {\r\n return \"\";\r\n }\r\n return prefix(\"view-control-rotation\".concat(deg));\r\n };\r\n}\r\nfunction getDirectionCondition(ableName, checkAbles) {\r\n if (checkAbles === void 0) { checkAbles = [ableName]; }\r\n return function (moveable, e) {\r\n if (e.isRequest) {\r\n if (checkAbles.some(function (name) { return e.requestAble === name; })) {\r\n return e.parentDirection;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n var target = e.inputEvent.target;\r\n return hasClass(target, prefix(\"direction\")) && (!ableName || hasClass(target, prefix(ableName)));\r\n };\r\n}\r\nfunction convertTransformInfo(transforms, state, index) {\r\n var _a;\r\n var matrixInfos = parse(transforms, {\r\n \"x%\": function (v) { return v / 100 * state.offsetWidth; },\r\n \"y%\": function (v) { return v / 100 * state.offsetHeight; },\r\n });\r\n var beforeFunctionTexts = transforms.slice(0, index < 0 ? undefined : index);\r\n var beforeFunctionTexts2 = transforms.slice(0, index < 0 ? undefined : index + 1);\r\n var targetFunctionText = transforms[index] || \"\";\r\n var afterFunctionTexts = index < 0 ? [] : transforms.slice(index);\r\n var afterFunctionTexts2 = index < 0 ? [] : transforms.slice(index + 1);\r\n var beforeFunctions = matrixInfos.slice(0, index < 0 ? undefined : index);\r\n var beforeFunctions2 = matrixInfos.slice(0, index < 0 ? undefined : index + 1);\r\n var targetFunction = (_a = matrixInfos[index]) !== null && _a !== void 0 ? _a : parse([\"\"])[0];\r\n var afterFunctions = index < 0 ? [] : matrixInfos.slice(index);\r\n var afterFunctions2 = index < 0 ? [] : matrixInfos.slice(index + 1);\r\n var targetFunctions = targetFunction ? [targetFunction] : [];\r\n var beforeFunctionMatrix = toMat(beforeFunctions);\r\n var beforeFunctionMatrix2 = toMat(beforeFunctions2);\r\n var afterFunctionMatrix = toMat(afterFunctions);\r\n var afterFunctionMatrix2 = toMat(afterFunctions2);\r\n var allFunctionMatrix = multiply(beforeFunctionMatrix, afterFunctionMatrix, 4);\r\n return {\r\n transforms: transforms,\r\n beforeFunctionMatrix: beforeFunctionMatrix,\r\n beforeFunctionMatrix2: beforeFunctionMatrix2,\r\n targetFunctionMatrix: toMat(targetFunctions),\r\n afterFunctionMatrix: afterFunctionMatrix,\r\n afterFunctionMatrix2: afterFunctionMatrix2,\r\n allFunctionMatrix: allFunctionMatrix,\r\n beforeFunctions: beforeFunctions,\r\n beforeFunctions2: beforeFunctions2,\r\n targetFunction: targetFunctions[0],\r\n afterFunctions: afterFunctions,\r\n afterFunctions2: afterFunctions2,\r\n beforeFunctionTexts: beforeFunctionTexts,\r\n beforeFunctionTexts2: beforeFunctionTexts2,\r\n targetFunctionText: targetFunctionText,\r\n afterFunctionTexts: afterFunctionTexts,\r\n afterFunctionTexts2: afterFunctionTexts2,\r\n };\r\n}\r\nfunction isArrayFormat(arr) {\r\n if (!arr || !isObject(arr)) {\r\n return false;\r\n }\r\n if (isNode(arr)) {\r\n return false;\r\n }\r\n return isArray(arr) || \"length\" in arr;\r\n}\r\nfunction getRefTarget(target, isSelector) {\r\n if (!target) {\r\n return null;\r\n }\r\n if (isNode(target)) {\r\n return target;\r\n }\r\n if (isString(target)) {\r\n if (isSelector) {\r\n return document.querySelector(target);\r\n }\r\n return target;\r\n }\r\n if (isFunction(target)) {\r\n return target();\r\n }\r\n if (isWindow(target)) {\r\n return target;\r\n }\r\n if (\"current\" in target) {\r\n return target.current;\r\n }\r\n return target;\r\n}\r\nfunction getRefTargets(targets, isSelector) {\r\n if (!targets) {\r\n return [];\r\n }\r\n var userTargets = isArrayFormat(targets) ? [].slice.call(targets) : [targets];\r\n return userTargets.reduce(function (prev, target) {\r\n if (isString(target) && isSelector) {\r\n return __spreadArray(__spreadArray([], __read(prev), false), __read([].slice.call(document.querySelectorAll(target))), false);\r\n }\r\n if (isArray(target)) {\r\n prev.push(getRefTargets(target, isSelector));\r\n }\r\n else {\r\n prev.push(getRefTarget(target, isSelector));\r\n }\r\n return prev;\r\n }, []);\r\n}\r\nfunction getAbsoluteRotation(pos1, pos2, direction) {\r\n var deg = getRad(pos1, pos2) / Math.PI * 180;\r\n deg = direction >= 0 ? deg : 180 - deg;\r\n deg = deg >= 0 ? deg : 360 + deg;\r\n return deg;\r\n}\r\nfunction getDragDistByState(state, dist) {\r\n var rootMatrix = state.rootMatrix, is3d = state.is3d;\r\n var n = is3d ? 4 : 3;\r\n var inverseMatrix = invert(rootMatrix, n);\r\n if (!is3d) {\r\n inverseMatrix = convertDimension(inverseMatrix, 3, 4);\r\n }\r\n inverseMatrix[12] = 0;\r\n inverseMatrix[13] = 0;\r\n inverseMatrix[14] = 0;\r\n return calculateMatrixDist(inverseMatrix, dist);\r\n}\r\nfunction getSizeDistByDist(startSize, dist, ratio, direction, keepRatio) {\r\n var _a = __read(startSize, 2), startOffsetWidth = _a[0], startOffsetHeight = _a[1];\r\n var distWidth = 0;\r\n var distHeight = 0;\r\n if (keepRatio && startOffsetWidth && startOffsetHeight) {\r\n var rad = getRad([0, 0], dist);\r\n var standardRad = getRad([0, 0], direction);\r\n var size = getDistSize(dist);\r\n var signSize = Math.cos(rad - standardRad) * size;\r\n if (!direction[0]) {\r\n // top, bottom\r\n distHeight = signSize;\r\n distWidth = distHeight * ratio;\r\n }\r\n else if (!direction[1]) {\r\n // left, right\r\n distWidth = signSize;\r\n distHeight = distWidth / ratio;\r\n }\r\n else {\r\n // two-way\r\n var startWidthSize = direction[0] * startOffsetWidth;\r\n var startHeightSize = direction[1] * startOffsetHeight;\r\n var secondRad = Math.atan2(startWidthSize + dist[0], startHeightSize + dist[1]);\r\n var firstRad = Math.atan2(startWidthSize, startHeightSize);\r\n if (secondRad < 0) {\r\n secondRad += Math.PI * 2;\r\n }\r\n if (firstRad < 0) {\r\n firstRad += Math.PI * 2;\r\n }\r\n var rad_1 = 0;\r\n if (abs(secondRad - firstRad) < Math.PI / 2 || abs(secondRad - firstRad) > Math.PI / 2 * 3) {\r\n rad_1 = secondRad - firstRad;\r\n }\r\n else {\r\n firstRad += Math.PI;\r\n rad_1 = secondRad - firstRad;\r\n }\r\n if (rad_1 > Math.PI * 2) {\r\n rad_1 -= Math.PI * 2;\r\n }\r\n else if (rad_1 > Math.PI) {\r\n rad_1 = 2 * Math.PI - rad_1;\r\n }\r\n else if (rad_1 < -Math.PI) {\r\n rad_1 = -2 * Math.PI - rad_1;\r\n }\r\n // 180\r\n // -1, -1, // 1, -1\r\n // 270 90\r\n // -1, 1 // 1, 1\r\n // 0\r\n var distSize = getDistSize([startWidthSize + dist[0], startHeightSize + dist[1]]) * Math.cos(rad_1);\r\n distWidth = distSize * Math.sin(firstRad) - startWidthSize;\r\n distHeight = distSize * Math.cos(firstRad) - startHeightSize;\r\n if (direction[0] < 0) {\r\n distWidth *= -1;\r\n }\r\n if (direction[1] < 0) {\r\n distHeight *= -1;\r\n }\r\n }\r\n }\r\n else {\r\n distWidth = direction[0] * dist[0];\r\n distHeight = direction[1] * dist[1];\r\n }\r\n return [distWidth, distHeight];\r\n}\r\nfunction getOffsetSizeDist(sizeDirection, keepRatio, datas, e) {\r\n var _a;\r\n var ratio = datas.ratio, startOffsetWidth = datas.startOffsetWidth, startOffsetHeight = datas.startOffsetHeight;\r\n var distWidth = 0;\r\n var distHeight = 0;\r\n var distX = e.distX, distY = e.distY, pinchScale = e.pinchScale, parentDistance = e.parentDistance, parentDist = e.parentDist, parentScale = e.parentScale;\r\n var startFixedDirection = datas.fixedDirection;\r\n var directionsDists = [0, 1].map(function (index) {\r\n return abs(sizeDirection[index] - startFixedDirection[index]);\r\n });\r\n var directionRatios = [0, 1].map(function (index) {\r\n var dist = directionsDists[index];\r\n if (dist !== 0) {\r\n dist = 2 / dist;\r\n }\r\n return dist;\r\n });\r\n if (parentDist) {\r\n distWidth = parentDist[0];\r\n distHeight = parentDist[1];\r\n if (keepRatio) {\r\n if (!distWidth) {\r\n distWidth = distHeight * ratio;\r\n }\r\n else if (!distHeight) {\r\n distHeight = distWidth / ratio;\r\n }\r\n }\r\n }\r\n else if (isNumber(pinchScale)) {\r\n distWidth = (pinchScale - 1) * startOffsetWidth;\r\n distHeight = (pinchScale - 1) * startOffsetHeight;\r\n }\r\n else if (parentScale) {\r\n distWidth = (parentScale[0] - 1) * startOffsetWidth;\r\n distHeight = (parentScale[1] - 1) * startOffsetHeight;\r\n }\r\n else if (parentDistance) {\r\n var scaleX = startOffsetWidth * directionsDists[0];\r\n var scaleY = startOffsetHeight * directionsDists[1];\r\n var ratioDistance = getDistSize([scaleX, scaleY]);\r\n distWidth = parentDistance / ratioDistance * scaleX * directionRatios[0];\r\n distHeight = parentDistance / ratioDistance * scaleY * directionRatios[1];\r\n }\r\n else {\r\n var dist_1 = getDragDist({ datas: datas, distX: distX, distY: distY });\r\n dist_1 = directionRatios.map(function (ratio, i) {\r\n return dist_1[i] * ratio;\r\n });\r\n _a = __read(getSizeDistByDist([startOffsetWidth, startOffsetHeight], dist_1, ratio, sizeDirection, keepRatio), 2), distWidth = _a[0], distHeight = _a[1];\r\n }\r\n return {\r\n // direction,\r\n // sizeDirection,\r\n distWidth: distWidth,\r\n distHeight: distHeight,\r\n };\r\n}\r\nfunction convertTransformUnit(origin, xy) {\r\n if (xy) {\r\n if (origin === \"left\") {\r\n return { x: \"0%\", y: \"50%\" };\r\n }\r\n else if (origin === \"top\") {\r\n return { x: \"50%\", y: \"50%\" };\r\n }\r\n else if (origin === \"center\") {\r\n return { x: \"50%\", y: \"50%\" };\r\n }\r\n else if (origin === \"right\") {\r\n return { x: \"100%\", y: \"50%\" };\r\n }\r\n else if (origin === \"bottom\") {\r\n return { x: \"50%\", y: \"100%\" };\r\n }\r\n var _a = __read(origin.split(\" \"), 2), left = _a[0], right = _a[1];\r\n var leftOrigin = convertTransformUnit(left || \"\");\r\n var rightOrigin = convertTransformUnit(right || \"\");\r\n var originObject = __assign(__assign({}, leftOrigin), rightOrigin);\r\n var nextOriginObject = {\r\n x: \"50%\",\r\n y: \"50%\",\r\n };\r\n if (originObject.x) {\r\n nextOriginObject.x = originObject.x;\r\n }\r\n if (originObject.y) {\r\n nextOriginObject.y = originObject.y;\r\n }\r\n if (originObject.value) {\r\n if (originObject.x && !originObject.y) {\r\n nextOriginObject.y = originObject.value;\r\n }\r\n if (!originObject.x && originObject.y) {\r\n nextOriginObject.x = originObject.value;\r\n }\r\n }\r\n return nextOriginObject;\r\n }\r\n if (origin === \"left\") {\r\n return { x: \"0%\" };\r\n }\r\n if (origin === \"right\") {\r\n return { x: \"100%\" };\r\n }\r\n if (origin === \"top\") {\r\n return { y: \"0%\" };\r\n }\r\n if (origin === \"bottom\") {\r\n return { y: \"100%\" };\r\n }\r\n if (!origin) {\r\n return {};\r\n }\r\n if (origin === \"center\") {\r\n return { value: \"50%\" };\r\n }\r\n return { value: origin };\r\n}\r\nfunction convertTransformOriginArray(transformOrigin, width, height) {\r\n var _a = convertTransformUnit(transformOrigin, true), x = _a.x, y = _a.y;\r\n return [\r\n convertUnitSize(x, width) || 0,\r\n convertUnitSize(y, height) || 0,\r\n ];\r\n}\r\nfunction rotatePosesInfo(poses, origin, rad) {\r\n var prevPoses = poses.map(function (pos) { return minus(pos, origin); });\r\n var nextPoses = prevPoses.map(function (pos) { return rotate(pos, rad); });\r\n return {\r\n prev: prevPoses,\r\n next: nextPoses,\r\n result: nextPoses.map(function (pos) { return plus(pos, origin); }),\r\n };\r\n}\r\nfunction isDeepArrayEquals(arr1, arr2) {\r\n return arr1.length === arr2.length && arr1.every(function (value1, i) {\r\n var value2 = arr2[i];\r\n var isArray1 = isArray(value1);\r\n var isArray2 = isArray(value2);\r\n if (isArray1 && isArray2) {\r\n return isDeepArrayEquals(value1, value2);\r\n }\r\n else if (!isArray1 && !isArray2) {\r\n return value1 === value2;\r\n }\r\n return false;\r\n });\r\n}\r\nfunction watchValue(moveable, property, nextValue, valueKey, defaultValue) {\r\n var store = moveable._store;\r\n var prevValue = store[property];\r\n if (!(property in store)) {\r\n if (defaultValue != null) {\r\n store[property] = defaultValue;\r\n prevValue = defaultValue;\r\n }\r\n else {\r\n store[property] = nextValue;\r\n return nextValue;\r\n }\r\n }\r\n if (prevValue === nextValue || valueKey(prevValue) === valueKey(nextValue)) {\r\n return prevValue;\r\n }\r\n store[property] = nextValue;\r\n return nextValue;\r\n}\r\nfunction sign(value) {\r\n return value >= 0 ? 1 : -1;\r\n}\r\nfunction abs(value) {\r\n return Math.abs(value);\r\n}\r\nfunction countEach(count, callback) {\r\n return counter(count).map(function (index) { return callback(index); });\r\n}\r\nfunction getPaddingBox(padding) {\r\n if (isNumber(padding)) {\r\n return {\r\n top: padding,\r\n left: padding,\r\n right: padding,\r\n bottom: padding,\r\n };\r\n }\r\n return {\r\n left: padding.left || 0,\r\n top: padding.top || 0,\r\n right: padding.right || 0,\r\n bottom: padding.bottom || 0,\r\n };\r\n}\n\n/**\r\n * @namespace Moveable.Pinchable\r\n * @description Whether or not target can be pinched with draggable, resizable, scalable, rotatable (default: false)\r\n */\r\nvar Pinchable = makeAble(\"pinchable\", {\r\n props: [\r\n \"pinchable\",\r\n ],\r\n events: [\r\n \"pinchStart\",\r\n \"pinch\",\r\n \"pinchEnd\",\r\n \"pinchGroupStart\",\r\n \"pinchGroup\",\r\n \"pinchGroupEnd\",\r\n ],\r\n dragStart: function () {\r\n return true;\r\n },\r\n pinchStart: function (moveable, e) {\r\n var datas = e.datas, targets = e.targets, angle = e.angle, originalDatas = e.originalDatas;\r\n var _a = moveable.props, pinchable = _a.pinchable, ables = _a.ables;\r\n if (!pinchable) {\r\n return false;\r\n }\r\n var eventName = \"onPinch\".concat(targets ? \"Group\" : \"\", \"Start\");\r\n var controlEventName = \"drag\".concat(targets ? \"Group\" : \"\", \"ControlStart\");\r\n var pinchAbles = (pinchable === true ? moveable.controlAbles : ables.filter(function (able) {\r\n return pinchable.indexOf(able.name) > -1;\r\n })).filter(function (able) { return able.canPinch && able[controlEventName]; });\r\n var params = fillParams(moveable, e, {});\r\n if (targets) {\r\n params.targets = targets;\r\n }\r\n var result = triggerEvent(moveable, eventName, params);\r\n datas.isPinch = result !== false;\r\n datas.ables = pinchAbles;\r\n var isPinch = datas.isPinch;\r\n if (!isPinch) {\r\n return false;\r\n }\r\n pinchAbles.forEach(function (able) {\r\n originalDatas[able.name] = originalDatas[able.name] || {};\r\n if (!able[controlEventName]) {\r\n return;\r\n }\r\n var ableEvent = __assign(__assign({}, e), { datas: originalDatas[able.name], parentRotate: angle, isPinch: true });\r\n able[controlEventName](moveable, ableEvent);\r\n });\r\n moveable.state.snapRenderInfo = {\r\n request: e.isRequest,\r\n direction: [0, 0],\r\n };\r\n return isPinch;\r\n },\r\n pinch: function (moveable, e) {\r\n var datas = e.datas, pinchScale = e.scale, distance = e.distance, originalDatas = e.originalDatas, inputEvent = e.inputEvent, targets = e.targets, angle = e.angle;\r\n if (!datas.isPinch) {\r\n return;\r\n }\r\n var parentDistance = distance * (1 - 1 / pinchScale);\r\n var params = fillParams(moveable, e, {});\r\n if (targets) {\r\n params.targets = targets;\r\n }\r\n var eventName = \"onPinch\".concat(targets ? \"Group\" : \"\");\r\n triggerEvent(moveable, eventName, params);\r\n var ables = datas.ables;\r\n var controlEventName = \"drag\".concat(targets ? \"Group\" : \"\", \"Control\");\r\n ables.forEach(function (able) {\r\n if (!able[controlEventName]) {\r\n return;\r\n }\r\n able[controlEventName](moveable, __assign(__assign({}, e), { datas: originalDatas[able.name], inputEvent: inputEvent, resolveMatrix: true, pinchScale: pinchScale, parentDistance: parentDistance, parentRotate: angle, isPinch: true }));\r\n });\r\n return params;\r\n },\r\n pinchEnd: function (moveable, e) {\r\n var datas = e.datas, isPinch = e.isPinch, inputEvent = e.inputEvent, targets = e.targets, originalDatas = e.originalDatas;\r\n if (!datas.isPinch) {\r\n return;\r\n }\r\n var eventName = \"onPinch\".concat(targets ? \"Group\" : \"\", \"End\");\r\n var params = fillEndParams(moveable, e, { isDrag: isPinch });\r\n if (targets) {\r\n params.targets = targets;\r\n }\r\n triggerEvent(moveable, eventName, params);\r\n var ables = datas.ables;\r\n var controlEventName = \"drag\".concat(targets ? \"Group\" : \"\", \"ControlEnd\");\r\n ables.forEach(function (able) {\r\n if (!able[controlEventName]) {\r\n return;\r\n }\r\n able[controlEventName](moveable, __assign(__assign({}, e), { isDrag: isPinch, datas: originalDatas[able.name], inputEvent: inputEvent, isPinch: true }));\r\n });\r\n return isPinch;\r\n },\r\n pinchGroupStart: function (moveable, e) {\r\n return this.pinchStart(moveable, __assign(__assign({}, e), { targets: moveable.props.targets }));\r\n },\r\n pinchGroup: function (moveable, e) {\r\n return this.pinch(moveable, __assign(__assign({}, e), { targets: moveable.props.targets }));\r\n },\r\n pinchGroupEnd: function (moveable, e) {\r\n return this.pinchEnd(moveable, __assign(__assign({}, e), { targets: moveable.props.targets }));\r\n },\r\n});\r\n/**\r\n * Whether or not target can be pinched with draggable, resizable, scalable, rotatable (default: false)\r\n * @name Moveable.Pinchable#pinchable\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.pinchable = true;\r\n */\r\n/**\r\n * When the pinch starts, the pinchStart event is called with part of scaleStart, rotateStart, resizeStart\r\n * @memberof Moveable.Pinchable\r\n * @event pinchStart\r\n * @param {Moveable.Pinchable.OnPinchStart} - Parameters for the pinchStart event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * rotatable: true,\r\n * scalable: true,\r\n * pinchable: true, // [\"rotatable\", \"scalable\"]\r\n * });\r\n * moveable.on(\"pinchStart\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n * moveable.on(\"rotateStart\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n * moveable.on(\"scaleStart\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n */\r\n/**\r\n * When pinching, the pinch event is called with part of scale, rotate, resize\r\n * @memberof Moveable.Pinchable\r\n * @event pinch\r\n * @param {Moveable.Pinchable.OnPinch} - Parameters for the pinch event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * rotatable: true,\r\n * scalable: true,\r\n * pinchable: true, // [\"rotatable\", \"scalable\"]\r\n * });\r\n * moveable.on(\"pinch\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n * moveable.on(\"rotate\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n * moveable.on(\"scale\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n */\r\n/**\r\n * When the pinch finishes, the pinchEnd event is called.\r\n * @memberof Moveable.Pinchable\r\n * @event pinchEnd\r\n * @param {Moveable.Pinchable.OnPinchEnd} - Parameters for the pinchEnd event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * rotatable: true,\r\n * scalable: true,\r\n * pinchable: true, // [\"rotatable\", \"scalable\"]\r\n * });\r\n * moveable.on(\"pinchEnd\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n * moveable.on(\"rotateEnd\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n * moveable.on(\"scaleEnd\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n */\r\n/**\r\n * When the group pinch starts, the `pinchGroupStart` event is called.\r\n * @memberof Moveable.Pinchable\r\n * @event pinchGroupStart\r\n * @param {Moveable.Pinchable.OnPinchGroupStart} - Parameters for the `pinchGroupStart` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * pinchable: true\r\n * });\r\n * moveable.on(\"pinchGroupStart\", ({ targets }) => {\r\n * console.log(\"onPinchGroupStart\", targets);\r\n * });\r\n */\r\n/**\r\n * When the group pinch, the `pinchGroup` event is called.\r\n * @memberof Moveable.Pinchable\r\n * @event pinchGroup\r\n * @param {Moveable.Pinchable.OnPinchGroup} - Parameters for the `pinchGroup` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * pinchable: true\r\n * });\r\n * moveable.on(\"pinchGroup\", ({ targets, events }) => {\r\n * console.log(\"onPinchGroup\", targets);\r\n * });\r\n */\r\n/**\r\n * When the group pinch finishes, the `pinchGroupEnd` event is called.\r\n * @memberof Moveable.Pinchable\r\n * @event pinchGroupEnd\r\n * @param {Moveable.Pinchable.OnPinchGroupEnd} - Parameters for the `pinchGroupEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * pinchable: true\r\n * });\r\n * moveable.on(\"pinchGroupEnd\", ({ targets, isDrag }) => {\r\n * console.log(\"onPinchGroupEnd\", targets, isDrag);\r\n * });\r\n */\n\nvar directionCondition = getDirectionCondition(\"scalable\");\r\n/**\r\n * @namespace Scalable\r\n * @memberof Moveable\r\n * @description Scalable indicates whether the target's x and y can be scale of transform.\r\n */\r\nvar Scalable = {\r\n name: \"scalable\",\r\n ableGroup: \"size\",\r\n canPinch: true,\r\n props: [\r\n \"scalable\",\r\n \"throttleScale\",\r\n \"renderDirections\",\r\n \"keepRatio\",\r\n \"edge\",\r\n \"displayAroundControls\",\r\n ],\r\n events: [\r\n \"scaleStart\",\r\n \"beforeScale\",\r\n \"scale\",\r\n \"scaleEnd\",\r\n \"scaleGroupStart\",\r\n \"beforeScaleGroup\",\r\n \"scaleGroup\",\r\n \"scaleGroupEnd\",\r\n ],\r\n render: getRenderDirections(\"scalable\"),\r\n dragControlCondition: directionCondition,\r\n viewClassName: getDirectionViewClassName(\"scalable\"),\r\n dragControlStart: function (moveable, e) {\r\n var datas = e.datas, isPinch = e.isPinch, inputEvent = e.inputEvent, parentDirection = e.parentDirection;\r\n var direction = getTotalDirection(parentDirection, isPinch, inputEvent, datas);\r\n var _a = moveable.state, width = _a.width, height = _a.height, targetTransform = _a.targetTransform, target = _a.target, pos1 = _a.pos1, pos2 = _a.pos2, pos4 = _a.pos4;\r\n if (!direction || !target) {\r\n return false;\r\n }\r\n if (!isPinch) {\r\n setDragStart(moveable, e);\r\n }\r\n datas.datas = {};\r\n datas.transform = targetTransform;\r\n datas.prevDist = [1, 1];\r\n datas.direction = direction;\r\n datas.startOffsetWidth = width;\r\n datas.startOffsetHeight = height;\r\n datas.startValue = [1, 1];\r\n // const scaleWidth = getDist(pos1, pos2);\r\n // const scaleHeight = getDist(pos2, pos4);\r\n var isWidth = (!direction[0] && !direction[1]) || direction[0] || !direction[1];\r\n // datas.scaleWidth = scaleWidth;\r\n // datas.scaleHeight = scaleHeight;\r\n // datas.scaleXRatio = scaleWidth / width;\r\n // datas.scaleYRatio = scaleHeight / height;\r\n setDefaultTransformIndex(moveable, e, \"scale\");\r\n datas.isWidth = isWidth;\r\n function setRatio(ratio) {\r\n datas.ratio = ratio && isFinite(ratio) ? ratio : 0;\r\n }\r\n datas.startPositions = getAbsolutePosesByState(moveable.state);\r\n function setFixedDirection(fixedDirection) {\r\n var result = getFixedDirectionInfo(datas.startPositions, fixedDirection);\r\n datas.fixedDirection = result.fixedDirection;\r\n datas.fixedPosition = result.fixedPosition;\r\n datas.fixedOffset = result.fixedOffset;\r\n }\r\n datas.setFixedDirection = setFixedDirection;\r\n setRatio(getDist$1(pos1, pos2) / getDist$1(pos2, pos4));\r\n setFixedDirection([-direction[0], -direction[1]]);\r\n var setMinScaleSize = function (min) {\r\n datas.minScaleSize = min;\r\n };\r\n var setMaxScaleSize = function (max) {\r\n datas.maxScaleSize = max;\r\n };\r\n // const setMinScale = (min: number[]) => {\r\n // };\r\n // const setMaxScale = (max: number[]) => {\r\n // };\r\n setMinScaleSize([-Infinity, -Infinity]);\r\n setMaxScaleSize([Infinity, Infinity]);\r\n var params = fillParams(moveable, e, __assign(__assign({ direction: direction, set: function (scale) {\r\n datas.startValue = scale;\r\n }, setRatio: setRatio, setFixedDirection: setFixedDirection, setMinScaleSize: setMinScaleSize, setMaxScaleSize: setMaxScaleSize }, fillTransformStartEvent(moveable, e)), { dragStart: Draggable.dragStart(moveable, new CustomGesto().dragStart([0, 0], e)) }));\r\n var result = triggerEvent(moveable, \"onScaleStart\", params);\r\n datas.startFixedDirection = datas.fixedDirection;\r\n if (result !== false) {\r\n datas.isScale = true;\r\n moveable.state.snapRenderInfo = {\r\n request: e.isRequest,\r\n direction: direction,\r\n };\r\n }\r\n return datas.isScale ? params : false;\r\n },\r\n dragControl: function (moveable, e) {\r\n resolveTransformEvent(moveable, e, \"scale\");\r\n var datas = e.datas, parentKeepRatio = e.parentKeepRatio, parentFlag = e.parentFlag, isPinch = e.isPinch, dragClient = e.dragClient, isRequest = e.isRequest, useSnap = e.useSnap, resolveMatrix = e.resolveMatrix;\r\n var prevDist = datas.prevDist, direction = datas.direction, startOffsetWidth = datas.startOffsetWidth, startOffsetHeight = datas.startOffsetHeight, isScale = datas.isScale, startValue = datas.startValue, isWidth = datas.isWidth, ratio = datas.ratio;\r\n if (!isScale) {\r\n return false;\r\n }\r\n var props = moveable.props;\r\n var throttleScale = props.throttleScale, parentMoveable = props.parentMoveable;\r\n var sizeDirection = direction;\r\n if (!direction[0] && !direction[1]) {\r\n sizeDirection = [1, 1];\r\n }\r\n var keepRatio = (ratio && (parentKeepRatio != null ? parentKeepRatio : props.keepRatio)) || false;\r\n var state = moveable.state;\r\n var tempScaleValue = [\r\n startValue[0],\r\n startValue[1],\r\n ];\r\n function getNextScale() {\r\n var _a = getOffsetSizeDist(sizeDirection, keepRatio, datas, e), distWidth = _a.distWidth, distHeight = _a.distHeight;\r\n var distX = startOffsetWidth ? (startOffsetWidth + distWidth) / startOffsetWidth : 1;\r\n var distY = startOffsetHeight ? (startOffsetHeight + distHeight) / startOffsetHeight : 1;\r\n if (!startValue[0]) {\r\n tempScaleValue[0] = distWidth / startOffsetWidth;\r\n }\r\n if (!startValue[1]) {\r\n tempScaleValue[1] = distHeight / startOffsetHeight;\r\n }\r\n var scaleX = (sizeDirection[0] || keepRatio ? distX : 1) * tempScaleValue[0];\r\n var scaleY = (sizeDirection[1] || keepRatio ? distY : 1) * tempScaleValue[1];\r\n if (scaleX === 0) {\r\n scaleX = sign(prevDist[0]) * MIN_SCALE;\r\n }\r\n if (scaleY === 0) {\r\n scaleY = sign(prevDist[1]) * MIN_SCALE;\r\n }\r\n return [scaleX, scaleY];\r\n }\r\n var scale = getNextScale();\r\n if (!isPinch && moveable.props.groupable) {\r\n var snapRenderInfo = state.snapRenderInfo || {};\r\n var stateDirection = snapRenderInfo.direction;\r\n if (isArray(stateDirection) && (stateDirection[0] || stateDirection[1])) {\r\n state.snapRenderInfo = { direction: direction, request: e.isRequest };\r\n }\r\n }\r\n triggerEvent(moveable, \"onBeforeScale\", fillParams(moveable, e, {\r\n scale: scale,\r\n setFixedDirection: function (nextFixedDirection) {\r\n datas.setFixedDirection(nextFixedDirection);\r\n scale = getNextScale();\r\n return scale;\r\n },\r\n startFixedDirection: datas.startFixedDirection,\r\n setScale: function (nextScale) {\r\n scale = nextScale;\r\n },\r\n }, true));\r\n var dist = [\r\n scale[0] / tempScaleValue[0],\r\n scale[1] / tempScaleValue[1],\r\n ];\r\n var fixedPosition = dragClient;\r\n var snapDist = [0, 0];\r\n var distSign = sign(dist[0] * dist[1]);\r\n var isSelfPinch = !dragClient && !parentFlag && isPinch;\r\n if (isSelfPinch || resolveMatrix) {\r\n fixedPosition = getTranslateFixedPosition(moveable, datas.targetAllTransform, [0, 0], [0, 0], datas);\r\n }\r\n else if (!dragClient) {\r\n fixedPosition = datas.fixedPosition;\r\n }\r\n if (!isPinch) {\r\n snapDist = checkSnapScale(moveable, dist, direction, !useSnap && isRequest, datas);\r\n }\r\n if (keepRatio) {\r\n if (sizeDirection[0] && sizeDirection[1] && snapDist[0] && snapDist[1]) {\r\n if (Math.abs(snapDist[0] * startOffsetWidth) > Math.abs(snapDist[1] * startOffsetHeight)) {\r\n snapDist[1] = 0;\r\n }\r\n else {\r\n snapDist[0] = 0;\r\n }\r\n }\r\n var isNoSnap = !snapDist[0] && !snapDist[1];\r\n if (isNoSnap) {\r\n // throttle scale value (not absolute scale size)\r\n if (isWidth) {\r\n dist[0] = throttle(dist[0] * tempScaleValue[0], throttleScale) / tempScaleValue[0];\r\n }\r\n else {\r\n dist[1] = throttle(dist[1] * tempScaleValue[1], throttleScale) / tempScaleValue[1];\r\n }\r\n }\r\n if ((sizeDirection[0] && !sizeDirection[1])\r\n || (snapDist[0] && !snapDist[1])\r\n || (isNoSnap && isWidth)) {\r\n dist[0] += snapDist[0];\r\n var snapHeight = startOffsetWidth * dist[0] * tempScaleValue[0] / ratio;\r\n dist[1] = sign(distSign * dist[0]) * abs(snapHeight / startOffsetHeight / tempScaleValue[1]);\r\n }\r\n else if ((!sizeDirection[0] && sizeDirection[1])\r\n || (!snapDist[0] && snapDist[1])\r\n || (isNoSnap && !isWidth)) {\r\n dist[1] += snapDist[1];\r\n var snapWidth = startOffsetHeight * dist[1] * tempScaleValue[1] * ratio;\r\n dist[0] = sign(distSign * dist[1]) * abs(snapWidth / startOffsetWidth / tempScaleValue[0]);\r\n }\r\n }\r\n else {\r\n dist[0] += snapDist[0];\r\n dist[1] += snapDist[1];\r\n if (!snapDist[0]) {\r\n dist[0] = throttle(dist[0] * tempScaleValue[0], throttleScale) / tempScaleValue[0];\r\n }\r\n if (!snapDist[1]) {\r\n dist[1] = throttle(dist[1] * tempScaleValue[1], throttleScale) / tempScaleValue[1];\r\n }\r\n }\r\n if (dist[0] === 0) {\r\n dist[0] = sign(prevDist[0]) * MIN_SCALE;\r\n }\r\n if (dist[1] === 0) {\r\n dist[1] = sign(prevDist[1]) * MIN_SCALE;\r\n }\r\n scale = multiply2(dist, [tempScaleValue[0], tempScaleValue[1]]);\r\n var startOffsetSize = [\r\n startOffsetWidth,\r\n startOffsetHeight,\r\n ];\r\n var scaleSize = [\r\n startOffsetWidth * scale[0],\r\n startOffsetHeight * scale[1],\r\n ];\r\n scaleSize = calculateBoundSize(scaleSize, datas.minScaleSize, datas.maxScaleSize, keepRatio ? ratio : false);\r\n // if (keepRatio && (isGroup || keepRatioFinally)) {\r\n // if (isWidth) {\r\n // boundingHeight = boundingWidth / ratio;\r\n // } else {\r\n // boundingWidth = boundingHeight * ratio;\r\n // }\r\n // }\r\n scale = countEach(2, function (i) {\r\n return startOffsetSize[i] ? scaleSize[i] / startOffsetSize[i] : scaleSize[i];\r\n });\r\n dist = countEach(2, function (i) {\r\n return scale[i] / tempScaleValue[i];\r\n });\r\n var delta = countEach(2, function (i) { return prevDist[i] ? dist[i] / prevDist[i] : dist[i]; });\r\n var distText = \"scale(\".concat(dist.join(\", \"), \")\");\r\n var scaleText = \"scale(\".concat(scale.join(\", \"), \")\");\r\n var nextTransform = convertTransformFormat(datas, scaleText, distText);\r\n var isZeroScale = !startValue[0] || !startValue[1];\r\n var inverseDist = getScaleDist(moveable, isZeroScale ? scaleText : distText, datas.fixedDirection, fixedPosition, datas.fixedOffset, datas, isZeroScale);\r\n var inverseDelta = isSelfPinch ? inverseDist : minus(inverseDist, datas.prevInverseDist || [0, 0]);\r\n datas.prevDist = dist;\r\n datas.prevInverseDist = inverseDist;\r\n if (scale[0] === prevDist[0] && scale[1] === prevDist[1]\r\n && inverseDelta.every(function (num) { return !num; })\r\n && !parentMoveable\r\n && !isSelfPinch) {\r\n return false;\r\n }\r\n var params = fillParams(moveable, e, __assign({ offsetWidth: startOffsetWidth, offsetHeight: startOffsetHeight, direction: direction, scale: scale, dist: dist, delta: delta, isPinch: !!isPinch }, fillTransformEvent(moveable, nextTransform, inverseDelta, isPinch, e)));\r\n triggerEvent(moveable, \"onScale\", params);\r\n return params;\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n var datas = e.datas;\r\n if (!datas.isScale) {\r\n return false;\r\n }\r\n datas.isScale = false;\r\n var scaleEndParam = fillEndParams(moveable, e, {});\r\n triggerEvent(moveable, \"onScaleEnd\", scaleEndParam);\r\n return scaleEndParam;\r\n },\r\n dragGroupControlCondition: directionCondition,\r\n dragGroupControlStart: function (moveable, e) {\r\n var datas = e.datas;\r\n var params = this.dragControlStart(moveable, e);\r\n if (!params) {\r\n return false;\r\n }\r\n var originalEvents = fillChildEvents(moveable, \"resizable\", e);\r\n datas.moveableScale = moveable.scale;\r\n var events = triggerChildAbles(moveable, this, \"dragControlStart\", e, function (child, ev) {\r\n return startChildDist(moveable, child, datas, ev);\r\n });\r\n var setFixedDirection = function (fixedDirection) {\r\n params.setFixedDirection(fixedDirection);\r\n events.forEach(function (ev, i) {\r\n ev.setFixedDirection(fixedDirection);\r\n startChildDist(moveable, ev.moveable, datas, originalEvents[i]);\r\n });\r\n };\r\n datas.setFixedDirection = setFixedDirection;\r\n var nextParams = __assign(__assign({}, params), { targets: moveable.props.targets, events: events, setFixedDirection: setFixedDirection });\r\n var result = triggerEvent(moveable, \"onScaleGroupStart\", nextParams);\r\n datas.isScale = result !== false;\r\n return datas.isScale ? nextParams : false;\r\n },\r\n dragGroupControl: function (moveable, e) {\r\n var datas = e.datas;\r\n if (!datas.isScale) {\r\n return;\r\n }\r\n catchEvent(moveable, \"onBeforeScale\", function (parentEvent) {\r\n triggerEvent(moveable, \"onBeforeScaleGroup\", fillParams(moveable, e, __assign(__assign({}, parentEvent), { targets: moveable.props.targets }), true));\r\n });\r\n var params = this.dragControl(moveable, e);\r\n if (!params) {\r\n return;\r\n }\r\n var dist = params.dist;\r\n var moveableScale = datas.moveableScale;\r\n moveable.scale = [\r\n dist[0] * moveableScale[0],\r\n dist[1] * moveableScale[1],\r\n ];\r\n var keepRatio = moveable.props.keepRatio;\r\n var fixedPosition = datas.fixedPosition;\r\n var events = triggerChildAbles(moveable, this, \"dragControl\", e, function (_, ev) {\r\n var _a = __read(calculate(createRotateMatrix(moveable.rotation / 180 * Math.PI, 3), [\r\n ev.datas.originalX * dist[0],\r\n ev.datas.originalY * dist[1],\r\n 1,\r\n ], 3), 2), clientX = _a[0], clientY = _a[1];\r\n return __assign(__assign({}, ev), { parentDist: null, parentScale: dist, parentKeepRatio: keepRatio, \r\n // recalculate child fixed position for parent group's dragging.\r\n dragClient: plus(fixedPosition, [clientX, clientY]) });\r\n });\r\n var nextParams = __assign({ targets: moveable.props.targets, events: events }, params);\r\n triggerEvent(moveable, \"onScaleGroup\", nextParams);\r\n return nextParams;\r\n },\r\n dragGroupControlEnd: function (moveable, e) {\r\n var isDrag = e.isDrag, datas = e.datas;\r\n if (!datas.isScale) {\r\n return;\r\n }\r\n this.dragControlEnd(moveable, e);\r\n var events = triggerChildAbles(moveable, this, \"dragControlEnd\", e);\r\n var nextParams = fillEndParams(moveable, e, {\r\n targets: moveable.props.targets,\r\n events: events,\r\n });\r\n triggerEvent(moveable, \"onScaleGroupEnd\", nextParams);\r\n return isDrag;\r\n },\r\n /**\r\n * @method Moveable.Scalable#request\r\n * @param {Moveable.Scalable.ScalableRequestParam} e - the Scalable's request parameter\r\n * @return {Moveable.Requester} Moveable Requester\r\n * @example\r\n\n * // Instantly Request (requestStart - request - requestEnd)\r\n * moveable.request(\"scalable\", { deltaWidth: 10, deltaHeight: 10 }, true);\r\n *\r\n * // requestStart\r\n * const requester = moveable.request(\"scalable\");\r\n *\r\n * // request\r\n * requester.request({ deltaWidth: 10, deltaHeight: 10 });\r\n * requester.request({ deltaWidth: 10, deltaHeight: 10 });\r\n * requester.request({ deltaWidth: 10, deltaHeight: 10 });\r\n *\r\n * // requestEnd\r\n * requester.requestEnd();\r\n */\r\n request: function () {\r\n var datas = {};\r\n var distWidth = 0;\r\n var distHeight = 0;\r\n var useSnap = false;\r\n return {\r\n isControl: true,\r\n requestStart: function (e) {\r\n useSnap = e.useSnap;\r\n return {\r\n datas: datas,\r\n parentDirection: e.direction || [1, 1],\r\n useSnap: useSnap,\r\n };\r\n },\r\n request: function (e) {\r\n distWidth += e.deltaWidth;\r\n distHeight += e.deltaHeight;\r\n return {\r\n datas: datas,\r\n parentDist: [distWidth, distHeight],\r\n parentKeepRatio: e.keepRatio,\r\n useSnap: useSnap,\r\n };\r\n },\r\n requestEnd: function () {\r\n return { datas: datas, isDrag: true, useSnap: useSnap };\r\n },\r\n };\r\n },\r\n};\r\n/**\r\n * Whether or not target can scaled.\r\n *\r\n * @name Moveable.Scalable#scalable\r\n * @default false\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.scalable = true;\r\n */\r\n/**\r\n * throttle of scaleX, scaleY when scale.\r\n * @name Moveable.Scalable#throttleScale\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.throttleScale = 0.1;\r\n */\r\n/**\r\n * Set directions to show the control box. (default: [\"n\", \"nw\", \"ne\", \"s\", \"se\", \"sw\", \"e\", \"w\"])\r\n * @name Moveable.Scalable#renderDirections\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * scalable: true,\r\n * renderDirections: [\"n\", \"nw\", \"ne\", \"s\", \"se\", \"sw\", \"e\", \"w\"],\r\n * });\r\n *\r\n * moveable.renderDirections = [\"nw\", \"ne\", \"sw\", \"se\"];\r\n */\r\n/**\r\n * When resize or scale, keeps a ratio of the width, height. (default: false)\r\n * @name Moveable.Scalable#keepRatio\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * scalable: true,\r\n * });\r\n *\r\n * moveable.keepRatio = true;\r\n */\r\n/**\r\n * When the scale starts, the scaleStart event is called.\r\n * @memberof Moveable.Scalable\r\n * @event scaleStart\r\n * @param {Moveable.Scalable.OnScaleStart} - Parameters for the scaleStart event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { scalable: true });\r\n * moveable.on(\"scaleStart\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n */\r\n/**\r\n * When scaling, `beforeScale` is called before `scale` occurs. In `beforeScale`, you can get and set the pre-value before scaling.\r\n * @memberof Moveable.Scalable\r\n * @event beforeScale\r\n * @param {Moveable.Scalable.OnBeforeScale} - Parameters for the `beforeScale` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { scalable: true });\r\n * moveable.on(\"beforeScale\", ({ setFixedDirection }) => {\r\n * if (shiftKey) {\r\n * setFixedDirection([0, 0]);\r\n * }\r\n * });\r\n * moveable.on(\"scale\", ({ target, transform, dist }) => {\r\n * target.style.transform = transform;\r\n * });\r\n */\r\n/**\r\n * When scaling, the `scale` event is called.\r\n * @memberof Moveable.Scalable\r\n * @event scale\r\n * @param {Moveable.Scalable.OnScale} - Parameters for the `scale` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { scalable: true });\r\n * moveable.on(\"scale\", ({ target, transform, dist }) => {\r\n * target.style.transform = transform;\r\n * });\r\n */\r\n/**\r\n * When the scale finishes, the `scaleEnd` event is called.\r\n * @memberof Moveable.Scalable\r\n * @event scaleEnd\r\n * @param {Moveable.Scalable.OnScaleEnd} - Parameters for the `scaleEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { scalable: true });\r\n * moveable.on(\"scaleEnd\", ({ target, isDrag }) => {\r\n * console.log(target, isDrag);\r\n * });\r\n */\r\n/**\r\n* When the group scale starts, the `scaleGroupStart` event is called.\r\n* @memberof Moveable.Scalable\r\n* @event scaleGroupStart\r\n* @param {Moveable.Scalable.OnScaleGroupStart} - Parameters for the `scaleGroupStart` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* target: [].slice.call(document.querySelectorAll(\".target\")),\r\n* scalable: true\r\n* });\r\n* moveable.on(\"scaleGroupStart\", ({ targets }) => {\r\n* console.log(\"onScaleGroupStart\", targets);\r\n* });\r\n*/\r\n/**\r\n* When the group scale, the `scaleGroup` event is called.\r\n* @memberof Moveable.Scalable\r\n* @event scaleGroup\r\n* @param {Moveable.Scalable.OnScaleGroup} - Parameters for the `scaleGroup` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* target: [].slice.call(document.querySelectorAll(\".target\")),\r\n* scalable: true\r\n* });\r\n* moveable.on(\"scaleGroup\", ({ targets, events }) => {\r\n* console.log(\"onScaleGroup\", targets);\r\n* events.forEach(ev => {\r\n* const target = ev.target;\r\n* // ev.drag is a drag event that occurs when the group scale.\r\n* const left = ev.drag.beforeDist[0];\r\n* const top = ev.drag.beforeDist[1];\r\n* const scaleX = ev.scale[0];\r\n* const scaleY = ev.scale[1];\r\n* });\r\n* });\r\n*/\r\n/**\r\n * When the group scale finishes, the `scaleGroupEnd` event is called.\r\n * @memberof Moveable.Scalable\r\n * @event scaleGroupEnd\r\n * @param {Moveable.Scalable.OnScaleGroupEnd} - Parameters for the `scaleGroupEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * scalable: true\r\n * });\r\n * moveable.on(\"scaleGroupEnd\", ({ targets, isDrag }) => {\r\n * console.log(\"onScaleGroupEnd\", targets, isDrag);\r\n * });\r\n */\n\nfunction getMiddleLinePos(pos1, pos2) {\r\n return pos1.map(function (pos, i) { return dot(pos, pos2[i], 1, 2); });\r\n}\r\nfunction getTriangleRad(pos1, pos2, pos3) {\r\n // pos1 Rad\r\n var rad1 = getRad(pos1, pos2);\r\n var rad2 = getRad(pos1, pos3);\r\n var rad = rad2 - rad1;\r\n return rad >= 0 ? rad : rad + 2 * Math.PI;\r\n}\r\nfunction isValidPos(poses1, poses2) {\r\n var rad1 = getTriangleRad(poses1[0], poses1[1], poses1[2]);\r\n var rad2 = getTriangleRad(poses2[0], poses2[1], poses2[2]);\r\n var pi = Math.PI;\r\n if ((rad1 >= pi && rad2 <= pi) || (rad1 <= pi && rad2 >= pi)) {\r\n return false;\r\n }\r\n return true;\r\n}\r\n/**\r\n * @namespace Moveable.Warpable\r\n * @description Warpable indicates whether the target can be warped(distorted, bented).\r\n */\r\nvar Warpable = {\r\n name: \"warpable\",\r\n ableGroup: \"size\",\r\n props: [\r\n \"warpable\",\r\n \"renderDirections\",\r\n \"edge\",\r\n \"displayAroundControls\",\r\n ],\r\n events: [\r\n \"warpStart\",\r\n \"warp\",\r\n \"warpEnd\",\r\n ],\r\n viewClassName: getDirectionViewClassName(\"warpable\"),\r\n render: function (moveable, React) {\r\n var _a = moveable.props, resizable = _a.resizable, scalable = _a.scalable, warpable = _a.warpable, zoom = _a.zoom;\r\n if (resizable || scalable || !warpable) {\r\n return [];\r\n }\r\n var _b = moveable.state, pos1 = _b.pos1, pos2 = _b.pos2, pos3 = _b.pos3, pos4 = _b.pos4;\r\n var linePosFrom1 = getMiddleLinePos(pos1, pos2);\r\n var linePosFrom2 = getMiddleLinePos(pos2, pos1);\r\n var linePosFrom3 = getMiddleLinePos(pos1, pos3);\r\n var linePosFrom4 = getMiddleLinePos(pos3, pos1);\r\n var linePosTo1 = getMiddleLinePos(pos3, pos4);\r\n var linePosTo2 = getMiddleLinePos(pos4, pos3);\r\n var linePosTo3 = getMiddleLinePos(pos2, pos4);\r\n var linePosTo4 = getMiddleLinePos(pos4, pos2);\r\n return __spreadArray([\r\n React.createElement(\"div\", { className: prefix(\"line\"), key: \"middeLine1\", style: getLineStyle(linePosFrom1, linePosTo1, zoom) }),\r\n React.createElement(\"div\", { className: prefix(\"line\"), key: \"middeLine2\", style: getLineStyle(linePosFrom2, linePosTo2, zoom) }),\r\n React.createElement(\"div\", { className: prefix(\"line\"), key: \"middeLine3\", style: getLineStyle(linePosFrom3, linePosTo3, zoom) }),\r\n React.createElement(\"div\", { className: prefix(\"line\"), key: \"middeLine4\", style: getLineStyle(linePosFrom4, linePosTo4, zoom) })\r\n ], __read(renderAllDirections(moveable, \"warpable\", React)), false);\r\n },\r\n dragControlCondition: function (moveable, e) {\r\n if (e.isRequest) {\r\n return false;\r\n }\r\n var target = e.inputEvent.target;\r\n return hasClass(target, prefix(\"direction\")) && hasClass(target, prefix(\"warpable\"));\r\n },\r\n dragControlStart: function (moveable, e) {\r\n var datas = e.datas, inputEvent = e.inputEvent;\r\n var target = moveable.props.target;\r\n var inputTarget = inputEvent.target;\r\n var direction = getDirection(inputTarget, datas);\r\n if (!direction || !target) {\r\n return false;\r\n }\r\n var state = moveable.state;\r\n var transformOrigin = state.transformOrigin, is3d = state.is3d, targetTransform = state.targetTransform, targetMatrix = state.targetMatrix, width = state.width, height = state.height, left = state.left, top = state.top;\r\n datas.datas = {};\r\n datas.targetTransform = targetTransform;\r\n datas.warpTargetMatrix = is3d ? targetMatrix : convertDimension(targetMatrix, 3, 4);\r\n datas.targetInverseMatrix = ignoreDimension(invert(datas.warpTargetMatrix, 4), 3, 4);\r\n datas.direction = direction;\r\n datas.left = left;\r\n datas.top = top;\r\n datas.poses = [\r\n [0, 0],\r\n [width, 0],\r\n [0, height],\r\n [width, height],\r\n ].map(function (p) { return minus(p, transformOrigin); });\r\n datas.nextPoses = datas.poses.map(function (_a) {\r\n var _b = __read(_a, 2), x = _b[0], y = _b[1];\r\n return calculate(datas.warpTargetMatrix, [x, y, 0, 1], 4);\r\n });\r\n datas.startValue = createIdentityMatrix(4);\r\n datas.prevMatrix = createIdentityMatrix(4);\r\n datas.absolutePoses = getAbsolutePosesByState(state);\r\n datas.posIndexes = getPosIndexesByDirection(direction);\r\n setDragStart(moveable, e);\r\n setDefaultTransformIndex(moveable, e, \"matrix3d\");\r\n state.snapRenderInfo = {\r\n request: e.isRequest,\r\n direction: direction,\r\n };\r\n var params = fillParams(moveable, e, __assign({ set: function (matrix) {\r\n datas.startValue = matrix;\r\n } }, fillTransformStartEvent(moveable, e)));\r\n var result = triggerEvent(moveable, \"onWarpStart\", params);\r\n if (result !== false) {\r\n datas.isWarp = true;\r\n }\r\n return datas.isWarp;\r\n },\r\n dragControl: function (moveable, e) {\r\n var datas = e.datas, isRequest = e.isRequest;\r\n var distX = e.distX, distY = e.distY;\r\n var targetInverseMatrix = datas.targetInverseMatrix, prevMatrix = datas.prevMatrix, isWarp = datas.isWarp, startValue = datas.startValue, poses = datas.poses, posIndexes = datas.posIndexes, absolutePoses = datas.absolutePoses;\r\n if (!isWarp) {\r\n return false;\r\n }\r\n resolveTransformEvent(moveable, e, \"matrix3d\");\r\n if (hasGuidelines(moveable, \"warpable\")) {\r\n var selectedPoses = posIndexes.map(function (index) { return absolutePoses[index]; });\r\n if (selectedPoses.length > 1) {\r\n selectedPoses.push([\r\n (selectedPoses[0][0] + selectedPoses[1][0]) / 2,\r\n (selectedPoses[0][1] + selectedPoses[1][1]) / 2,\r\n ]);\r\n }\r\n var _a = checkMoveableSnapBounds(moveable, isRequest, {\r\n horizontal: selectedPoses.map(function (pos) { return pos[1] + distY; }),\r\n vertical: selectedPoses.map(function (pos) { return pos[0] + distX; }),\r\n }), horizontalSnapInfo = _a.horizontal, verticalSnapInfo = _a.vertical;\r\n distY -= horizontalSnapInfo.offset;\r\n distX -= verticalSnapInfo.offset;\r\n }\r\n var dist = getDragDist({ datas: datas, distX: distX, distY: distY }, true);\r\n var nextPoses = datas.nextPoses.slice();\r\n posIndexes.forEach(function (index) {\r\n nextPoses[index] = plus(nextPoses[index], dist);\r\n });\r\n if (!NEARBY_POS.every(function (nearByPoses) { return isValidPos(nearByPoses.map(function (i) { return poses[i]; }), nearByPoses.map(function (i) { return nextPoses[i]; })); })) {\r\n return false;\r\n }\r\n var h = createWarpMatrix(poses[0], poses[2], poses[1], poses[3], nextPoses[0], nextPoses[2], nextPoses[1], nextPoses[3]);\r\n if (!h.length) {\r\n return false;\r\n }\r\n // B * A * M\r\n var afterMatrix = multiply(targetInverseMatrix, h, 4);\r\n // B * M * A\r\n var matrix = getTransfromMatrix(datas, afterMatrix, true);\r\n var delta = multiply(invert(prevMatrix, 4), matrix, 4);\r\n datas.prevMatrix = matrix;\r\n var totalMatrix = multiply(startValue, matrix, 4);\r\n var nextTransform = convertTransformFormat(datas, \"matrix3d(\".concat(totalMatrix.join(\", \"), \")\"), \"matrix3d(\".concat(matrix.join(\", \"), \")\"));\r\n fillOriginalTransform(e, nextTransform);\r\n triggerEvent(moveable, \"onWarp\", fillParams(moveable, e, __assign({ delta: delta, matrix: totalMatrix, dist: matrix, multiply: multiply, transform: nextTransform }, fillCSSObject({\r\n transform: nextTransform,\r\n }, e))));\r\n return true;\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n var datas = e.datas, isDrag = e.isDrag;\r\n if (!datas.isWarp) {\r\n return false;\r\n }\r\n datas.isWarp = false;\r\n triggerEvent(moveable, \"onWarpEnd\", fillEndParams(moveable, e, {}));\r\n return isDrag;\r\n },\r\n};\r\n/**\r\n * Whether or not target can be warped. (default: false)\r\n * @name Moveable.Warpable#warpable\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.warpable = true;\r\n */\r\n/**\r\n* Set directions to show the control box. (default: [\"n\", \"nw\", \"ne\", \"s\", \"se\", \"sw\", \"e\", \"w\"])\r\n* @name Moveable.Warpable#renderDirections\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* warpable: true,\r\n* renderDirections: [\"n\", \"nw\", \"ne\", \"s\", \"se\", \"sw\", \"e\", \"w\"],\r\n* });\r\n*\r\n* moveable.renderDirections = [\"nw\", \"ne\", \"sw\", \"se\"];\r\n*/\r\n/**\r\n* When the warp starts, the warpStart event is called.\r\n* @memberof Moveable.Warpable\r\n* @event warpStart\r\n* @param {Moveable.Warpable.OnWarpStart} - Parameters for the warpStart event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, { warpable: true });\r\n* moveable.on(\"warpStart\", ({ target }) => {\r\n* console.log(target);\r\n* });\r\n*/\r\n/**\r\n * When warping, the warp event is called.\r\n * @memberof Moveable.Warpable\r\n * @event warp\r\n * @param {Moveable.Warpable.OnWarp} - Parameters for the warp event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n * let matrix = [\r\n * 1, 0, 0, 0,\r\n * 0, 1, 0, 0,\r\n * 0, 0, 1, 0,\r\n * 0, 0, 0, 1,\r\n * ];\r\n * const moveable = new Moveable(document.body, { warpable: true });\r\n * moveable.on(\"warp\", ({ target, transform, delta, multiply }) => {\r\n * // target.style.transform = transform;\r\n * matrix = multiply(matrix, delta);\r\n * target.style.transform = `matrix3d(${matrix.join(\",\")})`;\r\n * });\r\n */\r\n/**\r\n * When the warp finishes, the warpEnd event is called.\r\n * @memberof Moveable.Warpable\r\n * @event warpEnd\r\n * @param {Moveable.Warpable.OnWarpEnd} - Parameters for the warpEnd event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { warpable: true });\r\n * moveable.on(\"warpEnd\", ({ target, isDrag }) => {\r\n * console.log(target, isDrag);\r\n * });\r\n */\n\nvar AREA_PIECES = /*#__PURE__*/ prefix(\"area-pieces\");\r\nvar AREA_PIECE = /*#__PURE__*/ prefix(\"area-piece\");\r\nvar AVOID = /*#__PURE__*/ prefix(\"avoid\");\r\nvar VIEW_DRAGGING = prefix(\"view-dragging\");\n\nfunction restoreStyle(moveable) {\r\n var el = moveable.areaElement;\r\n if (!el) {\r\n return;\r\n }\r\n var _a = moveable.state, width = _a.width, height = _a.height;\r\n removeClass(el, AVOID);\r\n el.style.cssText += \"left: 0px; top: 0px; width: \".concat(width, \"px; height: \").concat(height, \"px\");\r\n}\r\nfunction renderPieces(React) {\r\n return (React.createElement(\"div\", { key: \"area_pieces\", className: AREA_PIECES },\r\n React.createElement(\"div\", { className: AREA_PIECE }),\r\n React.createElement(\"div\", { className: AREA_PIECE }),\r\n React.createElement(\"div\", { className: AREA_PIECE }),\r\n React.createElement(\"div\", { className: AREA_PIECE })));\r\n}\r\nvar DragArea = {\r\n name: \"dragArea\",\r\n props: [\r\n \"dragArea\",\r\n \"passDragArea\",\r\n ],\r\n events: [\r\n \"click\",\r\n \"clickGroup\",\r\n ],\r\n render: function (moveable, React) {\r\n var _a = moveable.props, target = _a.target, dragArea = _a.dragArea, groupable = _a.groupable, passDragArea = _a.passDragArea;\r\n var _b = moveable.getState(), width = _b.width, height = _b.height, renderPoses = _b.renderPoses;\r\n var className = passDragArea ? prefix(\"area\", \"pass\") : prefix(\"area\");\r\n if (groupable) {\r\n return [\r\n React.createElement(\"div\", { key: \"area\", ref: ref(moveable, \"areaElement\"), className: className }),\r\n renderPieces(React),\r\n ];\r\n }\r\n if (!target || !dragArea) {\r\n return [];\r\n }\r\n var h = createWarpMatrix([0, 0], [width, 0], [0, height], [width, height], renderPoses[0], renderPoses[1], renderPoses[2], renderPoses[3]);\r\n var transform = h.length ? makeMatrixCSS(h, true) : \"none\";\r\n return [\r\n React.createElement(\"div\", { key: \"area\", ref: ref(moveable, \"areaElement\"), className: className, style: {\r\n top: \"0px\",\r\n left: \"0px\",\r\n width: \"\".concat(width, \"px\"),\r\n height: \"\".concat(height, \"px\"),\r\n transformOrigin: \"0 0\",\r\n transform: transform,\r\n } }),\r\n renderPieces(React),\r\n ];\r\n },\r\n dragStart: function (moveable, _a) {\r\n var datas = _a.datas, clientX = _a.clientX, clientY = _a.clientY, inputEvent = _a.inputEvent;\r\n if (!inputEvent) {\r\n return false;\r\n }\r\n datas.isDragArea = false;\r\n var areaElement = moveable.areaElement;\r\n var state = moveable.state;\r\n var moveableClientRect = state.moveableClientRect, renderPoses = state.renderPoses, rootMatrix = state.rootMatrix, is3d = state.is3d;\r\n var left = moveableClientRect.left, top = moveableClientRect.top;\r\n var _b = getRect(renderPoses), relativeLeft = _b.left, relativeTop = _b.top, width = _b.width, height = _b.height;\r\n var n = is3d ? 4 : 3;\r\n var _c = __read(calculateInversePosition(rootMatrix, [clientX - left, clientY - top], n), 2), posX = _c[0], posY = _c[1];\r\n posX -= relativeLeft;\r\n posY -= relativeTop;\r\n var rects = [\r\n { left: relativeLeft, top: relativeTop, width: width, height: posY - 10 },\r\n { left: relativeLeft, top: relativeTop, width: posX - 10, height: height },\r\n { left: relativeLeft, top: relativeTop + posY + 10, width: width, height: height - posY - 10 },\r\n { left: relativeLeft + posX + 10, top: relativeTop, width: width - posX - 10, height: height },\r\n ];\r\n var children = [].slice.call(areaElement.nextElementSibling.children);\r\n rects.forEach(function (rect, i) {\r\n children[i].style.cssText\r\n = \"left: \".concat(rect.left, \"px;top: \").concat(rect.top, \"px; width: \").concat(rect.width, \"px; height: \").concat(rect.height, \"px;\");\r\n });\r\n addClass(areaElement, AVOID);\r\n state.disableNativeEvent = true;\r\n return;\r\n },\r\n drag: function (moveable, _a) {\r\n var datas = _a.datas, inputEvent = _a.inputEvent;\r\n this.enableNativeEvent(moveable);\r\n if (!inputEvent) {\r\n return false;\r\n }\r\n if (!datas.isDragArea) {\r\n datas.isDragArea = true;\r\n restoreStyle(moveable);\r\n }\r\n },\r\n dragEnd: function (moveable, e) {\r\n this.enableNativeEvent(moveable);\r\n var inputEvent = e.inputEvent, datas = e.datas;\r\n if (!inputEvent) {\r\n return false;\r\n }\r\n if (!datas.isDragArea) {\r\n restoreStyle(moveable);\r\n }\r\n },\r\n dragGroupStart: function (moveable, e) {\r\n return this.dragStart(moveable, e);\r\n },\r\n dragGroup: function (moveable, e) {\r\n return this.drag(moveable, e);\r\n },\r\n dragGroupEnd: function (moveable, e) {\r\n return this.dragEnd(moveable, e);\r\n },\r\n unset: function (moveable) {\r\n restoreStyle(moveable);\r\n moveable.state.disableNativeEvent = false;\r\n },\r\n enableNativeEvent: function (moveable) {\r\n var state = moveable.state;\r\n if (state.disableNativeEvent) {\r\n requestAnimationFrame(function () {\r\n state.disableNativeEvent = false;\r\n });\r\n }\r\n },\r\n};\r\n/**\r\n * Add an event to the moveable area instead of the target for stopPropagation. (default: false, true in group)\r\n * @name Moveable#dragArea\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * dragArea: false,\r\n * });\r\n */\r\n/**\r\n * Set `pointerEvents: none;` css to pass events in dragArea. (default: false)\r\n * @name Moveable#passDragArea\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * dragArea: false,\r\n * });\r\n */\n\nvar Origin = makeAble(\"origin\", {\r\n props: [\"origin\", \"svgOrigin\"],\r\n render: function (moveable, React) {\r\n var _a = moveable.props, zoom = _a.zoom, svgOrigin = _a.svgOrigin, groupable = _a.groupable;\r\n var _b = moveable.getState(), beforeOrigin = _b.beforeOrigin, rotation = _b.rotation, svg = _b.svg, allMatrix = _b.allMatrix, is3d = _b.is3d, left = _b.left, top = _b.top, offsetWidth = _b.offsetWidth, offsetHeight = _b.offsetHeight;\r\n var originStyle;\r\n if (!groupable && svg && svgOrigin) {\r\n var _c = __read(convertTransformOriginArray(svgOrigin, offsetWidth, offsetHeight), 2), originX = _c[0], originY = _c[1];\r\n var n = is3d ? 4 : 3;\r\n var result = calculatePosition(allMatrix, [originX, originY], n);\r\n originStyle = getControlTransform(rotation, zoom, minus(result, [left, top]));\r\n }\r\n else {\r\n originStyle = getControlTransform(rotation, zoom, beforeOrigin);\r\n }\r\n return [\r\n React.createElement(\"div\", { className: prefix(\"control\", \"origin\"), style: originStyle, key: \"beforeOrigin\" }),\r\n ];\r\n },\r\n});\r\n/**\r\n * Whether or not the origin controlbox will be visible or not (default: true)\r\n * @name Moveable#origin\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.origin = true;\r\n */\n\nfunction getDefaultScrollPosition(e) {\r\n var scrollContainer = e.scrollContainer;\r\n return [\r\n scrollContainer.scrollLeft,\r\n scrollContainer.scrollTop,\r\n ];\r\n}\r\n/**\r\n * @namespace Moveable.Scrollable\r\n * @description Whether or not target can be scrolled to the scroll container (default: false)\r\n */\r\nvar Scrollable = {\r\n name: \"scrollable\",\r\n canPinch: true,\r\n props: [\r\n \"scrollable\",\r\n \"scrollContainer\",\r\n \"scrollThreshold\",\r\n \"scrollThrottleTime\",\r\n \"getScrollPosition\",\r\n \"scrollOptions\",\r\n ],\r\n events: [\r\n \"scroll\",\r\n \"scrollGroup\",\r\n ],\r\n dragRelation: \"strong\",\r\n dragStart: function (moveable, e) {\r\n var props = moveable.props;\r\n var _a = props.scrollContainer, scrollContainer = _a === void 0 ? moveable.getContainer() : _a, scrollOptions = props.scrollOptions;\r\n var dragScroll = new DragScroll();\r\n var scrollContainerElement = getRefTarget(scrollContainer, true);\r\n e.datas.dragScroll = dragScroll;\r\n moveable.state.dragScroll = dragScroll;\r\n var gestoName = e.isControl ? \"controlGesto\" : \"targetGesto\";\r\n var targets = e.targets;\r\n dragScroll.on(\"scroll\", function (_a) {\r\n var container = _a.container, direction = _a.direction;\r\n var params = fillParams(moveable, e, {\r\n scrollContainer: container,\r\n direction: direction,\r\n });\r\n var eventName = targets ? \"onScrollGroup\" : \"onScroll\";\r\n if (targets) {\r\n params.targets = targets;\r\n }\r\n triggerEvent(moveable, eventName, params);\r\n }).on(\"move\", function (_a) {\r\n var offsetX = _a.offsetX, offsetY = _a.offsetY, inputEvent = _a.inputEvent;\r\n moveable[gestoName].scrollBy(offsetX, offsetY, inputEvent.inputEvent, false);\r\n }).on(\"scrollDrag\", function (_a) {\r\n var next = _a.next;\r\n next(moveable[gestoName].getCurrentEvent());\r\n });\r\n dragScroll.dragStart(e, __assign({ container: scrollContainerElement }, scrollOptions));\r\n },\r\n checkScroll: function (moveable, e) {\r\n var dragScroll = e.datas.dragScroll;\r\n if (!dragScroll) {\r\n return;\r\n }\r\n var _a = moveable.props, _b = _a.scrollContainer, scrollContainer = _b === void 0 ? moveable.getContainer() : _b, _c = _a.scrollThreshold, scrollThreshold = _c === void 0 ? 0 : _c, _d = _a.scrollThrottleTime, scrollThrottleTime = _d === void 0 ? 0 : _d, _e = _a.getScrollPosition, getScrollPosition = _e === void 0 ? getDefaultScrollPosition : _e, scrollOptions = _a.scrollOptions;\r\n dragScroll.drag(e, __assign({ container: scrollContainer, threshold: scrollThreshold, throttleTime: scrollThrottleTime, getScrollPosition: function (ev) {\r\n return getScrollPosition({ scrollContainer: ev.container, direction: ev.direction });\r\n } }, scrollOptions));\r\n return true;\r\n },\r\n drag: function (moveable, e) {\r\n return this.checkScroll(moveable, e);\r\n },\r\n dragEnd: function (moveable, e) {\r\n e.datas.dragScroll.dragEnd();\r\n e.datas.dragScroll = null;\r\n },\r\n dragControlStart: function (moveable, e) {\r\n return this.dragStart(moveable, __assign(__assign({}, e), { isControl: true }));\r\n },\r\n dragControl: function (moveable, e) {\r\n return this.drag(moveable, e);\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n return this.dragEnd(moveable, e);\r\n },\r\n dragGroupStart: function (moveable, e) {\r\n return this.dragStart(moveable, __assign(__assign({}, e), { targets: moveable.props.targets }));\r\n },\r\n dragGroup: function (moveable, e) {\r\n return this.drag(moveable, __assign(__assign({}, e), { targets: moveable.props.targets }));\r\n },\r\n dragGroupEnd: function (moveable, e) {\r\n return this.dragEnd(moveable, __assign(__assign({}, e), { targets: moveable.props.targets }));\r\n },\r\n dragGroupControlStart: function (moveable, e) {\r\n return this.dragStart(moveable, __assign(__assign({}, e), { targets: moveable.props.targets, isControl: true }));\r\n },\r\n dragGroupControl: function (moveable, e) {\r\n return this.drag(moveable, __assign(__assign({}, e), { targets: moveable.props.targets }));\r\n },\r\n dragGroupControEnd: function (moveable, e) {\r\n return this.dragEnd(moveable, __assign(__assign({}, e), { targets: moveable.props.targets }));\r\n },\r\n unset: function (moveable) {\r\n var _a;\r\n var state = moveable.state;\r\n (_a = state.dragScroll) === null || _a === void 0 ? void 0 : _a.dragEnd();\r\n state.dragScroll = null;\r\n },\r\n};\r\n/**\r\n * When the drag cursor leaves the scrollContainer, the `scroll` event occur to scroll.\r\n * @memberof Moveable.Scrollable\r\n * @event scroll\r\n * @param {Moveable.Scrollable.OnScroll} - Parameters for the `scroll` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: document.querySelector(\".target\"),\r\n * });\r\n * moveable.on(\"scroll\", ({ scrollContainer, direction }) => {\r\n * scrollContainer.scrollLeft += direction[0] * 10;\r\n * scrollContainer.scrollTop += direction[1] * 10;\r\n * });\r\n */\r\n/**\r\n * When the drag cursor leaves the scrollContainer, the `scrollGroup` event occur to scroll in group.\r\n * @memberof Moveable.Scrollable\r\n * @event scrollGroup\r\n * @param {Moveable.Scrollable.OnScrollGroup} - Parameters for the `scrollGroup` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * });\r\n * moveable.on(\"scroll\", ({ scrollContainer, direction }) => {\r\n * scrollContainer.scrollLeft += direction[0] * 10;\r\n * scrollContainer.scrollTop += direction[1] * 10;\r\n * });\r\n */\n\nvar Default = {\r\n name: \"\",\r\n props: [\r\n \"target\",\r\n \"dragTargetSelf\",\r\n \"dragTarget\",\r\n \"dragContainer\",\r\n \"container\",\r\n \"warpSelf\",\r\n \"rootContainer\",\r\n \"useResizeObserver\",\r\n \"useMutationObserver\",\r\n \"zoom\",\r\n \"dragFocusedInput\",\r\n \"transformOrigin\",\r\n \"ables\",\r\n \"className\",\r\n \"pinchThreshold\",\r\n \"pinchOutside\",\r\n \"triggerAblesSimultaneously\",\r\n \"checkInput\",\r\n \"cspNonce\",\r\n \"translateZ\",\r\n \"hideDefaultLines\",\r\n \"props\",\r\n \"flushSync\",\r\n \"stopPropagation\",\r\n \"preventClickEventOnDrag\",\r\n \"preventClickDefault\",\r\n \"viewContainer\",\r\n \"persistData\",\r\n \"useAccuratePosition\",\r\n \"firstRenderState\",\r\n \"linePadding\",\r\n \"controlPadding\",\r\n \"preventDefault\",\r\n \"requestStyles\",\r\n ],\r\n events: [\r\n \"changeTargets\",\r\n ],\r\n};\n\nvar Padding = makeAble(\"padding\", {\r\n props: [\"padding\"],\r\n render: function (moveable, React) {\r\n var props = moveable.props;\r\n if (props.dragArea) {\r\n return [];\r\n }\r\n var _a = getPaddingBox(props.padding || {}), left = _a.left, top = _a.top, right = _a.right, bottom = _a.bottom;\r\n var _b = moveable.getState(), renderPoses = _b.renderPoses, pos1 = _b.pos1, pos2 = _b.pos2, pos3 = _b.pos3, pos4 = _b.pos4;\r\n var poses = [pos1, pos2, pos3, pos4];\r\n var paddingDirections = [];\r\n if (left > 0) {\r\n paddingDirections.push([0, 2]);\r\n }\r\n if (top > 0) {\r\n paddingDirections.push([0, 1]);\r\n }\r\n if (right > 0) {\r\n paddingDirections.push([1, 3]);\r\n }\r\n if (bottom > 0) {\r\n paddingDirections.push([2, 3]);\r\n }\r\n return paddingDirections.map(function (_a, i) {\r\n var _b = __read(_a, 2), dir1 = _b[0], dir2 = _b[1];\r\n var paddingPos1 = poses[dir1];\r\n var paddingPos2 = poses[dir2];\r\n var paddingPos3 = renderPoses[dir1];\r\n var paddingPos4 = renderPoses[dir2];\r\n var h = createWarpMatrix([0, 0], [100, 0], [0, 100], [100, 100], paddingPos1, paddingPos2, paddingPos3, paddingPos4);\r\n if (!h.length) {\r\n return undefined;\r\n }\r\n return (React.createElement(\"div\", { key: \"padding\".concat(i), className: prefix(\"padding\"), style: {\r\n transform: makeMatrixCSS(h, true),\r\n } }));\r\n });\r\n },\r\n});\r\n/**\r\n * Add padding around the target to increase the drag area.\r\n * @name Moveable#padding\r\n * @default null\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: document.querySelector(\".target\"),\r\n * padding: { left: 0, top: 0, right: 0, bottom: 0 },\r\n * });\r\n * moveable.padding = { left: 10, top: 10, right: 10, bottom: 10 },\r\n * moveable.updateRect();\r\n */\n\nvar RADIUS_DIRECTIONS = [\"nw\", \"ne\", \"se\", \"sw\"];\r\nfunction calculateRatio(values, size) {\r\n var sumSize = values[0] + values[1];\r\n var sumRatio = sumSize > size ? size / sumSize : 1;\r\n values[0] *= sumRatio;\r\n values[1] = size - values[1] * sumRatio;\r\n return values;\r\n}\r\nvar HORIZONTAL_RADIUS_ORDER = [1, 2, 5, 6];\r\nvar VERTICAL_RADIUS_ORDER = [0, 3, 4, 7];\r\nvar HORIZONTAL_RADIUS_DIRECTIONS = [1, -1, -1, 1];\r\nvar VERTICAL_RADIUS_DIRECTIONS = [1, 1, -1, -1];\r\nfunction getRadiusStyles(nextPoses, isRelative, width, height, left, top, right, bottom) {\r\n if (left === void 0) { left = 0; }\r\n if (top === void 0) { top = 0; }\r\n if (right === void 0) { right = width; }\r\n if (bottom === void 0) { bottom = height; }\r\n var clipStyles = [];\r\n var isVertical = false;\r\n var radiusPoses = nextPoses.filter(function (pos) { return !pos.virtual; });\r\n var raws = radiusPoses.map(function (posInfo) {\r\n var horizontal = posInfo.horizontal, vertical = posInfo.vertical, pos = posInfo.pos;\r\n if (vertical && !isVertical) {\r\n isVertical = true;\r\n clipStyles.push(\"/\");\r\n }\r\n if (isVertical) {\r\n var rawPos = Math.max(0, vertical === 1 ? pos[1] - top : bottom - pos[1]);\r\n clipStyles.push(convertCSSSize(rawPos, height, isRelative));\r\n return rawPos;\r\n }\r\n else {\r\n var rawPos = Math.max(0, horizontal === 1 ? pos[0] - left : right - pos[0]);\r\n clipStyles.push(convertCSSSize(rawPos, width, isRelative));\r\n return rawPos;\r\n }\r\n });\r\n return {\r\n radiusPoses: radiusPoses,\r\n styles: clipStyles,\r\n raws: raws,\r\n };\r\n}\r\nfunction getRadiusRange(controlPoses) {\r\n // [start, length]\r\n var horizontalRange = [0, 0];\r\n var verticalRange = [0, 0];\r\n var length = controlPoses.length;\r\n for (var i = 0; i < length; ++i) {\r\n var clipPose = controlPoses[i];\r\n if (!clipPose.sub) {\r\n continue;\r\n }\r\n if (clipPose.horizontal) {\r\n if (horizontalRange[1] === 0) {\r\n horizontalRange[0] = i;\r\n }\r\n horizontalRange[1] = i - horizontalRange[0] + 1;\r\n verticalRange[0] = i + 1;\r\n }\r\n if (clipPose.vertical) {\r\n if (verticalRange[1] === 0) {\r\n verticalRange[0] = i;\r\n }\r\n verticalRange[1] = i - verticalRange[0] + 1;\r\n }\r\n }\r\n return {\r\n horizontalRange: horizontalRange,\r\n verticalRange: verticalRange,\r\n };\r\n}\r\nfunction getRadiusValues(values, width, height, left, top, minCounts, full) {\r\n var _a, _b, _c, _d;\r\n if (minCounts === void 0) { minCounts = [0, 0]; }\r\n if (full === void 0) { full = false; }\r\n var splitIndex = values.indexOf(\"/\");\r\n var splitLength = (splitIndex > -1 ? values.slice(0, splitIndex) : values).length;\r\n var horizontalValues = values.slice(0, splitLength);\r\n var verticalValues = values.slice(splitLength + 1);\r\n var horizontalValuesLength = horizontalValues.length;\r\n var verticalValuesLength = verticalValues.length;\r\n var hasVerticalValues = verticalValuesLength > 0;\r\n var _e = __read(horizontalValues, 4), _f = _e[0], nwValue = _f === void 0 ? \"0px\" : _f, _g = _e[1], neValue = _g === void 0 ? nwValue : _g, _h = _e[2], seValue = _h === void 0 ? nwValue : _h, _j = _e[3], swValue = _j === void 0 ? neValue : _j;\r\n var _k = __read(verticalValues, 4), _l = _k[0], wnValue = _l === void 0 ? nwValue : _l, _m = _k[1], enValue = _m === void 0 ? hasVerticalValues ? wnValue : neValue : _m, _o = _k[2], esValue = _o === void 0 ? hasVerticalValues ? wnValue : seValue : _o, _p = _k[3], wsValue = _p === void 0 ? hasVerticalValues ? enValue : swValue : _p;\r\n var horizontalRawPoses = [nwValue, neValue, seValue, swValue].map(function (pos) { return convertUnitSize(pos, width); });\r\n var verticalRawPoses = [wnValue, enValue, esValue, wsValue].map(function (pos) { return convertUnitSize(pos, height); });\r\n var horizontalPoses = horizontalRawPoses.slice();\r\n var verticalPoses = verticalRawPoses.slice();\r\n _a = __read(calculateRatio([horizontalPoses[0], horizontalPoses[1]], width), 2), horizontalPoses[0] = _a[0], horizontalPoses[1] = _a[1];\r\n _b = __read(calculateRatio([horizontalPoses[3], horizontalPoses[2]], width), 2), horizontalPoses[3] = _b[0], horizontalPoses[2] = _b[1];\r\n _c = __read(calculateRatio([verticalPoses[0], verticalPoses[3]], height), 2), verticalPoses[0] = _c[0], verticalPoses[3] = _c[1];\r\n _d = __read(calculateRatio([verticalPoses[1], verticalPoses[2]], height), 2), verticalPoses[1] = _d[0], verticalPoses[2] = _d[1];\r\n var nextHorizontalPoses = full\r\n ? horizontalPoses\r\n : horizontalPoses.slice(0, Math.max(minCounts[0], horizontalValuesLength));\r\n var nextVerticalPoses = full\r\n ? verticalPoses\r\n : verticalPoses.slice(0, Math.max(minCounts[1], verticalValuesLength));\r\n return __spreadArray(__spreadArray([], __read(nextHorizontalPoses.map(function (pos, i) {\r\n var direction = RADIUS_DIRECTIONS[i];\r\n return {\r\n virtual: i >= horizontalValuesLength,\r\n horizontal: HORIZONTAL_RADIUS_DIRECTIONS[i],\r\n vertical: 0,\r\n pos: [left + pos, top + (VERTICAL_RADIUS_DIRECTIONS[i] === -1 ? height : 0)],\r\n sub: true,\r\n raw: horizontalRawPoses[i],\r\n direction: direction,\r\n };\r\n })), false), __read(nextVerticalPoses.map(function (pos, i) {\r\n var direction = RADIUS_DIRECTIONS[i];\r\n return {\r\n virtual: i >= verticalValuesLength,\r\n horizontal: 0,\r\n vertical: VERTICAL_RADIUS_DIRECTIONS[i],\r\n pos: [left + (HORIZONTAL_RADIUS_DIRECTIONS[i] === -1 ? width : 0), top + pos],\r\n sub: true,\r\n raw: verticalRawPoses[i],\r\n direction: direction,\r\n };\r\n })), false);\r\n}\r\nfunction removeRadiusPos(controlPoses, poses, index, startIndex, length) {\r\n if (length === void 0) { length = poses.length; }\r\n var _a = getRadiusRange(controlPoses.slice(startIndex)), horizontalRange = _a.horizontalRange, verticalRange = _a.verticalRange;\r\n var radiuslIndex = index - startIndex;\r\n var deleteCount = 0;\r\n if (radiuslIndex === 0) {\r\n deleteCount = length;\r\n }\r\n else if (radiuslIndex > 0 && radiuslIndex < horizontalRange[1]) {\r\n deleteCount = horizontalRange[1] - radiuslIndex;\r\n }\r\n else if (radiuslIndex >= verticalRange[0]) {\r\n deleteCount = verticalRange[0] + verticalRange[1] - radiuslIndex;\r\n }\r\n else {\r\n return;\r\n }\r\n controlPoses.splice(index, deleteCount);\r\n poses.splice(index, deleteCount);\r\n}\r\nfunction addRadiusPos(controlPoses, poses, startIndex, horizontalIndex, verticalIndex, distX, distY, right, bottom, left, top) {\r\n if (left === void 0) { left = 0; }\r\n if (top === void 0) { top = 0; }\r\n var _a = getRadiusRange(controlPoses.slice(startIndex)), horizontalRange = _a.horizontalRange, verticalRange = _a.verticalRange;\r\n if (horizontalIndex > -1) {\r\n var radiusX = HORIZONTAL_RADIUS_DIRECTIONS[horizontalIndex] === 1\r\n ? distX - left\r\n : right - distX;\r\n for (var i = horizontalRange[1]; i <= horizontalIndex; ++i) {\r\n var y = VERTICAL_RADIUS_DIRECTIONS[i] === 1 ? top : bottom;\r\n var x = 0;\r\n if (horizontalIndex === i) {\r\n x = distX;\r\n }\r\n else if (i === 0) {\r\n x = left + radiusX;\r\n }\r\n else if (HORIZONTAL_RADIUS_DIRECTIONS[i] === -1) {\r\n x = right - (poses[startIndex][0] - left);\r\n }\r\n controlPoses.splice(startIndex + i, 0, {\r\n horizontal: HORIZONTAL_RADIUS_DIRECTIONS[i],\r\n vertical: 0,\r\n pos: [x, y],\r\n });\r\n poses.splice(startIndex + i, 0, [x, y]);\r\n if (i === 0) {\r\n break;\r\n }\r\n }\r\n }\r\n else if (verticalIndex > -1) {\r\n var radiusY = VERTICAL_RADIUS_DIRECTIONS[verticalIndex] === 1\r\n ? distY - top\r\n : bottom - distY;\r\n if (horizontalRange[1] === 0 && verticalRange[1] === 0) {\r\n var pos = [\r\n left + radiusY,\r\n top,\r\n ];\r\n controlPoses.push({\r\n horizontal: HORIZONTAL_RADIUS_DIRECTIONS[0],\r\n vertical: 0,\r\n pos: pos,\r\n });\r\n poses.push(pos);\r\n }\r\n var startVerticalIndex = verticalRange[0];\r\n for (var i = verticalRange[1]; i <= verticalIndex; ++i) {\r\n var x = HORIZONTAL_RADIUS_DIRECTIONS[i] === 1 ? left : right;\r\n var y = 0;\r\n if (verticalIndex === i) {\r\n y = distY;\r\n }\r\n else if (i === 0) {\r\n y = top + radiusY;\r\n }\r\n else if (VERTICAL_RADIUS_DIRECTIONS[i] === 1) {\r\n y = poses[startIndex + startVerticalIndex][1];\r\n }\r\n else if (VERTICAL_RADIUS_DIRECTIONS[i] === -1) {\r\n y = bottom - (poses[startIndex + startVerticalIndex][1] - top);\r\n }\r\n controlPoses.push({\r\n horizontal: 0,\r\n vertical: VERTICAL_RADIUS_DIRECTIONS[i],\r\n pos: [x, y],\r\n });\r\n poses.push([x, y]);\r\n if (i === 0) {\r\n break;\r\n }\r\n }\r\n }\r\n}\r\nfunction splitRadiusPoses(controlPoses, raws) {\r\n if (raws === void 0) { raws = controlPoses.map(function (pos) { return pos.raw; }); }\r\n var horizontals = controlPoses\r\n .map(function (pos, i) { return pos.horizontal ? raws[i] : null; }).filter(function (pos) { return pos != null; });\r\n var verticals = controlPoses\r\n .map(function (pos, i) { return pos.vertical ? raws[i] : null; }).filter(function (pos) { return pos != null; });\r\n return {\r\n horizontals: horizontals,\r\n verticals: verticals,\r\n };\r\n}\n\nvar CLIP_DIRECTIONS = [\r\n [0, -1, \"n\"],\r\n [1, 0, \"e\"],\r\n];\r\nvar CLIP_RECT_DIRECTIONS = [\r\n [-1, -1, \"nw\"],\r\n [0, -1, \"n\"],\r\n [1, -1, \"ne\"],\r\n [1, 0, \"e\"],\r\n [1, 1, \"se\"],\r\n [0, 1, \"s\"],\r\n [-1, 1, \"sw\"],\r\n [-1, 0, \"w\"],\r\n];\r\n// 1 2 5 6 0 3 4 7\r\n// 0 1 2 3 4 5 6 7\r\nfunction getClipStyles(moveable, clipPath, poses) {\r\n var clipRelative = moveable.props.clipRelative;\r\n var _a = moveable.state, width = _a.width, height = _a.height;\r\n var _b = clipPath, clipType = _b.type, clipPoses = _b.poses;\r\n var isRect = clipType === \"rect\";\r\n var isCircle = clipType === \"circle\";\r\n if (clipType === \"polygon\") {\r\n return poses.map(function (pos) { return \"\".concat(convertCSSSize(pos[0], width, clipRelative), \" \").concat(convertCSSSize(pos[1], height, clipRelative)); });\r\n }\r\n else if (isRect || clipType === \"inset\") {\r\n var top_1 = poses[1][1];\r\n var right = poses[3][0];\r\n var left = poses[7][0];\r\n var bottom = poses[5][1];\r\n if (isRect) {\r\n return [\r\n top_1,\r\n right,\r\n bottom,\r\n left,\r\n ].map(function (pos) { return \"\".concat(pos, \"px\"); });\r\n }\r\n var clipStyles = [top_1, width - right, height - bottom, left]\r\n .map(function (pos, i) { return convertCSSSize(pos, i % 2 ? width : height, clipRelative); });\r\n if (poses.length > 8) {\r\n var _c = __read(minus(poses[4], poses[0]), 2), subWidth = _c[0], subHeight = _c[1];\r\n clipStyles.push.apply(clipStyles, __spreadArray([\"round\"], __read(getRadiusStyles(clipPoses.slice(8).map(function (info, i) {\r\n return __assign(__assign({}, info), { pos: poses[i] });\r\n }), clipRelative, subWidth, subHeight, left, top_1, right, bottom).styles), false));\r\n }\r\n return clipStyles;\r\n }\r\n else if (isCircle || clipType === \"ellipse\") {\r\n var center = poses[0];\r\n var ry = convertCSSSize(abs(poses[1][1] - center[1]), isCircle ? Math.sqrt((width * width + height * height) / 2) : height, clipRelative);\r\n var clipStyles = isCircle ? [ry]\r\n : [convertCSSSize(abs(poses[2][0] - center[0]), width, clipRelative), ry];\r\n clipStyles.push(\"at\", convertCSSSize(center[0], width, clipRelative), convertCSSSize(center[1], height, clipRelative));\r\n return clipStyles;\r\n }\r\n}\r\nfunction getRectPoses(top, right, bottom, left) {\r\n var xs = [left, (left + right) / 2, right];\r\n var ys = [top, (top + bottom) / 2, bottom];\r\n return CLIP_RECT_DIRECTIONS.map(function (_a) {\r\n var _b = __read(_a, 3), dirx = _b[0], diry = _b[1], dir = _b[2];\r\n var x = xs[dirx + 1];\r\n var y = ys[diry + 1];\r\n return {\r\n vertical: abs(diry),\r\n horizontal: abs(dirx),\r\n direction: dir,\r\n pos: [x, y],\r\n };\r\n });\r\n}\r\nfunction getControlSize(controlPoses) {\r\n var xRange = [Infinity, -Infinity];\r\n var yRange = [Infinity, -Infinity];\r\n controlPoses.forEach(function (_a) {\r\n var pos = _a.pos;\r\n xRange[0] = Math.min(xRange[0], pos[0]);\r\n xRange[1] = Math.max(xRange[1], pos[0]);\r\n yRange[0] = Math.min(yRange[0], pos[1]);\r\n yRange[1] = Math.max(yRange[1], pos[1]);\r\n });\r\n return [\r\n abs(xRange[1] - xRange[0]),\r\n abs(yRange[1] - yRange[0]),\r\n ];\r\n}\r\nfunction getClipPath(target, width, height, defaultClip, customClip) {\r\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\r\n if (!target) {\r\n return;\r\n }\r\n var clipText = customClip;\r\n if (!clipText) {\r\n var getStyle = getCachedStyle(target);\r\n var clipPath = getStyle(\"clipPath\");\r\n clipText = clipPath !== \"none\" ? clipPath : getStyle(\"clip\");\r\n }\r\n if (!clipText || clipText === \"none\" || clipText === \"auto\") {\r\n clipText = defaultClip;\r\n if (!clipText) {\r\n return;\r\n }\r\n }\r\n var _k = splitBracket(clipText), _l = _k.prefix, clipPrefix = _l === void 0 ? clipText : _l, _m = _k.value, value = _m === void 0 ? \"\" : _m;\r\n var isCircle = clipPrefix === \"circle\";\r\n var splitter = \" \";\r\n if (clipPrefix === \"polygon\") {\r\n var values = splitComma(value || \"0% 0%, 100% 0%, 100% 100%, 0% 100%\");\r\n splitter = \",\";\r\n var poses = values.map(function (pos) {\r\n var _a = __read(pos.split(\" \"), 2), xPos = _a[0], yPos = _a[1];\r\n return {\r\n vertical: 1,\r\n horizontal: 1,\r\n pos: [\r\n convertUnitSize(xPos, width),\r\n convertUnitSize(yPos, height),\r\n ],\r\n };\r\n });\r\n var minMaxs = getMinMaxs(poses.map(function (pos) { return pos.pos; }));\r\n return {\r\n type: clipPrefix,\r\n clipText: clipText,\r\n poses: poses,\r\n splitter: splitter,\r\n left: minMaxs.minX,\r\n right: minMaxs.maxX,\r\n top: minMaxs.minY,\r\n bottom: minMaxs.maxY,\r\n };\r\n }\r\n else if (isCircle || clipPrefix === \"ellipse\") {\r\n var xPos = \"\";\r\n var yPos = \"\";\r\n var radiusX_1 = 0;\r\n var radiusY_1 = 0;\r\n var values = splitSpace(value);\r\n if (isCircle) {\r\n var radius = \"\";\r\n _a = __read(values, 4), _b = _a[0], radius = _b === void 0 ? \"50%\" : _b, _c = _a[2], xPos = _c === void 0 ? \"50%\" : _c, _d = _a[3], yPos = _d === void 0 ? \"50%\" : _d;\r\n radiusX_1 = convertUnitSize(radius, Math.sqrt((width * width + height * height) / 2));\r\n radiusY_1 = radiusX_1;\r\n }\r\n else {\r\n var xRadius = \"\";\r\n var yRadius = \"\";\r\n _e = __read(values, 5), _f = _e[0], xRadius = _f === void 0 ? \"50%\" : _f, _g = _e[1], yRadius = _g === void 0 ? \"50%\" : _g, _h = _e[3], xPos = _h === void 0 ? \"50%\" : _h, _j = _e[4], yPos = _j === void 0 ? \"50%\" : _j;\r\n radiusX_1 = convertUnitSize(xRadius, width);\r\n radiusY_1 = convertUnitSize(yRadius, height);\r\n }\r\n var centerPos_1 = [\r\n convertUnitSize(xPos, width),\r\n convertUnitSize(yPos, height),\r\n ];\r\n var poses = __spreadArray([\r\n {\r\n vertical: 1,\r\n horizontal: 1,\r\n pos: centerPos_1,\r\n direction: \"nesw\",\r\n }\r\n ], __read(CLIP_DIRECTIONS.slice(0, isCircle ? 1 : 2).map(function (dir) { return ({\r\n vertical: abs(dir[1]),\r\n horizontal: dir[0],\r\n direction: dir[2],\r\n sub: true,\r\n pos: [\r\n centerPos_1[0] + dir[0] * radiusX_1,\r\n centerPos_1[1] + dir[1] * radiusY_1,\r\n ],\r\n }); })), false);\r\n return {\r\n type: clipPrefix,\r\n clipText: clipText,\r\n radiusX: radiusX_1,\r\n radiusY: radiusY_1,\r\n left: centerPos_1[0] - radiusX_1,\r\n top: centerPos_1[1] - radiusY_1,\r\n right: centerPos_1[0] + radiusX_1,\r\n bottom: centerPos_1[1] + radiusY_1,\r\n poses: poses,\r\n splitter: splitter,\r\n };\r\n }\r\n else if (clipPrefix === \"inset\") {\r\n var values = splitSpace(value || \"0 0 0 0\");\r\n var roundIndex = values.indexOf(\"round\");\r\n var rectLength = (roundIndex > -1 ? values.slice(0, roundIndex) : values).length;\r\n var radiusValues = values.slice(rectLength + 1);\r\n var _o = __read(values.slice(0, rectLength), 4), topValue = _o[0], _p = _o[1], rightValue = _p === void 0 ? topValue : _p, _q = _o[2], bottomValue = _q === void 0 ? topValue : _q, _r = _o[3], leftValue = _r === void 0 ? rightValue : _r;\r\n var _s = __read([topValue, bottomValue].map(function (pos) { return convertUnitSize(pos, height); }), 2), top_2 = _s[0], bottom = _s[1];\r\n var _t = __read([leftValue, rightValue].map(function (pos) { return convertUnitSize(pos, width); }), 2), left = _t[0], right = _t[1];\r\n var nextRight = width - right;\r\n var nextBottom = height - bottom;\r\n var radiusPoses = getRadiusValues(radiusValues, nextRight - left, nextBottom - top_2, left, top_2);\r\n var poses = __spreadArray(__spreadArray([], __read(getRectPoses(top_2, nextRight, nextBottom, left)), false), __read(radiusPoses), false);\r\n return {\r\n type: \"inset\",\r\n clipText: clipText,\r\n poses: poses,\r\n top: top_2,\r\n left: left,\r\n right: nextRight,\r\n bottom: nextBottom,\r\n radius: radiusValues,\r\n splitter: splitter,\r\n };\r\n }\r\n else if (clipPrefix === \"rect\") {\r\n // top right bottom left\r\n var values = splitComma(value || \"0px, \".concat(width, \"px, \").concat(height, \"px, 0px\"));\r\n splitter = \",\";\r\n var _u = __read(values.map(function (pos) {\r\n var posValue = splitUnit(pos).value;\r\n return posValue;\r\n }), 4), top_3 = _u[0], right = _u[1], bottom = _u[2], left = _u[3];\r\n var poses = getRectPoses(top_3, right, bottom, left);\r\n return {\r\n type: \"rect\",\r\n clipText: clipText,\r\n poses: poses,\r\n top: top_3,\r\n right: right,\r\n bottom: bottom,\r\n left: left,\r\n values: values,\r\n splitter: splitter,\r\n };\r\n }\r\n return;\r\n}\n\nfunction moveControlPos(controlPoses, index, dist, isRect, keepRatio) {\r\n var _a = controlPoses[index], direction = _a.direction, sub = _a.sub;\r\n var dists = controlPoses.map(function () { return [0, 0]; });\r\n var directions = direction ? direction.split(\"\") : [];\r\n if (isRect && index < 8) {\r\n var verticalDirections = directions.filter(function (dir) { return dir === \"w\" || dir === \"e\"; });\r\n var horizontalDirections = directions.filter(function (dir) { return dir === \"n\" || dir === \"s\"; });\r\n var verticalDirection_1 = verticalDirections[0];\r\n var horizontalDirection_1 = horizontalDirections[0];\r\n dists[index] = dist;\r\n var _b = __read(getControlSize(controlPoses), 2), width = _b[0], height = _b[1];\r\n var ratio = width && height ? width / height : 0;\r\n if (ratio && keepRatio) {\r\n // 0 1 2\r\n // 7 3\r\n // 6 5 4\r\n var fixedIndex = (index + 4) % 8;\r\n var fixedPosition = controlPoses[fixedIndex].pos;\r\n var sizeDirection = [0, 0];\r\n if (direction.indexOf(\"w\") > -1) {\r\n sizeDirection[0] = -1;\r\n }\r\n else if (direction.indexOf(\"e\") > -1) {\r\n sizeDirection[0] = 1;\r\n }\r\n if (direction.indexOf(\"n\") > -1) {\r\n sizeDirection[1] = -1;\r\n }\r\n else if (direction.indexOf(\"s\") > -1) {\r\n sizeDirection[1] = 1;\r\n }\r\n var nextDist = getSizeDistByDist([width, height], dist, ratio, sizeDirection, true);\r\n var nextWidth = width + nextDist[0];\r\n var nextHeight = height + nextDist[1];\r\n var top_1 = fixedPosition[1];\r\n var bottom = fixedPosition[1];\r\n var left = fixedPosition[0];\r\n var right = fixedPosition[0];\r\n if (sizeDirection[0] === -1) {\r\n left = right - nextWidth;\r\n }\r\n else if (sizeDirection[0] === 1) {\r\n right = left + nextWidth;\r\n }\r\n else {\r\n left = left - nextWidth / 2;\r\n right = right + nextWidth / 2;\r\n }\r\n if (sizeDirection[1] === -1) {\r\n top_1 = bottom - nextHeight;\r\n }\r\n else if (sizeDirection[1] === 1) {\r\n bottom = top_1 + nextHeight;\r\n }\r\n else {\r\n top_1 = bottom - nextHeight / 2;\r\n bottom = top_1 + nextHeight;\r\n }\r\n var nextControlPoses_1 = getRectPoses(top_1, right, bottom, left);\r\n controlPoses.forEach(function (controlPose, i) {\r\n dists[i][0] = nextControlPoses_1[i].pos[0] - controlPose.pos[0];\r\n dists[i][1] = nextControlPoses_1[i].pos[1] - controlPose.pos[1];\r\n });\r\n }\r\n else {\r\n controlPoses.forEach(function (controlPose, i) {\r\n var controlDir = controlPose.direction;\r\n if (!controlDir) {\r\n return;\r\n }\r\n if (controlDir.indexOf(verticalDirection_1) > -1) {\r\n dists[i][0] = dist[0];\r\n }\r\n if (controlDir.indexOf(horizontalDirection_1) > -1) {\r\n dists[i][1] = dist[1];\r\n }\r\n });\r\n if (verticalDirection_1) {\r\n dists[1][0] = dist[0] / 2;\r\n dists[5][0] = dist[0] / 2;\r\n }\r\n if (horizontalDirection_1) {\r\n dists[3][1] = dist[1] / 2;\r\n dists[7][1] = dist[1] / 2;\r\n }\r\n }\r\n }\r\n else if (direction && !sub) {\r\n directions.forEach(function (dir) {\r\n var isVertical = dir === \"n\" || dir === \"s\";\r\n controlPoses.forEach(function (controlPose, i) {\r\n var dirDir = controlPose.direction, dirHorizontal = controlPose.horizontal, dirVertical = controlPose.vertical;\r\n if (!dirDir || dirDir.indexOf(dir) === -1) {\r\n return;\r\n }\r\n dists[i] = [\r\n isVertical || !dirHorizontal ? 0 : dist[0],\r\n !isVertical || !dirVertical ? 0 : dist[1],\r\n ];\r\n });\r\n });\r\n }\r\n else {\r\n dists[index] = dist;\r\n }\r\n return dists;\r\n}\r\nfunction addClipPath(moveable, e) {\r\n var _a = __read(calculatePointerDist(moveable, e), 2), distX = _a[0], distY = _a[1];\r\n var _b = e.datas, clipPath = _b.clipPath, clipIndex = _b.clipIndex;\r\n var _c = clipPath, clipType = _c.type, clipPoses = _c.poses, splitter = _c.splitter;\r\n var poses = clipPoses.map(function (pos) { return pos.pos; });\r\n if (clipType === \"polygon\") {\r\n poses.splice(clipIndex, 0, [distX, distY]);\r\n }\r\n else if (clipType === \"inset\") {\r\n var horizontalIndex = HORIZONTAL_RADIUS_ORDER.indexOf(clipIndex);\r\n var verticalIndex = VERTICAL_RADIUS_ORDER.indexOf(clipIndex);\r\n var length_1 = clipPoses.length;\r\n addRadiusPos(clipPoses, poses, 8, horizontalIndex, verticalIndex, distX, distY, poses[4][0], poses[4][1], poses[0][0], poses[0][1]);\r\n if (length_1 === clipPoses.length) {\r\n return;\r\n }\r\n }\r\n else {\r\n return;\r\n }\r\n var clipStyles = getClipStyles(moveable, clipPath, poses);\r\n var clipStyle = \"\".concat(clipType, \"(\").concat(clipStyles.join(splitter), \")\");\r\n triggerEvent(moveable, \"onClip\", fillParams(moveable, e, __assign({ clipEventType: \"added\", clipType: clipType, poses: poses, clipStyles: clipStyles, clipStyle: clipStyle, distX: 0, distY: 0 }, fillCSSObject({\r\n clipPath: clipStyle,\r\n }, e))));\r\n}\r\nfunction removeClipPath(moveable, e) {\r\n var _a = e.datas, clipPath = _a.clipPath, clipIndex = _a.clipIndex;\r\n var _b = clipPath, clipType = _b.type, clipPoses = _b.poses, splitter = _b.splitter;\r\n var poses = clipPoses.map(function (pos) { return pos.pos; });\r\n var length = poses.length;\r\n if (clipType === \"polygon\") {\r\n clipPoses.splice(clipIndex, 1);\r\n poses.splice(clipIndex, 1);\r\n }\r\n else if (clipType === \"inset\") {\r\n if (clipIndex < 8) {\r\n return;\r\n }\r\n removeRadiusPos(clipPoses, poses, clipIndex, 8, length);\r\n if (length === clipPoses.length) {\r\n return;\r\n }\r\n }\r\n else {\r\n return;\r\n }\r\n var clipStyles = getClipStyles(moveable, clipPath, poses);\r\n var clipStyle = \"\".concat(clipType, \"(\").concat(clipStyles.join(splitter), \")\");\r\n triggerEvent(moveable, \"onClip\", fillParams(moveable, e, __assign({ clipEventType: \"removed\", clipType: clipType, poses: poses, clipStyles: clipStyles, clipStyle: clipStyle, distX: 0, distY: 0 }, fillCSSObject({\r\n clipPath: clipStyle,\r\n }, e))));\r\n}\r\n/**\r\n * @namespace Moveable.Clippable\r\n * @description Whether to clip the target.\r\n */\r\nvar Clippable = {\r\n name: \"clippable\",\r\n props: [\r\n \"clippable\",\r\n \"defaultClipPath\",\r\n \"customClipPath\",\r\n \"keepRatio\",\r\n \"clipRelative\",\r\n \"clipArea\",\r\n \"dragWithClip\",\r\n \"clipTargetBounds\",\r\n \"clipVerticalGuidelines\",\r\n \"clipHorizontalGuidelines\",\r\n \"clipSnapThreshold\",\r\n ],\r\n events: [\r\n \"clipStart\",\r\n \"clip\",\r\n \"clipEnd\",\r\n ],\r\n css: [\r\n \".control.clip-control {\\nbackground: #6d6;\\ncursor: pointer;\\n}\\n.control.clip-control.clip-radius {\\nbackground: #d66;\\n}\\n.line.clip-line {\\nbackground: #6e6;\\ncursor: move;\\nz-index: 1;\\n}\\n.clip-area {\\nposition: absolute;\\ntop: 0;\\nleft: 0;\\n}\\n.clip-ellipse {\\nposition: absolute;\\ncursor: move;\\nborder: 1px solid #6d6;\\nborder: var(--zoompx) solid #6d6;\\nborder-radius: 50%;\\ntransform-origin: 0px 0px;\\n}\",\r\n \":host {\\n--bounds-color: #d66;\\n}\",\r\n \".guideline {\\npointer-events: none;\\nz-index: 2;\\n}\",\r\n \".line.guideline.bounds {\\nbackground: #d66;\\nbackground: var(--bounds-color);\\n}\",\r\n ],\r\n render: function (moveable, React) {\r\n var _a = moveable.props, customClipPath = _a.customClipPath, defaultClipPath = _a.defaultClipPath, clipArea = _a.clipArea, zoom = _a.zoom, groupable = _a.groupable;\r\n var _b = moveable.getState(), target = _b.target, width = _b.width, height = _b.height, allMatrix = _b.allMatrix, is3d = _b.is3d, left = _b.left, top = _b.top, pos1 = _b.pos1, pos2 = _b.pos2, pos3 = _b.pos3, pos4 = _b.pos4, clipPathState = _b.clipPathState, snapBoundInfos = _b.snapBoundInfos, rotationRad = _b.rotation;\r\n if (!target || groupable) {\r\n return [];\r\n }\r\n var clipPath = getClipPath(target, width, height, defaultClipPath || \"inset\", clipPathState || customClipPath);\r\n if (!clipPath) {\r\n return [];\r\n }\r\n var n = is3d ? 4 : 3;\r\n var type = clipPath.type;\r\n var clipPoses = clipPath.poses;\r\n var poses = clipPoses.map(function (pos) {\r\n // return [x, y];\r\n var calculatedPos = calculatePosition(allMatrix, pos.pos, n);\r\n return [\r\n calculatedPos[0] - left,\r\n calculatedPos[1] - top,\r\n ];\r\n });\r\n var controls = [];\r\n var lines = [];\r\n var isRect = type === \"rect\";\r\n var isInset = type === \"inset\";\r\n var isPolygon = type === \"polygon\";\r\n if (isRect || isInset || isPolygon) {\r\n var linePoses_1 = isInset ? poses.slice(0, 8) : poses;\r\n lines = linePoses_1.map(function (to, i) {\r\n var from = i === 0 ? linePoses_1[linePoses_1.length - 1] : linePoses_1[i - 1];\r\n var rad = getRad(from, to);\r\n var dist = getDiagonalSize(from, to);\r\n return React.createElement(\"div\", { key: \"clipLine\".concat(i), className: prefix(\"line\", \"clip-line\", \"snap-control\"), \"data-clip-index\": i, style: {\r\n width: \"\".concat(dist, \"px\"),\r\n transform: \"translate(\".concat(from[0], \"px, \").concat(from[1], \"px) rotate(\").concat(rad, \"rad) scaleY(\").concat(zoom, \")\"),\r\n } });\r\n });\r\n }\r\n controls = poses.map(function (pos, i) {\r\n return React.createElement(\"div\", { key: \"clipControl\".concat(i), className: prefix(\"control\", \"clip-control\", \"snap-control\"), \"data-clip-index\": i, style: {\r\n transform: \"translate(\".concat(pos[0], \"px, \").concat(pos[1], \"px) rotate(\").concat(rotationRad, \"rad) scale(\").concat(zoom, \")\"),\r\n } });\r\n });\r\n if (isInset) {\r\n controls.push.apply(controls, __spreadArray([], __read(poses.slice(8).map(function (pos, i) {\r\n return React.createElement(\"div\", { key: \"clipRadiusControl\".concat(i), className: prefix(\"control\", \"clip-control\", \"clip-radius\", \"snap-control\"), \"data-clip-index\": 8 + i, style: {\r\n transform: \"translate(\".concat(pos[0], \"px, \").concat(pos[1], \"px) rotate(\").concat(rotationRad, \"rad) scale(\").concat(zoom, \")\"),\r\n } });\r\n })), false));\r\n }\r\n if (type === \"circle\" || type === \"ellipse\") {\r\n var clipLeft = clipPath.left, clipTop = clipPath.top, radiusX = clipPath.radiusX, radiusY = clipPath.radiusY;\r\n var _c = __read(minus(calculatePosition(allMatrix, [clipLeft, clipTop], n), calculatePosition(allMatrix, [0, 0], n)), 2), distLeft = _c[0], distTop = _c[1];\r\n var ellipseClipPath = \"none\";\r\n if (!clipArea) {\r\n var piece = Math.max(10, radiusX / 5, radiusY / 5);\r\n var areaPoses = [];\r\n for (var i = 0; i <= piece; ++i) {\r\n var rad = Math.PI * 2 / piece * i;\r\n areaPoses.push([\r\n radiusX + (radiusX - zoom) * Math.cos(rad),\r\n radiusY + (radiusY - zoom) * Math.sin(rad),\r\n ]);\r\n }\r\n areaPoses.push([radiusX, -2]);\r\n areaPoses.push([-2, -2]);\r\n areaPoses.push([-2, radiusY * 2 + 2]);\r\n areaPoses.push([radiusX * 2 + 2, radiusY * 2 + 2]);\r\n areaPoses.push([radiusX * 2 + 2, -2]);\r\n areaPoses.push([radiusX, -2]);\r\n ellipseClipPath = \"polygon(\".concat(areaPoses.map(function (pos) { return \"\".concat(pos[0], \"px \").concat(pos[1], \"px\"); }).join(\", \"), \")\");\r\n }\r\n controls.push(React.createElement(\"div\", { key: \"clipEllipse\", className: prefix(\"clip-ellipse\", \"snap-control\"), style: {\r\n width: \"\".concat(radiusX * 2, \"px\"),\r\n height: \"\".concat(radiusY * 2, \"px\"),\r\n clipPath: ellipseClipPath,\r\n transform: \"translate(\".concat(-left + distLeft, \"px, \").concat(-top + distTop, \"px) \").concat(makeMatrixCSS(allMatrix)),\r\n } }));\r\n }\r\n if (clipArea) {\r\n var _d = getRect(__spreadArray([pos1, pos2, pos3, pos4], __read(poses), false)), allWidth = _d.width, allHeight = _d.height, allLeft_1 = _d.left, allTop_1 = _d.top;\r\n if (isPolygon || isRect || isInset) {\r\n var areaPoses = isInset ? poses.slice(0, 8) : poses;\r\n controls.push(React.createElement(\"div\", { key: \"clipArea\", className: prefix(\"clip-area\", \"snap-control\"), style: {\r\n width: \"\".concat(allWidth, \"px\"),\r\n height: \"\".concat(allHeight, \"px\"),\r\n transform: \"translate(\".concat(allLeft_1, \"px, \").concat(allTop_1, \"px)\"),\r\n clipPath: \"polygon(\".concat(areaPoses.map(function (pos) { return \"\".concat(pos[0] - allLeft_1, \"px \").concat(pos[1] - allTop_1, \"px\"); }).join(\", \"), \")\"),\r\n } }));\r\n }\r\n }\r\n if (snapBoundInfos) {\r\n [\"vertical\", \"horizontal\"].forEach(function (directionType) {\r\n var info = snapBoundInfos[directionType];\r\n var isHorizontal = directionType === \"horizontal\";\r\n if (info.isSnap) {\r\n lines.push.apply(lines, __spreadArray([], __read(info.snap.posInfos.map(function (_a, i) {\r\n var pos = _a.pos;\r\n var snapPos1 = minus(calculatePosition(allMatrix, isHorizontal ? [0, pos] : [pos, 0], n), [left, top]);\r\n var snapPos2 = minus(calculatePosition(allMatrix, isHorizontal ? [width, pos] : [pos, height], n), [left, top]);\r\n return renderLine(React, \"\", snapPos1, snapPos2, zoom, \"clip\".concat(directionType, \"snap\").concat(i), \"guideline\");\r\n })), false));\r\n }\r\n if (info.isBound) {\r\n lines.push.apply(lines, __spreadArray([], __read(info.bounds.map(function (_a, i) {\r\n var pos = _a.pos;\r\n var snapPos1 = minus(calculatePosition(allMatrix, isHorizontal ? [0, pos] : [pos, 0], n), [left, top]);\r\n var snapPos2 = minus(calculatePosition(allMatrix, isHorizontal ? [width, pos] : [pos, height], n), [left, top]);\r\n return renderLine(React, \"\", snapPos1, snapPos2, zoom, \"clip\".concat(directionType, \"bounds\").concat(i), \"guideline\", \"bounds\", \"bold\");\r\n })), false));\r\n }\r\n });\r\n }\r\n return __spreadArray(__spreadArray([], __read(controls), false), __read(lines), false);\r\n },\r\n dragControlCondition: function (moveable, e) {\r\n return e.inputEvent && (e.inputEvent.target.getAttribute(\"class\") || \"\").indexOf(\"clip\") > -1;\r\n },\r\n dragStart: function (moveable, e) {\r\n var props = moveable.props;\r\n var _a = props.dragWithClip, dragWithClip = _a === void 0 ? true : _a;\r\n if (dragWithClip) {\r\n return false;\r\n }\r\n return this.dragControlStart(moveable, e);\r\n },\r\n drag: function (moveable, e) {\r\n return this.dragControl(moveable, __assign(__assign({}, e), { isDragTarget: true }));\r\n },\r\n dragEnd: function (moveable, e) {\r\n return this.dragControlEnd(moveable, e);\r\n },\r\n dragControlStart: function (moveable, e) {\r\n var state = moveable.state;\r\n var _a = moveable.props, defaultClipPath = _a.defaultClipPath, customClipPath = _a.customClipPath;\r\n var target = state.target, width = state.width, height = state.height;\r\n var inputTarget = e.inputEvent ? e.inputEvent.target : null;\r\n var className = (inputTarget && inputTarget.getAttribute(\"class\")) || \"\";\r\n var datas = e.datas;\r\n var clipPath = getClipPath(target, width, height, defaultClipPath || \"inset\", customClipPath);\r\n if (!clipPath) {\r\n return false;\r\n }\r\n var clipText = clipPath.clipText, type = clipPath.type, poses = clipPath.poses;\r\n var result = triggerEvent(moveable, \"onClipStart\", fillParams(moveable, e, {\r\n clipType: type,\r\n clipStyle: clipText,\r\n poses: poses.map(function (pos) { return pos.pos; }),\r\n }));\r\n if (result === false) {\r\n datas.isClipStart = false;\r\n return false;\r\n }\r\n datas.isControl = className && className.indexOf(\"clip-control\") > -1;\r\n datas.isLine = className.indexOf(\"clip-line\") > -1;\r\n datas.isArea = className.indexOf(\"clip-area\") > -1 || className.indexOf(\"clip-ellipse\") > -1;\r\n datas.clipIndex = inputTarget ? parseInt(inputTarget.getAttribute(\"data-clip-index\"), 10) : -1;\r\n datas.clipPath = clipPath;\r\n datas.isClipStart = true;\r\n state.clipPathState = clipText;\r\n setDragStart(moveable, e);\r\n return true;\r\n },\r\n dragControl: function (moveable, e) {\r\n var _a, _b, _c;\r\n var datas = e.datas, originalDatas = e.originalDatas, isDragTarget = e.isDragTarget;\r\n if (!datas.isClipStart) {\r\n return false;\r\n }\r\n var _d = datas, isControl = _d.isControl, isLine = _d.isLine, isArea = _d.isArea, clipIndex = _d.clipIndex, clipPath = _d.clipPath;\r\n if (!clipPath) {\r\n return false;\r\n }\r\n var props = getProps(moveable.props, \"clippable\");\r\n var keepRatio = props.keepRatio;\r\n var distX = 0;\r\n var distY = 0;\r\n var originalDraggable = originalDatas.draggable;\r\n var originalDist = getDragDist(e);\r\n if (isDragTarget && originalDraggable) {\r\n _a = __read(originalDraggable.prevBeforeDist, 2), distX = _a[0], distY = _a[1];\r\n }\r\n else {\r\n _b = __read(originalDist, 2), distX = _b[0], distY = _b[1];\r\n }\r\n var firstDist = [distX, distY];\r\n var state = moveable.state;\r\n var width = state.width, height = state.height;\r\n var isDragWithTarget = !isArea && !isControl && !isLine;\r\n var clipType = clipPath.type, clipPoses = clipPath.poses, splitter = clipPath.splitter;\r\n var poses = clipPoses.map(function (pos) { return pos.pos; });\r\n if (isDragWithTarget) {\r\n distX = -distX;\r\n distY = -distY;\r\n }\r\n var isAll = !isControl || clipPoses[clipIndex].direction === \"nesw\";\r\n var isRect = clipType === \"inset\" || clipType === \"rect\";\r\n var dists = clipPoses.map(function () { return [0, 0]; });\r\n if (isControl && !isAll) {\r\n var _e = clipPoses[clipIndex], horizontal = _e.horizontal, vertical = _e.vertical;\r\n var dist = [\r\n distX * abs(horizontal),\r\n distY * abs(vertical),\r\n ];\r\n dists = moveControlPos(clipPoses, clipIndex, dist, isRect, keepRatio);\r\n }\r\n else if (isAll) {\r\n dists = poses.map(function () { return [distX, distY]; });\r\n }\r\n var nextPoses = poses.map(function (pos, i) { return plus(pos, dists[i]); });\r\n var guidePoses = __spreadArray([], __read(nextPoses), false);\r\n state.snapBoundInfos = null;\r\n var isCircle = clipPath.type === \"circle\";\r\n var isEllipse = clipPath.type === \"ellipse\";\r\n if (isCircle || isEllipse) {\r\n var guideRect = getRect(nextPoses);\r\n var ry = abs(guideRect.bottom - guideRect.top);\r\n var rx = abs(isEllipse ? guideRect.right - guideRect.left : ry);\r\n var bottom = nextPoses[0][1] + ry;\r\n var left = nextPoses[0][0] - rx;\r\n var right = nextPoses[0][0] + rx;\r\n // right\r\n if (isCircle) {\r\n guidePoses.push([right, guideRect.bottom]);\r\n dists.push([1, 0]);\r\n }\r\n // bottom\r\n guidePoses.push([guideRect.left, bottom]);\r\n dists.push([0, 1]);\r\n // left\r\n guidePoses.push([left, guideRect.bottom]);\r\n dists.push([1, 0]);\r\n }\r\n var guidelines = getDefaultGuidelines((props.clipHorizontalGuidelines || []).map(function (v) { return convertUnitSize(\"\".concat(v), height); }), (props.clipVerticalGuidelines || []).map(function (v) { return convertUnitSize(\"\".concat(v), width); }), width, height);\r\n var guideXPoses = [];\r\n var guideYPoses = [];\r\n if (isCircle || isEllipse) {\r\n guideXPoses = [guidePoses[4][0], guidePoses[2][0]];\r\n guideYPoses = [guidePoses[1][1], guidePoses[3][1]];\r\n }\r\n else if (isRect) {\r\n var rectPoses = [guidePoses[0], guidePoses[2], guidePoses[4], guidePoses[6]];\r\n var rectDists_1 = [dists[0], dists[2], dists[4], dists[6]];\r\n guideXPoses = rectPoses.filter(function (_, i) { return rectDists_1[i][0]; }).map(function (pos) { return pos[0]; });\r\n guideYPoses = rectPoses.filter(function (_, i) { return rectDists_1[i][1]; }).map(function (pos) { return pos[1]; });\r\n }\r\n else {\r\n guideXPoses = guidePoses.filter(function (_, i) { return dists[i][0]; }).map(function (pos) { return pos[0]; });\r\n guideYPoses = guidePoses.filter(function (_, i) { return dists[i][1]; }).map(function (pos) { return pos[1]; });\r\n }\r\n var boundDelta = [0, 0];\r\n var _f = checkSnapBounds(guidelines, props.clipTargetBounds && { left: 0, top: 0, right: width, bottom: height }, guideXPoses, guideYPoses, 5), horizontalSnapInfo = _f.horizontal, verticalSnapInfo = _f.vertical;\r\n var snapOffsetY = horizontalSnapInfo.offset;\r\n var snapOffsetX = verticalSnapInfo.offset;\r\n if (horizontalSnapInfo.isBound) {\r\n boundDelta[1] += snapOffsetY;\r\n }\r\n if (verticalSnapInfo.isBound) {\r\n boundDelta[0] += snapOffsetX;\r\n }\r\n if ((isEllipse || isCircle) && dists[0][0] === 0 && dists[0][1] === 0) {\r\n var guideRect = getRect(nextPoses);\r\n var cy = guideRect.bottom - guideRect.top;\r\n var cx = isEllipse ? guideRect.right - guideRect.left : cy;\r\n var distSnapX = verticalSnapInfo.isBound\r\n ? abs(snapOffsetX)\r\n : (verticalSnapInfo.snapIndex === 0 ? -snapOffsetX : snapOffsetX);\r\n var distSnapY = horizontalSnapInfo.isBound\r\n ? abs(snapOffsetY)\r\n : (horizontalSnapInfo.snapIndex === 0 ? -snapOffsetY : snapOffsetY);\r\n cx -= distSnapX;\r\n cy -= distSnapY;\r\n if (isCircle) {\r\n cy = checkSnapBoundPriority(verticalSnapInfo, horizontalSnapInfo) > 0 ? cy : cx;\r\n cx = cy;\r\n }\r\n var center = guidePoses[0];\r\n guidePoses[1][1] = center[1] - cy;\r\n guidePoses[2][0] = center[0] + cx;\r\n guidePoses[3][1] = center[1] + cy;\r\n guidePoses[4][0] = center[0] - cx;\r\n }\r\n else if (isRect && keepRatio && isControl) {\r\n var _g = __read(getControlSize(clipPoses), 2), width_1 = _g[0], height_1 = _g[1];\r\n var ratio = width_1 && height_1 ? width_1 / height_1 : 0;\r\n var clipPose = clipPoses[clipIndex];\r\n var direction = clipPose.direction || \"\";\r\n var top_2 = guidePoses[1][1];\r\n var bottom = guidePoses[5][1];\r\n var left = guidePoses[7][0];\r\n var right = guidePoses[3][0];\r\n if (abs(snapOffsetY) <= abs(snapOffsetX)) {\r\n snapOffsetY = sign(snapOffsetY) * abs(snapOffsetX) / ratio;\r\n }\r\n else {\r\n snapOffsetX = sign(snapOffsetX) * abs(snapOffsetY) * ratio;\r\n }\r\n if (direction.indexOf(\"w\") > -1) {\r\n left -= snapOffsetX;\r\n }\r\n else if (direction.indexOf(\"e\") > -1) {\r\n right -= snapOffsetX;\r\n }\r\n else {\r\n left += snapOffsetX / 2;\r\n right -= snapOffsetX / 2;\r\n }\r\n if (direction.indexOf(\"n\") > -1) {\r\n top_2 -= snapOffsetY;\r\n }\r\n else if (direction.indexOf(\"s\") > -1) {\r\n bottom -= snapOffsetY;\r\n }\r\n else {\r\n top_2 += snapOffsetY / 2;\r\n bottom -= snapOffsetY / 2;\r\n }\r\n var nextControlPoses_2 = getRectPoses(top_2, right, bottom, left);\r\n guidePoses.forEach(function (pos, i) {\r\n var _a;\r\n _a = __read(nextControlPoses_2[i].pos, 2), pos[0] = _a[0], pos[1] = _a[1];\r\n });\r\n }\r\n else {\r\n guidePoses.forEach(function (pos, j) {\r\n var dist = dists[j];\r\n if (dist[0]) {\r\n pos[0] -= snapOffsetX;\r\n }\r\n if (dist[1]) {\r\n pos[1] -= snapOffsetY;\r\n }\r\n });\r\n }\r\n var nextClipStyles = getClipStyles(moveable, clipPath, nextPoses);\r\n var clipStyle = \"\".concat(clipType, \"(\").concat(nextClipStyles.join(splitter), \")\");\r\n state.clipPathState = clipStyle;\r\n if (isCircle || isEllipse) {\r\n guideXPoses = [guidePoses[4][0], guidePoses[2][0]];\r\n guideYPoses = [guidePoses[1][1], guidePoses[3][1]];\r\n }\r\n else if (isRect) {\r\n var rectPoses = [guidePoses[0], guidePoses[2], guidePoses[4], guidePoses[6]];\r\n guideXPoses = rectPoses.map(function (pos) { return pos[0]; });\r\n guideYPoses = rectPoses.map(function (pos) { return pos[1]; });\r\n }\r\n else {\r\n guideXPoses = guidePoses.map(function (pos) { return pos[0]; });\r\n guideYPoses = guidePoses.map(function (pos) { return pos[1]; });\r\n }\r\n state.snapBoundInfos = checkSnapBounds(guidelines, props.clipTargetBounds && { left: 0, top: 0, right: width, bottom: height }, guideXPoses, guideYPoses, 1);\r\n if (originalDraggable) {\r\n var is3d = state.is3d, allMatrix = state.allMatrix;\r\n var n = is3d ? 4 : 3;\r\n var dragDist = boundDelta;\r\n if (isDragTarget) {\r\n dragDist = [\r\n firstDist[0] + boundDelta[0] - originalDist[0],\r\n firstDist[1] + boundDelta[1] - originalDist[1],\r\n ];\r\n }\r\n originalDraggable.deltaOffset = multiply(allMatrix, [dragDist[0], dragDist[1], 0, 0], n);\r\n }\r\n triggerEvent(moveable, \"onClip\", fillParams(moveable, e, __assign({ clipEventType: \"changed\", clipType: clipType, poses: nextPoses, clipStyle: clipStyle, clipStyles: nextClipStyles, distX: distX, distY: distY }, fillCSSObject((_c = {},\r\n _c[clipType === \"rect\" ? \"clip\" : \"clipPath\"] = clipStyle,\r\n _c), e))));\r\n return true;\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n this.unset(moveable);\r\n var isDrag = e.isDrag, datas = e.datas, isDouble = e.isDouble;\r\n var isLine = datas.isLine, isClipStart = datas.isClipStart, isControl = datas.isControl;\r\n if (!isClipStart) {\r\n return false;\r\n }\r\n triggerEvent(moveable, \"onClipEnd\", fillEndParams(moveable, e, {}));\r\n if (isDouble) {\r\n if (isControl) {\r\n removeClipPath(moveable, e);\r\n }\r\n else if (isLine) {\r\n // add\r\n addClipPath(moveable, e);\r\n }\r\n }\r\n return isDouble || isDrag;\r\n },\r\n unset: function (moveable) {\r\n moveable.state.clipPathState = \"\";\r\n moveable.state.snapBoundInfos = null;\r\n },\r\n};\r\n/**\r\n * Whether to clip the target. (default: false)\r\n * @name Moveable.Clippable#clippable\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * clippable: true,\r\n * defaultClipPath: \"inset\",\r\n * customClipPath: \"\",\r\n * clipRelative: false,\r\n * clipArea: false,\r\n * dragWithClip: true,\r\n * });\r\n * moveable.on(\"clipStart\", e => {\r\n * console.log(e);\r\n * }).on(\"clip\", e => {\r\n * if (e.clipType === \"rect\") {\r\n * e.target.style.clip = e.clipStyle;\r\n * } else {\r\n * e.target.style.clipPath = e.clipStyle;\r\n * }\r\n * }).on(\"clipEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * If clippath is not set, the default value can be set. (defaultClipPath < style < customClipPath < dragging clipPath)\r\n * @name Moveable.Clippable#defaultClipPath\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * clippable: true,\r\n * defaultClipPath: \"inset\",\r\n * customClipPath: \"\",\r\n * clipRelative: false,\r\n * clipArea: false,\r\n * dragWithClip: true,\r\n * });\r\n * moveable.on(\"clipStart\", e => {\r\n * console.log(e);\r\n * }).on(\"clip\", e => {\r\n * if (e.clipType === \"rect\") {\r\n * e.target.style.clip = e.clipStyle;\r\n * } else {\r\n * e.target.style.clipPath = e.clipStyle;\r\n * }\r\n * }).on(\"clipEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * % Can be used instead of the absolute px (`rect` not possible) (default: false)\r\n * @name Moveable.Clippable#clipRelative\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * clippable: true,\r\n * defaultClipPath: \"inset\",\r\n * customClipPath: \"\",\r\n * clipRelative: false,\r\n * clipArea: false,\r\n * dragWithClip: true,\r\n * });\r\n * moveable.on(\"clipStart\", e => {\r\n * console.log(e);\r\n * }).on(\"clip\", e => {\r\n * if (e.clipType === \"rect\") {\r\n * e.target.style.clip = e.clipStyle;\r\n * } else {\r\n * e.target.style.clipPath = e.clipStyle;\r\n * }\r\n * }).on(\"clipEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * You can force the custom clipPath. (defaultClipPath < style < customClipPath < dragging clipPath)\r\n * @name Moveable.Clippable#customClipPath\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * clippable: true,\r\n * defaultClipPath: \"inset\",\r\n * customClipPath: \"\",\r\n * clipRelative: false,\r\n * clipArea: false,\r\n * dragWithClip: true,\r\n * });\r\n * moveable.on(\"clipStart\", e => {\r\n * console.log(e);\r\n * }).on(\"clip\", e => {\r\n * if (e.clipType === \"rect\") {\r\n * e.target.style.clip = e.clipStyle;\r\n * } else {\r\n * e.target.style.clipPath = e.clipStyle;\r\n * }\r\n * }).on(\"clipEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * When dragging the target, the clip also moves. (default: true)\r\n * @name Moveable.Clippable#dragWithClip\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * clippable: true,\r\n * defaultClipPath: \"inset\",\r\n * customClipPath: \"\",\r\n * clipRelative: false,\r\n * clipArea: false,\r\n * dragWithClip: true,\r\n * });\r\n * moveable.on(\"clipStart\", e => {\r\n * console.log(e);\r\n * }).on(\"clip\", e => {\r\n * if (e.clipType === \"rect\") {\r\n * e.target.style.clip = e.clipStyle;\r\n * } else {\r\n * e.target.style.clipPath = e.clipStyle;\r\n * }\r\n * }).on(\"clipEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * You can drag the clip by setting clipArea.\r\n * @name Moveable.Clippable#clipArea\r\n * @default false\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * clippable: true,\r\n * defaultClipPath: \"inset\",\r\n * customClipPath: \"\",\r\n * clipRelative: false,\r\n * clipArea: false,\r\n * dragWithClip: true,\r\n * });\r\n * moveable.on(\"clipStart\", e => {\r\n * console.log(e);\r\n * }).on(\"clip\", e => {\r\n * if (e.clipType === \"rect\") {\r\n * e.target.style.clip = e.clipStyle;\r\n * } else {\r\n * e.target.style.clipPath = e.clipStyle;\r\n * }\r\n * }).on(\"clipEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n* Whether the clip is bound to the target.\r\n* @name Moveable.Clippable#clipTargetBounds\r\n* @default false\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* clippable: true,\r\n* defaultClipPath: \"inset\",\r\n* customClipPath: \"\",\r\n* clipRelative: false,\r\n* clipArea: false,\r\n* dragWithClip: true,\r\n* clipTargetBounds: true,\r\n* });\r\n* moveable.on(\"clipStart\", e => {\r\n* console.log(e);\r\n* }).on(\"clip\", e => {\r\n* if (e.clipType === \"rect\") {\r\n* e.target.style.clip = e.clipStyle;\r\n* } else {\r\n* e.target.style.clipPath = e.clipStyle;\r\n* }\r\n* }).on(\"clipEnd\", e => {\r\n* console.log(e);\r\n* });\r\n*/\r\n/**\r\n * Add clip guidelines in the vertical direction.\r\n * @name Moveable.Clippable#clipVerticalGuidelines\r\n * @default 0\r\n * @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* clippable: true,\r\n* defaultClipPath: \"inset\",\r\n* customClipPath: \"\",\r\n* clipRelative: false,\r\n* clipArea: false,\r\n* dragWithClip: true,\r\n* clipVerticalGuidelines: [0, 100, 200],\r\n* clipHorizontalGuidelines: [0, 100, 200],\r\n* clipSnapThreshold: 5,\r\n* });\r\n*/\r\n/**\r\n* Add clip guidelines in the horizontal direction.\r\n* @name Moveable.Clippable#clipHorizontalGuidelines\r\n* @default []\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* clippable: true,\r\n* defaultClipPath: \"inset\",\r\n* customClipPath: \"\",\r\n* clipRelative: false,\r\n* clipArea: false,\r\n* dragWithClip: true,\r\n* clipVerticalGuidelines: [0, 100, 200],\r\n* clipHorizontalGuidelines: [0, 100, 200],\r\n* clipSnapThreshold: 5,\r\n* });\r\n*/\r\n/**\r\n* istance value that can snap to clip guidelines.\r\n* @name Moveable.Clippable#clipSnapThreshold\r\n* @default 5\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* clippable: true,\r\n* defaultClipPath: \"inset\",\r\n* customClipPath: \"\",\r\n* clipRelative: false,\r\n* clipArea: false,\r\n* dragWithClip: true,\r\n* clipVerticalGuidelines: [0, 100, 200],\r\n* clipHorizontalGuidelines: [0, 100, 200],\r\n* clipSnapThreshold: 5,\r\n* });\r\n*/\r\n/**\r\n * When drag start the clip area or controls, the `clipStart` event is called.\r\n * @memberof Moveable.Clippable\r\n * @event clipStart\r\n * @param {Moveable.Clippable.OnClipStart} - Parameters for the `clipStart` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * clippable: true,\r\n * defaultClipPath: \"inset\",\r\n * customClipPath: \"\",\r\n * clipRelative: false,\r\n * clipArea: false,\r\n * dragWithClip: true,\r\n * });\r\n * moveable.on(\"clipStart\", e => {\r\n * console.log(e);\r\n * }).on(\"clip\", e => {\r\n * if (e.clipType === \"rect\") {\r\n * e.target.style.clip = e.clipStyle;\r\n * } else {\r\n * e.target.style.clipPath = e.clipStyle;\r\n * }\r\n * }).on(\"clipEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * When drag the clip area or controls, the `clip` event is called.\r\n * @memberof Moveable.Clippable\r\n * @event clip\r\n * @param {Moveable.Clippable.OnClip} - Parameters for the `clip` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * clippable: true,\r\n * defaultClipPath: \"inset\",\r\n * customClipPath: \"\",\r\n * clipRelative: false,\r\n * clipArea: false,\r\n * dragWithClip: true,\r\n * });\r\n * moveable.on(\"clipStart\", e => {\r\n * console.log(e);\r\n * }).on(\"clip\", e => {\r\n * if (e.clipType === \"rect\") {\r\n * e.target.style.clip = e.clipStyle;\r\n * } else {\r\n * e.target.style.clipPath = e.clipStyle;\r\n * }\r\n * }).on(\"clipEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * When drag end the clip area or controls, the `clipEnd` event is called.\r\n * @memberof Moveable.Clippable\r\n * @event clipEnd\r\n * @param {Moveable.Clippable.OnClipEnd} - Parameters for the `clipEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * clippable: true,\r\n * defaultClipPath: \"inset\",\r\n * customClipPath: \"\",\r\n * clipRelative: false,\r\n * clipArea: false,\r\n * dragWithClip: true,\r\n * });\r\n * moveable.on(\"clipStart\", e => {\r\n * console.log(e);\r\n * }).on(\"clip\", e => {\r\n * if (e.clipType === \"rect\") {\r\n * e.target.style.clip = e.clipStyle;\r\n * } else {\r\n * e.target.style.clipPath = e.clipStyle;\r\n * }\r\n * }).on(\"clipEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\n\n/**\r\n * @namespace OriginDraggable\r\n * @memberof Moveable\r\n * @description Whether to drag origin (default: false)\r\n */\r\nvar OriginDraggable = {\r\n name: \"originDraggable\",\r\n props: [\r\n \"originDraggable\",\r\n \"originRelative\",\r\n ],\r\n events: [\r\n \"dragOriginStart\",\r\n \"dragOrigin\",\r\n \"dragOriginEnd\",\r\n ],\r\n css: [\r\n \":host[data-able-origindraggable] .control.origin {\\npointer-events: auto;\\n}\",\r\n ],\r\n dragControlCondition: function (_, e) {\r\n if (e.isRequest) {\r\n return e.requestAble === \"originDraggable\";\r\n }\r\n return hasClass(e.inputEvent.target, prefix(\"origin\"));\r\n },\r\n dragControlStart: function (moveable, e) {\r\n var datas = e.datas;\r\n setDragStart(moveable, e);\r\n var params = fillParams(moveable, e, {\r\n dragStart: Draggable.dragStart(moveable, new CustomGesto().dragStart([0, 0], e)),\r\n });\r\n var result = triggerEvent(moveable, \"onDragOriginStart\", params);\r\n datas.startOrigin = moveable.state.transformOrigin;\r\n datas.startTargetOrigin = moveable.state.targetOrigin;\r\n datas.prevOrigin = [0, 0];\r\n datas.isDragOrigin = true;\r\n if (result === false) {\r\n datas.isDragOrigin = false;\r\n return false;\r\n }\r\n return params;\r\n },\r\n dragControl: function (moveable, e) {\r\n var datas = e.datas, isPinch = e.isPinch, isRequest = e.isRequest;\r\n if (!datas.isDragOrigin) {\r\n return false;\r\n }\r\n var _a = __read(getDragDist(e), 2), distX = _a[0], distY = _a[1];\r\n var state = moveable.state;\r\n var width = state.width, height = state.height, offsetMatrix = state.offsetMatrix, targetMatrix = state.targetMatrix, is3d = state.is3d;\r\n var _b = moveable.props.originRelative, originRelative = _b === void 0 ? true : _b;\r\n var n = is3d ? 4 : 3;\r\n var dist = [distX, distY];\r\n if (isRequest) {\r\n var distOrigin = e.distOrigin;\r\n if (distOrigin[0] || distOrigin[1]) {\r\n dist = distOrigin;\r\n }\r\n }\r\n var origin = plus(datas.startOrigin, dist);\r\n var targetOrigin = plus(datas.startTargetOrigin, dist);\r\n var delta = minus(dist, datas.prevOrigin);\r\n var nextMatrix = getNextMatrix(offsetMatrix, targetMatrix, origin, n);\r\n var rect = moveable.getRect();\r\n var nextRect = getRect(calculatePoses(nextMatrix, width, height, n));\r\n var dragDelta = [\r\n rect.left - nextRect.left,\r\n rect.top - nextRect.top,\r\n ];\r\n datas.prevOrigin = dist;\r\n var transformOrigin = [\r\n convertCSSSize(targetOrigin[0], width, originRelative),\r\n convertCSSSize(targetOrigin[1], height, originRelative),\r\n ].join(\" \");\r\n var result = Draggable.drag(moveable, setCustomDrag(e, moveable.state, dragDelta, !!isPinch, false));\r\n var params = fillParams(moveable, e, __assign(__assign({ width: width, height: height, origin: origin, dist: dist, delta: delta, transformOrigin: transformOrigin, drag: result }, fillCSSObject({\r\n transformOrigin: transformOrigin,\r\n transform: result.transform,\r\n }, e)), { afterTransform: result.transform }));\r\n triggerEvent(moveable, \"onDragOrigin\", params);\r\n return params;\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n var datas = e.datas;\r\n if (!datas.isDragOrigin) {\r\n return false;\r\n }\r\n triggerEvent(moveable, \"onDragOriginEnd\", fillEndParams(moveable, e, {}));\r\n return true;\r\n },\r\n dragGroupControlCondition: function (moveable, e) {\r\n return this.dragControlCondition(moveable, e);\r\n },\r\n dragGroupControlStart: function (moveable, e) {\r\n var params = this.dragControlStart(moveable, e);\r\n if (!params) {\r\n return false;\r\n }\r\n return true;\r\n },\r\n dragGroupControl: function (moveable, e) {\r\n var params = this.dragControl(moveable, e);\r\n if (!params) {\r\n return false;\r\n }\r\n moveable.transformOrigin = params.transformOrigin;\r\n return true;\r\n },\r\n /**\r\n * @method Moveable.OriginDraggable#request\r\n * @param {object} e - the OriginDraggable's request parameter\r\n * @param {number} [e.x] - x position\r\n * @param {number} [e.y] - y position\r\n * @param {number} [e.deltaX] - x number to move\r\n * @param {number} [e.deltaY] - y number to move\r\n * @param {array} [e.deltaOrigin] - left, top number to move transform-origin\r\n * @param {array} [e.origin] - transform-origin position\r\n * @param {number} [e.isInstant] - Whether to execute the request instantly\r\n * @return {Moveable.Requester} Moveable Requester\r\n * @example\r\n\n * // Instantly Request (requestStart - request - requestEnd)\r\n * // Use Relative Value\r\n * moveable.request(\"originDraggable\", { deltaX: 10, deltaY: 10 }, true);\r\n * // Use Absolute Value\r\n * moveable.request(\"originDraggable\", { x: 200, y: 100 }, true);\r\n * // Use Transform Value\r\n * moveable.request(\"originDraggable\", { deltaOrigin: [10, 0] }, true);\r\n * moveable.request(\"originDraggable\", { origin: [100, 0] }, true);\r\n * // requestStart\r\n * const requester = moveable.request(\"originDraggable\");\r\n *\r\n * // request\r\n * // Use Relative Value\r\n * requester.request({ deltaX: 10, deltaY: 10 });\r\n * requester.request({ deltaX: 10, deltaY: 10 });\r\n * requester.request({ deltaX: 10, deltaY: 10 });\r\n * // Use Absolute Value\r\n * moveable.request(\"originDraggable\", { x: 200, y: 100 });\r\n * moveable.request(\"originDraggable\", { x: 220, y: 100 });\r\n * moveable.request(\"originDraggable\", { x: 240, y: 100 });\r\n *\r\n * // requestEnd\r\n * requester.requestEnd();\r\n */\r\n request: function (moveable) {\r\n var datas = {};\r\n var rect = moveable.getRect();\r\n var distX = 0;\r\n var distY = 0;\r\n var transformOrigin = rect.transformOrigin;\r\n var distOrigin = [0, 0];\r\n return {\r\n isControl: true,\r\n requestStart: function () {\r\n return { datas: datas };\r\n },\r\n request: function (e) {\r\n if (\"deltaOrigin\" in e) {\r\n distOrigin[0] += e.deltaOrigin[0];\r\n distOrigin[1] += e.deltaOrigin[1];\r\n }\r\n else if (\"origin\" in e) {\r\n distOrigin[0] = e.origin[0] - transformOrigin[0];\r\n distOrigin[1] = e.origin[1] - transformOrigin[1];\r\n }\r\n else {\r\n if (\"x\" in e) {\r\n distX = e.x - rect.left;\r\n }\r\n else if (\"deltaX\" in e) {\r\n distX += e.deltaX;\r\n }\r\n if (\"y\" in e) {\r\n distY = e.y - rect.top;\r\n }\r\n else if (\"deltaY\" in e) {\r\n distY += e.deltaY;\r\n }\r\n }\r\n return { datas: datas, distX: distX, distY: distY, distOrigin: distOrigin };\r\n },\r\n requestEnd: function () {\r\n return { datas: datas, isDrag: true };\r\n },\r\n };\r\n },\r\n};\r\n/**\r\n * Whether to drag origin (default: false)\r\n * @name Moveable.OriginDraggable#originDraggable\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * originDraggable: true,\r\n * });\r\n * let translate = [0, 0];\r\n * moveable.on(\"dragOriginStart\", e => {\r\n * e.dragStart && e.dragStart.set(translate);\r\n * }).on(\"dragOrigin\", e => {\r\n * translate = e.drag.beforeTranslate;\r\n * e.target.style.cssText\r\n * = `transform-origin: ${e.transformOrigin};`\r\n * + `transform: translate(${translate[0]}px, ${translate[1]}px)`;\r\n * }).on(\"dragOriginEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * % Can be used instead of the absolute px (default: true)\r\n * @name Moveable.OriginDraggable#originRelative\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * originDraggable: true,\r\n * originRelative: false,\r\n * });\r\n * moveable.originRelative = true;\r\n */\r\n/**\r\n* When drag start the origin, the `dragOriginStart` event is called.\r\n* @memberof Moveable.OriginDraggable\r\n* @event dragOriginStart\r\n* @param {Moveable.OriginDraggable.OnDragOriginStart} - Parameters for the `dragOriginStart` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* originDraggable: true,\r\n* });\r\n* let translate = [0, 0];\r\n* moveable.on(\"dragOriginStart\", e => {\r\n* e.dragStart && e.dragStart.set(translate);\r\n* }).on(\"dragOrigin\", e => {\r\n* translate = e.drag.beforeTranslate;\r\n* e.target.style.cssText\r\n* = `transform-origin: ${e.transformOrigin};`\r\n* + `transform: translate(${translate[0]}px, ${translate[1]}px)`;\r\n* }).on(\"dragOriginEnd\", e => {\r\n* console.log(e);\r\n* });\r\n*/\r\n/**\r\n* When drag the origin, the `dragOrigin` event is called.\r\n* @memberof Moveable.OriginDraggable\r\n* @event dragOrigin\r\n* @param {Moveable.OriginDraggable.OnDragOrigin} - Parameters for the `dragOrigin` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* originDraggable: true,\r\n* });\r\n* let translate = [0, 0];\r\n* moveable.on(\"dragOriginStart\", e => {\r\n* e.dragStart && e.dragStart.set(translate);\r\n* }).on(\"dragOrigin\", e => {\r\n* translate = e.drag.beforeTranslate;\r\n* e.target.style.cssText\r\n* = `transform-origin: ${e.transformOrigin};`\r\n* + `transform: translate(${translate[0]}px, ${translate[1]}px)`;\r\n* }).on(\"dragOriginEnd\", e => {\r\n* console.log(e);\r\n* });\r\n*/\r\n/**\r\n* When drag end the origin, the `dragOriginEnd` event is called.\r\n* @memberof Moveable.OriginDraggable\r\n* @event dragOriginEnd\r\n* @param {Moveable.OriginDraggable.OnDragOriginEnd} - Parameters for the `dragOriginEnd` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* originDraggable: true,\r\n* });\r\n* let translate = [0, 0];\r\n* moveable.on(\"dragOriginStart\", e => {\r\n* e.dragStart && e.dragStart.set(translate);\r\n* }).on(\"dragOrigin\", e => {\r\n* translate = e.drag.beforeTranslate;\r\n* e.target.style.cssText\r\n* = `transform-origin: ${e.transformOrigin};`\r\n* + `transform: translate(${translate[0]}px, ${translate[1]}px)`;\r\n* }).on(\"dragOriginEnd\", e => {\r\n* console.log(e);\r\n* });\r\n*/\n\nfunction addBorderRadiusByLine(controlPoses, lineIndex, distX, distY) {\r\n // lineIndex\r\n // 0 top\r\n // 1 right\r\n // 2 bottom\r\n // 3 left\r\n var horizontalsLength = controlPoses.filter(function (_a) {\r\n var virtual = _a.virtual, horizontal = _a.horizontal;\r\n return horizontal && !virtual;\r\n }).length;\r\n var verticalsLength = controlPoses.filter(function (_a) {\r\n var virtual = _a.virtual, vertical = _a.vertical;\r\n return vertical && !virtual;\r\n }).length;\r\n var controlIndex = -1;\r\n //top\r\n if (lineIndex === 0) {\r\n if (horizontalsLength === 0) {\r\n controlIndex = 0;\r\n }\r\n else if (horizontalsLength === 1) {\r\n controlIndex = 1;\r\n }\r\n }\r\n // bottom\r\n if (lineIndex === 2) {\r\n if (horizontalsLength <= 2) {\r\n controlIndex = 2;\r\n }\r\n else if (horizontalsLength <= 3) {\r\n controlIndex = 3;\r\n }\r\n }\r\n // left\r\n if (lineIndex === 3) {\r\n if (verticalsLength === 0) {\r\n controlIndex = 4;\r\n }\r\n else if (verticalsLength < 4) {\r\n controlIndex = 7;\r\n }\r\n }\r\n // right\r\n if (lineIndex === 1) {\r\n if (verticalsLength <= 1) {\r\n controlIndex = 5;\r\n }\r\n else if (verticalsLength <= 2) {\r\n controlIndex = 6;\r\n }\r\n }\r\n if (controlIndex === -1 || !controlPoses[controlIndex].virtual) {\r\n return;\r\n }\r\n var controlPoseInfo = controlPoses[controlIndex];\r\n addBorderRadius(controlPoses, controlIndex);\r\n if (controlIndex < 4) {\r\n controlPoseInfo.pos[0] = distX;\r\n }\r\n else {\r\n controlPoseInfo.pos[1] = distY;\r\n }\r\n}\r\nfunction addBorderRadius(controlPoses, index) {\r\n if (index < 4) {\r\n controlPoses.slice(0, index + 1).forEach(function (info) {\r\n info.virtual = false;\r\n });\r\n }\r\n else {\r\n if (controlPoses[0].virtual) {\r\n controlPoses[0].virtual = false;\r\n }\r\n controlPoses.slice(4, index + 1).forEach(function (info) {\r\n info.virtual = false;\r\n });\r\n }\r\n}\r\nfunction removeBorderRadius(controlPoses, index) {\r\n if (index < 4) {\r\n controlPoses.slice(index, 4).forEach(function (info) {\r\n info.virtual = true;\r\n });\r\n }\r\n else {\r\n controlPoses.slice(index).forEach(function (info) {\r\n info.virtual = true;\r\n });\r\n }\r\n}\r\nfunction getBorderRadius(borderRadius, width, height, minCounts, full) {\r\n if (minCounts === void 0) { minCounts = [0, 0]; }\r\n var values = [];\r\n if (!borderRadius || borderRadius === \"0px\") {\r\n values = [];\r\n }\r\n else {\r\n values = splitSpace(borderRadius);\r\n }\r\n return getRadiusValues(values, width, height, 0, 0, minCounts, full);\r\n}\r\nfunction triggerRoundEvent(moveable, e, dist, delta, nextPoses) {\r\n var state = moveable.state;\r\n var width = state.width, height = state.height;\r\n var _a = getRadiusStyles(nextPoses, moveable.props.roundRelative, width, height), raws = _a.raws, styles = _a.styles, radiusPoses = _a.radiusPoses;\r\n var _b = splitRadiusPoses(radiusPoses, raws), horizontals = _b.horizontals, verticals = _b.verticals;\r\n var borderRadius = styles.join(\" \");\r\n state.borderRadiusState = borderRadius;\r\n var params = fillParams(moveable, e, __assign({ horizontals: horizontals, verticals: verticals, borderRadius: borderRadius, width: width, height: height, delta: delta, dist: dist }, fillCSSObject({\r\n borderRadius: borderRadius,\r\n }, e)));\r\n triggerEvent(moveable, \"onRound\", params);\r\n return params;\r\n}\r\nfunction getStyleBorderRadius(moveable) {\r\n var _a, _b;\r\n var style = moveable.getState().style;\r\n var borderRadius = style.borderRadius || \"\";\r\n if (!borderRadius && moveable.props.groupable) {\r\n var firstMoveable = moveable.moveables[0];\r\n var firstTarget = moveable.getTargets()[0];\r\n if (firstTarget) {\r\n if ((firstMoveable === null || firstMoveable === void 0 ? void 0 : firstMoveable.props.target) === firstTarget) {\r\n borderRadius = (_b = (_a = moveable.moveables[0]) === null || _a === void 0 ? void 0 : _a.state.style.borderRadius) !== null && _b !== void 0 ? _b : \"\";\r\n style.borderRadius = borderRadius;\r\n }\r\n else {\r\n borderRadius = getComputedStyle(firstTarget).borderRadius;\r\n style.borderRadius = borderRadius;\r\n }\r\n }\r\n }\r\n return borderRadius;\r\n}\r\n/**\r\n * @namespace Moveable.Roundable\r\n * @description Whether to show and drag or double click border-radius\r\n */\r\nvar Roundable = {\r\n name: \"roundable\",\r\n props: [\r\n \"roundable\",\r\n \"roundRelative\",\r\n \"minRoundControls\",\r\n \"maxRoundControls\",\r\n \"roundClickable\",\r\n \"roundPadding\",\r\n \"isDisplayShadowRoundControls\",\r\n ],\r\n events: [\r\n \"roundStart\",\r\n \"round\",\r\n \"roundEnd\",\r\n \"roundGroupStart\",\r\n \"roundGroup\",\r\n \"roundGroupEnd\",\r\n ],\r\n css: [\r\n \".control.border-radius {\\nbackground: #d66;\\ncursor: pointer;\\nz-index: 3;\\n}\",\r\n \".control.border-radius.vertical {\\nbackground: #d6d;\\nz-index: 2;\\n}\",\r\n \".control.border-radius.virtual {\\nopacity: 0.5;\\nz-index: 1;\\n}\",\r\n \":host.round-line-clickable .line.direction {\\ncursor: pointer;\\n}\",\r\n ],\r\n className: function (moveable) {\r\n var roundClickable = moveable.props.roundClickable;\r\n return roundClickable === true || roundClickable === \"line\" ? prefix(\"round-line-clickable\") : \"\";\r\n },\r\n requestStyle: function () {\r\n return [\"borderRadius\"];\r\n },\r\n requestChildStyle: function () {\r\n return [\"borderRadius\"];\r\n },\r\n render: function (moveable, React) {\r\n var _a = moveable.getState(), target = _a.target, width = _a.width, height = _a.height, allMatrix = _a.allMatrix, is3d = _a.is3d, left = _a.left, top = _a.top, borderRadiusState = _a.borderRadiusState;\r\n var _b = moveable.props, _c = _b.minRoundControls, minRoundControls = _c === void 0 ? [0, 0] : _c, _d = _b.maxRoundControls, maxRoundControls = _d === void 0 ? [4, 4] : _d, zoom = _b.zoom, _e = _b.roundPadding, roundPadding = _e === void 0 ? 0 : _e, isDisplayShadowRoundControls = _b.isDisplayShadowRoundControls, groupable = _b.groupable;\r\n if (!target) {\r\n return null;\r\n }\r\n var borderRadius = borderRadiusState || getStyleBorderRadius(moveable);\r\n var n = is3d ? 4 : 3;\r\n var radiusValues = getBorderRadius(borderRadius, width, height, minRoundControls, true);\r\n if (!radiusValues) {\r\n return null;\r\n }\r\n var verticalCount = 0;\r\n var horizontalCount = 0;\r\n var basePos = groupable ? [0, 0] : [left, top];\r\n return radiusValues.map(function (v, i) {\r\n var horizontal = v.horizontal;\r\n var vertical = v.vertical;\r\n var direction = v.direction || \"\";\r\n var originalPos = __spreadArray([], __read(v.pos), false);\r\n horizontalCount += Math.abs(horizontal);\r\n verticalCount += Math.abs(vertical);\r\n if (horizontal && direction.indexOf(\"n\") > -1) {\r\n originalPos[1] -= roundPadding;\r\n }\r\n if (vertical && direction.indexOf(\"w\") > -1) {\r\n originalPos[0] -= roundPadding;\r\n }\r\n if (horizontal && direction.indexOf(\"s\") > -1) {\r\n originalPos[1] += roundPadding;\r\n }\r\n if (vertical && direction.indexOf(\"e\") > -1) {\r\n originalPos[0] += roundPadding;\r\n }\r\n var pos = minus(calculatePosition(allMatrix, originalPos, n), basePos);\r\n var isDisplayVerticalShadow = isDisplayShadowRoundControls\r\n && isDisplayShadowRoundControls !== \"horizontal\";\r\n var isDisplay = v.vertical\r\n ? verticalCount <= maxRoundControls[1] && (isDisplayVerticalShadow || !v.virtual)\r\n : horizontalCount <= maxRoundControls[0] && (isDisplayShadowRoundControls || !v.virtual);\r\n return React.createElement(\"div\", { key: \"borderRadiusControl\".concat(i), className: prefix(\"control\", \"border-radius\", v.vertical ? \"vertical\" : \"\", v.virtual ? \"virtual\" : \"\"), \"data-radius-index\": i, style: {\r\n display: isDisplay ? \"block\" : \"none\",\r\n transform: \"translate(\".concat(pos[0], \"px, \").concat(pos[1], \"px) scale(\").concat(zoom, \")\"),\r\n } });\r\n });\r\n },\r\n dragControlCondition: function (moveable, e) {\r\n if (!e.inputEvent || e.isRequest) {\r\n return false;\r\n }\r\n var className = (e.inputEvent.target.getAttribute(\"class\") || \"\");\r\n return className.indexOf(\"border-radius\") > -1\r\n || (className.indexOf(\"moveable-line\") > -1 && className.indexOf(\"moveable-direction\") > -1);\r\n },\r\n dragGroupControlCondition: function (moveable, e) {\r\n return this.dragControlCondition(moveable, e);\r\n },\r\n dragControlStart: function (moveable, e) {\r\n var inputEvent = e.inputEvent, datas = e.datas;\r\n var inputTarget = inputEvent.target;\r\n var className = (inputTarget.getAttribute(\"class\") || \"\");\r\n var isControl = className.indexOf(\"border-radius\") > -1;\r\n var isLine = className.indexOf(\"moveable-line\") > -1 && className.indexOf(\"moveable-direction\") > -1;\r\n var controlIndex = isControl ? parseInt(inputTarget.getAttribute(\"data-radius-index\"), 10) : -1;\r\n var lineIndex = -1;\r\n if (isLine) {\r\n var indexAttr = inputTarget.getAttribute(\"data-line-key\") || \"\";\r\n if (indexAttr) {\r\n lineIndex = parseInt(indexAttr.replace(/render-line-/g, \"\"), 10);\r\n if (isNaN(lineIndex)) {\r\n lineIndex = -1;\r\n }\r\n }\r\n }\r\n if (!isControl && !isLine) {\r\n return false;\r\n }\r\n var params = fillParams(moveable, e, {});\r\n var result = triggerEvent(moveable, \"onRoundStart\", params);\r\n if (result === false) {\r\n return false;\r\n }\r\n datas.lineIndex = lineIndex;\r\n datas.controlIndex = controlIndex;\r\n datas.isControl = isControl;\r\n datas.isLine = isLine;\r\n setDragStart(moveable, e);\r\n var _a = moveable.props, roundRelative = _a.roundRelative, _b = _a.minRoundControls, minRoundControls = _b === void 0 ? [0, 0] : _b;\r\n var state = moveable.state;\r\n var width = state.width, height = state.height;\r\n datas.isRound = true;\r\n datas.prevDist = [0, 0];\r\n var borderRadius = getStyleBorderRadius(moveable);\r\n var controlPoses = getBorderRadius(borderRadius || \"\", width, height, minRoundControls, true) || [];\r\n datas.controlPoses = controlPoses;\r\n state.borderRadiusState = getRadiusStyles(controlPoses, roundRelative, width, height).styles.join(\" \");\r\n return params;\r\n },\r\n dragControl: function (moveable, e) {\r\n var datas = e.datas;\r\n var controlPoses = datas.controlPoses;\r\n if (!datas.isRound || !datas.isControl || !controlPoses.length) {\r\n return false;\r\n }\r\n var index = datas.controlIndex;\r\n var _a = __read(getDragDist(e), 2), distX = _a[0], distY = _a[1];\r\n var dist = [distX, distY];\r\n var delta = minus(dist, datas.prevDist);\r\n var _b = moveable.props.maxRoundControls, maxRoundControls = _b === void 0 ? [4, 4] : _b;\r\n var _c = moveable.state, width = _c.width, height = _c.height;\r\n var selectedControlPose = controlPoses[index];\r\n var selectedVertical = selectedControlPose.vertical;\r\n var selectedHorizontal = selectedControlPose.horizontal;\r\n // 0: [0, 1, 2, 3] maxCount === 1\r\n // 0: [0, 2] maxCount === 2\r\n // 1: [1, 3] maxCount === 2\r\n // 0: [0] maxCount === 3\r\n // 1: [1, 3] maxCount === 3\r\n var dists = controlPoses.map(function (pose) {\r\n var horizontal = pose.horizontal, vertical = pose.vertical;\r\n var poseDist = [\r\n horizontal * selectedHorizontal * dist[0],\r\n vertical * selectedVertical * dist[1],\r\n ];\r\n if (horizontal) {\r\n if (maxRoundControls[0] === 1) {\r\n return poseDist;\r\n }\r\n else if (maxRoundControls[0] < 4 && horizontal !== selectedHorizontal) {\r\n return poseDist;\r\n }\r\n }\r\n else if (maxRoundControls[1] === 0) {\r\n poseDist[1] = vertical * selectedHorizontal * dist[0] / width * height;\r\n return poseDist;\r\n }\r\n else if (selectedVertical) {\r\n if (maxRoundControls[1] === 1) {\r\n return poseDist;\r\n }\r\n else if (maxRoundControls[1] < 4 && vertical !== selectedVertical) {\r\n return poseDist;\r\n }\r\n }\r\n return [0, 0];\r\n });\r\n dists[index] = dist;\r\n var nextPoses = controlPoses.map(function (info, i) {\r\n return __assign(__assign({}, info), { pos: plus(info.pos, dists[i]) });\r\n });\r\n if (index < 4) {\r\n nextPoses.slice(0, index + 1).forEach(function (info) {\r\n info.virtual = false;\r\n });\r\n }\r\n else {\r\n nextPoses.slice(4, index + 1).forEach(function (info) {\r\n info.virtual = false;\r\n });\r\n }\r\n datas.prevDist = [distX, distY];\r\n return triggerRoundEvent(moveable, e, dist, delta, nextPoses);\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n var state = moveable.state;\r\n state.borderRadiusState = \"\";\r\n var datas = e.datas, isDouble = e.isDouble;\r\n if (!datas.isRound) {\r\n return false;\r\n }\r\n var isControl = datas.isControl, controlIndex = datas.controlIndex, isLine = datas.isLine, lineIndex = datas.lineIndex;\r\n var controlPoses = datas.controlPoses;\r\n var length = controlPoses.filter(function (_a) {\r\n var virtual = _a.virtual;\r\n return virtual;\r\n }).length;\r\n var _a = moveable.props.roundClickable, roundClickable = _a === void 0 ? true : _a;\r\n if (isDouble && roundClickable) {\r\n if (isControl && (roundClickable === true || roundClickable === \"control\")) {\r\n removeBorderRadius(controlPoses, controlIndex);\r\n }\r\n else if (isLine && (roundClickable === true || roundClickable === \"line\")) {\r\n var _b = __read(calculatePointerDist(moveable, e), 2), distX = _b[0], distY = _b[1];\r\n addBorderRadiusByLine(controlPoses, lineIndex, distX, distY);\r\n }\r\n if (length !== controlPoses.filter(function (_a) {\r\n var virtual = _a.virtual;\r\n return virtual;\r\n }).length) {\r\n triggerRoundEvent(moveable, e, [0, 0], [0, 0], controlPoses);\r\n }\r\n }\r\n var params = fillEndParams(moveable, e, {});\r\n triggerEvent(moveable, \"onRoundEnd\", params);\r\n state.borderRadiusState = \"\";\r\n return params;\r\n },\r\n dragGroupControlStart: function (moveable, e) {\r\n var result = this.dragControlStart(moveable, e);\r\n if (!result) {\r\n return false;\r\n }\r\n var moveables = moveable.moveables;\r\n var targets = moveable.props.targets;\r\n var events = fillChildEvents(moveable, \"roundable\", e);\r\n var nextParams = __assign({ targets: moveable.props.targets, events: events.map(function (ev, i) {\r\n return __assign(__assign({}, ev), { target: targets[i], moveable: moveables[i], currentTarget: moveables[i] });\r\n }) }, result);\r\n triggerEvent(moveable, \"onRoundGroupStart\", nextParams);\r\n return result;\r\n },\r\n dragGroupControl: function (moveable, e) {\r\n var result = this.dragControl(moveable, e);\r\n if (!result) {\r\n return false;\r\n }\r\n var moveables = moveable.moveables;\r\n var targets = moveable.props.targets;\r\n var events = fillChildEvents(moveable, \"roundable\", e);\r\n var nextParams = __assign({ targets: moveable.props.targets, events: events.map(function (ev, i) {\r\n return __assign(__assign(__assign({}, ev), { target: targets[i], moveable: moveables[i], currentTarget: moveables[i] }), fillCSSObject({\r\n borderRadius: result.borderRadius,\r\n }, ev));\r\n }) }, result);\r\n triggerEvent(moveable, \"onRoundGroup\", nextParams);\r\n return nextParams;\r\n },\r\n dragGroupControlEnd: function (moveable, e) {\r\n var moveables = moveable.moveables;\r\n var targets = moveable.props.targets;\r\n var events = fillChildEvents(moveable, \"roundable\", e);\r\n catchEvent(moveable, \"onRound\", function (parentEvent) {\r\n var nextParams = __assign({ targets: moveable.props.targets, events: events.map(function (ev, i) {\r\n return __assign(__assign(__assign({}, ev), { target: targets[i], moveable: moveables[i], currentTarget: moveables[i] }), fillCSSObject({\r\n borderRadius: parentEvent.borderRadius,\r\n }, ev));\r\n }) }, parentEvent);\r\n triggerEvent(moveable, \"onRoundGroup\", nextParams);\r\n });\r\n var result = this.dragControlEnd(moveable, e);\r\n if (!result) {\r\n return false;\r\n }\r\n var nextParams = __assign({ targets: moveable.props.targets, events: events.map(function (ev, i) {\r\n var _a;\r\n return __assign(__assign({}, ev), { target: targets[i], moveable: moveables[i], currentTarget: moveables[i], lastEvent: (_a = ev.datas) === null || _a === void 0 ? void 0 : _a.lastEvent });\r\n }) }, result);\r\n triggerEvent(moveable, \"onRoundGroupEnd\", nextParams);\r\n return nextParams;\r\n },\r\n unset: function (moveable) {\r\n moveable.state.borderRadiusState = \"\";\r\n },\r\n};\r\n/**\r\n * Whether to show and drag or double click border-radius, (default: false)\r\n * @name Moveable.Roundable#roundable\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * roundRelative: false,\r\n * });\r\n * moveable.on(\"roundStart\", e => {\r\n * console.log(e);\r\n * }).on(\"round\", e => {\r\n * e.target.style.borderRadius = e.borderRadius;\r\n * }).on(\"roundEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * % Can be used instead of the absolute px\r\n * @name Moveable.Roundable#roundRelative\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * roundRelative: false,\r\n * });\r\n * moveable.on(\"roundStart\", e => {\r\n * console.log(e);\r\n * }).on(\"round\", e => {\r\n * e.target.style.borderRadius = e.borderRadius;\r\n * }).on(\"roundEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * Minimum number of round controls. It moves in proportion by control. [horizontal, vertical] (default: [0, 0])\r\n * @name Moveable.Roundable#minRoundControls\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * roundRelative: false,\r\n * minRoundControls: [0, 0],\r\n * });\r\n * moveable.minRoundControls = [1, 0];\r\n */\r\n/**\r\n * Maximum number of round controls. It moves in proportion by control. [horizontal, vertical] (default: [4, 4])\r\n * @name Moveable.Roundable#maxRoundControls\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * roundRelative: false,\r\n * maxRoundControls: [4, 4],\r\n * });\r\n * moveable.maxRoundControls = [1, 0];\r\n */\r\n/**\r\n * Whether you can add/delete round controls by double-clicking a line or control.\r\n * @name Moveable.Roundable#roundClickable\r\n * @default true\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * roundRelative: false,\r\n * roundClickable: true,\r\n * });\r\n * moveable.roundClickable = false;\r\n */\r\n/**\r\n * Whether to show a round control that does not actually exist as a shadow\r\n * @name Moveable.Roundable#isDisplayShadowRoundControls\r\n * @default false\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * isDisplayShadowRoundControls: false,\r\n * });\r\n * moveable.isDisplayShadowRoundControls = true;\r\n */\r\n/**\r\n * The padding value of the position of the round control\r\n * @name Moveable.Roundable#roundPadding\r\n * @default false\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * roundPadding: 0,\r\n * });\r\n * moveable.roundPadding = 15;\r\n */\r\n/**\r\n * When drag start the clip area or controls, the `roundStart` event is called.\r\n * @memberof Moveable.Roundable\r\n * @event roundStart\r\n * @param {Moveable.Roundable.OnRoundStart} - Parameters for the `roundStart` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * roundRelative: false,\r\n * });\r\n * moveable.on(\"roundStart\", e => {\r\n * console.log(e);\r\n * }).on(\"round\", e => {\r\n * e.target.style.borderRadius = e.borderRadius;\r\n * }).on(\"roundEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * When drag or double click the border area or controls, the `round` event is called.\r\n * @memberof Moveable.Roundable\r\n * @event round\r\n * @param {Moveable.Roundable.OnRound} - Parameters for the `round` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * roundRelative: false,\r\n * });\r\n * moveable.on(\"roundStart\", e => {\r\n * console.log(e);\r\n * }).on(\"round\", e => {\r\n * e.target.style.borderRadius = e.borderRadius;\r\n * }).on(\"roundEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * When drag end the border area or controls, the `roundEnd` event is called.\r\n * @memberof Moveable.Roundable\r\n * @event roundEnd\r\n * @param {Moveable.Roundable.onRoundEnd} - Parameters for the `roundEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * roundRelative: false,\r\n * });\r\n * moveable.on(\"roundStart\", e => {\r\n * console.log(e);\r\n * }).on(\"round\", e => {\r\n * e.target.style.borderRadius = e.borderRadius;\r\n * }).on(\"roundEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * When drag start the clip area or controls, the `roundGroupStart` event is called.\r\n * @memberof Moveable.Roundable\r\n * @event roundGroupStart\r\n * @param {Moveable.Roundable.OnRoundGroupStart} - Parameters for the `roundGroupStart` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * targets: [target1, target2, target3],\r\n * roundable: true,\r\n * });\r\n * moveable.on(\"roundGroupStart\", e => {\r\n * console.log(e.targets);\r\n * }).on(\"roundGroup\", e => {\r\n * e.events.forEach(ev => {\r\n * ev.target.style.cssText += ev.cssText;\r\n * });\r\n * }).on(\"roundGroupEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * When drag or double click the border area or controls, the `roundGroup` event is called.\r\n * @memberof Moveable.Roundable\r\n * @event roundGroup\r\n * @param {Moveable.Roundable.OnRoundGroup} - Parameters for the `roundGroup` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * targets: [target1, target2, target3],\r\n * roundable: true,\r\n * });\r\n * moveable.on(\"roundGroupStart\", e => {\r\n * console.log(e.targets);\r\n * }).on(\"roundGroup\", e => {\r\n * e.events.forEach(ev => {\r\n * ev.target.style.cssText += ev.cssText;\r\n * });\r\n * }).on(\"roundGroupEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * When drag end the border area or controls, the `roundGroupEnd` event is called.\r\n * @memberof Moveable.Roundable\r\n * @event roundGroupEnd\r\n * @param {Moveable.Roundable.onRoundGroupEnd} - Parameters for the `roundGroupEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * targets: [target1, target2, target3],\r\n * roundable: true,\r\n * });\r\n * moveable.on(\"roundGroupStart\", e => {\r\n * console.log(e.targets);\r\n * }).on(\"roundGroup\", e => {\r\n * e.events.forEach(ev => {\r\n * ev.target.style.cssText += ev.cssText;\r\n * });\r\n * }).on(\"roundGroupEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\n\nfunction isIdentityMatrix(matrix, is3d) {\r\n var n = is3d ? 4 : 3;\r\n var identityMatrix = createIdentityMatrix(n);\r\n var value = \"matrix\".concat(is3d ? \"3d\" : \"\", \"(\").concat(identityMatrix.join(\",\"), \")\");\r\n return matrix === value || matrix === \"matrix(1,0,0,1,0,0)\";\r\n}\r\nvar BeforeRenderable = {\r\n isPinch: true,\r\n name: \"beforeRenderable\",\r\n props: [],\r\n events: [\r\n \"beforeRenderStart\",\r\n \"beforeRender\",\r\n \"beforeRenderEnd\",\r\n \"beforeRenderGroupStart\",\r\n \"beforeRenderGroup\",\r\n \"beforeRenderGroupEnd\",\r\n ],\r\n dragRelation: \"weak\",\r\n setTransform: function (moveable, e) {\r\n var _a = moveable.state, is3d = _a.is3d, targetMatrix = _a.targetMatrix, inlineTransform = _a.inlineTransform;\r\n var cssMatrix = is3d\r\n ? \"matrix3d(\".concat(targetMatrix.join(\",\"), \")\")\r\n : \"matrix(\".concat(convertMatrixtoCSS(targetMatrix, true), \")\");\r\n var startTransform = !inlineTransform || inlineTransform === \"none\" ? cssMatrix : inlineTransform;\r\n e.datas.startTransforms = isIdentityMatrix(startTransform, is3d) ? [] : splitSpace(startTransform);\r\n },\r\n resetStyle: function (e) {\r\n var datas = e.datas;\r\n datas.nextStyle = {};\r\n datas.nextTransforms = e.datas.startTransforms;\r\n datas.nextTransformAppendedIndexes = [];\r\n },\r\n fillDragStartParams: function (moveable, e) {\r\n return fillParams(moveable, e, {\r\n setTransform: function (transform) {\r\n e.datas.startTransforms = isArray(transform) ? transform : splitSpace(transform);\r\n },\r\n isPinch: !!e.isPinch,\r\n });\r\n },\r\n fillDragParams: function (moveable, e) {\r\n return fillParams(moveable, e, {\r\n isPinch: !!e.isPinch,\r\n });\r\n },\r\n dragStart: function (moveable, e) {\r\n this.setTransform(moveable, e);\r\n this.resetStyle(e);\r\n triggerEvent(moveable, \"onBeforeRenderStart\", this.fillDragStartParams(moveable, e));\r\n },\r\n drag: function (moveable, e) {\r\n if (!e.datas.startTransforms) {\r\n this.setTransform(moveable, e);\r\n }\r\n this.resetStyle(e);\r\n triggerEvent(moveable, \"onBeforeRender\", fillParams(moveable, e, {\r\n isPinch: !!e.isPinch,\r\n }));\r\n },\r\n dragEnd: function (moveable, e) {\r\n if (!e.datas.startTransforms) {\r\n this.setTransform(moveable, e);\r\n this.resetStyle(e);\r\n }\r\n triggerEvent(moveable, \"onBeforeRenderEnd\", fillParams(moveable, e, {\r\n isPinch: !!e.isPinch,\r\n isDrag: e.isDrag,\r\n }));\r\n },\r\n dragGroupStart: function (moveable, e) {\r\n var _this = this;\r\n this.dragStart(moveable, e);\r\n var events = fillChildEvents(moveable, \"beforeRenderable\", e);\r\n var moveables = moveable.moveables;\r\n var params = events.map(function (childEvent, i) {\r\n var childMoveable = moveables[i];\r\n _this.setTransform(childMoveable, childEvent);\r\n _this.resetStyle(childEvent);\r\n return _this.fillDragStartParams(childMoveable, childEvent);\r\n });\r\n triggerEvent(moveable, \"onBeforeRenderGroupStart\", fillParams(moveable, e, {\r\n isPinch: !!e.isPinch,\r\n targets: moveable.props.targets,\r\n setTransform: function () { },\r\n events: params,\r\n }));\r\n },\r\n dragGroup: function (moveable, e) {\r\n var _this = this;\r\n this.drag(moveable, e);\r\n var events = fillChildEvents(moveable, \"beforeRenderable\", e);\r\n var moveables = moveable.moveables;\r\n var params = events.map(function (childEvent, i) {\r\n var childMoveable = moveables[i];\r\n _this.resetStyle(childEvent);\r\n return _this.fillDragParams(childMoveable, childEvent);\r\n });\r\n triggerEvent(moveable, \"onBeforeRenderGroup\", fillParams(moveable, e, {\r\n isPinch: !!e.isPinch,\r\n targets: moveable.props.targets,\r\n events: params,\r\n }));\r\n },\r\n dragGroupEnd: function (moveable, e) {\r\n this.dragEnd(moveable, e);\r\n triggerEvent(moveable, \"onBeforeRenderGroupEnd\", fillParams(moveable, e, {\r\n isPinch: !!e.isPinch,\r\n isDrag: e.isDrag,\r\n targets: moveable.props.targets,\r\n }));\r\n },\r\n dragControlStart: function (moveable, e) {\r\n return this.dragStart(moveable, e);\r\n },\r\n dragControl: function (moveable, e) {\r\n return this.drag(moveable, e);\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n return this.dragEnd(moveable, e);\r\n },\r\n dragGroupControlStart: function (moveable, e) {\r\n return this.dragGroupStart(moveable, e);\r\n },\r\n dragGroupControl: function (moveable, e) {\r\n return this.dragGroup(moveable, e);\r\n },\r\n dragGroupControlEnd: function (moveable, e) {\r\n return this.dragGroupEnd(moveable, e);\r\n },\r\n};\n\nvar Renderable = {\r\n name: \"renderable\",\r\n props: [],\r\n events: [\r\n \"renderStart\",\r\n \"render\",\r\n \"renderEnd\",\r\n \"renderGroupStart\",\r\n \"renderGroup\",\r\n \"renderGroupEnd\",\r\n ],\r\n dragRelation: \"weak\",\r\n dragStart: function (moveable, e) {\r\n triggerEvent(moveable, \"onRenderStart\", fillParams(moveable, e, {\r\n isPinch: !!e.isPinch,\r\n }));\r\n },\r\n drag: function (moveable, e) {\r\n triggerEvent(moveable, \"onRender\", this.fillDragParams(moveable, e));\r\n },\r\n dragAfter: function (moveable, e) {\r\n return this.drag(moveable, e);\r\n },\r\n dragEnd: function (moveable, e) {\r\n triggerEvent(moveable, \"onRenderEnd\", this.fillDragEndParams(moveable, e));\r\n },\r\n dragGroupStart: function (moveable, e) {\r\n triggerEvent(moveable, \"onRenderGroupStart\", fillParams(moveable, e, {\r\n isPinch: !!e.isPinch,\r\n targets: moveable.props.targets,\r\n }));\r\n },\r\n dragGroup: function (moveable, e) {\r\n var _this = this;\r\n var events = fillChildEvents(moveable, \"beforeRenderable\", e);\r\n var moveables = moveable.moveables;\r\n var params = events.map(function (childEvent, i) {\r\n var childMoveable = moveables[i];\r\n return _this.fillDragParams(childMoveable, childEvent);\r\n });\r\n triggerEvent(moveable, \"onRenderGroup\", fillParams(moveable, e, __assign(__assign({ isPinch: !!e.isPinch, targets: moveable.props.targets, transform: getNextTransformText(e), transformObject: {} }, fillCSSObject(getNextStyle(e))), { events: params })));\r\n },\r\n dragGroupEnd: function (moveable, e) {\r\n var _this = this;\r\n var events = fillChildEvents(moveable, \"beforeRenderable\", e);\r\n var moveables = moveable.moveables;\r\n var params = events.map(function (childEvent, i) {\r\n var childMoveable = moveables[i];\r\n return _this.fillDragEndParams(childMoveable, childEvent);\r\n });\r\n triggerEvent(moveable, \"onRenderGroupEnd\", fillParams(moveable, e, __assign({ isPinch: !!e.isPinch, isDrag: e.isDrag, targets: moveable.props.targets, events: params, transformObject: {}, transform: getNextTransformText(e) }, fillCSSObject(getNextStyle(e)))));\r\n },\r\n dragControlStart: function (moveable, e) {\r\n return this.dragStart(moveable, e);\r\n },\r\n dragControl: function (moveable, e) {\r\n return this.drag(moveable, e);\r\n },\r\n dragControlAfter: function (moveable, e) {\r\n return this.dragAfter(moveable, e);\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n return this.dragEnd(moveable, e);\r\n },\r\n dragGroupControlStart: function (moveable, e) {\r\n return this.dragGroupStart(moveable, e);\r\n },\r\n dragGroupControl: function (moveable, e) {\r\n return this.dragGroup(moveable, e);\r\n },\r\n dragGroupControlEnd: function (moveable, e) {\r\n return this.dragGroupEnd(moveable, e);\r\n },\r\n fillDragParams: function (moveable, e) {\r\n var transformObject = {};\r\n parse(getNextTransforms(e) || []).forEach(function (matrixInfo) {\r\n transformObject[matrixInfo.name] = matrixInfo.functionValue;\r\n });\r\n return fillParams(moveable, e, __assign({ isPinch: !!e.isPinch, transformObject: transformObject, transform: getNextTransformText(e) }, fillCSSObject(getNextStyle(e))));\r\n },\r\n fillDragEndParams: function (moveable, e) {\r\n var transformObject = {};\r\n parse(getNextTransforms(e) || []).forEach(function (matrixInfo) {\r\n transformObject[matrixInfo.name] = matrixInfo.functionValue;\r\n });\r\n return fillParams(moveable, e, __assign({ isPinch: !!e.isPinch, isDrag: e.isDrag, transformObject: transformObject, transform: getNextTransformText(e) }, fillCSSObject(getNextStyle(e))));\r\n },\r\n};\n\nfunction triggerAble(moveable, moveableAbles, eventOperations, eventAffix, eventType, e, requestInstant) {\r\n // pre setting\r\n e.clientDistX = e.distX;\r\n e.clientDistY = e.distY;\r\n var isStart = eventType === \"Start\";\r\n var isEnd = eventType === \"End\";\r\n var isAfter = eventType === \"After\";\r\n var target = moveable.state.target;\r\n var isRequest = e.isRequest;\r\n var isControl = eventAffix.indexOf(\"Control\") > -1;\r\n if (!target\r\n || (isStart && isControl && !isRequest && moveable.areaElement === e.inputEvent.target)) {\r\n return false;\r\n }\r\n var ables = __spreadArray([], __read(moveableAbles), false);\r\n if (isRequest) {\r\n var requestAble_1 = e.requestAble;\r\n if (!ables.some(function (able) { return able.name === requestAble_1; })) {\r\n ables.push.apply(ables, __spreadArray([], __read(moveable.props.ables.filter(function (able) { return able.name === requestAble_1; })), false));\r\n }\r\n }\r\n if (!ables.length || ables.every(function (able) { return able.dragRelation; })) {\r\n return false;\r\n }\r\n // \"drag\" \"Control\" \"After\"\r\n var inputEvent = e.inputEvent;\r\n var inputTarget;\r\n if (isEnd && inputEvent) {\r\n inputTarget = document.elementFromPoint(e.clientX, e.clientY) || inputEvent.target;\r\n }\r\n var isDragStop = false;\r\n var stop = function () {\r\n var _a;\r\n isDragStop = true;\r\n (_a = e.stop) === null || _a === void 0 ? void 0 : _a.call(e);\r\n };\r\n var isFirstStart = isStart && (!moveable.targetGesto || !moveable.controlGesto\r\n || (!moveable.targetGesto.isFlag() || !moveable.controlGesto.isFlag()));\r\n if (isFirstStart) {\r\n moveable.updateRect(eventType, true, false);\r\n }\r\n // trigger ables\r\n var datas = e.datas;\r\n var gestoType = isControl ? \"controlGesto\" : \"targetGesto\";\r\n var prevGesto = moveable[gestoType];\r\n var trigger = function (able, eventName, conditionName) {\r\n if (!(eventName in able) || prevGesto !== moveable[gestoType]) {\r\n return false;\r\n }\r\n var ableName = able.name;\r\n var nextDatas = datas[ableName] || (datas[ableName] = {});\r\n if (isStart) {\r\n nextDatas.isEventStart = !conditionName\r\n || !able[conditionName] || able[conditionName](moveable, e);\r\n }\r\n if (!nextDatas.isEventStart) {\r\n return false;\r\n }\r\n var result = able[eventName](moveable, __assign(__assign({}, e), { stop: stop, datas: nextDatas, originalDatas: datas, inputTarget: inputTarget }));\r\n moveable._emitter.off();\r\n if (isStart && result === false) {\r\n nextDatas.isEventStart = false;\r\n }\r\n return result;\r\n };\r\n // unset ables for first drag start\r\n if (isFirstStart) {\r\n ables.forEach(function (able) {\r\n able.unset && able.unset(moveable);\r\n });\r\n }\r\n // BeforeRenderable\r\n trigger(BeforeRenderable, \"drag\".concat(eventAffix).concat(eventType));\r\n var forceEndedCount = 0;\r\n var updatedCount = 0;\r\n eventOperations.forEach(function (eventOperation) {\r\n if (isDragStop) {\r\n return false;\r\n }\r\n var eventName = \"\".concat(eventOperation).concat(eventAffix).concat(eventType);\r\n var conditionName = \"\".concat(eventOperation).concat(eventAffix, \"Condition\");\r\n if (eventType === \"\" && !isRequest) {\r\n // Convert distX, distY\r\n convertDragDist(moveable.state, e);\r\n }\r\n // const isGroup = eventAffix.indexOf(\"Group\") > -1;\r\n var eventAbles = ables.filter(function (able) { return able[eventName]; });\r\n eventAbles = eventAbles.filter(function (able, i) {\r\n return able.name && eventAbles.indexOf(able) === i;\r\n });\r\n var results = eventAbles.filter(function (able) { return trigger(able, eventName, conditionName); });\r\n var isUpdate = results.length;\r\n // end ables\r\n if (isDragStop) {\r\n ++forceEndedCount;\r\n }\r\n if (isUpdate) {\r\n ++updatedCount;\r\n }\r\n if (!isDragStop && isStart && eventAbles.length && !isUpdate) {\r\n forceEndedCount += eventAbles.filter(function (able) {\r\n var ableName = able.name;\r\n var nextDatas = datas[ableName];\r\n if (nextDatas.isEventStart) {\r\n if (able.dragRelation === \"strong\") {\r\n return false;\r\n }\r\n // stop drag\r\n return true;\r\n }\r\n // pre stop drag\r\n return false;\r\n }).length ? 1 : 0;\r\n }\r\n });\r\n if (!isAfter || updatedCount) {\r\n trigger(Renderable, \"drag\".concat(eventAffix).concat(eventType));\r\n }\r\n // stop gesto condition\r\n var isForceEnd = prevGesto !== moveable[gestoType] || forceEndedCount === eventOperations.length;\r\n if (isEnd || isDragStop || isForceEnd) {\r\n moveable.state.gestos = {};\r\n if (moveable.moveables) {\r\n moveable.moveables.forEach(function (childMoveable) {\r\n childMoveable.state.gestos = {};\r\n });\r\n }\r\n ables.forEach(function (able) {\r\n able.unset && able.unset(moveable);\r\n });\r\n }\r\n if (isStart && !isForceEnd && !isRequest && updatedCount && moveable.props.preventDefault) {\r\n e === null || e === void 0 ? void 0 : e.preventDefault();\r\n }\r\n if (moveable.isUnmounted || isForceEnd) {\r\n return false;\r\n }\r\n if ((!isStart && updatedCount && !requestInstant) || isEnd) {\r\n var flushSync = moveable.props.flushSync || defaultSync;\r\n flushSync(function () {\r\n moveable.updateRect(isEnd ? eventType : \"\", true, false);\r\n moveable.forceUpdate();\r\n });\r\n }\r\n if (!isStart && !isEnd && !isAfter && updatedCount && !requestInstant) {\r\n triggerAble(moveable, moveableAbles, eventOperations, eventAffix, eventType + \"After\", e);\r\n }\r\n return true;\r\n}\r\nfunction checkMoveableTarget(moveable) {\r\n return function (e) {\r\n var _a;\r\n var eventTarget = e.inputEvent.target;\r\n var areaElement = moveable.areaElement;\r\n var dragTargetElement = moveable._dragTarget;\r\n if (!dragTargetElement || ((_a = moveable.controlGesto) === null || _a === void 0 ? void 0 : _a.isFlag())) {\r\n return false;\r\n }\r\n return eventTarget === dragTargetElement\r\n || dragTargetElement.contains(eventTarget)\r\n || eventTarget === areaElement\r\n || (!moveable.isMoveableElement(eventTarget) && !moveable.controlBox.contains(eventTarget))\r\n || hasClass(eventTarget, \"moveable-area\")\r\n || hasClass(eventTarget, \"moveable-padding\")\r\n || hasClass(eventTarget, \"moveable-edgeDraggable\");\r\n };\r\n}\r\nfunction getTargetAbleGesto(moveable, moveableTarget, eventAffix) {\r\n var controlBox = moveable.controlBox;\r\n var targets = [];\r\n var props = moveable.props;\r\n var dragArea = props.dragArea;\r\n var target = moveable.state.target;\r\n var dragTarget = props.dragTarget;\r\n targets.push(controlBox);\r\n if (!dragArea || dragTarget) {\r\n targets.push(moveableTarget);\r\n }\r\n if (!dragArea && dragTarget && target && moveableTarget !== target && props.dragTargetSelf) {\r\n targets.push(target);\r\n }\r\n return getAbleGesto(moveable, targets, \"targetAbles\", eventAffix, {\r\n dragStart: checkMoveableTarget(moveable),\r\n pinchStart: checkMoveableTarget(moveable),\r\n });\r\n}\r\nfunction getAbleGesto(moveable, target, ableType, eventAffix, conditionFunctions) {\r\n if (conditionFunctions === void 0) { conditionFunctions = {}; }\r\n var isTargetAbles = ableType === \"targetAbles\";\r\n var _a = moveable.props, pinchOutside = _a.pinchOutside, pinchThreshold = _a.pinchThreshold, preventClickEventOnDrag = _a.preventClickEventOnDrag, preventClickDefault = _a.preventClickDefault, checkInput = _a.checkInput, dragFocusedInput = _a.dragFocusedInput, _b = _a.preventDefault, preventDefault = _b === void 0 ? true : _b, dragContaienrOption = _a.dragContainer;\r\n var dragContainer = getRefTarget(dragContaienrOption, true);\r\n var options = {\r\n preventDefault: preventDefault,\r\n preventRightClick: true,\r\n preventWheelClick: true,\r\n container: dragContainer || getWindow(moveable.getControlBoxElement()),\r\n pinchThreshold: pinchThreshold,\r\n pinchOutside: pinchOutside,\r\n preventClickEventOnDrag: isTargetAbles ? preventClickEventOnDrag : false,\r\n preventClickEventOnDragStart: isTargetAbles ? preventClickDefault : false,\r\n preventClickEventByCondition: isTargetAbles ? null : function (e) {\r\n return moveable.controlBox.contains(e.target);\r\n },\r\n checkInput: isTargetAbles ? checkInput : false,\r\n dragFocusedInput: dragFocusedInput,\r\n };\r\n var gesto = new Gesto(target, options);\r\n var isControl = eventAffix === \"Control\";\r\n [\"drag\", \"pinch\"].forEach(function (eventOperation) {\r\n [\"Start\", \"\", \"End\"].forEach(function (eventType) {\r\n gesto.on(\"\".concat(eventOperation).concat(eventType), function (e) {\r\n var _a;\r\n var eventName = e.eventType;\r\n var isPinchScheduled = eventOperation === \"drag\" && e.isPinch;\r\n if (conditionFunctions[eventName] && !conditionFunctions[eventName](e)) {\r\n e.stop();\r\n return;\r\n }\r\n if (isPinchScheduled) {\r\n return;\r\n }\r\n var eventOperations = eventOperation === \"drag\" ? [eventOperation] : [\"drag\", eventOperation];\r\n var moveableAbles = __spreadArray([], __read(moveable[ableType]), false);\r\n var result = triggerAble(moveable, moveableAbles, eventOperations, eventAffix, eventType, e);\r\n if (!result) {\r\n e.stop();\r\n }\r\n else if (moveable.props.stopPropagation || (eventType === \"Start\" && isControl)) {\r\n (_a = e === null || e === void 0 ? void 0 : e.inputEvent) === null || _a === void 0 ? void 0 : _a.stopPropagation();\r\n }\r\n });\r\n });\r\n });\r\n return gesto;\r\n}\n\nvar EventManager = /*#__PURE__*/ (function () {\r\n function EventManager(target, moveable, eventName) {\r\n var _this = this;\r\n this.target = target;\r\n this.moveable = moveable;\r\n this.eventName = eventName;\r\n this.ables = [];\r\n this._onEvent = function (e) {\r\n var eventName = _this.eventName;\r\n var moveable = _this.moveable;\r\n if (moveable.state.disableNativeEvent) {\r\n return;\r\n }\r\n _this.ables.forEach(function (able) {\r\n able[eventName](moveable, {\r\n inputEvent: e,\r\n });\r\n });\r\n };\r\n target.addEventListener(eventName.toLowerCase(), this._onEvent);\r\n }\r\n EventManager.prototype.setAbles = function (ables) {\r\n this.ables = ables;\r\n };\r\n EventManager.prototype.destroy = function () {\r\n this.target.removeEventListener(this.eventName.toLowerCase(), this._onEvent);\r\n this.target = null;\r\n this.moveable = null;\r\n };\r\n return EventManager;\r\n}());\n\nfunction calculateMatrixStack(target, container, rootContainer, isAbsolute3d) {\r\n var _a;\r\n if (rootContainer === void 0) { rootContainer = container; }\r\n var _b = getMatrixStackInfo(target, container), matrixes = _b.matrixes, is3d = _b.is3d, prevTargetMatrix = _b.targetMatrix, transformOrigin = _b.transformOrigin, targetOrigin = _b.targetOrigin, offsetContainer = _b.offsetContainer, hasFixed = _b.hasFixed, containerZoom = _b.zoom; // prevMatrix\r\n var _c = getCachedMatrixContainerInfo(offsetContainer, rootContainer), rootMatrixes = _c.matrixes, isRoot3d = _c.is3d, offsetRootContainer = _c.offsetContainer, rootZoom = _c.zoom; // prevRootMatrix\r\n // if (rootContainer === document.body) {\r\n // console.log(offsetContainer, rootContainer, rootMatrixes);\r\n // }\r\n var isNext3d = isAbsolute3d || isRoot3d || is3d;\r\n var n = isNext3d ? 4 : 3;\r\n var isSVGGraphicElement = target.tagName.toLowerCase() !== \"svg\" && \"ownerSVGElement\" in target;\r\n var targetMatrix = prevTargetMatrix;\r\n // let allMatrix = prevMatrix ? convertDimension(prevMatrix, prevN!, n) : createIdentityMatrix(n);\r\n // let rootMatrix = prevRootMatrix ? convertDimension(prevRootMatrix, prevN!, n) : createIdentityMatrix(n);\r\n // let beforeMatrix = prevMatrix ? convertDimension(prevMatrix, prevN!, n) : createIdentityMatrix(n);\r\n var allMatrix = createIdentityMatrix(n);\r\n var rootMatrix = createIdentityMatrix(n);\r\n var beforeMatrix = createIdentityMatrix(n);\r\n var offsetMatrix = createIdentityMatrix(n);\r\n var length = matrixes.length;\r\n var nextRootMatrixes = rootMatrixes.map(function (info) {\r\n return __assign(__assign({}, info), { matrix: info.matrix ? __spreadArray([], __read(info.matrix), false) : undefined });\r\n }).reverse();\r\n matrixes.reverse();\r\n if (!is3d && isNext3d) {\r\n targetMatrix = convertDimension(targetMatrix, 3, 4);\r\n convert3DMatrixes(matrixes);\r\n }\r\n if (!isRoot3d && isNext3d) {\r\n convert3DMatrixes(nextRootMatrixes);\r\n }\r\n // rootMatrix = (...) -> container -> offset -> absolute -> offset -> absolute(targetMatrix)\r\n // rootMatrixBeforeOffset = lastOffsetMatrix -> (...) -> container\r\n // beforeMatrix = (... -> container -> offset -> absolute) -> offset -> absolute(targetMatrix)\r\n // offsetMatrix = (... -> container -> offset -> absolute -> offset) -> absolute(targetMatrix)\r\n nextRootMatrixes.forEach(function (info) {\r\n rootMatrix = multiply(rootMatrix, info.matrix, n);\r\n });\r\n var originalRootContainer = rootContainer || getDocumentBody(target);\r\n var endContainer = ((_a = nextRootMatrixes[0]) === null || _a === void 0 ? void 0 : _a.target)\r\n || getOffsetInfo(originalRootContainer, originalRootContainer, true).offsetParent;\r\n var rootMatrixBeforeOffset = nextRootMatrixes.slice(1).reduce(function (matrix, info) {\r\n return multiply(matrix, info.matrix, n);\r\n }, createIdentityMatrix(n));\r\n matrixes.forEach(function (info, i) {\r\n if (length - 2 === i) {\r\n // length - 3\r\n beforeMatrix = allMatrix.slice();\r\n }\r\n if (length - 1 === i) {\r\n // length - 2\r\n offsetMatrix = allMatrix.slice();\r\n }\r\n // calculate for SVGElement\r\n if (!info.matrix) {\r\n var nextInfo = matrixes[i + 1];\r\n var offset = getSVGOffset(info, nextInfo, endContainer, n, multiply(rootMatrixBeforeOffset, allMatrix, n));\r\n info.matrix = createOriginMatrix(offset, n);\r\n }\r\n allMatrix = multiply(allMatrix, info.matrix, n);\r\n });\r\n var isMatrix3d = !isSVGGraphicElement && is3d;\r\n if (!targetMatrix) {\r\n targetMatrix = createIdentityMatrix(isMatrix3d ? 4 : 3);\r\n }\r\n var targetTransform = makeMatrixCSS(isSVGGraphicElement && targetMatrix.length === 16\r\n ? convertDimension(targetMatrix, 4, 3) : targetMatrix, isMatrix3d);\r\n var originalRootMatrix = rootMatrix;\r\n rootMatrix = ignoreDimension(rootMatrix, n, n);\r\n return {\r\n hasZoom: containerZoom !== 1 || rootZoom !== 1,\r\n hasFixed: hasFixed,\r\n matrixes: matrixes,\r\n rootMatrix: rootMatrix,\r\n originalRootMatrix: originalRootMatrix,\r\n beforeMatrix: beforeMatrix,\r\n offsetMatrix: offsetMatrix,\r\n allMatrix: allMatrix,\r\n targetMatrix: targetMatrix,\r\n targetTransform: targetTransform,\r\n inlineTransform: target.style.transform,\r\n transformOrigin: transformOrigin,\r\n targetOrigin: targetOrigin,\r\n is3d: isNext3d,\r\n offsetContainer: offsetContainer,\r\n offsetRootContainer: offsetRootContainer,\r\n };\r\n}\n\nfunction calculateElementInfo(target, container, rootContainer, isAbsolute3d) {\r\n if (rootContainer === void 0) { rootContainer = container; }\r\n var width = 0;\r\n var height = 0;\r\n var rotation = 0;\r\n var allResult = {};\r\n var sizes = getSize(target);\r\n if (target) {\r\n width = sizes.offsetWidth;\r\n height = sizes.offsetHeight;\r\n }\r\n if (target) {\r\n var result = calculateMatrixStack(target, container, rootContainer, isAbsolute3d);\r\n var position = calculateElementPosition(result.allMatrix, result.transformOrigin, width, height);\r\n allResult = __assign(__assign({}, result), position);\r\n var rotationPosition = calculateElementPosition(result.allMatrix, [50, 50], 100, 100);\r\n rotation = getRotationRad([rotationPosition.pos1, rotationPosition.pos2], rotationPosition.direction);\r\n }\r\n var n = isAbsolute3d ? 4 : 3;\r\n return __assign(__assign(__assign({ hasZoom: false, width: width, height: height, rotation: rotation }, sizes), { originalRootMatrix: createIdentityMatrix(n), rootMatrix: createIdentityMatrix(n), beforeMatrix: createIdentityMatrix(n), offsetMatrix: createIdentityMatrix(n), allMatrix: createIdentityMatrix(n), targetMatrix: createIdentityMatrix(n), targetTransform: \"\", inlineTransform: \"\", transformOrigin: [0, 0], targetOrigin: [0, 0], is3d: !!isAbsolute3d, left: 0, top: 0, right: 0, bottom: 0, origin: [0, 0], pos1: [0, 0], pos2: [0, 0], pos3: [0, 0], pos4: [0, 0], direction: 1, hasFixed: false, offsetContainer: null, offsetRootContainer: null, matrixes: [] }), allResult);\r\n}\r\nfunction getElementInfo(target, container, rootContainer) {\r\n if (rootContainer === void 0) { rootContainer = container; }\r\n return calculateElementInfo(target, container, rootContainer, true);\r\n}\n\nfunction getMoveableTargetInfo(moveableElement, target, container, parentContainer, rootContainer, requestStyles) {\r\n if (requestStyles === void 0) { requestStyles = []; }\r\n var beforeDirection = 1;\r\n var beforeOrigin = [0, 0];\r\n var targetClientRect = resetClientRect();\r\n var moveableClientRect = resetClientRect();\r\n var containerClientRect = resetClientRect();\r\n var rootContainerClientRect = resetClientRect();\r\n var offsetDelta = [0, 0];\r\n var style = {};\r\n var result = calculateElementInfo(target, container, rootContainer, true);\r\n if (target) {\r\n var getStyle_1 = getCachedStyle(target);\r\n requestStyles.forEach(function (name) {\r\n style[name] = getStyle_1(name);\r\n });\r\n var n = result.is3d ? 4 : 3;\r\n var beforePosition = calculateElementPosition(result.offsetMatrix, plus(result.transformOrigin, getOrigin(result.targetMatrix, n)), result.width, result.height);\r\n beforeDirection = beforePosition.direction;\r\n beforeOrigin = plus(beforePosition.origin, [beforePosition.left - result.left, beforePosition.top - result.top]);\r\n rootContainerClientRect = getClientRect(result.offsetRootContainer);\r\n var offsetContainer = getOffsetInfo(parentContainer, parentContainer, true).offsetParent\r\n || result.offsetRootContainer;\r\n if (result.hasZoom) {\r\n var absoluteTargetPosition = calculateElementPosition(multiply(result.originalRootMatrix, result.allMatrix), result.transformOrigin, result.width, result.height);\r\n var absoluteContainerPosition = calculateElementPosition(result.originalRootMatrix, getTransformOriginArray(getCachedStyle(offsetContainer)(\"transformOrigin\")).map(function (pos) { return parseFloat(pos); }), offsetContainer.offsetWidth, offsetContainer.offsetHeight);\r\n targetClientRect = getClientRectByPosition(absoluteTargetPosition, rootContainerClientRect);\r\n containerClientRect = getClientRectByPosition(absoluteContainerPosition, rootContainerClientRect, offsetContainer, true);\r\n if (moveableElement) {\r\n var left = absoluteTargetPosition.left;\r\n var top_1 = absoluteTargetPosition.top;\r\n moveableClientRect = getClientRectByPosition({\r\n left: left,\r\n top: top_1,\r\n bottom: top_1,\r\n right: top_1,\r\n }, rootContainerClientRect);\r\n }\r\n }\r\n else {\r\n targetClientRect = getClientRect(target);\r\n containerClientRect = getCachedClientRect(offsetContainer);\r\n if (moveableElement) {\r\n moveableClientRect = getClientRect(moveableElement);\r\n }\r\n var containerClientRectLeft = containerClientRect.left, containerClientRectTop = containerClientRect.top, containterClientLeft = containerClientRect.clientLeft, containerClientTop = containerClientRect.clientTop;\r\n var clientDelta = [\r\n targetClientRect.left - containerClientRectLeft,\r\n targetClientRect.top - containerClientRectTop,\r\n ];\r\n offsetDelta = minus(calculateInversePosition(result.rootMatrix, clientDelta, 4), [containterClientLeft + result.left, containerClientTop + result.top]);\r\n }\r\n }\r\n return __assign({ targetClientRect: targetClientRect, containerClientRect: containerClientRect, moveableClientRect: moveableClientRect, rootContainerClientRect: rootContainerClientRect, beforeDirection: beforeDirection, beforeOrigin: beforeOrigin, originalBeforeOrigin: beforeOrigin, target: target, style: style, offsetDelta: offsetDelta }, result);\r\n}\n\nfunction getPersistState(rect) {\r\n var pos1 = rect.pos1, pos2 = rect.pos2, pos3 = rect.pos3, pos4 = rect.pos4;\r\n if (!pos1 || !pos2 || !pos3 || !pos4) {\r\n return null;\r\n }\r\n var minPos = getMinMaxs([pos1, pos2, pos3, pos4]);\r\n var posDelta = [minPos.minX, minPos.minY];\r\n var origin = minus(rect.origin, posDelta);\r\n pos1 = minus(pos1, posDelta);\r\n pos2 = minus(pos2, posDelta);\r\n pos3 = minus(pos3, posDelta);\r\n pos4 = minus(pos4, posDelta);\r\n return __assign(__assign({}, rect), { left: rect.left, top: rect.top, posDelta: posDelta, pos1: pos1, pos2: pos2, pos3: pos3, pos4: pos4, origin: origin, beforeOrigin: origin, \r\n // originalBeforeOrigin: origin,\r\n isPersisted: true });\r\n}\n\nvar MoveableManager = /*#__PURE__*/ (function (_super) {\r\n __extends(MoveableManager, _super);\r\n function MoveableManager() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.state = __assign({ container: null, gestos: {}, renderLines: [\r\n [[0, 0], [0, 0]],\r\n [[0, 0], [0, 0]],\r\n [[0, 0], [0, 0]],\r\n [[0, 0], [0, 0]],\r\n ], renderPoses: [[0, 0], [0, 0], [0, 0], [0, 0]], disableNativeEvent: false, posDelta: [0, 0] }, getMoveableTargetInfo(null));\r\n _this.renderState = {};\r\n _this.enabledAbles = [];\r\n _this.targetAbles = [];\r\n _this.controlAbles = [];\r\n _this.rotation = 0;\r\n _this.scale = [1, 1];\r\n _this.isMoveableMounted = false;\r\n _this.isUnmounted = false;\r\n _this.events = {\r\n \"mouseEnter\": null,\r\n \"mouseLeave\": null,\r\n };\r\n _this._emitter = new EventEmitter();\r\n _this._prevOriginalDragTarget = null;\r\n _this._originalDragTarget = null;\r\n _this._prevDragTarget = null;\r\n _this._dragTarget = null;\r\n _this._prevPropTarget = null;\r\n _this._propTarget = null;\r\n _this._prevDragArea = false;\r\n _this._isPropTargetChanged = false;\r\n _this._hasFirstTarget = false;\r\n _this._reiszeObserver = null;\r\n _this._observerId = 0;\r\n _this._mutationObserver = null;\r\n _this._rootContainer = null;\r\n _this._viewContainer = null;\r\n _this._viewClassNames = [];\r\n _this._store = {};\r\n _this.checkUpdateRect = function () {\r\n if (_this.isDragging()) {\r\n return;\r\n }\r\n var parentMoveable = _this.props.parentMoveable;\r\n if (parentMoveable) {\r\n parentMoveable.checkUpdateRect();\r\n return;\r\n }\r\n cancelAnimationFrame(_this._observerId);\r\n _this._observerId = requestAnimationFrame(function () {\r\n if (_this.isDragging()) {\r\n return;\r\n }\r\n _this.updateRect();\r\n });\r\n };\r\n _this._onPreventClick = function (e) {\r\n e.stopPropagation();\r\n e.preventDefault();\r\n // removeEvent(window, \"click\", this._onPreventClick, true);\r\n };\r\n return _this;\r\n }\r\n MoveableManager.prototype.render = function () {\r\n var props = this.props;\r\n var state = this.getState();\r\n var parentPosition = props.parentPosition, className = props.className, propsTarget = props.target, zoom = props.zoom, cspNonce = props.cspNonce, translateZ = props.translateZ, ControlBoxElement = props.cssStyled, groupable = props.groupable, linePadding = props.linePadding, controlPadding = props.controlPadding;\r\n this._checkUpdateRootContainer();\r\n this.checkUpdate();\r\n this.updateRenderPoses();\r\n var _a = __read(parentPosition || [0, 0], 2), parentLeft = _a[0], parentTop = _a[1];\r\n var left = state.left, top = state.top, stateTarget = state.target, direction = state.direction, hasFixed = state.hasFixed, offsetDelta = state.offsetDelta;\r\n var groupTargets = props.targets;\r\n var isDragging = this.isDragging();\r\n var ableAttributes = {};\r\n this.getEnabledAbles().forEach(function (able) {\r\n ableAttributes[\"data-able-\".concat(able.name.toLowerCase())] = true;\r\n });\r\n var ableClassName = this._getAbleClassName();\r\n var isDisplay = (groupTargets && groupTargets.length && (stateTarget || groupable))\r\n || propsTarget\r\n || (!this._hasFirstTarget && this.state.isPersisted);\r\n var isVisible = this.controlBox || this.props.firstRenderState || this.props.persistData;\r\n var translate = [left - parentLeft, top - parentTop];\r\n if (!groupable && props.useAccuratePosition) {\r\n translate[0] += offsetDelta[0];\r\n translate[1] += offsetDelta[1];\r\n }\r\n var style = {\r\n \"position\": hasFixed ? \"fixed\" : \"absolute\",\r\n \"display\": isDisplay ? \"block\" : \"none\",\r\n \"visibility\": isVisible ? \"visible\" : \"hidden\",\r\n \"transform\": \"translate3d(\".concat(translate[0], \"px, \").concat(translate[1], \"px, \").concat(translateZ, \")\"),\r\n \"--zoom\": zoom,\r\n \"--zoompx\": \"\".concat(zoom, \"px\"),\r\n };\r\n if (linePadding) {\r\n style[\"--moveable-line-padding\"] = linePadding;\r\n }\r\n if (controlPadding) {\r\n style[\"--moveable-control-padding\"] = controlPadding;\r\n }\r\n return (React.createElement(ControlBoxElement, __assign({ cspNonce: cspNonce, ref: ref(this, \"controlBox\"), className: \"\".concat(prefix(\"control-box\", direction === -1 ? \"reverse\" : \"\", isDragging ? \"dragging\" : \"\"), \" \").concat(ableClassName, \" \").concat(className) }, ableAttributes, { onClick: this._onPreventClick, style: style }),\r\n this.renderAbles(),\r\n this._renderLines()));\r\n };\r\n MoveableManager.prototype.componentDidMount = function () {\r\n this.isMoveableMounted = true;\r\n this.isUnmounted = false;\r\n var props = this.props;\r\n var parentMoveable = props.parentMoveable, container = props.container;\r\n this._checkUpdateRootContainer();\r\n this._checkUpdateViewContainer();\r\n this._updateTargets();\r\n this._updateNativeEvents();\r\n this._updateEvents();\r\n this.updateCheckInput();\r\n this._updateObserver(this.props);\r\n if (!container && !parentMoveable && !this.state.isPersisted) {\r\n this.updateRect(\"\", false, false);\r\n this.forceUpdate();\r\n }\r\n };\r\n MoveableManager.prototype.componentDidUpdate = function (prevProps) {\r\n this._checkUpdateRootContainer();\r\n this._checkUpdateViewContainer();\r\n this._updateNativeEvents();\r\n this._updateTargets();\r\n this._updateEvents();\r\n this.updateCheckInput();\r\n this._updateObserver(prevProps);\r\n };\r\n MoveableManager.prototype.componentWillUnmount = function () {\r\n var _a, _b;\r\n this.isMoveableMounted = false;\r\n this.isUnmounted = true;\r\n this._emitter.off();\r\n (_a = this._reiszeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();\r\n (_b = this._mutationObserver) === null || _b === void 0 ? void 0 : _b.disconnect();\r\n var viewContainer = this._viewContainer;\r\n if (viewContainer) {\r\n this._changeAbleViewClassNames([]);\r\n }\r\n unsetGesto(this, false);\r\n unsetGesto(this, true);\r\n var events = this.events;\r\n for (var name_1 in events) {\r\n var manager = events[name_1];\r\n manager && manager.destroy();\r\n }\r\n };\r\n MoveableManager.prototype.getTargets = function () {\r\n var target = this.props.target;\r\n return target ? [target] : [];\r\n };\r\n /**\r\n * Get the able used in MoveableManager.\r\n * @method Moveable#getAble\r\n * @param - able name\r\n */\r\n MoveableManager.prototype.getAble = function (ableName) {\r\n var ables = this.props.ables || [];\r\n return find(ables, function (able) { return able.name === ableName; });\r\n };\r\n MoveableManager.prototype.getContainer = function () {\r\n var _a = this.props, parentMoveable = _a.parentMoveable, wrapperMoveable = _a.wrapperMoveable, container = _a.container;\r\n return container\r\n || (wrapperMoveable && wrapperMoveable.getContainer())\r\n || (parentMoveable && parentMoveable.getContainer())\r\n || this.controlBox.parentElement;\r\n };\r\n /**\r\n * Returns the element of the control box.\r\n * @method Moveable#getControlBoxElement\r\n */\r\n MoveableManager.prototype.getControlBoxElement = function () {\r\n return this.controlBox;\r\n };\r\n /**\r\n * Target element to be dragged in moveable\r\n * @method Moveable#getDragElement\r\n */\r\n MoveableManager.prototype.getDragElement = function () {\r\n return this._dragTarget;\r\n };\r\n /**\r\n * Check if the target is an element included in the moveable.\r\n * @method Moveable#isMoveableElement\r\n * @param - the target\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * window.addEventListener(\"click\", e => {\r\n * if (!moveable.isMoveableElement(e.target)) {\r\n * moveable.target = e.target;\r\n * }\r\n * });\r\n */\r\n MoveableManager.prototype.isMoveableElement = function (target) {\r\n var _a;\r\n return target && (((_a = target.getAttribute) === null || _a === void 0 ? void 0 : _a.call(target, \"class\")) || \"\").indexOf(PREFIX) > -1;\r\n };\r\n /**\r\n * You can drag start the Moveable through the external `MouseEvent`or `TouchEvent`. (Angular: ngDragStart)\r\n * @method Moveable#dragStart\r\n * @param - external `MouseEvent`or `TouchEvent`\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * document.body.addEventListener(\"mousedown\", e => {\r\n * if (!moveable.isMoveableElement(e.target)) {\r\n * moveable.dragStart(e);\r\n * }\r\n * });\r\n */\r\n MoveableManager.prototype.dragStart = function (e) {\r\n var targetGesto = this.targetGesto;\r\n var controlGesto = this.controlGesto;\r\n if (targetGesto && checkMoveableTarget(this)({ inputEvent: e })) {\r\n if (!targetGesto.isFlag()) {\r\n targetGesto.triggerDragStart(e);\r\n }\r\n }\r\n else if (controlGesto && this.isMoveableElement(e.target)) {\r\n if (!controlGesto.isFlag()) {\r\n controlGesto.triggerDragStart(e);\r\n }\r\n }\r\n return this;\r\n };\r\n /**\r\n * Hit test an element or rect on a moveable target.\r\n * (100% = 100)\r\n * @method Moveable#hitTest\r\n * @param - element or rect to test\r\n * @return - Get hit test rate (rate > 0 is hitted)\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * document.body.addEventListener(\"mousedown\", e => {\r\n * if (moveable.hitTest(e.target) > 0) {\r\n * console.log(\"hiited\");\r\n * }\r\n * });\r\n */\r\n MoveableManager.prototype.hitTest = function (el) {\r\n var _a = this.state, target = _a.target, pos1 = _a.pos1, pos2 = _a.pos2, pos3 = _a.pos3, pos4 = _a.pos4, targetClientRect = _a.targetClientRect;\r\n if (!target) {\r\n return 0;\r\n }\r\n var rect;\r\n if (isNode(el)) {\r\n var clientRect = el.getBoundingClientRect();\r\n rect = {\r\n left: clientRect.left,\r\n top: clientRect.top,\r\n width: clientRect.width,\r\n height: clientRect.height,\r\n };\r\n }\r\n else {\r\n rect = __assign({ width: 0, height: 0 }, el);\r\n }\r\n var rectLeft = rect.left, rectTop = rect.top, rectWidth = rect.width, rectHeight = rect.height;\r\n var points = fitPoints([pos1, pos2, pos4, pos3], targetClientRect);\r\n var size = getOverlapSize(points, [\r\n [rectLeft, rectTop],\r\n [rectLeft + rectWidth, rectTop],\r\n [rectLeft + rectWidth, rectTop + rectHeight],\r\n [rectLeft, rectTop + rectHeight],\r\n ]);\r\n var totalSize = getAreaSize(points);\r\n if (!size || !totalSize) {\r\n return 0;\r\n }\r\n return Math.min(100, size / totalSize * 100);\r\n };\r\n /**\r\n * Whether the coordinates are inside Moveable\r\n * @method Moveable#isInside\r\n * @param - x coordinate\r\n * @param - y coordinate\r\n * @return - True if the coordinate is in moveable or false\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * document.body.addEventListener(\"mousedown\", e => {\r\n * if (moveable.isInside(e.clientX, e.clientY)) {\r\n * console.log(\"inside\");\r\n * }\r\n * });\r\n */\r\n MoveableManager.prototype.isInside = function (clientX, clientY) {\r\n var _a = this.state, target = _a.target, pos1 = _a.pos1, pos2 = _a.pos2, pos3 = _a.pos3, pos4 = _a.pos4, targetClientRect = _a.targetClientRect;\r\n if (!target) {\r\n return false;\r\n }\r\n return isInside([clientX, clientY], fitPoints([pos1, pos2, pos4, pos3], targetClientRect));\r\n };\r\n /**\r\n * If the width, height, left, and top of all elements change, update the shape of the moveable.\r\n * @method Moveable#updateRect\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * window.addEventListener(\"resize\", e => {\r\n * moveable.updateRect();\r\n * });\r\n */\r\n MoveableManager.prototype.updateRect = function (type, isTarget, isSetState) {\r\n if (isSetState === void 0) { isSetState = true; }\r\n var props = this.props;\r\n var isSingle = !props.parentPosition && !props.wrapperMoveable;\r\n if (isSingle) {\r\n setStoreCache(true);\r\n }\r\n var parentMoveable = props.parentMoveable;\r\n var state = this.state;\r\n var target = (state.target || props.target);\r\n var container = this.getContainer();\r\n var rootContainer = parentMoveable\r\n ? parentMoveable._rootContainer\r\n : this._rootContainer;\r\n var nextState = getMoveableTargetInfo(this.controlBox, target, container, container, rootContainer || container, this._getRequestStyles());\r\n if (!target && this._hasFirstTarget && props.persistData) {\r\n var persistState = getPersistState(props.persistData);\r\n for (var name_2 in persistState) {\r\n nextState[name_2] = persistState[name_2];\r\n }\r\n }\r\n if (isSingle) {\r\n setStoreCache();\r\n }\r\n this.updateState(nextState, parentMoveable ? false : isSetState);\r\n };\r\n /**\r\n * Check if the moveable state is being dragged.\r\n * @method Moveable#isDragging\r\n * @param - If you want to check if able is dragging, specify ableName.\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * // false\r\n * console.log(moveable.isDragging());\r\n *\r\n * moveable.on(\"drag\", () => {\r\n * // true\r\n * console.log(moveable.isDragging());\r\n * });\r\n */\r\n MoveableManager.prototype.isDragging = function (ableName) {\r\n var _a, _b;\r\n var targetGesto = this.targetGesto;\r\n var controlGesto = this.controlGesto;\r\n if (targetGesto === null || targetGesto === void 0 ? void 0 : targetGesto.isFlag()) {\r\n if (!ableName) {\r\n return true;\r\n }\r\n var data = targetGesto.getEventData();\r\n return !!((_a = data[ableName]) === null || _a === void 0 ? void 0 : _a.isEventStart);\r\n }\r\n if (controlGesto === null || controlGesto === void 0 ? void 0 : controlGesto.isFlag()) {\r\n if (!ableName) {\r\n return true;\r\n }\r\n var data = controlGesto.getEventData();\r\n return !!((_b = data[ableName]) === null || _b === void 0 ? void 0 : _b.isEventStart);\r\n }\r\n return false;\r\n };\r\n /**\r\n * If the width, height, left, and top of the only target change, update the shape of the moveable.\r\n * Use `.updateRect()` method\r\n * @method Moveable#updateTarget\r\n * @deprecated\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.updateTarget();\r\n */\r\n MoveableManager.prototype.updateTarget = function (type) {\r\n this.updateRect(type, true);\r\n };\r\n /**\r\n * You can get the vertex information, position and offset size information of the target based on the container.\r\n * @method Moveable#getRect\r\n * @return - The Rect Info\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * const rectInfo = moveable.getRect();\r\n */\r\n MoveableManager.prototype.getRect = function () {\r\n var state = this.state;\r\n var poses = getAbsolutePosesByState(this.state);\r\n var _a = __read(poses, 4), pos1 = _a[0], pos2 = _a[1], pos3 = _a[2], pos4 = _a[3];\r\n var rect = getRect(poses);\r\n var offsetWidth = state.width, offsetHeight = state.height;\r\n var width = rect.width, height = rect.height, left = rect.left, top = rect.top;\r\n var statePos = [state.left, state.top];\r\n var origin = plus(statePos, state.origin);\r\n var beforeOrigin = plus(statePos, state.beforeOrigin);\r\n var transformOrigin = state.transformOrigin;\r\n return {\r\n width: width,\r\n height: height,\r\n left: left,\r\n top: top,\r\n pos1: pos1,\r\n pos2: pos2,\r\n pos3: pos3,\r\n pos4: pos4,\r\n offsetWidth: offsetWidth,\r\n offsetHeight: offsetHeight,\r\n beforeOrigin: beforeOrigin,\r\n origin: origin,\r\n transformOrigin: transformOrigin,\r\n rotation: this.getRotation(),\r\n };\r\n };\r\n /**\r\n * Get a manager that manages the moveable's state and props.\r\n * @method Moveable#getManager\r\n * @return - The Rect Info\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * const manager = moveable.getManager(); // real moveable class instance\r\n */\r\n MoveableManager.prototype.getManager = function () {\r\n return this;\r\n };\r\n /**\r\n * You can stop the dragging currently in progress through a method from outside.\r\n * @method Moveable#stopDrag\r\n * @return - The Rect Info\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.stopDrag();\r\n */\r\n MoveableManager.prototype.stopDrag = function (type) {\r\n if (!type || type === \"target\") {\r\n var gesto = this.targetGesto;\r\n if ((gesto === null || gesto === void 0 ? void 0 : gesto.isIdle()) === false) {\r\n unsetAbles(this, false);\r\n }\r\n gesto === null || gesto === void 0 ? void 0 : gesto.stop();\r\n }\r\n if (!type || type === \"control\") {\r\n var gesto = this.controlGesto;\r\n if ((gesto === null || gesto === void 0 ? void 0 : gesto.isIdle()) === false) {\r\n unsetAbles(this, true);\r\n }\r\n gesto === null || gesto === void 0 ? void 0 : gesto.stop();\r\n }\r\n };\r\n MoveableManager.prototype.getRotation = function () {\r\n var _a = this.state, pos1 = _a.pos1, pos2 = _a.pos2, direction = _a.direction;\r\n return getAbsoluteRotation(pos1, pos2, direction);\r\n };\r\n /**\r\n * Request able through a method rather than an event.\r\n * At the moment of execution, requestStart is executed,\r\n * and then request and requestEnd can be executed through Requester.\r\n * @method Moveable#request\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Draggable.html#request|Draggable Requester}\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Resizable.html#request|Resizable Requester}\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Scalable.html#request|Scalable Requester}\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Rotatable.html#request|Rotatable Requester}\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.OriginDraggable.html#request|OriginDraggable Requester}\r\n * @param - ableName\r\n * @param - request to be able params.\r\n * @param - If isInstant is true, request and requestEnd are executed immediately.\r\n * @return - Able Requester. If there is no request in able, nothing will work.\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * // Instantly Request (requestStart - request - requestEnd)\r\n * moveable.request(\"draggable\", { deltaX: 10, deltaY: 10 }, true);\r\n *\r\n * // Start move\r\n * const requester = moveable.request(\"draggable\");\r\n * requester.request({ deltaX: 10, deltaY: 10 });\r\n * requester.request({ deltaX: 10, deltaY: 10 });\r\n * requester.request({ deltaX: 10, deltaY: 10 });\r\n * requester.requestEnd();\r\n */\r\n MoveableManager.prototype.request = function (ableName, param, isInstant) {\r\n if (param === void 0) { param = {}; }\r\n var self = this;\r\n var props = self.props;\r\n var manager = props.parentMoveable || props.wrapperMoveable || self;\r\n var allAbles = manager.props.ables;\r\n var groupable = props.groupable;\r\n var requsetAble = find(allAbles, function (able) { return able.name === ableName; });\r\n if (this.isDragging() || !requsetAble || !requsetAble.request) {\r\n return {\r\n request: function () {\r\n return this;\r\n },\r\n requestEnd: function () {\r\n return this;\r\n },\r\n };\r\n }\r\n var ableRequester = requsetAble.request(self);\r\n var requestInstant = isInstant || param.isInstant;\r\n var ableType = ableRequester.isControl ? \"controlAbles\" : \"targetAbles\";\r\n var eventAffix = \"\".concat((groupable ? \"Group\" : \"\")).concat(ableRequester.isControl ? \"Control\" : \"\");\r\n var moveableAbles = __spreadArray([], __read(manager[ableType]), false);\r\n var requester = {\r\n request: function (ableParam) {\r\n triggerAble(self, moveableAbles, [\"drag\"], eventAffix, \"\", __assign(__assign({}, ableRequester.request(ableParam)), { requestAble: ableName, isRequest: true }), requestInstant);\r\n return requester;\r\n },\r\n requestEnd: function () {\r\n triggerAble(self, moveableAbles, [\"drag\"], eventAffix, \"End\", __assign(__assign({}, ableRequester.requestEnd()), { requestAble: ableName, isRequest: true }), requestInstant);\r\n return requester;\r\n },\r\n };\r\n triggerAble(self, moveableAbles, [\"drag\"], eventAffix, \"Start\", __assign(__assign({}, ableRequester.requestStart(param)), { requestAble: ableName, isRequest: true }), requestInstant);\r\n return requestInstant ? requester.request(param).requestEnd() : requester;\r\n };\r\n /**\r\n * moveable is the top level that manages targets\r\n * `Single`: MoveableManager instance\r\n * `Group`: MoveableGroup instance\r\n * `IndividualGroup`: MoveableIndividaulGroup instance\r\n * Returns leaf target MoveableManagers.\r\n */\r\n MoveableManager.prototype.getMoveables = function () {\r\n return [this];\r\n };\r\n /**\r\n * Remove the Moveable object and the events.\r\n * @method Moveable#destroy\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.destroy();\r\n */\r\n MoveableManager.prototype.destroy = function () {\r\n this.componentWillUnmount();\r\n };\r\n MoveableManager.prototype.updateRenderPoses = function () {\r\n var state = this.getState();\r\n var props = this.props;\r\n var padding = props.padding;\r\n var originalBeforeOrigin = state.originalBeforeOrigin, transformOrigin = state.transformOrigin, allMatrix = state.allMatrix, is3d = state.is3d, pos1 = state.pos1, pos2 = state.pos2, pos3 = state.pos3, pos4 = state.pos4, stateLeft = state.left, stateTop = state.top, isPersisted = state.isPersisted;\r\n var zoom = props.zoom || 1;\r\n if (!padding && zoom <= 1) {\r\n state.renderPoses = [\r\n pos1,\r\n pos2,\r\n pos3,\r\n pos4,\r\n ];\r\n state.renderLines = [\r\n [pos1, pos2],\r\n [pos2, pos4],\r\n [pos4, pos3],\r\n [pos3, pos1],\r\n ];\r\n return;\r\n }\r\n var _a = getPaddingBox(padding || {}), left = _a.left, top = _a.top, bottom = _a.bottom, right = _a.right;\r\n var n = is3d ? 4 : 3;\r\n // const clipPathInfo = getClipPath(\r\n // props.target,\r\n // offsetWidth,\r\n // offsetHeight,\r\n // );\r\n // if (clipPathInfo) {\r\n // left -= Math.max(0, clipPathInfo.left);\r\n // top -= Math.max(0, clipPathInfo.top);\r\n // bottom -= Math.max(0, offsetHeight - clipPathInfo.bottom);\r\n // right -= Math.max(0, offsetWidth - clipPathInfo.right);\r\n // }\r\n var absoluteOrigin = [];\r\n if (isPersisted) {\r\n absoluteOrigin = transformOrigin;\r\n }\r\n else if (this.controlBox && props.groupable) {\r\n absoluteOrigin = originalBeforeOrigin;\r\n }\r\n else {\r\n absoluteOrigin = plus(originalBeforeOrigin, [stateLeft, stateTop]);\r\n }\r\n var nextMatrix = multiplies(n, createOriginMatrix(absoluteOrigin.map(function (v) { return -v; }), n), allMatrix, createOriginMatrix(transformOrigin, n));\r\n var renderPos1 = calculatePadding(nextMatrix, pos1, [-left, -top], n);\r\n var renderPos2 = calculatePadding(nextMatrix, pos2, [right, -top], n);\r\n var renderPos3 = calculatePadding(nextMatrix, pos3, [-left, bottom], n);\r\n var renderPos4 = calculatePadding(nextMatrix, pos4, [right, bottom], n);\r\n state.renderPoses = [\r\n renderPos1,\r\n renderPos2,\r\n renderPos3,\r\n renderPos4,\r\n ];\r\n state.renderLines = [\r\n [renderPos1, renderPos2],\r\n [renderPos2, renderPos4],\r\n [renderPos4, renderPos3],\r\n [renderPos3, renderPos1],\r\n ];\r\n if (zoom) {\r\n var zoomOffset = zoom / 2;\r\n state.renderLines = [\r\n [\r\n calculatePadding(nextMatrix, pos1, [-left - zoomOffset, -top], n),\r\n calculatePadding(nextMatrix, pos2, [right + zoomOffset, -top], n),\r\n ],\r\n [\r\n calculatePadding(nextMatrix, pos2, [right, -top - zoomOffset], n),\r\n calculatePadding(nextMatrix, pos4, [right, bottom + zoomOffset], n),\r\n ],\r\n [\r\n calculatePadding(nextMatrix, pos4, [right + zoomOffset, bottom], n),\r\n calculatePadding(nextMatrix, pos3, [-left - zoomOffset, bottom], n),\r\n ],\r\n [\r\n calculatePadding(nextMatrix, pos3, [-left, bottom + zoomOffset], n),\r\n calculatePadding(nextMatrix, pos1, [-left, -top - zoomOffset], n),\r\n ],\r\n ];\r\n }\r\n };\r\n MoveableManager.prototype.checkUpdate = function () {\r\n this._isPropTargetChanged = false;\r\n var _a = this.props, target = _a.target, container = _a.container, parentMoveable = _a.parentMoveable;\r\n var _b = this.state, stateTarget = _b.target, stateContainer = _b.container;\r\n if (!stateTarget && !target) {\r\n return;\r\n }\r\n this.updateAbles();\r\n var isTargetChanged = !equals(stateTarget, target);\r\n var isChanged = isTargetChanged || !equals(stateContainer, container);\r\n if (!isChanged) {\r\n return;\r\n }\r\n var moveableContainer = container || this.controlBox;\r\n if (moveableContainer) {\r\n this.unsetAbles();\r\n }\r\n this.updateState({ target: target, container: container });\r\n if (!parentMoveable && moveableContainer) {\r\n this.updateRect(\"End\", false, false);\r\n }\r\n this._isPropTargetChanged = isTargetChanged;\r\n };\r\n MoveableManager.prototype.waitToChangeTarget = function () {\r\n return new Promise(function () { });\r\n };\r\n MoveableManager.prototype.triggerEvent = function (name, e) {\r\n var props = this.props;\r\n this._emitter.trigger(name, e);\r\n if (props.parentMoveable && e.isRequest && !e.isRequestChild) {\r\n return props.parentMoveable.triggerEvent(name, e, true);\r\n }\r\n var callback = props[name];\r\n return callback && callback(e);\r\n };\r\n MoveableManager.prototype.useCSS = function (tag, css) {\r\n var customStyleMap = this.props.customStyledMap;\r\n var key = tag + css;\r\n if (!customStyleMap[key]) {\r\n customStyleMap[key] = styled(tag, css);\r\n }\r\n return customStyleMap[key];\r\n };\r\n MoveableManager.prototype.getState = function () {\r\n var _a;\r\n var props = this.props;\r\n if (props.target || ((_a = props.targets) === null || _a === void 0 ? void 0 : _a.length)) {\r\n this._hasFirstTarget = true;\r\n }\r\n var hasControlBox = this.controlBox;\r\n var persistData = props.persistData;\r\n var firstRenderState = props.firstRenderState;\r\n if (firstRenderState && !hasControlBox) {\r\n return firstRenderState;\r\n }\r\n if (!this._hasFirstTarget && persistData) {\r\n var persistState = getPersistState(persistData);\r\n if (persistState) {\r\n this.updateState(persistState, false);\r\n return this.state;\r\n }\r\n }\r\n this.state.isPersisted = false;\r\n return this.state;\r\n };\r\n MoveableManager.prototype.updateSelectors = function () { };\r\n MoveableManager.prototype.unsetAbles = function () {\r\n var _this = this;\r\n this.targetAbles.forEach(function (able) {\r\n if (able.unset) {\r\n able.unset(_this);\r\n }\r\n });\r\n };\r\n MoveableManager.prototype.updateAbles = function (ables, eventAffix) {\r\n if (ables === void 0) { ables = this.props.ables; }\r\n if (eventAffix === void 0) { eventAffix = \"\"; }\r\n var props = this.props;\r\n var triggerAblesSimultaneously = props.triggerAblesSimultaneously;\r\n var enabledAbles = this.getEnabledAbles(ables);\r\n var dragStart = \"drag\".concat(eventAffix, \"Start\");\r\n var pinchStart = \"pinch\".concat(eventAffix, \"Start\");\r\n var dragControlStart = \"drag\".concat(eventAffix, \"ControlStart\");\r\n var targetAbles = filterAbles(enabledAbles, [dragStart, pinchStart], triggerAblesSimultaneously);\r\n var controlAbles = filterAbles(enabledAbles, [dragControlStart], triggerAblesSimultaneously);\r\n this.enabledAbles = enabledAbles;\r\n this.targetAbles = targetAbles;\r\n this.controlAbles = controlAbles;\r\n };\r\n MoveableManager.prototype.updateState = function (nextState, isSetState) {\r\n if (isSetState) {\r\n if (this.isUnmounted) {\r\n return;\r\n }\r\n this.setState(nextState);\r\n }\r\n else {\r\n var state = this.state;\r\n for (var name_3 in nextState) {\r\n state[name_3] = nextState[name_3];\r\n }\r\n }\r\n };\r\n MoveableManager.prototype.getEnabledAbles = function (ables) {\r\n if (ables === void 0) { ables = this.props.ables; }\r\n var props = this.props;\r\n return ables.filter(function (able) { return able && ((able.always && props[able.name] !== false)\r\n || props[able.name]); });\r\n };\r\n MoveableManager.prototype.renderAbles = function () {\r\n var _this = this;\r\n var props = this.props;\r\n var triggerAblesSimultaneously = props.triggerAblesSimultaneously;\r\n var Renderer = {\r\n createElement: createElement,\r\n };\r\n this.renderState = {};\r\n return groupByMap(flat(filterAbles(this.getEnabledAbles(), [\"render\"], triggerAblesSimultaneously).map(function (_a) {\r\n var render = _a.render;\r\n return render(_this, Renderer) || [];\r\n })).filter(function (el) { return el; }), function (_a) {\r\n var key = _a.key;\r\n return key;\r\n }).map(function (group) { return group[0]; });\r\n };\r\n MoveableManager.prototype.updateCheckInput = function () {\r\n this.targetGesto && (this.targetGesto.options.checkInput = this.props.checkInput);\r\n };\r\n MoveableManager.prototype._getRequestStyles = function () {\r\n var styleNames = this.getEnabledAbles().reduce(function (names, able) {\r\n var _a, _b;\r\n var ableStyleNames = ((_b = (_a = able.requestStyle) === null || _a === void 0 ? void 0 : _a.call(able)) !== null && _b !== void 0 ? _b : []);\r\n return __spreadArray(__spreadArray([], __read(names), false), __read(ableStyleNames), false);\r\n }, __spreadArray([], __read((this.props.requestStyles || [])), false));\r\n return styleNames;\r\n };\r\n MoveableManager.prototype._updateObserver = function (prevProps) {\r\n this._updateResizeObserver(prevProps);\r\n this._updateMutationObserver(prevProps);\r\n };\r\n MoveableManager.prototype._updateEvents = function () {\r\n var controlBoxElement = this.controlBox;\r\n var hasTargetAble = this.targetAbles.length;\r\n var hasControlAble = this.controlAbles.length;\r\n var target = this._dragTarget;\r\n var isUnset = (!hasTargetAble && this.targetGesto)\r\n || this._isTargetChanged(true);\r\n if (isUnset) {\r\n unsetGesto(this, false);\r\n this.updateState({ gestos: {} });\r\n }\r\n if (!hasControlAble) {\r\n unsetGesto(this, true);\r\n }\r\n if (target && hasTargetAble && !this.targetGesto) {\r\n this.targetGesto = getTargetAbleGesto(this, target, \"\");\r\n }\r\n if (!this.controlGesto && hasControlAble) {\r\n this.controlGesto = getAbleGesto(this, controlBoxElement, \"controlAbles\", \"Control\");\r\n }\r\n };\r\n MoveableManager.prototype._updateTargets = function () {\r\n var props = this.props;\r\n this._prevPropTarget = this._propTarget;\r\n this._prevDragTarget = this._dragTarget;\r\n this._prevOriginalDragTarget = this._originalDragTarget;\r\n this._prevDragArea = props.dragArea;\r\n this._propTarget = props.target;\r\n this._originalDragTarget = props.dragTarget || props.target;\r\n this._dragTarget = getRefTarget(this._originalDragTarget, true);\r\n };\r\n MoveableManager.prototype._renderLines = function () {\r\n var props = this.props;\r\n var _a = props, zoom = _a.zoom, hideDefaultLines = _a.hideDefaultLines, hideChildMoveableDefaultLines = _a.hideChildMoveableDefaultLines, parentMoveable = _a.parentMoveable;\r\n if (hideDefaultLines || (parentMoveable && hideChildMoveableDefaultLines)) {\r\n return [];\r\n }\r\n var state = this.getState();\r\n var Renderer = {\r\n createElement: createElement,\r\n };\r\n return state.renderLines.map(function (line, i) {\r\n return renderLine(Renderer, \"\", line[0], line[1], zoom, \"render-line-\".concat(i));\r\n });\r\n };\r\n MoveableManager.prototype._isTargetChanged = function (useDragArea) {\r\n var props = this.props;\r\n var nextTarget = props.dragTarget || props.target;\r\n var prevTarget = this._prevOriginalDragTarget;\r\n var prevDragArea = this._prevDragArea;\r\n var dragArea = props.dragArea;\r\n // check target without dragArea\r\n var isDragTargetChanged = !dragArea && prevTarget !== nextTarget;\r\n var isDragAreaChanged = (useDragArea || dragArea) && prevDragArea !== dragArea;\r\n return isDragTargetChanged || isDragAreaChanged || this._prevPropTarget != this._propTarget;\r\n };\r\n MoveableManager.prototype._updateNativeEvents = function () {\r\n var _this = this;\r\n var props = this.props;\r\n var target = props.dragArea ? this.areaElement : this.state.target;\r\n var events = this.events;\r\n var eventKeys = getKeys(events);\r\n if (this._isTargetChanged()) {\r\n for (var eventName in events) {\r\n var manager = events[eventName];\r\n manager && manager.destroy();\r\n events[eventName] = null;\r\n }\r\n }\r\n if (!target) {\r\n return;\r\n }\r\n var enabledAbles = this.enabledAbles;\r\n eventKeys.forEach(function (eventName) {\r\n var ables = filterAbles(enabledAbles, [eventName]);\r\n var hasAbles = ables.length > 0;\r\n var manager = events[eventName];\r\n if (!hasAbles) {\r\n if (manager) {\r\n manager.destroy();\r\n events[eventName] = null;\r\n }\r\n return;\r\n }\r\n if (!manager) {\r\n manager = new EventManager(target, _this, eventName);\r\n events[eventName] = manager;\r\n }\r\n manager.setAbles(ables);\r\n });\r\n };\r\n MoveableManager.prototype._checkUpdateRootContainer = function () {\r\n var rootContainer = this.props.rootContainer;\r\n if (!this._rootContainer && rootContainer) {\r\n this._rootContainer = getRefTarget(rootContainer, true);\r\n }\r\n };\r\n MoveableManager.prototype._checkUpdateViewContainer = function () {\r\n var viewContainerOption = this.props.viewContainer;\r\n if (!this._viewContainer && viewContainerOption) {\r\n this._viewContainer = getRefTarget(viewContainerOption, true);\r\n }\r\n var viewContainer = this._viewContainer;\r\n if (viewContainer) {\r\n this._changeAbleViewClassNames(__spreadArray(__spreadArray([], __read(this._getAbleViewClassNames()), false), [\r\n this.isDragging() ? VIEW_DRAGGING : \"\",\r\n ], false));\r\n }\r\n };\r\n MoveableManager.prototype._changeAbleViewClassNames = function (classNames) {\r\n var viewContainer = this._viewContainer;\r\n var nextClassNames = groupBy(classNames.filter(Boolean), function (el) { return el; }).map(function (_a) {\r\n var _b = __read(_a, 1), className = _b[0];\r\n return className;\r\n });\r\n var prevClassNames = this._viewClassNames;\r\n var _a = diff$1(prevClassNames, nextClassNames), removed = _a.removed, added = _a.added;\r\n removed.forEach(function (index) {\r\n removeClass(viewContainer, prevClassNames[index]);\r\n });\r\n added.forEach(function (index) {\r\n addClass(viewContainer, nextClassNames[index]);\r\n });\r\n this._viewClassNames = nextClassNames;\r\n };\r\n MoveableManager.prototype._getAbleViewClassNames = function () {\r\n var _this = this;\r\n return (this.getEnabledAbles().map(function (able) {\r\n var _a;\r\n return (((_a = able.viewClassName) === null || _a === void 0 ? void 0 : _a.call(able, _this)) || \"\");\r\n }).join(\" \") + \" \".concat(this._getAbleClassName(\"-view\"))).split(/\\s+/g);\r\n };\r\n MoveableManager.prototype._getAbleClassName = function (classPrefix) {\r\n var _this = this;\r\n if (classPrefix === void 0) { classPrefix = \"\"; }\r\n var ables = this.getEnabledAbles();\r\n var targetGesto = this.targetGesto;\r\n var controlGesto = this.controlGesto;\r\n var targetGestoData = (targetGesto === null || targetGesto === void 0 ? void 0 : targetGesto.isFlag())\r\n ? targetGesto.getEventData() : {};\r\n var controlGestoData = (controlGesto === null || controlGesto === void 0 ? void 0 : controlGesto.isFlag())\r\n ? controlGesto.getEventData() : {};\r\n return ables.map(function (able) {\r\n var _a, _b, _c;\r\n var name = able.name;\r\n var className = ((_a = able.className) === null || _a === void 0 ? void 0 : _a.call(able, _this)) || \"\";\r\n if (((_b = targetGestoData[name]) === null || _b === void 0 ? void 0 : _b.isEventStart)\r\n || ((_c = controlGestoData[name]) === null || _c === void 0 ? void 0 : _c.isEventStart)) {\r\n className += \" \".concat(prefix(\"\".concat(name).concat(classPrefix, \"-dragging\")));\r\n }\r\n return className.trim();\r\n }).filter(Boolean).join(\" \");\r\n };\r\n MoveableManager.prototype._updateResizeObserver = function (prevProps) {\r\n var _a;\r\n var props = this.props;\r\n var target = props.target;\r\n var win = getWindow(this.getControlBoxElement());\r\n if (!win.ResizeObserver || !target || !props.useResizeObserver) {\r\n (_a = this._reiszeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();\r\n return;\r\n }\r\n if (prevProps.target === target && this._reiszeObserver) {\r\n return;\r\n }\r\n var observer = new win.ResizeObserver(this.checkUpdateRect);\r\n observer.observe(target, {\r\n box: \"border-box\",\r\n });\r\n this._reiszeObserver = observer;\r\n };\r\n MoveableManager.prototype._updateMutationObserver = function (prevProps) {\r\n var _this = this;\r\n var _a;\r\n var props = this.props;\r\n var target = props.target;\r\n var win = getWindow(this.getControlBoxElement());\r\n if (!win.MutationObserver || !target || !props.useMutationObserver) {\r\n (_a = this._mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();\r\n return;\r\n }\r\n if (prevProps.target === target && this._mutationObserver) {\r\n return;\r\n }\r\n var observer = new win.MutationObserver(function (records) {\r\n var e_1, _a;\r\n try {\r\n for (var records_1 = __values(records), records_1_1 = records_1.next(); !records_1_1.done; records_1_1 = records_1.next()) {\r\n var mutation = records_1_1.value;\r\n if (mutation.type === \"attributes\" && mutation.attributeName === \"style\") {\r\n _this.checkUpdateRect();\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (records_1_1 && !records_1_1.done && (_a = records_1.return)) _a.call(records_1);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n });\r\n observer.observe(target, {\r\n attributes: true,\r\n });\r\n this._mutationObserver = observer;\r\n };\r\n MoveableManager.defaultProps = {\r\n dragTargetSelf: false,\r\n target: null,\r\n dragTarget: null,\r\n container: null,\r\n rootContainer: null,\r\n origin: true,\r\n parentMoveable: null,\r\n wrapperMoveable: null,\r\n isWrapperMounted: false,\r\n parentPosition: null,\r\n warpSelf: false,\r\n svgOrigin: \"\",\r\n dragContainer: null,\r\n useResizeObserver: false,\r\n useMutationObserver: false,\r\n preventDefault: true,\r\n linePadding: 0,\r\n controlPadding: 0,\r\n ables: [],\r\n pinchThreshold: 20,\r\n dragArea: false,\r\n passDragArea: false,\r\n transformOrigin: \"\",\r\n className: \"\",\r\n zoom: 1,\r\n triggerAblesSimultaneously: false,\r\n padding: {},\r\n pinchOutside: true,\r\n checkInput: false,\r\n dragFocusedInput: false,\r\n groupable: false,\r\n hideDefaultLines: false,\r\n cspNonce: \"\",\r\n translateZ: 0,\r\n cssStyled: null,\r\n customStyledMap: {},\r\n props: {},\r\n stopPropagation: false,\r\n preventClickDefault: false,\r\n preventClickEventOnDrag: true,\r\n flushSync: defaultSync,\r\n firstRenderState: null,\r\n persistData: null,\r\n viewContainer: null,\r\n requestStyles: [],\r\n useAccuratePosition: false,\r\n };\r\n return MoveableManager;\r\n}(React.PureComponent));\r\n/**\r\n * The target to indicate Moveable Control Box.\r\n * @name Moveable#target\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n * moveable.target = document.querySelector(\".target\");\r\n */\r\n/**\r\n * Zooms in the elements of a moveable.\r\n * @name Moveable#zoom\r\n * @default 1\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n * moveable.zoom = 2;\r\n */\r\n/**\r\n * Whether the target size is detected and updated whenever it changes.\r\n * @name Moveable#useResizeObserver\r\n * @default false\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n * moveable.useResizeObserver = true;\r\n */\r\n/**\r\n * Resize, Scale Events at edges\r\n * @name Moveable#edge\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n * moveable.edge = true;\r\n */\r\n/**\r\n * You can specify the className of the moveable controlbox.\r\n * @name Moveable#className\r\n * @default \"\"\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * className: \"\",\r\n * });\r\n *\r\n * moveable.className = \"moveable1\";\r\n */\r\n/**\r\n * The target(s) to drag Moveable target(s)\r\n * @name Moveable#dragTarget\r\n * @default target\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n * moveable.target = document.querySelector(\".target\");\r\n * moveable.dragTarget = document.querySelector(\".dragTarget\");\r\n */\r\n/**\r\n * `renderStart` event occurs at the first start of all events.\r\n * @memberof Moveable\r\n * @event renderStart\r\n * @param {Moveable.OnRenderStart} - Parameters for the `renderStart` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: document.querySelector(\".target\"),\r\n * });\r\n * moveable.on(\"renderStart\", ({ target }) => {\r\n * console.log(\"onRenderStart\", target);\r\n * });\r\n */\r\n/**\r\n * `render` event occurs before the target is drawn on the screen.\r\n * @memberof Moveable\r\n * @event render\r\n * @param {Moveable.OnRender} - Parameters for the `render` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: document.querySelector(\".target\"),\r\n * });\r\n * moveable.on(\"render\", ({ target }) => {\r\n * console.log(\"onRender\", target);\r\n * });\r\n */\r\n/**\r\n * `renderEnd` event occurs at the end of all events.\r\n * @memberof Moveable\r\n * @event renderEnd\r\n * @param {Moveable.OnRenderEnd} - Parameters for the `renderEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: document.querySelector(\".target\"),\r\n * });\r\n * moveable.on(\"renderEnd\", ({ target }) => {\r\n * console.log(\"onRenderEnd\", target);\r\n * });\r\n */\r\n/**\r\n * `renderGroupStart` event occurs at the first start of all events in group.\r\n * @memberof Moveable\r\n * @event renderGroupStart\r\n * @param {Moveable.OnRenderGroupStart} - Parameters for the `renderGroupStart` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * });\r\n * moveable.on(\"renderGroupStart\", ({ targets }) => {\r\n * console.log(\"onRenderGroupStart\", targets);\r\n * });\r\n */\r\n/**\r\n * `renderGroup` event occurs before the target is drawn on the screen in group.\r\n * @memberof Moveable\r\n * @event renderGroup\r\n * @param {Moveable.OnRenderGroup} - Parameters for the `renderGroup` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * });\r\n * moveable.on(\"renderGroup\", ({ targets }) => {\r\n * console.log(\"onRenderGroup\", targets);\r\n * });\r\n */\r\n/**\r\n * `renderGroupEnd` event occurs at the end of all events in group.\r\n * @memberof Moveable\r\n * @event renderGroupEnd\r\n * @param {Moveable.OnRenderGroupEnd} - Parameters for the `renderGroupEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * });\r\n * moveable.on(\"renderGroupEnd\", ({ targets }) => {\r\n * console.log(\"onRenderGroupEnd\", targets);\r\n * });\r\n */\n\nvar Groupable = {\r\n name: \"groupable\",\r\n props: [\r\n \"defaultGroupRotate\",\r\n \"useDefaultGroupRotate\",\r\n \"defaultGroupOrigin\",\r\n \"groupable\",\r\n \"groupableProps\",\r\n \"targetGroups\",\r\n \"hideChildMoveableDefaultLines\",\r\n ],\r\n events: [],\r\n render: function (moveable, React) {\r\n var _a;\r\n var props = moveable.props;\r\n var targets = props.targets || [];\r\n var _b = moveable.getState(), left = _b.left, top = _b.top, isPersisted = _b.isPersisted;\r\n var zoom = props.zoom || 1;\r\n var renderGroupRects = moveable.renderGroupRects;\r\n var persistDatChildren = ((_a = props.persistData) === null || _a === void 0 ? void 0 : _a.children) || [];\r\n if (isPersisted) {\r\n targets = persistDatChildren.map(function () { return null; });\r\n }\r\n else {\r\n persistDatChildren = [];\r\n }\r\n var parentPosition = watchValue(moveable, \"parentPosition\", [left, top], function (styles) { return styles.join(\",\"); });\r\n var requestStyles = watchValue(moveable, \"requestStyles\", moveable.getRequestChildStyles(), function (styles) { return styles.join(\",\"); });\r\n moveable.moveables = moveable.moveables.slice(0, targets.length);\r\n return __spreadArray(__spreadArray([], __read(targets.map(function (target, i) {\r\n return React.createElement(MoveableManager, { key: \"moveable\" + i, ref: refs(moveable, \"moveables\", i), target: target, origin: false, requestStyles: requestStyles, cssStyled: props.cssStyled, customStyledMap: props.customStyledMap, useResizeObserver: props.useResizeObserver, useMutationObserver: props.useMutationObserver, hideChildMoveableDefaultLines: props.hideChildMoveableDefaultLines, parentMoveable: moveable, parentPosition: [left, top], persistData: persistDatChildren[i], zoom: zoom });\r\n })), false), __read(flat(renderGroupRects.map(function (_a, i) {\r\n var pos1 = _a.pos1, pos2 = _a.pos2, pos3 = _a.pos3, pos4 = _a.pos4;\r\n var poses = [pos1, pos2, pos3, pos4];\r\n return [\r\n [0, 1],\r\n [1, 3],\r\n [3, 2],\r\n [2, 0],\r\n ].map(function (_a, j) {\r\n var _b = __read(_a, 2), from = _b[0], to = _b[1];\r\n return renderLine(React, \"\", minus(poses[from], parentPosition), minus(poses[to], parentPosition), zoom, \"group-rect-\".concat(i, \"-\").concat(j));\r\n });\r\n }))), false);\r\n },\r\n};\n\nvar Clickable = makeAble(\"clickable\", {\r\n props: [\r\n \"clickable\",\r\n ],\r\n events: [\r\n \"click\",\r\n \"clickGroup\",\r\n ],\r\n always: true,\r\n dragRelation: \"weak\",\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n dragStart: function () {\r\n return;\r\n },\r\n dragControlStart: function () {\r\n return;\r\n },\r\n dragGroupStart: function (moveable, e) {\r\n e.datas.inputTarget = e.inputEvent && e.inputEvent.target;\r\n },\r\n dragEnd: function (moveable, e) {\r\n var target = moveable.props.target;\r\n var inputEvent = e.inputEvent;\r\n var inputTarget = e.inputTarget;\r\n var isMoveableElement = moveable.isMoveableElement(inputTarget);\r\n var containsElement = !isMoveableElement && moveable.controlBox.contains(inputTarget);\r\n if (!inputEvent || !inputTarget || e.isDrag\r\n || moveable.isMoveableElement(inputTarget)\r\n || containsElement\r\n // External event duplicate target or dragAreaElement\r\n ) {\r\n return;\r\n }\r\n var containsTarget = target.contains(inputTarget);\r\n triggerEvent(moveable, \"onClick\", fillParams(moveable, e, {\r\n isDouble: e.isDouble,\r\n inputTarget: inputTarget,\r\n isTarget: target === inputTarget,\r\n moveableTarget: moveable.props.target,\r\n containsTarget: containsTarget,\r\n }));\r\n },\r\n dragGroupEnd: function (moveable, e) {\r\n var inputEvent = e.inputEvent;\r\n var inputTarget = e.inputTarget;\r\n if (!inputEvent || !inputTarget || e.isDrag\r\n || moveable.isMoveableElement(inputTarget)\r\n // External event duplicate target or dragAreaElement\r\n || e.datas.inputTarget === inputTarget) {\r\n return;\r\n }\r\n var targets = moveable.props.targets;\r\n var targetIndex = targets.indexOf(inputTarget);\r\n var isTarget = targetIndex > -1;\r\n var containsTarget = false;\r\n if (targetIndex === -1) {\r\n targetIndex = findIndex(targets, function (parentTarget) { return parentTarget.contains(inputTarget); });\r\n containsTarget = targetIndex > -1;\r\n }\r\n triggerEvent(moveable, \"onClickGroup\", fillParams(moveable, e, {\r\n isDouble: e.isDouble,\r\n targets: targets,\r\n inputTarget: inputTarget,\r\n targetIndex: targetIndex,\r\n isTarget: isTarget,\r\n containsTarget: containsTarget,\r\n moveableTarget: targets[targetIndex],\r\n }));\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n this.dragEnd(moveable, e);\r\n },\r\n dragGroupControlEnd: function (moveable, e) {\r\n this.dragEnd(moveable, e);\r\n },\r\n});\r\n/**\r\n * When you click on the element, the `click` event is called.\r\n * @memberof Moveable\r\n * @event click\r\n * @param {Moveable.OnClick} - Parameters for the `click` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: document.querySelector(\".target\"),\r\n * });\r\n * moveable.on(\"click\", ({ hasTarget, containsTarget, targetIndex }) => {\r\n * // If you click on an element other than the target and not included in the target, index is -1.\r\n * console.log(\"onClickGroup\", target, hasTarget, containsTarget, targetIndex);\r\n * });\r\n */\r\n/**\r\n * When you click on the element inside the group, the `clickGroup` event is called.\r\n * @memberof Moveable\r\n * @event clickGroup\r\n * @param {Moveable.OnClickGroup} - Parameters for the `clickGroup` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * });\r\n * moveable.on(\"clickGroup\", ({ inputTarget, isTarget, containsTarget, targetIndex }) => {\r\n * // If you click on an element other than the target and not included in the target, index is -1.\r\n * console.log(\"onClickGroup\", inputTarget, isTarget, containsTarget, targetIndex);\r\n * });\r\n */\n\nfunction getDraggableEvent(e) {\r\n var datas = e.originalDatas.draggable;\r\n if (!datas) {\r\n e.originalDatas.draggable = {};\r\n datas = e.originalDatas.draggable;\r\n }\r\n return __assign(__assign({}, e), { datas: datas });\r\n}\r\nvar edgeDraggable = makeAble(\"edgeDraggable\", {\r\n css: [\r\n \".edge.edgeDraggable.line {\\ncursor: move;\\n}\",\r\n ],\r\n render: function (moveable, React) {\r\n var props = moveable.props;\r\n var edge = props.edgeDraggable;\r\n if (!edge) {\r\n return [];\r\n }\r\n return renderEdgeLines(React, \"edgeDraggable\", edge, moveable.getState().renderPoses, props.zoom);\r\n },\r\n dragCondition: function (moveable, e) {\r\n var _a;\r\n var props = moveable.props;\r\n var target = (_a = e.inputEvent) === null || _a === void 0 ? void 0 : _a.target;\r\n if (!props.edgeDraggable || !target) {\r\n return false;\r\n }\r\n return !props.draggable\r\n && hasClass(target, prefix(\"direction\"))\r\n && hasClass(target, prefix(\"edge\"))\r\n && hasClass(target, prefix(\"edgeDraggable\"));\r\n },\r\n dragStart: function (moveable, e) {\r\n return Draggable.dragStart(moveable, getDraggableEvent(e));\r\n },\r\n drag: function (moveable, e) {\r\n return Draggable.drag(moveable, getDraggableEvent(e));\r\n },\r\n dragEnd: function (moveable, e) {\r\n return Draggable.dragEnd(moveable, getDraggableEvent(e));\r\n },\r\n dragGroupCondition: function (moveable, e) {\r\n var _a;\r\n var props = moveable.props;\r\n var target = (_a = e.inputEvent) === null || _a === void 0 ? void 0 : _a.target;\r\n if (!props.edgeDraggable || !target) {\r\n return false;\r\n }\r\n return !props.draggable && hasClass(target, prefix(\"direction\")) && hasClass(target, prefix(\"line\"));\r\n },\r\n dragGroupStart: function (moveable, e) {\r\n return Draggable.dragGroupStart(moveable, getDraggableEvent(e));\r\n },\r\n dragGroup: function (moveable, e) {\r\n return Draggable.dragGroup(moveable, getDraggableEvent(e));\r\n },\r\n dragGroupEnd: function (moveable, e) {\r\n return Draggable.dragGroupEnd(moveable, getDraggableEvent(e));\r\n },\r\n unset: function (moveable) {\r\n return Draggable.unset(moveable);\r\n },\r\n});\r\n/**\r\n * Whether to move by dragging the edge line (default: false)\r\n * @name Moveable.Draggable#edgeDraggable\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * draggable: true,\r\n * edgeDraggable: false,\r\n * });\r\n *\r\n * moveable.edgeDraggable = true;\r\n */\n\nvar IndividualGroupable = {\r\n name: \"individualGroupable\",\r\n props: [\r\n \"individualGroupable\",\r\n \"individualGroupableProps\",\r\n ],\r\n events: [],\r\n};\n\nvar MOVEABLE_ABLES = [\r\n BeforeRenderable,\r\n Default, Snappable, Pinchable,\r\n Draggable, edgeDraggable,\r\n Resizable, Scalable, Warpable, Rotatable,\r\n Scrollable, Padding, Origin,\r\n OriginDraggable,\r\n Clippable, Roundable, Groupable, IndividualGroupable,\r\n Clickable,\r\n DragArea,\r\n Renderable,\r\n];\r\nvar MOVEABLE_EVENTS = /*#__PURE__*/ MOVEABLE_ABLES.reduce(function (current, able) {\r\n (able.events || []).forEach(function (name) {\r\n pushSet(current, name);\r\n });\r\n return current;\r\n}, []);\r\nvar MOVEABLE_PROPS = /*#__PURE__*/ MOVEABLE_ABLES.reduce(function (current, able) {\r\n (able.props || []).forEach(function (name) {\r\n pushSet(current, name);\r\n });\r\n return current;\r\n}, []);\n\nfunction solveConstantsDistance(_a, pos) {\r\n var _b = __read(_a, 3), a = _b[0], b = _b[1], c = _b[2];\r\n return (a * pos[0] + b * pos[1] + c) / Math.sqrt(a * a + b * b);\r\n}\r\nfunction solveC(_a, pos) {\r\n var _b = __read(_a, 2), a = _b[0], b = _b[1];\r\n // ax + by + c = 0\r\n // -ax -by;\r\n return -a * pos[0] - b * pos[1];\r\n}\n\nfunction getMaxPos(poses, index) {\r\n return Math.max.apply(Math, __spreadArray([], __read(poses.map(function (_a) {\r\n var _b = __read(_a, 4), pos1 = _b[0], pos2 = _b[1], pos3 = _b[2], pos4 = _b[3];\r\n return Math.max(pos1[index], pos2[index], pos3[index], pos4[index]);\r\n })), false));\r\n}\r\nfunction getMinPos(poses, index) {\r\n return Math.min.apply(Math, __spreadArray([], __read(poses.map(function (_a) {\r\n var _b = __read(_a, 4), pos1 = _b[0], pos2 = _b[1], pos3 = _b[2], pos4 = _b[3];\r\n return Math.min(pos1[index], pos2[index], pos3[index], pos4[index]);\r\n })), false));\r\n}\r\nfunction getGroupRect(parentPoses, rotation) {\r\n var _a, _b, _c;\r\n var pos1 = [0, 0];\r\n var pos2 = [0, 0];\r\n var pos3 = [0, 0];\r\n var pos4 = [0, 0];\r\n var width = 0;\r\n var height = 0;\r\n if (!parentPoses.length) {\r\n return {\r\n pos1: pos1,\r\n pos2: pos2,\r\n pos3: pos3,\r\n pos4: pos4,\r\n minX: 0,\r\n minY: 0,\r\n maxX: 0,\r\n maxY: 0,\r\n width: width,\r\n height: height,\r\n rotation: rotation,\r\n };\r\n }\r\n var fixedRotation = throttle(rotation, TINY_NUM);\r\n if (fixedRotation % 90) {\r\n var rad = fixedRotation / 180 * Math.PI;\r\n var a1_1 = Math.tan(rad);\r\n var a2_1 = -1 / a1_1;\r\n // ax = y // -ax + y = 0 // 0 => 1\r\n // -ax = y // ax + y = 0 // 0 => 3\r\n var a1MinMax_1 = [MAX_NUM, MIN_NUM];\r\n var a1MinMaxPos_1 = [[0, 0], [0, 0]];\r\n var a2MinMax_1 = [MAX_NUM, MIN_NUM];\r\n var a2MinMaxPos_1 = [[0, 0], [0, 0]];\r\n parentPoses.forEach(function (poses) {\r\n poses.forEach(function (pos) {\r\n // const b1 = pos[1] - a1 * pos[0];\r\n // const b2 = pos[1] - a2 * pos[0];\r\n var a1Dist = solveConstantsDistance([-a1_1, 1, 0], pos);\r\n var a2Dist = solveConstantsDistance([-a2_1, 1, 0], pos);\r\n if (a1MinMax_1[0] > a1Dist) {\r\n a1MinMaxPos_1[0] = pos;\r\n a1MinMax_1[0] = a1Dist;\r\n }\r\n if (a1MinMax_1[1] < a1Dist) {\r\n a1MinMaxPos_1[1] = pos;\r\n a1MinMax_1[1] = a1Dist;\r\n }\r\n if (a2MinMax_1[0] > a2Dist) {\r\n a2MinMaxPos_1[0] = pos;\r\n a2MinMax_1[0] = a2Dist;\r\n }\r\n if (a2MinMax_1[1] < a2Dist) {\r\n a2MinMaxPos_1[1] = pos;\r\n a2MinMax_1[1] = a2Dist;\r\n }\r\n });\r\n });\r\n var _d = __read(a1MinMaxPos_1, 2), a1MinPos = _d[0], a1MaxPos = _d[1];\r\n var _e = __read(a2MinMaxPos_1, 2), a2MinPos = _e[0], a2MaxPos = _e[1];\r\n var minHorizontalLine = [-a1_1, 1, solveC([-a1_1, 1], a1MinPos)];\r\n var maxHorizontalLine = [-a1_1, 1, solveC([-a1_1, 1], a1MaxPos)];\r\n var minVerticalLine = [-a2_1, 1, solveC([-a2_1, 1], a2MinPos)];\r\n var maxVerticalLine = [-a2_1, 1, solveC([-a2_1, 1], a2MaxPos)];\r\n _a = __read([\r\n [minHorizontalLine, minVerticalLine],\r\n [minHorizontalLine, maxVerticalLine],\r\n [maxHorizontalLine, minVerticalLine],\r\n [maxHorizontalLine, maxVerticalLine],\r\n ].map(function (_a) {\r\n var _b = __read(_a, 2), line1 = _b[0], line2 = _b[1];\r\n return getIntersectionPointsByConstants(line1, line2)[0];\r\n }), 4), pos1 = _a[0], pos2 = _a[1], pos3 = _a[2], pos4 = _a[3];\r\n width = a2MinMax_1[1] - a2MinMax_1[0];\r\n height = a1MinMax_1[1] - a1MinMax_1[0];\r\n }\r\n else {\r\n var minX_1 = getMinPos(parentPoses, 0);\r\n var minY_1 = getMinPos(parentPoses, 1);\r\n var maxX_1 = getMaxPos(parentPoses, 0);\r\n var maxY_1 = getMaxPos(parentPoses, 1);\r\n pos1 = [minX_1, minY_1];\r\n pos2 = [maxX_1, minY_1];\r\n pos3 = [minX_1, maxY_1];\r\n pos4 = [maxX_1, maxY_1];\r\n width = maxX_1 - minX_1;\r\n height = maxY_1 - minY_1;\r\n if (fixedRotation % 180) {\r\n // 0\r\n // 1 2\r\n // 3 4\r\n // 90\r\n // 3 1\r\n // 4 2\r\n // 180\r\n // 4 3\r\n // 2 1\r\n // 270\r\n // 2 4\r\n // 1 3\r\n // 1, 2, 3,4 = 3 1 4 2\r\n var changedX = [pos3, pos1, pos4, pos2];\r\n _b = __read(changedX, 4), pos1 = _b[0], pos2 = _b[1], pos3 = _b[2], pos4 = _b[3];\r\n width = maxY_1 - minY_1;\r\n height = maxX_1 - minX_1;\r\n }\r\n }\r\n if (fixedRotation % 360 > 180) {\r\n // 1 2 4 3\r\n // 3 4 2 1\r\n var changedX = [pos4, pos3, pos2, pos1];\r\n _c = __read(changedX, 4), pos1 = _c[0], pos2 = _c[1], pos3 = _c[2], pos4 = _c[3];\r\n }\r\n var _f = getMinMaxs([pos1, pos2, pos3, pos4]), minX = _f.minX, minY = _f.minY, maxX = _f.maxX, maxY = _f.maxY;\r\n return {\r\n pos1: pos1,\r\n pos2: pos2,\r\n pos3: pos3,\r\n pos4: pos4,\r\n width: width,\r\n height: height,\r\n minX: minX,\r\n minY: minY,\r\n maxX: maxX,\r\n maxY: maxY,\r\n rotation: rotation,\r\n };\r\n}\r\nfunction findMoveableGroups(moveables, childTargetGroups) {\r\n var groups = childTargetGroups.map(function (targetGroup) {\r\n if (isArray(targetGroup)) {\r\n var childMoveableGroups = findMoveableGroups(moveables, targetGroup);\r\n var length_1 = childMoveableGroups.length;\r\n if (length_1 > 1) {\r\n return childMoveableGroups;\r\n }\r\n else if (length_1 === 1) {\r\n return childMoveableGroups[0];\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n else {\r\n var checked = find(moveables, function (_a) {\r\n var manager = _a.manager;\r\n return manager.props.target === targetGroup;\r\n });\r\n if (checked) {\r\n checked.finded = true;\r\n return checked.manager;\r\n }\r\n return null;\r\n }\r\n }).filter(Boolean);\r\n if (groups.length === 1 && isArray(groups[0])) {\r\n return groups[0];\r\n }\r\n return groups;\r\n}\r\n/**\r\n * @namespace Moveable.Group\r\n * @description You can make targets moveable.\r\n */\r\nvar MoveableGroup = /*#__PURE__*/ (function (_super) {\r\n __extends(MoveableGroup, _super);\r\n function MoveableGroup() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.differ = new ChildrenDiffer();\r\n _this.moveables = [];\r\n _this.transformOrigin = \"50% 50%\";\r\n _this.renderGroupRects = [];\r\n _this._targetGroups = [];\r\n _this._hasFirstTargets = false;\r\n return _this;\r\n }\r\n MoveableGroup.prototype.componentDidMount = function () {\r\n _super.prototype.componentDidMount.call(this);\r\n };\r\n MoveableGroup.prototype.checkUpdate = function () {\r\n this._isPropTargetChanged = false;\r\n this.updateAbles();\r\n };\r\n MoveableGroup.prototype.getTargets = function () {\r\n return this.props.targets;\r\n };\r\n MoveableGroup.prototype.updateRect = function (type, isTarget, isSetState) {\r\n var _a;\r\n if (isSetState === void 0) { isSetState = true; }\r\n var state = this.state;\r\n if (!this.controlBox || state.isPersisted) {\r\n return;\r\n }\r\n setStoreCache(true);\r\n this.moveables.forEach(function (moveable) {\r\n moveable.updateRect(type, false, false);\r\n });\r\n var props = this.props;\r\n var moveables = this.moveables;\r\n var target = state.target || props.target;\r\n var checkeds = moveables.map(function (moveable) { return ({ finded: false, manager: moveable }); });\r\n var targetGroups = this.props.targetGroups || [];\r\n var moveableGroups = findMoveableGroups(checkeds, targetGroups);\r\n var useDefaultGroupRotate = props.useDefaultGroupRotate;\r\n moveableGroups.push.apply(moveableGroups, __spreadArray([], __read(checkeds.filter(function (_a) {\r\n var finded = _a.finded;\r\n return !finded;\r\n }).map(function (_a) {\r\n var manager = _a.manager;\r\n return manager;\r\n })), false));\r\n var renderGroupRects = [];\r\n var isReset = !isTarget || (type !== \"\" && props.updateGroup);\r\n var defaultGroupRotate = props.defaultGroupRotate || 0;\r\n if (!this._hasFirstTargets) {\r\n var persistedRoatation = (_a = props.persistData) === null || _a === void 0 ? void 0 : _a.rotation;\r\n if (persistedRoatation != null) {\r\n defaultGroupRotate = persistedRoatation;\r\n }\r\n }\r\n function getMoveableGroupRect(group, parentRotation, isRoot) {\r\n var posesRotations = group.map(function (moveable) {\r\n if (isArray(moveable)) {\r\n var rect = getMoveableGroupRect(moveable, parentRotation);\r\n var poses = [rect.pos1, rect.pos2, rect.pos3, rect.pos4];\r\n renderGroupRects.push(rect);\r\n return { poses: poses, rotation: rect.rotation };\r\n }\r\n else {\r\n return {\r\n poses: getAbsolutePosesByState(moveable.state),\r\n rotation: moveable.getRotation(),\r\n };\r\n }\r\n });\r\n var rotations = posesRotations.map(function (_a) {\r\n var rotation = _a.rotation;\r\n return rotation;\r\n });\r\n var groupRotation = 0;\r\n var firstRotation = rotations[0];\r\n var isSameRotation = rotations.every(function (nextRotation) {\r\n return Math.abs(firstRotation - nextRotation) < 0.1;\r\n });\r\n if (isReset) {\r\n groupRotation = !useDefaultGroupRotate && isSameRotation ? firstRotation : defaultGroupRotate;\r\n }\r\n else {\r\n groupRotation = !useDefaultGroupRotate && !isRoot && isSameRotation ? firstRotation : parentRotation;\r\n }\r\n var groupPoses = posesRotations.map(function (_a) {\r\n var poses = _a.poses;\r\n return poses;\r\n });\r\n var groupRect = getGroupRect(groupPoses, groupRotation);\r\n return groupRect;\r\n }\r\n var rootGroupRect = getMoveableGroupRect(moveableGroups, this.rotation, true);\r\n if (isReset) {\r\n // reset rotataion\r\n this.rotation = rootGroupRect.rotation;\r\n this.transformOrigin = props.defaultGroupOrigin || \"50% 50%\";\r\n this.scale = [1, 1];\r\n }\r\n this._targetGroups = targetGroups;\r\n this.renderGroupRects = renderGroupRects;\r\n var transformOrigin = this.transformOrigin;\r\n var rotation = this.rotation;\r\n var scale = this.scale;\r\n var width = rootGroupRect.width, height = rootGroupRect.height, minX = rootGroupRect.minX, minY = rootGroupRect.minY;\r\n var posesInfo = rotatePosesInfo([\r\n [0, 0],\r\n [width, 0],\r\n [0, height],\r\n [width, height],\r\n ], convertTransformOriginArray(transformOrigin, width, height), this.rotation / 180 * Math.PI);\r\n var _b = getMinMaxs(posesInfo.result), deltaX = _b.minX, deltaY = _b.minY;\r\n var rotateScale = \" rotate(\".concat(rotation, \"deg)\")\r\n + \" scale(\".concat(sign(scale[0]), \", \").concat(sign(scale[1]), \")\");\r\n var transform = \"translate(\".concat(-deltaX, \"px, \").concat(-deltaY, \"px)\").concat(rotateScale);\r\n this.controlBox.style.transform\r\n = \"translate3d(\".concat(minX, \"px, \").concat(minY, \"px, \").concat(this.props.translateZ || 0, \")\");\r\n target.style.cssText += \"left:0px;top:0px;\"\r\n + \"transform-origin:\".concat(transformOrigin, \";\")\r\n + \"width:\".concat(width, \"px;height:\").concat(height, \"px;\")\r\n + \"transform: \".concat(transform);\r\n state.width = width;\r\n state.height = height;\r\n var container = this.getContainer();\r\n var info = getMoveableTargetInfo(this.controlBox, target, this.controlBox, this.getContainer(), this._rootContainer || container, []);\r\n var pos = [info.left, info.top];\r\n var _c = __read(getAbsolutePosesByState(info), 4), pos1 = _c[0], pos2 = _c[1], pos3 = _c[2], pos4 = _c[3]; // info.left + info.pos(1 ~ 4)\r\n var minPos = getMinMaxs([pos1, pos2, pos3, pos4]);\r\n var delta = [minPos.minX, minPos.minY];\r\n var direction = sign(scale[0] * scale[1]);\r\n info.pos1 = minus(pos1, delta);\r\n info.pos2 = minus(pos2, delta);\r\n info.pos3 = minus(pos3, delta);\r\n info.pos4 = minus(pos4, delta);\r\n // info.left = info.left + delta[0];\r\n // info.top = info.top + delta[1];\r\n info.left = minX - info.left + delta[0];\r\n info.top = minY - info.top + delta[1];\r\n info.origin = minus(plus(pos, info.origin), delta);\r\n info.beforeOrigin = minus(plus(pos, info.beforeOrigin), delta);\r\n info.originalBeforeOrigin = plus(pos, info.originalBeforeOrigin);\r\n info.transformOrigin = minus(plus(pos, info.transformOrigin), delta);\r\n target.style.transform\r\n = \"translate(\".concat(-deltaX - delta[0], \"px, \").concat(-deltaY - delta[1], \"px)\")\r\n + rotateScale;\r\n setStoreCache();\r\n this.updateState(__assign(__assign({}, info), { posDelta: delta, direction: direction, beforeDirection: direction }), isSetState);\r\n };\r\n MoveableGroup.prototype.getRect = function () {\r\n return __assign(__assign({}, _super.prototype.getRect.call(this)), { children: this.moveables.map(function (child) { return child.getRect(); }) });\r\n };\r\n MoveableGroup.prototype.triggerEvent = function (name, e, isManager) {\r\n if (isManager || name.indexOf(\"Group\") > -1) {\r\n return _super.prototype.triggerEvent.call(this, name, e);\r\n }\r\n else {\r\n this._emitter.trigger(name, e);\r\n }\r\n };\r\n MoveableGroup.prototype.getRequestChildStyles = function () {\r\n var styleNames = this.getEnabledAbles().reduce(function (names, able) {\r\n var _a, _b;\r\n var ableStyleNames = ((_b = (_a = able.requestChildStyle) === null || _a === void 0 ? void 0 : _a.call(able)) !== null && _b !== void 0 ? _b : []);\r\n return __spreadArray(__spreadArray([], __read(names), false), __read(ableStyleNames), false);\r\n }, []);\r\n return styleNames;\r\n };\r\n MoveableGroup.prototype.getMoveables = function () {\r\n return __spreadArray([], __read(this.moveables), false);\r\n };\r\n MoveableGroup.prototype.updateAbles = function () {\r\n _super.prototype.updateAbles.call(this, __spreadArray(__spreadArray([], __read(this.props.ables), false), [Groupable], false), \"Group\");\r\n };\r\n MoveableGroup.prototype._updateTargets = function () {\r\n _super.prototype._updateTargets.call(this);\r\n this._originalDragTarget = this.props.dragTarget || this.areaElement;\r\n this._dragTarget = getRefTarget(this._originalDragTarget, true);\r\n };\r\n MoveableGroup.prototype._updateEvents = function () {\r\n var state = this.state;\r\n var props = this.props;\r\n var prevTarget = this._prevDragTarget;\r\n var nextTarget = props.dragTarget || this.areaElement;\r\n var targets = props.targets;\r\n var _a = this.differ.update(targets), added = _a.added, changed = _a.changed, removed = _a.removed;\r\n var isTargetChanged = added.length || removed.length;\r\n if (isTargetChanged || this._prevOriginalDragTarget !== this._originalDragTarget) {\r\n unsetGesto(this, false);\r\n unsetGesto(this, true);\r\n this.updateState({ gestos: {} });\r\n }\r\n if (prevTarget !== nextTarget) {\r\n state.target = null;\r\n }\r\n if (!state.target) {\r\n state.target = this.areaElement;\r\n this.controlBox.style.display = \"block\";\r\n }\r\n if (state.target) {\r\n if (!this.targetGesto) {\r\n this.targetGesto = getTargetAbleGesto(this, this._dragTarget, \"Group\");\r\n }\r\n if (!this.controlGesto) {\r\n this.controlGesto = getAbleGesto(this, this.controlBox, \"controlAbles\", \"GroupControl\");\r\n }\r\n }\r\n var isContainerChanged = !equals(state.container, props.container);\r\n if (isContainerChanged) {\r\n state.container = props.container;\r\n }\r\n if (isContainerChanged\r\n || isTargetChanged\r\n || this.transformOrigin !== (props.defaultGroupOrigin || \"50% 50%\")\r\n || changed.length\r\n || targets.length && !isDeepArrayEquals(this._targetGroups, props.targetGroups || [])) {\r\n this.updateRect();\r\n this._hasFirstTargets = true;\r\n }\r\n this._isPropTargetChanged = !!isTargetChanged;\r\n };\r\n MoveableGroup.prototype._updateObserver = function () { };\r\n MoveableGroup.defaultProps = __assign(__assign({}, MoveableManager.defaultProps), { transformOrigin: [\"50%\", \"50%\"], groupable: true, dragArea: true, keepRatio: true, targets: [], defaultGroupRotate: 0, defaultGroupOrigin: \"50% 50%\" });\r\n return MoveableGroup;\r\n}(MoveableManager));\n\n/**\r\n * @namespace Moveable.IndividualGroup\r\n * @description Create targets individually, not as a group.Create targets individually, not as a group.\r\n */\r\nvar MoveableIndividualGroup = /*#__PURE__*/ (function (_super) {\r\n __extends(MoveableIndividualGroup, _super);\r\n function MoveableIndividualGroup() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.moveables = [];\r\n return _this;\r\n }\r\n MoveableIndividualGroup.prototype.render = function () {\r\n var _this = this;\r\n var _a;\r\n var props = this.props;\r\n var cspNonce = props.cspNonce, ControlBoxElement = props.cssStyled, persistData = props.persistData;\r\n var targets = props.targets || [];\r\n var length = targets.length;\r\n var canPersist = this.isUnmounted || !length;\r\n var persistDatChildren = (_a = persistData === null || persistData === void 0 ? void 0 : persistData.children) !== null && _a !== void 0 ? _a : [];\r\n if (canPersist && !length && persistDatChildren.length) {\r\n targets = persistDatChildren.map(function () { return null; });\r\n }\r\n else if (!canPersist) {\r\n persistDatChildren = [];\r\n }\r\n return React.createElement(ControlBoxElement, { cspNonce: cspNonce, ref: ref(this, \"controlBox\"), className: prefix(\"control-box\") }, targets.map(function (target, i) {\r\n var _a, _b;\r\n var individualProps = (_b = (_a = props.individualGroupableProps) === null || _a === void 0 ? void 0 : _a.call(props, target, i)) !== null && _b !== void 0 ? _b : {};\r\n return React.createElement(MoveableManager, __assign({ key: \"moveable\" + i, ref: refs(_this, \"moveables\", i) }, props, individualProps, { target: target, wrapperMoveable: _this, isWrapperMounted: _this.isMoveableMounted, persistData: persistDatChildren[i] }));\r\n }));\r\n };\r\n MoveableIndividualGroup.prototype.componentDidMount = function () { };\r\n MoveableIndividualGroup.prototype.componentDidUpdate = function () { };\r\n MoveableIndividualGroup.prototype.getTargets = function () {\r\n return this.props.targets;\r\n };\r\n MoveableIndividualGroup.prototype.updateRect = function (type, isTarget, isSetState) {\r\n if (isSetState === void 0) { isSetState = true; }\r\n setStoreCache(true);\r\n this.moveables.forEach(function (moveable) {\r\n moveable.updateRect(type, isTarget, isSetState);\r\n });\r\n setStoreCache();\r\n };\r\n MoveableIndividualGroup.prototype.getRect = function () {\r\n return __assign(__assign({}, _super.prototype.getRect.call(this)), { children: this.moveables.map(function (child) { return child.getRect(); }) });\r\n };\r\n MoveableIndividualGroup.prototype.request = function (ableName, param, isInstant) {\r\n if (param === void 0) { param = {}; }\r\n var results = this.moveables.map(function (m) { return m.request(ableName, __assign(__assign({}, param), { isInstant: false }), false); });\r\n var requestInstant = isInstant || param.isInstant;\r\n var requester = {\r\n request: function (ableParam) {\r\n results.forEach(function (r) { return r.request(ableParam); });\r\n return this;\r\n },\r\n requestEnd: function () {\r\n results.forEach(function (r) { return r.requestEnd(); });\r\n return this;\r\n },\r\n };\r\n return requestInstant ? requester.request(param).requestEnd() : requester;\r\n };\r\n MoveableIndividualGroup.prototype.dragStart = function (e) {\r\n var inputTarget = e.target;\r\n var childMoveable = find(this.moveables, function (child) {\r\n var target = child.getTargets()[0];\r\n var controlBoxElement = child.getControlBoxElement();\r\n var dragElement = child.getDragElement();\r\n if (!target || !dragElement) {\r\n return false;\r\n }\r\n return dragElement === inputTarget || dragElement.contains(inputTarget)\r\n || (dragElement !== target && target === inputTarget || target.contains(inputTarget))\r\n || controlBoxElement === inputTarget || controlBoxElement.contains(inputTarget);\r\n });\r\n if (childMoveable) {\r\n childMoveable.dragStart(e);\r\n }\r\n return this;\r\n };\r\n MoveableIndividualGroup.prototype.hitTest = function () {\r\n return 0;\r\n };\r\n MoveableIndividualGroup.prototype.isInside = function () {\r\n return false;\r\n };\r\n MoveableIndividualGroup.prototype.isDragging = function () {\r\n return false;\r\n };\r\n MoveableIndividualGroup.prototype.getDragElement = function () {\r\n return null;\r\n };\r\n MoveableIndividualGroup.prototype.getMoveables = function () {\r\n return __spreadArray([], __read(this.moveables), false);\r\n };\r\n MoveableIndividualGroup.prototype.updateRenderPoses = function () { };\r\n MoveableIndividualGroup.prototype.checkUpdate = function () { };\r\n MoveableIndividualGroup.prototype.triggerEvent = function () { };\r\n MoveableIndividualGroup.prototype.updateAbles = function () { };\r\n MoveableIndividualGroup.prototype._updateEvents = function () { };\r\n MoveableIndividualGroup.prototype._updateObserver = function () { };\r\n return MoveableIndividualGroup;\r\n}(MoveableManager));\n\nfunction getElementTargets(refTargets, selectorMap) {\r\n var elementTargets = [];\r\n refTargets.forEach(function (target) {\r\n if (!target) {\r\n return;\r\n }\r\n if (isString(target)) {\r\n if (selectorMap[target]) {\r\n elementTargets.push.apply(elementTargets, __spreadArray([], __read(selectorMap[target]), false));\r\n }\r\n return;\r\n }\r\n if (isArray(target)) {\r\n elementTargets.push.apply(elementTargets, __spreadArray([], __read(getElementTargets(target, selectorMap)), false));\r\n }\r\n else {\r\n elementTargets.push(target);\r\n }\r\n });\r\n return elementTargets;\r\n}\r\nfunction getTargetGroups(refTargets, selectorMap) {\r\n var targetGroups = [];\r\n refTargets.forEach(function (target) {\r\n if (!target) {\r\n return;\r\n }\r\n if (isString(target)) {\r\n if (selectorMap[target]) {\r\n targetGroups.push.apply(targetGroups, __spreadArray([], __read(selectorMap[target]), false));\r\n }\r\n return;\r\n }\r\n if (isArray(target)) {\r\n targetGroups.push(getTargetGroups(target, selectorMap));\r\n }\r\n else {\r\n targetGroups.push(target);\r\n }\r\n });\r\n return targetGroups;\r\n}\r\nfunction compareRefTargets(prevRefTargets, nextRefTargets) {\r\n return (prevRefTargets.length !== nextRefTargets.length) || prevRefTargets.some(function (target, i) {\r\n var nextTarget = nextRefTargets[i];\r\n if (!target && !nextTarget) {\r\n return false;\r\n }\r\n else if (target != nextTarget) {\r\n if (isArray(target) && isArray(nextTarget)) {\r\n return compareRefTargets(target, nextTarget);\r\n }\r\n return true;\r\n }\r\n return false;\r\n });\r\n}\r\nvar InitialMoveable = /*#__PURE__*/ (function (_super) {\r\n __extends(InitialMoveable, _super);\r\n function InitialMoveable() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.refTargets = [];\r\n _this.selectorMap = {};\r\n _this._differ = new ChildrenDiffer();\r\n _this._elementTargets = [];\r\n _this._tmpRefTargets = [];\r\n _this._tmpSelectorMap = {};\r\n _this._onChangeTargets = null;\r\n return _this;\r\n }\r\n InitialMoveable.makeStyled = function () {\r\n var cssMap = {};\r\n var ables = this.getTotalAbles();\r\n ables.forEach(function (_a) {\r\n var css = _a.css;\r\n if (!css) {\r\n return;\r\n }\r\n css.forEach(function (text) {\r\n cssMap[text] = true;\r\n });\r\n });\r\n var style = getKeys(cssMap).join(\"\\n\");\r\n this.defaultStyled = styled(\"div\", prefixCSS(PREFIX, MOVEABLE_CSS + style));\r\n };\r\n InitialMoveable.getTotalAbles = function () {\r\n return __spreadArray([Default, Groupable, IndividualGroupable, DragArea], __read(this.defaultAbles), false);\r\n };\r\n InitialMoveable.prototype.render = function () {\r\n var _a;\r\n var moveableContructor = this.constructor;\r\n if (!moveableContructor.defaultStyled) {\r\n moveableContructor.makeStyled();\r\n }\r\n var _b = this.props, userAbles = _b.ables, userProps = _b.props, props = __rest(_b, [\"ables\", \"props\"]);\r\n var _c = __read(this._updateRefs(true), 2), refTargets = _c[0], nextSelectorMap = _c[1];\r\n var elementTargets = getElementTargets(refTargets, nextSelectorMap);\r\n var isGroup = elementTargets.length > 1;\r\n var totalAbles = moveableContructor.getTotalAbles();\r\n var ables = __spreadArray(__spreadArray([], __read(totalAbles), false), __read((userAbles || [])), false);\r\n var nextProps = __assign(__assign(__assign({}, props), (userProps || {})), { ables: ables, cssStyled: moveableContructor.defaultStyled, customStyledMap: moveableContructor.customStyledMap });\r\n this._elementTargets = elementTargets;\r\n var firstRenderState = null;\r\n var prevMoveable = this.moveable;\r\n var persistData = props.persistData;\r\n if (persistData === null || persistData === void 0 ? void 0 : persistData.children) {\r\n isGroup = true;\r\n }\r\n // Even one child is treated as a group if individualGroupable is enabled. #867\r\n if (props.individualGroupable) {\r\n return React.createElement(MoveableIndividualGroup, __assign({ key: \"individual-group\", ref: ref(this, \"moveable\") }, nextProps, { target: null, targets: elementTargets }));\r\n }\r\n if (isGroup) {\r\n var targetGroups = getTargetGroups(refTargets, nextSelectorMap);\r\n // manager\r\n if (prevMoveable && !prevMoveable.props.groupable && !prevMoveable.props.individualGroupable) {\r\n var target = prevMoveable.props.target;\r\n if (target && elementTargets.indexOf(target) > -1) {\r\n firstRenderState = __assign({}, prevMoveable.state);\r\n }\r\n }\r\n return React.createElement(MoveableGroup, __assign({ key: \"group\", ref: ref(this, \"moveable\") }, nextProps, (_a = props.groupableProps) !== null && _a !== void 0 ? _a : {}, { target: null, targets: elementTargets, targetGroups: targetGroups, firstRenderState: firstRenderState }));\r\n }\r\n else {\r\n var target_1 = elementTargets[0];\r\n // manager\r\n if (prevMoveable && (prevMoveable.props.groupable || prevMoveable.props.individualGroupable)) {\r\n var moveables = prevMoveable.moveables || [];\r\n var prevTargetMoveable = find(moveables, function (mv) { return mv.props.target === target_1; });\r\n if (prevTargetMoveable) {\r\n firstRenderState = __assign({}, prevTargetMoveable.state);\r\n }\r\n }\r\n return React.createElement(MoveableManager, __assign({ key: \"single\", ref: ref(this, \"moveable\") }, nextProps, { target: target_1, firstRenderState: firstRenderState }));\r\n }\r\n };\r\n InitialMoveable.prototype.componentDidMount = function () {\r\n this._checkChangeTargets();\r\n };\r\n InitialMoveable.prototype.componentDidUpdate = function () {\r\n this._checkChangeTargets();\r\n };\r\n InitialMoveable.prototype.componentWillUnmount = function () {\r\n this.selectorMap = {};\r\n this.refTargets = [];\r\n };\r\n /**\r\n * Get targets set in moveable through target or targets of props.\r\n * @method Moveable#getTargets\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [targetRef, \".target\", document.querySelectorAll(\".target\")],\r\n * });\r\n *\r\n * console.log(moveable.getTargets());\r\n */\r\n InitialMoveable.prototype.getTargets = function () {\r\n var _a, _b;\r\n return (_b = (_a = this.moveable) === null || _a === void 0 ? void 0 : _a.getTargets()) !== null && _b !== void 0 ? _b : [];\r\n };\r\n /**\r\n * If the element list corresponding to the selector among the targets is changed, it is updated.\r\n * @method Moveable#updateSelectors\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: \".target\",\r\n * });\r\n *\r\n * moveable.updateSelectors();\r\n */\r\n InitialMoveable.prototype.updateSelectors = function () {\r\n this.selectorMap = {};\r\n this._updateRefs();\r\n };\r\n /**\r\n * User changes target and waits for target to change.\r\n * @method Moveable#waitToChangeTarget\r\n * @story combination-with-other-components--components-selecto\r\n * @example\r\n * document.querySelector(\".target\").addEventListener(\"mousedown\", e => {\r\n * moveable.waitToChangeTarget().then(() => {\r\n * moveable.dragStart(e.currentTarget);\r\n * });\r\n * moveable.target = e.currentTarget;\r\n * });\r\n */\r\n InitialMoveable.prototype.waitToChangeTarget = function () {\r\n // let resolvePromise: (e: OnChangeTarget) => void;\r\n var _this = this;\r\n // this._onChangeTargets = () => {\r\n // this._onChangeTargets = null;\r\n // resolvePromise({\r\n // moveable: this.getManager(),\r\n // targets: this._elementTargets,\r\n // });\r\n // };\r\n // return new Promise(resolve => {\r\n // resolvePromise = resolve;\r\n // });\r\n var resolvePromise;\r\n this._onChangeTargets = function () {\r\n _this._onChangeTargets = null;\r\n resolvePromise();\r\n };\r\n return new Promise(function (resolve) {\r\n resolvePromise = resolve;\r\n });\r\n };\r\n InitialMoveable.prototype.waitToChangeTargets = function () {\r\n return this.waitToChangeTarget();\r\n };\r\n InitialMoveable.prototype.getManager = function () {\r\n return this.moveable;\r\n };\r\n InitialMoveable.prototype.getMoveables = function () {\r\n return this.moveable.getMoveables();\r\n };\r\n InitialMoveable.prototype.getDragElement = function () {\r\n return this.moveable.getDragElement();\r\n };\r\n InitialMoveable.prototype._updateRefs = function (isRender) {\r\n var prevRefTargets = this.refTargets;\r\n var nextRefTargets = getRefTargets((this.props.target || this.props.targets));\r\n var isBrowser = typeof document !== \"undefined\";\r\n var isUpdate = compareRefTargets(prevRefTargets, nextRefTargets);\r\n var selectorMap = this.selectorMap;\r\n var nextSelectorMap = {};\r\n this.refTargets.forEach(function updateSelectorMap(target) {\r\n if (isString(target)) {\r\n var selectorTarget = selectorMap[target];\r\n if (selectorTarget) {\r\n nextSelectorMap[target] = selectorMap[target];\r\n }\r\n else if (isBrowser) {\r\n isUpdate = true;\r\n nextSelectorMap[target] = [].slice.call(document.querySelectorAll(target));\r\n }\r\n }\r\n else if (isArray(target)) {\r\n target.forEach(updateSelectorMap);\r\n }\r\n });\r\n this._tmpRefTargets = nextRefTargets;\r\n this._tmpSelectorMap = nextSelectorMap;\r\n return [\r\n nextRefTargets,\r\n nextSelectorMap,\r\n !isRender && isUpdate,\r\n ];\r\n };\r\n InitialMoveable.prototype._checkChangeTargets = function () {\r\n var _a, _b, _c;\r\n this.refTargets = this._tmpRefTargets;\r\n this.selectorMap = this._tmpSelectorMap;\r\n var _d = this._differ.update(this._elementTargets), added = _d.added, removed = _d.removed;\r\n var isTargetChanged = added.length || removed.length;\r\n if (isTargetChanged) {\r\n (_b = (_a = this.props).onChangeTargets) === null || _b === void 0 ? void 0 : _b.call(_a, {\r\n moveable: this.moveable,\r\n targets: this._elementTargets,\r\n });\r\n (_c = this._onChangeTargets) === null || _c === void 0 ? void 0 : _c.call(this);\r\n }\r\n var _e = __read(this._updateRefs(), 3), refTargets = _e[0], selectorMap = _e[1], isUpdate = _e[2];\r\n this.refTargets = refTargets;\r\n this.selectorMap = selectorMap;\r\n if (isUpdate) {\r\n this.forceUpdate();\r\n }\r\n };\r\n InitialMoveable.defaultAbles = [];\r\n InitialMoveable.customStyledMap = {};\r\n InitialMoveable.defaultStyled = null;\r\n __decorate([\r\n withMethods(MOVEABLE_METHODS)\r\n ], InitialMoveable.prototype, \"moveable\", void 0);\r\n return InitialMoveable;\r\n}(React.PureComponent));\n\nvar Moveable = /*#__PURE__*/ (function (_super) {\r\n __extends(Moveable, _super);\r\n function Moveable() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Moveable.defaultAbles = MOVEABLE_ABLES;\r\n return Moveable;\r\n}(InitialMoveable));\n\nfunction makeMoveable(ables) {\r\n var _a;\r\n return _a = /*#__PURE__*/ (function (_super) {\r\n __extends(Moveable, _super);\r\n function Moveable() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return Moveable;\r\n }(InitialMoveable)),\r\n _a.defaultAbles = ables,\r\n _a;\r\n}\n\nexport { Clippable, DIRECTIONS, Draggable, edgeDraggable as EdgeDraggable, InitialMoveable, MOVEABLE_ABLES, MOVEABLE_EVENTS, MOVEABLE_METHODS, MOVEABLE_PROPS, Pinchable, Resizable, Rotatable, Roundable, Scalable, Snappable, Warpable, calculateElementPosition, Moveable as default, getElementInfo, makeAble, makeMoveable };\n//# sourceMappingURL=moveable.esm.js.map\n","import * as React from \"react\";\nimport Moveable from \"react-moveable\";\nimport { ref } from \"framework-utils\";\n\nexport default class InnerMoveable extends React.Component {\n public state: any = {};\n public moveable!: Moveable;\n constructor(props: any) {\n super(props);\n this.state = this.props;\n }\n public render(): React.ReactNode {\n return ;\n }\n}\n","import {\n MOVEABLE_PROPS,\n MOVEABLE_METHODS,\n MOVEABLE_EVENTS,\n} from \"react-moveable\";\n\nexport const PROPERTIES: string[] = MOVEABLE_PROPS;\nexport const METHODS: string[] = MOVEABLE_METHODS;\nexport const EVENTS: string[] = MOVEABLE_EVENTS;\n","import { ref, Properties } from \"framework-utils\";\nimport * as React from \"react\";\nimport { renderSelf, ContainerProvider } from \"croact\";\nimport InnerMoveable from \"./InnerMoveable\";\nimport {\n MoveableInterface,\n MoveableOptions, MoveableProperties,\n} from \"react-moveable/types\";\nimport { camelize, getDocument, isArray } from \"@daybrush/utils\";\nimport { MoveableEventsParameters } from \"./types\";\nimport { PROPERTIES, EVENTS, METHODS } from \"./consts\";\nimport EventEmitter from \"@scena/event-emitter\";\n/**\n * Moveable is Draggable! Resizable! Scalable! Rotatable!\n * @sort 1\n * @alias Moveable\n * @extends EventEmitter\n */\n@Properties(METHODS, (prototype, property) => {\n if (prototype[property]) {\n return;\n }\n prototype[property] = function(...args: any[]) {\n const self = this.getMoveable();\n\n if (!self || !self[property]) {\n return;\n }\n return self[property](...args);\n };\n})\n@Properties(PROPERTIES, (prototype, property) => {\n Object.defineProperty(prototype, property, {\n get() {\n return this.getMoveable().props[property];\n },\n set(value) {\n this.setState({\n [property]: value,\n });\n },\n enumerable: true,\n configurable: true,\n });\n})\nclass MoveableManager extends EventEmitter {\n private innerMoveable!: InnerMoveable | null;\n private containerProvider: ContainerProvider | null = null;\n private selfElement: HTMLElement | null = null;\n private _warp = false;\n /**\n *\n */\n constructor(parentElement: HTMLElement, options: MoveableOptions = {}) {\n super();\n const nextOptions = { ...options };\n\n const events: any = {};\n\n EVENTS.forEach(name => {\n events[camelize(`on ${name}`)] = (e: any) => this.trigger(name, e);\n });\n let selfElement!: HTMLElement;\n\n if (options.warpSelf) {\n delete options.warpSelf;\n this._warp = true;\n selfElement = parentElement;\n } else {\n selfElement = getDocument(parentElement).createElement(\"div\");\n parentElement.appendChild(selfElement);\n }\n this.containerProvider = renderSelf(\n as any,\n selfElement,\n );\n\n this.selfElement = selfElement;\n const target = nextOptions.target!;\n if (isArray(target) && target.length > 1) {\n this.updateRect();\n }\n }\n public setState(state: Partial, callback?: () => any) {\n this.innerMoveable!.setState(state, callback);\n }\n public forceUpdate(callback?: () => any) {\n this.innerMoveable!.forceUpdate(callback);\n }\n public dragStart(e: MouseEvent | TouchEvent) {\n const innerMoveable = this.innerMoveable;\n if ((innerMoveable as any).$_timer) {\n this.forceUpdate();\n }\n this.getMoveable().dragStart(e);\n }\n public destroy() {\n const selfElement = this.selfElement!;\n\n renderSelf(\n null,\n selfElement!,\n this.containerProvider,\n );\n if (!this._warp) {\n selfElement?.parentElement?.removeChild(selfElement);\n }\n this.containerProvider = null;\n\n this.off();\n this.selfElement = null;\n this.innerMoveable = null;\n }\n private getMoveable() {\n return this.innerMoveable!.moveable;\n }\n}\n\ninterface MoveableManager extends MoveableInterface, MoveableProperties {\n}\n\nexport default MoveableManager;\n","import MoveableManager from \"./MoveableManager\";\n\nexport default class Moveable extends MoveableManager {}\n","import { Able, DefaultProps } from \"react-moveable/types\";\nimport { getElementInfo as getElementInfoFunction, makeAble as makeAbleFunction } from \"react-moveable\";\n\nexport function getElementInfo(\n target: SVGElement | HTMLElement,\n container?: SVGElement | HTMLElement | null,\n rootContainer?: SVGElement | HTMLElement | null | undefined,\n) {\n return getElementInfoFunction(target, container, rootContainer);\n};\nexport function makeAble<\n Name extends string,\n AbleObject extends Partial>,\n>(name: Name, able: AbleObject) {\n return makeAbleFunction(name, able);\n}\n","import Moveable, * as modules from \"./index\";\n\nfor (const name in modules) {\n (Moveable as any)[name] = (modules as any)[name];\n}\n\nexport default Moveable;\n"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","constructor","create","__assign","assign","t","s","i","n","arguments","length","apply","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","__decorate","decorators","target","key","desc","c","r","getOwnPropertyDescriptor","Reflect","decorate","defineProperty","__values","o","Symbol","iterator","m","next","value","done","__read","ar","push","error","__spreadArray","to","from","pack","l","slice","concat","makeAble","name","able","events","props","DIRECTIONS4","DIRECTIONS","getSVGCursor","scale","degree","getCursorCSS","x1","degree45","Math","round","defaultCursor","agent","getAgent","IS_WEBKIT","browser","webkit","IS_WEBKIT605","navi","window","userAgent","navigator","res","exec","toLowerCase","parseFloat","browserName","browserVersion","parseInt","version","IS_CHROME","IS_CHROMIUM","chromium","chromiumVersion","IS_CHROMIUM109","IS_FIREFOX","IS_SAFARI_ABOVE15","webkitVersion","PREFIX","directionCSS","map","dir","top","left","originX","originY","offset","join","MOVEABLE_CSS","NEARBY_POS","FLOAT_POINT_NUM","TINY_NUM","MIN_SCALE","MAX_NUM","pow","MIN_NUM","DIRECTION_REGION_TO_DIRECTION","w","nw","ne","sw","se","DIRECTION_INDEXES","DIRECTION_ROTATIONS","MOVEABLE_METHODS","setCustomDrag","state","delta","isPinch","isConvert","ableName","_a","_b","result","gestos","move","inputEvent","datas","originalDatas","ableDatas","convertDragDist","parentEvent","CustomGesto","prevX","prevY","startX","startY","isDrag","isFlag","draggable","dragStart","client","type","drag","clientX","clientY","isFirstDrag","isPrevDrag","distX","distY","deltaX","deltaY","parentGesto","calculateElementPosition","matrix","origin","width","height","is3d","poses","calculatePoses","y1","_c","x2","y2","_d","x3","y3","_e","x4","y4","_f","calculatePosition","min","right","max","bottom","sx","sy","direction","sign","pos1","pos2","pos3","pos4","calculatePointerDist","moveable","moveableClientRect","rootMatrix","minus","calculateInversePosition","posX","posY","getDragDist","setDragStart","allMatrix","beforeMatrix","offsetMatrix","targetMatrix","transformOrigin","inverseMatrix","invert","inverseBeforeMatrix","absoluteOrigin","convertPositionMatrix","plus","startDragBeforeDist","calculate","startDragDist","getTransformDirection","beforeTransform","resolveTransformEvent","event","functionName","beforeRenderable","index","transformIndex","nextTransforms","nextTransformAppendedIndexes","nextIndex","findIndex","text","match","find","info","filter","convertTransformInfo","targetFunction","matFunctionName","beforeFunctionTexts","afterFunctionTexts","beforeFunctionMatrix","beforeTransform2","beforeFunctionMatrix2","targetTansform","targetFunctionMatrix","afterTransform","afterFunctionMatrix","afterTransform2","afterFunctionMatrix2","targetAllTransform","allFunctionMatrix","splice","isAppendTransform","isAppend","convertTransformFormat","dist","getTransformDist","getBeforeDragDist","bx","by","getTransfromMatrix","fromTranslation","isAfter","nextTargetMatrix","multiply","res1","afterTargetMatrix","isBefore","getInverseDragDist","calculateTransformOrigin","prevWidth","prevHeight","prevOrigin","pos","splitUnit","unit","prevSize","size","isNaN","measureRatio","getPosIndexesByDirection","indexes","getPosesByDirection","getPosBySingleDirection","ratio","dot","getPosByDirection","getDist","startPos","fixedDirection","fixedPos","getNextMatrix","getAbsoluteMatrix","getNextTransformMatrix","transform","isAllTransform","targetTransform","isString","convertDimension","parseMat","scaleMatrix","createScaleMatrix","fillTransformStartEvent","getBeforeRenderableDatas","setTransform","startTransforms","isArray","splitSpace","setTransformIndex","setDefaultTransformIndex","property","func","parse","v","offsetWidth","offsetHeight","startValue","functionValue","fillOriginalTransform","getNextTransforms","getNextTransformText","getNextStyle","nextStyle","fillTransformEvent","nextTransform","Draggable","fillCSSObject","getTranslateFixedPosition","fixedOffset","nextMatrix","nextFixedPosition","getDirectionOffset","getTranslateDist","fixedPosition","groupable","groupLeft","groupTop","getScaleDist","getDirectionByPos","fixedOffsetPosition","getRotateDist","rotateDist","getResizeDist","nextOrigin","getAbsolutePosition","getAbsolutePosesByState","getGestoData","targetGesto","controlGesto","data","getEventData","getShadowRoot","parentElement","getRootNode","rootNode","nodeType","getIndividualTransforms","getStyle","rotate","translate","individualTransforms","split","getMatrixStackInfo","container","checkContainer","el","matrixes","documentElement","getDocumentElement","getDocumentBody","requestEnd","isEnd","targetTransformOrigin","hasFixed","offsetContainer","getOffsetInfo","offsetParent","zoom","getCachedStyle","position","getElementTransform","isFixed","convertCSStoMatrix","getTransformMatrix","isOffsetEnd","isStatic","parentClientLeft","parentClientTop","fixedClientLeft","fixedClientTop","fixedInfo","hasTransform","fixedContainer","getPositionFixedInfo","length_1","convert3DMatrixes","getOffsetPosInfo","tagName","hasOffset","isSVG","origin_1","targetOrigin","offsetPos","offsetLeft","offsetTop","ownerSVGElement","getSVGMatrix","createIdentityMatrix","targetZoom","offsetInfo","offsetZoom","isCustomElement","parentSlotElement","customOffsetParent","customOffsetLeft","customOffsetTop","clientLeft","clientTop","margin","getBodyOffset","isElementTarget","scrollLeft","scrollTop","createOriginMatrix","cacheStyleMap","clientRectStyleMap","matrixContainerInfos","setStoreCache","useCache","Map","getCachedClientRect","clientRect","get","nextClientRect","getClientRect","set","getCachedMatrixContainerInfo","result_1","element","cache","nextStyle_1","getWindow","getComputedStyle","style","cached","fillChildEvents","groupableDatas","childDatas","moveables","_","isRequestChild","triggerChildGesto","isStart","childEvents","eventParams","ev","childMoveable","childEvent","childGestos","parentFlag","child","triggerChildAbles","eachEvent","callback","childs","startChildDist","parentDatas","startPositions","createRotateMatrix","rotation","PI","originalX","originalY","renderDirectionControlsByInfos","renderDirections","React","getState","renderPoses","rotationRad","getProps","degRotation","absDegree","directionMap","renderState","renderDirectionMap","forEach","directionSign","classNames","directionRotation","throttle","dataAttrs","getKeys","createElement","className","prefix","getControlTransform","renderDirectionControls","defaultDirections","directions","displayAroundControls","renderAroundControls","renderLine","_i","rad","getRad","getLineStyle","renderEdgeLines","edge","index1","index2","Boolean","getRenderDirections","renderDiagonalDirections","renderAllDirections","checkBoundPoses","bounds","verticalPoses","horizontalPoses","Infinity","nextBounds","vertical","checkBounds","horizontal","getBounds","externalBounds","containerClientRect","containerHeight","clientHeight","containerWidth","clientWidth","snapOffset","snapOffsetLeft","snapOffsetTop","snapOffsetRight","snapOffsetBottom","isCSS","_g","checkBoundKeepRatio","endPos","endX","endY","dx","dy","abs","isBottom","isRight","verticalInfo","isBound","horizontalInfo","a","y","x","isVertical","startBoundPos","endBoundPos","minPos","maxPos","boundInfos","sort","isBoundRotate$1","relativePoses","boundRect","nextPoses","some","boundRotate","vec","boundPos","getDistSize","nextPos","sqrt","checkRotateBounds","prevPoses","relativeLeft","relativeRight","relativeTop","relativeBottom","relativeRad1","relativeRad2","nextRad","VERTICAL_NAMES","HORIZONTAL_NAMES","SNAP_SKIP_NAMES_MAP","VERTICAL_NAMES_MAP","start","end","center","HORIZONTAL_NAMES_MAP","getInitialBounds","hasGuidelines","snappable","innerBounds","verticalGuidelines","horizontalGuidelines","snapGridWidth","snapGridHeight","guidelines","enableSnap","getSnapDirections","snapDirections","mapSnapDirectionPoses","snapPoses","nextSnapDirections","nextSnapPoses","name_1","splitSnapDirectionPoses","horizontalNames","verticalNames","calculateContainerPos","containerRect","clientPos","solveLineConstants","point1","point2","TINY_NUM$1","checkMoveableSnapPoses","posesX","posesY","dirXs","dirYs","customSnapThreshold","snapThresholdMultiples","snapThresholdInfo","multiples","snapThreshold","selectValue","checkSnapPoses","checkSnap","checkSnapKeepRatio","getTinyDist","isSnap","verticalSnapInfo","horizontalSnapInfo","posInfos","getNearestSnapGuidelineInfo","isVerticalSnap","verticalGuideline","guideline","isHorizontalSnap","horizontalGuideline","horizontalPos","verticalPos","getStringDirection","stringDirection","checkSnaps","rect","horizontalDirection","verticalDirection","snapInfo","posInfo","guidelineInfo","guidelineInfos","targetType","targetPoses","dirs","posType","snapPosInfos","targetPos","snapPosInfo","getSnapInfosByDirection","snapDirection","arr","nextDir","keepRatio","xs","ys","checkSnapBoundPriority","aDist","bDist","getNearOffsetInfo","offsets","aSign","bSign","aOffset","bOffset","getCheckSnapDirections","endDirection_1","signX","signY","nextDirection","signs","isStartLine","line","cx","average","cy","hitTestLine","test1","test2","isSameStartLine","dots","centerSign","every","checkInnerBoundDot","threshold","checkInnerBound","verticalSign","horizontalSign","lineConstants","isAllBound","isVerticalBound","isHorizontalBound","leftLine","topLine","rightLine","bottomLine","topBoundInfo","checkLineBoundCollision","bottomBoundInfo","leftBoundInfo","rightBoundInfo","isAllVerticalBound","isAllHorizontalBound","verticalOffset","maxOffset","horizontalOffset","boundLine","isRender","dot1","boundDot1","boundDot2","dy2","dx2","hasDx","hasDy","slope","getInnerBoundInfo","lineInfos","multiple","sizeOffset","getInnerBoundDragInfo","lines","getCheckInnerBoundLineInfos","innerBoundInfo","widthOffsetInfo","heightOffsetInfo","getCheckSnapLineDirections","lineDirections","virtualPoses","dir1","dir2","virtualLine","isBoundRotate","boundDots","getDistPointLine","solveReverseLine","checkRotateInnerBounds","dotInfos","lineRad","lineDist","dotDist","dotRad","distRad","acos","nextRad1","nextRad2","reduce","prev","cur","checkInnerBoundPoses","boundMap","getRect","lineInfo","isHorizontalStart","isVerticalStart","solveEquation","solveNextOffset","isOutside","getDist$1","dist1","dist2","widthOffset","heightOffset","getSnapBound","boundInfo","checkThrottleDragRotate","throttleDragRotate","_h","offsetX","offsetY","adjustPoses","adjustPos","prevDistY","checkSnapBoundsDrag","ignoreSnap","getAbsolutePoses","absolutePoses","boundPoses","middle","checkMoveableSnapBounds","verticalSnapBoundInfo","horizontalSnapBoundInfo","verticalInnerBoundInfo","horizontalInnerBoundInfo","horizontalBoundInfos","verticalBoundInfos","horizontalDist","verticalDist","snapIndex","snap","checkSnapBounds","guideines","checkSnapRightLine","snapBoundInfo","rad180","isHorizontalLine","isVerticalLine","getSnapBoundInfo","isRequest","startDirection","endDirection","otherStartPos","otherEndPos","checkSnapBoundsKeepRatio","otherHorizontalOffset","isOtherHorizontalBound","isOtherHorizontalSnap","otherVerticalOffset","isOtherVerticalBound","isOtherVerticalSnap","snapLine","getSnapBoundOffset","horizontalBoundInfo","verticalBoundInfo","checkMaxBounds","maxWidth","maxHeight","left_1","top_1","right_1","bottom_1","otherDirection","isCheckVertical","isCheckHorizontal","otherPos","deg","nextOtherPos","isHeightOutside","isWidthOutside","requestStyle","requestChildStyle","render","hideThrottleDragRotateLine","dragInfo","beforeOrigin","startCheckSnapDrag","prevDist","prevBeforeDist","deltaOffset","params","fillParams","triggerEvent","startRect","useSnap","isGroup","parentThrottleDrag","parentMoveable","throttleDrag","dragRotateRad","startDragRotate","ry","cos","rx","sin","beforeTranslate","throttleArray","beforeDist","beforeDelta","passDelta","passDist","num","dragAfter","dragEnd","param","fillEndParams","dragGroupStart","nextParams","targets","throttleOffset","dragGroup","dragGroupEnd","request","isControl","requestStart","unset","getFixedDirectionInfo","getOffsetFixedDirectionInfo","nextFixedOffset","getOffsetFixedPositionInfo","offsetFixedPosition","directionCondition$2","getDirectionCondition","Resizable","ableGroup","canPinch","dragControlCondition","viewClassName","getDirectionViewClassName","dragControlStart","parentDirection","parentFixedDirection","getTotalDirection","resizable","startOffsetWidth","startOffsetHeight","minSize","startWidth","inlineCSSWidth","cssWidth","startHeight","inlineCSSHeight","cssHeight","maxSize","minOffsetWidth","minOffsetHeight","maxOffsetWidth","maxOffsetHeight","startOffsetMatrix","startTransformOrigin","isWidth","parentIsWidth","setRatio","isFinite","setFixedDirection","setFixedPosition","setMin","convertUnitSize","setMax","nextMaxSize","isNumber","startRatio","setOrigin","startFixedDirection","startFixedPosition","isResize","snapRenderInfo","dragControl","parentKeepRatio","dragClient","parentDist","resolveMatrix","targetN","nextAllMatrix","resizeFormat","throttleResize","keepRatioFinally","sizeDirection","distWidth","distHeight","getNextBoundingSize","nextSize","getOffsetSizeDist","nextWidth","nextHeight","boundingWidth","boundingHeight","nextFixedDirection","setSize","snapDist","checkSnapResize","computeSize","isNoSnap","calculateBoundSize","inverseDelta","fillAfterTransform","dragControlAfter","checkResizableError","errorWidth","errorHeight","isErrorWidth","isErrorHeight","dragControlEnd","dragGroupControlCondition","dragGroupControlStart","originalEvents","parentStartOffsetWidth","parentStartOffsetHeight","updateGroupMin","originalMinSize","childMinSize","childStartOffsetWidth","childStartOffsetHeight","parentMinWidth","parentMinHeight","updateGroupMax","originalMaxSize","childMaxSize","parentMaxWidth","parentMaxHeight","dragGroupControl","catchEvent","parentScale","dragGroupControlEnd","deltaWidth","deltaHeight","setRotateStartInfo","startAbsoluteOrigin","prevDeg","defaultDeg","prevSnapDeg","loop","startDist","getAbsoluteDist","normalizedPrevDeg","floor","getAbsoluteDistByClient","getRotateInfo","moveableRect","throttleRotate","snapRotation","checkSnapRotate","snapDeg","getRotationPositions","rotationPosition","radPoses","getRotationRad","isReverse","requestAble","hasClass","rotateAroundControls","rotationTarget","getRefTargets","contains","css","Rotatable","isDragging","rotatable","resolveAblesWithRotatable","positions","jsxs","ables","resolveMap_1","directionControlInfos","resolve","parentRotate","beforeDirection","resizeStart","startClientX","startClientY","externalRotate","beforeInfo","afterInfo","absoluteInfo","inputTarget","regionDirection","getAttribute","controlDirection","isAroundControl","resolveAble","clientPoses","calculateMoveableClientPositions","originalFixedPosition_1","getOrigin","fixedBeforeOrigin","fixedAfterOrigin","posDelta","parentPosition","controlPosition","parentFixedPosition","getTotalOrigin","rotatation","isRotate","clientDistX","clientDistY","groupDelta","targetDirection","beforeRotation","absoluteDelta","absoluteDist","absoluteRotation","startRotation","absoluteStartRotation","nextClientX","nextClientY","setRotation","nextRotation","inverseDist","prevInverseDist","requestValue","dragEvent","transformEvent","parentDistance","resize","undefined","resizeEvent","beforeRotate","absoluteRotate","parentLeft","parentTop","parentBeforeOrigin","childClient","startGroupClient","groupClient","prevClientX","prevClientY","setGroupRotation","distRotate","getRotation","deltaRotate","renderGuideline","isHorizontal","scaleType","renderInnerGuideline","sizeValue","posValue","renderSnapPoses","renderPos","renderGuidelines","targetRect","isDisplayInnerSnapDigit","mainNames","targetStart","targetEnd","hide","elementRect","renderDigitLine","lineType","gap","snapDigit","isDisplaySnapDigit","snapDistFormat","sizeName","absGap","snapSize","toFixed","groupByElementGuidelines","otherIndex","names","groupBy","nextGuidelines","inner","elementRect1","elementRect2","nextPos1","nextPos2","elementDirection","total","renderDashedGuidelines","rendered","groups","sideNames","sidePos","prevRect","nextRect","size1","size2","renderPos1","renderPos2","renderGapGuidelines","targetSideStart","targetSideEnd","gapRects","sideStartPos","sideEndPos","sideCenterPos","getTotalGuidelines","overflow","scrollHeight","scrollWidth","containerClientHeight","containerClientWidth","snapGap","maxSnapElementGuidelineDistance","isDisplayGridGuidelines","elementGuidelines","getElementGuidelines","totalGuidelines","getGapGuidelines","getGridGuidelines","getDefaultGuidelines","checkBetweenRects","snapThresholds","maxSnapElementGapDistance","elementRects","gapGuidelines","targetCenter","targetStart2","targetEnd2","snapThresholdMap","nextElementRects","snapRect1","snapRect2","rect1","rect2","rect1Start","rect1End","rect2Start","rect2End","isCenter","startGridGroupGuidelines","snapGridAll","hasDirection","rect_1","children_1","children","posName","clientOffset","rectSize","rectPos","childSizes","flat$1","firstChildSize","childSnapSizes","rectRatio","childSize","startOffset","defaultSnapGridWidth","defaultSnapGridHeight","pushGuideline","grid","distance","prevValues","snapRect","refresh","nextElementGuidelines","isObject","getRefTarget","diff","maintained","added","nextValues","prevIndex","getSnapElementRects","elementSnapDirections","topValue","leftValue","rightValue","bottomValue","centerValue","middleValue","rectTop","rectLeft","sizes","getObjectGuidelines","containerSize","posGuideline","snapWidth","snapHeight","values","offsetDelta","containerLeft","containerTop","getBoundingClientRect","elementLeft","elementTop","elementRight","elementBottom","checkSnapInfo","snapContainer","snapContainerTarget","snapContainerRect","offset1","getDragDistByState","offset2","getNextFixedPoses","nextFixedPos","normalized","getSizeOffsetInfo","innerBoundLineInfos","recheckSizeByTwoDirection","snapPos","nextWidthOffset","nextHeightOffset","checkSizeDist","getNextPoses","isWidthBound","isHeightBound","widthDist","heightDist","isGetWidthOffset","bumpDegree","baseDeg","count","deg1","deg2","getMinDegreeDistance","deg3","snapRotationThreshold","NAME_snapRotationThreshold","snapRotationDegrees","NAME_snapRotationDegrees","origin2_1","rad_1","sorted","firstDegree","checkSnapScale","sizeDist","getSnapGuidelines","addBoundGuidelines","verticalSnapPoses","horizontalSnapPoses","innerBoundMap","verticalInnerBoundPoses","horizontalInnerBoundPoses","innerPos","directionCondition$1","Snappable","dragRelation","targetTop","targetLeft","snapRenderThreshold","watchValue","JSON","stringify","minLeft","minTop","externalPoses","snapInfos","hasExternalPoses","externalRect","verticalPosInfos","horizontalPosInfos","allGuidelines","elements","gaps","nextBoundMap","nextInnerBoundMap","pinchStart","multiply2","prefixNames","defaultSync","fn","multiplies","measureSVGSize","viewBox","getSVGViewBox","getBeforeTransformOrigin","relativeOrigin","getTransformOrigin","getTransformOriginArray","computedTransform","list","baseVal","_loop_1","chr","lastParent","isParent","checkZoom","getTargetStyle","hasSlot","assignedSlotParentElement","assignedSlot","targetPosition","willChange","slotParentNode","parentNode","targetParentNode","host","isUndefined","getSVGGraphicsOffset","getBodyStyle","bodyPosition","marginLeft","marginTop","body","makeMatrixCSS","convertMatrixtoCSS","viewBoxWidth","viewBoxHeight","scaleX","scaleY","preserveAspectRatio","align","meetOrSlice","svgOrigin","xAlign","yAlign","scaleDimension","isGTarget","getBBox","isFillBox","bbox","rectWidth","rectHeight","calculateRect","getSVGOffset","targetInfo","getSize","mat","prevLeft","prevTop","posOrigin","rectOrigin","mat2","nextLeft","nextTop","distLeft","distTop","rootClientRect","rootPoses","getDiagonalSize","self","contentWidth","contentHeight","minWidth","minHeight","svg","targetStyle","boxSizing","borderLeft","borderRight","borderTop","borderBottom","paddingLeft","paddingRight","paddingTop","paddingBottom","horizontalPadding","verticalPadding","horizontalBorder","verticalBorder","getParentStyle","between","resetClientRect","getExtendsRect","isRoot","extendsRect","getClientRectByPosition","base","isExtends","baseTop","baseLeft","convertTransformOriginArray","getDirection","direciton","unsetAbles","unsetGesto","gestoName","gesto","isIdle","resolvedEvent","cssText","decamelize","prevEvent","nextEvent","isBeforeEvent","currentTarget","isTrusted","stopAble","isEventStart","stopDrag","stop","isStartEvent","lastEvent","isDouble","_emitter","on","isManager","pseudoElt","filterAbles","methods","triggerAblesSimultaneously","enabledAbles","ableGroups","method","equals","a1","a2","groupKeys","groupKey","keyIndex","group","groupByMap","flat","args","calculatePadding","xAdded","yAdded","nextAdded","convertCSSSize","isRelative","checkAbles","transforms","matrixInfos","beforeFunctionTexts2","targetFunctionText","afterFunctionTexts2","beforeFunctions","beforeFunctions2","afterFunctions","afterFunctions2","targetFunctions","toMat","isArrayFormat","isNode","isSelector","document","querySelector","isFunction","isWindow","current","userTargets","querySelectorAll","getAbsoluteRotation","calculateMatrixDist","getSizeDistByDist","startSize","standardRad","signSize","startWidthSize","startHeightSize","secondRad","atan2","firstRad","distSize","pinchScale","directionsDists","directionRatios","ratioDistance","dist_1","convertTransformUnit","xy","leftOrigin","rightOrigin","originObject","nextOriginObject","rotatePosesInfo","isDeepArrayEquals","arr1","arr2","value1","value2","isArray1","isArray2","nextValue","valueKey","defaultValue","store","_store","prevValue","countEach","counter","getPaddingBox","padding","Pinchable","angle","pinchable","eventName","controlEventName","pinchAbles","controlAbles","ableEvent","pinch","pinchEnd","pinchGroupStart","pinchGroup","pinchGroupEnd","directionCondition","Scalable","setMinScaleSize","minScaleSize","setMaxScaleSize","maxScaleSize","isScale","throttleScale","tempScaleValue","getNextScale","stateDirection","setScale","nextScale","distSign","isSelfPinch","startOffsetSize","scaleSize","distText","scaleText","isZeroScale","scaleEndParam","moveableScale","getMiddleLinePos","getTriangleRad","rad1","rad2","isValidPos","poses1","poses2","pi","Warpable","scalable","warpable","linePosFrom1","linePosFrom2","linePosFrom3","linePosFrom4","linePosTo1","linePosTo2","linePosTo3","linePosTo4","warpTargetMatrix","targetInverseMatrix","ignoreDimension","prevMatrix","posIndexes","isWarp","selectedPoses","nearByPoses","h","createWarpMatrix","afterMatrix","totalMatrix","AREA_PIECES","AREA_PIECE","AVOID","VIEW_DRAGGING","restoreStyle","areaElement","removeClass","renderPieces","DragArea","dragArea","passDragArea","ref","isDragArea","rects","nextElementSibling","addClass","disableNativeEvent","enableNativeEvent","requestAnimationFrame","Origin","originStyle","getDefaultScrollPosition","scrollContainer","Scrollable","getContainer","scrollOptions","dragScroll","DragScroll","scrollContainerElement","scrollBy","getCurrentEvent","checkScroll","scrollThreshold","scrollThrottleTime","getScrollPosition","throttleTime","dragGroupControEnd","Default","Padding","paddingDirections","paddingPos1","paddingPos2","paddingPos3","paddingPos4","RADIUS_DIRECTIONS","calculateRatio","sumSize","sumRatio","HORIZONTAL_RADIUS_ORDER","VERTICAL_RADIUS_ORDER","HORIZONTAL_RADIUS_DIRECTIONS","VERTICAL_RADIUS_DIRECTIONS","getRadiusStyles","clipStyles","radiusPoses","virtual","raws","rawPos","styles","getRadiusRange","controlPoses","horizontalRange","verticalRange","clipPose","sub","getRadiusValues","minCounts","full","splitIndex","splitLength","horizontalValues","verticalValues","horizontalValuesLength","verticalValuesLength","hasVerticalValues","nwValue","neValue","seValue","_j","swValue","_k","_l","wnValue","_m","enValue","_o","esValue","_p","wsValue","horizontalRawPoses","verticalRawPoses","nextHorizontalPoses","nextVerticalPoses","raw","removeRadiusPos","startIndex","radiuslIndex","deleteCount","addRadiusPos","horizontalIndex","verticalIndex","radiusX","radiusY","startVerticalIndex","splitRadiusPoses","horizontals","verticals","CLIP_DIRECTIONS","CLIP_RECT_DIRECTIONS","getClipStyles","clipPath","clipRelative","clipType","clipPoses","isRect","isCircle","subWidth","subHeight","getRectPoses","dirx","diry","getControlSize","xRange","yRange","getClipPath","defaultClip","customClip","clipText","splitBracket","clipPrefix","splitter","splitComma","xPos","yPos","minMaxs","getMinMaxs","minX","maxX","minY","maxY","radiusX_1","radiusY_1","radius","xRadius","yRadius","centerPos_1","roundIndex","rectLength","radiusValues","_q","_r","_s","top_2","_t","nextRight","nextBottom","_u","top_3","moveControlPos","dists","verticalDirections","horizontalDirections","verticalDirection_1","horizontalDirection_1","fixedIndex","nextDist","nextControlPoses_1","controlPose","controlDir","dirDir","dirHorizontal","dirVertical","addClipPath","clipIndex","clipStyle","clipEventType","removeClipPath","Clippable","customClipPath","defaultClipPath","clipArea","clipPathState","snapBoundInfos","calculatedPos","controls","isInset","isPolygon","linePoses_1","clipLeft","clipTop","ellipseClipPath","piece","areaPoses","allWidth","allHeight","allLeft_1","allTop_1","directionType","snapPos1","snapPos2","dragWithClip","isDragTarget","isClipStart","isLine","isArea","originalDraggable","originalDist","firstDist","isDragWithTarget","isAll","guidePoses","isEllipse","guideRect","clipHorizontalGuidelines","clipVerticalGuidelines","guideXPoses","guideYPoses","rectPoses","rectDists_1","boundDelta","clipTargetBounds","snapOffsetY","snapOffsetX","distSnapX","distSnapY","width_1","height_1","nextControlPoses_2","j","nextClipStyles","dragDist","OriginDraggable","startOrigin","startTargetOrigin","isDragOrigin","originRelative","distOrigin","dragDelta","deltaOrigin","addBorderRadiusByLine","lineIndex","horizontalsLength","verticalsLength","controlIndex","controlPoseInfo","addBorderRadius","removeBorderRadius","getBorderRadius","borderRadius","triggerRoundEvent","roundRelative","borderRadiusState","getStyleBorderRadius","firstMoveable","firstTarget","getTargets","Roundable","roundClickable","minRoundControls","maxRoundControls","roundPadding","isDisplayShadowRoundControls","verticalCount","horizontalCount","basePos","originalPos","isDisplayVerticalShadow","isDisplay","display","indexAttr","replace","isRound","selectedControlPose","selectedVertical","selectedHorizontal","pose","poseDist","isIdentityMatrix","identityMatrix","BeforeRenderable","inlineTransform","cssMatrix","startTransform","resetStyle","fillDragStartParams","fillDragParams","_this","Renderable","fillDragEndParams","transformObject","matrixInfo","triggerAble","moveableAbles","eventOperations","eventAffix","eventType","requestInstant","requestAble_1","elementFromPoint","isDragStop","isFirstStart","updateRect","gestoType","prevGesto","trigger","conditionName","nextDatas","off","forceEndedCount","updatedCount","eventOperation","eventAbles","results","isUpdate","isForceEnd","preventDefault","isUnmounted","flushSync","forceUpdate","checkMoveableTarget","eventTarget","dragTargetElement","_dragTarget","isMoveableElement","controlBox","getTargetAbleGesto","moveableTarget","dragTarget","dragTargetSelf","getAbleGesto","ableType","conditionFunctions","isTargetAbles","pinchOutside","pinchThreshold","preventClickEventOnDrag","preventClickDefault","checkInput","dragFocusedInput","dragContaienrOption","dragContainer","options","preventRightClick","preventWheelClick","getControlBoxElement","preventClickEventOnDragStart","preventClickEventByCondition","Gesto","isPinchScheduled","stopPropagation","EventManager","_onEvent","addEventListener","setAbles","destroy","removeEventListener","calculateMatrixStack","rootContainer","isAbsolute3d","prevTargetMatrix","containerZoom","rootMatrixes","isRoot3d","offsetRootContainer","rootZoom","isNext3d","isSVGGraphicElement","nextRootMatrixes","reverse","originalRootContainer","endContainer","rootMatrixBeforeOffset","nextInfo","isMatrix3d","originalRootMatrix","hasZoom","calculateElementInfo","allResult","getElementInfo","getMoveableTargetInfo","moveableElement","parentContainer","requestStyles","targetClientRect","rootContainerClientRect","getStyle_1","beforePosition","absoluteTargetPosition","absoluteContainerPosition","containerClientRectLeft","containerClientRectTop","containterClientLeft","containerClientTop","clientDelta","originalBeforeOrigin","getPersistState","isPersisted","MoveableManager","_super","renderLines","targetAbles","isMoveableMounted","EventEmitter","_prevOriginalDragTarget","_originalDragTarget","_prevDragTarget","_prevPropTarget","_propTarget","_prevDragArea","_isPropTargetChanged","_hasFirstTarget","_reiszeObserver","_observerId","_mutationObserver","_rootContainer","_viewContainer","_viewClassNames","checkUpdateRect","cancelAnimationFrame","_onPreventClick","propsTarget","cspNonce","translateZ","ControlBoxElement","cssStyled","linePadding","controlPadding","_checkUpdateRootContainer","checkUpdate","updateRenderPoses","stateTarget","groupTargets","ableAttributes","getEnabledAbles","ableClassName","_getAbleClassName","isVisible","firstRenderState","persistData","useAccuratePosition","onClick","renderAbles","_renderLines","componentDidMount","_checkUpdateViewContainer","_updateTargets","_updateNativeEvents","_updateEvents","updateCheckInput","_updateObserver","componentDidUpdate","prevProps","componentWillUnmount","disconnect","viewContainer","_changeAbleViewClassNames","manager","getAble","wrapperMoveable","getDragElement","triggerDragStart","hitTest","points","fitPoints","getOverlapSize","totalSize","getAreaSize","isInside","isTarget","isSetState","isSingle","nextState","_getRequestStyles","persistState","name_2","updateState","updateTarget","statePos","getManager","isInstant","allAbles","requsetAble","ableRequester","requester","ableParam","getMoveables","stateLeft","stateTop","renderPos3","renderPos4","zoomOffset","stateContainer","updateAbles","isTargetChanged","isChanged","moveableContainer","waitToChangeTarget","Promise","useCSS","tag","customStyleMap","customStyledMap","styled","hasControlBox","updateSelectors","setState","name_3","always","Renderer","styleNames","ableStyleNames","_updateResizeObserver","_updateMutationObserver","controlBoxElement","hasTargetAble","hasControlAble","isUnset","_isTargetChanged","hideDefaultLines","hideChildMoveableDefaultLines","useDragArea","nextTarget","prevTarget","prevDragArea","isDragTargetChanged","isDragAreaChanged","eventKeys","hasAbles","viewContainerOption","_getAbleViewClassNames","nextClassNames","prevClassNames","diff$1","removed","classPrefix","targetGestoData","controlGestoData","trim","win","ResizeObserver","useResizeObserver","observer","observe","box","MutationObserver","useMutationObserver","records","e_1","records_1","records_1_1","mutation","attributeName","e_1_1","return","attributes","defaultProps","isWrapperMounted","warpSelf","Groupable","renderGroupRects","persistDatChildren","getRequestChildStyles","refs","Clickable","containsElement","containsTarget","targetIndex","parentTarget","getDraggableEvent","edgeDraggable","dragCondition","dragGroupCondition","IndividualGroupable","MOVEABLE_ABLES","MOVEABLE_EVENTS","pushSet","MOVEABLE_PROPS","solveConstantsDistance","solveC","getMaxPos","getMinPos","getGroupRect","parentPoses","fixedRotation","a1_1","tan","a2_1","a1MinMax_1","a1MinMaxPos_1","a2MinMax_1","a2MinMaxPos_1","a1Dist","a2Dist","a1MinPos","a1MaxPos","a2MinPos","a2MaxPos","minHorizontalLine","maxHorizontalLine","minVerticalLine","maxVerticalLine","line1","line2","getIntersectionPointsByConstants","minX_1","minY_1","maxX_1","maxY_1","changedX","findMoveableGroups","childTargetGroups","targetGroup","childMoveableGroups","checked","finded","MoveableGroup","differ","ChildrenDiffer","_targetGroups","_hasFirstTargets","checkeds","targetGroups","moveableGroups","useDefaultGroupRotate","isReset","updateGroup","defaultGroupRotate","persistedRoatation","getMoveableGroupRect","parentRotation","posesRotations","rotations","groupRotation","firstRotation","isSameRotation","groupPoses","groupRect","rootGroupRect","defaultGroupOrigin","posesInfo","rotateScale","update","changed","isContainerChanged","MoveableIndividualGroup","canPersist","individualProps","individualGroupableProps","dragElement","getElementTargets","refTargets","selectorMap","elementTargets","getTargetGroups","compareRefTargets","prevRefTargets","nextRefTargets","InitialMoveable","_differ","_elementTargets","_tmpRefTargets","_tmpSelectorMap","_onChangeTargets","makeStyled","cssMap","getTotalAbles","defaultStyled","prefixCSS","defaultAbles","moveableContructor","userAbles","userProps","_updateRefs","nextSelectorMap","totalAbles","nextProps","prevMoveable","individualGroupable","groupableProps","target_1","prevTargetMoveable","mv","_checkChangeTargets","resolvePromise","waitToChangeTargets","isBrowser","updateSelectorMap","selectorTarget","onChangeTargets","withMethods","Moveable","InnerMoveable","PROPERTIES","METHODS","EVENTS","containerProvider","selfElement","_warp","nextOptions","camelize","getDocument","appendChild","renderSelf","innerMoveable","$_timer","getMoveable","removeChild","Properties","enumerable","configurable","getElementInfoFunction","makeAbleFunction","modules"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAeQ,MAAf,CAAsBe,SAAtB,GAAkC,IAAlC,CAAA;IACA+C,IAAAA,QAAQ,CAACtE,KAAT,CAAe6sB,QAAf,GAA0B,IAA1B,CAAA;IACH,GAAA;IA5SW,CAAhB,CAAA;IA8SA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IAEA,SAAS0C,qBAAT,CAA+Bja,cAA/B,EAA+ClL,cAA/C,EAA+D;IAC3D,EAAA,IAAI4C,aAAa,GAAG/C,iBAAiB,CAACqL,cAAD,EAAiBlL,cAAjB,CAArC,CAAA;IACA,EAAA,IAAIuC,WAAW,GAAG,CAAC,CAAD,EAAI,CAAJ,CAAlB,CAAA;MACA,OAAO;IACHK,IAAAA,aAAa,EAAEA,aADZ;IAEH5C,IAAAA,cAAc,EAAEA,cAFb;IAGHuC,IAAAA,WAAW,EAAEA,WAAAA;OAHjB,CAAA;IAKH,CAAA;;IACD,SAAS6iB,2BAAT,CAAqCxvB,KAArC,E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CAAA;OA3eQ;MAghBZ+B,KAAK,EAAE,UAAUhrB,QAAV,EAAoB;IACvBA,IAAAA,QAAQ,CAACtE,KAAT,CAAeQ,MAAf,CAAsBgwB,SAAtB,GAAkC,IAAlC,CAAA;IACH,GAAA;IAlhBW,CAAhB,CAAA;IAohBA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IAEA;IACA;IACA;IACA;IACA;;IACA,SAAS6F,kBAAT,CAA4B/xB,QAA5B,EAAsC3D,KAAtC,EAA6CiB,OAA7C,EAAsDC,OAAtD,EAA+D0e,IAA/D,EAA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,MAAM,EAAE,IAAA;aAA/B,CAAA;IACH,OAAA;SAhBL,CAAA;IAkBH,GAAA;IA7ZW,CAAhB,CAAA;IA+ZA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IAEA,SAASw7B,eAAT,CAAyBj2B,IAAzB,EAA+BkP,KAA/B,EAAsC;IAClC,EAAA,IAAIzV,EAAJ,CAAA;;IACA,EAAA,IAAI0D,SAAS,GAAG6C,IAAI,CAAC7C,SAArB;IAAA,MAAgC2S,UAAU,GAAG9P,IAAI,CAAC8P,UAAlD;IAAA,MAA8DlN,IAAI,GAAG5C,IAAI,CAAC4C,IAA1E;IAAA,MAAgFJ,GAAG,GAAGxC,IAAI,CAACwC,GAA3F;IAAA,MAAgGwG,IAAI,GAAGhJ,IAAI,CAACgJ,IAA5G;IAAA,MAAkH7V,GAAG,GAAG6M,IAAI,CAAC7M,GAA7H,CAAA;IACA,EAAA,IAAI+iC,YAAY,GAAG/4B,SAAS,KAAK,YAAjC,CAAA;MACA,IAAIg5B,SAAS,GAAGD,YAAY,GAAG,GA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;MA+LZ4xB,mBAAmB,EAAE,UAAU5xB,QAAV,EAAoB;QACrC,IAAKgrB,CAAAA,KAAL,CAAWhrB,QAAX,CAAA,CAAA;OAhMQ;MAkMZgrB,KAAK,EAAE,UAAUhrB,QAAV,EAAoB;IACvB,IAAA,IAAItE,KAAK,GAAGsE,QAAQ,CAACtE,KAArB,CAAA;QACAA,KAAK,CAACud,UAAN,GAAmB,KAAnB,CAAA;QACAvd,KAAK,CAACsd,UAAN,GAAmB,EAAnB,CAAA;QACAtd,KAAK,CAACyyB,cAAN,GAAuB,IAAvB,CAAA;QACAzyB,KAAK,CAACuhC,YAAN,GAAqB,EAArB,CAAA;IACH,GAAA;IAxMW,CAAhB,CAAA;IA0MA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IAC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BxL,QAAQ,CAACA,QAAQ,CAAC,EAAD,EAAKU,CAAL,CAAT,EAAkB;IAAEu1B,MAAAA,OAAO,EAAEzqB,QAAQ,CAACxI,KAAT,CAAeizB,OAAAA;IAA1B,KAAlB,CAA7B,CAAP,CAAA;OAlG8B;IAoGlC6pB,EAAAA,aAAa,EAAE,UAAUt0C,QAAV,EAAoB9K,CAApB,EAAuB;IAClC,IAAA,OAAO,IAAKi/C,CAAAA,QAAL,CAAcn0C,QAAd,EAAwBxL,QAAQ,CAACA,QAAQ,CAAC,EAAD,EAAKU,CAAL,CAAT,EAAkB;IAAEu1B,MAAAA,OAAO,EAAEzqB,QAAQ,CAACxI,KAAT,CAAeizB,OAAAA;IAA1B,KAAlB,CAAhC,CAAP,CAAA;IACH,GAAA;IAtGiC,CAAd,CAAxB,CAAA;IAwGA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IAEA,IAAI8pB,kBAAkB,GAAGhpB,qBAAqB,CAAC,UAAD,CAA9C,CAAA;IACA;IACA;IACA;IACA;IACA;;IACA,IA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IAwBH,GAAA;IAtYU,CAAf,CAAA;IAwYA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IAEA,SAAS4sB,gBAAT,CAA0Bl2C,IAA1B,EAAgCC,IAAhC,EAAsC;MAClC,OAAOD,IAAI,CAAC3F,GAAL,CAAS,UAAU8K,GAAV,EAAelQ,CAAf,EAAkB;IAAE,IAAA,OAAO8Q,GAAG,CAACZ,GAAD,EAAMlF,IAAI,CAAChL,CAAD,CAAV,EAAe,CAAf,EAAkB,CAAlB,CAAV,CAAA;IAAiC,GAA9D,CAAP,CAAA;IACH,CAAA;;IACD,SAASkhD,cAAT,CAAwBn2C,IAAxB,EAA8BC,IAA9B,EAAoCC,IAApC,EAA0C;IACtC;IACA,EAAA,IAAIk2C,IAAI,GAAG1iC,QAAM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A;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA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AD,CAAjB;IAAsBoL,UAAAA,QAAQ,EAAE6P,SAAS,CAACjb,CAAD,CAAzC;IAA8C44C,UAAAA,aAAa,EAAE39B,SAAS,CAACjb,CAAD,CAAtE;IAA2Em5C,UAAAA,SAAS,EAAE,CAAChyC,EAAE,GAAGqU,EAAE,CAAC/T,KAAT,MAAoB,IAApB,IAA4BN,EAAE,KAAK,KAAK,CAAxC,GAA4C,KAAK,CAAjD,GAAqDA,EAAE,CAACgyC,SAAAA;IAA9I,SAAnB,CAAf,CAAA;WAF6D,CAAA;SAA5C,EAGf9xC,MAHe,CAAzB,CAAA;;IAIA8sB,IAAAA,YAAY,CAAC/oB,QAAD,EAAW,iBAAX,EAA8BwqB,UAA9B,CAAZ,CAAA;IACA,IAAA,OAAOA,UAAP,CAAA;OA3RQ;MA6RZQ,KAAK,EAAE,UAAUhrB,QAAV,EAAoB;IACvBA,IAAAA,QAAQ,CAACtE,KAAT,CAAe6rD,iBAAf,GAAmC,EAAnC,CAAA;IACH,GAAA;IA/RW,CAAhB,CAAA;IAiSA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IAEA,SAAS0B,gBAAT,CAA0BjrD,MAA1B,EAAkCI,IAAlC,EAAwC;IACpC,EAAA,IAAIvJ,CAAC,GAAGuJ,IAAI,GAAG,CAAH,GAAO,CAAnB,CAAA;IACA,EAAA,IAAI8qD,cAAc,GAAG97C,oBAAoB,CAACvY,CAAD,CAAzC,CAAA;MACA,IAAI0B,KAAK,GAAG,QAASY,CAAAA,MAAT,CAAgBiH,IAAI,GAAG,IAAH,GAAU,EAA9B,EAAkC,GAAlC,CAAuCjH,CAAAA,MAAvC,CAA8C+xD,cAAc,CAAC3uD,IAAf,CAAoB,GAApB,CAA9C,EAAwE,GAAxE,CAAZ,CAAA;IACA,EAAA,OAAOyD,MAAM,KAAKzH,KAAX,IAAoByH,MAAM,KAAK,qBAAtC,CAAA;IACH,CAAA;;IACD,IAAImrD,gBAAgB,GAAG;IACnBvtD,EAAAA,OAAO,EAAE,IADU;IAEnBvE,EAAAA,IAAI,EAAE,kBAFa;IAGnBG,EAAAA,KAAK,EAAE,EAHY;IAInBD,EAAAA,MAAM,EAAE,CACJ,mBADI,EAEJ,cAFI,EAGJ,iBAHI,EAIJ,w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;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;;IAEA,IAAIkpD,SAAS,GAAG;IACZrjE,EAAAA,IAAI,EAAE,WADM;IAEZG,EAAAA,KAAK,EAAE,CACH,oBADG,EAEH,uBAFG,EAGH,oBAHG,EAIH,WAJG,EAKH,gBALG,EAMH,cANG,EAOH,+BAPG,CAFK;IAWZD,EAAAA,MAAM,EAAE,EAXI;IAYZ8wB,EAAAA,MAAM,EAAE,UAAUroB,QAAV,EAAoBwR,KAApB,EAA2B;IAC/B,IAAA,IAAIzV,EAAJ,CAAA;;IACA,IAAA,IAAIvE,KAAK,GAAGwI,QAAQ,CAACxI,KAArB,CAAA;IACA,IAAA,IAAIizB,OAAO,GAAGjzB,KAAK,CAACizB,OAAN,IAAiB,EAA/B,CAAA;;IACA,IAAA,IAAIzuB,EAAE,GAAGgE,QAAQ,CAACyR,QAAT,EAAT;IAAA,QAA8BtX,IAAI,GAAG6B,EAAE,CAAC7B,IAAxC;IAAA,QAA8CD,GAAG,GAAG8B,EAAE,CAAC9B,GAAvD;IAAA,QAA4Ds2D,WAAW,GAAGx0D,EAAE,CAACw0D,WAA7E,CAAA;;IACA,IAAA,IAAIllD,IAAI,GAAG9T,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/release/0.52.0/dist/moveable.min.js b/release/0.52.0/dist/moveable.min.js new file mode 100644 index 000000000..37d8a8b31 --- /dev/null +++ b/release/0.52.0/dist/moveable.min.js @@ -0,0 +1,10 @@ +/* +Copyright (c) 2019 Daybrush +name: moveable +license: MIT +author: Daybrush +repository: https://github.com/daybrush/moveable/blob/master/packages/moveable +version: 0.52.0 +*/ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Moveable=e()}(this,(function(){"use strict";var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};function e(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 n=function(){return n=Object.assign||function(t){for(var e,n=1,r=arguments.length;n-1?t[r]:n}var B=function(){var t=z(),e=p&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame);return e?e.bind(window):function(e){var n=z();return setTimeout((function(){e(n-t)}),1e3/60)}}(),A=function(){var t=p&&(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame);return t?t.bind(window):function(t){clearTimeout(t)}}();function I(t){return Object.keys(t)}function F(t,e){var n=P(t),r=n.value,i=n.unit;if(x(e)){var o=e[i];if(o){if(D(o))return o(r);if(g[i])return g[i](r,o)}}else if("%"===i)return r*e/100;return g[i]?g[i](r):r}function N(t,e,n){return Math.max(e,Math.min(t,n))}function q(t,e,n,r){return void 0===r&&(r=t[0]/t[1]),[[L(e[0],v),L(e[0]/r,v)],[L(e[1]*r,v),L(e[1],v)]].filter((function(t){return t.every((function(t,r){var i=e[r],o=L(i,v);return n?t<=i||t<=o:t>=i||t>=o}))}))[0]||t}function Y(t,e,n,r){if(!r)return t.map((function(t,r){return N(t,e[r],n[r])}));var i=t[0],o=t[1],a=!0===r?i/o:r,s=q(t,e,!1,a),u=s[0],c=s[1],l=q(t,n,!0,a),f=l[0],p=l[1];return if||o>p)&&(i=f,o=p),[i,o]}function X(t){for(var e=t.length,n=0,r=e-1;r>=0;--r)n+=t[r];return e?n/e:0}function W(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=Math.atan2(r,n);return i>=0?i:i+2*Math.PI}function j(t){var e=function(t){return[0,1].map((function(e){return X(t.map((function(t){return t[e]})))}))}(t),n=W(e,t[0]),r=W(e,t[1]);return nr&&r-n<-Math.PI?1:-1}function H(t,e){return Math.sqrt(Math.pow((e?e[0]:0)-t[0],2)+Math.pow((e?e[1]:0)-t[1],2))}function L(t,e){if(!e)return t;var n=1/e;return Math.round(t/e)/n}function V(t,e){return t.forEach((function(n,r){t[r]=L(t[r],e)})),t}function U(t){return t.reduce((function(t,e){return t.concat(e)}),[])}function $(t,e){-1===t.indexOf(e)&&t.push(e)}function Z(t,e){return t.classList?t.classList.contains(e):!!t.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}function K(t,e){t.classList?t.classList.add(e):t.className+=" "+e}function J(t,e){if(t.classList)t.classList.remove(e);else{var n=new RegExp("(\\s|^)"+e+"(\\s|$)");t.className=t.className.replace(n," ")}}function Q(t,e,n,r){t.addEventListener(e,n,r)}function tt(t,e,n,r){t.removeEventListener(e,n,r)}function et(t){return(null==t?void 0:t.ownerDocument)||d}function nt(t){return et(t).documentElement}function rt(t){return et(t).body}function it(t){var e;return(null===(e=null==t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView)||window}function ot(t){return x(t)&&t.nodeName&&t.nodeType&&"ownerDocument"in t}var at=function(){function t(){this.keys=[],this.values=[]}var e=t.prototype;return e.get=function(t){return this.values[this.keys.indexOf(t)]},e.set=function(t,e){var n=this.keys,r=this.values,i=n.indexOf(t),o=-1===i?n.length:i;n[o]=t,r[o]=e},t}(),st=function(){function t(){this.object={}}var e=t.prototype;return e.get=function(t){return this.object[t]},e.set=function(t,e){this.object[t]=e},t}(),ut="function"==typeof Map,ct=function(){function t(){}var e=t.prototype;return e.connect=function(t,e){this.prev=t,this.next=e,t&&(t.next=this),e&&(e.prev=this)},e.disconnect=function(){var t=this.prev,e=this.next;t&&(t.next=e),e&&(e.prev=t)},e.getIndex=function(){for(var t=this,e=-1;t;)t=t.prev,++e;return e},t}();var lt=function(){function t(t,e,n,r,i,o,a,s){this.prevList=t,this.list=e,this.added=n,this.removed=r,this.changed=i,this.maintained=o,this.changedBeforeAdded=a,this.fixed=s}var e=t.prototype;return Object.defineProperty(e,"ordered",{get:function(){return this.cacheOrdered||this.caculateOrdered(),this.cacheOrdered},enumerable:!0,configurable:!0}),Object.defineProperty(e,"pureChanged",{get:function(){return this.cachePureChanged||this.caculateOrdered(),this.cachePureChanged},enumerable:!0,configurable:!0}),e.caculateOrdered=function(){var t=function(t,e){var n=[],r=[];return t.forEach((function(t){var e=t[0],i=t[1],o=new ct;n[e]=o,r[i]=o})),n.forEach((function(t,e){t.connect(n[e-1])})),t.filter((function(t,n){return!e[n]})).map((function(t,e){var i=t[0],o=t[1];if(i===o)return[0,0];var a=n[i],s=r[o-1],u=a.getIndex();return a.disconnect(),s?a.connect(s,s.next):a.connect(void 0,n[0]),[u,a.getIndex()]}))}(this.changedBeforeAdded,this.fixed),e=this.changed,n=[];this.cacheOrdered=t.filter((function(t,r){var i=t[0],o=t[1],a=e[r],s=a[0],u=a[1];if(i!==o)return n.push([s,u]),!0})),this.cachePureChanged=n},t}();function ft(t,e,n){var r=ut?Map:n?st:at,i=n||function(t){return t},o=[],a=[],s=[],u=t.map(i),c=e.map(i),l=new r,f=new r,p=[],d=[],h={},v=[],g=0,m=0;return u.forEach((function(t,e){l.set(t,e)})),c.forEach((function(t,e){f.set(t,e)})),u.forEach((function(t,e){var n=f.get(t);void 0===n?(++m,a.push(e)):h[n]=m})),c.forEach((function(t,e){var n=l.get(t);void 0===n?(o.push(e),++g):(s.push([n,e]),m=h[e]||0,p.push([n-m,e-g]),d.push(e===n),n!==e&&v.push([n,e]))})),a.reverse(),new lt(t,e,o,a,v,s,p,d)}var pt=function(){function t(t,e){void 0===t&&(t=[]),this.findKeyCallback=e,this.list=[].slice.call(t)}return t.prototype.update=function(t){var e=[].slice.call(t),n=ft(this.list,e,this.findKeyCallback);return this.list=e,n},t}(),dt=function(t,e){return dt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},dt(t,e)};function ht(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}dt(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var vt=function(){return vt=Object.assign||function(t){for(var e,n=1,r=arguments.length;ns&&t.push(e),t}),[]).forEach((function(n){jt(n,n._ps,[n.o],t,e,!0)})),!1;a.o=n,a.ss(r);var l=a.ps;return E(n)||(a.ps=n.props,a.ref=n.ref),Tt(this),a.r(t,e,a.b?l:{},r),!0},e.md=function(){this.rr()},e.ss=function(){},e.ud=function(){this.rr()},e.rr=function(){var t=this,e=t.ref,n=t.fr;e&&e(n?n.current:t.b)},t}();function Pt(){return Object.__CROACT_CURRENT_INSTNACE__}function Tt(t){return Object.__CROACT_CURRENT_INSTNACE__=t,Ot=0,t}var zt=function(){function t(t,e){void 0===t&&(t={}),this.props=t,this.context=e,this.state={},this.$_timer=0,this.$_state={},this.$_subs=[],this.$_cs={}}var e=t.prototype;return e.render=function(){return null},e.shouldComponentUpdate=function(t,e){return this.props!==t||this.state!==e},e.setState=function(t,e,n){var r=this;r.$_timer||(r.$_state={}),clearTimeout(r.$_timer),r.$_timer=0,r.$_state=vt(vt({},r.$_state),t),n?r.$_setState(e,n):r.$_timer=window.setTimeout((function(){r.$_timer=0,r.$_setState(e,n)}))},e.forceUpdate=function(t){this.setState({},t,!0)},e.componentDidMount=function(){},e.componentDidUpdate=function(t,e){},e.componentWillUnmount=function(){},e.$_setState=function(t,e){var n=[],r=this.$_p;jt(r.c,[r],[r.o],n,r._cs,vt(vt({},this.state),this.$_state),e)&&(t&&n.push(t),_t(n),Tt(null))},t}(),Gt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ht(e,t),e.prototype.shouldComponentUpdate=function(t,e){return Et(this.props,t)||Et(this.state,e)},e}(zt);function kt(t){var e=function(t){e.current=t};return e.current=t,e}var Bt=function(t){function e(e,n,r,i,o,a,s){void 0===s&&(s={});var u=t.call(this,e,n,r,i,o,a,yt(s,e.defaultProps))||this;return u.typ="comp",u._usefs=[],u._uefs=[],u._defs=[],u}ht(e,t);var n=e.prototype;return n.s=function(t,e){var n=this.b;return!1!==n.shouldComponentUpdate(yt(t,this.t.defaultProps),e||n.state)},n.r=function(t,e,n){var r,i,o=this,a=o.t;o.ps=yt(o.ps,o.t.defaultProps);var s=o.ps,u=!o.b,c=a.contextType,l=o.b,f=null==c?void 0:c.get(o);o._cs=e,u?(l=function(t,e,n,r){var i,o;return(null===(i=null==t?void 0:t.prototype)||void 0===i?void 0:i.render)?o=new t(e,n):((o=new zt(e,n)).constructor=t,t._fr?(r.fr=kt(),o.render=function(){return this.constructor(this.props,r.fr)}):o.render=Mt),o.$_p=r,o}(a,s,f,o),o.b=l):(l.props=s,l.context=f);var p=l.state;o._usefs=[],o._uefs=[];var d=l.render();0===(null===(i=null===(r=null==d?void 0:d.props)||void 0===r?void 0:r.children)||void 0===i?void 0:i.length)&&(d.props.children=o.ps.children);var h=vt(vt({},e),l.$_cs);jt(o,o._ps,d?[d]:[],t,h),u?o._uefs.push((function(){null==c||c.register(o),l.componentDidMount()})):o._uefs.push((function(){l.componentDidUpdate(n,p)})),t.push((function(){o._usefs.forEach((function(t){t()})),u?o.md():o.ud(),o._defs=o._uefs.map((function(t){return t()}))}))},n.ss=function(t){var e=this.b;e&&t&&(e.state=t)},n.un=function(){var t,e=this;e._ps.forEach((function(t){t.un()})),null===(t=e.t.contextType)||void 0===t||t.unregister(e),clearTimeout(e.b.$_timer),e._defs.forEach((function(t){t&&t()})),e.b.componentWillUnmount()},e}(Rt);function At(t,e){var n=I(t),r=I(e),i=ft(n,r,(function(t){return t})),o={},a={},s={};return i.added.forEach((function(t){var n=r[t];o[n]=e[n]})),i.removed.forEach((function(e){var r=n[e];a[r]=t[r]})),i.maintained.forEach((function(r){var i=r[0],o=n[i],a=[t[o],e[o]];t[o]!==e[o]&&(s[o]=a)})),{added:o,removed:a,changed:s}}var It=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.typ="elem",e._es={},e._svg=!1,e}ht(e,t);var n=e.prototype;return n.e=function(t,e){var n=this,r=n._es,i=n.b,o=function(t){return t.replace(/^on/g,"").toLowerCase()}(t);e?(tt(i,o,r[t]),delete r[t]):(r[t]=function(e){var r,i;null===(i=(r=n.ps)[t])||void 0===i||i.call(r,e)},Q(i,o,r[t]))},n.s=function(t){return Et(this.ps,t)},n.r=function(t,e,n){var r,i=this,o=!i.b,a=i.ps;if(o){var s=Ct(i.c),u=!1;u=!(!i._svg&&"svg"!==i.t)||s&&s.ownerSVGElement,i._svg=u;var c=null===(r=i._hyd)||void 0===r?void 0:r.splice(0,1)[0],l=i.t;if(c)i._hyd=[].slice.call(c.children||[]);else{var f=et(s);c=u?f.createElementNS("http://www.w3.org/2000/svg",l):f.createElement(l)}i.b=c}jt(i,i._ps,a.children,t,e);var p=i.b,d=Dt(n),h=d[0],v=d[1],g=Dt(a),m=g[0],b=g[1];return function(t,e,n){var r=At(St(t),St(e)),i=r.added,o=r.removed,a=r.changed;for(var s in i)n.setAttribute(s,i[s]);for(var u in a)n.setAttribute(u,a[u][1]);for(var c in o)n.removeAttribute(c)}(h,m,p),function(t,e,n){var r=At(t,e),i=r.added,o=r.removed;for(var a in o)n.e(a,!0);for(var s in i)n.e(s)}(v,b,i),function(t,e,n){var r=n.style,i=At(t,e),o=i.added,a=i.removed,s=i.changed;for(var u in o){var c=T(u,"-");r.setProperty(c,o[u])}for(var u in s){var l=T(u,"-");r.setProperty(l,s[u][1])}for(var u in a){var f=T(u,"-");r.removeProperty(f)}}(n.style||{},a.style||{},p),t.push((function(){o?i.md():i.ud()})),!0},n.un=function(){var t=this,e=t._es,n=t.b;for(var r in e)tt(n,r,e[r]);t._ps.forEach((function(t){t.un()})),t._es={},t._sel||wt(n)},e}(Rt);function Ft(t){if(!t||ot(t))return t;var e=t.$_p._ps;return e.length?Ft(e[0].b):null}function Nt(t){if(t){if(t.b&&ot(t.b))return t;var e=t._ps;return e.length?Nt(e[0]):null}}function qt(t,e){for(var n=[],r=2;r0}function Ht(t,e,n){return!n&&t&&((n=new Yt(e.parentElement))._hyd=[e],n._sel=!0),function(t,e,n,r){void 0===n&&(n=e.__CROACT__),void 0===r&&(r={});var i=!!n;n||(n=new Yt(e));var o=[];jt(n,n._ps,t?[t]:[],o,r,void 0,void 0),_t(o),Tt(null),i||(e.__CROACT__=n)}(t,e,n),n}function Lt(t){var e=Pt(),n=e._hs||(e._hs=[]),r=Ot,i=n[r];if(Ot=r+1,i){if(!Et(i.deps,t.deps))return i.updated=!1,i;n[r]=t}else n.push(t);return t.value=t.func(),t.updated=!0,t}function Vt(t){return Lt({func:function(){return kt(t)},deps:[]}).value}function Ut(t,e,n){var r=Pt(),i=Lt({func:function(){return t},deps:e}),o=n?r._usefs:r._uefs;i.updated?o.push((function(){return i.effect&&i.effect(),i.effect=t(),i.effect})):o.push((function(){return i.effect}))}function $t(t,e){for(var n=t.length,r=0;r-1&&r.splice(i,1)}}else this._events[t]=[];else this._events={};return this},e.once=function(t,e){var n=this;return e&&this._addEvent(t,e,{once:!0}),new Promise((function(e){n._addEvent(t,e,{once:!0})}))},e.emit=function(t,e){var n=this;void 0===e&&(e={});var r=this._events[t];if(!t||!r)return!0;var i=!1;return e.eventType=t,e.stop=function(){i=!0},e.currentTarget=this,function(){for(var t=0,e=0,n=arguments.length;er-o?(s[1]>a.top||rs[1])&&(u[1]=1),a.left>n-o?(s[0]>a.left||ns[0])&&(u[0]=1),!(!u[0]&&!u[1])&&this._continueDrag(Ve(Ve({},e),{direction:u,inputEvent:t,isDrag:!0}))}},n.checkScroll=function(t){var e=this;if(this._isWait)return!1;var n=t.prevScrollPos,r=void 0===n?this._prevScrollPos:n,i=t.direction,o=t.throttleTime,a=void 0===o?0:o,s=t.inputEvent,u=t.isDrag,c=this._getScrollPosition(i||[0,0],t),l=c[0]-r[0],f=c[1]-r[1],p=i||[l?Math.abs(l)/l:0,f?Math.abs(f)/f:0];return this._prevScrollPos=c,this._lock=!1,!(!l&&!f)&&(this.emit("move",{offsetX:p[0]?l:0,offsetY:p[1]?f:0,inputEvent:s}),a&&u&&(clearTimeout(this._timer),this._timer=window.setTimeout((function(){e._continueDrag(t)}),a)),!0)},n.dragEnd=function(){this._flag=!1,this._lock=!1,clearTimeout(this._timer),this._unregisterScrollEvent()},n._getScrollPosition=function(t,e){var n=e.container,r=e.getScrollPosition;return(void 0===r?Ue:r)({container:Ze(n),direction:t})},n._continueDrag=function(t){var e,n=this,r=t.container,i=t.direction,o=t.throttleTime,a=t.useScroll,s=t.isDrag,u=t.inputEvent;if(!(!this._flag||s&&this._isWait)){var c=z(),l=Math.max(o+this._prevTime-c,0);if(l>0)return clearTimeout(this._timer),this._timer=window.setTimeout((function(){n._continueDrag(t)}),l),!1;this._prevTime=c;var f=this._getScrollPosition(i,t);this._prevScrollPos=f,s&&(this._isWait=!0),a||(this._lock=!0);var p={container:Ze(r),direction:i,inputEvent:u};return null===(e=t.requestScroll)||void 0===e||e.call(t,p),this.emit("scroll",p),this._isWait=!1,a||this.checkScroll(Ve(Ve({},t),{prevScrollPos:f,direction:i,inputEvent:u}))}},n._registerScrollEvent=function(t){this._unregisterScrollEvent();var e=t.checkScrollEvent;if(e){var n=!0===e?$e:e,r=Ze(t.container);!0!==e||r!==document.body&&r!==document.documentElement?this._unregister=n(r,this._onScroll):this._unregister=$e(window,this._onScroll)}},n._unregisterScrollEvent=function(){var t;null===(t=this._unregister)||void 0===t||t.call(this),this._unregister=null},e}(He),Je=Ke;function Qe(t){return L(t,v)}function tn(t){return t.length<3?0:Math.abs(function(t){for(var e=0,n=t.length-1;n>=0;--n)e+=t[n];return e}(t.map((function(e,n){var r=t[n+1]||t[0];return e[0]*r[1]-r[0]*e[1]}))))/2}function en(t,e){var n=e.width,r=e.height,i=e.left,o=e.top,a=nn(t),s=a.minX,u=a.minY,c=a.maxX,l=a.maxY,f=n/(c-s),p=r/(l-u);return t.map((function(t){return[i+(t[0]-s)*f,o+(t[1]-u)*p]}))}function nn(t){var e=t.map((function(t){return t[0]})),n=t.map((function(t){return t[1]}));return{minX:Math.min.apply(Math,e),minY:Math.min.apply(Math,n),maxX:Math.max.apply(Math,e),maxY:Math.max.apply(Math,n)}}function rn(t,e,n){var r=t[0],i=t[1],o=nn(e),a=o.minX,s=o.maxX,u=[[a,i],[s,i]],c=on(u[0],u[1]),l=un(e),f=[];if(l.forEach((function(e){var n,r=on(e[0],e[1]),o=e[0];(n=r,c.every((function(t,e){return 0===Qe(t-n[e])})))?f.push({pos:t,line:e,type:"line"}):sn(an(c,r),[u,e]).forEach((function(t){e.some((function(e){return r=t,!Qe((n=e)[0]-r[0])&&!Qe(n[1]-r[1]);var n,r}))?f.push({pos:t,line:e,type:"point"}):0!==Qe(o[1]-i)&&f.push({pos:t,line:e,type:"intersection"})}))})),!n&&k(f,(function(t){return t[0]===r})))return!0;var p=0,d={};return f.forEach((function(t){var e=t.pos,n=t.type,o=t.line;if(!(e[0]>r))if("intersection"===n)++p;else{if("line"===n)return;if("point"===n){var a=k(o,(function(t){return t[1]!==i})),s=d[e[0]],u=a[1]>i?1:-1;s?s!==u&&++p:d[e[0]]=u}}})),p%2==1}function on(t,e){var n=t[0],r=t[1],i=e[0]-n,o=e[1]-r;Math.abs(i)0)return[];r=[[s,a],[u,a]]}}else{var c=Math.max.apply(Math,n.map((function(t){return t[1][0]}))),l=Math.min.apply(Math,n.map((function(t){return t[1][1]})));if(Qe(c-l)>0)return[];r=[[o,c],[o,l]]}}return r.length||(r=t.filter((function(t){var e=t[0],r=t[1];return n.every((function(t){return 0<=Qe(e-t[0][0])&&0<=Qe(t[0][1]-e)&&0<=Qe(r-t[1][0])&&0<=Qe(t[1][1]-r)}))}))),r.map((function(t){return[Qe(t[0]),Qe(t[1])]}))}function un(t){return function(){for(var t=0,e=0,n=arguments.length;e=0?o:o+2*Math.PI)/Math.PI);var e,n,r,i,o}function dn(t){return t?t.touches?function(t){for(var e=Math.min(t.length,2),n=[],r=0;r=-1;if(!r.flag||!n){r._isDragAPI=!0;var i=r.options,o=i.container,a=i.pinchOutside,s=i.preventWheelClick,u=i.preventRightClick,c=i.preventDefault,l=i.checkInput,f=i.dragFocusedInput,p=i.preventClickEventOnDragStart,d=i.preventClickEventOnDrag,h=i.preventClickEventByCondition,v=r._useTouch,g=!r.flag;if(r._isSecondaryButton=3===t.which||2===t.button,s&&(2===t.which||1===t.button)||u&&(3===t.which||2===t.button))return r.stop(),!1;if(g){var m=r._window.document.activeElement,b=t.target;if(b){var x=b.tagName.toLowerCase(),y=xn.indexOf(x)>-1,E=b.isContentEditable;if(y||E){if(l||!f&&m===b)return!1;if(m&&(m===b||E&&m.isContentEditable&&m.contains(b))){if(!f)return!1;b.blur()}}else if((c||"touchstart"===t.type)&&m){var S=m.tagName.toLowerCase();(m.isContentEditable||xn.indexOf(S)>-1)&&m.blur()}(p||d||h)&&Q(r._window,"click",r._onClick,!0)}r.clientStores=[new bn(dn(t))],r._isIdle=!1,r.flag=!0,r.isDrag=!1,r._isTrusted=e,r._dragFlag=!0,r._prevInputEvent=t,r.data={},r.doubleFlag=z()-r.prevTime<200,r._isMouseEvent=function(t){return t&&(t.type.indexOf("mouse")>-1||"button"in t)}(t),!r._isMouseEvent&&r._preventMouseEvent&&(r._preventMouseEvent=!1),!1===(r._preventMouseEvent||r.emit("dragStart",fn(fn({data:r.data,datas:r.data,inputEvent:t,isMouseEvent:r._isMouseEvent,isSecondaryButton:r._isSecondaryButton,isTrusted:e,isDouble:r.doubleFlag},r.getCurrentStore().getPosition()),{preventDefault:function(){t.preventDefault()},preventDrag:function(){r._dragFlag=!1}})))&&r.stop(),r._isMouseEvent&&r.flag&&c&&t.preventDefault()}if(!r.flag)return!1;var D=0;if(g?(r._attchDragEvent(),v&&a&&(D=setTimeout((function(){Q(o,"touchstart",r.onDragStart,{passive:!1})})))):v&&a&&tt(o,"touchstart",r.onDragStart),r.flag&&function(t){return t.touches&&t.touches.length>=2}(t)){if(clearTimeout(D),g&&t.touches.length!==t.changedTouches.length)return;r.pinchFlag||r.onPinchStart(t)}}}},r.onDrag=function(t,e){if(r.flag){var n=r.options.preventDefault;!r._isMouseEvent&&n&&t.preventDefault(),r._prevInputEvent=t;var i=dn(t),o=r.moveClients(i,t,!1);if(r._dragFlag){if(r.pinchFlag||o.deltaX||o.deltaY)if(!1===(r._preventMouseEvent||r.emit("drag",fn(fn({},o),{isScroll:!!e,inputEvent:t}))))return void r.stop();r.pinchFlag&&r.onPinch(t,i)}r.getCurrentStore().getPosition(i,!0)}},r.onDragEnd=function(t){if(r.flag){var e=r.options,n=e.pinchOutside,i=e.container,o=e.preventClickEventOnDrag,a=e.preventClickEventOnDragStart,s=e.preventClickEventByCondition,u=r.isDrag;(o||a||s)&&requestAnimationFrame((function(){r._allowClickEvent()})),s||a||!o||u||r._allowClickEvent(),r._useTouch&&n&&tt(i,"touchstart",r.onDragStart),r.pinchFlag&&r.onPinchEnd(t);var c=(null==t?void 0:t.touches)?dn(t):[];0!==c.length&&r.options.keepDragging?r._addStore(new bn(c)):r.flag=!1;var l=r._getPosition(),f=z(),p=!u&&r.doubleFlag;r._prevInputEvent=null,r.prevTime=u||p?0:f,r.flag||(r._dettachDragEvent(),r._preventMouseEvent||r.emit("dragEnd",fn({data:r.data,datas:r.data,isDouble:p,isDrag:u,isClick:!u,isMouseEvent:r._isMouseEvent,isSecondaryButton:r._isSecondaryButton,inputEvent:t,isTrusted:r._isTrusted},l)),r.clientStores=[],r._isMouseEvent||(r._preventMouseEvent=!0,requestAnimationFrame((function(){requestAnimationFrame((function(){r._preventMouseEvent=!1}))}))),r._isIdle=!0)}},r.onBlur=function(){r.onDragEnd()},r._allowClickEvent=function(){tt(r._window,"click",r._onClick,!0)},r._onClick=function(t){r._allowClickEvent(),r._preventMouseEvent=!1;var e=r.options.preventClickEventByCondition;(null==e?void 0:e(t))||(t.stopPropagation(),t.preventDefault())},r._onContextMenu=function(t){r.options.preventRightClick?r.onDragEnd(t):t.preventDefault()},r._passCallback=function(){};var i=[].concat(e),o=i[0];r._window=o&&!("document"in o)?it(o):window,r.options=fn({checkInput:!1,container:o&&!("document"in o)?it(o):o,preventRightClick:!0,preventWheelClick:!0,preventClickEventOnDragStart:!1,preventClickEventOnDrag:!1,preventClickEventByCondition:null,preventDefault:!0,checkWindowBlur:!1,keepDragging:!1,pinchThreshold:0,events:["touch","mouse"]},n);var a=r.options,s=a.container,u=a.events,c=a.checkWindowBlur;if(r._useDrag=u.indexOf("drag")>-1,r._useTouch=u.indexOf("touch")>-1,r._useMouse=u.indexOf("mouse")>-1,r.targets=i,r._useDrag&&i.forEach((function(t){Q(t,"dragstart",r.onDragStart)})),r._useMouse&&(i.forEach((function(t){Q(t,"mousedown",r.onDragStart),Q(t,"mousemove",r._passCallback)})),Q(s,"contextmenu",r._onContextMenu)),c&&Q(it(),"blur",r.onBlur),r._useTouch){var l={passive:!1};i.forEach((function(t){Q(t,"touchstart",r.onDragStart,l),Q(t,"touchmove",r._passCallback,l)}))}return r}return function(t,e){function n(){this.constructor=t}ln(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.stop=function(){this.isDrag=!1,this.data={},this.clientStores=[],this.pinchFlag=!1,this.doubleFlag=!1,this.prevTime=0,this.flag=!1,this._isIdle=!0,this._allowClickEvent(),this._dettachDragEvent(),this._isDragAPI=!1},e.prototype.getMovement=function(t){return this.getCurrentStore().getMovement(t)+this.clientStores.slice(1).reduce((function(t,e){return t+e.movement}),0)},e.prototype.isDragging=function(){return this.isDrag},e.prototype.isIdle=function(){return this._isIdle},e.prototype.isFlag=function(){return this.flag},e.prototype.isPinchFlag=function(){return this.pinchFlag},e.prototype.isDoubleFlag=function(){return this.doubleFlag},e.prototype.isPinching=function(){return this.isPinch},e.prototype.scrollBy=function(t,e,n,r){void 0===r&&(r=!0),this.flag&&(this.clientStores[0].move(t,e),r&&this.onDrag(n,!0))},e.prototype.move=function(t,e){var n=t[0],r=t[1],i=this.getCurrentStore().prevClients;return this.moveClients(i.map((function(t){var e=t.clientX,i=t.clientY;return{clientX:e+n,clientY:i+r,originalClientX:e,originalClientY:i}})),e,!0)},e.prototype.triggerDragStart=function(t){this.onDragStart(t,!1)},e.prototype.setEventData=function(t){var e=this.data;for(var n in t)e[n]=t[n];return this},e.prototype.setEventDatas=function(t){return this.setEventData(t)},e.prototype.getCurrentEvent=function(t){return void 0===t&&(t=this._prevInputEvent),fn(fn({data:this.data,datas:this.data},this._getPosition()),{movement:this.getMovement(),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:t})},e.prototype.getEventData=function(){return this.data},e.prototype.getEventDatas=function(){return this.data},e.prototype.unset=function(){var t=this,e=this.targets,n=this.options.container;this.off(),tt(this._window,"blur",this.onBlur),this._useDrag&&e.forEach((function(e){tt(e,"dragstart",t.onDragStart)})),this._useMouse&&(e.forEach((function(e){tt(e,"mousedown",t.onDragStart)})),tt(n,"contextmenu",this._onContextMenu)),this._useTouch&&(e.forEach((function(e){tt(e,"touchstart",t.onDragStart)})),tt(n,"touchstart",this.onDragStart)),this._prevInputEvent=null,this._allowClickEvent(),this._dettachDragEvent()},e.prototype.onPinchStart=function(t){var e=this,n=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>n)){var r=new bn(dn(t));this.pinchFlag=!0,this._addStore(r),!1===this.emit("pinchStart",fn(fn({data:this.data,datas:this.data,angle:r.getAngle(),touches:this.getCurrentStore().getPositions()},r.getPosition()),{inputEvent:t,isTrusted:this._isTrusted,preventDefault:function(){t.preventDefault()},preventDrag:function(){e._dragFlag=!1}}))&&(this.pinchFlag=!1)}},e.prototype.onPinch=function(t,e){if(this.flag&&this.pinchFlag&&!(e.length<2)){var n=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",fn(fn({data:this.data,datas:this.data,movement:this.getMovement(e),angle:n.getAngle(e),rotation:n.getRotation(e),touches:n.getPositions(e),scale:n.getScale(e),distance:n.getDistance(e)},n.getPosition(e)),{inputEvent:t,isTrusted:this._isTrusted}))}},e.prototype.onPinchEnd=function(t){if(this.pinchFlag){var e=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var n=this.getCurrentStore();this.emit("pinchEnd",fn(fn({data:this.data,datas:this.data,isPinch:e,touches:n.getPositions()},n.getPosition()),{inputEvent:t}))}},e.prototype.getCurrentStore=function(){return this.clientStores[0]},e.prototype.moveClients=function(t,e,n){var r=this._getPosition(t,n),i=this.isDrag;(r.deltaX||r.deltaY)&&(this.isDrag=!0);var o=!1;return!i&&this.isDrag&&(o=!0),fn(fn({data:this.data,datas:this.data},r),{movement:this.getMovement(t),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,isMouseEvent:this._isMouseEvent,isSecondaryButton:this._isSecondaryButton,inputEvent:e,isTrusted:this._isTrusted,isFirstDrag:o})},e.prototype._addStore=function(t){this.clientStores.splice(0,0,t)},e.prototype._getPosition=function(t,e){var n=this.getCurrentStore().getPosition(t,e),r=this.clientStores.slice(1).reduce((function(t,e){var n=e.getPosition();return t.distX+=n.distX,t.distY+=n.distY,t}),n),i=r.distX,o=r.distY;return fn(fn({},n),{distX:i,distY:o})},e.prototype._attchDragEvent=function(){var t=this._window,e=this.options.container,n={passive:!1};this._isDragAPI&&(Q(e,"dragover",this.onDrag,n),Q(t,"dragend",this.onDragEnd)),this._useMouse&&(Q(e,"mousemove",this.onDrag),Q(t,"mouseup",this.onDragEnd)),this._useTouch&&(Q(e,"touchmove",this.onDrag,n),Q(t,"touchend",this.onDragEnd,n),Q(t,"touchcancel",this.onDragEnd,n))},e.prototype._dettachDragEvent=function(){var t=this._window,e=this.options.container;this._isDragAPI&&(tt(e,"dragover",this.onDrag),tt(t,"dragend",this.onDragEnd)),this._useMouse&&(tt(e,"mousemove",this.onDrag),tt(t,"mouseup",this.onDragEnd)),this._useTouch&&(tt(e,"touchstart",this.onDragStart),tt(e,"touchmove",this.onDrag),tt(t,"touchend",this.onDragEnd),tt(t,"touchcancel",this.onDragEnd))},e}(He);var En=function(t){for(var e=5381,n=t.length;n;)e=33*e^t.charCodeAt(--n);return e>>>0};function Sn(t,e,n,r,i){var o=et(r),a=o.createElement("style");return a.setAttribute("type","text/css"),a.setAttribute("data-styled-id",t),a.setAttribute("data-styled-count","1"),n.nonce&&a.setAttribute("nonce",n.nonce),a.innerHTML=function(t,e,n){return n.original?e:e.replace(/([^};{\s}][^};{]*|^\s*){/gm,(function(e,n){var r=n.trim();return(r?O(r):[""]).map((function(e){var n=e.trim();return 0===n.indexOf("@")?n:n.indexOf(":global")>-1?n.replace(/\:global/g,""):n.indexOf(":host")>-1?"".concat(n.replace(/\:host/g,".".concat(t))):n?".".concat(t," ").concat(n):".".concat(t)})).join(", ")+" {"}))}(t,e,n),(i||o.head||o.body).appendChild(a),a}function Dn(t){var e="rCS"+En(t).toString(36);return{className:e,inject:function(n,r){void 0===r&&(r={});var i=function(t){if(t&&t.getRootNode){var e=t.getRootNode();if(11===e.nodeType)return e}}(n),o=(i||n.ownerDocument||document).querySelector('style[data-styled-id="'.concat(e,'"]'));if(o){var a=parseFloat(o.getAttribute("data-styled-count"))||0;o.setAttribute("data-styled-count","".concat(a+1))}else o=Sn(e,t,r,n,i);return{destroy:function(){var t,e=parseFloat(o.getAttribute("data-styled-count"))||0;e<=1?(o.remove?o.remove():null===(t=o.parentNode)||void 0===t||t.removeChild(o),o=null):o.setAttribute("data-styled-count","".concat(e-1))}}}}}var Cn=function(){return Cn=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function Pn(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i=109||Wn&&jn>=109,Ln="firefox"===qn,Vn=parseInt(In.browser.webkitVersion,10)>=612||Yn>=15,Un="moveable-",$n=Gn.map((function(t){var e="",n="",r="center",i="center",o="calc(var(--moveable-control-padding, 20) * -1px)";return t.indexOf("n")>-1&&(e="top: ".concat(o,";"),i="bottom"),t.indexOf("s")>-1&&(e="top: 0px;",i="top"),t.indexOf("w")>-1&&(n="left: ".concat(o,";"),r="right"),t.indexOf("e")>-1&&(n="left: 0px;",r="left"),'.around-control[data-direction*="'.concat(t,'"] {\n ').concat(n).concat(e,"\n transform-origin: ").concat(r," ").concat(i,";\n }")})).join("\n"),Zn="\n{\nposition: absolute;\nwidth: 1px;\nheight: 1px;\nleft: 0;\ntop: 0;\nz-index: 3000;\n--moveable-color: #4af;\n--zoom: 1;\n--zoompx: 1px;\n--moveable-line-padding: 0;\n--moveable-control-padding: 0;\nwill-change: transform;\noutline: 1px solid transparent;\n}\n.control-box {\nz-index: 0;\n}\n.line, .control {\nposition: absolute;\nleft: 0;\ntop: 0;\nwill-change: transform;\n}\n.control {\nwidth: 14px;\nheight: 14px;\nborder-radius: 50%;\nborder: 2px solid #fff;\nbox-sizing: border-box;\nbackground: #4af;\nbackground: var(--moveable-color);\nmargin-top: -7px;\nmargin-left: -7px;\nborder: 2px solid #fff;\nz-index: 10;\n}\n.around-control {\nposition: absolute;\nwill-change: transform;\nwidth: calc(var(--moveable-control-padding, 20) * 1px);\nheight: calc(var(--moveable-control-padding, 20) * 1px);\nleft: calc(var(--moveable-control-padding, 20) * -0.5px);\ntop: calc(var(--moveable-control-padding, 20) * -0.5px);\nbox-sizing: border-box;\nbackground: transparent;\nz-index: 8;\ncursor: alias;\ntransform-origin: center center;\n}\n".concat($n,"\n.padding {\nposition: absolute;\ntop: 0px;\nleft: 0px;\nwidth: 100px;\nheight: 100px;\ntransform-origin: 0 0;\n}\n.line {\nwidth: 1px;\nheight: 1px;\nbackground: #4af;\nbackground: var(--moveable-color);\ntransform-origin: 0px 50%;\n}\n.line.edge {\nz-index: 1;\nbackground: transparent;\n}\n.line.dashed {\nbox-sizing: border-box;\nbackground: transparent;\n}\n.line.dashed.horizontal {\nborder-top: 1px dashed #4af;\nborder-top-color: #4af;\nborder-top-color: var(--moveable-color);\n}\n.line.dashed.vertical {\nborder-left: 1px dashed #4af;\nborder-left-color: #4af;\nborder-left-color: var(--moveable-color);\n}\n.line.vertical {\ntransform: translateX(-50%);\n}\n.line.horizontal {\ntransform: translateY(-50%);\n}\n.line.vertical.bold {\nwidth: 2px;\n}\n.line.horizontal.bold {\nheight: 2px;\n}\n\n.control.origin {\nborder-color: #f55;\nbackground: #fff;\nwidth: 12px;\nheight: 12px;\nmargin-top: -6px;\nmargin-left: -6px;\npointer-events: none;\n}\n").concat([0,15,30,45,60,75,90,105,120,135,150,165].map((function(t){return'\n.direction[data-rotation="'.concat(t,'"], :global .view-control-rotation').concat(t," {\n").concat(function(t){var e=function(t,e){return'data:image/svg+xml;utf8,')}(1,t),n=45*Math.round(t/45)%180,r="ns-resize";return 135===n?r="nwse-resize":45===n?r="nesw-resize":90===n&&(r="ew-resize"),"cursor:".concat(r,";cursor: url('").concat(e,"') 16 16, ").concat(r,";")}(t),"\n}\n")})).join("\n"),'\n\n.line.direction:before {\ncontent: "";\nposition: absolute;\nwidth: 100%;\nheight: calc(var(--moveable-line-padding, 0) * 1px);\nbottom: 0;\nleft: 0;\n}\n.group {\nz-index: -1;\n}\n.area {\nposition: absolute;\n}\n.area-pieces {\nposition: absolute;\ntop: 0;\nleft: 0;\ndisplay: none;\n}\n.area.avoid, .area.pass {\npointer-events: none;\n}\n.area.avoid+.area-pieces {\ndisplay: block;\n}\n.area-piece {\nposition: absolute;\n}\n\n').concat(Nn?':global svg *:before {\ncontent:"";\ntransform-origin: inherit;\n}':"","\n"),Kn=[[0,1,2],[1,0,3],[2,0,3],[3,1,2]],Jn=1e-4,Qn=1e-7,tr=1e-9,er=Math.pow(10,10),nr=-er,rr={n:[0,-1],e:[1,0],s:[0,1],w:[-1,0],nw:[-1,-1],ne:[1,-1],sw:[-1,1],se:[1,1]},ir={n:[0,1],e:[1,3],s:[3,2],w:[2,0],nw:[0],ne:[1],sw:[2],se:[3]},or={n:0,s:180,w:270,e:90,nw:315,ne:45,sw:225,se:135},ar=["isMoveableElement","updateRect","updateTarget","destroy","dragStart","isInside","hitTest","setState","getRect","request","isDragging","getManager","forceUpdate","waitToChangeTarget","updateSelectors","getTargets","stopDrag","getControlBoxElement","getMoveables","getDragElement"];function sr(t,e,n,r,i,o){var a,s;void 0===o&&(o="draggable");var u=null!==(s=null===(a=e.gestos[o])||void 0===a?void 0:a.move(n,t.inputEvent))&&void 0!==s?s:{},c=u.originalDatas||u.datas,l=c[o]||(c[o]={});return On(On({},i?va(e,u):u),{isPinch:!!r,parentEvent:!0,datas:l,originalDatas:t.originalDatas})}var ur=function(){function t(t){var e;void 0===t&&(t="draggable"),this.ableName=t,this.prevX=0,this.prevY=0,this.startX=0,this.startY=0,this.isDrag=!1,this.isFlag=!1,this.datas={draggable:{}},this.datas=((e={})[t]={},e)}var e=t.prototype;return e.dragStart=function(t,e){this.isDrag=!1,this.isFlag=!1;var n=e.originalDatas;return this.datas=n,n[this.ableName]||(n[this.ableName]={}),On(On({},this.move(t,e.inputEvent)),{type:"dragstart"})},e.drag=function(t,e){return this.move([t[0]-this.prevX,t[1]-this.prevY],e)},e.move=function(t,e){var n,r,i=!1;if(this.isFlag){var o=this.isDrag;n=this.prevX+t[0],r=this.prevY+t[1],(t[0]||t[1])&&(this.isDrag=!0),!o&&this.isDrag&&(i=!0)}else this.prevX=t[0],this.prevY=t[1],this.startX=t[0],this.startY=t[1],n=t[0],r=t[1],this.isFlag=!0;return this.prevX=n,this.prevY=r,{type:"drag",clientX:n,clientY:r,inputEvent:e,isFirstDrag:i,isDrag:this.isDrag,distX:n-this.startX,distY:r-this.startY,deltaX:t[0],deltaY:t[1],datas:this.datas[this.ableName],originalDatas:this.datas,parentEvent:!0,parentGesto:this}},t}();function cr(t,e,n,r){var i=16===t.length?4:3,o=Rn(Io(t,n,r,i),4),a=Rn(o[0],2),s=a[0],u=a[1],c=Rn(o[1],2),l=c[0],f=c[1],p=Rn(o[2],2),d=p[0],h=p[1],v=Rn(o[3],2),g=v[0],m=v[1],b=Rn(Ao(t,e,i),2),x=b[0],y=b[1],E=Math.min(s,l,d,g),S=Math.min(u,f,h,m),D=Math.max(s,l,d,g);return s=s-E||0,{left:E,top:S,right:D,bottom:Math.max(u,f,h,m),origin:[x=x-E||0,y=y-S||0],pos1:[s,u=u-S||0],pos2:[l=l-E||0,f=f-S||0],pos3:[d=d-E||0,h=h-S||0],pos4:[g=g-E||0,m=m-S||0],direction:Pa(t[0]*t[i+1])}}function lr(t,e){var n=e.clientX,r=e.clientY,i=e.datas,o=t.state,a=o.moveableClientRect,s=o.rootMatrix,u=o.is3d,c=o.pos1,l=Rn(ye(ha(s,[n-a.left,r-a.top],u?4:3),c),2),f=Rn(mr({datas:i,distX:l[0],distY:l[1]}),2);return[f[0],f[1]]}function fr(t,e){var n=e.datas,r=t.state,i=r.allMatrix,o=r.beforeMatrix,a=r.is3d,s=r.left,u=r.top,c=r.origin,l=r.offsetMatrix,f=r.targetMatrix,p=r.transformOrigin,d=a?4:3;n.is3d=a,n.matrix=i,n.targetMatrix=f,n.beforeMatrix=o,n.offsetMatrix=l,n.transformOrigin=p,n.inverseMatrix=de(i,d),n.inverseBeforeMatrix=de(o,d),n.absoluteOrigin=ve(xe([s,u],c),d),n.startDragBeforeDist=Se(n.inverseBeforeMatrix,n.absoluteOrigin,d),n.startDragDist=Se(n.inverseMatrix,n.absoluteOrigin,d)}function pr(t,e,n){var r=e.datas,i=e.originalDatas.beforeRenderable,o=r.transformIndex,a=i.nextTransforms,s=a.length,u=i.nextTransformAppendedIndexes,c=-1;-1===o?("translate"===n?c=0:"rotate"===n&&(c=G(a,(function(t){return t.match(/scale\(/g)}))),-1===c&&(c=a.length),r.transformIndex=c):c=k(u,(function(t){return t.index===o&&t.functionName===n}))?o:o+u.filter((function(t){return t.indexc&&(r.isAppendTransform=!0,i.nextTransformAppendedIndexes=Pn(Pn([],Rn(u),!1),[{functionName:n,index:c,isAppend:!0}],!1))}function dr(t,e,n){return"".concat(t.beforeFunctionTexts.join(" ")," ").concat(t.isAppendTransform?n:e," ").concat(t.afterFunctionTexts.join(" "))}function hr(t){var e=t.datas,n=Rn(gr({datas:e,distX:t.distX,distY:t.distY}),2);return Se(vr(e,function(t,e){for(var n=Te(e),r=0;r=0&&(t[0]>=0&&e.push(3),t[0]<=0&&e.push(2)),t[1]<=0&&(t[0]>=0&&e.push(1),t[0]<=0&&e.push(0)),e}function xr(t,e){var n=(e+1)/2;return[m(t[0][0],t[1][0],n,1-n),m(t[0][1],t[1][1],n,1-n)]}function yr(t,e){var n=xr([t[0],t[1]],e[0]),r=xr([t[2],t[3]],e[0]);return xr([n,r],e[1])}function Er(t,e,n,r){return be(t,Co(e,r,n),r)}function Sr(t,e){var n=_r(e);return{setTransform:function(r,i){void 0===i&&(i=-1),n.startTransforms=y(r)?r:M(r),Cr(t,e,i)},setTransformIndex:function(n){Cr(t,e,n)}}}function Dr(t,e,n){Cr(t,e,G(_r(e).startTransforms,(function(t){return 0===t.indexOf("".concat(n,"("))})))}function Cr(t,e,n){var r=_r(e),i=e.datas;if(i.transformIndex=n,-1!==n){var o=r.startTransforms[n];if(o){var a=t.state,s=Fe([o],{"x%":function(t){return t/100*a.offsetWidth},"y%":function(t){return t/100*a.offsetHeight}});i.startValue=s[0].functionValue}}}function wr(t,e){_r(t).nextTransforms=M(e)}function _r(t){return t.originalDatas.beforeRenderable}function Mr(t){return t.originalDatas.beforeRenderable.nextTransforms}function Or(t){return(Mr(t)||[]).join(" ")}function Rr(t){return _r(t).nextStyle}function Pr(t,e,n,r,i){wr(i,e);var o=Fi.drag(t,sr(i,t.state,n,r,!1)),a=o?o.transform:e;return On(On({transform:e,drag:o},na({transform:a},i)),{afterTransform:a})}function Tr(t,e,n,r,i,o){var a=function(t,e,n,r){var i,o=t.transformOrigin,a=t.offsetMatrix,s=t.is3d?4:3;if(E(n)){var u=e.beforeTransform,c=e.afterTransform;i=ge(r?Ae(n):be(be(u,Ae([n]),4),c,4),4,s)}else i=n;return Er(a,i,o,s)}(t.state,i,e,o),s=function(t,e,n,r){void 0===r&&(r=t.state.allMatrix);var i=t.state,o=i.width,a=i.height,s=i.is3d?4:3,u=[o/2*(1+e[0])+n[0],a/2*(1+e[1])+n[1]];return Ao(r,u,s)}(t,n,r,a);return s}function zr(t,e,n,r,i,o,a){var s=Tr(t,e,n,i,o,a),u=t.state,c=u.left,l=u.top,f=t.props.groupable,p=f?c:0,d=f?l:0,h=ye(r,s);return ye(h,[p,d])}function Gr(t,e,n,r,i,o){var a=t.props.groupable,s=t.state,u=s.transformOrigin,c=s.offsetMatrix,l=s.is3d,f=s.width,p=s.height,d=s.left,h=s.top,v=o.fixedDirection,g=o.nextTargetMatrix||s.targetMatrix,m=l?4:3,b=function(t,e,n,r,i,o){return void 0===r&&(r=e),void 0===i&&(i=n),void 0===o&&(o=[0,0]),t?t.map((function(t,a){var s=P(t),u=s.value,c=s.unit,l=a?i:r,f=a?n:e;return"%"===t||isNaN(u)?f*(l?o[a]/l:0):"%"!==c?u:f*u/100})):o}(i,e,n,f,p,u),x=a?d:0,y=a?h:0,E=function(t,e,n,r,i,o){var a=yr(Io(e,n,r,i),o);return[t[0]-a[0],t[1]-a[1]]}(r,Er(c,g,b,m),e,n,m,v);return ye(E,[x,y])}function kr(t){if(t&&t.getRootNode){var e=t.getRootNode();if(11===e.nodeType)return e}}function Br(t){var e=t("scale"),n=t("rotate"),r=t("translate"),i=[];return r&&"0px"!==r&&"none"!==r&&i.push("translate(".concat(r.split(/\s+/).join(","),")")),n&&"1"!==n&&"none"!==n&&i.push("rotate(".concat(n,")")),e&&"1"!==e&&"none"!==e&&i.push("scale(".concat(e.split(/\s+/).join(","),")")),i}function Ar(t,e,n){for(var r,i,o,a,s,u=t,c=[],l=nt(t)||rt(t),f=!n&&t===e||t===l,p=f,d=!1,h=3,v=!1,g=Oo(e,e,!0).offsetParent,m=1;u&&!p;){p=f;var b=Yr(u),x=b("position"),y=Mo(u),E="fixed"===x,S=Br(b),D=(a=Do(y),void 0===(s=void 0)&&(s=6===a.length),s?[a[0],a[1],0,a[2],a[3],0,a[4],a[5],1]:a),C=void 0,w=!1,_=!1,M=0,O=0,R=0,P=0,T={hasTransform:!1,fixedContainer:null};E&&(v=!0,g=(T=zo(u)).fixedContainer);var z=D.length;d||16!==z&&!S.length||(d=!0,h=4,To(c),o&&(o=ge(o,3,4))),d&&9===z&&(D=ge(D,3,4));var G=Ro(u,t),k=G.tagName,B=G.hasOffset,A=G.isSVG,I=G.origin,F=G.targetOrigin,N=Rn(G.offset,2),q=N[0],Y=N[1];"svg"===k&&!t.ownerSVGElement&&o&&(c.push({type:"target",target:u,matrix:Bo(u,h)}),c.push({type:"offset",target:u,matrix:Te(h)}));var X=parseFloat(b("zoom"))||1;if(E)C=T.fixedContainer,w=!0;else{var W=Oo(u,e,!1,!0,b),j=W.offsetZoom;if(C=W.offsetParent,w=W.isEnd,_=W.isStatic,m*=j,(W.isCustomElement||1!==j)&&_)q-=C.offsetLeft,Y-=C.offsetTop;else if(Ln||Hn){if(W.parentSlotElement){for(var H=C,L=0,V=0;H&&kr(H);)L+=H.offsetLeft,V+=H.offsetTop,H=H.offsetParent;q-=L,Y-=V}}}if(!Fn||Vn||!B||A||!_||"relative"!==x&&"static"!==x||(q-=C.offsetLeft,Y-=C.offsetTop,f=f||w),E)B&&T.hasTransform&&(R=C.clientLeft,P=C.clientTop);else if(B&&g!==C&&(M=C.clientLeft,O=C.clientTop),B&&C===l){var U=Po(u,!1);q+=U[0],Y+=U[1]}if(c.push({type:"target",target:u,matrix:Co(D,h,I)}),S.length&&(c.push({type:"offset",target:u,matrix:Te(h)}),c.push({type:"target",target:u,matrix:Co(Ae(S),h,I)})),B){var $=u===t,Z=$?0:u.scrollLeft,K=$?0:u.scrollTop;c.push({type:"offset",target:u,matrix:Ge([q-Z+M-R,Y-K+O-P],h)})}else c.push({type:"offset",target:u,origin:I});if(1!==X&&c.push({type:"zoom",target:u,matrix:Co(ze([X,X],h),h,[0,0])}),o||(o=D),r||(r=I),i||(i=F),p||E)break;u=C,f=w,n&&u!==l||(p=f)}return o||(o=Te(h)),r||(r=[0,0]),i||(i=[0,0]),{zoom:m,offsetContainer:g,matrixes:c,targetMatrix:o,transformOrigin:r,targetOrigin:i,is3d:d,hasFixed:v}}var Ir=null,Fr=null,Nr=null;function qr(t){t?(window.Map&&(Ir=new Map,Fr=new Map),Nr=[]):(Ir=null,Nr=null,Fr=null)}function Yr(t){var e=null==Ir?void 0:Ir.get(t);if(!e){var n=it(t).getComputedStyle(t);if(!Ir)return function(t){return n[t]};e={style:n,cached:{}},Ir.set(t,e)}var r=e.cached,i=e.style;return function(t){return t in r||(r[t]=i[t]),r[t]}}function Xr(t,e,n){var r=n.originalDatas;r.groupable=r.groupable||{};var i=r.groupable;i.childDatas=i.childDatas||[];var o=i.childDatas;return t.moveables.map((function(t,r){return o[r]=o[r]||{},o[r][e]=o[r][e]||{},On(On({},n),{isRequestChild:!0,datas:o[r][e],originalDatas:o[r]})}))}function Wr(t,e,n,r,i,o,a){var s=!!n.match(/Start$/g),u=!!n.match(/End$/g),c=i.isPinch,l=i.datas,f=Xr(t,e.name,i),p=t.moveables,d=[],h=f.map((function(t,i){var f=p[i],h=f.state,v=h.gestos,g=t;if(s)g=new ur(a).dragStart(r,t),d.push(g);else{if(v[a]||(v[a]=l.childGestos[i]),!v[a])return;g=sr(t,h,r,c,o,a),d.push(g)}var m=e[n](f,On(On({},g),{parentFlag:!0}));return u&&(v[a]=null),m}));return s&&(l.childGestos=p.map((function(t){return t.state.gestos[a]}))),{eventParams:h,childEvents:d}}function jr(t,e,n,r,i,o){void 0===i&&(i=function(t,e){return e});var a=!!n.match(/End$/g),s=Xr(t,e.name,r),u=t.moveables;return s.map((function(t,r){var s,c=u[r];s=i(c,t);var l=e[n](c,On(On({},s),{parentFlag:!0}));return l&&o&&o(c,t,l,r),a&&(c.state.gestos={}),l}))}function Hr(t,e,n,r){var i=n.fixedDirection,o=n.fixedPosition,a=yr(r.datas.startPositions||Qo(e.state),i),s=Rn(Se(Pe(-t.rotation/180*Math.PI,3),[a[0]-o[0],a[1]-o[1],1],3),2),u=s[0],c=s[1];return r.datas.originalX=u,r.datas.originalY=c,r}function Lr(t,e,n,r){var i=t.getState(),o=i.renderPoses,a=i.rotation,s=i.direction,u=jo(t.props,e).zoom,c=lo(a/Math.PI*180),l={},f=t.renderState;f.renderDirectionMap||(f.renderDirectionMap={});var p=f.renderDirectionMap;n.forEach((function(t){var e=t.dir;l[e]=!0}));var d=Pa(s);return n.map((function(t){var n=t.data,i=t.classNames,s=t.dir,f=ir[s];if(!f||!l[s])return null;p[s]=!0;var h=(L(c,15)+d*or[s]+720)%180,v={};return I(n).forEach((function(t){v["data-".concat(t)]=n[t]})),r.createElement("div",On({className:Eo.apply(void 0,Pn(["control","direction",s,e],Rn(i),!1)),"data-rotation":h,"data-direction":s},v,{key:"direction-".concat(s),style:Wo.apply(void 0,Pn([a,u],Rn(f.map((function(t){return o[t]}))),!1))}))}))}function Vr(t,e,n,r){var i=jo(t.props,n),o=i.renderDirections,a=void 0===o?e:o,s=i.displayAroundControls;if(!a)return[];var u=!0===a?Gn:a;return Pn(Pn([],Rn(s?Jr(t,r,n,u):[]),!1),Rn(Lr(t,n,u.map((function(t){return{data:{},classNames:[],dir:t}})),r)),!1)}function Ur(t,e,n,r,i,o){for(var a=[],s=6;so&&s.push({direction:"start",isBound:!0,offset:o-r,pos:r}),i-1.1||t[0]>e.right&&Ta(t[0]-e.right)>.1||t[1].1||t[1]>e.bottom&&Ta(t[1]-e.bottom)>.1}))}function ri(t,e,n,r,i){if(!t.props.bounds)return[];var o=i*Math.PI/180,a=ti(t),s=a.left,u=a.top,c=a.right,l=a.bottom,f=s-r[0],p=c-r[0],d=u-r[1],h=l-r[1],v={left:f,top:d,right:p,bottom:h};if(!ni(n,v,0))return[];var g=[];return[[f,0],[p,0],[d,1],[h,1]].forEach((function(t){var r=Rn(t,2),i=r[0],a=r[1];n.forEach((function(t){var n=W([0,0],t);g.push.apply(g,Pn([],Rn(function(t,e,n){var r=qo(t),i=Math.sqrt(r*r-e*e)||0;return[i,-i].sort((function(e,r){return Ta(e-t[n?0:1])-Ta(r-t[n?0:1])})).map((function(t){return W([0,0],n?[t,e]:[e,t])}))}(t,i,a).map((function(t){return o+t-n})).filter((function(t){return!ni(e,v,t)})).map((function(t){return L(180*t/Math.PI,Qn)}))),!1))}))})),g}var ii=["left","right","center"],oi=["top","bottom","middle"],ai={left:"start",right:"end",center:"center",top:"start",bottom:"end",middle:"center"},si={start:"left",end:"right",center:"center"},ui={start:"top",end:"bottom",center:"middle"};function ci(t,e){var n=t.props,r=n.snappable,i=n.bounds,o=n.innerBounds,a=n.verticalGuidelines,s=n.horizontalGuidelines,u=n.snapGridWidth,c=n.snapGridHeight,l=t.state,f=l.guidelines,p=l.enableSnap;return!(!r||!p||e&&!0!==r&&r.indexOf(e)<0)&&!!(u||c||i||o||f&&f.length||a&&a.length||s&&s.length)}function li(t){return!1===t?{}:!0!==t&&t?t:{left:!0,right:!0,top:!0,bottom:!0}}function fi(t,e){var n=function(t,e){var n=li(t),r={};for(var i in n)i in e&&n[i]&&(r[i]=e[i]);return r}(t,e),r=oi.filter((function(t){return t in n})),i=ii.filter((function(t){return t in n}));return{horizontalNames:r,verticalNames:i,horizontal:r.map((function(t){return n[t]})),vertical:i.map((function(t){return n[t]}))}}function pi(t,e,n,r,i,o){var a;void 0===r&&(r=[]),void 0===i&&(i=[]);var s=t.props,u=(null===(a=t.state.snapThresholdInfo)||void 0===a?void 0:a.multiples)||[1,1],c=function(){for(var t=[],e=0;er)})).sort((function(t,e){return t.dist-e.dist}));return{pos:n,index:o,guidelineInfos:u,direction:a}})).filter((function(t){return t.guidelineInfos.length>0})).sort((function(t,e){return t.guidelineInfos[0].dist-e.guidelineInfos[0].dist})),c=u.length>0;return{isSnap:c,index:c?u[0].index:-1,direction:null!==(a=null===(o=u[0])||void 0===o?void 0:o.direction)&&void 0!==a?a:"",posInfos:u}}function bi(t,e,n,r){void 0===r&&(r=1);var i=[];n[0]&&n[1]?i=[n,[-n[0],n[1]],[n[0],-n[1]]]:n[0]||n[1]?t.props.keepRatio?i.push([-1,-1],[-1,1],[1,-1],[1,1],n):(i.push.apply(i,Pn([],Rn(function(t,e){return br(e).map((function(e){return t[e]}))}([[-1,-1],[1,-1],[-1,-1],[1,1]],n)),!1)),i.length>1&&i.push([(i[0][0]+i[1][0])/2,(i[0][1]+i[1][1])/2])):[[-1,-1],[1,-1],[1,1],[-1,1]].forEach((function(t,e,n){var r=n[e+1]||n[0];i.push(t),i.push([(t[0]+r[0])/2,(t[1]+r[1])/2])}));var o=i.map((function(t){return yr(e,t)})),a=pi(t,o.map((function(t){return t[0]})),o.map((function(t){return t[1]})),i.map((function(t){return hi(t[0])})),i.map((function(t){return hi(t[1])})),r),s=hi(i.map((function(t){return t[0]}))[a.vertical.index]),u=hi(i.map((function(t){return t[1]}))[a.horizontal.index]);return{vertical:On(On({},a.vertical),{direction:s}),horizontal:On(On({},a.horizontal),{direction:u})}}function xi(t,e){var n=Ta(t.offset),r=Ta(e.offset);return t.isBound&&e.isBound?r-n:t.isBound?-1:e.isBound?1:t.isSnap&&e.isSnap?r-n:t.isSnap?-1:e.isSnap||na||u>a,l=Rn(mr({datas:i,distX:o[0],distY:o[1]}),2);return{offset:[l[0],l[1]],isOutside:c}}function zi(t,e){return t.isBound?t.offset:e.isSnap?gi(e).offset:0}function Gi(t,e,n,r,i,o){if(!ci(t,"draggable"))return[{isSnap:!1,isBound:!1,offset:0},{isSnap:!1,isBound:!1,offset:0}];var a=Jo(o.absolutePoses,[e,n]),s=Fo(a),u=s.left,c=s.right,l=s.top,f=s.bottom,p={horizontal:a.map((function(t){return t[1]})),vertical:a.map((function(t){return t[0]}))},d=ki(t,i,fi(li(t.props.snapDirections),{left:u,right:c,top:l,bottom:f,center:(u+c)/2,middle:(l+f)/2}),p),h=d.vertical,g=d.horizontal,m=Mi(t,a,o),b=m.vertical,x=m.horizontal,y=h.isSnap,E=g.isSnap,S=h.isBound||b.isBound,D=g.isBound||x.isBound,C=Rn(function(t,e,n,r,i){var o=Rn(e,2),a=o[0],s=o[1],u=Rn(n,2),c=u[0],l=u[1],f=Rn(r,2),p=f[0],d=f[1],h=Rn(i,2),g=h[0],m=h[1],b=-g,x=-m;if(t&&a&&s){b=0,x=0;var y=[];if(c&&l?y.push([0,m],[g,0]):c?y.push([g,0]):l?y.push([0,m]):p&&d?y.push([0,m],[g,0]):p?y.push([g,0]):d&&y.push([0,m]),y.length){y.sort((function(t,e){return qo(ye([a,s],t))-qo(ye([a,s],e))}));var E=y[0];if(E[0]&&Ta(a)>v)b=-E[0],x=s*Ta(a+b)/Ta(a)-s;else if(E[1]&&Ta(s)>v){var S=s;x=-E[1],b=a*Ta(s+x)/Ta(S)-a}if(t&&l&&c)if(Ta(b)>v&&Ta(b)v&&Ta(x)0,v=p>0,g={isBound:!1,offset:0,pos:0},m={isBound:!1,offset:0,pos:0};if(0===p&&0===d)return{vertical:g,horizontal:m};if(0===p)h?sl&&(m.pos=o,m.offset=l-o);else if(0===d)v?ac&&(g.pos=i,g.offset=c-i);else{var b=d/p,x=n[1]-b*c,y=0,E=0,S=!1;v&&a<=c?(y=b*a+x,E=a,S=!0):!v&&c<=i&&(y=b*i+x,E=i,S=!0),S&&(ys)&&(S=!1),S||(h&&s<=l?(E=((y=s)-x)/b,S=!0):!h&&l<=o&&(E=((y=o)-x)/b,S=!0)),S&&(g.isBound=!0,g.pos=E,g.offset=c-E,m.isBound=!0,m.pos=y,m.offset=l-y)}return{vertical:g,horizontal:m}}(t,e,n),o=i.horizontal,a=i.vertical,s=r?{horizontal:{isSnap:!1},vertical:{isSnap:!1}}:function(t,e,n){var r=Rn(n,2),i=r[0],o=r[1],a=Rn(e,2),s=a[0],u=a[1],c=Rn(ye(n,e),2),l=c[0],f=c[1],p=f>0,d=l>0;l=ba(l),f=ba(f);var h={isSnap:!1,offset:0,pos:0},v={isSnap:!1,offset:0,pos:0};if(0===l&&0===f)return{vertical:h,horizontal:v};var g=pi(t,l?[i]:[],f?[o]:[]),m=g.vertical,b=g.horizontal;m.posInfos.filter((function(t){var e=t.pos;return d?e>=s:e<=s})),b.posInfos.filter((function(t){var e=t.pos;return p?e>=u:e<=u})),m.isSnap=m.posInfos.length>0,b.isSnap=b.posInfos.length>0;var x=gi(m),y=x.isSnap,E=x.guideline,S=gi(b),D=S.isSnap,C=S.guideline,w=D?C.pos[1]:0,_=y?E.pos[0]:0;if(0===l)D&&(v.isSnap=!0,v.pos=C.pos[1],v.offset=o-v.pos);else if(0===f)y&&(h.isSnap=!0,h.pos=_,h.offset=i-_);else{var M=f/l,O=n[1]-M*i,R=0,P=0,T=!1;y?(R=M*(P=_)+O,T=!0):D&&(P=((R=w)-O)/M,T=!0),T&&(h.isSnap=!0,h.pos=P,h.offset=i-P,v.isSnap=!0,v.pos=R,v.offset=o-R)}return{vertical:h,horizontal:v}}(t,e,n),u=s.horizontal,c=s.vertical,l=Ii(o,u),f=Ii(a,c),p=Ta(l),d=Ta(f);return{horizontal:{isBound:o.isBound,isSnap:u.isSnap,offset:l,dist:p},vertical:{isBound:a.isBound,isSnap:c.isSnap,offset:f,dist:d}}}(t,c,l,i):ki(t,i,{vertical:[l[0]],horizontal:[l[1]]}),p=f.horizontal,d=p.offset,h=p.isBound,v=p.isSnap,g=f.vertical,m=g.offset,b=g.isBound,x=g.isSnap,y=ye(u,s);if(!m&&!d)return{isBound:b||h,isSnap:x||v,sign:y,offset:[0,0]};var E=function(t,e,n,r){var i=W(t,e)/Math.PI*180,o=n.vertical,a=o.isBound,s=o.isSnap,u=o.dist,c=n.horizontal,l=c.isBound,f=c.isSnap,p=i%180,d=p<3||p>177,h=p>87&&p<93;return c.dist0&&(f||p)){var _=m.startDragRotate||0,M=L(_+180*W([0,0],[f,p])/Math.PI,y)-_,O=p*Math.abs(Math.cos((M-90)/180*Math.PI)),R=qo([f*Math.abs(Math.cos(M/180*Math.PI)),O]);E=M*Math.PI/180,f=R*Math.cos(E),p=R*Math.sin(E)}if(!o&&!r&&!i){var P=Rn(Gi(t,f,p,y,!s&&u||a,n),2),T=P[0],z=P[1];S=T.isSnap,D=T.isBound,C=z.isSnap,w=z.isBound,f+=T.offset,p+=z.offset}var G=xe(gr({datas:n,distX:f,distY:p}),g),k=xe(hr({datas:n,distX:f,distY:p}),g);V(k,Qn),V(G,Qn),y||(S||D||(k[0]=L(k[0],x),G[0]=L(G[0],x)),C||w||(k[1]=L(k[1],x),G[1]=L(G[1],x)));var B=ye(G,g),A=ye(k,g),I=ye(A,h),F=ye(B,v);n.prevDist=A,n.prevBeforeDist=B,n.passDelta=I,n.passDist=A;var N=n.left+B[0],q=n.top+B[1],Y=n.right-B[0],X=n.bottom-B[1],j=dr(n,"translate(".concat(k[0],"px, ").concat(k[1],"px)"),"translate(".concat(A[0],"px, ").concat(A[1],"px)"));if(wr(e,j),t.state.dragInfo.dist=r?[0,0]:A,r||b||!I.every((function(t){return!t}))||!F.some((function(t){return!t}))){var H=t.state,U=H.width,$=H.height,Z=ia(t,e,On({transform:j,dist:A,delta:I,translate:k,beforeDist:B,beforeDelta:F,beforeTranslate:G,left:N,top:q,right:Y,bottom:X,width:U,height:$,isPinch:o},na({transform:j},e)));return!r&&sa(t,"onDrag",Z),Z}}}},dragAfter:function(t,e){var n=e.datas,r=n.deltaOffset;return!(!r[0]&&!r[1])&&(n.deltaOffset=[0,0],this.drag(t,On(On({},e),{deltaOffset:r})))},dragEnd:function(t,e){var n=e.parentEvent,r=e.datas;if(t.state.dragInfo=null,r.isDrag){r.isDrag=!1;var i=oa(t,e,{});return!n&&sa(t,"onDragEnd",i),i}},dragGroupStart:function(t,e){var n,r,i=e.datas,o=e.clientX,a=e.clientY,s=this.dragStart(t,e);if(!s)return!1;var u=Wr(t,this,"dragStart",[o||0,a||0],e,!1,"draggable"),c=u.childEvents,l=u.eventParams,f=sa(t,"onDragGroupStart",On(On({},s),{targets:t.props.targets,events:l}));i.isDrag=!1!==f;var p=null!==(r=null===(n=c[0])||void 0===n?void 0:n.datas.startValue)&&void 0!==r?r:[0,0];return i.throttleOffset=[p[0]%1,p[1]%1],!!i.isDrag&&s},dragGroup:function(t,e){if(e.datas.isDrag){var n=this.drag(t,On(On({},e),{parentThrottleDrag:t.props.throttleDrag})),r=Wr(t,this,"drag",e.datas.passDelta,e,!1,"draggable").eventParams;if(n){var i=On({targets:t.props.targets,events:r},n);return sa(t,"onDragGroup",i),i}}},dragGroupEnd:function(t,e){var n=e.isDrag;if(e.datas.isDrag){this.dragEnd(t,e);var r=Wr(t,this,"dragEnd",[0,0],e,!1,"draggable").eventParams;return sa(t,"onDragGroupEnd",oa(t,e,{targets:t.props.targets,events:r})),n}},request:function(t){var e={},n=t.getRect(),r=0,i=0,o=!1;return{isControl:!1,requestStart:function(t){return o=t.useSnap,{datas:e,useSnap:o}},request:function(t){return"x"in t?r=t.x-n.left:"deltaX"in t&&(r+=t.deltaX),"y"in t?i=t.y-n.top:"deltaY"in t&&(i+=t.deltaY),{datas:e,distX:r,distY:i,useSnap:o}},requestEnd:function(){return{datas:e,isDrag:!0,useSnap:o}}}},unset:function(t){t.state.gestos.draggable=null,t.state.dragInfo=null}};function Ni(t,e){return{fixedPosition:yr(t,e),fixedDirection:e,fixedOffset:[0,0]}}function qi(t,e){var n=t.allMatrix,r=t.is3d,i=t.width,o=t.height,a=r?4:3,s=function(t,e,n){return[e?t[0]/(e/2)-1:0,n?t[1]/(n/2)-1:0]}(e,i,o);return{fixedPosition:Ao(n,e,a),fixedDirection:s,fixedOffset:[i?0:e[0],o?0:e[1]]}}var Yi=ya("resizable"),Xi={name:"resizable",ableGroup:"size",canPinch:!0,props:["resizable","throttleResize","renderDirections","displayAroundControls","keepRatio","resizeFormat","keepRatioFinally","edge","checkResizableError"],events:["resizeStart","beforeResize","resize","resizeEnd","resizeGroupStart","beforeResizeGroup","resizeGroup","resizeGroupEnd"],render:Zr("resizable"),dragControlCondition:Yi,viewClassName:xa("resizable"),dragControlStart:function(t,e){var n,r=e.inputEvent,i=e.isPinch,o=e.isGroup,a=e.parentDirection,s=e.parentGesto,u=e.datas,c=e.parentFixedDirection,l=e.parentEvent,f=Zo(a,i,r,u),p=t.state,d=p.target,h=p.width,v=p.height,g=p.gestos;if(!f||!d)return!1;if(g.resizable)return!1;g.resizable=s||t.controlGesto,!i&&fr(t,e),u.datas={},u.direction=f,u.startOffsetWidth=h,u.startOffsetHeight=v,u.prevWidth=0,u.prevHeight=0,u.minSize=[0,0],u.startWidth=p.inlineCSSWidth||p.cssWidth,u.startHeight=p.inlineCSSHeight||p.cssHeight,u.maxSize=[1/0,1/0],o||(u.minSize=[p.minOffsetWidth,p.minOffsetHeight],u.maxSize=[p.maxOffsetWidth,p.maxOffsetHeight]);var m=t.props.transformOrigin||"% %";function b(t){u.ratio=t&&isFinite(t)?t:0}function x(t){var e=Ni(u.startPositions,t);u.fixedDirection=e.fixedDirection,u.fixedPosition=e.fixedPosition,u.fixedOffset=e.fixedOffset}function y(e){var n=qi(t.state,e);u.fixedDirection=n.fixedDirection,u.fixedPosition=n.fixedPosition,u.fixedOffset=n.fixedOffset}function D(t){u.minSize=[F("".concat(t[0]),0)||0,F("".concat(t[1]),0)||0]}function C(t){var e=[t[0]||1/0,t[1]||1/0];S(e[0])&&!isFinite(e[0])||(e[0]=F("".concat(e[0]),0)||1/0),S(e[1])&&!isFinite(e[1])||(e[1]=F("".concat(e[1]),0)||1/0),u.maxSize=e}u.transformOrigin=m&&E(m)?m.split(" "):m,u.startOffsetMatrix=p.offsetMatrix,u.startTransformOrigin=p.transformOrigin,u.isWidth=null!==(n=null==e?void 0:e.parentIsWidth)&&void 0!==n?n:!f[0]&&!f[1]||f[0]||!f[1],u.startPositions=Qo(t.state),b(h/v),x(c||[-f[0],-f[1]]),u.setFixedDirection=x,u.setFixedPosition=y,u.setMin=D,u.setMax=C;var w=ia(t,e,{direction:f,startRatio:u.ratio,set:function(t){var e=Rn(t,2),n=e[0],r=e[1];u.startWidth=n,u.startHeight=r},setMin:D,setMax:C,setRatio:b,setFixedDirection:x,setFixedPosition:y,setOrigin:function(t){u.transformOrigin=t},dragStart:Fi.dragStart(t,(new ur).dragStart([0,0],e))}),_=l||sa(t,"onResizeStart",w);return u.startFixedDirection=u.fixedDirection,u.startFixedPosition=u.fixedPosition,!1!==_&&(u.isResize=!0,t.state.snapRenderInfo={request:e.isRequest,direction:f}),!!u.isResize&&w},dragControl:function(t,e){var n,r=e.datas,i=e.parentFlag,o=e.isPinch,a=e.parentKeepRatio,s=e.dragClient,u=e.parentDist,c=e.useSnap,l=e.isRequest,f=e.isGroup,p=e.parentEvent,d=e.resolveMatrix,h=r.isResize,v=r.transformOrigin,g=r.startWidth,m=r.startHeight,b=r.prevWidth,x=r.prevHeight,y=r.minSize,E=r.maxSize,S=r.ratio,D=r.startOffsetWidth,C=r.startOffsetHeight,w=r.isWidth;if(h){if(d){var _=t.state.is3d,M=r.startOffsetMatrix,O=r.startTransformOrigin,R=_?4:3,P=Ae(Mr(e)),T=Math.sqrt(P.length);R!==T&&(P=ge(P,T,R));var z=Er(M,P,O,R),G=Io(z,D,C,R);r.startPositions=G,r.nextTargetMatrix=P,r.nextAllMatrix=z}var k=jo(t.props,"resizable"),B=k.resizeFormat,A=k.throttleResize,I=void 0===A?i?0:1:A,F=k.parentMoveable,N=k.keepRatioFinally,q=r.direction,X=q,W=0,j=0;q[0]||q[1]||(X=[1,1]);var H=S&&(null!=a?a:k.keepRatio)||!1,V=Rn(at(),2),U=V[0],$=V[1];p||(r.setFixedDirection(r.fixedDirection),sa(t,"onBeforeResize",ia(t,e,{startFixedDirection:r.startFixedDirection,startFixedPosition:r.startFixedPosition,setFixedDirection:function(t){var e;return r.setFixedDirection(t),e=Rn(at(),2),U=e[0],$=e[1],[U,$]},setFixedPosition:function(t){var e;return r.setFixedPosition(t),e=Rn(at(),2),U=e[0],$=e[1],[U,$]},boundingWidth:U,boundingHeight:$,setSize:function(t){var e;e=Rn(t,2),U=e[0],$=e[1]}},!0)));var Z=s;s||(Z=!i&&o?function(t,e){return yr(Qo(t.state),e)}(t,[0,0]):r.fixedPosition);var K=[0,0];if(o||(K=function(t,e,n,r,i,o,a){if(!ci(t,"resizable"))return[0,0];var s=a.fixedDirection,u=a.nextAllMatrix,c=t.state,l=c.allMatrix,f=c.is3d;return co(t,(function(t,r){return ao(u||l,e+t,n+r,s,i,f)}),e,n,r,i,o,a)}(t,U,$,q,Z,!c&&l,r)),u&&(!u[0]&&(K[0]=0),!u[1]&&(K[1]=0)),H){X[0]&&X[1]&&K[0]&&K[1]&&(Ta(K[0])>Ta(K[1])?K[1]=0:K[0]=0);var J=!K[0]&&!K[1];J&&st(),X[0]&&!X[1]||K[0]&&!K[1]||J&&w?(U+=K[0],$=U/S):(!X[0]&&X[1]||!K[0]&&K[1]||J&&!w)&&($+=K[1],U=$*S)}else U+=K[0],$+=K[1],U=Math.max(0,U),$=Math.max(0,$);n=Rn(Y([U,$],y,E,!!H&&S),2),U=n[0],$=n[1],st(),H&&(f||N)&&(w?$=U/S:U=$*S);var Q=[(W=U-D)-b,(j=$-C)-x];r.prevWidth=W,r.prevHeight=j;var tt=Gr(t,U,$,Z,v,r);if(F||!Q.every((function(t){return!t}))||!tt.every((function(t){return!t}))){var et=Fi.drag(t,sr(e,t.state,tt,!!o,!1,"draggable")),nt=et.transform,rt=g+W,it=m+j,ot=ia(t,e,On({width:rt,height:it,offsetWidth:Math.round(U),offsetHeight:Math.round($),startRatio:S,boundingWidth:U,boundingHeight:$,direction:q,dist:[W,j],delta:Q,isPinch:!!o,drag:et},ra({style:{width:"".concat(rt,"px"),height:"".concat(it,"px")},transform:nt},et,e)));return!p&&sa(t,"onResize",ot),ot}}function at(){var t=r.fixedDirection,n=wa(X,H,r,e);W=n.distWidth,j=n.distHeight;var i=X[0]-t[0]||H?Math.max(D+W,Qn):D,o=X[1]-t[1]||H?Math.max(C+j,Qn):C;return H&&D&&C&&(w?o=i/S:i=o*S),[i,o]}function st(){var t;B&&(t=Rn(B([U,$]),2),U=t[0],$=t[1]),U=L(U,I),$=L($,I)}},dragControlAfter:function(t,e){var n=e.datas,r=n.isResize,i=n.startOffsetWidth,o=n.startOffsetHeight,a=n.prevWidth,s=n.prevHeight;if(r&&!1!==t.props.checkResizableError){var u=t.state,c=u.width-(i+a),l=u.height-(o+s),f=Ta(c)>3,p=Ta(l)>3;return f&&(n.startWidth+=c,n.startOffsetWidth+=c,n.prevWidth+=c),p&&(n.startHeight+=l,n.startOffsetHeight+=l,n.prevHeight+=l),f||p?this.dragControl(t,e):void 0}},dragControlEnd:function(t,e){var n=e.datas,r=e.parentEvent;if(n.isResize){n.isResize=!1;var i=oa(t,e,{});return!r&&sa(t,"onResizeEnd",i),i}},dragGroupControlCondition:Yi,dragGroupControlStart:function(t,e){var n=e.datas,r=this.dragControlStart(t,On(On({},e),{isGroup:!0}));if(!r)return!1;var i=Xr(t,"resizable",e),o=n.startOffsetWidth,a=n.startOffsetHeight;function s(){var t=n.minSize;i.forEach((function(e){var n=e.datas,r=n.minSize,i=n.startOffsetWidth,s=n.startOffsetHeight,u=o*(i?r[0]/i:0),c=a*(s?r[1]/s:0);t[0]=Math.max(t[0],u),t[1]=Math.max(t[1],c)}))}function u(){var t=n.maxSize;i.forEach((function(e){var n=e.datas,r=n.maxSize,i=n.startOffsetWidth,s=n.startOffsetHeight,u=o*(i?r[0]/i:0),c=a*(s?r[1]/s:0);t[0]=Math.min(t[0],u),t[1]=Math.min(t[1],c)}))}var c=jr(t,this,"dragControlStart",e,(function(e,r){return Hr(t,e,n,r)}));s(),u();var l=function(e){r.setFixedDirection(e),c.forEach((function(r,o){r.setFixedDirection(e),Hr(t,r.moveable,n,i[o])}))};n.setFixedDirection=l;var f=On(On({},r),{targets:t.props.targets,events:c.map((function(t){return On(On({},t),{setMin:function(e){t.setMin(e),s()},setMax:function(e){t.setMax(e),u()}})})),setFixedDirection:l,setMin:function(t){r.setMin(t),s()},setMax:function(t){r.setMax(t),u()}}),p=sa(t,"onResizeGroupStart",f);return n.isResize=!1!==p,!!n.isResize&&r},dragGroupControl:function(t,e){var n=e.datas;if(n.isResize){var r=jo(t.props,"resizable");aa(t,"onBeforeResize",(function(n){sa(t,"onBeforeResizeGroup",ia(t,e,On(On({},n),{targets:r.targets}),!0))}));var i=this.dragControl(t,On(On({},e),{isGroup:!0}));if(i){var o=i.boundingWidth,a=i.boundingHeight,s=i.dist,u=r.keepRatio,c=[o/(o-s[0]),a/(a-s[1])],l=n.fixedPosition,f=jr(t,this,"dragControl",e,(function(e,n){var r=Rn(Se(Pe(t.rotation/180*Math.PI,3),[n.datas.originalX*c[0],n.datas.originalY*c[1],1],3),2),i=r[0],o=r[1];return On(On({},n),{parentDist:null,parentScale:c,dragClient:xe(l,[i,o]),parentKeepRatio:u})})),p=On({targets:r.targets,events:f},i);return sa(t,"onResizeGroup",p),p}}},dragGroupControlEnd:function(t,e){var n=e.isDrag;if(e.datas.isResize){this.dragControlEnd(t,e);var r=jr(t,this,"dragControlEnd",e);return sa(t,"onResizeGroupEnd",oa(t,e,{targets:t.props.targets,events:r})),n}},request:function(t){var e={},n=0,r=0,i=!1,o=t.getRect();return{isControl:!0,requestStart:function(t){var n;return i=t.useSnap,{datas:e,parentDirection:t.direction||[1,1],parentIsWidth:null===(n=null==t?void 0:t.horizontal)||void 0===n||n,useSnap:i}},request:function(t){return"offsetWidth"in t?n=t.offsetWidth-o.offsetWidth:"deltaWidth"in t&&(n+=t.deltaWidth),"offsetHeight"in t?r=t.offsetHeight-o.offsetHeight:"deltaHeight"in t&&(r+=t.deltaHeight),{datas:e,parentDist:[n,r],parentKeepRatio:t.keepRatio,useSnap:i}},requestEnd:function(){return{datas:e,isDrag:!0,useSnap:i}}}},unset:function(t){t.state.gestos.resizable=null}};function Wi(t,e,n,r,i){var o=t.props.groupable,a=t.state,s=a.is3d?4:3,u=e.origin,c=Ao(t.state.rootMatrix,ye([u[0],u[1]],o?[0,0]:[a.left,a.top]),s),l=xe([i.left,i.top],c);e.startAbsoluteOrigin=l,e.prevDeg=W(l,[n,r])/Math.PI*180,e.defaultDeg=e.prevDeg,e.prevSnapDeg=0,e.loop=0,e.startDist=H(l,[n,r])}function ji(t,e,n){var r=n.defaultDeg,i=n.prevDeg,o=i%360,a=Math.floor(i/360);o<0&&(o+=360),o>t&&o>270&&t<90?++a:o270&&--a;var s=e*(360*a+t-r);return n.prevDeg=r+s,s}function Hi(t,e,n,r){return ji(W(r.startAbsoluteOrigin,[t,e])/Math.PI*180,n,r)}function Li(t,e,n,r,i,o){var a=t.props.throttleRotate,s=void 0===a?0:a,u=n.prevSnapDeg,c=0,l=!1;if(o){var f=function(t,e,n,r){var i,o=t.props,a=null!==(i=o[bo])&&void 0!==i?i:5,s=o[xo];if(ci(t,"rotatable")){var u=e.pos1,c=e.pos2,l=e.pos3,f=e.pos4,p=e.origin,d=n*Math.PI/180,h=[u,c,l,f].map((function(t){return ye(t,p)})),v=h.map((function(t){return Me(t,d)})),g=Pn(Pn([],Rn(ri(t,h,v,p,n)),!1),Rn(Pi(t,h,v,p,n)),!1);g.sort((function(t,e){return Ta(t-n)-Ta(e-n)}));var m=g.length>0;if(m)return{isSnap:m,dist:m?g[0]:n}}if((null==s?void 0:s.length)&&a){var b=s.slice().sort((function(t,e){return po(t,r)-po(e,r)}))[0];if(po(b,r)<=a)return{isSnap:!0,dist:n+fo(r,b)-r}}return{isSnap:!1,dist:n}}(t,e,r,i+r);l=f.isSnap,c=i+f.dist}l||(c=L(i+r,s));var p=c-i;return n.prevSnapDeg=p,[p-u,p,c]}function Vi(t,e,n){var r=Rn(e,4),i=r[0],o=r[1],a=r[2],s=r[3];if("none"===t)return[];if(y(t))return t.map((function(t){return Vi(t,[i,o,a,s],n)[0]}));var u=Rn((t||"top").split("-"),2),c=u[0],l=u[1],f=[i,o];"left"===c?f=[a,i]:"right"===c?f=[o,s]:"bottom"===c&&(f=[s,a]);var p=[(f[0][0]+f[1][0])/2,(f[0][1]+f[1][1])/2],d=Lo(f,n);if(l){var h="top"===l||"left"===l,v="bottom"===c||"left"===c;p=f[h&&!v||!h&&v?0:1]}return[[p,d]]}function Ui(t,e){if(e.isRequest)return"rotatable"===e.requestAble;var n=e.inputEvent.target;if(Z(n,Eo("rotation-control"))||t.props.rotateAroundControls&&Z(n,Eo("around-control"))||Z(n,Eo("control"))&&Z(n,Eo("rotatable")))return!0;var r=t.props.rotationTarget;return!!r&&Sa(r,!0).some((function(t){return!!t&&(n===t||n.contains(t))}))}var $i={name:"rotatable",canPinch:!0,props:["rotatable","rotationPosition","throttleRotate","renderDirections","rotationTarget","rotateAroundControls","edge","resolveAblesWithRotatable","displayAroundControls"],events:["rotateStart","beforeRotate","rotate","rotateEnd","rotateGroupStart","beforeRotateGroup","rotateGroup","rotateGroupEnd"],css:[".rotation {\nposition: absolute;\nheight: 40px;\nwidth: 1px;\ntransform-origin: 50% 100%;\nheight: calc(40px * var(--zoom));\ntop: auto;\nleft: 0;\nbottom: 100%;\nwill-change: transform;\n}\n.rotation .rotation-line {\ndisplay: block;\nwidth: 100%;\nheight: 100%;\ntransform-origin: 50% 50%;\n}\n.rotation .rotation-control {\nborder-color: #4af;\nborder-color: var(--moveable-color);\nbackground:#fff;\ncursor: alias;\n}\n:global .view-rotation-dragging, .rotatable.direction.control {\ncursor: alias;\n}\n.rotatable.direction.control.move {\ncursor: move;\n}\n"],viewClassName:function(t){return t.isDragging("rotatable")?Eo("view-rotation-dragging"):""},render:function(t,e){var n=jo(t.props,"rotatable"),r=n.rotatable,i=n.rotationPosition,o=n.zoom,a=n.renderDirections,s=n.rotateAroundControls,u=n.resolveAblesWithRotatable,c=t.getState(),l=c.renderPoses,f=c.direction;if(!r)return null;var p=Vi(i,l,f),d=[];if(p.forEach((function(t,n){var r=Rn(t,2),i=r[0],a=r[1];d.push(e.createElement("div",{key:"rotation".concat(n),className:Eo("rotation"),style:{transform:"translate(-50%) translate(".concat(i[0],"px, ").concat(i[1],"px) rotate(").concat(a,"rad)")}},e.createElement("div",{className:Eo("line rotation-line"),style:{transform:"scaleX(".concat(o,")")}}),e.createElement("div",{className:Eo("control rotation-control"),style:{transform:"translate(0.5px) scale(".concat(o,")")}})))})),a){var h=I(u||{}),v={};h.forEach((function(t){u[t].forEach((function(e){v[e]=t}))}));var g=[];y(a)&&(g=a.map((function(t){var e=v[t];return{data:e?{resolve:e}:{},classNames:e?["move"]:[],dir:t}}))),d.push.apply(d,Pn([],Rn(Lr(t,"rotatable",g,e)),!1))}return s&&d.push.apply(d,Pn([],Rn(Jr(t,e)),!1)),d},dragControlCondition:Ui,dragControlStart:function(t,e){var n,r,i=e.datas,o=e.clientX,a=e.clientY,s=e.parentRotate,u=e.parentFlag,c=e.isPinch,l=e.isRequest,f=t.state,p=f.target,d=f.left,h=f.top,v=f.direction,g=f.beforeDirection,m=f.targetTransform,b=f.moveableClientRect,x=f.offsetMatrix,y=f.targetMatrix,E=f.allMatrix,S=f.width,D=f.height;if(!l&&!p)return!1;var C=t.getRect();i.rect=C,i.transform=m,i.left=d,i.top=h;var w=function(e){var n=qi(t.state,e);i.fixedDirection=n.fixedDirection,i.fixedOffset=n.fixedOffset,i.fixedPosition=n.fixedPosition,I&&I.setFixedPosition(e)},_=function(e){var n=function(t,e){var n=t.allMatrix,r=t.is3d,i=t.width,o=t.height,a=r?4:3;return{fixedPosition:Ao(n,[i/2*(1+e[0]),o/2*(1+e[1])],a),fixedDirection:e,fixedOffset:[0,0]}}(t.state,e);i.fixedDirection=n.fixedDirection,i.fixedOffset=n.fixedOffset,i.fixedPosition=n.fixedPosition,I&&I.setFixedDirection(e)},M=o,O=a;if(l||c||u){var R=s||0;i.beforeInfo={origin:C.beforeOrigin,prevDeg:R,defaultDeg:R,prevSnapDeg:0,startDist:0},i.afterInfo=On(On({},i.beforeInfo),{origin:C.origin}),i.absoluteInfo=On(On({},i.beforeInfo),{origin:C.origin,startValue:R})}else{var P=null===(r=e.inputEvent)||void 0===r?void 0:r.target;if(P){var T=P.getAttribute("data-direction")||"",z=rr[T];if(z){i.isControl=!0,i.isAroundControl=Z(P,Eo("around-control")),i.controlDirection=z;var G=P.getAttribute("data-resolve");G&&(i.resolveAble=G);var k=function(t,e,n){var r=16===t.length?4:3,i=e.map((function(e){return Ao(t,e,r)})),o=n.left,a=n.top;return i.map((function(t){return[t[0]+o,t[1]+a]}))}(f.rootMatrix,f.renderPoses,b);n=Rn(yr(k,z),2),M=n[0],O=n[1]}}i.beforeInfo={origin:C.beforeOrigin},i.afterInfo={origin:C.origin},i.absoluteInfo={origin:C.origin,startValue:C.rotation};var B=w;w=function(e){var n=f.is3d?4:3,r=Rn(xe(he(y,n),e),2),o=r[0],a=r[1],s=Se(x,ve([o,a],n)),u=Se(E,ve([e[0],e[1]],n));B(e);var c=f.posDelta;i.beforeInfo.origin=ye(s,c),i.afterInfo.origin=ye(u,c),i.absoluteInfo.origin=ye(u,c),Wi(t,i.beforeInfo,M,O,b),Wi(t,i.afterInfo,M,O,b),Wi(t,i.absoluteInfo,M,O,b)},_=function(t){var e=yr([[0,0],[S,0],[0,D],[S,D]],t);w(e)}}i.startClientX=M,i.startClientY=O,i.direction=v,i.beforeDirection=g,i.startValue=0,i.datas={},Dr(t,e,"rotate");var A=!1,I=!1;i.isControl&&i.resolveAble&&("resizable"===i.resolveAble&&(I=Xi.dragControlStart(t,On(On({},new ur("resizable").dragStart([0,0],e)),{parentPosition:i.controlPosition,parentFixedPosition:i.fixedPosition}))));I||(A=Fi.dragStart(t,(new ur).dragStart([0,0],e))),w(function(t){var e=t.props,n=e.groupable,r=e.svgOrigin,i=t.getState(),o=i.offsetWidth,a=i.offsetHeight,s=i.svg,u=i.transformOrigin;if(!n&&s&&r)return Ma(r,o,a);return u}(t));var F=ia(t,e,On(On({set:function(t){i.startValue=t*Math.PI/180},setFixedDirection:_,setFixedPosition:w},Sr(t,e)),{dragStart:A,resizeStart:I})),N=sa(t,"onRotateStart",F);return i.isRotate=!1!==N,f.snapRenderInfo={request:e.isRequest},!!i.isRotate&&F},dragControl:function(t,e){var n,r,i,o=e.datas,a=e.clientDistX,s=e.clientDistY,u=e.parentRotate,c=e.parentFlag,l=e.isPinch,f=e.groupDelta,p=e.resolveMatrix,d=o.beforeDirection,h=o.beforeInfo,v=o.afterInfo,g=o.absoluteInfo,m=o.isRotate,b=o.startValue,x=o.rect,y=o.startClientX,E=o.startClientY;if(m){pr(t,e,"rotate");var S,D,C,w,_,M,O,R,P,T=function(t){return cr(t.datas.beforeTransform,[50,50],100,100).direction}(e),z=d*T,G=t.props.parentMoveable,k=180/Math.PI*b,B=g.startValue,A=!1,I=y+a,F=E+s;if(!c&&"parentDist"in e){var N=e.parentDist;D=N,_=N,R=N}else l||c?(D=ji(u,d,h),_=ji(u,z,v),R=ji(u,z,g)):(D=Hi(I,F,d,h),_=Hi(I,F,z,v),R=Hi(I,F,z,g),A=!0);if(sa(t,"onBeforeRotate",ia(t,e,{beforeRotation:C=k+D,rotation:M=k+_,absoluteRotation:P=B+R,setRotation:function(t){D=_=t-k,R=_}},!0)),S=(n=Rn(Li(t,x,h,D,k,A),3))[0],D=n[1],C=n[2],w=(r=Rn(Li(t,x,v,_,k,A),3))[0],_=r[1],M=r[2],O=(i=Rn(Li(t,x,g,R,B,A),3))[0],R=i[1],P=i[2],O||w||S||G||p){var q=dr(o,"rotate(".concat(M,"deg)"),"rotate(".concat(_,"deg)"));p&&(o.fixedPosition=Tr(t,o.targetAllTransform,o.fixedDirection,o.fixedOffset,o));var Y=function(t,e,n){var r=n.fixedDirection,i=n.fixedPosition,o=n.fixedOffset;return zr(t,"rotate(".concat(e,"deg)"),r,i,o,n)}(t,_,o),X=ye(xe(f||[0,0],Y),o.prevInverseDist||[0,0]);o.prevInverseDist=Y,o.requestValue=null;var W=Pr(t,q,X,l,e),j=W,L=H([I,F],g.startAbsoluteOrigin)-g.startDist,V=void 0;if("resizable"===o.resolveAble){var U=Xi.dragControl(t,On(On({},sr(e,t.state,[e.deltaX,e.deltaY],!!l,!1,"resizable")),{resolveMatrix:!0,parentDistance:L}));U&&(V=U,j=ra(j,U,e))}var $=ia(t,e,On(On({delta:w,dist:_,rotate:M,rotation:M,beforeDist:D,beforeDelta:S,beforeRotate:C,beforeRotation:C,absoluteDist:R,absoluteDelta:O,absoluteRotate:P,absoluteRotation:P,isPinch:!!l,resize:V},W),j));return sa(t,"onRotate",$),$}}},dragControlEnd:function(t,e){var n=e.datas;if(n.isRotate){n.isRotate=!1;var r=oa(t,e,{});return sa(t,"onRotateEnd",r),r}},dragGroupControlCondition:Ui,dragGroupControlStart:function(t,e){var n=e.datas,r=t.state,i=r.left,o=r.top,a=r.beforeOrigin,s=this.dragControlStart(t,e);if(!s)return!1;s.set(n.beforeDirection*t.rotation);var u=jr(t,this,"dragControlStart",e,(function(t,e){var n=t.state,r=n.left,s=n.top,u=n.beforeOrigin,c=xe(ye([r,s],[i,o]),ye(u,a));return e.datas.startGroupClient=c,e.datas.groupClient=c,On(On({},e),{parentRotate:0})})),c=sa(t,"onRotateGroupStart",On(On({},s),{targets:t.props.targets,events:u}));return n.isRotate=!1!==c,!!n.isRotate&&s},dragGroupControl:function(t,e){var n=e.datas;if(n.isRotate){aa(t,"onBeforeRotate",(function(n){sa(t,"onBeforeRotateGroup",ia(t,e,On(On({},n),{targets:t.props.targets}),!0))}));var r=this.dragControl(t,e);if(r){var i=n.beforeDirection,o=r.beforeDist,a=o/180*Math.PI,s=jr(t,this,"dragControl",e,(function(t,e){var n=e.datas.startGroupClient,r=Rn(e.datas.groupClient,2),s=r[0],u=r[1],c=Rn(Me(n,a*i),2),l=c[0],f=c[1],p=[l-s,f-u];return e.datas.groupClient=[l,f],On(On({},e),{parentRotate:o,groupDelta:p})}));t.rotation=i*r.beforeRotation;var u=On({targets:t.props.targets,events:s,set:function(e){t.rotation=e},setGroupRotation:function(e){t.rotation=e}},r);return sa(t,"onRotateGroup",u),u}}},dragGroupControlEnd:function(t,e){var n=e.isDrag;if(e.datas.isRotate){this.dragControlEnd(t,e);var r=jr(t,this,"dragControlEnd",e);return sa(t,"onRotateGroupEnd",oa(t,e,{targets:t.props.targets,events:r})),n}},request:function(t){var e={},n=0,r=t.getRotation();return{isControl:!0,requestStart:function(){return{datas:e}},request:function(t){return"deltaRotate"in t?n+=t.deltaRotate:"rotate"in t&&(n=t.rotate-r),{datas:e,parentDist:n}},requestEnd:function(){return{datas:e,isDrag:!0}}}}};function Zi(t,e){return function(t,e){var n,r=t.direction,i=t.classNames,o=t.size,a=t.pos,s=t.zoom,u=t.key,c="horizontal"===r,l=c?"Y":"X";return e.createElement("div",{key:u,className:i.join(" "),style:(n={},n[c?"width":"height"]="".concat(o),n.transform="translate(".concat(a[0],", ").concat(a[1],") translate").concat(l,"(-50%) scale").concat(l,"(").concat(s,")"),n)})}(On(On({},t),{classNames:Pn([Eo("line","guideline",t.direction)],Rn(t.classNames),!1).filter((function(t){return t})),size:t.size||"".concat(t.sizeValue,"px"),pos:t.pos||t.posValue.map((function(t){return"".concat(L(t,.1),"px")}))}),e)}function Ki(t,e,n,r,i,o,a,s){var u=t.props.zoom;return n.map((function(t,n){var c=t.type,l=t.pos,f=[0,0];return f[a]=r,f[a?0:1]=-i+l,Zi({key:"".concat(e,"TargetGuideline").concat(n),classNames:[Eo("target","bold",c)],posValue:f,sizeValue:o,zoom:u,direction:e},s)}))}function Ji(t,e,n,r,i,o){var a=t.props,s=a.zoom,u=a.isDisplayInnerSnapDigit,c="horizontal"===e?si:ui,l=i[c.start],f=i[c.end];return n.filter((function(t){var e=t.hide,n=t.elementRect;if(e)return!1;if(u&&n){var r=n.rect;if(r[c.start]<=l&&f<=r[c.end])return!1}return!0})).map((function(t,n){var i=t.pos,a=t.size,u=t.element,c=t.className,l=[-r[0]+i[0],-r[1]+i[1]];return Zi({key:"".concat(e,"-default-guideline-").concat(n),classNames:u?[Eo("bold"),c]:[Eo("normal"),c],direction:e,posValue:l,sizeValue:a,zoom:s},o)}))}function Qi(t,e,n,r,i,o,a,s){var u,c=t.props,l=c.snapDigit,f=void 0===l?0:l,p=c.isDisplaySnapDigit,d=void 0===p||p,h=c.snapDistFormat,v=void 0===h?function(t,e){return t}:h,g=c.zoom,m="horizontal"===e?"X":"Y",b="vertical"===e?"height":"width",x=Math.abs(i),y=d?parseFloat(x.toFixed(f)):0;return s.createElement("div",{key:"".concat(e,"-").concat(n,"-guideline-").concat(r),className:Eo("guideline-group",e),style:(u={left:"".concat(o[0],"px"),top:"".concat(o[1],"px")},u[b]="".concat(x,"px"),u)},Zi({direction:e,classNames:[Eo(n),a],size:"100%",posValue:[0,0],sizeValue:x,zoom:g},s),s.createElement("div",{className:Eo("size-value","gap"),style:{transform:"translate".concat(m,"(-50%) scale(").concat(g,")")}},y>0?v(y,e):""))}function to(t,e,n,r,i){var o=t.props.isDisplayInnerSnapDigit,a=[];return["vertical","horizontal"].forEach((function(s){var u=e.filter((function(t){return t.type===s})),c="vertical"===s?1:0,l=c?0:1,f=function(t,e,n,r){var i="vertical"===t?0:1,o="vertical"===t?1:0,a=i?si:ui,s=n[a.start],u=n[a.end];return fa(e,(function(t){return t.pos[i]})).map((function(e){var n=[],c=[];return e.forEach((function(e){var l,f,p=e.element,d=e.elementRect.rect;if(d[a.end]0){var u=[0,0];u[c]=n[c]+b[p.start]-h-o,u[l]=m,a.push(Qi(t,s,"dashed",a.length,o,u,e.className,i))}b=r})),b=r,f.forEach((function(e){var r=e.elementRect.rect,o=r[p.start]-b[p.end];if(o>0){var u=[0,0];u[c]=n[c]+b[p.end]-h,u[l]=m,a.push(Qi(t,s,"dashed",a.length,o,u,e.className,i))}b=r})),g.forEach((function(e){var r=e.elementRect.rect,o=h-r[p.start],u=r[p.end]-v,f=[0,0],d=[0,0];f[c]=n[c]-o,f[l]=m,d[c]=n[c]+v-h,d[l]=m,a.push(Qi(t,s,"dashed",a.length,o,f,e.className,i)),a.push(Qi(t,s,"dashed",a.length,u,d,e.className,i))}))}))})),a}function eo(t){var e,n,r=t.state,i=r.containerClientRect,o=r.hasFixed,a=i.overflow,s=i.scrollHeight,u=i.scrollWidth,c=i.clientHeight,l=i.clientWidth,f=i.clientLeft,p=i.clientTop,d=t.props,h=d.snapGap,v=void 0===h||h,g=d.verticalGuidelines,b=d.horizontalGuidelines,y=d.snapThreshold,E=void 0===y?5:y,S=d.maxSnapElementGuidelineDistance,D=void 0===S?1/0:S,C=d.isDisplayGridGuidelines,w=Fo(Qo(t.state)),_=w.top,M=w.left,O=w.bottom,R=w.right,P={top:_,left:M,bottom:O,right:R,center:(M+R)/2,middle:(_+O)/2},T=function(t){var e=t.state,n=t.props.elementGuidelines,r=void 0===n?[]:n;if(!r.length)return e.elementRects=[],[];var i=(e.elementRects||[]).filter((function(t){return!t.refresh})),o=r.map((function(t){return x(t)&&"element"in t?On(On({},t),{element:Ea(t.element,!0)}):{element:Ea(t,!0)}})).filter((function(t){return t.element})),a=(l=i.map((function(t){return t.element})),f=o.map((function(t){return t.element})),ft(l,f,Ye)),s=a.maintained,u=a.added,c=[];var l,f;s.forEach((function(t){var e=Rn(t,2),n=e[0],r=e[1];c[r]=i[n]})),function(t,e){if(!e.length)return[];var n=t.props.groupable,r=t.state,i=r.containerClientRect,o=r.rootMatrix,a=r.is3d,s=r.offsetDelta,u=a?4:3,c=Rn(function(t,e,n){var r=Ao(t,[e.clientLeft,e.clientTop],n);return[e.left+r[0],e.top+r[1]]}(o,i,u),2),l=c[0],f=c[1],p=n?0:s[0],d=n?0:s[1];return e.map((function(t){var e=t.element.getBoundingClientRect(),n=e.left-l-p,r=e.top-f-d,i=r+e.height,a=n+e.width,s=Rn(ha(o,[n,r],u),2),c=s[0],h=s[1],v=Rn(ha(o,[a,i],u),2),g=v[0],m=v[1];return On(On({},t),{rect:{left:c,right:g,top:h,bottom:m,center:(c+g)/2,middle:(h+m)/2}})}))}(t,u.map((function(t){return o[t]}))).map((function(t,e){c[u[e]]=t})),e.elementRects=c;var p=li(t.props.elementSnapDirections),d=[];return c.forEach((function(t){var e=t.element,n=t.top,r=void 0===n?p.top:n,i=t.left,o=void 0===i?p.left:i,a=t.right,s=void 0===a?p.right:a,u=t.bottom,c=void 0===u?p.bottom:u,l=t.center,f=void 0===l?p.center:l,h=t.middle,v=void 0===h?p.middle:h,g=t.className,m=t.rect,b=fi({top:r,right:s,left:o,bottom:c,center:f,middle:v},m),x=b.horizontal,y=b.vertical,E=b.horizontalNames,S=b.verticalNames,D=m.top,C=m.left,w=m.right-C,_=m.bottom-D,M=[w,_];y.forEach((function(n,r){d.push({type:"vertical",element:e,pos:[L(n,.1),D],size:_,sizes:M,className:g,elementRect:t,elementDirection:ai[S[r]]||S[r],direction:""})})),x.forEach((function(n,r){d.push({type:"horizontal",element:e,pos:[C,L(n,.1)],size:w,sizes:M,className:g,elementRect:t,elementDirection:ai[E[r]]||E[r],direction:""})}))})),d}(t),z=Pn([],Rn(T),!1),G=(null!==(n=null===(e=r.snapThresholdInfo)||void 0===e?void 0:e.multiples)&&void 0!==n?n:[1,1]).map((function(t){return t*E}));v&&z.push.apply(z,Pn([],Rn(function(t,e,n){var r=t.props,i=r.maxSnapElementGuidelineDistance,o=void 0===i?1/0:i,a=r.maxSnapElementGapDistance,s=void 0===a?1/0:a,u=t.state.elementRects,c=[];return[["vertical",si,ui],["horizontal",ui,si]].forEach((function(t){var r=Rn(t,3),i=r[0],a=r[1],l=r[2],f=e[a.start],p=e[a.end],d=e[a.center],h=e[l.start],v=e[l.end],g={left:n[0],top:n[1]};function m(t){var e=t.rect,n=g[a.start];return e[a.end]v||e[l.end]0})).sort((function(t,e){return m(t)-m(e)})),x=[];b.forEach((function(t){b.forEach((function(e){if(t!==e){var n=t.rect,r=e.rect,i=n[l.start],o=n[l.end],a=r[l.start];i>r[l.end]||a>o||x.push([t,e])}}))})),x.forEach((function(t){var n=Rn(t,2),r=n[0],u=n[1],l=r.rect,h=u.rect,v=l[a.start],m=l[a.end],b=h[a.start],x=h[a.end],y=g[a.start],E=0,S=0,D=!1,C=!1,w=!1;if(m<=f&&p<=b){if(C=!0,Ta((S=m+(E=(b-m-(p-f))/2)+(p-f)/2)-d)>y)return}else if(my)return}else{if(!(my)return}E&&no(e,h,i,o)&&(E>s||c.push({type:i,pos:"vertical"===i?[S,0]:[0,S],element:u.element,size:0,className:u.className,isStart:D,isCenter:C,isEnd:w,gap:E,hide:!0,gapRects:[r,u],direction:"",elementDirection:""}))}))})),c}(t,P,G)),!1));var k=On({},r.snapOffset||{left:0,top:0,bottom:0,right:0});if(z.push.apply(z,Pn([],Rn(function(t,e,n,r,i,o,a){void 0===r&&(r=0);void 0===i&&(i=0);var s=t.props,u=t.state,c=s.snapGridWidth,l=void 0===c?0:c,f=s.snapGridHeight,p=void 0===f?0:f,d=[],h=o.left,v=o.top,g=[0,0];!function(t,e,n,r){var i,o,a=t.props,s=t.state,u=a.snapGridAll,c=a.snapGridWidth,l=void 0===c?0:c,f=a.snapGridHeight,p=void 0===f?0:f,d=s.snapRenderInfo,h=d&&((null===(i=d.direction)||void 0===i?void 0:i[0])||(null===(o=d.direction)||void 0===o?void 0:o[1])),v=t.moveables;if(u&&v&&h&&(l||p)){if(s.snapThresholdInfo)return;s.snapThresholdInfo={multiples:[1,1],offset:[0,0]};var g=t.getRect(),b=g.children,x=d.direction;if(b){var y=x.map((function(t,i){var o=0===i?{snapSize:l,posName:"left",sizeName:"width",clientOffset:r.left-e}:{snapSize:p,posName:"top",sizeName:"height",clientOffset:r.top-n},a=o.snapSize,s=o.posName,u=o.sizeName,c=o.clientOffset;if(!a)return{dir:t,multiple:1,snapSize:a,snapOffset:0};var f=g[u],d=g[s],h=U(b.map((function(t){return[t[s]-d,t[u],f-t[u]-t[s]+d]}))).filter((function(t){return t})).sort((function(t,e){return t-e})),v=h[0],x=h.map((function(t){return L(t/v,.1)*a})),y=1,E=L(f/v,.1);for(y=1;y<=10&&!x.every((function(t){return t*y%1==0}));++y);var S=(1-t)/2,D=m(d-c,d-c+f,S,1-S);return{multiple:E*y,dir:t,snapSize:a,snapOffset:Math.round(D/a)}})),E=y.map((function(t){return t.multiple||1}));s.snapThresholdInfo.multiples=E,s.snapThresholdInfo.offset=y.map((function(t){return t.snapOffset})),y.forEach((function(t,e){t.snapSize}))}}else s.snapThresholdInfo=null}(t,r,i,o);var b=u.snapThresholdInfo,x=l,y=p;b&&(l*=b.multiples[0]||1,p*=b.multiples[1]||1,g=b.offset);if(p){for(var E=function(t){d.push({type:"horizontal",pos:[h,L(g[1]*y+t-i+v,.1)],className:Eo("grid-guideline"),size:e,hide:!a,direction:"",grid:!0})},S=0;S<=2*n;S+=p)E(S);for(S=-p;S>=-n;S-=p)E(S)}if(l){for(E=function(t){d.push({type:"vertical",pos:[L(g[0]*x+t-r+h,.1),v],className:Eo("grid-guideline"),size:n,hide:!a,direction:"",grid:!0})},S=0;S<=2*e;S+=l)E(S);for(S=-l;S>=-e;S-=l)E(S)}return d}(t,a?u:l,a?s:c,f,p,k,C)),!1)),o){var B=i.left,A=i.top;k.left+=B,k.top+=A,k.right+=B,k.bottom+=A}return z.push.apply(z,Pn([],Rn(io(b||!1,g||!1,a?u:l,a?s:c,f,p,k)),!1)),z=z.filter((function(t){var e=t.element,n=t.elementRect,r=t.type;if(!e||!n)return!0;var i=n.rect;return no(P,i,r,D)})),z}function no(t,e,n,r){return"horizontal"===n?Ta(t.right-e.left)<=r||Ta(t.left-e.right)<=r||t.left<=e.right&&e.left<=t.right:"vertical"!==n||(Ta(t.bottom-e.top)<=r||Ta(t.top-e.bottom)<=r||t.top<=e.bottom&&e.top<=t.bottom)}function ro(t,e){return t?t.map((function(t){var n=x(t)?t:{pos:t},r=n.pos;return S(r)?n:On(On({},n),{pos:F(r,e)})})):[]}function io(t,e,n,r,i,o,a){void 0===i&&(i=0),void 0===o&&(o=0),void 0===a&&(a={left:0,top:0,right:0,bottom:0});var s=[],u=a.left,c=a.top,l=a.bottom,f=n+a.right-u,p=r+l-c;return ro(t,p).forEach((function(t){s.push({type:"horizontal",pos:[u,L(t.pos-o+c,.1)],size:f,className:t.className,direction:""})})),ro(e,f).forEach((function(t){s.push({type:"vertical",pos:[L(t.pos-i+u,.1),c],size:p,className:t.className,direction:""})})),s}function oo(t){var e=t.state,n=e.container,r=t.props.snapContainer||n;if(e.snapContainer===r&&e.guidelines&&e.guidelines.length)return!1;var i=e.containerClientRect,o={left:0,top:0,bottom:0,right:0};if(n!==r){var a=Ea(r,!0);if(a){var s=$o(a),u=Da(e,[s.left-i.left,s.top-i.top]),c=Da(e,[s.right-i.right,s.bottom-i.bottom]);o.left=L(u[0],1e-5),o.top=L(u[1],1e-5),o.right=L(c[0],1e-5),o.bottom=L(c[1],1e-5)}}return e.snapContainer=r,e.snapOffset=o,e.guidelines=eo(t),e.enableSnap=!0,!0}function ao(t,e,n,r,i,o){var a=Io(t,e,n,o?4:3);return Jo(a,ye(i,yr(a,r)))}function so(t){return t?t/Ta(t):0}function uo(t,e,n,r,i,o){var a=function(t,e,n){var r=[];if(n)1!==Ta(e[0])||1!==Ta(e[1])?r.push([e,[-1,-1]],[e,[-1,1]],[e,[1,-1]],[e,[1,1]]):r.push([e,[t[0],-t[1]]],[e,[-t[0],t[1]]]),r.push([e,t]);else if(t[0]&&t[1]||!t[0]&&!t[1]){var i=t[0]?t:[1,1];[1,-1].forEach((function(t){[1,-1].forEach((function(n){var o=[t*i[0],n*i[1]];e[0]===o[0]&&e[1]===o[1]||r.push([e,o])}))}))}else t[0]?(1===Ta(e[0])?[1]:[1,-1]).forEach((function(n){r.push([[e[0],-1],[n*t[0],-1]],[[e[0],0],[n*t[0],0]],[[e[0],1],[n*t[0],1]])})):t[1]&&(1===Ta(e[1])?[1]:[1,-1]).forEach((function(n){r.push([[-1,e[1]],[-1,n*t[1]]],[[0,e[1]],[0,n*t[1]]],[[1,e[1]],[1,n*t[1]]])}));return r}(n,o.fixedDirection,r),s=Oi(t,e,n,r),u=Pn(Pn([],Rn(Ai(t,e,a,r,i,o)),!1),Rn(_i(t,s,o)),!1),c=yi(u,0),l=yi(u,1);return{width:{isBound:c.isBound,offset:c.offset[0]},height:{isBound:l.isBound,offset:l.offset[1]}}}function co(t,e,n,r,i,o,a,s){for(var u=Qo(t.state),c=t.props.keepRatio,l=0,f=0,p=0;p<2;++p){var d=uo(t,e(l,f),i,c,a,s),h=d.width,v=d.height,g=h.isBound,m=v.isBound,b=h.offset,x=v.offset;if(1===p&&(g||(b=0),m||(x=0)),0===p&&a&&!g&&!m)return[0,0];if(c){var y=Ta(b)*(n?1/n:1),E=Ta(x)*(r?1/r:1);(g&&m?y=0||r.push({type:"bounds",pos:t})})),d.forEach((function(t){G(i,(function(e){var n=e.type,r=e.pos;return"bounds"===n&&r===t}))>=0||i.push({type:"bounds",pos:t})})),{boundMap:c,innerBoundMap:f}}var mo=ya("",["resizable","scalable"]),bo="snapRotationThreshold",xo="snapRotationDegrees",yo={name:"snappable",dragRelation:"strong",props:["snappable","snapContainer","snapDirections","elementSnapDirections","snapGap","snapGridWidth","snapGridHeight","isDisplaySnapDigit","isDisplayInnerSnapDigit","isDisplayGridGuidelines","snapDigit","snapThreshold","snapRenderThreshold","snapGridAll",bo,xo,"horizontalGuidelines","verticalGuidelines","elementGuidelines","bounds","innerBounds","snapDistFormat","maxSnapElementGuidelineDistance","maxSnapElementGapDistance"],events:["snap","bound"],css:[":host {\n--bounds-color: #d66;\n}\n.guideline {\npointer-events: none;\nz-index: 2;\n}\n.guideline.bounds {\nbackground: #d66;\nbackground: var(--bounds-color);\n}\n.guideline-group {\nposition: absolute;\ntop: 0;\nleft: 0;\n}\n.guideline-group .size-value {\nposition: absolute;\ncolor: #f55;\nfont-size: 12px;\nfont-size: calc(12px * var(--zoom));\nfont-weight: bold;\n}\n.guideline-group.horizontal .size-value {\ntransform-origin: 50% 100%;\ntransform: translateX(-50%);\nleft: 50%;\nbottom: 5px;\nbottom: calc(2px + 3px * var(--zoom));\n}\n.guideline-group.vertical .size-value {\ntransform-origin: 0% 50%;\ntop: 50%;\ntransform: translateY(-50%);\nleft: 5px;\nleft: calc(2px + 3px * var(--zoom));\n}\n.guideline.gap {\nbackground: #f55;\n}\n.size-value.gap {\ncolor: #f55;\n}\n"],render:function(t,e){var n=t.state,r=n.top,i=n.left,o=n.pos1,a=n.pos2,s=n.pos3,u=n.pos4,c=n.snapRenderInfo,l=t.props.snapRenderThreshold,f=void 0===l?1:l;if(!c||!c.render||!ci(t,""))return Ra(t,"boundMap",{left:!1,top:!1,right:!1,bottom:!1},(function(t){return JSON.stringify(t)})),Ra(t,"innerBoundMap",{left:!1,top:!1,right:!1,bottom:!1},(function(t){return JSON.stringify(t)})),[];n.guidelines=eo(t);var p=Math.min(o[0],a[0],s[0],u[0]),d=Math.min(o[1],a[1],s[1],u[1]),h=c.externalPoses||[],v=Qo(t.state),g=[],m=[],b=[],x=[],y=[],E=Fo(v),S=E.width,D=E.height,C=E.top,w=E.left,_=E.bottom,M=E.right,O={left:w,right:M,top:C,bottom:_,center:(w+M)/2,middle:(C+_)/2},R=h.length>0,P=R?Fo(h):{};if(!c.request){if(c.direction&&y.push(bi(t,v,c.direction,f)),c.snap){var T=Fo(v);c.center&&(T.middle=(T.top+T.bottom)/2,T.center=(T.left+T.right)/2),y.push(vi(t,T,f))}R&&(c.center&&(P.middle=(P.top+P.bottom)/2,P.center=(P.left+P.right)/2),y.push(vi(t,P,f))),y.forEach((function(t){var e=t.vertical.posInfos,n=t.horizontal.posInfos;g.push.apply(g,Pn([],Rn(e.filter((function(t){return t.guidelineInfos.some((function(t){return!t.guideline.hide}))})).map((function(t){return{type:"snap",pos:t.pos}}))),!1)),m.push.apply(m,Pn([],Rn(n.filter((function(t){return t.guidelineInfos.some((function(t){return!t.guideline.hide}))})).map((function(t){return{type:"snap",pos:t.pos}}))),!1)),b.push.apply(b,Pn([],Rn(vo(e)),!1)),x.push.apply(x,Pn([],Rn(vo(n)),!1))}))}var z=go(t,[w,M],[C,_],g,m),G=z.boundMap,k=z.innerBoundMap;R&&go(t,[P.left,P.right],[P.top,P.bottom],g,m,c.externalBounds);var B=Pn(Pn([],Rn(b),!1),Rn(x),!1),A=B.filter((function(t){return t.element&&!t.gapRects})),I=B.filter((function(t){return t.gapRects})).sort((function(t,e){return t.gap-e.gap}));sa(t,"onSnap",{guidelines:B.filter((function(t){return!t.element})),elements:A,gaps:I},!0);var F=Ra(t,"boundMap",G,(function(t){return JSON.stringify(t)}),{left:!1,top:!1,right:!1,bottom:!1}),N=Ra(t,"innerBoundMap",k,(function(t){return JSON.stringify(t)}),{left:!1,top:!1,right:!1,bottom:!1});return G!==F&&k!==N||sa(t,"onBound",{bounds:G,innerBounds:k},!0),Pn(Pn(Pn(Pn(Pn(Pn([],Rn(to(t,A,[p,d],O,e)),!1),Rn(function(t,e,n,r,i){var o=[];return["horizontal","vertical"].forEach((function(a){var s=e.filter((function(t){return t.type===a})).slice(0,1),u="vertical"===a?0:1,c=u?0:1,l=u?ui:si,f=u?si:ui,p=r[l.start],d=r[l.end],h=r[f.start],v=r[f.end];s.forEach((function(e){var r=e.gap,a=e.gapRects,s=Math.max.apply(Math,Pn([h],Rn(a.map((function(t){return t.rect[f.start]}))),!1)),g=Math.min.apply(Math,Pn([v],Rn(a.map((function(t){return t.rect[f.end]}))),!1)),m=(s+g)/2;s!==g&&m!==(h+v)/2&&a.forEach((function(e){var a=e.rect,s=e.className,f=[n[0],n[1]];if(a[l.end]9),"".concat(e?"matrix3d":"matrix","(").concat(Ee(t,!e).join(","),")")}function ko(t){var e=t.clientWidth,n=t.clientHeight;if(!t)return{x:0,y:0,width:0,height:0,clientWidth:e,clientHeight:n};var r=t.viewBox,i=r&&r.baseVal||{x:0,y:0,width:0,height:0};return{x:i.x,y:i.y,width:i.width||e,height:i.height||n,clientWidth:e,clientHeight:n}}function Bo(t,e){var n,r=ko(t),i=r.width,o=r.height,a=r.clientWidth,s=r.clientHeight,u=a/i,c=s/o,l=t.preserveAspectRatio.baseVal,f=l.align,p=l.meetOrSlice,d=[0,0],h=[u,c],v=[0,0];if(1!==f){var g=(f-2)%3,m=Math.floor((f-2)/3);d[0]=i*g/2,d[1]=o*m/2;var b=2===p?Math.max(c,u):Math.min(u,c);h[0]=b,h[1]=b,v[0]=(a-i)/2*g,v[1]=(s-o)/2*m}var x=ze(h,e);return n=Rn(v,2),x[e*(e-1)]=n[0],x[e*(e-1)+1]=n[1],Co(x,e,d)}function Ao(t,e,n){return Se(t,ve(e,n),n)}function Io(t,e,n,r){return[[0,0],[e,0],[0,n],[e,n]].map((function(e){return Ao(t,e,r)}))}function Fo(t){var e=t.map((function(t){return t[0]})),n=t.map((function(t){return t[1]})),r=Math.min.apply(Math,Pn([],Rn(e),!1)),i=Math.min.apply(Math,Pn([],Rn(n),!1)),o=Math.max.apply(Math,Pn([],Rn(e),!1)),a=Math.max.apply(Math,Pn([],Rn(n),!1));return{left:r,top:i,right:o,bottom:a,width:o-r,height:a-i}}function No(t,e,n,r){return Fo(Io(t,e,n,r))}function qo(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Yo(t,e){return qo([e[0]-t[0],e[1]-t[1]])}function Xo(t,e,n,r){void 0===n&&(n=1),void 0===r&&(r=W(t,e));var i=Yo(t,e);return{transform:"translateY(-50%) translate(".concat(t[0],"px, ").concat(t[1],"px) rotate(").concat(r,"rad) scaleY(").concat(n,")"),width:"".concat(i,"px")}}function Wo(t,e){for(var n=[],r=2;r0?t[0]:t[1],e>0?t[1]:t[0])}function Vo(t,e){var n=t===rt(t)||t===nt(t),r={clientLeft:t.clientLeft,clientTop:t.clientTop,clientWidth:t.clientWidth,clientHeight:t.clientHeight,scrollWidth:t.scrollWidth,scrollHeight:t.scrollHeight,overflow:!1};return n&&(r.clientHeight=Math.max(e.height,r.clientHeight),r.scrollHeight=Math.max(e.height,r.scrollHeight)),r.overflow="visible"!==Yr(t)("overflow"),On(On({},e),r)}function Uo(t,e,n,r){var i=t.left,o=t.right,a=t.top,s=t.bottom,u=e.top,c=e.left,l={left:c+i,top:u+a,right:c+o,bottom:u+s,width:o-i,height:s-a};return n&&r?Vo(n,l):l}function $o(t,e){var n=0,r=0,i=0,o=0;if(t){var a=t.getBoundingClientRect();n=a.left,r=a.top,i=a.width,o=a.height}var s={left:n,top:r,width:i,height:o,right:n+i,bottom:r+o};return t&&e?Vo(t,s):s}function Zo(t,e,n,r){var i;if(t)i=t;else if(e)i=[0,0];else{i=Ko(n.target,r)}return i}function Ko(t,e){if(t){var n=t.getAttribute("data-rotation")||"",r=t.getAttribute("data-direction");if(e.deg=n,r){var i=[0,0];return r.indexOf("w")>-1&&(i[0]=-1),r.indexOf("e")>-1&&(i[0]=1),r.indexOf("n")>-1&&(i[1]=-1),r.indexOf("s")>-1&&(i[1]=1),i}}}function Jo(t,e){return[xe(e,t[0]),xe(e,t[1]),xe(e,t[2]),xe(e,t[3])]}function Qo(t){var e=t.left,n=t.top;return Jo([t.pos1,t.pos2,t.pos3,t.pos4],[e,n])}function ta(t,e){t[e?"controlAbles":"targetAbles"].forEach((function(e){e.unset&&e.unset(t)}))}function ea(t,e){var n=e?"controlGesto":"targetGesto",r=t[n];!1===(null==r?void 0:r.isIdle())&&ta(t,e),null==r||r.unset(),t[n]=null}function na(t,e){if(e){var n=_r(e);n.nextStyle=On(On({},n.nextStyle),t)}return{style:t,cssText:I(t).map((function(e){return"".concat(T(e,"-"),": ").concat(t[e],";")})).join("")}}function ra(t,e,n){var r=e.afterTransform||e.transform;return On(On({},na(On(On(On({},t.style),e.style),{transform:r}),n)),{afterTransform:r,transform:t.transform})}function ia(t,e,n,r){var i=e.datas;i.datas||(i.datas={});var o=On(On({},n),{target:t.state.target,clientX:e.clientX,clientY:e.clientY,inputEvent:e.inputEvent,currentTarget:t,moveable:t,datas:i.datas,isRequest:e.isRequest,isRequestChild:e.isRequestChild,isFirstDrag:!!e.isFirstDrag,isTrusted:!1!==e.isTrusted,stopAble:function(){i.isEventStart=!1},stopDrag:function(){var t;null===(t=e.stop)||void 0===t||t.call(e)}});return i.isStartEvent?r||(i.lastEvent=o):i.isStartEvent=!0,o}function oa(t,e,n){var r=e.datas,i="isDrag"in n?n.isDrag:e.isDrag;return r.datas||(r.datas={}),On(On({isDrag:i},n),{moveable:t,target:t.state.target,clientX:e.clientX,clientY:e.clientY,inputEvent:e.inputEvent,currentTarget:t,lastEvent:r.lastEvent,isDouble:e.isDouble,datas:r.datas,isFirstDrag:!!e.isFirstDrag})}function aa(t,e,n){t._emitter.on(e,n)}function sa(t,e,n,r,i){return t.triggerEvent(e,n,r,i)}function ua(t,e){return it(t).getComputedStyle(t,e)}function ca(t,e,n){var r={},i={};return t.filter((function(t){var o=t.name;if(r[o]||!e.some((function(e){return t[e]})))return!1;if(!n&&t.ableGroup){if(i[t.ableGroup])return!1;i[t.ableGroup]=!0}return r[o]=!0,!0}))}function la(t,e){return t===e||null==t&&null==e}function fa(t,e){var n=[],r=[];return t.forEach((function(i,o){var a=e(i,o,t),s=r.indexOf(a),u=n[s]||[];-1===s&&(r.push(a),n.push(u)),u.push(i)})),n}function pa(t){return t.reduce((function(t,e){return t.concat(e)}),[])}function da(){for(var t=[],e=0;eMath.PI/2*3?g-m:g-(m+=Math.PI))>2*Math.PI?b-=2*Math.PI:b>Math.PI?b=2*Math.PI-b:b<-Math.PI&&(b=-2*Math.PI-b);var x=qo([h+e[0],v+e[1]])*Math.cos(b);u=x*Math.sin(m)-h,c=x*Math.cos(m)-v,r[0]<0&&(u*=-1),r[1]<0&&(c*=-1)}else c=(u=d)/n;else u=(c=d)*n}else u=r[0]*e[0],c=r[1]*e[1];return[u,c]}function wa(t,e,n,r){var i,o=n.ratio,a=n.startOffsetWidth,s=n.startOffsetHeight,u=0,c=0,l=r.distX,f=r.distY,p=r.pinchScale,d=r.parentDistance,h=r.parentDist,v=r.parentScale,g=n.fixedDirection,m=[0,1].map((function(e){return Ta(t[e]-g[e])})),b=[0,1].map((function(t){var e=m[t];return 0!==e&&(e=2/e),e}));if(h)u=h[0],c=h[1],e&&(u?c||(c=u/o):u=c*o);else if(S(p))u=(p-1)*a,c=(p-1)*s;else if(v)u=(v[0]-1)*a,c=(v[1]-1)*s;else if(d){var x=a*m[0],y=s*m[1],E=qo([x,y]);u=d/E*x*b[0],c=d/E*y*b[1]}else{var D=mr({datas:n,distX:l,distY:f});D=b.map((function(t,e){return D[e]*t})),u=(i=Rn(Ca([a,s],D,o,t,e),2))[0],c=i[1]}return{distWidth:u,distHeight:c}}function _a(t,e){if(e){if("left"===t)return{x:"0%",y:"50%"};if("top"===t)return{x:"50%",y:"50%"};if("center"===t)return{x:"50%",y:"50%"};if("right"===t)return{x:"100%",y:"50%"};if("bottom"===t)return{x:"50%",y:"100%"};var n=Rn(t.split(" "),2),r=n[0],i=n[1],o=_a(r||""),a=_a(i||""),s=On(On({},o),a),u={x:"50%",y:"50%"};return s.x&&(u.x=s.x),s.y&&(u.y=s.y),s.value&&(s.x&&!s.y&&(u.y=s.value),!s.x&&s.y&&(u.x=s.value)),u}return"left"===t?{x:"0%"}:"right"===t?{x:"100%"}:"top"===t?{y:"0%"}:"bottom"===t?{y:"100%"}:t?"center"===t?{value:"50%"}:{value:t}:{}}function Ma(t,e,n){var r=_a(t,!0),i=r.x,o=r.y;return[F(i,e)||0,F(o,n)||0]}function Oa(t,e){return t.length===e.length&&t.every((function(t,n){var r=e[n],i=y(t),o=y(r);return i&&o?Oa(t,r):!i&&!o&&t===r}))}function Ra(t,e,n,r,i){var o=t._store,a=o[e];if(!(e in o)){if(null==i)return o[e]=n,n;o[e]=i,a=i}return a===n||r(a)===r(n)?a:(o[e]=n,n)}function Pa(t){return t>=0?1:-1}function Ta(t){return Math.abs(t)}function za(t,e){return function(t){for(var e=[],n=0;n-1}))).filter((function(t){return t.canPinch&&t[l]})),p=ia(t,e,{});r&&(p.targets=r);var d=sa(t,c,p);n.isPinch=!1!==d,n.ables=f;var h=n.isPinch;return!!h&&(f.forEach((function(n){if(o[n.name]=o[n.name]||{},n[l]){var r=On(On({},e),{datas:o[n.name],parentRotate:i,isPinch:!0});n[l](t,r)}})),t.state.snapRenderInfo={request:e.isRequest,direction:[0,0]},h)},pinch:function(t,e){var n=e.datas,r=e.scale,i=e.distance,o=e.originalDatas,a=e.inputEvent,s=e.targets,u=e.angle;if(n.isPinch){var c=i*(1-1/r),l=ia(t,e,{});s&&(l.targets=s);var f="onPinch".concat(s?"Group":"");sa(t,f,l);var p=n.ables,d="drag".concat(s?"Group":"","Control");return p.forEach((function(n){n[d]&&n[d](t,On(On({},e),{datas:o[n.name],inputEvent:a,resolveMatrix:!0,pinchScale:r,parentDistance:c,parentRotate:u,isPinch:!0}))})),l}},pinchEnd:function(t,e){var n=e.datas,r=e.isPinch,i=e.inputEvent,o=e.targets,a=e.originalDatas;if(n.isPinch){var s="onPinch".concat(o?"Group":"","End"),u=oa(t,e,{isDrag:r});o&&(u.targets=o),sa(t,s,u);var c=n.ables,l="drag".concat(o?"Group":"","ControlEnd");return c.forEach((function(n){n[l]&&n[l](t,On(On({},e),{isDrag:r,datas:a[n.name],inputEvent:i,isPinch:!0}))})),r}},pinchGroupStart:function(t,e){return this.pinchStart(t,On(On({},e),{targets:t.props.targets}))},pinchGroup:function(t,e){return this.pinch(t,On(On({},e),{targets:t.props.targets}))},pinchGroupEnd:function(t,e){return this.pinchEnd(t,On(On({},e),{targets:t.props.targets}))}}),Ba=ya("scalable"),Aa={name:"scalable",ableGroup:"size",canPinch:!0,props:["scalable","throttleScale","renderDirections","keepRatio","edge","displayAroundControls"],events:["scaleStart","beforeScale","scale","scaleEnd","scaleGroupStart","beforeScaleGroup","scaleGroup","scaleGroupEnd"],render:Zr("scalable"),dragControlCondition:Ba,viewClassName:xa("scalable"),dragControlStart:function(t,e){var n=e.datas,r=e.isPinch,i=e.inputEvent,o=Zo(e.parentDirection,r,i,n),a=t.state,s=a.width,u=a.height,c=a.targetTransform,l=a.target,f=a.pos1,p=a.pos2,d=a.pos4;if(!o||!l)return!1;r||fr(t,e),n.datas={},n.transform=c,n.prevDist=[1,1],n.direction=o,n.startOffsetWidth=s,n.startOffsetHeight=u,n.startValue=[1,1];var h=!o[0]&&!o[1]||o[0]||!o[1];function v(t){n.ratio=t&&isFinite(t)?t:0}function g(t){var e=Ni(n.startPositions,t);n.fixedDirection=e.fixedDirection,n.fixedPosition=e.fixedPosition,n.fixedOffset=e.fixedOffset}Dr(t,e,"scale"),n.isWidth=h,n.startPositions=Qo(t.state),n.setFixedDirection=g,v(H(f,p)/H(p,d)),g([-o[0],-o[1]]);var m=function(t){n.minScaleSize=t},b=function(t){n.maxScaleSize=t};m([-1/0,-1/0]),b([1/0,1/0]);var x=ia(t,e,On(On({direction:o,set:function(t){n.startValue=t},setRatio:v,setFixedDirection:g,setMinScaleSize:m,setMaxScaleSize:b},Sr(t,e)),{dragStart:Fi.dragStart(t,(new ur).dragStart([0,0],e))})),y=sa(t,"onScaleStart",x);return n.startFixedDirection=n.fixedDirection,!1!==y&&(n.isScale=!0,t.state.snapRenderInfo={request:e.isRequest,direction:o}),!!n.isScale&&x},dragControl:function(t,e){pr(t,e,"scale");var n=e.datas,r=e.parentKeepRatio,i=e.parentFlag,o=e.isPinch,a=e.dragClient,s=e.isRequest,u=e.useSnap,c=e.resolveMatrix,l=n.prevDist,f=n.direction,p=n.startOffsetWidth,d=n.startOffsetHeight,h=n.isScale,v=n.startValue,g=n.isWidth,m=n.ratio;if(!h)return!1;var b=t.props,x=b.throttleScale,E=b.parentMoveable,S=f;f[0]||f[1]||(S=[1,1]);var D=m&&(null!=r?r:b.keepRatio)||!1,C=t.state,w=[v[0],v[1]];function _(){var t=wa(S,D,n,e),r=t.distWidth,i=t.distHeight,o=p?(p+r)/p:1,a=d?(d+i)/d:1;v[0]||(w[0]=r/p),v[1]||(w[1]=i/d);var s=(S[0]||D?o:1)*w[0],u=(S[1]||D?a:1)*w[1];return 0===s&&(s=Pa(l[0])*tr),0===u&&(u=Pa(l[1])*tr),[s,u]}var M=_();if(!o&&t.props.groupable){var O=(C.snapRenderInfo||{}).direction;y(O)&&(O[0]||O[1])&&(C.snapRenderInfo={direction:f,request:e.isRequest})}sa(t,"onBeforeScale",ia(t,e,{scale:M,setFixedDirection:function(t){return n.setFixedDirection(t),M=_()},startFixedDirection:n.startFixedDirection,setScale:function(t){M=t}},!0));var R,P,T=[M[0]/w[0],M[1]/w[1]],z=a,G=[0,0],k=Pa(T[0]*T[1]),B=!a&&!i&&o;if(B||c?z=Tr(t,n.targetAllTransform,[0,0],[0,0],n):a||(z=n.fixedPosition),o||(G=ho(t,T,f,!u&&s,n)),D){S[0]&&S[1]&&G[0]&&G[1]&&(Math.abs(G[0]*p)>Math.abs(G[1]*d)?G[1]=0:G[0]=0);var A=!G[0]&&!G[1];if(A&&(g?T[0]=L(T[0]*w[0],x)/w[0]:T[1]=L(T[1]*w[1],x)/w[1]),S[0]&&!S[1]||G[0]&&!G[1]||A&&g){T[0]+=G[0];var I=p*T[0]*w[0]/m;T[1]=Pa(k*T[0])*Ta(I/d/w[1])}else if(!S[0]&&S[1]||!G[0]&&G[1]||A&&!g){T[1]+=G[1];var F=d*T[1]*w[1]*m;T[0]=Pa(k*T[1])*Ta(F/p/w[0])}}else T[0]+=G[0],T[1]+=G[1],G[0]||(T[0]=L(T[0]*w[0],x)/w[0]),G[1]||(T[1]=L(T[1]*w[1],x)/w[1]);0===T[0]&&(T[0]=Pa(l[0])*tr),0===T[1]&&(T[1]=Pa(l[1])*tr),R=T,P=[w[0],w[1]],M=[R[0]*P[0],R[1]*P[1]];var N=[p,d],q=[p*M[0],d*M[1]];q=Y(q,n.minScaleSize,n.maxScaleSize,!!D&&m),M=za(2,(function(t){return N[t]?q[t]/N[t]:q[t]})),T=za(2,(function(t){return M[t]/w[t]}));var X=za(2,(function(t){return l[t]?T[t]/l[t]:T[t]})),W="scale(".concat(T.join(", "),")"),j="scale(".concat(M.join(", "),")"),H=dr(n,j,W),V=!v[0]||!v[1],U=function(t,e,n,r,i,o,a){return zr(t,e,n,r,i,o,a)}(t,V?j:W,n.fixedDirection,z,n.fixedOffset,n,V),$=B?U:ye(U,n.prevInverseDist||[0,0]);if(n.prevDist=T,n.prevInverseDist=U,M[0]===l[0]&&M[1]===l[1]&&$.every((function(t){return!t}))&&!E&&!B)return!1;var Z=ia(t,e,On({offsetWidth:p,offsetHeight:d,direction:f,scale:M,dist:T,delta:X,isPinch:!!o},Pr(t,H,$,o,e)));return sa(t,"onScale",Z),Z},dragControlEnd:function(t,e){var n=e.datas;if(!n.isScale)return!1;n.isScale=!1;var r=oa(t,e,{});return sa(t,"onScaleEnd",r),r},dragGroupControlCondition:Ba,dragGroupControlStart:function(t,e){var n=e.datas,r=this.dragControlStart(t,e);if(!r)return!1;var i=Xr(t,"resizable",e);n.moveableScale=t.scale;var o=jr(t,this,"dragControlStart",e,(function(e,r){return Hr(t,e,n,r)})),a=function(e){r.setFixedDirection(e),o.forEach((function(r,o){r.setFixedDirection(e),Hr(t,r.moveable,n,i[o])}))};n.setFixedDirection=a;var s=On(On({},r),{targets:t.props.targets,events:o,setFixedDirection:a}),u=sa(t,"onScaleGroupStart",s);return n.isScale=!1!==u,!!n.isScale&&s},dragGroupControl:function(t,e){var n=e.datas;if(n.isScale){aa(t,"onBeforeScale",(function(n){sa(t,"onBeforeScaleGroup",ia(t,e,On(On({},n),{targets:t.props.targets}),!0))}));var r=this.dragControl(t,e);if(r){var i=r.dist,o=n.moveableScale;t.scale=[i[0]*o[0],i[1]*o[1]];var a=t.props.keepRatio,s=n.fixedPosition,u=jr(t,this,"dragControl",e,(function(e,n){var r=Rn(Se(Pe(t.rotation/180*Math.PI,3),[n.datas.originalX*i[0],n.datas.originalY*i[1],1],3),2),o=r[0],u=r[1];return On(On({},n),{parentDist:null,parentScale:i,parentKeepRatio:a,dragClient:xe(s,[o,u])})})),c=On({targets:t.props.targets,events:u},r);return sa(t,"onScaleGroup",c),c}}},dragGroupControlEnd:function(t,e){var n=e.isDrag;if(e.datas.isScale){this.dragControlEnd(t,e);var r=jr(t,this,"dragControlEnd",e);return sa(t,"onScaleGroupEnd",oa(t,e,{targets:t.props.targets,events:r})),n}},request:function(){var t={},e=0,n=0,r=!1;return{isControl:!0,requestStart:function(e){return r=e.useSnap,{datas:t,parentDirection:e.direction||[1,1],useSnap:r}},request:function(i){return e+=i.deltaWidth,n+=i.deltaHeight,{datas:t,parentDist:[e,n],parentKeepRatio:i.keepRatio,useSnap:r}},requestEnd:function(){return{datas:t,isDrag:!0,useSnap:r}}}}};function Ia(t,e){return t.map((function(t,n){return m(t,e[n],1,2)}))}function Fa(t,e,n){var r=W(t,e),i=W(t,n)-r;return i>=0?i:i+2*Math.PI}var Na={name:"warpable",ableGroup:"size",props:["warpable","renderDirections","edge","displayAroundControls"],events:["warpStart","warp","warpEnd"],viewClassName:xa("warpable"),render:function(t,e){var n=t.props,r=n.resizable,i=n.scalable,o=n.warpable,a=n.zoom;if(r||i||!o)return[];var s=t.state,u=s.pos1,c=s.pos2,l=s.pos3,f=s.pos4,p=Ia(u,c),d=Ia(c,u),h=Ia(u,l),v=Ia(l,u),g=Ia(l,f),m=Ia(f,l),b=Ia(c,f),x=Ia(f,c);return Pn([e.createElement("div",{className:Eo("line"),key:"middeLine1",style:Xo(p,g,a)}),e.createElement("div",{className:Eo("line"),key:"middeLine2",style:Xo(d,m,a)}),e.createElement("div",{className:Eo("line"),key:"middeLine3",style:Xo(h,b,a)}),e.createElement("div",{className:Eo("line"),key:"middeLine4",style:Xo(v,x,a)})],Rn(Kr(t,"warpable",e)),!1)},dragControlCondition:function(t,e){if(e.isRequest)return!1;var n=e.inputEvent.target;return Z(n,Eo("direction"))&&Z(n,Eo("warpable"))},dragControlStart:function(t,e){var n=e.datas,r=e.inputEvent,i=t.props.target,o=Ko(r.target,n);if(!o||!i)return!1;var a=t.state,s=a.transformOrigin,u=a.is3d,c=a.targetTransform,l=a.targetMatrix,f=a.width,p=a.height,d=a.left,h=a.top;return n.datas={},n.targetTransform=c,n.warpTargetMatrix=u?l:ge(l,3,4),n.targetInverseMatrix=pe(de(n.warpTargetMatrix,4),3,4),n.direction=o,n.left=d,n.top=h,n.poses=[[0,0],[f,0],[0,p],[f,p]].map((function(t){return ye(t,s)})),n.nextPoses=n.poses.map((function(t){var e=Rn(t,2),r=e[0],i=e[1];return Se(n.warpTargetMatrix,[r,i,0,1],4)})),n.startValue=Te(4),n.prevMatrix=Te(4),n.absolutePoses=Qo(a),n.posIndexes=br(o),fr(t,e),Dr(t,e,"matrix3d"),a.snapRenderInfo={request:e.isRequest,direction:o},!1!==sa(t,"onWarpStart",ia(t,e,On({set:function(t){n.startValue=t}},Sr(t,e))))&&(n.isWarp=!0),n.isWarp},dragControl:function(t,e){var n=e.datas,r=e.isRequest,i=e.distX,o=e.distY,a=n.targetInverseMatrix,s=n.prevMatrix,u=n.isWarp,c=n.startValue,l=n.poses,f=n.posIndexes,p=n.absolutePoses;if(!u)return!1;if(pr(t,e,"matrix3d"),ci(t,"warpable")){var d=f.map((function(t){return p[t]}));d.length>1&&d.push([(d[0][0]+d[1][0])/2,(d[0][1]+d[1][1])/2]);var h=ki(t,r,{horizontal:d.map((function(t){return t[1]+o})),vertical:d.map((function(t){return t[0]+i}))}),v=h.horizontal,g=h.vertical;o-=v.offset,i-=g.offset}var m=mr({datas:n,distX:i,distY:o},!0),b=n.nextPoses.slice();if(f.forEach((function(t){b[t]=xe(b[t],m)})),!Kn.every((function(t){return e=t.map((function(t){return l[t]})),n=t.map((function(t){return b[t]})),r=Fa(e[0],e[1],e[2]),i=Fa(n[0],n[1],n[2]),o=Math.PI,!(r>=o&&i<=o||r<=o&&i>=o);var e,n,r,i,o})))return!1;var x=ke(l[0],l[2],l[1],l[3],b[0],b[2],b[1],b[3]);if(!x.length)return!1;var y=vr(n,be(a,x,4),!0),E=be(de(s,4),y,4);n.prevMatrix=y;var S=be(c,y,4),D=dr(n,"matrix3d(".concat(S.join(", "),")"),"matrix3d(".concat(y.join(", "),")"));return wr(e,D),sa(t,"onWarp",ia(t,e,On({delta:E,matrix:S,dist:y,multiply:be,transform:D},na({transform:D},e)))),!0},dragControlEnd:function(t,e){var n=e.datas,r=e.isDrag;return!!n.isWarp&&(n.isWarp=!1,sa(t,"onWarpEnd",oa(t,e,{})),r)}},qa=Eo("area-pieces"),Ya=Eo("area-piece"),Xa=Eo("avoid"),Wa=Eo("view-dragging");function ja(t){var e=t.areaElement;if(e){var n=t.state,r=n.width,i=n.height;J(e,Xa),e.style.cssText+="left: 0px; top: 0px; width: ".concat(r,"px; height: ").concat(i,"px")}}function Ha(t){return t.createElement("div",{key:"area_pieces",className:qa},t.createElement("div",{className:Ya}),t.createElement("div",{className:Ya}),t.createElement("div",{className:Ya}),t.createElement("div",{className:Ya}))}var La={name:"dragArea",props:["dragArea","passDragArea"],events:["click","clickGroup"],render:function(t,e){var n=t.props,r=n.target,o=n.dragArea,a=n.groupable,s=n.passDragArea,u=t.getState(),c=u.width,l=u.height,f=u.renderPoses,p=s?Eo("area","pass"):Eo("area");if(a)return[e.createElement("div",{key:"area",ref:i(t,"areaElement"),className:p}),Ha(e)];if(!r||!o)return[];var d=ke([0,0],[c,0],[0,l],[c,l],f[0],f[1],f[2],f[3]),h=d.length?Go(d,!0):"none";return[e.createElement("div",{key:"area",ref:i(t,"areaElement"),className:p,style:{top:"0px",left:"0px",width:"".concat(c,"px"),height:"".concat(l,"px"),transformOrigin:"0 0",transform:h}}),Ha(e)]},dragStart:function(t,e){var n=e.datas,r=e.clientX,i=e.clientY;if(!e.inputEvent)return!1;n.isDragArea=!1;var o=t.areaElement,a=t.state,s=a.moveableClientRect,u=a.renderPoses,c=a.rootMatrix,l=a.is3d,f=s.left,p=s.top,d=Fo(u),h=d.left,v=d.top,g=d.width,m=d.height,b=Rn(ha(c,[r-f,i-p],l?4:3),2),x=b[0],y=b[1],E=[{left:h,top:v,width:g,height:(y-=v)-10},{left:h,top:v,width:(x-=h)-10,height:m},{left:h,top:v+y+10,width:g,height:m-y-10},{left:h+x+10,top:v,width:g-x-10,height:m}],S=[].slice.call(o.nextElementSibling.children);E.forEach((function(t,e){S[e].style.cssText="left: ".concat(t.left,"px;top: ").concat(t.top,"px; width: ").concat(t.width,"px; height: ").concat(t.height,"px;")})),K(o,Xa),a.disableNativeEvent=!0},drag:function(t,e){var n=e.datas,r=e.inputEvent;if(this.enableNativeEvent(t),!r)return!1;n.isDragArea||(n.isDragArea=!0,ja(t))},dragEnd:function(t,e){this.enableNativeEvent(t);var n=e.inputEvent,r=e.datas;if(!n)return!1;r.isDragArea||ja(t)},dragGroupStart:function(t,e){return this.dragStart(t,e)},dragGroup:function(t,e){return this.drag(t,e)},dragGroupEnd:function(t,e){return this.dragEnd(t,e)},unset:function(t){ja(t),t.state.disableNativeEvent=!1},enableNativeEvent:function(t){var e=t.state;e.disableNativeEvent&&B((function(){e.disableNativeEvent=!1}))}},Va=Tn("origin",{props:["origin","svgOrigin"],render:function(t,e){var n,r=t.props,i=r.zoom,o=r.svgOrigin,a=r.groupable,s=t.getState(),u=s.beforeOrigin,c=s.rotation,l=s.svg,f=s.allMatrix,p=s.is3d,d=s.left,h=s.top,v=s.offsetWidth,g=s.offsetHeight;if(!a&&l&&o){var m=Rn(Ma(o,v,g),2);n=Wo(c,i,ye(Ao(f,[m[0],m[1]],p?4:3),[d,h]))}else n=Wo(c,i,u);return[e.createElement("div",{className:Eo("control","origin"),style:n,key:"beforeOrigin"})]}});function Ua(t){var e=t.scrollContainer;return[e.scrollLeft,e.scrollTop]}var $a={name:"scrollable",canPinch:!0,props:["scrollable","scrollContainer","scrollThreshold","scrollThrottleTime","getScrollPosition","scrollOptions"],events:["scroll","scrollGroup"],dragRelation:"strong",dragStart:function(t,e){var n=t.props,r=n.scrollContainer,i=void 0===r?t.getContainer():r,o=n.scrollOptions,a=new Je,s=Ea(i,!0);e.datas.dragScroll=a,t.state.dragScroll=a;var u=e.isControl?"controlGesto":"targetGesto",c=e.targets;a.on("scroll",(function(n){var r=n.container,i=n.direction,o=ia(t,e,{scrollContainer:r,direction:i}),a=c?"onScrollGroup":"onScroll";c&&(o.targets=c),sa(t,a,o)})).on("move",(function(e){var n=e.offsetX,r=e.offsetY,i=e.inputEvent;t[u].scrollBy(n,r,i.inputEvent,!1)})).on("scrollDrag",(function(e){(0,e.next)(t[u].getCurrentEvent())})),a.dragStart(e,On({container:s},o))},checkScroll:function(t,e){var n=e.datas.dragScroll;if(n){var r=t.props,i=r.scrollContainer,o=void 0===i?t.getContainer():i,a=r.scrollThreshold,s=void 0===a?0:a,u=r.scrollThrottleTime,c=void 0===u?0:u,l=r.getScrollPosition,f=void 0===l?Ua:l,p=r.scrollOptions;return n.drag(e,On({container:o,threshold:s,throttleTime:c,getScrollPosition:function(t){return f({scrollContainer:t.container,direction:t.direction})}},p)),!0}},drag:function(t,e){return this.checkScroll(t,e)},dragEnd:function(t,e){e.datas.dragScroll.dragEnd(),e.datas.dragScroll=null},dragControlStart:function(t,e){return this.dragStart(t,On(On({},e),{isControl:!0}))},dragControl:function(t,e){return this.drag(t,e)},dragControlEnd:function(t,e){return this.dragEnd(t,e)},dragGroupStart:function(t,e){return this.dragStart(t,On(On({},e),{targets:t.props.targets}))},dragGroup:function(t,e){return this.drag(t,On(On({},e),{targets:t.props.targets}))},dragGroupEnd:function(t,e){return this.dragEnd(t,On(On({},e),{targets:t.props.targets}))},dragGroupControlStart:function(t,e){return this.dragStart(t,On(On({},e),{targets:t.props.targets,isControl:!0}))},dragGroupControl:function(t,e){return this.drag(t,On(On({},e),{targets:t.props.targets}))},dragGroupControEnd:function(t,e){return this.dragEnd(t,On(On({},e),{targets:t.props.targets}))},unset:function(t){var e,n=t.state;null===(e=n.dragScroll)||void 0===e||e.dragEnd(),n.dragScroll=null}},Za={name:"",props:["target","dragTargetSelf","dragTarget","dragContainer","container","warpSelf","rootContainer","useResizeObserver","useMutationObserver","zoom","dragFocusedInput","transformOrigin","ables","className","pinchThreshold","pinchOutside","triggerAblesSimultaneously","checkInput","cspNonce","translateZ","hideDefaultLines","props","flushSync","stopPropagation","preventClickEventOnDrag","preventClickDefault","viewContainer","persistData","useAccuratePosition","firstRenderState","linePadding","controlPadding","preventDefault","requestStyles"],events:["changeTargets"]},Ka=Tn("padding",{props:["padding"],render:function(t,e){var n=t.props;if(n.dragArea)return[];var r=Ga(n.padding||{}),i=r.left,o=r.top,a=r.right,s=r.bottom,u=t.getState(),c=u.renderPoses,l=[u.pos1,u.pos2,u.pos3,u.pos4],f=[];return i>0&&f.push([0,2]),o>0&&f.push([0,1]),a>0&&f.push([1,3]),s>0&&f.push([2,3]),f.map((function(t,n){var r=Rn(t,2),i=r[0],o=r[1],a=ke([0,0],[100,0],[0,100],[100,100],l[i],l[o],c[i],c[o]);if(a.length)return e.createElement("div",{key:"padding".concat(n),className:Eo("padding"),style:{transform:Go(a,!0)}})}))}}),Ja=["nw","ne","se","sw"];function Qa(t,e){var n=t[0]+t[1],r=n>e?e/n:1;return t[0]*=r,t[1]=e-t[1]*r,t}var ts=[1,2,5,6],es=[0,3,4,7],ns=[1,-1,-1,1],rs=[1,1,-1,-1];function is(t,e,n,r,i,o,a,s){void 0===i&&(i=0),void 0===o&&(o=0),void 0===a&&(a=n),void 0===s&&(s=r);var u=[],c=!1,l=t.filter((function(t){return!t.virtual})),f=l.map((function(t){var l=t.horizontal,f=t.vertical,p=t.pos;if(f&&!c&&(c=!0,u.push("/")),c){var d=Math.max(0,1===f?p[1]-o:s-p[1]);return u.push(ma(d,r,e)),d}d=Math.max(0,1===l?p[0]-i:a-p[0]);return u.push(ma(d,n,e)),d}));return{radiusPoses:l,styles:u,raws:f}}function os(t){for(var e=[0,0],n=[0,0],r=t.length,i=0;i-1?t.slice(0,f):t).length,d=t.slice(0,p),h=t.slice(p+1),v=d.length,g=h.length,m=g>0,b=Rn(d,4),x=b[0],y=void 0===x?"0px":x,E=b[1],S=void 0===E?y:E,D=b[2],C=void 0===D?y:D,w=b[3],_=void 0===w?S:w,M=Rn(h,4),O=M[0],R=void 0===O?y:O,P=M[1],T=void 0===P?m?R:S:P,z=M[2],G=void 0===z?m?R:C:z,k=M[3],B=void 0===k?m?T:_:k,A=[y,S,C,_].map((function(t){return F(t,e)})),I=[R,T,G,B].map((function(t){return F(t,n)})),N=A.slice(),q=I.slice();s=Rn(Qa([N[0],N[1]],e),2),N[0]=s[0],N[1]=s[1],u=Rn(Qa([N[3],N[2]],e),2),N[3]=u[0],N[2]=u[1],c=Rn(Qa([q[0],q[3]],n),2),q[0]=c[0],q[3]=c[1],l=Rn(Qa([q[1],q[2]],n),2),q[1]=l[0],q[2]=l[1];var Y=a?N:N.slice(0,Math.max(o[0],v)),X=a?q:q.slice(0,Math.max(o[1],g));return Pn(Pn([],Rn(Y.map((function(t,e){var o=Ja[e];return{virtual:e>=v,horizontal:ns[e],vertical:0,pos:[r+t,i+(-1===rs[e]?n:0)],sub:!0,raw:A[e],direction:o}}))),!1),Rn(X.map((function(t,n){var o=Ja[n];return{virtual:n>=g,horizontal:0,vertical:rs[n],pos:[r+(-1===ns[n]?e:0),i+t],sub:!0,raw:I[n],direction:o}}))),!1)}var ss=[[0,-1,"n"],[1,0,"e"]],us=[[-1,-1,"nw"],[0,-1,"n"],[1,-1,"ne"],[1,0,"e"],[1,1,"se"],[0,1,"s"],[-1,1,"sw"],[-1,0,"w"]];function cs(t,e,n){var r=t.props.clipRelative,i=t.state,o=i.width,a=i.height,s=e,u=s.type,c=s.poses,l="rect"===u,f="circle"===u;if("polygon"===u)return n.map((function(t){return"".concat(ma(t[0],o,r)," ").concat(ma(t[1],a,r))}));if(l||"inset"===u){var p=n[1][1],d=n[3][0],h=n[7][0],v=n[5][1];if(l)return[p,d,v,h].map((function(t){return"".concat(t,"px")}));var g=[p,o-d,a-v,h].map((function(t,e){return ma(t,e%2?o:a,r)}));if(n.length>8){var m=Rn(ye(n[4],n[0]),2),b=m[0],x=m[1];g.push.apply(g,Pn(["round"],Rn(is(c.slice(8).map((function(t,e){return On(On({},t),{pos:n[e]})})),r,b,x,h,p,d,v).styles),!1))}return g}if(f||"ellipse"===u){var y=n[0],E=ma(Ta(n[1][1]-y[1]),f?Math.sqrt((o*o+a*a)/2):a,r);return(g=f?[E]:[ma(Ta(n[2][0]-y[0]),o,r),E]).push("at",ma(y[0],o,r),ma(y[1],a,r)),g}}function ls(t,e,n,r){var i=[r,(r+e)/2,e],o=[t,(t+n)/2,n];return us.map((function(t){var e=Rn(t,3),n=e[0],r=e[1],a=e[2],s=i[n+1],u=o[r+1];return{vertical:Ta(r),horizontal:Ta(n),direction:a,pos:[s,u]}}))}function fs(t){var e=[1/0,-1/0],n=[1/0,-1/0];return t.forEach((function(t){var r=t.pos;e[0]=Math.min(e[0],r[0]),e[1]=Math.max(e[1],r[0]),n[0]=Math.min(n[0],r[1]),n[1]=Math.max(n[1],r[1])})),[Ta(e[1]-e[0]),Ta(n[1]-n[0])]}function ps(t,e,n,r,i){var o,a,s,u,c,l,f,p,d;if(t){var h=i;if(!h){var v=Yr(t),g=v("clipPath");h="none"!==g?g:v("clip")}if(h&&"none"!==h&&"auto"!==h||(h=r)){var m=R(h),b=m.prefix,x=void 0===b?h:b,y=m.value,E=void 0===y?"":y,S="circle"===x,D=" ";if("polygon"===x){D=",";var C=(k=O(E||"0% 0%, 100% 0%, 100% 100%, 0% 100%")).map((function(t){var r=Rn(t.split(" "),2),i=r[0],o=r[1];return{vertical:1,horizontal:1,pos:[F(i,e),F(o,n)]}})),w=nn(C.map((function(t){return t.pos})));return{type:x,clipText:h,poses:C,splitter:D,left:w.minX,right:w.maxX,top:w.minY,bottom:w.maxY}}if(S||"ellipse"===x){var _="",T="",z=0,G=0,k=M(E);if(S){var B;B=void 0===(a=(o=Rn(k,4))[0])?"50%":a,_=void 0===(s=o[2])?"50%":s,T=void 0===(u=o[3])?"50%":u,z=F(B,Math.sqrt((e*e+n*n)/2)),G=z}else{var A,I;A=void 0===(l=(c=Rn(k,5))[0])?"50%":l,I=void 0===(f=c[1])?"50%":f,_=void 0===(p=c[3])?"50%":p,T=void 0===(d=c[4])?"50%":d,z=F(A,e),G=F(I,n)}var N=[F(_,e),F(T,n)];C=Pn([{vertical:1,horizontal:1,pos:N,direction:"nesw"}],Rn(ss.slice(0,S?1:2).map((function(t){return{vertical:Ta(t[1]),horizontal:t[0],direction:t[2],sub:!0,pos:[N[0]+t[0]*z,N[1]+t[1]*G]}}))),!1);return{type:x,clipText:h,radiusX:z,radiusY:G,left:N[0]-z,top:N[1]-G,right:N[0]+z,bottom:N[1]+G,poses:C,splitter:D}}if("inset"===x){var q=(k=M(E||"0 0 0 0")).indexOf("round"),Y=(q>-1?k.slice(0,q):k).length,X=k.slice(Y+1),W=Rn(k.slice(0,Y),4),j=W[0],H=W[1],L=void 0===H?j:H,V=W[2],U=void 0===V?j:V,$=W[3],Z=void 0===$?L:$,K=Rn([j,U].map((function(t){return F(t,n)})),2),J=K[0],Q=K[1],tt=Rn([Z,L].map((function(t){return F(t,e)})),2),et=tt[0],nt=tt[1],rt=e-nt,it=n-Q,ot=as(X,rt-et,it-J,et,J);return{type:"inset",clipText:h,poses:C=Pn(Pn([],Rn(ls(J,rt,it,et)),!1),Rn(ot),!1),top:J,left:et,right:rt,bottom:it,radius:X,splitter:D}}if("rect"===x){D=",";var at=Rn((k=O(E||"0px, ".concat(e,"px, ").concat(n,"px, 0px"))).map((function(t){return P(t).value})),4),st=at[0];return{type:"rect",clipText:h,poses:C=ls(st,nt=at[1],Q=at[2],et=at[3]),top:st,right:nt,bottom:Q,left:et,values:k,splitter:D}}}}}function ds(t,e){var n=Rn(lr(t,e),2),r=n[0],i=n[1],o=e.datas,a=o.clipPath,s=o.clipIndex,u=a,c=u.type,l=u.poses,f=u.splitter,p=l.map((function(t){return t.pos}));if("polygon"===c)p.splice(s,0,[r,i]);else{if("inset"!==c)return;var d=ts.indexOf(s),h=es.indexOf(s),v=l.length;if(function(t,e,n,r,i,o,a,s,u,c,l){void 0===c&&(c=0),void 0===l&&(l=0);var f=os(t.slice(n)),p=f.horizontalRange,d=f.verticalRange;if(r>-1)for(var h=1===ns[r]?o-c:s-o,v=p[1];v<=r;++v){var g=1===rs[v]?l:u,m=0;if(r===v?m=o:0===v?m=c+h:-1===ns[v]&&(m=s-(e[n][0]-c)),t.splice(n+v,0,{horizontal:ns[v],vertical:0,pos:[m,g]}),e.splice(n+v,0,[m,g]),0===v)break}else if(i>-1){var b=1===rs[i]?a-l:u-a;if(0===p[1]&&0===d[1]){var x=[c+b,l];t.push({horizontal:ns[0],vertical:0,pos:x}),e.push(x)}var y=d[0];for(v=d[1];v<=i&&(m=1===ns[v]?c:s,g=0,i===v?g=a:0===v?g=l+b:1===rs[v]?g=e[n+y][1]:-1===rs[v]&&(g=u-(e[n+y][1]-l)),t.push({horizontal:0,vertical:rs[v],pos:[m,g]}),e.push([m,g]),0!==v);++v);}}(l,p,8,d,h,r,i,p[4][0],p[4][1],p[0][0],p[0][1]),v===l.length)return}var g=cs(t,a,p),m="".concat(c,"(").concat(g.join(f),")");sa(t,"onClip",ia(t,e,On({clipEventType:"added",clipType:c,poses:p,clipStyles:g,clipStyle:m,distX:0,distY:0},na({clipPath:m},e))))}function hs(t,e){var n=e.datas,r=n.clipPath,i=n.clipIndex,o=r,a=o.type,s=o.poses,u=o.splitter,c=s.map((function(t){return t.pos})),l=c.length;if("polygon"===a)s.splice(i,1),c.splice(i,1);else{if("inset"!==a)return;if(i<8)return;if(function(t,e,n,r,i){void 0===i&&(i=e.length);var o=os(t.slice(r)),a=o.horizontalRange,s=o.verticalRange,u=n-r,c=0;if(0===u)c=i;else if(u>0&&u=s[0]))return;c=s[0]+s[1]-u}t.splice(n,c),e.splice(n,c)}(s,c,i,8,l),l===s.length)return}var f=cs(t,r,c),p="".concat(a,"(").concat(f.join(u),")");sa(t,"onClip",ia(t,e,On({clipEventType:"removed",clipType:a,poses:c,clipStyles:f,clipStyle:p,distX:0,distY:0},na({clipPath:p},e))))}var vs={name:"clippable",props:["clippable","defaultClipPath","customClipPath","keepRatio","clipRelative","clipArea","dragWithClip","clipTargetBounds","clipVerticalGuidelines","clipHorizontalGuidelines","clipSnapThreshold"],events:["clipStart","clip","clipEnd"],css:[".control.clip-control {\nbackground: #6d6;\ncursor: pointer;\n}\n.control.clip-control.clip-radius {\nbackground: #d66;\n}\n.line.clip-line {\nbackground: #6e6;\ncursor: move;\nz-index: 1;\n}\n.clip-area {\nposition: absolute;\ntop: 0;\nleft: 0;\n}\n.clip-ellipse {\nposition: absolute;\ncursor: move;\nborder: 1px solid #6d6;\nborder: var(--zoompx) solid #6d6;\nborder-radius: 50%;\ntransform-origin: 0px 0px;\n}",":host {\n--bounds-color: #d66;\n}",".guideline {\npointer-events: none;\nz-index: 2;\n}",".line.guideline.bounds {\nbackground: #d66;\nbackground: var(--bounds-color);\n}"],render:function(t,e){var n=t.props,r=n.customClipPath,i=n.defaultClipPath,o=n.clipArea,a=n.zoom,s=n.groupable,u=t.getState(),c=u.target,l=u.width,f=u.height,p=u.allMatrix,d=u.is3d,h=u.left,v=u.top,g=u.pos1,m=u.pos2,b=u.pos3,x=u.pos4,y=u.clipPathState,E=u.snapBoundInfos,S=u.rotation;if(!c||s)return[];var D=ps(c,l,f,i||"inset",y||r);if(!D)return[];var C=d?4:3,w=D.type,_=D.poses.map((function(t){var e=Ao(p,t.pos,C);return[e[0]-h,e[1]-v]})),M=[],O=[],R="rect"===w,P="inset"===w,T="polygon"===w;if(R||P||T){var z=P?_.slice(0,8):_;O=z.map((function(t,n){var r=0===n?z[z.length-1]:z[n-1],i=W(r,t),o=Yo(r,t);return e.createElement("div",{key:"clipLine".concat(n),className:Eo("line","clip-line","snap-control"),"data-clip-index":n,style:{width:"".concat(o,"px"),transform:"translate(".concat(r[0],"px, ").concat(r[1],"px) rotate(").concat(i,"rad) scaleY(").concat(a,")")}})}))}if(M=_.map((function(t,n){return e.createElement("div",{key:"clipControl".concat(n),className:Eo("control","clip-control","snap-control"),"data-clip-index":n,style:{transform:"translate(".concat(t[0],"px, ").concat(t[1],"px) rotate(").concat(S,"rad) scale(").concat(a,")")}})})),P&&M.push.apply(M,Pn([],Rn(_.slice(8).map((function(t,n){return e.createElement("div",{key:"clipRadiusControl".concat(n),className:Eo("control","clip-control","clip-radius","snap-control"),"data-clip-index":8+n,style:{transform:"translate(".concat(t[0],"px, ").concat(t[1],"px) rotate(").concat(S,"rad) scale(").concat(a,")")}})}))),!1)),"circle"===w||"ellipse"===w){var G=D.left,k=D.top,B=D.radiusX,A=D.radiusY,I=Rn(ye(Ao(p,[G,k],C),Ao(p,[0,0],C)),2),F=I[0],N=I[1],q="none";if(!o){for(var Y=Math.max(10,B/5,A/5),X=[],j=0;j<=Y;++j){var H=2*Math.PI/Y*j;X.push([B+(B-a)*Math.cos(H),A+(A-a)*Math.sin(H)])}X.push([B,-2]),X.push([-2,-2]),X.push([-2,2*A+2]),X.push([2*B+2,2*A+2]),X.push([2*B+2,-2]),X.push([B,-2]),q="polygon(".concat(X.map((function(t){return"".concat(t[0],"px ").concat(t[1],"px")})).join(", "),")")}M.push(e.createElement("div",{key:"clipEllipse",className:Eo("clip-ellipse","snap-control"),style:{width:"".concat(2*B,"px"),height:"".concat(2*A,"px"),clipPath:q,transform:"translate(".concat(-h+F,"px, ").concat(-v+N,"px) ").concat(Go(p))}}))}if(o){var L=Fo(Pn([g,m,b,x],Rn(_),!1)),V=L.width,U=L.height,$=L.left,Z=L.top;if(T||R||P){X=P?_.slice(0,8):_;M.push(e.createElement("div",{key:"clipArea",className:Eo("clip-area","snap-control"),style:{width:"".concat(V,"px"),height:"".concat(U,"px"),transform:"translate(".concat($,"px, ").concat(Z,"px)"),clipPath:"polygon(".concat(X.map((function(t){return"".concat(t[0]-$,"px ").concat(t[1]-Z,"px")})).join(", "),")")}}))}}return E&&["vertical","horizontal"].forEach((function(t){var n=E[t],r="horizontal"===t;n.isSnap&&O.push.apply(O,Pn([],Rn(n.snap.posInfos.map((function(n,i){var o=n.pos,s=ye(Ao(p,r?[0,o]:[o,0],C),[h,v]),u=ye(Ao(p,r?[l,o]:[o,f],C),[h,v]);return Ur(e,"",s,u,a,"clip".concat(t,"snap").concat(i),"guideline")}))),!1)),n.isBound&&O.push.apply(O,Pn([],Rn(n.bounds.map((function(n,i){var o=n.pos,s=ye(Ao(p,r?[0,o]:[o,0],C),[h,v]),u=ye(Ao(p,r?[l,o]:[o,f],C),[h,v]);return Ur(e,"",s,u,a,"clip".concat(t,"bounds").concat(i),"guideline","bounds","bold")}))),!1))})),Pn(Pn([],Rn(M),!1),Rn(O),!1)},dragControlCondition:function(t,e){return e.inputEvent&&(e.inputEvent.target.getAttribute("class")||"").indexOf("clip")>-1},dragStart:function(t,e){var n=t.props.dragWithClip;return!(void 0===n||n)&&this.dragControlStart(t,e)},drag:function(t,e){return this.dragControl(t,On(On({},e),{isDragTarget:!0}))},dragEnd:function(t,e){return this.dragControlEnd(t,e)},dragControlStart:function(t,e){var n=t.state,r=t.props,i=r.defaultClipPath,o=r.customClipPath,a=n.target,s=n.width,u=n.height,c=e.inputEvent?e.inputEvent.target:null,l=c&&c.getAttribute("class")||"",f=e.datas,p=ps(a,s,u,i||"inset",o);if(!p)return!1;var d=p.clipText;return!1===sa(t,"onClipStart",ia(t,e,{clipType:p.type,clipStyle:d,poses:p.poses.map((function(t){return t.pos}))}))?(f.isClipStart=!1,!1):(f.isControl=l&&l.indexOf("clip-control")>-1,f.isLine=l.indexOf("clip-line")>-1,f.isArea=l.indexOf("clip-area")>-1||l.indexOf("clip-ellipse")>-1,f.clipIndex=c?parseInt(c.getAttribute("data-clip-index"),10):-1,f.clipPath=p,f.isClipStart=!0,n.clipPathState=d,fr(t,e),!0)},dragControl:function(t,e){var n,r,i,o=e.datas,a=e.originalDatas,s=e.isDragTarget;if(!o.isClipStart)return!1;var u=o,c=u.isControl,l=u.isLine,f=u.isArea,p=u.clipIndex,d=u.clipPath;if(!d)return!1;var h=jo(t.props,"clippable"),v=h.keepRatio,g=0,m=0,b=a.draggable,x=mr(e);s&&b?(n=Rn(b.prevBeforeDist,2),g=n[0],m=n[1]):(r=Rn(x,2),g=r[0],m=r[1]);var y=[g,m],E=t.state,S=E.width,D=E.height,C=!f&&!c&&!l,w=d.type,_=d.poses,M=d.splitter,O=_.map((function(t){return t.pos}));C&&(g=-g,m=-m);var R=!c||"nesw"===_[p].direction,P="inset"===w||"rect"===w,T=_.map((function(){return[0,0]}));if(c&&!R){var z=_[p],G=z.horizontal,k=z.vertical,B=[g*Ta(G),m*Ta(k)];T=function(t,e,n,r,i){var o=t[e],a=o.direction,s=o.sub,u=t.map((function(){return[0,0]})),c=a?a.split(""):[];if(r&&e<8){var l=c.filter((function(t){return"w"===t||"e"===t})),f=c.filter((function(t){return"n"===t||"s"===t})),p=l[0],d=f[0];u[e]=n;var h=Rn(fs(t),2),v=h[0],g=h[1],m=v&&g?v/g:0;if(m&&i){var b=t[(e+4)%8].pos,x=[0,0];a.indexOf("w")>-1?x[0]=-1:a.indexOf("e")>-1&&(x[0]=1),a.indexOf("n")>-1?x[1]=-1:a.indexOf("s")>-1&&(x[1]=1);var y=Ca([v,g],n,m,x,!0),E=v+y[0],S=g+y[1],D=b[1],C=b[1],w=b[0],_=b[0];-1===x[0]?w=_-E:1===x[0]?_=w+E:(w-=E/2,_+=E/2),-1===x[1]?D=C-S:C=1===x[1]?D+S:(D=C-S/2)+S;var M=ls(D,_,C,w);t.forEach((function(t,e){u[e][0]=M[e].pos[0]-t.pos[0],u[e][1]=M[e].pos[1]-t.pos[1]}))}else t.forEach((function(t,e){var r=t.direction;r&&(r.indexOf(p)>-1&&(u[e][0]=n[0]),r.indexOf(d)>-1&&(u[e][1]=n[1]))})),p&&(u[1][0]=n[0]/2,u[5][0]=n[0]/2),d&&(u[3][1]=n[1]/2,u[7][1]=n[1]/2)}else a&&!s?c.forEach((function(e){var r="n"===e||"s"===e;t.forEach((function(t,i){var o=t.direction,a=t.horizontal,s=t.vertical;o&&-1!==o.indexOf(e)&&(u[i]=[r||!a?0:n[0],r&&s?n[1]:0])}))})):u[e]=n;return u}(_,p,B,P,v)}else R&&(T=O.map((function(){return[g,m]})));var A=O.map((function(t,e){return xe(t,T[e])})),I=Pn([],Rn(A),!1);E.snapBoundInfos=null;var N="circle"===d.type,q="ellipse"===d.type;if(N||q){var Y=Ta((rt=Fo(A)).bottom-rt.top),X=Ta(q?rt.right-rt.left:Y),W=A[0][1]+Y,j=A[0][0]-X,H=A[0][0]+X;N&&(I.push([H,rt.bottom]),T.push([1,0])),I.push([rt.left,W]),T.push([0,1]),I.push([j,rt.bottom]),T.push([1,0])}var L=io((h.clipHorizontalGuidelines||[]).map((function(t){return F("".concat(t),D)})),(h.clipVerticalGuidelines||[]).map((function(t){return F("".concat(t),S)})),S,D),V=[],U=[];if(N||q)V=[I[4][0],I[2][0]],U=[I[1][1],I[3][1]];else if(P){var $=[I[0],I[2],I[4],I[6]],Z=[T[0],T[2],T[4],T[6]];V=$.filter((function(t,e){return Z[e][0]})).map((function(t){return t[0]})),U=$.filter((function(t,e){return Z[e][1]})).map((function(t){return t[1]}))}else V=I.filter((function(t,e){return T[e][0]})).map((function(t){return t[0]})),U=I.filter((function(t,e){return T[e][1]})).map((function(t){return t[1]}));var K=[0,0],J=Bi(L,h.clipTargetBounds&&{left:0,top:0,right:S,bottom:D},V,U,5),Q=J.horizontal,tt=J.vertical,et=Q.offset,nt=tt.offset;if(Q.isBound&&(K[1]+=et),tt.isBound&&(K[0]+=nt),(q||N)&&0===T[0][0]&&0===T[0][1]){var rt,it=(rt=Fo(A)).bottom-rt.top,ot=q?rt.right-rt.left:it;ot-=tt.isBound?Ta(nt):0===tt.snapIndex?-nt:nt,it-=Q.isBound?Ta(et):0===Q.snapIndex?-et:et,N&&(ot=it=xi(tt,Q)>0?it:ot);var at=I[0];I[1][1]=at[1]-it,I[2][0]=at[0]+ot,I[3][1]=at[1]+it,I[4][0]=at[0]-ot}else if(P&&v&&c){var st=Rn(fs(_),2),ut=st[0],ct=st[1],lt=ut&&ct?ut/ct:0,ft=_[p].direction||"",pt=I[1][1];W=I[5][1],j=I[7][0],H=I[3][0];Ta(et)<=Ta(nt)?et=Pa(et)*Ta(nt)/lt:nt=Pa(nt)*Ta(et)*lt,ft.indexOf("w")>-1?j-=nt:ft.indexOf("e")>-1?H-=nt:(j+=nt/2,H-=nt/2),ft.indexOf("n")>-1?pt-=et:ft.indexOf("s")>-1?W-=et:(pt+=et/2,W-=et/2);var dt=ls(pt,H,W,j);I.forEach((function(t,e){var n;n=Rn(dt[e].pos,2),t[0]=n[0],t[1]=n[1]}))}else I.forEach((function(t,e){var n=T[e];n[0]&&(t[0]-=nt),n[1]&&(t[1]-=et)}));var ht=cs(t,d,A),vt="".concat(w,"(").concat(ht.join(M),")");if(E.clipPathState=vt,N||q)V=[I[4][0],I[2][0]],U=[I[1][1],I[3][1]];else if(P){V=($=[I[0],I[2],I[4],I[6]]).map((function(t){return t[0]})),U=$.map((function(t){return t[1]}))}else V=I.map((function(t){return t[0]})),U=I.map((function(t){return t[1]}));if(E.snapBoundInfos=Bi(L,h.clipTargetBounds&&{left:0,top:0,right:S,bottom:D},V,U,1),b){var gt=E.is3d,mt=E.allMatrix,bt=gt?4:3,xt=K;s&&(xt=[y[0]+K[0]-x[0],y[1]+K[1]-x[1]]),b.deltaOffset=be(mt,[xt[0],xt[1],0,0],bt)}return sa(t,"onClip",ia(t,e,On({clipEventType:"changed",clipType:w,poses:A,clipStyle:vt,clipStyles:ht,distX:g,distY:m},na(((i={})["rect"===w?"clip":"clipPath"]=vt,i),e)))),!0},dragControlEnd:function(t,e){this.unset(t);var n=e.isDrag,r=e.datas,i=e.isDouble,o=r.isLine,a=r.isClipStart,s=r.isControl;return!!a&&(sa(t,"onClipEnd",oa(t,e,{})),i&&(s?hs(t,e):o&&ds(t,e)),i||n)},unset:function(t){t.state.clipPathState="",t.state.snapBoundInfos=null}},gs={name:"originDraggable",props:["originDraggable","originRelative"],events:["dragOriginStart","dragOrigin","dragOriginEnd"],css:[":host[data-able-origindraggable] .control.origin {\npointer-events: auto;\n}"],dragControlCondition:function(t,e){return e.isRequest?"originDraggable"===e.requestAble:Z(e.inputEvent.target,Eo("origin"))},dragControlStart:function(t,e){var n=e.datas;fr(t,e);var r=ia(t,e,{dragStart:Fi.dragStart(t,(new ur).dragStart([0,0],e))}),i=sa(t,"onDragOriginStart",r);return n.startOrigin=t.state.transformOrigin,n.startTargetOrigin=t.state.targetOrigin,n.prevOrigin=[0,0],n.isDragOrigin=!0,!1===i?(n.isDragOrigin=!1,!1):r},dragControl:function(t,e){var n=e.datas,r=e.isPinch,i=e.isRequest;if(!n.isDragOrigin)return!1;var o=Rn(mr(e),2),a=o[0],s=o[1],u=t.state,c=u.width,l=u.height,f=u.offsetMatrix,p=u.targetMatrix,d=u.is3d,h=t.props.originRelative,v=void 0===h||h,g=d?4:3,m=[a,s];if(i){var b=e.distOrigin;(b[0]||b[1])&&(m=b)}var x=xe(n.startOrigin,m),y=xe(n.startTargetOrigin,m),E=ye(m,n.prevOrigin),S=Er(f,p,x,g),D=t.getRect(),C=Fo(Io(S,c,l,g)),w=[D.left-C.left,D.top-C.top];n.prevOrigin=m;var _=[ma(y[0],c,v),ma(y[1],l,v)].join(" "),M=Fi.drag(t,sr(e,t.state,w,!!r,!1)),O=ia(t,e,On(On({width:c,height:l,origin:x,dist:m,delta:E,transformOrigin:_,drag:M},na({transformOrigin:_,transform:M.transform},e)),{afterTransform:M.transform}));return sa(t,"onDragOrigin",O),O},dragControlEnd:function(t,e){return!!e.datas.isDragOrigin&&(sa(t,"onDragOriginEnd",oa(t,e,{})),!0)},dragGroupControlCondition:function(t,e){return this.dragControlCondition(t,e)},dragGroupControlStart:function(t,e){return!!this.dragControlStart(t,e)},dragGroupControl:function(t,e){var n=this.dragControl(t,e);return!!n&&(t.transformOrigin=n.transformOrigin,!0)},request:function(t){var e={},n=t.getRect(),r=0,i=0,o=n.transformOrigin,a=[0,0];return{isControl:!0,requestStart:function(){return{datas:e}},request:function(t){return"deltaOrigin"in t?(a[0]+=t.deltaOrigin[0],a[1]+=t.deltaOrigin[1]):"origin"in t?(a[0]=t.origin[0]-o[0],a[1]=t.origin[1]-o[1]):("x"in t?r=t.x-n.left:"deltaX"in t&&(r+=t.deltaX),"y"in t?i=t.y-n.top:"deltaY"in t&&(i+=t.deltaY)),{datas:e,distX:r,distY:i,distOrigin:a}},requestEnd:function(){return{datas:e,isDrag:!0}}}}};function ms(t,e,n,r,i){void 0===r&&(r=[0,0]);return as(t&&"0px"!==t?M(t):[],e,n,0,0,r,i)}function bs(t,e,n,r,i){var o=t.state,a=o.width,s=o.height,u=is(i,t.props.roundRelative,a,s),c=u.raws,l=u.styles,f=function(t,e){return void 0===e&&(e=t.map((function(t){return t.raw}))),{horizontals:t.map((function(t,n){return t.horizontal?e[n]:null})).filter((function(t){return null!=t})),verticals:t.map((function(t,n){return t.vertical?e[n]:null})).filter((function(t){return null!=t}))}}(u.radiusPoses,c),p=f.horizontals,d=f.verticals,h=l.join(" ");o.borderRadiusState=h;var v=ia(t,e,On({horizontals:p,verticals:d,borderRadius:h,width:a,height:s,delta:r,dist:n},na({borderRadius:h},e)));return sa(t,"onRound",v),v}function xs(t){var e,n,r=t.getState().style,i=r.borderRadius||"";if(!i&&t.props.groupable){var o=t.moveables[0],a=t.getTargets()[0];a&&((null==o?void 0:o.props.target)===a?(i=null!==(n=null===(e=t.moveables[0])||void 0===e?void 0:e.state.style.borderRadius)&&void 0!==n?n:"",r.borderRadius=i):(i=ua(a).borderRadius,r.borderRadius=i))}return i}var ys={name:"roundable",props:["roundable","roundRelative","minRoundControls","maxRoundControls","roundClickable","roundPadding","isDisplayShadowRoundControls"],events:["roundStart","round","roundEnd","roundGroupStart","roundGroup","roundGroupEnd"],css:[".control.border-radius {\nbackground: #d66;\ncursor: pointer;\nz-index: 3;\n}",".control.border-radius.vertical {\nbackground: #d6d;\nz-index: 2;\n}",".control.border-radius.virtual {\nopacity: 0.5;\nz-index: 1;\n}",":host.round-line-clickable .line.direction {\ncursor: pointer;\n}"],className:function(t){var e=t.props.roundClickable;return!0===e||"line"===e?Eo("round-line-clickable"):""},requestStyle:function(){return["borderRadius"]},requestChildStyle:function(){return["borderRadius"]},render:function(t,e){var n=t.getState(),r=n.target,i=n.width,o=n.height,a=n.allMatrix,s=n.is3d,u=n.left,c=n.top,l=n.borderRadiusState,f=t.props,p=f.minRoundControls,d=void 0===p?[0,0]:p,h=f.maxRoundControls,v=void 0===h?[4,4]:h,g=f.zoom,m=f.roundPadding,b=void 0===m?0:m,x=f.isDisplayShadowRoundControls,y=f.groupable;if(!r)return null;var E=l||xs(t),S=s?4:3,D=ms(E,i,o,d,!0);if(!D)return null;var C=0,w=0,_=y?[0,0]:[u,c];return D.map((function(t,n){var r=t.horizontal,i=t.vertical,o=t.direction||"",s=Pn([],Rn(t.pos),!1);w+=Math.abs(r),C+=Math.abs(i),r&&o.indexOf("n")>-1&&(s[1]-=b),i&&o.indexOf("w")>-1&&(s[0]-=b),r&&o.indexOf("s")>-1&&(s[1]+=b),i&&o.indexOf("e")>-1&&(s[0]+=b);var u=ye(Ao(a,s,S),_),c=x&&"horizontal"!==x,l=t.vertical?C<=v[1]&&(c||!t.virtual):w<=v[0]&&(x||!t.virtual);return e.createElement("div",{key:"borderRadiusControl".concat(n),className:Eo("control","border-radius",t.vertical?"vertical":"",t.virtual?"virtual":""),"data-radius-index":n,style:{display:l?"block":"none",transform:"translate(".concat(u[0],"px, ").concat(u[1],"px) scale(").concat(g,")")}})}))},dragControlCondition:function(t,e){if(!e.inputEvent||e.isRequest)return!1;var n=e.inputEvent.target.getAttribute("class")||"";return n.indexOf("border-radius")>-1||n.indexOf("moveable-line")>-1&&n.indexOf("moveable-direction")>-1},dragGroupControlCondition:function(t,e){return this.dragControlCondition(t,e)},dragControlStart:function(t,e){var n=e.inputEvent,r=e.datas,i=n.target,o=i.getAttribute("class")||"",a=o.indexOf("border-radius")>-1,s=o.indexOf("moveable-line")>-1&&o.indexOf("moveable-direction")>-1,u=a?parseInt(i.getAttribute("data-radius-index"),10):-1,c=-1;if(s){var l=i.getAttribute("data-line-key")||"";l&&(c=parseInt(l.replace(/render-line-/g,""),10),isNaN(c)&&(c=-1))}if(!a&&!s)return!1;var f=ia(t,e,{});if(!1===sa(t,"onRoundStart",f))return!1;r.lineIndex=c,r.controlIndex=u,r.isControl=a,r.isLine=s,fr(t,e);var p=t.props,d=p.roundRelative,h=p.minRoundControls,v=void 0===h?[0,0]:h,g=t.state,m=g.width,b=g.height;r.isRound=!0,r.prevDist=[0,0];var x=ms(xs(t)||"",m,b,v,!0)||[];return r.controlPoses=x,g.borderRadiusState=is(x,d,m,b).styles.join(" "),f},dragControl:function(t,e){var n=e.datas,r=n.controlPoses;if(!n.isRound||!n.isControl||!r.length)return!1;var i=n.controlIndex,o=Rn(mr(e),2),a=o[0],s=o[1],u=[a,s],c=ye(u,n.prevDist),l=t.props.maxRoundControls,f=void 0===l?[4,4]:l,p=t.state,d=p.width,h=p.height,v=r[i],g=v.vertical,m=v.horizontal,b=r.map((function(t){var e=t.horizontal,n=t.vertical,r=[e*m*u[0],n*g*u[1]];if(e){if(1===f[0])return r;if(f[0]<4&&e!==m)return r}else{if(0===f[1])return r[1]=n*m*u[0]/d*h,r;if(g){if(1===f[1])return r;if(f[1]<4&&n!==g)return r}}return[0,0]}));b[i]=u;var x=r.map((function(t,e){return On(On({},t),{pos:xe(t.pos,b[e])})}));return i<4?x.slice(0,i+1).forEach((function(t){t.virtual=!1})):x.slice(4,i+1).forEach((function(t){t.virtual=!1})),n.prevDist=[a,s],bs(t,e,u,c,x)},dragControlEnd:function(t,e){var n=t.state;n.borderRadiusState="";var r=e.datas,i=e.isDouble;if(!r.isRound)return!1;var o=r.isControl,a=r.controlIndex,s=r.isLine,u=r.lineIndex,c=r.controlPoses,l=c.filter((function(t){return t.virtual})).length,f=t.props.roundClickable,p=void 0===f||f;if(i&&p){if(!o||!0!==p&&"control"!==p){if(s&&(!0===p||"line"===p)){var d=Rn(lr(t,e),2);!function(t,e,n,r){var i=t.filter((function(t){var e=t.virtual;return t.horizontal&&!e})).length,o=t.filter((function(t){var e=t.virtual;return t.vertical&&!e})).length,a=-1;if(0===e&&(0===i?a=0:1===i&&(a=1)),2===e&&(i<=2?a=2:i<=3&&(a=3)),3===e&&(0===o?a=4:o<4&&(a=7)),1===e&&(o<=1?a=5:o<=2&&(a=6)),-1!==a&&t[a].virtual){var s=t[a];!function(t,e){e<4?t.slice(0,e+1).forEach((function(t){t.virtual=!1})):(t[0].virtual&&(t[0].virtual=!1),t.slice(4,e+1).forEach((function(t){t.virtual=!1})))}(t,a),a<4?s.pos[0]=n:s.pos[1]=r}}(c,u,d[0],d[1])}}else!function(t,e){e<4?t.slice(e,4).forEach((function(t){t.virtual=!0})):t.slice(e).forEach((function(t){t.virtual=!0}))}(c,a);l!==c.filter((function(t){return t.virtual})).length&&bs(t,e,[0,0],[0,0],c)}var h=oa(t,e,{});return sa(t,"onRoundEnd",h),n.borderRadiusState="",h},dragGroupControlStart:function(t,e){var n=this.dragControlStart(t,e);if(!n)return!1;var r=t.moveables,i=t.props.targets,o=Xr(t,"roundable",e);return sa(t,"onRoundGroupStart",On({targets:t.props.targets,events:o.map((function(t,e){return On(On({},t),{target:i[e],moveable:r[e],currentTarget:r[e]})}))},n)),n},dragGroupControl:function(t,e){var n=this.dragControl(t,e);if(!n)return!1;var r=t.moveables,i=t.props.targets,o=Xr(t,"roundable",e),a=On({targets:t.props.targets,events:o.map((function(t,e){return On(On(On({},t),{target:i[e],moveable:r[e],currentTarget:r[e]}),na({borderRadius:n.borderRadius},t))}))},n);return sa(t,"onRoundGroup",a),a},dragGroupControlEnd:function(t,e){var n=t.moveables,r=t.props.targets,i=Xr(t,"roundable",e);aa(t,"onRound",(function(e){var o=On({targets:t.props.targets,events:i.map((function(t,i){return On(On(On({},t),{target:r[i],moveable:n[i],currentTarget:n[i]}),na({borderRadius:e.borderRadius},t))}))},e);sa(t,"onRoundGroup",o)}));var o=this.dragControlEnd(t,e);if(!o)return!1;var a=On({targets:t.props.targets,events:i.map((function(t,e){var i;return On(On({},t),{target:r[e],moveable:n[e],currentTarget:n[e],lastEvent:null===(i=t.datas)||void 0===i?void 0:i.lastEvent})}))},o);return sa(t,"onRoundGroupEnd",a),a},unset:function(t){t.state.borderRadiusState=""}};var Es={isPinch:!0,name:"beforeRenderable",props:[],events:["beforeRenderStart","beforeRender","beforeRenderEnd","beforeRenderGroupStart","beforeRenderGroup","beforeRenderGroupEnd"],dragRelation:"weak",setTransform:function(t,e){var n=t.state,r=n.is3d,i=n.targetMatrix,o=n.inlineTransform,a=r?"matrix3d(".concat(i.join(","),")"):"matrix(".concat(Ee(i,!0),")"),s=o&&"none"!==o?o:a;e.datas.startTransforms=function(t,e){var n=Te(e?4:3);return t==="matrix".concat(e?"3d":"","(").concat(n.join(","),")")||"matrix(1,0,0,1,0,0)"===t}(s,r)?[]:M(s)},resetStyle:function(t){var e=t.datas;e.nextStyle={},e.nextTransforms=t.datas.startTransforms,e.nextTransformAppendedIndexes=[]},fillDragStartParams:function(t,e){return ia(t,e,{setTransform:function(t){e.datas.startTransforms=y(t)?t:M(t)},isPinch:!!e.isPinch})},fillDragParams:function(t,e){return ia(t,e,{isPinch:!!e.isPinch})},dragStart:function(t,e){this.setTransform(t,e),this.resetStyle(e),sa(t,"onBeforeRenderStart",this.fillDragStartParams(t,e))},drag:function(t,e){e.datas.startTransforms||this.setTransform(t,e),this.resetStyle(e),sa(t,"onBeforeRender",ia(t,e,{isPinch:!!e.isPinch}))},dragEnd:function(t,e){e.datas.startTransforms||(this.setTransform(t,e),this.resetStyle(e)),sa(t,"onBeforeRenderEnd",ia(t,e,{isPinch:!!e.isPinch,isDrag:e.isDrag}))},dragGroupStart:function(t,e){var n=this;this.dragStart(t,e);var r=Xr(t,"beforeRenderable",e),i=t.moveables,o=r.map((function(t,e){var r=i[e];return n.setTransform(r,t),n.resetStyle(t),n.fillDragStartParams(r,t)}));sa(t,"onBeforeRenderGroupStart",ia(t,e,{isPinch:!!e.isPinch,targets:t.props.targets,setTransform:function(){},events:o}))},dragGroup:function(t,e){var n=this;this.drag(t,e);var r=Xr(t,"beforeRenderable",e),i=t.moveables,o=r.map((function(t,e){var r=i[e];return n.resetStyle(t),n.fillDragParams(r,t)}));sa(t,"onBeforeRenderGroup",ia(t,e,{isPinch:!!e.isPinch,targets:t.props.targets,events:o}))},dragGroupEnd:function(t,e){this.dragEnd(t,e),sa(t,"onBeforeRenderGroupEnd",ia(t,e,{isPinch:!!e.isPinch,isDrag:e.isDrag,targets:t.props.targets}))},dragControlStart:function(t,e){return this.dragStart(t,e)},dragControl:function(t,e){return this.drag(t,e)},dragControlEnd:function(t,e){return this.dragEnd(t,e)},dragGroupControlStart:function(t,e){return this.dragGroupStart(t,e)},dragGroupControl:function(t,e){return this.dragGroup(t,e)},dragGroupControlEnd:function(t,e){return this.dragGroupEnd(t,e)}},Ss={name:"renderable",props:[],events:["renderStart","render","renderEnd","renderGroupStart","renderGroup","renderGroupEnd"],dragRelation:"weak",dragStart:function(t,e){sa(t,"onRenderStart",ia(t,e,{isPinch:!!e.isPinch}))},drag:function(t,e){sa(t,"onRender",this.fillDragParams(t,e))},dragAfter:function(t,e){return this.drag(t,e)},dragEnd:function(t,e){sa(t,"onRenderEnd",this.fillDragEndParams(t,e))},dragGroupStart:function(t,e){sa(t,"onRenderGroupStart",ia(t,e,{isPinch:!!e.isPinch,targets:t.props.targets}))},dragGroup:function(t,e){var n=this,r=Xr(t,"beforeRenderable",e),i=t.moveables,o=r.map((function(t,e){var r=i[e];return n.fillDragParams(r,t)}));sa(t,"onRenderGroup",ia(t,e,On(On({isPinch:!!e.isPinch,targets:t.props.targets,transform:Or(e),transformObject:{}},na(Rr(e))),{events:o})))},dragGroupEnd:function(t,e){var n=this,r=Xr(t,"beforeRenderable",e),i=t.moveables,o=r.map((function(t,e){var r=i[e];return n.fillDragEndParams(r,t)}));sa(t,"onRenderGroupEnd",ia(t,e,On({isPinch:!!e.isPinch,isDrag:e.isDrag,targets:t.props.targets,events:o,transformObject:{},transform:Or(e)},na(Rr(e)))))},dragControlStart:function(t,e){return this.dragStart(t,e)},dragControl:function(t,e){return this.drag(t,e)},dragControlAfter:function(t,e){return this.dragAfter(t,e)},dragControlEnd:function(t,e){return this.dragEnd(t,e)},dragGroupControlStart:function(t,e){return this.dragGroupStart(t,e)},dragGroupControl:function(t,e){return this.dragGroup(t,e)},dragGroupControlEnd:function(t,e){return this.dragGroupEnd(t,e)},fillDragParams:function(t,e){var n={};return Fe(Mr(e)||[]).forEach((function(t){n[t.name]=t.functionValue})),ia(t,e,On({isPinch:!!e.isPinch,transformObject:n,transform:Or(e)},na(Rr(e))))},fillDragEndParams:function(t,e){var n={};return Fe(Mr(e)||[]).forEach((function(t){n[t.name]=t.functionValue})),ia(t,e,On({isPinch:!!e.isPinch,isDrag:e.isDrag,transformObject:n,transform:Or(e)},na(Rr(e))))}};function Ds(t,e,n,r,i,o,a){o.clientDistX=o.distX,o.clientDistY=o.distY;var s="Start"===i,u="End"===i,c="After"===i,l=t.state.target,f=o.isRequest,p=r.indexOf("Control")>-1;if(!l||s&&p&&!f&&t.areaElement===o.inputEvent.target)return!1;var d=Pn([],Rn(e),!1);if(f){var h=o.requestAble;d.some((function(t){return t.name===h}))||d.push.apply(d,Pn([],Rn(t.props.ables.filter((function(t){return t.name===h}))),!1))}if(!d.length||d.every((function(t){return t.dragRelation})))return!1;var v,g=o.inputEvent;u&&g&&(v=document.elementFromPoint(o.clientX,o.clientY)||g.target);var m=!1,b=function(){var t;m=!0,null===(t=o.stop)||void 0===t||t.call(o)},x=s&&(!t.targetGesto||!t.controlGesto||!t.targetGesto.isFlag()||!t.controlGesto.isFlag());x&&t.updateRect(i,!0,!1);var y=o.datas,E=p?"controlGesto":"targetGesto",S=t[E],D=function(e,n,r){if(!(n in e)||S!==t[E])return!1;var i=e.name,a=y[i]||(y[i]={});if(s&&(a.isEventStart=!r||!e[r]||e[r](t,o)),!a.isEventStart)return!1;var u=e[n](t,On(On({},o),{stop:b,datas:a,originalDatas:y,inputTarget:v}));return t._emitter.off(),s&&!1===u&&(a.isEventStart=!1),u};x&&d.forEach((function(e){e.unset&&e.unset(t)})),D(Es,"drag".concat(r).concat(i));var C=0,w=0;n.forEach((function(e){if(m)return!1;var n="".concat(e).concat(r).concat(i),a="".concat(e).concat(r,"Condition");""!==i||f||va(t.state,o);var u=d.filter((function(t){return t[n]})),c=(u=u.filter((function(t,e){return t.name&&u.indexOf(t)===e}))).filter((function(t){return D(t,n,a)})).length;m&&++C,c&&++w,!m&&s&&u.length&&!c&&(C+=u.filter((function(t){var e=t.name;return!!y[e].isEventStart&&"strong"!==t.dragRelation})).length?1:0)})),c&&!w||D(Ss,"drag".concat(r).concat(i));var _=S!==t[E]||C===n.length;if((u||m||_)&&(t.state.gestos={},t.moveables&&t.moveables.forEach((function(t){t.state.gestos={}})),d.forEach((function(e){e.unset&&e.unset(t)}))),s&&!_&&!f&&w&&t.props.preventDefault&&(null==o||o.preventDefault()),t.isUnmounted||_)return!1;(!s&&w&&!a||u)&&(t.props.flushSync||So)((function(){t.updateRect(u?i:"",!0,!1),t.forceUpdate()}));return s||u||c||!w||a||Ds(t,e,n,r,i+"After",o),!0}function Cs(t){return function(e){var n,r=e.inputEvent.target,i=t.areaElement,o=t._dragTarget;return!(!o||(null===(n=t.controlGesto)||void 0===n?void 0:n.isFlag()))&&(r===o||o.contains(r)||r===i||!t.isMoveableElement(r)&&!t.controlBox.contains(r)||Z(r,"moveable-area")||Z(r,"moveable-padding")||Z(r,"moveable-edgeDraggable"))}}function ws(t,e,n){var r=t.controlBox,i=[],o=t.props,a=o.dragArea,s=t.state.target,u=o.dragTarget;return i.push(r),a&&!u||i.push(e),!a&&u&&s&&e!==s&&o.dragTargetSelf&&i.push(s),_s(t,i,"targetAbles",n,{dragStart:Cs(t),pinchStart:Cs(t)})}function _s(t,e,n,r,i){void 0===i&&(i={});var o="targetAbles"===n,a=t.props,s=a.pinchOutside,u=a.pinchThreshold,c=a.preventClickEventOnDrag,l=a.preventClickDefault,f=a.checkInput,p=a.dragFocusedInput,d=a.preventDefault,h={preventDefault:void 0===d||d,preventRightClick:!0,preventWheelClick:!0,container:Ea(a.dragContainer,!0)||it(t.getControlBoxElement()),pinchThreshold:u,pinchOutside:s,preventClickEventOnDrag:!!o&&c,preventClickEventOnDragStart:!!o&&l,preventClickEventByCondition:o?null:function(e){return t.controlBox.contains(e.target)},checkInput:!!o&&f,dragFocusedInput:p},v=new yn(e,h),g="Control"===r;return["drag","pinch"].forEach((function(e){["Start","","End"].forEach((function(o){v.on("".concat(e).concat(o),(function(a){var s,u=a.eventType,c="drag"===e&&a.isPinch;if(!i[u]||i[u](a)){if(!c){var l="drag"===e?[e]:["drag",e],f=Pn([],Rn(t[n]),!1);Ds(t,f,l,r,o,a)?(t.props.stopPropagation||"Start"===o&&g)&&(null===(s=null==a?void 0:a.inputEvent)||void 0===s||s.stopPropagation()):a.stop()}}else a.stop()}))}))})),v}var Ms=function(){function t(t,e,n){var r=this;this.target=t,this.moveable=e,this.eventName=n,this.ables=[],this._onEvent=function(t){var e=r.eventName,n=r.moveable;n.state.disableNativeEvent||r.ables.forEach((function(r){r[e](n,{inputEvent:t})}))},t.addEventListener(n.toLowerCase(),this._onEvent)}var e=t.prototype;return e.setAbles=function(t){this.ables=t},e.destroy=function(){this.target.removeEventListener(this.eventName.toLowerCase(),this._onEvent),this.target=null,this.moveable=null},t}();function Os(t,e,n,r){var i;void 0===n&&(n=e);var o=Ar(t,e),a=o.matrixes,s=o.is3d,u=o.targetMatrix,c=o.transformOrigin,l=o.targetOrigin,f=o.offsetContainer,p=o.hasFixed,d=o.zoom,h=function(t,e){if(Nr){var n=k(Nr,(function(n){return n[0][0]==t&&n[0][1]==e}));if(n)return n[1]}var r=Ar(t,e,!0);return Nr&&Nr.push([[t,e],r]),r}(f,n),v=h.matrixes,g=h.is3d,m=h.offsetContainer,b=h.zoom,x=r||g||s,y=x?4:3,E="svg"!==t.tagName.toLowerCase()&&"ownerSVGElement"in t,S=u,D=Te(y),C=Te(y),w=Te(y),_=Te(y),M=a.length,O=v.map((function(t){return On(On({},t),{matrix:t.matrix?Pn([],Rn(t.matrix),!1):void 0})})).reverse();a.reverse(),!s&&x&&(S=ge(S,3,4),To(a)),!g&&x&&To(O),O.forEach((function(t){C=be(C,t.matrix,y)}));var R=n||rt(t),P=(null===(i=O[0])||void 0===i?void 0:i.target)||Oo(R,R,!0).offsetParent,T=O.slice(1).reduce((function(t,e){return be(t,e.matrix,y)}),Te(y));a.forEach((function(t,e){if(M-2===e&&(w=D.slice()),M-1===e&&(_=D.slice()),!t.matrix){var n=function(t,e,n,r,i){var o,a=t.target,s=t.origin,u=e.matrix,c=Ho(a),l=c.offsetWidth,f=c.offsetHeight,p=n.getBoundingClientRect(),d=[0,0];n===rt(n)&&(d=Po(a,!0));for(var h=a.getBoundingClientRect(),v=h.left-p.left+n.scrollLeft-(n.clientLeft||0)+d[0],g=h.top-p.top+n.scrollTop-(n.clientTop||0)+d[1],m=h.width,b=h.height,x=me(r,i,u),y=No(x,l,f,r),E=y.left,S=y.top,D=y.width,C=y.height,w=Ao(x,s,r),_=ye(w,[E,S]),M=[v+_[0]*m/D,g+_[1]*b/C],O=[0,0],R=0;++R<10;){var P=de(i,r);o=Rn(ye(Ao(P,M,r),Ao(P,w,r)),2),O[0]=o[0],O[1]=o[1];var T=No(me(r,i,Ge(O,r),u),l,f,r),z=T.left-v,G=T.top-g;if(Ta(z)<2&&Ta(G)<2)break;M[0]-=z,M[1]-=G}return O.map((function(t){return Math.round(t)}))}(t,a[e+1],P,y,be(T,D,y));t.matrix=Ge(n,y)}D=be(D,t.matrix,y)}));var z=!E&&s;S||(S=Te(z?4:3));var G=Go(E&&16===S.length?ge(S,4,3):S,z),B=C;return C=pe(C,y,y),{hasZoom:1!==d||1!==b,hasFixed:p,matrixes:a,rootMatrix:C,originalRootMatrix:B,beforeMatrix:w,offsetMatrix:_,allMatrix:D,targetMatrix:S,targetTransform:G,inlineTransform:t.style.transform,transformOrigin:c,targetOrigin:l,is3d:x,offsetContainer:f,offsetRootContainer:m}}function Rs(t,e,n,r){void 0===n&&(n=e);var i=0,o=0,a=0,s={},u=Ho(t);if(t&&(i=u.offsetWidth,o=u.offsetHeight),t){var c=Os(t,e,n,r),l=cr(c.allMatrix,c.transformOrigin,i,o);s=On(On({},c),l);var f=cr(c.allMatrix,[50,50],100,100);a=Lo([f.pos1,f.pos2],f.direction)}var p=r?4:3;return On(On(On({hasZoom:!1,width:i,height:o,rotation:a},u),{originalRootMatrix:Te(p),rootMatrix:Te(p),beforeMatrix:Te(p),offsetMatrix:Te(p),allMatrix:Te(p),targetMatrix:Te(p),targetTransform:"",inlineTransform:"",transformOrigin:[0,0],targetOrigin:[0,0],is3d:!!r,left:0,top:0,right:0,bottom:0,origin:[0,0],pos1:[0,0],pos2:[0,0],pos3:[0,0],pos4:[0,0],direction:1,hasFixed:!1,offsetContainer:null,offsetRootContainer:null,matrixes:[]}),s)}function Ps(t,e,n,r,i,o){void 0===o&&(o=[]);var a=1,s=[0,0],u={left:0,top:0,width:0,height:0,right:0,bottom:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},c={left:0,top:0,width:0,height:0,right:0,bottom:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},l={left:0,top:0,width:0,height:0,right:0,bottom:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},f={left:0,top:0,width:0,height:0,right:0,bottom:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},p=[0,0],d={},h=Rs(e,n,i,!0);if(e){var v=Yr(e);o.forEach((function(t){d[t]=v(t)}));var g=h.is3d?4:3,m=cr(h.offsetMatrix,xe(h.transformOrigin,he(h.targetMatrix,g)),h.width,h.height);a=m.direction,s=xe(m.origin,[m.left-h.left,m.top-h.top]),f=$o(h.offsetRootContainer);var b=Oo(r,r,!0).offsetParent||h.offsetRootContainer;if(h.hasZoom){var x=cr(be(h.originalRootMatrix,h.allMatrix),h.transformOrigin,h.width,h.height),y=cr(h.originalRootMatrix,_o(Yr(b)("transformOrigin")).map((function(t){return parseFloat(t)})),b.offsetWidth,b.offsetHeight);if(u=Uo(x,f),l=Uo(y,f,b,!0),t){var E=x.left,S=x.top;c=Uo({left:E,top:S,bottom:S,right:S},f)}}else{u=$o(e),l=function(t){var e=null==Fr?void 0:Fr.get(t);if(e)return e;var n=$o(t,!0);return Fr&&Fr.set(t,n),n}(b),t&&(c=$o(t));var D=l.left,C=l.top,w=l.clientLeft,_=l.clientTop,M=[u.left-D,u.top-C];p=ye(ha(h.rootMatrix,M,4),[w+h.left,_+h.top])}}return On({targetClientRect:u,containerClientRect:l,moveableClientRect:c,rootContainerClientRect:f,beforeDirection:a,beforeOrigin:s,originalBeforeOrigin:s,target:e,style:d,offsetDelta:p},h)}function Ts(t){var e=t.pos1,n=t.pos2,r=t.pos3,i=t.pos4;if(!(e&&n&&r&&i))return null;var o=nn([e,n,r,i]),a=[o.minX,o.minY],s=ye(t.origin,a);return e=ye(e,a),n=ye(n,a),r=ye(r,a),i=ye(i,a),On(On({},t),{left:t.left,top:t.top,posDelta:a,pos1:e,pos2:n,pos3:r,pos4:i,origin:s,beforeOrigin:s,isPersisted:!0})}var zs=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=On({container:null,gestos:{},renderLines:[[[0,0],[0,0]],[[0,0],[0,0]],[[0,0],[0,0]],[[0,0],[0,0]]],renderPoses:[[0,0],[0,0],[0,0],[0,0]],disableNativeEvent:!1,posDelta:[0,0]},Ps(null)),e.renderState={},e.enabledAbles=[],e.targetAbles=[],e.controlAbles=[],e.rotation=0,e.scale=[1,1],e.isMoveableMounted=!1,e.isUnmounted=!1,e.events={mouseEnter:null,mouseLeave:null},e._emitter=new He,e._prevOriginalDragTarget=null,e._originalDragTarget=null,e._prevDragTarget=null,e._dragTarget=null,e._prevPropTarget=null,e._propTarget=null,e._prevDragArea=!1,e._isPropTargetChanged=!1,e._hasFirstTarget=!1,e._reiszeObserver=null,e._observerId=0,e._mutationObserver=null,e._rootContainer=null,e._viewContainer=null,e._viewClassNames=[],e._store={},e.checkUpdateRect=function(){if(!e.isDragging()){var t=e.props.parentMoveable;t?t.checkUpdateRect():(A(e._observerId),e._observerId=B((function(){e.isDragging()||e.updateRect()})))}},e._onPreventClick=function(t){t.stopPropagation(),t.preventDefault()},e}Mn(e,t);var n=e.prototype;return n.render=function(){var t=this.props,e=this.getState(),n=t.parentPosition,r=t.className,o=t.target,a=t.zoom,s=t.cspNonce,u=t.translateZ,c=t.cssStyled,l=t.groupable,f=t.linePadding,p=t.controlPadding;this._checkUpdateRootContainer(),this.checkUpdate(),this.updateRenderPoses();var d=Rn(n||[0,0],2),h=d[0],v=d[1],g=e.left,m=e.top,b=e.target,x=e.direction,y=e.hasFixed,E=e.offsetDelta,S=t.targets,D=this.isDragging(),C={};this.getEnabledAbles().forEach((function(t){C["data-able-".concat(t.name.toLowerCase())]=!0}));var w=this._getAbleClassName(),_=S&&S.length&&(b||l)||o||!this._hasFirstTarget&&this.state.isPersisted,M=this.controlBox||this.props.firstRenderState||this.props.persistData,O=[g-h,m-v];!l&&t.useAccuratePosition&&(O[0]+=E[0],O[1]+=E[1]);var R={position:y?"fixed":"absolute",display:_?"block":"none",visibility:M?"visible":"hidden",transform:"translate3d(".concat(O[0],"px, ").concat(O[1],"px, ").concat(u,")"),"--zoom":a,"--zoompx":"".concat(a,"px")};return f&&(R["--moveable-line-padding"]=f),p&&(R["--moveable-control-padding"]=p),qt(c,On({cspNonce:s,ref:i(this,"controlBox"),className:"".concat(Eo("control-box",-1===x?"reverse":"",D?"dragging":"")," ").concat(w," ").concat(r)},C,{onClick:this._onPreventClick,style:R}),this.renderAbles(),this._renderLines())},n.componentDidMount=function(){this.isMoveableMounted=!0,this.isUnmounted=!1;var t=this.props,e=t.parentMoveable,n=t.container;this._checkUpdateRootContainer(),this._checkUpdateViewContainer(),this._updateTargets(),this._updateNativeEvents(),this._updateEvents(),this.updateCheckInput(),this._updateObserver(this.props),n||e||this.state.isPersisted||(this.updateRect("",!1,!1),this.forceUpdate())},n.componentDidUpdate=function(t){this._checkUpdateRootContainer(),this._checkUpdateViewContainer(),this._updateNativeEvents(),this._updateTargets(),this._updateEvents(),this.updateCheckInput(),this._updateObserver(t)},n.componentWillUnmount=function(){var t,e;this.isMoveableMounted=!1,this.isUnmounted=!0,this._emitter.off(),null===(t=this._reiszeObserver)||void 0===t||t.disconnect(),null===(e=this._mutationObserver)||void 0===e||e.disconnect(),this._viewContainer&&this._changeAbleViewClassNames([]),ea(this,!1),ea(this,!0);var n=this.events;for(var r in n){var i=n[r];i&&i.destroy()}},n.getTargets=function(){var t=this.props.target;return t?[t]:[]},n.getAble=function(t){return k(this.props.ables||[],(function(e){return e.name===t}))},n.getContainer=function(){var t=this.props,e=t.parentMoveable,n=t.wrapperMoveable;return t.container||n&&n.getContainer()||e&&e.getContainer()||this.controlBox.parentElement},n.getControlBoxElement=function(){return this.controlBox},n.getDragElement=function(){return this._dragTarget},n.isMoveableElement=function(t){var e;return t&&((null===(e=t.getAttribute)||void 0===e?void 0:e.call(t,"class"))||"").indexOf(Un)>-1},n.dragStart=function(t){var e=this.targetGesto,n=this.controlGesto;return e&&Cs(this)({inputEvent:t})?e.isFlag()||e.triggerDragStart(t):n&&this.isMoveableElement(t.target)&&(n.isFlag()||n.triggerDragStart(t)),this},n.hitTest=function(t){var e,n=this.state,r=n.target,i=n.pos1,o=n.pos2,a=n.pos3,s=n.pos4,u=n.targetClientRect;if(!r)return 0;if(ot(t)){var c=t.getBoundingClientRect();e={left:c.left,top:c.top,width:c.width,height:c.height}}else e=On({width:0,height:0},t);var l=e.left,f=e.top,p=e.width,d=e.height,h=en([i,o,s,a],u),v=tn(cn(h,[[l,f],[l+p,f],[l+p,f+d],[l,f+d]])),g=tn(h);return v&&g?Math.min(100,v/g*100):0},n.isInside=function(t,e){var n=this.state,r=n.target,i=n.pos1,o=n.pos2,a=n.pos3,s=n.pos4,u=n.targetClientRect;return!!r&&rn([t,e],en([i,o,s,a],u))},n.updateRect=function(t,e,n){void 0===n&&(n=!0);var r=this.props,i=!r.parentPosition&&!r.wrapperMoveable;i&&qr(!0);var o=r.parentMoveable,a=this.state.target||r.target,s=this.getContainer(),u=o?o._rootContainer:this._rootContainer,c=Ps(this.controlBox,a,s,s,u||s,this._getRequestStyles());if(!a&&this._hasFirstTarget&&r.persistData){var l=Ts(r.persistData);for(var f in l)c[f]=l[f]}i&&qr(),this.updateState(c,!o&&n)},n.isDragging=function(t){var e,n,r=this.targetGesto,i=this.controlGesto;return(null==r?void 0:r.isFlag())?!t||!!(null===(e=r.getEventData()[t])||void 0===e?void 0:e.isEventStart):!!(null==i?void 0:i.isFlag())&&(!t||!!(null===(n=i.getEventData()[t])||void 0===n?void 0:n.isEventStart))},n.updateTarget=function(t){this.updateRect(t,!0)},n.getRect=function(){var t=this.state,e=Qo(this.state),n=Rn(e,4),r=n[0],i=n[1],o=n[2],a=n[3],s=Fo(e),u=t.width,c=t.height,l=s.width,f=s.height,p=s.left,d=s.top,h=[t.left,t.top],v=xe(h,t.origin);return{width:l,height:f,left:p,top:d,pos1:r,pos2:i,pos3:o,pos4:a,offsetWidth:u,offsetHeight:c,beforeOrigin:xe(h,t.beforeOrigin),origin:v,transformOrigin:t.transformOrigin,rotation:this.getRotation()}},n.getManager=function(){return this},n.stopDrag=function(t){var e;t&&"target"!==t||(!1===(null==(e=this.targetGesto)?void 0:e.isIdle())&&ta(this,!1),null==e||e.stop());t&&"control"!==t||(!1===(null==(e=this.controlGesto)?void 0:e.isIdle())&&ta(this,!0),null==e||e.stop())},n.getRotation=function(){var t=this.state;return function(t,e,n){var r=W(t,e)/Math.PI*180;return(r=n>=0?r:180-r)>=0?r:360+r}(t.pos1,t.pos2,t.direction)},n.request=function(t,e,n){void 0===e&&(e={});var r=this,i=r.props,o=i.parentMoveable||i.wrapperMoveable||r,a=o.props.ables,s=i.groupable,u=k(a,(function(e){return e.name===t}));if(this.isDragging()||!u||!u.request)return{request:function(){return this},requestEnd:function(){return this}};var c=u.request(r),l=n||e.isInstant,f=c.isControl?"controlAbles":"targetAbles",p="".concat(s?"Group":"").concat(c.isControl?"Control":""),d=Pn([],Rn(o[f]),!1),h={request:function(e){return Ds(r,d,["drag"],p,"",On(On({},c.request(e)),{requestAble:t,isRequest:!0}),l),h},requestEnd:function(){return Ds(r,d,["drag"],p,"End",On(On({},c.requestEnd()),{requestAble:t,isRequest:!0}),l),h}};return Ds(r,d,["drag"],p,"Start",On(On({},c.requestStart(e)),{requestAble:t,isRequest:!0}),l),l?h.request(e).requestEnd():h},n.getMoveables=function(){return[this]},n.destroy=function(){this.componentWillUnmount()},n.updateRenderPoses=function(){var t=this.getState(),e=this.props,n=e.padding,r=t.originalBeforeOrigin,i=t.transformOrigin,o=t.allMatrix,a=t.is3d,s=t.pos1,u=t.pos2,c=t.pos3,l=t.pos4,f=t.left,p=t.top,d=t.isPersisted,h=e.zoom||1;if(!n&&h<=1)return t.renderPoses=[s,u,c,l],void(t.renderLines=[[s,u],[u,l],[l,c],[c,s]]);var v=Ga(n||{}),g=v.left,m=v.top,b=v.bottom,x=v.right,y=a?4:3,E=me(y,Ge((d?i:this.controlBox&&e.groupable?r:xe(r,[f,p])).map((function(t){return-t})),y),o,Ge(i,y)),S=ga(E,s,[-g,-m],y),D=ga(E,u,[x,-m],y),C=ga(E,c,[-g,b],y),w=ga(E,l,[x,b],y);if(t.renderPoses=[S,D,C,w],t.renderLines=[[S,D],[D,w],[w,C],[C,S]],h){var _=h/2;t.renderLines=[[ga(E,s,[-g-_,-m],y),ga(E,u,[x+_,-m],y)],[ga(E,u,[x,-m-_],y),ga(E,l,[x,b+_],y)],[ga(E,l,[x+_,b],y),ga(E,c,[-g-_,b],y)],[ga(E,c,[-g,b+_],y),ga(E,s,[-g,-m-_],y)]]}},n.checkUpdate=function(){this._isPropTargetChanged=!1;var t=this.props,e=t.target,n=t.container,r=t.parentMoveable,i=this.state,o=i.target,a=i.container;if(o||e){this.updateAbles();var s=!la(o,e);if(s||!la(a,n)){var u=n||this.controlBox;u&&this.unsetAbles(),this.updateState({target:e,container:n}),!r&&u&&this.updateRect("End",!1,!1),this._isPropTargetChanged=s}}},n.waitToChangeTarget=function(){return new Promise((function(){}))},n.triggerEvent=function(t,e){var n=this.props;if(this._emitter.trigger(t,e),n.parentMoveable&&e.isRequest&&!e.isRequestChild)return n.parentMoveable.triggerEvent(t,e,!0);var r=n[t];return r&&r(e)},n.useCSS=function(t,e){var n=this.props.customStyledMap,r=t+e;return n[r]||(n[r]=wn(t,e)),n[r]},n.getState=function(){var t,e=this.props;(e.target||(null===(t=e.targets)||void 0===t?void 0:t.length))&&(this._hasFirstTarget=!0);var n=this.controlBox,r=e.persistData,i=e.firstRenderState;if(i&&!n)return i;if(!this._hasFirstTarget&&r){var o=Ts(r);if(o)return this.updateState(o,!1),this.state}return this.state.isPersisted=!1,this.state},n.updateSelectors=function(){},n.unsetAbles=function(){var t=this;this.targetAbles.forEach((function(e){e.unset&&e.unset(t)}))},n.updateAbles=function(t,e){void 0===t&&(t=this.props.ables),void 0===e&&(e="");var n=this.props.triggerAblesSimultaneously,r=this.getEnabledAbles(t),i="drag".concat(e,"Start"),o="pinch".concat(e,"Start"),a="drag".concat(e,"ControlStart"),s=ca(r,[i,o],n),u=ca(r,[a],n);this.enabledAbles=r,this.targetAbles=s,this.controlAbles=u},n.updateState=function(t,e){if(e){if(this.isUnmounted)return;this.setState(t)}else{var n=this.state;for(var r in t)n[r]=t[r]}},n.getEnabledAbles=function(t){void 0===t&&(t=this.props.ables);var e=this.props;return t.filter((function(t){return t&&(t.always&&!1!==e[t.name]||e[t.name])}))},n.renderAbles=function(){var t,e,n,r,i=this,o=this.props.triggerAblesSimultaneously,a={createElement:qt};return this.renderState={},(t=pa(ca(this.getEnabledAbles(),["render"],o).map((function(t){return(0,t.render)(i,a)||[]}))).filter((function(t){return t})),e=function(t){return t.key},n=[],r={},t.forEach((function(i,o){var a=e(i,o,t),s=r[a];s||(s=[],r[a]=s,n.push(s)),s.push(i)})),n).map((function(t){return t[0]}))},n.updateCheckInput=function(){this.targetGesto&&(this.targetGesto.options.checkInput=this.props.checkInput)},n._getRequestStyles=function(){return this.getEnabledAbles().reduce((function(t,e){var n,r,i=null!==(r=null===(n=e.requestStyle)||void 0===n?void 0:n.call(e))&&void 0!==r?r:[];return Pn(Pn([],Rn(t),!1),Rn(i),!1)}),Pn([],Rn(this.props.requestStyles||[]),!1))},n._updateObserver=function(t){this._updateResizeObserver(t),this._updateMutationObserver(t)},n._updateEvents=function(){var t=this.controlBox,e=this.targetAbles.length,n=this.controlAbles.length,r=this._dragTarget;(!e&&this.targetGesto||this._isTargetChanged(!0))&&(ea(this,!1),this.updateState({gestos:{}})),n||ea(this,!0),r&&e&&!this.targetGesto&&(this.targetGesto=ws(this,r,"")),!this.controlGesto&&n&&(this.controlGesto=_s(this,t,"controlAbles","Control"))},n._updateTargets=function(){var t=this.props;this._prevPropTarget=this._propTarget,this._prevDragTarget=this._dragTarget,this._prevOriginalDragTarget=this._originalDragTarget,this._prevDragArea=t.dragArea,this._propTarget=t.target,this._originalDragTarget=t.dragTarget||t.target,this._dragTarget=Ea(this._originalDragTarget,!0)},n._renderLines=function(){var t=this.props,e=t.zoom,n=t.hideDefaultLines,r=t.hideChildMoveableDefaultLines,i=t.parentMoveable;if(n||i&&r)return[];var o=this.getState(),a={createElement:qt};return o.renderLines.map((function(t,n){return Ur(a,"",t[0],t[1],e,"render-line-".concat(n))}))},n._isTargetChanged=function(t){var e=this.props,n=e.dragTarget||e.target,r=this._prevOriginalDragTarget,i=this._prevDragArea,o=e.dragArea;return!o&&r!==n||(t||o)&&i!==o||this._prevPropTarget!=this._propTarget},n._updateNativeEvents=function(){var t=this,e=this.props.dragArea?this.areaElement:this.state.target,n=this.events,r=I(n);if(this._isTargetChanged())for(var i in n){var o=n[i];o&&o.destroy(),n[i]=null}if(e){var a=this.enabledAbles;r.forEach((function(r){var i=ca(a,[r]),o=i.length>0,s=n[r];o?(s||(s=new Ms(e,t,r),n[r]=s),s.setAbles(i)):s&&(s.destroy(),n[r]=null)}))}},n._checkUpdateRootContainer=function(){var t=this.props.rootContainer;!this._rootContainer&&t&&(this._rootContainer=Ea(t,!0))},n._checkUpdateViewContainer=function(){var t=this.props.viewContainer;!this._viewContainer&&t&&(this._viewContainer=Ea(t,!0)),this._viewContainer&&this._changeAbleViewClassNames(Pn(Pn([],Rn(this._getAbleViewClassNames()),!1),[this.isDragging()?Wa:""],!1))},n._changeAbleViewClassNames=function(t){var e=this._viewContainer,n=fa(t.filter(Boolean),(function(t){return t})).map((function(t){return Rn(t,1)[0]})),r=this._viewClassNames,i=ft(r,n),o=i.removed,a=i.added;o.forEach((function(t){J(e,r[t])})),a.forEach((function(t){K(e,n[t])})),this._viewClassNames=n},n._getAbleViewClassNames=function(){var t=this;return(this.getEnabledAbles().map((function(e){var n;return(null===(n=e.viewClassName)||void 0===n?void 0:n.call(e,t))||""})).join(" ")+" ".concat(this._getAbleClassName("-view"))).split(/\s+/g)},n._getAbleClassName=function(t){var e=this;void 0===t&&(t="");var n=this.getEnabledAbles(),r=this.targetGesto,i=this.controlGesto,o=(null==r?void 0:r.isFlag())?r.getEventData():{},a=(null==i?void 0:i.isFlag())?i.getEventData():{};return n.map((function(n){var r,i,s,u=n.name,c=(null===(r=n.className)||void 0===r?void 0:r.call(n,e))||"";return((null===(i=o[u])||void 0===i?void 0:i.isEventStart)||(null===(s=a[u])||void 0===s?void 0:s.isEventStart))&&(c+=" ".concat(Eo("".concat(u).concat(t,"-dragging")))),c.trim()})).filter(Boolean).join(" ")},n._updateResizeObserver=function(t){var e,n=this.props,r=n.target,i=it(this.getControlBoxElement());if(i.ResizeObserver&&r&&n.useResizeObserver){if(t.target!==r||!this._reiszeObserver){var o=new i.ResizeObserver(this.checkUpdateRect);o.observe(r,{box:"border-box"}),this._reiszeObserver=o}}else null===(e=this._reiszeObserver)||void 0===e||e.disconnect()},n._updateMutationObserver=function(t){var e,n=this,r=this.props,i=r.target,o=it(this.getControlBoxElement());if(o.MutationObserver&&i&&r.useMutationObserver){if(t.target!==i||!this._mutationObserver){var a=new o.MutationObserver((function(t){var e,r;try{for(var i=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),o=i.next();!o.done;o=i.next()){var a=o.value;"attributes"===a.type&&"style"===a.attributeName&&n.checkUpdateRect()}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}}));a.observe(i,{attributes:!0}),this._mutationObserver=a}}else null===(e=this._mutationObserver)||void 0===e||e.disconnect()},e.defaultProps={dragTargetSelf:!1,target:null,dragTarget:null,container:null,rootContainer:null,origin:!0,parentMoveable:null,wrapperMoveable:null,isWrapperMounted:!1,parentPosition:null,warpSelf:!1,svgOrigin:"",dragContainer:null,useResizeObserver:!1,useMutationObserver:!1,preventDefault:!0,linePadding:0,controlPadding:0,ables:[],pinchThreshold:20,dragArea:!1,passDragArea:!1,transformOrigin:"",className:"",zoom:1,triggerAblesSimultaneously:!1,padding:{},pinchOutside:!0,checkInput:!1,dragFocusedInput:!1,groupable:!1,hideDefaultLines:!1,cspNonce:"",translateZ:0,cssStyled:null,customStyledMap:{},props:{},stopPropagation:!1,preventClickDefault:!1,preventClickEventOnDrag:!0,flushSync:So,firstRenderState:null,persistData:null,viewContainer:null,requestStyles:[],useAccuratePosition:!1},e}(Gt),Gs={name:"groupable",props:["defaultGroupRotate","useDefaultGroupRotate","defaultGroupOrigin","groupable","groupableProps","targetGroups","hideChildMoveableDefaultLines"],events:[],render:function(t,e){var n,r=t.props,i=r.targets||[],a=t.getState(),s=a.left,u=a.top,c=a.isPersisted,l=r.zoom||1,f=t.renderGroupRects,p=(null===(n=r.persistData)||void 0===n?void 0:n.children)||[];c?i=p.map((function(){return null})):p=[];var d=Ra(t,"parentPosition",[s,u],(function(t){return t.join(",")})),h=Ra(t,"requestStyles",t.getRequestChildStyles(),(function(t){return t.join(",")}));return t.moveables=t.moveables.slice(0,i.length),Pn(Pn([],Rn(i.map((function(n,i){return e.createElement(zs,{key:"moveable"+i,ref:o(t,"moveables",i),target:n,origin:!1,requestStyles:h,cssStyled:r.cssStyled,customStyledMap:r.customStyledMap,useResizeObserver:r.useResizeObserver,useMutationObserver:r.useMutationObserver,hideChildMoveableDefaultLines:r.hideChildMoveableDefaultLines,parentMoveable:t,parentPosition:[s,u],persistData:p[i],zoom:l})}))),!1),Rn(pa(f.map((function(t,n){var r=[t.pos1,t.pos2,t.pos3,t.pos4];return[[0,1],[1,3],[3,2],[2,0]].map((function(t,i){var o=Rn(t,2),a=o[0],s=o[1];return Ur(e,"",ye(r[a],d),ye(r[s],d),l,"group-rect-".concat(n,"-").concat(i))}))})))),!1)}},ks=Tn("clickable",{props:["clickable"],events:["click","clickGroup"],always:!0,dragRelation:"weak",dragStart:function(){},dragControlStart:function(){},dragGroupStart:function(t,e){e.datas.inputTarget=e.inputEvent&&e.inputEvent.target},dragEnd:function(t,e){var n=t.props.target,r=e.inputEvent,i=e.inputTarget,o=!t.isMoveableElement(i)&&t.controlBox.contains(i);if(r&&i&&!e.isDrag&&!t.isMoveableElement(i)&&!o){var a=n.contains(i);sa(t,"onClick",ia(t,e,{isDouble:e.isDouble,inputTarget:i,isTarget:n===i,moveableTarget:t.props.target,containsTarget:a}))}},dragGroupEnd:function(t,e){var n=e.inputEvent,r=e.inputTarget;if(n&&r&&!e.isDrag&&!t.isMoveableElement(r)&&e.datas.inputTarget!==r){var i=t.props.targets,o=i.indexOf(r),a=o>-1,s=!1;-1===o&&(s=(o=G(i,(function(t){return t.contains(r)})))>-1),sa(t,"onClickGroup",ia(t,e,{isDouble:e.isDouble,targets:i,inputTarget:r,targetIndex:o,isTarget:a,containsTarget:s,moveableTarget:i[o]}))}},dragControlEnd:function(t,e){this.dragEnd(t,e)},dragGroupControlEnd:function(t,e){this.dragEnd(t,e)}});function Bs(t){var e=t.originalDatas.draggable;return e||(t.originalDatas.draggable={},e=t.originalDatas.draggable),On(On({},t),{datas:e})}var As=Tn("edgeDraggable",{css:[".edge.edgeDraggable.line {\ncursor: move;\n}"],render:function(t,e){var n=t.props,r=n.edgeDraggable;return r?$r(e,"edgeDraggable",r,t.getState().renderPoses,n.zoom):[]},dragCondition:function(t,e){var n,r=t.props,i=null===(n=e.inputEvent)||void 0===n?void 0:n.target;return!(!r.edgeDraggable||!i)&&(!r.draggable&&Z(i,Eo("direction"))&&Z(i,Eo("edge"))&&Z(i,Eo("edgeDraggable")))},dragStart:function(t,e){return Fi.dragStart(t,Bs(e))},drag:function(t,e){return Fi.drag(t,Bs(e))},dragEnd:function(t,e){return Fi.dragEnd(t,Bs(e))},dragGroupCondition:function(t,e){var n,r=t.props,i=null===(n=e.inputEvent)||void 0===n?void 0:n.target;return!(!r.edgeDraggable||!i)&&(!r.draggable&&Z(i,Eo("direction"))&&Z(i,Eo("line")))},dragGroupStart:function(t,e){return Fi.dragGroupStart(t,Bs(e))},dragGroup:function(t,e){return Fi.dragGroup(t,Bs(e))},dragGroupEnd:function(t,e){return Fi.dragGroupEnd(t,Bs(e))},unset:function(t){return Fi.unset(t)}}),Is={name:"individualGroupable",props:["individualGroupable","individualGroupableProps"],events:[]},Fs=[Es,Za,yo,ka,Fi,As,Xi,Aa,Na,$i,$a,Ka,Va,gs,vs,ys,Gs,Is,ks,La,Ss],Ns=Fs.reduce((function(t,e){return(e.events||[]).forEach((function(e){$(t,e)})),t}),[]),qs=Fs.reduce((function(t,e){return(e.props||[]).forEach((function(e){$(t,e)})),t}),[]);function Ys(t,e){var n=Rn(t,3),r=n[0],i=n[1],o=n[2];return(r*e[0]+i*e[1]+o)/Math.sqrt(r*r+i*i)}function Xs(t,e){var n=Rn(t,2),r=n[0],i=n[1];return-r*e[0]-i*e[1]}function Ws(t,e){return Math.max.apply(Math,Pn([],Rn(t.map((function(t){var n=Rn(t,4),r=n[0],i=n[1],o=n[2],a=n[3];return Math.max(r[e],i[e],o[e],a[e])}))),!1))}function js(t,e){return Math.min.apply(Math,Pn([],Rn(t.map((function(t){var n=Rn(t,4),r=n[0],i=n[1],o=n[2],a=n[3];return Math.min(r[e],i[e],o[e],a[e])}))),!1))}function Hs(t,e){var n=e.map((function(e){if(y(e)){var n=Hs(t,e),r=n.length;return r>1?n:1===r?n[0]:null}var i=k(t,(function(t){return t.manager.props.target===e}));return i?(i.finded=!0,i.manager):null})).filter(Boolean);return 1===n.length&&y(n[0])?n[0]:n}var Ls=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.differ=new Xe,e.moveables=[],e.transformOrigin="50% 50%",e.renderGroupRects=[],e._targetGroups=[],e._hasFirstTargets=!1,e}Mn(e,t);var n=e.prototype;return n.componentDidMount=function(){t.prototype.componentDidMount.call(this)},n.checkUpdate=function(){this._isPropTargetChanged=!1,this.updateAbles()},n.getTargets=function(){return this.props.targets},n.updateRect=function(t,e,n){var r;void 0===n&&(n=!0);var i=this.state;if(this.controlBox&&!i.isPersisted){qr(!0),this.moveables.forEach((function(e){e.updateRect(t,!1,!1)}));var o=this.props,a=this.moveables,s=i.target||o.target,u=a.map((function(t){return{finded:!1,manager:t}})),c=this.props.targetGroups||[],l=Hs(u,c),f=o.useDefaultGroupRotate;l.push.apply(l,Pn([],Rn(u.filter((function(t){return!t.finded})).map((function(t){return t.manager}))),!1));var p=[],d=!e||""!==t&&o.updateGroup,h=o.defaultGroupRotate||0;if(!this._hasFirstTargets){var v=null===(r=o.persistData)||void 0===r?void 0:r.rotation;null!=v&&(h=v)}var g=function t(e,n,r){var i=e.map((function(e){if(y(e)){var r=t(e,n),i=[r.pos1,r.pos2,r.pos3,r.pos4];return p.push(r),{poses:i,rotation:r.rotation}}return{poses:Qo(e.state),rotation:e.getRotation()}})),o=i.map((function(t){return t.rotation})),a=0,s=o[0],u=o.every((function(t){return Math.abs(s-t)<.1}));a=d?!f&&u?s:h:f||r||!u?n:s;var c=i.map((function(t){return t.poses})),l=function(t,e){var n,r,i,o=[0,0],a=[0,0],s=[0,0],u=[0,0],c=0,l=0;if(!t.length)return{pos1:o,pos2:a,pos3:s,pos4:u,minX:0,minY:0,maxX:0,maxY:0,width:c,height:l,rotation:e};var f=L(e,Qn);if(f%90){var p=f/180*Math.PI,d=Math.tan(p),h=-1/d,v=[er,nr],g=[[0,0],[0,0]],m=[er,nr],b=[[0,0],[0,0]];t.forEach((function(t){t.forEach((function(t){var e=Ys([-d,1,0],t),n=Ys([-h,1,0],t);v[0]>e&&(g[0]=t,v[0]=e),v[1]n&&(b[0]=t,m[0]=n),m[1]180&&(o=(i=Rn([u,s,a,o],4))[0],a=i[1],s=i[2],u=i[3]);var G=nn([o,a,s,u]);return{pos1:o,pos2:a,pos3:s,pos4:u,width:c,height:l,minX:G.minX,minY:G.minY,maxX:G.maxX,maxY:G.maxY,rotation:e}}(c,a);return l}(l,this.rotation,!0);d&&(this.rotation=g.rotation,this.transformOrigin=o.defaultGroupOrigin||"50% 50%",this.scale=[1,1]),this._targetGroups=c,this.renderGroupRects=p;var m,b,x,E,S,D=this.transformOrigin,C=this.rotation,w=this.scale,_=g.width,M=g.height,O=g.minX,R=g.minY,P=(m=[[0,0],[_,0],[0,M],[_,M]],b=Ma(D,_,M),x=this.rotation/180*Math.PI,E=m.map((function(t){return ye(t,b)})),S=E.map((function(t){return Me(t,x)})),{prev:E,next:S,result:S.map((function(t){return xe(t,b)}))}),T=nn(P.result),z=T.minX,G=T.minY,k=" rotate(".concat(C,"deg)")+" scale(".concat(Pa(w[0]),", ").concat(Pa(w[1]),")"),B="translate(".concat(-z,"px, ").concat(-G,"px)").concat(k);this.controlBox.style.transform="translate3d(".concat(O,"px, ").concat(R,"px, ").concat(this.props.translateZ||0,")"),s.style.cssText+="left:0px;top:0px;"+"transform-origin:".concat(D,";")+"width:".concat(_,"px;height:").concat(M,"px;")+"transform: ".concat(B),i.width=_,i.height=M;var A=this.getContainer(),I=Ps(this.controlBox,s,this.controlBox,this.getContainer(),this._rootContainer||A,[]),F=[I.left,I.top],N=Rn(Qo(I),4),q=N[0],Y=N[1],X=N[2],W=N[3],j=nn([q,Y,X,W]),H=[j.minX,j.minY],V=Pa(w[0]*w[1]);I.pos1=ye(q,H),I.pos2=ye(Y,H),I.pos3=ye(X,H),I.pos4=ye(W,H),I.left=O-I.left+H[0],I.top=R-I.top+H[1],I.origin=ye(xe(F,I.origin),H),I.beforeOrigin=ye(xe(F,I.beforeOrigin),H),I.originalBeforeOrigin=xe(F,I.originalBeforeOrigin),I.transformOrigin=ye(xe(F,I.transformOrigin),H),s.style.transform="translate(".concat(-z-H[0],"px, ").concat(-G-H[1],"px)")+k,qr(),this.updateState(On(On({},I),{posDelta:H,direction:V,beforeDirection:V}),n)}},n.getRect=function(){return On(On({},t.prototype.getRect.call(this)),{children:this.moveables.map((function(t){return t.getRect()}))})},n.triggerEvent=function(e,n,r){if(r||e.indexOf("Group")>-1)return t.prototype.triggerEvent.call(this,e,n);this._emitter.trigger(e,n)},n.getRequestChildStyles=function(){return this.getEnabledAbles().reduce((function(t,e){var n,r,i=null!==(r=null===(n=e.requestChildStyle)||void 0===n?void 0:n.call(e))&&void 0!==r?r:[];return Pn(Pn([],Rn(t),!1),Rn(i),!1)}),[])},n.getMoveables=function(){return Pn([],Rn(this.moveables),!1)},n.updateAbles=function(){t.prototype.updateAbles.call(this,Pn(Pn([],Rn(this.props.ables),!1),[Gs],!1),"Group")},n._updateTargets=function(){t.prototype._updateTargets.call(this),this._originalDragTarget=this.props.dragTarget||this.areaElement,this._dragTarget=Ea(this._originalDragTarget,!0)},n._updateEvents=function(){var t=this.state,e=this.props,n=this._prevDragTarget,r=e.dragTarget||this.areaElement,i=e.targets,o=this.differ.update(i),a=o.added,s=o.changed,u=o.removed,c=a.length||u.length;(c||this._prevOriginalDragTarget!==this._originalDragTarget)&&(ea(this,!1),ea(this,!0),this.updateState({gestos:{}})),n!==r&&(t.target=null),t.target||(t.target=this.areaElement,this.controlBox.style.display="block"),t.target&&(this.targetGesto||(this.targetGesto=ws(this,this._dragTarget,"Group")),this.controlGesto||(this.controlGesto=_s(this,this.controlBox,"controlAbles","GroupControl")));var l=!la(t.container,e.container);l&&(t.container=e.container),(l||c||this.transformOrigin!==(e.defaultGroupOrigin||"50% 50%")||s.length||i.length&&!Oa(this._targetGroups,e.targetGroups||[]))&&(this.updateRect(),this._hasFirstTargets=!0),this._isPropTargetChanged=!!c},n._updateObserver=function(){},e.defaultProps=On(On({},zs.defaultProps),{transformOrigin:["50%","50%"],groupable:!0,dragArea:!0,keepRatio:!0,targets:[],defaultGroupRotate:0,defaultGroupOrigin:"50% 50%"}),e}(zs),Vs=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.moveables=[],e}Mn(e,t);var n=e.prototype;return n.render=function(){var t,e=this,n=this.props,r=n.cspNonce,a=n.cssStyled,s=n.persistData,u=n.targets||[],c=u.length,l=this.isUnmounted||!c,f=null!==(t=null==s?void 0:s.children)&&void 0!==t?t:[];return l&&!c&&f.length?u=f.map((function(){return null})):l||(f=[]),qt(a,{cspNonce:r,ref:i(this,"controlBox"),className:Eo("control-box")},u.map((function(t,r){var i,a,s=null!==(a=null===(i=n.individualGroupableProps)||void 0===i?void 0:i.call(n,t,r))&&void 0!==a?a:{};return qt(zs,On({key:"moveable"+r,ref:o(e,"moveables",r)},n,s,{target:t,wrapperMoveable:e,isWrapperMounted:e.isMoveableMounted,persistData:f[r]}))})))},n.componentDidMount=function(){},n.componentDidUpdate=function(){},n.getTargets=function(){return this.props.targets},n.updateRect=function(t,e,n){void 0===n&&(n=!0),qr(!0),this.moveables.forEach((function(r){r.updateRect(t,e,n)})),qr()},n.getRect=function(){return On(On({},t.prototype.getRect.call(this)),{children:this.moveables.map((function(t){return t.getRect()}))})},n.request=function(t,e,n){void 0===e&&(e={});var r=this.moveables.map((function(n){return n.request(t,On(On({},e),{isInstant:!1}),!1)})),i={request:function(t){return r.forEach((function(e){return e.request(t)})),this},requestEnd:function(){return r.forEach((function(t){return t.requestEnd()})),this}};return n||e.isInstant?i.request(e).requestEnd():i},n.dragStart=function(t){var e=t.target,n=k(this.moveables,(function(t){var n=t.getTargets()[0],r=t.getControlBoxElement(),i=t.getDragElement();return!(!n||!i)&&(i===e||i.contains(e)||i!==n&&n===e||n.contains(e)||r===e||r.contains(e))}));return n&&n.dragStart(t),this},n.hitTest=function(){return 0},n.isInside=function(){return!1},n.isDragging=function(){return!1},n.getDragElement=function(){return null},n.getMoveables=function(){return Pn([],Rn(this.moveables),!1)},n.updateRenderPoses=function(){},n.checkUpdate=function(){},n.triggerEvent=function(){},n.updateAbles=function(){},n._updateEvents=function(){},n._updateObserver=function(){},e}(zs);function Us(t,e){var n=[];return t.forEach((function(t){t&&(E(t)?e[t]&&n.push.apply(n,Pn([],Rn(e[t]),!1)):y(t)?n.push.apply(n,Pn([],Rn(Us(t,e)),!1)):n.push(t))})),n}function $s(t,e){var n=[];return t.forEach((function(t){t&&(E(t)?e[t]&&n.push.apply(n,Pn([],Rn(e[t]),!1)):y(t)?n.push($s(t,e)):n.push(t))})),n}function Zs(t,e){return t.length!==e.length||t.some((function(t,n){var r=e[n];return!(!t&&!r)&&(t!=r&&(!y(t)||!y(r)||Zs(t,r)))}))}var Ks=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.refTargets=[],e.selectorMap={},e._differ=new Xe,e._elementTargets=[],e._tmpRefTargets=[],e._tmpSelectorMap={},e._onChangeTargets=null,e}Mn(e,t);var n,r,o=e.prototype;return e.makeStyled=function(){var t={};this.getTotalAbles().forEach((function(e){var n=e.css;n&&n.forEach((function(e){t[e]=!0}))}));var e=I(t).join("\n");this.defaultStyled=wn("div",function(t,e){return e.replace(/([^}{]*){/gm,(function(e,n){return n.replace(/\.([^{,\s\d.]+)/g,"."+t+"$1")+"{"}))}(Un,Zn+e))},e.getTotalAbles=function(){return Pn([Za,Gs,Is,La],Rn(this.defaultAbles),!1)},o.render=function(){var t,e=this.constructor;e.defaultStyled||e.makeStyled();var n=this.props,r=n.ables,o=n.props,a=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i1,p=Pn(Pn([],Rn(e.getTotalAbles()),!1),Rn(r||[]),!1),d=On(On(On({},a),o||{}),{ables:p,cssStyled:e.defaultStyled,customStyledMap:e.customStyledMap});this._elementTargets=l;var h=null,v=this.moveable,g=a.persistData;if((null==g?void 0:g.children)&&(f=!0),a.individualGroupable)return qt(Vs,On({key:"individual-group",ref:i(this,"moveable")},d,{target:null,targets:l}));if(f){var m=$s(u,c);if(v&&!v.props.groupable&&!v.props.individualGroupable){var b=v.props.target;b&&l.indexOf(b)>-1&&(h=On({},v.state))}return qt(Ls,On({key:"group",ref:i(this,"moveable")},d,null!==(t=a.groupableProps)&&void 0!==t?t:{},{target:null,targets:l,targetGroups:m,firstRenderState:h}))}var x=l[0];if(v&&(v.props.groupable||v.props.individualGroupable)){var y=k(v.moveables||[],(function(t){return t.props.target===x}));y&&(h=On({},y.state))}return qt(zs,On({key:"single",ref:i(this,"moveable")},d,{target:x,firstRenderState:h}))},o.componentDidMount=function(){this._checkChangeTargets()},o.componentDidUpdate=function(){this._checkChangeTargets()},o.componentWillUnmount=function(){this.selectorMap={},this.refTargets=[]},o.getTargets=function(){var t,e;return null!==(e=null===(t=this.moveable)||void 0===t?void 0:t.getTargets())&&void 0!==e?e:[]},o.updateSelectors=function(){this.selectorMap={},this._updateRefs()},o.waitToChangeTarget=function(){var t,e=this;return this._onChangeTargets=function(){e._onChangeTargets=null,t()},new Promise((function(e){t=e}))},o.waitToChangeTargets=function(){return this.waitToChangeTarget()},o.getManager=function(){return this.moveable},o.getMoveables=function(){return this.moveable.getMoveables()},o.getDragElement=function(){return this.moveable.getDragElement()},o._updateRefs=function(t){var e=this.refTargets,n=Sa(this.props.target||this.props.targets),r="undefined"!=typeof document,i=Zs(e,n),o=this.selectorMap,a={};return this.refTargets.forEach((function t(e){E(e)?o[e]?a[e]=o[e]:r&&(i=!0,a[e]=[].slice.call(document.querySelectorAll(e))):y(e)&&e.forEach(t)})),this._tmpRefTargets=n,this._tmpSelectorMap=a,[n,a,!t&&i]},o._checkChangeTargets=function(){var t,e,n;this.refTargets=this._tmpRefTargets,this.selectorMap=this._tmpSelectorMap;var r=this._differ.update(this._elementTargets),i=r.added,o=r.removed;(i.length||o.length)&&(null===(e=(t=this.props).onChangeTargets)||void 0===e||e.call(t,{moveable:this.moveable,targets:this._elementTargets}),null===(n=this._onChangeTargets)||void 0===n||n.call(this));var a=Rn(this._updateRefs(),3),s=a[0],u=a[1],c=a[2];this.refTargets=s,this.selectorMap=u,c&&this.forceUpdate()},e.defaultAbles=[],e.customStyledMap={},e.defaultStyled=null,function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);o>3&&a&&Object.defineProperty(e,n,a)}([(n=ar,void 0===r&&(r={}),function(t,e){n.forEach((function(n){var i=r[n]||n;i in t||(t[i]=function(){for(var t,r=[],i=0;i1&&o.updateRect(),o}e(r,t);var o=r.prototype;return o.setState=function(t,e){this.innerMoveable.setState(t,e)},o.forceUpdate=function(t){this.innerMoveable.forceUpdate(t)},o.dragStart=function(t){this.innerMoveable.$_timer&&this.forceUpdate(),this.getMoveable().dragStart(t)},o.destroy=function(){var t,e=this.selfElement;Ht(null,e,this.containerProvider),this._warp||null===(t=null==e?void 0:e.parentElement)||void 0===t||t.removeChild(e),this.containerProvider=null,this.off(),this.selfElement=null,this.innerMoveable=null},o.getMoveable=function(){return this.innerMoveable.moveable},r=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}([a(eu,(function(t,e){t[e]||(t[e]=function(){for(var t=[],n=0;n + + + + EventEmitter - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

EventEmitter

+ + + + + + + +
+ +
+ +

+ EventEmitter +

+ +
Implement EventEmitter on object or component.
+ + +
+ +
+
+ + + + +

Constructor

+ + +

new EventEmitter()

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Methods

+ + + + + + +

trigger<Name extends keyof Events>(eventName, paramopt) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Fires an event to call listeners. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
eventName + + +Name +| + +... + + + + + + Event name
param? + + +TargetParam<any> +| + +... + + + + + + {} + + Event parameter
+ + + + +

+ trigger<Name extends keyof Events, Param = Events[Name]>(eventName) + → {boolean} +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eventName + + + extends TargetParam<Param> ? Name : never + + + +
+ +
+ +

+ trigger<Name extends keyof Events, Param = Events[Name]>(eventName, param) + → {boolean} +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eventName + + +Name + + + +
param + + +TargetParam<Param> + + + +
+ +
+ + + +
Example
+ +
import EventEmitter from "@scena/event-emitter";
+
+
+const emitter = new EventEmitter();
+
+emitter.on("a", e => {
+});
+
+// emit
+emitter.trigger("a", {
+  a: 1,
+});
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ If false, stop the event. +
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + +

trigger<Name extends keyof Events>(eventName, paramopt) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Fires an event to call listeners. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
eventName + + +Name +| + +... + + + + + + Event name
param? + + +TargetParam<any> +| + +... + + + + + + {} + + Event parameter
+ + + + +

+ trigger<Name extends keyof Events, Param = Events[Name]>(eventName) + → {boolean} +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eventName + + + extends TargetParam<Param> ? Name : never + + + +
+ +
+ +

+ trigger<Name extends keyof Events, Param = Events[Name]>(eventName, param) + → {boolean} +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eventName + + +Name + + + +
param + + +TargetParam<Param> + + + +
+ +
+ + + +
Example
+ +
import EventEmitter from "@scena/event-emitter";
+
+
+const emitter = new EventEmitter();
+
+emitter.on("a", e => {
+});
+
+
+emitter.emit("a", {
+  a: 1,
+});
+     
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ If false, stop the event. +
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + +

once<Name extends keyof Events & string, Param = Events[Name]>(eventName, listeneropt) → {Promise<OnEvent<Param, this>>}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Add a disposable listener and Use promise to the registered event. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eventName + + +Name + + + + Name of the event to be added
listener? + + +EventListener<Param, this> + + + + disposable listener function of the event to be added
+ + + + + + +
Example
+ +
import EventEmitter from "@scena/event-emitter";
+cosnt emitter = new EventEmitter();
+
+// Add a disposable listener in "a" event
+emitter.once("a", () => {
+});
+
+// Use Promise
+emitter.once("a").then(e => {
+});
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise<OnEvent<Param, this>> + + +
+
+ + + + + + + + + +

on(eventName, listeneropt) → {this}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Add a listener to the registered event. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eventName + + +string | object +| + +... + + + + Name of the event to be added
listener? + + +EventListener<Events[any], this> +| + +... + + + + listener function of the event to be added
+ + + + +

+ on<Name extends keyof Events, Param = Events[Name]>(eventName, listener) + → {this} +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eventName + + +Name + + + +
listener + + +EventListener<Param, this> + + + +
+ +
+ +

+ on(events) + → {this} +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
events + + +EventHash<Events, this> + + + +
+ +
+ + + +
Example
+ +
import EventEmitter from "@scena/event-emitter";
+cosnt emitter = new EventEmitter();
+
+// Add listener in "a" event
+emitter.on("a", () => {
+});
+// Add listeners
+emitter.on({
+ a: () => {},
+ b: () => {},
+});
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +this + + +
+
+ + + + + + + + + +

off(eventNameopt, listeneropt) → {this}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Remove listeners registered in the event target. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eventName? + + +string | object +| + +... + + + + Name of the event to be removed
listener? + + +EventListener<Events[any], this> +| + +... + + + + listener function of the event to be removed
+ + + + +

+ off<Name extends keyof Events, Param = Events[Name]>(eventName, listener) + → {this} +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eventName? + + +Name + + + +
listener? + + +EventListener<Param, this> + + + +
+ +
+ +

+ off(events) + → {this} +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
events + + +EventHash<Events, this> + + + +
+ +
+ + + +
Example
+ +
import EventEmitter from "@scena/event-emitter";
+cosnt emitter = new EventEmitter();
+
+// Remove all listeners.
+emitter.off();
+
+// Remove all listeners in "A" event.
+emitter.off("a");
+
+
+// Remove "listener" listener in "a" event.
+emitter.off("a", listener);
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +this + + +
+
+ + + + + + + + + +

emit(eventName, paramopt) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Fires an event to call listeners. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
eventName + + +string +| + +... + + + + + + Event name
param? + + +TargetParam<any> +| + +... + + + + + + {} + + Event parameter
+ + + + +

+ emit<Name extends keyof Events, Param = Events[Name]>(eventName) + → {boolean} +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eventName + + + extends Param ? Name : never + + + +
+ +
+ +

+ emit<Name extends keyof Events, Param = Events[Name]>(eventName, param) + → {boolean} +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eventName + + +Name + + + +
param + + +TargetParam<Param> + + + +
+ +
+ + + +
Example
+ +
import EventEmitter from "@scena/event-emitter";
+
+
+const emitter = new EventEmitter();
+
+emitter.on("a", e => {
+});
+
+
+emitter.emit("a", {
+  a: 1,
+});
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ If false, stop the event. +
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +

Type Definitions

+ + + +

EmitterParam<Target = any>

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ type + + +
+ + + + + + + +
+ + type: +string + + + +
+ + +
+ +
+ + +
+ +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +Target + + + +
+ + +
+ +
+ + +
+ +
+ +
+ stop + + +
+ + + + + + + +
+ + stop: +() => void + + + +
+ + +
+ +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

EventHash<Events, Target>

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Type:
+
    +
  • + +Partial<[Key extends keyof Events]: EventListener<Events[Key], Target>> + + +
  • +
+ + + + + + + + +

EventInfo

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ listener + + +
+ + + + + + + +
+ + listener: +EventListener<any, any> + + + +
+ + +
+ +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

EventListener<Param, Target>

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Type:
+
    +
  • + +(e: OnEvent<Param, Target>) => any + + +
  • +
+ + + + + + + + +

EventOptions

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ once + + +
+ + + + + + + +
+ + once: +boolean + + + +
+ + +
+ +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnEvent<Param, Target = any>

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Type:
+ + + + + + + + + +

TargetParam<Param>

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Type:
+ + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + \ No newline at end of file diff --git a/release/0.52.0/doc/Moveable.Clippable.html b/release/0.52.0/doc/Moveable.Clippable.html new file mode 100644 index 000000000..373254d42 --- /dev/null +++ b/release/0.52.0/doc/Moveable.Clippable.html @@ -0,0 +1,3781 @@ + + + + + Clippable - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

Clippable

+ + + + + + + +
+ +
+ +

+ Moveable. + + Clippable +

+ + +
+ +
+
+ + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
Whether to clip the target.
+ + + + +
+ + + + + + + + + + + + +

Members

+ + + +

dragWithClip

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When dragging the target, the clip also moves. (default: true) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    clippable: true,
+    defaultClipPath: "inset",
+    customClipPath: "",
+    clipRelative: false,
+    clipArea: false,
+    dragWithClip: true,
+});
+moveable.on("clipStart", e => {
+    console.log(e);
+}).on("clip", e => {
+    if (e.clipType === "rect") {
+        e.target.style.clip = e.clipStyle;
+    } else {
+        e.target.style.clipPath = e.clipStyle;
+    }
+}).on("clipEnd", e => {
+    console.log(e);
+});
+ + + + + +

defaultClipPath

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ If clippath is not set, the default value can be set. (defaultClipPath < style < customClipPath < dragging clipPath) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    clippable: true,
+    defaultClipPath: "inset",
+    customClipPath: "",
+    clipRelative: false,
+    clipArea: false,
+    dragWithClip: true,
+});
+moveable.on("clipStart", e => {
+    console.log(e);
+}).on("clip", e => {
+    if (e.clipType === "rect") {
+        e.target.style.clip = e.clipStyle;
+    } else {
+        e.target.style.clipPath = e.clipStyle;
+    }
+}).on("clipEnd", e => {
+    console.log(e);
+});
+ + + + + +

customClipPath

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ You can force the custom clipPath. (defaultClipPath < style < customClipPath < dragging clipPath) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    clippable: true,
+    defaultClipPath: "inset",
+    customClipPath: "",
+    clipRelative: false,
+    clipArea: false,
+    dragWithClip: true,
+});
+moveable.on("clipStart", e => {
+    console.log(e);
+}).on("clip", e => {
+    if (e.clipType === "rect") {
+        e.target.style.clip = e.clipStyle;
+    } else {
+        e.target.style.clipPath = e.clipStyle;
+    }
+}).on("clipEnd", e => {
+    console.log(e);
+});
+ + + + + +

clipVerticalGuidelines

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
    +
  • 0
  • +
+ + + + + + + +
+ + + + + +
+ Add clip guidelines in the vertical direction. +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    clippable: true,
+    defaultClipPath: "inset",
+    customClipPath: "",
+    clipRelative: false,
+    clipArea: false,
+    dragWithClip: true,
+    clipVerticalGuidelines: [0, 100, 200],
+    clipHorizontalGuidelines: [0, 100, 200],
+    clipSnapThreshold: 5,
+});
+ + + + + +

clipTargetBounds

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
    +
  • false
  • +
+ + + + + + + +
+ + + + + +
+ Whether the clip is bound to the target. +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    clippable: true,
+    defaultClipPath: "inset",
+    customClipPath: "",
+    clipRelative: false,
+    clipArea: false,
+    dragWithClip: true,
+    clipTargetBounds: true,
+});
+moveable.on("clipStart", e => {
+    console.log(e);
+}).on("clip", e => {
+    if (e.clipType === "rect") {
+        e.target.style.clip = e.clipStyle;
+    } else {
+        e.target.style.clipPath = e.clipStyle;
+    }
+}).on("clipEnd", e => {
+    console.log(e);
+});
+ + + + + +

clipSnapThreshold

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
    +
  • 5
  • +
+ + + + + + + +
+ + + + + +
+ istance value that can snap to clip guidelines. +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    clippable: true,
+    defaultClipPath: "inset",
+    customClipPath: "",
+    clipRelative: false,
+    clipArea: false,
+    dragWithClip: true,
+    clipVerticalGuidelines: [0, 100, 200],
+    clipHorizontalGuidelines: [0, 100, 200],
+    clipSnapThreshold: 5,
+});
+ + + + + +

clipRelative

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ % Can be used instead of the absolute px (`rect` not possible) (default: false) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    clippable: true,
+    defaultClipPath: "inset",
+    customClipPath: "",
+    clipRelative: false,
+    clipArea: false,
+    dragWithClip: true,
+});
+moveable.on("clipStart", e => {
+    console.log(e);
+}).on("clip", e => {
+    if (e.clipType === "rect") {
+        e.target.style.clip = e.clipStyle;
+    } else {
+        e.target.style.clipPath = e.clipStyle;
+    }
+}).on("clipEnd", e => {
+    console.log(e);
+});
+ + + + + +

clippable

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Whether to clip the target. (default: false) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    clippable: true,
+    defaultClipPath: "inset",
+    customClipPath: "",
+    clipRelative: false,
+    clipArea: false,
+    dragWithClip: true,
+});
+moveable.on("clipStart", e => {
+    console.log(e);
+}).on("clip", e => {
+    if (e.clipType === "rect") {
+        e.target.style.clip = e.clipStyle;
+    } else {
+        e.target.style.clipPath = e.clipStyle;
+    }
+}).on("clipEnd", e => {
+    console.log(e);
+});
+ + + + + +

clipHorizontalGuidelines

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
    +
  • []
  • +
+ + + + + + + +
+ + + + + +
+ Add clip guidelines in the horizontal direction. +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    clippable: true,
+    defaultClipPath: "inset",
+    customClipPath: "",
+    clipRelative: false,
+    clipArea: false,
+    dragWithClip: true,
+    clipVerticalGuidelines: [0, 100, 200],
+    clipHorizontalGuidelines: [0, 100, 200],
+    clipSnapThreshold: 5,
+});
+ + + + + +

clipArea

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
    +
  • false
  • +
+ + + + + + + +
+ + + + + +
+ You can drag the clip by setting clipArea. +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    clippable: true,
+    defaultClipPath: "inset",
+    customClipPath: "",
+    clipRelative: false,
+    clipArea: false,
+    dragWithClip: true,
+});
+moveable.on("clipStart", e => {
+    console.log(e);
+}).on("clip", e => {
+    if (e.clipType === "rect") {
+        e.target.style.clip = e.clipStyle;
+    } else {
+        e.target.style.clipPath = e.clipStyle;
+    }
+}).on("clipEnd", e => {
+    console.log(e);
+});
+ + + + + + + + + +

Type Definitions

+ + + +

ClippableOptions

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ clippable + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + clippable?: +boolean | ClippableOptions + + + +
+ + +
+ Whether to clip the target. + +
+ + +
+ +
+ +
+ keepRatio + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + keepRatio?: +boolean + + + +
+ + +
+ Whether to keep the ratio of size if your clipPath is 'inset', 'rect', 'ellipse' type + +
+ + +
+ +
+ +
+ customClipPath + optional + +
+ + + + + + + +
+ + customClipPath?: +string + + + +
+ + +
+ You can force the custom clipPath. (defaultClipPath < style < customClipPath < dragging clipPath) + +
+ + +
+ +
+ +
+ defaultClipPath + optional + +
+ + + + + + + +
+ + defaultClipPath?: +string + + + +
+ + +
+ If clippath is not set, the default value can be set. (defaultClipPath < style < customClipPath < dragging clipPath) + +
+ + +
+ +
+ +
+ clipRelative + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + clipRelative?: +boolean + + + +
+ + +
+ % Can be used instead of the absolute px (`rect` not possible) + +
+ + +
+ +
+ +
+ dragWithClip + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + dragWithClip?: +boolean + + + +
+ + +
+ When dragging the target, the clip also moves. + +
+ + +
+ +
+ +
+ clipArea + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + clipArea?: +boolean + + + +
+ + +
+ You can drag the clip by setting clipArea. + +
+ + +
+ +
+ +
+ clipTargetBounds + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + clipTargetBounds?: +boolean + + + +
+ + +
+ Whether the clip is bound to the target. + +
+ + +
+ +
+ +
+ clipVerticalGuidelines + optional + +
+ + + + + + +
+ Default Value: [] + +
+ + +
+ + clipVerticalGuidelines?: +Array<string | number> + + + +
+ + +
+ Add clip guidelines in the vertical direction. + +
+ + +
+ +
+ +
+ clipHorizontalGuidelines + optional + +
+ + + + + + +
+ Default Value: [] + +
+ + +
+ + clipHorizontalGuidelines?: +Array<string | number> + + + +
+ + +
+ Add clip guidelines in the horizontal direction. + +
+ + +
+ +
+ +
+ clipSnapThreshold + optional + +
+ + + + + + +
+ Default Value: 5 + +
+ + +
+ + clipSnapThreshold?: +number + + + +
+ + +
+ Distance value that can snap to clip guidelines. + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnClip

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ style + + +
+ + + + + + + +
+ + style: +Record<string, string> + + + +
+ + +
+ You can get the style you can get from the event. + +
+ + +
+ +
+ +
+ cssText + + +
+ + + + + + + +
+ + cssText: +string + + + +
+ + +
+ You can get it as a cssText that you can get from that event. + +
+ + +
+ +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ clipType + + +
+ + + + + + + +
+ + clipType: +"polygon" | "circle" | "ellipse" | "inset" | "rect" + + + +
+ + +
+ The clip type. + +
+ + +
+ +
+ +
+ clipEventType + + +
+ + + + + + + +
+ + clipEventType: +"added" | "changed" | "removed" + + + +
+ + +
+ The clip event type. + +
+ + +
+ +
+ +
+ poses + + +
+ + + + + + + +
+ + poses: +number[][] + + + +
+ + +
+ The control positions + +
+ + +
+ +
+ +
+ distX + + +
+ + + + + + + +
+ + distX: +number + + + +
+ + +
+ x position of the distance the control has moved + +
+ + +
+ +
+ +
+ distY + + +
+ + + + + + + +
+ + distY: +number + + + +
+ + +
+ y position of the distance the control has moved + +
+ + +
+ +
+ +
+ clipStyle + + +
+ + + + + + + +
+ + clipStyle: +string + + + +
+ + +
+ CSS style of changed clip + +
+ + +
+ +
+ +
+ clipStyles + + +
+ + + + + + + +
+ + clipStyles: +string[] + + + +
+ + +
+ Splited CSS styles of changed clip + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnClipEnd

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ lastEvent + + +
+ + + + + + + +
+ + lastEvent: +any | undefined + + + +
+ + +
+ This is the last dragged event. No, if you haven't dragged. +
+ + +
+ +
+ +
+ isDrag + + +
+ + + + + + + +
+ + isDrag: +boolean + + + +
+ + +
+ Whether this moved +
+ + +
+ +
+ +
+ isDouble + + +
+ + + + + + + +
+ + isDouble: +boolean + + + +
+ + +
+ Whether it is double-click +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnClipStart

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ clipType + + +
+ + + + + + + +
+ + clipType: +"polygon" | "circle" | "ellipse" | "inset" | "rect" + + + +
+ + +
+ The clip type. +
+ + +
+ +
+ +
+ poses + + +
+ + + + + + + +
+ + poses: +number[][] + + + +
+ + +
+ The control positions +
+ + +
+ +
+ +
+ clipStyle + + +
+ + + + + + + +
+ + clipStyle: +string + + + +
+ + +
+ CSS style of changed clip +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + + + +

Events

+ + + + + + +

clip

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When drag the clip area or controls, the `clip` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Clippable.OnClip + + + + Parameters for the `clip` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    clippable: true,
+    defaultClipPath: "inset",
+    customClipPath: "",
+    clipRelative: false,
+    clipArea: false,
+    dragWithClip: true,
+});
+moveable.on("clipStart", e => {
+    console.log(e);
+}).on("clip", e => {
+    if (e.clipType === "rect") {
+        e.target.style.clip = e.clipStyle;
+    } else {
+        e.target.style.clipPath = e.clipStyle;
+    }
+}).on("clipEnd", e => {
+    console.log(e);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

clipEnd

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When drag end the clip area or controls, the `clipEnd` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Clippable.OnClipEnd + + + + Parameters for the `clipEnd` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    clippable: true,
+    defaultClipPath: "inset",
+    customClipPath: "",
+    clipRelative: false,
+    clipArea: false,
+    dragWithClip: true,
+});
+moveable.on("clipStart", e => {
+    console.log(e);
+}).on("clip", e => {
+    if (e.clipType === "rect") {
+        e.target.style.clip = e.clipStyle;
+    } else {
+        e.target.style.clipPath = e.clipStyle;
+    }
+}).on("clipEnd", e => {
+    console.log(e);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

clipStart

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When drag start the clip area or controls, the `clipStart` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Clippable.OnClipStart + + + + Parameters for the `clipStart` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    clippable: true,
+    defaultClipPath: "inset",
+    customClipPath: "",
+    clipRelative: false,
+    clipArea: false,
+    dragWithClip: true,
+});
+moveable.on("clipStart", e => {
+    console.log(e);
+}).on("clip", e => {
+    if (e.clipType === "rect") {
+        e.target.style.clip = e.clipStyle;
+    } else {
+        e.target.style.clipPath = e.clipStyle;
+    }
+}).on("clipEnd", e => {
+    console.log(e);
+});
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + \ No newline at end of file diff --git a/release/0.52.0/doc/Moveable.Draggable.html b/release/0.52.0/doc/Moveable.Draggable.html new file mode 100644 index 000000000..2c24b37b5 --- /dev/null +++ b/release/0.52.0/doc/Moveable.Draggable.html @@ -0,0 +1,4746 @@ + + + + + Draggable - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

Draggable

+ + + + + + + +
+ +
+ +

+ Moveable. + + Draggable +

+ + +
+ +
+
+ + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
Draggable refers to the ability to drag and move targets.
+ + + + +
+ + + + + + + + + + + + +

Members

+ + + +

throttleDragRotate

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ throttle of angle of x, y when drag. +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+moveable.throttleDragRotate = 45;
+ + + + + +

throttleDrag

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
    +
  • 0
  • +
+ + + + + + + +
+ + + + + +
+ throttle of x, y when drag. +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+moveable.throttleDrag = 1;
+ + + + + +

startDragRotate

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ start angle of throttleDragRotate of x, y when drag. +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+// 45, 135, 225, 315
+moveable.throttleDragRotate = 90;
+moveable.startDragRotate = 45;
+ + + + + +

edgeDraggable

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Whether to move by dragging the edge line (default: false) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+ draggable: true,
+ edgeDraggable: false,
+});
+
+moveable.edgeDraggable = true;
+ + + + + +

draggable

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Whether or not target can be dragged. (default: false) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+moveable.draggable = true;
+ + + + + + + +

Methods

+ + + + + + +

request(eopt, e.xopt, e.yopt, e.deltaXopt, e.deltaYopt) → {Moveable.Requester}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e? + + +object + + + + the draggable's request parameter +
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
x? + + +number + + + + x position
y? + + +number + + + + y position
deltaX? + + +number + + + + X number to move
deltaY? + + +number + + + + Y number to move
+ +
+ + + + + + +
Example
+ +
// Instantly Request (requestStart - request - requestEnd)
+// Use Relative Value
+moveable.request("draggable", { deltaX: 10, deltaY: 10 }, true);
+// Use Absolute Value
+moveable.request("draggable", { x: 200, y: 100 }, true);
+
+// requestStart
+const requester = moveable.request("draggable");
+
+// request
+// Use Relative Value
+requester.request({ deltaX: 10, deltaY: 10 });
+requester.request({ deltaX: 10, deltaY: 10 });
+requester.request({ deltaX: 10, deltaY: 10 });
+// Use Absolute Value
+moveable.request("draggable", { x: 200, y: 100 });
+moveable.request("draggable", { x: 220, y: 100 });
+moveable.request("draggable", { x: 240, y: 100 });
+
+// requestEnd
+requester.requestEnd();
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Moveable Requester +
+ + + +
+
+ Type +
+
+ +Moveable.Requester + + +
+
+ + + + + + + + +

Type Definitions

+ + + +

DraggableOptions

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ draggable + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + draggable?: +boolean + + + +
+ + +
+ Whether or not target can be dragged. + +
+ + +
+ +
+ +
+ throttleDrag + optional + +
+ + + + + + +
+ Default Value: 0 + +
+ + +
+ + throttleDrag?: +number + + + +
+ + +
+ throttle of x, y when drag. + +
+ + +
+ +
+ +
+ throttleDragRotate + optional + +
+ + + + + + +
+ Default Value: 0 + +
+ + +
+ + throttleDragRotate?: +number + + + +
+ + +
+ throttle of angle(degree) of x,y when drag. + +
+ + +
+ +
+ +
+ hideThrottleDragRotateLine + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + hideThrottleDragRotateLine?: +boolean + + + +
+ + +
+ Hides the guidelines that appear when using the `throttleDragRotate` prop. + +
+ + +
+ +
+ +
+ startDragRotate + optional + +
+ + + + + + +
+ Default Value: 0 + +
+ + +
+ + startDragRotate?: +number + + + +
+ + +
+ start angle(degree) of x,y for throttleDragRotate when drag. + +
+ + +
+ +
+ +
+ edgeDraggable + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + edgeDraggable?: +boolean | Array<LineDirection> + + + +
+ + +
+ Whether to move by dragging the edge line + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

DraggableRequestParam

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ isInstant + optional + +
+ + + + + + + +
+ + isInstant?: +boolean + + + +
+ + +
+ Run the request instantly. (requestStart, request, requestEnd happen at the same time) + +
+ + +
+ +
+ +
+ [key: string] + + +
+ + + + + + + +
+ + [key: string]: +any + + + +
+ + +
+ +
+ + +
+ +
+ +
+ x + optional + +
+ + + + + + + +
+ + x?: +number + + + +
+ + +
+ x position + +
+ + +
+ +
+ +
+ y + optional + +
+ + + + + + + +
+ + y?: +number + + + +
+ + +
+ y position + +
+ + +
+ +
+ +
+ deltaX + optional + +
+ + + + + + + +
+ + deltaX?: +number + + + +
+ + +
+ X number to move + +
+ + +
+ +
+ +
+ deltaY + optional + +
+ + + + + + + +
+ + deltaY?: +number + + + +
+ + +
+ Y number to move + +
+ + +
+ +
+ +
+ useSnap + optional + +
+ + + + + + + +
+ + useSnap?: +boolean + + + +
+ + +
+ whether to use with `snappable` + +
+ + +
+ + + + + + + +
+ the Draggable's request parameter +
+ + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnDrag

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ style + + +
+ + + + + + + +
+ + style: +Record<string, string> + + + +
+ + +
+ You can get the style you can get from the event. + +
+ + +
+ +
+ +
+ cssText + + +
+ + + + + + + +
+ + cssText: +string + + + +
+ + +
+ You can get it as a cssText that you can get from that event. + +
+ + +
+ +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ beforeDelta + + +
+ + + + + + + +
+ + beforeDelta: +number[] + + + +
+ + +
+ The delta of [left, top] +
+ + +
+ +
+ +
+ beforeDist + + +
+ + + + + + + +
+ + beforeDist: +number[] + + + +
+ + +
+ The distance of [left, top] +
+ + +
+ +
+ +
+ beforeTranslate + + +
+ + + + + + + +
+ + beforeTranslate: +number[] + + + +
+ + +
+ The position of [left, top] +
+ + +
+ +
+ +
+ delta + + +
+ + + + + + + +
+ + delta: +number[] + + + +
+ + +
+ The delta of [translateX, translateY] +
+ + +
+ +
+ +
+ dist + + +
+ + + + + + + +
+ + dist: +number[] + + + +
+ + +
+ The distance of [translateX, translateY] +
+ + +
+ +
+ +
+ translate + + +
+ + + + + + + +
+ + translate: +number[] + + + +
+ + +
+ The position of [translateX, translateY] +
+ + +
+ +
+ +
+ transform + + +
+ + + + + + + +
+ + transform: +string + + + +
+ + +
+ a target's transform +
+ + +
+ +
+ +
+ left + + +
+ + + + + + + +
+ + left: +number + + + +
+ + +
+ a target's left +
+ + +
+ +
+ +
+ top + + +
+ + + + + + + +
+ + top: +number + + + +
+ + +
+ a target's top +
+ + +
+ +
+ +
+ bottom + + +
+ + + + + + + +
+ + bottom: +number + + + +
+ + +
+ a target's bottom +
+ + +
+ +
+ +
+ width + + +
+ + + + + + + +
+ + width: +number + + + +
+ + +
+ a target's offset width +
+ + +
+ +
+ +
+ height + + +
+ + + + + + + +
+ + height: +number + + + +
+ + +
+ a target's offset height +
+ + +
+ +
+ +
+ right + + +
+ + + + + + + +
+ + right: +number + + + +
+ + +
+ a target's right +
+ + +
+ +
+ +
+ isPinch + + +
+ + + + + + + +
+ + isPinch: +boolean + + + +
+ + +
+ Whether or not it is being pinched. +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnDragEnd

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ lastEvent + + +
+ + + + + + + +
+ + lastEvent: +any | undefined + + + +
+ + +
+ This is the last dragged event. No, if you haven't dragged. +
+ + +
+ +
+ +
+ isDrag + + +
+ + + + + + + +
+ + isDrag: +boolean + + + +
+ + +
+ Whether this moved +
+ + +
+ +
+ +
+ isDouble + + +
+ + + + + + + +
+ + isDouble: +boolean + + + +
+ + +
+ Whether it is double-click +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnDragGroup

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ The dragging targets +
+ + +
+ +
+ +
+ events + + +
+ + + + + + + +
+ + events: +OnDrag[] + + + +
+ + +
+ Each `drag` event on the targets +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnDragGroupEnd

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ The drag finished targets +
+ + +
+ +
+ +
+ events + + +
+ + + + + + + +
+ + events: +OnDragEnd[] + + + +
+ + +
+ Each `dragEnd` event on the targets +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnDragGroupStart

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ targets to drag +
+ + +
+ +
+ +
+ events + + +
+ + + + + + + +
+ + events: +OnDragStart[] + + + +
+ + +
+ Each `dragStart` event on the targets +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnDragStart

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ setTransform + + +
+ + + + + + +
+ Default Value: transform of target's inline style + +
+ + +
+ + setTransform: +(transform: string | string[], transformIndex?: number) => void + + + +
+ + +
+ Set your original transform. +`transformIndex` is the sequence of functions used in the event. +If you use `setTransform`, you don't need to use `set` function. + +
+ + +
+ +
+ + + + + + + + +
+ Default Value: index with that property in transform or last + +
+ + +
+ + setTransformIndex: +(transformIndex: number) => void + + + +
+ + +
+ `transformIndex` is the sequence of functions used in the event. + +
+ + +
+ +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ set + + +
+ + + + + + + +
+ + set: +(translate: number[]) => void + + + +
+ + +
+ You can set the start translate value. + +
+ + +
+ + + + + + + +
+ When the drag starts, the dragStart event is called. +
+ + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + + + +

Events

+ + + + + + +

drag

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When dragging, the drag event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Draggable.OnDrag + + + + Parameters for the drag event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, { draggable: true });
+moveable.on("drag", ({ target, transform }) => {
+    target.style.transform = transform;
+});
+ + + + + + + + + + + + + + + + + + + + + + +

dragEnd

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the drag finishes, the dragEnd event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Draggable.OnDragEnd + + + + Parameters for the dragEnd event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, { draggable: true });
+moveable.on("dragEnd", ({ target, isDrag }) => {
+    console.log(target, isDrag);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

dragGroup

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the group drag, the `dragGroup` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Draggable.OnDragGroup + + + + Parameters for the `dragGroup` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    target: [].slice.call(document.querySelectorAll(".target")),
+    draggable: true
+});
+moveable.on("dragGroup", ({ targets, events }) => {
+    console.log("onDragGroup", targets);
+    events.forEach(ev => {
+         // drag event
+         console.log("onDrag left, top", ev.left, ev.top);
+         // ev.target!.style.left = `${ev.left}px`;
+         // ev.target!.style.top = `${ev.top}px`;
+         console.log("onDrag translate", ev.dist);
+         ev.target!.style.transform = ev.transform;)
+    });
+});
+ + + + + + + + + + + + + + + + + + + + + + +

dragGroupEnd

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the group drag finishes, the `dragGroupEnd` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Draggable.OnDragGroupEnd + + + + Parameters for the `dragGroupEnd` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    target: [].slice.call(document.querySelectorAll(".target")),
+    draggable: true
+});
+moveable.on("dragGroupEnd", ({ targets, isDrag }) => {
+    console.log("onDragGroupEnd", targets, isDrag);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

dragGroupStart

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the group drag starts, the `dragGroupStart` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Draggable.OnDragGroupStart + + + + Parameters for the `dragGroupStart` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    target: [].slice.call(document.querySelectorAll(".target")),
+    draggable: true
+});
+moveable.on("dragGroupStart", ({ targets }) => {
+    console.log("onDragGroupStart", targets);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

dragStart

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the drag starts, the dragStart event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Draggable.OnDragStart + + + + Parameters for the dragStart event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, { draggable: true });
+moveable.on("dragStart", ({ target }) => {
+    console.log(target);
+});
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + \ No newline at end of file diff --git a/release/0.52.0/doc/Moveable.Group.html b/release/0.52.0/doc/Moveable.Group.html new file mode 100644 index 000000000..97adfa030 --- /dev/null +++ b/release/0.52.0/doc/Moveable.Group.html @@ -0,0 +1,718 @@ + + + + + Group - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

Group

+ + + + + + + +
+ +
+ +

+ Moveable. + + Group +

+ + +
+ +
+
+ + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
You can make targets moveable.
+ + + + +
+ + + + + + + + + + + + +

Members

+ + + +

hideChildMoveableDefaultLines

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
    +
  • false
  • +
+ + + + + + + +
+ + + + + +
+ Whether to hide the line in child moveable for group corresponding to the rect of the target. +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+  target: [].slice.call(document.querySelectorAll(".target")),
+  hideChildMoveableDefaultLines: false,
+});
+
+moveable.hideChildMoveableDefaultLines = true;
+ + + + + +

defaultGroupRotate

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
    +
  • 0
  • +
+ + + + + + + +
+ + + + + +
+ Sets the initial rotation of the group. +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+  target: [].slice.call(document.querySelectorAll(".target")),
+  defaultGroupRotate: 0,
+});
+
+moveable.defaultGroupRotate = 40;
+ + + + + +

defaultGroupOrigin

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
    +
  • 0
  • +
+ + + + + + + +
+ + + + + +
+ Sets the initial origin of the group. +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+  target: [].slice.call(document.querySelectorAll(".target")),
+  defaultGroupOrigin: "50% 50%",
+});
+
+moveable.defaultGroupOrigin = "20% 40%";
+ + + + + + + + + +

Type Definitions

+ + + +

GroupableOptions

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ defaultGroupRotate + optional + +
+ + + + + + +
+ Default Value: 0 + +
+ + +
+ + defaultGroupRotate?: +number + + + +
+ + +
+ Sets the initial rotation of the group. + +
+ + +
+ +
+ +
+ useDefaultGroupRotate + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + useDefaultGroupRotate?: +boolean + + + +
+ + +
+ Use the defaultGroupRotate even if the children's rotations match. + +
+ + +
+ +
+ +
+ defaultGroupOrigin + optional + +
+ + + + + + +
+ Default Value: "50% 50%" + +
+ + +
+ + defaultGroupOrigin?: +string + + + +
+ + +
+ Sets the initial transform origin of the group. + +
+ + +
+ +
+ +
+ targetGroups + optional + +
+ + + + + + + +
+ + targetGroups?: +MoveableTargetGroupsType + + + +
+ + +
+ +
+ + +
+ +
+ + + + + + + + +
+ Default Value: false + +
+ + +
+ + hideChildMoveableDefaultLines?: +boolean + + + +
+ + +
+ Whether to hide the line in child moveable for group corresponding to the rect of the target. + +
+ + +
+ +
+ +
+ groupableProps + optional + +
+ + + + + + + +
+ + groupableProps?: +Record<string, any> + + + +
+ + +
+ Props that work when group + +
+ + Examples +
+ +
```js
+{
+    roundable: true,
+    groupableProps: {
+        roundable: false,
+    },
+}
+```
+ +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + \ No newline at end of file diff --git a/release/0.52.0/doc/Moveable.OriginDraggable.html b/release/0.52.0/doc/Moveable.OriginDraggable.html new file mode 100644 index 000000000..c5ec1c568 --- /dev/null +++ b/release/0.52.0/doc/Moveable.OriginDraggable.html @@ -0,0 +1,3052 @@ + + + + + OriginDraggable - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

OriginDraggable

+ + + + + + + +
+ +
+ +

+ Moveable. + + OriginDraggable +

+ + +
+ +
+
+ + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
Whether to drag origin (default: false)
+ + + + +
+ + + + + + + + + + + + +

Members

+ + + +

originRelative

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ % Can be used instead of the absolute px (default: true) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    originDraggable: true,
+    originRelative: false,
+});
+moveable.originRelative = true;
+ + + + + +

originDraggable

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Whether to drag origin (default: false) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    originDraggable: true,
+});
+let translate = [0, 0];
+moveable.on("dragOriginStart", e => {
+    e.dragStart && e.dragStart.set(translate);
+}).on("dragOrigin", e => {
+    translate = e.drag.beforeTranslate;
+    e.target.style.cssText
+        = `transform-origin: ${e.transformOrigin};`
+        + `transform: translate(${translate[0]}px, ${translate[1]}px)`;
+}).on("dragOriginEnd", e => {
+    console.log(e);
+});
+ + + + + + + +

Methods

+ + + + + + +

request(e, e.xopt, e.yopt, e.deltaXopt, e.deltaYopt, e.deltaOriginopt, e.originopt, e.isInstantopt) → {Moveable.Requester}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +object + + + + the OriginDraggable's request parameter +
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
x? + + +number + + + + x position
y? + + +number + + + + y position
deltaX? + + +number + + + + x number to move
deltaY? + + +number + + + + y number to move
deltaOrigin? + + +array + + + + left, top number to move transform-origin
origin? + + +array + + + + transform-origin position
isInstant? + + +number + + + + Whether to execute the request instantly
+ +
+ + + + + + +
Example
+ +
// Instantly Request (requestStart - request - requestEnd)
+// Use Relative Value
+moveable.request("originDraggable", { deltaX: 10, deltaY: 10 }, true);
+// Use Absolute Value
+moveable.request("originDraggable", { x: 200, y: 100 }, true);
+// Use Transform Value
+moveable.request("originDraggable", { deltaOrigin: [10, 0] }, true);
+moveable.request("originDraggable", { origin: [100, 0] }, true);
+// requestStart
+const requester = moveable.request("originDraggable");
+
+// request
+// Use Relative Value
+requester.request({ deltaX: 10, deltaY: 10 });
+requester.request({ deltaX: 10, deltaY: 10 });
+requester.request({ deltaX: 10, deltaY: 10 });
+// Use Absolute Value
+moveable.request("originDraggable", { x: 200, y: 100 });
+moveable.request("originDraggable", { x: 220, y: 100 });
+moveable.request("originDraggable", { x: 240, y: 100 });
+
+// requestEnd
+requester.requestEnd();
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Moveable Requester +
+ + + +
+
+ Type +
+
+ +Moveable.Requester + + +
+
+ + + + + + + + +

Type Definitions

+ + + +

OnDragOrigin

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ style + + +
+ + + + + + + +
+ + style: +Record<string, string> + + + +
+ + +
+ You can get the style you can get from the event. + +
+ + +
+ +
+ +
+ cssText + + +
+ + + + + + + +
+ + cssText: +string + + + +
+ + +
+ You can get it as a cssText that you can get from that event. + +
+ + +
+ +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ width + + +
+ + + + + + + +
+ + width: +number + + + +
+ + +
+ Offset width of target + +
+ + +
+ +
+ +
+ height + + +
+ + + + + + + +
+ + height: +number + + + +
+ + +
+ Offset height of target + +
+ + +
+ +
+ +
+ delta + + +
+ + + + + + + +
+ + delta: +number[] + + + +
+ + +
+ The delta of [x, y] + +
+ + +
+ +
+ +
+ dist + + +
+ + + + + + + +
+ + dist: +number[] + + + +
+ + +
+ The distance of [x, y] + +
+ + +
+ +
+ +
+ origin + + +
+ + + + + + + +
+ + origin: +number[] + + + +
+ + +
+ The target's moved transform-origin poses + +
+ + +
+ +
+ +
+ transformOrigin + + +
+ + + + + + + +
+ + transformOrigin: +string + + + +
+ + +
+ The target's moved transform-origin css + +
+ + +
+ +
+ +
+ afterTransform + + +
+ + + + + + + +
+ + afterTransform: +string + + + +
+ + +
+ A transform obtained by the simultaneous occurrence of other events in the current event + +
+ + +
+ +
+ +
+ drag + + +
+ + + + + + + +
+ + drag: +OnDrag + + + +
+ + +
+ `dragOrigin` causes a `drag` event. + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnDragOriginEnd

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ lastEvent + + +
+ + + + + + + +
+ + lastEvent: +any | undefined + + + +
+ + +
+ This is the last dragged event. No, if you haven't dragged. +
+ + +
+ +
+ +
+ isDrag + + +
+ + + + + + + +
+ + isDrag: +boolean + + + +
+ + +
+ Whether this moved +
+ + +
+ +
+ +
+ isDouble + + +
+ + + + + + + +
+ + isDouble: +boolean + + + +
+ + +
+ Whether it is double-click +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnDragOriginStart

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ dragStart + + +
+ + + + + + + +
+ + dragStart: +OnDragStart | false + + + +
+ + +
+ dragOrigin causes a `dragStart` event. +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OriginDraggableOptions

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ originDraggable + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + originDraggable?: +boolean + + + +
+ + +
+ Whether to drag origin. + +
+ + +
+ +
+ +
+ originRelative + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + originRelative?: +boolean + + + +
+ + +
+ % Can be used instead of the absolute px. + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + + + +

Events

+ + + + + + +

dragOrigin

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When drag the origin, the `dragOrigin` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.OriginDraggable.OnDragOrigin + + + + Parameters for the `dragOrigin` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    originDraggable: true,
+});
+let translate = [0, 0];
+moveable.on("dragOriginStart", e => {
+    e.dragStart && e.dragStart.set(translate);
+}).on("dragOrigin", e => {
+    translate = e.drag.beforeTranslate;
+    e.target.style.cssText
+        = `transform-origin: ${e.transformOrigin};`
+        + `transform: translate(${translate[0]}px, ${translate[1]}px)`;
+}).on("dragOriginEnd", e => {
+    console.log(e);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

dragOriginEnd

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When drag end the origin, the `dragOriginEnd` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.OriginDraggable.OnDragOriginEnd + + + + Parameters for the `dragOriginEnd` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    originDraggable: true,
+});
+let translate = [0, 0];
+moveable.on("dragOriginStart", e => {
+    e.dragStart && e.dragStart.set(translate);
+}).on("dragOrigin", e => {
+    translate = e.drag.beforeTranslate;
+    e.target.style.cssText
+        = `transform-origin: ${e.transformOrigin};`
+        + `transform: translate(${translate[0]}px, ${translate[1]}px)`;
+}).on("dragOriginEnd", e => {
+    console.log(e);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

dragOriginStart

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When drag start the origin, the `dragOriginStart` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.OriginDraggable.OnDragOriginStart + + + + Parameters for the `dragOriginStart` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    originDraggable: true,
+});
+let translate = [0, 0];
+moveable.on("dragOriginStart", e => {
+    e.dragStart && e.dragStart.set(translate);
+}).on("dragOrigin", e => {
+    translate = e.drag.beforeTranslate;
+    e.target.style.cssText
+        = `transform-origin: ${e.transformOrigin};`
+        + `transform: translate(${translate[0]}px, ${translate[1]}px)`;
+}).on("dragOriginEnd", e => {
+    console.log(e);
+});
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + \ No newline at end of file diff --git a/release/0.52.0/doc/Moveable.Pinchable.html b/release/0.52.0/doc/Moveable.Pinchable.html new file mode 100644 index 000000000..9d2893ea3 --- /dev/null +++ b/release/0.52.0/doc/Moveable.Pinchable.html @@ -0,0 +1,2971 @@ + + + + + Pinchable - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

Pinchable

+ + + + + + + +
+ +
+ +

+ Moveable. + + Pinchable +

+ + +
+ +
+
+ + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
Whether or not target can be pinched with draggable, resizable, scalable, rotatable (default: false)
+ + + + +
+ + + + + + + + + + + + +

Members

+ + + +

pinchable

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Whether or not target can be pinched with draggable, resizable, scalable, rotatable (default: false) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+moveable.pinchable = true;
+ + + + + + + + + +

Type Definitions

+ + + +

OnPinch

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnPinchEnd

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ lastEvent + + +
+ + + + + + + +
+ + lastEvent: +any | undefined + + + +
+ + +
+ This is the last dragged event. No, if you haven't dragged. +
+ + +
+ +
+ +
+ isDrag + + +
+ + + + + + + +
+ + isDrag: +boolean + + + +
+ + +
+ Whether this moved +
+ + +
+ +
+ +
+ isDouble + + +
+ + + + + + + +
+ + isDouble: +boolean + + + +
+ + +
+ Whether it is double-click +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnPinchGroup

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ targets to pinch +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnPinchGroupEnd

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ The pinch finished targets +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnPinchGroupStart

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ targets to pinch +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnPinchStart

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

PinchableOptions

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ pinchable + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + pinchable?: +boolean | Array<"rotatable" | "resizable" | "scalable"> + + + +
+ + +
+ Whether or not target can be pinched with draggable, resizable, scalable, rotatable. + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + + + +

Events

+ + + + + + +

pinch

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When pinching, the pinch event is called with part of scale, rotate, resize +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Pinchable.OnPinch + + + + Parameters for the pinch event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    rotatable: true,
+    scalable: true,
+    pinchable: true, // ["rotatable", "scalable"]
+});
+moveable.on("pinch", ({ target }) => {
+    console.log(target);
+});
+moveable.on("rotate", ({ target }) => {
+    console.log(target);
+});
+moveable.on("scale", ({ target }) => {
+    console.log(target);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

pinchEnd

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the pinch finishes, the pinchEnd event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Pinchable.OnPinchEnd + + + + Parameters for the pinchEnd event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    rotatable: true,
+    scalable: true,
+    pinchable: true, // ["rotatable", "scalable"]
+});
+moveable.on("pinchEnd", ({ target }) => {
+    console.log(target);
+});
+moveable.on("rotateEnd", ({ target }) => {
+    console.log(target);
+});
+moveable.on("scaleEnd", ({ target }) => {
+    console.log(target);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

pinchGroup

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the group pinch, the `pinchGroup` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Pinchable.OnPinchGroup + + + + Parameters for the `pinchGroup` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    target: [].slice.call(document.querySelectorAll(".target")),
+    pinchable: true
+});
+moveable.on("pinchGroup", ({ targets, events }) => {
+    console.log("onPinchGroup", targets);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

pinchGroupEnd

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the group pinch finishes, the `pinchGroupEnd` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Pinchable.OnPinchGroupEnd + + + + Parameters for the `pinchGroupEnd` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    target: [].slice.call(document.querySelectorAll(".target")),
+    pinchable: true
+});
+moveable.on("pinchGroupEnd", ({ targets, isDrag }) => {
+    console.log("onPinchGroupEnd", targets, isDrag);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

pinchGroupStart

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the group pinch starts, the `pinchGroupStart` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Pinchable.OnPinchGroupStart + + + + Parameters for the `pinchGroupStart` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    target: [].slice.call(document.querySelectorAll(".target")),
+    pinchable: true
+});
+moveable.on("pinchGroupStart", ({ targets }) => {
+    console.log("onPinchGroupStart", targets);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

pinchStart

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the pinch starts, the pinchStart event is called with part of scaleStart, rotateStart, resizeStart +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Pinchable.OnPinchStart + + + + Parameters for the pinchStart event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    rotatable: true,
+    scalable: true,
+    pinchable: true, // ["rotatable", "scalable"]
+});
+moveable.on("pinchStart", ({ target }) => {
+    console.log(target);
+});
+moveable.on("rotateStart", ({ target }) => {
+    console.log(target);
+});
+moveable.on("scaleStart", ({ target }) => {
+    console.log(target);
+});
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + \ No newline at end of file diff --git a/release/0.52.0/doc/Moveable.Resizable.html b/release/0.52.0/doc/Moveable.Resizable.html new file mode 100644 index 000000000..a1615268e --- /dev/null +++ b/release/0.52.0/doc/Moveable.Resizable.html @@ -0,0 +1,5993 @@ + + + + + Resizable - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

Resizable

+ + + + + + + +
+ +
+ +

+ Moveable. + + Resizable +

+ + +
+ +
+
+ + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
Resizable indicates whether the target's width and height can be increased or decreased.
+ + + + +
+ + + + + + + + + + + + +

Members

+ + + +

throttleResize

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
    +
  • 1
  • +
+ + + + + + + +
+ + + + + +
+ throttle of width, height when resize. If throttleResize is set to less than 1, the target may shake. +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+  resizable: true,
+  throttleResize: 1,
+});
+
+moveable.throttleResize = 0;
+ + + + + +

resizeFormat

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
    +
  • oneself
  • +
+ + + + + + + +
+ + + + + +
+ Function to convert size for resize +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+  resizable: true,
+  resizeFormat: v => v,
+});
+
+moveable.resizeFormat = (size: number[]) => ([Math.trunc(size[0]), Math.trunc(size[1])];
+ + + + + +

resizable

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
    +
  • false
  • +
+ + + + + + + +
+ + + + + +
+ Whether or not target can be resized. +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    resizable: false,
+});
+
+moveable.resizable = true;
+ + + + + +

renderDirections

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
    +
  • ["n", "nw", "ne", "s", "se", "sw", "e", "w"]
  • +
+ + + + + + + +
+ + + + + +
+ Set directions to show the control box. +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+  resizable: true,
+  renderDirections: ["n", "nw", "ne", "s", "se", "sw", "e", "w"],
+});
+
+moveable.renderDirections = ["nw", "ne", "sw", "se"];
+ + + + + +

keepRatio

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
    +
  • false
  • +
+ + + + + + + +
+ + + + + +
+ When resize or scale, keeps a ratio of the width, height. +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+  resizable: true,
+});
+
+moveable.keepRatio = true;
+ + + + + + + +

Methods

+ + + + + + +

request(e) → {Moveable.Requester}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +Moveable.Resizable.ResizableRequestParam + + + + the Resizable's request parameter
+ + + + + + +
Example
+ +
// Instantly Request (requestStart - request - requestEnd)
+// Use Relative Value
+moveable.request("resizable", { deltaWidth: 10, deltaHeight: 10 }, true);
+
+// Use Absolute Value
+moveable.request("resizable", { offsetWidth: 100, offsetHeight: 100 }, true);
+
+// requestStart
+const requester = moveable.request("resizable");
+
+// request
+// Use Relative Value
+requester.request({ deltaWidth: 10, deltaHeight: 10 });
+requester.request({ deltaWidth: 10, deltaHeight: 10 });
+requester.request({ deltaWidth: 10, deltaHeight: 10 });
+
+// Use Absolute Value
+moveable.request("resizable", { offsetWidth: 100, offsetHeight: 100 });
+moveable.request("resizable", { offsetWidth: 110, offsetHeight: 100 });
+moveable.request("resizable", { offsetWidth: 120, offsetHeight: 100 });
+
+// requestEnd
+requester.requestEnd();
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Moveable Requester +
+ + + +
+
+ Type +
+
+ +Moveable.Requester + + +
+
+ + + + + + + + +

Type Definitions

+ + + +

OnBeforeResize

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ + + + + + + + + +
+ + setFixedDirection: +(startDirecition: number[]) => number[] + + + +
+ + +
+ Set a fixed direction to resize. +If fixedDirection is set, the boundingWidth and boundingHeight values can be changed and can be reconfirmed as a return value. + +
+ + +
+ +
+ + + + + + + + + +
+ + startFixedDirection: +number[] + + + +
+ + +
+ fixedDirection set by resizeStart. + +
+ + +
+ +
+ +
+ setSize + + +
+ + + + + + + +
+ + setSize: +(size: number[]) => void + + + +
+ + +
+ Set the bounding size to resizing. + +
+ + +
+ +
+ +
+ boundingWidth + + +
+ + + + + + + +
+ + boundingWidth: +number + + + +
+ + +
+ a target's bounding width before snap and throttle and format + +
+ + +
+ +
+ +
+ boundingHeight + + +
+ + + + + + + +
+ + boundingHeight: +number + + + +
+ + +
+ a target's bounding height before snap and throttle and format + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnBeforeResizeGroup

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ The resizing targets + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnResize

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ style + + +
+ + + + + + + +
+ + style: +Record<string, string> + + + +
+ + +
+ You can get the style you can get from the event. + +
+ + +
+ +
+ +
+ cssText + + +
+ + + + + + + +
+ + cssText: +string + + + +
+ + +
+ You can get it as a cssText that you can get from that event. + +
+ + +
+ +
+ +
+ transform + + +
+ + + + + + + +
+ + transform: +string + + + +
+ + +
+ a target's next transform string value. + +
+ + +
+ +
+ +
+ afterTransform + + +
+ + + + + + + +
+ + afterTransform: +string + + + +
+ + +
+ A transform obtained by the simultaneous occurrence of other events in the current event + +
+ + +
+ +
+ +
+ drag + + +
+ + + + + + + +
+ + drag: +OnDrag + + + +
+ + +
+ transform events causes a `drag` event. In some events, there may be no value. + +
+ + +
+ +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ direction + + +
+ + + + + + + +
+ + direction: +number[] + + + +
+ + +
+ The direction of resize. + +
+ + +
+ +
+ +
+ width + + +
+ + + + + + + +
+ + width: +number + + + +
+ + +
+ a target's cssWidth + +
+ + +
+ +
+ +
+ height + + +
+ + + + + + + +
+ + height: +number + + + +
+ + +
+ a target's cssHeight + +
+ + +
+ +
+ +
+ offsetWidth + + +
+ + + + + + + +
+ + offsetWidth: +number + + + +
+ + +
+ a target's offset width as an integer with bounding width + +
+ + +
+ +
+ +
+ offsetHeight + + +
+ + + + + + + +
+ + offsetHeight: +number + + + +
+ + +
+ a target's offset height as an integer with bounding height + +
+ + +
+ +
+ +
+ boundingWidth + + +
+ + + + + + + +
+ + boundingWidth: +number + + + +
+ + +
+ a target's bounding width + +
+ + +
+ +
+ +
+ boundingHeight + + +
+ + + + + + + +
+ + boundingHeight: +number + + + +
+ + +
+ a target's bounding height + +
+ + +
+ +
+ +
+ dist + + +
+ + + + + + + +
+ + dist: +number[] + + + +
+ + +
+ The distance of [boundingWidth, boundingHeight] + +
+ + +
+ +
+ +
+ delta + + +
+ + + + + + + +
+ + delta: +number[] + + + +
+ + +
+ The delta of [boundingWidth, boundingHeight] + +
+ + +
+ +
+ +
+ startRatio + + +
+ + + + + + + +
+ + startRatio: +number + + + +
+ + +
+ First set (boundingWidth / boundingHeight) value + +
+ + +
+ +
+ +
+ isPinch + + +
+ + + + + + + +
+ + isPinch: +boolean + + + +
+ + +
+ Whether or not it is being pinched. + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnResizeEnd

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ lastEvent + + +
+ + + + + + + +
+ + lastEvent: +any | undefined + + + +
+ + +
+ This is the last dragged event. No, if you haven't dragged. +
+ + +
+ +
+ +
+ isDrag + + +
+ + + + + + + +
+ + isDrag: +boolean + + + +
+ + +
+ Whether this moved +
+ + +
+ +
+ +
+ isDouble + + +
+ + + + + + + +
+ + isDouble: +boolean + + + +
+ + +
+ Whether it is double-click +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnResizeGroup

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ The resizing targets +
+ + +
+ +
+ +
+ events + + +
+ + + + + + + +
+ + events: +OnResize[] + + + +
+ + +
+ Each `resize`event on the targets +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnResizeGroupEnd

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ The resize finished targets +
+ + +
+ +
+ +
+ events + + +
+ + + + + + + +
+ + events: +OnResizeEnd[] + + + +
+ + +
+ Each `resizeEnd` event on the targets +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnResizeGroupStart

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ targets to resize +
+ + +
+ +
+ +
+ events + + +
+ + + + + + + +
+ + events: +OnResizeStart[] + + + +
+ + +
+ Each `resizeStart` event on the targets +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnResizeStart

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ direction + + +
+ + + + + + + +
+ + direction: +number[] + + + +
+ + +
+ The direction of resize. + +
+ + +
+ +
+ +
+ startRatio + + +
+ + + + + + + +
+ + startRatio: +number + + + +
+ + +
+ First set (boundingWidth / boundingHeight) value + +
+ + +
+ +
+ +
+ dragStart + + +
+ + + + + + + +
+ + dragStart: +OnDragStart | false + + + +
+ + +
+ resize causes a `dragStart` event. + +
+ + +
+ +
+ +
+ set + + +
+ + + + + + + +
+ + set: +(size: number[]) => any + + + +
+ + +
+ You can set the css width, height value. + +
+ + +
+ +
+ +
+ setMin + + +
+ + + + + + +
+ Default Value: [minOffsetWidth, minOffsetHeight]) + +
+ + +
+ + setMin: +(minSize: Array<string | number>) => any + + + +
+ + +
+ You can set the css min offset width, min offset height value. + +
+ + +
+ +
+ +
+ setMax + + +
+ + + + + + +
+ Default Value: [maxOffsetWidth, maxOffsetHeight]) + +
+ + +
+ + setMax: +(maxSize: Array<string | number>) => any + + + +
+ + +
+ You can set the css max offset width, max offset height value. + +
+ + +
+ +
+ +
+ setOrigin + + +
+ + + + + + +
+ Default Value: transformOrigin + +
+ + +
+ + setOrigin: +(origin: Array<string | number>) => any + + + +
+ + +
+ You can set the css origin + +
+ + +
+ +
+ + + + + + + + +
+ Default Value: Opposite direction + +
+ + +
+ + setFixedDirection: +(startDirecition: number[]) => any + + + +
+ + +
+ Set a fixed direction to resize. + +
+ + +
+ +
+ +
+ setRatio + + +
+ + + + + + +
+ Default Value: offsetWidth / offsetHeight + +
+ + +
+ + setRatio: +(ratio: number) => any + + + +
+ + +
+ Set the ratio of width and height. + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

ResizableOptions

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ renderDirections + optional + +
+ + + + + + +
+ Default Value: false if rotatable, ["n", "nw", "ne", "s", "se", "sw", "e", "w"] otherwise + +
+ + +
+ + renderDirections?: +boolean | string[] + + + +
+ + +
+ Set directions to show the control box. + +
+ + +
+ +
+ +
+ edge + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + edge?: +boolean | Array<LineDirection> + + + +
+ + +
+ Whether to scale and resize through edge lines. +You can use "n", "w", "s", "e" in LineDirection array. + +
+ + +
+ +
+ +
+ displayAroundControls + optional + +
+ + + +
+ Since: + 0.44.0 + + +
+ + +
+ Story Example: options--options-control-padding +
+ + + +
+ Default Value: false + +
+ + +
+ + displayAroundControls?: +boolean + + + +
+ + +
+ You can expand the area around the control. +Either `rotateAroundControls` or `displayAroundControls` can be used. +You can set the area through the `controlPadding` value. + +
+ + +
+ +
+ +
+ resizable + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + resizable?: +boolean | ResizableOptions + + + +
+ + +
+ Whether or not target can be resized. + +
+ + +
+ +
+ +
+ throttleResize + optional + +
+ + + + + + +
+ Default Value: 1 + +
+ + +
+ + throttleResize?: +number + + + +
+ + +
+ throttle of width, height when resize. + +
+ + +
+ +
+ +
+ keepRatio + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + keepRatio?: +boolean + + + +
+ + +
+ When resize or scale, keeps a ratio of the width, height. + +
+ + +
+ +
+ +
+ keepRatioFinally + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + keepRatioFinally?: +boolean + + + +
+ + +
+ The size can be changed by format and throttle, but the ratio is maintained at the end. Forced true when using groups. + +
+ + +
+ +
+ +
+ resizeFormat + optional + +
+ + + + + + +
+ Default Value: oneself + +
+ + +
+ + resizeFormat?: +(size: number[]) => number[] + + + +
+ + +
+ Function to convert size for resize. + +
+ + +
+ +
+ +
+ edge + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + edge?: +boolean | Array<LineDirection> + + + +
+ + +
+ Whether to scale and resize through edge lines. +You can use "n", "w", "s", "e" in LineDirection array. + +
+ + +
+ +
+ +
+ checkResizableError + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + checkResizableError?: +boolean + + + +
+ + +
+ Whether to recalculate when the size to be calculated is different from the actual size + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

ResizableRequestParam

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ isInstant + optional + +
+ + + + + + + +
+ + isInstant?: +boolean + + + +
+ + +
+ Run the request instantly. (requestStart, request, requestEnd happen at the same time) + +
+ + +
+ +
+ +
+ [key: string] + + +
+ + + + + + + +
+ + [key: string]: +any + + + +
+ + +
+ +
+ + +
+ +
+ +
+ direction + optional + +
+ + + + + + +
+ Default Value: [1, 1] + +
+ + +
+ + direction?: +number[] + + + +
+ + +
+ Direction to resize + +
+ + +
+ +
+ +
+ keepRatio + optional + +
+ + + + + + + +
+ + keepRatio?: +boolean + + + +
+ + +
+ Whether to force keepRatio to resize + +
+ + +
+ +
+ +
+ deltaWidth + optional + +
+ + + + + + + +
+ + deltaWidth?: +number + + + +
+ + +
+ delta number of width + +
+ + +
+ +
+ +
+ deltaHeight + optional + +
+ + + + + + + +
+ + deltaHeight?: +number + + + +
+ + +
+ delta number of height + +
+ + +
+ +
+ +
+ offsetWidth + optional + +
+ + + + + + + +
+ + offsetWidth?: +number + + + +
+ + +
+ offset number of width + +
+ + +
+ +
+ +
+ offsetHeight + optional + +
+ + + + + + + +
+ + offsetHeight?: +number + + + +
+ + +
+ offset number of height + +
+ + +
+ +
+ +
+ horizontal + optional + +
+ + + + + + + +
+ + horizontal?: +boolean + + + +
+ + +
+ +
+ + +
+ +
+ +
+ useSnap + optional + +
+ + + + + + + +
+ + useSnap?: +boolean + + + +
+ + +
+ whether to use with `snappable` + +
+ + +
+ + + + + + + +
+ the Resizable's request parameter +
+ + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + + + +

Events

+ + + + + + +

beforeResize

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When resizing, `beforeResize` is called before `resize` occurs. In `beforeResize`, you can get and set the pre-value before resizing. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Resizable.OnBeforeResize + + + + Parameters for the `beforeResize` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, { resizable: true });
+moveable.on("beforeResize", ({ setFixedDirection }) => {
+    if (shiftKey) {
+       setFixedDirection([0, 0]);
+    }
+});
+moveable.on("resize", ({ target, width, height, drag }) => {
+    target.style.width = `${width}px`;
+    target.style.height = `${height}px`;
+    target.style.transform = drag.transform;
+});
+ + + + + + + + + + + + + + + + + + + + + + +

resize

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When resizing, the resize event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Resizable.OnResize + + + + Parameters for the resize event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, { resizable: true });
+moveable.on("resize", ({ target, width, height }) => {
+    target.style.width = `${e.width}px`;
+    target.style.height = `${e.height}px`;
+});
+ + + + + + + + + + + + + + + + + + + + + + +

resizeEnd

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the resize finishes, the resizeEnd event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Resizable.OnResizeEnd + + + + Parameters for the resizeEnd event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, { resizable: true });
+moveable.on("resizeEnd", ({ target, isDrag }) => {
+    console.log(target, isDrag);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

resizeGroup

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the group resize, the `resizeGroup` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Resizable.onResizeGroup + + + + Parameters for the `resizeGroup` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    target: [].slice.call(document.querySelectorAll(".target")),
+    resizable: true
+});
+moveable.on("resizeGroup", ({ targets, events }) => {
+    console.log("onResizeGroup", targets);
+    events.forEach(ev => {
+        const offset = [
+            direction[0] < 0 ? -ev.delta[0] : 0,
+            direction[1] < 0 ? -ev.delta[1] : 0,
+        ];
+        // ev.drag is a drag event that occurs when the group resize.
+        const left = offset[0] + ev.drag.beforeDist[0];
+        const top = offset[1] + ev.drag.beforeDist[1];
+        const width = ev.width;
+        const top = ev.top;
+    });
+});
+ + + + + + + + + + + + + + + + + + + + + + +

resizeGroupEnd

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the group resize finishes, the `resizeGroupEnd` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Resizable.OnResizeGroupEnd + + + + Parameters for the `resizeGroupEnd` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    target: [].slice.call(document.querySelectorAll(".target")),
+    resizable: true
+});
+moveable.on("resizeGroupEnd", ({ targets, isDrag }) => {
+    console.log("onResizeGroupEnd", targets, isDrag);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

resizeGroupStart

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the group resize starts, the `resizeGroupStart` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Resizable.OnResizeGroupStart + + + + Parameters for the `resizeGroupStart` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    target: [].slice.call(document.querySelectorAll(".target")),
+    resizable: true
+});
+moveable.on("resizeGroupStart", ({ targets }) => {
+    console.log("onResizeGroupStart", targets);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

resizeStart

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the resize starts, the resizeStart event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Resizable.OnResizeStart + + + + Parameters for the resizeStart event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, { resizable: true });
+moveable.on("resizeStart", ({ target }) => {
+    console.log(target);
+});
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + \ No newline at end of file diff --git a/release/0.52.0/doc/Moveable.Rotatable.html b/release/0.52.0/doc/Moveable.Rotatable.html new file mode 100644 index 000000000..22c9d5517 --- /dev/null +++ b/release/0.52.0/doc/Moveable.Rotatable.html @@ -0,0 +1,5584 @@ + + + + + Rotatable - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

Rotatable

+ + + + + + + +
+ +
+ +

+ Moveable. + + Rotatable +

+ + +
+ +
+
+ + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
Rotatable indicates whether the target can be rotated.
+ + + + +
+ + + + + + + + + + + + +

Members

+ + + +

throttleRotate

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ throttle of angle(degree) when rotate. +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+moveable.throttleRotate = 1;
+ + + + + +

rotationPosition

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ You can specify the position of the rotation. (default: "top") +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+  rotationPosition: "top",
+});
+
+moveable.rotationPosition = "bottom"
+ + + + + +

rotatable

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Whether or not target can be rotated. (default: false) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+moveable.rotatable = true;
+ + + + + + + +

Methods

+ + + + + + +

request(eopt, e.deltaRotateopt, e.rotateopt) → {Moveable.Requester}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e? + + +object + + + + the Resizable's request parameter +
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
deltaRotate? + + +number + + + + + + 0 + + delta number of rotation
rotate? + + +number + + + + + + 0 + + absolute number of moveable's rotation
+ +
+ + + + + + +
Example
+ +
// Instantly Request (requestStart - request - requestEnd)
+moveable.request("rotatable", { deltaRotate: 10 }, true);
+
+* moveable.request("rotatable", { rotate: 10 }, true);
+
+// requestStart
+const requester = moveable.request("rotatable");
+
+// request
+requester.request({ deltaRotate: 10 });
+requester.request({ deltaRotate: 10 });
+requester.request({ deltaRotate: 10 });
+
+requester.request({ rotate: 10 });
+requester.request({ rotate: 20 });
+requester.request({ rotate: 30 });
+
+// requestEnd
+requester.requestEnd();
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Moveable Requester +
+ + + +
+
+ Type +
+
+ +Moveable.Requester + + +
+
+ + + + + + + + +

Type Definitions

+ + + +

OnBeforeRotate

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ beforeRotation + + +
+ + + + + + + +
+ + beforeRotation: +number + + + +
+ + +
+ The rotation degree before transform is applied before snap and throttle and format + +
+ + +
+ +
+ +
+ rotation + + +
+ + + + + + + +
+ + rotation: +number + + + +
+ + +
+ The rotation degree before snap and throttle and format + +
+ + +
+ +
+ + + + + + + + + +
+ + absoluteRotation: +number + + + +
+ + +
+ The client rotation degree before snap and throttle and format + +
+ + +
+ +
+ +
+ setRotation + + +
+ + + + + + + +
+ + setRotation: +(nextRotation: number) => void + + + +
+ + +
+ You can set the value of `rotation`. + +
+ + +
+ + + + + + + +
+ Parameters for the `beforeRotate` event +
+ + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnBeforeRotateGroup

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ The rotating targets + +
+ + +
+ + + + + + + +
+ Parameters for the `beforeRotateGroup` event +
+ + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnRotate

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ style + + +
+ + + + + + + +
+ + style: +Record<string, string> + + + +
+ + +
+ You can get the style you can get from the event. + +
+ + +
+ +
+ +
+ cssText + + +
+ + + + + + + +
+ + cssText: +string + + + +
+ + +
+ You can get it as a cssText that you can get from that event. + +
+ + +
+ +
+ +
+ transform + + +
+ + + + + + + +
+ + transform: +string + + + +
+ + +
+ a target's next transform string value. + +
+ + +
+ +
+ +
+ afterTransform + + +
+ + + + + + + +
+ + afterTransform: +string + + + +
+ + +
+ A transform obtained by the simultaneous occurrence of other events in the current event + +
+ + +
+ +
+ +
+ drag + + +
+ + + + + + + +
+ + drag: +OnDrag + + + +
+ + +
+ transform events causes a `drag` event. In some events, there may be no value. + +
+ + +
+ +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ beforeDist + + +
+ + + + + + + +
+ + beforeDist: +number + + + +
+ + +
+ The distance of rotation degree before transform is applied + +
+ + +
+ +
+ +
+ beforeDelta + + +
+ + + + + + + +
+ + beforeDelta: +number + + + +
+ + +
+ The delta of rotation degree before transform is applied + +
+ + +
+ +
+ +
+ beforeRotate + + +
+ + + + + + + +
+ + beforeRotate: +number + + + +
+ + +
+ The now rotation degree before transform is applied + +
+ + +
+ +
+ +
+ beforeRotation + + +
+ + + + + + + +
+ + beforeRotation: +number + + + +
+ + +
+ The now rotation degree before transform is applied + +
+ + +
+ +
+ +
+ dist + + +
+ + + + + + + +
+ + dist: +number + + + +
+ + +
+ The distance of rotation degree + +
+ + +
+ +
+ +
+ delta + + +
+ + + + + + + +
+ + delta: +number + + + +
+ + +
+ The delta of rotation degree + +
+ + +
+ +
+ +
+ rotate + + +
+ + + + + + + +
+ + rotate: +number + + + +
+ + +
+ The now rotation degree + +
+ + +
+ +
+ +
+ rotation + + +
+ + + + + + + +
+ + rotation: +number + + + +
+ + +
+ The now rotation degree + +
+ + +
+ +
+ +
+ absoluteDist + + +
+ + + + + + + +
+ + absoluteDist: +number + + + +
+ + +
+ The distance of client rotation degree + +
+ + +
+ +
+ +
+ absoluteDelta + + +
+ + + + + + + +
+ + absoluteDelta: +number + + + +
+ + +
+ The delta of client rotation degree + +
+ + +
+ +
+ +
+ absoluteRotate + + +
+ + + + + + + +
+ + absoluteRotate: +number + + + +
+ + +
+ The now client rotation degree + +
+ + +
+ +
+ + + + + + + + + +
+ + absoluteRotation: +number + + + +
+ + +
+ The now client rotation degree + +
+ + +
+ +
+ +
+ isPinch + + +
+ + + + + + + +
+ + isPinch: +boolean + + + +
+ + +
+ Whether or not it is being pinched. + +
+ + +
+ +
+ +
+ resize + optional + +
+ + + + + + + +
+ + resize?: +OnResize + + + +
+ + +
+ rotate causes a `resize` event. + +
+ + +
+ + + + + + + +
+ Parameters for the `rotate` event +
+ + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnRotateEnd

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ lastEvent + + +
+ + + + + + + +
+ + lastEvent: +any | undefined + + + +
+ + +
+ This is the last dragged event. No, if you haven't dragged. +
+ + +
+ +
+ +
+ isDrag + + +
+ + + + + + + +
+ + isDrag: +boolean + + + +
+ + +
+ Whether this moved +
+ + +
+ +
+ +
+ isDouble + + +
+ + + + + + + +
+ + isDouble: +boolean + + + +
+ + +
+ Whether it is double-click +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnRotateGroup

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ The rotating targets + +
+ + +
+ +
+ +
+ events + + +
+ + + + + + + +
+ + events: +OnRotate[] + + + +
+ + +
+ Each `rotate` event on the targets + +
+ + +
+ +
+ +
+ set + + +
+ + + + + + + +
+ + set: +(rotation: number) => any + + + +
+ + +
+ You can set the group's rotation. + +
+ + +
+ +
+ + + + + + + + + +
+ + setGroupRotation: +(rotation: number) => any + + + +
+ + +
+ You can set the group's rotation. + +
+ + +
+ + + + + + + +
+ Parameters for the `rotateGroup` event +
+ + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnRotateGroupEnd

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ The rotate finished targets +
+ + +
+ +
+ +
+ events + + +
+ + + + + + + +
+ + events: +OnRotateEnd[] + + + +
+ + +
+ Each `rotateEnd` event on the targets +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnRotateGroupStart

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ targets to rotate +
+ + +
+ +
+ +
+ events + + +
+ + + + + + + +
+ + events: +OnRotateStart[] + + + +
+ + +
+ Each `rotateStart` event on the targets +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnRotateStart

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ setTransform + + +
+ + + + + + +
+ Default Value: transform of target's inline style + +
+ + +
+ + setTransform: +(transform: string | string[], transformIndex?: number) => void + + + +
+ + +
+ Set your original transform. +`transformIndex` is the sequence of functions used in the event. +If you use `setTransform`, you don't need to use `set` function. + +
+ + +
+ +
+ + + + + + + + +
+ Default Value: index with that property in transform or last + +
+ + +
+ + setTransformIndex: +(transformIndex: number) => void + + + +
+ + +
+ `transformIndex` is the sequence of functions used in the event. + +
+ + +
+ +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ set + + +
+ + + + + + + +
+ + set: +(rotate: number) => void + + + +
+ + +
+ You can set the start rotate value. + +
+ + +
+ +
+ + + + + + + + +
+ Default Value: target's transformOrigin + +
+ + +
+ + setFixedDirection: +(fixedDirection: number[]) => void + + + +
+ + +
+ Set a fixed direction to rotate. + +
+ + +
+ +
+ + + + + + + + +
+ Default Value: target's transformOrigin + +
+ + +
+ + setFixedPosition: +(fixedPosition: number[]) => void + + + +
+ + +
+ Set a fixed position to rotate. + +
+ + +
+ +
+ +
+ dragStart + + +
+ + + + + + + +
+ + dragStart: +OnDragStart | false + + + +
+ + +
+ rotate causes a `dragStart` event. + +
+ + +
+ +
+ +
+ resizeStart + + +
+ + + + + + + +
+ + resizeStart: +OnResizeStart | false + + + +
+ + +
+ rotate causes a `resizeStart` event. + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

RotatableOptions

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ renderDirections + optional + +
+ + + + + + +
+ Default Value: false if rotatable, ["n", "nw", "ne", "s", "se", "sw", "e", "w"] otherwise + +
+ + +
+ + renderDirections?: +boolean | string[] + + + +
+ + +
+ Set directions to show the control box. + +
+ + +
+ +
+ +
+ edge + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + edge?: +boolean | Array<LineDirection> + + + +
+ + +
+ Whether to scale and resize through edge lines. +You can use "n", "w", "s", "e" in LineDirection array. + +
+ + +
+ +
+ +
+ displayAroundControls + optional + +
+ + + +
+ Since: + 0.44.0 + + +
+ + +
+ Story Example: options--options-control-padding +
+ + + +
+ Default Value: false + +
+ + +
+ + displayAroundControls?: +boolean + + + +
+ + +
+ You can expand the area around the control. +Either `rotateAroundControls` or `displayAroundControls` can be used. +You can set the area through the `controlPadding` value. + +
+ + +
+ +
+ +
+ rotatable + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + rotatable?: +boolean | RotatableOptions + + + +
+ + +
+ Whether or not target can be rotated. + +
+ + +
+ +
+ +
+ rotationPosition + optional + +
+ + + + + + +
+ Default Value: "top" + +
+ + +
+ + rotationPosition?: +RotationPosition | RotationPosition[] + + + +
+ + +
+ You can specify the position of the rotation. + +
+ + +
+ +
+ +
+ rotateAroundControls + optional + +
+ + + + + + +
+ Default Value: 0 + +
+ + +
+ + rotateAroundControls?: +boolean + + + +
+ + +
+ You can rotate around direction controls. +Either `rotateAroundControls` or `displayAroundControls` can be used. + +
+ + +
+ +
+ +
+ resolveAblesWithRotatable + optional + +
+ + + + + + +
+ Default Value: null + +
+ + +
+ + resolveAblesWithRotatable?: +Record<string, LineDirection[]> | null | undefined + + + +
+ + +
+ Sets the control that will cause resize along with rotate. (Only Single Target, Only resizable, Beta) + +
+ + +
+ +
+ +
+ throttleRotate + optional + +
+ + + + + + +
+ Default Value: 0 + +
+ + +
+ + throttleRotate?: +number + + + +
+ + +
+ throttle of angle(degree) when rotate. + +
+ + +
+ +
+ +
+ rotationTarget + optional + +
+ + + + + + +
+ Default Value: null + +
+ + +
+ + rotationTarget?: +MoveableRefType | ArrayFormat<MoveableRefType> | false + + + +
+ + +
+ Set additional rotationTargets. + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

RotatableRequestParam

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ isInstant + optional + +
+ + + + + + + +
+ + isInstant?: +boolean + + + +
+ + +
+ Run the request instantly. (requestStart, request, requestEnd happen at the same time) + +
+ + +
+ +
+ +
+ [key: string] + + +
+ + + + + + + +
+ + [key: string]: +any + + + +
+ + +
+ +
+ + +
+ +
+ +
+ deltaRotate + optional + +
+ + + + + + + +
+ + deltaRotate?: +number + + + +
+ + +
+ delta number of rotation + +
+ + +
+ +
+ +
+ rotate + optional + +
+ + + + + + + +
+ + rotate?: +number + + + +
+ + +
+ absolute number of moveable's rotation + +
+ + +
+ + + + + + + +
+ the Rotatable's request parameter +
+ + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + + + +

Events

+ + + + + + +

rotate

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When rotating, the rotate event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Rotatable.OnRotate + + + + Parameters for the rotate event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, { rotatable: true });
+moveable.on("rotate", ({ target, transform, dist }) => {
+    target.style.transform = transform;
+});
+ + + + + + + + + + + + + + + + + + + + + + +

rotateEnd

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the rotate finishes, the rotateEnd event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Rotatable.OnRotateEnd + + + + Parameters for the rotateEnd event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, { rotatable: true });
+moveable.on("rotateEnd", ({ target, isDrag }) => {
+    console.log(target, isDrag);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

rotateGroup

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the group rotate, the `rotateGroup` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Rotatable.OnRotateGroup + + + + Parameters for the `rotateGroup` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    target: [].slice.call(document.querySelectorAll(".target")),
+    rotatable: true
+});
+moveable.on("rotateGroup", ({ targets, events }) => {
+    console.log("onRotateGroup", targets);
+    events.forEach(ev => {
+        const target = ev.target;
+        // ev.drag is a drag event that occurs when the group rotate.
+        const left = ev.drag.beforeDist[0];
+        const top = ev.drag.beforeDist[1];
+        const deg = ev.beforeDist;
+    });
+});
+ + + + + + + + + + + + + + + + + + + + + + +

rotateGroupEnd

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the group rotate finishes, the `rotateGroupEnd` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Rotatable.OnRotateGroupEnd + + + + Parameters for the `rotateGroupEnd` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    target: [].slice.call(document.querySelectorAll(".target")),
+    rotatable: true
+});
+moveable.on("rotateGroupEnd", ({ targets, isDrag }) => {
+    console.log("onRotateGroupEnd", targets, isDrag);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

rotateGroupStart

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the group rotate starts, the `rotateGroupStart` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Rotatable.OnRotateGroupStart + + + + Parameters for the `rotateGroupStart` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    target: [].slice.call(document.querySelectorAll(".target")),
+    rotatable: true
+});
+moveable.on("rotateGroupStart", ({ targets }) => {
+    console.log("onRotateGroupStart", targets);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

rotateStart

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the rotate starts, the rotateStart event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Rotatable.OnRotateStart + + + + Parameters for the rotateStart event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, { rotatable: true });
+moveable.on("rotateStart", ({ target }) => {
+    console.log(target);
+});
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + \ No newline at end of file diff --git a/release/0.52.0/doc/Moveable.Roundable.html b/release/0.52.0/doc/Moveable.Roundable.html new file mode 100644 index 000000000..148928768 --- /dev/null +++ b/release/0.52.0/doc/Moveable.Roundable.html @@ -0,0 +1,4064 @@ + + + + + Roundable - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

Roundable

+ + + + + + + +
+ +
+ +

+ Moveable. + + Roundable +

+ + +
+ +
+
+ + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
Whether to show and drag or double click border-radius
+ + + + +
+ + + + + + + + + + + + +

Members

+ + + +

roundRelative

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ % Can be used instead of the absolute px +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    roundable: true,
+    roundRelative: false,
+});
+moveable.on("roundStart", e => {
+    console.log(e);
+}).on("round", e => {
+    e.target.style.borderRadius = e.borderRadius;
+}).on("roundEnd", e => {
+    console.log(e);
+});
+ + + + + +

roundPadding

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
    +
  • false
  • +
+ + + + + + + +
+ + + + + +
+ The padding value of the position of the round control +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    roundable: true,
+    roundPadding: 0,
+});
+moveable.roundPadding = 15;
+ + + + + +

roundClickable

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
    +
  • true
  • +
+ + + + + + + +
+ + + + + +
+ Whether you can add/delete round controls by double-clicking a line or control. +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    roundable: true,
+    roundRelative: false,
+    roundClickable: true,
+});
+moveable.roundClickable = false;
+ + + + + +

roundable

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Whether to show and drag or double click border-radius, (default: false) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    roundable: true,
+    roundRelative: false,
+});
+moveable.on("roundStart", e => {
+    console.log(e);
+}).on("round", e => {
+    e.target.style.borderRadius = e.borderRadius;
+}).on("roundEnd", e => {
+    console.log(e);
+});
+ + + + + +

minRoundControls

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Minimum number of round controls. It moves in proportion by control. [horizontal, vertical] (default: [0, 0]) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    roundable: true,
+    roundRelative: false,
+    minRoundControls: [0, 0],
+});
+moveable.minRoundControls = [1, 0];
+ + + + + +

maxRoundControls

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Maximum number of round controls. It moves in proportion by control. [horizontal, vertical] (default: [4, 4]) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    roundable: true,
+    roundRelative: false,
+    maxRoundControls: [4, 4],
+});
+moveable.maxRoundControls = [1, 0];
+ + + + + +

isDisplayShadowRoundControls

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
    +
  • false
  • +
+ + + + + + + +
+ + + + + +
+ Whether to show a round control that does not actually exist as a shadow +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    roundable: true,
+    isDisplayShadowRoundControls: false,
+});
+moveable.isDisplayShadowRoundControls = true;
+ + + + + + + + + +

Type Definitions

+ + + +

OnRound

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ style + + +
+ + + + + + + +
+ + style: +Record<string, string> + + + +
+ + +
+ You can get the style you can get from the event. + +
+ + +
+ +
+ +
+ cssText + + +
+ + + + + + + +
+ + cssText: +string + + + +
+ + +
+ You can get it as a cssText that you can get from that event. + +
+ + +
+ +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ width + + +
+ + + + + + + +
+ + width: +number + + + +
+ + +
+ Offset width of target +
+ + +
+ +
+ +
+ height + + +
+ + + + + + + +
+ + height: +number + + + +
+ + +
+ Offset height of target +
+ + +
+ +
+ +
+ delta + + +
+ + + + + + + +
+ + delta: +number[] + + + +
+ + +
+ The delta of [x, y] +
+ + +
+ +
+ +
+ dist + + +
+ + + + + + + +
+ + dist: +number[] + + + +
+ + +
+ The distance of [x, y] +
+ + +
+ +
+ +
+ horizontals + + +
+ + + + + + + +
+ + horizontals: +number[] + + + +
+ + +
+ The target's moved border-radius's horizontal poses +
+ + +
+ +
+ +
+ verticals + + +
+ + + + + + + +
+ + verticals: +number[] + + + +
+ + +
+ The target's moved border-radius's vertical poses +
+ + +
+ +
+ +
+ borderRadius + + +
+ + + + + + + +
+ + borderRadius: +string + + + +
+ + +
+ The target's moved border-radius +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnRoundEnd

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ lastEvent + + +
+ + + + + + + +
+ + lastEvent: +any | undefined + + + +
+ + +
+ This is the last dragged event. No, if you haven't dragged. +
+ + +
+ +
+ +
+ isDrag + + +
+ + + + + + + +
+ + isDrag: +boolean + + + +
+ + +
+ Whether this moved +
+ + +
+ +
+ +
+ isDouble + + +
+ + + + + + + +
+ + isDouble: +boolean + + + +
+ + +
+ Whether it is double-click +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnRoundGroup

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ moveable's targets + +
+ + +
+ +
+ +
+ events + + +
+ + + + + + + +
+ + events: +OnRound[] + + + +
+ + +
+ moveable's child events + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnRoundGroupEnd

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ moveable's targets + +
+ + +
+ +
+ +
+ events + + +
+ + + + + + + +
+ + events: +OnRoundEnd[] + + + +
+ + +
+ moveable's child events + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnRoundGroupStart

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ moveable's targets + +
+ + +
+ +
+ +
+ events + + +
+ + + + + + + +
+ + events: +OnRoundStart[] + + + +
+ + +
+ moveable's child events + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnRoundStart

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

RoundableOptions

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ roundable + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + roundable?: +boolean + + + +
+ + +
+ Whether to show and drag border-radius. + +
+ + +
+ +
+ +
+ roundRelative + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + roundRelative?: +boolean + + + +
+ + +
+ % Can be used instead of the absolute px + +
+ + +
+ +
+ +
+ minRoundControls + optional + +
+ + + + + + +
+ Default Value: [0, 0] + +
+ + +
+ + minRoundControls?: +number[] + + + +
+ + +
+ Minimum number of round controls. It moves in proportion by control. [horizontal, vertical] + +
+ + +
+ +
+ +
+ maxRoundControls + optional + +
+ + + + + + +
+ Default Value: [4, 4] + +
+ + +
+ + maxRoundControls?: +number[] + + + +
+ + +
+ Maximum number of round controls. It moves in proportion by control. [horizontal, vertical] + +
+ + +
+ +
+ +
+ roundClickable + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + roundClickable?: +boolean | "line" | "control" + + + +
+ + +
+ Whether you can add/delete round controls by double-clicking a line or control. + +
+ + +
+ +
+ +
+ isDisplayShadowRoundControls + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + isDisplayShadowRoundControls?: +boolean | "horizontal" + + + +
+ + +
+ Whether to show a round control that does not actually exist as a shadow + +
+ + +
+ +
+ +
+ roundPadding + optional + +
+ + + + + + +
+ Default Value: 0 + +
+ + +
+ + roundPadding?: +number + + + +
+ + +
+ The padding value of the position of the round control + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + + + +

Events

+ + + + + + +

round

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When drag or double click the border area or controls, the `round` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Roundable.OnRound + + + + Parameters for the `round` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    roundable: true,
+    roundRelative: false,
+});
+moveable.on("roundStart", e => {
+    console.log(e);
+}).on("round", e => {
+    e.target.style.borderRadius = e.borderRadius;
+}).on("roundEnd", e => {
+    console.log(e);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

roundEnd

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When drag end the border area or controls, the `roundEnd` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Roundable.onRoundEnd + + + + Parameters for the `roundEnd` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    roundable: true,
+    roundRelative: false,
+});
+moveable.on("roundStart", e => {
+    console.log(e);
+}).on("round", e => {
+    e.target.style.borderRadius = e.borderRadius;
+}).on("roundEnd", e => {
+    console.log(e);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

roundGroup

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When drag or double click the border area or controls, the `roundGroup` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Roundable.OnRoundGroup + + + + Parameters for the `roundGroup` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    targets: [target1, target2, target3],
+    roundable: true,
+});
+moveable.on("roundGroupStart", e => {
+    console.log(e.targets);
+}).on("roundGroup", e => {
+  e.events.forEach(ev => {
+      ev.target.style.cssText += ev.cssText;
+  });
+}).on("roundGroupEnd", e => {
+    console.log(e);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

roundGroupEnd

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When drag end the border area or controls, the `roundGroupEnd` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Roundable.onRoundGroupEnd + + + + Parameters for the `roundGroupEnd` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    targets: [target1, target2, target3],
+    roundable: true,
+});
+moveable.on("roundGroupStart", e => {
+    console.log(e.targets);
+}).on("roundGroup", e => {
+    e.events.forEach(ev => {
+        ev.target.style.cssText += ev.cssText;
+    });
+}).on("roundGroupEnd", e => {
+    console.log(e);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

roundGroupStart

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When drag start the clip area or controls, the `roundGroupStart` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Roundable.OnRoundGroupStart + + + + Parameters for the `roundGroupStart` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    targets: [target1, target2, target3],
+    roundable: true,
+});
+moveable.on("roundGroupStart", e => {
+    console.log(e.targets);
+}).on("roundGroup", e => {
+  e.events.forEach(ev => {
+      ev.target.style.cssText += ev.cssText;
+  });
+}).on("roundGroupEnd", e => {
+    console.log(e);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

roundStart

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When drag start the clip area or controls, the `roundStart` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Roundable.OnRoundStart + + + + Parameters for the `roundStart` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    roundable: true,
+    roundRelative: false,
+});
+moveable.on("roundStart", e => {
+    console.log(e);
+}).on("round", e => {
+    e.target.style.borderRadius = e.borderRadius;
+}).on("roundEnd", e => {
+    console.log(e);
+});
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + \ No newline at end of file diff --git a/release/0.52.0/doc/Moveable.Scalable.html b/release/0.52.0/doc/Moveable.Scalable.html new file mode 100644 index 000000000..955061a80 --- /dev/null +++ b/release/0.52.0/doc/Moveable.Scalable.html @@ -0,0 +1,5511 @@ + + + + + Scalable - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

Scalable

+ + + + + + + +
+ +
+ +

+ Moveable. + + Scalable +

+ + +
+ +
+
+ + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
Scalable indicates whether the target's x and y can be scale of transform.
+ + + + +
+ + + + + + + + + + + + +

Members

+ + + +

throttleScale

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ throttle of scaleX, scaleY when scale. +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+moveable.throttleScale = 0.1;
+ + + + + +

scalable

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
    +
  • false
  • +
+ + + + + + + +
+ + + + + +
+ Whether or not target can scaled. +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+moveable.scalable = true;
+ + + + + +

renderDirections

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Set directions to show the control box. (default: ["n", "nw", "ne", "s", "se", "sw", "e", "w"]) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    scalable: true,
+  renderDirections: ["n", "nw", "ne", "s", "se", "sw", "e", "w"],
+});
+
+moveable.renderDirections = ["nw", "ne", "sw", "se"];
+ + + + + +

keepRatio

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When resize or scale, keeps a ratio of the width, height. (default: false) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    scalable: true,
+});
+
+moveable.keepRatio = true;
+ + + + + + + +

Methods

+ + + + + + +

request(e) → {Moveable.Requester}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +Moveable.Scalable.ScalableRequestParam + + + + the Scalable's request parameter
+ + + + + + +
Example
+ +
// Instantly Request (requestStart - request - requestEnd)
+moveable.request("scalable", { deltaWidth: 10, deltaHeight: 10 }, true);
+
+// requestStart
+const requester = moveable.request("scalable");
+
+// request
+requester.request({ deltaWidth: 10, deltaHeight: 10 });
+requester.request({ deltaWidth: 10, deltaHeight: 10 });
+requester.request({ deltaWidth: 10, deltaHeight: 10 });
+
+// requestEnd
+requester.requestEnd();
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Moveable Requester +
+ + + +
+
+ Type +
+
+ +Moveable.Requester + + +
+
+ + + + + + + + +

Type Definitions

+ + + +

OnBeforeScale

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ + + + + + + + + +
+ + setFixedDirection: +(startDirecition: number[]) => number[] + + + +
+ + +
+ Set a fixed direction to scale. +If fixedDirection is set, the scale values can be changed and can be reconfirmed as a return value. + +
+ + +
+ +
+ + + + + + + + + +
+ + startFixedDirection: +number[] + + + +
+ + +
+ fixedDirection set by rotateStart. + +
+ + +
+ +
+ +
+ setScale + + +
+ + + + + + + +
+ + setScale: +(scale: number[]) => void + + + +
+ + +
+ Set target's scale to scaling. + +
+ + +
+ +
+ +
+ scale + + +
+ + + + + + + +
+ + scale: +number[] + + + +
+ + +
+ a target's scale before snap and throttle and format + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnBeforeScaleGroup

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ The scaling targets +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnScale

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ style + + +
+ + + + + + + +
+ + style: +Record<string, string> + + + +
+ + +
+ You can get the style you can get from the event. + +
+ + +
+ +
+ +
+ cssText + + +
+ + + + + + + +
+ + cssText: +string + + + +
+ + +
+ You can get it as a cssText that you can get from that event. + +
+ + +
+ +
+ +
+ transform + + +
+ + + + + + + +
+ + transform: +string + + + +
+ + +
+ a target's next transform string value. + +
+ + +
+ +
+ +
+ afterTransform + + +
+ + + + + + + +
+ + afterTransform: +string + + + +
+ + +
+ A transform obtained by the simultaneous occurrence of other events in the current event + +
+ + +
+ +
+ +
+ drag + + +
+ + + + + + + +
+ + drag: +OnDrag + + + +
+ + +
+ transform events causes a `drag` event. In some events, there may be no value. + +
+ + +
+ +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ direction + + +
+ + + + + + + +
+ + direction: +number[] + + + +
+ + +
+ The direction of scale. +
+ + +
+ +
+ +
+ offsetWidth + + +
+ + + + + + + +
+ + offsetWidth: +number + + + +
+ + +
+ a target's offsetWidth +
+ + +
+ +
+ +
+ offsetHeight + + +
+ + + + + + + +
+ + offsetHeight: +number + + + +
+ + +
+ a target's offsetHeight +
+ + +
+ +
+ +
+ scale + + +
+ + + + + + + +
+ + scale: +number[] + + + +
+ + +
+ a target's scale +
+ + +
+ +
+ +
+ dist + + +
+ + + + + + + +
+ + dist: +number[] + + + +
+ + +
+ The distance of scale +
+ + +
+ +
+ +
+ delta + + +
+ + + + + + + +
+ + delta: +number[] + + + +
+ + +
+ The delta of scale +
+ + +
+ +
+ +
+ isPinch + + +
+ + + + + + + +
+ + isPinch: +boolean + + + +
+ + +
+ Whether or not it is being pinched. +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnScaleEnd

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ lastEvent + + +
+ + + + + + + +
+ + lastEvent: +any | undefined + + + +
+ + +
+ This is the last dragged event. No, if you haven't dragged. +
+ + +
+ +
+ +
+ isDrag + + +
+ + + + + + + +
+ + isDrag: +boolean + + + +
+ + +
+ Whether this moved +
+ + +
+ +
+ +
+ isDouble + + +
+ + + + + + + +
+ + isDouble: +boolean + + + +
+ + +
+ Whether it is double-click +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnScaleGroup

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ The scaling targets +
+ + +
+ +
+ +
+ events + + +
+ + + + + + + +
+ + events: +OnScale[] + + + +
+ + +
+ Each `scale` & `drag` event on the targets +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnScaleGroupEnd

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ The scale finished targets +
+ + +
+ +
+ +
+ events + + +
+ + + + + + + +
+ + events: +OnScaleEnd[] + + + +
+ + +
+ Each `scaleEnd` event on the targets +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnScaleGroupStart

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ targets to scale +
+ + +
+ +
+ +
+ events + + +
+ + + + + + + +
+ + events: +OnScaleStart[] + + + +
+ + +
+ Each `scaleStart` & `dragStart` event on the targets +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnScaleStart

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ setTransform + + +
+ + + + + + +
+ Default Value: transform of target's inline style + +
+ + +
+ + setTransform: +(transform: string | string[], transformIndex?: number) => void + + + +
+ + +
+ Set your original transform. +`transformIndex` is the sequence of functions used in the event. +If you use `setTransform`, you don't need to use `set` function. + +
+ + +
+ +
+ + + + + + + + +
+ Default Value: index with that property in transform or last + +
+ + +
+ + setTransformIndex: +(transformIndex: number) => void + + + +
+ + +
+ `transformIndex` is the sequence of functions used in the event. + +
+ + +
+ +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ direction + + +
+ + + + + + + +
+ + direction: +number[] + + + +
+ + +
+ The direction of scale. + +
+ + +
+ +
+ +
+ dragStart + + +
+ + + + + + + +
+ + dragStart: +OnDragStart | false + + + +
+ + +
+ scale causes a `dragStart` event. + +
+ + +
+ +
+ +
+ set + + +
+ + + + + + + +
+ + set: +(scale: number[]) => void + + + +
+ + +
+ You can set the start scale value. + +
+ + +
+ +
+ + + + + + + + +
+ Default Value: Opposite direction + +
+ + +
+ + setFixedDirection: +(startDirecition: number[]) => void + + + +
+ + +
+ Set a fixed direction to scale. + +
+ + +
+ +
+ +
+ setRatio + + +
+ + + + + + +
+ Default Value: offsetWidth / offsetHeight + +
+ + +
+ + setRatio: +(ratio: number) => void + + + +
+ + +
+ Set the ratio of width and height. + +
+ + +
+ +
+ +
+ setMinScaleSize + + +
+ + + + + + +
+ Default Value: [-Infinity, -Infinity] + +
+ + +
+ + setMinScaleSize: +(min: number[]) => void + + + +
+ + +
+ You can set the min scale width, height value. +scale size = scale value * offset size + +
+ + +
+ +
+ +
+ setMaxScaleSize + + +
+ + + + + + +
+ Default Value: [Infinity, Infinity] + +
+ + +
+ + setMaxScaleSize: +(max: number[]) => void + + + +
+ + +
+ You can set the max scale width, height value. +scale size = scale value * offset size + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

ScalableOptions

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ renderDirections + optional + +
+ + + + + + +
+ Default Value: false if rotatable, ["n", "nw", "ne", "s", "se", "sw", "e", "w"] otherwise + +
+ + +
+ + renderDirections?: +boolean | string[] + + + +
+ + +
+ Set directions to show the control box. + +
+ + +
+ +
+ +
+ edge + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + edge?: +boolean | Array<LineDirection> + + + +
+ + +
+ Whether to scale and resize through edge lines. +You can use "n", "w", "s", "e" in LineDirection array. + +
+ + +
+ +
+ +
+ displayAroundControls + optional + +
+ + + +
+ Since: + 0.44.0 + + +
+ + +
+ Story Example: options--options-control-padding +
+ + + +
+ Default Value: false + +
+ + +
+ + displayAroundControls?: +boolean + + + +
+ + +
+ You can expand the area around the control. +Either `rotateAroundControls` or `displayAroundControls` can be used. +You can set the area through the `controlPadding` value. + +
+ + +
+ +
+ +
+ scalable + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + scalable?: +boolean | ScalableOptions + + + +
+ + +
+ Whether or not target can be scaled. + +
+ + +
+ +
+ +
+ throttleScale + optional + +
+ + + + + + +
+ Default Value: 0 + +
+ + +
+ + throttleScale?: +number + + + +
+ + +
+ throttle of scaleX, scaleY when scale. + +
+ + +
+ +
+ +
+ keepRatio + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + keepRatio?: +boolean + + + +
+ + +
+ When resize or scale, keeps a ratio of the width, height. + +
+ + +
+ +
+ +
+ edge + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + edge?: +boolean | Array<LineDirection> + + + +
+ + +
+ Whether to scale and resize through edge lines. +You can use "n", "w", "s", "e" in LineDirection array. + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

ScalableRequestParam

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ isInstant + optional + +
+ + + + + + + +
+ + isInstant?: +boolean + + + +
+ + +
+ Run the request instantly. (requestStart, request, requestEnd happen at the same time) + +
+ + +
+ +
+ +
+ [key: string] + + +
+ + + + + + + +
+ + [key: string]: +any + + + +
+ + +
+ +
+ + +
+ +
+ +
+ direction + optional + +
+ + + + + + +
+ Default Value: [1, 1] + +
+ + +
+ + direction?: +number[] + + + +
+ + +
+ Direction to scale + +
+ + +
+ +
+ +
+ keepRatio + optional + +
+ + + + + + + +
+ + keepRatio?: +boolean + + + +
+ + +
+ Whether to force keepRatio to resize + +
+ + +
+ +
+ +
+ deltaWidth + optional + +
+ + + + + + + +
+ + deltaWidth?: +number + + + +
+ + +
+ delta number of width + +
+ + +
+ +
+ +
+ deltaHeight + optional + +
+ + + + + + + +
+ + deltaHeight?: +number + + + +
+ + +
+ delta number of height + +
+ + +
+ +
+ +
+ useSnap + optional + +
+ + + + + + + +
+ + useSnap?: +boolean + + + +
+ + +
+ whether to use with `snappable` + +
+ + +
+ + + + + + + +
+ the Scalable's request parameter +
+ + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + + + +

Events

+ + + + + + +

beforeScale

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When scaling, `beforeScale` is called before `scale` occurs. In `beforeScale`, you can get and set the pre-value before scaling. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Scalable.OnBeforeScale + + + + Parameters for the `beforeScale` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, { scalable: true });
+moveable.on("beforeScale", ({ setFixedDirection }) => {
+    if (shiftKey) {
+       setFixedDirection([0, 0]);
+    }
+});
+moveable.on("scale", ({ target, transform, dist }) => {
+    target.style.transform = transform;
+});
+ + + + + + + + + + + + + + + + + + + + + + +

scale

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When scaling, the `scale` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Scalable.OnScale + + + + Parameters for the `scale` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, { scalable: true });
+moveable.on("scale", ({ target, transform, dist }) => {
+    target.style.transform = transform;
+});
+ + + + + + + + + + + + + + + + + + + + + + +

scaleEnd

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the scale finishes, the `scaleEnd` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Scalable.OnScaleEnd + + + + Parameters for the `scaleEnd` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, { scalable: true });
+moveable.on("scaleEnd", ({ target, isDrag }) => {
+    console.log(target, isDrag);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

scaleGroup

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the group scale, the `scaleGroup` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Scalable.OnScaleGroup + + + + Parameters for the `scaleGroup` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    target: [].slice.call(document.querySelectorAll(".target")),
+    scalable: true
+});
+moveable.on("scaleGroup", ({ targets, events }) => {
+    console.log("onScaleGroup", targets);
+    events.forEach(ev => {
+        const target = ev.target;
+        // ev.drag is a drag event that occurs when the group scale.
+        const left = ev.drag.beforeDist[0];
+        const top = ev.drag.beforeDist[1];
+        const scaleX = ev.scale[0];
+        const scaleY = ev.scale[1];
+    });
+});
+ + + + + + + + + + + + + + + + + + + + + + +

scaleGroupEnd

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the group scale finishes, the `scaleGroupEnd` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Scalable.OnScaleGroupEnd + + + + Parameters for the `scaleGroupEnd` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    target: [].slice.call(document.querySelectorAll(".target")),
+    scalable: true
+});
+moveable.on("scaleGroupEnd", ({ targets, isDrag }) => {
+    console.log("onScaleGroupEnd", targets, isDrag);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

scaleGroupStart

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the group scale starts, the `scaleGroupStart` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Scalable.OnScaleGroupStart + + + + Parameters for the `scaleGroupStart` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    target: [].slice.call(document.querySelectorAll(".target")),
+    scalable: true
+});
+moveable.on("scaleGroupStart", ({ targets }) => {
+    console.log("onScaleGroupStart", targets);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

scaleStart

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the scale starts, the scaleStart event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Scalable.OnScaleStart + + + + Parameters for the scaleStart event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, { scalable: true });
+moveable.on("scaleStart", ({ target }) => {
+    console.log(target);
+});
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + \ No newline at end of file diff --git a/release/0.52.0/doc/Moveable.Scrollable.html b/release/0.52.0/doc/Moveable.Scrollable.html new file mode 100644 index 000000000..8b411048e --- /dev/null +++ b/release/0.52.0/doc/Moveable.Scrollable.html @@ -0,0 +1,1389 @@ + + + + + Scrollable - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

Scrollable

+ + + + + + + +
+ +
+ +

+ Moveable. + + Scrollable +

+ + +
+ +
+
+ + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
Whether or not target can be scrolled to the scroll container (default: false)
+ + + + +
+ + + + + + + + + + + + + + + + +

Type Definitions

+ + + +

OnScroll

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ scrollContainer + + +
+ + + + + + + +
+ + scrollContainer: +HTMLElement + + + +
+ + +
+ The container corresponding to scrolling area (scrollContainer >= rootContainer >= container) +
+ + +
+ +
+ +
+ direction + + +
+ + + + + + + +
+ + direction: +number[] + + + +
+ + +
+ The direction of scrolling [left, top] +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnScrollGroup

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ targets set to group. +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

ScrollableOptions

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ scrollable + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + scrollable?: +boolean + + + +
+ + +
+ Whether or not target can be scrolled to the scroll container + +
+ + +
+ +
+ +
+ scrollContainer + optional + +
+ + + + + + +
+ Default Value: container + +
+ + +
+ + scrollContainer?: +MoveableRefType<HTMLElement> + + + +
+ + +
+ The container to which scroll is applied + +
+ + +
+ +
+ +
+ scrollThreshold + optional + +
+ + + + + + +
+ Default Value: 0 + +
+ + +
+ + scrollThreshold?: +number + + + +
+ + +
+ Expand the range of the scroll check area. + +
+ + +
+ +
+ +
+ scrollThrottleTime + optional + +
+ + + + + + +
+ Default Value: 0 + +
+ + +
+ + scrollThrottleTime?: +number + + + +
+ + +
+ Time interval that occurs when scrolling occurs when dragging is maintained +If set to 0, it does not occur. + +
+ + +
+ +
+ +
+ getScrollPosition + optional + +
+ + + + + + +
+ Default Value: scrollContainer's scrollTop, scrollLeft + +
+ + +
+ + getScrollPosition?: +(e: {scrollContainer: HTMLElement, direction: number[]}) => number[] + + + +
+ + +
+ Sets a function to get the scroll position. + +
+ + +
+ +
+ +
+ scrollOptions + optional + +
+ + + +
+ Since: + 0.43.0 + + +
+ + +
+ Story Example: support-scroll--scrolling-scrollable +
+ + + + +
+ + scrollOptions?: +Partial<DragScrollOptions> | null + + + +
+ + +
+ Option to scroll with dragging + +
+ + Examples +
+ +
const scrollOptions = {
+    container: () => viewer.getContainer(),
+    threshold: 20,
+    getScrollPosition: () => {
+        return [
+            viewer.getScrollLeft({ absolute: true }),
+            viewer.getScrollTop({ absolute: true }),
+        ];
+    },
+};
+ +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + + + +

Events

+ + + + + + +

scroll

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the drag cursor leaves the scrollContainer, the `scroll` event occur to scroll. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Scrollable.OnScroll + + + + Parameters for the `scroll` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    target: document.querySelector(".target"),
+});
+moveable.on("scroll", ({ scrollContainer, direction }) => {
+  scrollContainer.scrollLeft += direction[0] * 10;
+  scrollContainer.scrollTop += direction[1] * 10;
+});
+ + + + + + + + + + + + + + + + + + + + + + +

scrollGroup

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the drag cursor leaves the scrollContainer, the `scrollGroup` event occur to scroll in group. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Scrollable.OnScrollGroup + + + + Parameters for the `scrollGroup` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    target: [].slice.call(document.querySelectorAll(".target")),
+});
+moveable.on("scroll", ({ scrollContainer, direction }) => {
+  scrollContainer.scrollLeft += direction[0] * 10;
+  scrollContainer.scrollTop += direction[1] * 10;
+});
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + \ No newline at end of file diff --git a/release/0.52.0/doc/Moveable.Snappable.html b/release/0.52.0/doc/Moveable.Snappable.html new file mode 100644 index 000000000..0d58cf578 --- /dev/null +++ b/release/0.52.0/doc/Moveable.Snappable.html @@ -0,0 +1,6376 @@ + + + + + Snappable - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

Snappable

+ + + + + + + +
+ +
+ +

+ Moveable. + + Snappable +

+ + +
+ +
+
+ + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
Whether or not target can be snapped to the guideline. (default: false)
+ + + + +
+ + + + + + + + + + + + +

Members

+ + + +

verticalGuidelines

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + +
+ Add guidelines in the vertical direction. (default: []) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+moveable.verticalGuidelines = [100, 200, 500];
+ + + + + +

snapThreshold

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + +
+ Distance value that can snap to guidelines. (default: 5) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+moveable.snapThreshold = 5;
+ + + + + +

snappable

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + +
+ Whether or not target can be snapped to the guideline. (default: false) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+moveable.snappable = true;
+ + + + + +

snapGridWidth

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + +
+ If width size is greater than 0, you can vertical snap to the grid. (default: 0) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+moveable.snapGridWidth = 5;
+ + + + + +

snapGridHeight

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + +
+ If height size is greater than 0, you can horizontal snap to the grid. (default: 0) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+moveable.snapGridHeight = 5;
+ + + + + +

snapGap

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + +
+ When you drag, make the gap snap in the element guidelines. (default: true) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+  snappable: true,
+  snapElement: true,
+  snapGap: true,
+});
+
+moveable.snapGap = false;
+ + + + + +

snapDistFormat

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + +
+ You can set the text format of the distance shown in the guidelines. (default: self) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+ snappable: true,
+ snapDistFormat: (v, type) => v,
+});
+moveable.snapDistFormat = (v, type) => `${v}px`;
+ + + + + +

snapDirections

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + +
+ You can specify the directions to snap to the target. (default: { left: true, top: true, right: true, bottom: true }) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+  snappable: true,
+  snapDirections: true,
+});
+// snap center
+moveable.snapDirections = { left: true, top: true, right: true, bottom: true, center: true, middle: true };
+ + + + + +

snapDigit

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + +
+ snap distance digits (default: 0) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+moveable.snapDigit = 0
+ + + + + +

snapContainer

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + +
+ A snap container that is the basis for snap, bounds, and innerBounds. (default: null = container) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.querySelector(".container"));
+
+moveable.snapContainer = document.body;
+ + + + + +

isDisplaySnapDigit

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + +
+ Whether to show snap distance (default: true) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+moveable.isDisplaySnapDigit = true;
+ + + + + +

isDisplayInnerSnapDigit

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + +
+ Whether to show element inner snap distance (default: false) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+moveable.isDisplayInnerSnapDigit = true;
+ + + + + +

innerBounds

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
    +
  • null
  • +
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + +
+ You can set up inner boundaries. +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+moveable.innerBounds = { left: 500, top: 500, width: 100, height: 100};
+ + + + + +

horizontalGuidelines

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + +
+ Add guidelines in the horizontal direction. (default: []) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+moveable.horizontalGuidelines = [100, 200, 500];
+ + + + + +

elementSnapDirections

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + +
+ You can specify the snap directions of elements. (default: { left: true, ftrue, right: true, bottom: true }) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+  snappable: true,
+  elementSnapDirections: true,
+});
+// snap center
+moveable.elementSnapDirections = { left: true, top: true, right: true, bottom: true, center: true, middle: true };
+ + + + + +

elementGuidelines

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + +
+ Add guidelines for the element. (default: []) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+moveable.elementGuidelines = [
+  document.querySelector(".element"),
+];
+ + + + + +

bounds

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
    +
  • null
  • +
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + +
+ You can set up boundaries. +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+moveable.bounds = { left: 0, right: 1000, top: 0, bottom: 1000};
+ + + + + + + + + +

Type Definitions

+ + + +

BoundType

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ position + optional + +
+ + + + + + +
+ Default Value: "client" + +
+ + +
+ + position?: +"client" | "css" + + + +
+ + +
+ If position is css, right and bottom are calculated as css right and css bottom of container. + +
+ + +
+ +
+ +
+ left + optional + +
+ + + + + + + +
+ + left?: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ top + optional + +
+ + + + + + + +
+ + top?: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ right + optional + +
+ + + + + + + +
+ + right?: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ bottom + optional + +
+ + + + + + + +
+ + bottom?: +number + + + +
+ + +
+ +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

ElementGuidelineValue

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ left + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + left?: +boolean + + + +
+ + +
+ Whether to snap the top of the element + +
+ + +
+ +
+ +
+ top + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + top?: +boolean + + + +
+ + +
+ Whether to snap the left of the element + +
+ + +
+ +
+ +
+ right + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + right?: +boolean + + + +
+ + +
+ Whether to snap the right of the element + +
+ + +
+ +
+ +
+ bottom + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + bottom?: +boolean + + + +
+ + +
+ Whether to snap the bottom of the element + +
+ + +
+ +
+ +
+ center + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + center?: +boolean + + + +
+ + +
+ Whether to snap the center((left + right) / 2) of the element + +
+ + +
+ +
+ +
+ middle + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + middle?: +boolean + + + +
+ + +
+ Whether to snap the middle((top + bottom) / 2) of the element + +
+ + +
+ +
+ +
+ element + + +
+ + + + + + + +
+ + element: +Element + + + +
+ + +
+ guideline element + +
+ + +
+ +
+ +
+ className + optional + +
+ + + + + + +
+ Default Value: "" + +
+ + +
+ + className?: +string + + + +
+ + +
+ class names to add to guideline + +
+ + Examples +
+ +
```css
+.moveable-gap.red {
+  background: red!important;
+}
+```
+```css
+.moveable-bold.red {
+  background: red!important;
+}
+```
+```css
+.moveable-dashed.red {
+  border-top-color: red!important;
+}
+```
+ +
+ + +
+ +
+ +
+ refresh + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + refresh?: +boolean + + + +
+ + +
+ Whether to update the element size at every render + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

ElementGuidelineValue

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ left + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + left?: +boolean + + + +
+ + +
+ Whether to snap the top of the element + +
+ + +
+ +
+ +
+ top + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + top?: +boolean + + + +
+ + +
+ Whether to snap the left of the element + +
+ + +
+ +
+ +
+ right + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + right?: +boolean + + + +
+ + +
+ Whether to snap the right of the element + +
+ + +
+ +
+ +
+ bottom + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + bottom?: +boolean + + + +
+ + +
+ Whether to snap the bottom of the element + +
+ + +
+ +
+ +
+ center + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + center?: +boolean + + + +
+ + +
+ Whether to snap the center((left + right) / 2) of the element + +
+ + +
+ +
+ +
+ middle + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + middle?: +boolean + + + +
+ + +
+ Whether to snap the middle((top + bottom) / 2) of the element + +
+ + +
+ +
+ +
+ element + + +
+ + + + + + + +
+ + element: +Element + + + +
+ + +
+ guideline element + +
+ + +
+ +
+ +
+ className + optional + +
+ + + + + + +
+ Default Value: "" + +
+ + +
+ + className?: +string + + + +
+ + +
+ class names to add to guideline + +
+ + +
+ +
+ +
+ refresh + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + refresh?: +boolean + + + +
+ + +
+ Whether to update the element size at every render + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

ElementGuidelineValueOption

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ left + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + left?: +boolean + + + +
+ + +
+ Whether to snap the top of the element + +
+ + +
+ +
+ +
+ top + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + top?: +boolean + + + +
+ + +
+ Whether to snap the left of the element + +
+ + +
+ +
+ +
+ right + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + right?: +boolean + + + +
+ + +
+ Whether to snap the right of the element + +
+ + +
+ +
+ +
+ bottom + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + bottom?: +boolean + + + +
+ + +
+ Whether to snap the bottom of the element + +
+ + +
+ +
+ +
+ center + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + center?: +boolean + + + +
+ + +
+ Whether to snap the center((left + right) / 2) of the element + +
+ + +
+ +
+ +
+ middle + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + middle?: +boolean + + + +
+ + +
+ Whether to snap the middle((top + bottom) / 2) of the element + +
+ + +
+ +
+ +
+ element + + +
+ + + + + + + +
+ + element: +MoveableRefType<Element> + + + +
+ + +
+ guideline element + +
+ + +
+ +
+ +
+ className + optional + +
+ + + + + + +
+ Default Value: "" + +
+ + +
+ + className?: +string + + + +
+ + +
+ class names to add to guideline + +
+ + +
+ +
+ +
+ refresh + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + refresh?: +boolean + + + +
+ + +
+ Whether to update the element size at every render + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

GapGuideline

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ renderPos + + +
+ + + + + + + +
+ + renderPos: +number[] + + + +
+ + +
+ +
+ + +
+ +
+ +
+ inner + optional + +
+ + + + + + + +
+ + inner?: +boolean + + + +
+ + +
+ +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

InnerBoundType

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ left + + +
+ + + + + + + +
+ + left: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ top + + +
+ + + + + + + +
+ + top: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ width + + +
+ + + + + + + +
+ + width: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ height + + +
+ + + + + + + +
+ + height: +number + + + +
+ + +
+ +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

NumericPosGuideline

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ pos + + +
+ + + + + + + +
+ + pos: +number + + + +
+ + +
+ +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnBound

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ bounds + + +
+ + + + + + + +
+ + bounds: +{left: boolean, top: boolean, right: boolean, bottom: boolean} + + + +
+ + +
+ +
+ + +
+ +
+ +
+ innerBounds + + +
+ + + + + + + +
+ + innerBounds: +{left: boolean, top: boolean, right: boolean, bottom: boolean} + + + +
+ + +
+ +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnSnap

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ guidelines + + +
+ + + + + + + +
+ + guidelines: +SnapGuideline[] + + + +
+ + +
+ snapped verticalGuidelines, horizontalGuidelines, + +
+ + +
+ +
+ +
+ elements + + +
+ + + + + + + +
+ + elements: +SnapGuideline[] + + + +
+ + +
+ snapped elements (group by element) + +
+ + +
+ +
+ +
+ gaps + + +
+ + + + + + + +
+ + gaps: +SnapGuideline[] + + + +
+ + +
+ gaps is snapped guidelines that became gap snap between elements. + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

PosGuideline

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ pos + + +
+ + + + + + + +
+ + pos: +number | string + + + +
+ + +
+ guideline pos + +
+ + +
+ +
+ +
+ className + optional + +
+ + + + + + +
+ Default Value: "" + +
+ + +
+ + className?: +string + + + +
+ + +
+ class names to add to guideline + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

RenderGuidelineInfo

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ key + optional + +
+ + + + + + + +
+ + key?: +string + + + +
+ + +
+ +
+ + +
+ +
+ +
+ direction + + +
+ + + + + + + +
+ + direction: +string + + + +
+ + +
+ +
+ + +
+ +
+ +
+ classNames + + +
+ + + + + + + +
+ + classNames: +string[] + + + +
+ + +
+ +
+ + +
+ +
+ +
+ size + + +
+ + + + + + + +
+ + size: +string + + + +
+ + +
+ +
+ + +
+ +
+ +
+ pos + + +
+ + + + + + + +
+ + pos: +string[] + + + +
+ + +
+ +
+ + +
+ +
+ +
+ sizeValue + + +
+ + + + + + + +
+ + sizeValue: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ posValue + + +
+ + + + + + + +
+ + posValue: +number[] + + + +
+ + +
+ +
+ + +
+ +
+ +
+ zoom + + +
+ + + + + + + +
+ + zoom: +number + + + +
+ + +
+ +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

SnapDirections

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ left + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + left?: +boolean + + + +
+ + +
+ Whether to snap the top of the element + +
+ + +
+ +
+ +
+ top + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + top?: +boolean + + + +
+ + +
+ Whether to snap the left of the element + +
+ + +
+ +
+ +
+ right + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + right?: +boolean + + + +
+ + +
+ Whether to snap the right of the element + +
+ + +
+ +
+ +
+ bottom + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + bottom?: +boolean + + + +
+ + +
+ Whether to snap the bottom of the element + +
+ + +
+ +
+ +
+ center + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + center?: +boolean + + + +
+ + +
+ Whether to snap the center((left + right) / 2) of the element + +
+ + +
+ +
+ +
+ middle + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + middle?: +boolean + + + +
+ + +
+ Whether to snap the middle((top + bottom) / 2) of the element + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

SnapElementGuideline

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

SnapGuideline

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ type + + +
+ + + + + + + +
+ + type: +"horizontal" | "vertical" + + + +
+ + +
+ +
+ + +
+ +
+ +
+ direction + + +
+ + + + + + + +
+ + direction: +string + + + +
+ + +
+ +
+ + +
+ +
+ +
+ hide + optional + +
+ + + + + + + +
+ + hide?: +boolean + + + +
+ + +
+ +
+ + +
+ +
+ +
+ element + optional + +
+ + + + + + + +
+ + element?: +Element | null + + + +
+ + +
+ +
+ + +
+ +
+ +
+ isStart + optional + +
+ + + + + + + +
+ + isStart?: +boolean + + + +
+ + +
+ +
+ + +
+ +
+ +
+ isEnd + optional + +
+ + + + + + + +
+ + isEnd?: +boolean + + + +
+ + +
+ +
+ + +
+ +
+ +
+ isCenter + optional + +
+ + + + + + + +
+ + isCenter?: +boolean + + + +
+ + +
+ +
+ + +
+ +
+ +
+ isInner + optional + +
+ + + + + + + +
+ + isInner?: +boolean + + + +
+ + +
+ +
+ + +
+ +
+ +
+ grid + optional + +
+ + + + + + + +
+ + grid?: +boolean + + + +
+ + +
+ +
+ + +
+ +
+ +
+ pos + + +
+ + + + + + + +
+ + pos: +number[] + + + +
+ + +
+ +
+ + +
+ +
+ +
+ size + + +
+ + + + + + + +
+ + size: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ className + optional + +
+ + + + + + + +
+ + className?: +string + + + +
+ + +
+ +
+ + +
+ +
+ +
+ sizes + optional + +
+ + + + + + + +
+ + sizes?: +number[] + + + +
+ + +
+ +
+ + +
+ +
+ +
+ gap + optional + +
+ + + + + + + +
+ + gap?: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ elementDirection + optional + +
+ + + + + + + +
+ + elementDirection?: +string + + + +
+ + +
+ +
+ + +
+ +
+ +
+ elementRect + optional + +
+ + + + + + + +
+ + elementRect?: +SnapElementRect + + + +
+ + +
+ +
+ + +
+ +
+ +
+ gapRects + optional + +
+ + + + + + + +
+ + gapRects?: +SnapElementRect[] + + + +
+ + +
+ +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

SnappableOptions

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ snappable + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + snappable?: +boolean | string[] + + + +
+ + +
+ Whether or not target can be snapped to the guideline. + +
+ + +
+ +
+ +
+ snapContainer + optional + +
+ + + + + + +
+ Default Value: null + +
+ + +
+ + snapContainer?: +MoveableRefType<HTMLElement | SVGElement> + + + +
+ + +
+ A snap container that is the basis for snap, bounds, and innerBounds. + +
+ + +
+ +
+ +
+ snapDirections + optional + +
+ + + + + + +
+ Default Value: true (true is all directions) + +
+ + +
+ + snapDirections?: +boolean | SnapDirections + + + +
+ + +
+ You can specify the directions to snap to the target. + +
+ + +
+ +
+ +
+ elementSnapDirections + optional + +
+ + + + + + +
+ Default Value: true (true is all directions) + +
+ + +
+ + elementSnapDirections?: +boolean | SnapDirections + + + +
+ + +
+ You can specify the snap directions of elements. + +
+ + +
+ +
+ +
+ snapGap + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + snapGap?: +boolean + + + +
+ + +
+ When you drag, make the gap snap in the element guidelines. + +
+ + +
+ +
+ +
+ snapThreshold + optional + +
+ + + + + + +
+ Default Value: 5 + +
+ + +
+ + snapThreshold?: +number + + + +
+ + +
+ /** +Distance value that can snap to guidelines. + +
+ + +
+ +
+ +
+ snapRenderThreshold + optional + +
+ + + + + + +
+ Default Value: 1 + +
+ + +
+ + snapRenderThreshold?: +number + + + +
+ + +
+ Distance value that render snapped guidelines. + +
+ + +
+ +
+ +
+ snapDigit + optional + +
+ + + + + + +
+ Default Value: 0 + +
+ + +
+ + snapDigit?: +number + + + +
+ + +
+ snap distance digits. + +
+ + +
+ +
+ +
+ isDisplayGridGuidelines + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + isDisplayGridGuidelines?: +boolean + + + +
+ + +
+ Whether to show guideline of snap by grid + +
+ + +
+ +
+ +
+ snapRotationThreshold + optional + +
+ + + + + + +
+ Default Value: 5 + +
+ + +
+ + snapRotationThreshold?: +number + + + +
+ + +
+ Snap works if `abs(current rotation - snapRotationDegrees) < snapRotationThreshold`. + +
+ + +
+ +
+ +
+ snapRotationDegrees + optional + +
+ + + + + + +
+ Default Value: [] + +
+ + +
+ + snapRotationDegrees?: +number[] + + + +
+ + +
+ degree angles to snap to rotation + +
+ + +
+ +
+ +
+ snapGridWidth + optional + +
+ + + + + + +
+ Default Value: 0 (0 is not used) + +
+ + +
+ + snapGridWidth?: +number + + + +
+ + +
+ If width size is greater than 0, you can vertical snap to the grid. + +
+ + +
+ +
+ +
+ snapGridHeight + optional + +
+ + + + + + +
+ Default Value: 0 (0 is not used) + +
+ + +
+ + snapGridHeight?: +number + + + +
+ + +
+ If height size is greater than 0, you can horizontal snap to the grid. + +
+ + +
+ +
+ +
+ snapGridAll + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + snapGridAll?: +boolean + + + +
+ + +
+ In the case of a group, if `snapGridWidth` and `snapGridHeight` are used, all children can be snapped. +Custom fixed directions are not yet allowed. Also, it cannot be applied if rotated. + +
+ + +
+ +
+ +
+ isDisplaySnapDigit + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + isDisplaySnapDigit?: +boolean + + + +
+ + +
+ Whether to show snap distance. + +
+ + +
+ +
+ +
+ isDisplayInnerSnapDigit + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + isDisplayInnerSnapDigit?: +boolean + + + +
+ + +
+ Whether to show element inner snap distance + +
+ + +
+ +
+ +
+ horizontalGuidelines + optional + +
+ + + + + + +
+ Default Value: [] + +
+ + +
+ + horizontalGuidelines?: +Array<PosGuideline | number | string> + + + +
+ + +
+ Add guidelines in the horizontal direction. + +
+ + +
+ +
+ +
+ verticalGuidelines + optional + +
+ + + + + + +
+ Default Value: [] + +
+ + +
+ + verticalGuidelines?: +Array<PosGuideline | number | string> + + + +
+ + +
+ Add guidelines in the vertical direction. + +
+ + +
+ +
+ +
+ elementGuidelines + optional + +
+ + + + + + +
+ Default Value: [] + +
+ + +
+ + elementGuidelines?: +Array<ElementGuidelineValueOption | MoveableRefType<Element>> + + + +
+ + +
+ Add guidelines for the element. + +
+ + +
+ +
+ + + + + + + + +
+ Default Value: Infinity + +
+ + +
+ + maxSnapElementGuidelineDistance?: +number + + + +
+ + +
+ Maximum distance to which element guidelines can be snapped. + +
+ + +
+ +
+ +
+ maxSnapElementGapDistance + optional + +
+ + + + + + +
+ Default Value: Infinity + +
+ + +
+ + maxSnapElementGapDistance?: +number + + + +
+ + +
+ Maximum distance to which element gap guidelines can be snapped. + +
+ + +
+ +
+ +
+ bounds + optional + +
+ + + + + + +
+ Default Value: null + +
+ + +
+ + bounds?: +BoundType | null + + + +
+ + +
+ You can set up boundaries. + +
+ + +
+ +
+ +
+ innerBounds + optional + +
+ + + + + + +
+ Default Value: null + +
+ + +
+ + innerBounds?: +InnerBoundType | null + + + +
+ + +
+ You can set up inner boundaries. + +
+ + +
+ +
+ +
+ snapDistFormat + optional + +
+ + + + + + +
+ Default Value: oneself + +
+ + +
+ + snapDistFormat?: +(distance: number, type: "vertical" | "horizontal") => number | string + + + +
+ + +
+ You can set the text format of the distance shown in the guidelines. + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + + + +

Events

+ + + + + + +

snap

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When you drag or dragControl, the `snap` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Snappable.OnSnap + + + + Parameters for the `snap` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    snappable: true
+});
+moveable.on("snap", e => {
+    console.log("onSnap", e);
+});
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + \ No newline at end of file diff --git a/release/0.52.0/doc/Moveable.Warpable.html b/release/0.52.0/doc/Moveable.Warpable.html new file mode 100644 index 000000000..4aa52ad83 --- /dev/null +++ b/release/0.52.0/doc/Moveable.Warpable.html @@ -0,0 +1,2716 @@ + + + + + Warpable - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

Warpable

+ + + + + + + +
+ +
+ +

+ Moveable. + + Warpable +

+ + +
+ +
+
+ + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
Warpable indicates whether the target can be warped(distorted, bented).
+ + + + +
+ + + + + + + + + + + + +

Members

+ + + +

warpable

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Whether or not target can be warped. (default: false) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+moveable.warpable = true;
+ + + + + +

renderDirections

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Set directions to show the control box. (default: ["n", "nw", "ne", "s", "se", "sw", "e", "w"]) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    warpable: true,
+    renderDirections: ["n", "nw", "ne", "s", "se", "sw", "e", "w"],
+});
+
+moveable.renderDirections = ["nw", "ne", "sw", "se"];
+ + + + + + + + + +

Type Definitions

+ + + +

OnWarp

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ style + + +
+ + + + + + + +
+ + style: +Record<string, string> + + + +
+ + +
+ You can get the style you can get from the event. + +
+ + +
+ +
+ +
+ cssText + + +
+ + + + + + + +
+ + cssText: +string + + + +
+ + +
+ You can get it as a cssText that you can get from that event. + +
+ + +
+ +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ delta + + +
+ + + + + + + +
+ + delta: +number[] + + + +
+ + +
+ The delta of warp matrix + +
+ + +
+ +
+ +
+ dist + + +
+ + + + + + + +
+ + dist: +number[] + + + +
+ + +
+ The dist of warp matrix + +
+ + +
+ +
+ +
+ matrix + + +
+ + + + + + + +
+ + matrix: +number[] + + + +
+ + +
+ The calculated warp matrix + +
+ + +
+ +
+ +
+ transform + + +
+ + + + + + + +
+ + transform: +string + + + +
+ + +
+ a target's transform + +
+ + +
+ +
+ +
+ multiply + + +
+ + + + + + + +
+ + multiply: +(matrix1: number[], matrix2: number[], n?: number) => number[] + + + +
+ + +
+ Multiply function that can multiply previous matrix by warp matrix + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnWarpEnd

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ lastEvent + + +
+ + + + + + + +
+ + lastEvent: +any | undefined + + + +
+ + +
+ This is the last dragged event. No, if you haven't dragged. +
+ + +
+ +
+ +
+ isDrag + + +
+ + + + + + + +
+ + isDrag: +boolean + + + +
+ + +
+ Whether this moved +
+ + +
+ +
+ +
+ isDouble + + +
+ + + + + + + +
+ + isDouble: +boolean + + + +
+ + +
+ Whether it is double-click +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnWarpStart

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ setTransform + + +
+ + + + + + +
+ Default Value: transform of target's inline style + +
+ + +
+ + setTransform: +(transform: string | string[], transformIndex?: number) => void + + + +
+ + +
+ Set your original transform. +`transformIndex` is the sequence of functions used in the event. +If you use `setTransform`, you don't need to use `set` function. + +
+ + +
+ +
+ + + + + + + + +
+ Default Value: index with that property in transform or last + +
+ + +
+ + setTransformIndex: +(transformIndex: number) => void + + + +
+ + +
+ `transformIndex` is the sequence of functions used in the event. + +
+ + +
+ +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ set + + +
+ + + + + + + +
+ + set: +(matrix: number[]) => any + + + +
+ + +
+ You can set the start matrix value. +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

WarpableOptions

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ renderDirections + optional + +
+ + + + + + +
+ Default Value: false if rotatable, ["n", "nw", "ne", "s", "se", "sw", "e", "w"] otherwise + +
+ + +
+ + renderDirections?: +boolean | string[] + + + +
+ + +
+ Set directions to show the control box. + +
+ + +
+ +
+ +
+ edge + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + edge?: +boolean | Array<LineDirection> + + + +
+ + +
+ Whether to scale and resize through edge lines. +You can use "n", "w", "s", "e" in LineDirection array. + +
+ + +
+ +
+ +
+ displayAroundControls + optional + +
+ + + +
+ Since: + 0.44.0 + + +
+ + +
+ Story Example: options--options-control-padding +
+ + + +
+ Default Value: false + +
+ + +
+ + displayAroundControls?: +boolean + + + +
+ + +
+ You can expand the area around the control. +Either `rotateAroundControls` or `displayAroundControls` can be used. +You can set the area through the `controlPadding` value. + +
+ + +
+ +
+ +
+ warpable + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + warpable?: +boolean + + + +
+ + +
+ Whether or not target can be warped. + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + + + +

Events

+ + + + + + +

warp

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When warping, the warp event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Warpable.OnWarp + + + + Parameters for the warp event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+let matrix = [
+ 1, 0, 0, 0,
+ 0, 1, 0, 0,
+ 0, 0, 1, 0,
+ 0, 0, 0, 1,
+];
+const moveable = new Moveable(document.body, { warpable: true });
+moveable.on("warp", ({ target, transform, delta, multiply }) => {
+   // target.style.transform = transform;
+   matrix = multiply(matrix, delta);
+   target.style.transform = `matrix3d(${matrix.join(",")})`;
+});
+ + + + + + + + + + + + + + + + + + + + + + +

warpEnd

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the warp finishes, the warpEnd event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Warpable.OnWarpEnd + + + + Parameters for the warpEnd event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, { warpable: true });
+moveable.on("warpEnd", ({ target, isDrag }) => {
+    console.log(target, isDrag);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

warpStart

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When the warp starts, the warpStart event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.Warpable.OnWarpStart + + + + Parameters for the warpStart event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, { warpable: true });
+moveable.on("warpStart", ({ target }) => {
+    console.log(target);
+});
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + \ No newline at end of file diff --git a/release/0.52.0/doc/Moveable.html b/release/0.52.0/doc/Moveable.html new file mode 100644 index 000000000..46295796f --- /dev/null +++ b/release/0.52.0/doc/Moveable.html @@ -0,0 +1,28271 @@ + + + + + Moveable - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

Moveable

+ + + + + + + +
+ +
+ +

+ Moveable +

+ +
Moveable is Draggable! Resizable! Scalable! Rotatable!
+ + +
+ +
+
+ + + + +

Constructor

+ + +

new Moveable(parentElement, optionsopt)

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
parentElement + + +HTMLElement + + + + + +
options? + + +MoveableOptions + + + + + + {} + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + +

Namespaces

+ +
+
Snappable
+
+ +
Warpable
+
+ +
Scrollable
+
+ +
Scalable
+
+ +
Roundable
+
+ +
Rotatable
+
+ +
Resizable
+
+ +
Pinchable
+
+ +
OriginDraggable
+
+ +
Group
+
+ +
Draggable
+
+ +
Clippable
+
+
+ + + +

Members

+ + + +

zoom

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
    +
  • 1
  • +
+ + + + + + + +
+ + + + + +
+ Zooms in the elements of a moveable. +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+moveable.zoom = 2;
+ + + + + +

useResizeObserver

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
    +
  • false
  • +
+ + + + + + + +
+ + + + + +
+ Whether the target size is detected and updated whenever it changes. +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+moveable.useResizeObserver = true;
+ + + + + +

target

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ The target to indicate Moveable Control Box. +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+moveable.target = document.querySelector(".target");
+ + + + + +

passDragArea

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Set `pointerEvents: none;` css to pass events in dragArea. (default: false) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+ dragArea: false,
+});
+ + + + + +

padding

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
    +
  • null
  • +
+ + + + + + + +
+ + + + + +
+ Add padding around the target to increase the drag area. +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+ target: document.querySelector(".target"),
+ padding: { left: 0, top: 0, right: 0, bottom: 0 },
+});
+moveable.padding = { left: 10, top: 10, right: 10, bottom: 10 },
+moveable.updateRect();
+ + + + + +

origin

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Whether or not the origin controlbox will be visible or not (default: true) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+moveable.origin = true;
+ + + + + +

edge

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Resize, Scale Events at edges +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+moveable.edge = true;
+ + + + + +

dragTarget

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
    +
  • target
  • +
+ + + + + + + +
+ + + + + +
+ The target(s) to drag Moveable target(s) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+moveable.target = document.querySelector(".target");
+moveable.dragTarget = document.querySelector(".dragTarget");
+ + + + + +

dragArea

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Add an event to the moveable area instead of the target for stopPropagation. (default: false, true in group) +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+ dragArea: false,
+});
+ + + + + +

className

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
    +
  • ""
  • +
+ + + + + + + +
+ + + + + +
+ You can specify the className of the moveable controlbox. +
+ + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+  className: "",
+});
+
+moveable.className = "moveable1";
+ + + + + + + +

Methods

+ + + + + + +

waitToChangeTarget() → {Promise<void>}

+ + + + + + +
+ + +
Source:
+
+ + + + + + +
Story Example:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ User changes target and waits for target to change. +
+ + + + + + + + + + + + + +
Example
+ +
document.querySelector(".target").addEventListener("mousedown", e => {
+  moveable.waitToChangeTarget().then(() => {
+     moveable.dragStart(e.currentTarget);
+  });
+  moveable.target = e.currentTarget;
+});
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise<void> + + +
+
+ + + + + + + + + +

updateTarget(typeopt)

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + +
Deprecated:
  • Yes
+ + + + + + + + + + + + + + + +
+ + + + + +
+ If the width, height, left, and top of the only target change, update the shape of the moveable. +Use `.updateRect()` method +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type? + + +"Start" | "" | "End" + + + +
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+moveable.updateTarget();
+ + + + + + + + + + + + + + + + + + + + + + +

updateSelectors()

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ If the element list corresponding to the selector among the targets is changed, it is updated. +
+ + + + + + + + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+   target: ".target",
+});
+
+moveable.updateSelectors();
+ + + + + + + + + + + + + + + + + + + + + + +

updateRect(typeopt, isTargetopt, isSetStateopt)

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ If the width, height, left, and top of all elements change, update the shape of the moveable. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
type? + + +"Start" | "" | "End" + + + + + +
isTarget? + + +boolean + + + + + +
isSetState? + + +boolean + + + + + + true + +
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+window.addEventListener("resize", e => {
+    moveable.updateRect();
+});
+ + + + + + + + + + + + + + + + + + + + + + +

trigger<Name extends keyof Events>(eventName, paramopt) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Fires an event to call listeners. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
eventName + + +Name +| + +... + + + + + + Event name
param? + + +TargetParam<any> +| + +... + + + + + + {} + + Event parameter
+ + + + +

+ trigger<Name extends keyof Events, Param = Events[Name]>(eventName) + → {boolean} +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eventName + + + extends TargetParam<Param> ? Name : never + + + +
+ +
+ +

+ trigger<Name extends keyof Events, Param = Events[Name]>(eventName, param) + → {boolean} +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eventName + + +Name + + + +
param + + +TargetParam<Param> + + + +
+ +
+ + + +
Example
+ +
import EventEmitter from "@scena/event-emitter";
+
+
+const emitter = new EventEmitter();
+
+emitter.on("a", e => {
+});
+
+
+emitter.emit("a", {
+  a: 1,
+});
+     
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ If false, stop the event. +
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + +

stopDrag(typeopt) → {void}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ You can stop the dragging currently in progress through a method from outside. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type? + + +"target" | "control" + + + +
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+moveable.stopDrag();
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ - The Rect Info +
+ + + +
+
+ Type +
+
+ +void + + +
+
+ + + + + + + + + +

request(ableName, paramopt, isInstantopt) → {Requester}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + +
+ Request able through a method rather than an event. +At the moment of execution, requestStart is executed, +and then request and requestEnd can be executed through Requester. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
ableName + + +string + + + + + + ableName
param? + + +IObject<any> + + + + + + {} + + request to be able params.
isInstant? + + +boolean + + + + + + If isInstant is true, request and requestEnd are executed immediately.
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+// Instantly Request (requestStart - request - requestEnd)
+moveable.request("draggable", { deltaX: 10, deltaY: 10 }, true);
+
+// Start move
+const requester = moveable.request("draggable");
+requester.request({ deltaX: 10, deltaY: 10 });
+requester.request({ deltaX: 10, deltaY: 10 });
+requester.request({ deltaX: 10, deltaY: 10 });
+requester.requestEnd();
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ - Able Requester. If there is no request in able, nothing will work. +
+ + + +
+
+ Type +
+
+ +Requester + + +
+
+ + + + + + + + + +

once<Name extends keyof Events & string, Param = Events[Name]>(eventName, listeneropt) → {Promise<OnEvent<Param, this>>}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Add a disposable listener and Use promise to the registered event. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eventName + + +Name + + + + Name of the event to be added
listener? + + +EventListener<Param, this> + + + + disposable listener function of the event to be added
+ + + + + + +
Example
+ +
import EventEmitter from "@scena/event-emitter";
+cosnt emitter = new EventEmitter();
+
+// Add a disposable listener in "a" event
+emitter.once("a", () => {
+});
+
+// Use Promise
+emitter.once("a").then(e => {
+});
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise<OnEvent<Param, this>> + + +
+
+ + + + + + + + + +

on(eventName, listeneropt) → {this}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Add a listener to the registered event. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eventName + + +string | object +| + +... + + + + Name of the event to be added
listener? + + +EventListener<Events[any], this> +| + +... + + + + listener function of the event to be added
+ + + + +

+ on<Name extends keyof Events, Param = Events[Name]>(eventName, listener) + → {this} +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eventName + + +Name + + + +
listener + + +EventListener<Param, this> + + + +
+ +
+ +

+ on(events) + → {this} +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
events + + +EventHash<Events, this> + + + +
+ +
+ + + +
Example
+ +
import EventEmitter from "@scena/event-emitter";
+cosnt emitter = new EventEmitter();
+
+// Add listener in "a" event
+emitter.on("a", () => {
+});
+// Add listeners
+emitter.on({
+ a: () => {},
+ b: () => {},
+});
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +this + + +
+
+ + + + + + + + + +

off(eventNameopt, listeneropt) → {this}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Remove listeners registered in the event target. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eventName? + + +string | object +| + +... + + + + Name of the event to be removed
listener? + + +EventListener<Events[any], this> +| + +... + + + + listener function of the event to be removed
+ + + + +

+ off<Name extends keyof Events, Param = Events[Name]>(eventName, listener) + → {this} +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eventName? + + +Name + + + +
listener? + + +EventListener<Param, this> + + + +
+ +
+ +

+ off(events) + → {this} +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
events + + +EventHash<Events, this> + + + +
+ +
+ + + +
Example
+ +
import EventEmitter from "@scena/event-emitter";
+cosnt emitter = new EventEmitter();
+
+// Remove all listeners.
+emitter.off();
+
+// Remove all listeners in "A" event.
+emitter.off("a");
+
+
+// Remove "listener" listener in "a" event.
+emitter.off("a", listener);
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +this + + +
+
+ + + + + + + + + +

isMoveableElement(target)

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Check if the target is an element included in the moveable. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
target + + +Element + + + + the target
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+window.addEventListener("click", e => {
+    if (!moveable.isMoveableElement(e.target)) {
+        moveable.target = e.target;
+    }
+});
+ + + + + + + + + + + + + + + + + + + + + + +

isInside(clientX, clientY)

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Whether the coordinates are inside Moveable +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
clientX + + +number + + + + x coordinate
clientY + + +number + + + + y coordinate
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+document.body.addEventListener("mousedown", e => {
+    if (moveable.isInside(e.clientX, e.clientY)) {
+         console.log("inside");
+    }
+});
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ - True if the coordinate is in moveable or false +
+ + + + + + + + + + + +

isDragging(ableNameopt)

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Check if the moveable state is being dragged. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ableName? + + +string + + + + If you want to check if able is dragging, specify ableName.
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+// false
+console.log(moveable.isDragging());
+
+moveable.on("drag", () => {
+  // true
+  console.log(moveable.isDragging());
+});
+ + + + + + + + + + + + + + + + + + + + + + +

hitTest(el) → {number}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Hit test an element or rect on a moveable target. +(100% = 100) +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
el + + +Element | HitRect + + + + element or rect to test
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+document.body.addEventListener("mousedown", e => {
+    if (moveable.hitTest(e.target) > 0) {
+         console.log("hiited");
+    }
+});
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ - Get hit test rate (rate > 0 is hitted) +
+ + + +
+
+ Type +
+
+ +number + + +
+
+ + + + + + + + + +

getTargets()

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Get targets set in moveable through target or targets of props. +
+ + + + + + + + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+   target: [targetRef, ".target", document.querySelectorAll(".target")],
+});
+
+console.log(moveable.getTargets());
+ + + + + + + + + + + + + + + + + + + + + + +

getRect() → {RectInfo}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ You can get the vertex information, position and offset size information of the target based on the container. +
+ + + + + + + + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+const rectInfo = moveable.getRect();
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ - The Rect Info +
+ + + +
+
+ Type +
+
+ +RectInfo + + +
+
+ + + + + + + + + +

getManager() → {MoveableManagerInterface<any, any>}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Get a manager that manages the moveable's state and props. +
+ + + + + + + + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+const manager = moveable.getManager(); // real moveable class instance
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ - The Rect Info +
+ + + +
+
+ Type +
+
+ +MoveableManagerInterface<any, any> + + +
+
+ + + + + + + + + +

getDragElement() → {HTMLElement | SVGElement | null | undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Target element to be dragged in moveable +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +HTMLElement | SVGElement | null | undefined + + +
+
+ + + + + + + + + +

getControlBoxElement() → {HTMLElement}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Returns the element of the control box. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +HTMLElement + + +
+
+ + + + + + + + + +

getAble<T extends Able>(ableName) → {T | undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Get the able used in MoveableManager. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ableName + + +string + + + + able name
+ + + + + + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +T | undefined + + +
+
+ + + + + + + + + +

emit(eventName, paramopt) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Fires an event to call listeners. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
eventName + + +string +| + +... + + + + + + Event name
param? + + +TargetParam<any> +| + +... + + + + + + {} + + Event parameter
+ + + + +

+ emit<Name extends keyof Events, Param = Events[Name]>(eventName) + → {boolean} +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eventName + + + extends Param ? Name : never + + + +
+ +
+ +

+ emit<Name extends keyof Events, Param = Events[Name]>(eventName, param) + → {boolean} +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eventName + + +Name + + + +
param + + +TargetParam<Param> + + + +
+ +
+ + + +
Example
+ +
import EventEmitter from "@scena/event-emitter";
+
+
+const emitter = new EventEmitter();
+
+emitter.on("a", e => {
+});
+
+
+emitter.emit("a", {
+  a: 1,
+});
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ If false, stop the event. +
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + +

dragStart(e)

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ You can drag start the Moveable through the external `MouseEvent`or `TouchEvent`. (Angular: ngDragStart) +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +MouseEvent | TouchEvent + + + + external `MouseEvent`or `TouchEvent`
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+document.body.addEventListener("mousedown", e => {
+    if (!moveable.isMoveableElement(e.target)) {
+         moveable.dragStart(e);
+    }
+});
+ + + + + + + + + + + + + + + + + + + + + + +

destroy() → {void}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Remove the Moveable object and the events. +
+ + + + + + + + + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+moveable.destroy();
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +void + + +
+
+ + + + + + + + +

Type Definitions

+ + + +

AbleRequesters

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ isInstant + optional + +
+ + + + + + + +
+ + isInstant?: +boolean + + + +
+ + +
+ Run the request instantly. (requestStart, request, requestEnd happen at the same time) + +
+ + +
+ +
+ +
+ [key: string] + + +
+ + + + + + + +
+ + [key: string]: +any + + + +
+ + +
+ +
+ + +
+ +
+ +
+ draggable + + +
+ + + + + + + +
+ + draggable: +DraggableRequestParam + + + +
+ + +
+ +
+ + +
+ +
+ +
+ resizable + + +
+ + + + + + + +
+ + resizable: +ResizableRequestParam + + + +
+ + +
+ +
+ + +
+ +
+ +
+ scalable + + +
+ + + + + + + +
+ + scalable: +ScalableRequestParam + + + +
+ + +
+ +
+ + +
+ +
+ +
+ rotatable + + +
+ + + + + + + +
+ + rotatable: +RotatableRequestParam + + + +
+ + +
+ +
+ + +
+ +
+ +
+ [key: string] + + +
+ + + + + + + +
+ + [key: string]: +AbleRequestParam + + + +
+ + +
+ +
+ + +
+ + + + + + + +
+ the Resizable's request parameter +
+ + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

AbleRequestParam

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ isInstant + optional + +
+ + + + + + + +
+ + isInstant?: +boolean + + + +
+ + +
+ Run the request instantly. (requestStart, request, requestEnd happen at the same time) + +
+ + +
+ +
+ +
+ [key: string] + + +
+ + + + + + + +
+ + [key: string]: +any + + + +
+ + +
+ +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

CSSObject

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ style + + +
+ + + + + + + +
+ + style: +Record<string, string> + + + +
+ + +
+ You can get the style you can get from the event. + +
+ + +
+ +
+ +
+ cssText + + +
+ + + + + + + +
+ + cssText: +string + + + +
+ + +
+ You can get it as a cssText that you can get from that event. + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

DefaultOptions

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ target + optional + +
+ + + + + + +
+ Default Value: null + +
+ + +
+ + target?: +SVGElement | HTMLElement | null + + + +
+ + +
+ The target(s) to indicate Moveable Control Box. + +
+ + +
+ +
+ +
+ dragTarget + optional + +
+ + + + + + +
+ Default Value: target + +
+ + +
+ + dragTarget?: +MoveableRefType | null + + + +
+ + +
+ The external target(s) to drag Moveable target(s) + +
+ + +
+ +
+ +
+ dragTargetSelf + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + dragTargetSelf?: +boolean + + + +
+ + +
+ If dragTarget is set directly, taget itself cannot be dragged. +Whether to drag the target as well. + +
+ + +
+ +
+ +
+ dragContainer + optional + +
+ + + + + + +
+ Default Value: window + +
+ + +
+ + dragContainer?: +null | Window | MoveableRefType<HTMLElement> + + + +
+ + +
+ Container area where drag works + +
+ + +
+ +
+ +
+ container + optional + +
+ + + + + + +
+ Default Value: parentElement + +
+ + +
+ + container?: +SVGElement | HTMLElement | null + + + +
+ + +
+ A container into which Moveables are inserted. +Set it only when used within the slot of Web Components or when the container is different. + +
+ + +
+ +
+ +
+ rootContainer + optional + +
+ + + + +
+ Story Example: options--options-root-container +
+ + + +
+ Default Value: parentElement + +
+ + +
+ + rootContainer?: +MoveableRefType<HTMLElement> + + + +
+ + +
+ Moveable Root Container (No Transformed Container) + +
+ + +
+ +
+ +
+ viewContainer + optional + +
+ + + + +
+ Story Example: options--options-view-container +
+ + + +
+ Default Value: null + +
+ + +
+ + viewContainer?: +MoveableRefType<HTMLElement> + + + +
+ + +
+ If you want to set the dragging information to the viewer, refer to the following. + +
+ + +
+ +
+ +
+ useResizeObserver + optional + +
+ + + + +
+ Story Example: options--options-resize-observer +
+ + + +
+ Default Value: false + +
+ + +
+ + useResizeObserver?: +boolean + + + +
+ + +
+ Whether the target size is detected and updated whenever it changes. +It is more effective when used together with `useMutationObserver`. + +
+ + +
+ +
+ +
+ useMutationObserver + optional + +
+ + + + +
+ Story Example: options--options-mutation-observer +
+ + + +
+ Default Value: false + +
+ + +
+ + useMutationObserver?: +boolean + + + +
+ + +
+ Whether the target size, pos in inline style is detected and updated whenever it changes. +It is more effective when used together with `useResizeObserver`. + +
+ + +
+ +
+ +
+ zoom + optional + +
+ + + + + + +
+ Default Value: 1 + +
+ + +
+ + zoom?: +number + + + +
+ + +
+ Zooms in the elements of a moveable. + +
+ + +
+ +
+ +
+ transformOrigin + optional + +
+ + + + + + +
+ Default Value: "" + +
+ + +
+ + transformOrigin?: +Array<string | number> | string | "" + + + +
+ + +
+ The default transformOrigin of the target can be set in advance. + +
+ + +
+ +
+ +
+ ables + optional + +
+ + + + + + +
+ Default Value: [] + +
+ + +
+ + ables?: +Able[] + + + +
+ + +
+ You can add your custom able. + +
+ + +
+ +
+ +
+ className + optional + +
+ + + + + + +
+ Default Value: "" + +
+ + +
+ + className?: +string + + + +
+ + +
+ You can specify the className of the moveable controlbox. + +
+ + +
+ +
+ +
+ pinchThreshold + optional + +
+ + + + + + +
+ Default Value: 20 + +
+ + +
+ + pinchThreshold?: +number + + + +
+ + +
+ Minimum distance to pinch. + +
+ + +
+ +
+ +
+ pinchOutside + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + pinchOutside?: +boolean + + + +
+ + +
+ Whether the container containing the target becomes a pinch. + +
+ + +
+ +
+ +
+ triggerAblesSimultaneously + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + triggerAblesSimultaneously?: +boolean + + + +
+ + +
+ Lets generate events of ables at the same time. (like Resizable, Scalable) + +
+ + +
+ +
+ +
+ checkInput + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + checkInput?: +boolean + + + +
+ + +
+ Checks whether this is an element to input text or contentEditable, and prevents dragging. + +
+ + +
+ +
+ +
+ cspNonce + optional + +
+ + + + + + +
+ Default Value: "" + +
+ + +
+ + cspNonce?: +string + + + +
+ + +
+ add nonce property to style for CSP. + +
+ + +
+ +
+ +
+ translateZ + optional + +
+ + + + + + +
+ Default Value: 50 + +
+ + +
+ + translateZ?: +number | string + + + +
+ + +
+ You can set the translateZ value of moveable. + +
+ + +
+ +
+ +
+ hideDefaultLines + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + hideDefaultLines?: +boolean + + + +
+ + +
+ Whether to hide the line corresponding to the rect of the target. + +
+ + +
+ +
+ +
+ stopPropagation + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + stopPropagation?: +boolean + + + +
+ + +
+ Whether to prevent bubbling of events like mousedown, touchstart, etc. + +
+ + +
+ +
+ +
+ preventDefault + optional + +
+ + + +
+ Since: + 0.44.0 + + +
+ + + + +
+ Default Value: true + +
+ + +
+ + preventDefault?: +boolean + + + +
+ + +
+ Whether to call preventDefault on touchstart or mousedown + +
+ + +
+ +
+ +
+ preventClickEventOnDrag + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + preventClickEventOnDrag?: +boolean + + + +
+ + +
+ Prevent click event on drag. (mousemove, touchmove) + +
+ + +
+ +
+ +
+ dragFocusedInput + optional + +
+ + + +
+ Since: + 0.47.0 + + +
+ + +
+ Story Example: options--options-drag-focused-input +
+ + + +
+ Default Value: false + +
+ + +
+ + dragFocusedInput?: +boolean + + + +
+ + +
+ Whether to drag the focused input +If `checkInput` is true, this option is not applied. + +
+ + +
+ +
+ +
+ preventClickDefault + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + preventClickDefault?: +boolean + + + +
+ + +
+ Prevent click event on dragStart. (mousedown, touchstart) + +
+ + +
+ +
+ +
+ props + optional + +
+ + + + + + +
+ Default Value: empty object + +
+ + +
+ + props?: +Record<string, any> + + + +
+ + +
+ You can use props in object format or custom props. + +
+ + +
+ +
+ +
+ persistData + optional + +
+ + + + + + +
+ Default Value: null + +
+ + +
+ + persistData?: +PersistRectData | null + + + +
+ + +
+ Data for first render + +
+ + +
+ +
+ +
+ useAccuratePosition + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + useAccuratePosition?: +boolean + + + +
+ + +
+ Whether to accurately show the position of a movable control box +Because getBoundingClientRect is used, css zoom, transform: rotate between container and rootContainer cannot be used. +group is not supported. + +
+ + +
+ +
+ +
+ linePadding + optional + +
+ + + +
+ Since: + 0.43.0 + + +
+ + +
+ Story Example: options--options-line-padding +
+ + + +
+ Default Value: 0 + +
+ + +
+ + linePadding?: +number + + + +
+ + +
+ By adding padding to the line, you can increase the area of the line that can be clicked and dragged. + +
+ + +
+ +
+ +
+ controlPadding + optional + +
+ + + +
+ Since: + 0.44.0 + + +
+ + +
+ Story Example: options--options-control-padding +
+ + + +
+ Default Value: 0 + +
+ + +
+ + controlPadding?: +number + + + +
+ + +
+ By adding padding to the control, you can increase the area of the control that can be clicked and dragged. +Either `rotateAroundControls` or `displayAroundControls` can be used. + +
+ + +
+ +
+ +
+ flushSync + optional + +
+ + + + + + +
+ Default Value: empty function + +
+ + +
+ + flushSync?: +(callback: () => void) => void + + + +
+ + +
+ If you are using React 18's concurrent mode, use `flushSync` for UI sync. + +
+ + Examples +
+ +
```jsx
+import { flushSync } from "react-dom";
+
+<Moveable flushSync={flushSync} />
+```
+ +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

DragAreaOptions

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ dragArea + optional + +
+ + + + + + +
+ Default Value: if group, true, else fals + +
+ + +
+ + dragArea?: +boolean + + + +
+ + +
+ Instead of firing an event on the target, we add it to the moveable control element. You can use click and clickGroup events. + +
+ + +
+ +
+ +
+ passDragArea + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + passDragArea?: +boolean + + + +
+ + +
+ Set `pointerEvents: none;` css to pass events in dragArea. + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

ElementSizes

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ svg + + +
+ + + + + + + +
+ + svg: +boolean + + + +
+ + +
+ +
+ + +
+ +
+ +
+ offsetWidth + + +
+ + + + + + + +
+ + offsetWidth: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ offsetHeight + + +
+ + + + + + + +
+ + offsetHeight: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ clientWidth + + +
+ + + + + + + +
+ + clientWidth: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ clientHeight + + +
+ + + + + + + +
+ + clientHeight: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ inlineCSSWidth + + +
+ + + + + + + +
+ + inlineCSSWidth: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ inlineCSSHeight + + +
+ + + + + + + +
+ + inlineCSSHeight: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ cssWidth + + +
+ + + + + + + +
+ + cssWidth: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ cssHeight + + +
+ + + + + + + +
+ + cssHeight: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ contentWidth + + +
+ + + + + + + +
+ + contentWidth: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ contentHeight + + +
+ + + + + + + +
+ + contentHeight: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ minWidth + + +
+ + + + + + + +
+ + minWidth: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ minHeight + + +
+ + + + + + + +
+ + minHeight: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ maxWidth + + +
+ + + + + + + +
+ + maxWidth: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ maxHeight + + +
+ + + + + + + +
+ + maxHeight: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ minOffsetWidth + + +
+ + + + + + + +
+ + minOffsetWidth: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ minOffsetHeight + + +
+ + + + + + + +
+ + minOffsetHeight: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ maxOffsetWidth + + +
+ + + + + + + +
+ + maxOffsetWidth: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ maxOffsetHeight + + +
+ + + + + + + +
+ + maxOffsetHeight: +number + + + +
+ + +
+ +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

GroupRect

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ pos1 + + +
+ + + + + + + +
+ + pos1: +number[] + + + +
+ + +
+ +
+ + +
+ +
+ +
+ pos2 + + +
+ + + + + + + +
+ + pos2: +number[] + + + +
+ + +
+ +
+ + +
+ +
+ +
+ pos3 + + +
+ + + + + + + +
+ + pos3: +number[] + + + +
+ + +
+ +
+ + +
+ +
+ +
+ pos4 + + +
+ + + + + + + +
+ + pos4: +number[] + + + +
+ + +
+ +
+ + +
+ +
+ +
+ minX + + +
+ + + + + + + +
+ + minX: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ minY + + +
+ + + + + + + +
+ + minY: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ maxX + + +
+ + + + + + + +
+ + maxX: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ maxY + + +
+ + + + + + + +
+ + maxY: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ width + + +
+ + + + + + + +
+ + width: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ height + + +
+ + + + + + + +
+ + height: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ rotation + + +
+ + + + + + + +
+ + rotation: +number + + + +
+ + +
+ +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

HitRect

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ top + + +
+ + + + + + + +
+ + top: +number + + + +
+ + +
+ top position +
+ + +
+ +
+ +
+ left + + +
+ + + + + + + +
+ + left: +number + + + +
+ + +
+ left position +
+ + +
+ +
+ +
+ width + optional + +
+ + + + + + + +
+ + width?: +number + + + +
+ + +
+ target's width +
+ + +
+ +
+ +
+ height + optional + +
+ + + + + + + +
+ + height?: +number + + + +
+ + +
+ target's height +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

In

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ You can make Able that can work in Moveable. +
+ + + + + + + + + + +

LineDirection

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Type:
+
    +
  • + +"n" | "e" | "s" | "w" | "nw" | "ne" | "sw" | "se" + + +
  • +
+ + + + + + + + +

MoveableDefaultEvents

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ onChangeTargets + optional + +
+ + + + + + + +
+ + onChangeTargets?: +(e: OnChangeTargets) => void + + + +
+ + +
+ +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

MoveableDefaultProps

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ onChangeTargets + optional + +
+ + + + + + + +
+ + onChangeTargets?: +(e: OnChangeTargets) => void + + + +
+ + +
+ +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

MoveableGroupInterface<T, U>

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ getManager + + +
+ + + + + + + +
+ + getManager: +() => MoveableManagerInterface<any, any> + + + +
+ + +
+ +
+ + +
+ +
+ +
+ getRect + + +
+ + + + + + + +
+ + getRect: +() => RectInfo + + + +
+ + +
+ +
+ + +
+ +
+ +
+ getAble + + +
+ + + + + + + +
+ + getAble: +<T extends Able>(ableName: string) => T | undefined + + + +
+ + +
+ +
+ + +
+ +
+ + + + + + + + + +
+ + isMoveableElement: +(target: Element) => boolean + + + +
+ + +
+ +
+ + +
+ +
+ +
+ updateRect + + +
+ + + + + + + +
+ + updateRect: +(type?: "Start" | "" | "End", isTarget?: boolean, isSetState?: boolean) => void + + + +
+ + +
+ If the location or size of the target is changed, call the `.updateRect()` method. +Use the `useResizeObserver` and `useMutationObserver` props to update automatically. + +
+ + +
+ +
+ +
+ updateTarget + + +
+ + + + + + + +
+ + updateTarget: +() => void + + + +
+ + +
+ +
+ + +
+ +
+ +
+ request + + +
+ + + + + + + +
+ + request: +<RequestParam extends AbleRequesters[Name], Name extends string = string>(ableName: Name, params?: RequestParam, isInstant?: boolean) => Requester<RequestParam> + + + +
+ + +
+ Request able through a method rather than an event. +At the moment of execution, requestStart is executed, +and then request and requestEnd can be executed through Requester. + +
+ + Examples +
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+// Instantly Request (requestStart - request - requestEnd)
+moveable.request("draggable", { deltaX: 10, deltaY: 10 }, true);
+
+// Start move
+const requester = moveable.request("draggable");
+requester.request({ deltaX: 10, deltaY: 10 });
+requester.request({ deltaX: 10, deltaY: 10 });
+requester.request({ deltaX: 10, deltaY: 10 });
+requester.requestEnd();
+ +
+ + +
+

Refer to:

+ +
+ +
+ +
+ +
+ getMoveables + + +
+ + + + + + + +
+ + getMoveables: +() => MoveableManagerInterface[] + + + +
+ + +
+ moveable is the top level that manages targets +`Single`: MoveableManager instance +`Group`: MoveableGroup instance +`IndividualGroup`: MoveableIndividaulGroup instance +Returns leaf target MoveableManagers. + +
+ + +
+ +
+ + + + + + + + + +
+ + getControlBoxElement: +() => HTMLElement + + + +
+ + +
+ Returns the element of the control box. + +
+ + +
+ +
+ +
+ getDragElement + + +
+ + + + + + + +
+ + getDragElement: +() => HTMLElement | SVGElement | null | undefined + + + +
+ + +
+ Target element to be dragged in moveable + +
+ + +
+ +
+ +
+ destroy + + +
+ + + + + + + +
+ + destroy: +() => void + + + +
+ + +
+ +
+ + +
+ +
+ +
+ dragStart + + +
+ + + + + + + +
+ + dragStart: +(e: MouseEvent | TouchEvent) => void + + + +
+ + +
+ +
+ + +
+ +
+ +
+ isInside + + +
+ + + + + + + +
+ + isInside: +(clientX: number, clientY: number) => boolean + + + +
+ + +
+ +
+ + +
+ +
+ +
+ isDragging + + +
+ + + + + + + +
+ + isDragging: +(ableName?: string) => boolean + + + +
+ + +
+ +
+ + +
+ +
+ +
+ hitTest + + +
+ + + + + + + +
+ + hitTest: +(el: Element | HitRect) => number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ setState + + +
+ + + + + + + +
+ + setState: +(state: any, callback?: () => any) => any + + + +
+ + +
+ +
+ + +
+ +
+ + + + + + + + + +
+ + waitToChangeTarget: +() => Promise<void> + + + +
+ + +
+ +
+ + +
+ +
+ +
+ forceUpdate + + +
+ + + + + + + +
+ + forceUpdate: +(callback?: () => any) => any + + + +
+ + +
+ +
+ + +
+ +
+ +
+ updateSelectors + + +
+ + + + + + + +
+ + updateSelectors: +() => void + + + +
+ + +
+ +
+ + +
+ +
+ +
+ getTargets + + +
+ + + + + + + +
+ + getTargets: +() => Array<HTMLElement | SVGElement> + + + +
+ + +
+ +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +(type?: "target" | "control") => void + + + +
+ + +
+ +
+ + +
+ +
+ +
+ moveables + optional + +
+ + + + + + + +
+ + moveables?: +MoveableManagerInterface[] + + + +
+ + +
+ +
+ + +
+ +
+ +
+ props + + +
+ + + + + + + +
+ + props: +MoveableManagerProps<T> + + + +
+ + +
+ +
+ + +
+ +
+ +
+ state + + +
+ + + + + + + +
+ + state: +MoveableManagerState<U> + + + +
+ + +
+ +
+ + +
+ +
+ +
+ renderState + + +
+ + + + + + + +
+ + renderState: +Record<string, any> + + + +
+ + +
+ +
+ + +
+ +
+ +
+ rotation + + +
+ + + + + + + +
+ + rotation: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ scale + + +
+ + + + + + + +
+ + scale: +number[] + + + +
+ + +
+ +
+ + +
+ +
+ +
+ controlGesto + + +
+ + + + + + + +
+ + controlGesto: +Gesto + + + +
+ + +
+ +
+ + +
+ +
+ +
+ targetGesto + + +
+ + + + + + + +
+ + targetGesto: +Gesto + + + +
+ + +
+ +
+ + +
+ +
+ +
+ enabledAbles + + +
+ + + + + + + +
+ + enabledAbles: +Able[] + + + +
+ + +
+ +
+ + +
+ +
+ +
+ controlAbles + + +
+ + + + + + + +
+ + controlAbles: +Able[] + + + +
+ + +
+ +
+ + +
+ +
+ +
+ targetAbles + + +
+ + + + + + + +
+ + targetAbles: +Able[] + + + +
+ + +
+ +
+ + +
+ +
+ +
+ areaElement + + +
+ + + + + + + +
+ + areaElement: +HTMLElement + + + +
+ + +
+ +
+ + +
+ +
+ +
+ controlBox + + +
+ + + + + + + +
+ + controlBox: +HTMLElement + + + +
+ + +
+ +
+ + +
+ +
+ +
+ isUnmounted + + +
+ + + + + + + +
+ + isUnmounted: +boolean + + + +
+ + +
+ +
+ + +
+ +
+ +
+ useCSS + + +
+ + + + + + + +
+ + useCSS: +(tag: string, css: string) => any + + + +
+ + +
+ +
+ + +
+ +
+ +
+ getContainer + + +
+ + + + + + + +
+ + getContainer: +() => HTMLElement | SVGElement + + + +
+ + +
+ +
+ + +
+ +
+ +
+ getRotation + + +
+ + + + + + + +
+ + getRotation: +() => number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ getState + + +
+ + + + + + + +
+ + getState: +() => MoveableManagerState<U> + + + +
+ + +
+ +
+ + +
+ +
+ +
+ triggerEvent + + +
+ + + + + + + +
+ + triggerEvent: +(name: string, params: IObject<any>, isManager?: boolean) => any + + + +
+ + +
+ +
+ + +
+ +
+ +
+ props + + +
+ + + + + + + +
+ + props: +MoveableManagerProps<T> & {targets: Array<HTMLElement | SVGElement>} + + + +
+ + +
+ +
+ + +
+ +
+ +
+ moveables + + +
+ + + + + + + +
+ + moveables: +MoveableManagerInterface[] + + + +
+ + +
+ +
+ + +
+ +
+ +
+ transformOrigin + + +
+ + + + + + + +
+ + transformOrigin: +string + + + +
+ + +
+ +
+ + +
+ +
+ + + + + + + + + +
+ + renderGroupRects: +GroupRect[] + + + +
+ + +
+ +
+ + +
+ +
+ + + + + + + + + +
+ + getRequestChildStyles: +() => string[] + + + +
+ + +
+ +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

MoveableInterface

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ getManager + + +
+ + + + + + + +
+ + getManager: +() => MoveableManagerInterface<any, any> + + + +
+ + +
+ +
+ + +
+ +
+ +
+ getRect + + +
+ + + + + + + +
+ + getRect: +() => RectInfo + + + +
+ + +
+ +
+ + +
+ +
+ +
+ getAble + + +
+ + + + + + + +
+ + getAble: +<T extends Able>(ableName: string) => T | undefined + + + +
+ + +
+ +
+ + +
+ +
+ + + + + + + + + +
+ + isMoveableElement: +(target: Element) => boolean + + + +
+ + +
+ +
+ + +
+ +
+ +
+ updateRect + + +
+ + + + + + + +
+ + updateRect: +(type?: "Start" | "" | "End", isTarget?: boolean, isSetState?: boolean) => void + + + +
+ + +
+ If the location or size of the target is changed, call the `.updateRect()` method. +Use the `useResizeObserver` and `useMutationObserver` props to update automatically. + +
+ + +
+ +
+ +
+ updateTarget + + +
+ + + + + + + +
+ + updateTarget: +() => void + + + +
+ + +
+ +
+ + +
+ +
+ +
+ request + + +
+ + + + + + + +
+ + request: +<RequestParam extends AbleRequesters[Name], Name extends string = string>(ableName: Name, params?: RequestParam, isInstant?: boolean) => Requester<RequestParam> + + + +
+ + +
+ Request able through a method rather than an event. +At the moment of execution, requestStart is executed, +and then request and requestEnd can be executed through Requester. + +
+ + Examples +
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+// Instantly Request (requestStart - request - requestEnd)
+moveable.request("draggable", { deltaX: 10, deltaY: 10 }, true);
+
+// Start move
+const requester = moveable.request("draggable");
+requester.request({ deltaX: 10, deltaY: 10 });
+requester.request({ deltaX: 10, deltaY: 10 });
+requester.request({ deltaX: 10, deltaY: 10 });
+requester.requestEnd();
+ +
+ + +
+

Refer to:

+ +
+ +
+ +
+ +
+ getMoveables + + +
+ + + + + + + +
+ + getMoveables: +() => MoveableManagerInterface[] + + + +
+ + +
+ moveable is the top level that manages targets +`Single`: MoveableManager instance +`Group`: MoveableGroup instance +`IndividualGroup`: MoveableIndividaulGroup instance +Returns leaf target MoveableManagers. + +
+ + +
+ +
+ + + + + + + + + +
+ + getControlBoxElement: +() => HTMLElement + + + +
+ + +
+ Returns the element of the control box. + +
+ + +
+ +
+ +
+ getDragElement + + +
+ + + + + + + +
+ + getDragElement: +() => HTMLElement | SVGElement | null | undefined + + + +
+ + +
+ Target element to be dragged in moveable + +
+ + +
+ +
+ +
+ destroy + + +
+ + + + + + + +
+ + destroy: +() => void + + + +
+ + +
+ +
+ + +
+ +
+ +
+ dragStart + + +
+ + + + + + + +
+ + dragStart: +(e: MouseEvent | TouchEvent) => void + + + +
+ + +
+ +
+ + +
+ +
+ +
+ isInside + + +
+ + + + + + + +
+ + isInside: +(clientX: number, clientY: number) => boolean + + + +
+ + +
+ +
+ + +
+ +
+ +
+ isDragging + + +
+ + + + + + + +
+ + isDragging: +(ableName?: string) => boolean + + + +
+ + +
+ +
+ + +
+ +
+ +
+ hitTest + + +
+ + + + + + + +
+ + hitTest: +(el: Element | HitRect) => number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ setState + + +
+ + + + + + + +
+ + setState: +(state: any, callback?: () => any) => any + + + +
+ + +
+ +
+ + +
+ +
+ + + + + + + + + +
+ + waitToChangeTarget: +() => Promise<void> + + + +
+ + +
+ +
+ + +
+ +
+ +
+ forceUpdate + + +
+ + + + + + + +
+ + forceUpdate: +(callback?: () => any) => any + + + +
+ + +
+ +
+ + +
+ +
+ +
+ updateSelectors + + +
+ + + + + + + +
+ + updateSelectors: +() => void + + + +
+ + +
+ +
+ + +
+ +
+ +
+ getTargets + + +
+ + + + + + + +
+ + getTargets: +() => Array<HTMLElement | SVGElement> + + + +
+ + +
+ +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +(type?: "target" | "control") => void + + + +
+ + +
+ +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

MoveableManagerInterface<T, U>

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ getManager + + +
+ + + + + + + +
+ + getManager: +() => MoveableManagerInterface<any, any> + + + +
+ + +
+ +
+ + +
+ +
+ +
+ getRect + + +
+ + + + + + + +
+ + getRect: +() => RectInfo + + + +
+ + +
+ +
+ + +
+ +
+ +
+ getAble + + +
+ + + + + + + +
+ + getAble: +<T extends Able>(ableName: string) => T | undefined + + + +
+ + +
+ +
+ + +
+ +
+ + + + + + + + + +
+ + isMoveableElement: +(target: Element) => boolean + + + +
+ + +
+ +
+ + +
+ +
+ +
+ updateRect + + +
+ + + + + + + +
+ + updateRect: +(type?: "Start" | "" | "End", isTarget?: boolean, isSetState?: boolean) => void + + + +
+ + +
+ If the location or size of the target is changed, call the `.updateRect()` method. +Use the `useResizeObserver` and `useMutationObserver` props to update automatically. + +
+ + +
+ +
+ +
+ updateTarget + + +
+ + + + + + + +
+ + updateTarget: +() => void + + + +
+ + +
+ +
+ + +
+ +
+ +
+ request + + +
+ + + + + + + +
+ + request: +<RequestParam extends AbleRequesters[Name], Name extends string = string>(ableName: Name, params?: RequestParam, isInstant?: boolean) => Requester<RequestParam> + + + +
+ + +
+ Request able through a method rather than an event. +At the moment of execution, requestStart is executed, +and then request and requestEnd can be executed through Requester. + +
+ + Examples +
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body);
+
+// Instantly Request (requestStart - request - requestEnd)
+moveable.request("draggable", { deltaX: 10, deltaY: 10 }, true);
+
+// Start move
+const requester = moveable.request("draggable");
+requester.request({ deltaX: 10, deltaY: 10 });
+requester.request({ deltaX: 10, deltaY: 10 });
+requester.request({ deltaX: 10, deltaY: 10 });
+requester.requestEnd();
+ +
+ + +
+

Refer to:

+ +
+ +
+ +
+ +
+ getMoveables + + +
+ + + + + + + +
+ + getMoveables: +() => MoveableManagerInterface[] + + + +
+ + +
+ moveable is the top level that manages targets +`Single`: MoveableManager instance +`Group`: MoveableGroup instance +`IndividualGroup`: MoveableIndividaulGroup instance +Returns leaf target MoveableManagers. + +
+ + +
+ +
+ + + + + + + + + +
+ + getControlBoxElement: +() => HTMLElement + + + +
+ + +
+ Returns the element of the control box. + +
+ + +
+ +
+ +
+ getDragElement + + +
+ + + + + + + +
+ + getDragElement: +() => HTMLElement | SVGElement | null | undefined + + + +
+ + +
+ Target element to be dragged in moveable + +
+ + +
+ +
+ +
+ destroy + + +
+ + + + + + + +
+ + destroy: +() => void + + + +
+ + +
+ +
+ + +
+ +
+ +
+ dragStart + + +
+ + + + + + + +
+ + dragStart: +(e: MouseEvent | TouchEvent) => void + + + +
+ + +
+ +
+ + +
+ +
+ +
+ isInside + + +
+ + + + + + + +
+ + isInside: +(clientX: number, clientY: number) => boolean + + + +
+ + +
+ +
+ + +
+ +
+ +
+ isDragging + + +
+ + + + + + + +
+ + isDragging: +(ableName?: string) => boolean + + + +
+ + +
+ +
+ + +
+ +
+ +
+ hitTest + + +
+ + + + + + + +
+ + hitTest: +(el: Element | HitRect) => number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ setState + + +
+ + + + + + + +
+ + setState: +(state: any, callback?: () => any) => any + + + +
+ + +
+ +
+ + +
+ +
+ + + + + + + + + +
+ + waitToChangeTarget: +() => Promise<void> + + + +
+ + +
+ +
+ + +
+ +
+ +
+ forceUpdate + + +
+ + + + + + + +
+ + forceUpdate: +(callback?: () => any) => any + + + +
+ + +
+ +
+ + +
+ +
+ +
+ updateSelectors + + +
+ + + + + + + +
+ + updateSelectors: +() => void + + + +
+ + +
+ +
+ + +
+ +
+ +
+ getTargets + + +
+ + + + + + + +
+ + getTargets: +() => Array<HTMLElement | SVGElement> + + + +
+ + +
+ +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +(type?: "target" | "control") => void + + + +
+ + +
+ +
+ + +
+ +
+ +
+ moveables + optional + +
+ + + + + + + +
+ + moveables?: +MoveableManagerInterface[] + + + +
+ + +
+ +
+ + +
+ +
+ +
+ props + + +
+ + + + + + + +
+ + props: +MoveableManagerProps<T> + + + +
+ + +
+ +
+ + +
+ +
+ +
+ state + + +
+ + + + + + + +
+ + state: +MoveableManagerState<U> + + + +
+ + +
+ +
+ + +
+ +
+ +
+ renderState + + +
+ + + + + + + +
+ + renderState: +Record<string, any> + + + +
+ + +
+ +
+ + +
+ +
+ +
+ rotation + + +
+ + + + + + + +
+ + rotation: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ scale + + +
+ + + + + + + +
+ + scale: +number[] + + + +
+ + +
+ +
+ + +
+ +
+ +
+ controlGesto + + +
+ + + + + + + +
+ + controlGesto: +Gesto + + + +
+ + +
+ +
+ + +
+ +
+ +
+ targetGesto + + +
+ + + + + + + +
+ + targetGesto: +Gesto + + + +
+ + +
+ +
+ + +
+ +
+ +
+ enabledAbles + + +
+ + + + + + + +
+ + enabledAbles: +Able[] + + + +
+ + +
+ +
+ + +
+ +
+ +
+ controlAbles + + +
+ + + + + + + +
+ + controlAbles: +Able[] + + + +
+ + +
+ +
+ + +
+ +
+ +
+ targetAbles + + +
+ + + + + + + +
+ + targetAbles: +Able[] + + + +
+ + +
+ +
+ + +
+ +
+ +
+ areaElement + + +
+ + + + + + + +
+ + areaElement: +HTMLElement + + + +
+ + +
+ +
+ + +
+ +
+ +
+ controlBox + + +
+ + + + + + + +
+ + controlBox: +HTMLElement + + + +
+ + +
+ +
+ + +
+ +
+ +
+ isUnmounted + + +
+ + + + + + + +
+ + isUnmounted: +boolean + + + +
+ + +
+ +
+ + +
+ +
+ +
+ useCSS + + +
+ + + + + + + +
+ + useCSS: +(tag: string, css: string) => any + + + +
+ + +
+ +
+ + +
+ +
+ +
+ getContainer + + +
+ + + + + + + +
+ + getContainer: +() => HTMLElement | SVGElement + + + +
+ + +
+ +
+ + +
+ +
+ +
+ getRotation + + +
+ + + + + + + +
+ + getRotation: +() => number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ getState + + +
+ + + + + + + +
+ + getState: +() => MoveableManagerState<U> + + + +
+ + +
+ +
+ + +
+ +
+ +
+ triggerEvent + + +
+ + + + + + + +
+ + triggerEvent: +(name: string, params: IObject<any>, isManager?: boolean) => any + + + +
+ + +
+ +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

MoveableOptions

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ clickable + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + clickable?: +boolean + + + +
+ + +
+ Whether to trigger the moveable's click event. + +
+ + +
+ +
+ +
+ roundable + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + roundable?: +boolean + + + +
+ + +
+ Whether to show and drag border-radius. + +
+ + +
+ +
+ +
+ roundRelative + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + roundRelative?: +boolean + + + +
+ + +
+ % Can be used instead of the absolute px + +
+ + +
+ +
+ +
+ minRoundControls + optional + +
+ + + + + + +
+ Default Value: [0, 0] + +
+ + +
+ + minRoundControls?: +number[] + + + +
+ + +
+ Minimum number of round controls. It moves in proportion by control. [horizontal, vertical] + +
+ + +
+ +
+ +
+ maxRoundControls + optional + +
+ + + + + + +
+ Default Value: [4, 4] + +
+ + +
+ + maxRoundControls?: +number[] + + + +
+ + +
+ Maximum number of round controls. It moves in proportion by control. [horizontal, vertical] + +
+ + +
+ +
+ +
+ roundClickable + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + roundClickable?: +boolean | "line" | "control" + + + +
+ + +
+ Whether you can add/delete round controls by double-clicking a line or control. + +
+ + +
+ +
+ +
+ isDisplayShadowRoundControls + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + isDisplayShadowRoundControls?: +boolean | "horizontal" + + + +
+ + +
+ Whether to show a round control that does not actually exist as a shadow + +
+ + +
+ +
+ +
+ roundPadding + optional + +
+ + + + + + +
+ Default Value: 0 + +
+ + +
+ + roundPadding?: +number + + + +
+ + +
+ The padding value of the position of the round control + +
+ + +
+ +
+ +
+ clippable + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + clippable?: +boolean | ClippableOptions + + + +
+ + +
+ Whether to clip the target. + +
+ + +
+ +
+ +
+ keepRatio + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + keepRatio?: +boolean + + + +
+ + +
+ Whether to keep the ratio of size if your clipPath is 'inset', 'rect', 'ellipse' type + +
+ + +
+ +
+ +
+ customClipPath + optional + +
+ + + + + + + +
+ + customClipPath?: +string + + + +
+ + +
+ You can force the custom clipPath. (defaultClipPath < style < customClipPath < dragging clipPath) + +
+ + +
+ +
+ +
+ defaultClipPath + optional + +
+ + + + + + + +
+ + defaultClipPath?: +string + + + +
+ + +
+ If clippath is not set, the default value can be set. (defaultClipPath < style < customClipPath < dragging clipPath) + +
+ + +
+ +
+ +
+ clipRelative + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + clipRelative?: +boolean + + + +
+ + +
+ % Can be used instead of the absolute px (`rect` not possible) + +
+ + +
+ +
+ +
+ dragWithClip + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + dragWithClip?: +boolean + + + +
+ + +
+ When dragging the target, the clip also moves. + +
+ + +
+ +
+ +
+ clipArea + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + clipArea?: +boolean + + + +
+ + +
+ You can drag the clip by setting clipArea. + +
+ + +
+ +
+ +
+ clipTargetBounds + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + clipTargetBounds?: +boolean + + + +
+ + +
+ Whether the clip is bound to the target. + +
+ + +
+ +
+ +
+ clipVerticalGuidelines + optional + +
+ + + + + + +
+ Default Value: [] + +
+ + +
+ + clipVerticalGuidelines?: +Array<string | number> + + + +
+ + +
+ Add clip guidelines in the vertical direction. + +
+ + +
+ +
+ +
+ clipHorizontalGuidelines + optional + +
+ + + + + + +
+ Default Value: [] + +
+ + +
+ + clipHorizontalGuidelines?: +Array<string | number> + + + +
+ + +
+ Add clip guidelines in the horizontal direction. + +
+ + +
+ +
+ +
+ clipSnapThreshold + optional + +
+ + + + + + +
+ Default Value: 5 + +
+ + +
+ + clipSnapThreshold?: +number + + + +
+ + +
+ Distance value that can snap to clip guidelines. + +
+ + +
+ +
+ +
+ scrollable + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + scrollable?: +boolean + + + +
+ + +
+ Whether or not target can be scrolled to the scroll container + +
+ + +
+ +
+ +
+ scrollContainer + optional + +
+ + + + + + +
+ Default Value: container + +
+ + +
+ + scrollContainer?: +MoveableRefType<HTMLElement> + + + +
+ + +
+ The container to which scroll is applied + +
+ + +
+ +
+ +
+ scrollThreshold + optional + +
+ + + + + + +
+ Default Value: 0 + +
+ + +
+ + scrollThreshold?: +number + + + +
+ + +
+ Expand the range of the scroll check area. + +
+ + +
+ +
+ +
+ scrollThrottleTime + optional + +
+ + + + + + +
+ Default Value: 0 + +
+ + +
+ + scrollThrottleTime?: +number + + + +
+ + +
+ Time interval that occurs when scrolling occurs when dragging is maintained +If set to 0, it does not occur. + +
+ + +
+ +
+ +
+ getScrollPosition + optional + +
+ + + + + + +
+ Default Value: scrollContainer's scrollTop, scrollLeft + +
+ + +
+ + getScrollPosition?: +(e: {scrollContainer: HTMLElement, direction: number[]}) => number[] + + + +
+ + +
+ Sets a function to get the scroll position. + +
+ + +
+ +
+ +
+ scrollOptions + optional + +
+ + + +
+ Since: + 0.43.0 + + +
+ + +
+ Story Example: support-scroll--scrolling-scrollable +
+ + + + +
+ + scrollOptions?: +Partial<DragScrollOptions> | null + + + +
+ + +
+ Option to scroll with dragging + +
+ + Examples +
+ +
const scrollOptions = {
+    container: () => viewer.getContainer(),
+    threshold: 20,
+    getScrollPosition: () => {
+        return [
+            viewer.getScrollLeft({ absolute: true }),
+            viewer.getScrollTop({ absolute: true }),
+        ];
+    },
+};
+ +
+ + +
+ +
+ +
+ originDraggable + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + originDraggable?: +boolean + + + +
+ + +
+ Whether to drag origin. + +
+ + +
+ +
+ +
+ originRelative + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + originRelative?: +boolean + + + +
+ + +
+ % Can be used instead of the absolute px. + +
+ + +
+ +
+ +
+ defaultGroupRotate + optional + +
+ + + + + + +
+ Default Value: 0 + +
+ + +
+ + defaultGroupRotate?: +number + + + +
+ + +
+ Sets the initial rotation of the group. + +
+ + +
+ +
+ +
+ useDefaultGroupRotate + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + useDefaultGroupRotate?: +boolean + + + +
+ + +
+ Use the defaultGroupRotate even if the children's rotations match. + +
+ + +
+ +
+ +
+ defaultGroupOrigin + optional + +
+ + + + + + +
+ Default Value: "50% 50%" + +
+ + +
+ + defaultGroupOrigin?: +string + + + +
+ + +
+ Sets the initial transform origin of the group. + +
+ + +
+ +
+ +
+ targetGroups + optional + +
+ + + + + + + +
+ + targetGroups?: +MoveableTargetGroupsType + + + +
+ + +
+ +
+ + +
+ +
+ + + + + + + + +
+ Default Value: false + +
+ + +
+ + hideChildMoveableDefaultLines?: +boolean + + + +
+ + +
+ Whether to hide the line in child moveable for group corresponding to the rect of the target. + +
+ + +
+ +
+ +
+ groupableProps + optional + +
+ + + + + + + +
+ + groupableProps?: +Record<string, any> + + + +
+ + +
+ Props that work when group + +
+ + Examples +
+ +
```js
+{
+    roundable: true,
+    groupableProps: {
+        roundable: false,
+    },
+}
+```
+ +
+ + +
+ +
+ +
+ pinchable + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + pinchable?: +boolean | Array<"rotatable" | "resizable" | "scalable"> + + + +
+ + +
+ Whether or not target can be pinched with draggable, resizable, scalable, rotatable. + +
+ + +
+ +
+ +
+ renderDirections + optional + +
+ + + + + + +
+ Default Value: false if rotatable, ["n", "nw", "ne", "s", "se", "sw", "e", "w"] otherwise + +
+ + +
+ + renderDirections?: +boolean | string[] + + + +
+ + +
+ Set directions to show the control box. + +
+ + +
+ +
+ +
+ edge + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + edge?: +boolean | Array<LineDirection> + + + +
+ + +
+ Whether to scale and resize through edge lines. +You can use "n", "w", "s", "e" in LineDirection array. + +
+ + +
+ +
+ +
+ displayAroundControls + optional + +
+ + + +
+ Since: + 0.44.0 + + +
+ + +
+ Story Example: options--options-control-padding +
+ + + +
+ Default Value: false + +
+ + +
+ + displayAroundControls?: +boolean + + + +
+ + +
+ You can expand the area around the control. +Either `rotateAroundControls` or `displayAroundControls` can be used. +You can set the area through the `controlPadding` value. + +
+ + +
+ +
+ +
+ warpable + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + warpable?: +boolean + + + +
+ + +
+ Whether or not target can be warped. + +
+ + +
+ +
+ +
+ renderDirections + optional + +
+ + + + + + +
+ Default Value: false if rotatable, ["n", "nw", "ne", "s", "se", "sw", "e", "w"] otherwise + +
+ + +
+ + renderDirections?: +boolean | string[] + + + +
+ + +
+ Set directions to show the control box. + +
+ + +
+ +
+ +
+ edge + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + edge?: +boolean | Array<LineDirection> + + + +
+ + +
+ Whether to scale and resize through edge lines. +You can use "n", "w", "s", "e" in LineDirection array. + +
+ + +
+ +
+ +
+ displayAroundControls + optional + +
+ + + +
+ Since: + 0.44.0 + + +
+ + +
+ Story Example: options--options-control-padding +
+ + + +
+ Default Value: false + +
+ + +
+ + displayAroundControls?: +boolean + + + +
+ + +
+ You can expand the area around the control. +Either `rotateAroundControls` or `displayAroundControls` can be used. +You can set the area through the `controlPadding` value. + +
+ + +
+ +
+ +
+ rotatable + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + rotatable?: +boolean | RotatableOptions + + + +
+ + +
+ Whether or not target can be rotated. + +
+ + +
+ +
+ +
+ rotationPosition + optional + +
+ + + + + + +
+ Default Value: "top" + +
+ + +
+ + rotationPosition?: +RotationPosition | RotationPosition[] + + + +
+ + +
+ You can specify the position of the rotation. + +
+ + +
+ +
+ +
+ rotateAroundControls + optional + +
+ + + + + + +
+ Default Value: 0 + +
+ + +
+ + rotateAroundControls?: +boolean + + + +
+ + +
+ You can rotate around direction controls. +Either `rotateAroundControls` or `displayAroundControls` can be used. + +
+ + +
+ +
+ +
+ resolveAblesWithRotatable + optional + +
+ + + + + + +
+ Default Value: null + +
+ + +
+ + resolveAblesWithRotatable?: +Record<string, LineDirection[]> | null | undefined + + + +
+ + +
+ Sets the control that will cause resize along with rotate. (Only Single Target, Only resizable, Beta) + +
+ + +
+ +
+ +
+ throttleRotate + optional + +
+ + + + + + +
+ Default Value: 0 + +
+ + +
+ + throttleRotate?: +number + + + +
+ + +
+ throttle of angle(degree) when rotate. + +
+ + +
+ +
+ +
+ rotationTarget + optional + +
+ + + + + + +
+ Default Value: null + +
+ + +
+ + rotationTarget?: +MoveableRefType | ArrayFormat<MoveableRefType> | false + + + +
+ + +
+ Set additional rotationTargets. + +
+ + +
+ +
+ +
+ renderDirections + optional + +
+ + + + + + +
+ Default Value: false if rotatable, ["n", "nw", "ne", "s", "se", "sw", "e", "w"] otherwise + +
+ + +
+ + renderDirections?: +boolean | string[] + + + +
+ + +
+ Set directions to show the control box. + +
+ + +
+ +
+ +
+ edge + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + edge?: +boolean | Array<LineDirection> + + + +
+ + +
+ Whether to scale and resize through edge lines. +You can use "n", "w", "s", "e" in LineDirection array. + +
+ + +
+ +
+ +
+ displayAroundControls + optional + +
+ + + +
+ Since: + 0.44.0 + + +
+ + +
+ Story Example: options--options-control-padding +
+ + + +
+ Default Value: false + +
+ + +
+ + displayAroundControls?: +boolean + + + +
+ + +
+ You can expand the area around the control. +Either `rotateAroundControls` or `displayAroundControls` can be used. +You can set the area through the `controlPadding` value. + +
+ + +
+ +
+ +
+ scalable + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + scalable?: +boolean | ScalableOptions + + + +
+ + +
+ Whether or not target can be scaled. + +
+ + +
+ +
+ +
+ throttleScale + optional + +
+ + + + + + +
+ Default Value: 0 + +
+ + +
+ + throttleScale?: +number + + + +
+ + +
+ throttle of scaleX, scaleY when scale. + +
+ + +
+ +
+ +
+ keepRatio + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + keepRatio?: +boolean + + + +
+ + +
+ When resize or scale, keeps a ratio of the width, height. + +
+ + +
+ +
+ +
+ edge + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + edge?: +boolean | Array<LineDirection> + + + +
+ + +
+ Whether to scale and resize through edge lines. +You can use "n", "w", "s", "e" in LineDirection array. + +
+ + +
+ +
+ +
+ renderDirections + optional + +
+ + + + + + +
+ Default Value: false if rotatable, ["n", "nw", "ne", "s", "se", "sw", "e", "w"] otherwise + +
+ + +
+ + renderDirections?: +boolean | string[] + + + +
+ + +
+ Set directions to show the control box. + +
+ + +
+ +
+ +
+ edge + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + edge?: +boolean | Array<LineDirection> + + + +
+ + +
+ Whether to scale and resize through edge lines. +You can use "n", "w", "s", "e" in LineDirection array. + +
+ + +
+ +
+ +
+ displayAroundControls + optional + +
+ + + +
+ Since: + 0.44.0 + + +
+ + +
+ Story Example: options--options-control-padding +
+ + + +
+ Default Value: false + +
+ + +
+ + displayAroundControls?: +boolean + + + +
+ + +
+ You can expand the area around the control. +Either `rotateAroundControls` or `displayAroundControls` can be used. +You can set the area through the `controlPadding` value. + +
+ + +
+ +
+ +
+ resizable + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + resizable?: +boolean | ResizableOptions + + + +
+ + +
+ Whether or not target can be resized. + +
+ + +
+ +
+ +
+ throttleResize + optional + +
+ + + + + + +
+ Default Value: 1 + +
+ + +
+ + throttleResize?: +number + + + +
+ + +
+ throttle of width, height when resize. + +
+ + +
+ +
+ +
+ keepRatio + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + keepRatio?: +boolean + + + +
+ + +
+ When resize or scale, keeps a ratio of the width, height. + +
+ + +
+ +
+ +
+ keepRatioFinally + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + keepRatioFinally?: +boolean + + + +
+ + +
+ The size can be changed by format and throttle, but the ratio is maintained at the end. Forced true when using groups. + +
+ + +
+ +
+ +
+ resizeFormat + optional + +
+ + + + + + +
+ Default Value: oneself + +
+ + +
+ + resizeFormat?: +(size: number[]) => number[] + + + +
+ + +
+ Function to convert size for resize. + +
+ + +
+ +
+ +
+ edge + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + edge?: +boolean | Array<LineDirection> + + + +
+ + +
+ Whether to scale and resize through edge lines. +You can use "n", "w", "s", "e" in LineDirection array. + +
+ + +
+ +
+ +
+ checkResizableError + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + checkResizableError?: +boolean + + + +
+ + +
+ Whether to recalculate when the size to be calculated is different from the actual size + +
+ + +
+ +
+ +
+ draggable + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + draggable?: +boolean + + + +
+ + +
+ Whether or not target can be dragged. + +
+ + +
+ +
+ +
+ throttleDrag + optional + +
+ + + + + + +
+ Default Value: 0 + +
+ + +
+ + throttleDrag?: +number + + + +
+ + +
+ throttle of x, y when drag. + +
+ + +
+ +
+ +
+ throttleDragRotate + optional + +
+ + + + + + +
+ Default Value: 0 + +
+ + +
+ + throttleDragRotate?: +number + + + +
+ + +
+ throttle of angle(degree) of x,y when drag. + +
+ + +
+ +
+ +
+ hideThrottleDragRotateLine + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + hideThrottleDragRotateLine?: +boolean + + + +
+ + +
+ Hides the guidelines that appear when using the `throttleDragRotate` prop. + +
+ + +
+ +
+ +
+ startDragRotate + optional + +
+ + + + + + +
+ Default Value: 0 + +
+ + +
+ + startDragRotate?: +number + + + +
+ + +
+ start angle(degree) of x,y for throttleDragRotate when drag. + +
+ + +
+ +
+ +
+ edgeDraggable + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + edgeDraggable?: +boolean | Array<LineDirection> + + + +
+ + +
+ Whether to move by dragging the edge line + +
+ + +
+ +
+ +
+ onChangeTargets + optional + +
+ + + + + + + +
+ + onChangeTargets?: +(e: OnChangeTargets) => void + + + +
+ + +
+ +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

MoveablePosition

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ left + + +
+ + + + + + + +
+ + left: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ top + + +
+ + + + + + + +
+ + top: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ right + + +
+ + + + + + + +
+ + right: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ bottom + + +
+ + + + + + + +
+ + bottom: +number + + + +
+ + +
+ +
+ + +
+ +
+ +
+ origin + + +
+ + + + + + + +
+ + origin: +number[] + + + +
+ + +
+ +
+ + +
+ +
+ +
+ pos1 + + +
+ + + + + + + +
+ + pos1: +number[] + + + +
+ + +
+ +
+ + +
+ +
+ +
+ pos2 + + +
+ + + + + + + +
+ + pos2: +number[] + + + +
+ + +
+ +
+ + +
+ +
+ +
+ pos3 + + +
+ + + + + + + +
+ + pos3: +number[] + + + +
+ + +
+ +
+ + +
+ +
+ +
+ pos4 + + +
+ + + + + + + +
+ + pos4: +number[] + + + +
+ + +
+ +
+ + +
+ +
+ +
+ direction + + +
+ + + + + + + +
+ + direction: +1 | -1 + + + +
+ + +
+ +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

MoveableRefObject<T extends Element = HTMLElement | SVGElement>

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ current + + +
+ + + + + + + +
+ + current: +T | undefined | null + + + +
+ + +
+ +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

MoveableRefTargetType

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Type:
+ + + + + + + + + +

MoveableRefType<T extends Element = HTMLElement | SVGElement>

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Type:
+ + + + + + + + + +

MoveableTargetGroupsType

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Type:
+ + + + + + + + + +

OnBeforeRender

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ isPinch + + +
+ + + + + + + +
+ + isPinch: +boolean + + + +
+ + +
+ Whether or not it is being pinched. +
+ + +
+ + + + + + + +
+ `beforeRender` event occurs before the dragging of all events. +
+ + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnBeforeRenderEnd

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ isPinch + + +
+ + + + + + + +
+ + isPinch: +boolean + + + +
+ + +
+ Whether or not it is being dragged. +
+ + +
+ +
+ +
+ isDrag + + +
+ + + + + + + +
+ + isDrag: +boolean + + + +
+ + +
+ Whether or not it is being pinched. +
+ + +
+ + + + + + + +
+ `beforeRenderEnd` event occurs before the end of all events. +
+ + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnBeforeRenderGroup

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ isPinch + + +
+ + + + + + + +
+ + isPinch: +boolean + + + +
+ + +
+ Whether or not it is being pinched. +
+ + +
+ +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ targets set to group. +
+ + +
+ +
+ +
+ events + + +
+ + + + + + + +
+ + events: +OnBeforeRender[] + + + +
+ + +
+ children's `beforeRender` events +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnBeforeRenderGroupEnd

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ isPinch + + +
+ + + + + + + +
+ + isPinch: +boolean + + + +
+ + +
+ Whether or not it is being dragged. +
+ + +
+ +
+ +
+ isDrag + + +
+ + + + + + + +
+ + isDrag: +boolean + + + +
+ + +
+ Whether or not it is being pinched. +
+ + +
+ +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ targets set to group. +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnBeforeRenderGroupStart

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ isPinch + + +
+ + + + + + + +
+ + isPinch: +boolean + + + +
+ + +
+ Whether or not it is being pinched. +
+ + +
+ +
+ +
+ setTransform + + +
+ + + + + + + +
+ + setTransform: +(transform: string | string[]) => any + + + +
+ + +
+ Set your original transform. +
+ + +
+ +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ targets set to group. +
+ + +
+ +
+ +
+ events + + +
+ + + + + + + +
+ + events: +OnBeforeRenderStart[] + + + +
+ + +
+ children's `beforeRenderStart` events +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnBeforeRenderStart

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ isPinch + + +
+ + + + + + + +
+ + isPinch: +boolean + + + +
+ + +
+ Whether or not it is being pinched. +
+ + +
+ +
+ +
+ setTransform + + +
+ + + + + + + +
+ + setTransform: +(transform: string | string[]) => any + + + +
+ + +
+ Set your original transform. +
+ + +
+ + + + + + + +
+ `beforeRenderStart` event occurs before the first start of all events. +
+ + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnChangeTargets

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<any, any> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ The Moveable's targets + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnClick

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ inputTarget + + +
+ + + + + + + +
+ + inputTarget: +Element + + + +
+ + +
+ Clicked element. + +
+ + +
+ +
+ +
+ moveableTarget + + +
+ + + + + + + +
+ + moveableTarget: +HTMLElement | SVGElement | null + + + +
+ + +
+ clicked moveable target + +
+ + +
+ +
+ +
+ isTarget + + +
+ + + + + + + +
+ + isTarget: +boolean + + + +
+ + +
+ Whether the clicked target is moveable target. + +
+ + +
+ +
+ +
+ containsTarget + + +
+ + + + + + + +
+ + containsTarget: +boolean + + + +
+ + +
+ Whether the clicked target is a child of moveable target. + +
+ + +
+ +
+ +
+ isDouble + + +
+ + + + + + + +
+ + isDouble: +boolean + + + +
+ + +
+ Whether it is double-click + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnClickGroup

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ inputTarget + + +
+ + + + + + + +
+ + inputTarget: +Element + + + +
+ + +
+ Clicked element. + +
+ + +
+ +
+ +
+ moveableTarget + + +
+ + + + + + + +
+ + moveableTarget: +HTMLElement | SVGElement | null + + + +
+ + +
+ clicked moveable target + +
+ + +
+ +
+ +
+ isTarget + + +
+ + + + + + + +
+ + isTarget: +boolean + + + +
+ + +
+ Whether the clicked target is moveable target. + +
+ + +
+ +
+ +
+ containsTarget + + +
+ + + + + + + +
+ + containsTarget: +boolean + + + +
+ + +
+ Whether the clicked target is a child of moveable target. + +
+ + +
+ +
+ +
+ isDouble + + +
+ + + + + + + +
+ + isDouble: +boolean + + + +
+ + +
+ Whether it is double-click + +
+ + +
+ +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Element[] + + + +
+ + +
+ targets set to group. + +
+ + +
+ +
+ +
+ targetIndex + + +
+ + + + + + + +
+ + targetIndex: +number + + + +
+ + +
+ The corresponding index among the targets set as a group. + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnEndEvent

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ lastEvent + + +
+ + + + + + + +
+ + lastEvent: +any | undefined + + + +
+ + +
+ This is the last dragged event. No, if you haven't dragged. +
+ + +
+ +
+ +
+ isDrag + + +
+ + + + + + + +
+ + isDrag: +boolean + + + +
+ + +
+ Whether this moved +
+ + +
+ +
+ +
+ isDouble + + +
+ + + + + + + +
+ + isDouble: +boolean + + + +
+ + +
+ Whether it is double-click +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnEvent

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnRender

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ style + + +
+ + + + + + + +
+ + style: +Record<string, string> + + + +
+ + +
+ You can get the style you can get from the event. + +
+ + +
+ +
+ +
+ cssText + + +
+ + + + + + + +
+ + cssText: +string + + + +
+ + +
+ You can get it as a cssText that you can get from that event. + +
+ + +
+ +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ transform + + +
+ + + + + + + +
+ + transform: +string + + + +
+ + +
+ a target's next transform string value. + +
+ + +
+ +
+ +
+ isPinch + + +
+ + + + + + + +
+ + isPinch: +boolean + + + +
+ + +
+ Whether or not it is being pinched. + +
+ + +
+ +
+ +
+ transformObject + + +
+ + + + + + + +
+ + transformObject: +Record<string, any> + + + +
+ + +
+ Return transform as a transform object. +`rotate` is a number and everything else is an array of numbers. + +
+ + +
+ + + + + + + +
+ `render` event occurs before the target is drawn on the screen. +
+ + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnRenderEnd

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ style + + +
+ + + + + + + +
+ + style: +Record<string, string> + + + +
+ + +
+ You can get the style you can get from the event. + +
+ + +
+ +
+ +
+ cssText + + +
+ + + + + + + +
+ + cssText: +string + + + +
+ + +
+ You can get it as a cssText that you can get from that event. + +
+ + +
+ +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ transform + + +
+ + + + + + + +
+ + transform: +string + + + +
+ + +
+ a target's next transform string value. + +
+ + +
+ +
+ +
+ isPinch + + +
+ + + + + + + +
+ + isPinch: +boolean + + + +
+ + +
+ Whether or not it is being dragged. + +
+ + +
+ +
+ +
+ isDrag + + +
+ + + + + + + +
+ + isDrag: +boolean + + + +
+ + +
+ Whether or not it is being pinched. + +
+ + +
+ +
+ +
+ transformObject + + +
+ + + + + + + +
+ + transformObject: +Record<string, any> + + + +
+ + +
+ Return transform as a transform object. +`rotate` is a number and everything else is an array of numbers. + +
+ + +
+ + + + + + + +
+ `renderEnd` event occurs at the end of all events. +
+ + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnRenderGroup

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ style + + +
+ + + + + + + +
+ + style: +Record<string, string> + + + +
+ + +
+ You can get the style you can get from the event. + +
+ + +
+ +
+ +
+ cssText + + +
+ + + + + + + +
+ + cssText: +string + + + +
+ + +
+ You can get it as a cssText that you can get from that event. + +
+ + +
+ +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ transform + + +
+ + + + + + + +
+ + transform: +string + + + +
+ + +
+ a target's next transform string value. + +
+ + +
+ +
+ +
+ isPinch + + +
+ + + + + + + +
+ + isPinch: +boolean + + + +
+ + +
+ Whether or not it is being pinched. + +
+ + +
+ +
+ +
+ transformObject + + +
+ + + + + + + +
+ + transformObject: +Record<string, any> + + + +
+ + +
+ Return transform as a transform object. +`rotate` is a number and everything else is an array of numbers. + +
+ + +
+ +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ targets set to group. +
+ + +
+ +
+ +
+ events + + +
+ + + + + + + +
+ + events: +OnRender[] + + + +
+ + +
+ Each `render` event on the targets +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnRenderGroupEnd

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ style + + +
+ + + + + + + +
+ + style: +Record<string, string> + + + +
+ + +
+ You can get the style you can get from the event. + +
+ + +
+ +
+ +
+ cssText + + +
+ + + + + + + +
+ + cssText: +string + + + +
+ + +
+ You can get it as a cssText that you can get from that event. + +
+ + +
+ +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ transform + + +
+ + + + + + + +
+ + transform: +string + + + +
+ + +
+ a target's next transform string value. + +
+ + +
+ +
+ +
+ isPinch + + +
+ + + + + + + +
+ + isPinch: +boolean + + + +
+ + +
+ Whether or not it is being dragged. + +
+ + +
+ +
+ +
+ isDrag + + +
+ + + + + + + +
+ + isDrag: +boolean + + + +
+ + +
+ Whether or not it is being pinched. + +
+ + +
+ +
+ +
+ transformObject + + +
+ + + + + + + +
+ + transformObject: +Record<string, any> + + + +
+ + +
+ Return transform as a transform object. +`rotate` is a number and everything else is an array of numbers. + +
+ + +
+ +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ targets set to group. +
+ + +
+ +
+ +
+ events + + +
+ + + + + + + +
+ + events: +OnRenderEnd[] + + + +
+ + +
+ Each `renderEnd` event on the targets +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnRenderGroupStart

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ isPinch + + +
+ + + + + + + +
+ + isPinch: +boolean + + + +
+ + +
+ Whether or not it is being pinched. +
+ + +
+ +
+ +
+ targets + + +
+ + + + + + + +
+ + targets: +Array<HTMLElement | SVGElement> + + + +
+ + +
+ targets set to group. +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnRenderStart

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ currentTarget + + +
+ + + + + + + +
+ + currentTarget: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ moveable + + +
+ + + + + + + +
+ + moveable: +MoveableManagerInterface<Record<string, any>, Record<string, any>> + + + +
+ + +
+ The Moveable instance + +
+ + +
+ +
+ +
+ target + + +
+ + + + + + + +
+ + target: +HTMLElement | SVGElement + + + +
+ + +
+ The Moveable's target + +
+ + +
+ +
+ +
+ clientX + + +
+ + + + + + + +
+ + clientX: +number + + + +
+ + +
+ The horizontal coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ clientY + + +
+ + + + + + + +
+ + clientY: +number + + + +
+ + +
+ The vertical coordinate within the application's client area at which the event occurred. + +
+ + +
+ +
+ +
+ isFirstDrag + + +
+ + + + + + + +
+ + isFirstDrag: +number + + + +
+ + +
+ Whether this is the first drag in the drag event + +
+ + +
+ +
+ +
+ datas + + +
+ + + + + + + +
+ + datas: +IObject<any> + + + +
+ + +
+ Objects that can send information to the following events. + +
+ + +
+ +
+ +
+ inputEvent + + +
+ + + + + + + +
+ + inputEvent: +any + + + +
+ + +
+ The mouse or touch input event that is invoking the moveable event + +
+ + +
+ +
+ +
+ stopAble + + +
+ + + + + + + +
+ + stopAble: +() => void + + + +
+ + +
+ Stop the currently working able. + +
+ + +
+ +
+ +
+ stopDrag + + +
+ + + + + + + +
+ + stopDrag: +() => void + + + +
+ + +
+ Calling `stopDrag` in a drag-related event ends the drag. + +
+ + +
+ +
+ +
+ isTrusted + + +
+ + + + + + + +
+ + isTrusted: +boolean + + + +
+ + +
+ Whether the event did not occur externally + +
+ + +
+ +
+ +
+ isPinch + + +
+ + + + + + + +
+ + isPinch: +boolean + + + +
+ + +
+ Whether or not it is being pinched. +
+ + +
+ + + + + + + +
+ `renderStart` event occurs at the first start of all events. +
+ + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnTransformEvent

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ style + + +
+ + + + + + + +
+ + style: +Record<string, string> + + + +
+ + +
+ You can get the style you can get from the event. + +
+ + +
+ +
+ +
+ cssText + + +
+ + + + + + + +
+ + cssText: +string + + + +
+ + +
+ You can get it as a cssText that you can get from that event. + +
+ + +
+ +
+ +
+ transform + + +
+ + + + + + + +
+ + transform: +string + + + +
+ + +
+ a target's next transform string value. + +
+ + +
+ +
+ +
+ afterTransform + + +
+ + + + + + + +
+ + afterTransform: +string + + + +
+ + +
+ A transform obtained by the simultaneous occurrence of other events in the current event + +
+ + +
+ +
+ +
+ drag + + +
+ + + + + + + +
+ + drag: +OnDrag + + + +
+ + +
+ transform events causes a `drag` event. In some events, there may be no value. + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OnTransformStartEvent

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ setTransform + + +
+ + + + + + +
+ Default Value: transform of target's inline style + +
+ + +
+ + setTransform: +(transform: string | string[], transformIndex?: number) => void + + + +
+ + +
+ Set your original transform. +`transformIndex` is the sequence of functions used in the event. +If you use `setTransform`, you don't need to use `set` function. + +
+ + +
+ +
+ + + + + + + + +
+ Default Value: index with that property in transform or last + +
+ + +
+ + setTransformIndex: +(transformIndex: number) => void + + + +
+ + +
+ `transformIndex` is the sequence of functions used in the event. + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

OriginOptions

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ origin + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + origin?: +boolean + + + +
+ + +
+ Whether or not the origin control box will be visible or not. + +
+ + +
+ +
+ +
+ svgOrigin + optional + +
+ + + +
+ Since: + 0.47.0 + + +
+ + + + +
+ Default Value: "" + +
+ + +
+ + svgOrigin?: +string + + + +
+ + +
+ Sets the transform origin based on the svg target. If not set, it is set as the transform origin based on the owner of svg. + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

PaddingBox

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ left + optional + +
+ + + + + + + +
+ + left?: +number + + + +
+ + +
+ left padding +
+ + +
+ +
+ +
+ top + optional + +
+ + + + + + + +
+ + top?: +number + + + +
+ + +
+ top padding +
+ + +
+ +
+ +
+ right + optional + +
+ + + + + + + +
+ + right?: +number + + + +
+ + +
+ right padding +
+ + +
+ +
+ +
+ bottom + optional + +
+ + + + + + + +
+ + bottom?: +number + + + +
+ + +
+ bottom padding +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

PaddingOptions

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ padding + optional + +
+ + + + + + +
+ Default Value: null + +
+ + +
+ + padding?: +PaddingBox | number + + + +
+ + +
+ Add padding around the target to increase the drag area. + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

PersistRectData

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Type:
+
    +
  • + +Omit<Partial<RectInfo>, "children"> & {children?: Array<Partial<RectInfo>>} + + +
  • +
+ + + + + + + + +

RectInfo

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ pos1 + + +
+ + + + + + + +
+ + pos1: +number[] + + + +
+ + +
+ The coordinates of the vertex 1 + +
+ + +
+ +
+ +
+ pos2 + + +
+ + + + + + + +
+ + pos2: +number[] + + + +
+ + +
+ The coordinates of the vertex 2 + +
+ + +
+ +
+ +
+ pos3 + + +
+ + + + + + + +
+ + pos3: +number[] + + + +
+ + +
+ The coordinates of the vertex 3 + +
+ + +
+ +
+ +
+ pos4 + + +
+ + + + + + + +
+ + pos4: +number[] + + + +
+ + +
+ The coordinates of the vertex 4 + +
+ + +
+ +
+ +
+ left + + +
+ + + + + + + +
+ + left: +number + + + +
+ + +
+ left position of the target relative to the container + +
+ + +
+ +
+ +
+ top + + +
+ + + + + + + +
+ + top: +number + + + +
+ + +
+ top position of the target relative to the container + +
+ + +
+ +
+ +
+ width + + +
+ + + + + + + +
+ + width: +number + + + +
+ + +
+ The width of moveable element + +
+ + +
+ +
+ +
+ height + + +
+ + + + + + + +
+ + height: +number + + + +
+ + +
+ The height of moveable element + +
+ + +
+ +
+ +
+ offsetWidth + + +
+ + + + + + + +
+ + offsetWidth: +number + + + +
+ + +
+ The offset width of the target + +
+ + +
+ +
+ +
+ offsetHeight + + +
+ + + + + + + +
+ + offsetHeight: +number + + + +
+ + +
+ The offset height of the target + +
+ + +
+ +
+ +
+ origin + + +
+ + + + + + + +
+ + origin: +number[] + + + +
+ + +
+ The absolute transform origin + +
+ + +
+ +
+ +
+ beforeOrigin + + +
+ + + + + + + +
+ + beforeOrigin: +number[] + + + +
+ + +
+ The absolute transform origin before transformation + +
+ + +
+ +
+ +
+ transformOrigin + + +
+ + + + + + + +
+ + transformOrigin: +number[] + + + +
+ + +
+ The target transform origin + +
+ + +
+ +
+ +
+ rotation + + +
+ + + + + + + +
+ + rotation: +number + + + +
+ + +
+ you can get the absolute rotation value + +
+ + +
+ +
+ +
+ children + optional + +
+ + + + + + + +
+ + children?: +RectInfo[] + + + +
+ + +
+ If you use a group, you can get child moveables' rect info + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

RenderDirections

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ renderDirections + optional + +
+ + + + + + +
+ Default Value: false if rotatable, ["n", "nw", "ne", "s", "se", "sw", "e", "w"] otherwise + +
+ + +
+ + renderDirections?: +boolean | string[] + + + +
+ + +
+ Set directions to show the control box. + +
+ + +
+ +
+ +
+ edge + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + edge?: +boolean | Array<LineDirection> + + + +
+ + +
+ Whether to scale and resize through edge lines. +You can use "n", "w", "s", "e" in LineDirection array. + +
+ + +
+ +
+ +
+ displayAroundControls + optional + +
+ + + +
+ Since: + 0.44.0 + + +
+ + +
+ Story Example: options--options-control-padding +
+ + + +
+ Default Value: false + +
+ + +
+ + displayAroundControls?: +boolean + + + +
+ + +
+ You can expand the area around the control. +Either `rotateAroundControls` or `displayAroundControls` can be used. +You can set the area through the `controlPadding` value. + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

Requester<RequestParam = AbleRequestParam>

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + +
Properties:
+ + + + +
+ +
+ request + + +
+ + + + + + + +
+ + request: +(param: RequestParam) => this + + + +
+ + +
+ Continue executing the request. +
+ + +
+ +
+ +
+ requestEnd + + +
+ + + + + + + +
+ + requestEnd: +() => this + + + +
+ + +
+ End the request. +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + +

TransformObject

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ style + + +
+ + + + + + + +
+ + style: +Record<string, string> + + + +
+ + +
+ You can get the style you can get from the event. + +
+ + +
+ +
+ +
+ cssText + + +
+ + + + + + + +
+ + cssText: +string + + + +
+ + +
+ You can get it as a cssText that you can get from that event. + +
+ + +
+ +
+ +
+ transform + + +
+ + + + + + + +
+ + transform: +string + + + +
+ + +
+ a target's next transform string value. + +
+ + +
+ +
+ +
+ afterTransform + + +
+ + + + + + + +
+ + afterTransform: +string + + + +
+ + +
+ A transform obtained by the simultaneous occurrence of other events in the current event + +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + + + +

Events

+ + + + + + +

click

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When you click on the element, the `click` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.OnClick + + + + Parameters for the `click` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    target: document.querySelector(".target"),
+});
+moveable.on("click", ({ hasTarget, containsTarget, targetIndex }) => {
+    // If you click on an element other than the target and not included in the target, index is -1.
+    console.log("onClickGroup", target, hasTarget, containsTarget, targetIndex);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

clickGroup

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ When you click on the element inside the group, the `clickGroup` event is called. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.OnClickGroup + + + + Parameters for the `clickGroup` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    target: [].slice.call(document.querySelectorAll(".target")),
+});
+moveable.on("clickGroup", ({ inputTarget, isTarget, containsTarget, targetIndex }) => {
+    // If you click on an element other than the target and not included in the target, index is -1.
+    console.log("onClickGroup", inputTarget, isTarget, containsTarget, targetIndex);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

render

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ `render` event occurs before the target is drawn on the screen. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.OnRender + + + + Parameters for the `render` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    target: document.querySelector(".target"),
+});
+moveable.on("render", ({ target }) => {
+    console.log("onRender", target);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

renderEnd

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ `renderEnd` event occurs at the end of all events. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.OnRenderEnd + + + + Parameters for the `renderEnd` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    target: document.querySelector(".target"),
+});
+moveable.on("renderEnd", ({ target }) => {
+    console.log("onRenderEnd", target);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

renderGroup

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ `renderGroup` event occurs before the target is drawn on the screen in group. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.OnRenderGroup + + + + Parameters for the `renderGroup` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    target: [].slice.call(document.querySelectorAll(".target")),
+});
+moveable.on("renderGroup", ({ targets }) => {
+    console.log("onRenderGroup", targets);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

renderGroupEnd

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ `renderGroupEnd` event occurs at the end of all events in group. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.OnRenderGroupEnd + + + + Parameters for the `renderGroupEnd` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    target: [].slice.call(document.querySelectorAll(".target")),
+});
+moveable.on("renderGroupEnd", ({ targets }) => {
+    console.log("onRenderGroupEnd", targets);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

renderGroupStart

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ `renderGroupStart` event occurs at the first start of all events in group. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.OnRenderGroupStart + + + + Parameters for the `renderGroupStart` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    target: [].slice.call(document.querySelectorAll(".target")),
+});
+moveable.on("renderGroupStart", ({ targets }) => {
+    console.log("onRenderGroupStart", targets);
+});
+ + + + + + + + + + + + + + + + + + + + + + +

renderStart

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ `renderStart` event occurs at the first start of all events. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +Moveable.OnRenderStart + + + + Parameters for the `renderStart` event
+ + + + + + +
Example
+ +
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    target: document.querySelector(".target"),
+});
+moveable.on("renderStart", ({ target }) => {
+    console.log("onRenderStart", target);
+});
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + \ No newline at end of file diff --git a/release/0.52.0/doc/global.html b/release/0.52.0/doc/global.html new file mode 100644 index 000000000..d1ff1c3c0 --- /dev/null +++ b/release/0.52.0/doc/global.html @@ -0,0 +1,1770 @@ + + + + + Global - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

Global

+ + + + + + + +
+ +
+ +

+ +

+ + +
+ +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + +

Methods

+ + + + + + +

getMoveables() → {MoveableManagerInterface[]}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ moveable is the top level that manages targets +`Single`: MoveableManager instance +`Group`: MoveableGroup instance +`IndividualGroup`: MoveableIndividaulGroup instance +Returns leaf target MoveableManagers. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +MoveableManagerInterface[] + + +
+
+ + + + + + + + +

Type Definitions

+ + + +

MoveableDefaultOptions

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + +
+ +
+ padding + optional + +
+ + + + + + +
+ Default Value: null + +
+ + +
+ + padding?: +PaddingBox | number + + + +
+ + +
+ Add padding around the target to increase the drag area. + +
+ + +
+ +
+ +
+ origin + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + origin?: +boolean + + + +
+ + +
+ Whether or not the origin control box will be visible or not. + +
+ + +
+ +
+ +
+ svgOrigin + optional + +
+ + + +
+ Since: + 0.47.0 + + +
+ + + + +
+ Default Value: "" + +
+ + +
+ + svgOrigin?: +string + + + +
+ + +
+ Sets the transform origin based on the svg target. If not set, it is set as the transform origin based on the owner of svg. + +
+ + +
+ +
+ +
+ dragArea + optional + +
+ + + + + + +
+ Default Value: if group, true, else fals + +
+ + +
+ + dragArea?: +boolean + + + +
+ + +
+ Instead of firing an event on the target, we add it to the moveable control element. You can use click and clickGroup events. + +
+ + +
+ +
+ +
+ passDragArea + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + passDragArea?: +boolean + + + +
+ + +
+ Set `pointerEvents: none;` css to pass events in dragArea. + +
+ + +
+ +
+ +
+ target + optional + +
+ + + + + + +
+ Default Value: null + +
+ + +
+ + target?: +SVGElement | HTMLElement | null + + + +
+ + +
+ The target(s) to indicate Moveable Control Box. + +
+ + +
+ +
+ +
+ dragTarget + optional + +
+ + + + + + +
+ Default Value: target + +
+ + +
+ + dragTarget?: +MoveableRefType | null + + + +
+ + +
+ The external target(s) to drag Moveable target(s) + +
+ + +
+ +
+ +
+ dragTargetSelf + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + dragTargetSelf?: +boolean + + + +
+ + +
+ If dragTarget is set directly, taget itself cannot be dragged. +Whether to drag the target as well. + +
+ + +
+ +
+ +
+ dragContainer + optional + +
+ + + + + + +
+ Default Value: window + +
+ + +
+ + dragContainer?: +null | Window | MoveableRefType<HTMLElement> + + + +
+ + +
+ Container area where drag works + +
+ + +
+ +
+ +
+ container + optional + +
+ + + + + + +
+ Default Value: parentElement + +
+ + +
+ + container?: +SVGElement | HTMLElement | null + + + +
+ + +
+ A container into which Moveables are inserted. +Set it only when used within the slot of Web Components or when the container is different. + +
+ + +
+ +
+ +
+ rootContainer + optional + +
+ + + + +
+ Story Example: options--options-root-container +
+ + + +
+ Default Value: parentElement + +
+ + +
+ + rootContainer?: +MoveableRefType<HTMLElement> + + + +
+ + +
+ Moveable Root Container (No Transformed Container) + +
+ + +
+ +
+ +
+ viewContainer + optional + +
+ + + + +
+ Story Example: options--options-view-container +
+ + + +
+ Default Value: null + +
+ + +
+ + viewContainer?: +MoveableRefType<HTMLElement> + + + +
+ + +
+ If you want to set the dragging information to the viewer, refer to the following. + +
+ + +
+ +
+ +
+ useResizeObserver + optional + +
+ + + + +
+ Story Example: options--options-resize-observer +
+ + + +
+ Default Value: false + +
+ + +
+ + useResizeObserver?: +boolean + + + +
+ + +
+ Whether the target size is detected and updated whenever it changes. +It is more effective when used together with `useMutationObserver`. + +
+ + +
+ +
+ +
+ useMutationObserver + optional + +
+ + + + +
+ Story Example: options--options-mutation-observer +
+ + + +
+ Default Value: false + +
+ + +
+ + useMutationObserver?: +boolean + + + +
+ + +
+ Whether the target size, pos in inline style is detected and updated whenever it changes. +It is more effective when used together with `useResizeObserver`. + +
+ + +
+ +
+ +
+ zoom + optional + +
+ + + + + + +
+ Default Value: 1 + +
+ + +
+ + zoom?: +number + + + +
+ + +
+ Zooms in the elements of a moveable. + +
+ + +
+ +
+ +
+ transformOrigin + optional + +
+ + + + + + +
+ Default Value: "" + +
+ + +
+ + transformOrigin?: +Array<string | number> | string | "" + + + +
+ + +
+ The default transformOrigin of the target can be set in advance. + +
+ + +
+ +
+ +
+ ables + optional + +
+ + + + + + +
+ Default Value: [] + +
+ + +
+ + ables?: +Able[] + + + +
+ + +
+ You can add your custom able. + +
+ + +
+ +
+ +
+ className + optional + +
+ + + + + + +
+ Default Value: "" + +
+ + +
+ + className?: +string + + + +
+ + +
+ You can specify the className of the moveable controlbox. + +
+ + +
+ +
+ +
+ pinchThreshold + optional + +
+ + + + + + +
+ Default Value: 20 + +
+ + +
+ + pinchThreshold?: +number + + + +
+ + +
+ Minimum distance to pinch. + +
+ + +
+ +
+ +
+ pinchOutside + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + pinchOutside?: +boolean + + + +
+ + +
+ Whether the container containing the target becomes a pinch. + +
+ + +
+ +
+ +
+ triggerAblesSimultaneously + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + triggerAblesSimultaneously?: +boolean + + + +
+ + +
+ Lets generate events of ables at the same time. (like Resizable, Scalable) + +
+ + +
+ +
+ +
+ checkInput + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + checkInput?: +boolean + + + +
+ + +
+ Checks whether this is an element to input text or contentEditable, and prevents dragging. + +
+ + +
+ +
+ +
+ cspNonce + optional + +
+ + + + + + +
+ Default Value: "" + +
+ + +
+ + cspNonce?: +string + + + +
+ + +
+ add nonce property to style for CSP. + +
+ + +
+ +
+ +
+ translateZ + optional + +
+ + + + + + +
+ Default Value: 50 + +
+ + +
+ + translateZ?: +number | string + + + +
+ + +
+ You can set the translateZ value of moveable. + +
+ + +
+ +
+ +
+ hideDefaultLines + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + hideDefaultLines?: +boolean + + + +
+ + +
+ Whether to hide the line corresponding to the rect of the target. + +
+ + +
+ +
+ +
+ stopPropagation + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + stopPropagation?: +boolean + + + +
+ + +
+ Whether to prevent bubbling of events like mousedown, touchstart, etc. + +
+ + +
+ +
+ +
+ preventDefault + optional + +
+ + + +
+ Since: + 0.44.0 + + +
+ + + + +
+ Default Value: true + +
+ + +
+ + preventDefault?: +boolean + + + +
+ + +
+ Whether to call preventDefault on touchstart or mousedown + +
+ + +
+ +
+ +
+ preventClickEventOnDrag + optional + +
+ + + + + + +
+ Default Value: true + +
+ + +
+ + preventClickEventOnDrag?: +boolean + + + +
+ + +
+ Prevent click event on drag. (mousemove, touchmove) + +
+ + +
+ +
+ +
+ dragFocusedInput + optional + +
+ + + +
+ Since: + 0.47.0 + + +
+ + +
+ Story Example: options--options-drag-focused-input +
+ + + +
+ Default Value: false + +
+ + +
+ + dragFocusedInput?: +boolean + + + +
+ + +
+ Whether to drag the focused input +If `checkInput` is true, this option is not applied. + +
+ + +
+ +
+ +
+ preventClickDefault + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + preventClickDefault?: +boolean + + + +
+ + +
+ Prevent click event on dragStart. (mousedown, touchstart) + +
+ + +
+ +
+ +
+ props + optional + +
+ + + + + + +
+ Default Value: empty object + +
+ + +
+ + props?: +Record<string, any> + + + +
+ + +
+ You can use props in object format or custom props. + +
+ + +
+ +
+ +
+ persistData + optional + +
+ + + + + + +
+ Default Value: null + +
+ + +
+ + persistData?: +PersistRectData | null + + + +
+ + +
+ Data for first render + +
+ + +
+ +
+ +
+ useAccuratePosition + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + useAccuratePosition?: +boolean + + + +
+ + +
+ Whether to accurately show the position of a movable control box +Because getBoundingClientRect is used, css zoom, transform: rotate between container and rootContainer cannot be used. +group is not supported. + +
+ + +
+ +
+ +
+ linePadding + optional + +
+ + + +
+ Since: + 0.43.0 + + +
+ + +
+ Story Example: options--options-line-padding +
+ + + +
+ Default Value: 0 + +
+ + +
+ + linePadding?: +number + + + +
+ + +
+ By adding padding to the line, you can increase the area of the line that can be clicked and dragged. + +
+ + +
+ +
+ +
+ controlPadding + optional + +
+ + + +
+ Since: + 0.44.0 + + +
+ + +
+ Story Example: options--options-control-padding +
+ + + +
+ Default Value: 0 + +
+ + +
+ + controlPadding?: +number + + + +
+ + +
+ By adding padding to the control, you can increase the area of the control that can be clicked and dragged. +Either `rotateAroundControls` or `displayAroundControls` can be used. + +
+ + +
+ +
+ +
+ flushSync + optional + +
+ + + + + + +
+ Default Value: empty function + +
+ + +
+ + flushSync?: +(callback: () => void) => void + + + +
+ + +
+ If you are using React 18's concurrent mode, use `flushSync` for UI sync. + +
+ + Examples +
+ +
```jsx
+import { flushSync } from "react-dom";
+
+<Moveable flushSync={flushSync} />
+```
+ +
+ + +
+ + + + + + + + + +
Type:
+
    +
  • + +TSInterface + + +
  • +
+ + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + \ No newline at end of file diff --git a/release/0.52.0/doc/index.html b/release/0.52.0/doc/index.html new file mode 100644 index 000000000..a556aba2d --- /dev/null +++ b/release/0.52.0/doc/index.html @@ -0,0 +1,404 @@ + + + + + Home - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+

+

Moveable

+

+ + npm version + Github actions + + + React + Preact + Angular + Vue + Vue 3 + Svelte + Lit +

+

Moveable is Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable, Snappable

+

+ Github / + Demo / + Storybook / + API / + Main Project +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Moveable
DraggableResizableScalableRotatable
+ + + + + + + +
WarpablePinchableGroupableSnappable
ClippableRoundableOriginDraggableSelecto
+

🔥 Features

+
    +
  • Draggable refers to the ability to drag and move targets.
  • +
  • Resizable indicates whether the target's width and height can be increased or decreased.
  • +
  • Scalable indicates whether the target's x and y can be scale of transform.
  • +
  • Rotatable indicates whether the target can be rotated.
  • +
  • Warpable indicates whether the target can be warped (distorted, bented).
  • +
  • Pinchable indicates whether the target can be pinched with draggable, resizable, scalable, rotatable.
  • +
  • Groupable indicates Whether the targets can be moved in group with draggable, resizable, scalable, rotatable.
  • +
  • Snappable indicates whether to snap to the guideline.
  • +
  • OriginDraggable* indicates Whether to drag origin.
  • +
  • Clippable indicates Whether to clip the target.
  • +
  • Roundable indicates Whether to show and drag or double click border-radius.
  • +
  • Support SVG Elements (svg, path, line, ellipse, g, rect, ...etc)
  • +
  • Support Major Browsers
  • +
  • Support 3d Transform
  • +
+

⚙️ Installation

+

npm

+
$ npm i moveable
+
+

scripts

+
<script src="//daybrush.com/moveable/release/latest/dist/moveable.min.js"></script>
+
+

📄 Documents

+ +

🚀 How to use

+
    +
  • All classes of moveable control box and able elements have a moveable- prefix. So please don't put moveable- class name in target.
  • +
+
import Moveable from "moveable";
+
+const moveable = new Moveable(document.body, {
+    target: document.querySelector(".target"),
+    // If the container is null, the position is fixed. (default: parentElement(document.body))
+    container: document.body,
+    draggable: true,
+    resizable: true,
+    scalable: true,
+    rotatable: true,
+    warpable: true,
+    // Enabling pinchable lets you use events that
+    // can be used in draggable, resizable, scalable, and rotateable.
+    pinchable: true, // ["resizable", "scalable", "rotatable"]
+    origin: true,
+    keepRatio: true,
+    // Resize, Scale Events at edges.
+    edge: false,
+    throttleDrag: 0,
+    throttleResize: 0,
+    throttleScale: 0,
+    throttleRotate: 0,
+});
+/* draggable */
+moveable.on("dragStart", ({ target, clientX, clientY }) => {
+    console.log("onDragStart", target);
+}).on("drag", ({
+    target, transform,
+    left, top, right, bottom,
+    beforeDelta, beforeDist, delta, dist,
+    clientX, clientY,
+}) => {
+    console.log("onDrag left, top", left, top);
+    target!.style.left = `${left}px`;
+    target!.style.top = `${top}px`;
+    // console.log("onDrag translate", dist);
+    // target!.style.transform = transform;
+}).on("dragEnd", ({ target, isDrag, clientX, clientY }) => {
+    console.log("onDragEnd", target, isDrag);
+});
+
+/* resizable */
+moveable.on("resizeStart", ({ target, clientX, clientY }) => {
+    console.log("onResizeStart", target);
+}).on("resize", ({ target, width, height, dist, delta, clientX, clientY }) => {
+    console.log("onResize", target);
+    delta[0] && (target!.style.width = `${width}px`);
+    delta[1] && (target!.style.height = `${height}px`);
+}).on("resizeEnd", ({ target, isDrag, clientX, clientY }) => {
+    console.log("onResizeEnd", target, isDrag);
+});
+
+/* scalable */
+moveable.on("scaleStart", ({ target, clientX, clientY }) => {
+    console.log("onScaleStart", target);
+}).on("scale", ({
+    target, scale, dist, delta, transform, clientX, clientY,
+}: OnScale) => {
+    console.log("onScale scale", scale);
+    target!.style.transform = transform;
+}).on("scaleEnd", ({ target, isDrag, clientX, clientY }) => {
+    console.log("onScaleEnd", target, isDrag);
+});
+
+/* rotatable */
+moveable.on("rotateStart", ({ target, clientX, clientY }) => {
+    console.log("onRotateStart", target);
+}).on("rotate", ({ target, beforeDelta, delta, dist, transform, clientX, clientY }) => {
+    console.log("onRotate", dist);
+    target!.style.transform = transform;
+}).on("rotateEnd", ({ target, isDrag, clientX, clientY }) => {
+    console.log("onRotateEnd", target, isDrag);
+});
+
+/* warpable */
+this.matrix = [
+    1, 0, 0, 0,
+    0, 1, 0, 0,
+    0, 0, 1, 0,
+    0, 0, 0, 1,
+];
+moveable.on("warpStart", ({ target, clientX, clientY }) => {
+    console.log("onWarpStart", target);
+}).on("warp", ({
+    target,
+    clientX,
+    clientY,
+    delta,
+    dist,
+    multiply,
+    transform,
+}) => {
+    console.log("onWarp", target);
+    // target.style.transform = transform;
+    this.matrix = multiply(this.matrix, delta);
+    target.style.transform = `matrix3d(${this.matrix.join(",")})`;
+}).on("warpEnd", ({ target, isDrag, clientX, clientY }) => {
+    console.log("onWarpEnd", target, isDrag);
+});
+
+/* pinchable */
+// Enabling pinchable lets you use events that
+// can be used in draggable, resizable, scalable, and rotateable.
+moveable.on("pinchStart", ({ target, clientX, clientY }) => {
+    // pinchStart event occur before dragStart, rotateStart, scaleStart, resizeStart
+    console.log("onPinchStart");
+}).on("pinch", ({ target, clientX, clientY, datas }) => {
+    // pinch event occur before drag, rotate, scale, resize
+    console.log("onPinch");
+}).on("pinchEnd", ({ isDrag, target, clientX, clientY, datas }) => {
+    // pinchEnd event occur before dragEnd, rotateEnd, scaleEnd, resizeEnd
+    console.log("onPinchEnd");
+});
+
+

📦 Packages

+
    +
  • moveable: A Vanilla Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable.
  • +
  • react-moveable: A React Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable.
  • +
  • preact-moveable: A Preact Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable.
  • +
  • ngx-moveable: An Angular Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable.
  • +
  • svelte-moveable: A Svelte Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable.
  • +
  • lit-moveable: A Lit Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable.
  • +
  • vue-moveable: A Vue Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable.
  • +
  • vue3-moveable: A Vue 3 Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable.
  • +
+

⚙️ Developments

+

The moveable repo is managed as a monorepo with yarn.

+
yarn config set registry https://registry.npmjs.org/
+
+

The main project was made with react and I used croact to make it lighter with umd.

+

For development and testing, check in packages/react-moveable.

+

npm run storybook

+
$ yarn
+$ npm run packages:build
+$ npm run storybook
+
+

Runs the app in the development mode.
+Open http://localhost:6006 to view it in the browser.

+

The page will reload if you make edits.
+You will also see any lint errors in the console.

+

⭐️ Show Your Support

+

Please give a ⭐️ if this project helped you!

+

👏 Contributing

+

If you have any questions or requests or want to contribute to moveable or other packages, please write the issue or give me a Pull Request freely.

+

Code Contributors

+

This project exists thanks to all the people who contribute. [Contribute].

+ + + +

🐞 Bug Report

+

If you find a bug, please report to us opening a new Issue on GitHub.

+

Sponsors

+

+ + + +

+

Open Collective Financial Contributors

+

Become a financial contributor and help us sustain our community. [Contribute]

+

Individuals

+

+

Organizations

+

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

+

+ + + + + + + + +

+

📝 License

+

This project is MIT licensed.

+
MIT License
+
+Copyright (c) 2019 Daybrush
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+
+ + + + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + \ No newline at end of file diff --git a/release/0.52.0/doc/node_modules_@scena_event-emitter_src_EventEmitter.ts.html b/release/0.52.0/doc/node_modules_@scena_event-emitter_src_EventEmitter.ts.html new file mode 100644 index 000000000..7aeed9e74 --- /dev/null +++ b/release/0.52.0/doc/node_modules_@scena_event-emitter_src_EventEmitter.ts.html @@ -0,0 +1,292 @@ + + + + + node_modules/@scena/event-emitter/src/EventEmitter.ts - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

node_modules/@scena/event-emitter/src/EventEmitter.ts

+ + + + + + + +
+
+
import { findIndex, isObject } from "@daybrush/utils";
+import { EventListener, EventHash, EventInfo, EventOptions, OnEvent, TargetParam } from "./types";
+
+/**
+ * Implement EventEmitter on object or component.
+ */
+class EventEmitter<Events extends {} = { [key: string]: { [key: string]: any } }> {
+
+    private _events: {
+        [name: string]: EventInfo[],
+    } = {};
+    public on<Name extends keyof Events, Param = Events[Name]>(
+        eventName: Name, listener: EventListener<Param, this>): this;
+    public on(events: EventHash<Events, this>): this;
+    /**
+     * Add a listener to the registered event.
+     * @param - Name of the event to be added
+     * @param - listener function of the event to be added
+     * @example
+     * import EventEmitter from "@scena/event-emitter";
+     * cosnt emitter = new EventEmitter();
+     *
+     * // Add listener in "a" event
+     * emitter.on("a", () => {
+     * });
+     * // Add listeners
+     * emitter.on({
+     *  a: () => {},
+     *  b: () => {},
+     * });
+     */
+    public on(eventName: string | object, listener?: EventListener<Events[any], this>): this {
+        if (isObject(eventName)) {
+            for (const name in eventName) {
+                this.on<any>(name, eventName[name]);
+            }
+        } else {
+            this._addEvent(eventName, listener, {});
+        }
+        return this;
+    }
+    public off<Name extends keyof Events, Param = Events[Name]>(
+        eventName?: Name, listener?: EventListener<Param, this>): this;
+    public off(events: EventHash<Events, this>): this;
+    /**
+     * Remove listeners registered in the event target.
+     * @param - Name of the event to be removed
+     * @param - listener function of the event to be removed
+     * @example
+     * import EventEmitter from "@scena/event-emitter";
+     * cosnt emitter = new EventEmitter();
+     *
+     * // Remove all listeners.
+     * emitter.off();
+     *
+     * // Remove all listeners in "A" event.
+     * emitter.off("a");
+     *
+     *
+     * // Remove "listener" listener in "a" event.
+     * emitter.off("a", listener);
+     */
+    public off(eventName?: string | object, listener?: EventListener<Events[any], this>): this {
+        if (!eventName) {
+            this._events = {};
+        } else if(isObject(eventName)) {
+            for (const name in eventName) {
+                this.off<any>(name);
+            }
+        } else if (!listener) {
+            this._events[eventName] = [];
+        } else {
+            const events = this._events[eventName];
+
+            if (events) {
+                const index = findIndex(events, e => e.listener === listener);
+
+                if (index > -1) {
+                    events.splice(index, 1);
+                }
+            }
+        }
+        return this;
+    }
+    /**
+     * Add a disposable listener and Use promise to the registered event.
+     * @param - Name of the event to be added
+     * @param - disposable listener function of the event to be added
+     * @example
+     * import EventEmitter from "@scena/event-emitter";
+     * cosnt emitter = new EventEmitter();
+     *
+     * // Add a disposable listener in "a" event
+     * emitter.once("a", () => {
+     * });
+     *
+     * // Use Promise
+     * emitter.once("a").then(e => {
+     * });
+     */
+    public once<Name extends keyof Events & string, Param = Events[Name]>(
+        eventName: Name, listener?: EventListener<Param, this>): Promise<OnEvent<Param, this>> {
+        if (listener) {
+            this._addEvent(eventName, listener, { once: true });
+        }
+        return new Promise<OnEvent<Param, this>>(resolve => {
+            this._addEvent(eventName, resolve, { once: true });
+        });
+    }
+    public emit<Name extends keyof Events, Param = Events[Name]>(
+        eventName: {} extends Param ? Name : never): boolean;
+    public emit<Name extends keyof Events, Param = Events[Name]>(
+        eventName: Name, param: TargetParam<Param>): boolean;
+    /**
+     * Fires an event to call listeners.
+     * @param - Event name
+     * @param - Event parameter
+     * @return If false, stop the event.
+     * @example
+     *
+     * import EventEmitter from "@scena/event-emitter";
+     *
+     *
+     * const emitter = new EventEmitter();
+     *
+     * emitter.on("a", e => {
+     * });
+     *
+     *
+     * emitter.emit("a", {
+     *   a: 1,
+     * });
+     */
+    public emit(eventName: string, param: TargetParam<any> = {}): boolean {
+        const events = this._events[eventName];
+
+        if (!eventName || !events) {
+            return true;
+        }
+        let isStop = false;
+
+        param.eventType = eventName;
+        param.stop = () => {
+            isStop = true;
+        };
+        param.currentTarget = this;
+
+
+        [...events].forEach(info => {
+            info.listener(param);
+            if (info.once) {
+                this.off<any>(eventName, info.listener);
+            }
+        });
+
+        return !isStop;
+    }
+    public trigger<Name extends keyof Events, Param = Events[Name]>(eventName: {} extends TargetParam<Param> ? Name : never): boolean;
+    public trigger<Name extends keyof Events, Param = Events[Name]>(eventName: Name, param: TargetParam<Param>): boolean;
+    /**
+     * Fires an event to call listeners.
+     * @param - Event name
+     * @param - Event parameter
+     * @return If false, stop the event.
+     * @example
+     *
+     * import EventEmitter from "@scena/event-emitter";
+     *
+     *
+     * const emitter = new EventEmitter();
+     *
+     * emitter.on("a", e => {
+     * });
+     *
+     *
+     * emitter.emit("a", {
+     *   a: 1,
+     * });
+     *//**
+     * Fires an event to call listeners.
+     * @param - Event name
+     * @param - Event parameter
+     * @return If false, stop the event.
+     * @example
+     *
+     * import EventEmitter from "@scena/event-emitter";
+     *
+     *
+     * const emitter = new EventEmitter();
+     *
+     * emitter.on("a", e => {
+     * });
+     *
+     * // emit
+     * emitter.trigger("a", {
+     *   a: 1,
+     * });
+     */
+    public trigger<Name extends keyof Events>(eventName: Name, param: TargetParam<any>= {}): boolean {
+        return this.emit<any>(eventName, param);
+    }
+
+    private _addEvent(eventName: string, listener: EventListener<Events[any], this>, options: Partial<EventOptions>) {
+        const events = this._events;
+
+        events[eventName] = events[eventName] || [];
+
+        const listeners = events[eventName];
+
+        listeners.push({ listener, ...options });
+    }
+}
+
+export default EventEmitter;
+
+
+
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + diff --git a/release/0.52.0/doc/node_modules_@scena_event-emitter_src_types.ts.html b/release/0.52.0/doc/node_modules_@scena_event-emitter_src_types.ts.html new file mode 100644 index 000000000..725c9a079 --- /dev/null +++ b/release/0.52.0/doc/node_modules_@scena_event-emitter_src_types.ts.html @@ -0,0 +1,125 @@ + + + + + node_modules/@scena/event-emitter/src/types.ts - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

node_modules/@scena/event-emitter/src/types.ts

+ + + + + + + +
+
+

+/**
+ * @memberof EventEmitter
+ * @typedef
+ */
+export type TargetParam<Param> = Pick<Param, Exclude<keyof Param, keyof EmitterParam>> & Partial<EmitterParam>;
+
+/**
+ * @memberof EventEmitter
+ * @typedef
+ */
+export interface EmitterParam<Target = any> {
+    type: string;
+    currentTarget: Target;
+    stop(): void;
+}
+/**
+ * @memberof EventEmitter
+ * @typedef
+ */
+export type OnEvent<Param, Target = any> = EmitterParam<Target> & Param;
+/**
+ * @memberof EventEmitter
+ * @typedef
+ */
+export type EventHash<Events, Target> = Partial<{ [Key in keyof Events]: EventListener<Events[Key], Target> }>;
+/**
+ * @memberof EventEmitter
+ * @typedef
+ */
+export type EventListener<Param, Target> = (e: OnEvent<Param, Target>) => any;
+
+/**
+ * @memberof EventEmitter
+ * @typedef
+ */
+export interface EventOptions {
+    once: boolean;
+}
+
+/**
+ * @memberof EventEmitter
+ * @typedef
+ */
+export interface EventInfo extends Partial<EventOptions> {
+    listener: EventListener<any, any>;
+}
+
+
+
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + diff --git a/release/0.52.0/doc/packages_moveable_src_MoveableManager.tsx.html b/release/0.52.0/doc/packages_moveable_src_MoveableManager.tsx.html new file mode 100644 index 000000000..aa06e4b0b --- /dev/null +++ b/release/0.52.0/doc/packages_moveable_src_MoveableManager.tsx.html @@ -0,0 +1,204 @@ + + + + + packages/moveable/src/MoveableManager.tsx - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

packages/moveable/src/MoveableManager.tsx

+ + + + + + + +
+
+
import { ref, Properties } from "framework-utils";
+import * as React from "react";
+import { renderSelf, ContainerProvider } from "croact";
+import InnerMoveable from "./InnerMoveable";
+import {
+    MoveableInterface,
+    MoveableOptions, MoveableProperties,
+} from "react-moveable/types";
+import { camelize, getDocument, isArray } from "@daybrush/utils";
+import { MoveableEventsParameters } from "./types";
+import { PROPERTIES, EVENTS, METHODS } from "./consts";
+import EventEmitter from "@scena/event-emitter";
+/**
+ * Moveable is Draggable! Resizable! Scalable! Rotatable!
+ * @sort 1
+ * @alias Moveable
+ * @extends EventEmitter
+ */
+@Properties(METHODS, (prototype, property) => {
+    if (prototype[property]) {
+        return;
+    }
+    prototype[property] = function(...args: any[]) {
+        const self = this.getMoveable();
+
+        if (!self || !self[property]) {
+            return;
+        }
+        return self[property](...args);
+    };
+})
+@Properties(PROPERTIES, (prototype, property) => {
+    Object.defineProperty(prototype, property, {
+        get() {
+            return this.getMoveable().props[property];
+        },
+        set(value) {
+            this.setState({
+                [property]: value,
+            });
+        },
+        enumerable: true,
+        configurable: true,
+    });
+})
+class MoveableManager extends EventEmitter<MoveableEventsParameters> {
+    private innerMoveable!: InnerMoveable | null;
+    private containerProvider: ContainerProvider | null = null;
+    private selfElement: HTMLElement | null = null;
+    private _warp = false;
+    /**
+     *
+     */
+    constructor(parentElement: HTMLElement, options: MoveableOptions = {}) {
+        super();
+        const nextOptions = { ...options };
+
+        const events: any = {};
+
+        EVENTS.forEach(name => {
+            events[camelize(`on ${name}`)] = (e: any) => this.trigger<any>(name, e);
+        });
+        let selfElement!: HTMLElement;
+
+        if (options.warpSelf) {
+            delete options.warpSelf;
+            this._warp = true;
+            selfElement = parentElement;
+        } else {
+            selfElement = getDocument(parentElement).createElement("div");
+            parentElement.appendChild(selfElement);
+        }
+        this.containerProvider = renderSelf(
+            <InnerMoveable
+                ref={ref(this, "innerMoveable")}
+                {...nextOptions}
+                {...events}
+            /> as any,
+            selfElement,
+        );
+
+        this.selfElement = selfElement;
+        const target = nextOptions.target!;
+        if (isArray(target) && target.length > 1) {
+            this.updateRect();
+        }
+    }
+    public setState(state: Partial<MoveableOptions>, callback?: () => any) {
+        this.innerMoveable!.setState(state, callback);
+    }
+    public forceUpdate(callback?: () => any) {
+        this.innerMoveable!.forceUpdate(callback);
+    }
+    public dragStart(e: MouseEvent | TouchEvent) {
+        const innerMoveable = this.innerMoveable;
+        if ((innerMoveable as any).$_timer) {
+            this.forceUpdate();
+        }
+        this.getMoveable().dragStart(e);
+    }
+    public destroy() {
+        const selfElement = this.selfElement!;
+
+        renderSelf(
+            null,
+            selfElement!,
+            this.containerProvider,
+        );
+        if (!this._warp) {
+            selfElement?.parentElement?.removeChild(selfElement);
+        }
+        this.containerProvider = null;
+
+        this.off();
+        this.selfElement = null;
+        this.innerMoveable = null;
+    }
+    private getMoveable() {
+        return this.innerMoveable!.moveable;
+    }
+}
+
+interface MoveableManager extends MoveableInterface, MoveableProperties {
+}
+
+export default MoveableManager;
+
+
+
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + diff --git a/release/0.52.0/doc/packages_react-moveable_src_InitialMoveable.tsx.html b/release/0.52.0/doc/packages_react-moveable_src_InitialMoveable.tsx.html new file mode 100644 index 000000000..8604e0815 --- /dev/null +++ b/release/0.52.0/doc/packages_react-moveable_src_InitialMoveable.tsx.html @@ -0,0 +1,449 @@ + + + + + packages/react-moveable/src/InitialMoveable.tsx - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

packages/react-moveable/src/InitialMoveable.tsx

+ + + + + + + +
+
+
import * as React from "react";
+import {
+    Able, MoveableInterface, GroupableProps, MoveableDefaultProps,
+    IndividualGroupableProps, MoveableManagerInterface, MoveableRefTargetsResultType,
+    MoveableTargetGroupsType, BeforeRenderableProps, RenderableProps, MoveableManagerState,
+} from "./types";
+import MoveableManager from "./MoveableManager";
+import MoveableGroup from "./MoveableGroup";
+import { ref, withMethods, prefixCSS } from "framework-utils";
+import { find, getKeys, IObject, isArray, isString } from "@daybrush/utils";
+import { MOVEABLE_METHODS, PREFIX, MOVEABLE_CSS } from "./consts";
+import Default from "./ables/Default";
+import Groupable from "./ables/Groupable";
+import DragArea from "./ables/DragArea";
+import { styled } from "react-css-styled";
+import { getRefTargets } from "./utils";
+import IndividualGroupable from "./ables/IndividualGroupable";
+import MoveableIndividualGroup from "./MoveableIndividualGroup";
+import ChildrenDiffer from "@egjs/children-differ";
+
+function getElementTargets(
+    refTargets: MoveableRefTargetsResultType,
+    selectorMap: IObject<Array<HTMLElement | SVGElement>>,
+): Array<SVGElement | HTMLElement> {
+    const elementTargets: Array<SVGElement | HTMLElement> = [];
+
+    refTargets.forEach(target => {
+        if (!target) {
+            return;
+        }
+        if (isString(target)) {
+            if (selectorMap[target]) {
+                elementTargets.push(...selectorMap[target]);
+            }
+            return;
+        }
+        if (isArray(target)) {
+            elementTargets.push(...getElementTargets(target, selectorMap));
+        } else {
+            elementTargets.push(target);
+        }
+    });
+
+    return elementTargets;
+}
+
+function getTargetGroups(
+    refTargets: MoveableRefTargetsResultType,
+    selectorMap: IObject<Array<HTMLElement | SVGElement>>,
+) {
+    const targetGroups: MoveableTargetGroupsType = [];
+
+    refTargets.forEach(target => {
+        if (!target) {
+            return;
+        }
+        if (isString(target)) {
+            if (selectorMap[target]) {
+                targetGroups.push(...selectorMap[target]);
+            }
+            return;
+        }
+        if (isArray(target)) {
+            targetGroups.push(getTargetGroups(target, selectorMap));
+        } else {
+            targetGroups.push(target);
+        }
+    });
+
+    return targetGroups;
+}
+
+function compareRefTargets(
+    prevRefTargets: MoveableRefTargetsResultType,
+    nextRefTargets: MoveableRefTargetsResultType,
+): boolean {
+    return (prevRefTargets.length !== nextRefTargets.length) || prevRefTargets.some((target, i) => {
+        const nextTarget = nextRefTargets[i];
+
+        if (!target && !nextTarget) {
+            return false;
+        } else if (target != nextTarget) {
+            if (isArray(target) && isArray(nextTarget)) {
+                return compareRefTargets(target, nextTarget);
+            }
+            return true;
+        }
+        return false;
+    });
+}
+
+type DefaultAbles = GroupableProps & IndividualGroupableProps & BeforeRenderableProps & RenderableProps;
+
+export class InitialMoveable<T = {}>
+    extends React.PureComponent<MoveableDefaultProps & DefaultAbles & T> {
+    public static defaultAbles: readonly Able<any>[] = [];
+    public static customStyledMap: Record<string, any> = {};
+    public static defaultStyled: any = null;
+    public static makeStyled() {
+        const cssMap: IObject<boolean> = {};
+
+        const ables = this.getTotalAbles();
+        ables.forEach(({ css }: Able) => {
+            if (!css) {
+                return;
+            }
+            css.forEach(text => {
+                cssMap[text] = true;
+            });
+        });
+        const style = getKeys(cssMap).join("\n");
+
+        this.defaultStyled = styled("div", prefixCSS(PREFIX, MOVEABLE_CSS + style));
+    }
+    public static getTotalAbles(): Able[] {
+        return [Default, Groupable, IndividualGroupable, DragArea, ...this.defaultAbles];
+    }
+    @withMethods(MOVEABLE_METHODS)
+    public moveable!: MoveableManager | MoveableGroup | MoveableIndividualGroup;
+    public refTargets: MoveableRefTargetsResultType = [];
+    public selectorMap: IObject<Array<HTMLElement | SVGElement>> = {};
+    private _differ: ChildrenDiffer<HTMLElement | SVGElement> = new ChildrenDiffer();
+    private _elementTargets: Array<HTMLElement | SVGElement> = [];
+    private _tmpRefTargets: MoveableRefTargetsResultType = [];
+    private _tmpSelectorMap: IObject<Array<HTMLElement | SVGElement>> = {};
+    private _onChangeTargets: (() => void) | null = null;
+    public render() {
+        const moveableContructor = (this.constructor as typeof InitialMoveable);
+
+        if (!moveableContructor.defaultStyled) {
+            moveableContructor.makeStyled();
+        }
+        const {
+            ables: userAbles,
+            props: userProps,
+            ...props
+        } = this.props;
+        const [
+            refTargets,
+            nextSelectorMap,
+        ] = this._updateRefs(true);
+        const elementTargets = getElementTargets(refTargets, nextSelectorMap);
+
+        let isGroup = elementTargets.length > 1;
+        const totalAbles = moveableContructor.getTotalAbles();
+        const ables = [
+            ...totalAbles,
+            ...(userAbles as any || []),
+        ];
+        const nextProps = {
+            ...props,
+            ...(userProps || {}),
+            ables,
+            cssStyled: moveableContructor.defaultStyled,
+            customStyledMap: moveableContructor.customStyledMap,
+        };
+
+        this._elementTargets = elementTargets;
+
+        let firstRenderState: MoveableManagerState | null = null;
+        const prevMoveable = this.moveable;
+
+
+        const persistData = props.persistData;
+
+        if (persistData?.children) {
+            isGroup = true;
+        }
+        // Even one child is treated as a group if individualGroupable is enabled. #867
+        if (props.individualGroupable) {
+            return <MoveableIndividualGroup key="individual-group" ref={ref(this, "moveable")}
+                {...nextProps}
+                target={null}
+                targets={elementTargets}
+            />;
+        }
+        if (isGroup) {
+            const targetGroups = getTargetGroups(refTargets, nextSelectorMap);
+
+            // manager
+            if (prevMoveable && !prevMoveable.props.groupable && !(prevMoveable.props as any).individualGroupable) {
+                const target = prevMoveable.props.target!;
+
+                if (target && elementTargets.indexOf(target) > -1) {
+                    firstRenderState = { ...prevMoveable.state };
+                }
+            }
+
+            return <MoveableGroup key="group" ref={ref(this, "moveable")}
+                {...nextProps}
+                {...props.groupableProps ?? {}}
+                target={null}
+                targets={elementTargets}
+                targetGroups={targetGroups}
+                firstRenderState={firstRenderState}
+            />;
+        } else {
+            const target = elementTargets[0];
+            // manager
+            if (prevMoveable && (prevMoveable.props.groupable || (prevMoveable.props as any).individualGroupable)) {
+                const moveables = (prevMoveable as MoveableGroup | MoveableIndividualGroup).moveables || [];
+                const prevTargetMoveable = find(moveables, mv => mv.props.target === target);
+
+                if (prevTargetMoveable) {
+                    firstRenderState = { ...prevTargetMoveable.state };
+                }
+            }
+
+            return <MoveableManager<any> key="single" ref={ref(this, "moveable")}
+                {...nextProps}
+                target={target}
+                firstRenderState={firstRenderState} />;
+        }
+    }
+    public componentDidMount() {
+        this._checkChangeTargets();
+    }
+    public componentDidUpdate() {
+        this._checkChangeTargets();
+    }
+    public componentWillUnmount() {
+        this.selectorMap = {};
+        this.refTargets = [];
+    }
+    /**
+     * Get targets set in moveable through target or targets of props.
+     * @method Moveable#getTargets
+     * @example
+     * import Moveable from "moveable";
+     *
+     * const moveable = new Moveable(document.body, {
+     *    target: [targetRef, ".target", document.querySelectorAll(".target")],
+     * });
+     *
+     * console.log(moveable.getTargets());
+     */
+    public getTargets() {
+        return this.moveable?.getTargets() ?? [];
+    }
+    /**
+     * If the element list corresponding to the selector among the targets is changed, it is updated.
+     * @method Moveable#updateSelectors
+     * @example
+     * import Moveable from "moveable";
+     *
+     * const moveable = new Moveable(document.body, {
+     *    target: ".target",
+     * });
+     *
+     * moveable.updateSelectors();
+     */
+    public updateSelectors() {
+        this.selectorMap = {};
+        this._updateRefs();
+    }
+    /**
+     * User changes target and waits for target to change.
+     * @method Moveable#waitToChangeTarget
+     * @story combination-with-other-components--components-selecto
+     * @example
+     * document.querySelector(".target").addEventListener("mousedown", e => {
+     *   moveable.waitToChangeTarget().then(() => {
+     *      moveable.dragStart(e.currentTarget);
+     *   });
+     *   moveable.target = e.currentTarget;
+     * });
+     */
+    public waitToChangeTarget(): Promise<void> {
+        // let resolvePromise: (e: OnChangeTarget) => void;
+
+        // this._onChangeTargets = () => {
+        //     this._onChangeTargets = null;
+        //     resolvePromise({
+        //         moveable: this.getManager(),
+        //         targets: this._elementTargets,
+        //     });
+        // };
+
+        // return new Promise<OnChangeTarget>(resolve => {
+        //     resolvePromise = resolve;
+        // });
+        let resolvePromise: () => void;
+
+        this._onChangeTargets = () => {
+            this._onChangeTargets = null;
+            resolvePromise();
+        };
+
+        return new Promise(resolve => {
+            resolvePromise = resolve;
+        });
+    }
+    public waitToChangeTargets(): Promise<void> {
+        return this.waitToChangeTarget();
+    }
+    public getManager(): MoveableManagerInterface<any, any> {
+        return this.moveable;
+    }
+    public getMoveables(): MoveableManagerInterface[] {
+        return this.moveable.getMoveables();
+    }
+    public getDragElement(): HTMLElement | SVGElement | null | undefined {
+        return this.moveable.getDragElement();
+    }
+    private _updateRefs(isRender?: boolean) {
+        const prevRefTargets = this.refTargets;
+        const nextRefTargets = getRefTargets((this.props.target || this.props.targets) as any);
+        const isBrowser = typeof document !== "undefined";
+
+        let isUpdate = compareRefTargets(prevRefTargets, nextRefTargets);
+        const selectorMap = this.selectorMap;
+        const nextSelectorMap: IObject<Array<HTMLElement | SVGElement>> = {};
+
+        this.refTargets.forEach(function updateSelectorMap(target) {
+            if (isString(target)) {
+                const selectorTarget = selectorMap[target];
+
+                if (selectorTarget) {
+                    nextSelectorMap[target] = selectorMap[target];
+                } else if (isBrowser) {
+                    isUpdate = true;
+                    nextSelectorMap[target] = [].slice.call(document.querySelectorAll(target));
+                }
+            } else if (isArray(target)) {
+                target.forEach(updateSelectorMap);
+            }
+        });
+
+        this._tmpRefTargets = nextRefTargets;
+        this._tmpSelectorMap = nextSelectorMap;
+
+        return [
+            nextRefTargets,
+            nextSelectorMap,
+            !isRender && isUpdate,
+        ] as const;
+    }
+    private _checkChangeTargets() {
+        this.refTargets = this._tmpRefTargets;
+        this.selectorMap = this._tmpSelectorMap;
+
+        const { added, removed } = this._differ.update(this._elementTargets);
+        const isTargetChanged = added.length || removed.length;
+
+        if (isTargetChanged) {
+            this.props.onChangeTargets?.({
+                moveable: this.moveable,
+                targets: this._elementTargets,
+            });
+            this._onChangeTargets?.();
+        }
+        const [
+            refTargets,
+            selectorMap,
+            isUpdate,
+        ] = this._updateRefs();
+
+        this.refTargets = refTargets;
+        this.selectorMap = selectorMap;
+
+        if (isUpdate) {
+            this.forceUpdate();
+        }
+    }
+}
+export interface InitialMoveable<T = {}>
+    extends React.PureComponent<MoveableDefaultProps & DefaultAbles & T>,
+    MoveableInterface {
+    setState(state: any, callback?: () => any): any;
+    forceUpdate(callback?: () => any): any;
+}
+
+
+
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + diff --git a/release/0.52.0/doc/packages_react-moveable_src_MoveableGroup.tsx.html b/release/0.52.0/doc/packages_react-moveable_src_MoveableGroup.tsx.html new file mode 100644 index 000000000..4dfaab677 --- /dev/null +++ b/release/0.52.0/doc/packages_react-moveable_src_MoveableGroup.tsx.html @@ -0,0 +1,613 @@ + + + + + packages/react-moveable/src/MoveableGroup.tsx - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

packages/react-moveable/src/MoveableGroup.tsx

+ + + + + + + +
+
+
import MoveableManager from "./MoveableManager";
+import { GroupableProps, GroupRect, MoveableManagerInterface, MoveableTargetGroupsType, RectInfo } from "./types";
+import ChildrenDiffer from "@egjs/children-differ";
+import { getAbleGesto, getTargetAbleGesto } from "./gesto/getAbleGesto";
+import Groupable from "./ables/Groupable";
+import { MIN_NUM, MAX_NUM, TINY_NUM } from "./consts";
+import {
+    getAbsolutePosesByState, equals, unsetGesto, rotatePosesInfo,
+    convertTransformOriginArray,
+    isDeepArrayEquals,
+    sign,
+    getRefTarget,
+} from "./utils";
+import { minus, plus } from "@scena/matrix";
+import { getIntersectionPointsByConstants, getMinMaxs } from "overlap-area";
+import { find, isArray, throttle } from "@daybrush/utils";
+import { getMoveableTargetInfo } from "./utils/getMoveableTargetInfo";
+import { solveC, solveConstantsDistance } from "./Snappable/utils";
+import { setStoreCache } from "./store/Store";
+
+function getMaxPos(poses: number[][][], index: number) {
+    return Math.max(...poses.map(([pos1, pos2, pos3, pos4]) => {
+        return Math.max(pos1[index], pos2[index], pos3[index], pos4[index]);
+    }));
+}
+function getMinPos(poses: number[][][], index: number) {
+    return Math.min(...poses.map(([pos1, pos2, pos3, pos4]) => {
+        return Math.min(pos1[index], pos2[index], pos3[index], pos4[index]);
+    }));
+}
+
+
+function getGroupRect(parentPoses: number[][][], rotation: number): GroupRect {
+    let pos1 = [0, 0];
+    let pos2 = [0, 0];
+    let pos3 = [0, 0];
+    let pos4 = [0, 0];
+    let width = 0;
+    let height = 0;
+
+    if (!parentPoses.length) {
+        return {
+            pos1,
+            pos2,
+            pos3,
+            pos4,
+            minX: 0,
+            minY: 0,
+            maxX: 0,
+            maxY: 0,
+            width,
+            height,
+            rotation,
+        };
+    }
+    const fixedRotation = throttle(rotation, TINY_NUM);
+
+    if (fixedRotation % 90) {
+        const rad = fixedRotation / 180 * Math.PI;
+        const a1 = Math.tan(rad);
+        const a2 = -1 / a1;
+        // ax = y  // -ax + y = 0 // 0 => 1
+        // -ax = y // ax + y = 0  // 0 => 3
+        const a1MinMax = [MAX_NUM, MIN_NUM];
+        const a1MinMaxPos = [[0, 0], [0, 0]];
+        const a2MinMax = [MAX_NUM, MIN_NUM];
+        const a2MinMaxPos = [[0, 0], [0, 0]];
+
+        parentPoses.forEach(poses => {
+            poses.forEach(pos => {
+
+                // const b1 = pos[1] - a1 * pos[0];
+                // const b2 = pos[1] - a2 * pos[0];
+
+                const a1Dist = solveConstantsDistance([-a1, 1, 0], pos);
+                const a2Dist = solveConstantsDistance([-a2, 1, 0], pos);
+
+                if (a1MinMax[0] > a1Dist) {
+                    a1MinMaxPos[0] = pos;
+                    a1MinMax[0] = a1Dist;
+                }
+                if (a1MinMax[1] < a1Dist) {
+                    a1MinMaxPos[1] = pos;
+                    a1MinMax[1] = a1Dist;
+                }
+                if (a2MinMax[0] > a2Dist) {
+                    a2MinMaxPos[0] = pos;
+                    a2MinMax[0] = a2Dist;
+                }
+                if (a2MinMax[1] < a2Dist) {
+                    a2MinMaxPos[1] = pos;
+                    a2MinMax[1] = a2Dist;
+                }
+            });
+        });
+
+        const [a1MinPos, a1MaxPos] = a1MinMaxPos;
+        const [a2MinPos, a2MaxPos] = a2MinMaxPos;
+
+        const minHorizontalLine = [-a1, 1, solveC([-a1, 1], a1MinPos)];
+        const maxHorizontalLine = [-a1, 1, solveC([-a1, 1], a1MaxPos)];
+
+        const minVerticalLine = [-a2, 1, solveC([-a2, 1], a2MinPos)];
+        const maxVerticalLine = [-a2, 1, solveC([-a2, 1], a2MaxPos)];
+
+        [pos1, pos2, pos3, pos4] = [
+            [minHorizontalLine, minVerticalLine],
+            [minHorizontalLine, maxVerticalLine],
+            [maxHorizontalLine, minVerticalLine],
+            [maxHorizontalLine, maxVerticalLine],
+        ].map(([line1, line2]) => getIntersectionPointsByConstants(line1, line2)[0]);
+
+        width = a2MinMax[1] - a2MinMax[0];
+        height = a1MinMax[1] - a1MinMax[0];
+    } else {
+        const minX = getMinPos(parentPoses, 0);
+        const minY = getMinPos(parentPoses, 1);
+        const maxX = getMaxPos(parentPoses, 0);
+        const maxY = getMaxPos(parentPoses, 1);
+
+        pos1 = [minX, minY];
+        pos2 = [maxX, minY];
+        pos3 = [minX, maxY];
+        pos4 = [maxX, maxY];
+        width = maxX - minX;
+        height = maxY - minY;
+        if (fixedRotation % 180) {
+            // 0
+            // 1 2
+            // 3 4
+            // 90
+            // 3 1
+            // 4 2
+            // 180
+            // 4 3
+            // 2 1
+            // 270
+            // 2 4
+            // 1 3
+            // 1, 2, 3,4 = 3 1 4 2
+            const changedX = [pos3, pos1, pos4, pos2];
+
+            [pos1, pos2, pos3, pos4] = changedX;
+            width = maxY - minY;
+            height = maxX - minX;
+        }
+
+    }
+    if (fixedRotation % 360 > 180) {
+        // 1 2   4 3
+        // 3 4   2 1
+        const changedX = [pos4, pos3, pos2, pos1];
+
+        [pos1, pos2, pos3, pos4] = changedX;
+    }
+    const { minX, minY, maxX, maxY } = getMinMaxs([pos1, pos2, pos3, pos4]);
+
+    return {
+        pos1,
+        pos2,
+        pos3,
+        pos4,
+        width,
+        height,
+        minX,
+        minY,
+        maxX,
+        maxY,
+        rotation,
+    };
+}
+type SelfGroup = Array<MoveableManager | null | SelfGroup>;
+type CheckedMoveableManager = { finded: boolean; manager: MoveableManager };
+
+function findMoveableGroups(
+    moveables: CheckedMoveableManager[],
+    childTargetGroups: MoveableTargetGroupsType,
+): SelfGroup {
+    const groups = childTargetGroups.map(targetGroup => {
+        if (isArray(targetGroup)) {
+            const childMoveableGroups = findMoveableGroups(moveables, targetGroup);
+            const length = childMoveableGroups.length;
+
+            if (length > 1) {
+                return childMoveableGroups;
+            } else if (length === 1) {
+                return childMoveableGroups[0];
+            } else {
+                return null;
+            }
+        } else {
+            const checked = find(moveables, ({ manager }) => manager.props.target === targetGroup)!;
+
+            if (checked) {
+                checked.finded = true;
+                return checked.manager;
+            }
+            return null;
+        }
+    }).filter(Boolean);
+
+    if (groups.length === 1 && isArray(groups[0])) {
+        return groups[0];
+    }
+    return groups;
+}
+
+/**
+ * @namespace Moveable.Group
+ * @description You can make targets moveable.
+ */
+class MoveableGroup extends MoveableManager<GroupableProps> {
+    public static defaultProps = {
+        ...MoveableManager.defaultProps,
+        transformOrigin: ["50%", "50%"],
+        groupable: true,
+        dragArea: true,
+        keepRatio: true,
+        targets: [],
+        defaultGroupRotate: 0,
+        defaultGroupOrigin: "50% 50%",
+    };
+    public differ: ChildrenDiffer<HTMLElement | SVGElement> = new ChildrenDiffer();
+    public moveables: MoveableManager[] = [];
+    public transformOrigin = "50% 50%";
+    public renderGroupRects: GroupRect[] = [];
+    private _targetGroups: MoveableTargetGroupsType = [];
+    private _hasFirstTargets = false;
+
+    public componentDidMount() {
+        super.componentDidMount();
+    }
+    public checkUpdate() {
+        this._isPropTargetChanged = false;
+        this.updateAbles();
+    }
+    public getTargets() {
+        return this.props.targets!;
+    }
+    public updateRect(type?: "Start" | "" | "End", isTarget?: boolean, isSetState = true) {
+        const state = this.state;
+
+        if (!this.controlBox || state.isPersisted) {
+            return;
+        }
+        setStoreCache(true);
+        this.moveables.forEach(moveable => {
+            moveable.updateRect(type, false, false);
+        });
+
+        const props = this.props;
+        const moveables = this.moveables;
+        const target = state.target! || props.target!;
+        const checkeds = moveables.map(moveable => ({ finded: false, manager: moveable }));
+        const targetGroups = this.props.targetGroups || [];
+        const moveableGroups = findMoveableGroups(
+            checkeds,
+            targetGroups,
+        );
+        const useDefaultGroupRotate = props.useDefaultGroupRotate;
+
+        moveableGroups.push(...checkeds.filter(({ finded }) => !finded).map(({ manager }) => manager));
+
+        const renderGroupRects: GroupRect[] = [];
+        const isReset = !isTarget || (type !== "" && props.updateGroup);
+        let defaultGroupRotate = props.defaultGroupRotate || 0;
+
+        if (!this._hasFirstTargets) {
+            const persistedRoatation = props.persistData?.rotation;
+
+            if (persistedRoatation != null) {
+                defaultGroupRotate = persistedRoatation;
+            }
+        }
+
+        function getMoveableGroupRect(group: SelfGroup, parentRotation: number, isRoot?: boolean): GroupRect {
+            const posesRotations = group.map(moveable => {
+                if (isArray(moveable)) {
+                    const rect = getMoveableGroupRect(moveable, parentRotation);
+                    const poses = [rect.pos1, rect.pos2, rect.pos3, rect.pos4];
+
+                    renderGroupRects.push(rect);
+                    return { poses, rotation: rect.rotation };
+                } else {
+                    return {
+                        poses: getAbsolutePosesByState(moveable!.state),
+                        rotation: moveable!.getRotation(),
+                    };
+                }
+            });
+            const rotations = posesRotations.map(({ rotation }) => rotation);
+
+            let groupRotation = 0;
+            const firstRotation = rotations[0];
+            const isSameRotation = rotations.every(nextRotation => {
+                return Math.abs(firstRotation - nextRotation) < 0.1;
+            });
+
+            if (isReset) {
+                groupRotation = !useDefaultGroupRotate && isSameRotation ? firstRotation : defaultGroupRotate;
+            } else {
+                groupRotation = !useDefaultGroupRotate && !isRoot && isSameRotation ? firstRotation : parentRotation;
+            }
+            const groupPoses = posesRotations.map(({ poses }) => poses);
+            const groupRect = getGroupRect(
+                groupPoses,
+                groupRotation,
+            );
+
+            return groupRect;
+        }
+        const rootGroupRect = getMoveableGroupRect(moveableGroups, this.rotation, true);
+
+        if (isReset) {
+            // reset rotataion
+            this.rotation = rootGroupRect.rotation;
+            this.transformOrigin = props.defaultGroupOrigin || "50% 50%";
+            this.scale = [1, 1];
+        }
+
+
+        this._targetGroups = targetGroups;
+        this.renderGroupRects = renderGroupRects;
+        const transformOrigin = this.transformOrigin;
+        const rotation = this.rotation;
+        const scale = this.scale;
+        const { width, height, minX, minY } = rootGroupRect;
+        const posesInfo = rotatePosesInfo(
+            [
+                [0, 0],
+                [width, 0],
+                [0, height],
+                [width, height],
+            ],
+            convertTransformOriginArray(transformOrigin, width, height),
+            this.rotation / 180 * Math.PI,
+        );
+
+        const { minX: deltaX, minY: deltaY } = getMinMaxs(posesInfo.result);
+        const rotateScale = ` rotate(${rotation}deg)`
+            + ` scale(${sign(scale[0])}, ${sign(scale[1])})`;
+        const transform = `translate(${-deltaX}px, ${-deltaY}px)${rotateScale}`;
+
+        this.controlBox.style.transform
+            = `translate3d(${minX}px, ${minY}px, ${this.props.translateZ || 0})`;
+
+        target.style.cssText += `left:0px;top:0px;`
+            + `transform-origin:${transformOrigin};`
+            + `width:${width}px;height:${height}px;`
+            + `transform: ${transform}`;
+        state.width = width;
+        state.height = height;
+
+        const container = this.getContainer();
+        const info = getMoveableTargetInfo(
+            this.controlBox,
+            target,
+            this.controlBox,
+            this.getContainer(),
+            this._rootContainer || container,
+            [],
+        );
+        const pos = [info.left!, info.top!];
+        const [
+            pos1,
+            pos2,
+            pos3,
+            pos4,
+        ] = getAbsolutePosesByState(info); // info.left + info.pos(1 ~ 4)
+
+        const minPos = getMinMaxs([pos1, pos2, pos3, pos4]);
+        const delta = [minPos.minX, minPos.minY];
+        const direction = sign(scale[0] * scale[1]);
+
+        info.pos1 = minus(pos1, delta);
+        info.pos2 = minus(pos2, delta);
+        info.pos3 = minus(pos3, delta);
+        info.pos4 = minus(pos4, delta);
+        // info.left = info.left + delta[0];
+        // info.top = info.top + delta[1];
+        info.left = minX - info.left! + delta[0];
+        info.top = minY - info.top! + delta[1];
+        info.origin = minus(plus(pos, info.origin!), delta);
+        info.beforeOrigin = minus(plus(pos, info.beforeOrigin!), delta);
+        info.originalBeforeOrigin = plus(pos, info.originalBeforeOrigin!);
+        info.transformOrigin = minus(plus(pos, info.transformOrigin!), delta);
+        target.style.transform
+            = `translate(${-deltaX - delta[0]}px, ${-deltaY - delta[1]}px)`
+            + rotateScale;
+
+        setStoreCache();
+        this.updateState(
+            {
+                ...info,
+                posDelta: delta,
+                direction,
+                beforeDirection: direction,
+            },
+            isSetState,
+        );
+    }
+    public getRect(): RectInfo {
+        return {
+            ...super.getRect(),
+            children: this.moveables.map(child => child.getRect()),
+        };
+    }
+    public triggerEvent(name: string, e: any, isManager?: boolean): any {
+        if (isManager || name.indexOf("Group") > -1) {
+            return super.triggerEvent(name as any, e);
+        } else {
+            this._emitter.trigger(name, e);
+        }
+    }
+    public getRequestChildStyles() {
+        const styleNames = this.getEnabledAbles().reduce((names, able) => {
+            const ableStyleNames = (able.requestChildStyle?.() ?? []) as Array<keyof CSSStyleDeclaration>;
+
+            return [...names, ...ableStyleNames];
+        }, [] as Array<keyof CSSStyleDeclaration>);
+
+
+        return styleNames;
+    }
+
+    public getMoveables(): MoveableManagerInterface[] {
+        return [...this.moveables];
+    }
+    protected updateAbles() {
+        super.updateAbles([...this.props.ables!, Groupable], "Group");
+    }
+    protected _updateTargets() {
+        super._updateTargets();
+        this._originalDragTarget = this.props.dragTarget || this.areaElement;
+        this._dragTarget = getRefTarget(this._originalDragTarget, true);
+    }
+    protected _updateEvents() {
+        const state = this.state;
+        const props = this.props;
+
+
+        const prevTarget = this._prevDragTarget;
+        const nextTarget = props.dragTarget || this.areaElement;
+        const targets = props.targets!;
+        const { added, changed, removed } = this.differ.update(targets);
+        const isTargetChanged = added.length || removed.length;
+
+        if (isTargetChanged || this._prevOriginalDragTarget !== this._originalDragTarget) {
+            unsetGesto(this, false);
+            unsetGesto(this, true);
+            this.updateState({ gestos: {} });
+        }
+        if (prevTarget !== nextTarget) {
+            state.target = null;
+        }
+        if (!state.target) {
+            state.target = this.areaElement;
+            this.controlBox.style.display = "block";
+        }
+        if (state.target) {
+            if (!this.targetGesto) {
+                this.targetGesto = getTargetAbleGesto(this, this._dragTarget!, "Group");
+            }
+            if (!this.controlGesto) {
+                this.controlGesto = getAbleGesto(this, this.controlBox, "controlAbles", "GroupControl");
+            }
+        }
+        const isContainerChanged = !equals(state.container, props.container);
+
+        if (isContainerChanged) {
+            state.container = props.container;
+        }
+
+
+        if (
+            isContainerChanged
+            || isTargetChanged
+            || this.transformOrigin !== (props.defaultGroupOrigin || "50% 50%")
+            || changed.length
+            || targets.length && !isDeepArrayEquals(this._targetGroups, props.targetGroups || [])
+        ) {
+            this.updateRect();
+            this._hasFirstTargets = true;
+        }
+        this._isPropTargetChanged = !!isTargetChanged;
+    }
+    protected _updateObserver() { }
+}
+
+/**
+ * Sets the initial rotation of the group.
+ * @name Moveable.Group#defaultGroupRotate
+ * @default 0
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *   target: [].slice.call(document.querySelectorAll(".target")),
+ *   defaultGroupRotate: 0,
+ * });
+ *
+ * moveable.defaultGroupRotate = 40;
+ */
+
+/**
+ * Sets the initial origin of the group.
+ * @name Moveable.Group#defaultGroupOrigin
+ * @default 0
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *   target: [].slice.call(document.querySelectorAll(".target")),
+ *   defaultGroupOrigin: "50% 50%",
+ * });
+ *
+ * moveable.defaultGroupOrigin = "20% 40%";
+ */
+
+
+/**
+ * Whether to hide the line in child moveable for group corresponding to the rect of the target.
+ * @name Moveable.Group#hideChildMoveableDefaultLines
+ * @default false
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *   target: [].slice.call(document.querySelectorAll(".target")),
+ *   hideChildMoveableDefaultLines: false,
+ * });
+ *
+ * moveable.hideChildMoveableDefaultLines = true;
+ */
+export default MoveableGroup;
+
+
+
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + diff --git a/release/0.52.0/doc/packages_react-moveable_src_MoveableManager.tsx.html b/release/0.52.0/doc/packages_react-moveable_src_MoveableManager.tsx.html new file mode 100644 index 000000000..2246a757c --- /dev/null +++ b/release/0.52.0/doc/packages_react-moveable_src_MoveableManager.tsx.html @@ -0,0 +1,1518 @@ + + + + + packages/react-moveable/src/MoveableManager.tsx - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

packages/react-moveable/src/MoveableManager.tsx

+ + + + + + + +
+
+
import * as React from "react";
+import { createElement } from "react";
+import { PREFIX } from "./consts";
+import {
+    prefix,
+    unsetGesto,
+    getAbsolutePosesByState,
+    getRect,
+    filterAbles,
+    equals,
+    flat,
+    groupByMap,
+    calculatePadding,
+    getAbsoluteRotation,
+    defaultSync,
+    getRefTarget,
+    groupBy,
+    unsetAbles,
+    getPaddingBox,
+} from "./utils";
+import Gesto from "gesto";
+import { ref } from "framework-utils";
+import {
+    MoveableManagerProps, MoveableManagerState, Able,
+    RectInfo, Requester, HitRect, MoveableManagerInterface,
+    MoveableDefaultOptions,
+    GroupableProps,
+    MoveableRefType,
+} from "./types";
+import { triggerAble, getTargetAbleGesto, getAbleGesto, checkMoveableTarget } from "./gesto/getAbleGesto";
+import { createOriginMatrix, multiplies, plus } from "@scena/matrix";
+import {
+    addClass, cancelAnimationFrame, find,
+    getKeys, getWindow, IObject, isNode, removeClass, requestAnimationFrame,
+} from "@daybrush/utils";
+import { renderLine } from "./renderDirections";
+import { fitPoints, getAreaSize, getOverlapSize, isInside } from "overlap-area";
+import EventManager from "./EventManager";
+import { styled } from "react-css-styled";
+import EventEmitter from "@scena/event-emitter";
+import { getMoveableTargetInfo } from "./utils/getMoveableTargetInfo";
+import { VIEW_DRAGGING } from "./classNames";
+import { diff } from "@egjs/list-differ";
+import { getPersistState } from "./utils/persist";
+import { setStoreCache } from "./store/Store";
+
+export default class MoveableManager<T = {}>
+    extends React.PureComponent<MoveableManagerProps<T>, MoveableManagerState> {
+    public static defaultProps: Required<MoveableManagerProps> = {
+        dragTargetSelf: false,
+        target: null,
+        dragTarget: null,
+        container: null,
+        rootContainer: null,
+        origin: true,
+        parentMoveable: null,
+        wrapperMoveable: null,
+        isWrapperMounted: false,
+        parentPosition: null,
+        warpSelf: false,
+        svgOrigin: "",
+        dragContainer: null,
+        useResizeObserver: false,
+        useMutationObserver: false,
+        preventDefault: true,
+        linePadding: 0,
+        controlPadding: 0,
+        ables: [],
+        pinchThreshold: 20,
+        dragArea: false,
+        passDragArea: false,
+        transformOrigin: "",
+        className: "",
+        zoom: 1,
+        triggerAblesSimultaneously: false,
+        padding: {},
+        pinchOutside: true,
+        checkInput: false,
+        dragFocusedInput: false,
+        groupable: false,
+        hideDefaultLines: false,
+        cspNonce: "",
+        translateZ: 0,
+        cssStyled: null,
+        customStyledMap: {},
+        props: {},
+        stopPropagation: false,
+        preventClickDefault: false,
+        preventClickEventOnDrag: true,
+        flushSync: defaultSync,
+        firstRenderState: null,
+        persistData: null,
+        viewContainer: null,
+        requestStyles: [],
+        useAccuratePosition: false,
+    };
+    public state: MoveableManagerState = {
+        container: null,
+        gestos: {},
+        renderLines: [
+            [[0, 0], [0, 0]],
+            [[0, 0], [0, 0]],
+            [[0, 0], [0, 0]],
+            [[0, 0], [0, 0]],
+        ],
+        renderPoses: [[0, 0], [0, 0], [0, 0], [0, 0]],
+        disableNativeEvent: false,
+        posDelta: [0, 0],
+        ...getMoveableTargetInfo(null),
+    };
+    public renderState: Record<string, any> = {};
+    public enabledAbles: Able[] = [];
+    public targetAbles: Able[] = [];
+    public controlAbles: Able[] = [];
+    public controlBox!: HTMLElement;
+    public areaElement!: HTMLElement;
+    public targetGesto!: Gesto;
+    public controlGesto!: Gesto;
+    public rotation = 0;
+    public scale: number[] = [1, 1];
+    public isMoveableMounted = false;
+    public isUnmounted = false;
+
+    public events: Record<string, EventManager | null> = {
+        "mouseEnter": null,
+        "mouseLeave": null,
+    };
+
+    protected _emitter: EventEmitter = new EventEmitter();
+
+    protected _prevOriginalDragTarget: MoveableRefType | null = null;
+    protected _originalDragTarget: MoveableRefType | null = null;
+
+    protected _prevDragTarget: HTMLElement | SVGElement | null | undefined = null;
+    protected _dragTarget: HTMLElement | SVGElement | null | undefined = null;
+
+    protected _prevPropTarget: HTMLElement | SVGElement | null | undefined = null;
+    protected _propTarget: HTMLElement | SVGElement | null | undefined = null;
+
+    protected _prevDragArea = false;
+    protected _isPropTargetChanged = false;
+    protected _hasFirstTarget = false;
+
+    private _reiszeObserver: ResizeObserver | null = null;
+    private _observerId = 0;
+    private _mutationObserver: MutationObserver | null = null;
+    public _rootContainer: HTMLElement | null | undefined = null;
+    private _viewContainer: HTMLElement | null | undefined = null;
+    private _viewClassNames: string[] = [];
+    private _store: Record<string, any> = {};
+
+    public render() {
+        const props = this.props;
+        const state = this.getState();
+        const {
+            parentPosition,
+            className,
+            target: propsTarget,
+            zoom, cspNonce,
+            translateZ,
+            cssStyled: ControlBoxElement,
+            groupable,
+            linePadding,
+            controlPadding,
+        } = props;
+
+        this._checkUpdateRootContainer();
+        this.checkUpdate();
+        this.updateRenderPoses();
+
+        const [parentLeft, parentTop] = parentPosition as number[] || [0, 0];
+        const {
+            left,
+            top,
+            target: stateTarget,
+            direction,
+            hasFixed,
+            offsetDelta,
+        } = state;
+        const groupTargets = (props as any).targets;
+        const isDragging = this.isDragging();
+        const ableAttributes: IObject<boolean> = {};
+        this.getEnabledAbles().forEach(able => {
+            ableAttributes[`data-able-${able.name.toLowerCase()}`] = true;
+        });
+        const ableClassName = this._getAbleClassName();
+        const isDisplay
+            = (groupTargets && groupTargets.length && (stateTarget || groupable))
+            || propsTarget
+            || (!this._hasFirstTarget && this.state.isPersisted);
+        const isVisible = this.controlBox || this.props.firstRenderState || this.props.persistData;
+        const translate = [left - parentLeft, top - parentTop];
+
+        if (!groupable && props.useAccuratePosition) {
+            translate[0] += offsetDelta[0];
+            translate[1] += offsetDelta[1];
+        }
+        const style: Record<string, any> = {
+            "position": hasFixed ? "fixed" : "absolute",
+            "display": isDisplay ? "block" : "none",
+            "visibility": isVisible ? "visible" : "hidden",
+            "transform": `translate3d(${translate[0]}px, ${translate[1]}px, ${translateZ})`,
+            "--zoom": zoom,
+            "--zoompx": `${zoom}px`,
+        };
+        if (linePadding) {
+            style["--moveable-line-padding"] = linePadding;
+        }
+        if (controlPadding) {
+            style["--moveable-control-padding"] = controlPadding;
+        }
+        return (
+            <ControlBoxElement
+                cspNonce={cspNonce}
+                ref={ref(this, "controlBox")}
+                className={`${prefix("control-box", direction === -1 ? "reverse" : "", isDragging ? "dragging" : "")} ${ableClassName} ${className}`}
+                {...ableAttributes}
+                onClick={this._onPreventClick}
+                style={style}>
+                {this.renderAbles()}
+                {this._renderLines()}
+            </ControlBoxElement>
+        );
+    }
+    public componentDidMount() {
+        this.isMoveableMounted = true;
+        this.isUnmounted = false;
+        const props = this.props;
+        const { parentMoveable, container } = props;
+
+
+        this._checkUpdateRootContainer();
+        this._checkUpdateViewContainer();
+        this._updateTargets();
+        this._updateNativeEvents();
+        this._updateEvents();
+        this.updateCheckInput();
+        this._updateObserver(this.props);
+
+        if (!container && !parentMoveable && !this.state.isPersisted) {
+            this.updateRect("", false, false);
+            this.forceUpdate();
+        }
+    }
+    public componentDidUpdate(prevProps: any) {
+        this._checkUpdateRootContainer();
+        this._checkUpdateViewContainer();
+        this._updateNativeEvents();
+        this._updateTargets();
+        this._updateEvents();
+        this.updateCheckInput();
+        this._updateObserver(prevProps);
+    }
+    public componentWillUnmount() {
+        this.isMoveableMounted = false;
+        this.isUnmounted = true;
+        this._emitter.off();
+        this._reiszeObserver?.disconnect();
+        this._mutationObserver?.disconnect();
+
+        const viewContainer = this._viewContainer;
+
+        if (viewContainer) {
+            this._changeAbleViewClassNames([]);
+        }
+        unsetGesto(this, false);
+        unsetGesto(this, true);
+
+        const events = this.events;
+        for (const name in events) {
+            const manager = events[name];
+            manager && manager.destroy();
+        }
+    }
+    public getTargets(): Array<HTMLElement | SVGElement> {
+        const target = this.props.target;
+        return target ? [target] : [];
+    }
+    /**
+     * Get the able used in MoveableManager.
+     * @method Moveable#getAble
+     * @param - able name
+     */
+    public getAble<T extends Able>(ableName: string): T | undefined {
+        const ables: Able[] = this.props.ables || [];
+
+        return find(ables, able => able.name === ableName) as T;
+    }
+    public getContainer(): HTMLElement | SVGElement {
+        const { parentMoveable, wrapperMoveable, container } = this.props;
+
+        return container!
+            || (wrapperMoveable && wrapperMoveable.getContainer())
+            || (parentMoveable && parentMoveable.getContainer())
+            || this.controlBox.parentElement!;
+    }
+    /**
+     * Returns the element of the control box.
+     * @method Moveable#getControlBoxElement
+     */
+    public getControlBoxElement(): HTMLElement {
+        return this.controlBox;
+    }
+    /**
+     * Target element to be dragged in moveable
+     * @method Moveable#getDragElement
+     */
+    public getDragElement(): HTMLElement | SVGElement | null | undefined {
+        return this._dragTarget;
+    }
+    /**
+     * Check if the target is an element included in the moveable.
+     * @method Moveable#isMoveableElement
+     * @param - the target
+     * @example
+     * import Moveable from "moveable";
+     *
+     * const moveable = new Moveable(document.body);
+     *
+     * window.addEventListener("click", e => {
+     *     if (!moveable.isMoveableElement(e.target)) {
+     *         moveable.target = e.target;
+     *     }
+     * });
+     */
+    public isMoveableElement(target: Element) {
+        return target && (target.getAttribute?.("class") || "").indexOf(PREFIX) > -1;
+    }
+    /**
+     * You can drag start the Moveable through the external `MouseEvent`or `TouchEvent`. (Angular: ngDragStart)
+     * @method Moveable#dragStart
+     * @param - external `MouseEvent`or `TouchEvent`
+     * @example
+     * import Moveable from "moveable";
+     *
+     * const moveable = new Moveable(document.body);
+     *
+     * document.body.addEventListener("mousedown", e => {
+     *     if (!moveable.isMoveableElement(e.target)) {
+     *          moveable.dragStart(e);
+     *     }
+     * });
+     */
+    public dragStart(e: MouseEvent | TouchEvent) {
+        const targetGesto = this.targetGesto;
+        const controlGesto = this.controlGesto;
+
+        if (targetGesto && checkMoveableTarget(this)({ inputEvent: e })) {
+            if (!targetGesto.isFlag()) {
+                targetGesto.triggerDragStart(e);
+            }
+        } else if (controlGesto && this.isMoveableElement(e.target as Element)) {
+            if (!controlGesto.isFlag()) {
+                controlGesto.triggerDragStart(e);
+            }
+        }
+        return this;
+    }
+    /**
+     * Hit test an element or rect on a moveable target.
+     * (100% = 100)
+     * @method Moveable#hitTest
+     * @param - element or rect to test
+     * @return - Get hit test rate (rate > 0 is hitted)
+     * @example
+     * import Moveable from "moveable";
+     *
+     * const moveable = new Moveable(document.body);
+     *
+     * document.body.addEventListener("mousedown", e => {
+     *     if (moveable.hitTest(e.target) > 0) {
+     *          console.log("hiited");
+     *     }
+     * });
+     */
+    public hitTest(el: Element | HitRect): number {
+        const { target, pos1, pos2, pos3, pos4, targetClientRect } = this.state;
+
+        if (!target) {
+            return 0;
+        }
+        let rect: Required<HitRect>;
+
+        if (isNode(el)) {
+            const clientRect = el.getBoundingClientRect();
+
+            rect = {
+                left: clientRect.left,
+                top: clientRect.top,
+                width: clientRect.width,
+                height: clientRect.height,
+            };
+        } else {
+            rect = { width: 0, height: 0, ...el };
+        }
+
+        const {
+            left: rectLeft,
+            top: rectTop,
+            width: rectWidth,
+            height: rectHeight,
+        } = rect;
+        const points = fitPoints([pos1, pos2, pos4, pos3], targetClientRect);
+        const size = getOverlapSize(points, [
+            [rectLeft, rectTop],
+            [rectLeft + rectWidth, rectTop],
+            [rectLeft + rectWidth, rectTop + rectHeight],
+            [rectLeft, rectTop + rectHeight],
+        ]);
+        const totalSize = getAreaSize(points);
+
+        if (!size || !totalSize) {
+            return 0;
+        }
+
+        return Math.min(100, size / totalSize * 100);
+    }
+    /**
+     * Whether the coordinates are inside Moveable
+     * @method Moveable#isInside
+     * @param - x coordinate
+     * @param - y coordinate
+     * @return - True if the coordinate is in moveable or false
+     * @example
+     * import Moveable from "moveable";
+     *
+     * const moveable = new Moveable(document.body);
+     *
+     * document.body.addEventListener("mousedown", e => {
+     *     if (moveable.isInside(e.clientX, e.clientY)) {
+     *          console.log("inside");
+     *     }
+     * });
+     */
+    public isInside(clientX: number, clientY: number) {
+        const { target, pos1, pos2, pos3, pos4, targetClientRect } = this.state;
+
+        if (!target) {
+            return false;
+        }
+        return isInside([clientX, clientY], fitPoints([pos1, pos2, pos4, pos3], targetClientRect));
+    }
+    /**
+     * If the width, height, left, and top of all elements change, update the shape of the moveable.
+     * @method Moveable#updateRect
+     * @example
+     * import Moveable from "moveable";
+     *
+     * const moveable = new Moveable(document.body);
+     *
+     * window.addEventListener("resize", e => {
+     *     moveable.updateRect();
+     * });
+     */
+    public updateRect(type?: "Start" | "" | "End", isTarget?: boolean, isSetState: boolean = true) {
+        const props = this.props;
+        const isSingle = !props.parentPosition && !props.wrapperMoveable;
+
+        if (isSingle) {
+            setStoreCache(true);
+        }
+        const parentMoveable = props.parentMoveable;
+        const state = this.state;
+        const target = (state.target || props.target) as HTMLElement | SVGElement;
+        const container = this.getContainer();
+        const rootContainer = parentMoveable
+            ? (parentMoveable as any)._rootContainer
+            : this._rootContainer;
+        const nextState = getMoveableTargetInfo(
+            this.controlBox,
+            target,
+            container,
+            container,
+            rootContainer || container,
+            this._getRequestStyles(),
+        );
+
+        if (!target && this._hasFirstTarget && props.persistData) {
+            const persistState = getPersistState(props.persistData);
+
+            for (const name in persistState) {
+                (nextState as any)[name] = (persistState as any)[name];
+            }
+        }
+
+        if (isSingle) {
+            setStoreCache();
+        }
+        this.updateState(
+            nextState,
+            parentMoveable ? false : isSetState,
+        );
+    }
+    /**
+     * Check if the moveable state is being dragged.
+     * @method Moveable#isDragging
+     * @param - If you want to check if able is dragging, specify ableName.
+     * @example
+     * import Moveable from "moveable";
+     *
+     * const moveable = new Moveable(document.body);
+     *
+     * // false
+     * console.log(moveable.isDragging());
+     *
+     * moveable.on("drag", () => {
+     *   // true
+     *   console.log(moveable.isDragging());
+     * });
+     */
+    public isDragging(ableName?: string) {
+        const targetGesto = this.targetGesto;
+        const controlGesto = this.controlGesto;
+
+        if (targetGesto?.isFlag()) {
+            if (!ableName) {
+                return true;
+            }
+            const data = targetGesto.getEventData();
+
+            return !!data[ableName]?.isEventStart;
+        }
+        if (controlGesto?.isFlag()) {
+            if (!ableName) {
+                return true;
+            }
+            const data = controlGesto.getEventData();
+
+            return !!data[ableName]?.isEventStart;
+        }
+        return false;
+    }
+    /**
+     * If the width, height, left, and top of the only target change, update the shape of the moveable.
+     * Use `.updateRect()` method
+     * @method Moveable#updateTarget
+     * @deprecated
+     * @example
+     * import Moveable from "moveable";
+     *
+     * const moveable = new Moveable(document.body);
+     *
+     * moveable.updateTarget();
+     */
+    public updateTarget(type?: "Start" | "" | "End") {
+        this.updateRect(type, true);
+    }
+    /**
+     * You can get the vertex information, position and offset size information of the target based on the container.
+     * @method Moveable#getRect
+     * @return - The Rect Info
+     * @example
+     * import Moveable from "moveable";
+     *
+     * const moveable = new Moveable(document.body);
+     *
+     * const rectInfo = moveable.getRect();
+     */
+    public getRect(): RectInfo {
+        const state = this.state;
+        const poses = getAbsolutePosesByState(this.state);
+        const [pos1, pos2, pos3, pos4] = poses;
+        const rect = getRect(poses);
+        const {
+            width: offsetWidth,
+            height: offsetHeight,
+        } = state;
+        const {
+            width,
+            height,
+            left,
+            top,
+        } = rect;
+        const statePos = [state.left, state.top];
+        const origin = plus(statePos, state.origin);
+        const beforeOrigin = plus(statePos, state.beforeOrigin);
+        const transformOrigin = state.transformOrigin;
+
+        return {
+            width,
+            height,
+            left,
+            top,
+            pos1,
+            pos2,
+            pos3,
+            pos4,
+            offsetWidth,
+            offsetHeight,
+            beforeOrigin,
+            origin,
+            transformOrigin,
+            rotation: this.getRotation(),
+        };
+    }
+    /**
+     * Get a manager that manages the moveable's state and props.
+     * @method Moveable#getManager
+     * @return - The Rect Info
+     * @example
+     * import Moveable from "moveable";
+     *
+     * const moveable = new Moveable(document.body);
+     *
+     * const manager = moveable.getManager(); // real moveable class instance
+     */
+    public getManager(): MoveableManagerInterface<any, any> {
+        return this as any;
+    }
+    /**
+     * You can stop the dragging currently in progress through a method from outside.
+     * @method Moveable#stopDrag
+     * @return - The Rect Info
+     * @example
+     * import Moveable from "moveable";
+     *
+     * const moveable = new Moveable(document.body);
+     *
+     * moveable.stopDrag();
+     */
+    public stopDrag(type?: "target" | "control"): void {
+        if (!type || type === "target") {
+            const gesto = this.targetGesto;
+
+            if (gesto?.isIdle() === false) {
+                unsetAbles(this, false);
+            }
+            gesto?.stop();
+        }
+        if (!type || type === "control") {
+            const gesto = this.controlGesto;
+
+            if (gesto?.isIdle() === false) {
+                unsetAbles(this, true);
+            }
+            gesto?.stop();
+        }
+    }
+    public getRotation() {
+        const {
+            pos1,
+            pos2,
+            direction,
+        } = this.state;
+
+        return getAbsoluteRotation(pos1, pos2, direction);
+    }
+    /**
+     * Request able through a method rather than an event.
+     * At the moment of execution, requestStart is executed,
+     * and then request and requestEnd can be executed through Requester.
+     * @method Moveable#request
+     * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Draggable.html#request|Draggable Requester}
+     * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Resizable.html#request|Resizable Requester}
+     * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Scalable.html#request|Scalable Requester}
+     * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Rotatable.html#request|Rotatable Requester}
+     * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.OriginDraggable.html#request|OriginDraggable Requester}
+     * @param - ableName
+     * @param - request to be able params.
+     * @param - If isInstant is true, request and requestEnd are executed immediately.
+     * @return - Able Requester. If there is no request in able, nothing will work.
+     * @example
+     * import Moveable from "moveable";
+     *
+     * const moveable = new Moveable(document.body);
+     *
+     * // Instantly Request (requestStart - request - requestEnd)
+     * moveable.request("draggable", { deltaX: 10, deltaY: 10 }, true);
+     *
+     * // Start move
+     * const requester = moveable.request("draggable");
+     * requester.request({ deltaX: 10, deltaY: 10 });
+     * requester.request({ deltaX: 10, deltaY: 10 });
+     * requester.request({ deltaX: 10, deltaY: 10 });
+     * requester.requestEnd();
+     */
+    public request(
+        ableName: string,
+        param: IObject<any> = {},
+        isInstant?: boolean,
+    ): Requester {
+        const self = this;
+        const props = self.props;
+        const manager = props.parentMoveable || props.wrapperMoveable || self;
+        const allAbles = manager.props.ables!;
+        const groupable = props.groupable;
+        const requsetAble = find(allAbles, (able: Able) => able.name === ableName);
+
+        if (this.isDragging() || !requsetAble || !requsetAble.request) {
+            return {
+                request() {
+                    return this;
+                },
+                requestEnd() {
+                    return this;
+                },
+            };
+        }
+
+        const ableRequester = requsetAble.request(self);
+        const requestInstant = isInstant || param.isInstant;
+        const ableType = ableRequester.isControl ? "controlAbles" : "targetAbles";
+        const eventAffix = `${(groupable ? "Group" : "")}${ableRequester.isControl ? "Control" : ""}`;
+        const moveableAbles: Able[] = [...manager[ableType]];
+
+        const requester = {
+            request(ableParam: IObject<any>) {
+                triggerAble(self, moveableAbles, ["drag"], eventAffix, "", {
+                    ...ableRequester.request(ableParam),
+                    requestAble: ableName,
+                    isRequest: true,
+                }, requestInstant);
+                return requester;
+            },
+            requestEnd() {
+                triggerAble(self, moveableAbles, ["drag"], eventAffix, "End", {
+                    ...ableRequester.requestEnd(),
+                    requestAble: ableName,
+                    isRequest: true,
+                }, requestInstant);
+                return requester;
+            },
+        };
+
+        triggerAble(self, moveableAbles, ["drag"], eventAffix, "Start", {
+            ...ableRequester.requestStart(param),
+            requestAble: ableName,
+            isRequest: true,
+        }, requestInstant);
+
+        return requestInstant ? requester.request(param).requestEnd() : requester;
+    }
+    /**
+     * moveable is the top level that manages targets
+     * `Single`: MoveableManager instance
+     * `Group`: MoveableGroup instance
+     * `IndividualGroup`: MoveableIndividaulGroup instance
+     * Returns leaf target MoveableManagers.
+     */
+    public getMoveables(): MoveableManagerInterface[] {
+        return [this];
+    }
+    /**
+     * Remove the Moveable object and the events.
+     * @method Moveable#destroy
+     * @example
+     * import Moveable from "moveable";
+     *
+     * const moveable = new Moveable(document.body);
+     *
+     * moveable.destroy();
+     */
+    public destroy(): void {
+        this.componentWillUnmount();
+    }
+    public updateRenderPoses() {
+        const state = this.getState();
+        const props = this.props;
+        const padding = props.padding;
+        const {
+            originalBeforeOrigin,
+            transformOrigin,
+            allMatrix, is3d,
+            pos1, pos2, pos3, pos4,
+            left: stateLeft,
+            top: stateTop,
+            isPersisted,
+        } = state;
+        const zoom = props.zoom || 1;
+
+        if (!padding && zoom <= 1) {
+            state.renderPoses = [
+                pos1,
+                pos2,
+                pos3,
+                pos4,
+            ];
+            state.renderLines = [
+                [pos1, pos2],
+                [pos2, pos4],
+                [pos4, pos3],
+                [pos3, pos1],
+            ];
+            return;
+        }
+        const {
+            left,
+            top,
+            bottom,
+            right,
+        } = getPaddingBox(padding || {});
+        const n = is3d ? 4 : 3;
+
+        // const clipPathInfo = getClipPath(
+        //     props.target,
+        //     offsetWidth,
+        //     offsetHeight,
+        // );
+
+        // if (clipPathInfo) {
+        //     left -= Math.max(0, clipPathInfo.left);
+        //     top -= Math.max(0, clipPathInfo.top);
+        //     bottom -= Math.max(0, offsetHeight - clipPathInfo.bottom);
+        //     right -= Math.max(0, offsetWidth - clipPathInfo.right);
+        // }
+
+        let absoluteOrigin: number[] = [];
+
+        if (isPersisted) {
+            absoluteOrigin = transformOrigin;
+        } else if (this.controlBox && props.groupable) {
+            absoluteOrigin = originalBeforeOrigin;
+        } else {
+            absoluteOrigin = plus(originalBeforeOrigin, [stateLeft, stateTop]);
+        }
+
+        const nextMatrix = multiplies(
+            n,
+            createOriginMatrix(absoluteOrigin.map(v => -v), n),
+            allMatrix,
+            createOriginMatrix(transformOrigin, n),
+        );
+
+        const renderPos1 = calculatePadding(nextMatrix, pos1, [-left, -top], n);
+        const renderPos2 = calculatePadding(nextMatrix, pos2, [right, -top], n);
+        const renderPos3 = calculatePadding(nextMatrix, pos3, [-left, bottom], n);
+        const renderPos4 = calculatePadding(nextMatrix, pos4, [right, bottom], n);
+
+        state.renderPoses = [
+            renderPos1,
+            renderPos2,
+            renderPos3,
+            renderPos4,
+        ];
+        state.renderLines = [
+            [renderPos1, renderPos2],
+            [renderPos2, renderPos4],
+            [renderPos4, renderPos3],
+            [renderPos3, renderPos1],
+        ];
+
+        if (zoom) {
+            const zoomOffset = zoom / 2;
+
+            state.renderLines = [
+                [
+                    calculatePadding(nextMatrix, pos1, [-left - zoomOffset, -top], n),
+                    calculatePadding(nextMatrix, pos2, [right + zoomOffset, -top], n),
+                ],
+                [
+                    calculatePadding(nextMatrix, pos2, [right, -top - zoomOffset], n),
+                    calculatePadding(nextMatrix, pos4, [right, bottom + zoomOffset], n),
+                ],
+                [
+                    calculatePadding(nextMatrix, pos4, [right + zoomOffset, bottom], n),
+                    calculatePadding(nextMatrix, pos3, [-left - zoomOffset, bottom], n),
+                ],
+                [
+                    calculatePadding(nextMatrix, pos3, [-left, bottom + zoomOffset], n),
+                    calculatePadding(nextMatrix, pos1, [-left, -top - zoomOffset], n),
+                ],
+            ];
+        }
+    }
+    public checkUpdate() {
+        this._isPropTargetChanged = false;
+        const { target, container, parentMoveable } = this.props;
+        const {
+            target: stateTarget,
+            container: stateContainer,
+        } = this.state;
+
+        if (!stateTarget && !target) {
+            return;
+        }
+        this.updateAbles();
+
+        const isTargetChanged = !equals(stateTarget, target);
+        const isChanged = isTargetChanged || !equals(stateContainer, container);
+
+        if (!isChanged) {
+            return;
+        }
+        const moveableContainer = container || this.controlBox;
+
+        if (moveableContainer) {
+            this.unsetAbles();
+        }
+        this.updateState({ target, container });
+
+        if (!parentMoveable && moveableContainer) {
+            this.updateRect("End", false, false);
+        }
+        this._isPropTargetChanged = isTargetChanged;
+    }
+    public waitToChangeTarget(): Promise<void> {
+        return new Promise(() => { });
+    }
+    public triggerEvent(
+        name: string,
+        e: any,
+    ): any {
+        const props = this.props;
+
+        this._emitter.trigger(name, e);
+
+        if (props.parentMoveable && e.isRequest && !e.isRequestChild) {
+            return props.parentMoveable.triggerEvent(name, e, true);
+        }
+
+        const callback = (props as any)[name];
+
+        return callback && callback(e);
+    }
+    public useCSS(tag: string, css: string) {
+        const customStyleMap = this.props.customStyledMap as Record<string, any>;
+
+        const key = tag + css;
+
+        if (!customStyleMap[key]) {
+            customStyleMap[key] = styled(tag, css);
+        }
+        return customStyleMap[key];
+    }
+    public checkUpdateRect = () => {
+        if (this.isDragging()) {
+            return;
+        }
+        const parentMoveable = this.props.parentMoveable;
+
+        if (parentMoveable) {
+            (parentMoveable as any).checkUpdateRect();
+            return;
+        }
+        cancelAnimationFrame(this._observerId);
+        this._observerId = requestAnimationFrame(() => {
+            if (this.isDragging()) {
+                return;
+            }
+            this.updateRect();
+        });
+    }
+    public getState(): MoveableManagerState {
+        const props = this.props;
+        if (props.target || (props as any).targets?.length) {
+            this._hasFirstTarget = true;
+        }
+        const hasControlBox = this.controlBox;
+        const persistData = props.persistData;
+        const firstRenderState = props.firstRenderState;
+
+        if (firstRenderState && !hasControlBox) {
+            return firstRenderState;
+        }
+        if (!this._hasFirstTarget && persistData) {
+            const persistState = getPersistState(persistData);
+
+            if (persistState) {
+                this.updateState(persistState, false);
+                return this.state;
+            }
+        }
+        (this.state as any).isPersisted = false;
+        return this.state;
+    }
+    public updateSelectors() { }
+    protected unsetAbles() {
+        this.targetAbles.forEach(able => {
+            if (able.unset) {
+                able.unset(this);
+            }
+        });
+    }
+    protected updateAbles(
+        ables: Able[] = this.props.ables!,
+        eventAffix: string = "",
+    ) {
+        const props = this.props as any;
+        const triggerAblesSimultaneously = props.triggerAblesSimultaneously;
+        const enabledAbles = this.getEnabledAbles(ables);
+
+        const dragStart = `drag${eventAffix}Start` as "dragStart";
+        const pinchStart = `pinch${eventAffix}Start` as "pinchStart";
+        const dragControlStart = `drag${eventAffix}ControlStart` as "dragControlStart";
+
+        const targetAbles = filterAbles(enabledAbles, [dragStart, pinchStart], triggerAblesSimultaneously);
+        const controlAbles = filterAbles(enabledAbles, [dragControlStart], triggerAblesSimultaneously);
+
+        this.enabledAbles = enabledAbles;
+        this.targetAbles = targetAbles;
+        this.controlAbles = controlAbles;
+    }
+    protected updateState(nextState: any, isSetState?: boolean) {
+        if (isSetState) {
+            if (this.isUnmounted) {
+                return;
+            }
+            this.setState(nextState);
+        } else {
+            const state = this.state;
+
+            for (const name in nextState) {
+                (state as any)[name] = nextState[name];
+            }
+        }
+    }
+    protected getEnabledAbles(ables: Able[] = this.props.ables!) {
+        const props = this.props as any;
+
+        return ables.filter(able => able && (
+            (able.always && props[able.name] !== false)
+            || props[able.name]));
+    }
+    protected renderAbles() {
+        const props = this.props as any;
+        const triggerAblesSimultaneously = props.triggerAblesSimultaneously;
+        const Renderer = {
+            createElement,
+        };
+
+        this.renderState = {};
+
+        return groupByMap(flat<any>(
+            filterAbles(this.getEnabledAbles(), ["render"], triggerAblesSimultaneously).map(({ render }) => {
+                return render!(this, Renderer) || [];
+            })).filter(el => el), ({ key }) => key).map(group => group[0]);
+    }
+    protected updateCheckInput() {
+        this.targetGesto && (this.targetGesto.options.checkInput = this.props.checkInput);
+    }
+    protected _getRequestStyles() {
+        const styleNames = this.getEnabledAbles().reduce((names, able) => {
+            const ableStyleNames = (able.requestStyle?.() ?? []) as Array<keyof CSSStyleDeclaration>;
+
+            return [...names, ...ableStyleNames];
+        }, [...(this.props.requestStyles || [])] as Array<keyof CSSStyleDeclaration>);
+
+
+        return styleNames;
+    }
+    protected _updateObserver(prevProps: MoveableDefaultOptions) {
+        this._updateResizeObserver(prevProps);
+        this._updateMutationObserver(prevProps);
+    }
+    protected _updateEvents() {
+        const controlBoxElement = this.controlBox;
+        const hasTargetAble = this.targetAbles.length;
+        const hasControlAble = this.controlAbles.length;
+        const target = this._dragTarget;
+        const isUnset = (!hasTargetAble && this.targetGesto)
+            || this._isTargetChanged(true);
+
+        if (isUnset) {
+            unsetGesto(this, false);
+            this.updateState({ gestos: {} });
+        }
+        if (!hasControlAble) {
+            unsetGesto(this, true);
+        }
+
+        if (target && hasTargetAble && !this.targetGesto) {
+            this.targetGesto = getTargetAbleGesto(this, target!, "");
+        }
+        if (!this.controlGesto && hasControlAble) {
+            this.controlGesto = getAbleGesto(this, controlBoxElement, "controlAbles", "Control");
+        }
+    }
+    protected _updateTargets() {
+        const props = this.props;
+
+        this._prevPropTarget = this._propTarget;
+        this._prevDragTarget = this._dragTarget;
+        this._prevOriginalDragTarget = this._originalDragTarget;
+        this._prevDragArea = props.dragArea!;
+
+        this._propTarget = props.target;
+        this._originalDragTarget = props.dragTarget || props.target;
+        this._dragTarget = getRefTarget(this._originalDragTarget, true);
+
+    }
+    private _renderLines() {
+        const props = this.props;
+        const {
+            zoom,
+            hideDefaultLines,
+            hideChildMoveableDefaultLines,
+            parentMoveable,
+        } = props as MoveableManagerProps<GroupableProps>;
+
+        if (hideDefaultLines || (parentMoveable && hideChildMoveableDefaultLines)) {
+            return [];
+        }
+        const state = this.getState();
+        const Renderer = {
+            createElement,
+        };
+
+        return state.renderLines.map((line, i) => {
+            return renderLine(Renderer, "", line[0], line[1], zoom!, `render-line-${i}`);
+        });
+    }
+    private _onPreventClick = (e: any) => {
+        e.stopPropagation();
+        e.preventDefault();
+        // removeEvent(window, "click", this._onPreventClick, true);
+    }
+    private _isTargetChanged(useDragArea?: boolean) {
+        const props = this.props;
+        const nextTarget = props.dragTarget || props.target;
+        const prevTarget = this._prevOriginalDragTarget;
+        const prevDragArea = this._prevDragArea;
+        const dragArea = props.dragArea;
+
+        // check target without dragArea
+        const isDragTargetChanged = !dragArea && prevTarget !== nextTarget;
+        const isDragAreaChanged = (useDragArea || dragArea) && prevDragArea !== dragArea;
+
+        return isDragTargetChanged || isDragAreaChanged || this._prevPropTarget != this._propTarget;
+    }
+    private _updateNativeEvents() {
+        const props = this.props;
+        const target = props.dragArea ? this.areaElement : this.state.target;
+        const events = this.events;
+        const eventKeys = getKeys(events);
+
+        if (this._isTargetChanged()) {
+            for (const eventName in events) {
+                const manager = events[eventName];
+                manager && manager.destroy();
+                events[eventName] = null;
+            }
+        }
+        if (!target) {
+            return;
+        }
+        const enabledAbles = this.enabledAbles;
+        eventKeys.forEach(eventName => {
+            const ables = filterAbles(enabledAbles, [eventName] as any);
+            const hasAbles = ables.length > 0;
+            let manager = events[eventName];
+
+            if (!hasAbles) {
+                if (manager) {
+                    manager.destroy();
+                    events[eventName] = null;
+                }
+                return;
+            }
+            if (!manager) {
+                manager = new EventManager(target, this, eventName);
+                events[eventName] = manager;
+            }
+            manager.setAbles(ables);
+        });
+    }
+    private _checkUpdateRootContainer() {
+        const rootContainer = this.props.rootContainer;
+
+        if (!this._rootContainer && rootContainer) {
+            this._rootContainer = getRefTarget(rootContainer, true);
+        }
+    }
+    private _checkUpdateViewContainer() {
+        const viewContainerOption = this.props.viewContainer;
+
+        if (!this._viewContainer && viewContainerOption) {
+            this._viewContainer = getRefTarget(viewContainerOption, true);
+        }
+        const viewContainer = this._viewContainer;
+
+        if (viewContainer) {
+            this._changeAbleViewClassNames([
+                ...this._getAbleViewClassNames(),
+                this.isDragging() ? VIEW_DRAGGING : "",
+            ]);
+        }
+    }
+    private _changeAbleViewClassNames(classNames: string[]) {
+        const viewContainer = this._viewContainer!;
+        const nextClassNames = groupBy(
+            classNames.filter(Boolean),
+            el => el,
+        ).map(([className]) => className);
+        const prevClassNames = this._viewClassNames;
+
+        const {
+            removed,
+            added,
+        } = diff(prevClassNames, nextClassNames);
+
+        removed.forEach(index => {
+            removeClass(viewContainer, prevClassNames[index]);
+        });
+        added.forEach(index => {
+            addClass(viewContainer, nextClassNames[index]);
+        });
+
+        this._viewClassNames = nextClassNames;
+
+    }
+    private _getAbleViewClassNames() {
+        return (this.getEnabledAbles().map(able => {
+            return (able.viewClassName?.(this) || "");
+        }).join(" ") + ` ${this._getAbleClassName("-view")}`).split(/\s+/g);
+    }
+    private _getAbleClassName(classPrefix = "") {
+        const ables = this.getEnabledAbles();
+
+        const targetGesto = this.targetGesto;
+        const controlGesto = this.controlGesto;
+        const targetGestoData: Record<string, any> = targetGesto?.isFlag()
+            ? targetGesto.getEventData() : {};
+        const controlGestoData: Record<string, any> = controlGesto?.isFlag()
+            ? controlGesto.getEventData() : {};
+
+        return ables.map(able => {
+            const name = able.name;
+            let className = able.className?.(this) || "";
+
+            if (
+                targetGestoData[name]?.isEventStart
+                || controlGestoData[name]?.isEventStart
+            ) {
+                className += ` ${prefix(`${name}${classPrefix}-dragging`)}`;
+            }
+            return className.trim();
+        }).filter(Boolean).join(" ");
+    }
+    private _updateResizeObserver(prevProps: MoveableDefaultOptions) {
+        const props = this.props;
+        const target = props.target;
+        const win = getWindow(this.getControlBoxElement());
+
+        if (!win.ResizeObserver || !target || !props.useResizeObserver) {
+            this._reiszeObserver?.disconnect();
+            return;
+        }
+
+        if (prevProps.target === target && this._reiszeObserver) {
+            return;
+        }
+
+        const observer = new win.ResizeObserver(this.checkUpdateRect);
+
+        observer.observe(target!, {
+            box: "border-box",
+        });
+        this._reiszeObserver = observer;
+    }
+    private _updateMutationObserver(prevProps: MoveableDefaultOptions) {
+        const props = this.props;
+        const target = props.target;
+        const win = getWindow(this.getControlBoxElement());
+
+        if (!win.MutationObserver || !target || !props.useMutationObserver) {
+            this._mutationObserver?.disconnect();
+            return;
+        }
+
+        if (prevProps.target === target && this._mutationObserver) {
+            return;
+        }
+
+        const observer = new win.MutationObserver(records => {
+            for (const mutation of records) {
+                if (mutation.type === "attributes" && mutation.attributeName === "style") {
+                    this.checkUpdateRect();
+                }
+            }
+        });
+
+        observer.observe(target!, {
+            attributes: true,
+        });
+        this._mutationObserver = observer;
+    }
+}
+
+/**
+ * The target to indicate Moveable Control Box.
+ * @name Moveable#target
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body);
+ * moveable.target = document.querySelector(".target");
+ */
+/**
+ * Zooms in the elements of a moveable.
+ * @name Moveable#zoom
+ * @default 1
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body);
+ * moveable.zoom = 2;
+ */
+
+/**
+ * Whether the target size is detected and updated whenever it changes.
+ * @name Moveable#useResizeObserver
+ * @default false
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body);
+ * moveable.useResizeObserver = true;
+ */
+
+/**
+ * Resize, Scale Events at edges
+ * @name Moveable#edge
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body);
+ * moveable.edge = true;
+ */
+
+/**
+ * You can specify the className of the moveable controlbox.
+ * @name Moveable#className
+ * @default ""
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *   className: "",
+ * });
+ *
+ * moveable.className = "moveable1";
+ */
+
+/**
+ * The target(s) to drag Moveable target(s)
+ * @name Moveable#dragTarget
+ * @default target
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body);
+ * moveable.target = document.querySelector(".target");
+ * moveable.dragTarget = document.querySelector(".dragTarget");
+ */
+
+/**
+ * `renderStart` event occurs at the first start of all events.
+ * @memberof Moveable
+ * @event renderStart
+ * @param {Moveable.OnRenderStart} - Parameters for the `renderStart` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     target: document.querySelector(".target"),
+ * });
+ * moveable.on("renderStart", ({ target }) => {
+ *     console.log("onRenderStart", target);
+ * });
+ */
+
+/**
+ * `render` event occurs before the target is drawn on the screen.
+ * @memberof Moveable
+ * @event render
+ * @param {Moveable.OnRender} - Parameters for the `render` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     target: document.querySelector(".target"),
+ * });
+ * moveable.on("render", ({ target }) => {
+ *     console.log("onRender", target);
+ * });
+ */
+
+/**
+ * `renderEnd` event occurs at the end of all events.
+ * @memberof Moveable
+ * @event renderEnd
+ * @param {Moveable.OnRenderEnd} - Parameters for the `renderEnd` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     target: document.querySelector(".target"),
+ * });
+ * moveable.on("renderEnd", ({ target }) => {
+ *     console.log("onRenderEnd", target);
+ * });
+ */
+
+/**
+ * `renderGroupStart` event occurs at the first start of all events in group.
+ * @memberof Moveable
+ * @event renderGroupStart
+ * @param {Moveable.OnRenderGroupStart} - Parameters for the `renderGroupStart` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     target: [].slice.call(document.querySelectorAll(".target")),
+ * });
+ * moveable.on("renderGroupStart", ({ targets }) => {
+ *     console.log("onRenderGroupStart", targets);
+ * });
+ */
+
+/**
+ * `renderGroup` event occurs before the target is drawn on the screen in group.
+ * @memberof Moveable
+ * @event renderGroup
+ * @param {Moveable.OnRenderGroup} - Parameters for the `renderGroup` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     target: [].slice.call(document.querySelectorAll(".target")),
+ * });
+ * moveable.on("renderGroup", ({ targets }) => {
+ *     console.log("onRenderGroup", targets);
+ * });
+ */
+
+/**
+ * `renderGroupEnd` event occurs at the end of all events in group.
+ * @memberof Moveable
+ * @event renderGroupEnd
+ * @param {Moveable.OnRenderGroupEnd} - Parameters for the `renderGroupEnd` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     target: [].slice.call(document.querySelectorAll(".target")),
+ * });
+ * moveable.on("renderGroupEnd", ({ targets }) => {
+ *     console.log("onRenderGroupEnd", targets);
+ * });
+ */
+
+
+
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + diff --git a/release/0.52.0/doc/packages_react-moveable_src_ables_Clickable.ts.html b/release/0.52.0/doc/packages_react-moveable_src_ables_Clickable.ts.html new file mode 100644 index 000000000..54615e9c2 --- /dev/null +++ b/release/0.52.0/doc/packages_react-moveable_src_ables_Clickable.ts.html @@ -0,0 +1,204 @@ + + + + + packages/react-moveable/src/ables/Clickable.ts - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

packages/react-moveable/src/ables/Clickable.ts

+ + + + + + + +
+
+
import {
+    MoveableManagerInterface, MoveableGroupInterface,
+    ClickableProps, OnClick, OnClickGroup,
+} from "../types";
+import { triggerEvent, fillParams } from "../utils";
+import { findIndex } from "@daybrush/utils";
+import { makeAble } from "./AbleManager";
+
+export default makeAble("clickable", {
+    props: [
+        "clickable",
+    ] as const,
+    events: [
+        "click",
+        "clickGroup",
+    ] as const,
+    always: true,
+    dragRelation: "weak",
+    // eslint-disable-next-line @typescript-eslint/no-unused-vars
+    dragStart() {
+        return;
+    },
+    dragControlStart() {
+        return;
+    },
+    dragGroupStart(moveable: MoveableManagerInterface<ClickableProps>, e: any) {
+        e.datas.inputTarget = e.inputEvent && e.inputEvent.target;
+    },
+    dragEnd(moveable: MoveableManagerInterface<ClickableProps>, e: any) {
+        const target = moveable.props.target!;
+        const inputEvent = e.inputEvent;
+        const inputTarget = e.inputTarget;
+        const isMoveableElement = moveable.isMoveableElement(inputTarget);
+        const containsElement = !isMoveableElement && moveable.controlBox.contains(inputTarget);
+
+        if (
+            !inputEvent || !inputTarget || e.isDrag
+            || moveable.isMoveableElement(inputTarget)
+            || containsElement
+            // External event duplicate target or dragAreaElement
+        ) {
+            return;
+        }
+        const containsTarget = target.contains(inputTarget);
+
+        triggerEvent(moveable, "onClick", fillParams<OnClick>(moveable, e, {
+            isDouble: e.isDouble,
+            inputTarget,
+            isTarget: target === inputTarget,
+            moveableTarget: moveable.props.target!,
+            containsTarget,
+        }));
+    },
+    dragGroupEnd(moveable: MoveableGroupInterface<ClickableProps>, e: any) {
+        const inputEvent = e.inputEvent;
+        const inputTarget = e.inputTarget;
+
+        if (
+            !inputEvent || !inputTarget || e.isDrag
+            || moveable.isMoveableElement(inputTarget)
+            // External event duplicate target or dragAreaElement
+            || e.datas.inputTarget === inputTarget
+        ) {
+            return;
+        }
+        const targets = moveable.props.targets!;
+        let targetIndex = targets.indexOf(inputTarget);
+        const isTarget = targetIndex > -1;
+        let containsTarget = false;
+
+        if (targetIndex === -1) {
+            targetIndex = findIndex(targets, parentTarget => parentTarget.contains(inputTarget));
+            containsTarget = targetIndex > -1;
+        }
+
+        triggerEvent(moveable, "onClickGroup", fillParams<OnClickGroup>(moveable, e, {
+            isDouble: e.isDouble,
+            targets,
+            inputTarget,
+            targetIndex,
+            isTarget,
+            containsTarget,
+            moveableTarget: targets[targetIndex],
+        }));
+    },
+    dragControlEnd(moveable: MoveableManagerInterface<ClickableProps>, e: any) {
+        this.dragEnd(moveable, e);
+    },
+    dragGroupControlEnd(moveable: MoveableManagerInterface<ClickableProps>, e: any) {
+        this.dragEnd(moveable, e);
+    },
+});
+
+/**
+ * When you click on the element, the `click` event is called.
+ * @memberof Moveable
+ * @event click
+ * @param {Moveable.OnClick} - Parameters for the `click` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     target: document.querySelector(".target"),
+ * });
+ * moveable.on("click", ({ hasTarget, containsTarget, targetIndex }) => {
+ *     // If you click on an element other than the target and not included in the target, index is -1.
+ *     console.log("onClickGroup", target, hasTarget, containsTarget, targetIndex);
+ * });
+ */
+
+/**
+ * When you click on the element inside the group, the `clickGroup` event is called.
+ * @memberof Moveable
+ * @event clickGroup
+ * @param {Moveable.OnClickGroup} - Parameters for the `clickGroup` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     target: [].slice.call(document.querySelectorAll(".target")),
+ * });
+ * moveable.on("clickGroup", ({ inputTarget, isTarget, containsTarget, targetIndex }) => {
+ *     // If you click on an element other than the target and not included in the target, index is -1.
+ *     console.log("onClickGroup", inputTarget, isTarget, containsTarget, targetIndex);
+ * });
+ */
+
+
+
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + diff --git a/release/0.52.0/doc/packages_react-moveable_src_ables_Clippable.tsx.html b/release/0.52.0/doc/packages_react-moveable_src_ables_Clippable.tsx.html new file mode 100644 index 000000000..314c2f3ab --- /dev/null +++ b/release/0.52.0/doc/packages_react-moveable_src_ables_Clippable.tsx.html @@ -0,0 +1,1239 @@ + + + + + packages/react-moveable/src/ables/Clippable.tsx - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

packages/react-moveable/src/ables/Clippable.tsx

+ + + + + + + +
+
+
import {
+    Renderer, ClippableProps, OnClip,
+    ClippableState, OnClipEnd, OnClipStart,
+    ControlPose, MoveableManagerInterface, DraggableProps,
+} from "../types";
+import { convertUnitSize, getRad } from "@daybrush/utils";
+import {
+    prefix, calculatePosition, getDiagonalSize,
+    fillParams, triggerEvent,
+    makeMatrixCSS, getRect, fillEndParams,
+    getSizeDistByDist,
+    getProps,
+    fillCSSObject,
+    abs,
+    sign,
+} from "../utils";
+import { plus, minus, multiply } from "@scena/matrix";
+import { getDragDist, calculatePointerDist, setDragStart } from "../gesto/GestoUtils";
+import {
+    HORIZONTAL_RADIUS_ORDER, VERTICAL_RADIUS_ORDER, addRadiusPos, removeRadiusPos,
+} from "./roundable/borderRadius";
+import { renderLine } from "../renderDirections";
+import { checkSnapBoundPriority } from "./snappable/snap";
+import { checkSnapBounds } from "./snappable/snapBounds";
+import { getDefaultGuidelines } from "./snappable/getTotalGuidelines";
+import {
+    getControlSize, getClipPath,
+    getClipStyles, getRectPoses,
+} from "./clippable/utils";
+
+export function moveControlPos(
+    controlPoses: ControlPose[],
+    index: number,
+    dist: number[],
+    isRect?: boolean,
+    keepRatio?: boolean,
+) {
+    const { direction, sub } = controlPoses[index];
+    const dists = controlPoses.map(() => [0, 0]);
+    const directions = direction ? direction.split("") : [];
+
+    if (isRect && index < 8) {
+        const verticalDirections = directions.filter(dir => dir === "w" || dir === "e");
+        const horizontalDirections = directions.filter(dir => dir === "n" || dir === "s");
+
+        const verticalDirection = verticalDirections[0];
+        const horizontalDirection = horizontalDirections[0];
+
+        dists[index] = dist;
+        const [width, height] = getControlSize(controlPoses);
+        const ratio = width && height ? width / height : 0;
+
+        if (ratio && keepRatio) {
+            // 0 1 2
+            // 7   3
+            // 6 5 4
+            const fixedIndex = (index + 4) % 8;
+            const fixedPosition = controlPoses[fixedIndex].pos;
+            const sizeDirection = [0, 0];
+
+            if (direction!.indexOf("w") > -1) {
+                sizeDirection[0] = -1;
+            } else if (direction!.indexOf("e") > -1) {
+                sizeDirection[0] = 1;
+            }
+            if (direction!.indexOf("n") > -1) {
+                sizeDirection[1] = -1;
+            } else if (direction!.indexOf("s") > -1) {
+                sizeDirection[1] = 1;
+            }
+
+
+            const nextDist = getSizeDistByDist(
+                [width, height],
+                dist,
+                ratio,
+                sizeDirection,
+                true,
+            );
+            const nextWidth = width + nextDist[0];
+            const nextHeight = height + nextDist[1];
+            let top = fixedPosition[1];
+            let bottom = fixedPosition[1];
+            let left = fixedPosition[0];
+            let right = fixedPosition[0];
+
+            if (sizeDirection[0] === -1) {
+                left = right - nextWidth;
+            } else if (sizeDirection[0] === 1) {
+                right = left + nextWidth;
+            } else {
+                left = left - nextWidth / 2;
+                right = right + nextWidth / 2;
+            }
+            if (sizeDirection[1] === -1) {
+                top = bottom - nextHeight;
+            } else if (sizeDirection[1] === 1) {
+                bottom = top + nextHeight;
+            } else {
+                top = bottom - nextHeight / 2;
+                bottom = top + nextHeight;
+            }
+
+            const nextControlPoses = getRectPoses(top, right, bottom, left);
+
+            controlPoses.forEach((controlPose, i) => {
+                dists[i][0] = nextControlPoses[i].pos[0] - controlPose.pos[0];
+                dists[i][1] = nextControlPoses[i].pos[1] - controlPose.pos[1];
+            });
+        } else {
+            controlPoses.forEach((controlPose, i) => {
+                const {
+                    direction: controlDir,
+                } = controlPose;
+
+                if (!controlDir) {
+                    return;
+                }
+                if (controlDir.indexOf(verticalDirection) > -1) {
+                    dists[i][0] = dist[0];
+                }
+                if (controlDir.indexOf(horizontalDirection) > -1) {
+                    dists[i][1] = dist[1];
+                }
+            });
+            if (verticalDirection) {
+                dists[1][0] = dist[0] / 2;
+                dists[5][0] = dist[0] / 2;
+            }
+            if (horizontalDirection) {
+                dists[3][1] = dist[1] / 2;
+                dists[7][1] = dist[1] / 2;
+            }
+        }
+    } else if (direction && !sub) {
+        directions.forEach(dir => {
+            const isVertical = dir === "n" || dir === "s";
+
+            controlPoses.forEach((controlPose, i) => {
+                const {
+                    direction: dirDir,
+                    horizontal: dirHorizontal,
+                    vertical: dirVertical,
+                } = controlPose;
+
+                if (!dirDir || dirDir.indexOf(dir) === -1) {
+                    return;
+                }
+                dists[i] = [
+                    isVertical || !dirHorizontal ? 0 : dist[0],
+                    !isVertical || !dirVertical ? 0 : dist[1],
+                ];
+            });
+        });
+    } else {
+        dists[index] = dist;
+    }
+
+    return dists;
+}
+
+
+function addClipPath(moveable: MoveableManagerInterface<ClippableProps>, e: any) {
+    const [distX, distY] = calculatePointerDist(moveable, e);
+    const { clipPath, clipIndex } = e.datas;
+    const {
+        type: clipType,
+        poses: clipPoses,
+        splitter,
+    } = (clipPath as ReturnType<typeof getClipPath>)!;
+    const poses = clipPoses.map(pos => pos.pos);
+    if (clipType === "polygon") {
+        poses.splice(clipIndex, 0, [distX, distY]);
+    } else if (clipType === "inset") {
+        const horizontalIndex = HORIZONTAL_RADIUS_ORDER.indexOf(clipIndex);
+        const verticalIndex = VERTICAL_RADIUS_ORDER.indexOf(clipIndex);
+        const length = clipPoses.length;
+
+        addRadiusPos(
+            clipPoses,
+            poses,
+            8,
+            horizontalIndex,
+            verticalIndex,
+            distX,
+            distY,
+            poses[4][0],
+            poses[4][1],
+            poses[0][0],
+            poses[0][1],
+        );
+
+        if (length === clipPoses.length) {
+            return;
+        }
+    } else {
+        return;
+    }
+    const clipStyles = getClipStyles(moveable, clipPath, poses)!;
+    const clipStyle = `${clipType}(${clipStyles.join(splitter)})`;
+
+    triggerEvent(moveable, "onClip", fillParams<OnClip>(moveable, e, {
+        clipEventType: "added",
+        clipType,
+        poses,
+        clipStyles,
+        clipStyle,
+        distX: 0,
+        distY: 0,
+        ...fillCSSObject({
+            clipPath: clipStyle,
+        }, e),
+    }));
+}
+function removeClipPath(moveable: MoveableManagerInterface<ClippableProps>, e: any) {
+    const { clipPath, clipIndex } = e.datas;
+    const {
+        type: clipType,
+        poses: clipPoses,
+        splitter,
+    } = (clipPath as ReturnType<typeof getClipPath>)!;
+    const poses = clipPoses.map(pos => pos.pos);
+    const length = poses.length;
+    if (clipType === "polygon") {
+        clipPoses.splice(clipIndex, 1);
+        poses.splice(clipIndex, 1);
+    } else if (clipType === "inset") {
+        if (clipIndex < 8) {
+            return;
+        }
+        removeRadiusPos(clipPoses, poses, clipIndex, 8, length);
+
+        if (length === clipPoses.length) {
+            return;
+        }
+    } else {
+        return;
+    }
+    const clipStyles = getClipStyles(moveable, clipPath, poses)!;
+    const clipStyle = `${clipType}(${clipStyles.join(splitter)})`;
+
+    triggerEvent(moveable, "onClip", fillParams<OnClip>(moveable, e, {
+        clipEventType: "removed",
+        clipType,
+        poses,
+        clipStyles,
+        clipStyle,
+        distX: 0,
+        distY: 0,
+        ...fillCSSObject({
+            clipPath: clipStyle,
+        }, e),
+    }));
+}
+/**
+ * @namespace Moveable.Clippable
+ * @description Whether to clip the target.
+ */
+
+export default {
+    name: "clippable",
+    props: [
+        "clippable",
+        "defaultClipPath",
+        "customClipPath",
+        "keepRatio",
+        "clipRelative",
+        "clipArea",
+        "dragWithClip",
+        "clipTargetBounds",
+        "clipVerticalGuidelines",
+        "clipHorizontalGuidelines",
+        "clipSnapThreshold",
+    ] as const,
+    events: [
+        "clipStart",
+        "clip",
+        "clipEnd",
+    ] as const,
+    css: [
+        `.control.clip-control {
+background: #6d6;
+cursor: pointer;
+}
+.control.clip-control.clip-radius {
+background: #d66;
+}
+.line.clip-line {
+background: #6e6;
+cursor: move;
+z-index: 1;
+}
+.clip-area {
+position: absolute;
+top: 0;
+left: 0;
+}
+.clip-ellipse {
+position: absolute;
+cursor: move;
+border: 1px solid #6d6;
+border: var(--zoompx) solid #6d6;
+border-radius: 50%;
+transform-origin: 0px 0px;
+}`,
+        `:host {
+--bounds-color: #d66;
+}`,
+        `.guideline {
+pointer-events: none;
+z-index: 2;
+}`,
+        `.line.guideline.bounds {
+background: #d66;
+background: var(--bounds-color);
+}`,
+    ],
+    render(moveable: MoveableManagerInterface<ClippableProps, ClippableState>, React: Renderer): any[] {
+        const {
+            customClipPath,
+            defaultClipPath,
+            clipArea, zoom,
+            groupable,
+        } = moveable.props;
+        const {
+            target, width, height, allMatrix, is3d, left, top,
+            pos1, pos2, pos3, pos4,
+            clipPathState,
+            snapBoundInfos,
+            rotation: rotationRad,
+        } = moveable.getState();
+
+        if (!target || groupable) {
+            return [];
+        }
+
+        const clipPath = getClipPath(
+            target, width, height, defaultClipPath || "inset", clipPathState || customClipPath);
+
+        if (!clipPath) {
+            return [];
+        }
+        const n = is3d ? 4 : 3;
+        const type = clipPath.type;
+        const clipPoses = clipPath.poses;
+        const poses = clipPoses.map(pos => {
+            // return [x, y];
+            const calculatedPos = calculatePosition(allMatrix, pos.pos, n);
+
+            return [
+                calculatedPos[0] - left,
+                calculatedPos[1] - top,
+            ];
+        });
+
+        let controls: any[] = [];
+        let lines: any[] = [];
+
+        const isRect = type === "rect";
+        const isInset = type === "inset";
+        const isPolygon = type === "polygon";
+
+        if (isRect || isInset || isPolygon) {
+            const linePoses = isInset ? poses.slice(0, 8) : poses;
+
+            lines = linePoses.map((to, i) => {
+                const from = i === 0 ? linePoses[linePoses.length - 1] : linePoses[i - 1];
+
+                const rad = getRad(from, to);
+                const dist = getDiagonalSize(from, to);
+                return <div key={`clipLine${i}`} className={prefix("line", "clip-line", "snap-control")}
+                    data-clip-index={i}
+                    style={{
+                        width: `${dist}px`,
+                        transform: `translate(${from[0]}px, ${from[1]}px) rotate(${rad}rad) scaleY(${zoom})`,
+                    }}></div>;
+            });
+        }
+        controls = poses.map((pos, i) => {
+            return <div key={`clipControl${i}`}
+                className={prefix("control", "clip-control", "snap-control")}
+                data-clip-index={i}
+                style={{
+                    transform: `translate(${pos[0]}px, ${pos[1]}px) rotate(${rotationRad}rad) scale(${zoom})`,
+                }}></div>;
+        });
+
+        if (isInset) {
+            controls.push(...poses.slice(8).map((pos, i) => {
+                return <div key={`clipRadiusControl${i}`}
+                    className={prefix("control", "clip-control", "clip-radius", "snap-control")}
+                    data-clip-index={8 + i}
+                    style={{
+                        transform: `translate(${pos[0]}px, ${pos[1]}px) rotate(${rotationRad}rad) scale(${zoom})`,
+                    }}></div>;
+            }));
+        }
+        if (type === "circle" || type === "ellipse") {
+            const {
+                left: clipLeft,
+                top: clipTop,
+                radiusX,
+                radiusY,
+            } = clipPath;
+
+            const [distLeft, distTop] = minus(
+                calculatePosition(allMatrix, [clipLeft!, clipTop!], n),
+                calculatePosition(allMatrix, [0, 0], n),
+            );
+            let ellipseClipPath = "none";
+
+            if (!clipArea) {
+                const piece = Math.max(10, radiusX! / 5, radiusY! / 5);
+                const areaPoses: number[][] = [];
+
+                for (let i = 0; i <= piece; ++i) {
+                    const rad = Math.PI * 2 / piece * i;
+                    areaPoses.push([
+                        radiusX! + (radiusX! - zoom!) * Math.cos(rad),
+                        radiusY! + (radiusY! - zoom!) * Math.sin(rad),
+                    ]);
+                }
+                areaPoses.push([radiusX!, -2]);
+                areaPoses.push([-2, -2]);
+                areaPoses.push([-2, radiusY! * 2 + 2]);
+                areaPoses.push([radiusX! * 2 + 2, radiusY! * 2 + 2]);
+                areaPoses.push([radiusX! * 2 + 2, -2]);
+                areaPoses.push([radiusX!, -2]);
+
+                ellipseClipPath = `polygon(${areaPoses.map(pos => `${pos[0]}px ${pos[1]}px`).join(", ")})`;
+            }
+            controls.push(<div key="clipEllipse" className={prefix("clip-ellipse", "snap-control")} style={{
+                width: `${radiusX! * 2}px`,
+                height: `${radiusY! * 2}px`,
+                clipPath: ellipseClipPath,
+                transform: `translate(${-left + distLeft}px, ${-top + distTop}px) ${makeMatrixCSS(allMatrix)}`,
+            }}></div>);
+        }
+        if (clipArea) {
+            const {
+                width: allWidth,
+                height: allHeight,
+                left: allLeft,
+                top: allTop,
+            } = getRect([pos1, pos2, pos3, pos4, ...poses]);
+            if (isPolygon || isRect || isInset) {
+                const areaPoses = isInset ? poses.slice(0, 8) : poses;
+                controls.push(<div key="clipArea" className={prefix("clip-area", "snap-control")} style={{
+                    width: `${allWidth}px`,
+                    height: `${allHeight}px`,
+                    transform: `translate(${allLeft}px, ${allTop}px)`,
+                    clipPath: `polygon(${areaPoses.map(pos => `${pos[0] - allLeft}px ${pos[1] - allTop}px`).join(", ")})`,
+                }}></div>);
+            }
+        }
+        if (snapBoundInfos) {
+            (["vertical", "horizontal"] as const).forEach(directionType => {
+                const info = snapBoundInfos[directionType];
+                const isHorizontal = directionType === "horizontal";
+
+                if (info.isSnap) {
+                    lines.push(...info.snap.posInfos.map(({ pos }, i) => {
+                        const snapPos1 = minus(calculatePosition(
+                            allMatrix, isHorizontal ? [0, pos] : [pos, 0], n), [left, top]);
+                        const snapPos2 = minus(calculatePosition(
+                            allMatrix, isHorizontal ? [width, pos] : [pos, height], n), [left, top]);
+
+                        return renderLine(
+                            React, "", snapPos1, snapPos2, zoom!,
+                            `clip${directionType}snap${i}`, "guideline");
+                    }));
+                }
+                if (info.isBound) {
+                    lines.push(...info.bounds.map(({ pos }, i) => {
+                        const snapPos1 = minus(calculatePosition(
+                            allMatrix, isHorizontal ? [0, pos] : [pos, 0], n), [left, top]);
+                        const snapPos2 = minus(calculatePosition(
+                            allMatrix, isHorizontal ? [width, pos] : [pos, height], n), [left, top]);
+
+                        return renderLine(
+                            React, "", snapPos1, snapPos2, zoom!,
+                            `clip${directionType}bounds${i}`, "guideline", "bounds", "bold");
+                    }));
+                }
+            });
+        }
+        return [
+            ...controls,
+            ...lines,
+        ];
+    },
+    dragControlCondition(moveable: any, e: any) {
+        return e.inputEvent && (e.inputEvent.target.getAttribute("class") || "").indexOf("clip") > -1;
+    },
+    dragStart(moveable: MoveableManagerInterface<ClippableProps, ClippableState>, e: any) {
+        const props = moveable.props;
+        const {
+            dragWithClip = true,
+        } = props;
+
+        if (dragWithClip) {
+            return false;
+        }
+
+        return this.dragControlStart(moveable, e);
+    },
+    drag(moveable: MoveableManagerInterface<ClippableProps, ClippableState>, e: any) {
+        return this.dragControl(moveable, { ...e, isDragTarget: true });
+    },
+    dragEnd(moveable: MoveableManagerInterface<ClippableProps, ClippableState>, e: any) {
+        return this.dragControlEnd(moveable, e);
+    },
+    dragControlStart(moveable: MoveableManagerInterface<ClippableProps, ClippableState>, e: any) {
+        const state = moveable.state;
+        const { defaultClipPath, customClipPath } = moveable.props;
+        const { target, width, height } = state;
+        const inputTarget = e.inputEvent ? e.inputEvent.target : null;
+        const className = (inputTarget && inputTarget.getAttribute("class")) || "";
+        const datas = e.datas;
+        const clipPath = getClipPath(target!, width, height, defaultClipPath || "inset", customClipPath);
+
+        if (!clipPath) {
+            return false;
+        }
+        const { clipText, type, poses } = clipPath;
+        const result = triggerEvent(moveable, "onClipStart", fillParams<OnClipStart>(moveable, e, {
+            clipType: type,
+            clipStyle: clipText,
+            poses: poses.map(pos => pos.pos),
+        }));
+
+        if (result === false) {
+            datas.isClipStart = false;
+            return false;
+        }
+        datas.isControl = className && className.indexOf("clip-control") > -1;
+        datas.isLine = className.indexOf("clip-line") > -1;
+        datas.isArea = className.indexOf("clip-area") > -1 || className.indexOf("clip-ellipse") > -1;
+        datas.clipIndex = inputTarget ? parseInt(inputTarget.getAttribute("data-clip-index"), 10) : -1;
+        datas.clipPath = clipPath;
+        datas.isClipStart = true;
+        state.clipPathState = clipText;
+        setDragStart(moveable, e);
+
+        return true;
+    },
+    dragControl(moveable: MoveableManagerInterface<ClippableProps & DraggableProps, ClippableState>, e: any) {
+        const { datas, originalDatas, isDragTarget } = e;
+
+        if (!datas.isClipStart) {
+            return false;
+        }
+        const { isControl, isLine, isArea, clipIndex, clipPath } = datas as {
+            clipPath: ReturnType<typeof getClipPath>,
+            [key: string]: any,
+        };
+        if (!clipPath) {
+            return false;
+        }
+        const props = getProps(moveable.props, "clippable");
+
+        const { keepRatio } = props;
+        let distX = 0;
+        let distY = 0;
+
+        const originalDraggable = originalDatas.draggable;
+        const originalDist = getDragDist(e);
+
+        if (isDragTarget && originalDraggable) {
+            [distX, distY] = originalDraggable.prevBeforeDist;
+        } else {
+            [distX, distY] = originalDist;
+        }
+
+        const firstDist = [distX, distY];
+
+        const state = moveable.state;
+        const { width, height } = state;
+        const isDragWithTarget = !isArea && !isControl && !isLine;
+        const {
+            type: clipType,
+            poses: clipPoses,
+            splitter,
+        } = clipPath;
+        const poses = clipPoses.map(pos => pos.pos);
+
+        if (isDragWithTarget) {
+            distX = -distX;
+            distY = -distY;
+        }
+        const isAll = !isControl || clipPoses[clipIndex].direction === "nesw";
+        const isRect = clipType === "inset" || clipType === "rect";
+        let dists = clipPoses.map(() => [0, 0]);
+
+        if (isControl && !isAll) {
+            const { horizontal, vertical } = clipPoses[clipIndex];
+            const dist = [
+                distX * abs(horizontal),
+                distY * abs(vertical),
+            ];
+            dists = moveControlPos(clipPoses, clipIndex, dist, isRect, keepRatio);
+        } else if (isAll) {
+            dists = poses.map(() => [distX, distY]);
+        }
+        const nextPoses: number[][] = poses.map((pos, i) => plus(pos, dists[i]));
+        const guidePoses = [...nextPoses];
+
+        state.snapBoundInfos = null;
+        const isCircle = clipPath.type === "circle";
+        const isEllipse = clipPath.type === "ellipse";
+
+        if (isCircle || isEllipse) {
+            const guideRect = getRect(nextPoses);
+            const ry = abs(guideRect.bottom - guideRect.top);
+            const rx = abs(isEllipse ? guideRect.right - guideRect.left : ry);
+            const bottom = nextPoses[0][1] + ry;
+            const left = nextPoses[0][0] - rx;
+            const right = nextPoses[0][0] + rx;
+
+            // right
+            if (isCircle) {
+                guidePoses.push([right, guideRect.bottom]);
+                dists.push([1, 0]);
+            }
+            // bottom
+            guidePoses.push([guideRect.left, bottom]);
+            dists.push([0, 1]);
+            // left
+            guidePoses.push([left, guideRect.bottom]);
+            dists.push([1, 0]);
+        }
+
+        const guidelines = getDefaultGuidelines(
+            (props.clipHorizontalGuidelines || []).map(v => convertUnitSize(`${v}`, height)),
+            (props.clipVerticalGuidelines || []).map(v => convertUnitSize(`${v}`, width)),
+            width!, height!,
+        );
+        let guideXPoses: number[] = [];
+        let guideYPoses: number[] = [];
+
+        if (isCircle || isEllipse) {
+            guideXPoses = [guidePoses[4][0], guidePoses[2][0]];
+            guideYPoses = [guidePoses[1][1], guidePoses[3][1]];
+        } else if (isRect) {
+            const rectPoses = [guidePoses[0], guidePoses[2], guidePoses[4], guidePoses[6]];
+            const rectDists = [dists[0], dists[2], dists[4], dists[6]];
+
+            guideXPoses = rectPoses.filter((_, i) => rectDists[i][0]).map(pos => pos[0]);
+            guideYPoses = rectPoses.filter((_, i) => rectDists[i][1]).map(pos => pos[1]);
+        } else {
+            guideXPoses = guidePoses.filter((_, i) => dists[i][0]).map(pos => pos[0]);
+            guideYPoses = guidePoses.filter((_, i) => dists[i][1]).map(pos => pos[1]);
+        }
+        const boundDelta = [0, 0];
+        const {
+            horizontal: horizontalSnapInfo,
+            vertical: verticalSnapInfo,
+        } = checkSnapBounds(
+            guidelines,
+            props.clipTargetBounds && { left: 0, top: 0, right: width, bottom: height },
+            guideXPoses,
+            guideYPoses,
+            5,
+        );
+        let snapOffsetY = horizontalSnapInfo.offset;
+        let snapOffsetX = verticalSnapInfo.offset;
+
+        if (horizontalSnapInfo.isBound) {
+            boundDelta[1] += snapOffsetY;
+        }
+        if (verticalSnapInfo.isBound) {
+            boundDelta[0] += snapOffsetX;
+        }
+        if ((isEllipse || isCircle) && dists[0][0] === 0 && dists[0][1] === 0) {
+            const guideRect = getRect(nextPoses);
+            let cy = guideRect.bottom - guideRect.top;
+            let cx = isEllipse ? guideRect.right - guideRect.left : cy;
+
+
+            const distSnapX = verticalSnapInfo.isBound
+                ? abs(snapOffsetX)
+                : (verticalSnapInfo.snapIndex === 0 ? -snapOffsetX : snapOffsetX);
+            const distSnapY = horizontalSnapInfo.isBound
+                ? abs(snapOffsetY)
+                : (horizontalSnapInfo.snapIndex === 0 ? -snapOffsetY : snapOffsetY);
+            cx -= distSnapX;
+            cy -= distSnapY;
+
+            if (isCircle) {
+                cy = checkSnapBoundPriority(verticalSnapInfo, horizontalSnapInfo) > 0 ? cy : cx;
+                cx = cy;
+            }
+            const center = guidePoses[0];
+
+            guidePoses[1][1] = center[1] - cy;
+            guidePoses[2][0] = center[0] + cx;
+            guidePoses[3][1] = center[1] + cy;
+            guidePoses[4][0] = center[0] - cx;
+        } else if (isRect && keepRatio && isControl) {
+            const [width, height] = getControlSize(clipPoses);
+            const ratio = width && height ? width / height : 0;
+            const clipPose = clipPoses[clipIndex];
+            const direction = clipPose.direction! || "";
+            let top = guidePoses[1][1];
+            let bottom = guidePoses[5][1];
+            let left = guidePoses[7][0];
+            let right = guidePoses[3][0];
+
+            if (abs(snapOffsetY) <= abs(snapOffsetX)) {
+                snapOffsetY = sign(snapOffsetY) * abs(snapOffsetX) / ratio;
+            } else {
+                snapOffsetX = sign(snapOffsetX) * abs(snapOffsetY) * ratio;
+            }
+            if (direction!.indexOf("w") > -1) {
+                left -= snapOffsetX;
+            } else if (direction!.indexOf("e") > -1) {
+                right -= snapOffsetX;
+            } else {
+                left += snapOffsetX / 2;
+                right -= snapOffsetX / 2;
+            }
+            if (direction!.indexOf("n") > -1) {
+                top -= snapOffsetY;
+            } else if (direction!.indexOf("s") > -1) {
+                bottom -= snapOffsetY;
+            } else {
+                top += snapOffsetY / 2;
+                bottom -= snapOffsetY / 2;
+            }
+            const nextControlPoses = getRectPoses(top, right, bottom, left);
+
+            guidePoses.forEach((pos, i) => {
+                [pos[0], pos[1]] = nextControlPoses[i].pos;
+            });
+        } else {
+            guidePoses.forEach((pos, j) => {
+                const dist = dists[j];
+
+                if (dist[0]) {
+                    pos[0] -= snapOffsetX;
+                }
+                if (dist[1]) {
+                    pos[1] -= snapOffsetY;
+                }
+            });
+        }
+        const nextClipStyles = getClipStyles(moveable, clipPath, nextPoses)!;
+        const clipStyle = `${clipType}(${nextClipStyles.join(splitter)})`;
+
+        state.clipPathState = clipStyle;
+
+        if (isCircle || isEllipse) {
+            guideXPoses = [guidePoses[4][0], guidePoses[2][0]];
+            guideYPoses = [guidePoses[1][1], guidePoses[3][1]];
+        } else if (isRect) {
+            const rectPoses = [guidePoses[0], guidePoses[2], guidePoses[4], guidePoses[6]];
+
+            guideXPoses = rectPoses.map(pos => pos[0]);
+            guideYPoses = rectPoses.map(pos => pos[1]);
+        } else {
+            guideXPoses = guidePoses.map(pos => pos[0]);
+            guideYPoses = guidePoses.map(pos => pos[1]);
+        }
+        state.snapBoundInfos = checkSnapBounds(
+            guidelines,
+            props.clipTargetBounds && { left: 0, top: 0, right: width, bottom: height },
+            guideXPoses,
+            guideYPoses,
+            1,
+        );
+
+        if (originalDraggable) {
+            const {
+                is3d,
+                allMatrix,
+            } = state;
+            const n = is3d ? 4 : 3;
+
+            let dragDist = boundDelta;
+
+            if (isDragTarget) {
+                dragDist = [
+                    firstDist[0] + boundDelta[0] - originalDist[0],
+                    firstDist[1] + boundDelta[1] - originalDist[1],
+                ];
+            }
+            originalDraggable.deltaOffset = multiply(allMatrix, [dragDist[0], dragDist[1], 0, 0], n);
+        }
+        triggerEvent(moveable, "onClip", fillParams<OnClip>(moveable, e, {
+            clipEventType: "changed",
+            clipType,
+            poses: nextPoses,
+            clipStyle,
+            clipStyles: nextClipStyles,
+            distX,
+            distY,
+            ...fillCSSObject({
+                [clipType === "rect" ? "clip" : "clipPath"]: clipStyle,
+            }, e),
+        }));
+
+        return true;
+    },
+    dragControlEnd(moveable: MoveableManagerInterface<ClippableProps, ClippableState>, e: any) {
+        this.unset(moveable);
+        const { isDrag, datas, isDouble } = e;
+        const { isLine, isClipStart, isControl } = datas;
+
+        if (!isClipStart) {
+            return false;
+        }
+        triggerEvent(moveable, "onClipEnd", fillEndParams<OnClipEnd>(moveable, e, {}));
+        if (isDouble) {
+            if (isControl) {
+                removeClipPath(moveable, e);
+            } else if (isLine) {
+                // add
+                addClipPath(moveable, e);
+            }
+        }
+        return isDouble || isDrag;
+    },
+    unset(moveable: MoveableManagerInterface<ClippableProps, ClippableState>) {
+        moveable.state.clipPathState = "";
+        moveable.state.snapBoundInfos = null;
+    },
+};
+
+/**
+ * Whether to clip the target. (default: false)
+ * @name Moveable.Clippable#clippable
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     clippable: true,
+ *     defaultClipPath: "inset",
+ *     customClipPath: "",
+ *     clipRelative: false,
+ *     clipArea: false,
+ *     dragWithClip: true,
+ * });
+ * moveable.on("clipStart", e => {
+ *     console.log(e);
+ * }).on("clip", e => {
+ *     if (e.clipType === "rect") {
+ *         e.target.style.clip = e.clipStyle;
+ *     } else {
+ *         e.target.style.clipPath = e.clipStyle;
+ *     }
+ * }).on("clipEnd", e => {
+ *     console.log(e);
+ * });
+ */
+/**
+ *  If clippath is not set, the default value can be set. (defaultClipPath < style < customClipPath < dragging clipPath)
+ * @name Moveable.Clippable#defaultClipPath
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     clippable: true,
+ *     defaultClipPath: "inset",
+ *     customClipPath: "",
+ *     clipRelative: false,
+ *     clipArea: false,
+ *     dragWithClip: true,
+ * });
+ * moveable.on("clipStart", e => {
+ *     console.log(e);
+ * }).on("clip", e => {
+ *     if (e.clipType === "rect") {
+ *         e.target.style.clip = e.clipStyle;
+ *     } else {
+ *         e.target.style.clipPath = e.clipStyle;
+ *     }
+ * }).on("clipEnd", e => {
+ *     console.log(e);
+ * });
+ */
+
+/**
+ * % Can be used instead of the absolute px (`rect` not possible) (default: false)
+ * @name Moveable.Clippable#clipRelative
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     clippable: true,
+ *     defaultClipPath: "inset",
+ *     customClipPath: "",
+ *     clipRelative: false,
+ *     clipArea: false,
+ *     dragWithClip: true,
+ * });
+ * moveable.on("clipStart", e => {
+ *     console.log(e);
+ * }).on("clip", e => {
+ *     if (e.clipType === "rect") {
+ *         e.target.style.clip = e.clipStyle;
+ *     } else {
+ *         e.target.style.clipPath = e.clipStyle;
+ *     }
+ * }).on("clipEnd", e => {
+ *     console.log(e);
+ * });
+ */
+
+/**
+ * You can force the custom clipPath. (defaultClipPath < style < customClipPath < dragging clipPath)
+ * @name Moveable.Clippable#customClipPath
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     clippable: true,
+ *     defaultClipPath: "inset",
+ *     customClipPath: "",
+ *     clipRelative: false,
+ *     clipArea: false,
+ *     dragWithClip: true,
+ * });
+ * moveable.on("clipStart", e => {
+ *     console.log(e);
+ * }).on("clip", e => {
+ *     if (e.clipType === "rect") {
+ *         e.target.style.clip = e.clipStyle;
+ *     } else {
+ *         e.target.style.clipPath = e.clipStyle;
+ *     }
+ * }).on("clipEnd", e => {
+ *     console.log(e);
+ * });
+ */
+
+/**
+ * When dragging the target, the clip also moves. (default: true)
+ * @name Moveable.Clippable#dragWithClip
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     clippable: true,
+ *     defaultClipPath: "inset",
+ *     customClipPath: "",
+ *     clipRelative: false,
+ *     clipArea: false,
+ *     dragWithClip: true,
+ * });
+ * moveable.on("clipStart", e => {
+ *     console.log(e);
+ * }).on("clip", e => {
+ *     if (e.clipType === "rect") {
+ *         e.target.style.clip = e.clipStyle;
+ *     } else {
+ *         e.target.style.clipPath = e.clipStyle;
+ *     }
+ * }).on("clipEnd", e => {
+ *     console.log(e);
+ * });
+ */
+
+/**
+ * You can drag the clip by setting clipArea.
+ * @name Moveable.Clippable#clipArea
+ * @default false
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     clippable: true,
+ *     defaultClipPath: "inset",
+ *     customClipPath: "",
+ *     clipRelative: false,
+ *     clipArea: false,
+ *     dragWithClip: true,
+ * });
+ * moveable.on("clipStart", e => {
+ *     console.log(e);
+ * }).on("clip", e => {
+ *     if (e.clipType === "rect") {
+ *         e.target.style.clip = e.clipStyle;
+ *     } else {
+ *         e.target.style.clipPath = e.clipStyle;
+ *     }
+ * }).on("clipEnd", e => {
+ *     console.log(e);
+ * });
+ */
+
+/**
+* Whether the clip is bound to the target.
+* @name Moveable.Clippable#clipTargetBounds
+* @default false
+* @example
+* import Moveable from "moveable";
+*
+* const moveable = new Moveable(document.body, {
+*     clippable: true,
+*     defaultClipPath: "inset",
+*     customClipPath: "",
+*     clipRelative: false,
+*     clipArea: false,
+*     dragWithClip: true,
+*     clipTargetBounds: true,
+* });
+* moveable.on("clipStart", e => {
+*     console.log(e);
+* }).on("clip", e => {
+*     if (e.clipType === "rect") {
+*         e.target.style.clip = e.clipStyle;
+*     } else {
+*         e.target.style.clipPath = e.clipStyle;
+*     }
+* }).on("clipEnd", e => {
+*     console.log(e);
+* });
+*/
+
+/**
+ * Add clip guidelines in the vertical direction.
+ * @name Moveable.Clippable#clipVerticalGuidelines
+ * @default 0
+ * @example
+* import Moveable from "moveable";
+*
+* const moveable = new Moveable(document.body, {
+*     clippable: true,
+*     defaultClipPath: "inset",
+*     customClipPath: "",
+*     clipRelative: false,
+*     clipArea: false,
+*     dragWithClip: true,
+*     clipVerticalGuidelines: [0, 100, 200],
+*     clipHorizontalGuidelines: [0, 100, 200],
+*     clipSnapThreshold: 5,
+* });
+*/
+
+/**
+* Add clip guidelines in the horizontal direction.
+* @name Moveable.Clippable#clipHorizontalGuidelines
+* @default []
+* @example
+* import Moveable from "moveable";
+*
+* const moveable = new Moveable(document.body, {
+*     clippable: true,
+*     defaultClipPath: "inset",
+*     customClipPath: "",
+*     clipRelative: false,
+*     clipArea: false,
+*     dragWithClip: true,
+*     clipVerticalGuidelines: [0, 100, 200],
+*     clipHorizontalGuidelines: [0, 100, 200],
+*     clipSnapThreshold: 5,
+* });
+*/
+/**
+* istance value that can snap to clip guidelines.
+* @name Moveable.Clippable#clipSnapThreshold
+* @default 5
+* @example
+* import Moveable from "moveable";
+*
+* const moveable = new Moveable(document.body, {
+*     clippable: true,
+*     defaultClipPath: "inset",
+*     customClipPath: "",
+*     clipRelative: false,
+*     clipArea: false,
+*     dragWithClip: true,
+*     clipVerticalGuidelines: [0, 100, 200],
+*     clipHorizontalGuidelines: [0, 100, 200],
+*     clipSnapThreshold: 5,
+* });
+*/
+/**
+ * When drag start the clip area or controls, the `clipStart` event is called.
+ * @memberof Moveable.Clippable
+ * @event clipStart
+ * @param {Moveable.Clippable.OnClipStart} - Parameters for the `clipStart` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     clippable: true,
+ *     defaultClipPath: "inset",
+ *     customClipPath: "",
+ *     clipRelative: false,
+ *     clipArea: false,
+ *     dragWithClip: true,
+ * });
+ * moveable.on("clipStart", e => {
+ *     console.log(e);
+ * }).on("clip", e => {
+ *     if (e.clipType === "rect") {
+ *         e.target.style.clip = e.clipStyle;
+ *     } else {
+ *         e.target.style.clipPath = e.clipStyle;
+ *     }
+ * }).on("clipEnd", e => {
+ *     console.log(e);
+ * });
+ */
+/**
+ * When drag the clip area or controls, the `clip` event is called.
+ * @memberof Moveable.Clippable
+ * @event clip
+ * @param {Moveable.Clippable.OnClip} - Parameters for the `clip` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     clippable: true,
+ *     defaultClipPath: "inset",
+ *     customClipPath: "",
+ *     clipRelative: false,
+ *     clipArea: false,
+ *     dragWithClip: true,
+ * });
+ * moveable.on("clipStart", e => {
+ *     console.log(e);
+ * }).on("clip", e => {
+ *     if (e.clipType === "rect") {
+ *         e.target.style.clip = e.clipStyle;
+ *     } else {
+ *         e.target.style.clipPath = e.clipStyle;
+ *     }
+ * }).on("clipEnd", e => {
+ *     console.log(e);
+ * });
+ */
+/**
+ * When drag end the clip area or controls, the `clipEnd` event is called.
+ * @memberof Moveable.Clippable
+ * @event clipEnd
+ * @param {Moveable.Clippable.OnClipEnd} - Parameters for the `clipEnd` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     clippable: true,
+ *     defaultClipPath: "inset",
+ *     customClipPath: "",
+ *     clipRelative: false,
+ *     clipArea: false,
+ *     dragWithClip: true,
+ * });
+ * moveable.on("clipStart", e => {
+ *     console.log(e);
+ * }).on("clip", e => {
+ *     if (e.clipType === "rect") {
+ *         e.target.style.clip = e.clipStyle;
+ *     } else {
+ *         e.target.style.clipPath = e.clipStyle;
+ *     }
+ * }).on("clipEnd", e => {
+ *     console.log(e);
+ * });
+ */
+
+
+
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + diff --git a/release/0.52.0/doc/packages_react-moveable_src_ables_DragArea.tsx.html b/release/0.52.0/doc/packages_react-moveable_src_ables_DragArea.tsx.html new file mode 100644 index 000000000..e71b0f927 --- /dev/null +++ b/release/0.52.0/doc/packages_react-moveable_src_ables_DragArea.tsx.html @@ -0,0 +1,265 @@ + + + + + packages/react-moveable/src/ables/DragArea.tsx - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

packages/react-moveable/src/ables/DragArea.tsx

+ + + + + + + +
+
+
import {
+    createWarpMatrix,
+} from "@scena/matrix";
+import { ref } from "framework-utils";
+import { getRect, calculateInversePosition, makeMatrixCSS, prefix } from "../utils";
+import {
+    Renderer, GroupableProps, DragAreaProps, MoveableManagerInterface, MoveableGroupInterface,
+} from "../types";
+import { AREA_PIECE, AVOID, AREA_PIECES } from "../classNames";
+import { addClass, removeClass, requestAnimationFrame } from "@daybrush/utils";
+
+function restoreStyle(moveable: MoveableManagerInterface) {
+    const el = moveable.areaElement;
+
+    if (!el) {
+        return;
+    }
+    const { width, height } = moveable.state;
+
+    removeClass(el, AVOID);
+
+    el.style.cssText += `left: 0px; top: 0px; width: ${width}px; height: ${height}px`;
+}
+
+function renderPieces(React: Renderer): any {
+    return (<div key="area_pieces" className={AREA_PIECES}>
+        <div className={AREA_PIECE}></div>
+        <div className={AREA_PIECE}></div>
+        <div className={AREA_PIECE}></div>
+        <div className={AREA_PIECE}></div>
+    </div>);
+}
+export default {
+    name: "dragArea",
+    props: [
+        "dragArea",
+        "passDragArea",
+    ] as const,
+    events: [
+        "click",
+        "clickGroup",
+    ] as const,
+    render(moveable: MoveableManagerInterface<GroupableProps>, React: Renderer): any[] {
+        const { target, dragArea, groupable, passDragArea } = moveable.props;
+        const { width, height, renderPoses } = moveable.getState();
+
+        const className = passDragArea ? prefix("area", "pass") : prefix("area");
+        if (groupable) {
+            return [
+                <div key="area" ref={ref(moveable, "areaElement")} className={className}></div>,
+                renderPieces(React),
+            ];
+        }
+        if (!target || !dragArea) {
+            return [];
+        }
+        const h = createWarpMatrix(
+            [0, 0],
+            [width, 0],
+            [0, height],
+            [width, height],
+            renderPoses[0],
+            renderPoses[1],
+            renderPoses[2],
+            renderPoses[3],
+        );
+        const transform = h.length ? makeMatrixCSS(h, true) : "none";
+
+        return [
+            <div key="area" ref={ref(moveable, "areaElement")} className={className} style={{
+                top: "0px",
+                left: "0px",
+                width: `${width}px`,
+                height: `${height}px`,
+                transformOrigin: "0 0",
+                transform,
+            }}></div>,
+            renderPieces(React),
+        ];
+    },
+    dragStart(moveable: MoveableManagerInterface, { datas, clientX, clientY, inputEvent }: any) {
+        if (!inputEvent) {
+            return false;
+        }
+        datas.isDragArea = false;
+        const areaElement = moveable.areaElement;
+        const state = moveable.state;
+        const {
+            moveableClientRect,
+            renderPoses,
+            rootMatrix,
+            is3d,
+        } = state;
+        const { left, top } = moveableClientRect;
+        const {
+            left: relativeLeft,
+            top: relativeTop,
+            width,
+            height,
+        } = getRect(renderPoses);
+        const n = is3d ? 4 : 3;
+        let [posX, posY] = calculateInversePosition(rootMatrix, [clientX - left, clientY - top], n);
+
+        posX -= relativeLeft;
+        posY -= relativeTop;
+        const rects = [
+            { left: relativeLeft, top: relativeTop, width, height: posY - 10 },
+            { left: relativeLeft, top: relativeTop, width: posX - 10, height },
+            { left: relativeLeft, top: relativeTop + posY + 10, width, height: height - posY - 10 },
+            { left: relativeLeft + posX + 10, top: relativeTop, width: width - posX - 10, height },
+        ];
+
+        const children = [].slice.call(areaElement.nextElementSibling!.children) as HTMLElement[];
+        rects.forEach((rect, i) => {
+            children[i].style.cssText
+                = `left: ${rect.left}px;top: ${rect.top}px; width: ${rect.width}px; height: ${rect.height}px;`;
+        });
+        addClass(areaElement, AVOID);
+        state.disableNativeEvent = true;
+        return;
+    },
+    drag(moveable: MoveableManagerInterface, { datas, inputEvent }: any) {
+        this.enableNativeEvent(moveable);
+        if (!inputEvent) {
+            return false;
+        }
+        if (!datas.isDragArea) {
+            datas.isDragArea = true;
+            restoreStyle(moveable);
+        }
+    },
+    dragEnd(moveable: MoveableManagerInterface<DragAreaProps>, e: any) {
+        this.enableNativeEvent(moveable);
+        const { inputEvent, datas } = e;
+        if (!inputEvent) {
+            return false;
+        }
+        if (!datas.isDragArea) {
+            restoreStyle(moveable);
+        }
+    },
+    dragGroupStart(moveable: MoveableGroupInterface, e: any) {
+        return this.dragStart(moveable, e);
+    },
+    dragGroup(moveable: MoveableGroupInterface, e: any) {
+        return this.drag(moveable, e);
+    },
+    dragGroupEnd(
+        moveable: MoveableGroupInterface<DragAreaProps>,
+        e: any,
+    ) {
+        return this.dragEnd(moveable, e);
+    },
+    unset(moveable: MoveableManagerInterface<DragAreaProps>) {
+        restoreStyle(moveable);
+        moveable.state.disableNativeEvent = false;
+    },
+    enableNativeEvent(moveable: MoveableManagerInterface<DragAreaProps>) {
+        const state = moveable.state;
+        if (state.disableNativeEvent) {
+            requestAnimationFrame(() => {
+                state.disableNativeEvent = false;
+            });
+        }
+    },
+};
+
+/**
+ * Add an event to the moveable area instead of the target for stopPropagation. (default: false, true in group)
+ * @name Moveable#dragArea
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *  dragArea: false,
+ * });
+ */
+/**
+ * Set `pointerEvents: none;` css to pass events in dragArea. (default: false)
+ * @name Moveable#passDragArea
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *  dragArea: false,
+ * });
+ */
+
+
+
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + diff --git a/release/0.52.0/doc/packages_react-moveable_src_ables_Draggable.tsx.html b/release/0.52.0/doc/packages_react-moveable_src_ables_Draggable.tsx.html new file mode 100644 index 000000000..f49d88979 --- /dev/null +++ b/release/0.52.0/doc/packages_react-moveable_src_ables_Draggable.tsx.html @@ -0,0 +1,681 @@ + + + + + packages/react-moveable/src/ables/Draggable.tsx - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

packages/react-moveable/src/ables/Draggable.tsx

+ + + + + + + +
+
+
import {
+    setDragStart, getBeforeDragDist, getTransformDist,
+    convertTransformFormat, resolveTransformEvent, fillTransformStartEvent,
+    setDefaultTransformIndex, fillOriginalTransform,
+} from "../gesto/GestoUtils";
+import {
+    triggerEvent, fillParams,
+    getDistSize, prefix,
+    fillEndParams,
+    fillCSSObject,
+} from "../utils";
+import { minus, plus } from "@scena/matrix";
+import {
+    DraggableProps, OnDrag, OnDragGroup,
+    OnDragGroupStart, OnDragStart, OnDragEnd, DraggableState,
+    Renderer, OnDragGroupEnd, MoveableManagerInterface, MoveableGroupInterface,
+} from "../types";
+import { triggerChildGesto } from "../groupUtils";
+import { startCheckSnapDrag } from "./Snappable";
+import { getRad, throttle, throttleArray } from "@daybrush/utils";
+import { checkSnapBoundsDrag } from "./snappable/snapBounds";
+import { TINY_NUM } from "../consts";
+
+/**
+ * @namespace Draggable
+ * @memberof Moveable
+ * @description Draggable refers to the ability to drag and move targets.
+ */
+export default {
+    name: "draggable",
+    props: [
+        "draggable",
+        "throttleDrag",
+        "throttleDragRotate",
+        "hideThrottleDragRotateLine",
+        "startDragRotate",
+        "edgeDraggable",
+    ] as const,
+    events: [
+        "dragStart",
+        "drag",
+        "dragEnd",
+        "dragGroupStart",
+        "dragGroup",
+        "dragGroupEnd",
+    ] as const,
+    requestStyle(): string[] {
+        return ["left", "top", "right", "bottom"];
+    },
+    requestChildStyle(): string[] {
+        return ["left", "top", "right", "bottom"];
+    },
+    render(
+        moveable: MoveableManagerInterface<DraggableProps, DraggableState>,
+        React: Renderer,
+    ): any[] {
+        const { hideThrottleDragRotateLine, throttleDragRotate, zoom } = moveable.props;
+        const { dragInfo, beforeOrigin } = moveable.getState();
+
+        if (hideThrottleDragRotateLine || !throttleDragRotate || !dragInfo) {
+            return [];
+        }
+        const dist = dragInfo.dist;
+
+        if (!dist[0] && !dist[1]) {
+            return [];
+        }
+
+        const width = getDistSize(dist);
+        const rad = getRad(dist, [0, 0]);
+
+        return [<div className={prefix(
+            "line",
+            "horizontal",
+            "dragline",
+            "dashed",
+        )} key={`dragRotateGuideline`} style={{
+            width: `${width}px`,
+            transform: `translate(${beforeOrigin[0]}px, ${beforeOrigin[1]}px) rotate(${rad}rad) scaleY(${zoom})`,
+        }} />];
+    },
+    dragStart(
+        moveable: MoveableManagerInterface<DraggableProps, any>,
+        e: any,
+    ) {
+        const { datas, parentEvent, parentGesto } = e;
+        const state = moveable.state;
+        const {
+            gestos,
+            style,
+        } = state;
+
+        if (gestos.draggable) {
+            return false;
+        }
+        gestos.draggable = parentGesto || moveable.targetGesto;
+
+        datas.datas = {};
+        datas.left = parseFloat(style.left || "") || 0;
+        datas.top = parseFloat(style.top || "") || 0;
+        datas.bottom = parseFloat(style.bottom || "") || 0;
+        datas.right = parseFloat(style.right || "") || 0;
+        datas.startValue = [0, 0];
+
+        setDragStart(moveable, e);
+        setDefaultTransformIndex(moveable, e, "translate");
+        startCheckSnapDrag(moveable, datas);
+
+        datas.prevDist = [0, 0];
+        datas.prevBeforeDist = [0, 0];
+        datas.isDrag = false;
+        datas.deltaOffset = [0, 0];
+
+        const params = fillParams<OnDragStart>(moveable, e, {
+            set: (translate: number[]) => {
+                datas.startValue = translate;
+            },
+            ...fillTransformStartEvent(moveable, e),
+        });
+        const result = parentEvent || triggerEvent(moveable, "onDragStart", params);
+
+        if (result !== false) {
+            datas.isDrag = true;
+            moveable.state.dragInfo = {
+                startRect: moveable.getRect(),
+                dist: [0, 0],
+            };
+        } else {
+            gestos.draggable = null;
+            datas.isPinch = false;
+        }
+        return datas.isDrag ? params : false;
+    },
+    drag(
+        moveable: MoveableManagerInterface<DraggableProps, any>,
+        e: any,
+    ): OnDrag | undefined {
+        if (!e) {
+            return;
+        }
+        resolveTransformEvent(moveable, e, "translate");
+
+        const {
+            datas, parentEvent,
+            parentFlag, isPinch, deltaOffset,
+            useSnap,
+            isRequest,
+            isGroup,
+            parentThrottleDrag,
+        } = e;
+        let { distX, distY } = e;
+        const { isDrag, prevDist, prevBeforeDist, startValue } = datas;
+
+        if (!isDrag) {
+            return;
+        }
+
+        if (deltaOffset) {
+            distX += deltaOffset[0];
+            distY += deltaOffset[1];
+        }
+        const props = moveable.props;
+
+        const parentMoveable = props.parentMoveable;
+        const throttleDrag = isGroup ? 0 : (props.throttleDrag || parentThrottleDrag || 0);
+        const throttleDragRotate = parentEvent ? 0 : (props.throttleDragRotate || 0);
+
+        let dragRotateRad = 0;
+        let isVerticalSnap = false;
+        let isVerticalBound = false;
+        let isHorizontalSnap = false;
+        let isHorizontalBound = false;
+
+        if (!parentEvent && throttleDragRotate > 0 && (distX || distY)) {
+            const startDragRotate = props.startDragRotate || 0;
+            const deg
+                = throttle(startDragRotate + getRad([0, 0], [distX, distY]) * 180 / Math.PI, throttleDragRotate)
+                - startDragRotate;
+            const ry = distY * Math.abs(Math.cos((deg - 90) / 180 * Math.PI));
+            const rx = distX * Math.abs(Math.cos(deg / 180 * Math.PI));
+            const r = getDistSize([rx, ry]);
+            dragRotateRad = deg * Math.PI / 180;
+
+            distX = r * Math.cos(dragRotateRad);
+            distY = r * Math.sin(dragRotateRad);
+        }
+
+        if (!isPinch && !parentEvent && !parentFlag) {
+            const [verticalInfo, horizontalInfo] = checkSnapBoundsDrag(
+                moveable, distX, distY,
+                throttleDragRotate,
+                (!useSnap && isRequest) || deltaOffset,
+                datas,
+            );
+            isVerticalSnap = verticalInfo.isSnap;
+            isVerticalBound = verticalInfo.isBound;
+            isHorizontalSnap = horizontalInfo.isSnap;
+            isHorizontalBound = horizontalInfo.isBound;
+
+            const verticalOffset = verticalInfo.offset;
+            const horizontalOffset = horizontalInfo.offset;
+
+            distX += verticalOffset;
+            distY += horizontalOffset;
+        }
+
+        const beforeTranslate = plus(getBeforeDragDist({ datas, distX, distY }), startValue);
+        const translate = plus(getTransformDist({ datas, distX, distY }), startValue);
+
+        throttleArray(translate, TINY_NUM);
+        throttleArray(beforeTranslate, TINY_NUM);
+
+        if (!throttleDragRotate) {
+            if (!isVerticalSnap && !isVerticalBound) {
+                translate[0] = throttle(translate[0], throttleDrag);
+                beforeTranslate[0] = throttle(beforeTranslate[0], throttleDrag);
+            }
+            if (!isHorizontalSnap && !isHorizontalBound) {
+                translate[1] = throttle(translate[1], throttleDrag);
+                beforeTranslate[1] = throttle(beforeTranslate[1], throttleDrag);
+            }
+        }
+
+
+        const beforeDist = minus(beforeTranslate, startValue);
+        const dist = minus(translate, startValue);
+        const delta = minus(dist, prevDist);
+        const beforeDelta = minus(beforeDist, prevBeforeDist);
+
+        datas.prevDist = dist;
+        datas.prevBeforeDist = beforeDist;
+
+
+        datas.passDelta = delta; //distX - (datas.passDistX || 0);
+        // datas.passDeltaY = distY - (datas.passDistY || 0);
+        datas.passDist = dist; //distX;
+        // datas.passDistY = distY;
+
+        const left = datas.left + beforeDist[0];
+        const top = datas.top + beforeDist[1];
+        const right = datas.right - beforeDist[0];
+        const bottom = datas.bottom - beforeDist[1];
+        const nextTransform = convertTransformFormat(datas,
+            `translate(${translate[0]}px, ${translate[1]}px)`, `translate(${dist[0]}px, ${dist[1]}px)`);
+
+        fillOriginalTransform(e, nextTransform);
+
+        moveable.state.dragInfo.dist = parentEvent ? [0, 0] : dist;
+        if (!parentEvent && !parentMoveable && delta.every(num => !num) && beforeDelta.some(num => !num)) {
+            return;
+        }
+
+        const {
+            width,
+            height,
+        } = moveable.state;
+        const params = fillParams<OnDrag>(moveable, e, {
+            transform: nextTransform,
+            dist,
+            delta,
+            translate,
+            beforeDist,
+            beforeDelta,
+            beforeTranslate,
+            left,
+            top,
+            right,
+            bottom,
+            width,
+            height,
+            isPinch,
+            ...fillCSSObject({
+                transform: nextTransform,
+            }, e),
+        });
+
+        !parentEvent && triggerEvent(moveable, "onDrag", params);
+        return params;
+    },
+    dragAfter(
+        moveable: MoveableManagerInterface<DraggableProps, DraggableState>,
+        e: any,
+    ) {
+        const datas = e.datas;
+        const {
+            deltaOffset,
+        } = datas;
+
+        if (deltaOffset[0] || deltaOffset[1]) {
+            datas.deltaOffset = [0, 0];
+            return this.drag(moveable, {...e, deltaOffset });
+        }
+        return false;
+    },
+    dragEnd(
+        moveable: MoveableManagerInterface<DraggableProps, DraggableState>,
+        e: any,
+    ) {
+        const { parentEvent, datas } = e;
+
+        moveable.state.dragInfo = null;
+        if (!datas.isDrag) {
+            return;
+        }
+        datas.isDrag = false;
+        const param = fillEndParams<OnDragEnd>(moveable, e, {});
+        !parentEvent && triggerEvent(moveable, "onDragEnd", param);
+        return param;
+    },
+    dragGroupStart(moveable: MoveableGroupInterface<any, any>, e: any) {
+        const { datas, clientX, clientY } = e;
+
+        const params = this.dragStart(moveable, e);
+
+        if (!params) {
+            return false;
+        }
+        const {
+            childEvents,
+            eventParams,
+        } = triggerChildGesto(moveable, this, "dragStart", [
+            clientX || 0,
+            clientY || 0,
+        ], e, false, "draggable");
+
+        const nextParams: OnDragGroupStart = {
+            ...params,
+            targets: moveable.props.targets!,
+            events: eventParams,
+        };
+        const result = triggerEvent(moveable, "onDragGroupStart", nextParams);
+
+        datas.isDrag = result !== false;
+
+
+        // find data.startValue and based on first child moveable
+        const startValue = childEvents[0]?.datas.startValue ?? [0, 0];
+
+
+        datas.throttleOffset = [startValue[0] % 1, startValue[1] % 1];
+
+        return datas.isDrag ? params : false;
+    },
+    dragGroup(moveable: MoveableGroupInterface<any, any>, e: any) {
+        const { datas } = e;
+
+        if (!datas.isDrag) {
+            return;
+        }
+        const params = this.drag(moveable, {
+            ...e,
+            parentThrottleDrag: moveable.props.throttleDrag,
+        });
+        const { passDelta } = e.datas;
+        const {
+            eventParams,
+        } = triggerChildGesto(moveable, this, "drag", passDelta, e, false, "draggable");
+
+        if (!params) {
+            return;
+        }
+
+        const nextParams: OnDragGroup = {
+            targets: moveable.props.targets!,
+            events: eventParams,
+            ...params,
+        };
+
+        triggerEvent(moveable, "onDragGroup", nextParams);
+        return nextParams;
+    },
+    dragGroupEnd(moveable: MoveableGroupInterface<any, any>, e: any) {
+        const { isDrag, datas } = e;
+
+        if (!datas.isDrag) {
+            return;
+        }
+        this.dragEnd(moveable, e);
+        const {
+            eventParams,
+        } = triggerChildGesto(moveable, this, "dragEnd", [0, 0], e, false, "draggable");
+        triggerEvent(moveable, "onDragGroupEnd", fillEndParams<OnDragGroupEnd>(moveable, e, {
+            targets: moveable.props.targets!,
+            events: eventParams,
+        }));
+
+        return isDrag;
+    },
+    /**
+     * @method Moveable.Draggable#request
+     * @param {object} [e] - the draggable's request parameter
+     * @param {number} [e.x] - x position
+     * @param {number} [e.y] - y position
+     * @param {number} [e.deltaX] - X number to move
+     * @param {number} [e.deltaY] - Y number to move
+     * @return {Moveable.Requester} Moveable Requester
+     * @example
+
+     * // Instantly Request (requestStart - request - requestEnd)
+     * // Use Relative Value
+     * moveable.request("draggable", { deltaX: 10, deltaY: 10 }, true);
+     * // Use Absolute Value
+     * moveable.request("draggable", { x: 200, y: 100 }, true);
+     *
+     * // requestStart
+     * const requester = moveable.request("draggable");
+     *
+     * // request
+     * // Use Relative Value
+     * requester.request({ deltaX: 10, deltaY: 10 });
+     * requester.request({ deltaX: 10, deltaY: 10 });
+     * requester.request({ deltaX: 10, deltaY: 10 });
+     * // Use Absolute Value
+     * moveable.request("draggable", { x: 200, y: 100 });
+     * moveable.request("draggable", { x: 220, y: 100 });
+     * moveable.request("draggable", { x: 240, y: 100 });
+     *
+     * // requestEnd
+     * requester.requestEnd();
+     */
+    request(moveable: MoveableManagerInterface<any, any>) {
+        const datas = {};
+        const rect = moveable.getRect();
+        let distX = 0;
+        let distY = 0;
+        let useSnap = false;
+
+        return {
+            isControl: false,
+            requestStart(e: Record<string, any>) {
+                useSnap = e.useSnap;
+                return { datas, useSnap };
+            },
+            request(e: Record<string, any>) {
+                if ("x" in e) {
+                    distX = e.x - rect.left;
+                } else if ("deltaX" in e) {
+                    distX += e.deltaX;
+                }
+                if ("y" in e) {
+                    distY = e.y - rect.top;
+                } else if ("deltaY" in e) {
+                    distY += e.deltaY;
+                }
+
+                return { datas, distX, distY, useSnap };
+            },
+            requestEnd() {
+                return { datas, isDrag: true, useSnap };
+            },
+        };
+    },
+    unset(moveable: MoveableManagerInterface<any, Record<string, any>>) {
+        moveable.state.gestos.draggable = null;
+        moveable.state.dragInfo = null;
+    },
+};
+
+/**
+ * Whether or not target can be dragged. (default: false)
+ * @name Moveable.Draggable#draggable
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body);
+ *
+ * moveable.draggable = true;
+ */
+
+/**
+ * throttle of x, y when drag.
+ * @name Moveable.Draggable#throttleDrag
+ * @default 0
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body);
+ *
+ * moveable.throttleDrag = 1;
+ */
+
+/**
+* throttle of angle of x, y when drag.
+* @name Moveable.Draggable#throttleDragRotate
+* @example
+* import Moveable from "moveable";
+*
+* const moveable = new Moveable(document.body);
+*
+* moveable.throttleDragRotate = 45;
+*/
+
+/**
+* start angle of throttleDragRotate of x, y when drag.
+* @name Moveable.Draggable#startDragRotate
+* @example
+* import Moveable from "moveable";
+*
+* const moveable = new Moveable(document.body);
+*
+* // 45, 135, 225, 315
+* moveable.throttleDragRotate = 90;
+* moveable.startDragRotate = 45;
+*/
+
+/**
+ * When the drag starts, the dragStart event is called.
+ * @memberof Moveable.Draggable
+ * @event dragStart
+ * @param {Moveable.Draggable.OnDragStart} - Parameters for the dragStart event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, { draggable: true });
+ * moveable.on("dragStart", ({ target }) => {
+ *     console.log(target);
+ * });
+ */
+/**
+ * When dragging, the drag event is called.
+ * @memberof Moveable.Draggable
+ * @event drag
+ * @param {Moveable.Draggable.OnDrag} - Parameters for the drag event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, { draggable: true });
+ * moveable.on("drag", ({ target, transform }) => {
+ *     target.style.transform = transform;
+ * });
+ */
+/**
+ * When the drag finishes, the dragEnd event is called.
+ * @memberof Moveable.Draggable
+ * @event dragEnd
+ * @param {Moveable.Draggable.OnDragEnd} - Parameters for the dragEnd event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, { draggable: true });
+ * moveable.on("dragEnd", ({ target, isDrag }) => {
+ *     console.log(target, isDrag);
+ * });
+ */
+
+/**
+* When the group drag starts, the `dragGroupStart` event is called.
+* @memberof Moveable.Draggable
+* @event dragGroupStart
+* @param {Moveable.Draggable.OnDragGroupStart} - Parameters for the `dragGroupStart` event
+* @example
+* import Moveable from "moveable";
+*
+* const moveable = new Moveable(document.body, {
+*     target: [].slice.call(document.querySelectorAll(".target")),
+*     draggable: true
+* });
+* moveable.on("dragGroupStart", ({ targets }) => {
+*     console.log("onDragGroupStart", targets);
+* });
+*/
+
+/**
+* When the group drag, the `dragGroup` event is called.
+* @memberof Moveable.Draggable
+* @event dragGroup
+* @param {Moveable.Draggable.OnDragGroup} - Parameters for the `dragGroup` event
+* @example
+* import Moveable from "moveable";
+*
+* const moveable = new Moveable(document.body, {
+*     target: [].slice.call(document.querySelectorAll(".target")),
+*     draggable: true
+* });
+* moveable.on("dragGroup", ({ targets, events }) => {
+*     console.log("onDragGroup", targets);
+*     events.forEach(ev => {
+*          // drag event
+*          console.log("onDrag left, top", ev.left, ev.top);
+*          // ev.target!.style.left = `${ev.left}px`;
+*          // ev.target!.style.top = `${ev.top}px`;
+*          console.log("onDrag translate", ev.dist);
+*          ev.target!.style.transform = ev.transform;)
+*     });
+* });
+*/
+
+/**
+ * When the group drag finishes, the `dragGroupEnd` event is called.
+ * @memberof Moveable.Draggable
+ * @event dragGroupEnd
+ * @param {Moveable.Draggable.OnDragGroupEnd} - Parameters for the `dragGroupEnd` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     target: [].slice.call(document.querySelectorAll(".target")),
+ *     draggable: true
+ * });
+ * moveable.on("dragGroupEnd", ({ targets, isDrag }) => {
+ *     console.log("onDragGroupEnd", targets, isDrag);
+ * });
+ */
+
+
+
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + diff --git a/release/0.52.0/doc/packages_react-moveable_src_ables_Origin.tsx.html b/release/0.52.0/doc/packages_react-moveable_src_ables_Origin.tsx.html new file mode 100644 index 000000000..fa3722bc0 --- /dev/null +++ b/release/0.52.0/doc/packages_react-moveable_src_ables_Origin.tsx.html @@ -0,0 +1,122 @@ + + + + + packages/react-moveable/src/ables/Origin.tsx - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

packages/react-moveable/src/ables/Origin.tsx

+ + + + + + + +
+
+
import { prefix, getControlTransform, calculatePosition, convertTransformOriginArray } from "../utils";
+import { Renderer, OriginOptions, MoveableManagerInterface } from "../types";
+import { makeAble } from "./AbleManager";
+import { minus } from "@scena/matrix";
+
+export default makeAble("origin", {
+    props: ["origin", "svgOrigin"] as const,
+    render(moveable: MoveableManagerInterface<OriginOptions>, React: Renderer): any[] {
+        const { zoom, svgOrigin, groupable } = moveable.props;
+        const {
+            beforeOrigin, rotation, svg, allMatrix, is3d,
+            left, top, offsetWidth, offsetHeight,
+        } = moveable.getState();
+
+        let originStyle!: Record<string, any>;
+
+        if (!groupable && svg && svgOrigin) {
+            const [originX, originY] = convertTransformOriginArray(svgOrigin, offsetWidth, offsetHeight);
+            const n = is3d ? 4 : 3;
+            const result = calculatePosition(
+                allMatrix,
+                [originX, originY],
+                n,
+            );
+            originStyle = getControlTransform(rotation, zoom!, minus(result, [left, top]));
+        } else {
+            originStyle = getControlTransform(rotation, zoom!, beforeOrigin);
+        }
+        return [
+            <div className={prefix("control", "origin")} style={originStyle} key="beforeOrigin"></div>,
+        ];
+    },
+});
+
+/**
+ * Whether or not the origin controlbox will be visible or not (default: true)
+ * @name Moveable#origin
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body);
+ *
+ * moveable.origin = true;
+ */
+
+
+
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + diff --git a/release/0.52.0/doc/packages_react-moveable_src_ables_OriginDraggable.tsx.html b/release/0.52.0/doc/packages_react-moveable_src_ables_OriginDraggable.tsx.html new file mode 100644 index 000000000..1c3e46906 --- /dev/null +++ b/release/0.52.0/doc/packages_react-moveable_src_ables_OriginDraggable.tsx.html @@ -0,0 +1,433 @@ + + + + + packages/react-moveable/src/ables/OriginDraggable.tsx - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

packages/react-moveable/src/ables/OriginDraggable.tsx

+ + + + + + + +
+
+
import {
+    prefix, triggerEvent,
+    fillParams, calculatePoses, getRect, fillEndParams, convertCSSSize, fillCSSObject,
+} from "../utils";
+import {
+    OnDragOriginStart, OnDragOrigin,
+    OnDragOriginEnd, MoveableManagerInterface, DraggableProps, OriginDraggableProps, MoveableGroupInterface,
+} from "../types";
+import { hasClass, IObject } from "@daybrush/utils";
+import { setDragStart, getDragDist, getNextMatrix } from "../gesto/GestoUtils";
+import { minus, plus } from "@scena/matrix";
+import Draggable from "./Draggable";
+import CustomGesto, { setCustomDrag } from "../gesto/CustomGesto";
+
+/**
+ * @namespace OriginDraggable
+ * @memberof Moveable
+ * @description Whether to drag origin (default: false)
+ */
+export default {
+    name: "originDraggable",
+    props: [
+        "originDraggable",
+        "originRelative",
+    ] as const,
+    events: [
+        "dragOriginStart",
+        "dragOrigin",
+        "dragOriginEnd",
+    ] as const,
+    css: [
+        `:host[data-able-origindraggable] .control.origin {
+pointer-events: auto;
+}`,
+    ],
+    dragControlCondition(_: any, e: any) {
+        if (e.isRequest) {
+            return e.requestAble === "originDraggable";
+        }
+        return hasClass(e.inputEvent.target, prefix("origin"));
+    },
+    dragControlStart(moveable: MoveableManagerInterface<OriginDraggableProps & DraggableProps>, e: any) {
+        const { datas } = e;
+
+        setDragStart(moveable, e);
+
+        const params = fillParams<OnDragOriginStart>(moveable, e, {
+            dragStart: Draggable.dragStart(
+                moveable,
+                new CustomGesto().dragStart([0, 0], e),
+            ),
+        });
+        const result = triggerEvent(moveable, "onDragOriginStart", params);
+
+        datas.startOrigin = moveable.state.transformOrigin;
+        datas.startTargetOrigin = moveable.state.targetOrigin;
+        datas.prevOrigin = [0, 0];
+        datas.isDragOrigin = true;
+
+        if (result === false) {
+            datas.isDragOrigin = false;
+            return false;
+        }
+
+        return params;
+    },
+    dragControl(moveable: MoveableManagerInterface<OriginDraggableProps & DraggableProps>, e: any) {
+        const { datas, isPinch, isRequest } = e;
+
+        if (!datas.isDragOrigin) {
+            return false;
+        }
+        const [distX, distY] = getDragDist(e);
+        const state = moveable.state;
+        const {
+            width,
+            height,
+            offsetMatrix,
+            targetMatrix,
+            is3d,
+        } = state;
+        const {
+            originRelative = true,
+        } = moveable.props;
+        const n = is3d ? 4 : 3;
+        let dist = [distX, distY];
+
+        if (isRequest) {
+            const distOrigin = e.distOrigin;
+            if (distOrigin[0] || distOrigin[1]) {
+                dist = distOrigin;
+            }
+        }
+        const origin = plus(datas.startOrigin, dist);
+        const targetOrigin = plus(datas.startTargetOrigin, dist);
+        const delta = minus(dist, datas.prevOrigin);
+
+        const nextMatrix = getNextMatrix(
+            offsetMatrix,
+            targetMatrix,
+            origin,
+            n,
+        );
+
+        const rect = moveable.getRect();
+        const nextRect = getRect(calculatePoses(nextMatrix, width, height, n));
+
+        const dragDelta = [
+            rect.left - nextRect.left,
+            rect.top - nextRect.top,
+        ];
+
+        datas.prevOrigin = dist;
+        const transformOrigin = [
+            convertCSSSize(targetOrigin[0], width, originRelative),
+            convertCSSSize(targetOrigin[1], height, originRelative),
+        ].join(" ");
+        const result = Draggable.drag(
+            moveable,
+            setCustomDrag(e, moveable.state, dragDelta, !!isPinch, false),
+        )!;
+        const params = fillParams<OnDragOrigin>(moveable, e, {
+            width,
+            height,
+            origin,
+            dist,
+            delta,
+            transformOrigin,
+            drag: result,
+            ...fillCSSObject({
+                transformOrigin,
+                transform: result.transform,
+            }, e),
+            afterTransform: result.transform,
+        });
+        triggerEvent(moveable, "onDragOrigin", params);
+        return params;
+    },
+    dragControlEnd(moveable: MoveableManagerInterface<OriginDraggableProps>, e: any) {
+        const { datas } = e;
+
+        if (!datas.isDragOrigin) {
+            return false;
+        }
+        triggerEvent(moveable, "onDragOriginEnd",
+            fillEndParams<OnDragOriginEnd>(moveable, e, {}));
+        return true;
+    },
+    dragGroupControlCondition(moveable: any, e: any) {
+        return this.dragControlCondition(moveable, e);
+    },
+    dragGroupControlStart(moveable: MoveableGroupInterface<OriginDraggableProps>, e: any) {
+        const params = this.dragControlStart(moveable, e);
+
+        if (!params) {
+            return false;
+        }
+
+        return true;
+    },
+    dragGroupControl(moveable: MoveableGroupInterface<OriginDraggableProps>, e: any) {
+        const params = this.dragControl(moveable, e);
+
+        if (!params) {
+            return false;
+        }
+        moveable.transformOrigin = params.transformOrigin;
+
+        return true;
+    },
+    /**
+    * @method Moveable.OriginDraggable#request
+    * @param {object} e - the OriginDraggable's request parameter
+    * @param {number} [e.x] - x position
+    * @param {number} [e.y] - y position
+    * @param {number} [e.deltaX] - x number to move
+    * @param {number} [e.deltaY] - y number to move
+    * @param {array} [e.deltaOrigin] - left, top number to move transform-origin
+    * @param {array} [e.origin] - transform-origin position
+    * @param {number} [e.isInstant] - Whether to execute the request instantly
+    * @return {Moveable.Requester} Moveable Requester
+    * @example
+
+    * // Instantly Request (requestStart - request - requestEnd)
+    * // Use Relative Value
+    * moveable.request("originDraggable", { deltaX: 10, deltaY: 10 }, true);
+    * // Use Absolute Value
+    * moveable.request("originDraggable", { x: 200, y: 100 }, true);
+    * // Use Transform Value
+    * moveable.request("originDraggable", { deltaOrigin: [10, 0] }, true);
+    * moveable.request("originDraggable", { origin: [100, 0] }, true);
+    * // requestStart
+    * const requester = moveable.request("originDraggable");
+    *
+    * // request
+    * // Use Relative Value
+    * requester.request({ deltaX: 10, deltaY: 10 });
+    * requester.request({ deltaX: 10, deltaY: 10 });
+    * requester.request({ deltaX: 10, deltaY: 10 });
+    * // Use Absolute Value
+    * moveable.request("originDraggable", { x: 200, y: 100 });
+    * moveable.request("originDraggable", { x: 220, y: 100 });
+    * moveable.request("originDraggable", { x: 240, y: 100 });
+    *
+    * // requestEnd
+    * requester.requestEnd();
+    */
+    request(moveable: MoveableManagerInterface<any, any>) {
+        const datas = {};
+        const rect = moveable.getRect();
+        let distX = 0;
+        let distY = 0;
+
+        const transformOrigin = rect.transformOrigin;
+        const distOrigin = [0, 0];
+
+        return {
+            isControl: true,
+            requestStart() {
+                return { datas };
+            },
+            request(e: IObject<any>) {
+                if ("deltaOrigin" in e) {
+                    distOrigin[0] += e.deltaOrigin[0];
+                    distOrigin[1] += e.deltaOrigin[1];
+                } else if ("origin" in e) {
+                    distOrigin[0] = e.origin[0] - transformOrigin[0];
+                    distOrigin[1] = e.origin[1] - transformOrigin[1];
+                } else {
+                    if ("x" in e) {
+                        distX = e.x - rect.left;
+                    } else if ("deltaX" in e) {
+                        distX += e.deltaX;
+                    }
+                    if ("y" in e) {
+                        distY = e.y - rect.top;
+                    } else if ("deltaY" in e) {
+                        distY += e.deltaY;
+                    }
+                }
+
+                return { datas, distX, distY, distOrigin };
+            },
+            requestEnd() {
+                return { datas, isDrag: true };
+            },
+        };
+    },
+};
+/**
+ * Whether to drag origin (default: false)
+ * @name Moveable.OriginDraggable#originDraggable
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     originDraggable: true,
+ * });
+ * let translate = [0, 0];
+ * moveable.on("dragOriginStart", e => {
+ *     e.dragStart && e.dragStart.set(translate);
+ * }).on("dragOrigin", e => {
+ *     translate = e.drag.beforeTranslate;
+ *     e.target.style.cssText
+ *         = `transform-origin: ${e.transformOrigin};`
+ *         + `transform: translate(${translate[0]}px, ${translate[1]}px)`;
+ * }).on("dragOriginEnd", e => {
+ *     console.log(e);
+ * });
+ */
+
+/**
+ * % Can be used instead of the absolute px (default: true)
+ * @name Moveable.OriginDraggable#originRelative
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     originDraggable: true,
+ *     originRelative: false,
+ * });
+ * moveable.originRelative = true;
+ */
+
+/**
+* When drag start the origin, the `dragOriginStart` event is called.
+* @memberof Moveable.OriginDraggable
+* @event dragOriginStart
+* @param {Moveable.OriginDraggable.OnDragOriginStart} - Parameters for the `dragOriginStart` event
+* @example
+* import Moveable from "moveable";
+*
+* const moveable = new Moveable(document.body, {
+*     originDraggable: true,
+* });
+* let translate = [0, 0];
+* moveable.on("dragOriginStart", e => {
+*     e.dragStart && e.dragStart.set(translate);
+* }).on("dragOrigin", e => {
+*     translate = e.drag.beforeTranslate;
+*     e.target.style.cssText
+*         = `transform-origin: ${e.transformOrigin};`
+*         + `transform: translate(${translate[0]}px, ${translate[1]}px)`;
+* }).on("dragOriginEnd", e => {
+*     console.log(e);
+* });
+*/
+
+/**
+* When drag the origin, the `dragOrigin` event is called.
+* @memberof Moveable.OriginDraggable
+* @event dragOrigin
+* @param {Moveable.OriginDraggable.OnDragOrigin} - Parameters for the `dragOrigin` event
+* @example
+* import Moveable from "moveable";
+*
+* const moveable = new Moveable(document.body, {
+*     originDraggable: true,
+* });
+* let translate = [0, 0];
+* moveable.on("dragOriginStart", e => {
+*     e.dragStart && e.dragStart.set(translate);
+* }).on("dragOrigin", e => {
+*     translate = e.drag.beforeTranslate;
+*     e.target.style.cssText
+*         = `transform-origin: ${e.transformOrigin};`
+*         + `transform: translate(${translate[0]}px, ${translate[1]}px)`;
+* }).on("dragOriginEnd", e => {
+*     console.log(e);
+* });
+*/
+
+/**
+* When drag end the origin, the `dragOriginEnd` event is called.
+* @memberof Moveable.OriginDraggable
+* @event dragOriginEnd
+* @param {Moveable.OriginDraggable.OnDragOriginEnd} - Parameters for the `dragOriginEnd` event
+* @example
+* import Moveable from "moveable";
+*
+* const moveable = new Moveable(document.body, {
+*     originDraggable: true,
+* });
+* let translate = [0, 0];
+* moveable.on("dragOriginStart", e => {
+*     e.dragStart && e.dragStart.set(translate);
+* }).on("dragOrigin", e => {
+*     translate = e.drag.beforeTranslate;
+*     e.target.style.cssText
+*         = `transform-origin: ${e.transformOrigin};`
+*         + `transform: translate(${translate[0]}px, ${translate[1]}px)`;
+* }).on("dragOriginEnd", e => {
+*     console.log(e);
+* });
+*/
+
+
+
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + diff --git a/release/0.52.0/doc/packages_react-moveable_src_ables_Padding.tsx.html b/release/0.52.0/doc/packages_react-moveable_src_ables_Padding.tsx.html new file mode 100644 index 000000000..facd740cf --- /dev/null +++ b/release/0.52.0/doc/packages_react-moveable_src_ables_Padding.tsx.html @@ -0,0 +1,159 @@ + + + + + packages/react-moveable/src/ables/Padding.tsx - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

packages/react-moveable/src/ables/Padding.tsx

+ + + + + + + +
+
+
import { prefix, makeMatrixCSS, getPaddingBox } from "../utils";
+import { Renderer, MoveableManagerInterface } from "../types";
+import { createWarpMatrix } from "@scena/matrix";
+import { makeAble } from "./AbleManager";
+
+export default makeAble("padding", {
+    props: ["padding"] as const,
+    render(moveable: MoveableManagerInterface, React: Renderer): any[] {
+        const props = moveable.props;
+        if (props.dragArea) {
+            return [];
+        }
+        const {
+            left,
+            top,
+            right,
+            bottom,
+        } = getPaddingBox(props.padding || {});
+        const {
+            renderPoses,
+            pos1,
+            pos2,
+            pos3,
+            pos4,
+        } = moveable.getState();
+
+        const poses = [pos1, pos2, pos3, pos4];
+        const paddingDirections: number[][] = [];
+
+        if (left > 0) {
+            paddingDirections.push([0, 2]);
+        }
+        if (top > 0) {
+            paddingDirections.push([0, 1]);
+        }
+        if (right > 0) {
+            paddingDirections.push([1, 3]);
+        }
+        if (bottom > 0) {
+            paddingDirections.push([2, 3]);
+        }
+        return paddingDirections.map(([dir1, dir2], i) => {
+            const paddingPos1 = poses[dir1];
+            const paddingPos2 = poses[dir2];
+            const paddingPos3 = renderPoses[dir1];
+            const paddingPos4 = renderPoses[dir2];
+
+            const h = createWarpMatrix(
+                [0, 0],
+                [100, 0],
+                [0, 100],
+                [100, 100],
+                paddingPos1,
+                paddingPos2,
+                paddingPos3,
+                paddingPos4,
+            );
+            if (!h.length) {
+                return undefined;
+            }
+            return (<div key={`padding${i}`} className={prefix("padding")} style={{
+                transform: makeMatrixCSS(h, true),
+            }}></div>);
+        });
+    },
+});
+
+/**
+ * Add padding around the target to increase the drag area.
+ * @name Moveable#padding
+ * @default null
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *  target: document.querySelector(".target"),
+ *  padding: { left: 0, top: 0, right: 0, bottom: 0 },
+ * });
+ * moveable.padding = { left: 10, top: 10, right: 10, bottom: 10 },
+ * moveable.updateRect();
+ */
+
+
+
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + diff --git a/release/0.52.0/doc/packages_react-moveable_src_ables_Pinchable.ts.html b/release/0.52.0/doc/packages_react-moveable_src_ables_Pinchable.ts.html new file mode 100644 index 000000000..491efc4eb --- /dev/null +++ b/release/0.52.0/doc/packages_react-moveable_src_ables_Pinchable.ts.html @@ -0,0 +1,374 @@ + + + + + packages/react-moveable/src/ables/Pinchable.ts - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

packages/react-moveable/src/ables/Pinchable.ts

+ + + + + + + +
+
+
import { makeAble } from "./AbleManager";
+import { triggerEvent, fillParams, fillEndParams } from "../utils";
+import {
+    PinchableProps, Able, SnappableState,
+    OnPinchStart, OnPinch, OnPinchEnd, MoveableManagerInterface, MoveableGroupInterface,
+} from "../types";
+
+/**
+ * @namespace Moveable.Pinchable
+ * @description Whether or not target can be pinched with draggable, resizable, scalable, rotatable (default: false)
+ */
+export default makeAble("pinchable", {
+    props: [
+        "pinchable",
+    ] as const,
+    events: [
+        "pinchStart",
+        "pinch",
+        "pinchEnd",
+        "pinchGroupStart",
+        "pinchGroup",
+        "pinchGroupEnd",
+    ] as const,
+    dragStart() {
+        return true;
+    },
+    pinchStart(
+        moveable: MoveableManagerInterface<PinchableProps, SnappableState>,
+        e: any,
+    ) {
+        const { datas, targets, angle, originalDatas } = e;
+        const { pinchable, ables } = moveable.props;
+
+        if (!pinchable) {
+            return false;
+        }
+        const eventName = `onPinch${targets ? "Group" : ""}Start` as "onPinchStart";
+        const controlEventName = `drag${targets ? "Group" : ""}ControlStart` as "dragControlStart";
+
+        const pinchAbles = (pinchable === true ? moveable.controlAbles : ables!.filter(able => {
+            return pinchable.indexOf(able.name as any) > -1;
+        })).filter(able => able.canPinch && able[controlEventName]);
+
+        const params = fillParams<OnPinchStart>(moveable, e, {}) as any;
+
+        if (targets) {
+            params.targets = targets;
+        }
+        const result = triggerEvent(moveable, eventName, params);
+
+        datas.isPinch = result !== false;
+        datas.ables = pinchAbles;
+
+        const isPinch = datas.isPinch;
+
+        if (!isPinch) {
+            return false;
+        }
+        pinchAbles.forEach(able => {
+            originalDatas[able.name] = originalDatas[able.name] || {};
+
+            if (!able[controlEventName]) {
+                return;
+            }
+            const ableEvent: any = {
+                ...e,
+                datas: originalDatas[able.name],
+                parentRotate: angle,
+                isPinch: true,
+            };
+            able[controlEventName]!(moveable, ableEvent);
+        });
+
+        moveable.state.snapRenderInfo = {
+            request: e.isRequest,
+            direction: [0, 0],
+        };
+        return isPinch;
+    },
+    pinch(
+        moveable: MoveableManagerInterface<PinchableProps>,
+        e: any,
+    ) {
+        const {
+            datas, scale: pinchScale, distance,
+            originalDatas,
+            inputEvent, targets,
+            angle,
+        } = e;
+        if (!datas.isPinch) {
+            return;
+        }
+        const parentDistance = distance * (1 - 1 / pinchScale);
+        const params = fillParams<OnPinch>(moveable, e, {}) as any;
+
+        if (targets) {
+            params.targets = targets;
+        }
+        const eventName = `onPinch${targets ? "Group" : ""}` as "onPinch";
+        triggerEvent(moveable, eventName, params);
+
+        const ables: Able[] = datas.ables;
+        const controlEventName = `drag${targets ? "Group" : ""}Control` as "dragControl";
+
+        ables.forEach(able => {
+            if (!able[controlEventName]) {
+                return;
+            }
+            able[controlEventName]!(moveable, {
+                ...e,
+                datas: originalDatas[able.name],
+                inputEvent,
+                resolveMatrix: true,
+                pinchScale: pinchScale,
+                parentDistance,
+                parentRotate: angle,
+                isPinch: true,
+            } as any);
+        });
+        return params;
+    },
+    pinchEnd(
+        moveable: MoveableManagerInterface<PinchableProps>,
+        e: any,
+    ) {
+        const { datas, isPinch, inputEvent, targets, originalDatas } = e;
+        if (!datas.isPinch) {
+            return;
+        }
+        const eventName = `onPinch${targets ? "Group" : ""}End` as "onPinchEnd";
+
+        const params = fillEndParams<OnPinchEnd>(moveable, e, { isDrag: isPinch }) as any;
+
+        if (targets) {
+            params.targets = targets;
+        }
+        triggerEvent(moveable, eventName, params);
+        const ables: Able[] = datas.ables;
+        const controlEventName = `drag${targets ? "Group" : ""}ControlEnd` as "dragControlEnd";
+
+        ables.forEach(able => {
+            if (!able[controlEventName]) {
+                return;
+            }
+            able[controlEventName]!(moveable, {
+                ...e,
+                isDrag: isPinch,
+                datas: originalDatas[able.name],
+                inputEvent,
+                isPinch: true,
+            } as any);
+        });
+        return isPinch;
+    },
+    pinchGroupStart(moveable: MoveableGroupInterface<any, any>, e: any) {
+        return this.pinchStart!(moveable, { ...e, targets: moveable.props.targets });
+    },
+    pinchGroup(moveable: MoveableGroupInterface, e: any) {
+        return this.pinch!(moveable, { ...e, targets: moveable.props.targets });
+    },
+    pinchGroupEnd(moveable: MoveableGroupInterface, e: any) {
+        return this.pinchEnd!(moveable, { ...e, targets: moveable.props.targets });
+    },
+});
+
+/**
+ * Whether or not target can be pinched with draggable, resizable, scalable, rotatable (default: false)
+ * @name Moveable.Pinchable#pinchable
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body);
+ *
+ * moveable.pinchable = true;
+ */
+
+/**
+ * When the pinch starts, the pinchStart event is called with part of scaleStart, rotateStart, resizeStart
+ * @memberof Moveable.Pinchable
+ * @event pinchStart
+ * @param {Moveable.Pinchable.OnPinchStart} - Parameters for the pinchStart event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     rotatable: true,
+ *     scalable: true,
+ *     pinchable: true, // ["rotatable", "scalable"]
+ * });
+ * moveable.on("pinchStart", ({ target }) => {
+ *     console.log(target);
+ * });
+ * moveable.on("rotateStart", ({ target }) => {
+ *     console.log(target);
+ * });
+ * moveable.on("scaleStart", ({ target }) => {
+ *     console.log(target);
+ * });
+ */
+/**
+ * When pinching, the pinch event is called with part of scale, rotate, resize
+ * @memberof Moveable.Pinchable
+ * @event pinch
+ * @param {Moveable.Pinchable.OnPinch} - Parameters for the pinch event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     rotatable: true,
+ *     scalable: true,
+ *     pinchable: true, // ["rotatable", "scalable"]
+ * });
+ * moveable.on("pinch", ({ target }) => {
+ *     console.log(target);
+ * });
+ * moveable.on("rotate", ({ target }) => {
+ *     console.log(target);
+ * });
+ * moveable.on("scale", ({ target }) => {
+ *     console.log(target);
+ * });
+ */
+/**
+ * When the pinch finishes, the pinchEnd event is called.
+ * @memberof Moveable.Pinchable
+ * @event pinchEnd
+ * @param {Moveable.Pinchable.OnPinchEnd} - Parameters for the pinchEnd event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     rotatable: true,
+ *     scalable: true,
+ *     pinchable: true, // ["rotatable", "scalable"]
+ * });
+ * moveable.on("pinchEnd", ({ target }) => {
+ *     console.log(target);
+ * });
+ * moveable.on("rotateEnd", ({ target }) => {
+ *     console.log(target);
+ * });
+ * moveable.on("scaleEnd", ({ target }) => {
+ *     console.log(target);
+ * });
+ */
+
+/**
+ * When the group pinch starts, the `pinchGroupStart` event is called.
+ * @memberof Moveable.Pinchable
+ * @event pinchGroupStart
+ * @param {Moveable.Pinchable.OnPinchGroupStart} - Parameters for the `pinchGroupStart` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     target: [].slice.call(document.querySelectorAll(".target")),
+ *     pinchable: true
+ * });
+ * moveable.on("pinchGroupStart", ({ targets }) => {
+ *     console.log("onPinchGroupStart", targets);
+ * });
+ */
+
+/**
+ * When the group pinch, the `pinchGroup` event is called.
+ * @memberof Moveable.Pinchable
+ * @event pinchGroup
+ * @param {Moveable.Pinchable.OnPinchGroup} - Parameters for the `pinchGroup` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     target: [].slice.call(document.querySelectorAll(".target")),
+ *     pinchable: true
+ * });
+ * moveable.on("pinchGroup", ({ targets, events }) => {
+ *     console.log("onPinchGroup", targets);
+ * });
+ */
+
+/**
+ * When the group pinch finishes, the `pinchGroupEnd` event is called.
+ * @memberof Moveable.Pinchable
+ * @event pinchGroupEnd
+ * @param {Moveable.Pinchable.OnPinchGroupEnd} - Parameters for the `pinchGroupEnd` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     target: [].slice.call(document.querySelectorAll(".target")),
+ *     pinchable: true
+ * });
+ * moveable.on("pinchGroupEnd", ({ targets, isDrag }) => {
+ *     console.log("onPinchGroupEnd", targets, isDrag);
+ * });
+ */
+
+
+
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + diff --git a/release/0.52.0/doc/packages_react-moveable_src_ables_Resizable.ts.html b/release/0.52.0/doc/packages_react-moveable_src_ables_Resizable.ts.html new file mode 100644 index 000000000..a2c88434e --- /dev/null +++ b/release/0.52.0/doc/packages_react-moveable_src_ables_Resizable.ts.html @@ -0,0 +1,1104 @@ + + + + + packages/react-moveable/src/ables/Resizable.ts - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

packages/react-moveable/src/ables/Resizable.ts

+ + + + + + + +
+
+
import {
+    triggerEvent,
+    fillParams,
+    fillEndParams,
+    getAbsolutePosesByState,
+    catchEvent,
+    getOffsetSizeDist,
+    getProps,
+    getDirectionCondition,
+    calculatePoses,
+    fillAfterTransform,
+    getDirectionViewClassName,
+    getTotalDirection,
+    abs,
+} from "../utils";
+import {
+    setDragStart,
+    getResizeDist,
+    getAbsolutePosition,
+    getNextMatrix,
+    getNextTransforms,
+} from "../gesto/GestoUtils";
+import {
+    ResizableProps, OnResizeGroup, OnResizeGroupEnd,
+    OnResizeGroupStart, DraggableProps, OnDrag, OnResizeStart, SnappableState,
+    OnResize, OnResizeEnd, MoveableManagerInterface, MoveableGroupInterface, SnappableProps,
+    OnBeforeResize, OnBeforeResizeGroup, ResizableRequestParam,
+} from "../types";
+import { getRenderDirections } from "../renderDirections";
+import {
+    fillChildEvents,
+    startChildDist,
+    triggerChildAbles,
+} from "../groupUtils";
+import Draggable from "./Draggable";
+import { calculate, convertDimension, createRotateMatrix, plus } from "@scena/matrix";
+import CustomGesto, { setCustomDrag } from "../gesto/CustomGesto";
+import { checkSnapResize } from "./Snappable";
+import {
+    calculateBoundSize,
+    isString, convertUnitSize,
+    throttle,
+    isNumber,
+} from "@daybrush/utils";
+import { TINY_NUM } from "../consts";
+import { parseMat } from "css-to-mat";
+import { getFixedDirectionInfo, getOffsetFixedPositionInfo } from "../utils/getFixedDirection";
+
+/**
+ * @namespace Resizable
+ * @memberof Moveable
+ * @description Resizable indicates whether the target's width and height can be increased or decreased.
+ */
+
+const directionCondition = getDirectionCondition("resizable");
+
+export default {
+    name: "resizable",
+    ableGroup: "size",
+    canPinch: true,
+    props: [
+        "resizable",
+        "throttleResize",
+        "renderDirections",
+        "displayAroundControls",
+        "keepRatio",
+        "resizeFormat",
+        "keepRatioFinally",
+        "edge",
+        "checkResizableError",
+    ] as const,
+    events: [
+        "resizeStart",
+        "beforeResize",
+        "resize",
+        "resizeEnd",
+        "resizeGroupStart",
+        "beforeResizeGroup",
+        "resizeGroup",
+        "resizeGroupEnd",
+    ] as const,
+    render: getRenderDirections("resizable"),
+    dragControlCondition: directionCondition,
+    viewClassName: getDirectionViewClassName("resizable"),
+    dragControlStart(
+        moveable: MoveableManagerInterface<ResizableProps & DraggableProps, SnappableState>,
+        e: any,
+    ) {
+        const {
+            inputEvent,
+            isPinch,
+            isGroup,
+            parentDirection,
+            parentGesto,
+            datas,
+            parentFixedDirection,
+            parentEvent,
+        } = e;
+
+        const direction = getTotalDirection(
+            parentDirection,
+            isPinch,
+            inputEvent,
+            datas,
+        );
+
+        const state = moveable.state;
+        const { target, width, height, gestos } = state;
+
+        if (!direction || !target) {
+            return false;
+        }
+        if (gestos.resizable) {
+            return false;
+        }
+        gestos.resizable = parentGesto || moveable.controlGesto;
+        !isPinch && setDragStart(moveable, e);
+
+        datas.datas = {};
+        datas.direction = direction;
+        datas.startOffsetWidth = width;
+        datas.startOffsetHeight = height;
+        datas.prevWidth = 0;
+        datas.prevHeight = 0;
+
+        datas.minSize = [0, 0];
+
+
+        datas.startWidth = state.inlineCSSWidth || state.cssWidth;
+        datas.startHeight = state.inlineCSSHeight || state.cssHeight;
+        datas.maxSize = [Infinity, Infinity];
+
+        if (!isGroup) {
+            datas.minSize = [
+                state.minOffsetWidth,
+                state.minOffsetHeight,
+            ];
+            datas.maxSize = [
+                state.maxOffsetWidth,
+                state.maxOffsetHeight,
+            ];
+        }
+        const transformOrigin = moveable.props.transformOrigin || "% %";
+
+        datas.transformOrigin = transformOrigin && isString(transformOrigin)
+            ? transformOrigin.split(" ")
+            : transformOrigin;
+
+        datas.startOffsetMatrix = state.offsetMatrix;
+        datas.startTransformOrigin = state.transformOrigin;
+
+        datas.isWidth = e?.parentIsWidth ?? ((!direction[0] && !direction[1]) || direction[0] || !direction[1]);
+
+        function setRatio(ratio: number) {
+            datas.ratio = ratio && isFinite(ratio) ? ratio : 0;
+        }
+
+
+        datas.startPositions = getAbsolutePosesByState(moveable.state);
+
+        function setFixedDirection(fixedDirection: number[]) {
+            const result = getFixedDirectionInfo(datas.startPositions, fixedDirection);
+
+            datas.fixedDirection = result.fixedDirection;
+            datas.fixedPosition = result.fixedPosition;
+            datas.fixedOffset = result.fixedOffset;
+        }
+        function setFixedPosition(fixedPosition: number[]) {
+            const result = getOffsetFixedPositionInfo(moveable.state, fixedPosition);
+
+            datas.fixedDirection = result.fixedDirection;
+            datas.fixedPosition = result.fixedPosition;
+            datas.fixedOffset = result.fixedOffset;
+        }
+        function setMin(minSize: Array<string | number>)  {
+            datas.minSize = [
+                convertUnitSize(`${minSize[0]}`, 0) || 0,
+                convertUnitSize(`${minSize[1]}`, 0) || 0,
+            ];
+        }
+        function setMax(maxSize: Array<string | number>) {
+            const nextMaxSize = [
+                maxSize[0] || Infinity,
+                maxSize[1] || Infinity,
+            ];
+            if (!isNumber(nextMaxSize[0]) || isFinite(nextMaxSize[0])) {
+                nextMaxSize[0] = convertUnitSize(`${nextMaxSize[0]}`, 0) || Infinity;
+            }
+            if (!isNumber(nextMaxSize[1]) || isFinite(nextMaxSize[1])) {
+                nextMaxSize[1] = convertUnitSize(`${nextMaxSize[1]}`, 0) || Infinity;
+            }
+            datas.maxSize = nextMaxSize;
+        }
+
+        setRatio(width / height);
+        setFixedDirection(parentFixedDirection || [-direction[0], -direction[1]]);
+
+        datas.setFixedDirection = setFixedDirection;
+        datas.setFixedPosition = setFixedPosition;
+        datas.setMin = setMin;
+        datas.setMax = setMax;
+        const params = fillParams<OnResizeStart>(moveable, e, {
+            direction,
+            startRatio: datas.ratio,
+            set: ([startWidth, startHeight]: number[]) => {
+                datas.startWidth = startWidth;
+                datas.startHeight = startHeight;
+            },
+            setMin,
+            setMax,
+            setRatio,
+            setFixedDirection,
+            setFixedPosition,
+            setOrigin: (origin: Array<string | number>) => {
+                datas.transformOrigin = origin;
+            },
+            dragStart: Draggable.dragStart(
+                moveable,
+                new CustomGesto().dragStart([0, 0], e),
+            ),
+        });
+        const result = parentEvent || triggerEvent(moveable, "onResizeStart", params);
+
+        datas.startFixedDirection = datas.fixedDirection;
+        datas.startFixedPosition = datas.fixedPosition;
+        if (result !== false) {
+            datas.isResize = true;
+            moveable.state.snapRenderInfo = {
+                request: e.isRequest,
+                direction,
+            };
+        }
+        return datas.isResize ? params : false;
+    },
+    dragControl(
+        moveable: MoveableManagerInterface<ResizableProps & DraggableProps & SnappableProps>,
+        e: any,
+    ) {
+        const {
+            datas,
+            parentFlag,
+            isPinch,
+            parentKeepRatio,
+            dragClient,
+            parentDist,
+            useSnap,
+            isRequest,
+            isGroup,
+            parentEvent,
+            resolveMatrix,
+        } = e;
+
+        const {
+            isResize,
+            transformOrigin,
+            startWidth,
+            startHeight,
+            prevWidth,
+            prevHeight,
+            minSize,
+            maxSize,
+            ratio,
+            startOffsetWidth,
+            startOffsetHeight,
+            isWidth,
+        } = datas;
+
+        if (!isResize) {
+            return;
+        }
+        if (resolveMatrix) {
+            const {
+                is3d,
+            } = moveable.state;
+            const {
+                startOffsetMatrix,
+                startTransformOrigin,
+            } = datas;
+            const n = is3d ? 4 : 3;
+            let targetMatrix = parseMat(getNextTransforms(e));
+            const targetN = Math.sqrt(targetMatrix.length);
+
+            if (n !== targetN) {
+                targetMatrix = convertDimension(targetMatrix, targetN, n);
+            }
+
+            const nextAllMatrix = getNextMatrix(
+                startOffsetMatrix,
+                targetMatrix,
+                startTransformOrigin,
+                n,
+            );
+            const poses = calculatePoses(nextAllMatrix, startOffsetWidth, startOffsetHeight, n);
+
+            datas.startPositions = poses;
+            datas.nextTargetMatrix = targetMatrix;
+            datas.nextAllMatrix = nextAllMatrix;
+        }
+        const props = getProps(moveable.props, "resizable");
+        const {
+            resizeFormat,
+            throttleResize = parentFlag ? 0 : 1,
+            parentMoveable,
+            keepRatioFinally,
+        } = props;
+        const direction = datas.direction;
+        let sizeDirection = direction;
+        let distWidth = 0;
+        let distHeight = 0;
+
+        if (!direction[0] && !direction[1]) {
+            sizeDirection = [1, 1];
+        }
+        const keepRatio = (ratio && (parentKeepRatio != null ? parentKeepRatio : props.keepRatio)) || false;
+
+        function getNextBoundingSize() {
+            const fixedDirection = datas.fixedDirection;
+            const nextSize = getOffsetSizeDist(sizeDirection, keepRatio, datas, e);
+
+            distWidth = nextSize.distWidth;
+            distHeight = nextSize.distHeight;
+
+            let nextWidth = (sizeDirection[0] - fixedDirection[0]) || keepRatio
+                ? Math.max(startOffsetWidth + distWidth, TINY_NUM) : startOffsetWidth;
+            let nextHeight = (sizeDirection[1] - fixedDirection[1]) || keepRatio
+                ? Math.max(startOffsetHeight + distHeight, TINY_NUM) : startOffsetHeight;
+
+            if (keepRatio && startOffsetWidth && startOffsetHeight) {
+                // startOffsetWidth : startOffsetHeight = nextWidth : nextHeight
+                if (isWidth) {
+                    nextHeight = nextWidth / ratio;
+                } else {
+                    nextWidth = nextHeight * ratio;
+                }
+            }
+            return [nextWidth, nextHeight];
+        }
+
+        let [boundingWidth, boundingHeight] = getNextBoundingSize();
+
+        if (!parentEvent) {
+            datas.setFixedDirection(datas.fixedDirection);
+
+            triggerEvent(moveable, "onBeforeResize", fillParams<OnBeforeResize>(moveable, e, {
+                startFixedDirection: datas.startFixedDirection,
+                startFixedPosition: datas.startFixedPosition,
+                setFixedDirection(nextFixedDirection: number[]) {
+                    datas.setFixedDirection(nextFixedDirection);
+
+                    [boundingWidth, boundingHeight] = getNextBoundingSize();
+
+                    return [boundingWidth, boundingHeight];
+                },
+                setFixedPosition(nextFixedPosition: number[]) {
+                    datas.setFixedPosition(nextFixedPosition);
+
+                    [boundingWidth, boundingHeight] = getNextBoundingSize();
+
+                    return [boundingWidth, boundingHeight];
+                },
+                boundingWidth,
+                boundingHeight,
+                setSize(size: number[]) {
+                    [boundingWidth, boundingHeight] = size;
+                },
+            }, true));
+        }
+
+        let fixedPosition = dragClient;
+
+        if (!dragClient) {
+            if (!parentFlag && isPinch) {
+                fixedPosition = getAbsolutePosition(moveable, [0, 0]);
+            } else {
+                fixedPosition = datas.fixedPosition;
+            }
+        }
+
+        let snapDist = [0, 0];
+
+        if (!isPinch) {
+            snapDist = checkSnapResize(
+                moveable,
+                boundingWidth,
+                boundingHeight,
+                direction,
+                fixedPosition,
+                !useSnap && isRequest,
+                datas,
+            );
+        }
+        if (parentDist) {
+            !parentDist[0] && (snapDist[0] = 0);
+            !parentDist[1] && (snapDist[1] = 0);
+        }
+
+        function computeSize() {
+            if (resizeFormat) {
+                [boundingWidth, boundingHeight] = resizeFormat([boundingWidth, boundingHeight]);
+            }
+            boundingWidth = throttle(boundingWidth, throttleResize!);
+            boundingHeight = throttle(boundingHeight, throttleResize!);
+        }
+        if (keepRatio) {
+            if (sizeDirection[0] && sizeDirection[1] && snapDist[0] && snapDist[1]) {
+                if (abs(snapDist[0]) > abs(snapDist[1])) {
+                    snapDist[1] = 0;
+                } else {
+                    snapDist[0] = 0;
+                }
+            }
+            const isNoSnap = !snapDist[0] && !snapDist[1];
+
+            if (isNoSnap) {
+                // pre-compute before maintaining the ratio
+                computeSize();
+            }
+            if (
+                (sizeDirection[0] && !sizeDirection[1])
+                || (snapDist[0] && !snapDist[1])
+                || (isNoSnap && isWidth)
+            ) {
+                boundingWidth += snapDist[0];
+                boundingHeight = boundingWidth / ratio;
+            } else if (
+                (!sizeDirection[0] && sizeDirection[1])
+                || (!snapDist[0] && snapDist[1])
+                || (isNoSnap && !isWidth)
+            ) {
+                boundingHeight += snapDist[1];
+                boundingWidth = boundingHeight * ratio;
+            }
+        } else {
+            boundingWidth += snapDist[0];
+            boundingHeight += snapDist[1];
+
+            boundingWidth = Math.max(0, boundingWidth);
+            boundingHeight = Math.max(0, boundingHeight);
+        }
+
+        [boundingWidth, boundingHeight] = calculateBoundSize(
+            [boundingWidth, boundingHeight],
+            minSize,
+            maxSize,
+            keepRatio ? ratio : false,
+        );
+        computeSize();
+
+        if (keepRatio && (isGroup || keepRatioFinally)) {
+            if (isWidth) {
+                boundingHeight = boundingWidth / ratio;
+            } else {
+                boundingWidth = boundingHeight * ratio;
+            }
+        }
+        distWidth = boundingWidth - startOffsetWidth;
+        distHeight = boundingHeight - startOffsetHeight;
+
+        const delta = [distWidth - prevWidth, distHeight - prevHeight];
+
+        datas.prevWidth = distWidth;
+        datas.prevHeight = distHeight;
+
+        const inverseDelta = getResizeDist(
+            moveable,
+            boundingWidth,
+            boundingHeight,
+            fixedPosition,
+            transformOrigin,
+            datas,
+        );
+
+        if (!parentMoveable && delta.every(num => !num) && inverseDelta.every(num => !num)) {
+            return;
+        }
+        const drag = Draggable.drag(
+            moveable,
+            setCustomDrag(e, moveable.state, inverseDelta, !!isPinch, false, "draggable"),
+        ) as OnDrag;
+        const transform = drag.transform;
+
+        const nextWidth = startWidth + distWidth;
+        const nextHeight = startHeight + distHeight;
+
+        const params = fillParams<OnResize>(moveable, e, {
+            width: nextWidth,
+            height: nextHeight,
+            offsetWidth: Math.round(boundingWidth),
+            offsetHeight: Math.round(boundingHeight),
+            startRatio: ratio,
+            boundingWidth,
+            boundingHeight,
+            direction,
+            dist: [distWidth, distHeight],
+            delta,
+            isPinch: !!isPinch,
+            drag,
+            ...fillAfterTransform({
+                style: {
+                    width: `${nextWidth}px`,
+                    height: `${nextHeight}px`,
+                },
+                transform,
+            }, drag, e),
+        });
+        !parentEvent && triggerEvent(moveable, "onResize", params);
+        return params;
+    },
+    dragControlAfter(
+        moveable: MoveableManagerInterface<ResizableProps & DraggableProps>,
+        e: any,
+    ) {
+        const datas = e.datas;
+        const {
+            isResize,
+            startOffsetWidth,
+            startOffsetHeight,
+            prevWidth,
+            prevHeight,
+        } = datas;
+
+        if (!isResize || moveable.props.checkResizableError === false) {
+            return;
+        }
+        const {
+            width,
+            height,
+        } = moveable.state;
+        const errorWidth = width - (startOffsetWidth + prevWidth);
+        const errorHeight = height - (startOffsetHeight + prevHeight);
+        const isErrorWidth = abs(errorWidth) > 3;
+        const isErrorHeight = abs(errorHeight) > 3;
+
+        if (isErrorWidth) {
+            datas.startWidth += errorWidth;
+            datas.startOffsetWidth += errorWidth;
+            datas.prevWidth += errorWidth;
+        }
+        if (isErrorHeight) {
+            datas.startHeight += errorHeight;
+            datas.startOffsetHeight += errorHeight;
+            datas.prevHeight += errorHeight;
+        }
+        if (isErrorWidth || isErrorHeight) {
+            return this.dragControl(moveable, e);
+        }
+    },
+    dragControlEnd(
+        moveable: MoveableManagerInterface<ResizableProps & DraggableProps>,
+        e: any,
+    ) {
+        const { datas, parentEvent } = e;
+        if (!datas.isResize) {
+            return;
+        }
+        datas.isResize = false;
+
+        const params = fillEndParams<OnResizeEnd>(moveable, e, {});
+        !parentEvent && triggerEvent(moveable, "onResizeEnd", params);
+        return params;
+    },
+    dragGroupControlCondition: directionCondition,
+    dragGroupControlStart(moveable: MoveableGroupInterface<any, any>, e: any) {
+        const { datas } = e;
+        const params = this.dragControlStart(moveable, {...e, isGroup: true });
+
+        if (!params) {
+            return false;
+        }
+        const originalEvents = fillChildEvents(moveable, "resizable", e);
+        const {
+            startOffsetWidth: parentStartOffsetWidth,
+            startOffsetHeight: parentStartOffsetHeight,
+        } = datas;
+
+        function updateGroupMin() {
+            const originalMinSize = datas.minSize;
+            originalEvents.forEach(ev => {
+                const {
+                    minSize: childMinSize,
+                    startOffsetWidth: childStartOffsetWidth,
+                    startOffsetHeight: childStartOffsetHeight,
+                } = ev.datas;
+
+                const parentMinWidth = parentStartOffsetWidth
+                    * (childStartOffsetWidth ? childMinSize[0] / childStartOffsetWidth : 0);
+                const parentMinHeight = parentStartOffsetHeight
+                    * (childStartOffsetHeight ? childMinSize[1] / childStartOffsetHeight : 0);
+
+                originalMinSize[0] = Math.max(originalMinSize[0], parentMinWidth);
+                originalMinSize[1] = Math.max(originalMinSize[1], parentMinHeight);
+            });
+        }
+
+        function updateGroupMax() {
+            const originalMaxSize = datas.maxSize;
+            originalEvents.forEach(ev => {
+                const {
+                    maxSize: childMaxSize,
+                    startOffsetWidth: childStartOffsetWidth,
+                    startOffsetHeight: childStartOffsetHeight,
+                } = ev.datas;
+
+                const parentMaxWidth = parentStartOffsetWidth
+                    * (childStartOffsetWidth ? childMaxSize[0] / childStartOffsetWidth : 0);
+                const parentMaxHeight = parentStartOffsetHeight
+                    * (childStartOffsetHeight ? childMaxSize[1] / childStartOffsetHeight : 0);
+
+                originalMaxSize[0] = Math.min(originalMaxSize[0], parentMaxWidth);
+                originalMaxSize[1] = Math.min(originalMaxSize[1], parentMaxHeight);
+            });
+        }
+        const events = triggerChildAbles(
+            moveable,
+            this,
+            "dragControlStart",
+            e,
+            (child, ev) => {
+                return startChildDist(moveable, child, datas, ev);
+            },
+        );
+
+
+        updateGroupMin();
+        updateGroupMax();
+
+        const setFixedDirection = (fixedDirection: number[]) => {
+            params.setFixedDirection(fixedDirection);
+            events.forEach((ev, i) => {
+                ev.setFixedDirection(fixedDirection);
+                startChildDist(moveable, ev.moveable, datas, originalEvents[i]);
+            });
+        };
+
+        datas.setFixedDirection = setFixedDirection;
+
+        const nextParams: OnResizeGroupStart = {
+            ...params,
+            targets: moveable.props.targets!,
+            events: events.map(ev => {
+                return {
+                    ...ev,
+                    setMin: (minSize: Array<number | string>) => {
+                        ev.setMin(minSize);
+                        updateGroupMin();
+                    },
+                    setMax: (maxSize: Array<number | string>) => {
+                        ev.setMax(maxSize);
+                        updateGroupMax();
+                    },
+                };
+            }),
+            setFixedDirection,
+            setMin: (minSize: Array<number | string>) => {
+                params.setMin(minSize);
+                updateGroupMin();
+            },
+            setMax: (maxSize: Array<number | string>) => {
+                params.setMax(maxSize);
+                updateGroupMax();
+            },
+        };
+        const result = triggerEvent(moveable, "onResizeGroupStart", nextParams);
+
+        datas.isResize = result !== false;
+        return datas.isResize ? params : false;
+    },
+    dragGroupControl(moveable: MoveableGroupInterface<any, any>, e: any) {
+        const { datas } = e;
+        if (!datas.isResize) {
+            return;
+        }
+        const props = getProps(moveable.props, "resizable");
+
+        catchEvent(moveable, "onBeforeResize", parentEvent => {
+            triggerEvent(moveable, "onBeforeResizeGroup", fillParams<OnBeforeResizeGroup>(moveable, e, {
+                ...parentEvent,
+                targets: props.targets!,
+            }, true));
+        });
+
+
+        const params = this.dragControl(moveable, {...e, isGroup: true });
+
+        if (!params) {
+            return;
+        }
+        const {
+            boundingWidth,
+            boundingHeight,
+            dist,
+        } = params;
+
+        const keepRatio = props.keepRatio;
+
+        const parentScale = [
+            boundingWidth / (boundingWidth - dist[0]),
+            boundingHeight / (boundingHeight - dist[1]),
+        ];
+        const fixedPosition = datas.fixedPosition;
+
+        const events = triggerChildAbles(
+            moveable,
+            this,
+            "dragControl",
+            e,
+            (_, ev) => {
+                const [clientX, clientY] = calculate(
+                    createRotateMatrix(moveable.rotation / 180 * Math.PI, 3),
+                    [
+                        ev.datas.originalX * parentScale[0],
+                        ev.datas.originalY * parentScale[1],
+                        1,
+                    ],
+                    3,
+                );
+
+                return {
+                    ...ev,
+                    parentDist: null,
+                    parentScale,
+                    dragClient: plus(fixedPosition, [clientX, clientY]),
+                    parentKeepRatio: keepRatio,
+                };
+            },
+        );
+        const nextParams: OnResizeGroup = {
+            targets: props.targets!,
+            events,
+            ...params,
+        };
+
+        triggerEvent(moveable, "onResizeGroup", nextParams);
+        return nextParams;
+    },
+    dragGroupControlEnd(moveable: MoveableGroupInterface<any, any>, e: any) {
+        const { isDrag, datas } = e;
+
+        if (!datas.isResize) {
+            return;
+        }
+
+        this.dragControlEnd(moveable, e);
+        const events = triggerChildAbles(moveable, this, "dragControlEnd", e);
+
+        const nextParams: OnResizeGroupEnd = fillEndParams<OnResizeGroupEnd>(moveable, e, {
+            targets: moveable.props.targets!,
+            events,
+        });
+
+        triggerEvent(moveable, "onResizeGroupEnd", nextParams);
+        return isDrag;
+    },
+    /**
+     * @method Moveable.Resizable#request
+     * @param {Moveable.Resizable.ResizableRequestParam} e - the Resizable's request parameter
+     * @return {Moveable.Requester} Moveable Requester
+     * @example
+
+     * // Instantly Request (requestStart - request - requestEnd)
+     * // Use Relative Value
+     * moveable.request("resizable", { deltaWidth: 10, deltaHeight: 10 }, true);
+     *
+     * // Use Absolute Value
+     * moveable.request("resizable", { offsetWidth: 100, offsetHeight: 100 }, true);
+     *
+     * // requestStart
+     * const requester = moveable.request("resizable");
+     *
+     * // request
+     * // Use Relative Value
+     * requester.request({ deltaWidth: 10, deltaHeight: 10 });
+     * requester.request({ deltaWidth: 10, deltaHeight: 10 });
+     * requester.request({ deltaWidth: 10, deltaHeight: 10 });
+     *
+     * // Use Absolute Value
+     * moveable.request("resizable", { offsetWidth: 100, offsetHeight: 100 });
+     * moveable.request("resizable", { offsetWidth: 110, offsetHeight: 100 });
+     * moveable.request("resizable", { offsetWidth: 120, offsetHeight: 100 });
+     *
+     * // requestEnd
+     * requester.requestEnd();
+     */
+    request(moveable: MoveableManagerInterface<any>) {
+        const datas: Record<string, any> = {};
+        let distWidth = 0;
+        let distHeight = 0;
+        let useSnap = false;
+        const rect = moveable.getRect();
+
+        return {
+            isControl: true,
+            requestStart(e: ResizableRequestParam) {
+                useSnap = e.useSnap!;
+
+                return {
+                    datas, parentDirection: e.direction || [1, 1],
+                    parentIsWidth: e?.horizontal ?? true,
+                    useSnap,
+                };
+            },
+            request(e: ResizableRequestParam) {
+                if ("offsetWidth" in e) {
+                    distWidth = e.offsetWidth! - rect.offsetWidth;
+                } else if ("deltaWidth" in e) {
+                    distWidth += e.deltaWidth!;
+                }
+                if ("offsetHeight" in e) {
+                    distHeight = e.offsetHeight! - rect.offsetHeight;
+                } else if ("deltaHeight" in e) {
+                    distHeight += e.deltaHeight!;
+                }
+
+
+                return {
+                    datas,
+                    parentDist: [distWidth, distHeight],
+                    parentKeepRatio: e.keepRatio,
+                    useSnap,
+                };
+            },
+            requestEnd() {
+                return { datas, isDrag: true, useSnap };
+            },
+        };
+    },
+    unset(moveable: MoveableManagerInterface<any, {}>) {
+        moveable.state.gestos.resizable = null;
+    },
+};
+
+/**
+ * Whether or not target can be resized.
+ * @name Moveable.Resizable#resizable
+ * @default false
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     resizable: false,
+ * });
+ *
+ * moveable.resizable = true;
+ */
+
+/**
+ * throttle of width, height when resize. If throttleResize is set to less than 1, the target may shake.
+ * @name Moveable.Resizable#throttleResize
+ * @default 1
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *   resizable: true,
+ *   throttleResize: 1,
+ * });
+ *
+ * moveable.throttleResize = 0;
+ */
+/**
+ * When resize or scale, keeps a ratio of the width, height.
+ * @name Moveable.Resizable#keepRatio
+ * @default false
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *   resizable: true,
+ * });
+ *
+ * moveable.keepRatio = true;
+ */
+/**
+ * Set directions to show the control box.
+ * @name Moveable.Resizable#renderDirections
+ * @default ["n", "nw", "ne", "s", "se", "sw", "e", "w"]
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *   resizable: true,
+ *   renderDirections: ["n", "nw", "ne", "s", "se", "sw", "e", "w"],
+ * });
+ *
+ * moveable.renderDirections = ["nw", "ne", "sw", "se"];
+ */
+
+/**
+ * Function to convert size for resize
+ * @name Moveable.Resizable#resizeFormat
+ * @default oneself
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *   resizable: true,
+ *   resizeFormat: v => v,
+ * });
+ *
+ * moveable.resizeFormat = (size: number[]) => ([Math.trunc(size[0]), Math.trunc(size[1])];
+ */
+
+/**
+ * When the resize starts, the resizeStart event is called.
+ * @memberof Moveable.Resizable
+ * @event resizeStart
+ * @param {Moveable.Resizable.OnResizeStart} - Parameters for the resizeStart event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, { resizable: true });
+ * moveable.on("resizeStart", ({ target }) => {
+ *     console.log(target);
+ * });
+ */
+
+/**
+ * When resizing, `beforeResize` is called before `resize` occurs. In `beforeResize`, you can get and set the pre-value before resizing.
+ * @memberof Moveable.Resizable
+ * @event beforeResize
+ * @param {Moveable.Resizable.OnBeforeResize} - Parameters for the `beforeResize` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, { resizable: true });
+ * moveable.on("beforeResize", ({ setFixedDirection }) => {
+ *     if (shiftKey) {
+ *        setFixedDirection([0, 0]);
+ *     }
+ * });
+ * moveable.on("resize", ({ target, width, height, drag }) => {
+ *     target.style.width = `${width}px`;
+ *     target.style.height = `${height}px`;
+ *     target.style.transform = drag.transform;
+ * });
+ */
+
+/**
+ * When resizing, the resize event is called.
+ * @memberof Moveable.Resizable
+ * @event resize
+ * @param {Moveable.Resizable.OnResize} - Parameters for the resize event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, { resizable: true });
+ * moveable.on("resize", ({ target, width, height }) => {
+ *     target.style.width = `${e.width}px`;
+ *     target.style.height = `${e.height}px`;
+ * });
+ */
+/**
+ * When the resize finishes, the resizeEnd event is called.
+ * @memberof Moveable.Resizable
+ * @event resizeEnd
+ * @param {Moveable.Resizable.OnResizeEnd} - Parameters for the resizeEnd event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, { resizable: true });
+ * moveable.on("resizeEnd", ({ target, isDrag }) => {
+ *     console.log(target, isDrag);
+ * });
+ */
+
+/**
+* When the group resize starts, the `resizeGroupStart` event is called.
+* @memberof Moveable.Resizable
+* @event resizeGroupStart
+* @param {Moveable.Resizable.OnResizeGroupStart} - Parameters for the `resizeGroupStart` event
+* @example
+* import Moveable from "moveable";
+*
+* const moveable = new Moveable(document.body, {
+*     target: [].slice.call(document.querySelectorAll(".target")),
+*     resizable: true
+* });
+* moveable.on("resizeGroupStart", ({ targets }) => {
+*     console.log("onResizeGroupStart", targets);
+* });
+*/
+
+/**
+* When the group resize, the `resizeGroup` event is called.
+* @memberof Moveable.Resizable
+* @event resizeGroup
+* @param {Moveable.Resizable.onResizeGroup} - Parameters for the `resizeGroup` event
+* @example
+* import Moveable from "moveable";
+*
+* const moveable = new Moveable(document.body, {
+*     target: [].slice.call(document.querySelectorAll(".target")),
+*     resizable: true
+* });
+* moveable.on("resizeGroup", ({ targets, events }) => {
+*     console.log("onResizeGroup", targets);
+*     events.forEach(ev => {
+*         const offset = [
+*             direction[0] < 0 ? -ev.delta[0] : 0,
+*             direction[1] < 0 ? -ev.delta[1] : 0,
+*         ];
+*         // ev.drag is a drag event that occurs when the group resize.
+*         const left = offset[0] + ev.drag.beforeDist[0];
+*         const top = offset[1] + ev.drag.beforeDist[1];
+*         const width = ev.width;
+*         const top = ev.top;
+*     });
+* });
+*/
+
+/**
+ * When the group resize finishes, the `resizeGroupEnd` event is called.
+ * @memberof Moveable.Resizable
+ * @event resizeGroupEnd
+ * @param {Moveable.Resizable.OnResizeGroupEnd} - Parameters for the `resizeGroupEnd` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     target: [].slice.call(document.querySelectorAll(".target")),
+ *     resizable: true
+ * });
+ * moveable.on("resizeGroupEnd", ({ targets, isDrag }) => {
+ *     console.log("onResizeGroupEnd", targets, isDrag);
+ * });
+ */
+
+
+
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + diff --git a/release/0.52.0/doc/packages_react-moveable_src_ables_Rotatable.tsx.html b/release/0.52.0/doc/packages_react-moveable_src_ables_Rotatable.tsx.html new file mode 100644 index 000000000..5e32e0435 --- /dev/null +++ b/release/0.52.0/doc/packages_react-moveable_src_ables_Rotatable.tsx.html @@ -0,0 +1,1143 @@ + + + + + packages/react-moveable/src/ables/Rotatable.tsx - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

packages/react-moveable/src/ables/Rotatable.tsx

+ + + + + + + +
+
+
import {
+    prefix, triggerEvent, fillParams,
+    calculatePosition, fillEndParams, getRotationRad, getRefTargets,
+    catchEvent, getProps, calculateMoveableClientPositions,
+    fillAfterTransform,
+    getTotalOrigin,
+} from "../utils";
+import {
+    IObject, hasClass, getRad,
+    throttle,
+    getDist,
+    getKeys,
+    isArray,
+} from "@daybrush/utils";
+import {
+    RotatableProps, OnRotateGroup, OnRotateGroupEnd,
+    Renderer, OnRotateGroupStart, OnRotateStart, OnRotate,
+    OnRotateEnd, MoveableClientRect, SnappableProps,
+    SnappableState, MoveableManagerInterface, MoveableGroupInterface, DraggableProps,
+    OnBeforeRotate,
+    OnBeforeRotateGroup,
+    OnResizeStart,
+    OnResize,
+    TransformObject,
+    OnDragStart,
+} from "../types";
+import { triggerChildAbles } from "../groupUtils";
+import { calculate, convertPositionMatrix, getOrigin, minus, plus, rotate as rotateMatrix } from "@scena/matrix";
+import CustomGesto, { setCustomDrag } from "../gesto/CustomGesto";
+import { checkSnapRotate } from "./Snappable";
+import {
+    fillTransformStartEvent,
+    convertTransformFormat, getRotateDist,
+    fillTransformEvent,
+    setDefaultTransformIndex,
+    resolveTransformEvent,
+    getTransformDirection,
+    getPosByDirection,
+    getTranslateFixedPosition,
+} from "../gesto/GestoUtils";
+import { DirectionControlInfo, renderAroundControls, renderDirectionControlsByInfos } from "../renderDirections";
+import { DIRECTION_REGION_TO_DIRECTION } from "../consts";
+import Resizable from "./Resizable";
+import Draggable from "./Draggable";
+import { getOffsetFixedDirectionInfo, getOffsetFixedPositionInfo } from "../utils/getFixedDirection";
+
+/**
+ * @namespace Rotatable
+ * @memberof Moveable
+ * @description Rotatable indicates whether the target can be rotated.
+ */
+
+function setRotateStartInfo(
+    moveable: MoveableManagerInterface<any, any>,
+    datas: IObject<any>, clientX: number, clientY: number,
+    rect: MoveableClientRect,
+) {
+    const groupable = moveable.props.groupable;
+    const state = moveable.state;
+    const n = state.is3d ? 4 : 3;
+    const origin = datas.origin;
+    const nextOrigin = calculatePosition(
+        moveable.state.rootMatrix,
+        // TO-DO #710
+        minus([origin[0], origin[1]], groupable ? [0, 0] : [state.left, state.top]),
+        n,
+    );
+    const startAbsoluteOrigin = plus([rect.left, rect.top], nextOrigin);
+
+    datas.startAbsoluteOrigin = startAbsoluteOrigin;
+    datas.prevDeg = getRad(startAbsoluteOrigin, [clientX, clientY]) / Math.PI * 180;
+    datas.defaultDeg = datas.prevDeg;
+    datas.prevSnapDeg = 0;
+    datas.loop = 0;
+    datas.startDist = getDist(startAbsoluteOrigin, [clientX, clientY]);
+}
+
+function getAbsoluteDist(
+    deg: number,
+    direction: number,
+    datas: IObject<any>,
+) {
+    const {
+        defaultDeg,
+        prevDeg,
+    } = datas;
+
+
+    let normalizedPrevDeg = prevDeg % 360;
+    let loop = Math.floor(prevDeg / 360);
+
+    if (normalizedPrevDeg < 0) {
+        normalizedPrevDeg += 360;
+    }
+
+    if (normalizedPrevDeg > deg && normalizedPrevDeg > 270 && deg < 90) {
+        // 360 => 0
+        ++loop;
+    } else if (normalizedPrevDeg < deg && normalizedPrevDeg < 90 && deg > 270) {
+        // 0 => 360
+        --loop;
+    }
+    const dist = direction * (loop * 360 + deg - defaultDeg);
+
+    datas.prevDeg = defaultDeg + dist;
+
+    return dist;
+}
+function getAbsoluteDistByClient(
+    clientX: number, clientY: number,
+    direction: number,
+    datas: IObject<any>,
+) {
+    return getAbsoluteDist(
+        getRad(datas.startAbsoluteOrigin, [clientX, clientY]) / Math.PI * 180,
+        direction,
+        datas,
+    );
+}
+function getRotateInfo(
+    moveable: MoveableManagerInterface<any, any>,
+    moveableRect: any,
+    datas: IObject<any>,
+    dist: number,
+    startValue: number,
+    checkSnap?: boolean,
+) {
+    const {
+        throttleRotate = 0,
+    } = moveable.props;
+    const prevSnapDeg = datas.prevSnapDeg;
+    let snapRotation = 0;
+    let isSnap = false;
+
+    if (checkSnap) {
+        const result = checkSnapRotate(
+            moveable,
+            moveableRect,
+            dist,
+            startValue + dist,
+        );
+
+        isSnap = result.isSnap;
+        snapRotation = startValue + result.dist;
+    }
+
+    if (!isSnap) {
+        snapRotation = throttle(startValue + dist, throttleRotate);
+    }
+    const snapDeg = snapRotation - startValue;
+
+    datas.prevSnapDeg = snapDeg;
+
+    return [snapDeg - prevSnapDeg, snapDeg, snapRotation];
+
+
+}
+
+export function getReversePositionX(dir: string) {
+    if (dir === "left") {
+        return "right";
+    } else if (dir === "right") {
+        return "left";
+    }
+    return dir;
+}
+export function getReversePositionY(dir: string) {
+    if (dir === "top") {
+        return "bottom";
+    } else if (dir === "bottom") {
+        return "top";
+    }
+    return dir;
+}
+export function getRotationPositions(
+    rotationPosition: RotatableProps["rotationPosition"],
+    [pos1, pos2, pos3, pos4]: number[][],
+    direction: number,
+): [number[], number][] {
+    if (rotationPosition === "none") {
+        return [];
+    }
+    if (isArray(rotationPosition)) {
+        return rotationPosition.map(child => getRotationPositions(
+            child,
+            [pos1, pos2, pos3, pos4],
+            direction,
+        )[0]);
+    }
+    const [dir1, dir2] = (rotationPosition || "top").split("-");
+    let radPoses = [pos1, pos2];
+
+    if (dir1 === "left") {
+        radPoses = [pos3, pos1];
+    } else if (dir1 === "right") {
+        radPoses = [pos2, pos4];
+    } else if (dir1 === "bottom") {
+        radPoses = [pos4, pos3];
+    }
+    let pos = [
+        (radPoses[0][0] + radPoses[1][0]) / 2,
+        (radPoses[0][1] + radPoses[1][1]) / 2,
+    ];
+    const rad = getRotationRad(radPoses, direction);
+    if (dir2) {
+        const isStart = dir2 === "top" || dir2 === "left";
+        const isReverse = dir1 === "bottom" || dir1 === "left";
+
+        pos = radPoses[(isStart && !isReverse) || (!isStart && isReverse) ? 0 : 1];
+    }
+    return [[pos, rad]];
+}
+
+export function dragControlCondition(moveable: MoveableManagerInterface<RotatableProps>, e: any) {
+    if (e.isRequest) {
+        return e.requestAble === "rotatable";
+    }
+    const target = e.inputEvent.target as HTMLElement;
+    if (
+        hasClass(target, prefix("rotation-control"))
+        || (moveable.props.rotateAroundControls && hasClass(target, prefix("around-control")))
+        || (hasClass(target, prefix("control")) && hasClass(target, prefix("rotatable")))
+    ) {
+        return true;
+    }
+    const rotationTarget = moveable.props.rotationTarget;
+
+    if (rotationTarget) {
+        return getRefTargets(rotationTarget, true).some(element => {
+            if (!element) {
+                return false;
+            }
+            return target === element || target.contains(element);
+        });
+    }
+    return false;
+}
+
+const css = `.rotation {
+position: absolute;
+height: 40px;
+width: 1px;
+transform-origin: 50% 100%;
+height: calc(40px * var(--zoom));
+top: auto;
+left: 0;
+bottom: 100%;
+will-change: transform;
+}
+.rotation .rotation-line {
+display: block;
+width: 100%;
+height: 100%;
+transform-origin: 50% 50%;
+}
+.rotation .rotation-control {
+border-color: #4af;
+border-color: var(--moveable-color);
+background:#fff;
+cursor: alias;
+}
+:global .view-rotation-dragging, .rotatable.direction.control {
+cursor: alias;
+}
+.rotatable.direction.control.move {
+cursor: move;
+}
+`;
+export default {
+    name: "rotatable",
+    canPinch: true,
+    props: [
+        "rotatable",
+        "rotationPosition",
+        "throttleRotate",
+        "renderDirections",
+        "rotationTarget",
+        "rotateAroundControls",
+        "edge",
+        "resolveAblesWithRotatable",
+        "displayAroundControls",
+    ] as const,
+    events: [
+        "rotateStart",
+        "beforeRotate",
+        "rotate",
+        "rotateEnd",
+        "rotateGroupStart",
+        "beforeRotateGroup",
+        "rotateGroup",
+        "rotateGroupEnd",
+    ] as const,
+    css: [css],
+    viewClassName(moveable: MoveableManagerInterface<RotatableProps>) {
+        if (!moveable.isDragging("rotatable")) {
+            return "";
+        }
+        return prefix("view-rotation-dragging");
+    },
+    render(moveable: MoveableManagerInterface<RotatableProps>, React: Renderer): any {
+        const {
+            rotatable,
+            rotationPosition,
+            zoom,
+            renderDirections,
+            rotateAroundControls,
+            resolveAblesWithRotatable,
+        } = getProps(moveable.props, "rotatable");
+        const {
+            renderPoses,
+            direction,
+        } = moveable.getState();
+        if (!rotatable) {
+            return null;
+        }
+        const positions = getRotationPositions(rotationPosition!, renderPoses, direction);
+        const jsxs: any[] = [];
+
+        positions.forEach(([pos, rad], i) => {
+            jsxs.push(
+                <div key={`rotation${i}`} className={prefix("rotation")} style={{
+                    // tslint:disable-next-line: max-line-length
+                    transform: `translate(-50%) translate(${pos[0]}px, ${pos[1]}px) rotate(${rad}rad)`,
+                }}>
+                    <div className={prefix("line rotation-line")} style={{
+                        transform: `scaleX(${zoom})`,
+                    }}></div>
+                    <div className={prefix("control rotation-control")} style={{
+                        transform: `translate(0.5px) scale(${zoom})`,
+                    }}></div>
+                </div>
+            );
+        });
+        if (renderDirections) {
+            const ables = getKeys(resolveAblesWithRotatable || {});
+            const resolveMap: Record<string, string> = {};
+
+            ables.forEach(name => {
+                resolveAblesWithRotatable![name]!.forEach(direction => {
+                    resolveMap[direction] = name;
+                });
+            });
+
+            let directionControlInfos: DirectionControlInfo[] = [];
+
+            if (isArray(renderDirections)) {
+                directionControlInfos = renderDirections.map(dir => {
+                    const able = resolveMap[dir];
+
+                    return {
+                        data: able ? { resolve: able } : {},
+                        classNames: able ? [`move`] : [],
+                        dir,
+                    };
+                });
+            }
+
+            jsxs.push(...renderDirectionControlsByInfos(
+                moveable,
+                "rotatable",
+                directionControlInfos,
+                React,
+            ));
+        }
+        if (rotateAroundControls) {
+            jsxs.push(...renderAroundControls(moveable, React));
+        }
+
+        return jsxs;
+    },
+    dragControlCondition: dragControlCondition as (moveable: any, e: any) => boolean,
+    dragControlStart(
+        moveable: MoveableManagerInterface<RotatableProps & SnappableProps & DraggableProps, SnappableState>,
+        e: any) {
+        const {
+            datas,
+            clientX, clientY,
+            parentRotate, parentFlag, isPinch,
+            isRequest,
+        } = e;
+        const state = moveable.state;
+        const {
+            target, left, top,
+            direction, beforeDirection, targetTransform,
+            moveableClientRect,
+            offsetMatrix,
+            targetMatrix,
+            allMatrix,
+            width,
+            height,
+        } = state;
+
+        if (!isRequest && !target) {
+            return false;
+        }
+
+        const rect = moveable.getRect();
+        datas.rect = rect;
+        datas.transform = targetTransform;
+        datas.left = left;
+        datas.top = top;
+        let setFixedPosition = (fixedPosition: number[]) => {
+            const result = getOffsetFixedPositionInfo(moveable.state, fixedPosition);
+
+            datas.fixedDirection = result.fixedDirection;
+            datas.fixedOffset = result.fixedOffset;
+            datas.fixedPosition = result.fixedPosition;
+
+
+            if (resizeStart) {
+                resizeStart.setFixedPosition(fixedPosition);
+            }
+        };
+        let setFixedDirection: OnRotateStart["setFixedDirection"] = (fixedDirection: number[]) => {
+            const result = getOffsetFixedDirectionInfo(moveable.state, fixedDirection);
+
+            datas.fixedDirection = result.fixedDirection;
+            datas.fixedOffset = result.fixedOffset;
+            datas.fixedPosition = result.fixedPosition;
+
+            if (resizeStart) {
+                resizeStart.setFixedDirection(fixedDirection);
+            }
+        };
+        let startClientX = clientX;
+        let startClientY = clientY;
+
+        if (isRequest || isPinch || parentFlag) {
+            const externalRotate = parentRotate || 0;
+
+            datas.beforeInfo = {
+                origin: rect.beforeOrigin,
+                prevDeg: externalRotate,
+                defaultDeg: externalRotate,
+                prevSnapDeg: 0,
+                startDist: 0,
+            };
+            datas.afterInfo = {
+                ...datas.beforeInfo,
+                origin: rect.origin,
+            };
+            datas.absoluteInfo = {
+                ...datas.beforeInfo,
+                origin: rect.origin,
+                startValue: externalRotate,
+            };
+        } else {
+            const inputTarget = e.inputEvent?.target;
+
+            if (inputTarget) {
+                const regionDirection = inputTarget.getAttribute("data-direction") || "";
+                const controlDirection = DIRECTION_REGION_TO_DIRECTION[regionDirection];
+
+                if (controlDirection) {
+                    datas.isControl = true;
+                    datas.isAroundControl = hasClass(inputTarget, prefix("around-control"));
+                    datas.controlDirection = controlDirection;
+                    const resolve = inputTarget.getAttribute("data-resolve");
+
+                    if (resolve) {
+                        datas.resolveAble = resolve;
+                    }
+
+                    const clientPoses = calculateMoveableClientPositions(
+                        state.rootMatrix,
+                        state.renderPoses,
+                        moveableClientRect,
+                    );
+
+
+                    [startClientX, startClientY] = getPosByDirection(clientPoses, controlDirection);
+                }
+            }
+            datas.beforeInfo = { origin: rect.beforeOrigin };
+            datas.afterInfo = { origin: rect.origin };
+            datas.absoluteInfo = {
+                origin: rect.origin,
+                startValue: rect.rotation,
+            };
+
+            const originalFixedPosition = setFixedPosition;
+
+            setFixedPosition = (fixedPosition: number[]) => {
+                const n = state.is3d ? 4 : 3;
+                const [originX, originY] = plus(getOrigin(targetMatrix, n), fixedPosition);
+                const fixedBeforeOrigin = calculate(
+                    offsetMatrix,
+                    convertPositionMatrix([originX, originY], n),
+                );
+                const fixedAfterOrigin = calculate(
+                    allMatrix,
+                    convertPositionMatrix([fixedPosition[0], fixedPosition[1]], n),
+                );
+                originalFixedPosition(fixedPosition);
+                const posDelta = state.posDelta;
+
+                datas.beforeInfo.origin = minus(fixedBeforeOrigin, posDelta);
+                datas.afterInfo.origin = minus(fixedAfterOrigin, posDelta);
+                datas.absoluteInfo.origin = minus(fixedAfterOrigin, posDelta);
+
+                setRotateStartInfo(moveable, datas.beforeInfo, startClientX, startClientY, moveableClientRect);
+                setRotateStartInfo(moveable, datas.afterInfo, startClientX, startClientY, moveableClientRect);
+                setRotateStartInfo(moveable, datas.absoluteInfo, startClientX, startClientY, moveableClientRect);
+            };
+            setFixedDirection = (fixedDirection: number[]) => {
+                const fixedPosition = getPosByDirection([
+                    [0, 0],
+                    [width, 0],
+                    [0, height],
+                    [width, height],
+                ], fixedDirection);
+
+                setFixedPosition(fixedPosition);
+            };
+        }
+
+        datas.startClientX = startClientX;
+        datas.startClientY = startClientY;
+        datas.direction = direction;
+        datas.beforeDirection = beforeDirection;
+        datas.startValue = 0;
+        datas.datas = {};
+
+        setDefaultTransformIndex(moveable, e, "rotate");
+
+        let dragStart: OnDragStart | false = false;
+        let resizeStart: OnResizeStart | false = false;
+
+        if (datas.isControl && datas.resolveAble) {
+            const resolveAble = datas.resolveAble;
+
+            if (resolveAble === "resizable") {
+                resizeStart = Resizable.dragControlStart(moveable, {
+                    ...(new CustomGesto("resizable").dragStart([0, 0], e)),
+                    parentPosition: datas.controlPosition,
+                    parentFixedPosition: datas.fixedPosition,
+                });
+            }
+        }
+
+        if (!resizeStart) {
+            dragStart = Draggable.dragStart!(
+                moveable,
+                new CustomGesto().dragStart([0, 0], e),
+            );
+        }
+
+        setFixedPosition(getTotalOrigin(moveable));
+        const params = fillParams<OnRotateStart>(moveable, e, {
+            set: (rotatation: number) => {
+                datas.startValue = rotatation * Math.PI / 180;
+            },
+            setFixedDirection,
+            setFixedPosition,
+            ...fillTransformStartEvent(moveable, e),
+            dragStart,
+            resizeStart,
+        });
+        const result = triggerEvent(moveable, "onRotateStart", params);
+        datas.isRotate = result !== false;
+        state.snapRenderInfo = {
+            request: e.isRequest,
+        };
+
+        return datas.isRotate ? params : false;
+    },
+    dragControl(
+        moveable: MoveableManagerInterface<RotatableProps & DraggableProps>,
+        e: any,
+    ) {
+        const {
+            datas, clientDistX, clientDistY,
+            parentRotate, parentFlag, isPinch, groupDelta,
+            resolveMatrix,
+        } = e;
+        const {
+            beforeDirection,
+            beforeInfo,
+            afterInfo,
+            absoluteInfo,
+            isRotate,
+            startValue,
+            rect,
+            startClientX,
+            startClientY,
+        } = datas;
+
+        if (!isRotate) {
+            return;
+        }
+
+        resolveTransformEvent(moveable, e, "rotate");
+
+        const targetDirection = getTransformDirection(e);
+        const direction = beforeDirection * targetDirection;
+        const {
+            parentMoveable,
+        } = moveable.props;
+
+
+        let beforeDelta = 0;
+        let beforeDist: number;
+        let beforeRotation: number;
+
+        let delta = 0;
+        let dist: number;
+        let rotation: number;
+
+        let absoluteDelta = 0;
+        let absoluteDist: number;
+        let absoluteRotation: number;
+
+        const startRotation = 180 / Math.PI * startValue;
+        const absoluteStartRotation = absoluteInfo.startValue;
+        let isSnap = false;
+        const nextClientX = startClientX + clientDistX;
+        const nextClientY = startClientY + clientDistY;
+
+        if (!parentFlag && "parentDist" in e) {
+            const parentDist = e.parentDist;
+
+            beforeDist = parentDist;
+            dist = parentDist;
+            absoluteDist = parentDist;
+        } else if (isPinch || parentFlag) {
+            beforeDist = getAbsoluteDist(parentRotate, beforeDirection, beforeInfo);
+            dist = getAbsoluteDist(parentRotate, direction, afterInfo);
+            absoluteDist = getAbsoluteDist(parentRotate, direction, absoluteInfo);
+        } else {
+            beforeDist = getAbsoluteDistByClient(nextClientX, nextClientY, beforeDirection, beforeInfo);
+            dist = getAbsoluteDistByClient(nextClientX, nextClientY, direction, afterInfo);
+            absoluteDist = getAbsoluteDistByClient(nextClientX, nextClientY, direction, absoluteInfo);
+            isSnap = true;
+        }
+        beforeRotation = startRotation + beforeDist;
+        rotation = startRotation + dist;
+        absoluteRotation = absoluteStartRotation + absoluteDist;
+
+
+        triggerEvent(moveable, "onBeforeRotate", fillParams<OnBeforeRotate>(moveable, e, {
+            beforeRotation,
+            rotation,
+            absoluteRotation,
+            setRotation(nextRotation: number) {
+                dist = nextRotation - startRotation;
+                beforeDist = dist;
+                absoluteDist = dist;
+            },
+        }, true));
+
+        [
+            beforeDelta,
+            beforeDist,
+            beforeRotation,
+        ] = getRotateInfo(moveable, rect, beforeInfo, beforeDist, startRotation, isSnap);
+
+        [
+            delta,
+            dist,
+            rotation,
+        ] = getRotateInfo(moveable, rect, afterInfo, dist, startRotation, isSnap);
+
+        [
+            absoluteDelta,
+            absoluteDist,
+            absoluteRotation,
+        ] = getRotateInfo(moveable, rect, absoluteInfo, absoluteDist, absoluteStartRotation, isSnap);
+
+        if (!absoluteDelta && !delta && !beforeDelta && !parentMoveable && !resolveMatrix) {
+            return;
+        }
+
+        const nextTransform = convertTransformFormat(
+            datas, `rotate(${rotation}deg)`, `rotate(${dist}deg)`,
+        );
+        if (resolveMatrix) {
+            datas.fixedPosition = getTranslateFixedPosition(
+                moveable,
+                datas.targetAllTransform,
+                datas.fixedDirection,
+                datas.fixedOffset,
+                datas,
+            );
+        }
+
+        const inverseDist = getRotateDist(moveable, dist, datas);
+        const inverseDelta = minus(
+            plus(groupDelta || [0, 0], inverseDist),
+            datas.prevInverseDist || [0, 0],
+        );
+        datas.prevInverseDist = inverseDist;
+        datas.requestValue = null;
+
+        const dragEvent = fillTransformEvent(
+            moveable,
+            nextTransform,
+            inverseDelta,
+            isPinch,
+            e,
+        );
+
+        let transformEvent: TransformObject = dragEvent;
+        const parentDistance = getDist(
+            [nextClientX, nextClientY],
+            absoluteInfo.startAbsoluteOrigin,
+        ) - absoluteInfo.startDist;
+
+        let resize: OnResize | undefined = undefined;
+
+        if (datas.resolveAble === "resizable") {
+            const resizeEvent = Resizable.dragControl(
+                moveable,
+                {
+                    ...setCustomDrag(e, moveable.state, [e.deltaX, e.deltaY], !!isPinch, false, "resizable"),
+                    resolveMatrix: true,
+                    parentDistance,
+                },
+            );
+
+            if (resizeEvent) {
+                resize = resizeEvent;
+                transformEvent = fillAfterTransform(transformEvent, resizeEvent, e);
+            }
+        }
+
+        const params = fillParams<OnRotate>(moveable, e, {
+            delta,
+            dist,
+            rotate: rotation,
+            rotation,
+
+            beforeDist,
+            beforeDelta,
+            beforeRotate: beforeRotation,
+            beforeRotation,
+
+            absoluteDist,
+            absoluteDelta,
+            absoluteRotate: absoluteRotation,
+            absoluteRotation,
+
+            isPinch: !!isPinch,
+            resize,
+            ...dragEvent,
+            ...transformEvent,
+        });
+        triggerEvent(moveable, "onRotate", params);
+
+        return params;
+    },
+    dragControlEnd(moveable: MoveableManagerInterface<RotatableProps>, e: any) {
+        const { datas } = e;
+
+        if (!datas.isRotate) {
+            return;
+        }
+        datas.isRotate = false;
+
+        const params = fillEndParams<OnRotateEnd>(moveable, e, {});
+
+        triggerEvent(moveable, "onRotateEnd", params);
+        return params;
+    },
+    dragGroupControlCondition: dragControlCondition as (moveable: any, e: any) => boolean,
+    dragGroupControlStart(moveable: MoveableGroupInterface<any, any>, e: any) {
+        const { datas } = e;
+        const {
+            left: parentLeft,
+            top: parentTop,
+            beforeOrigin: parentBeforeOrigin,
+        } = moveable.state;
+
+        const params = this.dragControlStart(moveable, e);
+
+        if (!params) {
+            return false;
+        }
+
+        params.set(datas.beforeDirection * moveable.rotation);
+
+        const events = triggerChildAbles(
+            moveable,
+            this,
+            "dragControlStart",
+            e,
+            (child, ev) => {
+                const { left, top, beforeOrigin } = child.state;
+                const childClient = plus(
+                    minus([left, top], [parentLeft, parentTop]),
+                    minus(beforeOrigin, parentBeforeOrigin),
+                );
+
+                ev.datas.startGroupClient = childClient;
+                ev.datas.groupClient = childClient;
+                return { ...ev, parentRotate: 0 };
+            },
+        );
+
+        const nextParams: OnRotateGroupStart = {
+            ...params,
+            targets: moveable.props.targets!,
+            events,
+        };
+        const result = triggerEvent(moveable, "onRotateGroupStart", nextParams);
+
+        datas.isRotate = result !== false;
+
+        return datas.isRotate ? params : false;
+    },
+    dragGroupControl(moveable: MoveableGroupInterface<any, any>, e: any) {
+        const { datas } = e;
+
+        if (!datas.isRotate) {
+            return;
+        }
+
+        catchEvent(moveable, "onBeforeRotate", parentEvent => {
+            triggerEvent(moveable, "onBeforeRotateGroup", fillParams<OnBeforeRotateGroup>(moveable, e, {
+                ...parentEvent,
+                targets: moveable.props.targets!,
+            }, true));
+        });
+        const params = this.dragControl(moveable, e);
+
+        if (!params) {
+            return;
+        }
+        const direction = datas.beforeDirection;
+        const parentRotate = params.beforeDist;
+        const rad = parentRotate / 180 * Math.PI;
+        const events = triggerChildAbles(
+            moveable,
+            this,
+            "dragControl",
+            e,
+            (_, ev) => {
+                const startGroupClient = ev.datas.startGroupClient;
+                const [prevClientX, prevClientY] = ev.datas.groupClient;
+                const [clientX, clientY] = rotateMatrix(startGroupClient, rad * direction);
+                const delta = [clientX - prevClientX, clientY - prevClientY];
+
+                ev.datas.groupClient = [clientX, clientY];
+                return { ...ev, parentRotate, groupDelta: delta };
+            },
+        );
+        moveable.rotation = direction * params.beforeRotation;
+
+        const nextParams: OnRotateGroup = {
+            targets: moveable.props.targets!,
+            events,
+            set(rotation: number) {
+                moveable.rotation = rotation;
+            },
+            setGroupRotation(rotation: number) {
+                moveable.rotation = rotation;
+            },
+            ...params,
+        };
+
+        triggerEvent(moveable, "onRotateGroup", nextParams);
+        return nextParams;
+    },
+    dragGroupControlEnd(moveable: MoveableGroupInterface<any, any>, e: any) {
+        const { isDrag, datas } = e;
+
+        if (!datas.isRotate) {
+            return;
+        }
+
+        this.dragControlEnd(moveable, e);
+        const events = triggerChildAbles(moveable, this, "dragControlEnd", e);
+
+        const nextParams = fillEndParams<OnRotateGroupEnd>(moveable, e, {
+            targets: moveable.props.targets!,
+            events,
+        });
+
+        triggerEvent(moveable, "onRotateGroupEnd", nextParams);
+        return isDrag;
+    },
+    /**
+     * @method Moveable.Rotatable#request
+     * @param {object} [e] - the Resizable's request parameter
+     * @param {number} [e.deltaRotate=0] -  delta number of rotation
+     * @param {number} [e.rotate=0] - absolute number of moveable's rotation
+     * @return {Moveable.Requester} Moveable Requester
+     * @example
+
+     * // Instantly Request (requestStart - request - requestEnd)
+     * moveable.request("rotatable", { deltaRotate: 10 }, true);
+     *
+     * * moveable.request("rotatable", { rotate: 10 }, true);
+     *
+     * // requestStart
+     * const requester = moveable.request("rotatable");
+     *
+     * // request
+     * requester.request({ deltaRotate: 10 });
+     * requester.request({ deltaRotate: 10 });
+     * requester.request({ deltaRotate: 10 });
+     *
+     * requester.request({ rotate: 10 });
+     * requester.request({ rotate: 20 });
+     * requester.request({ rotate: 30 });
+     *
+     * // requestEnd
+     * requester.requestEnd();
+     */
+    request(moveable: MoveableManagerInterface<RotatableProps>) {
+        const datas = {};
+        let distRotate = 0;
+
+        const startRotation = moveable.getRotation();
+        return {
+            isControl: true,
+            requestStart() {
+                return { datas };
+            },
+            request(e: IObject<any>) {
+                if ("deltaRotate" in e) {
+                    distRotate += e.deltaRotate;
+                } else if ("rotate" in e) {
+                    distRotate = e.rotate - startRotation;
+                }
+
+                return { datas, parentDist: distRotate };
+            },
+            requestEnd() {
+                return { datas, isDrag: true };
+            },
+        };
+    },
+};
+/**
+ * Whether or not target can be rotated. (default: false)
+ * @name Moveable.Rotatable#rotatable
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body);
+ *
+ * moveable.rotatable = true;
+ */
+/**
+ * You can specify the position of the rotation. (default: "top")
+ * @name Moveable.Rotatable#rotationPosition
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *   rotationPosition: "top",
+ * });
+ *
+ * moveable.rotationPosition = "bottom"
+ */
+
+/**
+ * throttle of angle(degree) when rotate.
+ * @name Moveable.Rotatable#throttleRotate
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body);
+ *
+ * moveable.throttleRotate = 1;
+ */
+
+/**
+ * When the rotate starts, the rotateStart event is called.
+ * @memberof Moveable.Rotatable
+ * @event rotateStart
+ * @param {Moveable.Rotatable.OnRotateStart} - Parameters for the rotateStart event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, { rotatable: true });
+ * moveable.on("rotateStart", ({ target }) => {
+ *     console.log(target);
+ * });
+ */
+
+/**
+* When rotating, the rotate event is called.
+* @memberof Moveable.Rotatable
+* @event rotate
+* @param {Moveable.Rotatable.OnRotate} - Parameters for the rotate event
+* @example
+* import Moveable from "moveable";
+*
+* const moveable = new Moveable(document.body, { rotatable: true });
+* moveable.on("rotate", ({ target, transform, dist }) => {
+*     target.style.transform = transform;
+* });
+*/
+/**
+ * When the rotate finishes, the rotateEnd event is called.
+ * @memberof Moveable.Rotatable
+ * @event rotateEnd
+ * @param {Moveable.Rotatable.OnRotateEnd} - Parameters for the rotateEnd event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, { rotatable: true });
+ * moveable.on("rotateEnd", ({ target, isDrag }) => {
+ *     console.log(target, isDrag);
+ * });
+ */
+
+/**
+ * When the group rotate starts, the `rotateGroupStart` event is called.
+ * @memberof Moveable.Rotatable
+ * @event rotateGroupStart
+ * @param {Moveable.Rotatable.OnRotateGroupStart} - Parameters for the `rotateGroupStart` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     target: [].slice.call(document.querySelectorAll(".target")),
+ *     rotatable: true
+ * });
+ * moveable.on("rotateGroupStart", ({ targets }) => {
+ *     console.log("onRotateGroupStart", targets);
+ * });
+ */
+
+/**
+* When the group rotate, the `rotateGroup` event is called.
+* @memberof Moveable.Rotatable
+* @event rotateGroup
+* @param {Moveable.Rotatable.OnRotateGroup} - Parameters for the `rotateGroup` event
+* @example
+* import Moveable from "moveable";
+*
+* const moveable = new Moveable(document.body, {
+*     target: [].slice.call(document.querySelectorAll(".target")),
+*     rotatable: true
+* });
+* moveable.on("rotateGroup", ({ targets, events }) => {
+*     console.log("onRotateGroup", targets);
+*     events.forEach(ev => {
+*         const target = ev.target;
+*         // ev.drag is a drag event that occurs when the group rotate.
+*         const left = ev.drag.beforeDist[0];
+*         const top = ev.drag.beforeDist[1];
+*         const deg = ev.beforeDist;
+*     });
+* });
+*/
+
+/**
+ * When the group rotate finishes, the `rotateGroupEnd` event is called.
+ * @memberof Moveable.Rotatable
+ * @event rotateGroupEnd
+ * @param {Moveable.Rotatable.OnRotateGroupEnd} - Parameters for the `rotateGroupEnd` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     target: [].slice.call(document.querySelectorAll(".target")),
+ *     rotatable: true
+ * });
+ * moveable.on("rotateGroupEnd", ({ targets, isDrag }) => {
+ *     console.log("onRotateGroupEnd", targets, isDrag);
+ * });
+ */
+
+
+
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + diff --git a/release/0.52.0/doc/packages_react-moveable_src_ables_Roundable.tsx.html b/release/0.52.0/doc/packages_react-moveable_src_ables_Roundable.tsx.html new file mode 100644 index 000000000..7df66270e --- /dev/null +++ b/release/0.52.0/doc/packages_react-moveable_src_ables_Roundable.tsx.html @@ -0,0 +1,985 @@ + + + + + packages/react-moveable/src/ables/Roundable.tsx - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

packages/react-moveable/src/ables/Roundable.tsx

+ + + + + + + +
+
+
import {
+    prefix, triggerEvent,
+    fillParams, fillEndParams, calculatePosition,
+    fillCSSObject,
+    catchEvent,
+    getComputedStyle,
+} from "../utils";
+import {
+    Renderer, RoundableProps, OnRoundStart,
+    RoundableState, OnRound, ControlPose, OnRoundEnd,
+    MoveableManagerInterface,
+    OnRoundGroup,
+    MoveableGroupInterface,
+    OnRoundGroupStart,
+    OnRoundGroupEnd,
+} from "../types";
+import { splitSpace } from "@daybrush/utils";
+import { setDragStart, getDragDist, calculatePointerDist } from "../gesto/GestoUtils";
+import { minus, plus } from "@scena/matrix";
+import {
+    getRadiusValues,
+    getRadiusStyles,
+    splitRadiusPoses,
+} from "./roundable/borderRadius";
+import { fillChildEvents } from "../groupUtils";
+
+
+function addBorderRadiusByLine(
+    controlPoses: ControlPose[],
+    lineIndex: number,
+    distX: number,
+    distY: number,
+) {
+    // lineIndex
+    // 0 top
+    // 1 right
+    // 2 bottom
+    // 3 left
+
+    const horizontalsLength = controlPoses.filter(({ virtual, horizontal }) => horizontal && !virtual).length;
+    const verticalsLength = controlPoses.filter(({ virtual, vertical }) => vertical && !virtual).length;
+    let controlIndex = -1;
+
+    //top
+    if (lineIndex === 0) {
+        if (horizontalsLength === 0) {
+            controlIndex = 0;
+        } else if (horizontalsLength === 1) {
+            controlIndex = 1;
+        }
+    }
+    // bottom
+    if (lineIndex === 2) {
+        if (horizontalsLength <= 2) {
+            controlIndex = 2;
+        } else if (horizontalsLength <= 3) {
+            controlIndex = 3;
+        }
+    }
+    // left
+    if (lineIndex === 3) {
+        if (verticalsLength === 0) {
+            controlIndex = 4;
+        } else if (verticalsLength < 4) {
+            controlIndex = 7;
+        }
+    }
+
+    // right
+    if (lineIndex === 1) {
+        if (verticalsLength <= 1) {
+            controlIndex = 5;
+        } else if (verticalsLength <= 2) {
+            controlIndex = 6;
+        }
+    }
+    if (controlIndex === -1 || !controlPoses[controlIndex].virtual) {
+        return;
+    }
+    const controlPoseInfo = controlPoses[controlIndex];
+
+    addBorderRadius(controlPoses, controlIndex);
+
+    if (controlIndex < 4) {
+        controlPoseInfo.pos[0] = distX;
+    } else {
+        controlPoseInfo.pos[1] = distY;
+    }
+}
+function addBorderRadius(
+    controlPoses: ControlPose[],
+    index: number,
+) {
+    if (index < 4) {
+        controlPoses.slice(0, index + 1).forEach(info => {
+            info.virtual = false;
+        });
+    } else {
+        if (controlPoses[0].virtual) {
+            controlPoses[0].virtual = false;
+        }
+        controlPoses.slice(4, index + 1).forEach(info => {
+            info.virtual = false;
+        });
+    }
+}
+function removeBorderRadius(
+    controlPoses: ControlPose[],
+    index: number,
+) {
+    if (index < 4) {
+        controlPoses.slice(index, 4).forEach(info => {
+            info.virtual = true;
+        });
+    } else {
+        controlPoses.slice(index).forEach(info => {
+            info.virtual = true;
+        });
+    }
+}
+function getBorderRadius(
+    borderRadius: string,
+    width: number,
+    height: number,
+    minCounts: number[] = [0, 0],
+    full?: boolean,
+) {
+    let values: string[] = [];
+
+    if (!borderRadius || borderRadius === "0px") {
+        values = [];
+    } else {
+        values = splitSpace(borderRadius);
+    }
+
+    return getRadiusValues(values, width, height, 0, 0, minCounts, full);
+}
+
+function triggerRoundEvent(
+    moveable: MoveableManagerInterface<RoundableProps, RoundableState>,
+    e: any,
+    dist: number[],
+    delta: number[],
+    nextPoses: ControlPose[],
+) {
+    const state = moveable.state;
+    const {
+        width,
+        height,
+    } = state;
+    const {
+        raws,
+        styles,
+        radiusPoses,
+    } = getRadiusStyles(
+        nextPoses,
+        moveable.props.roundRelative!,
+        width,
+        height,
+    );
+    const {
+        horizontals,
+        verticals,
+    } = splitRadiusPoses(radiusPoses, raws);
+    const borderRadius = styles.join(" ");
+
+    state.borderRadiusState = borderRadius;
+    const params = fillParams<OnRound>(moveable, e, {
+        horizontals,
+        verticals,
+        borderRadius,
+        width,
+        height,
+        delta,
+        dist,
+        ...fillCSSObject({
+            borderRadius,
+        }, e),
+    });
+    triggerEvent(moveable, "onRound", params);
+
+    return params;
+}
+
+
+function getStyleBorderRadius(moveable: MoveableManagerInterface<RoundableProps, RoundableState>) {
+    const {
+        style,
+    } = moveable.getState();
+    let borderRadius = style.borderRadius || "";
+
+    if (!borderRadius && moveable.props.groupable) {
+        const firstMoveable = moveable.moveables![0];
+        const firstTarget = moveable.getTargets()[0];
+
+
+        if (firstTarget) {
+            if (firstMoveable?.props.target === firstTarget) {
+                borderRadius = moveable.moveables![0]?.state.style.borderRadius ?? "";
+                style.borderRadius = borderRadius;
+            } else {
+                borderRadius = getComputedStyle(firstTarget).borderRadius;
+                style.borderRadius = borderRadius;
+            }
+        }
+
+    }
+    return borderRadius;
+}
+
+/**
+ * @namespace Moveable.Roundable
+ * @description Whether to show and drag or double click border-radius
+ */
+
+export default {
+    name: "roundable",
+    props: [
+        "roundable",
+        "roundRelative",
+        "minRoundControls",
+        "maxRoundControls",
+        "roundClickable",
+        "roundPadding",
+        "isDisplayShadowRoundControls",
+    ] as const,
+    events: [
+        "roundStart",
+        "round",
+        "roundEnd",
+        "roundGroupStart",
+        "roundGroup",
+        "roundGroupEnd",
+    ] as const,
+    css: [
+        `.control.border-radius {
+background: #d66;
+cursor: pointer;
+z-index: 3;
+}`,
+        `.control.border-radius.vertical {
+background: #d6d;
+z-index: 2;
+}`,
+        `.control.border-radius.virtual {
+opacity: 0.5;
+z-index: 1;
+}`,
+        `:host.round-line-clickable .line.direction {
+cursor: pointer;
+}`,
+    ],
+    className(moveable: MoveableManagerInterface<RoundableProps, RoundableState>) {
+        const roundClickable = moveable.props.roundClickable;
+
+        return roundClickable === true || roundClickable === "line" ? prefix("round-line-clickable") : "";
+    },
+    requestStyle(): Array<keyof CSSStyleDeclaration> {
+        return ["borderRadius"];
+    },
+    requestChildStyle(): Array<keyof CSSStyleDeclaration> {
+        return ["borderRadius"];
+    },
+    render(moveable: MoveableManagerInterface<RoundableProps, RoundableState>, React: Renderer): any {
+        const {
+            target,
+            width,
+            height,
+            allMatrix,
+            is3d,
+            left,
+            top,
+            borderRadiusState,
+        } = moveable.getState();
+
+        const {
+            minRoundControls = [0, 0],
+            maxRoundControls = [4, 4],
+            zoom,
+            roundPadding = 0,
+            isDisplayShadowRoundControls,
+            groupable,
+        } = moveable.props;
+
+        if (!target) {
+            return null;
+        }
+
+        const borderRadius = borderRadiusState || getStyleBorderRadius(moveable);
+        const n = is3d ? 4 : 3;
+        const radiusValues = getBorderRadius(
+            borderRadius,
+            width, height,
+            minRoundControls,
+            true,
+        );
+
+        if (!radiusValues) {
+            return null;
+        }
+        let verticalCount = 0;
+        let horizontalCount = 0;
+        const basePos = groupable ? [0, 0] : [left, top];
+
+        return radiusValues.map((v, i) => {
+            const horizontal = v.horizontal;
+            const vertical = v.vertical;
+            const direction = v.direction || "";
+            const originalPos = [...v.pos];
+
+            horizontalCount += Math.abs(horizontal);
+            verticalCount += Math.abs(vertical);
+
+
+            if (horizontal && direction.indexOf("n") > -1) {
+                originalPos[1] -= roundPadding;
+            }
+            if (vertical && direction.indexOf("w") > -1) {
+                originalPos[0] -= roundPadding;
+            }
+            if (horizontal && direction.indexOf("s") > -1) {
+                originalPos[1] += roundPadding;
+            }
+            if (vertical && direction.indexOf("e") > -1) {
+                originalPos[0] += roundPadding;
+            }
+            const pos = minus(calculatePosition(allMatrix, originalPos, n), basePos);
+            const isDisplayVerticalShadow
+                = isDisplayShadowRoundControls
+                && isDisplayShadowRoundControls !== "horizontal";
+            const isDisplay = v.vertical
+                ? verticalCount <= maxRoundControls[1] && (isDisplayVerticalShadow || !v.virtual)
+                : horizontalCount <= maxRoundControls[0] && (isDisplayShadowRoundControls || !v.virtual);
+
+            return <div key={`borderRadiusControl${i}`}
+                className={prefix(
+                    "control", "border-radius",
+                    v.vertical ? "vertical" : "",
+                    v.virtual ? "virtual" : "",
+                )}
+                data-radius-index={i}
+                style={{
+                    display: isDisplay ? "block" : "none",
+                    transform: `translate(${pos[0]}px, ${pos[1]}px) scale(${zoom})`,
+                }}></div>;
+        });
+    },
+    dragControlCondition(moveable: any, e: any) {
+        if (!e.inputEvent || e.isRequest) {
+            return false;
+        }
+        const className = (e.inputEvent.target.getAttribute("class") || "");
+
+        return className.indexOf("border-radius") > -1
+            || (className.indexOf("moveable-line") > -1 && className.indexOf("moveable-direction") > -1);
+    },
+    dragGroupControlCondition(moveable: any, e: any) {
+        return this.dragControlCondition(moveable, e);
+    },
+    dragControlStart(moveable: MoveableManagerInterface<RoundableProps, RoundableState>, e: any) {
+        const { inputEvent, datas } = e;
+        const inputTarget = inputEvent.target;
+        const className = (inputTarget.getAttribute("class") || "");
+        const isControl = className.indexOf("border-radius") > -1;
+        const isLine = className.indexOf("moveable-line") > -1 && className.indexOf("moveable-direction") > -1;
+        const controlIndex = isControl ? parseInt(inputTarget.getAttribute("data-radius-index"), 10) : -1;
+        let lineIndex = -1;
+
+        if (isLine) {
+            const indexAttr = inputTarget.getAttribute("data-line-key")! || "";
+
+            if (indexAttr) {
+                lineIndex = parseInt(indexAttr.replace(/render-line-/g, ""), 10);
+
+                if (isNaN(lineIndex)) {
+                    lineIndex = -1;
+                }
+            }
+        }
+
+        if (!isControl && !isLine) {
+            return false;
+        }
+
+        const params = fillParams<OnRoundStart>(moveable, e, {});
+
+        const result = triggerEvent(
+            moveable, "onRoundStart", params);
+
+        if (result === false) {
+            return false;
+        }
+
+        datas.lineIndex = lineIndex;
+        datas.controlIndex = controlIndex;
+        datas.isControl = isControl;
+        datas.isLine = isLine;
+
+        setDragStart(moveable, e);
+
+        const {
+            roundRelative,
+            minRoundControls = [0, 0],
+        } = moveable.props;
+        const state = moveable.state;
+        const {
+            width,
+            height,
+        } = state;
+
+        datas.isRound = true;
+        datas.prevDist = [0, 0];
+        const borderRadius = getStyleBorderRadius(moveable);
+        const controlPoses = getBorderRadius(
+            borderRadius || "",
+            width,
+            height,
+            minRoundControls,
+            true,
+        ) || [];
+
+        datas.controlPoses = controlPoses;
+
+        state.borderRadiusState = getRadiusStyles(
+            controlPoses,
+            roundRelative!,
+            width,
+            height,
+        ).styles.join(" ");
+        return params;
+    },
+    dragControl(moveable: MoveableManagerInterface<RoundableProps, RoundableState>, e: any) {
+        const { datas } = e;
+        const controlPoses = datas.controlPoses as ControlPose[];
+
+        if (!datas.isRound || !datas.isControl || !controlPoses.length) {
+            return false;
+        }
+        const index = datas.controlIndex as number;
+
+        const [distX, distY] = getDragDist(e);
+        const dist = [distX, distY];
+        const delta = minus(dist, datas.prevDist);
+        const {
+            maxRoundControls = [4, 4],
+        } = moveable.props;
+        const { width, height } = moveable.state;
+        const selectedControlPose = controlPoses[index];
+
+        const selectedVertical = selectedControlPose.vertical;
+        const selectedHorizontal = selectedControlPose.horizontal;
+
+        // 0: [0, 1, 2, 3] maxCount === 1
+        // 0: [0, 2] maxCount === 2
+        // 1: [1, 3] maxCount === 2
+
+        // 0: [0] maxCount === 3
+        // 1: [1, 3] maxCount === 3
+
+        const dists = controlPoses.map(pose => {
+            const { horizontal, vertical } = pose;
+            const poseDist = [
+                horizontal * selectedHorizontal * dist[0],
+                vertical * selectedVertical * dist[1],
+            ];
+            if (horizontal) {
+                if (maxRoundControls[0] === 1) {
+                    return poseDist;
+                } else if (maxRoundControls[0] < 4 && horizontal !== selectedHorizontal) {
+                    return poseDist;
+                }
+            } else if (maxRoundControls[1] === 0) {
+                poseDist[1] = vertical * selectedHorizontal * dist[0] / width * height;
+
+                return poseDist;
+            } else if (selectedVertical) {
+                if (maxRoundControls[1] === 1) {
+                    return poseDist;
+                } else if (maxRoundControls[1] < 4 && vertical !== selectedVertical) {
+                    return poseDist;
+                }
+            }
+            return [0, 0];
+        });
+
+        dists[index] = dist;
+        const nextPoses = controlPoses.map((info, i) => {
+            return {
+                ...info,
+                pos: plus(info.pos, dists[i]),
+            };
+        });
+
+        if (index < 4) {
+            nextPoses.slice(0, index + 1).forEach(info => {
+                info.virtual = false;
+            });
+        } else {
+            nextPoses.slice(4, index + 1).forEach(info => {
+                info.virtual = false;
+            });
+        }
+
+        datas.prevDist = [distX, distY];
+
+        return triggerRoundEvent(
+            moveable,
+            e,
+            dist,
+            delta,
+            nextPoses,
+        );
+    },
+    dragControlEnd(moveable: MoveableManagerInterface<RoundableProps, RoundableState>, e: any) {
+        const state = moveable.state;
+
+        state.borderRadiusState = "";
+        const { datas, isDouble } = e;
+        if (!datas.isRound) {
+            return false;
+        }
+        const {
+            isControl,
+            controlIndex,
+            isLine,
+            lineIndex,
+        } = datas;
+        const controlPoses = datas.controlPoses as ControlPose[];
+        const length = controlPoses.filter(({ virtual }) => virtual).length;
+        const {
+            roundClickable = true,
+        } = moveable.props;
+
+        if (isDouble && roundClickable) {
+            if (isControl && (roundClickable === true || roundClickable === "control")) {
+                removeBorderRadius(controlPoses, controlIndex);
+            } else if (isLine && (roundClickable === true || roundClickable === "line")) {
+                const [distX, distY] = calculatePointerDist(moveable, e);
+
+                addBorderRadiusByLine(controlPoses, lineIndex, distX, distY);
+            }
+
+            if (length !== controlPoses.filter(({ virtual }) => virtual).length) {
+                triggerRoundEvent(
+                    moveable,
+                    e,
+                    [0, 0],
+                    [0, 0],
+                    controlPoses,
+                );
+            }
+        }
+        const params = fillEndParams<OnRoundEnd>(moveable, e, {});
+
+        triggerEvent(moveable, "onRoundEnd", params);
+        state.borderRadiusState = "";
+        return params;
+    },
+    dragGroupControlStart(moveable: MoveableGroupInterface<RoundableProps, RoundableState>, e: any) {
+        const result = this.dragControlStart(moveable, e);
+
+        if (!result) {
+            return false;
+        }
+
+        const moveables = moveable.moveables;
+        const targets = moveable.props.targets!;
+        const events = fillChildEvents(moveable, "roundable", e);
+
+        const nextParams: OnRoundGroupStart = {
+            targets: moveable.props.targets!,
+            events: events.map((ev, i) => {
+                return {
+                    ...ev,
+                    target: targets[i],
+                    moveable: moveables[i],
+                    currentTarget: moveables[i],
+                };
+            }),
+            ...result,
+        };
+
+        triggerEvent(moveable, "onRoundGroupStart", nextParams);
+        return result;
+    },
+    dragGroupControl(moveable: MoveableGroupInterface<RoundableProps, RoundableState>, e: any) {
+        const result = this.dragControl(moveable, e);
+
+
+        if (!result) {
+            return false;
+        }
+
+        const moveables = moveable.moveables;
+        const targets = moveable.props.targets!;
+        const events = fillChildEvents(moveable, "roundable", e);
+
+        const nextParams: OnRoundGroup = {
+            targets: moveable.props.targets!,
+            events: events.map((ev, i) => {
+                return {
+                    ...ev,
+                    target: targets[i],
+                    moveable: moveables[i],
+                    currentTarget: moveables[i],
+                    ...fillCSSObject({
+                        borderRadius: result.borderRadius,
+                    }, ev),
+                };
+            }),
+            ...result,
+        };
+
+        triggerEvent(moveable, "onRoundGroup", nextParams);
+        return nextParams;
+    },
+    dragGroupControlEnd(moveable: MoveableGroupInterface<RoundableProps, RoundableState>, e: any) {
+        const moveables = moveable.moveables;
+        const targets = moveable.props.targets!;
+        const events = fillChildEvents(moveable, "roundable", e);
+
+        catchEvent(moveable, "onRound", parentEvent => {
+            const nextParams: OnRoundGroup = {
+                targets: moveable.props.targets!,
+                events: events.map((ev, i) => {
+                    return {
+                        ...ev,
+                        target: targets[i],
+                        moveable: moveables[i],
+                        currentTarget: moveables[i],
+                        ...fillCSSObject({
+                            borderRadius: parentEvent.borderRadius,
+                        }, ev),
+                    };
+                }),
+                ...parentEvent,
+            };
+            triggerEvent(moveable, "onRoundGroup", nextParams);
+        });
+        const result = this.dragControlEnd(moveable, e);
+
+        if (!result) {
+            return false;
+        }
+        const nextParams: OnRoundGroupEnd = {
+            targets: moveable.props.targets!,
+            events: events.map((ev, i) => {
+                return {
+                    ...ev,
+                    target: targets[i],
+                    moveable: moveables[i],
+                    currentTarget: moveables[i],
+                    lastEvent: ev.datas?.lastEvent,
+                };
+            }),
+            ...result,
+        };
+
+        triggerEvent(moveable, "onRoundGroupEnd", nextParams);
+        return nextParams;
+    },
+    unset(moveable: MoveableManagerInterface<RoundableProps, RoundableState>) {
+        moveable.state.borderRadiusState = "";
+    },
+};
+/**
+ * Whether to show and drag or double click border-radius, (default: false)
+ * @name Moveable.Roundable#roundable
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     roundable: true,
+ *     roundRelative: false,
+ * });
+ * moveable.on("roundStart", e => {
+ *     console.log(e);
+ * }).on("round", e => {
+ *     e.target.style.borderRadius = e.borderRadius;
+ * }).on("roundEnd", e => {
+ *     console.log(e);
+ * });
+ */
+/**
+ * % Can be used instead of the absolute px
+ * @name Moveable.Roundable#roundRelative
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     roundable: true,
+ *     roundRelative: false,
+ * });
+ * moveable.on("roundStart", e => {
+ *     console.log(e);
+ * }).on("round", e => {
+ *     e.target.style.borderRadius = e.borderRadius;
+ * }).on("roundEnd", e => {
+ *     console.log(e);
+ * });
+ */
+/**
+ * Minimum number of round controls. It moves in proportion by control. [horizontal, vertical] (default: [0, 0])
+ * @name Moveable.Roundable#minRoundControls
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     roundable: true,
+ *     roundRelative: false,
+ *     minRoundControls: [0, 0],
+ * });
+ * moveable.minRoundControls = [1, 0];
+ */
+/**
+ * Maximum number of round controls. It moves in proportion by control. [horizontal, vertical] (default: [4, 4])
+ * @name Moveable.Roundable#maxRoundControls
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     roundable: true,
+ *     roundRelative: false,
+ *     maxRoundControls: [4, 4],
+ * });
+ * moveable.maxRoundControls = [1, 0];
+ */
+/**
+ * Whether you can add/delete round controls by double-clicking a line or control.
+ * @name Moveable.Roundable#roundClickable
+ * @default true
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     roundable: true,
+ *     roundRelative: false,
+ *     roundClickable: true,
+ * });
+ * moveable.roundClickable = false;
+ */
+
+/**
+ * Whether to show a round control that does not actually exist as a shadow
+ * @name Moveable.Roundable#isDisplayShadowRoundControls
+ * @default false
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     roundable: true,
+ *     isDisplayShadowRoundControls: false,
+ * });
+ * moveable.isDisplayShadowRoundControls = true;
+ */
+
+
+/**
+ * The padding value of the position of the round control
+ * @name Moveable.Roundable#roundPadding
+ * @default false
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     roundable: true,
+ *     roundPadding: 0,
+ * });
+ * moveable.roundPadding = 15;
+ */
+
+/**
+ * When drag start the clip area or controls, the `roundStart` event is called.
+ * @memberof Moveable.Roundable
+ * @event roundStart
+ * @param {Moveable.Roundable.OnRoundStart} - Parameters for the `roundStart` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     roundable: true,
+ *     roundRelative: false,
+ * });
+ * moveable.on("roundStart", e => {
+ *     console.log(e);
+ * }).on("round", e => {
+ *     e.target.style.borderRadius = e.borderRadius;
+ * }).on("roundEnd", e => {
+ *     console.log(e);
+ * });
+ */
+
+
+/**
+ * When drag or double click the border area or controls, the `round` event is called.
+ * @memberof Moveable.Roundable
+ * @event round
+ * @param {Moveable.Roundable.OnRound} - Parameters for the `round` event
+ * @example
+  * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     roundable: true,
+ *     roundRelative: false,
+ * });
+ * moveable.on("roundStart", e => {
+ *     console.log(e);
+ * }).on("round", e => {
+ *     e.target.style.borderRadius = e.borderRadius;
+ * }).on("roundEnd", e => {
+ *     console.log(e);
+ * });
+ */
+
+
+/**
+ * When drag end the border area or controls, the `roundEnd` event is called.
+ * @memberof Moveable.Roundable
+ * @event roundEnd
+ * @param {Moveable.Roundable.onRoundEnd} - Parameters for the `roundEnd` event
+ * @example
+  * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     roundable: true,
+ *     roundRelative: false,
+ * });
+ * moveable.on("roundStart", e => {
+ *     console.log(e);
+ * }).on("round", e => {
+ *     e.target.style.borderRadius = e.borderRadius;
+ * }).on("roundEnd", e => {
+ *     console.log(e);
+ * });
+ */
+
+
+/**
+ * When drag start the clip area or controls, the `roundGroupStart` event is called.
+ * @memberof Moveable.Roundable
+ * @event roundGroupStart
+ * @param {Moveable.Roundable.OnRoundGroupStart} - Parameters for the `roundGroupStart` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     targets: [target1, target2, target3],
+ *     roundable: true,
+ * });
+ * moveable.on("roundGroupStart", e => {
+ *     console.log(e.targets);
+ * }).on("roundGroup", e => {
+ *   e.events.forEach(ev => {
+ *       ev.target.style.cssText += ev.cssText;
+ *   });
+ * }).on("roundGroupEnd", e => {
+ *     console.log(e);
+ * });
+ */
+
+
+/**
+ * When drag or double click the border area or controls, the `roundGroup` event is called.
+ * @memberof Moveable.Roundable
+ * @event roundGroup
+ * @param {Moveable.Roundable.OnRoundGroup} - Parameters for the `roundGroup` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     targets: [target1, target2, target3],
+ *     roundable: true,
+ * });
+ * moveable.on("roundGroupStart", e => {
+ *     console.log(e.targets);
+ * }).on("roundGroup", e => {
+ *   e.events.forEach(ev => {
+ *       ev.target.style.cssText += ev.cssText;
+ *   });
+ * }).on("roundGroupEnd", e => {
+ *     console.log(e);
+ * });
+ */
+
+
+/**
+ * When drag end the border area or controls, the `roundGroupEnd` event is called.
+ * @memberof Moveable.Roundable
+ * @event roundGroupEnd
+ * @param {Moveable.Roundable.onRoundGroupEnd} - Parameters for the `roundGroupEnd` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     targets: [target1, target2, target3],
+ *     roundable: true,
+ * });
+ * moveable.on("roundGroupStart", e => {
+ *     console.log(e.targets);
+ * }).on("roundGroup", e => {
+ *     e.events.forEach(ev => {
+ *         ev.target.style.cssText += ev.cssText;
+ *     });
+ * }).on("roundGroupEnd", e => {
+ *     console.log(e);
+ * });
+ */
+
+
+
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + diff --git a/release/0.52.0/doc/packages_react-moveable_src_ables_Scalable.ts.html b/release/0.52.0/doc/packages_react-moveable_src_ables_Scalable.ts.html new file mode 100644 index 000000000..d4facc2f6 --- /dev/null +++ b/release/0.52.0/doc/packages_react-moveable_src_ables_Scalable.ts.html @@ -0,0 +1,890 @@ + + + + + packages/react-moveable/src/ables/Scalable.ts - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

packages/react-moveable/src/ables/Scalable.ts

+ + + + + + + +
+
+
import {
+    triggerEvent, multiply2,
+    fillParams, fillEndParams, getAbsolutePosesByState,
+    catchEvent, getOffsetSizeDist, getDirectionCondition,
+    getDirectionViewClassName, getTotalDirection, sign, countEach, abs,
+} from "../utils";
+import { MIN_SCALE } from "../consts";
+import {
+    setDragStart, resolveTransformEvent,
+    convertTransformFormat,
+    getScaleDist,
+    fillTransformStartEvent,
+    fillTransformEvent,
+    setDefaultTransformIndex,
+    getTranslateFixedPosition,
+} from "../gesto/GestoUtils";
+import { getRenderDirections } from "../renderDirections";
+import {
+    ScalableProps, OnScaleGroup, OnScaleGroupEnd,
+    OnScaleGroupStart, DraggableProps, OnDragStart,
+    SnappableState, GroupableProps, OnScaleStart,
+    OnScale, OnScaleEnd, MoveableManagerInterface, MoveableGroupInterface,
+    OnBeforeScaleGroup,
+    OnBeforeScale,
+} from "../types";
+import {
+    fillChildEvents,
+    startChildDist,
+    triggerChildAbles,
+} from "../groupUtils";
+import Draggable from "./Draggable";
+import { calculate, createRotateMatrix, plus, minus } from "@scena/matrix";
+import CustomGesto from "../gesto/CustomGesto";
+import { checkSnapScale } from "./Snappable";
+import {
+    isArray, IObject, getDist,
+    throttle,
+    calculateBoundSize,
+} from "@daybrush/utils";
+import { getFixedDirectionInfo } from "../utils/getFixedDirection";
+
+const directionCondition = getDirectionCondition("scalable");
+
+/**
+ * @namespace Scalable
+ * @memberof Moveable
+ * @description Scalable indicates whether the target's x and y can be scale of transform.
+ */
+export default {
+    name: "scalable",
+    ableGroup: "size",
+    canPinch: true,
+    props: [
+        "scalable",
+        "throttleScale",
+        "renderDirections",
+        "keepRatio",
+        "edge",
+        "displayAroundControls",
+    ] as const,
+    events: [
+        "scaleStart",
+        "beforeScale",
+        "scale",
+        "scaleEnd",
+        "scaleGroupStart",
+        "beforeScaleGroup",
+        "scaleGroup",
+        "scaleGroupEnd",
+    ] as const,
+    render: getRenderDirections("scalable"),
+    dragControlCondition: directionCondition,
+    viewClassName: getDirectionViewClassName("scalable"),
+    dragControlStart(
+        moveable: MoveableManagerInterface<ScalableProps & DraggableProps, SnappableState>,
+        e: any) {
+        const { datas, isPinch, inputEvent, parentDirection } = e;
+
+        const direction = getTotalDirection(
+            parentDirection,
+            isPinch,
+            inputEvent,
+            datas,
+        );
+        const {
+            width,
+            height,
+            targetTransform,
+            target,
+            pos1,
+            pos2,
+            pos4,
+        } = moveable.state;
+
+        if (!direction || !target) {
+            return false;
+        }
+        if (!isPinch) {
+            setDragStart(moveable, e);
+        }
+        datas.datas = {};
+        datas.transform = targetTransform;
+        datas.prevDist = [1, 1];
+        datas.direction = direction;
+        datas.startOffsetWidth = width;
+        datas.startOffsetHeight = height;
+        datas.startValue = [1, 1];
+
+        // const scaleWidth = getDist(pos1, pos2);
+        // const scaleHeight = getDist(pos2, pos4);
+        const isWidth = (!direction[0] && !direction[1]) || direction[0] || !direction[1];
+
+        // datas.scaleWidth = scaleWidth;
+        // datas.scaleHeight = scaleHeight;
+        // datas.scaleXRatio = scaleWidth / width;
+        // datas.scaleYRatio = scaleHeight / height;
+
+        setDefaultTransformIndex(moveable, e, "scale");
+
+        datas.isWidth = isWidth;
+
+
+        function setRatio(ratio: number) {
+            datas.ratio = ratio && isFinite(ratio) ? ratio : 0;
+        }
+
+        datas.startPositions = getAbsolutePosesByState(moveable.state);
+        function setFixedDirection(fixedDirection: number[]) {
+            const result = getFixedDirectionInfo(datas.startPositions, fixedDirection);
+
+            datas.fixedDirection = result.fixedDirection;
+            datas.fixedPosition = result.fixedPosition;
+            datas.fixedOffset = result.fixedOffset;
+        }
+
+        datas.setFixedDirection = setFixedDirection;
+        setRatio(getDist(pos1, pos2) / getDist(pos2, pos4));
+        setFixedDirection([-direction[0], -direction[1]]);
+
+        const setMinScaleSize = (min: number[]) => {
+            datas.minScaleSize = min;
+        };
+        const setMaxScaleSize = (max: number[]) => {
+            datas.maxScaleSize = max;
+        };
+        // const setMinScale = (min: number[]) => {
+        // };
+        // const setMaxScale = (max: number[]) => {
+        // };
+
+        setMinScaleSize([-Infinity, -Infinity]);
+        setMaxScaleSize([Infinity, Infinity]);
+        const params = fillParams<OnScaleStart>(moveable, e, {
+            direction,
+            set: (scale: number[]) => {
+                datas.startValue = scale;
+            },
+            setRatio,
+            setFixedDirection,
+            setMinScaleSize,
+            setMaxScaleSize,
+            ...fillTransformStartEvent(moveable, e),
+            dragStart: Draggable.dragStart(
+                moveable,
+                new CustomGesto().dragStart([0, 0], e),
+            ) as OnDragStart,
+        });
+        const result = triggerEvent(moveable, "onScaleStart", params);
+
+        datas.startFixedDirection = datas.fixedDirection;
+
+        if (result !== false) {
+            datas.isScale = true;
+            moveable.state.snapRenderInfo = {
+                request: e.isRequest,
+                direction,
+            };
+
+        }
+        return datas.isScale ? params : false;
+    },
+    dragControl(
+        moveable: MoveableManagerInterface<ScalableProps & DraggableProps & GroupableProps, SnappableState>,
+        e: any) {
+        resolveTransformEvent(moveable, e, "scale");
+        const {
+            datas,
+            parentKeepRatio,
+            parentFlag,
+            isPinch,
+            dragClient,
+            isRequest,
+            useSnap,
+            resolveMatrix,
+        } = e;
+        const {
+            prevDist,
+            direction,
+            startOffsetWidth,
+            startOffsetHeight,
+            isScale,
+            startValue,
+            isWidth,
+            ratio,
+        } = datas;
+
+        if (!isScale) {
+            return false;
+        }
+
+        const props = moveable.props;
+        const {
+            throttleScale,
+            parentMoveable,
+        } = props;
+        let sizeDirection = direction;
+
+        if (!direction[0] && !direction[1]) {
+            sizeDirection = [1, 1];
+        }
+        const keepRatio = (ratio && (parentKeepRatio != null ? parentKeepRatio : props.keepRatio)) || false;
+        const state = moveable.state;
+
+        const tempScaleValue = [
+            startValue[0],
+            startValue[1],
+        ];
+
+        function getNextScale() {
+            const {
+                distWidth,
+                distHeight,
+            } = getOffsetSizeDist(sizeDirection, keepRatio, datas, e);
+
+
+            const distX = startOffsetWidth ? (startOffsetWidth + distWidth) / startOffsetWidth : 1;
+            const distY = startOffsetHeight ? (startOffsetHeight + distHeight) / startOffsetHeight : 1;
+
+            if (!startValue[0]) {
+                tempScaleValue[0] = distWidth / startOffsetWidth;
+            }
+            if (!startValue[1]) {
+                tempScaleValue[1] = distHeight / startOffsetHeight;
+            }
+            let scaleX = (sizeDirection[0] || keepRatio ? distX : 1) * tempScaleValue[0];
+            let scaleY = (sizeDirection[1] || keepRatio ? distY : 1) * tempScaleValue[1];
+
+            if (scaleX === 0) {
+                scaleX = sign(prevDist[0]) * MIN_SCALE;
+            }
+            if (scaleY === 0) {
+                scaleY = sign(prevDist[1]) * MIN_SCALE;
+            }
+            return [scaleX, scaleY];
+        }
+
+
+        let scale = getNextScale();
+
+        if (!isPinch && moveable.props.groupable) {
+            const snapRenderInfo = state.snapRenderInfo || {};
+            const stateDirection = snapRenderInfo.direction;
+
+            if (isArray(stateDirection) && (stateDirection[0] || stateDirection[1])) {
+                state.snapRenderInfo = { direction, request: e.isRequest };
+            }
+        }
+
+        triggerEvent(moveable, "onBeforeScale", fillParams<OnBeforeScale>(moveable, e, {
+            scale,
+            setFixedDirection(nextFixedDirection: number[]) {
+                datas.setFixedDirection(nextFixedDirection);
+
+                scale = getNextScale();
+                return scale;
+            },
+            startFixedDirection: datas.startFixedDirection,
+            setScale(nextScale: number[]) {
+                scale = nextScale;
+            },
+        }, true));
+
+        let dist = [
+            scale[0] / tempScaleValue[0],
+            scale[1] / tempScaleValue[1],
+        ];
+        let fixedPosition = dragClient;
+        let snapDist = [0, 0];
+
+        const distSign = sign(dist[0] * dist[1]);
+        const isSelfPinch = !dragClient && !parentFlag && isPinch;
+
+        if (isSelfPinch || resolveMatrix) {
+            fixedPosition = getTranslateFixedPosition(
+                moveable,
+                datas.targetAllTransform,
+                [0, 0],
+                [0, 0],
+                datas,
+            );
+        } else if (!dragClient) {
+            fixedPosition = datas.fixedPosition;
+        }
+        if (!isPinch) {
+            snapDist = checkSnapScale(
+                moveable,
+                dist,
+                direction,
+                !useSnap && isRequest,
+                datas,
+            );
+        }
+
+        if (keepRatio) {
+            if (sizeDirection[0] && sizeDirection[1] && snapDist[0] && snapDist[1]) {
+                if (Math.abs(snapDist[0] * startOffsetWidth) > Math.abs(snapDist[1] * startOffsetHeight)) {
+                    snapDist[1] = 0;
+                } else {
+                    snapDist[0] = 0;
+                }
+            }
+
+            const isNoSnap = !snapDist[0] && !snapDist[1];
+
+            if (isNoSnap) {
+
+                // throttle scale value (not absolute scale size)
+                if (isWidth) {
+                    dist[0] = throttle(dist[0] * tempScaleValue[0], throttleScale!) / tempScaleValue[0];
+                } else {
+                    dist[1] = throttle(dist[1] * tempScaleValue[1], throttleScale!) / tempScaleValue[1];
+                }
+            }
+            if (
+                (sizeDirection[0] && !sizeDirection[1])
+                || (snapDist[0] && !snapDist[1])
+                || (isNoSnap && isWidth)
+            ) {
+                dist[0] += snapDist[0];
+                const snapHeight = startOffsetWidth * dist[0] * tempScaleValue[0] / ratio;
+
+                dist[1] = sign(distSign * dist[0]) * abs(snapHeight / startOffsetHeight / tempScaleValue[1]);
+            } else if (
+                (!sizeDirection[0] && sizeDirection[1])
+                || (!snapDist[0] && snapDist[1])
+                || (isNoSnap && !isWidth)
+            ) {
+                dist[1] += snapDist[1];
+                const snapWidth = startOffsetHeight * dist[1] * tempScaleValue[1] * ratio;
+
+                dist[0] = sign(distSign * dist[1]) * abs(snapWidth / startOffsetWidth / tempScaleValue[0]);
+            }
+        } else {
+            dist[0] += snapDist[0];
+            dist[1] += snapDist[1];
+
+            if (!snapDist[0]) {
+                dist[0] = throttle(dist[0] * tempScaleValue[0], throttleScale!) / tempScaleValue[0];
+            }
+            if (!snapDist[1]) {
+                dist[1] = throttle(dist[1] * tempScaleValue[1], throttleScale!) / tempScaleValue[1];
+            }
+        }
+
+        if (dist[0] === 0) {
+            dist[0] = sign(prevDist[0]) * MIN_SCALE;
+        }
+        if (dist[1] === 0) {
+            dist[1] = sign(prevDist[1]) * MIN_SCALE;
+        }
+        scale = multiply2(dist, [tempScaleValue[0], tempScaleValue[1]]);
+
+
+        const startOffsetSize = [
+            startOffsetWidth,
+            startOffsetHeight,
+        ];
+        let scaleSize = [
+            startOffsetWidth * scale[0],
+            startOffsetHeight * scale[1],
+        ];
+
+        scaleSize = calculateBoundSize(
+            scaleSize,
+            datas.minScaleSize,
+            datas.maxScaleSize,
+            keepRatio ? ratio : false,
+        );
+
+        // if (keepRatio && (isGroup || keepRatioFinally)) {
+        //     if (isWidth) {
+        //         boundingHeight = boundingWidth / ratio;
+        //     } else {
+        //         boundingWidth = boundingHeight * ratio;
+        //     }
+        // }
+        scale = countEach(2, i => {
+            return startOffsetSize[i] ? scaleSize[i] / startOffsetSize[i] : scaleSize[i];
+        });
+        dist = countEach(2, i => {
+            return scale[i] / tempScaleValue[i];
+        });
+
+        const delta = countEach(2, i => prevDist[i] ? dist[i] / prevDist[i] : dist[i]);
+
+
+        const distText = `scale(${dist.join(", ")})`;
+        const scaleText = `scale(${scale.join(", ")})`;
+        const nextTransform = convertTransformFormat(
+            datas, scaleText, distText);
+        const isZeroScale = !startValue[0] || !startValue[1];
+
+        const inverseDist = getScaleDist(
+            moveable,
+            isZeroScale ? scaleText : distText,
+            datas.fixedDirection,
+            fixedPosition,
+            datas.fixedOffset,
+            datas,
+            isZeroScale,
+        );
+        const inverseDelta = isSelfPinch ? inverseDist : minus(inverseDist, datas.prevInverseDist || [0, 0]);
+
+        datas.prevDist = dist;
+        datas.prevInverseDist = inverseDist;
+        if (
+            scale[0] === prevDist[0] && scale[1] === prevDist[1]
+            && inverseDelta.every(num => !num)
+            && !parentMoveable
+            && !isSelfPinch
+        ) {
+            return false;
+        }
+
+
+        const params = fillParams<OnScale>(moveable, e, {
+            offsetWidth: startOffsetWidth,
+            offsetHeight: startOffsetHeight,
+            direction,
+
+            scale,
+            dist,
+            delta,
+
+            isPinch: !!isPinch,
+            ...fillTransformEvent(
+                moveable,
+                nextTransform,
+                inverseDelta,
+                isPinch,
+                e,
+            ),
+        });
+        triggerEvent(moveable, "onScale", params);
+
+        return params;
+    },
+    dragControlEnd(moveable: MoveableManagerInterface<ScalableProps>, e: any) {
+        const { datas } = e;
+        if (!datas.isScale) {
+            return false;
+        }
+
+        datas.isScale = false;
+
+        const scaleEndParam = fillEndParams<OnScaleEnd>(moveable, e, {});
+        triggerEvent(moveable, "onScaleEnd", scaleEndParam);
+        return scaleEndParam;
+    },
+    dragGroupControlCondition: directionCondition,
+    dragGroupControlStart(moveable: MoveableGroupInterface<any, any>, e: any) {
+        const { datas } = e;
+
+        const params = this.dragControlStart(moveable, e);
+
+        if (!params) {
+            return false;
+        }
+        const originalEvents = fillChildEvents(moveable, "resizable", e);
+
+
+        datas.moveableScale = moveable.scale;
+
+        const events = triggerChildAbles(
+            moveable,
+            this,
+            "dragControlStart",
+            e,
+            (child, ev) => {
+                return startChildDist(moveable, child, datas, ev);
+            },
+        );
+
+        const setFixedDirection = (fixedDirection: number[]) => {
+            params.setFixedDirection(fixedDirection);
+            events.forEach((ev, i) => {
+                ev.setFixedDirection(fixedDirection);
+                startChildDist(moveable, ev.moveable, datas, originalEvents[i]);
+            });
+        };
+
+        datas.setFixedDirection = setFixedDirection;
+        const nextParams: OnScaleGroupStart = {
+            ...params,
+            targets: moveable.props.targets!,
+            events,
+            setFixedDirection,
+        };
+        const result = triggerEvent(moveable, "onScaleGroupStart", nextParams);
+
+        datas.isScale = result !== false;
+        return datas.isScale ? nextParams : false;
+    },
+    dragGroupControl(moveable: MoveableGroupInterface<any, any>, e: any) {
+        const { datas } = e;
+        if (!datas.isScale) {
+            return;
+        }
+
+        catchEvent(moveable, "onBeforeScale", parentEvent => {
+            triggerEvent(moveable, "onBeforeScaleGroup", fillParams<OnBeforeScaleGroup>(moveable, e, {
+                ...parentEvent,
+                targets: moveable.props.targets!,
+            }, true));
+        });
+
+        const params = this.dragControl(moveable, e);
+        if (!params) {
+            return;
+        }
+        const { dist } = params;
+        const moveableScale = datas.moveableScale;
+        moveable.scale = [
+            dist[0] * moveableScale[0],
+            dist[1] * moveableScale[1],
+        ];
+        const keepRatio = moveable.props.keepRatio;
+
+
+        const fixedPosition = datas.fixedPosition;
+        const events = triggerChildAbles(
+            moveable,
+            this,
+            "dragControl",
+            e,
+            (_, ev) => {
+                const [clientX, clientY] = calculate(
+                    createRotateMatrix(moveable.rotation / 180 * Math.PI, 3),
+                    [
+                        ev.datas.originalX * dist[0],
+                        ev.datas.originalY * dist[1],
+                        1,
+                    ],
+                    3,
+                );
+
+                return {
+                    ...ev,
+                    parentDist: null,
+                    parentScale: dist,
+                    parentKeepRatio: keepRatio,
+                    // recalculate child fixed position for parent group's dragging.
+                    dragClient: plus(fixedPosition, [clientX, clientY]),
+                };
+            },
+        );
+        const nextParams: OnScaleGroup = {
+            targets: moveable.props.targets!,
+            events,
+            ...params,
+        };
+
+        triggerEvent(moveable, "onScaleGroup", nextParams);
+        return nextParams;
+    },
+    dragGroupControlEnd(moveable: MoveableGroupInterface<any, any>, e: any) {
+        const { isDrag, datas } = e;
+
+        if (!datas.isScale) {
+            return;
+        }
+        this.dragControlEnd(moveable, e);
+        const events = triggerChildAbles(moveable, this, "dragControlEnd", e);
+
+        const nextParams = fillEndParams<OnScaleGroupEnd>(moveable, e, {
+            targets: moveable.props.targets!,
+            events,
+        });
+
+        triggerEvent(moveable, "onScaleGroupEnd", nextParams);
+        return isDrag;
+    },
+    /**
+     * @method Moveable.Scalable#request
+     * @param {Moveable.Scalable.ScalableRequestParam} e - the Scalable's request parameter
+     * @return {Moveable.Requester} Moveable Requester
+     * @example
+
+     * // Instantly Request (requestStart - request - requestEnd)
+     * moveable.request("scalable", { deltaWidth: 10, deltaHeight: 10 }, true);
+     *
+     * // requestStart
+     * const requester = moveable.request("scalable");
+     *
+     * // request
+     * requester.request({ deltaWidth: 10, deltaHeight: 10 });
+     * requester.request({ deltaWidth: 10, deltaHeight: 10 });
+     * requester.request({ deltaWidth: 10, deltaHeight: 10 });
+     *
+     * // requestEnd
+     * requester.requestEnd();
+     */
+    request() {
+        const datas = {};
+        let distWidth = 0;
+        let distHeight = 0;
+        let useSnap = false;
+
+        return {
+            isControl: true,
+            requestStart(e: IObject<any>) {
+                useSnap = e.useSnap;
+
+                return {
+                    datas,
+                    parentDirection: e.direction || [1, 1],
+                    useSnap,
+                };
+            },
+            request(e: IObject<any>) {
+                distWidth += e.deltaWidth;
+                distHeight += e.deltaHeight;
+
+                return {
+                    datas,
+                    parentDist: [distWidth, distHeight],
+                    parentKeepRatio: e.keepRatio,
+                    useSnap,
+                };
+            },
+            requestEnd() {
+                return { datas, isDrag: true, useSnap };
+            },
+        };
+    },
+};
+
+/**
+ * Whether or not target can scaled.
+ *
+ * @name Moveable.Scalable#scalable
+ * @default false
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body);
+ *
+ * moveable.scalable = true;
+ */
+
+/**
+ * throttle of scaleX, scaleY when scale.
+ * @name Moveable.Scalable#throttleScale
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body);
+ *
+ * moveable.throttleScale = 0.1;
+ */
+/**
+ * Set directions to show the control box. (default: ["n", "nw", "ne", "s", "se", "sw", "e", "w"])
+ * @name Moveable.Scalable#renderDirections
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     scalable: true,
+ *   renderDirections: ["n", "nw", "ne", "s", "se", "sw", "e", "w"],
+ * });
+ *
+ * moveable.renderDirections = ["nw", "ne", "sw", "se"];
+ */
+/**
+ * When resize or scale, keeps a ratio of the width, height. (default: false)
+ * @name Moveable.Scalable#keepRatio
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     scalable: true,
+ * });
+ *
+ * moveable.keepRatio = true;
+ */
+/**
+ * When the scale starts, the scaleStart event is called.
+ * @memberof Moveable.Scalable
+ * @event scaleStart
+ * @param {Moveable.Scalable.OnScaleStart} - Parameters for the scaleStart event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, { scalable: true });
+ * moveable.on("scaleStart", ({ target }) => {
+ *     console.log(target);
+ * });
+ */
+/**
+ * When scaling, `beforeScale` is called before `scale` occurs. In `beforeScale`, you can get and set the pre-value before scaling.
+ * @memberof Moveable.Scalable
+ * @event beforeScale
+ * @param {Moveable.Scalable.OnBeforeScale} - Parameters for the `beforeScale` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, { scalable: true });
+ * moveable.on("beforeScale", ({ setFixedDirection }) => {
+ *     if (shiftKey) {
+ *        setFixedDirection([0, 0]);
+ *     }
+ * });
+ * moveable.on("scale", ({ target, transform, dist }) => {
+ *     target.style.transform = transform;
+ * });
+ */
+
+/**
+ * When scaling, the `scale` event is called.
+ * @memberof Moveable.Scalable
+ * @event scale
+ * @param {Moveable.Scalable.OnScale} - Parameters for the `scale` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, { scalable: true });
+ * moveable.on("scale", ({ target, transform, dist }) => {
+ *     target.style.transform = transform;
+ * });
+ */
+/**
+ * When the scale finishes, the `scaleEnd` event is called.
+ * @memberof Moveable.Scalable
+ * @event scaleEnd
+ * @param {Moveable.Scalable.OnScaleEnd} - Parameters for the `scaleEnd` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, { scalable: true });
+ * moveable.on("scaleEnd", ({ target, isDrag }) => {
+ *     console.log(target, isDrag);
+ * });
+ */
+
+/**
+* When the group scale starts, the `scaleGroupStart` event is called.
+* @memberof Moveable.Scalable
+* @event scaleGroupStart
+* @param {Moveable.Scalable.OnScaleGroupStart} - Parameters for the `scaleGroupStart` event
+* @example
+* import Moveable from "moveable";
+*
+* const moveable = new Moveable(document.body, {
+*     target: [].slice.call(document.querySelectorAll(".target")),
+*     scalable: true
+* });
+* moveable.on("scaleGroupStart", ({ targets }) => {
+*     console.log("onScaleGroupStart", targets);
+* });
+*/
+
+/**
+* When the group scale, the `scaleGroup` event is called.
+* @memberof Moveable.Scalable
+* @event scaleGroup
+* @param {Moveable.Scalable.OnScaleGroup} - Parameters for the `scaleGroup` event
+* @example
+* import Moveable from "moveable";
+*
+* const moveable = new Moveable(document.body, {
+*     target: [].slice.call(document.querySelectorAll(".target")),
+*     scalable: true
+* });
+* moveable.on("scaleGroup", ({ targets, events }) => {
+*     console.log("onScaleGroup", targets);
+*     events.forEach(ev => {
+*         const target = ev.target;
+*         // ev.drag is a drag event that occurs when the group scale.
+*         const left = ev.drag.beforeDist[0];
+*         const top = ev.drag.beforeDist[1];
+*         const scaleX = ev.scale[0];
+*         const scaleY = ev.scale[1];
+*     });
+* });
+*/
+
+/**
+ * When the group scale finishes, the `scaleGroupEnd` event is called.
+ * @memberof Moveable.Scalable
+ * @event scaleGroupEnd
+ * @param {Moveable.Scalable.OnScaleGroupEnd} - Parameters for the `scaleGroupEnd` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     target: [].slice.call(document.querySelectorAll(".target")),
+ *     scalable: true
+ * });
+ * moveable.on("scaleGroupEnd", ({ targets, isDrag }) => {
+ *     console.log("onScaleGroupEnd", targets, isDrag);
+ * });
+ */
+
+
+
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + diff --git a/release/0.52.0/doc/packages_react-moveable_src_ables_Scrollable.ts.html b/release/0.52.0/doc/packages_react-moveable_src_ables_Scrollable.ts.html new file mode 100644 index 000000000..739ce5cb4 --- /dev/null +++ b/release/0.52.0/doc/packages_react-moveable_src_ables_Scrollable.ts.html @@ -0,0 +1,252 @@ + + + + + packages/react-moveable/src/ables/Scrollable.ts - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

packages/react-moveable/src/ables/Scrollable.ts

+ + + + + + + +
+
+

+import {
+    ScrollableProps, OnScroll, MoveableManagerInterface,
+    MoveableGroupInterface, MoveableRefType,
+} from "../types";
+import { triggerEvent, fillParams, getRefTarget } from "../utils";
+import DragScroll from "@scena/dragscroll";
+
+function getDefaultScrollPosition(e: { scrollContainer: HTMLElement, direction: number[] }) {
+    const scrollContainer = e.scrollContainer;
+
+    return [
+        scrollContainer.scrollLeft,
+        scrollContainer.scrollTop,
+    ];
+}
+/**
+ * @namespace Moveable.Scrollable
+ * @description Whether or not target can be scrolled to the scroll container (default: false)
+ */
+export default {
+    name: "scrollable",
+    canPinch: true,
+    props: [
+        "scrollable",
+        "scrollContainer",
+        "scrollThreshold",
+        "scrollThrottleTime",
+        "getScrollPosition",
+        "scrollOptions",
+    ] as const,
+    events: [
+        "scroll",
+        "scrollGroup",
+    ] as const,
+    dragRelation: "strong",
+    dragStart(moveable: MoveableManagerInterface<ScrollableProps, Record<string, any>>, e: any) {
+        const props = moveable.props;
+        const {
+            scrollContainer = moveable.getContainer() as HTMLElement,
+            scrollOptions,
+        } = props;
+
+        const dragScroll = new DragScroll();
+        const scrollContainerElement = getRefTarget<HTMLElement>(scrollContainer, true);
+
+        e.datas.dragScroll = dragScroll;
+        moveable.state.dragScroll = dragScroll;
+
+        const gestoName = e.isControl ? "controlGesto" : "targetGesto";
+        const targets = e.targets;
+
+        dragScroll.on("scroll", ({ container, direction }) => {
+            const params = fillParams<OnScroll>(moveable, e, {
+                scrollContainer: container,
+                direction,
+            }) as any;
+
+            const eventName = targets ? "onScrollGroup" : "onScroll" as any;
+            if (targets) {
+                params.targets = targets;
+            }
+            triggerEvent(moveable, eventName, params);
+        }).on("move", ({ offsetX, offsetY, inputEvent }) => {
+            moveable[gestoName].scrollBy(offsetX, offsetY, inputEvent.inputEvent, false);
+        }).on("scrollDrag", ({ next }) => {
+            next(moveable[gestoName].getCurrentEvent());
+        });
+        dragScroll.dragStart(e, {
+            container: scrollContainerElement!,
+            ...scrollOptions,
+        });
+    },
+    checkScroll(moveable: MoveableManagerInterface<ScrollableProps>, e: any) {
+        const dragScroll = e.datas.dragScroll as DragScroll;
+
+        if (!dragScroll) {
+            return;
+        }
+        const {
+            scrollContainer = moveable.getContainer() as MoveableRefType<HTMLElement>,
+            scrollThreshold = 0,
+            scrollThrottleTime = 0,
+            getScrollPosition = getDefaultScrollPosition,
+            scrollOptions,
+        } = moveable.props;
+
+        dragScroll.drag(e, {
+            container: scrollContainer!,
+            threshold: scrollThreshold,
+            throttleTime: scrollThrottleTime,
+            getScrollPosition: (ev: any) => {
+                return getScrollPosition({ scrollContainer: ev.container, direction: ev.direction });
+            },
+            ...scrollOptions,
+        });
+
+        return true;
+    },
+    drag(moveable: MoveableManagerInterface<ScrollableProps>, e: any) {
+        return this.checkScroll(moveable, e);
+    },
+    dragEnd(moveable: MoveableManagerInterface<ScrollableProps>, e: any) {
+        e.datas.dragScroll.dragEnd();
+        e.datas.dragScroll = null;
+    },
+    dragControlStart(moveable: MoveableManagerInterface<ScrollableProps>, e: any) {
+        return this.dragStart(moveable, { ...e, isControl: true });
+    },
+    dragControl(moveable: MoveableManagerInterface<ScrollableProps>, e: any) {
+        return this.drag(moveable, e);
+    },
+    dragControlEnd(moveable: MoveableManagerInterface<ScrollableProps>, e: any) {
+        return this.dragEnd(moveable, e);
+    },
+    dragGroupStart(moveable: MoveableGroupInterface, e: any) {
+        return this.dragStart(moveable, { ...e, targets: moveable.props.targets });
+    },
+    dragGroup(moveable: MoveableGroupInterface, e: any) {
+        return this.drag(moveable, { ...e, targets: moveable.props.targets });
+    },
+    dragGroupEnd(moveable: MoveableGroupInterface, e: any) {
+        return this.dragEnd(moveable, { ...e, targets: moveable.props.targets });
+    },
+    dragGroupControlStart(moveable: MoveableGroupInterface, e: any) {
+        return this.dragStart(moveable, { ...e, targets: moveable.props.targets, isControl: true });
+    },
+    dragGroupControl(moveable: MoveableGroupInterface, e: any) {
+        return this.drag(moveable, { ...e, targets: moveable.props.targets });
+    },
+    dragGroupControEnd(moveable: MoveableGroupInterface, e: any) {
+        return this.dragEnd(moveable, { ...e, targets: moveable.props.targets });
+    },
+    unset(moveable: MoveableManagerInterface<ScrollableProps, Record<string, any>>) {
+        const state = moveable.state;
+
+        state.dragScroll?.dragEnd();
+        state.dragScroll = null;
+    },
+};
+
+/**
+ * When the drag cursor leaves the scrollContainer, the `scroll` event occur to scroll.
+ * @memberof Moveable.Scrollable
+ * @event scroll
+ * @param {Moveable.Scrollable.OnScroll} - Parameters for the `scroll` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     target: document.querySelector(".target"),
+ * });
+ * moveable.on("scroll", ({ scrollContainer, direction }) => {
+ *   scrollContainer.scrollLeft += direction[0] * 10;
+ *   scrollContainer.scrollTop += direction[1] * 10;
+ * });
+ */
+
+/**
+ * When the drag cursor leaves the scrollContainer, the `scrollGroup` event occur to scroll in group.
+ * @memberof Moveable.Scrollable
+ * @event scrollGroup
+ * @param {Moveable.Scrollable.OnScrollGroup} - Parameters for the `scrollGroup` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     target: [].slice.call(document.querySelectorAll(".target")),
+ * });
+ * moveable.on("scroll", ({ scrollContainer, direction }) => {
+ *   scrollContainer.scrollLeft += direction[0] * 10;
+ *   scrollContainer.scrollTop += direction[1] * 10;
+ * });
+ */
+
+
+
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + diff --git a/release/0.52.0/doc/packages_react-moveable_src_ables_Snappable.tsx.html b/release/0.52.0/doc/packages_react-moveable_src_ables_Snappable.tsx.html new file mode 100644 index 000000000..a6596fe2f --- /dev/null +++ b/release/0.52.0/doc/packages_react-moveable_src_ables_Snappable.tsx.html @@ -0,0 +1,1332 @@ + + + + + packages/react-moveable/src/ables/Snappable.tsx - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

packages/react-moveable/src/ables/Snappable.tsx

+ + + + + + + +
+
+
import {
+    Renderer,
+    SnappableProps,
+    SnappableState,
+    SnapGuideline,
+    ScalableProps,
+    SnapPosInfo,
+    RotatableProps,
+    RectInfo,
+    MoveableManagerInterface,
+    SnappableRenderType,
+    BoundType,
+    MoveableGroupInterface,
+    SnapDirectionInfo,
+} from "../types";
+import {
+    prefix,
+    calculatePoses,
+    getRect,
+    getAbsolutePosesByState,
+    getAbsolutePoses,
+    getClientRect,
+    getRefTarget,
+    getDragDistByState,
+    triggerEvent,
+    getDirectionCondition,
+    abs,
+    watchValue,
+} from "../utils";
+import {
+    find,
+    findIndex, hasClass, throttle,
+} from "@daybrush/utils";
+import {
+    getDragDist,
+    scaleMatrix,
+    getPosByDirection,
+} from "../gesto/GestoUtils";
+import { minus, rotate, plus } from "@scena/matrix";
+import { dragControlCondition as rotatableDragControlCondtion } from "./Rotatable";
+import { FLOAT_POINT_NUM } from "../consts";
+import {
+    getInnerBoundInfo,
+    getCheckInnerBoundLineInfos,
+    checkRotateInnerBounds,
+    checkInnerBoundPoses,
+} from "./snappable/innerBounds";
+import {
+    checkBoundPoses,
+    checkRotateBounds,
+    getBounds,
+} from "./snappable/bounds";
+import {
+    checkSnaps,
+    getSnapInfosByDirection,
+    getNearOffsetInfo,
+    getCheckSnapDirections,
+} from "./snappable/snap";
+import {
+    renderSnapPoses,
+    renderGuidelines,
+    renderDashedGuidelines,
+    renderGapGuidelines,
+} from "./snappable/render";
+import {
+    getInitialBounds,
+    hasGuidelines,
+} from "./snappable/utils";
+import {
+    checkMaxBounds,
+    checkMoveableSnapBounds,
+    getSnapBoundInfo,
+} from "./snappable/snapBounds";
+import { getTotalGuidelines } from "./snappable/getTotalGuidelines";
+
+
+export interface SnapPoses {
+    vertical: number[];
+    horizontal: number[];
+}
+
+export function checkSnapInfo(
+    moveable: MoveableManagerInterface<SnappableProps, SnappableState>
+) {
+    const state = moveable.state;
+    const container = state.container;
+    const snapContainer = moveable.props.snapContainer || container!;
+
+    if (state.snapContainer === snapContainer && state.guidelines && state.guidelines.length) {
+        return false;
+    }
+
+    const containerClientRect = state.containerClientRect;
+    const snapOffset = {
+        left: 0,
+        top: 0,
+        bottom: 0,
+        right: 0,
+    };
+
+    if (container !== snapContainer) {
+        const snapContainerTarget = getRefTarget(snapContainer, true);
+
+        if (snapContainerTarget) {
+            const snapContainerRect = getClientRect(snapContainerTarget);
+            const offset1 = getDragDistByState(state, [
+                snapContainerRect.left - containerClientRect.left,
+                snapContainerRect.top - containerClientRect.top,
+            ]);
+            const offset2 = getDragDistByState(state, [
+                snapContainerRect.right - containerClientRect.right,
+                snapContainerRect.bottom - containerClientRect.bottom,
+            ]);
+
+            snapOffset.left = throttle(offset1[0], 0.00001);
+            snapOffset.top = throttle(offset1[1], 0.00001);
+            snapOffset.right = throttle(offset2[0], 0.00001);
+            snapOffset.bottom = throttle(offset2[1], 0.00001);
+        }
+    }
+
+    state.snapContainer = snapContainer;
+    state.snapOffset = snapOffset;
+    state.guidelines = getTotalGuidelines(moveable);
+    state.enableSnap = true;
+    return true;
+}
+
+function getNextFixedPoses(
+    matrix: number[],
+    width: number,
+    height: number,
+    fixedDirection: number[],
+    fixedPos: number[],
+    is3d: boolean
+) {
+    const nextPoses = calculatePoses(matrix, width, height, is3d ? 4 : 3);
+    const nextFixedPos = getPosByDirection(nextPoses, fixedDirection);
+
+    return getAbsolutePoses(nextPoses, minus(fixedPos, nextFixedPos));
+}
+
+export function normalized(value: number) {
+    return value ? value / abs(value) : 0;
+}
+
+export function getSizeOffsetInfo(
+    moveable: MoveableManagerInterface<SnappableProps, SnappableState>,
+    poses: number[][],
+    direction: number[],
+    keepRatio: boolean,
+    isRequest: boolean,
+    datas: any
+) {
+    const { fixedDirection } = datas;
+    const directions = getCheckSnapDirections(direction, fixedDirection, keepRatio);
+    const innerBoundLineInfos = getCheckInnerBoundLineInfos(moveable, poses, direction, keepRatio);
+    const offsets = [
+        ...getSnapBoundInfo(
+            moveable,
+            poses,
+            directions,
+            keepRatio,
+            isRequest,
+            datas
+        ),
+        ...getInnerBoundInfo(
+            moveable,
+            innerBoundLineInfos,
+            datas
+        ),
+    ];
+    const widthOffsetInfo = getNearOffsetInfo(offsets, 0);
+    const heightOffsetInfo = getNearOffsetInfo(offsets, 1);
+
+    return {
+        width: {
+            isBound: widthOffsetInfo.isBound,
+            offset: widthOffsetInfo.offset[0],
+        },
+        height: {
+            isBound: heightOffsetInfo.isBound,
+            offset: heightOffsetInfo.offset[1],
+        },
+    };
+}
+
+export function recheckSizeByTwoDirection(
+    moveable: MoveableManagerInterface<SnappableProps, SnappableState>,
+    poses: number[][],
+    width: number,
+    height: number,
+    maxWidth: number,
+    maxHeight: number,
+    direction: number[],
+    isRequest: boolean,
+    datas: any
+) {
+    const snapPos = getPosByDirection(poses, direction);
+
+    const {
+        horizontal: { offset: horizontalOffset },
+        vertical: { offset: verticalOffset },
+    } = checkMoveableSnapBounds(moveable, isRequest, {
+        vertical: [snapPos[0]],
+        horizontal: [snapPos[1]],
+    });
+
+    if (throttle(verticalOffset, FLOAT_POINT_NUM) || throttle(horizontalOffset, FLOAT_POINT_NUM)) {
+        const [nextWidthOffset, nextHeightOffset] = getDragDist({
+            datas,
+            distX: -verticalOffset,
+            distY: -horizontalOffset,
+        });
+        const nextWidth = Math.min(
+            maxWidth || Infinity,
+            width + direction[0] * nextWidthOffset
+        );
+        const nextHeight = Math.min(
+            maxHeight || Infinity,
+            height + direction[1] * nextHeightOffset
+        );
+
+        return [nextWidth - width, nextHeight - height];
+    }
+    return [0, 0];
+}
+
+export function checkSizeDist(
+    moveable: MoveableManagerInterface<any, any>,
+    getNextPoses: (widthOffset: number, heightOffset: number) => number[][],
+    width: number,
+    height: number,
+    direction: number[],
+    fixedPosition: number[],
+    isRequest: boolean,
+    datas: any
+) {
+    const poses = getAbsolutePosesByState(moveable.state);
+    const keepRatio = moveable.props.keepRatio;
+
+    let widthOffset = 0;
+    let heightOffset = 0;
+
+    for (let i = 0; i < 2; ++i) {
+        const nextPoses = getNextPoses(widthOffset, heightOffset);
+        const {
+            width: widthOffsetInfo,
+            height: heightOffsetInfo,
+        } = getSizeOffsetInfo(
+            moveable,
+            nextPoses,
+            direction,
+            keepRatio,
+            isRequest,
+            datas
+        );
+
+        const isWidthBound = widthOffsetInfo.isBound;
+        const isHeightBound = heightOffsetInfo.isBound;
+        let nextWidthOffset = widthOffsetInfo.offset;
+        let nextHeightOffset = heightOffsetInfo.offset;
+
+
+        if (i === 1) {
+            if (!isWidthBound) {
+                nextWidthOffset = 0;
+            }
+            if (!isHeightBound) {
+                nextHeightOffset = 0;
+            }
+        }
+        if (i === 0 && isRequest && !isWidthBound && !isHeightBound) {
+            return [0, 0];
+        }
+        if (keepRatio) {
+            const widthDist =
+                abs(nextWidthOffset) * (width ? 1 / width : 1);
+            const heightDist =
+                abs(nextHeightOffset) * (height ? 1 / height : 1);
+            const isGetWidthOffset =
+                isWidthBound && isHeightBound
+                    ? widthDist < heightDist
+                    : isHeightBound ||
+                    (!isWidthBound && widthDist < heightDist);
+            if (isGetWidthOffset) {
+                // width : height = ? : heightOffset
+                nextWidthOffset = (width * nextHeightOffset) / height;
+            } else {
+                // width : height = widthOffset : ?
+                nextHeightOffset = (height * nextWidthOffset) / width;
+            }
+        }
+        widthOffset += nextWidthOffset;
+        heightOffset += nextHeightOffset;
+    }
+
+    if (!keepRatio && direction[0] && direction[1]) {
+        const { maxWidth, maxHeight } = checkMaxBounds(
+            moveable,
+            poses,
+            direction,
+            fixedPosition,
+            datas
+        );
+
+        const [nextWidthOffset, nextHeightOffset] = recheckSizeByTwoDirection(
+            moveable,
+            getNextPoses(widthOffset, heightOffset).map(pos => pos.map(p => throttle(p, FLOAT_POINT_NUM))),
+            width + widthOffset,
+            height + heightOffset,
+            maxWidth,
+            maxHeight,
+            direction,
+            isRequest,
+            datas
+        );
+
+        widthOffset += nextWidthOffset;
+        heightOffset += nextHeightOffset;
+    }
+
+    return [widthOffset, heightOffset];
+}
+
+export function absDegree(deg: number) {
+    if (deg < 0) {
+        deg = deg % 360 + 360;
+    }
+    deg %= 360;
+    return deg;
+}
+
+export function bumpDegree(baseDeg: number, snapDeg: number) {
+    // baseDeg -80
+    // snapDeg 270
+    // return -90
+    snapDeg = absDegree(snapDeg);
+
+    const count = Math.floor(baseDeg / 360);
+
+
+    const deg1 = count * 360 + 360 - snapDeg;
+    const deg2 = count * 360 + snapDeg;
+
+    return abs(baseDeg - deg1) < abs(baseDeg - deg2) ? deg1 : deg2;
+}
+
+export function getMinDegreeDistance(deg1: number, deg2: number) {
+    deg1 = absDegree(deg1);
+    deg2 = absDegree(deg2);
+
+    const deg3 = absDegree(deg1 - deg2);
+
+    return Math.min(deg3, 360 - deg3);
+}
+
+export function checkSnapRotate(
+    moveable: MoveableManagerInterface<SnappableProps & RotatableProps, any>,
+    rect: RectInfo,
+    dist: number,
+    rotation: number,
+) {
+    const props = moveable.props;
+    const snapRotationThreshold = props[NAME_snapRotationThreshold] ?? 5;
+    const snapRotationDegrees = props[NAME_snapRotationDegrees];
+
+    if (hasGuidelines(moveable, "rotatable")) {
+        const { pos1, pos2, pos3, pos4, origin: origin2 } = rect;
+        const rad = (dist * Math.PI) / 180;
+        const prevPoses = [pos1, pos2, pos3, pos4].map((pos) => minus(pos, origin2));
+        const nextPoses = prevPoses.map((pos) => rotate(pos, rad));
+
+        // console.log(moveable.state.left, moveable.state.top, moveable.state.origin);
+        // console.log(pos1, pos2, pos3, pos4, origin, rad, prevPoses, nextPoses);
+        const result = [
+            ...checkRotateBounds(moveable, prevPoses, nextPoses, origin2, dist),
+            ...checkRotateInnerBounds(
+                moveable,
+                prevPoses,
+                nextPoses,
+                origin2,
+                dist
+            ),
+        ];
+        result.sort((a, b) => abs(a - dist) - abs(b - dist));
+        const isSnap = result.length > 0;
+
+        if (isSnap) {
+            return {
+                isSnap,
+                dist: isSnap ? result[0] : dist,
+            };
+        }
+    }
+    if (snapRotationDegrees?.length && snapRotationThreshold) {
+
+
+        const sorted = snapRotationDegrees.slice().sort((a, b) => {
+            return getMinDegreeDistance(a, rotation) - getMinDegreeDistance(b, rotation);
+        });
+        const firstDegree = sorted[0];
+
+        if (getMinDegreeDistance(firstDegree, rotation) <= snapRotationThreshold) {
+
+            return {
+                isSnap: true,
+                dist: dist + bumpDegree(rotation, firstDegree) - rotation,
+            };
+        }
+    }
+    return {
+        isSnap: false,
+        dist,
+    };
+
+}
+
+export function checkSnapResize(
+    moveable: MoveableManagerInterface<{}, {}>,
+    width: number,
+    height: number,
+    direction: number[],
+    fixedPosition: number[],
+    isRequest: boolean,
+    datas: any
+) {
+    if (!hasGuidelines(moveable, "resizable")) {
+        return [0, 0];
+    }
+    const { fixedDirection, nextAllMatrix } = datas;
+    const { allMatrix, is3d } = moveable.state;
+
+    return checkSizeDist(
+        moveable,
+        (widthOffset: number, heightOffset: number) => {
+            return getNextFixedPoses(
+                nextAllMatrix || allMatrix,
+                width + widthOffset,
+                height + heightOffset,
+                fixedDirection,
+                fixedPosition,
+                is3d
+            );
+        },
+        width,
+        height,
+        direction,
+        fixedPosition,
+        isRequest,
+        datas
+    );
+}
+export function checkSnapScale(
+    moveable: MoveableManagerInterface<ScalableProps, any>,
+    scale: number[],
+    direction: number[],
+    isRequest: boolean,
+    datas: any
+) {
+    if (!hasGuidelines(moveable, "scalable")) {
+        return [0, 0];
+    }
+    const { startOffsetWidth, startOffsetHeight, fixedPosition, fixedDirection, is3d } = datas;
+    const sizeDist = checkSizeDist(
+        moveable,
+        (widthOffset: number, heightOffset: number) => {
+            return getNextFixedPoses(
+                scaleMatrix(
+                    datas,
+                    plus(scale, [widthOffset / startOffsetWidth, heightOffset / startOffsetHeight]),
+                ),
+                startOffsetWidth,
+                startOffsetHeight,
+                fixedDirection,
+                fixedPosition,
+                is3d
+            );
+        },
+        startOffsetWidth,
+        startOffsetHeight,
+        direction,
+        fixedPosition,
+        isRequest,
+        datas
+    );
+    return [sizeDist[0] / startOffsetWidth, sizeDist[1] / startOffsetHeight];
+}
+
+export function startCheckSnapDrag(
+    moveable: MoveableManagerInterface<any, any>,
+    datas: any
+) {
+    datas.absolutePoses = getAbsolutePosesByState(moveable.state);
+}
+
+
+
+function getSnapGuidelines(posInfos: SnapPosInfo[]) {
+    const guidelines: Array<{ guideline: SnapGuideline, posInfo: SnapPosInfo }> = [];
+
+    posInfos.forEach((posInfo) => {
+        posInfo.guidelineInfos.forEach(({ guideline }) => {
+            if (find(guidelines, info => info.guideline === guideline)) {
+                return;
+            }
+            guideline.direction = "";
+            guidelines.push({ guideline, posInfo });
+        });
+    });
+
+    return guidelines.map(({ guideline, posInfo }) => {
+        return {
+            ...guideline,
+            direction: posInfo.direction,
+        };
+    });
+}
+
+function addBoundGuidelines(
+    moveable: MoveableManagerInterface<SnappableProps, SnappableState>,
+    verticalPoses: number[],
+    horizontalPoses: number[],
+    verticalSnapPoses: SnappableRenderType[],
+    horizontalSnapPoses: SnappableRenderType[],
+    externalBounds?: BoundType | false | null
+) {
+    const {
+        vertical: verticalBoundInfos,
+        horizontal: horizontalBoundInfos,
+    } = checkBoundPoses(
+        getBounds(moveable, externalBounds),
+        verticalPoses,
+        horizontalPoses
+    );
+
+    const boundMap = getInitialBounds();
+
+
+    verticalBoundInfos.forEach((info) => {
+        if (info.isBound) {
+            if (info.direction === "start") {
+                boundMap.left = true;
+            }
+            if (info.direction === "end") {
+                boundMap.right = true;
+            }
+            verticalSnapPoses.push({
+                type: "bounds",
+                pos: info.pos,
+            });
+        }
+    });
+    horizontalBoundInfos.forEach((info) => {
+        if (info.isBound) {
+            if (info.direction === "start") {
+                boundMap.top = true;
+            }
+            if (info.direction === "end") {
+                boundMap.bottom = true;
+            }
+            horizontalSnapPoses.push({
+                type: "bounds",
+                pos: info.pos,
+            });
+        }
+    });
+    const {
+        boundMap: innerBoundMap,
+        vertical: verticalInnerBoundPoses,
+        horizontal: horizontalInnerBoundPoses,
+    } = checkInnerBoundPoses(moveable);
+
+    verticalInnerBoundPoses.forEach((innerPos) => {
+        if (
+            findIndex(
+                verticalSnapPoses,
+                ({ type, pos }) => type === "bounds" && pos === innerPos
+            ) >= 0
+        ) {
+            return;
+        }
+        verticalSnapPoses.push({
+            type: "bounds",
+            pos: innerPos,
+        });
+    });
+
+    horizontalInnerBoundPoses.forEach((innerPos) => {
+        if (
+            findIndex(
+                horizontalSnapPoses,
+                ({ type, pos }) => type === "bounds" && pos === innerPos
+            ) >= 0
+        ) {
+            return;
+        }
+        horizontalSnapPoses.push({
+            type: "bounds",
+            pos: innerPos,
+        });
+    });
+
+    return {
+        boundMap,
+        innerBoundMap,
+    };
+}
+
+const directionCondition = getDirectionCondition("", ["resizable", "scalable"]);
+
+
+const NAME_snapRotationThreshold = "snapRotationThreshold";
+const NAME_snapRotationDegrees = "snapRotationDegrees";
+
+/**
+ * @namespace Moveable.Snappable
+ * @description Whether or not target can be snapped to the guideline. (default: false)
+ * @sort 2
+ */
+export default {
+    name: "snappable",
+    dragRelation: "strong",
+    props: [
+        "snappable",
+        "snapContainer",
+        "snapDirections",
+        "elementSnapDirections",
+        "snapGap",
+        "snapGridWidth",
+        "snapGridHeight",
+        "isDisplaySnapDigit",
+        "isDisplayInnerSnapDigit",
+        "isDisplayGridGuidelines",
+        "snapDigit",
+        "snapThreshold",
+        "snapRenderThreshold",
+        "snapGridAll",
+        NAME_snapRotationThreshold,
+        NAME_snapRotationDegrees,
+        "horizontalGuidelines",
+        "verticalGuidelines",
+        "elementGuidelines",
+        "bounds",
+        "innerBounds",
+        "snapDistFormat",
+        "maxSnapElementGuidelineDistance",
+        "maxSnapElementGapDistance",
+    ] as const,
+    events: ["snap", "bound"] as const,
+    css: [
+        `:host {
+--bounds-color: #d66;
+}
+.guideline {
+pointer-events: none;
+z-index: 2;
+}
+.guideline.bounds {
+background: #d66;
+background: var(--bounds-color);
+}
+.guideline-group {
+position: absolute;
+top: 0;
+left: 0;
+}
+.guideline-group .size-value {
+position: absolute;
+color: #f55;
+font-size: 12px;
+font-size: calc(12px * var(--zoom));
+font-weight: bold;
+}
+.guideline-group.horizontal .size-value {
+transform-origin: 50% 100%;
+transform: translateX(-50%);
+left: 50%;
+bottom: 5px;
+bottom: calc(2px + 3px * var(--zoom));
+}
+.guideline-group.vertical .size-value {
+transform-origin: 0% 50%;
+top: 50%;
+transform: translateY(-50%);
+left: 5px;
+left: calc(2px + 3px * var(--zoom));
+}
+.guideline.gap {
+background: #f55;
+}
+.size-value.gap {
+color: #f55;
+}
+`,
+    ],
+    render(
+        moveable: MoveableManagerInterface<SnappableProps, SnappableState>,
+        React: Renderer
+    ): any[] {
+        const state = moveable.state;
+        const {
+            top: targetTop,
+            left: targetLeft,
+            pos1,
+            pos2,
+            pos3,
+            pos4,
+            snapRenderInfo,
+        } = state;
+        const {
+            snapRenderThreshold = 1,
+        } = moveable.props;
+
+        if (!snapRenderInfo || !snapRenderInfo.render || !hasGuidelines(moveable, "")) {
+            // reset store
+            watchValue(
+                moveable,
+                "boundMap",
+                getInitialBounds(),
+                v => JSON.stringify(v),
+            );
+            watchValue(
+                moveable,
+                "innerBoundMap",
+                getInitialBounds(),
+                v => JSON.stringify(v),
+            );
+            return [];
+        }
+        state.guidelines = getTotalGuidelines(moveable);
+
+
+        const minLeft = Math.min(pos1[0], pos2[0], pos3[0], pos4[0]);
+        const minTop = Math.min(pos1[1], pos2[1], pos3[1], pos4[1]);
+        const externalPoses = snapRenderInfo.externalPoses || [];
+        const poses = getAbsolutePosesByState(moveable.state);
+        const verticalSnapPoses: SnappableRenderType[] = [];
+        const horizontalSnapPoses: SnappableRenderType[] = [];
+        const verticalGuidelines: SnapGuideline[] = [];
+        const horizontalGuidelines: SnapGuideline[] = [];
+        const snapInfos: Array<{
+            vertical: SnapDirectionInfo;
+            horizontal: SnapDirectionInfo;
+        }> = [];
+        const { width, height, top, left, bottom, right } = getRect(poses);
+        const targetRect = { left, right, top, bottom, center: (left + right) / 2, middle: (top + bottom) / 2 };
+        const hasExternalPoses = externalPoses.length > 0;
+        const externalRect = hasExternalPoses
+            ? getRect(externalPoses)
+            : ({} as ReturnType<typeof getRect>);
+
+        if (!snapRenderInfo.request) {
+            if (snapRenderInfo.direction) {
+                snapInfos.push(
+                    getSnapInfosByDirection(
+                        moveable,
+                        poses,
+                        snapRenderInfo.direction,
+                        snapRenderThreshold,
+                    )
+                );
+            }
+            if (snapRenderInfo.snap) {
+                const rect = getRect(poses);
+                if (snapRenderInfo.center) {
+                    (rect as any).middle = (rect.top + rect.bottom) / 2;
+                    (rect as any).center = (rect.left + rect.right) / 2;
+                }
+                snapInfos.push(checkSnaps(moveable, rect, snapRenderThreshold));
+            }
+            if (hasExternalPoses) {
+                if (snapRenderInfo.center) {
+                    (externalRect as any).middle =
+                        (externalRect.top + externalRect.bottom) / 2;
+                    (externalRect as any).center =
+                        (externalRect.left + externalRect.right) / 2;
+                }
+                snapInfos.push(checkSnaps(moveable, externalRect, snapRenderThreshold));
+            }
+            snapInfos.forEach((snapInfo) => {
+                const {
+                    vertical: { posInfos: verticalPosInfos },
+                    horizontal: { posInfos: horizontalPosInfos },
+                } = snapInfo;
+                verticalSnapPoses.push(
+                    ...verticalPosInfos.filter(({ guidelineInfos }) => {
+                        return guidelineInfos.some(({ guideline }) => !guideline.hide);
+                    }).map(
+                        (posInfo) => ({
+                            type: "snap",
+                            pos: posInfo.pos,
+                        } as const)
+                    )
+                );
+                horizontalSnapPoses.push(
+                    ...horizontalPosInfos.filter(({ guidelineInfos }) => {
+                        return guidelineInfos.some(({ guideline }) => !guideline.hide);
+                    }).map(
+                        (posInfo) => ({
+                            type: "snap",
+                            pos: posInfo.pos,
+                        } as const)
+                    )
+                );
+
+                verticalGuidelines.push(...getSnapGuidelines(verticalPosInfos));
+                horizontalGuidelines.push(...getSnapGuidelines(horizontalPosInfos));
+            });
+        }
+
+        const {
+            boundMap,
+            innerBoundMap,
+        } = addBoundGuidelines(
+            moveable,
+            [left, right],
+            [top, bottom],
+            verticalSnapPoses,
+            horizontalSnapPoses
+        );
+        if (hasExternalPoses) {
+            addBoundGuidelines(
+                moveable,
+                [externalRect.left, externalRect.right],
+                [externalRect.top, externalRect.bottom],
+                verticalSnapPoses,
+                horizontalSnapPoses,
+                snapRenderInfo.externalBounds
+            );
+        }
+        const allGuidelines = [...verticalGuidelines, ...horizontalGuidelines];
+        const elementGuidelines = allGuidelines.filter(guideline => guideline.element && !guideline.gapRects);
+        const gapGuidelines = allGuidelines.filter(guideline => guideline.gapRects).sort((a, b) => {
+            return a.gap! - b.gap!;
+        });
+
+        triggerEvent(
+            moveable,
+            "onSnap",
+            {
+                guidelines: allGuidelines.filter(({ element }) => !element),
+                elements: elementGuidelines,
+                gaps: gapGuidelines,
+            },
+            true
+        );
+
+        const nextBoundMap = watchValue(
+            moveable,
+            "boundMap",
+            boundMap,
+            v => JSON.stringify(v),
+            getInitialBounds(),
+        );
+        const nextInnerBoundMap = watchValue(
+            moveable,
+            "innerBoundMap",
+            innerBoundMap,
+            v => JSON.stringify(v),
+            getInitialBounds(),
+        );
+
+        if (boundMap === nextBoundMap || innerBoundMap === nextInnerBoundMap) {
+            triggerEvent(
+                moveable,
+                "onBound",
+                {
+                    bounds: boundMap,
+                    innerBounds: innerBoundMap,
+                },
+                true
+            );
+        }
+
+
+
+        // verticalSnapPoses.
+        return [
+            ...renderDashedGuidelines(
+                moveable,
+                elementGuidelines,
+                [minLeft, minTop],
+                targetRect,
+                React,
+            ),
+            ...renderGapGuidelines(
+                moveable,
+                gapGuidelines,
+                [minLeft, minTop],
+                targetRect,
+                React,
+            ),
+            ...renderGuidelines(
+                moveable,
+                "horizontal",
+                horizontalGuidelines,
+                [targetLeft, targetTop],
+                targetRect,
+                React
+            ),
+            ...renderGuidelines(
+                moveable,
+                "vertical",
+                verticalGuidelines,
+                [targetLeft, targetTop],
+                targetRect,
+                React
+            ),
+            ...renderSnapPoses(
+                moveable,
+                "horizontal",
+                horizontalSnapPoses,
+                minLeft,
+                targetTop,
+                width,
+                0,
+                React
+            ),
+            ...renderSnapPoses(
+                moveable,
+                "vertical",
+                verticalSnapPoses,
+                minTop,
+                targetLeft,
+                height,
+                1,
+                React
+            ),
+        ];
+    },
+    dragStart(
+        moveable: MoveableManagerInterface<SnappableProps, SnappableState>,
+        e: any
+    ) {
+        moveable.state.snapRenderInfo = {
+            request: e.isRequest,
+            snap: true,
+            center: true,
+        };
+        checkSnapInfo(moveable);
+    },
+    drag(
+        moveable: MoveableManagerInterface<SnappableProps, SnappableState>
+    ) {
+        const state = moveable.state;
+        if (!checkSnapInfo(moveable)) {
+            state.guidelines = getTotalGuidelines(moveable);
+        }
+        if (state.snapRenderInfo) {
+            state.snapRenderInfo.render = true;
+        }
+    },
+    pinchStart(
+        moveable: MoveableManagerInterface<SnappableProps, SnappableState>
+    ) {
+        this.unset(moveable);
+    },
+    dragEnd(
+        moveable: MoveableManagerInterface<SnappableProps, SnappableState>
+    ) {
+        this.unset(moveable);
+    },
+    dragControlCondition(moveable: MoveableManagerInterface, e: any) {
+        if (directionCondition(moveable, e) || rotatableDragControlCondtion(moveable, e)) {
+            return true;
+        }
+        if (!e.isRequest && e.inputEvent) {
+            return hasClass(e.inputEvent.target, prefix("snap-control"));
+        }
+    },
+    dragControlStart(
+        moveable: MoveableManagerInterface<SnappableProps, SnappableState>
+    ) {
+        moveable.state.snapRenderInfo = null;
+        checkSnapInfo(moveable);
+    },
+    dragControl(
+        moveable: MoveableManagerInterface<SnappableProps, SnappableState>
+    ) {
+        this.drag(moveable);
+    },
+    dragControlEnd(
+        moveable: MoveableManagerInterface<SnappableProps, SnappableState>
+    ) {
+        this.unset(moveable);
+    },
+    dragGroupStart(moveable: any, e: any) {
+        this.dragStart(moveable, e);
+    },
+    dragGroup(
+        moveable: MoveableGroupInterface<SnappableProps, SnappableState>
+    ) {
+        this.drag(moveable);
+    },
+    dragGroupEnd(
+        moveable: MoveableGroupInterface<SnappableProps, SnappableState>
+    ) {
+        this.unset(moveable);
+    },
+    dragGroupControlStart(
+        moveable: MoveableGroupInterface<SnappableProps, SnappableState>
+    ) {
+        moveable.state.snapRenderInfo = null;
+        checkSnapInfo(moveable);
+    },
+    dragGroupControl(
+        moveable: MoveableManagerInterface<SnappableProps, SnappableState>
+    ) {
+        this.drag(moveable);
+    },
+    dragGroupControlEnd(
+        moveable: MoveableGroupInterface<SnappableProps, SnappableState>
+    ) {
+        this.unset(moveable);
+    },
+    unset(moveable: any) {
+        const state = moveable.state;
+
+        state.enableSnap = false;
+        state.guidelines = [];
+        state.snapRenderInfo = null;
+        state.elementRects = [];
+    },
+};
+
+
+/**
+ * Whether or not target can be snapped to the guideline. (default: false)
+ * @name Moveable.Snappable#snappable
+ * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body);
+ *
+ * moveable.snappable = true;
+ */
+/**
+ *  A snap container that is the basis for snap, bounds, and innerBounds. (default: null = container)
+ * @name Moveable.Snappable#snapContainer
+ * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.querySelector(".container"));
+ *
+ * moveable.snapContainer = document.body;
+ */
+/**
+ * You can specify the directions to snap to the target. (default: { left: true, top: true, right: true, bottom: true })
+ * @name Moveable.Snappable#snapDirections
+ * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *   snappable: true,
+ *   snapDirections: true,
+ * });
+ * // snap center
+ * moveable.snapDirections = { left: true, top: true, right: true, bottom: true, center: true, middle: true };
+ */
+
+/**
+ * You can specify the snap directions of elements. (default: { left: true, ftrue, right: true, bottom: true })
+ * @name Moveable.Snappable#elementSnapDirections
+ * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *   snappable: true,
+ *   elementSnapDirections: true,
+ * });
+ * // snap center
+ * moveable.elementSnapDirections = { left: true, top: true, right: true, bottom: true, center: true, middle: true };
+ */
+/**
+ * When you drag, make the gap snap in the element guidelines. (default: true)
+ * @name Moveable.Snappable#snapGap
+ * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *   snappable: true,
+ *   snapElement: true,
+ *   snapGap: true,
+ * });
+ *
+ * moveable.snapGap = false;
+ */
+/**
+ * Distance value that can snap to guidelines. (default: 5)
+ * @name Moveable.Snappable#snapThreshold
+ * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body);
+ *
+ * moveable.snapThreshold = 5;
+ */
+
+/**
+ * Add guidelines in the horizontal direction. (default: [])
+ * @name Moveable.Snappable#horizontalGuidelines
+ * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body);
+ *
+ * moveable.horizontalGuidelines = [100, 200, 500];
+ */
+
+/**
+ * Add guidelines in the vertical direction. (default: [])
+ * @name Moveable.Snappable#verticalGuidelines
+ * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body);
+ *
+ * moveable.verticalGuidelines = [100, 200, 500];
+ */
+/**
+ * Add guidelines for the element. (default: [])
+ * @name Moveable.Snappable#elementGuidelines
+ * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body);
+ *
+ * moveable.elementGuidelines = [
+ *   document.querySelector(".element"),
+ * ];
+ */
+/**
+ * You can set up boundaries.
+ * @name Moveable.Snappable#bounds
+ * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}
+ * @default null
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body);
+ *
+ * moveable.bounds = { left: 0, right: 1000, top: 0, bottom: 1000};
+ */
+/**
+ * You can set up inner boundaries.
+ * @name Moveable.Snappable#innerBounds
+ * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}
+ * @default null
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body);
+ *
+ * moveable.innerBounds = { left: 500, top: 500, width: 100, height: 100};
+ */
+/**
+ * snap distance digits (default: 0)
+ * @name Moveable.Snappable#snapDigit
+ * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body);
+ *
+ * moveable.snapDigit = 0
+ */
+
+/**
+ * If width size is greater than 0, you can vertical snap to the grid. (default: 0)
+ * @name Moveable.Snappable#snapGridWidth
+ * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body);
+ *
+ * moveable.snapGridWidth = 5;
+ */
+
+/**
+ * If height size is greater than 0, you can horizontal snap to the grid. (default: 0)
+ * @name Moveable.Snappable#snapGridHeight
+ * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body);
+ *
+ * moveable.snapGridHeight = 5;
+ */
+/**
+ * Whether to show snap distance (default: true)
+ * @name Moveable.Snappable#isDisplaySnapDigit
+ * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body);
+ *
+ * moveable.isDisplaySnapDigit = true;
+ */
+
+/**
+ * Whether to show element inner snap distance (default: false)
+ * @name Moveable.Snappable#isDisplayInnerSnapDigit
+ * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body);
+ *
+ * moveable.isDisplayInnerSnapDigit = true;
+ */
+
+
+/**
+ * You can set the text format of the distance shown in the guidelines. (default: self)
+ * @name Moveable.Snappable#snapDistFormat
+ * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *  snappable: true,
+ *  snapDistFormat: (v, type) => v,
+ * });
+ * moveable.snapDistFormat = (v, type) => `${v}px`;
+ */
+
+/**
+ * When you drag or dragControl, the `snap` event is called.
+ * @memberof Moveable.Snappable
+ * @event snap
+ * @param {Moveable.Snappable.OnSnap} - Parameters for the `snap` event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *     snappable: true
+ * });
+ * moveable.on("snap", e => {
+ *     console.log("onSnap", e);
+ * });
+ */
+
+
+
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + diff --git a/release/0.52.0/doc/packages_react-moveable_src_ables_Warpable.tsx.html b/release/0.52.0/doc/packages_react-moveable_src_ables_Warpable.tsx.html new file mode 100644 index 000000000..e9c3b3b3e --- /dev/null +++ b/release/0.52.0/doc/packages_react-moveable_src_ables_Warpable.tsx.html @@ -0,0 +1,428 @@ + + + + + packages/react-moveable/src/ables/Warpable.tsx - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

packages/react-moveable/src/ables/Warpable.tsx

+ + + + + + + +
+
+
import {
+    prefix, getLineStyle, getDirection, getAbsolutePosesByState,
+    triggerEvent, fillParams, fillEndParams, getDirectionViewClassName, fillCSSObject,
+} from "../utils";
+import {
+    convertDimension, invert, multiply,
+    calculate,
+    createIdentityMatrix,
+    ignoreDimension,
+    minus,
+    createWarpMatrix,
+    plus,
+} from "@scena/matrix";
+import { NEARBY_POS } from "../consts";
+import {
+    setDragStart, getDragDist, getPosIndexesByDirection, setDefaultTransformIndex,
+    fillTransformStartEvent, resolveTransformEvent,
+    convertTransformFormat, fillOriginalTransform, getTransfromMatrix,
+} from "../gesto/GestoUtils";
+import {
+    WarpableProps, ScalableProps, ResizableProps,
+    Renderer, SnappableProps, SnappableState,
+    OnWarpStart, OnWarp, OnWarpEnd, MoveableManagerInterface,
+} from "../types";
+import { hasClass, dot, getRad } from "@daybrush/utils";
+import { renderAllDirections } from "../renderDirections";
+import { hasGuidelines } from "./snappable/utils";
+import { checkMoveableSnapBounds } from "./snappable/snapBounds";
+
+function getMiddleLinePos(pos1: number[], pos2: number[]) {
+    return pos1.map((pos, i) => dot(pos, pos2[i], 1, 2));
+}
+
+function getTriangleRad(pos1: number[], pos2: number[], pos3: number[]) {
+    // pos1 Rad
+    const rad1 = getRad(pos1, pos2);
+    const rad2 = getRad(pos1, pos3);
+
+    const rad = rad2 - rad1;
+
+    return rad >= 0 ? rad : rad + 2 * Math.PI;
+}
+
+function isValidPos(poses1: number[][], poses2: number[][]) {
+    const rad1 = getTriangleRad(poses1[0], poses1[1], poses1[2]);
+    const rad2 = getTriangleRad(poses2[0], poses2[1], poses2[2]);
+    const pi = Math.PI;
+
+    if ((rad1 >= pi && rad2 <= pi) || (rad1 <= pi && rad2 >= pi)) {
+        return false;
+    }
+    return true;
+}
+
+/**
+ * @namespace Moveable.Warpable
+ * @description Warpable indicates whether the target can be warped(distorted, bented).
+ */
+export default {
+    name: "warpable",
+    ableGroup: "size",
+    props: [
+        "warpable",
+        "renderDirections",
+        "edge",
+        "displayAroundControls",
+    ] as const,
+    events: [
+        "warpStart",
+        "warp",
+        "warpEnd",
+    ] as const,
+    viewClassName: getDirectionViewClassName("warpable"),
+    render(moveable: MoveableManagerInterface<ResizableProps & ScalableProps & WarpableProps>, React: Renderer): any[] {
+        const { resizable, scalable, warpable, zoom } = moveable.props;
+
+        if (resizable || scalable || !warpable) {
+            return [];
+        }
+        const { pos1, pos2, pos3, pos4 } = moveable.state;
+
+        const linePosFrom1 = getMiddleLinePos(pos1, pos2);
+        const linePosFrom2 = getMiddleLinePos(pos2, pos1);
+        const linePosFrom3 = getMiddleLinePos(pos1, pos3);
+        const linePosFrom4 = getMiddleLinePos(pos3, pos1);
+        const linePosTo1 = getMiddleLinePos(pos3, pos4);
+        const linePosTo2 = getMiddleLinePos(pos4, pos3);
+        const linePosTo3 = getMiddleLinePos(pos2, pos4);
+        const linePosTo4 = getMiddleLinePos(pos4, pos2);
+
+        return [
+            <div className={prefix("line")}
+                key="middeLine1" style={getLineStyle(linePosFrom1, linePosTo1, zoom)}></div>,
+            <div className={prefix("line")}
+                key="middeLine2" style={getLineStyle(linePosFrom2, linePosTo2, zoom)}></div>,
+            <div className={prefix("line")}
+                key="middeLine3" style={getLineStyle(linePosFrom3, linePosTo3, zoom)}></div>,
+            <div className={prefix("line")}
+                key="middeLine4" style={getLineStyle(linePosFrom4, linePosTo4, zoom)}></div>,
+            ...renderAllDirections(moveable, "warpable", React),
+        ];
+    },
+    dragControlCondition(moveable: any, e: any) {
+        if (e.isRequest) {
+            return false;
+        }
+        const target = e.inputEvent.target;
+
+        return hasClass(target, prefix("direction")) && hasClass(target, prefix("warpable"));
+    },
+    dragControlStart(
+        moveable: MoveableManagerInterface<WarpableProps, SnappableState>,
+        e: any,
+    ) {
+        const { datas, inputEvent } = e;
+        const { target } = moveable.props;
+        const { target: inputTarget } = inputEvent;
+        const direction = getDirection(inputTarget, datas);
+
+        if (!direction || !target) {
+            return false;
+        }
+        const state = moveable.state;
+        const {
+            transformOrigin, is3d,
+            targetTransform, targetMatrix,
+            width, height,
+            left, top,
+        } = state;
+
+        datas.datas = {};
+        datas.targetTransform = targetTransform;
+        datas.warpTargetMatrix = is3d ? targetMatrix : convertDimension(targetMatrix, 3, 4);
+        datas.targetInverseMatrix = ignoreDimension(invert(datas.warpTargetMatrix, 4), 3, 4);
+        datas.direction = direction;
+        datas.left = left;
+        datas.top = top;
+        datas.poses = [
+            [0, 0],
+            [width, 0],
+            [0, height],
+            [width, height],
+        ].map(p => minus(p, transformOrigin));
+
+        datas.nextPoses = datas.poses.map(([x, y]: number[]) => calculate(datas.warpTargetMatrix, [x, y, 0, 1], 4));
+        datas.startValue = createIdentityMatrix(4);
+        datas.prevMatrix = createIdentityMatrix(4);
+        datas.absolutePoses = getAbsolutePosesByState(state);
+        datas.posIndexes = getPosIndexesByDirection(direction);
+
+        setDragStart(moveable, e);
+        setDefaultTransformIndex(moveable, e, "matrix3d");
+
+        state.snapRenderInfo = {
+            request: e.isRequest,
+            direction,
+        };
+
+        const params = fillParams<OnWarpStart>(moveable, e, {
+            set: (matrix: number[]) => {
+                datas.startValue = matrix;
+            },
+            ...fillTransformStartEvent(moveable, e),
+        });
+        const result = triggerEvent(moveable, "onWarpStart", params);
+        if (result !== false) {
+            datas.isWarp = true;
+        }
+        return datas.isWarp;
+    },
+    dragControl(
+        moveable: MoveableManagerInterface<WarpableProps & SnappableProps, SnappableState>,
+        e: any,
+    ) {
+        const { datas, isRequest } = e;
+        let { distX, distY } = e;
+        const {
+            targetInverseMatrix, prevMatrix, isWarp, startValue,
+            poses,
+            posIndexes,
+            absolutePoses,
+        } = datas;
+
+        if (!isWarp) {
+            return false;
+        }
+        resolveTransformEvent(moveable, e, "matrix3d");
+        if (hasGuidelines(moveable, "warpable")) {
+            const selectedPoses: number[][] = posIndexes.map((index: number) => absolutePoses[index]);
+
+            if (selectedPoses.length > 1) {
+                selectedPoses.push([
+                    (selectedPoses[0][0] + selectedPoses[1][0]) / 2,
+                    (selectedPoses[0][1] + selectedPoses[1][1]) / 2,
+                ]);
+            }
+
+            const {
+                horizontal: horizontalSnapInfo,
+                vertical: verticalSnapInfo,
+            } = checkMoveableSnapBounds(
+                moveable,
+                isRequest,
+                {
+                    horizontal: selectedPoses.map(pos => pos[1] + distY),
+                    vertical: selectedPoses.map(pos => pos[0] + distX),
+                },
+            );
+
+            distY -= horizontalSnapInfo.offset;
+            distX -= verticalSnapInfo.offset;
+        }
+
+        const dist = getDragDist({ datas, distX, distY }, true);
+        const nextPoses = datas.nextPoses.slice();
+
+        posIndexes.forEach((index: number) => {
+            nextPoses[index] = plus(nextPoses[index], dist);
+        });
+
+        if (!NEARBY_POS.every(
+            nearByPoses => isValidPos(nearByPoses.map(i => poses[i]), nearByPoses.map(i => nextPoses[i])),
+        )) {
+            return false;
+        }
+        const h = createWarpMatrix(
+            poses[0],
+            poses[2],
+            poses[1],
+            poses[3],
+            nextPoses[0],
+            nextPoses[2],
+            nextPoses[1],
+            nextPoses[3],
+        );
+
+        if (!h.length) {
+            return false;
+        }
+        // B * A * M
+        const afterMatrix = multiply(targetInverseMatrix, h, 4);
+
+        // B * M * A
+        const matrix = getTransfromMatrix(datas, afterMatrix, true);
+
+        const delta = multiply(invert(prevMatrix, 4), matrix, 4);
+
+        datas.prevMatrix = matrix;
+        const totalMatrix = multiply(startValue, matrix, 4);
+        const nextTransform = convertTransformFormat(
+            datas, `matrix3d(${totalMatrix.join(", ")})`, `matrix3d(${matrix.join(", ")})`);
+
+        fillOriginalTransform(e, nextTransform);
+        triggerEvent(moveable, "onWarp", fillParams<OnWarp>(moveable, e, {
+            delta,
+            matrix: totalMatrix,
+            dist: matrix,
+            multiply,
+            transform: nextTransform,
+            ...fillCSSObject({
+                transform: nextTransform,
+            }, e),
+        }));
+        return true;
+    },
+    dragControlEnd(
+        moveable: MoveableManagerInterface<WarpableProps>,
+        e: any,
+    ) {
+        const { datas, isDrag } = e;
+        if (!datas.isWarp) {
+            return false;
+        }
+        datas.isWarp = false;
+
+        triggerEvent(moveable, "onWarpEnd", fillEndParams<OnWarpEnd>(moveable, e, {}));
+        return isDrag;
+    },
+};
+
+/**
+ * Whether or not target can be warped. (default: false)
+ * @name Moveable.Warpable#warpable
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body);
+ *
+ * moveable.warpable = true;
+ */
+
+/**
+* Set directions to show the control box. (default: ["n", "nw", "ne", "s", "se", "sw", "e", "w"])
+* @name Moveable.Warpable#renderDirections
+* @example
+* import Moveable from "moveable";
+*
+* const moveable = new Moveable(document.body, {
+*     warpable: true,
+*     renderDirections: ["n", "nw", "ne", "s", "se", "sw", "e", "w"],
+* });
+*
+* moveable.renderDirections = ["nw", "ne", "sw", "se"];
+*/
+/**
+* When the warp starts, the warpStart event is called.
+* @memberof Moveable.Warpable
+* @event warpStart
+* @param {Moveable.Warpable.OnWarpStart} - Parameters for the warpStart event
+* @example
+* import Moveable from "moveable";
+*
+* const moveable = new Moveable(document.body, { warpable: true });
+* moveable.on("warpStart", ({ target }) => {
+*     console.log(target);
+* });
+*/
+/**
+ * When warping, the warp event is called.
+ * @memberof Moveable.Warpable
+ * @event warp
+ * @param {Moveable.Warpable.OnWarp} - Parameters for the warp event
+ * @example
+ * import Moveable from "moveable";
+ * let matrix = [
+ *  1, 0, 0, 0,
+ *  0, 1, 0, 0,
+ *  0, 0, 1, 0,
+ *  0, 0, 0, 1,
+ * ];
+ * const moveable = new Moveable(document.body, { warpable: true });
+ * moveable.on("warp", ({ target, transform, delta, multiply }) => {
+ *    // target.style.transform = transform;
+ *    matrix = multiply(matrix, delta);
+ *    target.style.transform = `matrix3d(${matrix.join(",")})`;
+ * });
+ */
+/**
+ * When the warp finishes, the warpEnd event is called.
+ * @memberof Moveable.Warpable
+ * @event warpEnd
+ * @param {Moveable.Warpable.OnWarpEnd} - Parameters for the warpEnd event
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, { warpable: true });
+ * moveable.on("warpEnd", ({ target, isDrag }) => {
+ *     console.log(target, isDrag);
+ * });
+ */
+
+
+
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + diff --git a/release/0.52.0/doc/packages_react-moveable_src_ables_edgeDraggable.tsx.html b/release/0.52.0/doc/packages_react-moveable_src_ables_edgeDraggable.tsx.html new file mode 100644 index 000000000..0f5255978 --- /dev/null +++ b/release/0.52.0/doc/packages_react-moveable_src_ables_edgeDraggable.tsx.html @@ -0,0 +1,172 @@ + + + + + packages/react-moveable/src/ables/edgeDraggable.tsx - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

packages/react-moveable/src/ables/edgeDraggable.tsx

+ + + + + + + +
+
+
import { hasClass } from "@daybrush/utils";
+import { DraggableProps, MoveableGroupInterface, MoveableManagerInterface, Renderer } from "../types";
+import { prefix } from "../utils";
+import Draggable from "./Draggable";
+import { makeAble } from "./AbleManager";
+import { renderEdgeLines } from "../renderDirections";
+
+function getDraggableEvent(e: any) {
+    let datas = e.originalDatas.draggable;
+    if (!datas) {
+        e.originalDatas.draggable = {};
+        datas = e.originalDatas.draggable;
+    }
+    return { ...e, datas };
+}
+export default makeAble("edgeDraggable", {
+    css: [
+        `.edge.edgeDraggable.line {
+cursor: move;
+}`,
+    ],
+    render(moveable: MoveableManagerInterface<DraggableProps>, React: Renderer) {
+        const props = moveable.props;
+        const edge = props.edgeDraggable!;
+
+        if (!edge) {
+            return [];
+        }
+        return renderEdgeLines(
+            React,
+            "edgeDraggable",
+            edge,
+            moveable.getState().renderPoses,
+            props.zoom!,
+        );
+    },
+    dragCondition(moveable: MoveableManagerInterface<DraggableProps>, e: any) {
+        const props = moveable.props;
+        const target = e.inputEvent?.target;
+
+        if (!props.edgeDraggable || !target) {
+            return false;
+        }
+
+        return !props.draggable
+            && hasClass(target, prefix("direction"))
+            && hasClass(target, prefix("edge"))
+            && hasClass(target, prefix("edgeDraggable"));
+    },
+    dragStart(moveable: MoveableManagerInterface<DraggableProps>, e: any) {
+        return Draggable.dragStart(moveable, getDraggableEvent(e));
+    },
+    drag(moveable: MoveableManagerInterface<DraggableProps>, e: any) {
+        return Draggable.drag(moveable, getDraggableEvent(e));
+    },
+    dragEnd(moveable: MoveableManagerInterface<DraggableProps, any>, e: any) {
+        return Draggable.dragEnd(moveable, getDraggableEvent(e));
+    },
+    dragGroupCondition(moveable: MoveableGroupInterface<DraggableProps>, e: any) {
+        const props = moveable.props;
+        const target = e.inputEvent?.target;
+
+        if (!props.edgeDraggable || !target) {
+            return false;
+        }
+        return !props.draggable && hasClass(target, prefix("direction")) && hasClass(target, prefix("line"));
+    },
+    dragGroupStart(moveable: MoveableGroupInterface<DraggableProps>, e: any) {
+        return Draggable.dragGroupStart(moveable, getDraggableEvent(e));
+    },
+    dragGroup(moveable: MoveableGroupInterface<DraggableProps>, e: any) {
+        return Draggable.dragGroup(moveable, getDraggableEvent(e));
+    },
+    dragGroupEnd(moveable: MoveableGroupInterface<DraggableProps, any>, e: any) {
+        return Draggable.dragGroupEnd(moveable, getDraggableEvent(e));
+    },
+    unset(moveable: any) {
+        return Draggable.unset(moveable);
+    },
+});
+
+/**
+ * Whether to move by dragging the edge line (default: false)
+ * @name Moveable.Draggable#edgeDraggable
+ * @example
+ * import Moveable from "moveable";
+ *
+ * const moveable = new Moveable(document.body, {
+ *  draggable: true,
+ *  edgeDraggable: false,
+ * });
+ *
+ * moveable.edgeDraggable = true;
+ */
+
+
+
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + diff --git a/release/0.52.0/doc/packages_react-moveable_src_types.ts.html b/release/0.52.0/doc/packages_react-moveable_src_types.ts.html new file mode 100644 index 000000000..e5f349f05 --- /dev/null +++ b/release/0.52.0/doc/packages_react-moveable_src_types.ts.html @@ -0,0 +1,3557 @@ + + + + + packages/react-moveable/src/types.ts - Documentation + + + + + + + + + + + + + + + + + + + + + +
+ +

packages/react-moveable/src/types.ts

+ + + + + + + +
+
+
import { IObject } from "@daybrush/utils";
+import Gesto, * as GestoTypes from "gesto";
+import CustomGesto from "./gesto/CustomGesto";
+import { MoveableTargetInfo } from "./utils/getMoveableTargetInfo";
+import { DragScrollOptions } from "@scena/dragscroll";
+import { MOVEABLE_PROPS, MOVEABLE_EVENTS } from "./ables/consts";
+
+export interface MoveableClientRect {
+    left: number;
+    top: number;
+    right: number;
+    bottom: number;
+    width: number;
+    height: number;
+    clientLeft?: number;
+    clientTop?: number;
+    clientWidth?: number;
+    clientHeight?: number;
+    scrollWidth?: number;
+    scrollHeight?: number;
+    overflow?: boolean;
+}
+export type MoveableManagerProps<T = {}> = {
+    cssStyled: any;
+    customStyledMap: Record<string, any>;
+    wrapperMoveable?: MoveableManagerInterface | null;
+    isWrapperMounted?: boolean;
+    parentMoveable?: MoveableManagerInterface | null;
+    parentPosition?: number[] | null;
+    groupable?: boolean;
+} & MoveableDefaultOptions & (unknown extends T ? IObject<any> : T);
+
+export type AnyObject<T> = (unknown extends T ? IObject<any> : T);
+
+/**
+ * @typedef
+ * @memberof Moveable
+ */
+export interface MoveablePosition {
+    left: number;
+    top: number;
+    right: number;
+    bottom: number;
+    origin: number[];
+    pos1: number[];
+    pos2: number[];
+    pos3: number[];
+    pos4: number[];
+    direction: 1 | -1;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable
+ * @options
+ */
+export interface DefaultOptions {
+    /**
+     * The target(s) to indicate Moveable Control Box.
+     * @default null
+     */
+    target?: SVGElement | HTMLElement | null;
+    /**
+     * The external target(s) to drag Moveable target(s)
+     * @default target
+     */
+    dragTarget?: MoveableRefType | null;
+    /**
+     * If dragTarget is set directly, taget itself cannot be dragged.
+     * Whether to drag the target as well.
+     * @default false
+     */
+    dragTargetSelf?: boolean;
+    /**
+     * Container area where drag works
+     * @default window
+     */
+    dragContainer?: null | Window | MoveableRefType<HTMLElement>;
+    /**
+     * A container into which Moveables are inserted.
+     * Set it only when used within the slot of Web Components or when the container is different.
+     * @default parentElement
+     */
+    container?: SVGElement | HTMLElement | null;
+    /**
+     * Whether to warp itself to the container itself. Don't set it.
+     * @private
+     * @default false
+     */
+    warpSelf?: boolean;
+    /**
+     * Moveable Root Container (No Transformed Container)
+     * @default parentElement
+     * @story options--options-root-container
+     */
+    rootContainer?: MoveableRefType<HTMLElement>;
+    /**
+     * If you want to set the dragging information to the viewer, refer to the following.
+     * @default null
+     * @story options--options-view-container
+     */
+    viewContainer?: MoveableRefType<HTMLElement>;
+    /**
+     * Whether the target size is detected and updated whenever it changes.
+     * It is more effective when used together with `useMutationObserver`.
+     * @default false
+     * @story options--options-resize-observer
+     */
+    useResizeObserver?: boolean;
+    /**
+     * Whether the target size, pos in inline style is detected and updated whenever it changes.
+     * It is more effective when used together with `useResizeObserver`.
+     * @default false
+     * @story options--options-mutation-observer
+     */
+    useMutationObserver?: boolean;
+    /**
+     * Zooms in the elements of a moveable.
+     * @default 1
+     */
+    zoom?: number;
+    /**
+     * The default transformOrigin of the target can be set in advance.
+     * @default ""
+     */
+    transformOrigin?: Array<string | number> | string | "";
+    /**
+     * You can add your custom able.
+     * @default []
+     */
+    ables?: Able[];
+    /**
+     * You can specify the className of the moveable controlbox.
+     * @default ""
+     */
+    className?: string;
+    /**
+     * Minimum distance to pinch.
+     * @default 20
+     */
+    pinchThreshold?: number;
+    /**
+     * Whether the container containing the target becomes a pinch.
+     * @default true
+     */
+    pinchOutside?: boolean;
+    /**
+     * Lets generate events of ables at the same time. (like Resizable, Scalable)
+     * @default false
+     */
+    triggerAblesSimultaneously?: boolean;
+    /**
+     * Checks whether this is an element to input text or contentEditable, and prevents dragging.
+     * @default false
+     */
+    checkInput?: boolean;
+    /**
+     * add nonce property to style for CSP.
+     * @deprecated
+     * @default ""
+     */
+    cspNonce?: string;
+    /**
+     * You can set the translateZ value of moveable.
+     * @default 50
+     */
+    translateZ?: number | string;
+    /**
+     * Whether to hide the line corresponding to the rect of the target.
+     * @default false
+     */
+    hideDefaultLines?: boolean;
+    /**
+     * Whether to prevent bubbling of events like mousedown, touchstart, etc.
+     * @default false
+     */
+    stopPropagation?: boolean;
+    /**
+     * Whether to call preventDefault on touchstart or mousedown
+     * @since 0.44.0
+     * @default true
+     */
+    preventDefault?: boolean;
+    /**
+     * Prevent click event on drag. (mousemove, touchmove)
+     * @default true
+     */
+    preventClickEventOnDrag?: boolean;
+    /**
+     * Whether to drag the focused input
+     * If `checkInput` is true, this option is not applied.
+     * @since 0.47.0
+     * @story options--options-drag-focused-input
+     * @default false
+     */
+    dragFocusedInput?: boolean;
+    /**
+     * Prevent click event on dragStart. (mousedown, touchstart)
+     * @default false
+     */
+    preventClickDefault?: boolean;
+    /**
+     * You can use props in object format or custom props.
+     * @default empty object
+     */
+    props?: Record<string, any>;
+    /**
+     * Data for first render
+     * @default null
+     */
+    persistData?: PersistRectData | null;
+    /**
+     * Whether to accurately show the position of a movable control box
+     * Because getBoundingClientRect is used, css zoom, transform: rotate between container and rootContainer cannot be used.
+     * group is not supported.
+     * @default false
+     */
+    useAccuratePosition?: boolean;
+    /**
+     * By adding padding to the line, you can increase the area of the line that can be clicked and dragged.
+     * @since 0.43.0
+     * @story options--options-line-padding
+     * @default 0
+     */
+    linePadding?: number;
+    /**
+     * By adding padding to the control, you can increase the area of the control that can be clicked and dragged.
+     * Either `rotateAroundControls` or `displayAroundControls` can be used.
+     * @since 0.44.0
+     * @story options--options-control-padding
+     * @default 0
+     */
+    controlPadding?: number;
+    /**
+     * @private
+     * single => group로 변환과정에 도형 유지를 위한 첫 렌더링 state
+     */
+    firstRenderState?: MoveableManagerState | null;
+    /**
+     * @private
+     */
+    requestStyles?: string[];
+    /**
+     * If you are using React 18's concurrent mode, use `flushSync` for UI sync.
+     * @default empty function
+     * @example
+     * ```jsx
+     * import { flushSync } from "react-dom";
+     *
+     * <Moveable flushSync={flushSync} />
+     * ```
+     */
+    flushSync?: (callback: () => void) => void;
+}
+/**
+ * @typedef
+ * @extends Moveable.DefaultOptions
+ * @extends Moveable.DragAreaOptions
+ * @extends Moveable.OriginOptions
+ * @extends Moveable.PaddingOptions
+ */
+export interface MoveableDefaultOptions
+    extends DefaultOptions, DragAreaOptions, OriginOptions, PaddingOptions {
+}
+export interface MatrixInfo {
+    type: "offset" | "target" | "zoom";
+    target: SVGElement | HTMLElement;
+    matrix?: number[];
+    origin?: number[];
+    zoom?: number;
+}
+export type MoveableManagerState<T = {}> = {
+    container: SVGElement | HTMLElement | null | undefined;
+    disableNativeEvent: boolean;
+    gestos: Record<string, Gesto | CustomGesto | null>;
+    renderLines: number[][][];
+    renderPoses: number[][];
+    posDelta: number[];
+    style: Partial<Writable<CSSStyleDeclaration>>;
+    isPersisted?: boolean;
+} & MoveableTargetInfo & T;
+
+/**
+ * @typedef
+ * @memberof Moveable
+ */
+export interface ElementSizes {
+    svg: boolean;
+    offsetWidth: number;
+    offsetHeight: number;
+    clientWidth: number;
+    clientHeight: number;
+    inlineCSSWidth: number;
+    inlineCSSHeight: number;
+    cssWidth: number;
+    cssHeight: number;
+    contentWidth: number;
+    contentHeight: number;
+    minWidth: number;
+    minHeight: number;
+    maxWidth: number;
+    maxHeight: number;
+    minOffsetWidth: number;
+    minOffsetHeight: number;
+    maxOffsetWidth: number;
+    maxOffsetHeight: number;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable
+ */
+export type LineDirection = "n" | "e" | "s" | "w" | "nw" | "ne" | "sw" | "se";
+
+/**
+ * @typedef
+ * @memberof Moveable
+ * @property - left padding
+ * @property - top padding
+ * @property - right padding
+ * @property - bottom padding
+ */
+export interface PaddingBox {
+    left?: number;
+    top?: number;
+    right?: number;
+    bottom?: number;
+}
+
+export interface Renderer {
+    createElement(type: any, props?: any, ...children: any[]): any;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Snappable
+ */
+export interface SnapGuideline {
+    type: "horizontal" | "vertical";
+    direction: string;
+    hide?: boolean;
+    element?: Element | null;
+
+    isStart?: boolean;
+    isEnd?: boolean;
+    isCenter?: boolean;
+    isInner?: boolean;
+    grid?: boolean;
+
+    pos: number[];
+    size: number;
+    className?: string;
+    sizes?: number[];
+
+    gap?: number;
+    elementDirection?: string;
+    elementRect?: SnapElementRect;
+    gapRects?: SnapElementRect[];
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Snappable
+ */
+export interface SnapElementGuideline extends SnapGuideline {
+
+}
+
+export interface SnapBoundInfo {
+    isBound: boolean;
+    isSnap: boolean;
+    offset: number;
+    dist: number;
+    snapIndex?: number;
+    bounds?: BoundInfo[];
+    snap?: SnapInfo;
+}
+export interface BoundInfo {
+    direction?: "start" | "end";
+    isBound: boolean;
+    offset: number;
+    pos: number;
+}
+export interface SnapOffsetInfo {
+    isSnap: boolean;
+    offset: number;
+    pos: number;
+}
+export interface SnapDirectionInfo extends SnapInfo {
+    direction: string;
+}
+export interface SnapInfo {
+    isSnap: boolean;
+    index: number;
+    direction: string;
+    posInfos: SnapPosInfo[];
+}
+export interface SnapPosInfo {
+    pos: number;
+    index: number;
+    direction: string;
+    guidelineInfos: SnapGuidelineInfo[];
+}
+export interface SnapGuidelineInfo {
+    dist: number;
+    offset: number;
+    direction: string;
+    guideline: SnapGuideline;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Snappable
+ */
+export interface RenderGuidelineInfo {
+    key?: string;
+    direction: string;
+    classNames: string[];
+    size: string;
+    pos: string[];
+    sizeValue: number;
+    posValue: number[];
+    zoom: number;
+}
+export interface RenderGuidelineInnerInfo {
+    key?: string;
+    direction: string;
+    classNames: Array<string | undefined>;
+    size?: string;
+    pos?: string[];
+    sizeValue: number;
+    posValue: number[];
+    zoom: number;
+}
+export type ExcludeKeys<T extends IObject<any>, U> = Pick<T, Exclude<keyof T, U>>;
+
+export interface MoveableProps extends
+    MoveableDefaultProps,
+    DraggableProps,
+    DragAreaProps,
+    OriginDraggableProps,
+    RotatableProps,
+    ResizableProps,
+    ScalableProps,
+    WarpableProps,
+    PinchableProps,
+    ExcludeKeys<GroupableProps, "targets" | "updateGroup">,
+    IndividualGroupableProps,
+    SnappableProps,
+    ScrollableProps,
+    ClippableProps,
+    RoundableProps,
+    BeforeRenderableProps,
+    ClickableProps,
+    RenderableProps {
+}
+/**
+ * @memberof Moveable
+ * @typedef
+ */
+export interface MoveableDefaultEvents {
+    onChangeTargets?: (e: OnChangeTargets) => void;
+}
+
+export interface MoveableInitalOptions extends ExcludeKeys<MoveableDefaultOptions, "target"> {
+    target?: MoveableRefTargetType;
+}
+
+/**
+ * @memberof Moveable
+ * @typedef
+ * @extends Moveable.MoveableDefaultOptions
+ * @extends Moveable.MoveableDefaultEvents
+ */
+export interface MoveableDefaultProps extends MoveableInitalOptions, MoveableDefaultEvents {
+
+}
+/**
+ * @memberof Moveable
+ * @typedef
+ */
+export type MoveableRefTargetType = MoveableRefType | ArrayFormat<MoveableRefTargetType>;
+
+export type MoveableRefTargetsResultType
+    = Array<HTMLElement | SVGElement | string | null | MoveableRefTargetsResultType>;
+
+/**
+ * @memberof Moveable
+ * @typedef
+ */
+export type MoveableRefType<T extends Element = HTMLElement | SVGElement>
+    = string | (() => T) | MoveableRefObject<T> | T | null | undefined;
+/**
+ * @memberof Moveable
+ * @typedef
+ */
+export interface MoveableRefObject<T extends Element = HTMLElement | SVGElement> {
+    current: T | undefined | null;
+}
+/**
+ * @memberof Moveable
+ * @typedef
+ * @extends Moveable.MoveableDefaultProps
+ * @extends Moveable.Draggable.DraggableOptions
+ * @extends Moveable.Resizable.ResizableOptions
+ * @extends Moveable.Scalable.ScalableOptions
+ * @extends Moveable.Rotatable.RotatableOptions
+ * @extends Moveable.Warpable.WarpableOptions
+ * @extends Moveable.Pinchable.PinchableOptions
+ * @extends Moveable.Group.GroupableOptions
+ * @extends Moveable.OriginDraggable.OriginDraggableOptions
+ * @extends Moveable.Scrollable.ScrollableOptions
+ * @extends Moveable.Clippable.ClippableOptions
+ * @extends Moveable.Roundable.RoundableOptions
+ * @extends Moveable.Clickable.ClickableOptions
+ */
+export interface MoveableOptions extends
+    MoveableInitalOptions,
+    DraggableOptions,
+    DragAreaOptions,
+    OriginDraggableOptions,
+    RotatableOptions,
+    ResizableOptions,
+    ScalableOptions,
+    WarpableOptions,
+    PinchableOptions,
+    GroupableOptions,
+    IndividualGroupableOptions,
+    SnappableOptions,
+    ScrollableOptions,
+    ClippableOptions,
+    RoundableOptions,
+    ClickableOptions {
+}
+
+export type MoveableState = MoveableManagerState;
+
+/**
+ * You can make Able that can work in Moveable.
+ * @typedef
+ * In Able, you can manage drag events, props, state, fire event props, and render elements.
+ * @memberof Moveable
+ */
+export interface Able<
+    Props extends IObject<any> = IObject<any>,
+    Events extends IObject<any> = IObject<any>
+> {
+    name: string;
+    props?: readonly (keyof Props)[];
+    events?: readonly (keyof Events)[];
+    // Whether to always include in able. It is recommended to use always in frameworks other than react
+    always?: boolean;
+    ableGroup?: string;
+    updateRect?: boolean;
+    canPinch?: boolean;
+    css?: string[];
+    /**
+     * You can request style. Specify the name of the style in camel case.
+     * You can check it with `moveable.state.style`
+     * @exmaple
+     * ["borderRadius", "top", "left"]
+     */
+    requestStyle?(): string[];
+    /**
+     * If you use group, you can request child style. Specify the name of the style in camel case.
+     * You can check it with `moveable.state.style`
+     * @exmaple
+     * ["borderRadius", "top", "left"]
+     */
+    requestChildStyle?(): string[];
+    /**
+     * You can specify the class name to be added to the Moveable control box.
+     */
+    className?(moveable: any): string;
+    /**
+     * You can specify the class name to be added to the Moveable View Container
+     */
+    viewClassName?(moveable: any): string;
+    /**
+     * Check how related to drag
+     */
+    dragRelation?: "strong" | "weak" | undefined | null | false,
+    /**
+     * Fired when the event is cleared
+     */
+    unset?(moveable: any): any;
+    /**
+     * Renders the React DOM structure for the able.
+     */
+    render?(moveable: any, renderer: Renderer): any;
+
+    // Operates when a drag event occurs for the single target.
+    dragStart?(moveable: any, e: any): any;
+    drag?(moveable: any, e: any): any;
+    dragEnd?(moveable: any, e: any): any;
+    dragAfter?(moveable: any, e: any): any;
+
+    // Operates when a pinch event occurs for the single target.
+    pinchStart?(moveable: any, e: GestoTypes.OnPinchStart): any;
+    pinch?(moveable: any, e: GestoTypes.OnPinch): any;
+    pinchEnd?(moveable: any, e: GestoTypes.OnPinchEnd): any;
+
+    // Condition that occurs dragControl
+    dragControlCondition?(moveable: any, e: any): boolean;
+    // Operates when a drag event occurs for the moveable control and single target.
+    dragControlStart?(moveable: any, e: any): any;
+    dragControl?(moveable: any, e: any): any;
+    dragControlEnd?(moveable: any, e: any): any;
+    dragControlAfter?(moveable: any, e: any): any;
+
+    // Condition that occurs dragGroup
+    dragGroupCondition?(moveable: any, e: any): boolean;
+    // Operates when a drag event occurs for the multi target.
+    dragGroupStart?(moveable: any, e: any): any;
+    dragGroup?(moveable: any, e: any): any;
+    dragGroupEnd?(moveable: any, e: any): any;
+
+    // Operates when a pinch event occurs for the multi target.
+    pinchGroupStart?(moveable: any, e: GestoTypes.OnPinchStart): any;
+    pinchGroup?(moveable: any, e: GestoTypes.OnPinch): any;
+    pinchGroupEnd?(moveable: any, e: GestoTypes.OnPinchEnd): any;
+
+    // Condition that occurs dragGroupControl
+    dragGroupControlCondition?(moveable: any, e: any): boolean;
+
+    // Operates when a drag event occurs for the moveable control and multi target.
+    dragGroupControlStart?(moveable: any, e: any): any;
+    dragGroupControl?(moveable: any, e: any): any;
+    dragGroupControlEnd?(moveable: any, e: any): any;
+
+    // mouse enter event
+    mouseEnter?(moveable: any, e: any): any;
+    // mouse leave event
+    mouseLeave?(moveable: any, e: any): any;
+
+    // mouse enter event for group
+    mouseGroupEnter?(moveable: any, e: any): any;
+    // mouse leave event for group
+    mouseGroupLeave?(moveable: any, e: any): any;
+
+
+    // Execute the operation of able for external request
+    request?(moveable: any): AbleRequester;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable
+ */
+export interface OnEvent {
+    /**
+     * The Moveable instance
+     */
+    currentTarget: MoveableManagerInterface<Record<string, any>, Record<string, any>>;
+    /**
+     * The Moveable instance
+     */
+    moveable: MoveableManagerInterface<Record<string, any>, Record<string, any>>;
+    /**
+     * The Moveable's target
+     */
+    target: HTMLElement | SVGElement;
+    /**
+     * The horizontal coordinate within the application's client area at which the event occurred.
+     */
+    clientX: number;
+    /**
+     * The vertical coordinate within the application's client area at which the event occurred.
+     */
+    clientY: number;
+    /**
+     * Whether this is the first drag in the drag event
+     */
+    isFirstDrag: number;
+    /**
+     * Objects that can send information to the following events.
+     */
+    datas: IObject<any>;
+    /**
+     * The mouse or touch input event that is invoking the moveable event
+     */
+    inputEvent: any;
+    /**
+     * Stop the currently working able.
+     */
+    stopAble(): void;
+    /**
+     * Calling `stopDrag` in a drag-related event ends the drag.
+     */
+    stopDrag(): void;
+    /**
+     * Whether the event did not occur externally
+     */
+    isTrusted: boolean;
+
+}
+/**
+ * @typedef
+ * @memberof Moveable
+ * @extends Moveable.OnEvent
+ * @property - This is the last dragged event. No, if you haven't dragged.
+ * @property - Whether this moved
+ * @property - Whether it is double-click
+ */
+export interface OnEndEvent extends OnEvent {
+    lastEvent: any | undefined;
+    isDrag: boolean;
+    isDouble: boolean;
+}
+/**
+ * @typedef
+ * @memberof Moveable
+ */
+export interface OnTransformStartEvent {
+    /**
+     * Set your original transform.
+     * `transformIndex` is the sequence of functions used in the event.
+     * If you use `setTransform`, you don't need to use `set` function.
+     * @default transform of target's inline style
+     */
+    setTransform(transform: string | string[], transformIndex?: number): void;
+    /**
+     * `transformIndex` is the sequence of functions used in the event.
+     * @default index with that property in transform or last
+     */
+    setTransformIndex(transformIndex: number): void;
+}
+/**
+ * @typedef
+ * @memberof Moveable
+ * @extends Moveable.CSSObject
+ */
+export interface TransformObject extends CSSObject {
+    /**
+     * a target's next transform string value.
+     */
+    transform: string;
+    /**
+     * A transform obtained by the simultaneous occurrence of other events in the current event
+     */
+    afterTransform: string;
+}
+/**
+ * @typedef
+ * @memberof Moveable
+ * @extends Moveable.TransformObject
+ */
+export interface OnTransformEvent extends TransformObject {
+    /**
+     * transform events causes a `drag` event. In some events, there may be no value.
+     */
+    drag: OnDrag;
+}
+/**
+ * @typedef
+ * @memberof Moveable
+ */
+export interface AbleRequestParam {
+    /**
+     * Run the request instantly. (requestStart, request, requestEnd happen at the same time)
+     */
+    isInstant?: boolean;
+    [key: string]: any;
+}
+/**
+ * @typedef
+ * @memberof Moveable
+ * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.html#request|Request Method}
+ * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Draggable.html#request|Draggable Requester}
+ * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Resizable.html#request|Resizable Requester}
+ * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Scalable.html#request|Scalable Requester}
+ * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Rotatable.html#request|Rotatable Requester}
+ * @property - Continue executing the request.
+ * @property - End the request.
+ */
+export interface Requester<RequestParam extends {} = AbleRequestParam> {
+    request(param: RequestParam): this;
+    requestEnd(): this;
+}
+
+export interface AbleRequester {
+    isControl: boolean;
+    requestStart(param: IObject<any>): IObject<any>;
+    request(param: IObject<any>): IObject<any>;
+    requestEnd(): IObject<any>;
+}
+
+
+/**
+ * @typedef
+ * @memberof Moveable
+ */
+export interface OnChangeTargets {
+    /**
+     * The Moveable instance
+     */
+    moveable: MoveableManagerInterface<any, any>;
+    /**
+     * The Moveable's targets
+     */
+    targets: Array<HTMLElement | SVGElement>;
+}
+
+
+
+/**
+ * @typedef
+ * @memberof Moveable.Pinchable
+ * @extends Moveable.OnEvent
+ */
+export interface OnPinchStart extends OnEvent {
+}
+/**
+ * @typedef
+ * @memberof Moveable.Pinchable
+ * @extends Moveable.OnEvent
+ */
+export interface OnPinch extends OnEvent {
+}
+/**
+ * @typedef
+ * @memberof Moveable.Pinchable
+ * @extends Moveable.OnEndEvent
+ */
+export interface OnPinchEnd extends OnEndEvent { }
+/**
+ * When the drag starts, the dragStart event is called.
+ * @typedef
+ * @memberof Moveable.Draggable
+ * @extends Moveable.OnEvent
+ * @extends Moveable.OnTransformStartEvent
+ */
+export interface OnDragStart extends OnEvent, OnTransformStartEvent {
+    /**
+     * You can set the start translate value.
+     */
+    set: (translate: number[]) => void;
+}
+/**
+ * @typedef
+ * @memberof Moveable.Draggable
+ * @extends Moveable.OnEvent
+ * @extends Moveable.CSSObject
+ * @property - The delta of [left, top]
+ * @property - The distance of [left, top]
+ * @property - The position of [left, top]
+ * @property - The delta of [translateX, translateY]
+ * @property - The distance of [translateX, translateY]
+ * @property - The position of [translateX, translateY]
+ * @property - a target's transform
+ * @property - a target's left
+ * @property - a target's top
+ * @property - a target's bottom
+ * @property - a target's offset width
+ * @property - a target's offset height
+ * @property - a target's right
+ * @property - Whether or not it is being pinched.
+ */
+export interface OnDrag extends OnEvent, CSSObject {
+    beforeDelta: number[];
+    beforeDist: number[];
+    beforeTranslate: number[];
+    delta: number[];
+    dist: number[];
+    translate: number[];
+    transform: string;
+    left: number;
+    top: number;
+    bottom: number;
+    width: number;
+    height: number;
+    right: number;
+    isPinch: boolean;
+}
+/**
+ * @typedef
+ * @memberof Moveable.Draggable
+ * @extends Moveable.OnEndEvent
+ */
+export interface OnDragEnd extends OnEndEvent {
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.OriginDraggable
+ * @extends Moveable.OnEvent
+ * @property - dragOrigin causes a `dragStart` event.
+ */
+export interface OnDragOriginStart extends OnEvent {
+    dragStart: OnDragStart | false;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.OriginDraggable
+ * @extends Moveable.OnEvent
+ * @extends Moveable.CSSObject
+ */
+export interface OnDragOrigin extends OnEvent, CSSObject {
+    /**
+     * Offset width of target
+     */
+    width: number;
+    /**
+     * Offset height of target
+     */
+    height: number;
+    /**
+     * The delta of [x, y]
+     */
+    delta: number[];
+    /**
+     * The distance of [x, y]
+     */
+    dist: number[];
+    /**
+     * The target's moved transform-origin poses
+     */
+    origin: number[];
+    /**
+     * The target's moved transform-origin css
+     */
+    transformOrigin: string;
+    /**
+     * A transform obtained by the simultaneous occurrence of other events in the current event
+     */
+    afterTransform: string;
+    /**
+     * `dragOrigin` causes a `drag` event.
+     */
+    drag: OnDrag;
+
+}
+/**
+ * @typedef
+ * @memberof Moveable.OriginDraggable
+ * @extends Moveable.OnEndEvent
+ */
+export interface OnDragOriginEnd extends OnEndEvent {
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Roundable
+ * @extends Moveable.OnEvent
+ */
+export interface OnRoundStart extends OnEvent { }
+
+/**
+ * @typedef
+ * @memberof Moveable.Roundable
+ * @extends Moveable.OnEvent
+ * @extends Moveable.CSSObject
+ * @property - Offset width of target
+ * @property - Offset height of target
+ * @property - The delta of [x, y]
+ * @property - The distance of [x, y]
+ * @property - The target's moved border-radius's horizontal poses
+ * @property - The target's moved border-radius's vertical poses
+ * @property - The target's moved border-radius
+ */
+export interface OnRound extends OnEvent, CSSObject {
+    width: number;
+    height: number;
+    delta: number[];
+    dist: number[];
+    horizontals: number[];
+    verticals: number[];
+    borderRadius: string;
+
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Roundable
+ * @extends Moveable.OnEndEvent
+ */
+export interface OnRoundEnd extends OnEndEvent {
+}
+
+
+/**
+ * @typedef
+ * @memberof Moveable.Roundable
+ * @extends Moveable.OnRoundStart
+ */
+export interface OnRoundGroupStart extends OnRoundStart {
+    /**
+     * moveable's targets
+     */
+    targets: Array<HTMLElement | SVGElement>;
+    /**
+     * moveable's child events
+     */
+    events: OnRoundStart[];
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Roundable
+ * @extends Moveable.OnRound
+ */
+export interface OnRoundGroup extends OnRound {
+    /**
+     * moveable's targets
+     */
+    targets: Array<HTMLElement | SVGElement>;
+    /**
+     * moveable's child events
+     */
+    events: OnRound[];
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Roundable
+ * @extends Moveable.OnRoundEnd
+ */
+export interface OnRoundGroupEnd extends OnRoundEnd {
+    /**
+     * moveable's targets
+     */
+    targets: Array<HTMLElement | SVGElement>;
+    /**
+     * moveable's child events
+     */
+    events: OnRoundEnd[];
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Scalable
+ * @extends Moveable.OnEvent
+ * @extends Moveable.OnTransformStartEvent
+ */
+export interface OnScaleStart extends OnEvent, OnTransformStartEvent {
+    /**
+     * The direction of scale.
+     */
+    direction: number[];
+    /**
+     * scale causes a `dragStart` event.
+     */
+    dragStart: OnDragStart | false;
+    /**
+     * You can set the start scale value.
+     */
+    set: (scale: number[]) => void;
+    /**
+     * Set a fixed direction to scale.
+     * @default Opposite direction
+     */
+    setFixedDirection: (startDirecition: number[]) => void;
+    /**
+     * Set the ratio of width and height.
+     * @default offsetWidth / offsetHeight
+     */
+    setRatio: (ratio: number) => void;
+    /**
+     * You can set the min scale width, height value.
+     * scale size = scale value * offset size
+     * @default [-Infinity, -Infinity]
+     */
+    setMinScaleSize: (min: number[]) => void;
+    /**
+     * You can set the max scale width, height value.
+     * scale size = scale value * offset size
+     * @default [Infinity, Infinity]
+     */
+    setMaxScaleSize: (max: number[]) => void;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Scalable
+ * @extends Moveable.OnEvent
+ */
+export interface OnBeforeScale extends OnEvent {
+    /**
+     * Set a fixed direction to scale.
+     * If fixedDirection is set, the scale values can be changed and can be reconfirmed as a return value.
+     */
+    setFixedDirection: (startDirecition: number[]) => number[];
+    /**
+     * fixedDirection set by rotateStart.
+     */
+    startFixedDirection: number[];
+    /**
+     * Set target's scale to scaling.
+     */
+    setScale: (scale: number[]) => void;
+    /**
+     * a target's scale before snap and throttle and format
+     */
+    scale: number[];
+}
+
+
+/**
+ * @typedef
+ * @memberof Moveable.Scalable
+ * @extends Moveable.OnEvent
+ * @extends Moveable.OnTransformEvent
+ * @property - The direction of scale.
+ * @property - a target's offsetWidth
+ * @property - a target's offsetHeight
+ * @property - a target's scale
+ * @property - The distance of scale
+ * @property - The delta of scale
+ * @property - Whether or not it is being pinched.
+ */
+export interface OnScale extends OnEvent, OnTransformEvent {
+    direction: number[];
+    offsetWidth: number;
+    offsetHeight: number;
+
+    scale: number[];
+    dist: number[];
+    delta: number[];
+
+    isPinch: boolean;
+}
+/**
+ * @typedef
+ * @memberof Moveable.Scalable
+ * @extends Moveable.OnEndEvent
+ */
+export interface OnScaleEnd extends OnEndEvent {
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Resizable
+ * @extends Moveable.OnEvent
+ * @property - The direction of resize.
+ * @property - resize causes a `dragStart` event.
+ * @property - You can set the css width, height value.
+ * @property - You can set the css min width, min height value. (default: min-width)
+ * @property - You can set the css max width, max height value. (default: max-width)
+ * @property - You can set the css origin (default: % %)
+ * @property - Set a fixed direction to resize. (default: Opposite direction)
+ * @property - Set the ratio of width and height. (default: offsetWidth / offsetHeight)
+ */
+export interface OnResizeStart extends OnEvent {
+    /**
+     * The direction of resize.
+     */
+    direction: number[];
+    /**
+     * First set (boundingWidth / boundingHeight) value
+     */
+    startRatio: number;
+    /**
+     * resize causes a `dragStart` event.
+     */
+    dragStart: OnDragStart | false;
+    /**
+     * You can set the css width, height value.
+     */
+    set: (size: number[]) => any;
+    /**
+     * You can set the css min offset width, min offset height value.
+     * @default [minOffsetWidth, minOffsetHeight])
+     */
+    setMin: (minSize: Array<string | number>) => any;
+    /**
+     * You can set the css max offset width, max offset height value.
+     * @default [maxOffsetWidth, maxOffsetHeight])
+     */
+    setMax: (maxSize: Array<string | number>) => any;
+    /**
+     * You can set the css origin
+     * @default transformOrigin
+     */
+    setOrigin: (origin: Array<string | number>) => any;
+    /**
+     * Set a fixed direction to resize.
+     * @default Opposite direction
+     */
+    setFixedDirection: (startDirecition: number[]) => any;
+    /**
+     * Set a fixed direction to resize.
+     * @default Opposite position
+     * @private
+     */
+    setFixedPosition: (startPosition: number[]) => any;
+    /**
+     * Set the ratio of width and height.
+     * @default offsetWidth / offsetHeight
+     */
+    setRatio: (ratio: number) => any;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Resizable
+ * @extends Moveable.OnEvent
+ */
+export interface OnBeforeResize extends OnEvent {
+    /**
+     * Set a fixed direction to resize.
+     * If fixedDirection is set, the boundingWidth and boundingHeight values can be changed and can be reconfirmed as a return value.
+     */
+    setFixedDirection: (startDirecition: number[]) => number[];
+    /**
+     * Set a fixed position to resize.
+     * If fixedPosition is set, the boundingWidth and boundingHeight values can be changed and can be reconfirmed as a return value.
+     * @private
+     */
+    setFixedPosition: (startPosition: number[]) => number[];
+    /**
+     * fixedDirection set by resizeStart.
+     */
+    startFixedDirection: number[];
+    /**
+     * fixedPosition set by resizeStart.
+     * @private
+     */
+    startFixedPosition: number[];
+    /**
+     * Set the bounding size to resizing.
+     */
+    setSize: (size: number[]) => void;
+    /**
+     * a target's bounding width before snap and throttle and format
+     */
+    boundingWidth: number;
+    /**
+     * a target's bounding height before snap and throttle and format
+     */
+    boundingHeight: number;
+}
+/**
+ * @typedef
+ * @memberof Moveable
+ */
+export interface CSSObject {
+    /**
+     * You can get the style you can get from the event.
+     */
+    style: Record<string, string>;
+    /**
+     * You can get it as a cssText that you can get from that event.
+     */
+    cssText: string;
+}
+/**
+ * @typedef
+ * @memberof Moveable.Resizable
+ * @extends Moveable.OnEvent
+ * @extends Moveable.OnTransformEvent
+ */
+export interface OnResize extends OnEvent, OnTransformEvent {
+    /**
+     * The direction of resize.
+     */
+    direction: number[];
+    /**
+     * a target's cssWidth
+     */
+    width: number;
+    /**
+     * a target's cssHeight
+     */
+    height: number;
+    /**
+     * a target's offset width as an integer with bounding width
+     */
+    offsetWidth: number;
+    /**
+     * a target's offset height as an integer with bounding height
+     */
+    offsetHeight: number;
+    /**
+     * a target's bounding width
+     */
+    boundingWidth: number;
+    /**
+     * a target's bounding height
+     */
+    boundingHeight: number;
+    /**
+     * The distance of [boundingWidth, boundingHeight]
+     */
+    dist: number[];
+    /**
+     * The delta of [boundingWidth, boundingHeight]
+     */
+    delta: number[];
+    /**
+     * First set (boundingWidth / boundingHeight) value
+     */
+    startRatio: number;
+    /**
+     * Whether or not it is being pinched.
+     */
+    isPinch: boolean;
+}
+/**
+ * @typedef
+ * @memberof Moveable.Resizable
+ * @extends Moveable.OnEndEvent
+ */
+export interface OnResizeEnd extends OnEndEvent {
+}
+/**
+ * @typedef
+ * @memberof Moveable.Rotatable
+ * @extends Moveable.OnEvent
+ * @extends Moveable.OnTransformStartEvent
+ */
+export interface OnRotateStart extends OnEvent, OnTransformStartEvent {
+    /**
+     * You can set the start rotate value.
+     */
+    set: (rotate: number) => void;
+    /**
+     * Set a fixed direction to rotate.
+     * @default target's transformOrigin
+     */
+    setFixedDirection: (fixedDirection: number[]) => void;
+    /**
+     * Set a fixed position to rotate.
+     * @default target's transformOrigin
+     */
+    setFixedPosition: (fixedPosition: number[]) => void;
+    /**
+     * rotate causes a `dragStart` event.
+     */
+    dragStart: OnDragStart | false;
+    /**
+     * rotate causes a `resizeStart` event.
+     */
+    resizeStart: OnResizeStart | false;
+}
+/**
+ * @typedef
+ * @description Parameters for the `beforeRotate` event
+ * @memberof Moveable.Rotatable
+ * @extends Moveable.OnEvent
+ */
+export interface OnBeforeRotate extends OnEvent {
+    /**
+     * The rotation degree before transform is applied before snap and throttle and format
+     */
+    beforeRotation: number;
+    /**
+     * The rotation degree before snap and throttle and format
+     */
+    rotation: number;
+    /**
+     * The client rotation degree before snap and throttle and format
+     */
+    absoluteRotation: number;
+    /**
+     * You can set the value of `rotation`.
+     */
+    setRotation(nextRotation: number): void;
+}
+
+
+/**
+ * @typedef
+ * @description Parameters for the `rotate` event
+ * @memberof Moveable.Rotatable
+ * @extends Moveable.OnEvent
+ * @extends Moveable.OnTransformEvent
+ */
+export interface OnRotate extends OnEvent, OnTransformEvent {
+    /**
+     * The distance of rotation degree before transform is applied
+     */
+    beforeDist: number;
+    /**
+     * The delta of rotation degree before transform is applied
+     */
+    beforeDelta: number;
+    /**
+     * The now rotation degree before transform is applied
+     * @deprecated
+     */
+    beforeRotate: number;
+    /**
+     * The now rotation degree before transform is applied
+     */
+    beforeRotation: number;
+    /**
+     * The distance of rotation degree
+     */
+    dist: number;
+    /**
+     * The delta of rotation degree
+     */
+    delta: number;
+    /**
+     * The now rotation degree
+     * @deprecated
+     */
+    rotate: number;
+    /**
+     * The now rotation degree
+     */
+    rotation: number;
+    /**
+     * The distance of client rotation degree
+     */
+    absoluteDist: number;
+    /**
+     * The delta of client rotation degree
+     */
+    absoluteDelta: number;
+    /**
+     * The now client rotation degree
+     * @deprecated
+     */
+    absoluteRotate: number;
+    /**
+     * The now client rotation degree
+     */
+    absoluteRotation: number;
+    /**
+     * Whether or not it is being pinched.
+     */
+    isPinch: boolean;
+    /**
+     * rotate causes a `resize` event.
+     */
+    resize?: OnResize;
+}
+/**
+ * @typedef
+ * @memberof Moveable.Rotatable
+ * @extends Moveable.OnEndEvent
+ */
+export interface OnRotateEnd extends OnEndEvent { }
+
+/**
+ * @typedef
+ * @memberof Moveable.Warpable
+ * @extends Moveable.OnEvent
+ * @extends Moveable.OnTransformStartEvent
+ * @property - You can set the start matrix value.
+ */
+export interface OnWarpStart extends OnEvent, OnTransformStartEvent {
+    set: (matrix: number[]) => any;
+}
+/**
+ * @typedef
+ * @memberof Moveable.Warpable
+ * @extends Moveable.OnEvent
+ * @extends Moveable.CSSObject
+ */
+export interface OnWarp extends OnEvent, CSSObject {
+    /**
+     * The delta of warp matrix
+     */
+    delta: number[];
+    /**
+     * The dist of warp matrix
+     */
+    dist: number[];
+    /**
+     * The calculated warp matrix
+     */
+    matrix: number[];
+    /**
+     * a target's transform
+     */
+    transform: string;
+    /**
+     * Multiply function that can multiply previous matrix by warp matrix
+     */
+    multiply: (matrix1: number[], matrix2: number[], n?: number) => number[];
+}
+/**
+ * @typedef
+ * @memberof Moveable.Warpable
+ * @extends Moveable.OnEndEvent
+ */
+export interface OnWarpEnd extends OnEndEvent { }
+
+/**
+ * @typedef
+ * @memberof Moveable.Draggable
+ * @extends Moveable.OnDragStart
+ * @property - targets to drag
+ * @property - Each `dragStart` event on the targets
+ */
+export interface OnDragGroupStart extends OnDragStart {
+    targets: Array<HTMLElement | SVGElement>;
+    events: OnDragStart[];
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Draggable
+ * @extends Moveable.OnDrag
+ * @property - The dragging targets
+ * @property - Each `drag` event on the targets
+ */
+export interface OnDragGroup extends OnDrag {
+    targets: Array<HTMLElement | SVGElement>;
+    events: OnDrag[];
+}
+/**
+ * @typedef
+ * @memberof Moveable.Draggable
+ * @extends Moveable.OnDragEnd
+ * @property - The drag finished targets
+ * @property - Each `dragEnd` event on the targets
+ */
+export interface OnDragGroupEnd extends OnDragEnd {
+    targets: Array<HTMLElement | SVGElement>;
+    events: OnDragEnd[];
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Rotatable
+ * @extends Moveable.OnRotateStart
+ * @property - targets to rotate
+ * @property - Each `rotateStart` event on the targets
+ */
+export interface OnRotateGroupStart extends OnRotateStart {
+    targets: Array<HTMLElement | SVGElement>;
+    events: OnRotateStart[];
+}
+
+/**
+ * @typedef
+ * @description Parameters for the `beforeRotateGroup` event
+ * @memberof Moveable.Rotatable
+ * @extends Moveable.OnBeforeRotate
+ */
+export interface OnBeforeRotateGroup extends OnBeforeRotate {
+    /**
+     * The rotating targets
+     */
+    targets: Array<HTMLElement | SVGElement>;
+}
+/**
+ * @typedef
+ * @description Parameters for the `rotateGroup` event
+ * @memberof Moveable.Rotatable
+ * @extends Moveable.OnRotate
+ */
+export interface OnRotateGroup extends OnRotate {
+    /**
+     * The rotating targets
+     */
+    targets: Array<HTMLElement | SVGElement>;
+    /**
+     * Each `rotate` event on the targets
+     */
+    events: OnRotate[];
+    /**
+     * You can set the group's rotation.
+     * @deprecated
+     */
+    set: (rotation: number) => any;
+    /**
+     * You can set the group's rotation.
+     */
+    setGroupRotation: (rotation: number) => any;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Rotatable
+ * @extends Moveable.OnRotateEnd
+ * @property - The rotate finished targets
+ * @property - Each `rotateEnd` event on the targets
+ */
+export interface OnRotateGroupEnd extends OnRotateEnd {
+    targets: Array<HTMLElement | SVGElement>;
+    events: OnRotateEnd[];
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Resizable
+ * @extends Moveable.OnResizeStart
+ * @property - targets to resize
+ * @property - Each `resizeStart` event on the targets
+ */
+export interface OnResizeGroupStart extends OnResizeStart {
+    targets: Array<HTMLElement | SVGElement>;
+    events: OnResizeStart[];
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Resizable
+ * @extends Moveable.OnBeforeResize
+ */
+export interface OnBeforeResizeGroup extends OnBeforeResize {
+    /**
+     * The resizing targets
+     */
+    targets: Array<HTMLElement | SVGElement>;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Resizable
+ * @extends Moveable.OnResize
+ * @property - The resizing targets
+ * @property - Each `resize`event on the targets
+ */
+export interface OnResizeGroup extends OnResize {
+    targets: Array<HTMLElement | SVGElement>;
+    events: OnResize[];
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Resizable
+ * @extends Moveable.OnResizeEnd
+ * @property - The resize finished targets
+ * @property - Each `resizeEnd` event on the targets
+ */
+export interface OnResizeGroupEnd extends OnResizeEnd {
+    targets: Array<HTMLElement | SVGElement>;
+    events: OnResizeEnd[];
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Scalable
+ * @extends Moveable.OnScaleStart
+ * @property - targets to scale
+ * @property - Each `scaleStart` & `dragStart` event on the targets
+ */
+export interface OnScaleGroupStart extends OnScaleStart {
+    targets: Array<HTMLElement | SVGElement>;
+    events: OnScaleStart[];
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Scalable
+ * @extends Moveable.OnBeforeScale
+ * @property - The scaling targets
+ */
+export interface OnBeforeScaleGroup extends OnBeforeScale {
+    targets: Array<HTMLElement | SVGElement>;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Scalable
+ * @extends Moveable.OnScale
+ * @property - The scaling targets
+ * @property - Each `scale` & `drag` event on the targets
+ */
+export interface OnScaleGroup extends OnScale {
+    targets: Array<HTMLElement | SVGElement>;
+    events: OnScale[];
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Scalable
+ * @extends Moveable.OnScaleEnd
+ * @property - The scale finished targets
+ * @property - Each `scaleEnd` event on the targets
+ */
+export interface OnScaleGroupEnd extends OnScaleEnd {
+    targets: Array<HTMLElement | SVGElement>;
+    events: OnScaleEnd[];
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Pinchable
+ * @extends Moveable.OnPinchStart
+ * @property - targets to pinch
+ */
+export interface OnPinchGroupStart extends OnPinchStart {
+    targets: Array<HTMLElement | SVGElement>;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Pinchable
+ * @extends Moveable.OnPinch
+ * @property - targets to pinch
+ */
+export interface OnPinchGroup extends OnPinch {
+    targets: Array<HTMLElement | SVGElement>;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Pinchable
+ * @extends Moveable.OnPinchEnd
+ * @property - The pinch finished targets
+ */
+export interface OnPinchGroupEnd extends OnPinchEnd {
+    targets: Array<HTMLElement | SVGElement>;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable
+ * @extends Moveable.OnEvent
+ */
+export interface OnClick extends OnEvent {
+    /**
+     * Clicked element.
+     */
+    inputTarget: Element;
+    /**
+     * clicked moveable target
+     */
+    moveableTarget: HTMLElement | SVGElement | null;
+    /**
+     * Whether the clicked target is moveable target.
+     */
+    isTarget: boolean;
+    /**
+     * Whether the clicked target is a child of moveable target.
+     */
+    containsTarget: boolean;
+    /**
+     * Whether it is double-click
+     */
+    isDouble: boolean;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable
+ * @extends Moveable.OnClick
+ */
+export interface OnClickGroup extends OnClick {
+    /**
+     * targets set to group.
+     */
+    targets: Element[];
+    /**
+     * The corresponding index among the targets set as a group.
+     */
+    targetIndex: number;
+}
+
+/**
+ * `beforeRenderStart` event occurs before the first start of all events.
+ * @typedef
+ * @memberof Moveable
+ * @extends Moveable.OnEvent
+ * @property - Whether or not it is being pinched.
+ * @property - Set your original transform.
+ */
+export interface OnBeforeRenderStart extends OnEvent {
+    isPinch: boolean;
+    setTransform(transform: string | string[]): any;
+}
+
+/**
+ * `beforeRender` event occurs before the dragging of all events.
+ * @typedef
+ * @memberof Moveable
+ * @extends Moveable.OnEvent
+ * @property - Whether or not it is being pinched.
+ */
+export interface OnBeforeRender extends OnEvent {
+    isPinch: boolean;
+}
+
+/**
+ * `beforeRenderEnd` event occurs before the end of all events.
+ * @typedef
+ * @memberof Moveable
+ * @extends Moveable.OnEvent
+ * @property - Whether or not it is being dragged.
+ * @property - Whether or not it is being pinched.
+ */
+export interface OnBeforeRenderEnd extends OnEvent {
+    isPinch: boolean;
+    isDrag: boolean;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable
+ * @extends Moveable.OnBeforeRenderStart
+ * @property - targets set to group.
+ * @property - children's `beforeRenderStart` events
+ */
+export interface OnBeforeRenderGroupStart extends OnBeforeRenderStart {
+    targets: Array<HTMLElement | SVGElement>;
+    events: OnBeforeRenderStart[];
+}
+
+/**
+ * @typedef
+ * @memberof Moveable
+ * @extends Moveable.OnBeforeRender
+ * @property - targets set to group.
+ * @property - children's `beforeRender` events
+ */
+export interface OnBeforeRenderGroup extends OnBeforeRender {
+    targets: Array<HTMLElement | SVGElement>;
+    events: OnBeforeRender[];
+}
+
+/**
+ * @typedef
+ * @memberof Moveable
+ * @extends Moveable.OnBeforeRenderEnd
+ * @property - targets set to group.
+ */
+export interface OnBeforeRenderGroupEnd extends OnBeforeRenderEnd {
+    targets: Array<HTMLElement | SVGElement>;
+}
+
+/**
+ * `renderStart` event occurs at the first start of all events.
+ * @typedef
+ * @memberof Moveable
+ * @extends Moveable.OnEvent
+ * @property - Whether or not it is being pinched.
+ */
+export interface OnRenderStart extends OnEvent {
+    isPinch: boolean;
+}
+
+/**
+ * `render` event occurs before the target is drawn on the screen.
+ * @typedef
+ * @memberof Moveable
+ * @extends Moveable.OnEvent
+ * @extends Moveable.CSSObject
+ */
+export interface OnRender extends OnEvent, CSSObject {
+    /**
+     * a target's next transform string value.
+     */
+    transform: string;
+    /**
+     * Whether or not it is being pinched.
+     */
+    isPinch: boolean;
+    /**
+     * Return transform as a transform object.
+     * `rotate` is a number and everything else is an array of numbers.
+     */
+    transformObject: Record<string, any>;
+}
+
+/**
+ * `renderEnd` event occurs at the end of all events.
+ * @typedef
+ * @memberof Moveable
+ * @extends Moveable.OnEvent
+ * @extends Moveable.CSSObject
+ */
+export interface OnRenderEnd extends OnEvent, CSSObject {
+    /**
+     * a target's next transform string value.
+     */
+    transform: string;
+    /**
+     * Whether or not it is being dragged.
+     */
+    isPinch: boolean;
+    /**
+     * Whether or not it is being pinched.
+     */
+    isDrag: boolean;
+    /**
+     * Return transform as a transform object.
+     * `rotate` is a number and everything else is an array of numbers.
+     */
+    transformObject: Record<string, any>;
+}
+
+export type EventInterface<T extends IObject<any> = {}> = {
+    [key in keyof T]?: (e: T[key]) => any;
+};
+
+/**
+ * @typedef
+ * @memberof Moveable.Scrollable
+ * @extends Moveable.OnEvent
+ * @property - The container corresponding to scrolling area (scrollContainer >= rootContainer >= container)
+ * @property - The direction of scrolling [left, top]
+ */
+export interface OnScroll extends OnEvent {
+    scrollContainer: HTMLElement;
+    direction: number[];
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Scrollable
+ * @extends Moveable.OnScroll
+ * @property - targets set to group.
+ */
+export interface OnScrollGroup extends OnScroll {
+    targets: Array<HTMLElement | SVGElement>;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable
+ * @extends Moveable.OnRenderStart
+ * @property - targets set to group.
+ */
+export interface OnRenderGroupStart extends OnRenderStart {
+    targets: Array<HTMLElement | SVGElement>;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable
+ * @extends Moveable.OnRender
+ * @property - targets set to group.
+ * @property - Each `render` event on the targets
+ */
+export interface OnRenderGroup extends OnRender {
+    targets: Array<HTMLElement | SVGElement>;
+    events: OnRender[];
+}
+
+/**
+ * @typedef
+ * @memberof Moveable
+ * @extends Moveable.OnRenderEnd
+ * @property - targets set to group.
+ * @property - Each `renderEnd` event on the targets
+ */
+export interface OnRenderGroupEnd extends OnRenderEnd {
+    targets: Array<HTMLElement | SVGElement>;
+    events: OnRenderEnd[];
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Draggable
+ */
+export interface DraggableOptions {
+    /**
+     * Whether or not target can be dragged.
+     * @default false
+     */
+    draggable?: boolean;
+    /**
+     * throttle of x, y when drag.
+     * @default 0
+     */
+    throttleDrag?: number;
+    /**
+     * throttle of angle(degree) of x,y when drag.
+     * @default 0
+     */
+    throttleDragRotate?: number;
+    /**
+     * Hides the guidelines that appear when using the `throttleDragRotate` prop.
+     * @default false
+     */
+    hideThrottleDragRotateLine?: boolean;
+    /**
+     * start angle(degree) of x,y for throttleDragRotate when drag.
+     * @default 0
+     */
+    startDragRotate?: number;
+    /**
+     * Whether to move by dragging the edge line
+     * @default false
+     */
+    edgeDraggable?: boolean | Array<LineDirection>;
+}
+export interface DraggableEvents {
+    onDragStart: OnDragStart;
+    onDrag: OnDrag;
+    onDragEnd: OnDragEnd;
+
+    onDragGroupStart: OnDragGroupStart;
+    onDragGroup: OnDragGroup;
+    onDragGroupEnd: OnDragGroupEnd;
+}
+
+export interface DraggableProps extends DraggableOptions, EventInterface<DraggableEvents> {
+}
+
+export interface DraggableState {
+    dragInfo: {
+        startRect: RectInfo;
+        dist: number[];
+    } | null;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable
+ */
+export interface PaddingOptions {
+    /**
+     * Add padding around the target to increase the drag area.
+     * @default null
+     */
+    padding?: PaddingBox | number;
+}
+/**
+ * @typedef
+ * @memberof Moveable
+ */
+export interface OriginOptions {
+    /**
+     * Whether or not the origin control box will be visible or not.
+     * @default true
+     */
+    origin?: boolean;
+    /**
+     * Sets the transform origin based on the svg target. If not set, it is set as the transform origin based on the owner of svg.
+     * @since 0.47.0
+     * @default ""
+     */
+    svgOrigin?: string;
+}
+/**
+ * @typedef
+ * @memberof Moveable.OriginDraggable
+ */
+export interface OriginDraggableOptions {
+    /**
+     * Whether to drag origin.
+     * @default false
+     */
+    originDraggable?: boolean;
+    /**
+     * % Can be used instead of the absolute px.
+     * @default true
+     */
+    originRelative?: boolean;
+}
+export interface OriginDraggableEvents {
+    onDragOriginStart: OnDragOriginStart;
+    onDragOrigin: OnDragOrigin;
+    onDragOriginEnd: OnDragOriginEnd;
+}
+export interface OriginDraggableProps extends OriginDraggableOptions, EventInterface<OriginDraggableEvents> {
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Roundable
+ */
+export interface RoundableOptions {
+    /**
+     * Whether to show and drag border-radius.
+     * @default false
+     */
+    roundable?: boolean;
+    /**
+     * % Can be used instead of the absolute px
+     * @default false
+     */
+    roundRelative?: boolean;
+    /**
+     * Minimum number of round controls. It moves in proportion by control. [horizontal, vertical]
+     * @default [0, 0]
+     */
+    minRoundControls?: number[];
+    /**
+     * Maximum number of round controls. It moves in proportion by control. [horizontal, vertical]
+     * @default [4, 4]
+     */
+    maxRoundControls?: number[];
+    /**
+     * Whether you can add/delete round controls by double-clicking a line or control.
+     * @default true
+     */
+    roundClickable?: boolean | "line" | "control";
+    /**
+     * Whether to show a round control that does not actually exist as a shadow
+     * @default false
+     */
+    isDisplayShadowRoundControls?: boolean | "horizontal";
+    /**
+     * The padding value of the position of the round control
+     * @default 0
+     */
+    roundPadding?: number;
+}
+
+export interface RoundableEvents {
+    onRoundStart: OnRoundStart;
+    onRound: OnRound;
+    onRoundEnd: OnRoundEnd;
+    onRoundGroupStart: OnRoundGroupStart;
+    onRoundGroup: OnRoundGroup;
+    onRoundGroupEnd: OnRoundGroupEnd;
+}
+export interface RoundableProps extends RoundableOptions, EventInterface<RoundableEvents> {
+}
+
+export interface RoundableState {
+    borderRadiusState?: string;
+}
+/**
+ * @typedef
+ * @memberof Moveable.Resizable
+ * @extends Moveable.RenderDirections
+ */
+export interface ResizableOptions extends RenderDirections {
+    /**
+     * Whether or not target can be resized.
+     * @default false
+     */
+    resizable?: boolean | ResizableOptions;
+    /**
+     * throttle of width, height when resize.
+     * @default 1
+     */
+    throttleResize?: number;
+    /**
+     * When resize or scale, keeps a ratio of the width, height.
+     * @default false
+     */
+    keepRatio?: boolean;
+    /**
+     * The size can be changed by format and throttle, but the ratio is maintained at the end. Forced true when using groups.
+     * @default false
+     */
+    keepRatioFinally?: boolean;
+    /**
+     * Function to convert size for resize.
+     * @default oneself
+     */
+    resizeFormat?: (size: number[]) => number[];
+    /**
+     * Whether to scale and resize through edge lines.
+     * You can use "n", "w", "s", "e" in LineDirection array.
+     * @default false
+     */
+    edge?: boolean | Array<LineDirection>;
+    /**
+     * Whether to recalculate when the size to be calculated is different from the actual size
+     * @default true
+     */
+    checkResizableError?: boolean;
+}
+/**
+ * @typedef
+ * @memberof Moveable
+ * @extends Moveable.AbleRequestParam
+ * @description the Resizable's request parameter
+ */
+export interface AbleRequesters {
+    draggable: DraggableRequestParam;
+    resizable: ResizableRequestParam;
+    scalable: ScalableRequestParam;
+    rotatable: RotatableRequestParam;
+    [key: string]: AbleRequestParam;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Draggable
+ * @extends Moveable.AbleRequestParam
+ * @description the Draggable's request parameter
+ */
+export interface DraggableRequestParam extends AbleRequestParam {
+    /**
+     * x position
+     */
+    x?: number;
+    /**
+     * y position
+     */
+    y?: number;
+    /**
+     * X number to move
+     */
+    deltaX?: number;
+    /**
+     * Y number to move
+     */
+    deltaY?: number;
+    /**
+     * whether to use with `snappable`
+     */
+    useSnap?: boolean;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Resizable
+ * @extends Moveable.AbleRequestParam
+ * @description the Resizable's request parameter
+ */
+export interface ResizableRequestParam extends AbleRequestParam {
+    /**
+     * Direction to resize
+     * @default [1, 1]
+     */
+    direction?: number[];
+    /**
+     * Whether to force keepRatio to resize
+     */
+    keepRatio?: boolean;
+    /**
+     * delta number of width
+     */
+    deltaWidth?: number;
+    /**
+     * delta number of height
+     */
+    deltaHeight?: number;
+    /**
+     * offset number of width
+     */
+    offsetWidth?: number;
+    /**
+     * offset number of height
+     */
+    offsetHeight?: number;
+    /**
+     *
+     */
+    horizontal?: boolean;
+    /**
+     * whether to use with `snappable`
+     */
+    useSnap?: boolean;
+}
+
+export interface ResizableEvents {
+    onResizeStart: OnResizeStart;
+    onBeforeResize: OnBeforeResize;
+    onResize: OnResize;
+    onResizeEnd: OnResizeEnd;
+
+    onResizeGroupStart: OnResizeGroupStart;
+    onBeforeResizeGroup: OnBeforeResizeGroup;
+    onResizeGroup: OnResizeGroup;
+    onResizeGroupEnd: OnResizeGroupEnd;
+}
+
+export interface ResizableProps extends ResizableOptions, EventInterface<ResizableEvents> {
+}
+
+
+/**
+ * @typedef
+ * @memberof Moveable.Scalable
+ * @extends Moveable.RenderDirections
+ */
+export interface ScalableOptions extends RenderDirections {
+    /**
+     * Whether or not target can be scaled.
+     * @default false
+     */
+    scalable?: boolean | ScalableOptions;
+    /**
+     * throttle of scaleX, scaleY when scale.
+     * @default 0
+     */
+    throttleScale?: number;
+    /**
+     * When resize or scale, keeps a ratio of the width, height.
+     * @default false
+     */
+    keepRatio?: boolean;
+    /**
+     * Whether to scale and resize through edge lines.
+     * You can use "n", "w", "s", "e" in LineDirection array.
+     * @default false
+     */
+    edge?: boolean | Array<LineDirection>;
+}
+
+
+/**
+ * @typedef
+ * @memberof Moveable.Scalable
+ * @extends Moveable.AbleRequestParam
+ * @description the Scalable's request parameter
+ */
+export interface ScalableRequestParam extends AbleRequestParam {
+    /**
+     * Direction to scale
+     * @default [1, 1]
+     */
+    direction?: number[];
+    /**
+     * Whether to force keepRatio to resize
+     */
+    keepRatio?: boolean;
+    /**
+     * delta number of width
+     */
+    deltaWidth?: number;
+    /**
+     * delta number of height
+     */
+    deltaHeight?: number;
+    /**
+     * whether to use with `snappable`
+     */
+    useSnap?: boolean;
+}
+
+
+
+
+/**
+ * @typedef
+ * @memberof Moveable.Rotatable
+ * @extends Moveable.AbleRequestParam
+ * @description the Rotatable's request parameter
+ */
+export interface RotatableRequestParam extends AbleRequestParam {
+    /**
+     * delta number of rotation
+     */
+    deltaRotate?: number;
+    /**
+     * absolute number of moveable's rotation
+     */
+    rotate?: number;
+}
+
+
+export interface ScalableEvents {
+    onScaleStart: OnScaleStart;
+    onBeforeScale: OnBeforeScale;
+    onScale: OnScale;
+    onScaleEnd: OnScaleEnd;
+
+    onScaleGroupStart: OnScaleGroupStart;
+    onBeforeScaleGroup: OnBeforeScaleGroup;
+    onScaleGroup: OnScaleGroup;
+    onScaleGroupEnd: OnScaleGroupEnd;
+}
+export interface ScalableProps extends ScalableOptions, EventInterface<ScalableEvents> {
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Snappable
+ */
+export interface GapGuideline extends SnapGuideline {
+    renderPos: number[];
+    inner?: boolean;
+}
+/**
+ * @typedef
+ * @memberof Moveable
+ */
+export interface RenderDirections {
+    /**
+     * Set directions to show the control box.
+     * @default false if rotatable, ["n", "nw", "ne", "s", "se", "sw", "e", "w"] otherwise
+     */
+    renderDirections?: boolean | string[];
+    /**
+     * Whether to scale and resize through edge lines.
+     * You can use "n", "w", "s", "e" in LineDirection array.
+     * @default false
+     */
+    edge?: boolean | Array<LineDirection>;
+    /**
+     * You can expand the area around the control.
+     * Either `rotateAroundControls` or `displayAroundControls` can be used.
+     * You can set the area through the `controlPadding` value.
+     * @since 0.44.0
+     * @story options--options-control-padding
+     * @default false
+     */
+    displayAroundControls?: boolean;
+}
+
+export type RotationPosition
+    = "top" | "bottom"
+    | "left" | "right"
+    | "top-right" | "top-left"
+    | "bottom-right" | "bottom-left"
+    | "left-top" | "left-bottom"
+    | "right-top" | "right-bottom"
+    | "none";
+
+/**
+ * @typedef
+ * @memberof Moveable.Rotatable
+ * @extends Moveable.RenderDirections
+ */
+export interface RotatableOptions extends RenderDirections {
+    /**
+     * Whether or not target can be rotated.
+     * @default false
+     */
+    rotatable?: boolean | RotatableOptions;
+    /**
+     * You can specify the position of the rotation.
+     * @default "top"
+     */
+    rotationPosition?: RotationPosition | RotationPosition[];
+    /**
+     * You can rotate around direction controls.
+     * Either `rotateAroundControls` or `displayAroundControls` can be used.
+     * @default 0
+     */
+    rotateAroundControls?: boolean;
+    /**
+     * Sets the control that will cause resize along with rotate. (Only Single Target, Only resizable, Beta)
+     * @default null
+     */
+    resolveAblesWithRotatable?: Record<string, LineDirection[]> | null | undefined;
+    /**
+     * throttle of angle(degree) when rotate.
+     * @default 0
+     */
+    throttleRotate?: number;
+
+    /**
+     * Set additional rotationTargets.
+     * @default null
+     */
+    rotationTarget?: MoveableRefType | ArrayFormat<MoveableRefType> | false;
+}
+export interface RotatableEvents {
+    onRotateStart: OnRotateStart;
+    onBeforeRotate: OnBeforeRotate;
+    onRotate: OnRotate;
+    onRotateEnd: OnRotateEnd;
+
+    onRotateGroupStart: OnRotateGroupStart;
+    onBeforeRotateGroup: OnBeforeRotateGroup;
+    onRotateGroup: OnRotateGroup;
+    onRotateGroupEnd: OnRotateGroupEnd;
+}
+export interface RotatableProps extends RotatableOptions, EventInterface<RotatableEvents> {
+}
+/**
+ * @typedef
+ * @memberof Moveable.Warpable
+ * @extends Moveable.RenderDirections
+ */
+export interface WarpableOptions extends RenderDirections {
+    /**
+     * Whether or not target can be warped.
+     * @default false
+     */
+    warpable?: boolean;
+}
+
+export interface WarpableEvents {
+    onWarpStart: OnWarpStart;
+    onWarp: OnWarp;
+    onWarpEnd: OnWarpEnd;
+}
+export interface WarpableProps extends WarpableOptions, EventInterface<WarpableEvents> {
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Pinchable
+ */
+export interface PinchableOptions {
+    /**
+     * Whether or not target can be pinched with draggable, resizable, scalable, rotatable.
+     * @default false
+     */
+    pinchable?: boolean | Array<"rotatable" | "resizable" | "scalable">;
+}
+export interface PinchableEvents {
+    onPinchStart: OnPinchStart;
+    onPinch: OnPinch;
+    onPinchEnd: OnPinchEnd;
+
+    onPinchGroupStart: OnPinchGroupStart;
+    onPinchGroup: OnPinchGroup;
+    onPinchGroupEnd: OnPinchGroupEnd;
+}
+export interface PinchableProps
+    extends PinchableOptions, ResizableProps, ScalableProps,
+    RotatableProps, EventInterface<PinchableEvents> {
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Group
+ */
+export interface GroupableOptions {
+    /**
+     * Sets the initial rotation of the group.
+     * @default 0
+     */
+    defaultGroupRotate?: number;
+    /**
+     * Use the defaultGroupRotate even if the children's rotations match.
+     * @default false
+     */
+    useDefaultGroupRotate?: boolean;
+    /**
+     * Sets the initial transform origin of the group.
+     * @default  "50% 50%"
+     */
+    defaultGroupOrigin?: string;
+    /**
+     * @default
+     */
+    targetGroups?: MoveableTargetGroupsType;
+    /**
+     * @private
+     */
+    groupable?: boolean;
+    /**
+     * Whether to hide the line in child moveable for group corresponding to the rect of the target.
+     * @default false
+     */
+    hideChildMoveableDefaultLines?: boolean;
+    /**
+     * Props that work when group
+     * @example
+     * ```js
+     * {
+     *     roundable: true,
+     *     groupableProps: {
+     *         roundable: false,
+     *     },
+     * }
+     * ```
+     */
+    groupableProps?: Record<string, any>;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable
+ */
+export type MoveableTargetGroupsType = Array<HTMLElement | SVGElement | MoveableTargetGroupsType>;
+
+
+/**
+ * @typedef
+ * @memberof Moveable.IndividualGroup
+ */
+export interface IndividualGroupableOptions {
+    /**
+     * Create targets individually, not as a group.
+     * @story individual-group--individual-group-draggable-scalable-rotatable
+     */
+    individualGroupable?: boolean;
+    /**
+     * When using individualGroupable you can pass props to child moveable.
+     * @story individual-group--individual-group-groupable-props
+     * @since 0.44.0
+     */
+    individualGroupableProps?: (
+        element: HTMLElement | SVGElement | null | undefined,
+        index: number,
+    ) => Record<string, any> | undefined | null | void;
+}
+
+export interface IndividualGroupableProps extends IndividualGroupableOptions {
+}
+
+export interface GroupableProps extends GroupableOptions {
+    targets?: Array<HTMLElement | SVGElement>;
+    updateGroup?: boolean;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Snappable
+ */
+export interface SnappableOptions {
+    /**
+     * Whether or not target can be snapped to the guideline.
+     * @default false
+     */
+    snappable?: boolean | string[];
+    /**
+     * A snap container that is the basis for snap, bounds, and innerBounds.
+     * @default null
+     */
+    snapContainer?: MoveableRefType<HTMLElement | SVGElement>;
+    /**
+     * You can specify the directions to snap to the target.
+     * @default true (true is all directions)
+     */
+    snapDirections?: boolean | SnapDirections;
+    /**
+     * You can specify the snap directions of elements.
+     * @default true (true is all directions)
+     */
+    elementSnapDirections?: boolean | SnapDirections;
+    /**
+     * When you drag, make the gap snap in the element guidelines.
+     * @default true
+     */
+    snapGap?: boolean;
+    /**
+    /**
+     * Distance value that can snap to guidelines.
+     * @default 5
+     */
+    snapThreshold?: number;
+    /**
+     * Distance value that render snapped guidelines.
+     * @default 1
+     */
+    snapRenderThreshold?: number;
+    /**
+     * snap distance digits.
+     * @default 0
+     */
+    snapDigit?: number;
+    /**
+     * Whether to show guideline of snap by grid
+     * @default false
+     */
+    isDisplayGridGuidelines?: boolean;
+    /**
+     * Snap works if `abs(current rotation - snapRotationDegrees) < snapRotationThreshold`.
+     * @default 5
+     */
+    snapRotationThreshold?: number;
+    /**
+     * degree angles to snap to rotation
+     * @default []
+     */
+    snapRotationDegrees?: number[];
+    /**
+     * If width size is greater than 0, you can vertical snap to the grid.
+     * @default 0 (0 is not used)
+     */
+    snapGridWidth?: number;
+    /**
+     * If height size is greater than 0, you can horizontal snap to the grid.
+     * @default 0 (0 is not used)
+     */
+    snapGridHeight?: number;
+    /**
+     * In the case of a group, if `snapGridWidth` and `snapGridHeight` are used, all children can be snapped.
+     * Custom fixed directions are not yet allowed. Also, it cannot be applied if rotated.
+     * @default false
+     */
+    snapGridAll?: boolean;
+    /**
+     * Whether to show snap distance.
+     * @default true
+     */
+    isDisplaySnapDigit?: boolean;
+    /**
+     * Whether to show element inner snap distance
+     * @default false
+     */
+    isDisplayInnerSnapDigit?: boolean;
+    /**
+     * Add guidelines in the horizontal direction.
+     * @default []
+     */
+    horizontalGuidelines?: Array<PosGuideline | number | string>;
+    /**
+     * Add guidelines in the vertical direction.
+     * @default []
+     */
+    verticalGuidelines?: Array<PosGuideline | number | string>;
+    /**
+     * Add guidelines for the element.
+     * @default []
+     */
+    elementGuidelines?: Array<ElementGuidelineValueOption | MoveableRefType<Element>>;
+    /**
+     * Maximum distance to which element guidelines can be snapped.
+     * @default Infinity
+     */
+    maxSnapElementGuidelineDistance?: number;
+    /**
+     * Maximum distance to which element gap guidelines can be snapped.
+     * @default Infinity
+     */
+    maxSnapElementGapDistance?: number;
+    /**
+     * You can set up boundaries.
+     * @default null
+     */
+    bounds?: BoundType | null;
+    /**
+     * You can set up inner boundaries.
+     * @default null
+     */
+    innerBounds?: InnerBoundType | null;
+    /**
+     * You can set the text format of the distance shown in the guidelines.
+     * @default oneself
+     */
+    snapDistFormat?: (distance: number, type: "vertical" | "horizontal") => number | string;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Snappable
+ */
+export interface SnapDirections {
+    /**
+     * Whether to snap the top of the element
+     * @default true
+     */
+    left?: boolean;
+    /**
+     * Whether to snap the left of the element
+     * @default true
+     */
+    top?: boolean;
+    /**
+     * Whether to snap the right of the element
+     * @default true
+     */
+    right?: boolean;
+    /**
+     * Whether to snap the bottom of the element
+     * @default true
+     */
+    bottom?: boolean;
+    /**
+     * Whether to snap the center((left + right) / 2) of the element
+     * @default false
+     */
+    center?: boolean;
+    /**
+     * Whether to snap the middle((top + bottom) / 2) of the element
+     * @default false
+     */
+    middle?: boolean;
+}
+/**
+ * @typedef
+ * @memberof Moveable.Snappable
+ * @extends Moveable.Snappable.SnapDirections
+ */
+export interface ElementGuidelineValue extends SnapDirections {
+    /**
+     * guideline element
+     */
+    element: Element;
+    /**
+     * class names to add to guideline
+     * @default ""
+     * @example
+     *
+     * ```css
+     * .moveable-gap.red {
+     *   background: red!important;
+     * }
+     * ```
+     * ```css
+     * .moveable-bold.red {
+     *   background: red!important;
+     * }
+     * ```
+     * ```css
+     * .moveable-dashed.red {
+     *   border-top-color: red!important;
+     * }
+     * ```
+     */
+    className?: string;
+    /**
+     * Whether to update the element size at every render
+     * @default false
+     */
+    refresh?: boolean;
+}
+
+
+
+/**
+ * @typedef
+ * @memberof Moveable.Snappable
+ * @extends Moveable.Snappable.SnapDirections
+ */
+export interface ElementGuidelineValueOption extends SnapDirections {
+    /**
+     * guideline element
+     */
+    element: MoveableRefType<Element>;
+    /**
+     * class names to add to guideline
+     * @default ""
+     */
+    className?: string;
+    /**
+     * Whether to update the element size at every render
+     * @default false
+     */
+    refresh?: boolean;
+}
+/**
+ * @typedef
+ * @memberof Moveable.Snappable
+ */
+export interface PosGuideline {
+    /**
+     * guideline pos
+     */
+    pos: number | string;
+    /**
+     * class names to add to guideline
+     * @default ""
+     */
+    className?: string;
+}
+/**
+ * @typedef
+ * @memberof Moveable.Snappable
+ */
+export interface NumericPosGuideline extends PosGuideline {
+    pos: number;
+}
+/**
+ * @typedef
+ * @memberof Moveable.Snappable
+ * @extends Moveable.Snappable.SnapDirections
+ */
+export interface ElementGuidelineValue extends SnapDirections {
+    /**
+     * guideline element
+     */
+    element: Element;
+    /**
+     * class names to add to guideline
+     * @default ""
+     */
+    className?: string;
+    /**
+     * Whether to update the element size at every render
+     * @default false
+     */
+    refresh?: boolean;
+}
+export interface SnappableEvents {
+    onSnap: OnSnap;
+    onBound: OnBound;
+}
+export interface SnappableProps extends SnappableOptions, EventInterface<SnappableEvents> {
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Snappable
+ */
+export interface OnSnap {
+    /**
+     * snapped verticalGuidelines, horizontalGuidelines,
+     */
+    guidelines: SnapGuideline[];
+    /**
+     * snapped elements (group by element)
+     */
+    elements: SnapGuideline[];
+    /**
+     * gaps is snapped guidelines that became gap snap between elements.
+     */
+    gaps: SnapGuideline[];
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Snappable
+ */
+export interface OnBound {
+    bounds: {
+        left: boolean;
+        top: boolean;
+        right: boolean;
+        bottom: boolean;
+    };
+    innerBounds: {
+        left: boolean;
+        top: boolean;
+        right: boolean;
+        bottom: boolean;
+    };
+}
+/**
+ * @typedef
+ * @memberof Moveable.Snappable
+ */
+export interface InnerBoundType {
+    left: number;
+    top: number;
+    width: number;
+    height: number;
+}
+/**
+ * @typedef
+ * @memberof Moveable.Snappable
+ */
+export interface BoundType {
+    /**
+     * If position is css, right and bottom are calculated as css right and css bottom of container.
+     * @default "client"
+     */
+    position?: "client" | "css";
+    left?: number;
+    top?: number;
+    right?: number;
+    bottom?: number;
+}
+
+export interface SnapDirectionPoses {
+    left?: number;
+    top?: number;
+    right?: number;
+    bottom?: number;
+    center?: number;
+    middle?: number;
+}
+
+export interface SnapElementRect extends ElementGuidelineValue {
+    rect: SnapDirectionPoses;
+}
+export interface SnappableState {
+    staticGuidelines: SnapGuideline[];
+    elementRects: SnapElementRect[];
+    guidelines: SnapGuideline[];
+    snapContainer: MoveableRefType<HTMLElement | SVGElement>;
+    snapOffset: { left: number, top: number, bottom: number, right: number }
+    snapRenderInfo?: SnapRenderInfo | null;
+    snapThresholdInfo?: { multiples: number[]; offset: number[]; } | null;
+    enableSnap: boolean;
+}
+export interface SnapRenderInfo {
+    render?: boolean;
+    direction?: number[];
+    snap?: boolean;
+    center?: boolean;
+    request?: boolean;
+    externalPoses?: number[][];
+    externalBounds?: BoundType | false | null;
+}
+
+/**
+ * @typedef
+ * @options
+ * @memberof Moveable.Scrollable
+ */
+export interface ScrollableOptions {
+    /**
+     * Whether or not target can be scrolled to the scroll container
+     * @default false
+     */
+    scrollable?: boolean;
+    /**
+     * The container to which scroll is applied
+     * @deprecated
+     * @default container
+     */
+    scrollContainer?: MoveableRefType<HTMLElement>;
+    /**
+     * Expand the range of the scroll check area.
+     * @deprecated
+     * @default 0
+     */
+    scrollThreshold?: number;
+    /**
+     * Time interval that occurs when scrolling occurs when dragging is maintained
+     * If set to 0, it does not occur.
+     * @deprecated
+     * @default 0
+     */
+    scrollThrottleTime?: number;
+    /**
+     * Sets a function to get the scroll position.
+     * @deprecated
+     * @default scrollContainer's scrollTop, scrollLeft
+     */
+    getScrollPosition?: (e: { scrollContainer: HTMLElement, direction: number[] }) => number[];
+    /**
+     * Option to scroll with dragging
+     * @since 0.43.0
+     * @story support-scroll--scrolling-scrollable
+     * @example
+     * const scrollOptions = {
+     *     container: () => viewer.getContainer(),
+     *     threshold: 20,
+     *     getScrollPosition: () => {
+     *         return [
+     *             viewer.getScrollLeft({ absolute: true }),
+     *             viewer.getScrollTop({ absolute: true }),
+     *         ];
+     *     },
+     * };
+     */
+    scrollOptions?: Partial<DragScrollOptions> | null;
+}
+export interface ScrollableEvents {
+    onScroll: OnScroll;
+    onScrollGroup: OnScrollGroup;
+}
+export interface ScrollableProps extends ScrollableOptions, EventInterface<ScrollableEvents> {
+}
+
+/**
+ * @typedef
+ * @memberof Moveable
+ */
+export interface DragAreaOptions {
+    /**
+     * Instead of firing an event on the target, we add it to the moveable control element. You can use click and clickGroup events.
+     * @default if group, true, else fals
+     */
+    dragArea?: boolean;
+    /**
+     * Set `pointerEvents: none;` css to pass events in dragArea.
+     * @default false
+     */
+    passDragArea?: boolean;
+}
+export interface DragAreaProps extends DragAreaOptions {
+}
+/**
+ * @typedef
+ * @memberof Moveable.Clickable
+ */
+export interface ClickableEvents {
+    onClick: OnClick;
+    onClickGroup: OnClickGroup;
+}
+
+export interface ArrayFormat<T = any> {
+    length: number;
+    [key: number]: T;
+}
+/**
+ * @typedef
+ * @memberof Moveable.Clickable
+ */
+export interface ClickableOptions {
+    /**
+     * Whether to trigger the moveable's click event.
+     * @default true
+     */
+    clickable?: boolean;
+}
+/**
+ * @memberof Moveable.Clickable
+ * @extends Moveable.Clickable.ClickableEvents
+ * @extends Moveable.Clickable.ClickableOptions
+ * @typedef
+ */
+export interface ClickableProps extends EventInterface<ClickableEvents>, ClickableOptions {
+}
+export interface BeforeRenderableEvents {
+    onBeforeRenderStart: OnBeforeRenderStart;
+    onBeforeRender: OnBeforeRender;
+    onBeforeRenderEnd: OnBeforeRenderEnd;
+    onBeforeRenderGroupStart: OnBeforeRenderGroupStart;
+    onBeforeRenderGroup: OnBeforeRenderGroup;
+    onBeforeRenderGroupEnd: OnBeforeRenderGroupEnd;
+}
+export interface BeforeRenderableProps extends EventInterface<BeforeRenderableEvents> {
+}
+export interface RenderableEvents {
+    onRenderStart: OnRenderStart;
+    onRender: OnRender;
+    onRenderEnd: OnRenderEnd;
+    onRenderGroupStart: OnRenderGroupStart;
+    onRenderGroup: OnRenderGroup;
+    onRenderGroupEnd: OnRenderGroupEnd;
+}
+export interface RenderableProps extends EventInterface<RenderableEvents> {
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Clippable
+ */
+export interface ClippableOptions {
+    /**
+     * Whether to clip the target.
+     * @default false
+     */
+    clippable?: boolean | ClippableOptions;
+    /**
+     * Whether to keep the ratio of size if your clipPath is 'inset', 'rect', 'ellipse' type
+     * @default false
+     */
+    keepRatio?: boolean;
+    /**
+     * You can force the custom clipPath. (defaultClipPath < style < customClipPath < dragging clipPath)
+     */
+    customClipPath?: string;
+    /**
+     * If clippath is not set, the default value can be set. (defaultClipPath < style < customClipPath < dragging clipPath)
+     */
+    defaultClipPath?: string;
+    /**
+     * % Can be used instead of the absolute px (`rect` not possible)
+     * @default false
+     */
+    clipRelative?: boolean;
+    /**
+     * When dragging the target, the clip also moves.
+     * @default true
+     */
+    dragWithClip?: boolean;
+    /**
+     * You can drag the clip by setting clipArea.
+     * @default false
+     */
+    clipArea?: boolean;
+    /**
+     * Whether the clip is bound to the target.
+     * @default false
+     */
+    clipTargetBounds?: boolean;
+    /**
+     * Add clip guidelines in the vertical direction.
+     * @default []
+     */
+    clipVerticalGuidelines?: Array<string | number>;
+    /**
+     * Add clip guidelines in the horizontal direction.
+     * @default []
+     */
+    clipHorizontalGuidelines?: Array<string | number>;
+    /**
+     * Distance value that can snap to clip guidelines.
+     * @default 5
+     */
+    clipSnapThreshold?: number;
+}
+export interface ClippableEvents {
+    onClipStart: OnClipStart;
+    onClip: OnClip;
+    onClipEnd: OnClipEnd;
+}
+export interface ClippableProps extends ClippableOptions, EventInterface<ClippableEvents> {
+}
+export interface ClippableState {
+    clipPathState?: string;
+    snapBoundInfos?: { vertical: Required<SnapBoundInfo>, horizontal: Required<SnapBoundInfo> } | null;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable.Clippable
+ * @extends Moveable.OnEvent
+ * @property - The clip type.
+ * @property - The control positions
+ * @property - CSS style of changed clip
+ */
+export interface OnClipStart extends OnEvent {
+    clipType: "polygon" | "circle" | "ellipse" | "inset" | "rect";
+    poses: number[][];
+    clipStyle: string;
+}
+/**
+ * @typedef
+ * @memberof Moveable.Clippable
+ * @extends Moveable.OnEvent
+ * @extends Moveable.CSSObject
+ */
+export interface OnClip extends OnEvent, CSSObject {
+    /**
+     * The clip type.
+     */
+    clipType: "polygon" | "circle" | "ellipse" | "inset" | "rect";
+    /**
+     * The clip event type.
+     */
+    clipEventType: "added" | "changed" | "removed";
+    /**
+     * The control positions
+     */
+    poses: number[][];
+    /**
+     * x position of the distance the control has moved
+     */
+    distX: number;
+    /**
+     * y position of the distance the control has moved
+     */
+    distY: number;
+    /**
+     * CSS style of changed clip
+     */
+    clipStyle: string;
+    /**
+     * Splited CSS styles of changed clip
+     */
+    clipStyles: string[];
+
+}
+/**
+ * @typedef
+ * @memberof Moveable.Clippable
+ * @extends Moveable.OnEndEvent
+ */
+export interface OnClipEnd extends OnEndEvent { }
+
+export interface OnCustomDrag extends GestoTypes.Position {
+    type: string;
+    inputEvent: any;
+    isDrag: boolean;
+    isFirstDrag: boolean;
+    datas: IObject<any>;
+    originalDatas: IObject<any>;
+    parentEvent: boolean;
+    parentGesto: CustomGesto;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable
+ */
+export type PersistRectData = Omit<Partial<RectInfo>, "children"> & {
+    children?: Array<Partial<RectInfo>>;
+};
+
+
+/**
+ * @typedef
+ * @memberof Moveable
+ */
+export interface RectInfo {
+    /**
+     * The coordinates of the vertex 1
+     */
+    pos1: number[];
+    /**
+     * The coordinates of the vertex 2
+     */
+    pos2: number[];
+    /**
+     * The coordinates of the vertex 3
+     */
+    pos3: number[];
+    /**
+     * The coordinates of the vertex 4
+     */
+    pos4: number[];
+    /**
+     * left position of the target relative to the container
+     */
+    left: number;
+    /**
+     * top position of the target relative to the container
+     */
+    top: number;
+    /**
+     * The width of moveable element
+     */
+    width: number;
+    /**
+     * The height of moveable element
+     */
+    height: number;
+    /**
+     * The offset width of the target
+     */
+    offsetWidth: number;
+    /**
+     * The offset height of the target
+     */
+    offsetHeight: number;
+    /**
+     * The absolute transform origin
+     */
+    origin: number[];
+    /**
+     * The absolute transform origin before transformation
+     */
+    beforeOrigin: number[];
+    /**
+     * The target transform origin
+     */
+    transformOrigin: number[];
+    /**
+     * you can get the absolute rotation value
+     */
+    rotation: number;
+    /**
+     * If you use a group, you can get child moveables' rect info
+     */
+    children?: RectInfo[];
+}
+
+/**
+ * @typedef
+ * @memberof Moveable
+ */
+export interface GroupRect {
+    pos1: number[];
+    pos2: number[];
+    pos3: number[];
+    pos4: number[];
+    minX: number;
+    minY: number;
+    maxX: number;
+    maxY: number;
+    width: number;
+    height: number;
+    rotation: number;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable
+ * @property - top position
+ * @property - left position
+ * @property - target's width
+ * @property - target's height
+ */
+export interface HitRect {
+    top: number;
+    left: number;
+    width?: number;
+    height?: number;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable
+ * @extends Moveable.MoveableInterface
+ */
+export interface MoveableManagerInterface<T = {}, U = {}> extends MoveableInterface {
+    moveables?: MoveableManagerInterface[];
+    props: MoveableManagerProps<T>;
+    state: MoveableManagerState<U>;
+    renderState: Record<string, any>;
+    rotation: number;
+    scale: number[];
+    controlGesto: Gesto;
+    targetGesto: Gesto;
+    enabledAbles: Able[];
+    controlAbles: Able[];
+    targetAbles: Able[];
+    areaElement: HTMLElement;
+    controlBox: HTMLElement,
+    isUnmounted: boolean;
+    useCSS(tag: string, css: string): any;
+    getContainer(): HTMLElement | SVGElement;
+    getRotation(): number;
+    getState(): MoveableManagerState<U>;
+    triggerEvent(name: string, params: IObject<any>, isManager?: boolean): any;
+}
+
+/**
+ * @typedef
+ * @memberof Moveable
+ * @extends Moveable.MoveableManagerInterface
+ */
+export interface MoveableGroupInterface<T = {}, U = {}> extends MoveableManagerInterface<T, U> {
+    props: MoveableManagerProps<T> & { targets: Array<HTMLElement | SVGElement> };
+    moveables: MoveableManagerInterface[];
+    transformOrigin: string;
+    renderGroupRects: GroupRect[];
+    getRequestChildStyles(): string[];
+}
+
+/**
+ * @typedef
+ * @memberof Moveable
+ */
+export interface MoveableInterface {
+    getManager(): MoveableManagerInterface<any, any>;
+    getRect(): RectInfo;
+    getAble<T extends Able>(ableName: string): T | undefined;
+    isMoveableElement(target: Element): boolean;
+    /**
+     * If the location or size of the target is changed, call the `.updateRect()` method.
+     * Use the `useResizeObserver` and `useMutationObserver` props to update automatically.
+     */
+    updateRect(type?: "Start" | "" | "End", isTarget?: boolean, isSetState?: boolean): void;
+    /**
+     * @deprecated
+     * Use `.updateRect()` method
+     */
+    updateTarget(): void;
+    /**
+     * Request able through a method rather than an event.
+     * At the moment of execution, requestStart is executed,
+     * and then request and requestEnd can be executed through Requester.
+     * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Draggable.html#request Draggable Requester}
+     * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Resizable.html#request Resizable Requester}
+     * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Scalable.html#request Scalable Requester}
+     * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Rotatable.html#request Rotatable Requester}
+     * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.OriginDraggable.html#request OriginDraggable Requester}
+     * @param - ableName
+     * @param - request to be able params.
+     * @param - If isInstant is true, request and requestEnd are executed immediately.
+     * @return - Able Requester. If there is no request in able, nothing will work.
+     * @example
+     * import Moveable from "moveable";
+     *
+     * const moveable = new Moveable(document.body);
+     *
+     * // Instantly Request (requestStart - request - requestEnd)
+     * moveable.request("draggable", { deltaX: 10, deltaY: 10 }, true);
+     *
+     * // Start move
+     * const requester = moveable.request("draggable");
+     * requester.request({ deltaX: 10, deltaY: 10 });
+     * requester.request({ deltaX: 10, deltaY: 10 });
+     * requester.request({ deltaX: 10, deltaY: 10 });
+     * requester.requestEnd();
+     */
+    request<
+        RequestParam extends AbleRequesters[Name],
+        Name extends string = string,
+    >(ableName: Name, params?: RequestParam, isInstant?: boolean): Requester<RequestParam>;
+    /**
+     * moveable is the top level that manages targets
+     * `Single`: MoveableManager instance
+     * `Group`: MoveableGroup instance
+     * `IndividualGroup`: MoveableIndividaulGroup instance
+     * Returns leaf target MoveableManagers.
+     */
+    getMoveables(): MoveableManagerInterface[];
+    /**
+     * Returns the element of the control box.
+     */
+    getControlBoxElement(): HTMLElement;
+    /**
+     * Target element to be dragged in moveable
+     */
+    getDragElement(): HTMLElement | SVGElement | null | undefined;
+    destroy(): void;
+    dragStart(e: MouseEvent | TouchEvent): void;
+    isInside(clientX: number, clientY: number): boolean;
+    isDragging(ableName?: string): boolean;
+    hitTest(el: Element | HitRect): number;
+    setState(state: any, callback?: () => any): any;
+    waitToChangeTarget(): Promise<void>;
+    forceUpdate(callback?: () => any): any;
+    updateSelectors(): void;
+    getTargets(): Array<HTMLElement | SVGElement>;
+    stopDrag(type?: "target" | "control"): void;
+}
+
+export interface ControlPose {
+    virtual?: boolean;
+    vertical: number;
+    horizontal: number;
+    pos: number[];
+    sub?: boolean;
+    raw?: number;
+    direction?: "n" | "e" | "s" | "w" | "nw" | "ne" | "sw" | "se" | "nesw";
+}
+
+
+export type AnyProps<T extends IObject<any>> = Required<{ [key in keyof T]: any }>;
+export type UnionToIntersection<U> =
+    (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
+
+// export type MoveableEventsProps = Parameters<Required<MoveableProps>[keyof typeof MOVEABLE_EVENTS_PROPS_MAP]>[0];
+export type MoveableEvents = {
+    [key in typeof MOVEABLE_EVENTS[number]]
+    : Parameters<Required<MoveableProps>[`on${Capitalize<key>}`]>[0];
+};
+
+export type Writable<T> = {
+    -readonly [key in keyof T]: T[key];
+};
+
+export type MoveableProperties = {
+    -readonly [key in typeof MOVEABLE_PROPS[number]]?: MoveableProps[key];
+};
+
+export interface SnappableRenderType {
+    type: "snap" | "bounds";
+    pos: number;
+}
+
+export type ExcludeParams<T extends IObject<any>>
+    = ExcludeKeys<T, keyof OnEvent>;
+export type ExcludeEndParams<T extends IObject<any>>
+    = ExcludeKeys<ExcludeParams<T>, "lastEvent" | "isDrag" | "isDouble">;
+export type DefaultProps<Name extends string, AbleObject extends Partial<Able<any, any>>>
+    = AbleObject extends { props: {} } ? AbleObject["props"] : { readonly [key in Name]: BooleanConstructor; };
+
+
+
+ + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme. +
+ + + + + + + + diff --git a/release/0.52.0/doc/scripts/custom.js b/release/0.52.0/doc/scripts/custom.js new file mode 100644 index 000000000..b2b0b4352 --- /dev/null +++ b/release/0.52.0/doc/scripts/custom.js @@ -0,0 +1,12 @@ +(function () { + window.dataLayer = window.dataLayer || []; + function gtag() { dataLayer.push(arguments); } + gtag('js', new Date()); + + gtag('config', 'G-TRBNXHQ0ZF'); + var script = document.createElement("script"); + + script.src = "https://www.googletagmanager.com/gtag/js?id=G-TRBNXHQ0Z"; + + document.body.appendChild(script); +})(); diff --git a/release/0.52.0/doc/scripts/linenumber.js b/release/0.52.0/doc/scripts/linenumber.js new file mode 100644 index 000000000..9cb891484 --- /dev/null +++ b/release/0.52.0/doc/scripts/linenumber.js @@ -0,0 +1,25 @@ +/*global document */ +(function() { + var source = document.getElementsByClassName('prettyprint source linenums'); + var i = 0; + var lineNumber = 0; + var lineId; + var lines; + var totalLines; + var anchorHash; + + if (source && source[0]) { + anchorHash = document.location.hash.substring(1); + lines = source[0].getElementsByTagName('li'); + totalLines = lines.length; + + for (; i < totalLines; i++) { + lineNumber++; + lineId = 'line' + lineNumber; + lines[i].id = lineId; + if (lineId === anchorHash) { + lines[i].className += ' selected'; + } + } + } +})(); diff --git a/release/0.52.0/doc/scripts/prettify/Apache-License-2.0.txt b/release/0.52.0/doc/scripts/prettify/Apache-License-2.0.txt new file mode 100644 index 000000000..75b52484e --- /dev/null +++ b/release/0.52.0/doc/scripts/prettify/Apache-License-2.0.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/release/0.52.0/doc/scripts/prettify/lang-css.js b/release/0.52.0/doc/scripts/prettify/lang-css.js new file mode 100644 index 000000000..bb6dbea43 --- /dev/null +++ b/release/0.52.0/doc/scripts/prettify/lang-css.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com", +/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); diff --git a/release/0.52.0/doc/scripts/prettify/prettify.js b/release/0.52.0/doc/scripts/prettify/prettify.js new file mode 100644 index 000000000..ec2a488bd --- /dev/null +++ b/release/0.52.0/doc/scripts/prettify/prettify.js @@ -0,0 +1,28 @@ +var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; +(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= +[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), +l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, +q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, +q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, +"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), +a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} +for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], +"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], +H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], +J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ +I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), +["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", +/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), +["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", +hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= +!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}pul .parent")).map(function (group) { + var items = Array.prototype.slice.call(group.querySelectorAll("a")); + var strings = items.map(function (a) { + return a.innerText.toLowerCase(); + }); + + return {el: group, items: items, strings, strings}; + }); + input.addEventListener("keyup", function (e) { + var value = input.value.toLowerCase(); + + if (value) { + utils.addClass(nav, "searching"); + } else { + utils.removeClass(nav, "searching"); + return; + } + groups.forEach(function (group) { + var isSearch = false; + var items = group.items; + + group.strings.forEach(function (v, i) { + var item = items[i]; + if (utils.hasClass(item.parentNode, "parent")) { + item = item.parentNode; + } + if (v.indexOf(value) > -1) { + utils.addClass(item, "targeting"); + isSearch = true; + } else { + utils.removeClass(item, "targeting"); + } + }); + if (isSearch) { + utils.addClass(group.el, "module-targeting"); + } else { + utils.removeClass(group.el, "module-targeting"); + } + }); + }); +})(); \ No newline at end of file diff --git a/release/0.52.0/doc/scripts/utils.min.js b/release/0.52.0/doc/scripts/utils.min.js new file mode 100644 index 000000000..8489a3584 --- /dev/null +++ b/release/0.52.0/doc/scripts/utils.min.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2018 Daybrush +@name: @daybrush/utils +license: MIT +author: Daybrush +repository: https://github.com/daybrush/utils +@version 0.4.0 +*/ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.utils=t()}(this,function(){"use strict";var u="rgb",c="rgba",f="hsl",l="hsla",e=[u,c,f,l],t="function",n="object",r="string",i="undefined",a=typeof window!==i,o=["webkit","ms","moz","o"],s=function(e){if(typeof document===i)return"";var t=(document.body||document.documentElement).style,n=o.length;if(typeof t[e]!==i)return e;for(var r=0;rul>li:after { + content: ""; + position: absolute; + right: 10px; + top: 0; + bottom: 0; + width: 0; + height: 0; + margin: auto 0px; + border-top: 7px solid #ccc; + border-left: 6px solid transparent; + border-right: 6px solid transparent; +} +nav li h4, nav li ul { + display: none; +} + +.name.typescript { + background: #374E79; + font-size: 14px; +} +.name.typescript .signature { + color: #21de60; +} +.ts-params.typescript table .last { + display: none; +} +table.params th, table.params tr td , table.params tr td.type{ + word-break: break-word; + white-space: normal; +} + +nav .search { + position: relative; + margin: 0px 10px; + border: 3px solid #333; + height: 43px; +} +nav .search .input-area { + position: absolute; + left: 0; + top: 0; + right: 35px; + height: 35px; +} +nav .search input { + position: relative; + width: 100%; + height: 100%; + border: 0; + padding: 0; + text-indent: 10px; + font-weight: bold; + font-size: 14px; + outline: none; +} +nav .search button { + position: absolute; + top: 0; + right: 0px; + width: 35px; + height: 35px; + border: 0; + padding: 0; + outline: none; + cursor: pointer; +} +nav .search button:before { + position: absolute; + content: ""; + width: 18px; + height: 18px; + top: 7px; + left: 7px; + border: 3px solid #333; + border-radius: 50%; + box-sizing: border-box; +} +nav .search button:after { + position: absolute; + content: ""; + width: 3px; + height: 11px; + top: 21px; + left: 18px; + background: #333; + transform-origin: 50% 0%; + -ms-transform-origin: 50% 0%; + -webkit-transform-origin: 50% 0%; + transform: rotate(-45deg); + -ms-transform: rotate(-45deg); + -webkit-transform: rotate(-45deg); +} + +nav.searching li:after { + display: none!important; +} +nav.searching li h4, nav.searching li ul { + display: block!important; +} + +nav.searching .parent { + display: none; +} +nav.searching .parent ul li a { + display: none; +} + +nav.searching .parent.module-targeting { + display: block; +} +nav.searching .parent.module-targeting ul li a { + display: none; +} +nav.searching .parent.module-targeting ul li a.targeting { + display: block; +} +nav.searching .parent.targeting ul li a { + display: block; +} + +nav>h2.custom>a { + margin:12px 10px; +} + +tr.deprecated td { + text-decoration: line-through; +} + + +.db-prop { + margin-top: 20px; + margin-bottom: 40px; +} + +.db-name { + font-size: 120%; + font-weight: normal; +} + +.db-default, .db-since, .db-story { + margin-top: 10px; + margin-bottom: 10px; + font-size: 90%; +} +.db-optional { + display: inline-block; + font-size: 70%; + font-weight: normal; + background: #333; + border-radius: 3px; + padding: 1px 4px; + color: #eee; + vertical-align: middle; + margin-left: 10px; +} +.db-type { + margin-top: 10px; + margin-bottom: 10px; + padding: 13px 10px; + border: 1px solid #d8dcdf; + font-size: 90%; +} +.db-examples-header { + display: block; + font-weight: bold; + padding-top: 20px; + padding-bottom: 0px; +} +.db-examples { + overflow: auto; + max-height: 400px; +} diff --git a/release/0.52.0/doc/styles/jsdoc.css b/release/0.52.0/doc/styles/jsdoc.css new file mode 100644 index 000000000..c36e8afc1 --- /dev/null +++ b/release/0.52.0/doc/styles/jsdoc.css @@ -0,0 +1,679 @@ +@import url(https://fonts.googleapis.com/css?family=Montserrat:400,700); + +* { + box-sizing: border-box +} + +html, body { + height: 100%; + width: 100%; +} + +body { + color: #333; + background-color: white; + margin: 0 auto; + padding: 0 20px; + font-family: 'Helvetica Neue', Helvetica, sans-serif; + font-size: 16px; + /* line-height: 160%; */ +} + +a, +a:active { + color: #333; + text-decoration: none; +} + +a:hover { + text-decoration: none; +} + +article a { + border-bottom: 1px solid #ddd; +} + +article a:hover, article a:active { + border-bottom-color: #222; +} + +p, ul, ol, blockquote { + margin-bottom: 1em; +} + +h1, h2, h3, h4, h5, h6 { + font-family: 'Montserrat', sans-serif; +} + +h1, h2, h3, h4, h5, h6 { + color: #000; + font-weight: 400; + margin: 0; +} + +h1 { + font-weight: 300; + font-size: 48px; + margin: 1em 0 .5em; +} + +h1.page-title { + font-size: 48px; + margin: 1em 30px; +} + +h2 { + font-size: 24px; + margin: 1.5em 0 .3em; +} + +h3 { + font-size: 24px; + margin: 1.2em 0 .3em; +} + +h4 { + font-size: 18px; + margin: 1em 0 .2em; + color: #4d4e53; +} + +h4.name { + color: #fff; + background: #333; + box-shadow: 0 .25em .5em #d3d3d3; + border-top: 1px solid #d3d3d3; + border-bottom: 1px solid #d3d3d3; + margin: 1.5em 0 0.5em; + padding: .75em 0 .75em 10px; +} + +h4.name a { + color: #fff; +} + +h4.name a:hover { + border-bottom-color: #fff; +} + +h5, .container-overview .subsection-title { + font-size: 120%; + letter-spacing: -0.01em; + margin: 8px 0 3px 0; +} + +h6 { + font-size: 100%; + letter-spacing: -0.01em; + margin: 6px 0 3px 0; + font-style: italic; +} + +tt, code, kbd, samp { + font-family: Consolas, Monaco, 'Andale Mono', monospace; + background: #f4f4f4; + padding: 1px 5px; +} + +.class-description { + font-size: 130%; + line-height: 140%; + margin-bottom: 1em; + margin-top: 1em; +} + +.class-description:empty { + margin: 0 +} + +#main { + float: right; + width: calc(100% - 240px); +} + +header { + display: block +} + +section { + display: block; + background-color: #fff; + padding: 0 0 0 30px; +} + +.variation { + display: none +} + +.signature-attributes { + font-size: 60%; + color: #eee; + font-style: italic; + font-weight: lighter; +} + +nav { + float: left; + display: block; + width: 250px; + left: 10px; + background: #fff; + overflow: auto; + position: fixed; + height: 100%; + padding-bottom: 40px; +} + +nav h3 { + margin-top: 12px; + font-size: 13px; + text-transform: uppercase; + letter-spacing: 1px; + font-weight: 700; + line-height: 24px; + margin: 15px 0 10px; + padding: 0; + color: #000; +} + +nav ul { + font-size: 100%; + line-height: 17px; + padding: 0; + margin: 0; + list-style-type: none; +} +nav ul a { + font-size: 12px; +} +nav ul a, +nav ul a:active { + line-height: 18px; + padding: 0; + display: block; +} + + +nav > ul { + padding: 0 10px; +} +nav > ul > li { + position: relative; + padding: 13px 20px 13px 10px; + word-break: break-word; + box-sizing: border-box; + border-bottom: 1px solid #ccc; +} +nav > ul > li > a { + font-size: 14px; + color: black; + font-weight: bold; +} +nav .method a, nav .event a { + font-family: sans-serif; + color: black; + font-weight: 600; + font-size: 13px; +} +nav .method.inherits a { + color: #777; +} +nav .method.inherits a:after { + content: "ⓘ"; + margin-left: 5px; + font-size: 50%; + +} +nav ul h4, nav ul ul { + margin-left: 15px; +} +nav ul ul { + margin-bottom: 10px +} +nav ul h4 { + font-size: 14px; + margin-top: 5px; + color: black; +} +nav ul h4 a, nav ul h4 a:hover, nav ul h4 a:active { + color: black; + font-size: 14px; +} +nav ul ul + ul { + /* margin-top: -10px; */ +} + +nav ul ul a { + color: #333; + font-weight: bold; + border-left: 1px solid hsl(207, 10%, 86%); +} + +nav ul ul a, +nav ul ul a:active { + padding: 2px 0px; + padding-left: 20px; +} + +nav h2 { + font-size: 12px; + margin: 0; + padding: 0px 10px; +} + +nav > h2 > a { + display: block; + margin: 30px 10px 20px; + font-size: 16px; + font-weight: bold; + color: #333 !important; +} + +footer { + color: hsl(0, 0%, 28%); + margin-left: 250px; + display: block; + padding: 15px; + font-style: italic; + font-size: 90%; +} + +.ancestors { + color: #999 +} + +.ancestors a { + color: #999 !important; +} + +.clear { + clear: both +} + +.important { + font-weight: bold; + color: #950B02; +} + +.yes-def { + text-indent: -1000px +} + +.type-signature { + color: #88CCAA; +} + +.type-signature:last-child { + color: #eee; +} + +.name, .signature { + font-family: Consolas, Monaco, 'Andale Mono', monospace +} + +.signature { + color: #88CCAA; +} + +.details { + margin-top: 6px; + border-left: 2px solid #DDD; + line-height: 20px; + font-size: 14px; +} + +.details dt { + width: 120px; + float: left; + padding-left: 10px; +} + +.details dd { + margin-left: 70px; + margin-top: 6px; + margin-bottom: 6px; +} + +.details ul { + margin: 0 +} + +.details ul { + list-style-type: none +} + +.details pre.prettyprint { + margin: 0 +} + +.details .object-value { + padding-top: 0 +} + +.description { + margin-bottom: 1em; + margin-top: 1em; +} + +.code-caption { + font-style: italic; + font-size: 107%; + margin: 0; +} + +.prettyprint { + font-size: 14px; + overflow: auto; +} + +.prettyprint.source { + width: inherit; + line-height: 18px; + display: block; + background-color: #0d152a; + color: #aeaeae; +} + +.prettyprint code { + line-height: 18px; + display: block; + background-color: #0d152a; + color: #4D4E53; +} + +.prettyprint > code { + padding: 15px; +} + +.prettyprint .linenums code { + padding: 0 15px +} + +.prettyprint .linenums li:first-of-type code { + padding-top: 15px +} + +.prettyprint code span.line { + display: inline-block +} + +.prettyprint.linenums { + padding-left: 70px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.prettyprint.linenums ol { + padding-left: 0 +} + +.prettyprint.linenums li { + border-left: 3px #34446B solid; +} + +.prettyprint.linenums li.selected, .prettyprint.linenums li.selected * { + background-color: #34446B; +} + +.prettyprint.linenums li * { + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; +} + +.params, .props { + border-spacing: 0; + border: 1px solid #ddd; + border-collapse: collapse; + border-radius: 3px; + box-shadow: 0 1px 3px rgba(0,0,0,0.1); + width: 100%; + font-size: 14px; + margin: 1em 0; +} + +.params .type { + white-space: nowrap; +} + +.params code { + white-space: pre; +} + +.params td, .params .name, .props .name, .name code { + color: #4D4E53; + font-family: Consolas, Monaco, 'Andale Mono', monospace; + font-size: 100%; +} + +.params td, .params th, .props td, .props th { + margin: 0px; + text-align: left; + vertical-align: top; + padding: 10px; + display: table-cell; +} + +.params td { + font-weight: bold; + border-top: 1px solid #eee +} + +.params thead tr, .props thead tr { + background-color: #fff; + font-weight: bold; +} + +.params .params thead tr, .props .props thead tr { + background-color: #fff; + font-weight: bold; +} + +.params td.description > p:first-child, .props td.description > p:first-child { + margin-top: 0; + padding-top: 0; +} + +.params td.description > p:last-child, .props td.description > p:last-child { + margin-bottom: 0; + padding-bottom: 0; +} + +span.param-type, .params td .param-type, .param-type dd { + color: #999; + font-family: Consolas, Monaco, 'Andale Mono', monospace +} + +.param-type dt, .param-type dd { + display: inline-block +} + +.param-type { + margin: 14px 0; +} + +.disabled { + color: #454545 +} + +/* navicon button */ +.navicon-button { + display: none; + position: relative; + padding: 2.0625rem 1.5rem; + transition: 0.25s; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + opacity: .8; +} +.navicon-button .navicon:before, .navicon-button .navicon:after { + transition: 0.25s; +} +.navicon-button:hover { + transition: 0.5s; + opacity: 1; +} +.navicon-button:hover .navicon:before, .navicon-button:hover .navicon:after { + transition: 0.25s; +} +.navicon-button:hover .navicon:before { + top: .825rem; +} +.navicon-button:hover .navicon:after { + top: -.825rem; +} + +/* navicon */ +.navicon { + position: relative; + width: 2.5em; + height: .3125rem; + background: #000; + transition: 0.3s; + border-radius: 2.5rem; +} +.navicon:before, .navicon:after { + display: block; + content: ""; + height: .3125rem; + width: 2.5rem; + background: #000; + position: absolute; + z-index: -1; + transition: 0.3s 0.25s; + border-radius: 1rem; +} +.navicon:before { + top: .625rem; +} +.navicon:after { + top: -.625rem; +} + +/* open */ +.nav-trigger:checked + label:not(.steps) .navicon:before, +.nav-trigger:checked + label:not(.steps) .navicon:after { + top: 0 !important; +} + +.nav-trigger:checked + label .navicon:before, +.nav-trigger:checked + label .navicon:after { + transition: 0.5s; +} + +/* Minus */ +.nav-trigger:checked + label { + -webkit-transform: scale(0.75); + transform: scale(0.75); +} + +/* × and + */ +.nav-trigger:checked + label.plus .navicon, +.nav-trigger:checked + label.x .navicon { + background: transparent; +} + +.nav-trigger:checked + label.plus .navicon:before, +.nav-trigger:checked + label.x .navicon:before { + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + background: #FFF; +} + +.nav-trigger:checked + label.plus .navicon:after, +.nav-trigger:checked + label.x .navicon:after { + -webkit-transform: rotate(45deg); + transform: rotate(45deg); + background: #FFF; +} + +.nav-trigger:checked + label.plus { + -webkit-transform: scale(0.75) rotate(45deg); + transform: scale(0.75) rotate(45deg); +} + +.nav-trigger:checked ~ nav { + left: 0 !important; +} + +.nav-trigger:checked ~ .overlay { + display: block; +} + +.nav-trigger { + position: fixed; + top: 0; + clip: rect(0, 0, 0, 0); +} + +.overlay { + display: none; + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; + width: 100%; + height: 100%; + background: hsla(0, 0%, 0%, 0.5); + z-index: 1; +} + +@media only screen and (max-width: 680px) { + body { + overflow-x: hidden; + padding: 0 10px; + } + + nav { + background: #FFF; + width: 250px; + height: 100%; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: -250px; + z-index: 3; + padding: 0 10px; + transition: left 0.2s; + } + + .navicon-button { + display: inline-block; + position: fixed; + top: 1.5em; + right: 0; + z-index: 2; + } + + #main { + width: 100%; + } + + #main h1.page-title { + margin: 1em 0; + } + + #main section { + padding: 0; + } + + footer { + margin-left: 0; + } +} + +/** Add a '#' to static members */ +[data-type="member"] a::before { + content: '#'; + display: inline-block; + margin-left: -14px; + margin-right: 5px; +} diff --git a/release/0.52.0/doc/styles/prettify.css b/release/0.52.0/doc/styles/prettify.css new file mode 100644 index 000000000..629bde515 --- /dev/null +++ b/release/0.52.0/doc/styles/prettify.css @@ -0,0 +1,79 @@ +.pln { + color: #ddd; +} + +/* string content */ +.str { + color: #61ce3c; +} + +/* a keyword */ +.kwd { + color: #fbde2d; +} + +/* a comment */ +.com { + color: #aeaeae; +} + +/* a type name */ +.typ { + color: #8da6ce; +} + +/* a literal value */ +.lit { + color: #fbde2d; +} + +/* punctuation */ +.pun { + color: #ddd; +} + +/* lisp open bracket */ +.opn { + color: #000000; +} + +/* lisp close bracket */ +.clo { + color: #000000; +} + +/* a markup tag name */ +.tag { + color: #8da6ce; +} + +/* a markup attribute name */ +.atn { + color: #fbde2d; +} + +/* a markup attribute value */ +.atv { + color: #ddd; +} + +/* a declaration */ +.dec { + color: #EF5050; +} + +/* a variable name */ +.var { + color: #c82829; +} + +/* a function name */ +.fun { + color: #4271ae; +} + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { + margin-top: 0; + margin-bottom: 0; +} diff --git a/release/latest/dist/moveable.cjs.js b/release/latest/dist/moveable.cjs.js index 18fea3c5e..6b13c9b56 100644 --- a/release/latest/dist/moveable.cjs.js +++ b/release/latest/dist/moveable.cjs.js @@ -4,7 +4,7 @@ name: moveable license: MIT author: Daybrush repository: https://github.com/daybrush/moveable/blob/master/packages/moveable -version: 0.51.2 +version: 0.52.0 */ 'use strict'; diff --git a/release/latest/dist/moveable.esm.js b/release/latest/dist/moveable.esm.js index 92c88d42f..7cccdb3bc 100644 --- a/release/latest/dist/moveable.esm.js +++ b/release/latest/dist/moveable.esm.js @@ -4,7 +4,7 @@ name: moveable license: MIT author: Daybrush repository: https://github.com/daybrush/moveable/blob/master/packages/moveable -version: 0.51.2 +version: 0.52.0 */ import { ref, Properties } from 'framework-utils'; import * as React from 'croact'; diff --git a/release/latest/dist/moveable.js b/release/latest/dist/moveable.js index 4364d8e54..94281240b 100644 --- a/release/latest/dist/moveable.js +++ b/release/latest/dist/moveable.js @@ -4,7 +4,7 @@ name: moveable license: MIT author: Daybrush repository: https://github.com/daybrush/moveable/blob/master/packages/moveable -version: 0.51.2 +version: 0.52.0 */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : @@ -5725,7 +5725,7 @@ version: 0.51.2 license: MIT author: Daybrush repository: https://github.com/daybrush/moveable/blob/master/packages/react-moveable - version: 0.54.2 + version: 0.55.0 */ /****************************************************************************** Copyright (c) Microsoft Corporation. @@ -6413,12 +6413,15 @@ version: 0.51.2 }); } + function getPosBySingleDirection(poses, direction) { + var ratio = (direction + 1) / 2; + return [dot(poses[0][0], poses[1][0], ratio, 1 - ratio), dot(poses[0][1], poses[1][1], ratio, 1 - ratio)]; + } + function getPosByDirection(poses, direction) { - var xRatio = (direction[0] + 1) / 2; - var yRatio = (direction[1] + 1) / 2; - var top = [dot(poses[0][0], poses[1][0], xRatio, 1 - xRatio), dot(poses[0][1], poses[1][1], xRatio, 1 - xRatio)]; - var bottom = [dot(poses[2][0], poses[3][0], xRatio, 1 - xRatio), dot(poses[2][1], poses[3][1], xRatio, 1 - xRatio)]; - return [dot(top[0], bottom[0], yRatio, 1 - yRatio), dot(top[1], bottom[1], yRatio, 1 - yRatio)]; + var top = getPosBySingleDirection([poses[0], poses[1]], direction[0]); + var bottom = getPosBySingleDirection([poses[2], poses[3]], direction[0]); + return getPosBySingleDirection([top, bottom], direction[1]); } function getDist(startPos, matrix, width, height, n, fixedDirection) { @@ -6746,7 +6749,7 @@ version: 0.51.2 offsetLeft = _b[0], offsetTop = _b[1]; - if (tagName === "svg" && targetMatrix) { + if (tagName === "svg" && !target.ownerSVGElement && targetMatrix) { // scale matrix for svg's SVGElements. matrixes.push({ type: "target", @@ -7029,7 +7032,8 @@ version: 0.51.2 var datas = e.datas; var events = fillChildEvents(moveable, able.name, e); var moveables = moveable.moveables; - var childs = events.map(function (ev, i) { + var childEvents = []; + var eventParams = events.map(function (ev, i) { var childMoveable = moveables[i]; var state = childMoveable.state; var gestos = state.gestos; @@ -7037,6 +7041,7 @@ version: 0.51.2 if (isStart) { childEvent = new CustomGesto(ableName).dragStart(delta, ev); + childEvents.push(childEvent); } else { if (!gestos[ableName]) { gestos[ableName] = datas.childGestos[i]; @@ -7047,6 +7052,7 @@ version: 0.51.2 } childEvent = setCustomDrag(ev, state, delta, isPinch, isConvert, ableName); + childEvents.push(childEvent); } var result = able[type](childMoveable, __assign(__assign({}, childEvent), { @@ -7066,7 +7072,10 @@ version: 0.51.2 }); } - return childs; + return { + eventParams: eventParams, + childEvents: childEvents + }; } function triggerChildAbles(moveable, able, type, e, eachEvent, callback) { @@ -7716,6 +7725,8 @@ version: 0.51.2 } function checkMoveableSnapPoses(moveable, posesX, posesY, dirXs, dirYs, customSnapThreshold) { + var _a; + if (dirXs === void 0) { dirXs = []; } @@ -7725,14 +7736,15 @@ version: 0.51.2 } var props = moveable.props; + var snapThresholdMultiples = ((_a = moveable.state.snapThresholdInfo) === null || _a === void 0 ? void 0 : _a.multiples) || [1, 1]; var snapThreshold = selectValue(customSnapThreshold, props.snapThreshold, 5); - return checkSnapPoses(moveable.state.guidelines, posesX, posesY, dirXs, dirYs, snapThreshold); + return checkSnapPoses(moveable.state.guidelines, posesX, posesY, dirXs, dirYs, snapThreshold, snapThresholdMultiples); } - function checkSnapPoses(guidelines, posesX, posesY, dirXs, dirYs, snapThreshold) { + function checkSnapPoses(guidelines, posesX, posesY, dirXs, dirYs, snapThreshold, multiples) { return { - vertical: checkSnap(guidelines, "vertical", posesX, snapThreshold, dirXs), - horizontal: checkSnap(guidelines, "horizontal", posesY, snapThreshold, dirYs) + vertical: checkSnap(guidelines, "vertical", posesX, snapThreshold * multiples[0], dirXs), + horizontal: checkSnap(guidelines, "horizontal", posesY, snapThreshold * multiples[1], dirYs) }; } @@ -8934,7 +8946,11 @@ version: 0.51.2 }; } - function checkSnapBounds(guideines, bounds, posesX, posesY, snapThreshold) { + function checkSnapBounds(guideines, bounds, posesX, posesY, snapThreshold, multiples) { + if (multiples === void 0) { + multiples = [1, 1]; + } + var _a = checkBoundPoses(bounds, posesX, posesY), horizontalBoundInfos = _a.horizontal, verticalBoundInfos = _a.vertical; // options.isRequest ? { @@ -8943,7 +8959,7 @@ version: 0.51.2 // } : - var _b = checkSnapPoses(guideines, posesX, posesY, [], [], snapThreshold), + var _b = checkSnapPoses(guideines, posesX, posesY, [], [], snapThreshold, multiples), horizontalSnapInfo = _b.horizontal, verticalSnapInfo = _b.vertical; @@ -9287,7 +9303,9 @@ version: 0.51.2 isPinch = e.isPinch, deltaOffset = e.deltaOffset, useSnap = e.useSnap, - isRequest = e.isRequest; + isRequest = e.isRequest, + isGroup = e.isGroup, + parentThrottleDrag = e.parentThrottleDrag; var distX = e.distX, distY = e.distY; var isDrag = datas.isDrag, @@ -9306,7 +9324,7 @@ version: 0.51.2 var props = moveable.props; var parentMoveable = props.parentMoveable; - var throttleDrag = parentEvent ? 0 : props.throttleDrag || 0; + var throttleDrag = isGroup ? 0 : props.throttleDrag || parentThrottleDrag || 0; var throttleDragRotate = parentEvent ? 0 : props.throttleDragRotate || 0; var dragRotateRad = 0; var isVerticalSnap = false; @@ -9445,6 +9463,8 @@ version: 0.51.2 return param; }, dragGroupStart: function (moveable, e) { + var _a, _b; + var datas = e.datas, clientX = e.clientX, clientY = e.clientY; @@ -9454,15 +9474,20 @@ version: 0.51.2 return false; } - var events = triggerChildGesto(moveable, this, "dragStart", [clientX || 0, clientY || 0], e, false, "draggable"); + var _c = triggerChildGesto(moveable, this, "dragStart", [clientX || 0, clientY || 0], e, false, "draggable"), + childEvents = _c.childEvents, + eventParams = _c.eventParams; var nextParams = __assign(__assign({}, params), { targets: moveable.props.targets, - events: events + events: eventParams }); var result = triggerEvent(moveable, "onDragGroupStart", nextParams); - datas.isDrag = result !== false; + datas.isDrag = result !== false; // find data.startValue and based on first child moveable + + var startValue = (_b = (_a = childEvents[0]) === null || _a === void 0 ? void 0 : _a.datas.startValue) !== null && _b !== void 0 ? _b : [0, 0]; + datas.throttleOffset = [startValue[0] % 1, startValue[1] % 1]; return datas.isDrag ? params : false; }, dragGroup: function (moveable, e) { @@ -9472,9 +9497,11 @@ version: 0.51.2 return; } - var params = this.drag(moveable, e); + var params = this.drag(moveable, __assign(__assign({}, e), { + parentThrottleDrag: moveable.props.throttleDrag + })); var passDelta = e.datas.passDelta; - var events = triggerChildGesto(moveable, this, "drag", passDelta, e, false, "draggable"); + var eventParams = triggerChildGesto(moveable, this, "drag", passDelta, e, false, "draggable").eventParams; if (!params) { return; @@ -9482,7 +9509,7 @@ version: 0.51.2 var nextParams = __assign({ targets: moveable.props.targets, - events: events + events: eventParams }, params); triggerEvent(moveable, "onDragGroup", nextParams); @@ -9497,10 +9524,10 @@ version: 0.51.2 } this.dragEnd(moveable, e); - var events = triggerChildGesto(moveable, this, "dragEnd", [0, 0], e, false, "draggable"); + var eventParams = triggerChildGesto(moveable, this, "dragEnd", [0, 0], e, false, "draggable").eventParams; triggerEvent(moveable, "onDragGroupEnd", fillEndParams(moveable, e, { targets: moveable.props.targets, - events: events + events: eventParams })); return isDrag; }, @@ -9599,6 +9626,7 @@ version: 0.51.2 /** * throttle of x, y when drag. * @name Moveable.Draggable#throttleDrag + * @default 0 * @example * import Moveable from "moveable"; * @@ -11817,6 +11845,8 @@ version: 0.51.2 } function getTotalGuidelines(moveable) { + var _a, _b; + var state = moveable.state; var containerClientRect = state.containerClientRect, hasFixed = state.hasFixed; @@ -11827,20 +11857,16 @@ version: 0.51.2 containerClientWidth = containerClientRect.clientWidth, clientLeft = containerClientRect.clientLeft, clientTop = containerClientRect.clientTop; - var _a = moveable.props, - _b = _a.snapGap, - snapGap = _b === void 0 ? true : _b, - verticalGuidelines = _a.verticalGuidelines, - horizontalGuidelines = _a.horizontalGuidelines, - _c = _a.snapThreshold, - snapThreshold = _c === void 0 ? 5 : _c, - _d = _a.snapGridWidth, - snapGridWidth = _d === void 0 ? 0 : _d, - _e = _a.snapGridHeight, - snapGridHeight = _e === void 0 ? 0 : _e, - _f = _a.maxSnapElementGuidelineDistance, + var _c = moveable.props, + _d = _c.snapGap, + snapGap = _d === void 0 ? true : _d, + verticalGuidelines = _c.verticalGuidelines, + horizontalGuidelines = _c.horizontalGuidelines, + _e = _c.snapThreshold, + snapThreshold = _e === void 0 ? 5 : _e, + _f = _c.maxSnapElementGuidelineDistance, maxSnapElementGuidelineDistance = _f === void 0 ? Infinity : _f, - isDisplayGridGuidelines = _a.isDisplayGridGuidelines; + isDisplayGridGuidelines = _c.isDisplayGridGuidelines; var _g = getRect(getAbsolutePosesByState(moveable.state)), top = _g.top, @@ -11860,8 +11886,12 @@ version: 0.51.2 var totalGuidelines = __spreadArray([], __read(elementGuidelines), false); + var snapThresholdMultiples = ((_b = (_a = state.snapThresholdInfo) === null || _a === void 0 ? void 0 : _a.multiples) !== null && _b !== void 0 ? _b : [1, 1]).map(function (n) { + return n * snapThreshold; + }); + if (snapGap) { - totalGuidelines.push.apply(totalGuidelines, __spreadArray([], __read(getGapGuidelines(moveable, targetRect, snapThreshold)), false)); + totalGuidelines.push.apply(totalGuidelines, __spreadArray([], __read(getGapGuidelines(moveable, targetRect, snapThresholdMultiples)), false)); } var snapOffset = __assign({}, state.snapOffset || { @@ -11871,7 +11901,7 @@ version: 0.51.2 right: 0 }); - totalGuidelines.push.apply(totalGuidelines, __spreadArray([], __read(getGridGuidelines(snapGridWidth, snapGridHeight, overflow ? containerWidth : containerClientWidth, overflow ? containerHeight : containerClientHeight, clientLeft, clientTop, snapOffset, isDisplayGridGuidelines)), false)); + totalGuidelines.push.apply(totalGuidelines, __spreadArray([], __read(getGridGuidelines(moveable, overflow ? containerWidth : containerClientWidth, overflow ? containerHeight : containerClientHeight, clientLeft, clientTop, snapOffset, isDisplayGridGuidelines)), false)); if (hasFixed) { var left_1 = containerClientRect.left, @@ -11898,7 +11928,7 @@ version: 0.51.2 return totalGuidelines; } - function getGapGuidelines(moveable, targetRect, snapThreshold) { + function getGapGuidelines(moveable, targetRect, snapThresholds) { var _a = moveable.props, _b = _a.maxSnapElementGuidelineDistance, maxSnapElementGuidelineDistance = _b === void 0 ? Infinity : _b, @@ -11918,8 +11948,14 @@ version: 0.51.2 var targetStart2 = targetRect[sideNames.start]; var targetEnd2 = targetRect[sideNames.end]; // element : moveable + var snapThresholdMap = { + left: snapThresholds[0], + top: snapThresholds[1] + }; + function getDist(elementRect) { var rect = elementRect.rect; + var snapThreshold = snapThresholdMap[mainNames.start]; if (rect[mainNames.end] < targetStart + snapThreshold) { return targetStart - rect[mainNames.end]; @@ -11973,6 +12009,7 @@ version: 0.51.2 var rect1End = rect1[mainNames.end]; var rect2Start = rect2[mainNames.start]; var rect2End = rect2[mainNames.end]; + var snapThreshold = snapThresholdMap[mainNames.start]; var gap = 0; var pos = 0; var isStart = false; @@ -12042,7 +12079,114 @@ version: 0.51.2 return gapGuidelines; } - function getGridGuidelines(snapGridWidth, snapGridHeight, containerWidth, containerHeight, clientLeft, clientTop, snapOffset, isDisplayGridGuidelines) { + function startGridGroupGuidelines(moveable, clientLeft, clientTop, snapOffset) { + var _a, _b; + + var props = moveable.props; + var state = moveable.state; + var snapGridAll = props.snapGridAll; + var _c = props.snapGridWidth, + snapGridWidth = _c === void 0 ? 0 : _c, + _d = props.snapGridHeight, + snapGridHeight = _d === void 0 ? 0 : _d; + var snapRenderInfo = state.snapRenderInfo; + var hasDirection = snapRenderInfo && (((_a = snapRenderInfo.direction) === null || _a === void 0 ? void 0 : _a[0]) || ((_b = snapRenderInfo.direction) === null || _b === void 0 ? void 0 : _b[1])); + var moveables = moveable.moveables; // snap group's all child to grid. + + if (snapGridAll && moveables && hasDirection && (snapGridWidth || snapGridHeight)) { + if (state.snapThresholdInfo) { + return; + } + + state.snapThresholdInfo = { + multiples: [1, 1], + offset: [0, 0] + }; + var rect_1 = moveable.getRect(); + var children_1 = rect_1.children; + var direction = snapRenderInfo.direction; + + if (children_1) { + var result = direction.map(function (dir, i) { + var _a = i === 0 ? { + snapSize: snapGridWidth, + posName: "left", + sizeName: "width", + clientOffset: snapOffset.left - clientLeft + } : { + snapSize: snapGridHeight, + posName: "top", + sizeName: "height", + clientOffset: snapOffset.top - clientTop + }, + snapSize = _a.snapSize, + posName = _a.posName, + sizeName = _a.sizeName, + clientOffset = _a.clientOffset; + + if (!snapSize) { + return { + dir: dir, + multiple: 1, + snapSize: snapSize, + snapOffset: 0 + }; + } + + var rectSize = rect_1[sizeName]; + var rectPos = rect_1[posName]; // 사이즈보다 만약 작다면 어떻게 해야되죠? + + var childSizes = flat$2(children_1.map(function (child) { + return [child[posName] - rectPos, child[sizeName], rectSize - child[sizeName] - child[posName] + rectPos]; + })).filter(function (v) { + return v; + }).sort(function (a, b) { + return a - b; + }); + var firstChildSize = childSizes[0]; + var childSnapSizes = childSizes.map(function (size) { + return throttle(size / firstChildSize, 0.1) * snapSize; + }); + var n = 1; + var rectRatio = throttle(rectSize / firstChildSize, 0.1); + + for (n = 1; n <= 10; ++n) { + if (childSnapSizes.every(function (childSize) { + return childSize * n % 1 === 0; + })) { + break; + } + } // dir 1 (fixed -1) + // dir 0 (fixed 0) + // dir -1 (fixed 1) + + + var ratio = (-dir + 1) / 2; + var offsetPos = dot(rectPos - clientOffset, rectPos - clientOffset + rectSize, ratio, 1 - ratio); + return { + multiple: rectRatio * n, + dir: dir, + snapSize: snapSize, + snapOffset: Math.round(offsetPos / snapSize) + }; + }); + var multiples = result.map(function (r) { + return r.multiple || 1; + }); + state.snapThresholdInfo.multiples = multiples; + state.snapThresholdInfo.offset = result.map(function (r) { + return r.snapOffset; + }); + result.forEach(function (r, i) { + if (r.snapSize) ; + }); + } + } else { + state.snapThresholdInfo = null; + } + } + + function getGridGuidelines(moveable, containerWidth, containerHeight, clientLeft, clientTop, snapOffset, isDisplayGridGuidelines) { if (clientLeft === void 0) { clientLeft = 0; } @@ -12051,33 +12195,68 @@ version: 0.51.2 clientTop = 0; } + var props = moveable.props; + var state = moveable.state; + var _a = props.snapGridWidth, + snapGridWidth = _a === void 0 ? 0 : _a, + _b = props.snapGridHeight, + snapGridHeight = _b === void 0 ? 0 : _b; var guidelines = []; var snapOffsetLeft = snapOffset.left, snapOffsetTop = snapOffset.top; + var startOffset = [0, 0]; + startGridGroupGuidelines(moveable, clientLeft, clientTop, snapOffset); + var snapThresholdInfo = state.snapThresholdInfo; + var defaultSnapGridWidth = snapGridWidth; + var defaultSnapGridHeight = snapGridHeight; + + if (snapThresholdInfo) { + snapGridWidth *= snapThresholdInfo.multiples[0] || 1; + snapGridHeight *= snapThresholdInfo.multiples[1] || 1; + startOffset = snapThresholdInfo.offset; + } if (snapGridHeight) { - for (var pos = 0; pos <= containerHeight; pos += snapGridHeight) { + var pushGuideline = function (pos) { guidelines.push({ type: "horizontal", - pos: [snapOffsetLeft, throttle(pos - clientTop + snapOffsetTop, 0.1)], + pos: [snapOffsetLeft, throttle(startOffset[1] * defaultSnapGridHeight + pos - clientTop + snapOffsetTop, 0.1)], className: prefix("grid-guideline"), size: containerWidth, hide: !isDisplayGridGuidelines, - direction: "" + direction: "", + grid: true }); + }; + + for (var pos = 0; pos <= containerHeight * 2; pos += snapGridHeight) { + pushGuideline(pos); + } + + for (var pos = -snapGridHeight; pos >= -containerHeight; pos -= snapGridHeight) { + pushGuideline(pos); } } if (snapGridWidth) { - for (var pos = 0; pos <= containerWidth; pos += snapGridWidth) { + var pushGuideline = function (pos) { guidelines.push({ type: "vertical", - pos: [throttle(pos - clientLeft + snapOffsetLeft, 0.1), snapOffsetTop], + pos: [throttle(startOffset[0] * defaultSnapGridWidth + pos - clientLeft + snapOffsetLeft, 0.1), snapOffsetTop], className: prefix("grid-guideline"), size: containerHeight, hide: !isDisplayGridGuidelines, - direction: "" + direction: "", + grid: true }); + }; + + for (var pos = 0; pos <= containerWidth * 2; pos += snapGridWidth) { + pushGuideline(pos); + } + + for (var pos = -snapGridWidth; pos >= -containerWidth; pos -= snapGridWidth) { + pushGuideline(pos); } } @@ -12736,7 +12915,7 @@ version: 0.51.2 var Snappable = { name: "snappable", dragRelation: "strong", - props: ["snappable", "snapContainer", "snapDirections", "elementSnapDirections", "snapGap", "snapGridWidth", "snapGridHeight", "isDisplaySnapDigit", "isDisplayInnerSnapDigit", "isDisplayGridGuidelines", "snapDigit", "snapThreshold", "snapRenderThreshold", NAME_snapRotationThreshold, NAME_snapRotationDegrees, "horizontalGuidelines", "verticalGuidelines", "elementGuidelines", "bounds", "innerBounds", "snapDistFormat", "maxSnapElementGuidelineDistance", "maxSnapElementGapDistance"], + props: ["snappable", "snapContainer", "snapDirections", "elementSnapDirections", "snapGap", "snapGridWidth", "snapGridHeight", "isDisplaySnapDigit", "isDisplayInnerSnapDigit", "isDisplayGridGuidelines", "snapDigit", "snapThreshold", "snapRenderThreshold", "snapGridAll", NAME_snapRotationThreshold, NAME_snapRotationDegrees, "horizontalGuidelines", "verticalGuidelines", "elementGuidelines", "bounds", "innerBounds", "snapDistFormat", "maxSnapElementGuidelineDistance", "maxSnapElementGapDistance"], events: ["snap", "bound"], css: [":host {\n--bounds-color: #d66;\n}\n.guideline {\npointer-events: none;\nz-index: 2;\n}\n.guideline.bounds {\nbackground: #d66;\nbackground: var(--bounds-color);\n}\n.guideline-group {\nposition: absolute;\ntop: 0;\nleft: 0;\n}\n.guideline-group .size-value {\nposition: absolute;\ncolor: #f55;\nfont-size: 12px;\nfont-size: calc(12px * var(--zoom));\nfont-weight: bold;\n}\n.guideline-group.horizontal .size-value {\ntransform-origin: 50% 100%;\ntransform: translateX(-50%);\nleft: 50%;\nbottom: 5px;\nbottom: calc(2px + 3px * var(--zoom));\n}\n.guideline-group.vertical .size-value {\ntransform-origin: 0% 50%;\ntop: 50%;\ntransform: translateY(-50%);\nleft: 5px;\nleft: calc(2px + 3px * var(--zoom));\n}\n.guideline.gap {\nbackground: #f55;\n}\n.size-value.gap {\ncolor: #f55;\n}\n"], render: function (moveable, React) { @@ -13402,13 +13581,19 @@ version: 0.51.2 var origin; var targetOrigin; // inner svg element - if (!hasOffset && tagName !== "svg") { + if (!hasOffset && (tagName !== "svg" || target.ownerSVGElement)) { origin = IS_WEBKIT605 ? getBeforeTransformOrigin(el) : getTransformOriginArray(getStyle("transformOrigin")).map(function (pos) { return parseFloat(pos); }); targetOrigin = origin.slice(); hasOffset = true; - _a = __read(getSVGGraphicsOffset(el, origin, el === target && target.tagName.toLowerCase() === "g"), 4), offsetLeft = _a[0], offsetTop = _a[1], origin[0] = _a[2], origin[1] = _a[3]; + + if (tagName === "svg") { + offsetLeft = 0; + offsetTop = 0; + } else { + _a = __read(getSVGGraphicsOffset(el, origin, el === target && target.tagName.toLowerCase() === "g"), 4), offsetLeft = _a[0], offsetTop = _a[1], origin[0] = _a[2], origin[1] = _a[3]; + } } else { origin = getTransformOriginArray(getStyle("transformOrigin")).map(function (pos) { return parseFloat(pos); @@ -13769,7 +13954,7 @@ version: 0.51.2 var svg = false; if (target) { - if (!hasOffset && target.tagName.toLowerCase() !== "svg") { + if (!hasOffset && target.ownerSVGElement) { // check svg elements var bbox = target.getBBox(); svg = true; @@ -14291,8 +14476,8 @@ version: 0.51.2 return pos; } - var xAdded = calculatePosition(matrix, [normalized(added[0]), 0], n); - var yAdded = calculatePosition(matrix, [0, normalized(added[1])], n); + var xAdded = calculatePosition(matrix, [normalized(added[0] || 1), 0], n); + var yAdded = calculatePosition(matrix, [0, normalized(added[1] || 1)], n); var nextAdded = calculatePosition(matrix, [added[0] / getDistSize(xAdded), added[1] / getDistSize(yAdded)], n); return plus(pos, nextAdded); } @@ -15328,6 +15513,7 @@ version: 0.51.2 var dist = [scale[0] / tempScaleValue[0], scale[1] / tempScaleValue[1]]; var fixedPosition = dragClient; var snapDist = [0, 0]; + var distSign = sign(dist[0] * dist[1]); var isSelfPinch = !dragClient && !parentFlag && isPinch; if (isSelfPinch || resolveMatrix) { @@ -15363,11 +15549,11 @@ version: 0.51.2 if (sizeDirection[0] && !sizeDirection[1] || snapDist[0] && !snapDist[1] || isNoSnap && isWidth) { dist[0] += snapDist[0]; var snapHeight = startOffsetWidth * dist[0] * tempScaleValue[0] / ratio; - dist[1] = snapHeight / startOffsetHeight / tempScaleValue[1]; + dist[1] = sign(distSign * dist[0]) * abs(snapHeight / startOffsetHeight / tempScaleValue[1]); } else if (!sizeDirection[0] && sizeDirection[1] || !snapDist[0] && snapDist[1] || isNoSnap && !isWidth) { dist[1] += snapDist[1]; var snapWidth = startOffsetHeight * dist[1] * tempScaleValue[1] * ratio; - dist[0] = snapWidth / startOffsetWidth / tempScaleValue[0]; + dist[0] = sign(distSign * dist[1]) * abs(snapWidth / startOffsetWidth / tempScaleValue[0]); } } else { dist[0] += snapDist[0]; @@ -20347,6 +20533,7 @@ version: 0.51.2 _this.state = __assign({ container: null, gestos: {}, + renderLines: [[[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]]], renderPoses: [[0, 0], [0, 0], [0, 0], [0, 0]], disableNativeEvent: false, posDelta: [0, 0] @@ -21099,13 +21286,15 @@ version: 0.51.2 stateLeft = state.left, stateTop = state.top, isPersisted = state.isPersisted; + var zoom = props.zoom || 1; - if (!padding) { + if (!padding && zoom <= 1) { state.renderPoses = [pos1, pos2, pos3, pos4]; + state.renderLines = [[pos1, pos2], [pos2, pos4], [pos4, pos3], [pos3, pos1]]; return; } - var _a = getPaddingBox(padding), + var _a = getPaddingBox(padding || {}), left = _a.left, top = _a.top, bottom = _a.bottom, @@ -21136,7 +21325,17 @@ version: 0.51.2 var nextMatrix = multiplies(n, createOriginMatrix(absoluteOrigin.map(function (v) { return -v; }), n), allMatrix, createOriginMatrix(transformOrigin, n)); - state.renderPoses = [calculatePadding(nextMatrix, pos1, [-left, -top], n), calculatePadding(nextMatrix, pos2, [right, -top], n), calculatePadding(nextMatrix, pos3, [-left, bottom], n), calculatePadding(nextMatrix, pos4, [right, bottom], n)]; + var renderPos1 = calculatePadding(nextMatrix, pos1, [-left, -top], n); + var renderPos2 = calculatePadding(nextMatrix, pos2, [right, -top], n); + var renderPos3 = calculatePadding(nextMatrix, pos3, [-left, bottom], n); + var renderPos4 = calculatePadding(nextMatrix, pos4, [right, bottom], n); + state.renderPoses = [renderPos1, renderPos2, renderPos3, renderPos4]; + state.renderLines = [[renderPos1, renderPos2], [renderPos2, renderPos4], [renderPos4, renderPos3], [renderPos3, renderPos1]]; + + if (zoom) { + var zoomOffset = zoom / 2; + state.renderLines = [[calculatePadding(nextMatrix, pos1, [-left - zoomOffset, -top], n), calculatePadding(nextMatrix, pos2, [right + zoomOffset, -top], n)], [calculatePadding(nextMatrix, pos2, [right, -top - zoomOffset], n), calculatePadding(nextMatrix, pos4, [right, bottom + zoomOffset], n)], [calculatePadding(nextMatrix, pos4, [right + zoomOffset, bottom], n), calculatePadding(nextMatrix, pos3, [-left - zoomOffset, bottom], n)], [calculatePadding(nextMatrix, pos3, [-left, bottom + zoomOffset], n), calculatePadding(nextMatrix, pos1, [-left, -top - zoomOffset], n)]]; + } }; __proto.checkUpdate = function () { @@ -21391,16 +21590,12 @@ version: 0.51.2 return []; } - var renderPoses = this.getState().renderPoses; + var state = this.getState(); var Renderer = { createElement: createElement }; - return [[0, 1], [1, 3], [3, 2], [2, 0]].map(function (_a, i) { - var _b = __read(_a, 2), - from = _b[0], - to = _b[1]; - - return renderLine(Renderer, "", renderPoses[from], renderPoses[to], zoom, "render-line-".concat(i)); + return state.renderLines.map(function (line, i) { + return renderLine(Renderer, "", line[0], line[1], zoom, "render-line-".concat(i)); }); }; diff --git a/release/latest/dist/moveable.js.map b/release/latest/dist/moveable.js.map index fb1e24413..9c09d71f8 100644 --- a/release/latest/dist/moveable.js.map +++ b/release/latest/dist/moveable.js.map @@ -1 +1 @@ -{"version":3,"file":"moveable.js","sources":["../../react-moveable/dist/moveable.esm.js","../src/InnerMoveable.tsx","../src/consts.ts","../src/MoveableManager.tsx","../src/Moveable.tsx","../src/utils.ts","../src/index.umd.ts"],"sourcesContent":["/*\nCopyright (c) 2019 Daybrush\nname: react-moveable\nlicense: MIT\nauthor: Daybrush\nrepository: https://github.com/daybrush/moveable/blob/master/packages/react-moveable\nversion: 0.54.2\n*/\nimport getAgent from '@egjs/agent';\nimport { prefixNames, ref, refs, prefixCSS, withMethods } from 'framework-utils';\nimport { findIndex, find, dot, isArray, splitSpace, splitUnit, isString, getDocumentElement, getDocumentBody, getWindow, throttle, getKeys, getRad, TINY_NUM as TINY_NUM$1, average, getDist as getDist$1, throttleArray, calculateBoundSize, convertUnitSize, isNumber, hasClass, isObject, decamelize, isNode, isFunction, isWindow, counter, isUndefined, between, addClass, requestAnimationFrame, removeClass, splitBracket, splitComma, cancelAnimationFrame, pushSet } from '@daybrush/utils';\nimport { minus, invert, convertPositionMatrix, plus, calculate, fromTranslation, multiply, convertDimension, createScaleMatrix, convertCSStoMatrix, createIdentityMatrix, createOriginMatrix, createRotateMatrix, rotate, getOrigin, multiplies, convertMatrixtoCSS, ignoreDimension, createWarpMatrix } from '@scena/matrix';\nimport { parse, parseMat, toMat, calculateMatrixDist } from 'css-to-mat';\nimport ChildrenDiffer, { diff } from '@egjs/children-differ';\nimport DragScroll from '@scena/dragscroll';\nimport { getMinMaxs, fitPoints, getOverlapSize, getAreaSize, isInside, getIntersectionPointsByConstants } from 'overlap-area';\nimport * as React from 'react';\nimport { createElement } from 'react';\nimport Gesto from 'gesto';\nimport { styled } from 'react-css-styled';\nimport EventEmitter from '@scena/event-emitter';\nimport { diff as diff$1 } from '@egjs/list-differ';\n\n/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nfunction __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nfunction __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nfunction __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nfunction __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\n\nfunction makeAble(name, able) {\r\n return __assign({ events: [], props: [], name: name }, able);\r\n}\n\nvar DIRECTIONS4 = [\"n\", \"w\", \"s\", \"e\"];\r\nvar DIRECTIONS = [\"n\", \"w\", \"s\", \"e\", \"nw\", \"ne\", \"sw\", \"se\"];\r\nfunction getSVGCursor(scale, degree) {\r\n return \"data:image/svg+xml;utf8,\");\r\n}\r\nfunction getCursorCSS(degree) {\r\n var x1 = getSVGCursor(1, degree);\r\n // const x2 = getSVGCursor(2, degree);\r\n var degree45 = (Math.round(degree / 45) * 45) % 180;\r\n var defaultCursor = \"ns-resize\";\r\n if (degree45 === 135) {\r\n defaultCursor = \"nwse-resize\";\r\n }\r\n else if (degree45 === 45) {\r\n defaultCursor = \"nesw-resize\";\r\n }\r\n else if (degree45 === 90) {\r\n defaultCursor = \"ew-resize\";\r\n }\r\n // tslint:disable-next-line: max-line-length\r\n return \"cursor:\".concat(defaultCursor, \";cursor: url('\").concat(x1, \"') 16 16, \").concat(defaultCursor, \";\");\r\n}\r\nvar agent = getAgent();\r\nvar IS_WEBKIT = agent.browser.webkit;\r\nvar IS_WEBKIT605 = IS_WEBKIT && (function () {\r\n var navi = typeof window === \"undefined\" ? { userAgent: \"\" } : window.navigator;\r\n var res = /applewebkit\\/([^\\s]+)/g.exec(navi.userAgent.toLowerCase());\r\n return res ? parseFloat(res[1]) < 605 : false;\r\n})();\r\nvar browserName = agent.browser.name;\r\nvar browserVersion = parseInt(agent.browser.version, 10);\r\nvar IS_CHROME = browserName === \"chrome\";\r\nvar IS_CHROMIUM = agent.browser.chromium;\r\nvar chromiumVersion = parseInt(agent.browser.chromiumVersion, 10) || 0;\r\nvar IS_CHROMIUM109 = (IS_CHROME && browserVersion >= 109)\r\n || (IS_CHROMIUM && chromiumVersion >= 109);\r\nvar IS_FIREFOX = browserName === \"firefox\";\r\nvar IS_SAFARI_ABOVE15 = parseInt(agent.browser.webkitVersion, 10) >= 612\r\n || browserVersion >= 15;\r\nvar PREFIX = \"moveable-\";\r\nvar directionCSS = DIRECTIONS.map(function (dir) {\r\n var top = \"\";\r\n var left = \"\";\r\n var originX = \"center\";\r\n var originY = \"center\";\r\n var offset = \"calc(var(--moveable-control-padding, 20) * -1px)\";\r\n if (dir.indexOf(\"n\") > -1) {\r\n top = \"top: \".concat(offset, \";\");\r\n originY = \"bottom\";\r\n }\r\n if (dir.indexOf(\"s\") > -1) {\r\n top = \"top: 0px;\";\r\n originY = \"top\";\r\n }\r\n if (dir.indexOf(\"w\") > -1) {\r\n left = \"left: \".concat(offset, \";\");\r\n originX = \"right\";\r\n }\r\n if (dir.indexOf(\"e\") > -1) {\r\n left = \"left: 0px;\";\r\n originX = \"left\";\r\n }\r\n return \".around-control[data-direction*=\\\"\".concat(dir, \"\\\"] {\\n \").concat(left).concat(top, \"\\n transform-origin: \").concat(originX, \" \").concat(originY, \";\\n }\");\r\n}).join(\"\\n\");\r\nvar MOVEABLE_CSS = \"\\n{\\nposition: absolute;\\nwidth: 1px;\\nheight: 1px;\\nleft: 0;\\ntop: 0;\\nz-index: 3000;\\n--moveable-color: #4af;\\n--zoom: 1;\\n--zoompx: 1px;\\n--moveable-line-padding: 0;\\n--moveable-control-padding: 0;\\nwill-change: transform;\\noutline: 1px solid transparent;\\n}\\n.control-box {\\nz-index: 0;\\n}\\n.line, .control {\\nposition: absolute;\\nleft: 0;\\ntop: 0;\\nwill-change: transform;\\n}\\n.control {\\nwidth: 14px;\\nheight: 14px;\\nborder-radius: 50%;\\nborder: 2px solid #fff;\\nbox-sizing: border-box;\\nbackground: #4af;\\nbackground: var(--moveable-color);\\nmargin-top: -7px;\\nmargin-left: -7px;\\nborder: 2px solid #fff;\\nz-index: 10;\\n}\\n.around-control {\\nposition: absolute;\\nwill-change: transform;\\nwidth: calc(var(--moveable-control-padding, 20) * 1px);\\nheight: calc(var(--moveable-control-padding, 20) * 1px);\\nleft: calc(var(--moveable-control-padding, 20) * -0.5px);\\ntop: calc(var(--moveable-control-padding, 20) * -0.5px);\\nbox-sizing: border-box;\\nbackground: transparent;\\nz-index: 8;\\ncursor: alias;\\ntransform-origin: center center;\\n}\\n\".concat(directionCSS, \"\\n.padding {\\nposition: absolute;\\ntop: 0px;\\nleft: 0px;\\nwidth: 100px;\\nheight: 100px;\\ntransform-origin: 0 0;\\n}\\n.line {\\nwidth: 1px;\\nheight: 1px;\\nbackground: #4af;\\nbackground: var(--moveable-color);\\ntransform-origin: 0px 50%;\\n}\\n.line.edge {\\nz-index: 1;\\nbackground: transparent;\\n}\\n.line.dashed {\\nbox-sizing: border-box;\\nbackground: transparent;\\n}\\n.line.dashed.horizontal {\\nborder-top: 1px dashed #4af;\\nborder-top-color: #4af;\\nborder-top-color: var(--moveable-color);\\n}\\n.line.dashed.vertical {\\nborder-left: 1px dashed #4af;\\nborder-left-color: #4af;\\nborder-left-color: var(--moveable-color);\\n}\\n.line.vertical {\\ntransform: translateX(-50%);\\n}\\n.line.horizontal {\\ntransform: translateY(-50%);\\n}\\n.line.vertical.bold {\\nwidth: 2px;\\n}\\n.line.horizontal.bold {\\nheight: 2px;\\n}\\n\\n.control.origin {\\nborder-color: #f55;\\nbackground: #fff;\\nwidth: 12px;\\nheight: 12px;\\nmargin-top: -6px;\\nmargin-left: -6px;\\npointer-events: none;\\n}\\n\").concat([0, 15, 30, 45, 60, 75, 90, 105, 120, 135, 150, 165].map(function (degree) { return \"\\n.direction[data-rotation=\\\"\".concat(degree, \"\\\"], :global .view-control-rotation\").concat(degree, \" {\\n\").concat(getCursorCSS(degree), \"\\n}\\n\"); }).join(\"\\n\"), \"\\n\\n.line.direction:before {\\ncontent: \\\"\\\";\\nposition: absolute;\\nwidth: 100%;\\nheight: calc(var(--moveable-line-padding, 0) * 1px);\\nbottom: 0;\\nleft: 0;\\n}\\n.group {\\nz-index: -1;\\n}\\n.area {\\nposition: absolute;\\n}\\n.area-pieces {\\nposition: absolute;\\ntop: 0;\\nleft: 0;\\ndisplay: none;\\n}\\n.area.avoid, .area.pass {\\npointer-events: none;\\n}\\n.area.avoid+.area-pieces {\\ndisplay: block;\\n}\\n.area-piece {\\nposition: absolute;\\n}\\n\\n\").concat(IS_WEBKIT605 ? \":global svg *:before {\\ncontent:\\\"\\\";\\ntransform-origin: inherit;\\n}\" : \"\", \"\\n\");\r\nvar NEARBY_POS = [\r\n [0, 1, 2],\r\n [1, 0, 3],\r\n [2, 0, 3],\r\n [3, 1, 2],\r\n];\r\nvar FLOAT_POINT_NUM = 0.0001;\r\nvar TINY_NUM = 0.0000001;\r\nvar MIN_SCALE = 0.000000001;\r\nvar MAX_NUM = Math.pow(10, 10);\r\nvar MIN_NUM = -MAX_NUM;\r\nvar DIRECTION_REGION_TO_DIRECTION = {\r\n n: [0, -1],\r\n e: [1, 0],\r\n s: [0, 1],\r\n w: [-1, 0],\r\n nw: [-1, -1],\r\n ne: [1, -1],\r\n sw: [-1, 1],\r\n se: [1, 1],\r\n};\r\nvar DIRECTION_INDEXES = {\r\n n: [0, 1],\r\n e: [1, 3],\r\n s: [3, 2],\r\n w: [2, 0],\r\n nw: [0],\r\n ne: [1],\r\n sw: [2],\r\n se: [3],\r\n};\r\nvar DIRECTION_ROTATIONS = {\r\n n: 0,\r\n s: 180,\r\n w: 270,\r\n e: 90,\r\n nw: 315,\r\n ne: 45,\r\n sw: 225,\r\n se: 135,\r\n};\r\nvar MOVEABLE_METHODS = [\r\n \"isMoveableElement\",\r\n \"updateRect\",\r\n \"updateTarget\",\r\n \"destroy\",\r\n \"dragStart\",\r\n \"isInside\",\r\n \"hitTest\",\r\n \"setState\",\r\n \"getRect\",\r\n \"request\",\r\n \"isDragging\",\r\n \"getManager\",\r\n \"forceUpdate\",\r\n \"waitToChangeTarget\",\r\n \"updateSelectors\",\r\n \"getTargets\",\r\n \"stopDrag\",\r\n \"getControlBoxElement\",\r\n \"getMoveables\",\r\n \"getDragElement\",\r\n];\n\nfunction setCustomDrag(e, state, delta, isPinch, isConvert, ableName) {\r\n var _a, _b;\r\n if (ableName === void 0) { ableName = \"draggable\"; }\r\n var result = (_b = (_a = state.gestos[ableName]) === null || _a === void 0 ? void 0 : _a.move(delta, e.inputEvent)) !== null && _b !== void 0 ? _b : {};\r\n var datas = result.originalDatas || result.datas;\r\n var ableDatas = datas[ableName] || (datas[ableName] = {});\r\n return __assign(__assign({}, (isConvert ? convertDragDist(state, result) : result)), { isPinch: !!isPinch, parentEvent: true, datas: ableDatas, originalDatas: e.originalDatas });\r\n}\r\nvar CustomGesto = /*#__PURE__*/ (function () {\r\n function CustomGesto(ableName) {\r\n var _a;\r\n if (ableName === void 0) { ableName = \"draggable\"; }\r\n this.ableName = ableName;\r\n this.prevX = 0;\r\n this.prevY = 0;\r\n this.startX = 0;\r\n this.startY = 0;\r\n this.isDrag = false;\r\n this.isFlag = false;\r\n this.datas = {\r\n draggable: {},\r\n };\r\n this.datas = (_a = {},\r\n _a[ableName] = {},\r\n _a);\r\n }\r\n CustomGesto.prototype.dragStart = function (client, e) {\r\n this.isDrag = false;\r\n this.isFlag = false;\r\n var originalDatas = e.originalDatas;\r\n this.datas = originalDatas;\r\n if (!originalDatas[this.ableName]) {\r\n originalDatas[this.ableName] = {};\r\n }\r\n return __assign(__assign({}, this.move(client, e.inputEvent)), { type: \"dragstart\" });\r\n };\r\n CustomGesto.prototype.drag = function (client, inputEvent) {\r\n return this.move([\r\n client[0] - this.prevX,\r\n client[1] - this.prevY,\r\n ], inputEvent);\r\n };\r\n CustomGesto.prototype.move = function (delta, inputEvent) {\r\n var clientX;\r\n var clientY;\r\n var isFirstDrag = false;\r\n if (!this.isFlag) {\r\n this.prevX = delta[0];\r\n this.prevY = delta[1];\r\n this.startX = delta[0];\r\n this.startY = delta[1];\r\n clientX = delta[0];\r\n clientY = delta[1];\r\n this.isFlag = true;\r\n }\r\n else {\r\n var isPrevDrag = this.isDrag;\r\n clientX = this.prevX + delta[0];\r\n clientY = this.prevY + delta[1];\r\n if (delta[0] || delta[1]) {\r\n this.isDrag = true;\r\n }\r\n if (!isPrevDrag && this.isDrag) {\r\n isFirstDrag = true;\r\n }\r\n }\r\n this.prevX = clientX;\r\n this.prevY = clientY;\r\n return {\r\n type: \"drag\",\r\n clientX: clientX,\r\n clientY: clientY,\r\n inputEvent: inputEvent,\r\n isFirstDrag: isFirstDrag,\r\n isDrag: this.isDrag,\r\n distX: clientX - this.startX,\r\n distY: clientY - this.startY,\r\n deltaX: delta[0],\r\n deltaY: delta[1],\r\n datas: this.datas[this.ableName],\r\n originalDatas: this.datas,\r\n parentEvent: true,\r\n parentGesto: this,\r\n };\r\n };\r\n return CustomGesto;\r\n}());\n\nfunction calculateElementPosition(matrix, origin, width, height) {\r\n var is3d = matrix.length === 16;\r\n var n = is3d ? 4 : 3;\r\n var poses = calculatePoses(matrix, width, height, n);\r\n var _a = __read(poses, 4), _b = __read(_a[0], 2), x1 = _b[0], y1 = _b[1], _c = __read(_a[1], 2), x2 = _c[0], y2 = _c[1], _d = __read(_a[2], 2), x3 = _d[0], y3 = _d[1], _e = __read(_a[3], 2), x4 = _e[0], y4 = _e[1];\r\n var _f = __read(calculatePosition(matrix, origin, n), 2), originX = _f[0], originY = _f[1];\r\n var left = Math.min(x1, x2, x3, x4);\r\n var top = Math.min(y1, y2, y3, y4);\r\n var right = Math.max(x1, x2, x3, x4);\r\n var bottom = Math.max(y1, y2, y3, y4);\r\n x1 = (x1 - left) || 0;\r\n x2 = (x2 - left) || 0;\r\n x3 = (x3 - left) || 0;\r\n x4 = (x4 - left) || 0;\r\n y1 = (y1 - top) || 0;\r\n y2 = (y2 - top) || 0;\r\n y3 = (y3 - top) || 0;\r\n y4 = (y4 - top) || 0;\r\n originX = (originX - left) || 0;\r\n originY = (originY - top) || 0;\r\n var sx = matrix[0];\r\n var sy = matrix[n + 1];\r\n var direction = sign(sx * sy);\r\n return {\r\n left: left,\r\n top: top,\r\n right: right,\r\n bottom: bottom,\r\n origin: [originX, originY],\r\n pos1: [x1, y1],\r\n pos2: [x2, y2],\r\n pos3: [x3, y3],\r\n pos4: [x4, y4],\r\n direction: direction,\r\n };\r\n}\n\nfunction calculatePointerDist(moveable, e) {\r\n var clientX = e.clientX, clientY = e.clientY, datas = e.datas;\r\n var _a = moveable.state, moveableClientRect = _a.moveableClientRect, rootMatrix = _a.rootMatrix, is3d = _a.is3d, pos1 = _a.pos1;\r\n var left = moveableClientRect.left, top = moveableClientRect.top;\r\n var n = is3d ? 4 : 3;\r\n var _b = __read(minus(calculateInversePosition(rootMatrix, [clientX - left, clientY - top], n), pos1), 2), posX = _b[0], posY = _b[1];\r\n var _c = __read(getDragDist({ datas: datas, distX: posX, distY: posY }), 2), distX = _c[0], distY = _c[1];\r\n return [distX, distY];\r\n}\r\nfunction setDragStart(moveable, _a) {\r\n var datas = _a.datas;\r\n var _b = moveable.state, allMatrix = _b.allMatrix, beforeMatrix = _b.beforeMatrix, is3d = _b.is3d, left = _b.left, top = _b.top, origin = _b.origin, offsetMatrix = _b.offsetMatrix, targetMatrix = _b.targetMatrix, transformOrigin = _b.transformOrigin;\r\n var n = is3d ? 4 : 3;\r\n datas.is3d = is3d;\r\n datas.matrix = allMatrix;\r\n datas.targetMatrix = targetMatrix;\r\n datas.beforeMatrix = beforeMatrix;\r\n datas.offsetMatrix = offsetMatrix;\r\n datas.transformOrigin = transformOrigin;\r\n datas.inverseMatrix = invert(allMatrix, n);\r\n datas.inverseBeforeMatrix = invert(beforeMatrix, n);\r\n datas.absoluteOrigin = convertPositionMatrix(plus([left, top], origin), n);\r\n datas.startDragBeforeDist = calculate(datas.inverseBeforeMatrix, datas.absoluteOrigin, n);\r\n datas.startDragDist = calculate(datas.inverseMatrix, datas.absoluteOrigin, n);\r\n}\r\nfunction getTransformDirection(e) {\r\n return calculateElementPosition(e.datas.beforeTransform, [50, 50], 100, 100).direction;\r\n}\r\nfunction resolveTransformEvent(moveable, event, functionName) {\r\n var datas = event.datas, originalDatas = event.originalDatas.beforeRenderable;\r\n var index = datas.transformIndex;\r\n var nextTransforms = originalDatas.nextTransforms;\r\n var length = nextTransforms.length;\r\n var nextTransformAppendedIndexes = originalDatas.nextTransformAppendedIndexes;\r\n var nextIndex = -1;\r\n if (index === -1) {\r\n // translate => rotate => scale\r\n if (functionName === \"translate\") {\r\n nextIndex = 0;\r\n }\r\n else if (functionName === \"rotate\") {\r\n nextIndex = findIndex(nextTransforms, function (text) { return text.match(/scale\\(/g); });\r\n }\r\n if (nextIndex === -1) {\r\n nextIndex = nextTransforms.length;\r\n }\r\n datas.transformIndex = nextIndex;\r\n }\r\n else if (find(nextTransformAppendedIndexes, function (info) { return info.index === index && info.functionName === functionName; })) {\r\n nextIndex = index;\r\n }\r\n else {\r\n nextIndex = index + nextTransformAppendedIndexes.filter(function (info) { return info.index < index; }).length;\r\n }\r\n var result = convertTransformInfo(nextTransforms, moveable.state, nextIndex);\r\n var targetFunction = result.targetFunction;\r\n var matFunctionName = functionName === \"rotate\" ? \"rotateZ\" : functionName;\r\n datas.beforeFunctionTexts = result.beforeFunctionTexts;\r\n datas.afterFunctionTexts = result.afterFunctionTexts;\r\n datas.beforeTransform = result.beforeFunctionMatrix;\r\n datas.beforeTransform2 = result.beforeFunctionMatrix2;\r\n datas.targetTansform = result.targetFunctionMatrix;\r\n datas.afterTransform = result.afterFunctionMatrix;\r\n datas.afterTransform2 = result.afterFunctionMatrix2;\r\n datas.targetAllTransform = result.allFunctionMatrix;\r\n if (targetFunction.functionName === matFunctionName) {\r\n datas.afterFunctionTexts.splice(0, 1);\r\n datas.isAppendTransform = false;\r\n }\r\n else if (length > nextIndex) {\r\n datas.isAppendTransform = true;\r\n originalDatas.nextTransformAppendedIndexes = __spreadArray(__spreadArray([], __read(nextTransformAppendedIndexes), false), [{\r\n functionName: functionName,\r\n index: nextIndex,\r\n isAppend: true,\r\n }], false);\r\n }\r\n}\r\nfunction convertTransformFormat(datas, value, dist) {\r\n return \"\".concat(datas.beforeFunctionTexts.join(\" \"), \" \").concat(datas.isAppendTransform ? dist : value, \" \").concat(datas.afterFunctionTexts.join(\" \"));\r\n}\r\nfunction getTransformDist(_a) {\r\n var datas = _a.datas, distX = _a.distX, distY = _a.distY;\r\n var _b = __read(getBeforeDragDist({ datas: datas, distX: distX, distY: distY }), 2), bx = _b[0], by = _b[1];\r\n // B * [tx, ty] * A = [bx, by] * targetMatrix;\r\n // [tx, ty] = B-1 * [bx, by] * targetMatrix * A-1 * [0, 0];\r\n var res = getTransfromMatrix(datas, fromTranslation([bx, by], 4));\r\n return calculate(res, convertPositionMatrix([0, 0, 0], 4), 4);\r\n}\r\nfunction getTransfromMatrix(datas, targetMatrix, isAfter) {\r\n var beforeTransform = datas.beforeTransform, afterTransform = datas.afterTransform, beforeTransform2 = datas.beforeTransform2, afterTransform2 = datas.afterTransform2, targetAllTransform = datas.targetAllTransform;\r\n // B * afterTargetMatrix * A = (targetMatrix * targetAllTransform)\r\n // afterTargetMatrix = B-1 * targetMatrix * targetAllTransform * A-1\r\n // nextTargetMatrix = (targetMatrix * targetAllTransform)\r\n var nextTargetMatrix = isAfter\r\n ? multiply(targetAllTransform, targetMatrix, 4)\r\n : multiply(targetMatrix, targetAllTransform, 4);\r\n // res1 = B-1 * nextTargetMatrix\r\n var res1 = multiply(invert(isAfter ? beforeTransform2 : beforeTransform, 4), nextTargetMatrix, 4);\r\n // res3 = res2 * A-1\r\n var afterTargetMatrix = multiply(res1, invert(isAfter ? afterTransform2 : afterTransform, 4), 4);\r\n return afterTargetMatrix;\r\n}\r\nfunction getBeforeDragDist(_a) {\r\n var datas = _a.datas, distX = _a.distX, distY = _a.distY;\r\n // TT = BT\r\n var inverseBeforeMatrix = datas.inverseBeforeMatrix, is3d = datas.is3d, startDragBeforeDist = datas.startDragBeforeDist, absoluteOrigin = datas.absoluteOrigin;\r\n var n = is3d ? 4 : 3;\r\n // ABS_ORIGIN * [distX, distY] = BM * (ORIGIN + [tx, ty])\r\n // BM -1 * ABS_ORIGIN * [distX, distY] - ORIGIN = [tx, ty]\r\n return minus(calculate(inverseBeforeMatrix, plus(absoluteOrigin, [distX, distY]), n), startDragBeforeDist);\r\n}\r\nfunction getDragDist(_a, isBefore) {\r\n var datas = _a.datas, distX = _a.distX, distY = _a.distY;\r\n var inverseBeforeMatrix = datas.inverseBeforeMatrix, inverseMatrix = datas.inverseMatrix, is3d = datas.is3d, startDragBeforeDist = datas.startDragBeforeDist, startDragDist = datas.startDragDist, absoluteOrigin = datas.absoluteOrigin;\r\n var n = is3d ? 4 : 3;\r\n return minus(calculate(isBefore ? inverseBeforeMatrix : inverseMatrix, plus(absoluteOrigin, [distX, distY]), n), isBefore ? startDragBeforeDist : startDragDist);\r\n}\r\nfunction getInverseDragDist(_a, isBefore) {\r\n var datas = _a.datas, distX = _a.distX, distY = _a.distY;\r\n var beforeMatrix = datas.beforeMatrix, matrix = datas.matrix, is3d = datas.is3d, startDragBeforeDist = datas.startDragBeforeDist, startDragDist = datas.startDragDist, absoluteOrigin = datas.absoluteOrigin;\r\n var n = is3d ? 4 : 3;\r\n return minus(calculate(isBefore ? beforeMatrix : matrix, plus(isBefore ? startDragBeforeDist : startDragDist, [distX, distY]), n), absoluteOrigin);\r\n}\r\nfunction calculateTransformOrigin(transformOrigin, width, height, prevWidth, prevHeight, prevOrigin) {\r\n if (prevWidth === void 0) { prevWidth = width; }\r\n if (prevHeight === void 0) { prevHeight = height; }\r\n if (prevOrigin === void 0) { prevOrigin = [0, 0]; }\r\n if (!transformOrigin) {\r\n return prevOrigin;\r\n }\r\n return transformOrigin.map(function (pos, i) {\r\n var _a = splitUnit(pos), value = _a.value, unit = _a.unit;\r\n var prevSize = (i ? prevHeight : prevWidth);\r\n var size = (i ? height : width);\r\n if (pos === \"%\" || isNaN(value)) {\r\n // no value but %\r\n var measureRatio = prevSize ? prevOrigin[i] / prevSize : 0;\r\n return size * measureRatio;\r\n }\r\n else if (unit !== \"%\") {\r\n return value;\r\n }\r\n return size * value / 100;\r\n });\r\n}\r\nfunction getPosIndexesByDirection(direction) {\r\n var indexes = [];\r\n if (direction[1] >= 0) {\r\n if (direction[0] >= 0) {\r\n indexes.push(3);\r\n }\r\n if (direction[0] <= 0) {\r\n indexes.push(2);\r\n }\r\n }\r\n if (direction[1] <= 0) {\r\n if (direction[0] >= 0) {\r\n indexes.push(1);\r\n }\r\n if (direction[0] <= 0) {\r\n indexes.push(0);\r\n }\r\n }\r\n return indexes;\r\n}\r\nfunction getPosesByDirection(poses, direction) {\r\n /*\r\n [-1, -1](pos1) [0, -1](pos1,pos2) [1, -1](pos2)\r\n [-1, 0](pos1, pos3) [1, 0](pos2, pos4)\r\n [-1, 1](pos3) [0, 1](pos3, pos4) [1, 1](pos4)\r\n */\r\n return getPosIndexesByDirection(direction).map(function (index) { return poses[index]; });\r\n}\r\nfunction getPosByDirection(poses, direction) {\r\n var xRatio = (direction[0] + 1) / 2;\r\n var yRatio = (direction[1] + 1) / 2;\r\n var top = [\r\n dot(poses[0][0], poses[1][0], xRatio, 1 - xRatio),\r\n dot(poses[0][1], poses[1][1], xRatio, 1 - xRatio),\r\n ];\r\n var bottom = [\r\n dot(poses[2][0], poses[3][0], xRatio, 1 - xRatio),\r\n dot(poses[2][1], poses[3][1], xRatio, 1 - xRatio),\r\n ];\r\n return [\r\n dot(top[0], bottom[0], yRatio, 1 - yRatio),\r\n dot(top[1], bottom[1], yRatio, 1 - yRatio),\r\n ];\r\n}\r\nfunction getDist(startPos, matrix, width, height, n, fixedDirection) {\r\n var poses = calculatePoses(matrix, width, height, n);\r\n var fixedPos = getPosByDirection(poses, fixedDirection);\r\n var distX = startPos[0] - fixedPos[0];\r\n var distY = startPos[1] - fixedPos[1];\r\n return [distX, distY];\r\n}\r\nfunction getNextMatrix(offsetMatrix, targetMatrix, origin, n) {\r\n return multiply(offsetMatrix, getAbsoluteMatrix(targetMatrix, n, origin), n);\r\n}\r\nfunction getNextTransformMatrix(state, datas, transform, isAllTransform) {\r\n var transformOrigin = state.transformOrigin, offsetMatrix = state.offsetMatrix, is3d = state.is3d;\r\n var n = is3d ? 4 : 3;\r\n var targetTransform;\r\n if (isString(transform)) {\r\n var beforeTransform = datas.beforeTransform, afterTransform = datas.afterTransform;\r\n if (isAllTransform) {\r\n targetTransform = convertDimension(parseMat(transform), 4, n);\r\n }\r\n else {\r\n targetTransform = convertDimension(multiply(multiply(beforeTransform, parseMat([transform]), 4), afterTransform, 4), 4, n);\r\n }\r\n }\r\n else {\r\n targetTransform = transform;\r\n }\r\n return getNextMatrix(offsetMatrix, targetTransform, transformOrigin, n);\r\n}\r\nfunction scaleMatrix(state, scale) {\r\n var transformOrigin = state.transformOrigin, offsetMatrix = state.offsetMatrix, is3d = state.is3d, targetMatrix = state.targetMatrix, targetAllTransform = state.targetAllTransform;\r\n var n = is3d ? 4 : 3;\r\n return getNextMatrix(offsetMatrix, multiply(targetAllTransform || targetMatrix, createScaleMatrix(scale, n), n), transformOrigin, n);\r\n}\r\nfunction fillTransformStartEvent(moveable, e) {\r\n var originalDatas = getBeforeRenderableDatas(e);\r\n return {\r\n setTransform: function (transform, index) {\r\n if (index === void 0) { index = -1; }\r\n originalDatas.startTransforms = isArray(transform) ? transform : splitSpace(transform);\r\n setTransformIndex(moveable, e, index);\r\n },\r\n setTransformIndex: function (index) {\r\n setTransformIndex(moveable, e, index);\r\n },\r\n };\r\n}\r\nfunction setDefaultTransformIndex(moveable, e, property) {\r\n var originalDatas = getBeforeRenderableDatas(e);\r\n var startTransforms = originalDatas.startTransforms;\r\n setTransformIndex(moveable, e, findIndex(startTransforms, function (func) { return func.indexOf(\"\".concat(property, \"(\")) === 0; }));\r\n}\r\nfunction setTransformIndex(moveable, e, index) {\r\n var originalDatas = getBeforeRenderableDatas(e);\r\n var datas = e.datas;\r\n datas.transformIndex = index;\r\n if (index === -1) {\r\n return;\r\n }\r\n var transform = originalDatas.startTransforms[index];\r\n if (!transform) {\r\n return;\r\n }\r\n var state = moveable.state;\r\n var info = parse([transform], {\r\n \"x%\": function (v) { return v / 100 * state.offsetWidth; },\r\n \"y%\": function (v) { return v / 100 * state.offsetHeight; },\r\n });\r\n datas.startValue = info[0].functionValue;\r\n}\r\nfunction fillOriginalTransform(e, transform) {\r\n var originalDatas = getBeforeRenderableDatas(e);\r\n originalDatas.nextTransforms = splitSpace(transform);\r\n // originalDatas.nextTargetMatrix = parseMat(transform);\r\n}\r\nfunction getBeforeRenderableDatas(e) {\r\n return e.originalDatas.beforeRenderable;\r\n}\r\nfunction getNextTransforms(e) {\r\n var originalDatas = e.originalDatas.beforeRenderable;\r\n return originalDatas.nextTransforms;\r\n}\r\nfunction getNextTransformText(e) {\r\n return (getNextTransforms(e) || []).join(\" \");\r\n}\r\nfunction getNextStyle(e) {\r\n return getBeforeRenderableDatas(e).nextStyle;\r\n}\r\nfunction fillTransformEvent(moveable, nextTransform, delta, isPinch, e) {\r\n fillOriginalTransform(e, nextTransform);\r\n var drag = Draggable.drag(moveable, setCustomDrag(e, moveable.state, delta, isPinch, false));\r\n var afterTransform = drag ? drag.transform : nextTransform;\r\n return __assign(__assign({ transform: nextTransform, drag: drag }, fillCSSObject({\r\n transform: afterTransform,\r\n }, e)), { afterTransform: afterTransform });\r\n}\r\nfunction getTranslateFixedPosition(moveable, transform, fixedDirection, fixedOffset, datas, isAllTransform) {\r\n var nextMatrix = getNextTransformMatrix(moveable.state, datas, transform, isAllTransform);\r\n var nextFixedPosition = getDirectionOffset(moveable, fixedDirection, fixedOffset, nextMatrix);\r\n return nextFixedPosition;\r\n}\r\nfunction getTranslateDist(moveable, transform, fixedDirection, fixedPosition, fixedOffset, datas, isAllTransform) {\r\n var nextFixedPosition = getTranslateFixedPosition(moveable, transform, fixedDirection, fixedOffset, datas, isAllTransform);\r\n var state = moveable.state;\r\n var left = state.left, top = state.top;\r\n var groupable = moveable.props.groupable;\r\n var groupLeft = groupable ? left : 0;\r\n var groupTop = groupable ? top : 0;\r\n var dist = minus(fixedPosition, nextFixedPosition);\r\n return minus(dist, [groupLeft, groupTop]);\r\n}\r\nfunction getScaleDist(moveable, transform, fixedDirection, fixedPosition, fixedOffset, datas, isAllTransform) {\r\n var dist = getTranslateDist(moveable, transform, fixedDirection, fixedPosition, fixedOffset, datas, isAllTransform);\r\n return dist;\r\n}\r\nfunction getDirectionByPos(pos, width, height) {\r\n return [\r\n width ? -1 + pos[0] / (width / 2) : 0,\r\n height ? -1 + pos[1] / (height / 2) : 0,\r\n ];\r\n}\r\nfunction getDirectionOffset(moveable, fixedDirection, fixedOffset, nextMatrix) {\r\n if (nextMatrix === void 0) { nextMatrix = moveable.state.allMatrix; }\r\n var _a = moveable.state, width = _a.width, height = _a.height, is3d = _a.is3d;\r\n var n = is3d ? 4 : 3;\r\n var fixedOffsetPosition = [\r\n width / 2 * (1 + fixedDirection[0]) + fixedOffset[0],\r\n height / 2 * (1 + fixedDirection[1]) + fixedOffset[1],\r\n ];\r\n return calculatePosition(nextMatrix, fixedOffsetPosition, n);\r\n}\r\nfunction getRotateDist(moveable, rotateDist, datas) {\r\n var fixedDirection = datas.fixedDirection;\r\n var fixedPosition = datas.fixedPosition;\r\n var fixedOffset = datas.fixedOffset;\r\n return getTranslateDist(moveable, \"rotate(\".concat(rotateDist, \"deg)\"), fixedDirection, fixedPosition, fixedOffset, datas);\r\n}\r\nfunction getResizeDist(moveable, width, height, fixedPosition, transformOrigin, datas) {\r\n var groupable = moveable.props.groupable;\r\n var state = moveable.state;\r\n var prevOrigin = state.transformOrigin, offsetMatrix = state.offsetMatrix, is3d = state.is3d, prevWidth = state.width, prevHeight = state.height, left = state.left, top = state.top;\r\n var fixedDirection = datas.fixedDirection;\r\n var targetMatrix = datas.nextTargetMatrix || state.targetMatrix;\r\n var n = is3d ? 4 : 3;\r\n var nextOrigin = calculateTransformOrigin(transformOrigin, width, height, prevWidth, prevHeight, prevOrigin);\r\n var groupLeft = groupable ? left : 0;\r\n var groupTop = groupable ? top : 0;\r\n var nextMatrix = getNextMatrix(offsetMatrix, targetMatrix, nextOrigin, n);\r\n var dist = getDist(fixedPosition, nextMatrix, width, height, n, fixedDirection);\r\n return minus(dist, [groupLeft, groupTop]);\r\n}\r\nfunction getAbsolutePosition(moveable, direction) {\r\n return getPosByDirection(getAbsolutePosesByState(moveable.state), direction);\r\n}\n\nfunction getGestoData(moveable, ableName) {\r\n var targetGesto = moveable.targetGesto;\r\n var controlGesto = moveable.controlGesto;\r\n var data;\r\n if (targetGesto === null || targetGesto === void 0 ? void 0 : targetGesto.isFlag()) {\r\n data = targetGesto.getEventData()[ableName];\r\n }\r\n if (!data && (controlGesto === null || controlGesto === void 0 ? void 0 : controlGesto.isFlag())) {\r\n data = controlGesto.getEventData()[ableName];\r\n }\r\n return data || {};\r\n}\n\nfunction getShadowRoot(parentElement) {\r\n if (parentElement && parentElement.getRootNode) {\r\n var rootNode = parentElement.getRootNode();\r\n if (rootNode.nodeType === 11) {\r\n return rootNode;\r\n }\r\n }\r\n return;\r\n}\r\nfunction getIndividualTransforms(getStyle) {\r\n var scale = getStyle(\"scale\");\r\n var rotate = getStyle(\"rotate\");\r\n var translate = getStyle(\"translate\");\r\n var individualTransforms = [];\r\n if (translate && translate !== \"0px\" && translate !== \"none\") {\r\n individualTransforms.push(\"translate(\".concat(translate.split(/\\s+/).join(\",\"), \")\"));\r\n }\r\n if (rotate && rotate !== \"1\" && rotate !== \"none\") {\r\n individualTransforms.push(\"rotate(\".concat(rotate, \")\"));\r\n }\r\n if (scale && scale !== \"1\" && scale !== \"none\") {\r\n individualTransforms.push(\"scale(\".concat(scale.split(/\\s+/).join(\",\"), \")\"));\r\n }\r\n return individualTransforms;\r\n}\r\nfunction getMatrixStackInfo(target, container, checkContainer) {\r\n var el = target;\r\n var matrixes = [];\r\n var documentElement = getDocumentElement(target) || getDocumentBody(target);\r\n var requestEnd = !checkContainer && target === container || target === documentElement;\r\n var isEnd = requestEnd;\r\n var is3d = false;\r\n var n = 3;\r\n var transformOrigin;\r\n var targetTransformOrigin;\r\n var targetMatrix;\r\n var hasFixed = false;\r\n var offsetContainer = getOffsetInfo(container, container, true).offsetParent;\r\n var zoom = 1;\r\n while (el && !isEnd) {\r\n isEnd = requestEnd;\r\n var getStyle = getCachedStyle(el);\r\n var position = getStyle(\"position\");\r\n var transform = getElementTransform(el);\r\n var isFixed = position === \"fixed\";\r\n var individualTransforms = getIndividualTransforms(getStyle);\r\n var matrix = convertCSStoMatrix(getTransformMatrix(transform));\r\n var offsetParent = void 0;\r\n var isOffsetEnd = false;\r\n var isStatic = false;\r\n var parentClientLeft = 0;\r\n var parentClientTop = 0;\r\n var fixedClientLeft = 0;\r\n var fixedClientTop = 0;\r\n var fixedInfo = {\r\n hasTransform: false,\r\n fixedContainer: null,\r\n };\r\n if (isFixed) {\r\n hasFixed = true;\r\n fixedInfo = getPositionFixedInfo(el);\r\n offsetContainer = fixedInfo.fixedContainer;\r\n }\r\n // convert 3 to 4\r\n var length_1 = matrix.length;\r\n if (!is3d && (length_1 === 16 || individualTransforms.length)) {\r\n is3d = true;\r\n n = 4;\r\n convert3DMatrixes(matrixes);\r\n if (targetMatrix) {\r\n targetMatrix = convertDimension(targetMatrix, 3, 4);\r\n }\r\n }\r\n if (is3d && length_1 === 9) {\r\n matrix = convertDimension(matrix, 3, 4);\r\n }\r\n var _a = getOffsetPosInfo(el, target), tagName = _a.tagName, hasOffset = _a.hasOffset, isSVG = _a.isSVG, origin_1 = _a.origin, targetOrigin = _a.targetOrigin, offsetPos = _a.offset;\r\n var _b = __read(offsetPos, 2), offsetLeft = _b[0], offsetTop = _b[1];\r\n if (tagName === \"svg\" && targetMatrix) {\r\n // scale matrix for svg's SVGElements.\r\n matrixes.push({\r\n type: \"target\",\r\n target: el,\r\n matrix: getSVGMatrix(el, n),\r\n });\r\n matrixes.push({\r\n type: \"offset\",\r\n target: el,\r\n matrix: createIdentityMatrix(n),\r\n });\r\n }\r\n var targetZoom = parseFloat(getStyle(\"zoom\")) || 1;\r\n if (isFixed) {\r\n offsetParent = fixedInfo.fixedContainer;\r\n isOffsetEnd = true;\r\n }\r\n else {\r\n var offsetInfo = getOffsetInfo(el, container, false, true, getStyle);\r\n var offsetZoom = offsetInfo.offsetZoom;\r\n offsetParent = offsetInfo.offsetParent;\r\n isOffsetEnd = offsetInfo.isEnd;\r\n isStatic = offsetInfo.isStatic;\r\n zoom *= offsetZoom;\r\n if ((offsetInfo.isCustomElement || offsetZoom !== 1) && isStatic) {\r\n offsetLeft -= offsetParent.offsetLeft;\r\n offsetTop -= offsetParent.offsetTop;\r\n }\r\n else if (IS_FIREFOX || IS_CHROMIUM109) {\r\n var parentSlotElement = offsetInfo.parentSlotElement;\r\n if (parentSlotElement) {\r\n var customOffsetParent = offsetParent;\r\n var customOffsetLeft = 0;\r\n var customOffsetTop = 0;\r\n while (customOffsetParent) {\r\n if (!getShadowRoot(customOffsetParent)) {\r\n break;\r\n }\r\n customOffsetLeft += customOffsetParent.offsetLeft;\r\n customOffsetTop += customOffsetParent.offsetTop;\r\n customOffsetParent = customOffsetParent.offsetParent;\r\n }\r\n offsetLeft -= customOffsetLeft;\r\n offsetTop -= customOffsetTop;\r\n }\r\n }\r\n }\r\n if (IS_WEBKIT && !IS_SAFARI_ABOVE15\r\n && hasOffset && !isSVG && isStatic\r\n && (position === \"relative\" || position === \"static\")) {\r\n offsetLeft -= offsetParent.offsetLeft;\r\n offsetTop -= offsetParent.offsetTop;\r\n requestEnd = requestEnd || isOffsetEnd;\r\n }\r\n if (isFixed) {\r\n if (hasOffset && fixedInfo.hasTransform) {\r\n // border\r\n fixedClientLeft = offsetParent.clientLeft;\r\n fixedClientTop = offsetParent.clientTop;\r\n }\r\n }\r\n else {\r\n if (hasOffset && offsetContainer !== offsetParent) {\r\n // border\r\n parentClientLeft = offsetParent.clientLeft;\r\n parentClientTop = offsetParent.clientTop;\r\n }\r\n if (hasOffset && offsetParent === documentElement) {\r\n var margin = getBodyOffset(el, false);\r\n offsetLeft += margin[0];\r\n offsetTop += margin[1];\r\n }\r\n }\r\n matrixes.push({\r\n type: \"target\",\r\n target: el,\r\n matrix: getAbsoluteMatrix(matrix, n, origin_1),\r\n });\r\n if (individualTransforms.length) {\r\n matrixes.push({\r\n type: \"offset\",\r\n target: el,\r\n matrix: createIdentityMatrix(n),\r\n });\r\n matrixes.push({\r\n type: \"target\",\r\n target: el,\r\n matrix: getAbsoluteMatrix(parseMat(individualTransforms), n, origin_1),\r\n });\r\n }\r\n if (hasOffset) {\r\n var isElementTarget = el === target;\r\n var scrollLeft = isElementTarget ? 0 : el.scrollLeft;\r\n var scrollTop = isElementTarget ? 0 : el.scrollTop;\r\n matrixes.push({\r\n type: \"offset\",\r\n target: el,\r\n matrix: createOriginMatrix([\r\n offsetLeft - scrollLeft + parentClientLeft - fixedClientLeft,\r\n offsetTop - scrollTop + parentClientTop - fixedClientTop,\r\n ], n),\r\n });\r\n }\r\n else {\r\n // svg\r\n matrixes.push({\r\n type: \"offset\",\r\n target: el,\r\n origin: origin_1,\r\n });\r\n }\r\n // transform으로 계산되지 않는 zoom을 위한 (0, 0) 을 기준 matrix 추가.\r\n if (targetZoom !== 1) {\r\n matrixes.push({\r\n type: \"zoom\",\r\n target: el,\r\n matrix: getAbsoluteMatrix(createScaleMatrix([targetZoom, targetZoom], n), n, [0, 0]),\r\n });\r\n }\r\n if (!targetMatrix) {\r\n targetMatrix = matrix;\r\n }\r\n if (!transformOrigin) {\r\n transformOrigin = origin_1;\r\n }\r\n if (!targetTransformOrigin) {\r\n targetTransformOrigin = targetOrigin;\r\n }\r\n if (isEnd || isFixed) {\r\n break;\r\n }\r\n else {\r\n el = offsetParent;\r\n requestEnd = isOffsetEnd;\r\n }\r\n if (!checkContainer || el === documentElement) {\r\n isEnd = requestEnd;\r\n }\r\n }\r\n if (!targetMatrix) {\r\n targetMatrix = createIdentityMatrix(n);\r\n }\r\n if (!transformOrigin) {\r\n transformOrigin = [0, 0];\r\n }\r\n if (!targetTransformOrigin) {\r\n targetTransformOrigin = [0, 0];\r\n }\r\n return {\r\n zoom: zoom,\r\n offsetContainer: offsetContainer,\r\n matrixes: matrixes,\r\n targetMatrix: targetMatrix,\r\n transformOrigin: transformOrigin,\r\n targetOrigin: targetTransformOrigin,\r\n is3d: is3d,\r\n hasFixed: hasFixed,\r\n };\r\n}\n\nvar cacheStyleMap = null;\r\nvar clientRectStyleMap = null;\r\nvar matrixContainerInfos = null;\r\nfunction setStoreCache(useCache) {\r\n if (useCache) {\r\n if (window.Map) {\r\n cacheStyleMap = new Map();\r\n clientRectStyleMap = new Map();\r\n }\r\n matrixContainerInfos = [];\r\n }\r\n else {\r\n cacheStyleMap = null;\r\n matrixContainerInfos = null;\r\n clientRectStyleMap = null;\r\n }\r\n}\r\nfunction getCachedClientRect(el) {\r\n var clientRect = clientRectStyleMap === null || clientRectStyleMap === void 0 ? void 0 : clientRectStyleMap.get(el);\r\n if (clientRect) {\r\n return clientRect;\r\n }\r\n var nextClientRect = getClientRect(el, true);\r\n if (clientRectStyleMap) {\r\n clientRectStyleMap.set(el, nextClientRect);\r\n }\r\n return nextClientRect;\r\n}\r\nfunction getCachedMatrixContainerInfo(target, container) {\r\n if (matrixContainerInfos) {\r\n var result_1 = find(matrixContainerInfos, function (info) { return info[0][0] == target && info[0][1] == container; });\r\n if (result_1) {\r\n return result_1[1];\r\n }\r\n }\r\n var result = getMatrixStackInfo(target, container, true);\r\n if (matrixContainerInfos) {\r\n matrixContainerInfos.push([[target, container], result]);\r\n }\r\n return result;\r\n}\r\nfunction getCachedStyle(element) {\r\n var cache = cacheStyleMap === null || cacheStyleMap === void 0 ? void 0 : cacheStyleMap.get(element);\r\n if (!cache) {\r\n var nextStyle_1 = getWindow(element).getComputedStyle(element);\r\n if (!cacheStyleMap) {\r\n return function (property) {\r\n return nextStyle_1[property];\r\n };\r\n }\r\n cache = {\r\n style: nextStyle_1,\r\n cached: {},\r\n };\r\n cacheStyleMap.set(element, cache);\r\n }\r\n var cached = cache.cached;\r\n var style = cache.style;\r\n return function (property) {\r\n if (!(property in cached)) {\r\n cached[property] = style[property];\r\n }\r\n return cached[property];\r\n };\r\n}\n\nfunction fillChildEvents(moveable, name, e) {\r\n var datas = e.originalDatas;\r\n datas.groupable = datas.groupable || {};\r\n var groupableDatas = datas.groupable;\r\n groupableDatas.childDatas = groupableDatas.childDatas || [];\r\n var childDatas = groupableDatas.childDatas;\r\n return moveable.moveables.map(function (_, i) {\r\n childDatas[i] = childDatas[i] || {};\r\n childDatas[i][name] = childDatas[i][name] || {};\r\n return __assign(__assign({}, e), { isRequestChild: true, datas: childDatas[i][name], originalDatas: childDatas[i] });\r\n });\r\n}\r\nfunction triggerChildGesto(moveable, able, type, delta, e, isConvert, ableName) {\r\n var isStart = !!type.match(/Start$/g);\r\n var isEnd = !!type.match(/End$/g);\r\n var isPinch = e.isPinch;\r\n var datas = e.datas;\r\n var events = fillChildEvents(moveable, able.name, e);\r\n var moveables = moveable.moveables;\r\n var childs = events.map(function (ev, i) {\r\n var childMoveable = moveables[i];\r\n var state = childMoveable.state;\r\n var gestos = state.gestos;\r\n var childEvent = ev;\r\n if (isStart) {\r\n childEvent = new CustomGesto(ableName).dragStart(delta, ev);\r\n }\r\n else {\r\n if (!gestos[ableName]) {\r\n gestos[ableName] = datas.childGestos[i];\r\n }\r\n if (!gestos[ableName]) {\r\n return;\r\n }\r\n childEvent = setCustomDrag(ev, state, delta, isPinch, isConvert, ableName);\r\n }\r\n var result = able[type](childMoveable, __assign(__assign({}, childEvent), { parentFlag: true }));\r\n if (isEnd) {\r\n gestos[ableName] = null;\r\n }\r\n return result;\r\n });\r\n if (isStart) {\r\n datas.childGestos = moveables.map(function (child) { return child.state.gestos[ableName]; });\r\n }\r\n return childs;\r\n}\r\nfunction triggerChildAbles(moveable, able, type, e, eachEvent, callback) {\r\n if (eachEvent === void 0) { eachEvent = function (_, ev) { return ev; }; }\r\n var isEnd = !!type.match(/End$/g);\r\n var events = fillChildEvents(moveable, able.name, e);\r\n var moveables = moveable.moveables;\r\n var childs = events.map(function (ev, i) {\r\n var childMoveable = moveables[i];\r\n var childEvent = ev;\r\n childEvent = eachEvent(childMoveable, ev);\r\n var result = able[type](childMoveable, __assign(__assign({}, childEvent), { parentFlag: true }));\r\n result && callback && callback(childMoveable, ev, result, i);\r\n if (isEnd) {\r\n childMoveable.state.gestos = {};\r\n }\r\n return result;\r\n });\r\n return childs;\r\n}\r\nfunction startChildDist(moveable, child, parentDatas, childEvent) {\r\n var fixedDirection = parentDatas.fixedDirection;\r\n var fixedPosition = parentDatas.fixedPosition;\r\n var startPositions = childEvent.datas.startPositions || getAbsolutePosesByState(child.state);\r\n var pos = getPosByDirection(startPositions, fixedDirection);\r\n var _a = __read(calculate(createRotateMatrix(-moveable.rotation / 180 * Math.PI, 3), [pos[0] - fixedPosition[0], pos[1] - fixedPosition[1], 1], 3), 2), originalX = _a[0], originalY = _a[1];\r\n childEvent.datas.originalX = originalX;\r\n childEvent.datas.originalY = originalY;\r\n return childEvent;\r\n}\n\nfunction renderDirectionControlsByInfos(moveable, ableName, renderDirections, React) {\r\n var _a = moveable.getState(), renderPoses = _a.renderPoses, rotationRad = _a.rotation, direction = _a.direction;\r\n var zoom = getProps(moveable.props, ableName).zoom;\r\n var degRotation = absDegree(rotationRad / Math.PI * 180);\r\n var directionMap = {};\r\n var renderState = moveable.renderState;\r\n if (!renderState.renderDirectionMap) {\r\n renderState.renderDirectionMap = {};\r\n }\r\n var renderDirectionMap = renderState.renderDirectionMap;\r\n renderDirections.forEach(function (_a) {\r\n var dir = _a.dir;\r\n directionMap[dir] = true;\r\n });\r\n var directionSign = sign(direction);\r\n return renderDirections.map(function (_a) {\r\n var data = _a.data, classNames = _a.classNames, dir = _a.dir;\r\n var indexes = DIRECTION_INDEXES[dir];\r\n if (!indexes || !directionMap[dir]) {\r\n return null;\r\n }\r\n renderDirectionMap[dir] = true;\r\n var directionRotation = (throttle(degRotation, 15) + directionSign * DIRECTION_ROTATIONS[dir] + 720) % 180;\r\n var dataAttrs = {};\r\n getKeys(data).forEach(function (name) {\r\n dataAttrs[\"data-\".concat(name)] = data[name];\r\n });\r\n return (React.createElement(\"div\", __assign({ className: prefix.apply(void 0, __spreadArray([\"control\", \"direction\", dir, ableName], __read(classNames), false)), \"data-rotation\": directionRotation, \"data-direction\": dir }, dataAttrs, { key: \"direction-\".concat(dir), style: getControlTransform.apply(void 0, __spreadArray([rotationRad, zoom], __read(indexes.map(function (index) { return renderPoses[index]; })), false)) })));\r\n });\r\n}\r\nfunction renderDirectionControls(moveable, defaultDirections, ableName, React) {\r\n var _a = getProps(moveable.props, ableName), _b = _a.renderDirections, directions = _b === void 0 ? defaultDirections : _b, displayAroundControls = _a.displayAroundControls;\r\n if (!directions) {\r\n return [];\r\n }\r\n var renderDirections = directions === true ? DIRECTIONS : directions;\r\n return __spreadArray(__spreadArray([], __read((displayAroundControls ? renderAroundControls(moveable, React, ableName, renderDirections) : [])), false), __read(renderDirectionControlsByInfos(moveable, ableName, renderDirections.map(function (dir) {\r\n return {\r\n data: {},\r\n classNames: [],\r\n dir: dir,\r\n };\r\n }), React)), false);\r\n}\r\nfunction renderLine(React, direction, pos1, pos2, zoom, key) {\r\n var classNames = [];\r\n for (var _i = 6; _i < arguments.length; _i++) {\r\n classNames[_i - 6] = arguments[_i];\r\n }\r\n var rad = getRad(pos1, pos2);\r\n var rotation = direction ? (throttle(rad / Math.PI * 180, 15)) % 180 : -1;\r\n return React.createElement(\"div\", { key: \"line-\".concat(key), className: prefix.apply(void 0, __spreadArray([\"line\", \"direction\", direction ? \"edge\" : \"\", direction], __read(classNames), false)), \"data-rotation\": rotation, \"data-line-key\": key, \"data-direction\": direction, style: getLineStyle(pos1, pos2, zoom, rad) });\r\n}\r\nfunction renderEdgeLines(React, ableName, edge, poses, zoom) {\r\n var directions = edge === true ? DIRECTIONS4 : edge;\r\n return directions.map(function (direction, i) {\r\n var _a = __read(DIRECTION_INDEXES[direction], 2), index1 = _a[0], index2 = _a[1];\r\n if (index2 == null) {\r\n return;\r\n }\r\n return renderLine(React, direction, poses[index1], poses[index2], zoom, \"\".concat(ableName, \"Edge\").concat(i), ableName);\r\n }).filter(Boolean);\r\n}\r\nfunction getRenderDirections(ableName) {\r\n return function (moveable, React) {\r\n var edge = getProps(moveable.props, ableName).edge;\r\n if (edge && (edge === true || edge.length)) {\r\n return __spreadArray(__spreadArray([], __read(renderEdgeLines(React, ableName, edge, moveable.getState().renderPoses, moveable.props.zoom)), false), __read(renderDiagonalDirections(moveable, ableName, React)), false);\r\n }\r\n return renderAllDirections(moveable, ableName, React);\r\n };\r\n}\r\nfunction renderAllDirections(moveable, ableName, React) {\r\n return renderDirectionControls(moveable, DIRECTIONS, ableName, React);\r\n}\r\nfunction renderDiagonalDirections(moveable, ableName, React) {\r\n return renderDirectionControls(moveable, [\"nw\", \"ne\", \"sw\", \"se\"], ableName, React);\r\n}\r\nfunction renderAroundControls(moveable, React, ableName, renderDirections) {\r\n var renderState = moveable.renderState;\r\n if (!renderState.renderDirectionMap) {\r\n renderState.renderDirectionMap = {};\r\n }\r\n var _a = moveable.getState(), renderPoses = _a.renderPoses, rotationRad = _a.rotation, direction = _a.direction;\r\n var renderDirectionMap = renderState.renderDirectionMap;\r\n var zoom = moveable.props.zoom;\r\n var directionSign = sign(direction);\r\n var degRotation = rotationRad / Math.PI * 180;\r\n return (renderDirections || getKeys(renderDirectionMap)).map(function (dir) {\r\n var indexes = DIRECTION_INDEXES[dir];\r\n if (!indexes) {\r\n return null;\r\n }\r\n var directionRotation = (throttle(degRotation, 15) + directionSign * DIRECTION_ROTATIONS[dir] + 720) % 180;\r\n var classNames = [\"around-control\"];\r\n if (ableName) {\r\n classNames.push(\"direction\", ableName);\r\n }\r\n return (React.createElement(\"div\", { className: prefix.apply(void 0, __spreadArray([], __read(classNames), false)), \"data-rotation\": directionRotation, \"data-direction\": dir, key: \"direction-around-\".concat(dir), style: getControlTransform.apply(void 0, __spreadArray([rotationRad, zoom], __read(indexes.map(function (index) { return renderPoses[index]; })), false)) }));\r\n });\r\n}\n\nfunction checkBoundPoses(bounds, verticalPoses, horizontalPoses) {\r\n var _a = bounds || {}, _b = _a.position, position = _b === void 0 ? \"client\" : _b, _c = _a.left, left = _c === void 0 ? -Infinity : _c, _d = _a.top, top = _d === void 0 ? -Infinity : _d, _e = _a.right, right = _e === void 0 ? Infinity : _e, _f = _a.bottom, bottom = _f === void 0 ? Infinity : _f;\r\n var nextBounds = {\r\n position: position,\r\n left: left,\r\n top: top,\r\n right: right,\r\n bottom: bottom,\r\n };\r\n return {\r\n vertical: checkBounds(nextBounds, verticalPoses, true),\r\n horizontal: checkBounds(nextBounds, horizontalPoses, false),\r\n };\r\n}\r\nfunction getBounds(moveable, externalBounds) {\r\n var _a = moveable.state, _b = _a.containerClientRect, containerHeight = _b.clientHeight, containerWidth = _b.clientWidth, clientLeft = _b.clientLeft, clientTop = _b.clientTop, _c = _a.snapOffset, snapOffsetLeft = _c.left, snapOffsetTop = _c.top, snapOffsetRight = _c.right, snapOffsetBottom = _c.bottom;\r\n var bounds = externalBounds || moveable.props.bounds || {};\r\n var position = bounds.position || \"client\";\r\n var isCSS = position === \"css\";\r\n var _d = bounds.left, left = _d === void 0 ? -Infinity : _d, _e = bounds.top, top = _e === void 0 ? -Infinity : _e;\r\n var _f = bounds.right, right = _f === void 0 ? isCSS ? -Infinity : Infinity : _f, _g = bounds.bottom, bottom = _g === void 0 ? isCSS ? -Infinity : Infinity : _g;\r\n if (isCSS) {\r\n right = containerWidth + snapOffsetRight - snapOffsetLeft - right;\r\n bottom = containerHeight + snapOffsetBottom - snapOffsetTop - bottom;\r\n }\r\n return {\r\n left: left + snapOffsetLeft - clientLeft,\r\n right: right + snapOffsetLeft - clientLeft,\r\n top: top + snapOffsetTop - clientTop,\r\n bottom: bottom + snapOffsetTop - clientTop,\r\n };\r\n}\r\nfunction checkBoundKeepRatio(moveable, startPos, endPos) {\r\n var _a = getBounds(moveable), left = _a.left, top = _a.top, right = _a.right, bottom = _a.bottom;\r\n var _b = __read(endPos, 2), endX = _b[0], endY = _b[1];\r\n var _c = __read(minus(endPos, startPos), 2), dx = _c[0], dy = _c[1];\r\n if (abs(dx) < TINY_NUM) {\r\n dx = 0;\r\n }\r\n if (abs(dy) < TINY_NUM) {\r\n dy = 0;\r\n }\r\n var isBottom = dy > 0;\r\n var isRight = dx > 0;\r\n var verticalInfo = {\r\n isBound: false,\r\n offset: 0,\r\n pos: 0,\r\n };\r\n var horizontalInfo = {\r\n isBound: false,\r\n offset: 0,\r\n pos: 0,\r\n };\r\n if (dx === 0 && dy === 0) {\r\n return {\r\n vertical: verticalInfo,\r\n horizontal: horizontalInfo,\r\n };\r\n }\r\n else if (dx === 0) {\r\n if (isBottom) {\r\n if (bottom < endY) {\r\n horizontalInfo.pos = bottom;\r\n horizontalInfo.offset = endY - bottom;\r\n }\r\n }\r\n else {\r\n if (top > endY) {\r\n horizontalInfo.pos = top;\r\n horizontalInfo.offset = endY - top;\r\n }\r\n }\r\n }\r\n else if (dy === 0) {\r\n if (isRight) {\r\n if (right < endX) {\r\n verticalInfo.pos = right;\r\n verticalInfo.offset = endX - right;\r\n }\r\n }\r\n else {\r\n if (left > endX) {\r\n verticalInfo.pos = left;\r\n verticalInfo.offset = endX - left;\r\n }\r\n }\r\n }\r\n else {\r\n // y - y1 = a * (x - x1)\r\n var a = dy / dx;\r\n var b = endPos[1] - a * endX;\r\n var y = 0;\r\n var x = 0;\r\n var isBound = false;\r\n if (isRight && right <= endX) {\r\n y = a * right + b;\r\n x = right;\r\n isBound = true;\r\n }\r\n else if (!isRight && endX <= left) {\r\n y = a * left + b;\r\n x = left;\r\n isBound = true;\r\n }\r\n if (isBound) {\r\n if (y < top || y > bottom) {\r\n isBound = false;\r\n }\r\n }\r\n if (!isBound) {\r\n if (isBottom && bottom <= endY) {\r\n y = bottom;\r\n x = (y - b) / a;\r\n isBound = true;\r\n }\r\n else if (!isBottom && endY <= top) {\r\n y = top;\r\n x = (y - b) / a;\r\n isBound = true;\r\n }\r\n }\r\n if (isBound) {\r\n verticalInfo.isBound = true;\r\n verticalInfo.pos = x;\r\n verticalInfo.offset = endX - x;\r\n horizontalInfo.isBound = true;\r\n horizontalInfo.pos = y;\r\n horizontalInfo.offset = endY - y;\r\n }\r\n }\r\n return {\r\n vertical: verticalInfo,\r\n horizontal: horizontalInfo,\r\n };\r\n}\r\nfunction checkBounds(bounds, poses, isVertical) {\r\n // 0 [100 - 200] 300\r\n var startBoundPos = bounds[isVertical ? \"left\" : \"top\"];\r\n var endBoundPos = bounds[isVertical ? \"right\" : \"bottom\"];\r\n // 450\r\n var minPos = Math.min.apply(Math, __spreadArray([], __read(poses), false));\r\n var maxPos = Math.max.apply(Math, __spreadArray([], __read(poses), false));\r\n var boundInfos = [];\r\n if (startBoundPos + 1 > minPos) {\r\n boundInfos.push({\r\n direction: \"start\",\r\n isBound: true,\r\n offset: minPos - startBoundPos,\r\n pos: startBoundPos,\r\n });\r\n }\r\n if (endBoundPos - 1 < maxPos) {\r\n boundInfos.push({\r\n direction: \"end\",\r\n isBound: true,\r\n offset: maxPos - endBoundPos,\r\n pos: endBoundPos,\r\n });\r\n }\r\n if (!boundInfos.length) {\r\n boundInfos.push({\r\n isBound: false,\r\n offset: 0,\r\n pos: 0,\r\n });\r\n }\r\n return boundInfos.sort(function (a, b) { return abs(b.offset) - abs(a.offset); });\r\n}\r\nfunction isBoundRotate$1(relativePoses, boundRect, rad) {\r\n var nextPoses = rad ? relativePoses.map(function (pos) { return rotate(pos, rad); }) : relativePoses;\r\n return nextPoses.some(function (pos) {\r\n return (pos[0] < boundRect.left && abs(pos[0] - boundRect.left) > 0.1)\r\n || (pos[0] > boundRect.right && abs(pos[0] - boundRect.right) > 0.1)\r\n || (pos[1] < boundRect.top && abs(pos[1] - boundRect.top) > 0.1)\r\n || (pos[1] > boundRect.bottom && abs(pos[1] - boundRect.bottom) > 0.1);\r\n });\r\n}\r\nfunction boundRotate(vec, boundPos, index) {\r\n var r = getDistSize(vec);\r\n var nextPos = Math.sqrt(r * r - boundPos * boundPos) || 0;\r\n return [nextPos, -nextPos].sort(function (a, b) {\r\n return abs(a - vec[index ? 0 : 1]) - abs(b - vec[index ? 0 : 1]);\r\n }).map(function (pos) {\r\n return getRad([0, 0], index ? [pos, boundPos] : [boundPos, pos]);\r\n });\r\n}\r\nfunction checkRotateBounds(moveable, prevPoses, nextPoses, origin, rotation) {\r\n if (!moveable.props.bounds) {\r\n return [];\r\n }\r\n var rad = rotation * Math.PI / 180;\r\n var _a = getBounds(moveable), left = _a.left, top = _a.top, right = _a.right, bottom = _a.bottom;\r\n var relativeLeft = left - origin[0];\r\n var relativeRight = right - origin[0];\r\n var relativeTop = top - origin[1];\r\n var relativeBottom = bottom - origin[1];\r\n var boundRect = {\r\n left: relativeLeft,\r\n top: relativeTop,\r\n right: relativeRight,\r\n bottom: relativeBottom,\r\n };\r\n if (!isBoundRotate$1(nextPoses, boundRect, 0)) {\r\n return [];\r\n }\r\n var result = [];\r\n [\r\n [relativeLeft, 0],\r\n [relativeRight, 0],\r\n [relativeTop, 1],\r\n [relativeBottom, 1],\r\n ].forEach(function (_a) {\r\n var _b = __read(_a, 2), boundPos = _b[0], index = _b[1];\r\n nextPoses.forEach(function (nextPos) {\r\n var relativeRad1 = getRad([0, 0], nextPos);\r\n result.push.apply(result, __spreadArray([], __read(boundRotate(nextPos, boundPos, index)\r\n .map(function (relativeRad2) { return rad + relativeRad2 - relativeRad1; })\r\n .filter(function (nextRad) { return !isBoundRotate$1(prevPoses, boundRect, nextRad); })\r\n .map(function (nextRad) { return throttle(nextRad * 180 / Math.PI, TINY_NUM); })), false));\r\n });\r\n });\r\n return result;\r\n}\n\nvar VERTICAL_NAMES = [\"left\", \"right\", \"center\"];\r\nvar HORIZONTAL_NAMES = [\"top\", \"bottom\", \"middle\"];\r\nvar SNAP_SKIP_NAMES_MAP = {\r\n \"left\": \"start\",\r\n \"right\": \"end\",\r\n \"center\": \"center\",\r\n \"top\": \"start\",\r\n \"bottom\": \"end\",\r\n \"middle\": \"center\",\r\n};\r\nvar VERTICAL_NAMES_MAP = {\r\n start: \"left\",\r\n end: \"right\",\r\n center: \"center\",\r\n};\r\nvar HORIZONTAL_NAMES_MAP = {\r\n start: \"top\",\r\n end: \"bottom\",\r\n center: \"middle\",\r\n};\r\nfunction getInitialBounds() {\r\n return {\r\n left: false,\r\n top: false,\r\n right: false,\r\n bottom: false,\r\n };\r\n}\r\nfunction hasGuidelines(moveable, ableName) {\r\n var _a = moveable.props, snappable = _a.snappable, bounds = _a.bounds, innerBounds = _a.innerBounds, verticalGuidelines = _a.verticalGuidelines, horizontalGuidelines = _a.horizontalGuidelines, snapGridWidth = _a.snapGridWidth, snapGridHeight = _a.snapGridHeight, _b = moveable.state, guidelines = _b.guidelines, enableSnap = _b.enableSnap;\r\n if (!snappable ||\r\n !enableSnap ||\r\n (ableName && snappable !== true && snappable.indexOf(ableName) < 0)) {\r\n return false;\r\n }\r\n if (snapGridWidth ||\r\n snapGridHeight ||\r\n bounds ||\r\n innerBounds ||\r\n (guidelines && guidelines.length) ||\r\n (verticalGuidelines && verticalGuidelines.length) ||\r\n (horizontalGuidelines && horizontalGuidelines.length)) {\r\n return true;\r\n }\r\n return false;\r\n}\r\nfunction getSnapDirections(snapDirections) {\r\n if (snapDirections === false) {\r\n return {};\r\n }\r\n else if (snapDirections === true || !snapDirections) {\r\n return { left: true, right: true, top: true, bottom: true };\r\n }\r\n return snapDirections;\r\n}\r\nfunction mapSnapDirectionPoses(snapDirections, snapPoses) {\r\n var nextSnapDirections = getSnapDirections(snapDirections);\r\n var nextSnapPoses = {};\r\n for (var name_1 in nextSnapDirections) {\r\n if (name_1 in snapPoses && nextSnapDirections[name_1]) {\r\n nextSnapPoses[name_1] = snapPoses[name_1];\r\n }\r\n }\r\n return nextSnapPoses;\r\n}\r\nfunction splitSnapDirectionPoses(snapDirections, snapPoses) {\r\n var nextSnapPoses = mapSnapDirectionPoses(snapDirections, snapPoses);\r\n var horizontalNames = HORIZONTAL_NAMES.filter(function (name) { return name in nextSnapPoses; });\r\n var verticalNames = VERTICAL_NAMES.filter(function (name) { return name in nextSnapPoses; });\r\n return {\r\n horizontalNames: horizontalNames,\r\n verticalNames: verticalNames,\r\n horizontal: horizontalNames.map(function (name) { return nextSnapPoses[name]; }),\r\n vertical: verticalNames.map(function (name) { return nextSnapPoses[name]; }),\r\n };\r\n}\r\nfunction calculateContainerPos(rootMatrix, containerRect, n) {\r\n var clientPos = calculatePosition(rootMatrix, [containerRect.clientLeft, containerRect.clientTop], n);\r\n return [\r\n containerRect.left + clientPos[0],\r\n containerRect.top + clientPos[1],\r\n ];\r\n}\r\nfunction solveLineConstants(_a) {\r\n var _b = __read(_a, 2), point1 = _b[0], point2 = _b[1];\r\n var dx = point2[0] - point1[0];\r\n var dy = point2[1] - point1[1];\r\n if (Math.abs(dx) < TINY_NUM$1) {\r\n dx = 0;\r\n }\r\n if (Math.abs(dy) < TINY_NUM$1) {\r\n dy = 0;\r\n }\r\n // b > 0\r\n // ax + by + c = 0\r\n var a = 0;\r\n var b = 0;\r\n var c = 0;\r\n if (!dx) {\r\n // -x + 1 = 0\r\n a = -1;\r\n c = point1[0];\r\n }\r\n else if (!dy) {\r\n // y - 1 = 0\r\n b = 1;\r\n c = -point1[1];\r\n }\r\n else {\r\n // y = -a(x - x1) + y1\r\n // ax + y + a * x1 - y1 = 0\r\n a = -dy / dx;\r\n b = 1;\r\n c = a * point1[0] - point1[1];\r\n }\r\n return [a, b, c].map(function (v) { return throttle(v, TINY_NUM$1); });\r\n}\n\nfunction checkMoveableSnapPoses(moveable, posesX, posesY, dirXs, dirYs, customSnapThreshold) {\r\n if (dirXs === void 0) { dirXs = []; }\r\n if (dirYs === void 0) { dirYs = []; }\r\n var props = moveable.props;\r\n var snapThreshold = selectValue(customSnapThreshold, props.snapThreshold, 5);\r\n return checkSnapPoses(moveable.state.guidelines, posesX, posesY, dirXs, dirYs, snapThreshold);\r\n}\r\nfunction checkSnapPoses(guidelines, posesX, posesY, dirXs, dirYs, snapThreshold) {\r\n return {\r\n vertical: checkSnap(guidelines, \"vertical\", posesX, snapThreshold, dirXs),\r\n horizontal: checkSnap(guidelines, \"horizontal\", posesY, snapThreshold, dirYs),\r\n };\r\n}\r\nfunction checkSnapKeepRatio(moveable, startPos, endPos) {\r\n var _a = __read(endPos, 2), endX = _a[0], endY = _a[1];\r\n var _b = __read(startPos, 2), startX = _b[0], startY = _b[1];\r\n var _c = __read(minus(endPos, startPos), 2), dx = _c[0], dy = _c[1];\r\n var isBottom = dy > 0;\r\n var isRight = dx > 0;\r\n dx = getTinyDist(dx);\r\n dy = getTinyDist(dy);\r\n var verticalInfo = {\r\n isSnap: false,\r\n offset: 0,\r\n pos: 0,\r\n };\r\n var horizontalInfo = {\r\n isSnap: false,\r\n offset: 0,\r\n pos: 0,\r\n };\r\n if (dx === 0 && dy === 0) {\r\n return {\r\n vertical: verticalInfo,\r\n horizontal: horizontalInfo,\r\n };\r\n }\r\n var _d = checkMoveableSnapPoses(moveable, dx ? [endX] : [], dy ? [endY] : []), verticalSnapInfo = _d.vertical, horizontalSnapInfo = _d.horizontal;\r\n verticalSnapInfo.posInfos.filter(function (_a) {\r\n var pos = _a.pos;\r\n return isRight ? pos >= startX : pos <= startX;\r\n });\r\n horizontalSnapInfo.posInfos.filter(function (_a) {\r\n var pos = _a.pos;\r\n return isBottom ? pos >= startY : pos <= startY;\r\n });\r\n verticalSnapInfo.isSnap = verticalSnapInfo.posInfos.length > 0;\r\n horizontalSnapInfo.isSnap = horizontalSnapInfo.posInfos.length > 0;\r\n var _e = getNearestSnapGuidelineInfo(verticalSnapInfo), isVerticalSnap = _e.isSnap, verticalGuideline = _e.guideline;\r\n var _f = getNearestSnapGuidelineInfo(horizontalSnapInfo), isHorizontalSnap = _f.isSnap, horizontalGuideline = _f.guideline;\r\n var horizontalPos = isHorizontalSnap ? horizontalGuideline.pos[1] : 0;\r\n var verticalPos = isVerticalSnap ? verticalGuideline.pos[0] : 0;\r\n if (dx === 0) {\r\n if (isHorizontalSnap) {\r\n horizontalInfo.isSnap = true;\r\n horizontalInfo.pos = horizontalGuideline.pos[1];\r\n horizontalInfo.offset = endY - horizontalInfo.pos;\r\n }\r\n }\r\n else if (dy === 0) {\r\n if (isVerticalSnap) {\r\n verticalInfo.isSnap = true;\r\n verticalInfo.pos = verticalPos;\r\n verticalInfo.offset = endX - verticalPos;\r\n }\r\n }\r\n else {\r\n // y - y1 = a * (x - x1)\r\n var a = dy / dx;\r\n var b = endPos[1] - a * endX;\r\n var y = 0;\r\n var x = 0;\r\n var isSnap = false;\r\n if (isVerticalSnap) {\r\n x = verticalPos;\r\n y = a * x + b;\r\n isSnap = true;\r\n }\r\n else if (isHorizontalSnap) {\r\n y = horizontalPos;\r\n x = (y - b) / a;\r\n isSnap = true;\r\n }\r\n if (isSnap) {\r\n verticalInfo.isSnap = true;\r\n verticalInfo.pos = x;\r\n verticalInfo.offset = endX - x;\r\n horizontalInfo.isSnap = true;\r\n horizontalInfo.pos = y;\r\n horizontalInfo.offset = endY - y;\r\n }\r\n }\r\n return {\r\n vertical: verticalInfo,\r\n horizontal: horizontalInfo,\r\n };\r\n}\r\nfunction getStringDirection(dir) {\r\n var stringDirection = \"\";\r\n if (dir === -1 || dir === \"top\" || dir === \"left\") {\r\n stringDirection = \"start\";\r\n }\r\n else if (dir === 0 || dir === \"center\" || dir === \"middle\") {\r\n stringDirection = \"center\";\r\n }\r\n else if (dir === 1 || dir === \"right\" || dir === \"bottom\") {\r\n stringDirection = \"end\";\r\n }\r\n return stringDirection;\r\n}\r\nfunction checkSnaps(moveable, rect, customSnapThreshold) {\r\n var poses = splitSnapDirectionPoses(moveable.props.snapDirections, rect);\r\n var result = checkMoveableSnapPoses(moveable, poses.vertical, poses.horizontal, poses.verticalNames.map(function (name) { return getStringDirection(name); }), poses.horizontalNames.map(function (name) { return getStringDirection(name); }), customSnapThreshold);\r\n var horizontalDirection = getStringDirection(poses.horizontalNames[result.horizontal.index]);\r\n var verticalDirection = getStringDirection(poses.verticalNames[result.vertical.index]);\r\n return {\r\n vertical: __assign(__assign({}, result.vertical), { direction: verticalDirection }),\r\n horizontal: __assign(__assign({}, result.horizontal), { direction: horizontalDirection }),\r\n };\r\n}\r\nfunction getNearestSnapGuidelineInfo(snapInfo) {\r\n var isSnap = snapInfo.isSnap;\r\n if (!isSnap) {\r\n return {\r\n isSnap: false,\r\n offset: 0,\r\n dist: -1,\r\n pos: 0,\r\n guideline: null,\r\n };\r\n }\r\n var posInfo = snapInfo.posInfos[0];\r\n var guidelineInfo = posInfo.guidelineInfos[0];\r\n var offset = guidelineInfo.offset;\r\n var dist = guidelineInfo.dist;\r\n var guideline = guidelineInfo.guideline;\r\n return {\r\n isSnap: isSnap,\r\n offset: offset,\r\n dist: dist,\r\n pos: posInfo.pos,\r\n guideline: guideline,\r\n };\r\n}\r\nfunction checkSnap(guidelines, targetType, targetPoses, snapThreshold, dirs) {\r\n var _a, _b;\r\n if (dirs === void 0) { dirs = []; }\r\n if (!guidelines || !guidelines.length) {\r\n return {\r\n isSnap: false,\r\n index: -1,\r\n direction: \"\",\r\n posInfos: [],\r\n };\r\n }\r\n var isVertical = targetType === \"vertical\";\r\n var posType = isVertical ? 0 : 1;\r\n var snapPosInfos = targetPoses.map(function (targetPos, index) {\r\n var direction = dirs[index] || \"\";\r\n var guidelineInfos = guidelines.map(function (guideline) {\r\n var pos = guideline.pos;\r\n var offset = targetPos - pos[posType];\r\n return {\r\n offset: offset,\r\n dist: abs(offset),\r\n guideline: guideline,\r\n direction: direction,\r\n };\r\n }).filter(function (_a) {\r\n var guideline = _a.guideline, dist = _a.dist;\r\n var type = guideline.type;\r\n if (type !== targetType\r\n || dist > snapThreshold) {\r\n return false;\r\n }\r\n return true;\r\n }).sort(function (a, b) { return a.dist - b.dist; });\r\n return {\r\n pos: targetPos,\r\n index: index,\r\n guidelineInfos: guidelineInfos,\r\n direction: direction,\r\n };\r\n }).filter(function (snapPosInfo) {\r\n return snapPosInfo.guidelineInfos.length > 0;\r\n }).sort(function (a, b) {\r\n return a.guidelineInfos[0].dist - b.guidelineInfos[0].dist;\r\n });\r\n var isSnap = snapPosInfos.length > 0;\r\n return {\r\n isSnap: isSnap,\r\n index: isSnap ? snapPosInfos[0].index : -1,\r\n direction: (_b = (_a = snapPosInfos[0]) === null || _a === void 0 ? void 0 : _a.direction) !== null && _b !== void 0 ? _b : \"\",\r\n posInfos: snapPosInfos,\r\n };\r\n}\r\nfunction getSnapInfosByDirection(moveable, \r\n// pos1 pos2 pos3 pos4\r\nposes, snapDirection, snapThreshold) {\r\n if (snapThreshold === void 0) { snapThreshold = 1; }\r\n var dirs = [];\r\n if (snapDirection[0] && snapDirection[1]) {\r\n dirs = [\r\n snapDirection,\r\n [-snapDirection[0], snapDirection[1]],\r\n [snapDirection[0], -snapDirection[1]],\r\n ];\r\n }\r\n else if (!snapDirection[0] && !snapDirection[1]) {\r\n [\r\n [-1, -1],\r\n [1, -1],\r\n [1, 1],\r\n [-1, 1],\r\n ].forEach(function (dir, i, arr) {\r\n var nextDir = (arr[i + 1] || arr[0]);\r\n dirs.push(dir);\r\n dirs.push([\r\n (dir[0] + nextDir[0]) / 2,\r\n (dir[1] + nextDir[1]) / 2,\r\n ]);\r\n });\r\n }\r\n else {\r\n if (moveable.props.keepRatio) {\r\n dirs.push([-1, -1], [-1, 1], [1, -1], [1, 1], snapDirection);\r\n }\r\n else {\r\n dirs.push.apply(dirs, __spreadArray([], __read(getPosesByDirection([\r\n [-1, -1],\r\n [1, -1],\r\n [-1, -1],\r\n [1, 1],\r\n ], snapDirection)), false));\r\n if (dirs.length > 1) {\r\n dirs.push([\r\n (dirs[0][0] + dirs[1][0]) / 2,\r\n (dirs[0][1] + dirs[1][1]) / 2,\r\n ]);\r\n }\r\n }\r\n }\r\n var nextPoses = dirs.map(function (dir) { return getPosByDirection(poses, dir); });\r\n var xs = nextPoses.map(function (pos) { return pos[0]; });\r\n var ys = nextPoses.map(function (pos) { return pos[1]; });\r\n var result = checkMoveableSnapPoses(moveable, xs, ys, dirs.map(function (dir) { return getStringDirection(dir[0]); }), dirs.map(function (dir) { return getStringDirection(dir[1]); }), snapThreshold);\r\n var verticalDirection = getStringDirection(dirs.map(function (dir) { return dir[0]; })[result.vertical.index]);\r\n var horizontalDirection = getStringDirection(dirs.map(function (dir) { return dir[1]; })[result.horizontal.index]);\r\n return {\r\n vertical: __assign(__assign({}, result.vertical), { direction: verticalDirection }),\r\n horizontal: __assign(__assign({}, result.horizontal), { direction: horizontalDirection }),\r\n };\r\n}\r\nfunction checkSnapBoundPriority(a, b) {\r\n var aDist = abs(a.offset);\r\n var bDist = abs(b.offset);\r\n if (a.isBound && b.isBound) {\r\n return bDist - aDist;\r\n }\r\n else if (a.isBound) {\r\n return -1;\r\n }\r\n else if (b.isBound) {\r\n return 1;\r\n }\r\n else if (a.isSnap && b.isSnap) {\r\n return bDist - aDist;\r\n }\r\n else if (a.isSnap) {\r\n return -1;\r\n }\r\n else if (b.isSnap) {\r\n return 1;\r\n }\r\n else if (aDist < TINY_NUM) {\r\n return 1;\r\n }\r\n else if (bDist < TINY_NUM) {\r\n return -1;\r\n }\r\n return aDist - bDist;\r\n}\r\nfunction getNearOffsetInfo(offsets, index) {\r\n return offsets.slice().sort(function (a, b) {\r\n var aSign = a.sign[index];\r\n var bSign = b.sign[index];\r\n var aOffset = a.offset[index];\r\n var bOffset = b.offset[index];\r\n // -1 The positions of a and b do not change.\r\n // 1 The positions of a and b are reversed.\r\n if (!aSign) {\r\n return 1;\r\n }\r\n else if (!bSign) {\r\n return -1;\r\n }\r\n return checkSnapBoundPriority({ isBound: a.isBound, isSnap: a.isSnap, offset: aOffset }, { isBound: b.isBound, isSnap: b.isSnap, offset: bOffset });\r\n })[0];\r\n}\r\nfunction getCheckSnapDirections(direction, fixedDirection, keepRatio) {\r\n var directions = [];\r\n // const fixedDirection = [-direction[0], -direction[1]];\r\n if (keepRatio) {\r\n if (abs(fixedDirection[0]) !== 1 || abs(fixedDirection[1]) !== 1) {\r\n directions.push([fixedDirection, [-1, -1]], [fixedDirection, [-1, 1]], [fixedDirection, [1, -1]], [fixedDirection, [1, 1]]);\r\n }\r\n else {\r\n directions.push([fixedDirection, [direction[0], -direction[1]]], [fixedDirection, [-direction[0], direction[1]]]);\r\n }\r\n directions.push([fixedDirection, direction]);\r\n }\r\n else {\r\n if ((direction[0] && direction[1]) || (!direction[0] && !direction[1])) {\r\n var endDirection_1 = direction[0] ? direction : [1, 1];\r\n [1, -1].forEach(function (signX) {\r\n [1, -1].forEach(function (signY) {\r\n var nextDirection = [signX * endDirection_1[0], signY * endDirection_1[1]];\r\n if (fixedDirection[0] === nextDirection[0]\r\n && fixedDirection[1] === nextDirection[1]) {\r\n return;\r\n }\r\n directions.push([fixedDirection, nextDirection]);\r\n });\r\n });\r\n }\r\n else if (direction[0]) {\r\n var signs = abs(fixedDirection[0]) === 1 ? [1] : [1, -1];\r\n signs.forEach(function (sign) {\r\n directions.push([\r\n [fixedDirection[0], -1],\r\n [sign * direction[0], -1],\r\n ], [\r\n [fixedDirection[0], 0],\r\n [sign * direction[0], 0],\r\n ], [\r\n [fixedDirection[0], 1],\r\n [sign * direction[0], 1],\r\n ]);\r\n });\r\n }\r\n else if (direction[1]) {\r\n var signs = abs(fixedDirection[1]) === 1 ? [1] : [1, -1];\r\n signs.forEach(function (sign) {\r\n directions.push([\r\n [-1, fixedDirection[1]],\r\n [-1, sign * direction[1]],\r\n ], [\r\n [0, fixedDirection[1]],\r\n [0, sign * direction[1]],\r\n ], [\r\n [1, fixedDirection[1]],\r\n [1, sign * direction[1]],\r\n ]);\r\n });\r\n }\r\n }\r\n return directions;\r\n}\n\nfunction isStartLine(dot, line) {\r\n // l o => true\r\n // o l => false\r\n var cx = average([line[0][0], line[1][0]]);\r\n var cy = average([line[0][1], line[1][1]]);\r\n return {\r\n vertical: cx <= dot[0],\r\n horizontal: cy <= dot[1],\r\n };\r\n}\r\nfunction hitTestLine(dot, _a) {\r\n var _b = __read(_a, 2), pos1 = _b[0], pos2 = _b[1];\r\n var dx = pos2[0] - pos1[0];\r\n var dy = pos2[1] - pos1[1];\r\n if (abs(dx) < TINY_NUM) {\r\n dx = 0;\r\n }\r\n if (abs(dy) < TINY_NUM) {\r\n dy = 0;\r\n }\r\n var test1;\r\n var test2;\r\n if (!dx) {\r\n test1 = pos1[0];\r\n test2 = dot[0];\r\n }\r\n else if (!dy) {\r\n test1 = pos1[1];\r\n test2 = dot[1];\r\n }\r\n else {\r\n var a = dy / dx;\r\n // y = a * (x - pos1) + pos1\r\n test1 = a * (dot[0] - pos1[0]) + pos1[1];\r\n test2 = dot[1];\r\n }\r\n return test1 - test2;\r\n}\r\nfunction isSameStartLine(dots, line, centerSign, error) {\r\n if (error === void 0) { error = TINY_NUM; }\r\n return dots.every(function (dot) {\r\n var value = hitTestLine(dot, line);\r\n var sign = value <= 0;\r\n return sign === centerSign || abs(value) <= error;\r\n });\r\n}\r\nfunction checkInnerBoundDot(pos, start, end, isStart, threshold) {\r\n if (threshold === void 0) { threshold = 0; }\r\n if ((isStart && start - threshold <= pos)\r\n || (!isStart && pos <= end + threshold)) {\r\n // false 402 565 602 => 37 ([0, 37])\r\n // true 400 524.9712603540036 600 => 124 ([124, 0])\r\n // true 400 410 600 => 10 ([10, 0])\r\n return {\r\n isBound: true,\r\n offset: isStart ? start - pos : end - pos,\r\n };\r\n }\r\n return {\r\n isBound: false,\r\n offset: 0,\r\n };\r\n}\r\nfunction checkInnerBound(moveable, _a) {\r\n var line = _a.line, centerSign = _a.centerSign, verticalSign = _a.verticalSign, horizontalSign = _a.horizontalSign, lineConstants = _a.lineConstants;\r\n var bounds = moveable.props.innerBounds;\r\n if (!bounds) {\r\n return {\r\n isAllBound: false,\r\n isBound: false,\r\n isVerticalBound: false,\r\n isHorizontalBound: false,\r\n offset: [0, 0],\r\n };\r\n }\r\n var left = bounds.left, top = bounds.top, width = bounds.width, height = bounds.height;\r\n var leftLine = [[left, top], [left, top + height]];\r\n var topLine = [[left, top], [left + width, top]];\r\n var rightLine = [[left + width, top], [left + width, top + height]];\r\n var bottomLine = [[left, top + height], [left + width, top + height]];\r\n if (isSameStartLine([\r\n [left, top],\r\n [left + width, top],\r\n [left, top + height],\r\n [left + width, top + height],\r\n ], line, centerSign)) {\r\n return {\r\n isAllBound: false,\r\n isBound: false,\r\n isVerticalBound: false,\r\n isHorizontalBound: false,\r\n offset: [0, 0],\r\n };\r\n }\r\n // test vertical\r\n var topBoundInfo = checkLineBoundCollision(line, lineConstants, topLine, verticalSign);\r\n var bottomBoundInfo = checkLineBoundCollision(line, lineConstants, bottomLine, verticalSign);\r\n // test horizontal\r\n var leftBoundInfo = checkLineBoundCollision(line, lineConstants, leftLine, horizontalSign);\r\n var rightBoundInfo = checkLineBoundCollision(line, lineConstants, rightLine, horizontalSign);\r\n var isAllVerticalBound = topBoundInfo.isBound && bottomBoundInfo.isBound;\r\n var isVerticalBound = topBoundInfo.isBound || bottomBoundInfo.isBound;\r\n var isAllHorizontalBound = leftBoundInfo.isBound && rightBoundInfo.isBound;\r\n var isHorizontalBound = leftBoundInfo.isBound || rightBoundInfo.isBound;\r\n var verticalOffset = maxOffset(topBoundInfo.offset, bottomBoundInfo.offset);\r\n var horizontalOffset = maxOffset(leftBoundInfo.offset, rightBoundInfo.offset);\r\n var offset = [0, 0];\r\n var isBound = false;\r\n var isAllBound = false;\r\n if (abs(horizontalOffset) < abs(verticalOffset)) {\r\n offset = [verticalOffset, 0];\r\n isBound = isVerticalBound;\r\n isAllBound = isAllVerticalBound;\r\n }\r\n else {\r\n offset = [0, horizontalOffset];\r\n isBound = isHorizontalBound;\r\n isAllBound = isAllHorizontalBound;\r\n }\r\n return {\r\n isAllBound: isAllBound,\r\n isVerticalBound: isVerticalBound,\r\n isHorizontalBound: isHorizontalBound,\r\n isBound: isBound,\r\n offset: offset,\r\n };\r\n}\r\nfunction checkLineBoundCollision(line, _a, boundLine, isStart, threshold, isRender) {\r\n var _b = __read(_a, 2), a = _b[0], b = _b[1];\r\n var dot1 = line[0];\r\n // const dot2 = line[1];\r\n var boundDot1 = boundLine[0];\r\n var boundDot2 = boundLine[1];\r\n // const dy1 = getTinyDist(dot2[1] - dot1[1]);\r\n // const dx1 = getTinyDist(dot2[0] - dot1[0]);\r\n var dy2 = getTinyDist(boundDot2[1] - boundDot1[1]);\r\n var dx2 = getTinyDist(boundDot2[0] - boundDot1[0]);\r\n var hasDx = b;\r\n var hasDy = a;\r\n var slope = -a / b;\r\n // lineConstants\r\n // ax + by + c = 0\r\n // dx2 or dy2 is zero\r\n if (!dx2) {\r\n // vertical\r\n // by + c = 0\r\n if (isRender && !hasDy) {\r\n // 90deg\r\n return {\r\n isBound: false,\r\n offset: 0,\r\n };\r\n }\r\n else if (hasDx) {\r\n // ax + by + c = 0\r\n // const y = dy1 ? dy1 / dx1 * (boundDot1[0] - dot1[0]) + dot1[1] : dot1[1];\r\n var y = slope * (boundDot1[0] - dot1[0]) + dot1[1];\r\n // boundDot1[1] <= y <= boundDot2[1]\r\n return checkInnerBoundDot(y, boundDot1[1], boundDot2[1], isStart, threshold);\r\n }\r\n else {\r\n // ax + c = 0\r\n var offset = boundDot1[0] - dot1[0];\r\n var isBound = abs(offset) <= (threshold || 0);\r\n return {\r\n isBound: isBound,\r\n offset: isBound ? offset : 0,\r\n };\r\n }\r\n }\r\n else if (!dy2) {\r\n // horizontal\r\n if (isRender && !hasDx) {\r\n // 90deg\r\n return {\r\n isBound: false,\r\n offset: 0,\r\n };\r\n }\r\n else if (hasDy) {\r\n // y = a * (x - x1) + y1\r\n // x = (y - y1) / a + x1\r\n // const a = dy1 / dx1;\r\n // const x = dx1 ? (boundDot1[1] - dot1[1]) / a + dot1[0] : dot1[0];\r\n var x = (boundDot1[1] - dot1[1]) / slope + dot1[0];\r\n // boundDot1[0] <= x && x <= boundDot2[0]\r\n return checkInnerBoundDot(x, boundDot1[0], boundDot2[0], isStart, threshold);\r\n }\r\n else {\r\n var offset = boundDot1[1] - dot1[1];\r\n var isBound = abs(offset) <= (threshold || 0);\r\n return {\r\n isBound: isBound,\r\n offset: isBound ? offset : 0,\r\n };\r\n }\r\n }\r\n return {\r\n isBound: false,\r\n offset: 0,\r\n };\r\n}\r\nfunction getInnerBoundInfo(moveable, lineInfos, datas) {\r\n return lineInfos.map(function (info) {\r\n var _a = checkInnerBound(moveable, info), isBound = _a.isBound, offset = _a.offset, isVerticalBound = _a.isVerticalBound, isHorizontalBound = _a.isHorizontalBound;\r\n var multiple = info.multiple;\r\n var sizeOffset = getDragDist({\r\n datas: datas,\r\n distX: offset[0],\r\n distY: offset[1],\r\n }).map(function (size, i) { return size * (multiple[i] ? 2 / multiple[i] : 0); });\r\n return {\r\n sign: multiple,\r\n isBound: isBound,\r\n isVerticalBound: isVerticalBound,\r\n isHorizontalBound: isHorizontalBound,\r\n isSnap: false,\r\n offset: sizeOffset,\r\n };\r\n });\r\n}\r\nfunction getInnerBoundDragInfo(moveable, poses, datas) {\r\n var _a;\r\n var lines = getCheckInnerBoundLineInfos(moveable, poses, [0, 0], false).map(function (info) {\r\n return __assign(__assign({}, info), { multiple: info.multiple.map(function (dir) { return abs(dir) * 2; }) });\r\n });\r\n var innerBoundInfo = getInnerBoundInfo(moveable, lines, datas);\r\n var widthOffsetInfo = getNearOffsetInfo(innerBoundInfo, 0);\r\n var heightOffsetInfo = getNearOffsetInfo(innerBoundInfo, 1);\r\n var verticalOffset = 0;\r\n var horizontalOffset = 0;\r\n var isVerticalBound = widthOffsetInfo.isVerticalBound || heightOffsetInfo.isVerticalBound;\r\n var isHorizontalBound = widthOffsetInfo.isHorizontalBound || heightOffsetInfo.isHorizontalBound;\r\n if (isVerticalBound || isHorizontalBound) {\r\n _a = __read(getInverseDragDist({\r\n datas: datas,\r\n distX: -widthOffsetInfo.offset[0],\r\n distY: -heightOffsetInfo.offset[1],\r\n }), 2), verticalOffset = _a[0], horizontalOffset = _a[1];\r\n }\r\n return {\r\n vertical: {\r\n isBound: isVerticalBound,\r\n offset: verticalOffset,\r\n },\r\n horizontal: {\r\n isBound: isHorizontalBound,\r\n offset: horizontalOffset,\r\n },\r\n };\r\n}\r\nfunction getCheckSnapLineDirections(direction, keepRatio) {\r\n var lineDirections = [];\r\n var x = direction[0];\r\n var y = direction[1];\r\n if (x && y) {\r\n lineDirections.push([[0, y * 2], direction, [-x, y]], [[x * 2, 0], direction, [x, -y]]);\r\n }\r\n else if (x) {\r\n // vertcal\r\n lineDirections.push([[x * 2, 0], [x, 1], [x, -1]]);\r\n if (keepRatio) {\r\n lineDirections.push([[0, -1], [x, -1], [-x, -1]], [[0, 1], [x, 1], [-x, 1]]);\r\n }\r\n }\r\n else if (y) {\r\n // horizontal\r\n lineDirections.push([[0, y * 2], [1, y], [-1, y]]);\r\n if (keepRatio) {\r\n lineDirections.push([[-1, 0], [-1, y], [-1, -y]], [[1, 0], [1, y], [1, -y]]);\r\n }\r\n }\r\n else {\r\n // [0, 0] to all direction\r\n lineDirections.push([[-1, 0], [-1, -1], [-1, 1]], [[1, 0], [1, -1], [1, 1]], [[0, -1], [-1, -1], [1, -1]], [[0, 1], [-1, 1], [1, 1]]);\r\n }\r\n return lineDirections;\r\n}\r\nfunction getCheckInnerBoundLineInfos(moveable, poses, direction, keepRatio) {\r\n var _a = moveable.state, allMatrix = _a.allMatrix, is3d = _a.is3d;\r\n var virtualPoses = calculatePoses(allMatrix, 100, 100, is3d ? 4 : 3);\r\n var center = getPosByDirection(virtualPoses, [0, 0]);\r\n return getCheckSnapLineDirections(direction, keepRatio).map(function (_a) {\r\n var _b = __read(_a, 3), multiple = _b[0], dir1 = _b[1], dir2 = _b[2];\r\n var virtualLine = [\r\n getPosByDirection(virtualPoses, dir1),\r\n getPosByDirection(virtualPoses, dir2),\r\n ];\r\n var lineConstants = solveLineConstants(virtualLine);\r\n var _c = isStartLine(center, virtualLine), verticalSign = _c.vertical, horizontalSign = _c.horizontal;\r\n var centerSign = hitTestLine(center, virtualLine) <= 0;\r\n return {\r\n multiple: multiple,\r\n centerSign: centerSign,\r\n verticalSign: verticalSign,\r\n horizontalSign: horizontalSign,\r\n lineConstants: lineConstants,\r\n line: [\r\n getPosByDirection(poses, dir1),\r\n getPosByDirection(poses, dir2),\r\n ],\r\n };\r\n });\r\n}\r\nfunction isBoundRotate(relativePoses, boundDots, center, rad) {\r\n var nextPoses = rad ? relativePoses.map(function (pos) { return rotate(pos, rad); }) : relativePoses;\r\n return [\r\n [nextPoses[0], nextPoses[1]],\r\n [nextPoses[1], nextPoses[3]],\r\n [nextPoses[3], nextPoses[2]],\r\n [nextPoses[2], nextPoses[0]],\r\n ].some(function (line) {\r\n var centerSign = hitTestLine(center, line) <= 0;\r\n return !isSameStartLine(boundDots, line, centerSign);\r\n });\r\n}\r\nfunction getDistPointLine(_a) {\r\n // x = 0, y = 0\r\n // d = (ax + by + c) / root(a2 + b2)\r\n var _b = __read(_a, 2), pos1 = _b[0], pos2 = _b[1];\r\n var dx = pos2[0] - pos1[0];\r\n var dy = pos2[1] - pos1[1];\r\n if (!dx) {\r\n return abs(pos1[0]);\r\n }\r\n if (!dy) {\r\n return abs(pos1[1]);\r\n }\r\n // y - y1 = a(x - x1)\r\n // 0 = ax -y + -a * x1 + y1\r\n var a = dy / dx;\r\n return abs((-a * pos1[0] + pos1[1]) / Math.sqrt(Math.pow(a, 2) + 1));\r\n}\r\nfunction solveReverseLine(_a) {\r\n var _b = __read(_a, 2), pos1 = _b[0], pos2 = _b[1];\r\n var dx = pos2[0] - pos1[0];\r\n var dy = pos2[1] - pos1[1];\r\n if (!dx) {\r\n return [pos1[0], 0];\r\n }\r\n if (!dy) {\r\n return [0, pos1[1]];\r\n }\r\n var a = dy / dx;\r\n // y - y1 = a (x - x1)\r\n // y = ax - a * x1 + y1\r\n var b = -a * pos1[0] + pos1[1];\r\n // y = ax + b = -1/a x\r\n // x = -b / (a + 1 / a)\r\n // y = b / (1 + 1 / a^2)\r\n return [\r\n -b / (a + 1 / a),\r\n b / ((a * a) + 1),\r\n ];\r\n}\r\nfunction checkRotateInnerBounds(moveable, prevPoses, nextPoses, origin, rotation) {\r\n var bounds = moveable.props.innerBounds;\r\n var rad = rotation * Math.PI / 180;\r\n if (!bounds) {\r\n return [];\r\n }\r\n var left = bounds.left, top = bounds.top, width = bounds.width, height = bounds.height;\r\n var relativeLeft = left - origin[0];\r\n var relativeRight = left + width - origin[0];\r\n var relativeTop = top - origin[1];\r\n var relativeBottom = top + height - origin[1];\r\n var dots = [\r\n [relativeLeft, relativeTop],\r\n [relativeRight, relativeTop],\r\n [relativeLeft, relativeBottom],\r\n [relativeRight, relativeBottom],\r\n ];\r\n var center = getPosByDirection(nextPoses, [0, 0]);\r\n if (!isBoundRotate(nextPoses, dots, center, 0)) {\r\n return [];\r\n }\r\n var result = [];\r\n var dotInfos = dots.map(function (dot) { return [\r\n getDistSize(dot),\r\n getRad([0, 0], dot),\r\n ]; });\r\n [\r\n [nextPoses[0], nextPoses[1]],\r\n [nextPoses[1], nextPoses[3]],\r\n [nextPoses[3], nextPoses[2]],\r\n [nextPoses[2], nextPoses[0]],\r\n ].forEach(function (line) {\r\n var lineRad = getRad([0, 0], solveReverseLine(line));\r\n var lineDist = getDistPointLine(line);\r\n result.push.apply(result, __spreadArray([], __read(dotInfos\r\n .filter(function (_a) {\r\n var _b = __read(_a, 1), dotDist = _b[0];\r\n return dotDist && lineDist <= dotDist;\r\n })\r\n .map(function (_a) {\r\n var _b = __read(_a, 2), dotDist = _b[0], dotRad = _b[1];\r\n var distRad = Math.acos(dotDist ? lineDist / dotDist : 0);\r\n var nextRad1 = dotRad + distRad;\r\n var nextRad2 = dotRad - distRad;\r\n return [\r\n rad + nextRad1 - lineRad,\r\n rad + nextRad2 - lineRad,\r\n ];\r\n })\r\n .reduce(function (prev, cur) {\r\n prev.push.apply(prev, __spreadArray([], __read(cur), false));\r\n return prev;\r\n }, [])\r\n .filter(function (nextRad) { return !isBoundRotate(prevPoses, dots, center, nextRad); })\r\n .map(function (nextRad) { return throttle(nextRad * 180 / Math.PI, TINY_NUM); })), false));\r\n });\r\n return result;\r\n}\r\nfunction checkInnerBoundPoses(moveable) {\r\n var innerBounds = moveable.props.innerBounds;\r\n var boundMap = getInitialBounds();\r\n if (!innerBounds) {\r\n return {\r\n boundMap: boundMap,\r\n vertical: [],\r\n horizontal: [],\r\n };\r\n }\r\n var _a = moveable.getRect(), pos1 = _a.pos1, pos2 = _a.pos2, pos3 = _a.pos3, pos4 = _a.pos4;\r\n var poses = [pos1, pos2, pos3, pos4];\r\n var center = getPosByDirection(poses, [0, 0]);\r\n var left = innerBounds.left, top = innerBounds.top, width = innerBounds.width, height = innerBounds.height;\r\n var leftLine = [[left, top], [left, top + height]];\r\n var topLine = [[left, top], [left + width, top]];\r\n var rightLine = [[left + width, top], [left + width, top + height]];\r\n var bottomLine = [[left, top + height], [left + width, top + height]];\r\n var lineInfos = getCheckInnerBoundLineInfos(moveable, poses, [0, 0], false);\r\n var horizontalPoses = [];\r\n var verticalPoses = [];\r\n lineInfos.forEach(function (lineInfo) {\r\n var line = lineInfo.line, lineConstants = lineInfo.lineConstants;\r\n var _a = isStartLine(center, line), isHorizontalStart = _a.horizontal, isVerticalStart = _a.vertical;\r\n // test vertical\r\n var topBoundInfo = checkLineBoundCollision(line, lineConstants, topLine, isVerticalStart, 1, true);\r\n var bottomBoundInfo = checkLineBoundCollision(line, lineConstants, bottomLine, isVerticalStart, 1, true);\r\n // test horizontal\r\n var leftBoundInfo = checkLineBoundCollision(line, lineConstants, leftLine, isHorizontalStart, 1, true);\r\n var rightBoundInfo = checkLineBoundCollision(line, lineConstants, rightLine, isHorizontalStart, 1, true);\r\n if (topBoundInfo.isBound && !boundMap.top) {\r\n horizontalPoses.push(top);\r\n boundMap.top = true;\r\n }\r\n if (bottomBoundInfo.isBound && !boundMap.bottom) {\r\n horizontalPoses.push(top + height);\r\n boundMap.bottom = true;\r\n }\r\n if (leftBoundInfo.isBound && !boundMap.left) {\r\n verticalPoses.push(left);\r\n boundMap.left = true;\r\n }\r\n if (rightBoundInfo.isBound && !boundMap.right) {\r\n verticalPoses.push(left + width);\r\n boundMap.right = true;\r\n }\r\n });\r\n return {\r\n boundMap: boundMap,\r\n horizontal: horizontalPoses,\r\n vertical: verticalPoses,\r\n };\r\n}\n\nfunction solveEquation(pos1, pos2, snapOffset, isVertical) {\r\n var dx = pos2[0] - pos1[0];\r\n var dy = pos2[1] - pos1[1];\r\n if (abs(dx) < TINY_NUM$1) {\r\n dx = 0;\r\n }\r\n if (abs(dy) < TINY_NUM$1) {\r\n dy = 0;\r\n }\r\n if (!dx) {\r\n // y = 0 * x + b\r\n // only horizontal\r\n if (!isVertical) {\r\n return [0, snapOffset];\r\n }\r\n return [0, 0];\r\n }\r\n if (!dy) {\r\n // only vertical\r\n if (isVertical) {\r\n return [snapOffset, 0];\r\n }\r\n return [0, 0];\r\n }\r\n // y = ax + b\r\n var a = dy / dx;\r\n var b = pos1[1] - a * pos1[0];\r\n if (isVertical) {\r\n // y = a * x + b\r\n var y = a * (pos2[0] + snapOffset) + b;\r\n return [snapOffset, y - pos2[1]];\r\n }\r\n else {\r\n // x = (y - b) / a\r\n var x = (pos2[1] + snapOffset - b) / a;\r\n return [x - pos2[0], snapOffset];\r\n }\r\n}\r\nfunction solveNextOffset(pos1, pos2, offset, isVertical, datas) {\r\n var sizeOffset = solveEquation(pos1, pos2, offset, isVertical);\r\n if (!sizeOffset) {\r\n return {\r\n isOutside: false,\r\n offset: [0, 0],\r\n };\r\n }\r\n var size = getDist$1(pos1, pos2);\r\n var dist1 = getDist$1(sizeOffset, pos1);\r\n var dist2 = getDist$1(sizeOffset, pos2);\r\n var isOutside = dist1 > size || dist2 > size;\r\n var _a = __read(getDragDist({\r\n datas: datas,\r\n distX: sizeOffset[0],\r\n distY: sizeOffset[1],\r\n }), 2), widthOffset = _a[0], heightOffset = _a[1];\r\n return {\r\n offset: [widthOffset, heightOffset],\r\n isOutside: isOutside,\r\n };\r\n}\r\nfunction getSnapBound(boundInfo, snapInfo) {\r\n if (boundInfo.isBound) {\r\n return boundInfo.offset;\r\n }\r\n else if (snapInfo.isSnap) {\r\n return getNearestSnapGuidelineInfo(snapInfo).offset;\r\n }\r\n return 0;\r\n}\r\nfunction checkThrottleDragRotate(throttleDragRotate, _a, _b, _c, _d) {\r\n var _e = __read(_a, 2), distX = _e[0], distY = _e[1];\r\n var _f = __read(_b, 2), isVerticalBound = _f[0], isHorizontalBound = _f[1];\r\n var _g = __read(_c, 2), isVerticalSnap = _g[0], isHorizontalSnap = _g[1];\r\n var _h = __read(_d, 2), verticalOffset = _h[0], horizontalOffset = _h[1];\r\n var offsetX = -verticalOffset;\r\n var offsetY = -horizontalOffset;\r\n if (throttleDragRotate && distX && distY) {\r\n offsetX = 0;\r\n offsetY = 0;\r\n var adjustPoses = [];\r\n if (isVerticalBound && isHorizontalBound) {\r\n adjustPoses.push([0, horizontalOffset], [verticalOffset, 0]);\r\n }\r\n else if (isVerticalBound) {\r\n adjustPoses.push([verticalOffset, 0]);\r\n }\r\n else if (isHorizontalBound) {\r\n adjustPoses.push([0, horizontalOffset]);\r\n }\r\n else if (isVerticalSnap && isHorizontalSnap) {\r\n adjustPoses.push([0, horizontalOffset], [verticalOffset, 0]);\r\n }\r\n else if (isVerticalSnap) {\r\n adjustPoses.push([verticalOffset, 0]);\r\n }\r\n else if (isHorizontalSnap) {\r\n adjustPoses.push([0, horizontalOffset]);\r\n }\r\n if (adjustPoses.length) {\r\n adjustPoses.sort(function (a, b) {\r\n return (getDistSize(minus([distX, distY], a)) -\r\n getDistSize(minus([distX, distY], b)));\r\n });\r\n var adjustPos = adjustPoses[0];\r\n if (adjustPos[0] && abs(distX) > TINY_NUM$1) {\r\n offsetX = -adjustPos[0];\r\n offsetY =\r\n (distY * abs(distX + offsetX)) / abs(distX) -\r\n distY;\r\n }\r\n else if (adjustPos[1] && abs(distY) > TINY_NUM$1) {\r\n var prevDistY = distY;\r\n offsetY = -adjustPos[1];\r\n offsetX =\r\n (distX * abs(distY + offsetY)) / abs(prevDistY) -\r\n distX;\r\n }\r\n if (throttleDragRotate && isHorizontalBound && isVerticalBound) {\r\n if (abs(offsetX) > TINY_NUM$1 &&\r\n abs(offsetX) < abs(verticalOffset)) {\r\n var scale = abs(verticalOffset) / abs(offsetX);\r\n offsetX *= scale;\r\n offsetY *= scale;\r\n }\r\n else if (abs(offsetY) > TINY_NUM$1 &&\r\n abs(offsetY) < abs(horizontalOffset)) {\r\n var scale = abs(horizontalOffset) / abs(offsetY);\r\n offsetX *= scale;\r\n offsetY *= scale;\r\n }\r\n else {\r\n offsetX = maxOffset(-verticalOffset, offsetX);\r\n offsetY = maxOffset(-horizontalOffset, offsetY);\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n offsetX = distX || isVerticalBound ? -verticalOffset : 0;\r\n offsetY = distY || isHorizontalBound ? -horizontalOffset : 0;\r\n }\r\n return [offsetX, offsetY];\r\n}\r\nfunction checkSnapBoundsDrag(moveable, distX, distY, throttleDragRotate, ignoreSnap, datas) {\r\n if (!hasGuidelines(moveable, \"draggable\")) {\r\n return [\r\n {\r\n isSnap: false,\r\n isBound: false,\r\n offset: 0,\r\n },\r\n {\r\n isSnap: false,\r\n isBound: false,\r\n offset: 0,\r\n },\r\n ];\r\n }\r\n var poses = getAbsolutePoses(datas.absolutePoses, [distX, distY]);\r\n var _a = getRect(poses), left = _a.left, right = _a.right, top = _a.top, bottom = _a.bottom;\r\n var boundPoses = {\r\n horizontal: poses.map(function (pos) { return pos[1]; }),\r\n vertical: poses.map(function (pos) { return pos[0]; }),\r\n };\r\n var snapDirections = getSnapDirections(moveable.props.snapDirections);\r\n var snapPoses = splitSnapDirectionPoses(snapDirections, {\r\n left: left,\r\n right: right,\r\n top: top,\r\n bottom: bottom,\r\n center: (left + right) / 2,\r\n middle: (top + bottom) / 2,\r\n });\r\n var _b = checkMoveableSnapBounds(moveable, ignoreSnap, snapPoses, boundPoses), verticalSnapBoundInfo = _b.vertical, horizontalSnapBoundInfo = _b.horizontal;\r\n var _c = getInnerBoundDragInfo(moveable, poses, datas), verticalInnerBoundInfo = _c.vertical, horizontalInnerBoundInfo = _c.horizontal;\r\n var isVerticalSnap = verticalSnapBoundInfo.isSnap;\r\n var isHorizontalSnap = horizontalSnapBoundInfo.isSnap;\r\n var isVerticalBound = verticalSnapBoundInfo.isBound || verticalInnerBoundInfo.isBound;\r\n var isHorizontalBound = horizontalSnapBoundInfo.isBound || horizontalInnerBoundInfo.isBound;\r\n var verticalOffset = maxOffset(verticalSnapBoundInfo.offset, verticalInnerBoundInfo.offset);\r\n var horizontalOffset = maxOffset(horizontalSnapBoundInfo.offset, horizontalInnerBoundInfo.offset);\r\n var _d = __read(checkThrottleDragRotate(throttleDragRotate, [distX, distY], [isVerticalBound, isHorizontalBound], [isVerticalSnap, isHorizontalSnap], [verticalOffset, horizontalOffset]), 2), offsetX = _d[0], offsetY = _d[1];\r\n return [\r\n {\r\n isBound: isVerticalBound,\r\n isSnap: isVerticalSnap,\r\n offset: offsetX,\r\n },\r\n {\r\n isBound: isHorizontalBound,\r\n isSnap: isHorizontalSnap,\r\n offset: offsetY,\r\n },\r\n ];\r\n}\r\nfunction checkMoveableSnapBounds(moveable, ignoreSnap, poses, boundPoses) {\r\n if (boundPoses === void 0) { boundPoses = poses; }\r\n var _a = checkBoundPoses(getBounds(moveable), boundPoses.vertical, boundPoses.horizontal), horizontalBoundInfos = _a.horizontal, verticalBoundInfos = _a.vertical;\r\n var _b = ignoreSnap ? {\r\n horizontal: { isSnap: false, index: -1 },\r\n vertical: { isSnap: false, index: -1 },\r\n } : checkMoveableSnapPoses(moveable, poses.vertical, poses.horizontal), horizontalSnapInfo = _b.horizontal, verticalSnapInfo = _b.vertical;\r\n var horizontalOffset = getSnapBound(horizontalBoundInfos[0], horizontalSnapInfo);\r\n var verticalOffset = getSnapBound(verticalBoundInfos[0], verticalSnapInfo);\r\n var horizontalDist = abs(horizontalOffset);\r\n var verticalDist = abs(verticalOffset);\r\n return {\r\n horizontal: {\r\n isBound: horizontalBoundInfos[0].isBound,\r\n isSnap: horizontalSnapInfo.isSnap,\r\n snapIndex: horizontalSnapInfo.index,\r\n offset: horizontalOffset,\r\n dist: horizontalDist,\r\n bounds: horizontalBoundInfos,\r\n snap: horizontalSnapInfo,\r\n },\r\n vertical: {\r\n isBound: verticalBoundInfos[0].isBound,\r\n isSnap: verticalSnapInfo.isSnap,\r\n snapIndex: verticalSnapInfo.index,\r\n offset: verticalOffset,\r\n dist: verticalDist,\r\n bounds: verticalBoundInfos,\r\n snap: verticalSnapInfo,\r\n },\r\n };\r\n}\r\nfunction checkSnapBounds(guideines, bounds, posesX, posesY, snapThreshold) {\r\n var _a = checkBoundPoses(bounds, posesX, posesY), horizontalBoundInfos = _a.horizontal, verticalBoundInfos = _a.vertical;\r\n // options.isRequest ? {\r\n // horizontal: { isSnap: false, index: -1 } as SnapInfo,\r\n // vertical: { isSnap: false, index: -1 } as SnapInfo,\r\n // } :\r\n var _b = checkSnapPoses(guideines, posesX, posesY, [], [], snapThreshold), horizontalSnapInfo = _b.horizontal, verticalSnapInfo = _b.vertical;\r\n var horizontalOffset = getSnapBound(horizontalBoundInfos[0], horizontalSnapInfo);\r\n var verticalOffset = getSnapBound(verticalBoundInfos[0], verticalSnapInfo);\r\n var horizontalDist = abs(horizontalOffset);\r\n var verticalDist = abs(verticalOffset);\r\n return {\r\n horizontal: {\r\n isBound: horizontalBoundInfos[0].isBound,\r\n isSnap: horizontalSnapInfo.isSnap,\r\n snapIndex: horizontalSnapInfo.index,\r\n offset: horizontalOffset,\r\n dist: horizontalDist,\r\n bounds: horizontalBoundInfos,\r\n snap: horizontalSnapInfo,\r\n },\r\n vertical: {\r\n isBound: verticalBoundInfos[0].isBound,\r\n isSnap: verticalSnapInfo.isSnap,\r\n snapIndex: verticalSnapInfo.index,\r\n offset: verticalOffset,\r\n dist: verticalDist,\r\n bounds: verticalBoundInfos,\r\n snap: verticalSnapInfo,\r\n },\r\n };\r\n}\r\nfunction checkSnapRightLine(startPos, endPos, snapBoundInfo, keepRatio) {\r\n var rad = (getRad(startPos, endPos) / Math.PI) * 180;\r\n var _a = snapBoundInfo.vertical, isVerticalBound = _a.isBound, isVerticalSnap = _a.isSnap, verticalDist = _a.dist, _b = snapBoundInfo.horizontal, isHorizontalBound = _b.isBound, isHorizontalSnap = _b.isSnap, horizontalDist = _b.dist;\r\n var rad180 = rad % 180;\r\n var isHorizontalLine = rad180 < 3 || rad180 > 177;\r\n var isVerticalLine = rad180 > 87 && rad180 < 93;\r\n if (horizontalDist < verticalDist) {\r\n if (isVerticalBound ||\r\n (isVerticalSnap &&\r\n !isVerticalLine &&\r\n (!keepRatio || !isHorizontalLine))) {\r\n return \"vertical\";\r\n }\r\n }\r\n if (isHorizontalBound ||\r\n (isHorizontalSnap &&\r\n !isHorizontalLine &&\r\n (!keepRatio || !isVerticalLine))) {\r\n return \"horizontal\";\r\n }\r\n return \"\";\r\n}\r\nfunction getSnapBoundInfo(moveable, poses, directions, keepRatio, isRequest, datas) {\r\n return directions.map(function (_a) {\r\n var _b = __read(_a, 2), startDirection = _b[0], endDirection = _b[1];\r\n var otherStartPos = getPosByDirection(poses, startDirection);\r\n var otherEndPos = getPosByDirection(poses, endDirection);\r\n var snapBoundInfo = keepRatio\r\n ? checkSnapBoundsKeepRatio(moveable, otherStartPos, otherEndPos, isRequest)\r\n : checkMoveableSnapBounds(moveable, isRequest, {\r\n vertical: [otherEndPos[0]],\r\n horizontal: [otherEndPos[1]],\r\n });\r\n var _c = snapBoundInfo.horizontal, \r\n // dist: otherHorizontalDist,\r\n otherHorizontalOffset = _c.offset, isOtherHorizontalBound = _c.isBound, isOtherHorizontalSnap = _c.isSnap, _d = snapBoundInfo.vertical, \r\n // dist: otherVerticalDist,\r\n otherVerticalOffset = _d.offset, isOtherVerticalBound = _d.isBound, isOtherVerticalSnap = _d.isSnap;\r\n var multiple = minus(endDirection, startDirection);\r\n if (!otherVerticalOffset && !otherHorizontalOffset) {\r\n return {\r\n isBound: isOtherVerticalBound || isOtherHorizontalBound,\r\n isSnap: isOtherVerticalSnap || isOtherHorizontalSnap,\r\n sign: multiple,\r\n offset: [0, 0],\r\n };\r\n }\r\n var snapLine = checkSnapRightLine(otherStartPos, otherEndPos, snapBoundInfo, keepRatio);\r\n if (!snapLine) {\r\n return {\r\n sign: multiple,\r\n isBound: false,\r\n isSnap: false,\r\n offset: [0, 0],\r\n };\r\n }\r\n var isVertical = snapLine === \"vertical\";\r\n var sizeOffset = [0, 0];\r\n if (!keepRatio\r\n && abs(endDirection[0]) === 1\r\n && abs(endDirection[1]) === 1\r\n && startDirection[0] !== endDirection[0]\r\n && startDirection[1] !== endDirection[1]) {\r\n sizeOffset = getDragDist({\r\n datas: datas,\r\n distX: -otherVerticalOffset,\r\n distY: -otherHorizontalOffset,\r\n });\r\n }\r\n else {\r\n sizeOffset = solveNextOffset(otherStartPos, otherEndPos, -(isVertical ? otherVerticalOffset : otherHorizontalOffset), isVertical, datas).offset;\r\n }\r\n sizeOffset = sizeOffset.map(function (size, i) { return size * (multiple[i] ? 2 / multiple[i] : 0); });\r\n return {\r\n sign: multiple,\r\n isBound: isVertical ? isOtherVerticalBound : isOtherHorizontalBound,\r\n isSnap: isVertical ? isOtherVerticalSnap : isOtherHorizontalSnap,\r\n offset: sizeOffset,\r\n };\r\n });\r\n}\r\nfunction getSnapBoundOffset(boundInfo, snapInfo) {\r\n if (boundInfo.isBound) {\r\n return boundInfo.offset;\r\n }\r\n else if (snapInfo.isSnap) {\r\n return snapInfo.offset;\r\n }\r\n return 0;\r\n}\r\nfunction checkSnapBoundsKeepRatio(moveable, startPos, endPos, isRequest) {\r\n var _a = checkBoundKeepRatio(moveable, startPos, endPos), horizontalBoundInfo = _a.horizontal, verticalBoundInfo = _a.vertical;\r\n var _b = isRequest ? {\r\n horizontal: { isSnap: false },\r\n vertical: { isSnap: false },\r\n } : checkSnapKeepRatio(moveable, startPos, endPos), horizontalSnapInfo = _b.horizontal, verticalSnapInfo = _b.vertical;\r\n var horizontalOffset = getSnapBoundOffset(horizontalBoundInfo, horizontalSnapInfo);\r\n var verticalOffset = getSnapBoundOffset(verticalBoundInfo, verticalSnapInfo);\r\n var horizontalDist = abs(horizontalOffset);\r\n var verticalDist = abs(verticalOffset);\r\n return {\r\n horizontal: {\r\n isBound: horizontalBoundInfo.isBound,\r\n isSnap: horizontalSnapInfo.isSnap,\r\n offset: horizontalOffset,\r\n dist: horizontalDist,\r\n },\r\n vertical: {\r\n isBound: verticalBoundInfo.isBound,\r\n isSnap: verticalSnapInfo.isSnap,\r\n offset: verticalOffset,\r\n dist: verticalDist,\r\n },\r\n };\r\n}\r\nfunction checkMaxBounds(moveable, poses, direction, fixedPosition, datas) {\r\n var fixedDirection = [-direction[0], -direction[1]];\r\n var _a = moveable.state, width = _a.width, height = _a.height;\r\n var bounds = moveable.props.bounds;\r\n var maxWidth = Infinity;\r\n var maxHeight = Infinity;\r\n if (bounds) {\r\n var directions = [\r\n [direction[0], -direction[1]],\r\n [-direction[0], direction[1]],\r\n ];\r\n var _b = bounds.left, left_1 = _b === void 0 ? -Infinity : _b, _c = bounds.top, top_1 = _c === void 0 ? -Infinity : _c, _d = bounds.right, right_1 = _d === void 0 ? Infinity : _d, _e = bounds.bottom, bottom_1 = _e === void 0 ? Infinity : _e;\r\n directions.forEach(function (otherDirection) {\r\n var isCheckVertical = otherDirection[0] !== fixedDirection[0];\r\n var isCheckHorizontal = otherDirection[1] !== fixedDirection[1];\r\n var otherPos = getPosByDirection(poses, otherDirection);\r\n var deg = (getRad(fixedPosition, otherPos) * 360) / Math.PI;\r\n if (isCheckHorizontal) {\r\n var nextOtherPos = otherPos.slice();\r\n if (abs(deg - 360) < 2 || abs(deg - 180) < 2) {\r\n nextOtherPos[1] = fixedPosition[1];\r\n }\r\n var _a = solveNextOffset(fixedPosition, nextOtherPos, (fixedPosition[1] < otherPos[1] ? bottom_1 : top_1) -\r\n otherPos[1], false, datas), _b = __read(_a.offset, 2), heightOffset = _b[1], isHeightOutside = _a.isOutside;\r\n if (!isNaN(heightOffset)) {\r\n maxHeight = height + (isHeightOutside ? 1 : -1) * abs(heightOffset);\r\n }\r\n }\r\n if (isCheckVertical) {\r\n var nextOtherPos = otherPos.slice();\r\n if (abs(deg - 90) < 2 || abs(deg - 270) < 2) {\r\n nextOtherPos[0] = fixedPosition[0];\r\n }\r\n var _c = solveNextOffset(fixedPosition, nextOtherPos, (fixedPosition[0] < otherPos[0] ? right_1 : left_1) - otherPos[0], true, datas), _d = __read(_c.offset, 1), widthOffset = _d[0], isWidthOutside = _c.isOutside;\r\n if (!isNaN(widthOffset)) {\r\n maxWidth = width + (isWidthOutside ? 1 : -1) * abs(widthOffset);\r\n }\r\n }\r\n });\r\n }\r\n return {\r\n maxWidth: maxWidth,\r\n maxHeight: maxHeight,\r\n };\r\n}\n\n/**\r\n * @namespace Draggable\r\n * @memberof Moveable\r\n * @description Draggable refers to the ability to drag and move targets.\r\n */\r\nvar Draggable = {\r\n name: \"draggable\",\r\n props: [\r\n \"draggable\",\r\n \"throttleDrag\",\r\n \"throttleDragRotate\",\r\n \"hideThrottleDragRotateLine\",\r\n \"startDragRotate\",\r\n \"edgeDraggable\",\r\n ],\r\n events: [\r\n \"dragStart\",\r\n \"drag\",\r\n \"dragEnd\",\r\n \"dragGroupStart\",\r\n \"dragGroup\",\r\n \"dragGroupEnd\",\r\n ],\r\n requestStyle: function () {\r\n return [\"left\", \"top\", \"right\", \"bottom\"];\r\n },\r\n requestChildStyle: function () {\r\n return [\"left\", \"top\", \"right\", \"bottom\"];\r\n },\r\n render: function (moveable, React) {\r\n var _a = moveable.props, hideThrottleDragRotateLine = _a.hideThrottleDragRotateLine, throttleDragRotate = _a.throttleDragRotate, zoom = _a.zoom;\r\n var _b = moveable.getState(), dragInfo = _b.dragInfo, beforeOrigin = _b.beforeOrigin;\r\n if (hideThrottleDragRotateLine || !throttleDragRotate || !dragInfo) {\r\n return [];\r\n }\r\n var dist = dragInfo.dist;\r\n if (!dist[0] && !dist[1]) {\r\n return [];\r\n }\r\n var width = getDistSize(dist);\r\n var rad = getRad(dist, [0, 0]);\r\n return [React.createElement(\"div\", { className: prefix(\"line\", \"horizontal\", \"dragline\", \"dashed\"), key: \"dragRotateGuideline\", style: {\r\n width: \"\".concat(width, \"px\"),\r\n transform: \"translate(\".concat(beforeOrigin[0], \"px, \").concat(beforeOrigin[1], \"px) rotate(\").concat(rad, \"rad) scaleY(\").concat(zoom, \")\"),\r\n } })];\r\n },\r\n dragStart: function (moveable, e) {\r\n var datas = e.datas, parentEvent = e.parentEvent, parentGesto = e.parentGesto;\r\n var state = moveable.state;\r\n var gestos = state.gestos, style = state.style;\r\n if (gestos.draggable) {\r\n return false;\r\n }\r\n gestos.draggable = parentGesto || moveable.targetGesto;\r\n datas.datas = {};\r\n datas.left = parseFloat(style.left || \"\") || 0;\r\n datas.top = parseFloat(style.top || \"\") || 0;\r\n datas.bottom = parseFloat(style.bottom || \"\") || 0;\r\n datas.right = parseFloat(style.right || \"\") || 0;\r\n datas.startValue = [0, 0];\r\n setDragStart(moveable, e);\r\n setDefaultTransformIndex(moveable, e, \"translate\");\r\n startCheckSnapDrag(moveable, datas);\r\n datas.prevDist = [0, 0];\r\n datas.prevBeforeDist = [0, 0];\r\n datas.isDrag = false;\r\n datas.deltaOffset = [0, 0];\r\n var params = fillParams(moveable, e, __assign({ set: function (translate) {\r\n datas.startValue = translate;\r\n } }, fillTransformStartEvent(moveable, e)));\r\n var result = parentEvent || triggerEvent(moveable, \"onDragStart\", params);\r\n if (result !== false) {\r\n datas.isDrag = true;\r\n moveable.state.dragInfo = {\r\n startRect: moveable.getRect(),\r\n dist: [0, 0],\r\n };\r\n }\r\n else {\r\n gestos.draggable = null;\r\n datas.isPinch = false;\r\n }\r\n return datas.isDrag ? params : false;\r\n },\r\n drag: function (moveable, e) {\r\n if (!e) {\r\n return;\r\n }\r\n resolveTransformEvent(moveable, e, \"translate\");\r\n var datas = e.datas, parentEvent = e.parentEvent, parentFlag = e.parentFlag, isPinch = e.isPinch, deltaOffset = e.deltaOffset, useSnap = e.useSnap, isRequest = e.isRequest;\r\n var distX = e.distX, distY = e.distY;\r\n var isDrag = datas.isDrag, prevDist = datas.prevDist, prevBeforeDist = datas.prevBeforeDist, startValue = datas.startValue;\r\n if (!isDrag) {\r\n return;\r\n }\r\n if (deltaOffset) {\r\n distX += deltaOffset[0];\r\n distY += deltaOffset[1];\r\n }\r\n var props = moveable.props;\r\n var parentMoveable = props.parentMoveable;\r\n var throttleDrag = parentEvent ? 0 : (props.throttleDrag || 0);\r\n var throttleDragRotate = parentEvent ? 0 : (props.throttleDragRotate || 0);\r\n var dragRotateRad = 0;\r\n var isVerticalSnap = false;\r\n var isVerticalBound = false;\r\n var isHorizontalSnap = false;\r\n var isHorizontalBound = false;\r\n if (!parentEvent && throttleDragRotate > 0 && (distX || distY)) {\r\n var startDragRotate = props.startDragRotate || 0;\r\n var deg = throttle(startDragRotate + getRad([0, 0], [distX, distY]) * 180 / Math.PI, throttleDragRotate)\r\n - startDragRotate;\r\n var ry = distY * Math.abs(Math.cos((deg - 90) / 180 * Math.PI));\r\n var rx = distX * Math.abs(Math.cos(deg / 180 * Math.PI));\r\n var r = getDistSize([rx, ry]);\r\n dragRotateRad = deg * Math.PI / 180;\r\n distX = r * Math.cos(dragRotateRad);\r\n distY = r * Math.sin(dragRotateRad);\r\n }\r\n if (!isPinch && !parentEvent && !parentFlag) {\r\n var _a = __read(checkSnapBoundsDrag(moveable, distX, distY, throttleDragRotate, (!useSnap && isRequest) || deltaOffset, datas), 2), verticalInfo = _a[0], horizontalInfo = _a[1];\r\n isVerticalSnap = verticalInfo.isSnap;\r\n isVerticalBound = verticalInfo.isBound;\r\n isHorizontalSnap = horizontalInfo.isSnap;\r\n isHorizontalBound = horizontalInfo.isBound;\r\n var verticalOffset = verticalInfo.offset;\r\n var horizontalOffset = horizontalInfo.offset;\r\n distX += verticalOffset;\r\n distY += horizontalOffset;\r\n }\r\n var beforeTranslate = plus(getBeforeDragDist({ datas: datas, distX: distX, distY: distY }), startValue);\r\n var translate = plus(getTransformDist({ datas: datas, distX: distX, distY: distY }), startValue);\r\n throttleArray(translate, TINY_NUM);\r\n throttleArray(beforeTranslate, TINY_NUM);\r\n if (!throttleDragRotate) {\r\n if (!isVerticalSnap && !isVerticalBound) {\r\n translate[0] = throttle(translate[0], throttleDrag);\r\n beforeTranslate[0] = throttle(beforeTranslate[0], throttleDrag);\r\n }\r\n if (!isHorizontalSnap && !isHorizontalBound) {\r\n translate[1] = throttle(translate[1], throttleDrag);\r\n beforeTranslate[1] = throttle(beforeTranslate[1], throttleDrag);\r\n }\r\n }\r\n var beforeDist = minus(beforeTranslate, startValue);\r\n var dist = minus(translate, startValue);\r\n var delta = minus(dist, prevDist);\r\n var beforeDelta = minus(beforeDist, prevBeforeDist);\r\n datas.prevDist = dist;\r\n datas.prevBeforeDist = beforeDist;\r\n datas.passDelta = delta; //distX - (datas.passDistX || 0);\r\n // datas.passDeltaY = distY - (datas.passDistY || 0);\r\n datas.passDist = dist; //distX;\r\n // datas.passDistY = distY;\r\n var left = datas.left + beforeDist[0];\r\n var top = datas.top + beforeDist[1];\r\n var right = datas.right - beforeDist[0];\r\n var bottom = datas.bottom - beforeDist[1];\r\n var nextTransform = convertTransformFormat(datas, \"translate(\".concat(translate[0], \"px, \").concat(translate[1], \"px)\"), \"translate(\".concat(dist[0], \"px, \").concat(dist[1], \"px)\"));\r\n fillOriginalTransform(e, nextTransform);\r\n moveable.state.dragInfo.dist = parentEvent ? [0, 0] : dist;\r\n if (!parentEvent && !parentMoveable && delta.every(function (num) { return !num; }) && beforeDelta.some(function (num) { return !num; })) {\r\n return;\r\n }\r\n var _b = moveable.state, width = _b.width, height = _b.height;\r\n var params = fillParams(moveable, e, __assign({ transform: nextTransform, dist: dist, delta: delta, translate: translate, beforeDist: beforeDist, beforeDelta: beforeDelta, beforeTranslate: beforeTranslate, left: left, top: top, right: right, bottom: bottom, width: width, height: height, isPinch: isPinch }, fillCSSObject({\r\n transform: nextTransform,\r\n }, e)));\r\n !parentEvent && triggerEvent(moveable, \"onDrag\", params);\r\n return params;\r\n },\r\n dragAfter: function (moveable, e) {\r\n var datas = e.datas;\r\n var deltaOffset = datas.deltaOffset;\r\n if (deltaOffset[0] || deltaOffset[1]) {\r\n datas.deltaOffset = [0, 0];\r\n return this.drag(moveable, __assign(__assign({}, e), { deltaOffset: deltaOffset }));\r\n }\r\n return false;\r\n },\r\n dragEnd: function (moveable, e) {\r\n var parentEvent = e.parentEvent, datas = e.datas;\r\n moveable.state.dragInfo = null;\r\n if (!datas.isDrag) {\r\n return;\r\n }\r\n datas.isDrag = false;\r\n var param = fillEndParams(moveable, e, {});\r\n !parentEvent && triggerEvent(moveable, \"onDragEnd\", param);\r\n return param;\r\n },\r\n dragGroupStart: function (moveable, e) {\r\n var datas = e.datas, clientX = e.clientX, clientY = e.clientY;\r\n var params = this.dragStart(moveable, e);\r\n if (!params) {\r\n return false;\r\n }\r\n var events = triggerChildGesto(moveable, this, \"dragStart\", [\r\n clientX || 0,\r\n clientY || 0,\r\n ], e, false, \"draggable\");\r\n var nextParams = __assign(__assign({}, params), { targets: moveable.props.targets, events: events });\r\n var result = triggerEvent(moveable, \"onDragGroupStart\", nextParams);\r\n datas.isDrag = result !== false;\r\n return datas.isDrag ? params : false;\r\n },\r\n dragGroup: function (moveable, e) {\r\n var datas = e.datas;\r\n if (!datas.isDrag) {\r\n return;\r\n }\r\n var params = this.drag(moveable, e);\r\n var passDelta = e.datas.passDelta;\r\n var events = triggerChildGesto(moveable, this, \"drag\", passDelta, e, false, \"draggable\");\r\n if (!params) {\r\n return;\r\n }\r\n var nextParams = __assign({ targets: moveable.props.targets, events: events }, params);\r\n triggerEvent(moveable, \"onDragGroup\", nextParams);\r\n return nextParams;\r\n },\r\n dragGroupEnd: function (moveable, e) {\r\n var isDrag = e.isDrag, datas = e.datas;\r\n if (!datas.isDrag) {\r\n return;\r\n }\r\n this.dragEnd(moveable, e);\r\n var events = triggerChildGesto(moveable, this, \"dragEnd\", [0, 0], e, false, \"draggable\");\r\n triggerEvent(moveable, \"onDragGroupEnd\", fillEndParams(moveable, e, {\r\n targets: moveable.props.targets,\r\n events: events,\r\n }));\r\n return isDrag;\r\n },\r\n /**\r\n * @method Moveable.Draggable#request\r\n * @param {object} [e] - the draggable's request parameter\r\n * @param {number} [e.x] - x position\r\n * @param {number} [e.y] - y position\r\n * @param {number} [e.deltaX] - X number to move\r\n * @param {number} [e.deltaY] - Y number to move\r\n * @return {Moveable.Requester} Moveable Requester\r\n * @example\r\n\n * // Instantly Request (requestStart - request - requestEnd)\r\n * // Use Relative Value\r\n * moveable.request(\"draggable\", { deltaX: 10, deltaY: 10 }, true);\r\n * // Use Absolute Value\r\n * moveable.request(\"draggable\", { x: 200, y: 100 }, true);\r\n *\r\n * // requestStart\r\n * const requester = moveable.request(\"draggable\");\r\n *\r\n * // request\r\n * // Use Relative Value\r\n * requester.request({ deltaX: 10, deltaY: 10 });\r\n * requester.request({ deltaX: 10, deltaY: 10 });\r\n * requester.request({ deltaX: 10, deltaY: 10 });\r\n * // Use Absolute Value\r\n * moveable.request(\"draggable\", { x: 200, y: 100 });\r\n * moveable.request(\"draggable\", { x: 220, y: 100 });\r\n * moveable.request(\"draggable\", { x: 240, y: 100 });\r\n *\r\n * // requestEnd\r\n * requester.requestEnd();\r\n */\r\n request: function (moveable) {\r\n var datas = {};\r\n var rect = moveable.getRect();\r\n var distX = 0;\r\n var distY = 0;\r\n var useSnap = false;\r\n return {\r\n isControl: false,\r\n requestStart: function (e) {\r\n useSnap = e.useSnap;\r\n return { datas: datas, useSnap: useSnap };\r\n },\r\n request: function (e) {\r\n if (\"x\" in e) {\r\n distX = e.x - rect.left;\r\n }\r\n else if (\"deltaX\" in e) {\r\n distX += e.deltaX;\r\n }\r\n if (\"y\" in e) {\r\n distY = e.y - rect.top;\r\n }\r\n else if (\"deltaY\" in e) {\r\n distY += e.deltaY;\r\n }\r\n return { datas: datas, distX: distX, distY: distY, useSnap: useSnap };\r\n },\r\n requestEnd: function () {\r\n return { datas: datas, isDrag: true, useSnap: useSnap };\r\n },\r\n };\r\n },\r\n unset: function (moveable) {\r\n moveable.state.gestos.draggable = null;\r\n moveable.state.dragInfo = null;\r\n },\r\n};\r\n/**\r\n * Whether or not target can be dragged. (default: false)\r\n * @name Moveable.Draggable#draggable\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.draggable = true;\r\n */\r\n/**\r\n * throttle of x, y when drag.\r\n * @name Moveable.Draggable#throttleDrag\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.throttleDrag = 1;\r\n */\r\n/**\r\n* throttle of angle of x, y when drag.\r\n* @name Moveable.Draggable#throttleDragRotate\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body);\r\n*\r\n* moveable.throttleDragRotate = 45;\r\n*/\r\n/**\r\n* start angle of throttleDragRotate of x, y when drag.\r\n* @name Moveable.Draggable#startDragRotate\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body);\r\n*\r\n* // 45, 135, 225, 315\r\n* moveable.throttleDragRotate = 90;\r\n* moveable.startDragRotate = 45;\r\n*/\r\n/**\r\n * When the drag starts, the dragStart event is called.\r\n * @memberof Moveable.Draggable\r\n * @event dragStart\r\n * @param {Moveable.Draggable.OnDragStart} - Parameters for the dragStart event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { draggable: true });\r\n * moveable.on(\"dragStart\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n */\r\n/**\r\n * When dragging, the drag event is called.\r\n * @memberof Moveable.Draggable\r\n * @event drag\r\n * @param {Moveable.Draggable.OnDrag} - Parameters for the drag event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { draggable: true });\r\n * moveable.on(\"drag\", ({ target, transform }) => {\r\n * target.style.transform = transform;\r\n * });\r\n */\r\n/**\r\n * When the drag finishes, the dragEnd event is called.\r\n * @memberof Moveable.Draggable\r\n * @event dragEnd\r\n * @param {Moveable.Draggable.OnDragEnd} - Parameters for the dragEnd event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { draggable: true });\r\n * moveable.on(\"dragEnd\", ({ target, isDrag }) => {\r\n * console.log(target, isDrag);\r\n * });\r\n */\r\n/**\r\n* When the group drag starts, the `dragGroupStart` event is called.\r\n* @memberof Moveable.Draggable\r\n* @event dragGroupStart\r\n* @param {Moveable.Draggable.OnDragGroupStart} - Parameters for the `dragGroupStart` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* target: [].slice.call(document.querySelectorAll(\".target\")),\r\n* draggable: true\r\n* });\r\n* moveable.on(\"dragGroupStart\", ({ targets }) => {\r\n* console.log(\"onDragGroupStart\", targets);\r\n* });\r\n*/\r\n/**\r\n* When the group drag, the `dragGroup` event is called.\r\n* @memberof Moveable.Draggable\r\n* @event dragGroup\r\n* @param {Moveable.Draggable.OnDragGroup} - Parameters for the `dragGroup` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* target: [].slice.call(document.querySelectorAll(\".target\")),\r\n* draggable: true\r\n* });\r\n* moveable.on(\"dragGroup\", ({ targets, events }) => {\r\n* console.log(\"onDragGroup\", targets);\r\n* events.forEach(ev => {\r\n* // drag event\r\n* console.log(\"onDrag left, top\", ev.left, ev.top);\r\n* // ev.target!.style.left = `${ev.left}px`;\r\n* // ev.target!.style.top = `${ev.top}px`;\r\n* console.log(\"onDrag translate\", ev.dist);\r\n* ev.target!.style.transform = ev.transform;)\r\n* });\r\n* });\r\n*/\r\n/**\r\n * When the group drag finishes, the `dragGroupEnd` event is called.\r\n * @memberof Moveable.Draggable\r\n * @event dragGroupEnd\r\n * @param {Moveable.Draggable.OnDragGroupEnd} - Parameters for the `dragGroupEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * draggable: true\r\n * });\r\n * moveable.on(\"dragGroupEnd\", ({ targets, isDrag }) => {\r\n * console.log(\"onDragGroupEnd\", targets, isDrag);\r\n * });\r\n */\n\nfunction getFixedDirectionInfo(startPositions, fixedDirection) {\r\n var fixedPosition = getPosByDirection(startPositions, fixedDirection);\r\n var fixedOffset = [0, 0];\r\n return {\r\n fixedPosition: fixedPosition,\r\n fixedDirection: fixedDirection,\r\n fixedOffset: fixedOffset,\r\n };\r\n}\r\nfunction getOffsetFixedDirectionInfo(state, fixedDirection) {\r\n // for start\r\n var allMatrix = state.allMatrix, is3d = state.is3d, width = state.width, height = state.height;\r\n var n = is3d ? 4 : 3;\r\n var nextFixedOffset = [\r\n width / 2 * (1 + fixedDirection[0]),\r\n height / 2 * (1 + fixedDirection[1]),\r\n ];\r\n var fixedPosition = calculatePosition(allMatrix, nextFixedOffset, n);\r\n var fixedOffset = [0, 0];\r\n return {\r\n fixedPosition: fixedPosition,\r\n fixedDirection: fixedDirection,\r\n fixedOffset: fixedOffset,\r\n };\r\n}\r\nfunction getOffsetFixedPositionInfo(state, offsetFixedPosition) {\r\n // for start\r\n var allMatrix = state.allMatrix, is3d = state.is3d, width = state.width, height = state.height;\r\n var n = is3d ? 4 : 3;\r\n var fixedDirection = getDirectionByPos(offsetFixedPosition, width, height);\r\n var nextFixedPosition = calculatePosition(allMatrix, offsetFixedPosition, n);\r\n var fixedOffset = [\r\n width ? 0 : offsetFixedPosition[0],\r\n height ? 0 : offsetFixedPosition[1],\r\n ];\r\n return {\r\n fixedPosition: nextFixedPosition,\r\n fixedDirection: fixedDirection,\r\n fixedOffset: fixedOffset,\r\n };\r\n}\n\n/**\r\n * @namespace Resizable\r\n * @memberof Moveable\r\n * @description Resizable indicates whether the target's width and height can be increased or decreased.\r\n */\r\nvar directionCondition$2 = getDirectionCondition(\"resizable\");\r\nvar Resizable = {\r\n name: \"resizable\",\r\n ableGroup: \"size\",\r\n canPinch: true,\r\n props: [\r\n \"resizable\",\r\n \"throttleResize\",\r\n \"renderDirections\",\r\n \"displayAroundControls\",\r\n \"keepRatio\",\r\n \"resizeFormat\",\r\n \"keepRatioFinally\",\r\n \"edge\",\r\n \"checkResizableError\",\r\n ],\r\n events: [\r\n \"resizeStart\",\r\n \"beforeResize\",\r\n \"resize\",\r\n \"resizeEnd\",\r\n \"resizeGroupStart\",\r\n \"beforeResizeGroup\",\r\n \"resizeGroup\",\r\n \"resizeGroupEnd\",\r\n ],\r\n render: getRenderDirections(\"resizable\"),\r\n dragControlCondition: directionCondition$2,\r\n viewClassName: getDirectionViewClassName(\"resizable\"),\r\n dragControlStart: function (moveable, e) {\r\n var _a;\r\n var inputEvent = e.inputEvent, isPinch = e.isPinch, isGroup = e.isGroup, parentDirection = e.parentDirection, parentGesto = e.parentGesto, datas = e.datas, parentFixedDirection = e.parentFixedDirection, parentEvent = e.parentEvent;\r\n var direction = getTotalDirection(parentDirection, isPinch, inputEvent, datas);\r\n var state = moveable.state;\r\n var target = state.target, width = state.width, height = state.height, gestos = state.gestos;\r\n if (!direction || !target) {\r\n return false;\r\n }\r\n if (gestos.resizable) {\r\n return false;\r\n }\r\n gestos.resizable = parentGesto || moveable.controlGesto;\r\n !isPinch && setDragStart(moveable, e);\r\n datas.datas = {};\r\n datas.direction = direction;\r\n datas.startOffsetWidth = width;\r\n datas.startOffsetHeight = height;\r\n datas.prevWidth = 0;\r\n datas.prevHeight = 0;\r\n datas.minSize = [0, 0];\r\n datas.startWidth = state.inlineCSSWidth || state.cssWidth;\r\n datas.startHeight = state.inlineCSSHeight || state.cssHeight;\r\n datas.maxSize = [Infinity, Infinity];\r\n if (!isGroup) {\r\n datas.minSize = [\r\n state.minOffsetWidth,\r\n state.minOffsetHeight,\r\n ];\r\n datas.maxSize = [\r\n state.maxOffsetWidth,\r\n state.maxOffsetHeight,\r\n ];\r\n }\r\n var transformOrigin = moveable.props.transformOrigin || \"% %\";\r\n datas.transformOrigin = transformOrigin && isString(transformOrigin)\r\n ? transformOrigin.split(\" \")\r\n : transformOrigin;\r\n datas.startOffsetMatrix = state.offsetMatrix;\r\n datas.startTransformOrigin = state.transformOrigin;\r\n datas.isWidth = (_a = e === null || e === void 0 ? void 0 : e.parentIsWidth) !== null && _a !== void 0 ? _a : ((!direction[0] && !direction[1]) || direction[0] || !direction[1]);\r\n function setRatio(ratio) {\r\n datas.ratio = ratio && isFinite(ratio) ? ratio : 0;\r\n }\r\n datas.startPositions = getAbsolutePosesByState(moveable.state);\r\n function setFixedDirection(fixedDirection) {\r\n var result = getFixedDirectionInfo(datas.startPositions, fixedDirection);\r\n datas.fixedDirection = result.fixedDirection;\r\n datas.fixedPosition = result.fixedPosition;\r\n datas.fixedOffset = result.fixedOffset;\r\n }\r\n function setFixedPosition(fixedPosition) {\r\n var result = getOffsetFixedPositionInfo(moveable.state, fixedPosition);\r\n datas.fixedDirection = result.fixedDirection;\r\n datas.fixedPosition = result.fixedPosition;\r\n datas.fixedOffset = result.fixedOffset;\r\n }\r\n function setMin(minSize) {\r\n datas.minSize = [\r\n convertUnitSize(\"\".concat(minSize[0]), 0) || 0,\r\n convertUnitSize(\"\".concat(minSize[1]), 0) || 0,\r\n ];\r\n }\r\n function setMax(maxSize) {\r\n var nextMaxSize = [\r\n maxSize[0] || Infinity,\r\n maxSize[1] || Infinity,\r\n ];\r\n if (!isNumber(nextMaxSize[0]) || isFinite(nextMaxSize[0])) {\r\n nextMaxSize[0] = convertUnitSize(\"\".concat(nextMaxSize[0]), 0) || Infinity;\r\n }\r\n if (!isNumber(nextMaxSize[1]) || isFinite(nextMaxSize[1])) {\r\n nextMaxSize[1] = convertUnitSize(\"\".concat(nextMaxSize[1]), 0) || Infinity;\r\n }\r\n datas.maxSize = nextMaxSize;\r\n }\r\n setRatio(width / height);\r\n setFixedDirection(parentFixedDirection || [-direction[0], -direction[1]]);\r\n datas.setFixedDirection = setFixedDirection;\r\n datas.setFixedPosition = setFixedPosition;\r\n datas.setMin = setMin;\r\n datas.setMax = setMax;\r\n var params = fillParams(moveable, e, {\r\n direction: direction,\r\n startRatio: datas.ratio,\r\n set: function (_a) {\r\n var _b = __read(_a, 2), startWidth = _b[0], startHeight = _b[1];\r\n datas.startWidth = startWidth;\r\n datas.startHeight = startHeight;\r\n },\r\n setMin: setMin,\r\n setMax: setMax,\r\n setRatio: setRatio,\r\n setFixedDirection: setFixedDirection,\r\n setFixedPosition: setFixedPosition,\r\n setOrigin: function (origin) {\r\n datas.transformOrigin = origin;\r\n },\r\n dragStart: Draggable.dragStart(moveable, new CustomGesto().dragStart([0, 0], e)),\r\n });\r\n var result = parentEvent || triggerEvent(moveable, \"onResizeStart\", params);\r\n datas.startFixedDirection = datas.fixedDirection;\r\n datas.startFixedPosition = datas.fixedPosition;\r\n if (result !== false) {\r\n datas.isResize = true;\r\n moveable.state.snapRenderInfo = {\r\n request: e.isRequest,\r\n direction: direction,\r\n };\r\n }\r\n return datas.isResize ? params : false;\r\n },\r\n dragControl: function (moveable, e) {\r\n var _a;\r\n var datas = e.datas, parentFlag = e.parentFlag, isPinch = e.isPinch, parentKeepRatio = e.parentKeepRatio, dragClient = e.dragClient, parentDist = e.parentDist, useSnap = e.useSnap, isRequest = e.isRequest, isGroup = e.isGroup, parentEvent = e.parentEvent, resolveMatrix = e.resolveMatrix;\r\n var isResize = datas.isResize, transformOrigin = datas.transformOrigin, startWidth = datas.startWidth, startHeight = datas.startHeight, prevWidth = datas.prevWidth, prevHeight = datas.prevHeight, minSize = datas.minSize, maxSize = datas.maxSize, ratio = datas.ratio, startOffsetWidth = datas.startOffsetWidth, startOffsetHeight = datas.startOffsetHeight, isWidth = datas.isWidth;\r\n if (!isResize) {\r\n return;\r\n }\r\n if (resolveMatrix) {\r\n var is3d = moveable.state.is3d;\r\n var startOffsetMatrix = datas.startOffsetMatrix, startTransformOrigin = datas.startTransformOrigin;\r\n var n = is3d ? 4 : 3;\r\n var targetMatrix = parseMat(getNextTransforms(e));\r\n var targetN = Math.sqrt(targetMatrix.length);\r\n if (n !== targetN) {\r\n targetMatrix = convertDimension(targetMatrix, targetN, n);\r\n }\r\n var nextAllMatrix = getNextMatrix(startOffsetMatrix, targetMatrix, startTransformOrigin, n);\r\n var poses = calculatePoses(nextAllMatrix, startOffsetWidth, startOffsetHeight, n);\r\n datas.startPositions = poses;\r\n datas.nextTargetMatrix = targetMatrix;\r\n datas.nextAllMatrix = nextAllMatrix;\r\n }\r\n var props = getProps(moveable.props, \"resizable\");\r\n var resizeFormat = props.resizeFormat, _b = props.throttleResize, throttleResize = _b === void 0 ? parentFlag ? 0 : 1 : _b, parentMoveable = props.parentMoveable, keepRatioFinally = props.keepRatioFinally;\r\n var direction = datas.direction;\r\n var sizeDirection = direction;\r\n var distWidth = 0;\r\n var distHeight = 0;\r\n if (!direction[0] && !direction[1]) {\r\n sizeDirection = [1, 1];\r\n }\r\n var keepRatio = (ratio && (parentKeepRatio != null ? parentKeepRatio : props.keepRatio)) || false;\r\n function getNextBoundingSize() {\r\n var fixedDirection = datas.fixedDirection;\r\n var nextSize = getOffsetSizeDist(sizeDirection, keepRatio, datas, e);\r\n distWidth = nextSize.distWidth;\r\n distHeight = nextSize.distHeight;\r\n var nextWidth = (sizeDirection[0] - fixedDirection[0]) || keepRatio\r\n ? Math.max(startOffsetWidth + distWidth, TINY_NUM) : startOffsetWidth;\r\n var nextHeight = (sizeDirection[1] - fixedDirection[1]) || keepRatio\r\n ? Math.max(startOffsetHeight + distHeight, TINY_NUM) : startOffsetHeight;\r\n if (keepRatio && startOffsetWidth && startOffsetHeight) {\r\n // startOffsetWidth : startOffsetHeight = nextWidth : nextHeight\r\n if (isWidth) {\r\n nextHeight = nextWidth / ratio;\r\n }\r\n else {\r\n nextWidth = nextHeight * ratio;\r\n }\r\n }\r\n return [nextWidth, nextHeight];\r\n }\r\n var _c = __read(getNextBoundingSize(), 2), boundingWidth = _c[0], boundingHeight = _c[1];\r\n if (!parentEvent) {\r\n datas.setFixedDirection(datas.fixedDirection);\r\n triggerEvent(moveable, \"onBeforeResize\", fillParams(moveable, e, {\r\n startFixedDirection: datas.startFixedDirection,\r\n startFixedPosition: datas.startFixedPosition,\r\n setFixedDirection: function (nextFixedDirection) {\r\n var _a;\r\n datas.setFixedDirection(nextFixedDirection);\r\n _a = __read(getNextBoundingSize(), 2), boundingWidth = _a[0], boundingHeight = _a[1];\r\n return [boundingWidth, boundingHeight];\r\n },\r\n setFixedPosition: function (nextFixedPosition) {\r\n var _a;\r\n datas.setFixedPosition(nextFixedPosition);\r\n _a = __read(getNextBoundingSize(), 2), boundingWidth = _a[0], boundingHeight = _a[1];\r\n return [boundingWidth, boundingHeight];\r\n },\r\n boundingWidth: boundingWidth,\r\n boundingHeight: boundingHeight,\r\n setSize: function (size) {\r\n var _a;\r\n _a = __read(size, 2), boundingWidth = _a[0], boundingHeight = _a[1];\r\n },\r\n }, true));\r\n }\r\n var fixedPosition = dragClient;\r\n if (!dragClient) {\r\n if (!parentFlag && isPinch) {\r\n fixedPosition = getAbsolutePosition(moveable, [0, 0]);\r\n }\r\n else {\r\n fixedPosition = datas.fixedPosition;\r\n }\r\n }\r\n var snapDist = [0, 0];\r\n if (!isPinch) {\r\n snapDist = checkSnapResize(moveable, boundingWidth, boundingHeight, direction, fixedPosition, !useSnap && isRequest, datas);\r\n }\r\n if (parentDist) {\r\n !parentDist[0] && (snapDist[0] = 0);\r\n !parentDist[1] && (snapDist[1] = 0);\r\n }\r\n function computeSize() {\r\n var _a;\r\n if (resizeFormat) {\r\n _a = __read(resizeFormat([boundingWidth, boundingHeight]), 2), boundingWidth = _a[0], boundingHeight = _a[1];\r\n }\r\n boundingWidth = throttle(boundingWidth, throttleResize);\r\n boundingHeight = throttle(boundingHeight, throttleResize);\r\n }\r\n if (keepRatio) {\r\n if (sizeDirection[0] && sizeDirection[1] && snapDist[0] && snapDist[1]) {\r\n if (abs(snapDist[0]) > abs(snapDist[1])) {\r\n snapDist[1] = 0;\r\n }\r\n else {\r\n snapDist[0] = 0;\r\n }\r\n }\r\n var isNoSnap = !snapDist[0] && !snapDist[1];\r\n if (isNoSnap) {\r\n // pre-compute before maintaining the ratio\r\n computeSize();\r\n }\r\n if ((sizeDirection[0] && !sizeDirection[1])\r\n || (snapDist[0] && !snapDist[1])\r\n || (isNoSnap && isWidth)) {\r\n boundingWidth += snapDist[0];\r\n boundingHeight = boundingWidth / ratio;\r\n }\r\n else if ((!sizeDirection[0] && sizeDirection[1])\r\n || (!snapDist[0] && snapDist[1])\r\n || (isNoSnap && !isWidth)) {\r\n boundingHeight += snapDist[1];\r\n boundingWidth = boundingHeight * ratio;\r\n }\r\n }\r\n else {\r\n boundingWidth += snapDist[0];\r\n boundingHeight += snapDist[1];\r\n boundingWidth = Math.max(0, boundingWidth);\r\n boundingHeight = Math.max(0, boundingHeight);\r\n }\r\n _a = __read(calculateBoundSize([boundingWidth, boundingHeight], minSize, maxSize, keepRatio ? ratio : false), 2), boundingWidth = _a[0], boundingHeight = _a[1];\r\n computeSize();\r\n if (keepRatio && (isGroup || keepRatioFinally)) {\r\n if (isWidth) {\r\n boundingHeight = boundingWidth / ratio;\r\n }\r\n else {\r\n boundingWidth = boundingHeight * ratio;\r\n }\r\n }\r\n distWidth = boundingWidth - startOffsetWidth;\r\n distHeight = boundingHeight - startOffsetHeight;\r\n var delta = [distWidth - prevWidth, distHeight - prevHeight];\r\n datas.prevWidth = distWidth;\r\n datas.prevHeight = distHeight;\r\n var inverseDelta = getResizeDist(moveable, boundingWidth, boundingHeight, fixedPosition, transformOrigin, datas);\r\n if (!parentMoveable && delta.every(function (num) { return !num; }) && inverseDelta.every(function (num) { return !num; })) {\r\n return;\r\n }\r\n var drag = Draggable.drag(moveable, setCustomDrag(e, moveable.state, inverseDelta, !!isPinch, false, \"draggable\"));\r\n var transform = drag.transform;\r\n var nextWidth = startWidth + distWidth;\r\n var nextHeight = startHeight + distHeight;\r\n var params = fillParams(moveable, e, __assign({ width: nextWidth, height: nextHeight, offsetWidth: Math.round(boundingWidth), offsetHeight: Math.round(boundingHeight), startRatio: ratio, boundingWidth: boundingWidth, boundingHeight: boundingHeight, direction: direction, dist: [distWidth, distHeight], delta: delta, isPinch: !!isPinch, drag: drag }, fillAfterTransform({\r\n style: {\r\n width: \"\".concat(nextWidth, \"px\"),\r\n height: \"\".concat(nextHeight, \"px\"),\r\n },\r\n transform: transform,\r\n }, drag, e)));\r\n !parentEvent && triggerEvent(moveable, \"onResize\", params);\r\n return params;\r\n },\r\n dragControlAfter: function (moveable, e) {\r\n var datas = e.datas;\r\n var isResize = datas.isResize, startOffsetWidth = datas.startOffsetWidth, startOffsetHeight = datas.startOffsetHeight, prevWidth = datas.prevWidth, prevHeight = datas.prevHeight;\r\n if (!isResize || moveable.props.checkResizableError === false) {\r\n return;\r\n }\r\n var _a = moveable.state, width = _a.width, height = _a.height;\r\n var errorWidth = width - (startOffsetWidth + prevWidth);\r\n var errorHeight = height - (startOffsetHeight + prevHeight);\r\n var isErrorWidth = abs(errorWidth) > 3;\r\n var isErrorHeight = abs(errorHeight) > 3;\r\n if (isErrorWidth) {\r\n datas.startWidth += errorWidth;\r\n datas.startOffsetWidth += errorWidth;\r\n datas.prevWidth += errorWidth;\r\n }\r\n if (isErrorHeight) {\r\n datas.startHeight += errorHeight;\r\n datas.startOffsetHeight += errorHeight;\r\n datas.prevHeight += errorHeight;\r\n }\r\n if (isErrorWidth || isErrorHeight) {\r\n return this.dragControl(moveable, e);\r\n }\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n var datas = e.datas, parentEvent = e.parentEvent;\r\n if (!datas.isResize) {\r\n return;\r\n }\r\n datas.isResize = false;\r\n var params = fillEndParams(moveable, e, {});\r\n !parentEvent && triggerEvent(moveable, \"onResizeEnd\", params);\r\n return params;\r\n },\r\n dragGroupControlCondition: directionCondition$2,\r\n dragGroupControlStart: function (moveable, e) {\r\n var datas = e.datas;\r\n var params = this.dragControlStart(moveable, __assign(__assign({}, e), { isGroup: true }));\r\n if (!params) {\r\n return false;\r\n }\r\n var originalEvents = fillChildEvents(moveable, \"resizable\", e);\r\n var parentStartOffsetWidth = datas.startOffsetWidth, parentStartOffsetHeight = datas.startOffsetHeight;\r\n function updateGroupMin() {\r\n var originalMinSize = datas.minSize;\r\n originalEvents.forEach(function (ev) {\r\n var _a = ev.datas, childMinSize = _a.minSize, childStartOffsetWidth = _a.startOffsetWidth, childStartOffsetHeight = _a.startOffsetHeight;\r\n var parentMinWidth = parentStartOffsetWidth\r\n * (childStartOffsetWidth ? childMinSize[0] / childStartOffsetWidth : 0);\r\n var parentMinHeight = parentStartOffsetHeight\r\n * (childStartOffsetHeight ? childMinSize[1] / childStartOffsetHeight : 0);\r\n originalMinSize[0] = Math.max(originalMinSize[0], parentMinWidth);\r\n originalMinSize[1] = Math.max(originalMinSize[1], parentMinHeight);\r\n });\r\n }\r\n function updateGroupMax() {\r\n var originalMaxSize = datas.maxSize;\r\n originalEvents.forEach(function (ev) {\r\n var _a = ev.datas, childMaxSize = _a.maxSize, childStartOffsetWidth = _a.startOffsetWidth, childStartOffsetHeight = _a.startOffsetHeight;\r\n var parentMaxWidth = parentStartOffsetWidth\r\n * (childStartOffsetWidth ? childMaxSize[0] / childStartOffsetWidth : 0);\r\n var parentMaxHeight = parentStartOffsetHeight\r\n * (childStartOffsetHeight ? childMaxSize[1] / childStartOffsetHeight : 0);\r\n originalMaxSize[0] = Math.min(originalMaxSize[0], parentMaxWidth);\r\n originalMaxSize[1] = Math.min(originalMaxSize[1], parentMaxHeight);\r\n });\r\n }\r\n var events = triggerChildAbles(moveable, this, \"dragControlStart\", e, function (child, ev) {\r\n return startChildDist(moveable, child, datas, ev);\r\n });\r\n updateGroupMin();\r\n updateGroupMax();\r\n var setFixedDirection = function (fixedDirection) {\r\n params.setFixedDirection(fixedDirection);\r\n events.forEach(function (ev, i) {\r\n ev.setFixedDirection(fixedDirection);\r\n startChildDist(moveable, ev.moveable, datas, originalEvents[i]);\r\n });\r\n };\r\n datas.setFixedDirection = setFixedDirection;\r\n var nextParams = __assign(__assign({}, params), { targets: moveable.props.targets, events: events.map(function (ev) {\r\n return __assign(__assign({}, ev), { setMin: function (minSize) {\r\n ev.setMin(minSize);\r\n updateGroupMin();\r\n }, setMax: function (maxSize) {\r\n ev.setMax(maxSize);\r\n updateGroupMax();\r\n } });\r\n }), setFixedDirection: setFixedDirection, setMin: function (minSize) {\r\n params.setMin(minSize);\r\n updateGroupMin();\r\n }, setMax: function (maxSize) {\r\n params.setMax(maxSize);\r\n updateGroupMax();\r\n } });\r\n var result = triggerEvent(moveable, \"onResizeGroupStart\", nextParams);\r\n datas.isResize = result !== false;\r\n return datas.isResize ? params : false;\r\n },\r\n dragGroupControl: function (moveable, e) {\r\n var datas = e.datas;\r\n if (!datas.isResize) {\r\n return;\r\n }\r\n var props = getProps(moveable.props, \"resizable\");\r\n catchEvent(moveable, \"onBeforeResize\", function (parentEvent) {\r\n triggerEvent(moveable, \"onBeforeResizeGroup\", fillParams(moveable, e, __assign(__assign({}, parentEvent), { targets: props.targets }), true));\r\n });\r\n var params = this.dragControl(moveable, __assign(__assign({}, e), { isGroup: true }));\r\n if (!params) {\r\n return;\r\n }\r\n var boundingWidth = params.boundingWidth, boundingHeight = params.boundingHeight, dist = params.dist;\r\n var keepRatio = props.keepRatio;\r\n var parentScale = [\r\n boundingWidth / (boundingWidth - dist[0]),\r\n boundingHeight / (boundingHeight - dist[1]),\r\n ];\r\n var fixedPosition = datas.fixedPosition;\r\n var events = triggerChildAbles(moveable, this, \"dragControl\", e, function (_, ev) {\r\n var _a = __read(calculate(createRotateMatrix(moveable.rotation / 180 * Math.PI, 3), [\r\n ev.datas.originalX * parentScale[0],\r\n ev.datas.originalY * parentScale[1],\r\n 1,\r\n ], 3), 2), clientX = _a[0], clientY = _a[1];\r\n return __assign(__assign({}, ev), { parentDist: null, parentScale: parentScale, dragClient: plus(fixedPosition, [clientX, clientY]), parentKeepRatio: keepRatio });\r\n });\r\n var nextParams = __assign({ targets: props.targets, events: events }, params);\r\n triggerEvent(moveable, \"onResizeGroup\", nextParams);\r\n return nextParams;\r\n },\r\n dragGroupControlEnd: function (moveable, e) {\r\n var isDrag = e.isDrag, datas = e.datas;\r\n if (!datas.isResize) {\r\n return;\r\n }\r\n this.dragControlEnd(moveable, e);\r\n var events = triggerChildAbles(moveable, this, \"dragControlEnd\", e);\r\n var nextParams = fillEndParams(moveable, e, {\r\n targets: moveable.props.targets,\r\n events: events,\r\n });\r\n triggerEvent(moveable, \"onResizeGroupEnd\", nextParams);\r\n return isDrag;\r\n },\r\n /**\r\n * @method Moveable.Resizable#request\r\n * @param {Moveable.Resizable.ResizableRequestParam} e - the Resizable's request parameter\r\n * @return {Moveable.Requester} Moveable Requester\r\n * @example\r\n\n * // Instantly Request (requestStart - request - requestEnd)\r\n * // Use Relative Value\r\n * moveable.request(\"resizable\", { deltaWidth: 10, deltaHeight: 10 }, true);\r\n *\r\n * // Use Absolute Value\r\n * moveable.request(\"resizable\", { offsetWidth: 100, offsetHeight: 100 }, true);\r\n *\r\n * // requestStart\r\n * const requester = moveable.request(\"resizable\");\r\n *\r\n * // request\r\n * // Use Relative Value\r\n * requester.request({ deltaWidth: 10, deltaHeight: 10 });\r\n * requester.request({ deltaWidth: 10, deltaHeight: 10 });\r\n * requester.request({ deltaWidth: 10, deltaHeight: 10 });\r\n *\r\n * // Use Absolute Value\r\n * moveable.request(\"resizable\", { offsetWidth: 100, offsetHeight: 100 });\r\n * moveable.request(\"resizable\", { offsetWidth: 110, offsetHeight: 100 });\r\n * moveable.request(\"resizable\", { offsetWidth: 120, offsetHeight: 100 });\r\n *\r\n * // requestEnd\r\n * requester.requestEnd();\r\n */\r\n request: function (moveable) {\r\n var datas = {};\r\n var distWidth = 0;\r\n var distHeight = 0;\r\n var useSnap = false;\r\n var rect = moveable.getRect();\r\n return {\r\n isControl: true,\r\n requestStart: function (e) {\r\n var _a;\r\n useSnap = e.useSnap;\r\n return {\r\n datas: datas,\r\n parentDirection: e.direction || [1, 1],\r\n parentIsWidth: (_a = e === null || e === void 0 ? void 0 : e.horizontal) !== null && _a !== void 0 ? _a : true,\r\n useSnap: useSnap,\r\n };\r\n },\r\n request: function (e) {\r\n if (\"offsetWidth\" in e) {\r\n distWidth = e.offsetWidth - rect.offsetWidth;\r\n }\r\n else if (\"deltaWidth\" in e) {\r\n distWidth += e.deltaWidth;\r\n }\r\n if (\"offsetHeight\" in e) {\r\n distHeight = e.offsetHeight - rect.offsetHeight;\r\n }\r\n else if (\"deltaHeight\" in e) {\r\n distHeight += e.deltaHeight;\r\n }\r\n return {\r\n datas: datas,\r\n parentDist: [distWidth, distHeight],\r\n parentKeepRatio: e.keepRatio,\r\n useSnap: useSnap,\r\n };\r\n },\r\n requestEnd: function () {\r\n return { datas: datas, isDrag: true, useSnap: useSnap };\r\n },\r\n };\r\n },\r\n unset: function (moveable) {\r\n moveable.state.gestos.resizable = null;\r\n },\r\n};\r\n/**\r\n * Whether or not target can be resized.\r\n * @name Moveable.Resizable#resizable\r\n * @default false\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * resizable: false,\r\n * });\r\n *\r\n * moveable.resizable = true;\r\n */\r\n/**\r\n * throttle of width, height when resize. If throttleResize is set to less than 1, the target may shake.\r\n * @name Moveable.Resizable#throttleResize\r\n * @default 1\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * resizable: true,\r\n * throttleResize: 1,\r\n * });\r\n *\r\n * moveable.throttleResize = 0;\r\n */\r\n/**\r\n * When resize or scale, keeps a ratio of the width, height.\r\n * @name Moveable.Resizable#keepRatio\r\n * @default false\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * resizable: true,\r\n * });\r\n *\r\n * moveable.keepRatio = true;\r\n */\r\n/**\r\n * Set directions to show the control box.\r\n * @name Moveable.Resizable#renderDirections\r\n * @default [\"n\", \"nw\", \"ne\", \"s\", \"se\", \"sw\", \"e\", \"w\"]\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * resizable: true,\r\n * renderDirections: [\"n\", \"nw\", \"ne\", \"s\", \"se\", \"sw\", \"e\", \"w\"],\r\n * });\r\n *\r\n * moveable.renderDirections = [\"nw\", \"ne\", \"sw\", \"se\"];\r\n */\r\n/**\r\n * Function to convert size for resize\r\n * @name Moveable.Resizable#resizeFormat\r\n * @default oneself\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * resizable: true,\r\n * resizeFormat: v => v,\r\n * });\r\n *\r\n * moveable.resizeFormat = (size: number[]) => ([Math.trunc(size[0]), Math.trunc(size[1])];\r\n */\r\n/**\r\n * When the resize starts, the resizeStart event is called.\r\n * @memberof Moveable.Resizable\r\n * @event resizeStart\r\n * @param {Moveable.Resizable.OnResizeStart} - Parameters for the resizeStart event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { resizable: true });\r\n * moveable.on(\"resizeStart\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n */\r\n/**\r\n * When resizing, `beforeResize` is called before `resize` occurs. In `beforeResize`, you can get and set the pre-value before resizing.\r\n * @memberof Moveable.Resizable\r\n * @event beforeResize\r\n * @param {Moveable.Resizable.OnBeforeResize} - Parameters for the `beforeResize` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { resizable: true });\r\n * moveable.on(\"beforeResize\", ({ setFixedDirection }) => {\r\n * if (shiftKey) {\r\n * setFixedDirection([0, 0]);\r\n * }\r\n * });\r\n * moveable.on(\"resize\", ({ target, width, height, drag }) => {\r\n * target.style.width = `${width}px`;\r\n * target.style.height = `${height}px`;\r\n * target.style.transform = drag.transform;\r\n * });\r\n */\r\n/**\r\n * When resizing, the resize event is called.\r\n * @memberof Moveable.Resizable\r\n * @event resize\r\n * @param {Moveable.Resizable.OnResize} - Parameters for the resize event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { resizable: true });\r\n * moveable.on(\"resize\", ({ target, width, height }) => {\r\n * target.style.width = `${e.width}px`;\r\n * target.style.height = `${e.height}px`;\r\n * });\r\n */\r\n/**\r\n * When the resize finishes, the resizeEnd event is called.\r\n * @memberof Moveable.Resizable\r\n * @event resizeEnd\r\n * @param {Moveable.Resizable.OnResizeEnd} - Parameters for the resizeEnd event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { resizable: true });\r\n * moveable.on(\"resizeEnd\", ({ target, isDrag }) => {\r\n * console.log(target, isDrag);\r\n * });\r\n */\r\n/**\r\n* When the group resize starts, the `resizeGroupStart` event is called.\r\n* @memberof Moveable.Resizable\r\n* @event resizeGroupStart\r\n* @param {Moveable.Resizable.OnResizeGroupStart} - Parameters for the `resizeGroupStart` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* target: [].slice.call(document.querySelectorAll(\".target\")),\r\n* resizable: true\r\n* });\r\n* moveable.on(\"resizeGroupStart\", ({ targets }) => {\r\n* console.log(\"onResizeGroupStart\", targets);\r\n* });\r\n*/\r\n/**\r\n* When the group resize, the `resizeGroup` event is called.\r\n* @memberof Moveable.Resizable\r\n* @event resizeGroup\r\n* @param {Moveable.Resizable.onResizeGroup} - Parameters for the `resizeGroup` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* target: [].slice.call(document.querySelectorAll(\".target\")),\r\n* resizable: true\r\n* });\r\n* moveable.on(\"resizeGroup\", ({ targets, events }) => {\r\n* console.log(\"onResizeGroup\", targets);\r\n* events.forEach(ev => {\r\n* const offset = [\r\n* direction[0] < 0 ? -ev.delta[0] : 0,\r\n* direction[1] < 0 ? -ev.delta[1] : 0,\r\n* ];\r\n* // ev.drag is a drag event that occurs when the group resize.\r\n* const left = offset[0] + ev.drag.beforeDist[0];\r\n* const top = offset[1] + ev.drag.beforeDist[1];\r\n* const width = ev.width;\r\n* const top = ev.top;\r\n* });\r\n* });\r\n*/\r\n/**\r\n * When the group resize finishes, the `resizeGroupEnd` event is called.\r\n * @memberof Moveable.Resizable\r\n * @event resizeGroupEnd\r\n * @param {Moveable.Resizable.OnResizeGroupEnd} - Parameters for the `resizeGroupEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * resizable: true\r\n * });\r\n * moveable.on(\"resizeGroupEnd\", ({ targets, isDrag }) => {\r\n * console.log(\"onResizeGroupEnd\", targets, isDrag);\r\n * });\r\n */\n\n/**\r\n * @namespace Rotatable\r\n * @memberof Moveable\r\n * @description Rotatable indicates whether the target can be rotated.\r\n */\r\nfunction setRotateStartInfo(moveable, datas, clientX, clientY, rect) {\r\n var groupable = moveable.props.groupable;\r\n var state = moveable.state;\r\n var n = state.is3d ? 4 : 3;\r\n var origin = datas.origin;\r\n var nextOrigin = calculatePosition(moveable.state.rootMatrix, \r\n // TO-DO #710\r\n minus([origin[0], origin[1]], groupable ? [0, 0] : [state.left, state.top]), n);\r\n var startAbsoluteOrigin = plus([rect.left, rect.top], nextOrigin);\r\n datas.startAbsoluteOrigin = startAbsoluteOrigin;\r\n datas.prevDeg = getRad(startAbsoluteOrigin, [clientX, clientY]) / Math.PI * 180;\r\n datas.defaultDeg = datas.prevDeg;\r\n datas.prevSnapDeg = 0;\r\n datas.loop = 0;\r\n datas.startDist = getDist$1(startAbsoluteOrigin, [clientX, clientY]);\r\n}\r\nfunction getAbsoluteDist(deg, direction, datas) {\r\n var defaultDeg = datas.defaultDeg, prevDeg = datas.prevDeg;\r\n var normalizedPrevDeg = prevDeg % 360;\r\n var loop = Math.floor(prevDeg / 360);\r\n if (normalizedPrevDeg < 0) {\r\n normalizedPrevDeg += 360;\r\n }\r\n if (normalizedPrevDeg > deg && normalizedPrevDeg > 270 && deg < 90) {\r\n // 360 => 0\r\n ++loop;\r\n }\r\n else if (normalizedPrevDeg < deg && normalizedPrevDeg < 90 && deg > 270) {\r\n // 0 => 360\r\n --loop;\r\n }\r\n var dist = direction * (loop * 360 + deg - defaultDeg);\r\n datas.prevDeg = defaultDeg + dist;\r\n return dist;\r\n}\r\nfunction getAbsoluteDistByClient(clientX, clientY, direction, datas) {\r\n return getAbsoluteDist(getRad(datas.startAbsoluteOrigin, [clientX, clientY]) / Math.PI * 180, direction, datas);\r\n}\r\nfunction getRotateInfo(moveable, moveableRect, datas, dist, startValue, checkSnap) {\r\n var _a = moveable.props.throttleRotate, throttleRotate = _a === void 0 ? 0 : _a;\r\n var prevSnapDeg = datas.prevSnapDeg;\r\n var snapRotation = 0;\r\n var isSnap = false;\r\n if (checkSnap) {\r\n var result = checkSnapRotate(moveable, moveableRect, dist, startValue + dist);\r\n isSnap = result.isSnap;\r\n snapRotation = startValue + result.dist;\r\n }\r\n if (!isSnap) {\r\n snapRotation = throttle(startValue + dist, throttleRotate);\r\n }\r\n var snapDeg = snapRotation - startValue;\r\n datas.prevSnapDeg = snapDeg;\r\n return [snapDeg - prevSnapDeg, snapDeg, snapRotation];\r\n}\r\nfunction getRotationPositions(rotationPosition, _a, direction) {\r\n var _b = __read(_a, 4), pos1 = _b[0], pos2 = _b[1], pos3 = _b[2], pos4 = _b[3];\r\n if (rotationPosition === \"none\") {\r\n return [];\r\n }\r\n if (isArray(rotationPosition)) {\r\n return rotationPosition.map(function (child) { return getRotationPositions(child, [pos1, pos2, pos3, pos4], direction)[0]; });\r\n }\r\n var _c = __read((rotationPosition || \"top\").split(\"-\"), 2), dir1 = _c[0], dir2 = _c[1];\r\n var radPoses = [pos1, pos2];\r\n if (dir1 === \"left\") {\r\n radPoses = [pos3, pos1];\r\n }\r\n else if (dir1 === \"right\") {\r\n radPoses = [pos2, pos4];\r\n }\r\n else if (dir1 === \"bottom\") {\r\n radPoses = [pos4, pos3];\r\n }\r\n var pos = [\r\n (radPoses[0][0] + radPoses[1][0]) / 2,\r\n (radPoses[0][1] + radPoses[1][1]) / 2,\r\n ];\r\n var rad = getRotationRad(radPoses, direction);\r\n if (dir2) {\r\n var isStart = dir2 === \"top\" || dir2 === \"left\";\r\n var isReverse = dir1 === \"bottom\" || dir1 === \"left\";\r\n pos = radPoses[(isStart && !isReverse) || (!isStart && isReverse) ? 0 : 1];\r\n }\r\n return [[pos, rad]];\r\n}\r\nfunction dragControlCondition(moveable, e) {\r\n if (e.isRequest) {\r\n return e.requestAble === \"rotatable\";\r\n }\r\n var target = e.inputEvent.target;\r\n if (hasClass(target, prefix(\"rotation-control\"))\r\n || (moveable.props.rotateAroundControls && hasClass(target, prefix(\"around-control\")))\r\n || (hasClass(target, prefix(\"control\")) && hasClass(target, prefix(\"rotatable\")))) {\r\n return true;\r\n }\r\n var rotationTarget = moveable.props.rotationTarget;\r\n if (rotationTarget) {\r\n return getRefTargets(rotationTarget, true).some(function (element) {\r\n if (!element) {\r\n return false;\r\n }\r\n return target === element || target.contains(element);\r\n });\r\n }\r\n return false;\r\n}\r\nvar css = \".rotation {\\nposition: absolute;\\nheight: 40px;\\nwidth: 1px;\\ntransform-origin: 50% 100%;\\nheight: calc(40px * var(--zoom));\\ntop: auto;\\nleft: 0;\\nbottom: 100%;\\nwill-change: transform;\\n}\\n.rotation .rotation-line {\\ndisplay: block;\\nwidth: 100%;\\nheight: 100%;\\ntransform-origin: 50% 50%;\\n}\\n.rotation .rotation-control {\\nborder-color: #4af;\\nborder-color: var(--moveable-color);\\nbackground:#fff;\\ncursor: alias;\\n}\\n:global .view-rotation-dragging, .rotatable.direction.control {\\ncursor: alias;\\n}\\n.rotatable.direction.control.move {\\ncursor: move;\\n}\\n\";\r\nvar Rotatable = {\r\n name: \"rotatable\",\r\n canPinch: true,\r\n props: [\r\n \"rotatable\",\r\n \"rotationPosition\",\r\n \"throttleRotate\",\r\n \"renderDirections\",\r\n \"rotationTarget\",\r\n \"rotateAroundControls\",\r\n \"edge\",\r\n \"resolveAblesWithRotatable\",\r\n \"displayAroundControls\",\r\n ],\r\n events: [\r\n \"rotateStart\",\r\n \"beforeRotate\",\r\n \"rotate\",\r\n \"rotateEnd\",\r\n \"rotateGroupStart\",\r\n \"beforeRotateGroup\",\r\n \"rotateGroup\",\r\n \"rotateGroupEnd\",\r\n ],\r\n css: [css],\r\n viewClassName: function (moveable) {\r\n if (!moveable.isDragging(\"rotatable\")) {\r\n return \"\";\r\n }\r\n return prefix(\"view-rotation-dragging\");\r\n },\r\n render: function (moveable, React) {\r\n var _a = getProps(moveable.props, \"rotatable\"), rotatable = _a.rotatable, rotationPosition = _a.rotationPosition, zoom = _a.zoom, renderDirections = _a.renderDirections, rotateAroundControls = _a.rotateAroundControls, resolveAblesWithRotatable = _a.resolveAblesWithRotatable;\r\n var _b = moveable.getState(), renderPoses = _b.renderPoses, direction = _b.direction;\r\n if (!rotatable) {\r\n return null;\r\n }\r\n var positions = getRotationPositions(rotationPosition, renderPoses, direction);\r\n var jsxs = [];\r\n positions.forEach(function (_a, i) {\r\n var _b = __read(_a, 2), pos = _b[0], rad = _b[1];\r\n jsxs.push(React.createElement(\"div\", { key: \"rotation\".concat(i), className: prefix(\"rotation\"), style: {\r\n // tslint:disable-next-line: max-line-length\r\n transform: \"translate(-50%) translate(\".concat(pos[0], \"px, \").concat(pos[1], \"px) rotate(\").concat(rad, \"rad)\"),\r\n } },\r\n React.createElement(\"div\", { className: prefix(\"line rotation-line\"), style: {\r\n transform: \"scaleX(\".concat(zoom, \")\"),\r\n } }),\r\n React.createElement(\"div\", { className: prefix(\"control rotation-control\"), style: {\r\n transform: \"translate(0.5px) scale(\".concat(zoom, \")\"),\r\n } })));\r\n });\r\n if (renderDirections) {\r\n var ables = getKeys(resolveAblesWithRotatable || {});\r\n var resolveMap_1 = {};\r\n ables.forEach(function (name) {\r\n resolveAblesWithRotatable[name].forEach(function (direction) {\r\n resolveMap_1[direction] = name;\r\n });\r\n });\r\n var directionControlInfos = [];\r\n if (isArray(renderDirections)) {\r\n directionControlInfos = renderDirections.map(function (dir) {\r\n var able = resolveMap_1[dir];\r\n return {\r\n data: able ? { resolve: able } : {},\r\n classNames: able ? [\"move\"] : [],\r\n dir: dir,\r\n };\r\n });\r\n }\r\n jsxs.push.apply(jsxs, __spreadArray([], __read(renderDirectionControlsByInfos(moveable, \"rotatable\", directionControlInfos, React)), false));\r\n }\r\n if (rotateAroundControls) {\r\n jsxs.push.apply(jsxs, __spreadArray([], __read(renderAroundControls(moveable, React)), false));\r\n }\r\n return jsxs;\r\n },\r\n dragControlCondition: dragControlCondition,\r\n dragControlStart: function (moveable, e) {\r\n var _a;\r\n var _b;\r\n var datas = e.datas, clientX = e.clientX, clientY = e.clientY, parentRotate = e.parentRotate, parentFlag = e.parentFlag, isPinch = e.isPinch, isRequest = e.isRequest;\r\n var state = moveable.state;\r\n var target = state.target, left = state.left, top = state.top, direction = state.direction, beforeDirection = state.beforeDirection, targetTransform = state.targetTransform, moveableClientRect = state.moveableClientRect, offsetMatrix = state.offsetMatrix, targetMatrix = state.targetMatrix, allMatrix = state.allMatrix, width = state.width, height = state.height;\r\n if (!isRequest && !target) {\r\n return false;\r\n }\r\n var rect = moveable.getRect();\r\n datas.rect = rect;\r\n datas.transform = targetTransform;\r\n datas.left = left;\r\n datas.top = top;\r\n var setFixedPosition = function (fixedPosition) {\r\n var result = getOffsetFixedPositionInfo(moveable.state, fixedPosition);\r\n datas.fixedDirection = result.fixedDirection;\r\n datas.fixedOffset = result.fixedOffset;\r\n datas.fixedPosition = result.fixedPosition;\r\n if (resizeStart) {\r\n resizeStart.setFixedPosition(fixedPosition);\r\n }\r\n };\r\n var setFixedDirection = function (fixedDirection) {\r\n var result = getOffsetFixedDirectionInfo(moveable.state, fixedDirection);\r\n datas.fixedDirection = result.fixedDirection;\r\n datas.fixedOffset = result.fixedOffset;\r\n datas.fixedPosition = result.fixedPosition;\r\n if (resizeStart) {\r\n resizeStart.setFixedDirection(fixedDirection);\r\n }\r\n };\r\n var startClientX = clientX;\r\n var startClientY = clientY;\r\n if (isRequest || isPinch || parentFlag) {\r\n var externalRotate = parentRotate || 0;\r\n datas.beforeInfo = {\r\n origin: rect.beforeOrigin,\r\n prevDeg: externalRotate,\r\n defaultDeg: externalRotate,\r\n prevSnapDeg: 0,\r\n startDist: 0,\r\n };\r\n datas.afterInfo = __assign(__assign({}, datas.beforeInfo), { origin: rect.origin });\r\n datas.absoluteInfo = __assign(__assign({}, datas.beforeInfo), { origin: rect.origin, startValue: externalRotate });\r\n }\r\n else {\r\n var inputTarget = (_b = e.inputEvent) === null || _b === void 0 ? void 0 : _b.target;\r\n if (inputTarget) {\r\n var regionDirection = inputTarget.getAttribute(\"data-direction\") || \"\";\r\n var controlDirection = DIRECTION_REGION_TO_DIRECTION[regionDirection];\r\n if (controlDirection) {\r\n datas.isControl = true;\r\n datas.isAroundControl = hasClass(inputTarget, prefix(\"around-control\"));\r\n datas.controlDirection = controlDirection;\r\n var resolve = inputTarget.getAttribute(\"data-resolve\");\r\n if (resolve) {\r\n datas.resolveAble = resolve;\r\n }\r\n var clientPoses = calculateMoveableClientPositions(state.rootMatrix, state.renderPoses, moveableClientRect);\r\n _a = __read(getPosByDirection(clientPoses, controlDirection), 2), startClientX = _a[0], startClientY = _a[1];\r\n }\r\n }\r\n datas.beforeInfo = { origin: rect.beforeOrigin };\r\n datas.afterInfo = { origin: rect.origin };\r\n datas.absoluteInfo = {\r\n origin: rect.origin,\r\n startValue: rect.rotation,\r\n };\r\n var originalFixedPosition_1 = setFixedPosition;\r\n setFixedPosition = function (fixedPosition) {\r\n var n = state.is3d ? 4 : 3;\r\n var _a = __read(plus(getOrigin(targetMatrix, n), fixedPosition), 2), originX = _a[0], originY = _a[1];\r\n var fixedBeforeOrigin = calculate(offsetMatrix, convertPositionMatrix([originX, originY], n));\r\n var fixedAfterOrigin = calculate(allMatrix, convertPositionMatrix([fixedPosition[0], fixedPosition[1]], n));\r\n originalFixedPosition_1(fixedPosition);\r\n var posDelta = state.posDelta;\r\n datas.beforeInfo.origin = minus(fixedBeforeOrigin, posDelta);\r\n datas.afterInfo.origin = minus(fixedAfterOrigin, posDelta);\r\n datas.absoluteInfo.origin = minus(fixedAfterOrigin, posDelta);\r\n setRotateStartInfo(moveable, datas.beforeInfo, startClientX, startClientY, moveableClientRect);\r\n setRotateStartInfo(moveable, datas.afterInfo, startClientX, startClientY, moveableClientRect);\r\n setRotateStartInfo(moveable, datas.absoluteInfo, startClientX, startClientY, moveableClientRect);\r\n };\r\n setFixedDirection = function (fixedDirection) {\r\n var fixedPosition = getPosByDirection([\r\n [0, 0],\r\n [width, 0],\r\n [0, height],\r\n [width, height],\r\n ], fixedDirection);\r\n setFixedPosition(fixedPosition);\r\n };\r\n }\r\n datas.startClientX = startClientX;\r\n datas.startClientY = startClientY;\r\n datas.direction = direction;\r\n datas.beforeDirection = beforeDirection;\r\n datas.startValue = 0;\r\n datas.datas = {};\r\n setDefaultTransformIndex(moveable, e, \"rotate\");\r\n var dragStart = false;\r\n var resizeStart = false;\r\n if (datas.isControl && datas.resolveAble) {\r\n var resolveAble = datas.resolveAble;\r\n if (resolveAble === \"resizable\") {\r\n resizeStart = Resizable.dragControlStart(moveable, __assign(__assign({}, (new CustomGesto(\"resizable\").dragStart([0, 0], e))), { parentPosition: datas.controlPosition, parentFixedPosition: datas.fixedPosition }));\r\n }\r\n }\r\n if (!resizeStart) {\r\n dragStart = Draggable.dragStart(moveable, new CustomGesto().dragStart([0, 0], e));\r\n }\r\n setFixedPosition(getTotalOrigin(moveable));\r\n var params = fillParams(moveable, e, __assign(__assign({ set: function (rotatation) {\r\n datas.startValue = rotatation * Math.PI / 180;\r\n }, setFixedDirection: setFixedDirection, setFixedPosition: setFixedPosition }, fillTransformStartEvent(moveable, e)), { dragStart: dragStart, resizeStart: resizeStart }));\r\n var result = triggerEvent(moveable, \"onRotateStart\", params);\r\n datas.isRotate = result !== false;\r\n state.snapRenderInfo = {\r\n request: e.isRequest,\r\n };\r\n return datas.isRotate ? params : false;\r\n },\r\n dragControl: function (moveable, e) {\r\n var _a, _b, _c;\r\n var datas = e.datas, clientDistX = e.clientDistX, clientDistY = e.clientDistY, parentRotate = e.parentRotate, parentFlag = e.parentFlag, isPinch = e.isPinch, groupDelta = e.groupDelta, resolveMatrix = e.resolveMatrix;\r\n var beforeDirection = datas.beforeDirection, beforeInfo = datas.beforeInfo, afterInfo = datas.afterInfo, absoluteInfo = datas.absoluteInfo, isRotate = datas.isRotate, startValue = datas.startValue, rect = datas.rect, startClientX = datas.startClientX, startClientY = datas.startClientY;\r\n if (!isRotate) {\r\n return;\r\n }\r\n resolveTransformEvent(moveable, e, \"rotate\");\r\n var targetDirection = getTransformDirection(e);\r\n var direction = beforeDirection * targetDirection;\r\n var parentMoveable = moveable.props.parentMoveable;\r\n var beforeDelta = 0;\r\n var beforeDist;\r\n var beforeRotation;\r\n var delta = 0;\r\n var dist;\r\n var rotation;\r\n var absoluteDelta = 0;\r\n var absoluteDist;\r\n var absoluteRotation;\r\n var startRotation = 180 / Math.PI * startValue;\r\n var absoluteStartRotation = absoluteInfo.startValue;\r\n var isSnap = false;\r\n var nextClientX = startClientX + clientDistX;\r\n var nextClientY = startClientY + clientDistY;\r\n if (!parentFlag && \"parentDist\" in e) {\r\n var parentDist = e.parentDist;\r\n beforeDist = parentDist;\r\n dist = parentDist;\r\n absoluteDist = parentDist;\r\n }\r\n else if (isPinch || parentFlag) {\r\n beforeDist = getAbsoluteDist(parentRotate, beforeDirection, beforeInfo);\r\n dist = getAbsoluteDist(parentRotate, direction, afterInfo);\r\n absoluteDist = getAbsoluteDist(parentRotate, direction, absoluteInfo);\r\n }\r\n else {\r\n beforeDist = getAbsoluteDistByClient(nextClientX, nextClientY, beforeDirection, beforeInfo);\r\n dist = getAbsoluteDistByClient(nextClientX, nextClientY, direction, afterInfo);\r\n absoluteDist = getAbsoluteDistByClient(nextClientX, nextClientY, direction, absoluteInfo);\r\n isSnap = true;\r\n }\r\n beforeRotation = startRotation + beforeDist;\r\n rotation = startRotation + dist;\r\n absoluteRotation = absoluteStartRotation + absoluteDist;\r\n triggerEvent(moveable, \"onBeforeRotate\", fillParams(moveable, e, {\r\n beforeRotation: beforeRotation,\r\n rotation: rotation,\r\n absoluteRotation: absoluteRotation,\r\n setRotation: function (nextRotation) {\r\n dist = nextRotation - startRotation;\r\n beforeDist = dist;\r\n absoluteDist = dist;\r\n },\r\n }, true));\r\n _a = __read(getRotateInfo(moveable, rect, beforeInfo, beforeDist, startRotation, isSnap), 3), beforeDelta = _a[0], beforeDist = _a[1], beforeRotation = _a[2];\r\n _b = __read(getRotateInfo(moveable, rect, afterInfo, dist, startRotation, isSnap), 3), delta = _b[0], dist = _b[1], rotation = _b[2];\r\n _c = __read(getRotateInfo(moveable, rect, absoluteInfo, absoluteDist, absoluteStartRotation, isSnap), 3), absoluteDelta = _c[0], absoluteDist = _c[1], absoluteRotation = _c[2];\r\n if (!absoluteDelta && !delta && !beforeDelta && !parentMoveable && !resolveMatrix) {\r\n return;\r\n }\r\n var nextTransform = convertTransformFormat(datas, \"rotate(\".concat(rotation, \"deg)\"), \"rotate(\".concat(dist, \"deg)\"));\r\n if (resolveMatrix) {\r\n datas.fixedPosition = getTranslateFixedPosition(moveable, datas.targetAllTransform, datas.fixedDirection, datas.fixedOffset, datas);\r\n }\r\n var inverseDist = getRotateDist(moveable, dist, datas);\r\n var inverseDelta = minus(plus(groupDelta || [0, 0], inverseDist), datas.prevInverseDist || [0, 0]);\r\n datas.prevInverseDist = inverseDist;\r\n datas.requestValue = null;\r\n var dragEvent = fillTransformEvent(moveable, nextTransform, inverseDelta, isPinch, e);\r\n var transformEvent = dragEvent;\r\n var parentDistance = getDist$1([nextClientX, nextClientY], absoluteInfo.startAbsoluteOrigin) - absoluteInfo.startDist;\r\n var resize = undefined;\r\n if (datas.resolveAble === \"resizable\") {\r\n var resizeEvent = Resizable.dragControl(moveable, __assign(__assign({}, setCustomDrag(e, moveable.state, [e.deltaX, e.deltaY], !!isPinch, false, \"resizable\")), { resolveMatrix: true, parentDistance: parentDistance }));\r\n if (resizeEvent) {\r\n resize = resizeEvent;\r\n transformEvent = fillAfterTransform(transformEvent, resizeEvent, e);\r\n }\r\n }\r\n var params = fillParams(moveable, e, __assign(__assign({ delta: delta, dist: dist, rotate: rotation, rotation: rotation, beforeDist: beforeDist, beforeDelta: beforeDelta, beforeRotate: beforeRotation, beforeRotation: beforeRotation, absoluteDist: absoluteDist, absoluteDelta: absoluteDelta, absoluteRotate: absoluteRotation, absoluteRotation: absoluteRotation, isPinch: !!isPinch, resize: resize }, dragEvent), transformEvent));\r\n triggerEvent(moveable, \"onRotate\", params);\r\n return params;\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n var datas = e.datas;\r\n if (!datas.isRotate) {\r\n return;\r\n }\r\n datas.isRotate = false;\r\n var params = fillEndParams(moveable, e, {});\r\n triggerEvent(moveable, \"onRotateEnd\", params);\r\n return params;\r\n },\r\n dragGroupControlCondition: dragControlCondition,\r\n dragGroupControlStart: function (moveable, e) {\r\n var datas = e.datas;\r\n var _a = moveable.state, parentLeft = _a.left, parentTop = _a.top, parentBeforeOrigin = _a.beforeOrigin;\r\n var params = this.dragControlStart(moveable, e);\r\n if (!params) {\r\n return false;\r\n }\r\n params.set(datas.beforeDirection * moveable.rotation);\r\n var events = triggerChildAbles(moveable, this, \"dragControlStart\", e, function (child, ev) {\r\n var _a = child.state, left = _a.left, top = _a.top, beforeOrigin = _a.beforeOrigin;\r\n var childClient = plus(minus([left, top], [parentLeft, parentTop]), minus(beforeOrigin, parentBeforeOrigin));\r\n ev.datas.startGroupClient = childClient;\r\n ev.datas.groupClient = childClient;\r\n return __assign(__assign({}, ev), { parentRotate: 0 });\r\n });\r\n var nextParams = __assign(__assign({}, params), { targets: moveable.props.targets, events: events });\r\n var result = triggerEvent(moveable, \"onRotateGroupStart\", nextParams);\r\n datas.isRotate = result !== false;\r\n return datas.isRotate ? params : false;\r\n },\r\n dragGroupControl: function (moveable, e) {\r\n var datas = e.datas;\r\n if (!datas.isRotate) {\r\n return;\r\n }\r\n catchEvent(moveable, \"onBeforeRotate\", function (parentEvent) {\r\n triggerEvent(moveable, \"onBeforeRotateGroup\", fillParams(moveable, e, __assign(__assign({}, parentEvent), { targets: moveable.props.targets }), true));\r\n });\r\n var params = this.dragControl(moveable, e);\r\n if (!params) {\r\n return;\r\n }\r\n var direction = datas.beforeDirection;\r\n var parentRotate = params.beforeDist;\r\n var rad = parentRotate / 180 * Math.PI;\r\n var events = triggerChildAbles(moveable, this, \"dragControl\", e, function (_, ev) {\r\n var startGroupClient = ev.datas.startGroupClient;\r\n var _a = __read(ev.datas.groupClient, 2), prevClientX = _a[0], prevClientY = _a[1];\r\n var _b = __read(rotate(startGroupClient, rad * direction), 2), clientX = _b[0], clientY = _b[1];\r\n var delta = [clientX - prevClientX, clientY - prevClientY];\r\n ev.datas.groupClient = [clientX, clientY];\r\n return __assign(__assign({}, ev), { parentRotate: parentRotate, groupDelta: delta });\r\n });\r\n moveable.rotation = direction * params.beforeRotation;\r\n var nextParams = __assign({ targets: moveable.props.targets, events: events, set: function (rotation) {\r\n moveable.rotation = rotation;\r\n }, setGroupRotation: function (rotation) {\r\n moveable.rotation = rotation;\r\n } }, params);\r\n triggerEvent(moveable, \"onRotateGroup\", nextParams);\r\n return nextParams;\r\n },\r\n dragGroupControlEnd: function (moveable, e) {\r\n var isDrag = e.isDrag, datas = e.datas;\r\n if (!datas.isRotate) {\r\n return;\r\n }\r\n this.dragControlEnd(moveable, e);\r\n var events = triggerChildAbles(moveable, this, \"dragControlEnd\", e);\r\n var nextParams = fillEndParams(moveable, e, {\r\n targets: moveable.props.targets,\r\n events: events,\r\n });\r\n triggerEvent(moveable, \"onRotateGroupEnd\", nextParams);\r\n return isDrag;\r\n },\r\n /**\r\n * @method Moveable.Rotatable#request\r\n * @param {object} [e] - the Resizable's request parameter\r\n * @param {number} [e.deltaRotate=0] - delta number of rotation\r\n * @param {number} [e.rotate=0] - absolute number of moveable's rotation\r\n * @return {Moveable.Requester} Moveable Requester\r\n * @example\r\n\n * // Instantly Request (requestStart - request - requestEnd)\r\n * moveable.request(\"rotatable\", { deltaRotate: 10 }, true);\r\n *\r\n * * moveable.request(\"rotatable\", { rotate: 10 }, true);\r\n *\r\n * // requestStart\r\n * const requester = moveable.request(\"rotatable\");\r\n *\r\n * // request\r\n * requester.request({ deltaRotate: 10 });\r\n * requester.request({ deltaRotate: 10 });\r\n * requester.request({ deltaRotate: 10 });\r\n *\r\n * requester.request({ rotate: 10 });\r\n * requester.request({ rotate: 20 });\r\n * requester.request({ rotate: 30 });\r\n *\r\n * // requestEnd\r\n * requester.requestEnd();\r\n */\r\n request: function (moveable) {\r\n var datas = {};\r\n var distRotate = 0;\r\n var startRotation = moveable.getRotation();\r\n return {\r\n isControl: true,\r\n requestStart: function () {\r\n return { datas: datas };\r\n },\r\n request: function (e) {\r\n if (\"deltaRotate\" in e) {\r\n distRotate += e.deltaRotate;\r\n }\r\n else if (\"rotate\" in e) {\r\n distRotate = e.rotate - startRotation;\r\n }\r\n return { datas: datas, parentDist: distRotate };\r\n },\r\n requestEnd: function () {\r\n return { datas: datas, isDrag: true };\r\n },\r\n };\r\n },\r\n};\r\n/**\r\n * Whether or not target can be rotated. (default: false)\r\n * @name Moveable.Rotatable#rotatable\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.rotatable = true;\r\n */\r\n/**\r\n * You can specify the position of the rotation. (default: \"top\")\r\n * @name Moveable.Rotatable#rotationPosition\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * rotationPosition: \"top\",\r\n * });\r\n *\r\n * moveable.rotationPosition = \"bottom\"\r\n */\r\n/**\r\n * throttle of angle(degree) when rotate.\r\n * @name Moveable.Rotatable#throttleRotate\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.throttleRotate = 1;\r\n */\r\n/**\r\n * When the rotate starts, the rotateStart event is called.\r\n * @memberof Moveable.Rotatable\r\n * @event rotateStart\r\n * @param {Moveable.Rotatable.OnRotateStart} - Parameters for the rotateStart event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { rotatable: true });\r\n * moveable.on(\"rotateStart\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n */\r\n/**\r\n* When rotating, the rotate event is called.\r\n* @memberof Moveable.Rotatable\r\n* @event rotate\r\n* @param {Moveable.Rotatable.OnRotate} - Parameters for the rotate event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, { rotatable: true });\r\n* moveable.on(\"rotate\", ({ target, transform, dist }) => {\r\n* target.style.transform = transform;\r\n* });\r\n*/\r\n/**\r\n * When the rotate finishes, the rotateEnd event is called.\r\n * @memberof Moveable.Rotatable\r\n * @event rotateEnd\r\n * @param {Moveable.Rotatable.OnRotateEnd} - Parameters for the rotateEnd event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { rotatable: true });\r\n * moveable.on(\"rotateEnd\", ({ target, isDrag }) => {\r\n * console.log(target, isDrag);\r\n * });\r\n */\r\n/**\r\n * When the group rotate starts, the `rotateGroupStart` event is called.\r\n * @memberof Moveable.Rotatable\r\n * @event rotateGroupStart\r\n * @param {Moveable.Rotatable.OnRotateGroupStart} - Parameters for the `rotateGroupStart` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * rotatable: true\r\n * });\r\n * moveable.on(\"rotateGroupStart\", ({ targets }) => {\r\n * console.log(\"onRotateGroupStart\", targets);\r\n * });\r\n */\r\n/**\r\n* When the group rotate, the `rotateGroup` event is called.\r\n* @memberof Moveable.Rotatable\r\n* @event rotateGroup\r\n* @param {Moveable.Rotatable.OnRotateGroup} - Parameters for the `rotateGroup` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* target: [].slice.call(document.querySelectorAll(\".target\")),\r\n* rotatable: true\r\n* });\r\n* moveable.on(\"rotateGroup\", ({ targets, events }) => {\r\n* console.log(\"onRotateGroup\", targets);\r\n* events.forEach(ev => {\r\n* const target = ev.target;\r\n* // ev.drag is a drag event that occurs when the group rotate.\r\n* const left = ev.drag.beforeDist[0];\r\n* const top = ev.drag.beforeDist[1];\r\n* const deg = ev.beforeDist;\r\n* });\r\n* });\r\n*/\r\n/**\r\n * When the group rotate finishes, the `rotateGroupEnd` event is called.\r\n * @memberof Moveable.Rotatable\r\n * @event rotateGroupEnd\r\n * @param {Moveable.Rotatable.OnRotateGroupEnd} - Parameters for the `rotateGroupEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * rotatable: true\r\n * });\r\n * moveable.on(\"rotateGroupEnd\", ({ targets, isDrag }) => {\r\n * console.log(\"onRotateGroupEnd\", targets, isDrag);\r\n * });\r\n */\n\nfunction renderGuideline(info, React) {\r\n var _a;\r\n var direction = info.direction, classNames = info.classNames, size = info.size, pos = info.pos, zoom = info.zoom, key = info.key;\r\n var isHorizontal = direction === \"horizontal\";\r\n var scaleType = isHorizontal ? \"Y\" : \"X\";\r\n // const scaleType2 = isHorizontal ? \"Y\" : \"X\";\r\n return React.createElement(\"div\", {\r\n key: key,\r\n className: classNames.join(\" \"),\r\n style: (_a = {},\r\n _a[isHorizontal ? \"width\" : \"height\"] = \"\".concat(size),\r\n _a.transform = \"translate(\".concat(pos[0], \", \").concat(pos[1], \") translate\").concat(scaleType, \"(-50%) scale\").concat(scaleType, \"(\").concat(zoom, \")\"),\r\n _a),\r\n });\r\n}\r\nfunction renderInnerGuideline(info, React) {\r\n return renderGuideline(__assign(__assign({}, info), { classNames: __spreadArray([\r\n prefix(\"line\", \"guideline\", info.direction)\r\n ], __read(info.classNames), false).filter(function (className) { return className; }), size: info.size || \"\".concat(info.sizeValue, \"px\"), pos: info.pos || info.posValue.map(function (v) { return \"\".concat(throttle(v, 0.1), \"px\"); }) }), React);\r\n}\r\nfunction renderSnapPoses(moveable, direction, snapPoses, minPos, targetPos, size, index, React) {\r\n var zoom = moveable.props.zoom;\r\n return snapPoses.map(function (_a, i) {\r\n var type = _a.type, pos = _a.pos;\r\n var renderPos = [0, 0];\r\n renderPos[index] = minPos;\r\n renderPos[index ? 0 : 1] = -targetPos + pos;\r\n return renderInnerGuideline({\r\n key: \"\".concat(direction, \"TargetGuideline\").concat(i),\r\n classNames: [prefix(\"target\", \"bold\", type)],\r\n posValue: renderPos,\r\n sizeValue: size,\r\n zoom: zoom,\r\n direction: direction,\r\n }, React);\r\n });\r\n}\r\nfunction renderGuidelines(moveable, type, guidelines, targetPos, targetRect, React) {\r\n var _a = moveable.props, zoom = _a.zoom, isDisplayInnerSnapDigit = _a.isDisplayInnerSnapDigit;\r\n var mainNames = type === \"horizontal\" ? VERTICAL_NAMES_MAP : HORIZONTAL_NAMES_MAP;\r\n var targetStart = targetRect[mainNames.start];\r\n var targetEnd = targetRect[mainNames.end];\r\n return guidelines.filter(function (_a) {\r\n var hide = _a.hide, elementRect = _a.elementRect;\r\n if (hide) {\r\n return false;\r\n }\r\n if (isDisplayInnerSnapDigit && elementRect) {\r\n // inner\r\n var rect = elementRect.rect;\r\n if (rect[mainNames.start] <= targetStart && targetEnd <= rect[mainNames.end]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }).map(function (guideline, i) {\r\n var pos = guideline.pos, size = guideline.size, element = guideline.element, className = guideline.className;\r\n var renderPos = [\r\n -targetPos[0] + pos[0],\r\n -targetPos[1] + pos[1],\r\n ];\r\n return renderInnerGuideline({\r\n key: \"\".concat(type, \"-default-guideline-\").concat(i),\r\n classNames: element ? [prefix(\"bold\"), className] : [prefix(\"normal\"), className],\r\n direction: type,\r\n posValue: renderPos,\r\n sizeValue: size,\r\n zoom: zoom,\r\n }, React);\r\n });\r\n}\r\nfunction renderDigitLine(moveable, type, lineType, index, gap, renderPos, className, React) {\r\n var _a;\r\n var _b = moveable.props, _c = _b.snapDigit, snapDigit = _c === void 0 ? 0 : _c, _d = _b.isDisplaySnapDigit, isDisplaySnapDigit = _d === void 0 ? true : _d, _e = _b.snapDistFormat, snapDistFormat = _e === void 0 ? function (v, type) {\r\n // Type can be used render different values.\r\n if (type === 'vertical') {\r\n return v;\r\n }\r\n return v;\r\n } : _e, zoom = _b.zoom;\r\n var scaleType = type === \"horizontal\" ? \"X\" : \"Y\";\r\n var sizeName = type === \"vertical\" ? \"height\" : \"width\";\r\n var absGap = Math.abs(gap);\r\n var snapSize = isDisplaySnapDigit\r\n ? parseFloat(absGap.toFixed(snapDigit))\r\n : 0;\r\n return React.createElement(\"div\", { key: \"\".concat(type, \"-\").concat(lineType, \"-guideline-\").concat(index), className: prefix(\"guideline-group\", type), style: (_a = {\r\n left: \"\".concat(renderPos[0], \"px\"),\r\n top: \"\".concat(renderPos[1], \"px\")\r\n },\r\n _a[sizeName] = \"\".concat(absGap, \"px\"),\r\n _a) },\r\n renderInnerGuideline({\r\n direction: type,\r\n classNames: [prefix(lineType), className],\r\n size: \"100%\",\r\n posValue: [0, 0],\r\n sizeValue: absGap,\r\n zoom: zoom,\r\n }, React),\r\n React.createElement(\"div\", { className: prefix(\"size-value\", \"gap\"), style: {\r\n transform: \"translate\".concat(scaleType, \"(-50%) scale(\").concat(zoom, \")\"),\r\n } }, snapSize > 0 ? snapDistFormat(snapSize, type) : \"\"));\r\n}\r\nfunction groupByElementGuidelines(type, guidelines, targetRect, isDisplayInnerSnapDigit) {\r\n var index = type === \"vertical\" ? 0 : 1;\r\n var otherIndex = type === \"vertical\" ? 1 : 0;\r\n var names = index ? VERTICAL_NAMES_MAP : HORIZONTAL_NAMES_MAP;\r\n var targetStart = targetRect[names.start];\r\n var targetEnd = targetRect[names.end];\r\n return groupBy(guidelines, function (guideline) {\r\n return guideline.pos[index];\r\n }).map(function (nextGuidelines) {\r\n var start = [];\r\n var end = [];\r\n var inner = [];\r\n nextGuidelines.forEach(function (guideline) {\r\n var _a, _b;\r\n var element = guideline.element;\r\n var rect = guideline.elementRect.rect;\r\n if (rect[names.end] < targetStart) {\r\n start.push(guideline);\r\n }\r\n else if (targetEnd < rect[names.start]) {\r\n end.push(guideline);\r\n }\r\n else if (rect[names.start] <= targetStart && targetEnd <= rect[names.end] && isDisplayInnerSnapDigit) {\r\n var pos = guideline.pos;\r\n var elementRect1 = { element: element, rect: __assign(__assign({}, rect), (_a = {}, _a[names.end] = rect[names.start], _a)) };\r\n var elementRect2 = { element: element, rect: __assign(__assign({}, rect), (_b = {}, _b[names.start] = rect[names.end], _b)) };\r\n var nextPos1 = [0, 0];\r\n var nextPos2 = [0, 0];\r\n nextPos1[index] = pos[index];\r\n nextPos1[otherIndex] = pos[otherIndex];\r\n nextPos2[index] = pos[index];\r\n nextPos2[otherIndex] = pos[otherIndex] + guideline.size;\r\n start.push({\r\n type: type,\r\n pos: nextPos1,\r\n size: 0,\r\n elementRect: elementRect1,\r\n direction: \"\",\r\n elementDirection: \"end\",\r\n });\r\n end.push({\r\n type: type,\r\n pos: nextPos2,\r\n size: 0,\r\n elementRect: elementRect2,\r\n direction: \"\",\r\n elementDirection: \"start\",\r\n });\r\n // inner.push(guideline);\r\n }\r\n });\r\n start.sort(function (a, b) {\r\n return b.pos[otherIndex] - a.pos[otherIndex];\r\n });\r\n end.sort(function (a, b) {\r\n return a.pos[otherIndex] - b.pos[otherIndex];\r\n });\r\n return {\r\n total: nextGuidelines,\r\n start: start,\r\n end: end,\r\n inner: inner,\r\n };\r\n });\r\n}\r\nfunction renderDashedGuidelines(moveable, guidelines, targetPos, targetRect, React) {\r\n var isDisplayInnerSnapDigit = moveable.props.isDisplayInnerSnapDigit;\r\n var rendered = [];\r\n [\"vertical\", \"horizontal\"].forEach(function (type) {\r\n var nextGuidelines = guidelines.filter(function (guideline) { return guideline.type === type; });\r\n var index = type === \"vertical\" ? 1 : 0;\r\n var otherIndex = index ? 0 : 1;\r\n var groups = groupByElementGuidelines(type, nextGuidelines, targetRect, isDisplayInnerSnapDigit);\r\n var mainNames = index ? HORIZONTAL_NAMES_MAP : VERTICAL_NAMES_MAP;\r\n var sideNames = index ? VERTICAL_NAMES_MAP : HORIZONTAL_NAMES_MAP;\r\n var targetStart = targetRect[mainNames.start];\r\n var targetEnd = targetRect[mainNames.end];\r\n groups.forEach(function (_a) {\r\n var total = _a.total, start = _a.start, end = _a.end, inner = _a.inner;\r\n var sidePos = targetPos[otherIndex] + total[0].pos[otherIndex] - targetRect[sideNames.start];\r\n var prevRect = targetRect;\r\n start.forEach(function (guideline) {\r\n var nextRect = guideline.elementRect.rect;\r\n var size = prevRect[mainNames.start] - nextRect[mainNames.end];\r\n if (size > 0) {\r\n var renderPos = [0, 0];\r\n renderPos[index] = targetPos[index] + prevRect[mainNames.start] - targetStart - size;\r\n renderPos[otherIndex] = sidePos;\r\n rendered.push(renderDigitLine(moveable, type, \"dashed\", rendered.length, size, renderPos, guideline.className, React));\r\n }\r\n prevRect = nextRect;\r\n });\r\n prevRect = targetRect;\r\n end.forEach(function (guideline) {\r\n var nextRect = guideline.elementRect.rect;\r\n var size = nextRect[mainNames.start] - prevRect[mainNames.end];\r\n if (size > 0) {\r\n var renderPos = [0, 0];\r\n renderPos[index] = targetPos[index] + prevRect[mainNames.end] - targetStart;\r\n renderPos[otherIndex] = sidePos;\r\n rendered.push(renderDigitLine(moveable, type, \"dashed\", rendered.length, size, renderPos, guideline.className, React));\r\n }\r\n prevRect = nextRect;\r\n });\r\n inner.forEach(function (guideline) {\r\n var nextRect = guideline.elementRect.rect;\r\n var size1 = targetStart - nextRect[mainNames.start];\r\n var size2 = nextRect[mainNames.end] - targetEnd;\r\n var renderPos1 = [0, 0];\r\n var renderPos2 = [0, 0];\r\n renderPos1[index] = targetPos[index] - size1;\r\n renderPos1[otherIndex] = sidePos;\r\n renderPos2[index] = targetPos[index] + targetEnd - targetStart;\r\n renderPos2[otherIndex] = sidePos;\r\n rendered.push(renderDigitLine(moveable, type, \"dashed\", rendered.length, size1, renderPos1, guideline.className, React));\r\n rendered.push(renderDigitLine(moveable, type, \"dashed\", rendered.length, size2, renderPos2, guideline.className, React));\r\n });\r\n });\r\n });\r\n return rendered;\r\n}\r\nfunction renderGapGuidelines(moveable, guidelines, targetPos, targetRect, React) {\r\n var rendered = [];\r\n [\"horizontal\", \"vertical\"].forEach(function (type) {\r\n var nextGuidelines = guidelines.filter(function (guideline) { return guideline.type === type; }).slice(0, 1);\r\n var index = type === \"vertical\" ? 0 : 1;\r\n var otherIndex = index ? 0 : 1;\r\n var mainNames = index ? HORIZONTAL_NAMES_MAP : VERTICAL_NAMES_MAP;\r\n var sideNames = index ? VERTICAL_NAMES_MAP : HORIZONTAL_NAMES_MAP;\r\n var targetStart = targetRect[mainNames.start];\r\n var targetEnd = targetRect[mainNames.end];\r\n var targetSideStart = targetRect[sideNames.start];\r\n var targetSideEnd = targetRect[sideNames.end];\r\n nextGuidelines.forEach(function (_a) {\r\n var gap = _a.gap, gapRects = _a.gapRects;\r\n var sideStartPos = Math.max.apply(Math, __spreadArray([targetSideStart], __read(gapRects.map(function (_a) {\r\n var rect = _a.rect;\r\n return rect[sideNames.start];\r\n })), false));\r\n var sideEndPos = Math.min.apply(Math, __spreadArray([targetSideEnd], __read(gapRects.map(function (_a) {\r\n var rect = _a.rect;\r\n return rect[sideNames.end];\r\n })), false));\r\n var sideCenterPos = (sideStartPos + sideEndPos) / 2;\r\n if (sideStartPos === sideEndPos || sideCenterPos === (targetSideStart + targetSideEnd) / 2) {\r\n return;\r\n }\r\n gapRects.forEach(function (_a) {\r\n var rect = _a.rect, className = _a.className;\r\n var renderPos = [targetPos[0], targetPos[1]];\r\n if (rect[mainNames.end] < targetStart) {\r\n renderPos[index] += rect[mainNames.end] - targetStart;\r\n }\r\n else if (targetEnd < rect[mainNames.start]) {\r\n renderPos[index] += rect[mainNames.start] - targetStart - gap;\r\n }\r\n else {\r\n return;\r\n }\r\n renderPos[otherIndex] += sideCenterPos - targetSideStart;\r\n rendered.push(renderDigitLine(moveable, index ? \"vertical\" : \"horizontal\", \"gap\", rendered.length, gap, renderPos, className, React));\r\n });\r\n });\r\n });\r\n return rendered;\r\n}\n\nfunction getTotalGuidelines(moveable) {\r\n var state = moveable.state;\r\n var containerClientRect = state.containerClientRect, hasFixed = state.hasFixed;\r\n var overflow = containerClientRect.overflow, containerHeight = containerClientRect.scrollHeight, containerWidth = containerClientRect.scrollWidth, containerClientHeight = containerClientRect.clientHeight, containerClientWidth = containerClientRect.clientWidth, clientLeft = containerClientRect.clientLeft, clientTop = containerClientRect.clientTop;\r\n var _a = moveable.props, _b = _a.snapGap, snapGap = _b === void 0 ? true : _b, verticalGuidelines = _a.verticalGuidelines, horizontalGuidelines = _a.horizontalGuidelines, _c = _a.snapThreshold, snapThreshold = _c === void 0 ? 5 : _c, _d = _a.snapGridWidth, snapGridWidth = _d === void 0 ? 0 : _d, _e = _a.snapGridHeight, snapGridHeight = _e === void 0 ? 0 : _e, _f = _a.maxSnapElementGuidelineDistance, maxSnapElementGuidelineDistance = _f === void 0 ? Infinity : _f, isDisplayGridGuidelines = _a.isDisplayGridGuidelines;\r\n var _g = getRect(getAbsolutePosesByState(moveable.state)), top = _g.top, left = _g.left, bottom = _g.bottom, right = _g.right;\r\n var targetRect = { top: top, left: left, bottom: bottom, right: right, center: (left + right) / 2, middle: (top + bottom) / 2 };\r\n var elementGuidelines = getElementGuidelines(moveable);\r\n var totalGuidelines = __spreadArray([], __read(elementGuidelines), false);\r\n if (snapGap) {\r\n totalGuidelines.push.apply(totalGuidelines, __spreadArray([], __read(getGapGuidelines(moveable, targetRect, snapThreshold)), false));\r\n }\r\n var snapOffset = __assign({}, (state.snapOffset || {\r\n left: 0,\r\n top: 0,\r\n bottom: 0,\r\n right: 0,\r\n }));\r\n totalGuidelines.push.apply(totalGuidelines, __spreadArray([], __read(getGridGuidelines(snapGridWidth, snapGridHeight, overflow ? containerWidth : containerClientWidth, overflow ? containerHeight : containerClientHeight, clientLeft, clientTop, snapOffset, isDisplayGridGuidelines)), false));\r\n if (hasFixed) {\r\n var left_1 = containerClientRect.left, top_1 = containerClientRect.top;\r\n snapOffset.left += left_1;\r\n snapOffset.top += top_1;\r\n snapOffset.right += left_1;\r\n snapOffset.bottom += top_1;\r\n }\r\n totalGuidelines.push.apply(totalGuidelines, __spreadArray([], __read(getDefaultGuidelines(horizontalGuidelines || false, verticalGuidelines || false, overflow ? containerWidth : containerClientWidth, overflow ? containerHeight : containerClientHeight, clientLeft, clientTop, snapOffset)), false));\r\n totalGuidelines = totalGuidelines.filter(function (_a) {\r\n var element = _a.element, elementRect = _a.elementRect, type = _a.type;\r\n if (!element || !elementRect) {\r\n return true;\r\n }\r\n var rect = elementRect.rect;\r\n return checkBetweenRects(targetRect, rect, type, maxSnapElementGuidelineDistance);\r\n });\r\n return totalGuidelines;\r\n}\r\nfunction getGapGuidelines(moveable, targetRect, snapThreshold) {\r\n var _a = moveable.props, _b = _a.maxSnapElementGuidelineDistance, maxSnapElementGuidelineDistance = _b === void 0 ? Infinity : _b, _c = _a.maxSnapElementGapDistance, maxSnapElementGapDistance = _c === void 0 ? Infinity : _c;\r\n var elementRects = moveable.state.elementRects;\r\n var gapGuidelines = [];\r\n [\r\n [\"vertical\", VERTICAL_NAMES_MAP, HORIZONTAL_NAMES_MAP],\r\n [\"horizontal\", HORIZONTAL_NAMES_MAP, VERTICAL_NAMES_MAP],\r\n ].forEach(function (_a) {\r\n var _b = __read(_a, 3), type = _b[0], mainNames = _b[1], sideNames = _b[2];\r\n var targetStart = targetRect[mainNames.start];\r\n var targetEnd = targetRect[mainNames.end];\r\n var targetCenter = targetRect[mainNames.center];\r\n var targetStart2 = targetRect[sideNames.start];\r\n var targetEnd2 = targetRect[sideNames.end];\r\n // element : moveable\r\n function getDist(elementRect) {\r\n var rect = elementRect.rect;\r\n if (rect[mainNames.end] < targetStart + snapThreshold) {\r\n return targetStart - rect[mainNames.end];\r\n }\r\n else if (targetEnd - snapThreshold < rect[mainNames.start]) {\r\n return rect[mainNames.start] - targetEnd;\r\n }\r\n else {\r\n return -1;\r\n }\r\n }\r\n var nextElementRects = elementRects.filter(function (elementRect) {\r\n var rect = elementRect.rect;\r\n if (rect[sideNames.start] > targetEnd2 || rect[sideNames.end] < targetStart2) {\r\n return false;\r\n }\r\n return getDist(elementRect) > 0;\r\n }).sort(function (a, b) {\r\n return getDist(a) - getDist(b);\r\n });\r\n var groups = [];\r\n nextElementRects.forEach(function (snapRect1) {\r\n nextElementRects.forEach(function (snapRect2) {\r\n if (snapRect1 === snapRect2) {\r\n return;\r\n }\r\n var rect1 = snapRect1.rect;\r\n var rect2 = snapRect2.rect;\r\n var rect1Start = rect1[sideNames.start];\r\n var rect1End = rect1[sideNames.end];\r\n var rect2Start = rect2[sideNames.start];\r\n var rect2End = rect2[sideNames.end];\r\n if (rect1Start > rect2End || rect2Start > rect1End) {\r\n return;\r\n }\r\n groups.push([snapRect1, snapRect2]);\r\n });\r\n });\r\n groups.forEach(function (_a) {\r\n var _b = __read(_a, 2), snapRect1 = _b[0], snapRect2 = _b[1];\r\n var rect1 = snapRect1.rect;\r\n var rect2 = snapRect2.rect;\r\n var rect1Start = rect1[mainNames.start];\r\n var rect1End = rect1[mainNames.end];\r\n var rect2Start = rect2[mainNames.start];\r\n var rect2End = rect2[mainNames.end];\r\n var gap = 0;\r\n var pos = 0;\r\n var isStart = false;\r\n var isCenter = false;\r\n var isEnd = false;\r\n if (rect1End <= targetStart && targetEnd <= rect2Start) {\r\n // (l)element1(r) : (l)target(r) : (l)element2(r)\r\n isCenter = true;\r\n gap = ((rect2Start - rect1End) - (targetEnd - targetStart)) / 2;\r\n pos = rect1End + gap + (targetEnd - targetStart) / 2;\r\n if (abs(pos - targetCenter) > snapThreshold) {\r\n return;\r\n }\r\n }\r\n else if (rect1End < rect2Start && rect2End < targetStart + snapThreshold) {\r\n // (l)element1(r) : (l)element2(r) : (l)target\r\n isStart = true;\r\n gap = rect2Start - rect1End;\r\n pos = rect2End + gap;\r\n if (abs(pos - targetStart) > snapThreshold) {\r\n return;\r\n }\r\n }\r\n else if (rect1End < rect2Start && targetEnd - snapThreshold < rect1Start) {\r\n // target(r) : (l)element1(r) : (l)element2(r)\r\n isEnd = true;\r\n gap = rect2Start - rect1End;\r\n pos = rect1Start - gap;\r\n if (abs(pos - targetEnd) > snapThreshold) {\r\n return;\r\n }\r\n }\r\n else {\r\n return;\r\n }\r\n if (!gap) {\r\n return;\r\n }\r\n if (!checkBetweenRects(targetRect, rect2, type, maxSnapElementGuidelineDistance)) {\r\n return;\r\n }\r\n if (gap > maxSnapElementGapDistance) {\r\n return;\r\n }\r\n gapGuidelines.push({\r\n type: type,\r\n pos: type === \"vertical\" ? [pos, 0] : [0, pos],\r\n element: snapRect2.element,\r\n size: 0,\r\n className: snapRect2.className,\r\n isStart: isStart,\r\n isCenter: isCenter,\r\n isEnd: isEnd,\r\n gap: gap,\r\n hide: true,\r\n gapRects: [snapRect1, snapRect2],\r\n direction: \"\",\r\n elementDirection: \"\",\r\n });\r\n });\r\n });\r\n return gapGuidelines;\r\n}\r\nfunction getGridGuidelines(snapGridWidth, snapGridHeight, containerWidth, containerHeight, clientLeft, clientTop, snapOffset, isDisplayGridGuidelines) {\r\n if (clientLeft === void 0) { clientLeft = 0; }\r\n if (clientTop === void 0) { clientTop = 0; }\r\n var guidelines = [];\r\n var snapOffsetLeft = snapOffset.left, snapOffsetTop = snapOffset.top;\r\n if (snapGridHeight) {\r\n for (var pos = 0; pos <= containerHeight; pos += snapGridHeight) {\r\n guidelines.push({\r\n type: \"horizontal\",\r\n pos: [\r\n snapOffsetLeft,\r\n throttle(pos - clientTop + snapOffsetTop, 0.1),\r\n ],\r\n className: prefix(\"grid-guideline\"),\r\n size: containerWidth,\r\n hide: !isDisplayGridGuidelines,\r\n direction: \"\",\r\n });\r\n }\r\n }\r\n if (snapGridWidth) {\r\n for (var pos = 0; pos <= containerWidth; pos += snapGridWidth) {\r\n guidelines.push({\r\n type: \"vertical\",\r\n pos: [\r\n throttle(pos - clientLeft + snapOffsetLeft, 0.1),\r\n snapOffsetTop,\r\n ],\r\n className: prefix(\"grid-guideline\"),\r\n size: containerHeight,\r\n hide: !isDisplayGridGuidelines,\r\n direction: \"\",\r\n });\r\n }\r\n }\r\n return guidelines;\r\n}\r\nfunction checkBetweenRects(rect1, rect2, type, distance) {\r\n if (type === \"horizontal\") {\r\n return abs(rect1.right - rect2.left) <= distance\r\n || abs(rect1.left - rect2.right) <= distance\r\n || rect1.left <= rect2.right && rect2.left <= rect1.right;\r\n }\r\n else if (type === \"vertical\") {\r\n return abs(rect1.bottom - rect2.top) <= distance\r\n || abs(rect1.top - rect2.bottom) <= distance\r\n || rect1.top <= rect2.bottom && rect2.top <= rect1.bottom;\r\n }\r\n return true;\r\n}\r\nfunction getElementGuidelines(moveable) {\r\n var state = moveable.state;\r\n var _a = moveable.props.elementGuidelines, elementGuidelines = _a === void 0 ? [] : _a;\r\n if (!elementGuidelines.length) {\r\n state.elementRects = [];\r\n return [];\r\n }\r\n var prevValues = (state.elementRects || []).filter(function (snapRect) { return !snapRect.refresh; });\r\n var nextElementGuidelines = elementGuidelines.map(function (el) {\r\n if (isObject(el) && \"element\" in el) {\r\n return __assign(__assign({}, el), { element: getRefTarget(el.element, true) });\r\n }\r\n return {\r\n element: getRefTarget(el, true),\r\n };\r\n }).filter(function (value) {\r\n return value.element;\r\n });\r\n var _b = diff(prevValues.map(function (v) { return v.element; }), nextElementGuidelines.map(function (v) { return v.element; })), maintained = _b.maintained, added = _b.added;\r\n var nextValues = [];\r\n maintained.forEach(function (_a) {\r\n var _b = __read(_a, 2), prevIndex = _b[0], nextIndex = _b[1];\r\n nextValues[nextIndex] = prevValues[prevIndex];\r\n });\r\n getSnapElementRects(moveable, added.map(function (index) { return nextElementGuidelines[index]; })).map(function (rect, i) {\r\n nextValues[added[i]] = rect;\r\n });\r\n state.elementRects = nextValues;\r\n var elementSnapDirections = getSnapDirections(moveable.props.elementSnapDirections);\r\n var nextGuidelines = [];\r\n nextValues.forEach(function (snapRect) {\r\n var element = snapRect.element, _a = snapRect.top, topValue = _a === void 0 ? elementSnapDirections.top : _a, _b = snapRect.left, leftValue = _b === void 0 ? elementSnapDirections.left : _b, _c = snapRect.right, rightValue = _c === void 0 ? elementSnapDirections.right : _c, _d = snapRect.bottom, bottomValue = _d === void 0 ? elementSnapDirections.bottom : _d, _e = snapRect.center, centerValue = _e === void 0 ? elementSnapDirections.center : _e, _f = snapRect.middle, middleValue = _f === void 0 ? elementSnapDirections.middle : _f, className = snapRect.className, rect = snapRect.rect;\r\n var _g = splitSnapDirectionPoses({\r\n top: topValue,\r\n right: rightValue,\r\n left: leftValue,\r\n bottom: bottomValue,\r\n center: centerValue,\r\n middle: middleValue,\r\n }, rect), horizontal = _g.horizontal, vertical = _g.vertical, horizontalNames = _g.horizontalNames, verticalNames = _g.verticalNames;\r\n var rectTop = rect.top;\r\n var rectLeft = rect.left;\r\n var width = rect.right - rectLeft;\r\n var height = rect.bottom - rectTop;\r\n var sizes = [width, height];\r\n vertical.forEach(function (pos, i) {\r\n nextGuidelines.push({\r\n type: \"vertical\",\r\n element: element,\r\n pos: [\r\n throttle(pos, 0.1),\r\n rectTop,\r\n ], size: height,\r\n sizes: sizes,\r\n className: className,\r\n elementRect: snapRect,\r\n elementDirection: SNAP_SKIP_NAMES_MAP[verticalNames[i]] || verticalNames[i],\r\n direction: \"\",\r\n });\r\n });\r\n horizontal.forEach(function (pos, i) {\r\n nextGuidelines.push({\r\n type: \"horizontal\",\r\n element: element,\r\n pos: [\r\n rectLeft,\r\n throttle(pos, 0.1),\r\n ],\r\n size: width,\r\n sizes: sizes,\r\n className: className,\r\n elementRect: snapRect,\r\n elementDirection: SNAP_SKIP_NAMES_MAP[horizontalNames[i]] || horizontalNames[i],\r\n direction: \"\",\r\n });\r\n });\r\n });\r\n return nextGuidelines;\r\n}\r\nfunction getObjectGuidelines(guidelines, containerSize) {\r\n return guidelines ? guidelines.map(function (info) {\r\n var posGuideline = isObject(info) ? info : { pos: info };\r\n var pos = posGuideline.pos;\r\n if (isNumber(pos)) {\r\n return posGuideline;\r\n }\r\n else {\r\n return __assign(__assign({}, posGuideline), { pos: convertUnitSize(pos, containerSize) });\r\n }\r\n }) : [];\r\n}\r\nfunction getDefaultGuidelines(horizontalGuidelines, verticalGuidelines, width, height, clientLeft, clientTop, snapOffset) {\r\n if (clientLeft === void 0) { clientLeft = 0; }\r\n if (clientTop === void 0) { clientTop = 0; }\r\n if (snapOffset === void 0) { snapOffset = { left: 0, top: 0, right: 0, bottom: 0 }; }\r\n var guidelines = [];\r\n var snapOffsetLeft = snapOffset.left, snapOffsetTop = snapOffset.top, snapOffsetBottom = snapOffset.bottom, snapOffsetRight = snapOffset.right;\r\n var snapWidth = width + snapOffsetRight - snapOffsetLeft;\r\n var snapHeight = height + snapOffsetBottom - snapOffsetTop;\r\n getObjectGuidelines(horizontalGuidelines, snapHeight).forEach(function (posInfo) {\r\n guidelines.push({\r\n type: \"horizontal\",\r\n pos: [\r\n snapOffsetLeft,\r\n throttle(posInfo.pos - clientTop + snapOffsetTop, 0.1),\r\n ],\r\n size: snapWidth,\r\n className: posInfo.className,\r\n direction: \"\",\r\n });\r\n });\r\n getObjectGuidelines(verticalGuidelines, snapWidth).forEach(function (posInfo) {\r\n guidelines.push({\r\n type: \"vertical\",\r\n pos: [\r\n throttle(posInfo.pos - clientLeft + snapOffsetLeft, 0.1),\r\n snapOffsetTop,\r\n ],\r\n size: snapHeight,\r\n className: posInfo.className,\r\n direction: \"\",\r\n });\r\n });\r\n return guidelines;\r\n}\r\nfunction getSnapElementRects(moveable, values) {\r\n if (!values.length) {\r\n return [];\r\n }\r\n var groupable = moveable.props.groupable;\r\n var state = moveable.state;\r\n var containerClientRect = state.containerClientRect, \r\n // targetClientRect: {\r\n // top: clientTop,\r\n // left: clientLeft,\r\n // },\r\n rootMatrix = state.rootMatrix, is3d = state.is3d, offsetDelta = state.offsetDelta;\r\n var n = is3d ? 4 : 3;\r\n var _a = __read(calculateContainerPos(rootMatrix, containerClientRect, n), 2), containerLeft = _a[0], containerTop = _a[1];\r\n // const poses = getAbsolutePosesByState(state);\r\n // const {\r\n // minX: targetLeft,\r\n // minY: targetTop,\r\n // } = getMinMaxs(poses);\r\n // const [distLeft, distTop] = minus([targetLeft, targetTop], calculateInversePosition(rootMatrix, [\r\n // clientLeft - containerLeft,\r\n // clientTop - containerTop,\r\n // ], n)).map(pos => roundSign(pos));\r\n var offsetLeft = groupable ? 0 : offsetDelta[0];\r\n var offsetTop = groupable ? 0 : offsetDelta[1];\r\n return values.map(function (value) {\r\n var rect = value.element.getBoundingClientRect();\r\n var left = rect.left - containerLeft - offsetLeft;\r\n var top = rect.top - containerTop - offsetTop;\r\n var bottom = top + rect.height;\r\n var right = left + rect.width;\r\n var _a = __read(calculateInversePosition(rootMatrix, [left, top], n), 2), elementLeft = _a[0], elementTop = _a[1];\r\n var _b = __read(calculateInversePosition(rootMatrix, [right, bottom], n), 2), elementRight = _b[0], elementBottom = _b[1];\r\n return __assign(__assign({}, value), { rect: {\r\n left: elementLeft,\r\n right: elementRight,\r\n top: elementTop,\r\n bottom: elementBottom,\r\n center: (elementLeft + elementRight) / 2,\r\n middle: (elementTop + elementBottom) / 2,\r\n } });\r\n });\r\n}\n\nfunction checkSnapInfo(moveable) {\r\n var state = moveable.state;\r\n var container = state.container;\r\n var snapContainer = moveable.props.snapContainer || container;\r\n if (state.snapContainer === snapContainer && state.guidelines && state.guidelines.length) {\r\n return false;\r\n }\r\n var containerClientRect = state.containerClientRect;\r\n var snapOffset = {\r\n left: 0,\r\n top: 0,\r\n bottom: 0,\r\n right: 0,\r\n };\r\n if (container !== snapContainer) {\r\n var snapContainerTarget = getRefTarget(snapContainer, true);\r\n if (snapContainerTarget) {\r\n var snapContainerRect = getClientRect(snapContainerTarget);\r\n var offset1 = getDragDistByState(state, [\r\n snapContainerRect.left - containerClientRect.left,\r\n snapContainerRect.top - containerClientRect.top,\r\n ]);\r\n var offset2 = getDragDistByState(state, [\r\n snapContainerRect.right - containerClientRect.right,\r\n snapContainerRect.bottom - containerClientRect.bottom,\r\n ]);\r\n snapOffset.left = throttle(offset1[0], 0.00001);\r\n snapOffset.top = throttle(offset1[1], 0.00001);\r\n snapOffset.right = throttle(offset2[0], 0.00001);\r\n snapOffset.bottom = throttle(offset2[1], 0.00001);\r\n }\r\n }\r\n state.snapContainer = snapContainer;\r\n state.snapOffset = snapOffset;\r\n state.guidelines = getTotalGuidelines(moveable);\r\n state.enableSnap = true;\r\n return true;\r\n}\r\nfunction getNextFixedPoses(matrix, width, height, fixedDirection, fixedPos, is3d) {\r\n var nextPoses = calculatePoses(matrix, width, height, is3d ? 4 : 3);\r\n var nextFixedPos = getPosByDirection(nextPoses, fixedDirection);\r\n return getAbsolutePoses(nextPoses, minus(fixedPos, nextFixedPos));\r\n}\r\nfunction normalized(value) {\r\n return value ? value / abs(value) : 0;\r\n}\r\nfunction getSizeOffsetInfo(moveable, poses, direction, keepRatio, isRequest, datas) {\r\n var fixedDirection = datas.fixedDirection;\r\n var directions = getCheckSnapDirections(direction, fixedDirection, keepRatio);\r\n var innerBoundLineInfos = getCheckInnerBoundLineInfos(moveable, poses, direction, keepRatio);\r\n var offsets = __spreadArray(__spreadArray([], __read(getSnapBoundInfo(moveable, poses, directions, keepRatio, isRequest, datas)), false), __read(getInnerBoundInfo(moveable, innerBoundLineInfos, datas)), false);\r\n var widthOffsetInfo = getNearOffsetInfo(offsets, 0);\r\n var heightOffsetInfo = getNearOffsetInfo(offsets, 1);\r\n return {\r\n width: {\r\n isBound: widthOffsetInfo.isBound,\r\n offset: widthOffsetInfo.offset[0],\r\n },\r\n height: {\r\n isBound: heightOffsetInfo.isBound,\r\n offset: heightOffsetInfo.offset[1],\r\n },\r\n };\r\n}\r\nfunction recheckSizeByTwoDirection(moveable, poses, width, height, maxWidth, maxHeight, direction, isRequest, datas) {\r\n var snapPos = getPosByDirection(poses, direction);\r\n var _a = checkMoveableSnapBounds(moveable, isRequest, {\r\n vertical: [snapPos[0]],\r\n horizontal: [snapPos[1]],\r\n }), horizontalOffset = _a.horizontal.offset, verticalOffset = _a.vertical.offset;\r\n if (throttle(verticalOffset, FLOAT_POINT_NUM) || throttle(horizontalOffset, FLOAT_POINT_NUM)) {\r\n var _b = __read(getDragDist({\r\n datas: datas,\r\n distX: -verticalOffset,\r\n distY: -horizontalOffset,\r\n }), 2), nextWidthOffset = _b[0], nextHeightOffset = _b[1];\r\n var nextWidth = Math.min(maxWidth || Infinity, width + direction[0] * nextWidthOffset);\r\n var nextHeight = Math.min(maxHeight || Infinity, height + direction[1] * nextHeightOffset);\r\n return [nextWidth - width, nextHeight - height];\r\n }\r\n return [0, 0];\r\n}\r\nfunction checkSizeDist(moveable, getNextPoses, width, height, direction, fixedPosition, isRequest, datas) {\r\n var poses = getAbsolutePosesByState(moveable.state);\r\n var keepRatio = moveable.props.keepRatio;\r\n var widthOffset = 0;\r\n var heightOffset = 0;\r\n for (var i = 0; i < 2; ++i) {\r\n var nextPoses = getNextPoses(widthOffset, heightOffset);\r\n var _a = getSizeOffsetInfo(moveable, nextPoses, direction, keepRatio, isRequest, datas), widthOffsetInfo = _a.width, heightOffsetInfo = _a.height;\r\n var isWidthBound = widthOffsetInfo.isBound;\r\n var isHeightBound = heightOffsetInfo.isBound;\r\n var nextWidthOffset = widthOffsetInfo.offset;\r\n var nextHeightOffset = heightOffsetInfo.offset;\r\n if (i === 1) {\r\n if (!isWidthBound) {\r\n nextWidthOffset = 0;\r\n }\r\n if (!isHeightBound) {\r\n nextHeightOffset = 0;\r\n }\r\n }\r\n if (i === 0 && isRequest && !isWidthBound && !isHeightBound) {\r\n return [0, 0];\r\n }\r\n if (keepRatio) {\r\n var widthDist = abs(nextWidthOffset) * (width ? 1 / width : 1);\r\n var heightDist = abs(nextHeightOffset) * (height ? 1 / height : 1);\r\n var isGetWidthOffset = isWidthBound && isHeightBound\r\n ? widthDist < heightDist\r\n : isHeightBound ||\r\n (!isWidthBound && widthDist < heightDist);\r\n if (isGetWidthOffset) {\r\n // width : height = ? : heightOffset\r\n nextWidthOffset = (width * nextHeightOffset) / height;\r\n }\r\n else {\r\n // width : height = widthOffset : ?\r\n nextHeightOffset = (height * nextWidthOffset) / width;\r\n }\r\n }\r\n widthOffset += nextWidthOffset;\r\n heightOffset += nextHeightOffset;\r\n }\r\n if (!keepRatio && direction[0] && direction[1]) {\r\n var _b = checkMaxBounds(moveable, poses, direction, fixedPosition, datas), maxWidth = _b.maxWidth, maxHeight = _b.maxHeight;\r\n var _c = __read(recheckSizeByTwoDirection(moveable, getNextPoses(widthOffset, heightOffset).map(function (pos) { return pos.map(function (p) { return throttle(p, FLOAT_POINT_NUM); }); }), width + widthOffset, height + heightOffset, maxWidth, maxHeight, direction, isRequest, datas), 2), nextWidthOffset = _c[0], nextHeightOffset = _c[1];\r\n widthOffset += nextWidthOffset;\r\n heightOffset += nextHeightOffset;\r\n }\r\n return [widthOffset, heightOffset];\r\n}\r\nfunction absDegree(deg) {\r\n if (deg < 0) {\r\n deg = deg % 360 + 360;\r\n }\r\n deg %= 360;\r\n return deg;\r\n}\r\nfunction bumpDegree(baseDeg, snapDeg) {\r\n // baseDeg -80\r\n // snapDeg 270\r\n // return -90\r\n snapDeg = absDegree(snapDeg);\r\n var count = Math.floor(baseDeg / 360);\r\n var deg1 = count * 360 + 360 - snapDeg;\r\n var deg2 = count * 360 + snapDeg;\r\n return abs(baseDeg - deg1) < abs(baseDeg - deg2) ? deg1 : deg2;\r\n}\r\nfunction getMinDegreeDistance(deg1, deg2) {\r\n deg1 = absDegree(deg1);\r\n deg2 = absDegree(deg2);\r\n var deg3 = absDegree(deg1 - deg2);\r\n return Math.min(deg3, 360 - deg3);\r\n}\r\nfunction checkSnapRotate(moveable, rect, dist, rotation) {\r\n var _a;\r\n var props = moveable.props;\r\n var snapRotationThreshold = (_a = props[NAME_snapRotationThreshold]) !== null && _a !== void 0 ? _a : 5;\r\n var snapRotationDegrees = props[NAME_snapRotationDegrees];\r\n if (hasGuidelines(moveable, \"rotatable\")) {\r\n var pos1 = rect.pos1, pos2 = rect.pos2, pos3 = rect.pos3, pos4 = rect.pos4, origin2_1 = rect.origin;\r\n var rad_1 = (dist * Math.PI) / 180;\r\n var prevPoses = [pos1, pos2, pos3, pos4].map(function (pos) { return minus(pos, origin2_1); });\r\n var nextPoses = prevPoses.map(function (pos) { return rotate(pos, rad_1); });\r\n // console.log(moveable.state.left, moveable.state.top, moveable.state.origin);\r\n // console.log(pos1, pos2, pos3, pos4, origin, rad, prevPoses, nextPoses);\r\n var result = __spreadArray(__spreadArray([], __read(checkRotateBounds(moveable, prevPoses, nextPoses, origin2_1, dist)), false), __read(checkRotateInnerBounds(moveable, prevPoses, nextPoses, origin2_1, dist)), false);\r\n result.sort(function (a, b) { return abs(a - dist) - abs(b - dist); });\r\n var isSnap = result.length > 0;\r\n if (isSnap) {\r\n return {\r\n isSnap: isSnap,\r\n dist: isSnap ? result[0] : dist,\r\n };\r\n }\r\n }\r\n if ((snapRotationDegrees === null || snapRotationDegrees === void 0 ? void 0 : snapRotationDegrees.length) && snapRotationThreshold) {\r\n var sorted = snapRotationDegrees.slice().sort(function (a, b) {\r\n return getMinDegreeDistance(a, rotation) - getMinDegreeDistance(b, rotation);\r\n });\r\n var firstDegree = sorted[0];\r\n if (getMinDegreeDistance(firstDegree, rotation) <= snapRotationThreshold) {\r\n return {\r\n isSnap: true,\r\n dist: dist + bumpDegree(rotation, firstDegree) - rotation,\r\n };\r\n }\r\n }\r\n return {\r\n isSnap: false,\r\n dist: dist,\r\n };\r\n}\r\nfunction checkSnapResize(moveable, width, height, direction, fixedPosition, isRequest, datas) {\r\n if (!hasGuidelines(moveable, \"resizable\")) {\r\n return [0, 0];\r\n }\r\n var fixedDirection = datas.fixedDirection, nextAllMatrix = datas.nextAllMatrix;\r\n var _a = moveable.state, allMatrix = _a.allMatrix, is3d = _a.is3d;\r\n return checkSizeDist(moveable, function (widthOffset, heightOffset) {\r\n return getNextFixedPoses(nextAllMatrix || allMatrix, width + widthOffset, height + heightOffset, fixedDirection, fixedPosition, is3d);\r\n }, width, height, direction, fixedPosition, isRequest, datas);\r\n}\r\nfunction checkSnapScale(moveable, scale, direction, isRequest, datas) {\r\n if (!hasGuidelines(moveable, \"scalable\")) {\r\n return [0, 0];\r\n }\r\n var startOffsetWidth = datas.startOffsetWidth, startOffsetHeight = datas.startOffsetHeight, fixedPosition = datas.fixedPosition, fixedDirection = datas.fixedDirection, is3d = datas.is3d;\r\n var sizeDist = checkSizeDist(moveable, function (widthOffset, heightOffset) {\r\n return getNextFixedPoses(scaleMatrix(datas, plus(scale, [widthOffset / startOffsetWidth, heightOffset / startOffsetHeight])), startOffsetWidth, startOffsetHeight, fixedDirection, fixedPosition, is3d);\r\n }, startOffsetWidth, startOffsetHeight, direction, fixedPosition, isRequest, datas);\r\n return [sizeDist[0] / startOffsetWidth, sizeDist[1] / startOffsetHeight];\r\n}\r\nfunction startCheckSnapDrag(moveable, datas) {\r\n datas.absolutePoses = getAbsolutePosesByState(moveable.state);\r\n}\r\nfunction getSnapGuidelines(posInfos) {\r\n var guidelines = [];\r\n posInfos.forEach(function (posInfo) {\r\n posInfo.guidelineInfos.forEach(function (_a) {\r\n var guideline = _a.guideline;\r\n if (find(guidelines, function (info) { return info.guideline === guideline; })) {\r\n return;\r\n }\r\n guideline.direction = \"\";\r\n guidelines.push({ guideline: guideline, posInfo: posInfo });\r\n });\r\n });\r\n return guidelines.map(function (_a) {\r\n var guideline = _a.guideline, posInfo = _a.posInfo;\r\n return __assign(__assign({}, guideline), { direction: posInfo.direction });\r\n });\r\n}\r\nfunction addBoundGuidelines(moveable, verticalPoses, horizontalPoses, verticalSnapPoses, horizontalSnapPoses, externalBounds) {\r\n var _a = checkBoundPoses(getBounds(moveable, externalBounds), verticalPoses, horizontalPoses), verticalBoundInfos = _a.vertical, horizontalBoundInfos = _a.horizontal;\r\n var boundMap = getInitialBounds();\r\n verticalBoundInfos.forEach(function (info) {\r\n if (info.isBound) {\r\n if (info.direction === \"start\") {\r\n boundMap.left = true;\r\n }\r\n if (info.direction === \"end\") {\r\n boundMap.right = true;\r\n }\r\n verticalSnapPoses.push({\r\n type: \"bounds\",\r\n pos: info.pos,\r\n });\r\n }\r\n });\r\n horizontalBoundInfos.forEach(function (info) {\r\n if (info.isBound) {\r\n if (info.direction === \"start\") {\r\n boundMap.top = true;\r\n }\r\n if (info.direction === \"end\") {\r\n boundMap.bottom = true;\r\n }\r\n horizontalSnapPoses.push({\r\n type: \"bounds\",\r\n pos: info.pos,\r\n });\r\n }\r\n });\r\n var _b = checkInnerBoundPoses(moveable), innerBoundMap = _b.boundMap, verticalInnerBoundPoses = _b.vertical, horizontalInnerBoundPoses = _b.horizontal;\r\n verticalInnerBoundPoses.forEach(function (innerPos) {\r\n if (findIndex(verticalSnapPoses, function (_a) {\r\n var type = _a.type, pos = _a.pos;\r\n return type === \"bounds\" && pos === innerPos;\r\n }) >= 0) {\r\n return;\r\n }\r\n verticalSnapPoses.push({\r\n type: \"bounds\",\r\n pos: innerPos,\r\n });\r\n });\r\n horizontalInnerBoundPoses.forEach(function (innerPos) {\r\n if (findIndex(horizontalSnapPoses, function (_a) {\r\n var type = _a.type, pos = _a.pos;\r\n return type === \"bounds\" && pos === innerPos;\r\n }) >= 0) {\r\n return;\r\n }\r\n horizontalSnapPoses.push({\r\n type: \"bounds\",\r\n pos: innerPos,\r\n });\r\n });\r\n return {\r\n boundMap: boundMap,\r\n innerBoundMap: innerBoundMap,\r\n };\r\n}\r\nvar directionCondition$1 = getDirectionCondition(\"\", [\"resizable\", \"scalable\"]);\r\nvar NAME_snapRotationThreshold = \"snapRotationThreshold\";\r\nvar NAME_snapRotationDegrees = \"snapRotationDegrees\";\r\n/**\r\n * @namespace Moveable.Snappable\r\n * @description Whether or not target can be snapped to the guideline. (default: false)\r\n * @sort 2\r\n */\r\nvar Snappable = {\r\n name: \"snappable\",\r\n dragRelation: \"strong\",\r\n props: [\r\n \"snappable\",\r\n \"snapContainer\",\r\n \"snapDirections\",\r\n \"elementSnapDirections\",\r\n \"snapGap\",\r\n \"snapGridWidth\",\r\n \"snapGridHeight\",\r\n \"isDisplaySnapDigit\",\r\n \"isDisplayInnerSnapDigit\",\r\n \"isDisplayGridGuidelines\",\r\n \"snapDigit\",\r\n \"snapThreshold\",\r\n \"snapRenderThreshold\",\r\n NAME_snapRotationThreshold,\r\n NAME_snapRotationDegrees,\r\n \"horizontalGuidelines\",\r\n \"verticalGuidelines\",\r\n \"elementGuidelines\",\r\n \"bounds\",\r\n \"innerBounds\",\r\n \"snapDistFormat\",\r\n \"maxSnapElementGuidelineDistance\",\r\n \"maxSnapElementGapDistance\",\r\n ],\r\n events: [\"snap\", \"bound\"],\r\n css: [\r\n \":host {\\n--bounds-color: #d66;\\n}\\n.guideline {\\npointer-events: none;\\nz-index: 2;\\n}\\n.guideline.bounds {\\nbackground: #d66;\\nbackground: var(--bounds-color);\\n}\\n.guideline-group {\\nposition: absolute;\\ntop: 0;\\nleft: 0;\\n}\\n.guideline-group .size-value {\\nposition: absolute;\\ncolor: #f55;\\nfont-size: 12px;\\nfont-size: calc(12px * var(--zoom));\\nfont-weight: bold;\\n}\\n.guideline-group.horizontal .size-value {\\ntransform-origin: 50% 100%;\\ntransform: translateX(-50%);\\nleft: 50%;\\nbottom: 5px;\\nbottom: calc(2px + 3px * var(--zoom));\\n}\\n.guideline-group.vertical .size-value {\\ntransform-origin: 0% 50%;\\ntop: 50%;\\ntransform: translateY(-50%);\\nleft: 5px;\\nleft: calc(2px + 3px * var(--zoom));\\n}\\n.guideline.gap {\\nbackground: #f55;\\n}\\n.size-value.gap {\\ncolor: #f55;\\n}\\n\",\r\n ],\r\n render: function (moveable, React) {\r\n var state = moveable.state;\r\n var targetTop = state.top, targetLeft = state.left, pos1 = state.pos1, pos2 = state.pos2, pos3 = state.pos3, pos4 = state.pos4, snapRenderInfo = state.snapRenderInfo;\r\n var _a = moveable.props.snapRenderThreshold, snapRenderThreshold = _a === void 0 ? 1 : _a;\r\n if (!snapRenderInfo || !snapRenderInfo.render || !hasGuidelines(moveable, \"\")) {\r\n // reset store\r\n watchValue(moveable, \"boundMap\", getInitialBounds(), function (v) { return JSON.stringify(v); });\r\n watchValue(moveable, \"innerBoundMap\", getInitialBounds(), function (v) { return JSON.stringify(v); });\r\n return [];\r\n }\r\n state.guidelines = getTotalGuidelines(moveable);\r\n var minLeft = Math.min(pos1[0], pos2[0], pos3[0], pos4[0]);\r\n var minTop = Math.min(pos1[1], pos2[1], pos3[1], pos4[1]);\r\n var externalPoses = snapRenderInfo.externalPoses || [];\r\n var poses = getAbsolutePosesByState(moveable.state);\r\n var verticalSnapPoses = [];\r\n var horizontalSnapPoses = [];\r\n var verticalGuidelines = [];\r\n var horizontalGuidelines = [];\r\n var snapInfos = [];\r\n var _b = getRect(poses), width = _b.width, height = _b.height, top = _b.top, left = _b.left, bottom = _b.bottom, right = _b.right;\r\n var targetRect = { left: left, right: right, top: top, bottom: bottom, center: (left + right) / 2, middle: (top + bottom) / 2 };\r\n var hasExternalPoses = externalPoses.length > 0;\r\n var externalRect = hasExternalPoses\r\n ? getRect(externalPoses)\r\n : {};\r\n if (!snapRenderInfo.request) {\r\n if (snapRenderInfo.direction) {\r\n snapInfos.push(getSnapInfosByDirection(moveable, poses, snapRenderInfo.direction, snapRenderThreshold));\r\n }\r\n if (snapRenderInfo.snap) {\r\n var rect = getRect(poses);\r\n if (snapRenderInfo.center) {\r\n rect.middle = (rect.top + rect.bottom) / 2;\r\n rect.center = (rect.left + rect.right) / 2;\r\n }\r\n snapInfos.push(checkSnaps(moveable, rect, snapRenderThreshold));\r\n }\r\n if (hasExternalPoses) {\r\n if (snapRenderInfo.center) {\r\n externalRect.middle =\r\n (externalRect.top + externalRect.bottom) / 2;\r\n externalRect.center =\r\n (externalRect.left + externalRect.right) / 2;\r\n }\r\n snapInfos.push(checkSnaps(moveable, externalRect, snapRenderThreshold));\r\n }\r\n snapInfos.forEach(function (snapInfo) {\r\n var verticalPosInfos = snapInfo.vertical.posInfos, horizontalPosInfos = snapInfo.horizontal.posInfos;\r\n verticalSnapPoses.push.apply(verticalSnapPoses, __spreadArray([], __read(verticalPosInfos.filter(function (_a) {\r\n var guidelineInfos = _a.guidelineInfos;\r\n return guidelineInfos.some(function (_a) {\r\n var guideline = _a.guideline;\r\n return !guideline.hide;\r\n });\r\n }).map(function (posInfo) { return ({\r\n type: \"snap\",\r\n pos: posInfo.pos,\r\n }); })), false));\r\n horizontalSnapPoses.push.apply(horizontalSnapPoses, __spreadArray([], __read(horizontalPosInfos.filter(function (_a) {\r\n var guidelineInfos = _a.guidelineInfos;\r\n return guidelineInfos.some(function (_a) {\r\n var guideline = _a.guideline;\r\n return !guideline.hide;\r\n });\r\n }).map(function (posInfo) { return ({\r\n type: \"snap\",\r\n pos: posInfo.pos,\r\n }); })), false));\r\n verticalGuidelines.push.apply(verticalGuidelines, __spreadArray([], __read(getSnapGuidelines(verticalPosInfos)), false));\r\n horizontalGuidelines.push.apply(horizontalGuidelines, __spreadArray([], __read(getSnapGuidelines(horizontalPosInfos)), false));\r\n });\r\n }\r\n var _c = addBoundGuidelines(moveable, [left, right], [top, bottom], verticalSnapPoses, horizontalSnapPoses), boundMap = _c.boundMap, innerBoundMap = _c.innerBoundMap;\r\n if (hasExternalPoses) {\r\n addBoundGuidelines(moveable, [externalRect.left, externalRect.right], [externalRect.top, externalRect.bottom], verticalSnapPoses, horizontalSnapPoses, snapRenderInfo.externalBounds);\r\n }\r\n var allGuidelines = __spreadArray(__spreadArray([], __read(verticalGuidelines), false), __read(horizontalGuidelines), false);\r\n var elementGuidelines = allGuidelines.filter(function (guideline) { return guideline.element && !guideline.gapRects; });\r\n var gapGuidelines = allGuidelines.filter(function (guideline) { return guideline.gapRects; }).sort(function (a, b) {\r\n return a.gap - b.gap;\r\n });\r\n triggerEvent(moveable, \"onSnap\", {\r\n guidelines: allGuidelines.filter(function (_a) {\r\n var element = _a.element;\r\n return !element;\r\n }),\r\n elements: elementGuidelines,\r\n gaps: gapGuidelines,\r\n }, true);\r\n var nextBoundMap = watchValue(moveable, \"boundMap\", boundMap, function (v) { return JSON.stringify(v); }, getInitialBounds());\r\n var nextInnerBoundMap = watchValue(moveable, \"innerBoundMap\", innerBoundMap, function (v) { return JSON.stringify(v); }, getInitialBounds());\r\n if (boundMap === nextBoundMap || innerBoundMap === nextInnerBoundMap) {\r\n triggerEvent(moveable, \"onBound\", {\r\n bounds: boundMap,\r\n innerBounds: innerBoundMap,\r\n }, true);\r\n }\r\n // verticalSnapPoses.\r\n return __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(renderDashedGuidelines(moveable, elementGuidelines, [minLeft, minTop], targetRect, React)), false), __read(renderGapGuidelines(moveable, gapGuidelines, [minLeft, minTop], targetRect, React)), false), __read(renderGuidelines(moveable, \"horizontal\", horizontalGuidelines, [targetLeft, targetTop], targetRect, React)), false), __read(renderGuidelines(moveable, \"vertical\", verticalGuidelines, [targetLeft, targetTop], targetRect, React)), false), __read(renderSnapPoses(moveable, \"horizontal\", horizontalSnapPoses, minLeft, targetTop, width, 0, React)), false), __read(renderSnapPoses(moveable, \"vertical\", verticalSnapPoses, minTop, targetLeft, height, 1, React)), false);\r\n },\r\n dragStart: function (moveable, e) {\r\n moveable.state.snapRenderInfo = {\r\n request: e.isRequest,\r\n snap: true,\r\n center: true,\r\n };\r\n checkSnapInfo(moveable);\r\n },\r\n drag: function (moveable) {\r\n var state = moveable.state;\r\n if (!checkSnapInfo(moveable)) {\r\n state.guidelines = getTotalGuidelines(moveable);\r\n }\r\n if (state.snapRenderInfo) {\r\n state.snapRenderInfo.render = true;\r\n }\r\n },\r\n pinchStart: function (moveable) {\r\n this.unset(moveable);\r\n },\r\n dragEnd: function (moveable) {\r\n this.unset(moveable);\r\n },\r\n dragControlCondition: function (moveable, e) {\r\n if (directionCondition$1(moveable, e) || dragControlCondition(moveable, e)) {\r\n return true;\r\n }\r\n if (!e.isRequest && e.inputEvent) {\r\n return hasClass(e.inputEvent.target, prefix(\"snap-control\"));\r\n }\r\n },\r\n dragControlStart: function (moveable) {\r\n moveable.state.snapRenderInfo = null;\r\n checkSnapInfo(moveable);\r\n },\r\n dragControl: function (moveable) {\r\n this.drag(moveable);\r\n },\r\n dragControlEnd: function (moveable) {\r\n this.unset(moveable);\r\n },\r\n dragGroupStart: function (moveable, e) {\r\n this.dragStart(moveable, e);\r\n },\r\n dragGroup: function (moveable) {\r\n this.drag(moveable);\r\n },\r\n dragGroupEnd: function (moveable) {\r\n this.unset(moveable);\r\n },\r\n dragGroupControlStart: function (moveable) {\r\n moveable.state.snapRenderInfo = null;\r\n checkSnapInfo(moveable);\r\n },\r\n dragGroupControl: function (moveable) {\r\n this.drag(moveable);\r\n },\r\n dragGroupControlEnd: function (moveable) {\r\n this.unset(moveable);\r\n },\r\n unset: function (moveable) {\r\n var state = moveable.state;\r\n state.enableSnap = false;\r\n state.guidelines = [];\r\n state.snapRenderInfo = null;\r\n state.elementRects = [];\r\n },\r\n};\r\n/**\r\n * Whether or not target can be snapped to the guideline. (default: false)\r\n * @name Moveable.Snappable#snappable\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.snappable = true;\r\n */\r\n/**\r\n * A snap container that is the basis for snap, bounds, and innerBounds. (default: null = container)\r\n * @name Moveable.Snappable#snapContainer\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.querySelector(\".container\"));\r\n *\r\n * moveable.snapContainer = document.body;\r\n */\r\n/**\r\n * You can specify the directions to snap to the target. (default: { left: true, top: true, right: true, bottom: true })\r\n * @name Moveable.Snappable#snapDirections\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * snappable: true,\r\n * snapDirections: true,\r\n * });\r\n * // snap center\r\n * moveable.snapDirections = { left: true, top: true, right: true, bottom: true, center: true, middle: true };\r\n */\r\n/**\r\n * You can specify the snap directions of elements. (default: { left: true, ftrue, right: true, bottom: true })\r\n * @name Moveable.Snappable#elementSnapDirections\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * snappable: true,\r\n * elementSnapDirections: true,\r\n * });\r\n * // snap center\r\n * moveable.elementSnapDirections = { left: true, top: true, right: true, bottom: true, center: true, middle: true };\r\n */\r\n/**\r\n * When you drag, make the gap snap in the element guidelines. (default: true)\r\n * @name Moveable.Snappable#snapGap\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * snappable: true,\r\n * snapElement: true,\r\n * snapGap: true,\r\n * });\r\n *\r\n * moveable.snapGap = false;\r\n */\r\n/**\r\n * Distance value that can snap to guidelines. (default: 5)\r\n * @name Moveable.Snappable#snapThreshold\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.snapThreshold = 5;\r\n */\r\n/**\r\n * Add guidelines in the horizontal direction. (default: [])\r\n * @name Moveable.Snappable#horizontalGuidelines\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.horizontalGuidelines = [100, 200, 500];\r\n */\r\n/**\r\n * Add guidelines in the vertical direction. (default: [])\r\n * @name Moveable.Snappable#verticalGuidelines\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.verticalGuidelines = [100, 200, 500];\r\n */\r\n/**\r\n * Add guidelines for the element. (default: [])\r\n * @name Moveable.Snappable#elementGuidelines\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.elementGuidelines = [\r\n * document.querySelector(\".element\"),\r\n * ];\r\n */\r\n/**\r\n * You can set up boundaries.\r\n * @name Moveable.Snappable#bounds\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @default null\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.bounds = { left: 0, right: 1000, top: 0, bottom: 1000};\r\n */\r\n/**\r\n * You can set up inner boundaries.\r\n * @name Moveable.Snappable#innerBounds\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @default null\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.innerBounds = { left: 500, top: 500, width: 100, height: 100};\r\n */\r\n/**\r\n * snap distance digits (default: 0)\r\n * @name Moveable.Snappable#snapDigit\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.snapDigit = 0\r\n */\r\n/**\r\n * If width size is greater than 0, you can vertical snap to the grid. (default: 0)\r\n * @name Moveable.Snappable#snapGridWidth\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.snapGridWidth = 5;\r\n */\r\n/**\r\n * If height size is greater than 0, you can horizontal snap to the grid. (default: 0)\r\n * @name Moveable.Snappable#snapGridHeight\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.snapGridHeight = 5;\r\n */\r\n/**\r\n * Whether to show snap distance (default: true)\r\n * @name Moveable.Snappable#isDisplaySnapDigit\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.isDisplaySnapDigit = true;\r\n */\r\n/**\r\n * Whether to show element inner snap distance (default: false)\r\n * @name Moveable.Snappable#isDisplayInnerSnapDigit\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.isDisplayInnerSnapDigit = true;\r\n */\r\n/**\r\n * You can set the text format of the distance shown in the guidelines. (default: self)\r\n * @name Moveable.Snappable#snapDistFormat\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * snappable: true,\r\n * snapDistFormat: (v, type) => v,\r\n * });\r\n * moveable.snapDistFormat = (v, type) => `${v}px`;\r\n */\r\n/**\r\n * When you drag or dragControl, the `snap` event is called.\r\n * @memberof Moveable.Snappable\r\n * @event snap\r\n * @param {Moveable.Snappable.OnSnap} - Parameters for the `snap` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * snappable: true\r\n * });\r\n * moveable.on(\"snap\", e => {\r\n * console.log(\"onSnap\", e);\r\n * });\r\n */\n\nfunction multiply2(pos1, pos2) {\r\n return [\r\n pos1[0] * pos2[0],\r\n pos1[1] * pos2[1],\r\n ];\r\n}\r\nfunction prefix() {\r\n var classNames = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n classNames[_i] = arguments[_i];\r\n }\r\n return prefixNames.apply(void 0, __spreadArray([PREFIX], __read(classNames), false));\r\n}\r\nfunction defaultSync(fn) {\r\n fn();\r\n}\r\nfunction getTransformMatrix(transform) {\r\n if (!transform || transform === \"none\") {\r\n return [1, 0, 0, 1, 0, 0];\r\n }\r\n if (isObject(transform)) {\r\n return transform;\r\n }\r\n return parseMat(transform);\r\n}\r\nfunction getAbsoluteMatrix(matrix, n, origin) {\r\n return multiplies(n, createOriginMatrix(origin, n), matrix, createOriginMatrix(origin.map(function (a) { return -a; }), n));\r\n}\r\nfunction measureSVGSize(el, unit, isHorizontal) {\r\n if (unit === \"%\") {\r\n var viewBox = getSVGViewBox(el.ownerSVGElement);\r\n return viewBox[isHorizontal ? \"width\" : \"height\"] / 100;\r\n }\r\n return 1;\r\n}\r\nfunction getBeforeTransformOrigin(el) {\r\n var relativeOrigin = getTransformOrigin(getComputedStyle(el, \":before\"));\r\n return relativeOrigin.map(function (o, i) {\r\n var _a = splitUnit(o), value = _a.value, unit = _a.unit;\r\n return value * measureSVGSize(el, unit, i === 0);\r\n });\r\n}\r\nfunction getTransformOriginArray(transformOrigin) {\r\n return transformOrigin ? transformOrigin.split(\" \") : [\"0\", \"0\"];\r\n}\r\nfunction getTransformOrigin(style) {\r\n return getTransformOriginArray(style.transformOrigin);\r\n}\r\nfunction getElementTransform(target) {\r\n var getStyle = getCachedStyle(target);\r\n var computedTransform = getStyle(\"transform\");\r\n if (computedTransform && computedTransform !== \"none\") {\r\n return computedTransform;\r\n }\r\n if (\"transform\" in target) {\r\n var list = target.transform;\r\n var baseVal = list.baseVal;\r\n if (!baseVal) {\r\n return \"\";\r\n }\r\n var length_1 = baseVal.length;\r\n if (!length_1) {\r\n return \"\";\r\n }\r\n var matrixes = [];\r\n var _loop_1 = function (i) {\r\n var matrix = baseVal[i].matrix;\r\n matrixes.push(\"matrix(\".concat([\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"].map(function (chr) { return matrix[chr]; }).join(\", \"), \")\"));\r\n };\r\n for (var i = 0; i < length_1; ++i) {\r\n _loop_1(i);\r\n }\r\n return matrixes.join(\" \");\r\n }\r\n return \"\";\r\n}\r\nfunction getOffsetInfo(el, lastParent, isParent, checkZoom, getTargetStyle) {\r\n var _a, _b;\r\n var documentElement = getDocumentElement(el) || getDocumentBody(el);\r\n var hasSlot = false;\r\n var target;\r\n var parentSlotElement;\r\n if (!el || isParent) {\r\n target = el;\r\n }\r\n else {\r\n var assignedSlotParentElement = (_a = el === null || el === void 0 ? void 0 : el.assignedSlot) === null || _a === void 0 ? void 0 : _a.parentElement;\r\n var parentElement = el.parentElement;\r\n if (assignedSlotParentElement) {\r\n hasSlot = true;\r\n parentSlotElement = parentElement;\r\n target = assignedSlotParentElement;\r\n }\r\n else {\r\n target = parentElement;\r\n }\r\n }\r\n var isCustomElement = false;\r\n var isEnd = el === lastParent || target === lastParent;\r\n var position = \"relative\";\r\n var offsetZoom = 1;\r\n var targetZoom = parseFloat(getTargetStyle === null || getTargetStyle === void 0 ? void 0 : getTargetStyle(\"zoom\")) || 1;\r\n var targetPosition = getTargetStyle === null || getTargetStyle === void 0 ? void 0 : getTargetStyle(\"position\");\r\n while (target && target !== documentElement) {\r\n if (lastParent === target) {\r\n isEnd = true;\r\n }\r\n var getStyle = getCachedStyle(target);\r\n var tagName = target.tagName.toLowerCase();\r\n var transform = getElementTransform(target);\r\n var willChange = getStyle(\"willChange\");\r\n var zoom = parseFloat(getStyle(\"zoom\")) || 1;\r\n position = getStyle(\"position\");\r\n if (checkZoom && zoom !== 1) {\r\n offsetZoom = zoom;\r\n break;\r\n }\r\n if (\r\n // offsetParent is the parentElement if the target's zoom is not 1 and not absolute.\r\n !isParent && checkZoom && targetZoom !== 1 && targetPosition && targetPosition !== \"absolute\"\r\n || tagName === \"svg\"\r\n || position !== \"static\"\r\n || (transform && transform !== \"none\")\r\n || willChange === \"transform\") {\r\n break;\r\n }\r\n var slotParentNode = (_b = el === null || el === void 0 ? void 0 : el.assignedSlot) === null || _b === void 0 ? void 0 : _b.parentNode;\r\n var targetParentNode = target.parentNode;\r\n if (slotParentNode) {\r\n hasSlot = true;\r\n parentSlotElement = targetParentNode;\r\n }\r\n var parentNode = targetParentNode;\r\n if (parentNode && parentNode.nodeType === 11) {\r\n // Shadow Root\r\n target = parentNode.host;\r\n isCustomElement = true;\r\n position = getCachedStyle(target)(\"position\");\r\n break;\r\n }\r\n target = parentNode;\r\n position = \"relative\";\r\n }\r\n return {\r\n offsetZoom: offsetZoom,\r\n hasSlot: hasSlot,\r\n parentSlotElement: parentSlotElement,\r\n isCustomElement: isCustomElement,\r\n isStatic: position === \"static\",\r\n isEnd: isEnd || !target || target === documentElement,\r\n offsetParent: target || documentElement,\r\n };\r\n}\r\nfunction getOffsetPosInfo(el, target) {\r\n var _a;\r\n var tagName = el.tagName.toLowerCase();\r\n var offsetLeft = el.offsetLeft;\r\n var offsetTop = el.offsetTop;\r\n var getStyle = getCachedStyle(el);\r\n // svg\r\n var isSVG = isUndefined(offsetLeft);\r\n var hasOffset = !isSVG;\r\n var origin;\r\n var targetOrigin;\r\n // inner svg element\r\n if (!hasOffset && tagName !== \"svg\") {\r\n origin = IS_WEBKIT605\r\n ? getBeforeTransformOrigin(el)\r\n : getTransformOriginArray(getStyle(\"transformOrigin\")).map(function (pos) { return parseFloat(pos); });\r\n targetOrigin = origin.slice();\r\n hasOffset = true;\r\n _a = __read(getSVGGraphicsOffset(el, origin, el === target && target.tagName.toLowerCase() === \"g\"), 4), offsetLeft = _a[0], offsetTop = _a[1], origin[0] = _a[2], origin[1] = _a[3];\r\n }\r\n else {\r\n origin = getTransformOriginArray(getStyle(\"transformOrigin\")).map(function (pos) { return parseFloat(pos); });\r\n targetOrigin = origin.slice();\r\n }\r\n return {\r\n tagName: tagName,\r\n isSVG: isSVG,\r\n hasOffset: hasOffset,\r\n offset: [offsetLeft || 0, offsetTop || 0],\r\n origin: origin,\r\n targetOrigin: targetOrigin,\r\n };\r\n}\r\nfunction getBodyOffset(el, isSVG) {\r\n var getStyle = getCachedStyle(el);\r\n var getBodyStyle = getCachedStyle(getDocumentBody(el));\r\n var bodyPosition = getBodyStyle(\"position\");\r\n if (!isSVG && (!bodyPosition || bodyPosition === \"static\")) {\r\n return [0, 0];\r\n }\r\n var marginLeft = parseInt(getBodyStyle(\"marginLeft\"), 10);\r\n var marginTop = parseInt(getBodyStyle(\"marginTop\"), 10);\r\n if (getStyle(\"position\") === \"absolute\") {\r\n if (getStyle(\"top\") !== \"auto\" || getStyle(\"bottom\") !== \"auto\") {\r\n marginTop = 0;\r\n }\r\n if (getStyle(\"left\") !== \"auto\" || getStyle(\"right\") !== \"auto\") {\r\n marginLeft = 0;\r\n }\r\n }\r\n return [marginLeft, marginTop];\r\n}\r\nfunction convert3DMatrixes(matrixes) {\r\n matrixes.forEach(function (info) {\r\n var matrix = info.matrix;\r\n if (matrix) {\r\n info.matrix = convertDimension(matrix, 3, 4);\r\n }\r\n });\r\n}\r\nfunction getPositionFixedInfo(el) {\r\n var fixedContainer = el.parentElement;\r\n var hasTransform = false;\r\n var body = getDocumentBody(el);\r\n while (fixedContainer) {\r\n var transform = getComputedStyle(fixedContainer).transform;\r\n if (transform && transform !== \"none\") {\r\n hasTransform = true;\r\n break;\r\n }\r\n if (fixedContainer === body) {\r\n break;\r\n }\r\n fixedContainer = fixedContainer.parentElement;\r\n }\r\n return {\r\n fixedContainer: fixedContainer || body,\r\n hasTransform: hasTransform,\r\n };\r\n}\r\nfunction makeMatrixCSS(matrix, is3d) {\r\n if (is3d === void 0) { is3d = matrix.length > 9; }\r\n return \"\".concat(is3d ? \"matrix3d\" : \"matrix\", \"(\").concat(convertMatrixtoCSS(matrix, !is3d).join(\",\"), \")\");\r\n}\r\nfunction getSVGViewBox(el) {\r\n var clientWidth = el.clientWidth;\r\n var clientHeight = el.clientHeight;\r\n if (!el) {\r\n return { x: 0, y: 0, width: 0, height: 0, clientWidth: clientWidth, clientHeight: clientHeight };\r\n }\r\n var viewBox = el.viewBox;\r\n var baseVal = (viewBox && viewBox.baseVal) || { x: 0, y: 0, width: 0, height: 0 };\r\n return {\r\n x: baseVal.x,\r\n y: baseVal.y,\r\n width: baseVal.width || clientWidth,\r\n height: baseVal.height || clientHeight,\r\n clientWidth: clientWidth,\r\n clientHeight: clientHeight,\r\n };\r\n}\r\nfunction getSVGMatrix(el, n) {\r\n var _a;\r\n var _b = getSVGViewBox(el), viewBoxWidth = _b.width, viewBoxHeight = _b.height, clientWidth = _b.clientWidth, clientHeight = _b.clientHeight;\r\n var scaleX = clientWidth / viewBoxWidth;\r\n var scaleY = clientHeight / viewBoxHeight;\r\n var preserveAspectRatio = el.preserveAspectRatio.baseVal;\r\n // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/preserveAspectRatio\r\n var align = preserveAspectRatio.align;\r\n // 1 : meet 2: slice\r\n var meetOrSlice = preserveAspectRatio.meetOrSlice;\r\n var svgOrigin = [0, 0];\r\n var scale = [scaleX, scaleY];\r\n var translate = [0, 0];\r\n if (align !== 1) {\r\n var xAlign = (align - 2) % 3;\r\n var yAlign = Math.floor((align - 2) / 3);\r\n svgOrigin[0] = viewBoxWidth * xAlign / 2;\r\n svgOrigin[1] = viewBoxHeight * yAlign / 2;\r\n var scaleDimension = meetOrSlice === 2 ? Math.max(scaleY, scaleX) : Math.min(scaleX, scaleY);\r\n scale[0] = scaleDimension;\r\n scale[1] = scaleDimension;\r\n translate[0] = (clientWidth - viewBoxWidth) / 2 * xAlign;\r\n translate[1] = (clientHeight - viewBoxHeight) / 2 * yAlign;\r\n }\r\n var scaleMatrix = createScaleMatrix(scale, n);\r\n _a = __read(translate, 2), scaleMatrix[n * (n - 1)] = _a[0], scaleMatrix[n * (n - 1) + 1] = _a[1];\r\n return getAbsoluteMatrix(scaleMatrix, n, svgOrigin);\r\n}\r\nfunction getSVGGraphicsOffset(el, origin, isGTarget) {\r\n if (!el.getBBox || !isGTarget && el.tagName.toLowerCase() === \"g\") {\r\n return [0, 0, 0, 0];\r\n }\r\n var getStyle = getCachedStyle(el);\r\n var isFillBox = getStyle(\"transform-box\") === \"fill-box\";\r\n var bbox = el.getBBox();\r\n var viewBox = getSVGViewBox(el.ownerSVGElement);\r\n var left = bbox.x - viewBox.x;\r\n var top = bbox.y - viewBox.y;\r\n var originX = isFillBox ? origin[0] : origin[0] - left;\r\n var originY = isFillBox ? origin[1] : origin[1] - top;\r\n return [left, top, originX, originY];\r\n}\r\nfunction calculatePosition(matrix, pos, n) {\r\n return calculate(matrix, convertPositionMatrix(pos, n), n);\r\n}\r\nfunction calculatePoses(matrix, width, height, n) {\r\n return [[0, 0], [width, 0], [0, height], [width, height]].map(function (pos) { return calculatePosition(matrix, pos, n); });\r\n}\r\nfunction getRect(poses) {\r\n var posesX = poses.map(function (pos) { return pos[0]; });\r\n var posesY = poses.map(function (pos) { return pos[1]; });\r\n var left = Math.min.apply(Math, __spreadArray([], __read(posesX), false));\r\n var top = Math.min.apply(Math, __spreadArray([], __read(posesY), false));\r\n var right = Math.max.apply(Math, __spreadArray([], __read(posesX), false));\r\n var bottom = Math.max.apply(Math, __spreadArray([], __read(posesY), false));\r\n var rectWidth = right - left;\r\n var rectHeight = bottom - top;\r\n return {\r\n left: left,\r\n top: top,\r\n right: right,\r\n bottom: bottom,\r\n width: rectWidth,\r\n height: rectHeight,\r\n };\r\n}\r\nfunction calculateRect(matrix, width, height, n) {\r\n var poses = calculatePoses(matrix, width, height, n);\r\n return getRect(poses);\r\n}\r\nfunction getSVGOffset(offsetInfo, targetInfo, container, n, beforeMatrix) {\r\n var _a;\r\n var target = offsetInfo.target;\r\n var origin = offsetInfo.origin;\r\n var targetMatrix = targetInfo.matrix;\r\n var _b = getSize(target), width = _b.offsetWidth, height = _b.offsetHeight;\r\n var containerClientRect = container.getBoundingClientRect();\r\n var margin = [0, 0];\r\n if (container === getDocumentBody(container)) {\r\n margin = getBodyOffset(target, true);\r\n }\r\n var rect = target.getBoundingClientRect();\r\n var rectLeft = rect.left - containerClientRect.left + container.scrollLeft\r\n - (container.clientLeft || 0) + margin[0];\r\n var rectTop = rect.top - containerClientRect.top + container.scrollTop\r\n - (container.clientTop || 0) + margin[1];\r\n var rectWidth = rect.width;\r\n var rectHeight = rect.height;\r\n var mat = multiplies(n, beforeMatrix, targetMatrix);\r\n var _c = calculateRect(mat, width, height, n), prevLeft = _c.left, prevTop = _c.top, prevWidth = _c.width, prevHeight = _c.height;\r\n var posOrigin = calculatePosition(mat, origin, n);\r\n var prevOrigin = minus(posOrigin, [prevLeft, prevTop]);\r\n var rectOrigin = [\r\n rectLeft + prevOrigin[0] * rectWidth / prevWidth,\r\n rectTop + prevOrigin[1] * rectHeight / prevHeight,\r\n ];\r\n var offset = [0, 0];\r\n var count = 0;\r\n while (++count < 10) {\r\n var inverseBeforeMatrix = invert(beforeMatrix, n);\r\n _a = __read(minus(calculatePosition(inverseBeforeMatrix, rectOrigin, n), calculatePosition(inverseBeforeMatrix, posOrigin, n)), 2), offset[0] = _a[0], offset[1] = _a[1];\r\n var mat2 = multiplies(n, beforeMatrix, createOriginMatrix(offset, n), targetMatrix);\r\n var _d = calculateRect(mat2, width, height, n), nextLeft = _d.left, nextTop = _d.top;\r\n var distLeft = nextLeft - rectLeft;\r\n var distTop = nextTop - rectTop;\r\n if (abs(distLeft) < 2 && abs(distTop) < 2) {\r\n break;\r\n }\r\n rectOrigin[0] -= distLeft;\r\n rectOrigin[1] -= distTop;\r\n }\r\n return offset.map(function (p) { return Math.round(p); });\r\n}\r\nfunction calculateMoveableClientPositions(rootMatrix, poses, rootClientRect) {\r\n var is3d = rootMatrix.length === 16;\r\n var n = is3d ? 4 : 3;\r\n var rootPoses = poses.map(function (pos) { return calculatePosition(rootMatrix, pos, n); });\r\n var left = rootClientRect.left, top = rootClientRect.top;\r\n return rootPoses.map(function (pos) {\r\n return [pos[0] + left, pos[1] + top];\r\n });\r\n}\r\nfunction getDistSize(vec) {\r\n return Math.sqrt(vec[0] * vec[0] + vec[1] * vec[1]);\r\n}\r\nfunction getDiagonalSize(pos1, pos2) {\r\n return getDistSize([\r\n pos2[0] - pos1[0],\r\n pos2[1] - pos1[1],\r\n ]);\r\n}\r\nfunction getLineStyle(pos1, pos2, zoom, rad) {\r\n if (zoom === void 0) { zoom = 1; }\r\n if (rad === void 0) { rad = getRad(pos1, pos2); }\r\n var width = getDiagonalSize(pos1, pos2);\r\n return {\r\n transform: \"translateY(-50%) translate(\".concat(pos1[0], \"px, \").concat(pos1[1], \"px) rotate(\").concat(rad, \"rad) scaleY(\").concat(zoom, \")\"),\r\n width: \"\".concat(width, \"px\"),\r\n };\r\n}\r\nfunction getControlTransform(rotation, zoom) {\r\n var poses = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n poses[_i - 2] = arguments[_i];\r\n }\r\n var length = poses.length;\r\n var x = poses.reduce(function (prev, pos) { return prev + pos[0]; }, 0) / length;\r\n var y = poses.reduce(function (prev, pos) { return prev + pos[1]; }, 0) / length;\r\n return {\r\n transform: \"translateZ(0px) translate(\".concat(x, \"px, \").concat(y, \"px) rotate(\").concat(rotation, \"rad) scale(\").concat(zoom, \")\"),\r\n };\r\n}\r\nfunction getProps(props, ableName) {\r\n var self = props[ableName];\r\n if (isObject(self)) {\r\n return __assign(__assign({}, props), self);\r\n }\r\n return props;\r\n}\r\nfunction getSize(target) {\r\n var hasOffset = target && !isUndefined(target.offsetWidth);\r\n var offsetWidth = 0;\r\n var offsetHeight = 0;\r\n var clientWidth = 0;\r\n var clientHeight = 0;\r\n var cssWidth = 0;\r\n var cssHeight = 0;\r\n var contentWidth = 0;\r\n var contentHeight = 0;\r\n var minWidth = 0;\r\n var minHeight = 0;\r\n var minOffsetWidth = 0;\r\n var minOffsetHeight = 0;\r\n var maxWidth = Infinity;\r\n var maxHeight = Infinity;\r\n var maxOffsetWidth = Infinity;\r\n var maxOffsetHeight = Infinity;\r\n var inlineCSSWidth = 0;\r\n var inlineCSSHeight = 0;\r\n var svg = false;\r\n if (target) {\r\n if (!hasOffset && target.tagName.toLowerCase() !== \"svg\") {\r\n // check svg elements\r\n var bbox = target.getBBox();\r\n svg = true;\r\n offsetWidth = bbox.width;\r\n offsetHeight = bbox.height;\r\n cssWidth = offsetWidth;\r\n cssHeight = offsetHeight;\r\n contentWidth = offsetWidth;\r\n contentHeight = offsetHeight;\r\n clientWidth = offsetWidth;\r\n clientHeight = offsetHeight;\r\n }\r\n else {\r\n // check html elements\r\n var getStyle = getCachedStyle(target);\r\n var targetStyle = target.style;\r\n var boxSizing = getStyle(\"boxSizing\") === \"border-box\";\r\n var borderLeft = parseFloat(getStyle(\"borderLeftWidth\")) || 0;\r\n var borderRight = parseFloat(getStyle(\"borderRightWidth\")) || 0;\r\n var borderTop = parseFloat(getStyle(\"borderTopWidth\")) || 0;\r\n var borderBottom = parseFloat(getStyle(\"borderBottomWidth\")) || 0;\r\n var paddingLeft = parseFloat(getStyle(\"paddingLeft\")) || 0;\r\n var paddingRight = parseFloat(getStyle(\"paddingRight\")) || 0;\r\n var paddingTop = parseFloat(getStyle(\"paddingTop\")) || 0;\r\n var paddingBottom = parseFloat(getStyle(\"paddingBottom\")) || 0;\r\n var horizontalPadding = paddingLeft + paddingRight;\r\n var verticalPadding = paddingTop + paddingBottom;\r\n var horizontalBorder = borderLeft + borderRight;\r\n var verticalBorder = borderTop + borderBottom;\r\n var horizontalOffset = horizontalPadding + horizontalBorder;\r\n var verticalOffset = verticalPadding + verticalBorder;\r\n var position = getStyle(\"position\");\r\n var containerWidth = 0;\r\n var containerHeight = 0;\r\n // SVGSVGElement, HTMLElement\r\n if (\"clientLeft\" in target) {\r\n var parentElement = null;\r\n if (position === \"absolute\") {\r\n var offsetInfo = getOffsetInfo(target, getDocumentBody(target));\r\n parentElement = offsetInfo.offsetParent;\r\n }\r\n else {\r\n parentElement = target.parentElement;\r\n }\r\n if (parentElement) {\r\n var getParentStyle = getCachedStyle(parentElement);\r\n containerWidth = parseFloat(getParentStyle(\"width\"));\r\n containerHeight = parseFloat(getParentStyle(\"height\"));\r\n }\r\n }\r\n minWidth = Math.max(horizontalPadding, convertUnitSize(getStyle(\"minWidth\"), containerWidth) || 0);\r\n minHeight = Math.max(verticalPadding, convertUnitSize(getStyle(\"minHeight\"), containerHeight) || 0);\r\n maxWidth = convertUnitSize(getStyle(\"maxWidth\"), containerWidth);\r\n maxHeight = convertUnitSize(getStyle(\"maxHeight\"), containerHeight);\r\n if (isNaN(maxWidth)) {\r\n maxWidth = Infinity;\r\n }\r\n if (isNaN(maxHeight)) {\r\n maxHeight = Infinity;\r\n }\r\n inlineCSSWidth = convertUnitSize(targetStyle.width, 0) || 0;\r\n inlineCSSHeight = convertUnitSize(targetStyle.height, 0) || 0;\r\n cssWidth = parseFloat(getStyle(\"width\")) || 0;\r\n cssHeight = parseFloat(getStyle(\"height\")) || 0;\r\n contentWidth = abs(cssWidth - inlineCSSWidth) < 1\r\n ? between(minWidth, inlineCSSWidth || cssWidth, maxWidth)\r\n : cssWidth;\r\n contentHeight = abs(cssHeight - inlineCSSHeight) < 1\r\n ? between(minHeight, inlineCSSHeight || cssHeight, maxHeight)\r\n : cssHeight;\r\n offsetWidth = contentWidth;\r\n offsetHeight = contentHeight;\r\n clientWidth = contentWidth;\r\n clientHeight = contentHeight;\r\n if (boxSizing) {\r\n maxOffsetWidth = maxWidth;\r\n maxOffsetHeight = maxHeight;\r\n minOffsetWidth = minWidth;\r\n minOffsetHeight = minHeight;\r\n contentWidth = offsetWidth - horizontalOffset;\r\n contentHeight = offsetHeight - verticalOffset;\r\n }\r\n else {\r\n maxOffsetWidth = maxWidth + horizontalOffset;\r\n maxOffsetHeight = maxHeight + verticalOffset;\r\n minOffsetWidth = minWidth + horizontalOffset;\r\n minOffsetHeight = minHeight + verticalOffset;\r\n offsetWidth = contentWidth + horizontalOffset;\r\n offsetHeight = contentHeight + verticalOffset;\r\n }\r\n clientWidth = contentWidth + horizontalPadding;\r\n clientHeight = contentHeight + verticalPadding;\r\n }\r\n }\r\n return {\r\n svg: svg,\r\n offsetWidth: offsetWidth,\r\n offsetHeight: offsetHeight,\r\n clientWidth: clientWidth,\r\n clientHeight: clientHeight,\r\n contentWidth: contentWidth,\r\n contentHeight: contentHeight,\r\n inlineCSSWidth: inlineCSSWidth,\r\n inlineCSSHeight: inlineCSSHeight,\r\n cssWidth: cssWidth,\r\n cssHeight: cssHeight,\r\n minWidth: minWidth,\r\n minHeight: minHeight,\r\n maxWidth: maxWidth,\r\n maxHeight: maxHeight,\r\n minOffsetWidth: minOffsetWidth,\r\n minOffsetHeight: minOffsetHeight,\r\n maxOffsetWidth: maxOffsetWidth,\r\n maxOffsetHeight: maxOffsetHeight,\r\n };\r\n}\r\nfunction getRotationRad(poses, direction) {\r\n return getRad(direction > 0 ? poses[0] : poses[1], direction > 0 ? poses[1] : poses[0]);\r\n}\r\nfunction resetClientRect() {\r\n return {\r\n left: 0, top: 0,\r\n width: 0, height: 0,\r\n right: 0,\r\n bottom: 0,\r\n clientLeft: 0, clientTop: 0,\r\n clientWidth: 0, clientHeight: 0,\r\n scrollWidth: 0, scrollHeight: 0,\r\n };\r\n}\r\nfunction getExtendsRect(el, rect) {\r\n var isRoot = el === getDocumentBody(el) || el === getDocumentElement(el);\r\n var extendsRect = {\r\n clientLeft: el.clientLeft,\r\n clientTop: el.clientTop,\r\n clientWidth: el.clientWidth,\r\n clientHeight: el.clientHeight,\r\n scrollWidth: el.scrollWidth,\r\n scrollHeight: el.scrollHeight,\r\n overflow: false,\r\n };\r\n if (isRoot) {\r\n extendsRect.clientHeight = Math.max(rect.height, extendsRect.clientHeight);\r\n extendsRect.scrollHeight = Math.max(rect.height, extendsRect.scrollHeight);\r\n }\r\n extendsRect.overflow = getCachedStyle(el)(\"overflow\") !== \"visible\";\r\n return __assign(__assign({}, rect), extendsRect);\r\n}\r\nfunction getClientRectByPosition(position, base, el, isExtends) {\r\n var left = position.left, right = position.right, top = position.top, bottom = position.bottom;\r\n var baseTop = base.top;\r\n var baseLeft = base.left;\r\n var rect = {\r\n left: baseLeft + left,\r\n top: baseTop + top,\r\n right: baseLeft + right,\r\n bottom: baseTop + bottom,\r\n width: right - left,\r\n height: bottom - top,\r\n };\r\n if (el && isExtends) {\r\n return getExtendsRect(el, rect);\r\n }\r\n return rect;\r\n}\r\nfunction getClientRect(el, isExtends) {\r\n var left = 0;\r\n var top = 0;\r\n var width = 0;\r\n var height = 0;\r\n // let isRoot = false;\r\n if (el) {\r\n var clientRect = el.getBoundingClientRect();\r\n left = clientRect.left;\r\n top = clientRect.top;\r\n width = clientRect.width;\r\n height = clientRect.height;\r\n }\r\n var rect = {\r\n left: left,\r\n top: top,\r\n width: width,\r\n height: height,\r\n right: left + width,\r\n bottom: top + height,\r\n };\r\n if (el && isExtends) {\r\n return getExtendsRect(el, rect);\r\n }\r\n return rect;\r\n}\r\nfunction getTotalOrigin(moveable) {\r\n var _a = moveable.props, groupable = _a.groupable, svgOrigin = _a.svgOrigin;\r\n var _b = moveable.getState(), offsetWidth = _b.offsetWidth, offsetHeight = _b.offsetHeight, svg = _b.svg, transformOrigin = _b.transformOrigin;\r\n if (!groupable && svg && svgOrigin) {\r\n return convertTransformOriginArray(svgOrigin, offsetWidth, offsetHeight);\r\n }\r\n return transformOrigin;\r\n}\r\nfunction getTotalDirection(parentDirection, isPinch, inputEvent, datas) {\r\n var direction;\r\n if (parentDirection) {\r\n direction = parentDirection;\r\n }\r\n else if (isPinch) {\r\n direction = [0, 0];\r\n }\r\n else {\r\n var target = inputEvent.target;\r\n direction = getDirection(target, datas);\r\n }\r\n return direction;\r\n}\r\nfunction getDirection(target, datas) {\r\n if (!target) {\r\n return;\r\n }\r\n var deg = target.getAttribute(\"data-rotation\") || \"\";\r\n var direciton = target.getAttribute(\"data-direction\");\r\n datas.deg = deg;\r\n if (!direciton) {\r\n return;\r\n }\r\n var dir = [0, 0];\r\n (direciton.indexOf(\"w\") > -1) && (dir[0] = -1);\r\n (direciton.indexOf(\"e\") > -1) && (dir[0] = 1);\r\n (direciton.indexOf(\"n\") > -1) && (dir[1] = -1);\r\n (direciton.indexOf(\"s\") > -1) && (dir[1] = 1);\r\n return dir;\r\n}\r\nfunction getAbsolutePoses(poses, dist) {\r\n return [\r\n plus(dist, poses[0]),\r\n plus(dist, poses[1]),\r\n plus(dist, poses[2]),\r\n plus(dist, poses[3]),\r\n ];\r\n}\r\nfunction getAbsolutePosesByState(_a) {\r\n var left = _a.left, top = _a.top, pos1 = _a.pos1, pos2 = _a.pos2, pos3 = _a.pos3, pos4 = _a.pos4;\r\n return getAbsolutePoses([pos1, pos2, pos3, pos4], [left, top]);\r\n}\r\nfunction unsetAbles(self, isControl) {\r\n self[isControl ? \"controlAbles\" : \"targetAbles\"].forEach(function (able) {\r\n able.unset && able.unset(self);\r\n });\r\n}\r\nfunction unsetGesto(self, isControl) {\r\n var gestoName = isControl ? \"controlGesto\" : \"targetGesto\";\r\n var gesto = self[gestoName];\r\n if ((gesto === null || gesto === void 0 ? void 0 : gesto.isIdle()) === false) {\r\n unsetAbles(self, isControl);\r\n }\r\n gesto === null || gesto === void 0 ? void 0 : gesto.unset();\r\n self[gestoName] = null;\r\n}\r\nfunction fillCSSObject(style, resolvedEvent) {\r\n if (resolvedEvent) {\r\n var originalDatas = getBeforeRenderableDatas(resolvedEvent);\r\n originalDatas.nextStyle = __assign(__assign({}, originalDatas.nextStyle), style);\r\n }\r\n return {\r\n style: style,\r\n cssText: getKeys(style).map(function (name) { return \"\".concat(decamelize(name, \"-\"), \": \").concat(style[name], \";\"); }).join(\"\"),\r\n };\r\n}\r\nfunction fillAfterTransform(prevEvent, nextEvent, resolvedEvent) {\r\n var afterTransform = nextEvent.afterTransform || nextEvent.transform;\r\n return __assign(__assign({}, fillCSSObject(__assign(__assign(__assign({}, prevEvent.style), nextEvent.style), { transform: afterTransform }), resolvedEvent)), { afterTransform: afterTransform, transform: prevEvent.transform });\r\n}\r\nfunction fillParams(moveable, e, params, isBeforeEvent) {\r\n var datas = e.datas;\r\n if (!datas.datas) {\r\n datas.datas = {};\r\n }\r\n var nextParams = __assign(__assign({}, params), { target: moveable.state.target, clientX: e.clientX, clientY: e.clientY, inputEvent: e.inputEvent, currentTarget: moveable, moveable: moveable, datas: datas.datas, isRequest: e.isRequest, isRequestChild: e.isRequestChild, isFirstDrag: !!e.isFirstDrag, isTrusted: e.isTrusted !== false, stopAble: function () {\r\n datas.isEventStart = false;\r\n }, stopDrag: function () {\r\n var _a;\r\n (_a = e.stop) === null || _a === void 0 ? void 0 : _a.call(e);\r\n } });\r\n if (!datas.isStartEvent) {\r\n datas.isStartEvent = true;\r\n }\r\n else if (!isBeforeEvent) {\r\n datas.lastEvent = nextParams;\r\n }\r\n return nextParams;\r\n}\r\nfunction fillEndParams(moveable, e, params) {\r\n var datas = e.datas;\r\n var isDrag = \"isDrag\" in params ? params.isDrag : e.isDrag;\r\n if (!datas.datas) {\r\n datas.datas = {};\r\n }\r\n return __assign(__assign({ isDrag: isDrag }, params), { moveable: moveable, target: moveable.state.target, clientX: e.clientX, clientY: e.clientY, inputEvent: e.inputEvent, currentTarget: moveable, lastEvent: datas.lastEvent, isDouble: e.isDouble, datas: datas.datas, isFirstDrag: !!e.isFirstDrag });\r\n}\r\nfunction catchEvent(moveable, name, callback) {\r\n moveable._emitter.on(name, callback);\r\n}\r\nfunction triggerEvent(moveable, name, params, isManager, isRequest) {\r\n return moveable.triggerEvent(name, params, isManager, isRequest);\r\n}\r\nfunction getComputedStyle(el, pseudoElt) {\r\n return getWindow(el).getComputedStyle(el, pseudoElt);\r\n}\r\nfunction filterAbles(ables, methods, triggerAblesSimultaneously) {\r\n var enabledAbles = {};\r\n var ableGroups = {};\r\n return ables.filter(function (able) {\r\n var name = able.name;\r\n if (enabledAbles[name] || !methods.some(function (method) { return able[method]; })) {\r\n return false;\r\n }\r\n if (!triggerAblesSimultaneously && able.ableGroup) {\r\n if (ableGroups[able.ableGroup]) {\r\n return false;\r\n }\r\n ableGroups[able.ableGroup] = true;\r\n }\r\n enabledAbles[name] = true;\r\n return true;\r\n });\r\n}\r\nfunction equals(a1, a2) {\r\n return a1 === a2 || (a1 == null && a2 == null);\r\n}\r\nfunction selectValue() {\r\n var values = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n values[_i] = arguments[_i];\r\n }\r\n var length = values.length - 1;\r\n for (var i = 0; i < length; ++i) {\r\n var value = values[i];\r\n if (!isUndefined(value)) {\r\n return value;\r\n }\r\n }\r\n return values[length];\r\n}\r\nfunction groupBy(arr, func) {\r\n var groups = [];\r\n var groupKeys = [];\r\n arr.forEach(function (el, index) {\r\n var groupKey = func(el, index, arr);\r\n var keyIndex = groupKeys.indexOf(groupKey);\r\n var group = groups[keyIndex] || [];\r\n if (keyIndex === -1) {\r\n groupKeys.push(groupKey);\r\n groups.push(group);\r\n }\r\n group.push(el);\r\n });\r\n return groups;\r\n}\r\nfunction groupByMap(arr, func) {\r\n var groups = [];\r\n var groupKeys = {};\r\n arr.forEach(function (el, index) {\r\n var groupKey = func(el, index, arr);\r\n var group = groupKeys[groupKey];\r\n if (!group) {\r\n group = [];\r\n groupKeys[groupKey] = group;\r\n groups.push(group);\r\n }\r\n group.push(el);\r\n });\r\n return groups;\r\n}\r\nfunction flat(arr) {\r\n return arr.reduce(function (prev, cur) {\r\n return prev.concat(cur);\r\n }, []);\r\n}\r\nfunction maxOffset() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n args.sort(function (a, b) { return abs(b) - abs(a); });\r\n return args[0];\r\n}\r\nfunction calculateInversePosition(matrix, pos, n) {\r\n return calculate(invert(matrix, n), convertPositionMatrix(pos, n), n);\r\n}\r\nfunction convertDragDist(state, e) {\r\n var _a;\r\n var is3d = state.is3d, rootMatrix = state.rootMatrix;\r\n var n = is3d ? 4 : 3;\r\n _a = __read(calculateInversePosition(rootMatrix, [e.distX, e.distY], n), 2), e.distX = _a[0], e.distY = _a[1];\r\n return e;\r\n}\r\nfunction calculatePadding(matrix, pos, added, n) {\r\n if (!added[0] && !added[1]) {\r\n return pos;\r\n }\r\n var xAdded = calculatePosition(matrix, [normalized(added[0]), 0], n);\r\n var yAdded = calculatePosition(matrix, [0, normalized(added[1])], n);\r\n var nextAdded = calculatePosition(matrix, [\r\n added[0] / getDistSize(xAdded),\r\n added[1] / getDistSize(yAdded),\r\n ], n);\r\n return plus(pos, nextAdded);\r\n}\r\nfunction convertCSSSize(value, size, isRelative) {\r\n return isRelative ? \"\".concat(value / size * 100, \"%\") : \"\".concat(value, \"px\");\r\n}\r\nfunction getTinyDist(v) {\r\n return abs(v) <= TINY_NUM ? 0 : v;\r\n}\r\nfunction getDirectionViewClassName(ableName) {\r\n return function (moveable) {\r\n if (!moveable.isDragging(ableName)) {\r\n return \"\";\r\n }\r\n var data = getGestoData(moveable, ableName);\r\n var deg = data.deg;\r\n if (!deg) {\r\n return \"\";\r\n }\r\n return prefix(\"view-control-rotation\".concat(deg));\r\n };\r\n}\r\nfunction getDirectionCondition(ableName, checkAbles) {\r\n if (checkAbles === void 0) { checkAbles = [ableName]; }\r\n return function (moveable, e) {\r\n if (e.isRequest) {\r\n if (checkAbles.some(function (name) { return e.requestAble === name; })) {\r\n return e.parentDirection;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n var target = e.inputEvent.target;\r\n return hasClass(target, prefix(\"direction\")) && (!ableName || hasClass(target, prefix(ableName)));\r\n };\r\n}\r\nfunction convertTransformInfo(transforms, state, index) {\r\n var _a;\r\n var matrixInfos = parse(transforms, {\r\n \"x%\": function (v) { return v / 100 * state.offsetWidth; },\r\n \"y%\": function (v) { return v / 100 * state.offsetHeight; },\r\n });\r\n var beforeFunctionTexts = transforms.slice(0, index < 0 ? undefined : index);\r\n var beforeFunctionTexts2 = transforms.slice(0, index < 0 ? undefined : index + 1);\r\n var targetFunctionText = transforms[index] || \"\";\r\n var afterFunctionTexts = index < 0 ? [] : transforms.slice(index);\r\n var afterFunctionTexts2 = index < 0 ? [] : transforms.slice(index + 1);\r\n var beforeFunctions = matrixInfos.slice(0, index < 0 ? undefined : index);\r\n var beforeFunctions2 = matrixInfos.slice(0, index < 0 ? undefined : index + 1);\r\n var targetFunction = (_a = matrixInfos[index]) !== null && _a !== void 0 ? _a : parse([\"\"])[0];\r\n var afterFunctions = index < 0 ? [] : matrixInfos.slice(index);\r\n var afterFunctions2 = index < 0 ? [] : matrixInfos.slice(index + 1);\r\n var targetFunctions = targetFunction ? [targetFunction] : [];\r\n var beforeFunctionMatrix = toMat(beforeFunctions);\r\n var beforeFunctionMatrix2 = toMat(beforeFunctions2);\r\n var afterFunctionMatrix = toMat(afterFunctions);\r\n var afterFunctionMatrix2 = toMat(afterFunctions2);\r\n var allFunctionMatrix = multiply(beforeFunctionMatrix, afterFunctionMatrix, 4);\r\n return {\r\n transforms: transforms,\r\n beforeFunctionMatrix: beforeFunctionMatrix,\r\n beforeFunctionMatrix2: beforeFunctionMatrix2,\r\n targetFunctionMatrix: toMat(targetFunctions),\r\n afterFunctionMatrix: afterFunctionMatrix,\r\n afterFunctionMatrix2: afterFunctionMatrix2,\r\n allFunctionMatrix: allFunctionMatrix,\r\n beforeFunctions: beforeFunctions,\r\n beforeFunctions2: beforeFunctions2,\r\n targetFunction: targetFunctions[0],\r\n afterFunctions: afterFunctions,\r\n afterFunctions2: afterFunctions2,\r\n beforeFunctionTexts: beforeFunctionTexts,\r\n beforeFunctionTexts2: beforeFunctionTexts2,\r\n targetFunctionText: targetFunctionText,\r\n afterFunctionTexts: afterFunctionTexts,\r\n afterFunctionTexts2: afterFunctionTexts2,\r\n };\r\n}\r\nfunction isArrayFormat(arr) {\r\n if (!arr || !isObject(arr)) {\r\n return false;\r\n }\r\n if (isNode(arr)) {\r\n return false;\r\n }\r\n return isArray(arr) || \"length\" in arr;\r\n}\r\nfunction getRefTarget(target, isSelector) {\r\n if (!target) {\r\n return null;\r\n }\r\n if (isNode(target)) {\r\n return target;\r\n }\r\n if (isString(target)) {\r\n if (isSelector) {\r\n return document.querySelector(target);\r\n }\r\n return target;\r\n }\r\n if (isFunction(target)) {\r\n return target();\r\n }\r\n if (isWindow(target)) {\r\n return target;\r\n }\r\n if (\"current\" in target) {\r\n return target.current;\r\n }\r\n return target;\r\n}\r\nfunction getRefTargets(targets, isSelector) {\r\n if (!targets) {\r\n return [];\r\n }\r\n var userTargets = isArrayFormat(targets) ? [].slice.call(targets) : [targets];\r\n return userTargets.reduce(function (prev, target) {\r\n if (isString(target) && isSelector) {\r\n return __spreadArray(__spreadArray([], __read(prev), false), __read([].slice.call(document.querySelectorAll(target))), false);\r\n }\r\n if (isArray(target)) {\r\n prev.push(getRefTargets(target, isSelector));\r\n }\r\n else {\r\n prev.push(getRefTarget(target, isSelector));\r\n }\r\n return prev;\r\n }, []);\r\n}\r\nfunction getAbsoluteRotation(pos1, pos2, direction) {\r\n var deg = getRad(pos1, pos2) / Math.PI * 180;\r\n deg = direction >= 0 ? deg : 180 - deg;\r\n deg = deg >= 0 ? deg : 360 + deg;\r\n return deg;\r\n}\r\nfunction getDragDistByState(state, dist) {\r\n var rootMatrix = state.rootMatrix, is3d = state.is3d;\r\n var n = is3d ? 4 : 3;\r\n var inverseMatrix = invert(rootMatrix, n);\r\n if (!is3d) {\r\n inverseMatrix = convertDimension(inverseMatrix, 3, 4);\r\n }\r\n inverseMatrix[12] = 0;\r\n inverseMatrix[13] = 0;\r\n inverseMatrix[14] = 0;\r\n return calculateMatrixDist(inverseMatrix, dist);\r\n}\r\nfunction getSizeDistByDist(startSize, dist, ratio, direction, keepRatio) {\r\n var _a = __read(startSize, 2), startOffsetWidth = _a[0], startOffsetHeight = _a[1];\r\n var distWidth = 0;\r\n var distHeight = 0;\r\n if (keepRatio && startOffsetWidth && startOffsetHeight) {\r\n var rad = getRad([0, 0], dist);\r\n var standardRad = getRad([0, 0], direction);\r\n var size = getDistSize(dist);\r\n var signSize = Math.cos(rad - standardRad) * size;\r\n if (!direction[0]) {\r\n // top, bottom\r\n distHeight = signSize;\r\n distWidth = distHeight * ratio;\r\n }\r\n else if (!direction[1]) {\r\n // left, right\r\n distWidth = signSize;\r\n distHeight = distWidth / ratio;\r\n }\r\n else {\r\n // two-way\r\n var startWidthSize = direction[0] * startOffsetWidth;\r\n var startHeightSize = direction[1] * startOffsetHeight;\r\n var secondRad = Math.atan2(startWidthSize + dist[0], startHeightSize + dist[1]);\r\n var firstRad = Math.atan2(startWidthSize, startHeightSize);\r\n if (secondRad < 0) {\r\n secondRad += Math.PI * 2;\r\n }\r\n if (firstRad < 0) {\r\n firstRad += Math.PI * 2;\r\n }\r\n var rad_1 = 0;\r\n if (abs(secondRad - firstRad) < Math.PI / 2 || abs(secondRad - firstRad) > Math.PI / 2 * 3) {\r\n rad_1 = secondRad - firstRad;\r\n }\r\n else {\r\n firstRad += Math.PI;\r\n rad_1 = secondRad - firstRad;\r\n }\r\n if (rad_1 > Math.PI * 2) {\r\n rad_1 -= Math.PI * 2;\r\n }\r\n else if (rad_1 > Math.PI) {\r\n rad_1 = 2 * Math.PI - rad_1;\r\n }\r\n else if (rad_1 < -Math.PI) {\r\n rad_1 = -2 * Math.PI - rad_1;\r\n }\r\n // 180\r\n // -1, -1, // 1, -1\r\n // 270 90\r\n // -1, 1 // 1, 1\r\n // 0\r\n var distSize = getDistSize([startWidthSize + dist[0], startHeightSize + dist[1]]) * Math.cos(rad_1);\r\n distWidth = distSize * Math.sin(firstRad) - startWidthSize;\r\n distHeight = distSize * Math.cos(firstRad) - startHeightSize;\r\n if (direction[0] < 0) {\r\n distWidth *= -1;\r\n }\r\n if (direction[1] < 0) {\r\n distHeight *= -1;\r\n }\r\n }\r\n }\r\n else {\r\n distWidth = direction[0] * dist[0];\r\n distHeight = direction[1] * dist[1];\r\n }\r\n return [distWidth, distHeight];\r\n}\r\nfunction getOffsetSizeDist(sizeDirection, keepRatio, datas, e) {\r\n var _a;\r\n var ratio = datas.ratio, startOffsetWidth = datas.startOffsetWidth, startOffsetHeight = datas.startOffsetHeight;\r\n var distWidth = 0;\r\n var distHeight = 0;\r\n var distX = e.distX, distY = e.distY, pinchScale = e.pinchScale, parentDistance = e.parentDistance, parentDist = e.parentDist, parentScale = e.parentScale;\r\n var startFixedDirection = datas.fixedDirection;\r\n var directionsDists = [0, 1].map(function (index) {\r\n return abs(sizeDirection[index] - startFixedDirection[index]);\r\n });\r\n var directionRatios = [0, 1].map(function (index) {\r\n var dist = directionsDists[index];\r\n if (dist !== 0) {\r\n dist = 2 / dist;\r\n }\r\n return dist;\r\n });\r\n if (parentDist) {\r\n distWidth = parentDist[0];\r\n distHeight = parentDist[1];\r\n if (keepRatio) {\r\n if (!distWidth) {\r\n distWidth = distHeight * ratio;\r\n }\r\n else if (!distHeight) {\r\n distHeight = distWidth / ratio;\r\n }\r\n }\r\n }\r\n else if (isNumber(pinchScale)) {\r\n distWidth = (pinchScale - 1) * startOffsetWidth;\r\n distHeight = (pinchScale - 1) * startOffsetHeight;\r\n }\r\n else if (parentScale) {\r\n distWidth = (parentScale[0] - 1) * startOffsetWidth;\r\n distHeight = (parentScale[1] - 1) * startOffsetHeight;\r\n }\r\n else if (parentDistance) {\r\n var scaleX = startOffsetWidth * directionsDists[0];\r\n var scaleY = startOffsetHeight * directionsDists[1];\r\n var ratioDistance = getDistSize([scaleX, scaleY]);\r\n distWidth = parentDistance / ratioDistance * scaleX * directionRatios[0];\r\n distHeight = parentDistance / ratioDistance * scaleY * directionRatios[1];\r\n }\r\n else {\r\n var dist_1 = getDragDist({ datas: datas, distX: distX, distY: distY });\r\n dist_1 = directionRatios.map(function (ratio, i) {\r\n return dist_1[i] * ratio;\r\n });\r\n _a = __read(getSizeDistByDist([startOffsetWidth, startOffsetHeight], dist_1, ratio, sizeDirection, keepRatio), 2), distWidth = _a[0], distHeight = _a[1];\r\n }\r\n return {\r\n // direction,\r\n // sizeDirection,\r\n distWidth: distWidth,\r\n distHeight: distHeight,\r\n };\r\n}\r\nfunction convertTransformUnit(origin, xy) {\r\n if (xy) {\r\n if (origin === \"left\") {\r\n return { x: \"0%\", y: \"50%\" };\r\n }\r\n else if (origin === \"top\") {\r\n return { x: \"50%\", y: \"50%\" };\r\n }\r\n else if (origin === \"center\") {\r\n return { x: \"50%\", y: \"50%\" };\r\n }\r\n else if (origin === \"right\") {\r\n return { x: \"100%\", y: \"50%\" };\r\n }\r\n else if (origin === \"bottom\") {\r\n return { x: \"50%\", y: \"100%\" };\r\n }\r\n var _a = __read(origin.split(\" \"), 2), left = _a[0], right = _a[1];\r\n var leftOrigin = convertTransformUnit(left || \"\");\r\n var rightOrigin = convertTransformUnit(right || \"\");\r\n var originObject = __assign(__assign({}, leftOrigin), rightOrigin);\r\n var nextOriginObject = {\r\n x: \"50%\",\r\n y: \"50%\",\r\n };\r\n if (originObject.x) {\r\n nextOriginObject.x = originObject.x;\r\n }\r\n if (originObject.y) {\r\n nextOriginObject.y = originObject.y;\r\n }\r\n if (originObject.value) {\r\n if (originObject.x && !originObject.y) {\r\n nextOriginObject.y = originObject.value;\r\n }\r\n if (!originObject.x && originObject.y) {\r\n nextOriginObject.x = originObject.value;\r\n }\r\n }\r\n return nextOriginObject;\r\n }\r\n if (origin === \"left\") {\r\n return { x: \"0%\" };\r\n }\r\n if (origin === \"right\") {\r\n return { x: \"100%\" };\r\n }\r\n if (origin === \"top\") {\r\n return { y: \"0%\" };\r\n }\r\n if (origin === \"bottom\") {\r\n return { y: \"100%\" };\r\n }\r\n if (!origin) {\r\n return {};\r\n }\r\n if (origin === \"center\") {\r\n return { value: \"50%\" };\r\n }\r\n return { value: origin };\r\n}\r\nfunction convertTransformOriginArray(transformOrigin, width, height) {\r\n var _a = convertTransformUnit(transformOrigin, true), x = _a.x, y = _a.y;\r\n return [\r\n convertUnitSize(x, width) || 0,\r\n convertUnitSize(y, height) || 0,\r\n ];\r\n}\r\nfunction rotatePosesInfo(poses, origin, rad) {\r\n var prevPoses = poses.map(function (pos) { return minus(pos, origin); });\r\n var nextPoses = prevPoses.map(function (pos) { return rotate(pos, rad); });\r\n return {\r\n prev: prevPoses,\r\n next: nextPoses,\r\n result: nextPoses.map(function (pos) { return plus(pos, origin); }),\r\n };\r\n}\r\nfunction isDeepArrayEquals(arr1, arr2) {\r\n return arr1.length === arr2.length && arr1.every(function (value1, i) {\r\n var value2 = arr2[i];\r\n var isArray1 = isArray(value1);\r\n var isArray2 = isArray(value2);\r\n if (isArray1 && isArray2) {\r\n return isDeepArrayEquals(value1, value2);\r\n }\r\n else if (!isArray1 && !isArray2) {\r\n return value1 === value2;\r\n }\r\n return false;\r\n });\r\n}\r\nfunction watchValue(moveable, property, nextValue, valueKey, defaultValue) {\r\n var store = moveable._store;\r\n var prevValue = store[property];\r\n if (!(property in store)) {\r\n if (defaultValue != null) {\r\n store[property] = defaultValue;\r\n prevValue = defaultValue;\r\n }\r\n else {\r\n store[property] = nextValue;\r\n return nextValue;\r\n }\r\n }\r\n if (prevValue === nextValue || valueKey(prevValue) === valueKey(nextValue)) {\r\n return prevValue;\r\n }\r\n store[property] = nextValue;\r\n return nextValue;\r\n}\r\nfunction sign(value) {\r\n return value >= 0 ? 1 : -1;\r\n}\r\nfunction abs(value) {\r\n return Math.abs(value);\r\n}\r\nfunction countEach(count, callback) {\r\n return counter(count).map(function (index) { return callback(index); });\r\n}\r\nfunction getPaddingBox(padding) {\r\n if (isNumber(padding)) {\r\n return {\r\n top: padding,\r\n left: padding,\r\n right: padding,\r\n bottom: padding,\r\n };\r\n }\r\n return {\r\n left: padding.left || 0,\r\n top: padding.top || 0,\r\n right: padding.right || 0,\r\n bottom: padding.bottom || 0,\r\n };\r\n}\n\n/**\r\n * @namespace Moveable.Pinchable\r\n * @description Whether or not target can be pinched with draggable, resizable, scalable, rotatable (default: false)\r\n */\r\nvar Pinchable = makeAble(\"pinchable\", {\r\n props: [\r\n \"pinchable\",\r\n ],\r\n events: [\r\n \"pinchStart\",\r\n \"pinch\",\r\n \"pinchEnd\",\r\n \"pinchGroupStart\",\r\n \"pinchGroup\",\r\n \"pinchGroupEnd\",\r\n ],\r\n dragStart: function () {\r\n return true;\r\n },\r\n pinchStart: function (moveable, e) {\r\n var datas = e.datas, targets = e.targets, angle = e.angle, originalDatas = e.originalDatas;\r\n var _a = moveable.props, pinchable = _a.pinchable, ables = _a.ables;\r\n if (!pinchable) {\r\n return false;\r\n }\r\n var eventName = \"onPinch\".concat(targets ? \"Group\" : \"\", \"Start\");\r\n var controlEventName = \"drag\".concat(targets ? \"Group\" : \"\", \"ControlStart\");\r\n var pinchAbles = (pinchable === true ? moveable.controlAbles : ables.filter(function (able) {\r\n return pinchable.indexOf(able.name) > -1;\r\n })).filter(function (able) { return able.canPinch && able[controlEventName]; });\r\n var params = fillParams(moveable, e, {});\r\n if (targets) {\r\n params.targets = targets;\r\n }\r\n var result = triggerEvent(moveable, eventName, params);\r\n datas.isPinch = result !== false;\r\n datas.ables = pinchAbles;\r\n var isPinch = datas.isPinch;\r\n if (!isPinch) {\r\n return false;\r\n }\r\n pinchAbles.forEach(function (able) {\r\n originalDatas[able.name] = originalDatas[able.name] || {};\r\n if (!able[controlEventName]) {\r\n return;\r\n }\r\n var ableEvent = __assign(__assign({}, e), { datas: originalDatas[able.name], parentRotate: angle, isPinch: true });\r\n able[controlEventName](moveable, ableEvent);\r\n });\r\n moveable.state.snapRenderInfo = {\r\n request: e.isRequest,\r\n direction: [0, 0],\r\n };\r\n return isPinch;\r\n },\r\n pinch: function (moveable, e) {\r\n var datas = e.datas, pinchScale = e.scale, distance = e.distance, originalDatas = e.originalDatas, inputEvent = e.inputEvent, targets = e.targets, angle = e.angle;\r\n if (!datas.isPinch) {\r\n return;\r\n }\r\n var parentDistance = distance * (1 - 1 / pinchScale);\r\n var params = fillParams(moveable, e, {});\r\n if (targets) {\r\n params.targets = targets;\r\n }\r\n var eventName = \"onPinch\".concat(targets ? \"Group\" : \"\");\r\n triggerEvent(moveable, eventName, params);\r\n var ables = datas.ables;\r\n var controlEventName = \"drag\".concat(targets ? \"Group\" : \"\", \"Control\");\r\n ables.forEach(function (able) {\r\n if (!able[controlEventName]) {\r\n return;\r\n }\r\n able[controlEventName](moveable, __assign(__assign({}, e), { datas: originalDatas[able.name], inputEvent: inputEvent, resolveMatrix: true, pinchScale: pinchScale, parentDistance: parentDistance, parentRotate: angle, isPinch: true }));\r\n });\r\n return params;\r\n },\r\n pinchEnd: function (moveable, e) {\r\n var datas = e.datas, isPinch = e.isPinch, inputEvent = e.inputEvent, targets = e.targets, originalDatas = e.originalDatas;\r\n if (!datas.isPinch) {\r\n return;\r\n }\r\n var eventName = \"onPinch\".concat(targets ? \"Group\" : \"\", \"End\");\r\n var params = fillEndParams(moveable, e, { isDrag: isPinch });\r\n if (targets) {\r\n params.targets = targets;\r\n }\r\n triggerEvent(moveable, eventName, params);\r\n var ables = datas.ables;\r\n var controlEventName = \"drag\".concat(targets ? \"Group\" : \"\", \"ControlEnd\");\r\n ables.forEach(function (able) {\r\n if (!able[controlEventName]) {\r\n return;\r\n }\r\n able[controlEventName](moveable, __assign(__assign({}, e), { isDrag: isPinch, datas: originalDatas[able.name], inputEvent: inputEvent, isPinch: true }));\r\n });\r\n return isPinch;\r\n },\r\n pinchGroupStart: function (moveable, e) {\r\n return this.pinchStart(moveable, __assign(__assign({}, e), { targets: moveable.props.targets }));\r\n },\r\n pinchGroup: function (moveable, e) {\r\n return this.pinch(moveable, __assign(__assign({}, e), { targets: moveable.props.targets }));\r\n },\r\n pinchGroupEnd: function (moveable, e) {\r\n return this.pinchEnd(moveable, __assign(__assign({}, e), { targets: moveable.props.targets }));\r\n },\r\n});\r\n/**\r\n * Whether or not target can be pinched with draggable, resizable, scalable, rotatable (default: false)\r\n * @name Moveable.Pinchable#pinchable\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.pinchable = true;\r\n */\r\n/**\r\n * When the pinch starts, the pinchStart event is called with part of scaleStart, rotateStart, resizeStart\r\n * @memberof Moveable.Pinchable\r\n * @event pinchStart\r\n * @param {Moveable.Pinchable.OnPinchStart} - Parameters for the pinchStart event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * rotatable: true,\r\n * scalable: true,\r\n * pinchable: true, // [\"rotatable\", \"scalable\"]\r\n * });\r\n * moveable.on(\"pinchStart\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n * moveable.on(\"rotateStart\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n * moveable.on(\"scaleStart\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n */\r\n/**\r\n * When pinching, the pinch event is called with part of scale, rotate, resize\r\n * @memberof Moveable.Pinchable\r\n * @event pinch\r\n * @param {Moveable.Pinchable.OnPinch} - Parameters for the pinch event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * rotatable: true,\r\n * scalable: true,\r\n * pinchable: true, // [\"rotatable\", \"scalable\"]\r\n * });\r\n * moveable.on(\"pinch\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n * moveable.on(\"rotate\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n * moveable.on(\"scale\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n */\r\n/**\r\n * When the pinch finishes, the pinchEnd event is called.\r\n * @memberof Moveable.Pinchable\r\n * @event pinchEnd\r\n * @param {Moveable.Pinchable.OnPinchEnd} - Parameters for the pinchEnd event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * rotatable: true,\r\n * scalable: true,\r\n * pinchable: true, // [\"rotatable\", \"scalable\"]\r\n * });\r\n * moveable.on(\"pinchEnd\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n * moveable.on(\"rotateEnd\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n * moveable.on(\"scaleEnd\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n */\r\n/**\r\n * When the group pinch starts, the `pinchGroupStart` event is called.\r\n * @memberof Moveable.Pinchable\r\n * @event pinchGroupStart\r\n * @param {Moveable.Pinchable.OnPinchGroupStart} - Parameters for the `pinchGroupStart` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * pinchable: true\r\n * });\r\n * moveable.on(\"pinchGroupStart\", ({ targets }) => {\r\n * console.log(\"onPinchGroupStart\", targets);\r\n * });\r\n */\r\n/**\r\n * When the group pinch, the `pinchGroup` event is called.\r\n * @memberof Moveable.Pinchable\r\n * @event pinchGroup\r\n * @param {Moveable.Pinchable.OnPinchGroup} - Parameters for the `pinchGroup` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * pinchable: true\r\n * });\r\n * moveable.on(\"pinchGroup\", ({ targets, events }) => {\r\n * console.log(\"onPinchGroup\", targets);\r\n * });\r\n */\r\n/**\r\n * When the group pinch finishes, the `pinchGroupEnd` event is called.\r\n * @memberof Moveable.Pinchable\r\n * @event pinchGroupEnd\r\n * @param {Moveable.Pinchable.OnPinchGroupEnd} - Parameters for the `pinchGroupEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * pinchable: true\r\n * });\r\n * moveable.on(\"pinchGroupEnd\", ({ targets, isDrag }) => {\r\n * console.log(\"onPinchGroupEnd\", targets, isDrag);\r\n * });\r\n */\n\nvar directionCondition = getDirectionCondition(\"scalable\");\r\n/**\r\n * @namespace Scalable\r\n * @memberof Moveable\r\n * @description Scalable indicates whether the target's x and y can be scale of transform.\r\n */\r\nvar Scalable = {\r\n name: \"scalable\",\r\n ableGroup: \"size\",\r\n canPinch: true,\r\n props: [\r\n \"scalable\",\r\n \"throttleScale\",\r\n \"renderDirections\",\r\n \"keepRatio\",\r\n \"edge\",\r\n \"displayAroundControls\",\r\n ],\r\n events: [\r\n \"scaleStart\",\r\n \"beforeScale\",\r\n \"scale\",\r\n \"scaleEnd\",\r\n \"scaleGroupStart\",\r\n \"beforeScaleGroup\",\r\n \"scaleGroup\",\r\n \"scaleGroupEnd\",\r\n ],\r\n render: getRenderDirections(\"scalable\"),\r\n dragControlCondition: directionCondition,\r\n viewClassName: getDirectionViewClassName(\"scalable\"),\r\n dragControlStart: function (moveable, e) {\r\n var datas = e.datas, isPinch = e.isPinch, inputEvent = e.inputEvent, parentDirection = e.parentDirection;\r\n var direction = getTotalDirection(parentDirection, isPinch, inputEvent, datas);\r\n var _a = moveable.state, width = _a.width, height = _a.height, targetTransform = _a.targetTransform, target = _a.target, pos1 = _a.pos1, pos2 = _a.pos2, pos4 = _a.pos4;\r\n if (!direction || !target) {\r\n return false;\r\n }\r\n if (!isPinch) {\r\n setDragStart(moveable, e);\r\n }\r\n datas.datas = {};\r\n datas.transform = targetTransform;\r\n datas.prevDist = [1, 1];\r\n datas.direction = direction;\r\n datas.startOffsetWidth = width;\r\n datas.startOffsetHeight = height;\r\n datas.startValue = [1, 1];\r\n // const scaleWidth = getDist(pos1, pos2);\r\n // const scaleHeight = getDist(pos2, pos4);\r\n var isWidth = (!direction[0] && !direction[1]) || direction[0] || !direction[1];\r\n // datas.scaleWidth = scaleWidth;\r\n // datas.scaleHeight = scaleHeight;\r\n // datas.scaleXRatio = scaleWidth / width;\r\n // datas.scaleYRatio = scaleHeight / height;\r\n setDefaultTransformIndex(moveable, e, \"scale\");\r\n datas.isWidth = isWidth;\r\n function setRatio(ratio) {\r\n datas.ratio = ratio && isFinite(ratio) ? ratio : 0;\r\n }\r\n datas.startPositions = getAbsolutePosesByState(moveable.state);\r\n function setFixedDirection(fixedDirection) {\r\n var result = getFixedDirectionInfo(datas.startPositions, fixedDirection);\r\n datas.fixedDirection = result.fixedDirection;\r\n datas.fixedPosition = result.fixedPosition;\r\n datas.fixedOffset = result.fixedOffset;\r\n }\r\n datas.setFixedDirection = setFixedDirection;\r\n setRatio(getDist$1(pos1, pos2) / getDist$1(pos2, pos4));\r\n setFixedDirection([-direction[0], -direction[1]]);\r\n var setMinScaleSize = function (min) {\r\n datas.minScaleSize = min;\r\n };\r\n var setMaxScaleSize = function (max) {\r\n datas.maxScaleSize = max;\r\n };\r\n // const setMinScale = (min: number[]) => {\r\n // };\r\n // const setMaxScale = (max: number[]) => {\r\n // };\r\n setMinScaleSize([-Infinity, -Infinity]);\r\n setMaxScaleSize([Infinity, Infinity]);\r\n var params = fillParams(moveable, e, __assign(__assign({ direction: direction, set: function (scale) {\r\n datas.startValue = scale;\r\n }, setRatio: setRatio, setFixedDirection: setFixedDirection, setMinScaleSize: setMinScaleSize, setMaxScaleSize: setMaxScaleSize }, fillTransformStartEvent(moveable, e)), { dragStart: Draggable.dragStart(moveable, new CustomGesto().dragStart([0, 0], e)) }));\r\n var result = triggerEvent(moveable, \"onScaleStart\", params);\r\n datas.startFixedDirection = datas.fixedDirection;\r\n if (result !== false) {\r\n datas.isScale = true;\r\n moveable.state.snapRenderInfo = {\r\n request: e.isRequest,\r\n direction: direction,\r\n };\r\n }\r\n return datas.isScale ? params : false;\r\n },\r\n dragControl: function (moveable, e) {\r\n resolveTransformEvent(moveable, e, \"scale\");\r\n var datas = e.datas, parentKeepRatio = e.parentKeepRatio, parentFlag = e.parentFlag, isPinch = e.isPinch, dragClient = e.dragClient, isRequest = e.isRequest, useSnap = e.useSnap, resolveMatrix = e.resolveMatrix;\r\n var prevDist = datas.prevDist, direction = datas.direction, startOffsetWidth = datas.startOffsetWidth, startOffsetHeight = datas.startOffsetHeight, isScale = datas.isScale, startValue = datas.startValue, isWidth = datas.isWidth, ratio = datas.ratio;\r\n if (!isScale) {\r\n return false;\r\n }\r\n var props = moveable.props;\r\n var throttleScale = props.throttleScale, parentMoveable = props.parentMoveable;\r\n var sizeDirection = direction;\r\n if (!direction[0] && !direction[1]) {\r\n sizeDirection = [1, 1];\r\n }\r\n var keepRatio = (ratio && (parentKeepRatio != null ? parentKeepRatio : props.keepRatio)) || false;\r\n var state = moveable.state;\r\n var tempScaleValue = [\r\n startValue[0],\r\n startValue[1],\r\n ];\r\n function getNextScale() {\r\n var _a = getOffsetSizeDist(sizeDirection, keepRatio, datas, e), distWidth = _a.distWidth, distHeight = _a.distHeight;\r\n var distX = startOffsetWidth ? (startOffsetWidth + distWidth) / startOffsetWidth : 1;\r\n var distY = startOffsetHeight ? (startOffsetHeight + distHeight) / startOffsetHeight : 1;\r\n if (!startValue[0]) {\r\n tempScaleValue[0] = distWidth / startOffsetWidth;\r\n }\r\n if (!startValue[1]) {\r\n tempScaleValue[1] = distHeight / startOffsetHeight;\r\n }\r\n var scaleX = (sizeDirection[0] || keepRatio ? distX : 1) * tempScaleValue[0];\r\n var scaleY = (sizeDirection[1] || keepRatio ? distY : 1) * tempScaleValue[1];\r\n if (scaleX === 0) {\r\n scaleX = sign(prevDist[0]) * MIN_SCALE;\r\n }\r\n if (scaleY === 0) {\r\n scaleY = sign(prevDist[1]) * MIN_SCALE;\r\n }\r\n return [scaleX, scaleY];\r\n }\r\n var scale = getNextScale();\r\n if (!isPinch && moveable.props.groupable) {\r\n var snapRenderInfo = state.snapRenderInfo || {};\r\n var stateDirection = snapRenderInfo.direction;\r\n if (isArray(stateDirection) && (stateDirection[0] || stateDirection[1])) {\r\n state.snapRenderInfo = { direction: direction, request: e.isRequest };\r\n }\r\n }\r\n triggerEvent(moveable, \"onBeforeScale\", fillParams(moveable, e, {\r\n scale: scale,\r\n setFixedDirection: function (nextFixedDirection) {\r\n datas.setFixedDirection(nextFixedDirection);\r\n scale = getNextScale();\r\n return scale;\r\n },\r\n startFixedDirection: datas.startFixedDirection,\r\n setScale: function (nextScale) {\r\n scale = nextScale;\r\n },\r\n }, true));\r\n var dist = [\r\n scale[0] / tempScaleValue[0],\r\n scale[1] / tempScaleValue[1],\r\n ];\r\n var fixedPosition = dragClient;\r\n var snapDist = [0, 0];\r\n var isSelfPinch = !dragClient && !parentFlag && isPinch;\r\n if (isSelfPinch || resolveMatrix) {\r\n fixedPosition = getTranslateFixedPosition(moveable, datas.targetAllTransform, [0, 0], [0, 0], datas);\r\n }\r\n else if (!dragClient) {\r\n fixedPosition = datas.fixedPosition;\r\n }\r\n if (!isPinch) {\r\n snapDist = checkSnapScale(moveable, dist, direction, !useSnap && isRequest, datas);\r\n }\r\n if (keepRatio) {\r\n if (sizeDirection[0] && sizeDirection[1] && snapDist[0] && snapDist[1]) {\r\n if (Math.abs(snapDist[0] * startOffsetWidth) > Math.abs(snapDist[1] * startOffsetHeight)) {\r\n snapDist[1] = 0;\r\n }\r\n else {\r\n snapDist[0] = 0;\r\n }\r\n }\r\n var isNoSnap = !snapDist[0] && !snapDist[1];\r\n if (isNoSnap) {\r\n // throttle scale value (not absolute scale size)\r\n if (isWidth) {\r\n dist[0] = throttle(dist[0] * tempScaleValue[0], throttleScale) / tempScaleValue[0];\r\n }\r\n else {\r\n dist[1] = throttle(dist[1] * tempScaleValue[1], throttleScale) / tempScaleValue[1];\r\n }\r\n }\r\n if ((sizeDirection[0] && !sizeDirection[1])\r\n || (snapDist[0] && !snapDist[1])\r\n || (isNoSnap && isWidth)) {\r\n dist[0] += snapDist[0];\r\n var snapHeight = startOffsetWidth * dist[0] * tempScaleValue[0] / ratio;\r\n dist[1] = snapHeight / startOffsetHeight / tempScaleValue[1];\r\n }\r\n else if ((!sizeDirection[0] && sizeDirection[1])\r\n || (!snapDist[0] && snapDist[1])\r\n || (isNoSnap && !isWidth)) {\r\n dist[1] += snapDist[1];\r\n var snapWidth = startOffsetHeight * dist[1] * tempScaleValue[1] * ratio;\r\n dist[0] = snapWidth / startOffsetWidth / tempScaleValue[0];\r\n }\r\n }\r\n else {\r\n dist[0] += snapDist[0];\r\n dist[1] += snapDist[1];\r\n if (!snapDist[0]) {\r\n dist[0] = throttle(dist[0] * tempScaleValue[0], throttleScale) / tempScaleValue[0];\r\n }\r\n if (!snapDist[1]) {\r\n dist[1] = throttle(dist[1] * tempScaleValue[1], throttleScale) / tempScaleValue[1];\r\n }\r\n }\r\n if (dist[0] === 0) {\r\n dist[0] = sign(prevDist[0]) * MIN_SCALE;\r\n }\r\n if (dist[1] === 0) {\r\n dist[1] = sign(prevDist[1]) * MIN_SCALE;\r\n }\r\n scale = multiply2(dist, [tempScaleValue[0], tempScaleValue[1]]);\r\n var startOffsetSize = [\r\n startOffsetWidth,\r\n startOffsetHeight,\r\n ];\r\n var scaleSize = [\r\n startOffsetWidth * scale[0],\r\n startOffsetHeight * scale[1],\r\n ];\r\n scaleSize = calculateBoundSize(scaleSize, datas.minScaleSize, datas.maxScaleSize, keepRatio ? ratio : false);\r\n // if (keepRatio && (isGroup || keepRatioFinally)) {\r\n // if (isWidth) {\r\n // boundingHeight = boundingWidth / ratio;\r\n // } else {\r\n // boundingWidth = boundingHeight * ratio;\r\n // }\r\n // }\r\n scale = countEach(2, function (i) {\r\n return startOffsetSize[i] ? scaleSize[i] / startOffsetSize[i] : scaleSize[i];\r\n });\r\n dist = countEach(2, function (i) {\r\n return scale[i] / tempScaleValue[i];\r\n });\r\n var delta = countEach(2, function (i) { return prevDist[i] ? dist[i] / prevDist[i] : dist[i]; });\r\n var distText = \"scale(\".concat(dist.join(\", \"), \")\");\r\n var scaleText = \"scale(\".concat(scale.join(\", \"), \")\");\r\n var nextTransform = convertTransformFormat(datas, scaleText, distText);\r\n var isZeroScale = !startValue[0] || !startValue[1];\r\n var inverseDist = getScaleDist(moveable, isZeroScale ? scaleText : distText, datas.fixedDirection, fixedPosition, datas.fixedOffset, datas, isZeroScale);\r\n var inverseDelta = isSelfPinch ? inverseDist : minus(inverseDist, datas.prevInverseDist || [0, 0]);\r\n datas.prevDist = dist;\r\n datas.prevInverseDist = inverseDist;\r\n if (scale[0] === prevDist[0] && scale[1] === prevDist[1]\r\n && inverseDelta.every(function (num) { return !num; })\r\n && !parentMoveable\r\n && !isSelfPinch) {\r\n return false;\r\n }\r\n var params = fillParams(moveable, e, __assign({ offsetWidth: startOffsetWidth, offsetHeight: startOffsetHeight, direction: direction, scale: scale, dist: dist, delta: delta, isPinch: !!isPinch }, fillTransformEvent(moveable, nextTransform, inverseDelta, isPinch, e)));\r\n triggerEvent(moveable, \"onScale\", params);\r\n return params;\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n var datas = e.datas;\r\n if (!datas.isScale) {\r\n return false;\r\n }\r\n datas.isScale = false;\r\n var scaleEndParam = fillEndParams(moveable, e, {});\r\n triggerEvent(moveable, \"onScaleEnd\", scaleEndParam);\r\n return scaleEndParam;\r\n },\r\n dragGroupControlCondition: directionCondition,\r\n dragGroupControlStart: function (moveable, e) {\r\n var datas = e.datas;\r\n var params = this.dragControlStart(moveable, e);\r\n if (!params) {\r\n return false;\r\n }\r\n var originalEvents = fillChildEvents(moveable, \"resizable\", e);\r\n datas.moveableScale = moveable.scale;\r\n var events = triggerChildAbles(moveable, this, \"dragControlStart\", e, function (child, ev) {\r\n return startChildDist(moveable, child, datas, ev);\r\n });\r\n var setFixedDirection = function (fixedDirection) {\r\n params.setFixedDirection(fixedDirection);\r\n events.forEach(function (ev, i) {\r\n ev.setFixedDirection(fixedDirection);\r\n startChildDist(moveable, ev.moveable, datas, originalEvents[i]);\r\n });\r\n };\r\n datas.setFixedDirection = setFixedDirection;\r\n var nextParams = __assign(__assign({}, params), { targets: moveable.props.targets, events: events, setFixedDirection: setFixedDirection });\r\n var result = triggerEvent(moveable, \"onScaleGroupStart\", nextParams);\r\n datas.isScale = result !== false;\r\n return datas.isScale ? nextParams : false;\r\n },\r\n dragGroupControl: function (moveable, e) {\r\n var datas = e.datas;\r\n if (!datas.isScale) {\r\n return;\r\n }\r\n catchEvent(moveable, \"onBeforeScale\", function (parentEvent) {\r\n triggerEvent(moveable, \"onBeforeScaleGroup\", fillParams(moveable, e, __assign(__assign({}, parentEvent), { targets: moveable.props.targets }), true));\r\n });\r\n var params = this.dragControl(moveable, e);\r\n if (!params) {\r\n return;\r\n }\r\n var dist = params.dist;\r\n var moveableScale = datas.moveableScale;\r\n moveable.scale = [\r\n dist[0] * moveableScale[0],\r\n dist[1] * moveableScale[1],\r\n ];\r\n var keepRatio = moveable.props.keepRatio;\r\n var fixedPosition = datas.fixedPosition;\r\n var events = triggerChildAbles(moveable, this, \"dragControl\", e, function (_, ev) {\r\n var _a = __read(calculate(createRotateMatrix(moveable.rotation / 180 * Math.PI, 3), [\r\n ev.datas.originalX * dist[0],\r\n ev.datas.originalY * dist[1],\r\n 1,\r\n ], 3), 2), clientX = _a[0], clientY = _a[1];\r\n return __assign(__assign({}, ev), { parentDist: null, parentScale: dist, parentKeepRatio: keepRatio, \r\n // recalculate child fixed position for parent group's dragging.\r\n dragClient: plus(fixedPosition, [clientX, clientY]) });\r\n });\r\n var nextParams = __assign({ targets: moveable.props.targets, events: events }, params);\r\n triggerEvent(moveable, \"onScaleGroup\", nextParams);\r\n return nextParams;\r\n },\r\n dragGroupControlEnd: function (moveable, e) {\r\n var isDrag = e.isDrag, datas = e.datas;\r\n if (!datas.isScale) {\r\n return;\r\n }\r\n this.dragControlEnd(moveable, e);\r\n var events = triggerChildAbles(moveable, this, \"dragControlEnd\", e);\r\n var nextParams = fillEndParams(moveable, e, {\r\n targets: moveable.props.targets,\r\n events: events,\r\n });\r\n triggerEvent(moveable, \"onScaleGroupEnd\", nextParams);\r\n return isDrag;\r\n },\r\n /**\r\n * @method Moveable.Scalable#request\r\n * @param {Moveable.Scalable.ScalableRequestParam} e - the Scalable's request parameter\r\n * @return {Moveable.Requester} Moveable Requester\r\n * @example\r\n\n * // Instantly Request (requestStart - request - requestEnd)\r\n * moveable.request(\"scalable\", { deltaWidth: 10, deltaHeight: 10 }, true);\r\n *\r\n * // requestStart\r\n * const requester = moveable.request(\"scalable\");\r\n *\r\n * // request\r\n * requester.request({ deltaWidth: 10, deltaHeight: 10 });\r\n * requester.request({ deltaWidth: 10, deltaHeight: 10 });\r\n * requester.request({ deltaWidth: 10, deltaHeight: 10 });\r\n *\r\n * // requestEnd\r\n * requester.requestEnd();\r\n */\r\n request: function () {\r\n var datas = {};\r\n var distWidth = 0;\r\n var distHeight = 0;\r\n var useSnap = false;\r\n return {\r\n isControl: true,\r\n requestStart: function (e) {\r\n useSnap = e.useSnap;\r\n return {\r\n datas: datas,\r\n parentDirection: e.direction || [1, 1],\r\n useSnap: useSnap,\r\n };\r\n },\r\n request: function (e) {\r\n distWidth += e.deltaWidth;\r\n distHeight += e.deltaHeight;\r\n return {\r\n datas: datas,\r\n parentDist: [distWidth, distHeight],\r\n parentKeepRatio: e.keepRatio,\r\n useSnap: useSnap,\r\n };\r\n },\r\n requestEnd: function () {\r\n return { datas: datas, isDrag: true, useSnap: useSnap };\r\n },\r\n };\r\n },\r\n};\r\n/**\r\n * Whether or not target can scaled.\r\n *\r\n * @name Moveable.Scalable#scalable\r\n * @default false\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.scalable = true;\r\n */\r\n/**\r\n * throttle of scaleX, scaleY when scale.\r\n * @name Moveable.Scalable#throttleScale\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.throttleScale = 0.1;\r\n */\r\n/**\r\n * Set directions to show the control box. (default: [\"n\", \"nw\", \"ne\", \"s\", \"se\", \"sw\", \"e\", \"w\"])\r\n * @name Moveable.Scalable#renderDirections\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * scalable: true,\r\n * renderDirections: [\"n\", \"nw\", \"ne\", \"s\", \"se\", \"sw\", \"e\", \"w\"],\r\n * });\r\n *\r\n * moveable.renderDirections = [\"nw\", \"ne\", \"sw\", \"se\"];\r\n */\r\n/**\r\n * When resize or scale, keeps a ratio of the width, height. (default: false)\r\n * @name Moveable.Scalable#keepRatio\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * scalable: true,\r\n * });\r\n *\r\n * moveable.keepRatio = true;\r\n */\r\n/**\r\n * When the scale starts, the scaleStart event is called.\r\n * @memberof Moveable.Scalable\r\n * @event scaleStart\r\n * @param {Moveable.Scalable.OnScaleStart} - Parameters for the scaleStart event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { scalable: true });\r\n * moveable.on(\"scaleStart\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n */\r\n/**\r\n * When scaling, `beforeScale` is called before `scale` occurs. In `beforeScale`, you can get and set the pre-value before scaling.\r\n * @memberof Moveable.Scalable\r\n * @event beforeScale\r\n * @param {Moveable.Scalable.OnBeforeScale} - Parameters for the `beforeScale` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { scalable: true });\r\n * moveable.on(\"beforeScale\", ({ setFixedDirection }) => {\r\n * if (shiftKey) {\r\n * setFixedDirection([0, 0]);\r\n * }\r\n * });\r\n * moveable.on(\"scale\", ({ target, transform, dist }) => {\r\n * target.style.transform = transform;\r\n * });\r\n */\r\n/**\r\n * When scaling, the `scale` event is called.\r\n * @memberof Moveable.Scalable\r\n * @event scale\r\n * @param {Moveable.Scalable.OnScale} - Parameters for the `scale` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { scalable: true });\r\n * moveable.on(\"scale\", ({ target, transform, dist }) => {\r\n * target.style.transform = transform;\r\n * });\r\n */\r\n/**\r\n * When the scale finishes, the `scaleEnd` event is called.\r\n * @memberof Moveable.Scalable\r\n * @event scaleEnd\r\n * @param {Moveable.Scalable.OnScaleEnd} - Parameters for the `scaleEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { scalable: true });\r\n * moveable.on(\"scaleEnd\", ({ target, isDrag }) => {\r\n * console.log(target, isDrag);\r\n * });\r\n */\r\n/**\r\n* When the group scale starts, the `scaleGroupStart` event is called.\r\n* @memberof Moveable.Scalable\r\n* @event scaleGroupStart\r\n* @param {Moveable.Scalable.OnScaleGroupStart} - Parameters for the `scaleGroupStart` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* target: [].slice.call(document.querySelectorAll(\".target\")),\r\n* scalable: true\r\n* });\r\n* moveable.on(\"scaleGroupStart\", ({ targets }) => {\r\n* console.log(\"onScaleGroupStart\", targets);\r\n* });\r\n*/\r\n/**\r\n* When the group scale, the `scaleGroup` event is called.\r\n* @memberof Moveable.Scalable\r\n* @event scaleGroup\r\n* @param {Moveable.Scalable.OnScaleGroup} - Parameters for the `scaleGroup` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* target: [].slice.call(document.querySelectorAll(\".target\")),\r\n* scalable: true\r\n* });\r\n* moveable.on(\"scaleGroup\", ({ targets, events }) => {\r\n* console.log(\"onScaleGroup\", targets);\r\n* events.forEach(ev => {\r\n* const target = ev.target;\r\n* // ev.drag is a drag event that occurs when the group scale.\r\n* const left = ev.drag.beforeDist[0];\r\n* const top = ev.drag.beforeDist[1];\r\n* const scaleX = ev.scale[0];\r\n* const scaleY = ev.scale[1];\r\n* });\r\n* });\r\n*/\r\n/**\r\n * When the group scale finishes, the `scaleGroupEnd` event is called.\r\n * @memberof Moveable.Scalable\r\n * @event scaleGroupEnd\r\n * @param {Moveable.Scalable.OnScaleGroupEnd} - Parameters for the `scaleGroupEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * scalable: true\r\n * });\r\n * moveable.on(\"scaleGroupEnd\", ({ targets, isDrag }) => {\r\n * console.log(\"onScaleGroupEnd\", targets, isDrag);\r\n * });\r\n */\n\nfunction getMiddleLinePos(pos1, pos2) {\r\n return pos1.map(function (pos, i) { return dot(pos, pos2[i], 1, 2); });\r\n}\r\nfunction getTriangleRad(pos1, pos2, pos3) {\r\n // pos1 Rad\r\n var rad1 = getRad(pos1, pos2);\r\n var rad2 = getRad(pos1, pos3);\r\n var rad = rad2 - rad1;\r\n return rad >= 0 ? rad : rad + 2 * Math.PI;\r\n}\r\nfunction isValidPos(poses1, poses2) {\r\n var rad1 = getTriangleRad(poses1[0], poses1[1], poses1[2]);\r\n var rad2 = getTriangleRad(poses2[0], poses2[1], poses2[2]);\r\n var pi = Math.PI;\r\n if ((rad1 >= pi && rad2 <= pi) || (rad1 <= pi && rad2 >= pi)) {\r\n return false;\r\n }\r\n return true;\r\n}\r\n/**\r\n * @namespace Moveable.Warpable\r\n * @description Warpable indicates whether the target can be warped(distorted, bented).\r\n */\r\nvar Warpable = {\r\n name: \"warpable\",\r\n ableGroup: \"size\",\r\n props: [\r\n \"warpable\",\r\n \"renderDirections\",\r\n \"edge\",\r\n \"displayAroundControls\",\r\n ],\r\n events: [\r\n \"warpStart\",\r\n \"warp\",\r\n \"warpEnd\",\r\n ],\r\n viewClassName: getDirectionViewClassName(\"warpable\"),\r\n render: function (moveable, React) {\r\n var _a = moveable.props, resizable = _a.resizable, scalable = _a.scalable, warpable = _a.warpable, zoom = _a.zoom;\r\n if (resizable || scalable || !warpable) {\r\n return [];\r\n }\r\n var _b = moveable.state, pos1 = _b.pos1, pos2 = _b.pos2, pos3 = _b.pos3, pos4 = _b.pos4;\r\n var linePosFrom1 = getMiddleLinePos(pos1, pos2);\r\n var linePosFrom2 = getMiddleLinePos(pos2, pos1);\r\n var linePosFrom3 = getMiddleLinePos(pos1, pos3);\r\n var linePosFrom4 = getMiddleLinePos(pos3, pos1);\r\n var linePosTo1 = getMiddleLinePos(pos3, pos4);\r\n var linePosTo2 = getMiddleLinePos(pos4, pos3);\r\n var linePosTo3 = getMiddleLinePos(pos2, pos4);\r\n var linePosTo4 = getMiddleLinePos(pos4, pos2);\r\n return __spreadArray([\r\n React.createElement(\"div\", { className: prefix(\"line\"), key: \"middeLine1\", style: getLineStyle(linePosFrom1, linePosTo1, zoom) }),\r\n React.createElement(\"div\", { className: prefix(\"line\"), key: \"middeLine2\", style: getLineStyle(linePosFrom2, linePosTo2, zoom) }),\r\n React.createElement(\"div\", { className: prefix(\"line\"), key: \"middeLine3\", style: getLineStyle(linePosFrom3, linePosTo3, zoom) }),\r\n React.createElement(\"div\", { className: prefix(\"line\"), key: \"middeLine4\", style: getLineStyle(linePosFrom4, linePosTo4, zoom) })\r\n ], __read(renderAllDirections(moveable, \"warpable\", React)), false);\r\n },\r\n dragControlCondition: function (moveable, e) {\r\n if (e.isRequest) {\r\n return false;\r\n }\r\n var target = e.inputEvent.target;\r\n return hasClass(target, prefix(\"direction\")) && hasClass(target, prefix(\"warpable\"));\r\n },\r\n dragControlStart: function (moveable, e) {\r\n var datas = e.datas, inputEvent = e.inputEvent;\r\n var target = moveable.props.target;\r\n var inputTarget = inputEvent.target;\r\n var direction = getDirection(inputTarget, datas);\r\n if (!direction || !target) {\r\n return false;\r\n }\r\n var state = moveable.state;\r\n var transformOrigin = state.transformOrigin, is3d = state.is3d, targetTransform = state.targetTransform, targetMatrix = state.targetMatrix, width = state.width, height = state.height, left = state.left, top = state.top;\r\n datas.datas = {};\r\n datas.targetTransform = targetTransform;\r\n datas.warpTargetMatrix = is3d ? targetMatrix : convertDimension(targetMatrix, 3, 4);\r\n datas.targetInverseMatrix = ignoreDimension(invert(datas.warpTargetMatrix, 4), 3, 4);\r\n datas.direction = direction;\r\n datas.left = left;\r\n datas.top = top;\r\n datas.poses = [\r\n [0, 0],\r\n [width, 0],\r\n [0, height],\r\n [width, height],\r\n ].map(function (p) { return minus(p, transformOrigin); });\r\n datas.nextPoses = datas.poses.map(function (_a) {\r\n var _b = __read(_a, 2), x = _b[0], y = _b[1];\r\n return calculate(datas.warpTargetMatrix, [x, y, 0, 1], 4);\r\n });\r\n datas.startValue = createIdentityMatrix(4);\r\n datas.prevMatrix = createIdentityMatrix(4);\r\n datas.absolutePoses = getAbsolutePosesByState(state);\r\n datas.posIndexes = getPosIndexesByDirection(direction);\r\n setDragStart(moveable, e);\r\n setDefaultTransformIndex(moveable, e, \"matrix3d\");\r\n state.snapRenderInfo = {\r\n request: e.isRequest,\r\n direction: direction,\r\n };\r\n var params = fillParams(moveable, e, __assign({ set: function (matrix) {\r\n datas.startValue = matrix;\r\n } }, fillTransformStartEvent(moveable, e)));\r\n var result = triggerEvent(moveable, \"onWarpStart\", params);\r\n if (result !== false) {\r\n datas.isWarp = true;\r\n }\r\n return datas.isWarp;\r\n },\r\n dragControl: function (moveable, e) {\r\n var datas = e.datas, isRequest = e.isRequest;\r\n var distX = e.distX, distY = e.distY;\r\n var targetInverseMatrix = datas.targetInverseMatrix, prevMatrix = datas.prevMatrix, isWarp = datas.isWarp, startValue = datas.startValue, poses = datas.poses, posIndexes = datas.posIndexes, absolutePoses = datas.absolutePoses;\r\n if (!isWarp) {\r\n return false;\r\n }\r\n resolveTransformEvent(moveable, e, \"matrix3d\");\r\n if (hasGuidelines(moveable, \"warpable\")) {\r\n var selectedPoses = posIndexes.map(function (index) { return absolutePoses[index]; });\r\n if (selectedPoses.length > 1) {\r\n selectedPoses.push([\r\n (selectedPoses[0][0] + selectedPoses[1][0]) / 2,\r\n (selectedPoses[0][1] + selectedPoses[1][1]) / 2,\r\n ]);\r\n }\r\n var _a = checkMoveableSnapBounds(moveable, isRequest, {\r\n horizontal: selectedPoses.map(function (pos) { return pos[1] + distY; }),\r\n vertical: selectedPoses.map(function (pos) { return pos[0] + distX; }),\r\n }), horizontalSnapInfo = _a.horizontal, verticalSnapInfo = _a.vertical;\r\n distY -= horizontalSnapInfo.offset;\r\n distX -= verticalSnapInfo.offset;\r\n }\r\n var dist = getDragDist({ datas: datas, distX: distX, distY: distY }, true);\r\n var nextPoses = datas.nextPoses.slice();\r\n posIndexes.forEach(function (index) {\r\n nextPoses[index] = plus(nextPoses[index], dist);\r\n });\r\n if (!NEARBY_POS.every(function (nearByPoses) { return isValidPos(nearByPoses.map(function (i) { return poses[i]; }), nearByPoses.map(function (i) { return nextPoses[i]; })); })) {\r\n return false;\r\n }\r\n var h = createWarpMatrix(poses[0], poses[2], poses[1], poses[3], nextPoses[0], nextPoses[2], nextPoses[1], nextPoses[3]);\r\n if (!h.length) {\r\n return false;\r\n }\r\n // B * A * M\r\n var afterMatrix = multiply(targetInverseMatrix, h, 4);\r\n // B * M * A\r\n var matrix = getTransfromMatrix(datas, afterMatrix, true);\r\n var delta = multiply(invert(prevMatrix, 4), matrix, 4);\r\n datas.prevMatrix = matrix;\r\n var totalMatrix = multiply(startValue, matrix, 4);\r\n var nextTransform = convertTransformFormat(datas, \"matrix3d(\".concat(totalMatrix.join(\", \"), \")\"), \"matrix3d(\".concat(matrix.join(\", \"), \")\"));\r\n fillOriginalTransform(e, nextTransform);\r\n triggerEvent(moveable, \"onWarp\", fillParams(moveable, e, __assign({ delta: delta, matrix: totalMatrix, dist: matrix, multiply: multiply, transform: nextTransform }, fillCSSObject({\r\n transform: nextTransform,\r\n }, e))));\r\n return true;\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n var datas = e.datas, isDrag = e.isDrag;\r\n if (!datas.isWarp) {\r\n return false;\r\n }\r\n datas.isWarp = false;\r\n triggerEvent(moveable, \"onWarpEnd\", fillEndParams(moveable, e, {}));\r\n return isDrag;\r\n },\r\n};\r\n/**\r\n * Whether or not target can be warped. (default: false)\r\n * @name Moveable.Warpable#warpable\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.warpable = true;\r\n */\r\n/**\r\n* Set directions to show the control box. (default: [\"n\", \"nw\", \"ne\", \"s\", \"se\", \"sw\", \"e\", \"w\"])\r\n* @name Moveable.Warpable#renderDirections\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* warpable: true,\r\n* renderDirections: [\"n\", \"nw\", \"ne\", \"s\", \"se\", \"sw\", \"e\", \"w\"],\r\n* });\r\n*\r\n* moveable.renderDirections = [\"nw\", \"ne\", \"sw\", \"se\"];\r\n*/\r\n/**\r\n* When the warp starts, the warpStart event is called.\r\n* @memberof Moveable.Warpable\r\n* @event warpStart\r\n* @param {Moveable.Warpable.OnWarpStart} - Parameters for the warpStart event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, { warpable: true });\r\n* moveable.on(\"warpStart\", ({ target }) => {\r\n* console.log(target);\r\n* });\r\n*/\r\n/**\r\n * When warping, the warp event is called.\r\n * @memberof Moveable.Warpable\r\n * @event warp\r\n * @param {Moveable.Warpable.OnWarp} - Parameters for the warp event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n * let matrix = [\r\n * 1, 0, 0, 0,\r\n * 0, 1, 0, 0,\r\n * 0, 0, 1, 0,\r\n * 0, 0, 0, 1,\r\n * ];\r\n * const moveable = new Moveable(document.body, { warpable: true });\r\n * moveable.on(\"warp\", ({ target, transform, delta, multiply }) => {\r\n * // target.style.transform = transform;\r\n * matrix = multiply(matrix, delta);\r\n * target.style.transform = `matrix3d(${matrix.join(\",\")})`;\r\n * });\r\n */\r\n/**\r\n * When the warp finishes, the warpEnd event is called.\r\n * @memberof Moveable.Warpable\r\n * @event warpEnd\r\n * @param {Moveable.Warpable.OnWarpEnd} - Parameters for the warpEnd event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { warpable: true });\r\n * moveable.on(\"warpEnd\", ({ target, isDrag }) => {\r\n * console.log(target, isDrag);\r\n * });\r\n */\n\nvar AREA_PIECES = /*#__PURE__*/ prefix(\"area-pieces\");\r\nvar AREA_PIECE = /*#__PURE__*/ prefix(\"area-piece\");\r\nvar AVOID = /*#__PURE__*/ prefix(\"avoid\");\r\nvar VIEW_DRAGGING = prefix(\"view-dragging\");\n\nfunction restoreStyle(moveable) {\r\n var el = moveable.areaElement;\r\n if (!el) {\r\n return;\r\n }\r\n var _a = moveable.state, width = _a.width, height = _a.height;\r\n removeClass(el, AVOID);\r\n el.style.cssText += \"left: 0px; top: 0px; width: \".concat(width, \"px; height: \").concat(height, \"px\");\r\n}\r\nfunction renderPieces(React) {\r\n return (React.createElement(\"div\", { key: \"area_pieces\", className: AREA_PIECES },\r\n React.createElement(\"div\", { className: AREA_PIECE }),\r\n React.createElement(\"div\", { className: AREA_PIECE }),\r\n React.createElement(\"div\", { className: AREA_PIECE }),\r\n React.createElement(\"div\", { className: AREA_PIECE })));\r\n}\r\nvar DragArea = {\r\n name: \"dragArea\",\r\n props: [\r\n \"dragArea\",\r\n \"passDragArea\",\r\n ],\r\n events: [\r\n \"click\",\r\n \"clickGroup\",\r\n ],\r\n render: function (moveable, React) {\r\n var _a = moveable.props, target = _a.target, dragArea = _a.dragArea, groupable = _a.groupable, passDragArea = _a.passDragArea;\r\n var _b = moveable.getState(), width = _b.width, height = _b.height, renderPoses = _b.renderPoses;\r\n var className = passDragArea ? prefix(\"area\", \"pass\") : prefix(\"area\");\r\n if (groupable) {\r\n return [\r\n React.createElement(\"div\", { key: \"area\", ref: ref(moveable, \"areaElement\"), className: className }),\r\n renderPieces(React),\r\n ];\r\n }\r\n if (!target || !dragArea) {\r\n return [];\r\n }\r\n var h = createWarpMatrix([0, 0], [width, 0], [0, height], [width, height], renderPoses[0], renderPoses[1], renderPoses[2], renderPoses[3]);\r\n var transform = h.length ? makeMatrixCSS(h, true) : \"none\";\r\n return [\r\n React.createElement(\"div\", { key: \"area\", ref: ref(moveable, \"areaElement\"), className: className, style: {\r\n top: \"0px\",\r\n left: \"0px\",\r\n width: \"\".concat(width, \"px\"),\r\n height: \"\".concat(height, \"px\"),\r\n transformOrigin: \"0 0\",\r\n transform: transform,\r\n } }),\r\n renderPieces(React),\r\n ];\r\n },\r\n dragStart: function (moveable, _a) {\r\n var datas = _a.datas, clientX = _a.clientX, clientY = _a.clientY, inputEvent = _a.inputEvent;\r\n if (!inputEvent) {\r\n return false;\r\n }\r\n datas.isDragArea = false;\r\n var areaElement = moveable.areaElement;\r\n var state = moveable.state;\r\n var moveableClientRect = state.moveableClientRect, renderPoses = state.renderPoses, rootMatrix = state.rootMatrix, is3d = state.is3d;\r\n var left = moveableClientRect.left, top = moveableClientRect.top;\r\n var _b = getRect(renderPoses), relativeLeft = _b.left, relativeTop = _b.top, width = _b.width, height = _b.height;\r\n var n = is3d ? 4 : 3;\r\n var _c = __read(calculateInversePosition(rootMatrix, [clientX - left, clientY - top], n), 2), posX = _c[0], posY = _c[1];\r\n posX -= relativeLeft;\r\n posY -= relativeTop;\r\n var rects = [\r\n { left: relativeLeft, top: relativeTop, width: width, height: posY - 10 },\r\n { left: relativeLeft, top: relativeTop, width: posX - 10, height: height },\r\n { left: relativeLeft, top: relativeTop + posY + 10, width: width, height: height - posY - 10 },\r\n { left: relativeLeft + posX + 10, top: relativeTop, width: width - posX - 10, height: height },\r\n ];\r\n var children = [].slice.call(areaElement.nextElementSibling.children);\r\n rects.forEach(function (rect, i) {\r\n children[i].style.cssText\r\n = \"left: \".concat(rect.left, \"px;top: \").concat(rect.top, \"px; width: \").concat(rect.width, \"px; height: \").concat(rect.height, \"px;\");\r\n });\r\n addClass(areaElement, AVOID);\r\n state.disableNativeEvent = true;\r\n return;\r\n },\r\n drag: function (moveable, _a) {\r\n var datas = _a.datas, inputEvent = _a.inputEvent;\r\n this.enableNativeEvent(moveable);\r\n if (!inputEvent) {\r\n return false;\r\n }\r\n if (!datas.isDragArea) {\r\n datas.isDragArea = true;\r\n restoreStyle(moveable);\r\n }\r\n },\r\n dragEnd: function (moveable, e) {\r\n this.enableNativeEvent(moveable);\r\n var inputEvent = e.inputEvent, datas = e.datas;\r\n if (!inputEvent) {\r\n return false;\r\n }\r\n if (!datas.isDragArea) {\r\n restoreStyle(moveable);\r\n }\r\n },\r\n dragGroupStart: function (moveable, e) {\r\n return this.dragStart(moveable, e);\r\n },\r\n dragGroup: function (moveable, e) {\r\n return this.drag(moveable, e);\r\n },\r\n dragGroupEnd: function (moveable, e) {\r\n return this.dragEnd(moveable, e);\r\n },\r\n unset: function (moveable) {\r\n restoreStyle(moveable);\r\n moveable.state.disableNativeEvent = false;\r\n },\r\n enableNativeEvent: function (moveable) {\r\n var state = moveable.state;\r\n if (state.disableNativeEvent) {\r\n requestAnimationFrame(function () {\r\n state.disableNativeEvent = false;\r\n });\r\n }\r\n },\r\n};\r\n/**\r\n * Add an event to the moveable area instead of the target for stopPropagation. (default: false, true in group)\r\n * @name Moveable#dragArea\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * dragArea: false,\r\n * });\r\n */\r\n/**\r\n * Set `pointerEvents: none;` css to pass events in dragArea. (default: false)\r\n * @name Moveable#passDragArea\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * dragArea: false,\r\n * });\r\n */\n\nvar Origin = makeAble(\"origin\", {\r\n props: [\"origin\", \"svgOrigin\"],\r\n render: function (moveable, React) {\r\n var _a = moveable.props, zoom = _a.zoom, svgOrigin = _a.svgOrigin, groupable = _a.groupable;\r\n var _b = moveable.getState(), beforeOrigin = _b.beforeOrigin, rotation = _b.rotation, svg = _b.svg, allMatrix = _b.allMatrix, is3d = _b.is3d, left = _b.left, top = _b.top, offsetWidth = _b.offsetWidth, offsetHeight = _b.offsetHeight;\r\n var originStyle;\r\n if (!groupable && svg && svgOrigin) {\r\n var _c = __read(convertTransformOriginArray(svgOrigin, offsetWidth, offsetHeight), 2), originX = _c[0], originY = _c[1];\r\n var n = is3d ? 4 : 3;\r\n var result = calculatePosition(allMatrix, [originX, originY], n);\r\n originStyle = getControlTransform(rotation, zoom, minus(result, [left, top]));\r\n }\r\n else {\r\n originStyle = getControlTransform(rotation, zoom, beforeOrigin);\r\n }\r\n return [\r\n React.createElement(\"div\", { className: prefix(\"control\", \"origin\"), style: originStyle, key: \"beforeOrigin\" }),\r\n ];\r\n },\r\n});\r\n/**\r\n * Whether or not the origin controlbox will be visible or not (default: true)\r\n * @name Moveable#origin\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.origin = true;\r\n */\n\nfunction getDefaultScrollPosition(e) {\r\n var scrollContainer = e.scrollContainer;\r\n return [\r\n scrollContainer.scrollLeft,\r\n scrollContainer.scrollTop,\r\n ];\r\n}\r\n/**\r\n * @namespace Moveable.Scrollable\r\n * @description Whether or not target can be scrolled to the scroll container (default: false)\r\n */\r\nvar Scrollable = {\r\n name: \"scrollable\",\r\n canPinch: true,\r\n props: [\r\n \"scrollable\",\r\n \"scrollContainer\",\r\n \"scrollThreshold\",\r\n \"scrollThrottleTime\",\r\n \"getScrollPosition\",\r\n \"scrollOptions\",\r\n ],\r\n events: [\r\n \"scroll\",\r\n \"scrollGroup\",\r\n ],\r\n dragRelation: \"strong\",\r\n dragStart: function (moveable, e) {\r\n var props = moveable.props;\r\n var _a = props.scrollContainer, scrollContainer = _a === void 0 ? moveable.getContainer() : _a, scrollOptions = props.scrollOptions;\r\n var dragScroll = new DragScroll();\r\n var scrollContainerElement = getRefTarget(scrollContainer, true);\r\n e.datas.dragScroll = dragScroll;\r\n moveable.state.dragScroll = dragScroll;\r\n var gestoName = e.isControl ? \"controlGesto\" : \"targetGesto\";\r\n var targets = e.targets;\r\n dragScroll.on(\"scroll\", function (_a) {\r\n var container = _a.container, direction = _a.direction;\r\n var params = fillParams(moveable, e, {\r\n scrollContainer: container,\r\n direction: direction,\r\n });\r\n var eventName = targets ? \"onScrollGroup\" : \"onScroll\";\r\n if (targets) {\r\n params.targets = targets;\r\n }\r\n triggerEvent(moveable, eventName, params);\r\n }).on(\"move\", function (_a) {\r\n var offsetX = _a.offsetX, offsetY = _a.offsetY, inputEvent = _a.inputEvent;\r\n moveable[gestoName].scrollBy(offsetX, offsetY, inputEvent.inputEvent, false);\r\n }).on(\"scrollDrag\", function (_a) {\r\n var next = _a.next;\r\n next(moveable[gestoName].getCurrentEvent());\r\n });\r\n dragScroll.dragStart(e, __assign({ container: scrollContainerElement }, scrollOptions));\r\n },\r\n checkScroll: function (moveable, e) {\r\n var dragScroll = e.datas.dragScroll;\r\n if (!dragScroll) {\r\n return;\r\n }\r\n var _a = moveable.props, _b = _a.scrollContainer, scrollContainer = _b === void 0 ? moveable.getContainer() : _b, _c = _a.scrollThreshold, scrollThreshold = _c === void 0 ? 0 : _c, _d = _a.scrollThrottleTime, scrollThrottleTime = _d === void 0 ? 0 : _d, _e = _a.getScrollPosition, getScrollPosition = _e === void 0 ? getDefaultScrollPosition : _e, scrollOptions = _a.scrollOptions;\r\n dragScroll.drag(e, __assign({ container: scrollContainer, threshold: scrollThreshold, throttleTime: scrollThrottleTime, getScrollPosition: function (ev) {\r\n return getScrollPosition({ scrollContainer: ev.container, direction: ev.direction });\r\n } }, scrollOptions));\r\n return true;\r\n },\r\n drag: function (moveable, e) {\r\n return this.checkScroll(moveable, e);\r\n },\r\n dragEnd: function (moveable, e) {\r\n e.datas.dragScroll.dragEnd();\r\n e.datas.dragScroll = null;\r\n },\r\n dragControlStart: function (moveable, e) {\r\n return this.dragStart(moveable, __assign(__assign({}, e), { isControl: true }));\r\n },\r\n dragControl: function (moveable, e) {\r\n return this.drag(moveable, e);\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n return this.dragEnd(moveable, e);\r\n },\r\n dragGroupStart: function (moveable, e) {\r\n return this.dragStart(moveable, __assign(__assign({}, e), { targets: moveable.props.targets }));\r\n },\r\n dragGroup: function (moveable, e) {\r\n return this.drag(moveable, __assign(__assign({}, e), { targets: moveable.props.targets }));\r\n },\r\n dragGroupEnd: function (moveable, e) {\r\n return this.dragEnd(moveable, __assign(__assign({}, e), { targets: moveable.props.targets }));\r\n },\r\n dragGroupControlStart: function (moveable, e) {\r\n return this.dragStart(moveable, __assign(__assign({}, e), { targets: moveable.props.targets, isControl: true }));\r\n },\r\n dragGroupControl: function (moveable, e) {\r\n return this.drag(moveable, __assign(__assign({}, e), { targets: moveable.props.targets }));\r\n },\r\n dragGroupControEnd: function (moveable, e) {\r\n return this.dragEnd(moveable, __assign(__assign({}, e), { targets: moveable.props.targets }));\r\n },\r\n unset: function (moveable) {\r\n var _a;\r\n var state = moveable.state;\r\n (_a = state.dragScroll) === null || _a === void 0 ? void 0 : _a.dragEnd();\r\n state.dragScroll = null;\r\n },\r\n};\r\n/**\r\n * When the drag cursor leaves the scrollContainer, the `scroll` event occur to scroll.\r\n * @memberof Moveable.Scrollable\r\n * @event scroll\r\n * @param {Moveable.Scrollable.OnScroll} - Parameters for the `scroll` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: document.querySelector(\".target\"),\r\n * });\r\n * moveable.on(\"scroll\", ({ scrollContainer, direction }) => {\r\n * scrollContainer.scrollLeft += direction[0] * 10;\r\n * scrollContainer.scrollTop += direction[1] * 10;\r\n * });\r\n */\r\n/**\r\n * When the drag cursor leaves the scrollContainer, the `scrollGroup` event occur to scroll in group.\r\n * @memberof Moveable.Scrollable\r\n * @event scrollGroup\r\n * @param {Moveable.Scrollable.OnScrollGroup} - Parameters for the `scrollGroup` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * });\r\n * moveable.on(\"scroll\", ({ scrollContainer, direction }) => {\r\n * scrollContainer.scrollLeft += direction[0] * 10;\r\n * scrollContainer.scrollTop += direction[1] * 10;\r\n * });\r\n */\n\nvar Default = {\r\n name: \"\",\r\n props: [\r\n \"target\",\r\n \"dragTargetSelf\",\r\n \"dragTarget\",\r\n \"dragContainer\",\r\n \"container\",\r\n \"warpSelf\",\r\n \"rootContainer\",\r\n \"useResizeObserver\",\r\n \"useMutationObserver\",\r\n \"zoom\",\r\n \"dragFocusedInput\",\r\n \"transformOrigin\",\r\n \"ables\",\r\n \"className\",\r\n \"pinchThreshold\",\r\n \"pinchOutside\",\r\n \"triggerAblesSimultaneously\",\r\n \"checkInput\",\r\n \"cspNonce\",\r\n \"translateZ\",\r\n \"hideDefaultLines\",\r\n \"props\",\r\n \"flushSync\",\r\n \"stopPropagation\",\r\n \"preventClickEventOnDrag\",\r\n \"preventClickDefault\",\r\n \"viewContainer\",\r\n \"persistData\",\r\n \"useAccuratePosition\",\r\n \"firstRenderState\",\r\n \"linePadding\",\r\n \"controlPadding\",\r\n \"preventDefault\",\r\n \"requestStyles\",\r\n ],\r\n events: [\r\n \"changeTargets\",\r\n ],\r\n};\n\nvar Padding = makeAble(\"padding\", {\r\n props: [\"padding\"],\r\n render: function (moveable, React) {\r\n var props = moveable.props;\r\n if (props.dragArea) {\r\n return [];\r\n }\r\n var _a = getPaddingBox(props.padding || {}), left = _a.left, top = _a.top, right = _a.right, bottom = _a.bottom;\r\n var _b = moveable.getState(), renderPoses = _b.renderPoses, pos1 = _b.pos1, pos2 = _b.pos2, pos3 = _b.pos3, pos4 = _b.pos4;\r\n var poses = [pos1, pos2, pos3, pos4];\r\n var paddingDirections = [];\r\n if (left > 0) {\r\n paddingDirections.push([0, 2]);\r\n }\r\n if (top > 0) {\r\n paddingDirections.push([0, 1]);\r\n }\r\n if (right > 0) {\r\n paddingDirections.push([1, 3]);\r\n }\r\n if (bottom > 0) {\r\n paddingDirections.push([2, 3]);\r\n }\r\n return paddingDirections.map(function (_a, i) {\r\n var _b = __read(_a, 2), dir1 = _b[0], dir2 = _b[1];\r\n var paddingPos1 = poses[dir1];\r\n var paddingPos2 = poses[dir2];\r\n var paddingPos3 = renderPoses[dir1];\r\n var paddingPos4 = renderPoses[dir2];\r\n var h = createWarpMatrix([0, 0], [100, 0], [0, 100], [100, 100], paddingPos1, paddingPos2, paddingPos3, paddingPos4);\r\n if (!h.length) {\r\n return undefined;\r\n }\r\n return (React.createElement(\"div\", { key: \"padding\".concat(i), className: prefix(\"padding\"), style: {\r\n transform: makeMatrixCSS(h, true),\r\n } }));\r\n });\r\n },\r\n});\r\n/**\r\n * Add padding around the target to increase the drag area.\r\n * @name Moveable#padding\r\n * @default null\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: document.querySelector(\".target\"),\r\n * padding: { left: 0, top: 0, right: 0, bottom: 0 },\r\n * });\r\n * moveable.padding = { left: 10, top: 10, right: 10, bottom: 10 },\r\n * moveable.updateRect();\r\n */\n\nvar RADIUS_DIRECTIONS = [\"nw\", \"ne\", \"se\", \"sw\"];\r\nfunction calculateRatio(values, size) {\r\n var sumSize = values[0] + values[1];\r\n var sumRatio = sumSize > size ? size / sumSize : 1;\r\n values[0] *= sumRatio;\r\n values[1] = size - values[1] * sumRatio;\r\n return values;\r\n}\r\nvar HORIZONTAL_RADIUS_ORDER = [1, 2, 5, 6];\r\nvar VERTICAL_RADIUS_ORDER = [0, 3, 4, 7];\r\nvar HORIZONTAL_RADIUS_DIRECTIONS = [1, -1, -1, 1];\r\nvar VERTICAL_RADIUS_DIRECTIONS = [1, 1, -1, -1];\r\nfunction getRadiusStyles(nextPoses, isRelative, width, height, left, top, right, bottom) {\r\n if (left === void 0) { left = 0; }\r\n if (top === void 0) { top = 0; }\r\n if (right === void 0) { right = width; }\r\n if (bottom === void 0) { bottom = height; }\r\n var clipStyles = [];\r\n var isVertical = false;\r\n var radiusPoses = nextPoses.filter(function (pos) { return !pos.virtual; });\r\n var raws = radiusPoses.map(function (posInfo) {\r\n var horizontal = posInfo.horizontal, vertical = posInfo.vertical, pos = posInfo.pos;\r\n if (vertical && !isVertical) {\r\n isVertical = true;\r\n clipStyles.push(\"/\");\r\n }\r\n if (isVertical) {\r\n var rawPos = Math.max(0, vertical === 1 ? pos[1] - top : bottom - pos[1]);\r\n clipStyles.push(convertCSSSize(rawPos, height, isRelative));\r\n return rawPos;\r\n }\r\n else {\r\n var rawPos = Math.max(0, horizontal === 1 ? pos[0] - left : right - pos[0]);\r\n clipStyles.push(convertCSSSize(rawPos, width, isRelative));\r\n return rawPos;\r\n }\r\n });\r\n return {\r\n radiusPoses: radiusPoses,\r\n styles: clipStyles,\r\n raws: raws,\r\n };\r\n}\r\nfunction getRadiusRange(controlPoses) {\r\n // [start, length]\r\n var horizontalRange = [0, 0];\r\n var verticalRange = [0, 0];\r\n var length = controlPoses.length;\r\n for (var i = 0; i < length; ++i) {\r\n var clipPose = controlPoses[i];\r\n if (!clipPose.sub) {\r\n continue;\r\n }\r\n if (clipPose.horizontal) {\r\n if (horizontalRange[1] === 0) {\r\n horizontalRange[0] = i;\r\n }\r\n horizontalRange[1] = i - horizontalRange[0] + 1;\r\n verticalRange[0] = i + 1;\r\n }\r\n if (clipPose.vertical) {\r\n if (verticalRange[1] === 0) {\r\n verticalRange[0] = i;\r\n }\r\n verticalRange[1] = i - verticalRange[0] + 1;\r\n }\r\n }\r\n return {\r\n horizontalRange: horizontalRange,\r\n verticalRange: verticalRange,\r\n };\r\n}\r\nfunction getRadiusValues(values, width, height, left, top, minCounts, full) {\r\n var _a, _b, _c, _d;\r\n if (minCounts === void 0) { minCounts = [0, 0]; }\r\n if (full === void 0) { full = false; }\r\n var splitIndex = values.indexOf(\"/\");\r\n var splitLength = (splitIndex > -1 ? values.slice(0, splitIndex) : values).length;\r\n var horizontalValues = values.slice(0, splitLength);\r\n var verticalValues = values.slice(splitLength + 1);\r\n var horizontalValuesLength = horizontalValues.length;\r\n var verticalValuesLength = verticalValues.length;\r\n var hasVerticalValues = verticalValuesLength > 0;\r\n var _e = __read(horizontalValues, 4), _f = _e[0], nwValue = _f === void 0 ? \"0px\" : _f, _g = _e[1], neValue = _g === void 0 ? nwValue : _g, _h = _e[2], seValue = _h === void 0 ? nwValue : _h, _j = _e[3], swValue = _j === void 0 ? neValue : _j;\r\n var _k = __read(verticalValues, 4), _l = _k[0], wnValue = _l === void 0 ? nwValue : _l, _m = _k[1], enValue = _m === void 0 ? hasVerticalValues ? wnValue : neValue : _m, _o = _k[2], esValue = _o === void 0 ? hasVerticalValues ? wnValue : seValue : _o, _p = _k[3], wsValue = _p === void 0 ? hasVerticalValues ? enValue : swValue : _p;\r\n var horizontalRawPoses = [nwValue, neValue, seValue, swValue].map(function (pos) { return convertUnitSize(pos, width); });\r\n var verticalRawPoses = [wnValue, enValue, esValue, wsValue].map(function (pos) { return convertUnitSize(pos, height); });\r\n var horizontalPoses = horizontalRawPoses.slice();\r\n var verticalPoses = verticalRawPoses.slice();\r\n _a = __read(calculateRatio([horizontalPoses[0], horizontalPoses[1]], width), 2), horizontalPoses[0] = _a[0], horizontalPoses[1] = _a[1];\r\n _b = __read(calculateRatio([horizontalPoses[3], horizontalPoses[2]], width), 2), horizontalPoses[3] = _b[0], horizontalPoses[2] = _b[1];\r\n _c = __read(calculateRatio([verticalPoses[0], verticalPoses[3]], height), 2), verticalPoses[0] = _c[0], verticalPoses[3] = _c[1];\r\n _d = __read(calculateRatio([verticalPoses[1], verticalPoses[2]], height), 2), verticalPoses[1] = _d[0], verticalPoses[2] = _d[1];\r\n var nextHorizontalPoses = full\r\n ? horizontalPoses\r\n : horizontalPoses.slice(0, Math.max(minCounts[0], horizontalValuesLength));\r\n var nextVerticalPoses = full\r\n ? verticalPoses\r\n : verticalPoses.slice(0, Math.max(minCounts[1], verticalValuesLength));\r\n return __spreadArray(__spreadArray([], __read(nextHorizontalPoses.map(function (pos, i) {\r\n var direction = RADIUS_DIRECTIONS[i];\r\n return {\r\n virtual: i >= horizontalValuesLength,\r\n horizontal: HORIZONTAL_RADIUS_DIRECTIONS[i],\r\n vertical: 0,\r\n pos: [left + pos, top + (VERTICAL_RADIUS_DIRECTIONS[i] === -1 ? height : 0)],\r\n sub: true,\r\n raw: horizontalRawPoses[i],\r\n direction: direction,\r\n };\r\n })), false), __read(nextVerticalPoses.map(function (pos, i) {\r\n var direction = RADIUS_DIRECTIONS[i];\r\n return {\r\n virtual: i >= verticalValuesLength,\r\n horizontal: 0,\r\n vertical: VERTICAL_RADIUS_DIRECTIONS[i],\r\n pos: [left + (HORIZONTAL_RADIUS_DIRECTIONS[i] === -1 ? width : 0), top + pos],\r\n sub: true,\r\n raw: verticalRawPoses[i],\r\n direction: direction,\r\n };\r\n })), false);\r\n}\r\nfunction removeRadiusPos(controlPoses, poses, index, startIndex, length) {\r\n if (length === void 0) { length = poses.length; }\r\n var _a = getRadiusRange(controlPoses.slice(startIndex)), horizontalRange = _a.horizontalRange, verticalRange = _a.verticalRange;\r\n var radiuslIndex = index - startIndex;\r\n var deleteCount = 0;\r\n if (radiuslIndex === 0) {\r\n deleteCount = length;\r\n }\r\n else if (radiuslIndex > 0 && radiuslIndex < horizontalRange[1]) {\r\n deleteCount = horizontalRange[1] - radiuslIndex;\r\n }\r\n else if (radiuslIndex >= verticalRange[0]) {\r\n deleteCount = verticalRange[0] + verticalRange[1] - radiuslIndex;\r\n }\r\n else {\r\n return;\r\n }\r\n controlPoses.splice(index, deleteCount);\r\n poses.splice(index, deleteCount);\r\n}\r\nfunction addRadiusPos(controlPoses, poses, startIndex, horizontalIndex, verticalIndex, distX, distY, right, bottom, left, top) {\r\n if (left === void 0) { left = 0; }\r\n if (top === void 0) { top = 0; }\r\n var _a = getRadiusRange(controlPoses.slice(startIndex)), horizontalRange = _a.horizontalRange, verticalRange = _a.verticalRange;\r\n if (horizontalIndex > -1) {\r\n var radiusX = HORIZONTAL_RADIUS_DIRECTIONS[horizontalIndex] === 1\r\n ? distX - left\r\n : right - distX;\r\n for (var i = horizontalRange[1]; i <= horizontalIndex; ++i) {\r\n var y = VERTICAL_RADIUS_DIRECTIONS[i] === 1 ? top : bottom;\r\n var x = 0;\r\n if (horizontalIndex === i) {\r\n x = distX;\r\n }\r\n else if (i === 0) {\r\n x = left + radiusX;\r\n }\r\n else if (HORIZONTAL_RADIUS_DIRECTIONS[i] === -1) {\r\n x = right - (poses[startIndex][0] - left);\r\n }\r\n controlPoses.splice(startIndex + i, 0, {\r\n horizontal: HORIZONTAL_RADIUS_DIRECTIONS[i],\r\n vertical: 0,\r\n pos: [x, y],\r\n });\r\n poses.splice(startIndex + i, 0, [x, y]);\r\n if (i === 0) {\r\n break;\r\n }\r\n }\r\n }\r\n else if (verticalIndex > -1) {\r\n var radiusY = VERTICAL_RADIUS_DIRECTIONS[verticalIndex] === 1\r\n ? distY - top\r\n : bottom - distY;\r\n if (horizontalRange[1] === 0 && verticalRange[1] === 0) {\r\n var pos = [\r\n left + radiusY,\r\n top,\r\n ];\r\n controlPoses.push({\r\n horizontal: HORIZONTAL_RADIUS_DIRECTIONS[0],\r\n vertical: 0,\r\n pos: pos,\r\n });\r\n poses.push(pos);\r\n }\r\n var startVerticalIndex = verticalRange[0];\r\n for (var i = verticalRange[1]; i <= verticalIndex; ++i) {\r\n var x = HORIZONTAL_RADIUS_DIRECTIONS[i] === 1 ? left : right;\r\n var y = 0;\r\n if (verticalIndex === i) {\r\n y = distY;\r\n }\r\n else if (i === 0) {\r\n y = top + radiusY;\r\n }\r\n else if (VERTICAL_RADIUS_DIRECTIONS[i] === 1) {\r\n y = poses[startIndex + startVerticalIndex][1];\r\n }\r\n else if (VERTICAL_RADIUS_DIRECTIONS[i] === -1) {\r\n y = bottom - (poses[startIndex + startVerticalIndex][1] - top);\r\n }\r\n controlPoses.push({\r\n horizontal: 0,\r\n vertical: VERTICAL_RADIUS_DIRECTIONS[i],\r\n pos: [x, y],\r\n });\r\n poses.push([x, y]);\r\n if (i === 0) {\r\n break;\r\n }\r\n }\r\n }\r\n}\r\nfunction splitRadiusPoses(controlPoses, raws) {\r\n if (raws === void 0) { raws = controlPoses.map(function (pos) { return pos.raw; }); }\r\n var horizontals = controlPoses\r\n .map(function (pos, i) { return pos.horizontal ? raws[i] : null; }).filter(function (pos) { return pos != null; });\r\n var verticals = controlPoses\r\n .map(function (pos, i) { return pos.vertical ? raws[i] : null; }).filter(function (pos) { return pos != null; });\r\n return {\r\n horizontals: horizontals,\r\n verticals: verticals,\r\n };\r\n}\n\nvar CLIP_DIRECTIONS = [\r\n [0, -1, \"n\"],\r\n [1, 0, \"e\"],\r\n];\r\nvar CLIP_RECT_DIRECTIONS = [\r\n [-1, -1, \"nw\"],\r\n [0, -1, \"n\"],\r\n [1, -1, \"ne\"],\r\n [1, 0, \"e\"],\r\n [1, 1, \"se\"],\r\n [0, 1, \"s\"],\r\n [-1, 1, \"sw\"],\r\n [-1, 0, \"w\"],\r\n];\r\n// 1 2 5 6 0 3 4 7\r\n// 0 1 2 3 4 5 6 7\r\nfunction getClipStyles(moveable, clipPath, poses) {\r\n var clipRelative = moveable.props.clipRelative;\r\n var _a = moveable.state, width = _a.width, height = _a.height;\r\n var _b = clipPath, clipType = _b.type, clipPoses = _b.poses;\r\n var isRect = clipType === \"rect\";\r\n var isCircle = clipType === \"circle\";\r\n if (clipType === \"polygon\") {\r\n return poses.map(function (pos) { return \"\".concat(convertCSSSize(pos[0], width, clipRelative), \" \").concat(convertCSSSize(pos[1], height, clipRelative)); });\r\n }\r\n else if (isRect || clipType === \"inset\") {\r\n var top_1 = poses[1][1];\r\n var right = poses[3][0];\r\n var left = poses[7][0];\r\n var bottom = poses[5][1];\r\n if (isRect) {\r\n return [\r\n top_1,\r\n right,\r\n bottom,\r\n left,\r\n ].map(function (pos) { return \"\".concat(pos, \"px\"); });\r\n }\r\n var clipStyles = [top_1, width - right, height - bottom, left]\r\n .map(function (pos, i) { return convertCSSSize(pos, i % 2 ? width : height, clipRelative); });\r\n if (poses.length > 8) {\r\n var _c = __read(minus(poses[4], poses[0]), 2), subWidth = _c[0], subHeight = _c[1];\r\n clipStyles.push.apply(clipStyles, __spreadArray([\"round\"], __read(getRadiusStyles(clipPoses.slice(8).map(function (info, i) {\r\n return __assign(__assign({}, info), { pos: poses[i] });\r\n }), clipRelative, subWidth, subHeight, left, top_1, right, bottom).styles), false));\r\n }\r\n return clipStyles;\r\n }\r\n else if (isCircle || clipType === \"ellipse\") {\r\n var center = poses[0];\r\n var ry = convertCSSSize(abs(poses[1][1] - center[1]), isCircle ? Math.sqrt((width * width + height * height) / 2) : height, clipRelative);\r\n var clipStyles = isCircle ? [ry]\r\n : [convertCSSSize(abs(poses[2][0] - center[0]), width, clipRelative), ry];\r\n clipStyles.push(\"at\", convertCSSSize(center[0], width, clipRelative), convertCSSSize(center[1], height, clipRelative));\r\n return clipStyles;\r\n }\r\n}\r\nfunction getRectPoses(top, right, bottom, left) {\r\n var xs = [left, (left + right) / 2, right];\r\n var ys = [top, (top + bottom) / 2, bottom];\r\n return CLIP_RECT_DIRECTIONS.map(function (_a) {\r\n var _b = __read(_a, 3), dirx = _b[0], diry = _b[1], dir = _b[2];\r\n var x = xs[dirx + 1];\r\n var y = ys[diry + 1];\r\n return {\r\n vertical: abs(diry),\r\n horizontal: abs(dirx),\r\n direction: dir,\r\n pos: [x, y],\r\n };\r\n });\r\n}\r\nfunction getControlSize(controlPoses) {\r\n var xRange = [Infinity, -Infinity];\r\n var yRange = [Infinity, -Infinity];\r\n controlPoses.forEach(function (_a) {\r\n var pos = _a.pos;\r\n xRange[0] = Math.min(xRange[0], pos[0]);\r\n xRange[1] = Math.max(xRange[1], pos[0]);\r\n yRange[0] = Math.min(yRange[0], pos[1]);\r\n yRange[1] = Math.max(yRange[1], pos[1]);\r\n });\r\n return [\r\n abs(xRange[1] - xRange[0]),\r\n abs(yRange[1] - yRange[0]),\r\n ];\r\n}\r\nfunction getClipPath(target, width, height, defaultClip, customClip) {\r\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\r\n if (!target) {\r\n return;\r\n }\r\n var clipText = customClip;\r\n if (!clipText) {\r\n var getStyle = getCachedStyle(target);\r\n var clipPath = getStyle(\"clipPath\");\r\n clipText = clipPath !== \"none\" ? clipPath : getStyle(\"clip\");\r\n }\r\n if (!clipText || clipText === \"none\" || clipText === \"auto\") {\r\n clipText = defaultClip;\r\n if (!clipText) {\r\n return;\r\n }\r\n }\r\n var _k = splitBracket(clipText), _l = _k.prefix, clipPrefix = _l === void 0 ? clipText : _l, _m = _k.value, value = _m === void 0 ? \"\" : _m;\r\n var isCircle = clipPrefix === \"circle\";\r\n var splitter = \" \";\r\n if (clipPrefix === \"polygon\") {\r\n var values = splitComma(value || \"0% 0%, 100% 0%, 100% 100%, 0% 100%\");\r\n splitter = \",\";\r\n var poses = values.map(function (pos) {\r\n var _a = __read(pos.split(\" \"), 2), xPos = _a[0], yPos = _a[1];\r\n return {\r\n vertical: 1,\r\n horizontal: 1,\r\n pos: [\r\n convertUnitSize(xPos, width),\r\n convertUnitSize(yPos, height),\r\n ],\r\n };\r\n });\r\n var minMaxs = getMinMaxs(poses.map(function (pos) { return pos.pos; }));\r\n return {\r\n type: clipPrefix,\r\n clipText: clipText,\r\n poses: poses,\r\n splitter: splitter,\r\n left: minMaxs.minX,\r\n right: minMaxs.maxX,\r\n top: minMaxs.minY,\r\n bottom: minMaxs.maxY,\r\n };\r\n }\r\n else if (isCircle || clipPrefix === \"ellipse\") {\r\n var xPos = \"\";\r\n var yPos = \"\";\r\n var radiusX_1 = 0;\r\n var radiusY_1 = 0;\r\n var values = splitSpace(value);\r\n if (isCircle) {\r\n var radius = \"\";\r\n _a = __read(values, 4), _b = _a[0], radius = _b === void 0 ? \"50%\" : _b, _c = _a[2], xPos = _c === void 0 ? \"50%\" : _c, _d = _a[3], yPos = _d === void 0 ? \"50%\" : _d;\r\n radiusX_1 = convertUnitSize(radius, Math.sqrt((width * width + height * height) / 2));\r\n radiusY_1 = radiusX_1;\r\n }\r\n else {\r\n var xRadius = \"\";\r\n var yRadius = \"\";\r\n _e = __read(values, 5), _f = _e[0], xRadius = _f === void 0 ? \"50%\" : _f, _g = _e[1], yRadius = _g === void 0 ? \"50%\" : _g, _h = _e[3], xPos = _h === void 0 ? \"50%\" : _h, _j = _e[4], yPos = _j === void 0 ? \"50%\" : _j;\r\n radiusX_1 = convertUnitSize(xRadius, width);\r\n radiusY_1 = convertUnitSize(yRadius, height);\r\n }\r\n var centerPos_1 = [\r\n convertUnitSize(xPos, width),\r\n convertUnitSize(yPos, height),\r\n ];\r\n var poses = __spreadArray([\r\n {\r\n vertical: 1,\r\n horizontal: 1,\r\n pos: centerPos_1,\r\n direction: \"nesw\",\r\n }\r\n ], __read(CLIP_DIRECTIONS.slice(0, isCircle ? 1 : 2).map(function (dir) { return ({\r\n vertical: abs(dir[1]),\r\n horizontal: dir[0],\r\n direction: dir[2],\r\n sub: true,\r\n pos: [\r\n centerPos_1[0] + dir[0] * radiusX_1,\r\n centerPos_1[1] + dir[1] * radiusY_1,\r\n ],\r\n }); })), false);\r\n return {\r\n type: clipPrefix,\r\n clipText: clipText,\r\n radiusX: radiusX_1,\r\n radiusY: radiusY_1,\r\n left: centerPos_1[0] - radiusX_1,\r\n top: centerPos_1[1] - radiusY_1,\r\n right: centerPos_1[0] + radiusX_1,\r\n bottom: centerPos_1[1] + radiusY_1,\r\n poses: poses,\r\n splitter: splitter,\r\n };\r\n }\r\n else if (clipPrefix === \"inset\") {\r\n var values = splitSpace(value || \"0 0 0 0\");\r\n var roundIndex = values.indexOf(\"round\");\r\n var rectLength = (roundIndex > -1 ? values.slice(0, roundIndex) : values).length;\r\n var radiusValues = values.slice(rectLength + 1);\r\n var _o = __read(values.slice(0, rectLength), 4), topValue = _o[0], _p = _o[1], rightValue = _p === void 0 ? topValue : _p, _q = _o[2], bottomValue = _q === void 0 ? topValue : _q, _r = _o[3], leftValue = _r === void 0 ? rightValue : _r;\r\n var _s = __read([topValue, bottomValue].map(function (pos) { return convertUnitSize(pos, height); }), 2), top_2 = _s[0], bottom = _s[1];\r\n var _t = __read([leftValue, rightValue].map(function (pos) { return convertUnitSize(pos, width); }), 2), left = _t[0], right = _t[1];\r\n var nextRight = width - right;\r\n var nextBottom = height - bottom;\r\n var radiusPoses = getRadiusValues(radiusValues, nextRight - left, nextBottom - top_2, left, top_2);\r\n var poses = __spreadArray(__spreadArray([], __read(getRectPoses(top_2, nextRight, nextBottom, left)), false), __read(radiusPoses), false);\r\n return {\r\n type: \"inset\",\r\n clipText: clipText,\r\n poses: poses,\r\n top: top_2,\r\n left: left,\r\n right: nextRight,\r\n bottom: nextBottom,\r\n radius: radiusValues,\r\n splitter: splitter,\r\n };\r\n }\r\n else if (clipPrefix === \"rect\") {\r\n // top right bottom left\r\n var values = splitComma(value || \"0px, \".concat(width, \"px, \").concat(height, \"px, 0px\"));\r\n splitter = \",\";\r\n var _u = __read(values.map(function (pos) {\r\n var posValue = splitUnit(pos).value;\r\n return posValue;\r\n }), 4), top_3 = _u[0], right = _u[1], bottom = _u[2], left = _u[3];\r\n var poses = getRectPoses(top_3, right, bottom, left);\r\n return {\r\n type: \"rect\",\r\n clipText: clipText,\r\n poses: poses,\r\n top: top_3,\r\n right: right,\r\n bottom: bottom,\r\n left: left,\r\n values: values,\r\n splitter: splitter,\r\n };\r\n }\r\n return;\r\n}\n\nfunction moveControlPos(controlPoses, index, dist, isRect, keepRatio) {\r\n var _a = controlPoses[index], direction = _a.direction, sub = _a.sub;\r\n var dists = controlPoses.map(function () { return [0, 0]; });\r\n var directions = direction ? direction.split(\"\") : [];\r\n if (isRect && index < 8) {\r\n var verticalDirections = directions.filter(function (dir) { return dir === \"w\" || dir === \"e\"; });\r\n var horizontalDirections = directions.filter(function (dir) { return dir === \"n\" || dir === \"s\"; });\r\n var verticalDirection_1 = verticalDirections[0];\r\n var horizontalDirection_1 = horizontalDirections[0];\r\n dists[index] = dist;\r\n var _b = __read(getControlSize(controlPoses), 2), width = _b[0], height = _b[1];\r\n var ratio = width && height ? width / height : 0;\r\n if (ratio && keepRatio) {\r\n // 0 1 2\r\n // 7 3\r\n // 6 5 4\r\n var fixedIndex = (index + 4) % 8;\r\n var fixedPosition = controlPoses[fixedIndex].pos;\r\n var sizeDirection = [0, 0];\r\n if (direction.indexOf(\"w\") > -1) {\r\n sizeDirection[0] = -1;\r\n }\r\n else if (direction.indexOf(\"e\") > -1) {\r\n sizeDirection[0] = 1;\r\n }\r\n if (direction.indexOf(\"n\") > -1) {\r\n sizeDirection[1] = -1;\r\n }\r\n else if (direction.indexOf(\"s\") > -1) {\r\n sizeDirection[1] = 1;\r\n }\r\n var nextDist = getSizeDistByDist([width, height], dist, ratio, sizeDirection, true);\r\n var nextWidth = width + nextDist[0];\r\n var nextHeight = height + nextDist[1];\r\n var top_1 = fixedPosition[1];\r\n var bottom = fixedPosition[1];\r\n var left = fixedPosition[0];\r\n var right = fixedPosition[0];\r\n if (sizeDirection[0] === -1) {\r\n left = right - nextWidth;\r\n }\r\n else if (sizeDirection[0] === 1) {\r\n right = left + nextWidth;\r\n }\r\n else {\r\n left = left - nextWidth / 2;\r\n right = right + nextWidth / 2;\r\n }\r\n if (sizeDirection[1] === -1) {\r\n top_1 = bottom - nextHeight;\r\n }\r\n else if (sizeDirection[1] === 1) {\r\n bottom = top_1 + nextHeight;\r\n }\r\n else {\r\n top_1 = bottom - nextHeight / 2;\r\n bottom = top_1 + nextHeight;\r\n }\r\n var nextControlPoses_1 = getRectPoses(top_1, right, bottom, left);\r\n controlPoses.forEach(function (controlPose, i) {\r\n dists[i][0] = nextControlPoses_1[i].pos[0] - controlPose.pos[0];\r\n dists[i][1] = nextControlPoses_1[i].pos[1] - controlPose.pos[1];\r\n });\r\n }\r\n else {\r\n controlPoses.forEach(function (controlPose, i) {\r\n var controlDir = controlPose.direction;\r\n if (!controlDir) {\r\n return;\r\n }\r\n if (controlDir.indexOf(verticalDirection_1) > -1) {\r\n dists[i][0] = dist[0];\r\n }\r\n if (controlDir.indexOf(horizontalDirection_1) > -1) {\r\n dists[i][1] = dist[1];\r\n }\r\n });\r\n if (verticalDirection_1) {\r\n dists[1][0] = dist[0] / 2;\r\n dists[5][0] = dist[0] / 2;\r\n }\r\n if (horizontalDirection_1) {\r\n dists[3][1] = dist[1] / 2;\r\n dists[7][1] = dist[1] / 2;\r\n }\r\n }\r\n }\r\n else if (direction && !sub) {\r\n directions.forEach(function (dir) {\r\n var isVertical = dir === \"n\" || dir === \"s\";\r\n controlPoses.forEach(function (controlPose, i) {\r\n var dirDir = controlPose.direction, dirHorizontal = controlPose.horizontal, dirVertical = controlPose.vertical;\r\n if (!dirDir || dirDir.indexOf(dir) === -1) {\r\n return;\r\n }\r\n dists[i] = [\r\n isVertical || !dirHorizontal ? 0 : dist[0],\r\n !isVertical || !dirVertical ? 0 : dist[1],\r\n ];\r\n });\r\n });\r\n }\r\n else {\r\n dists[index] = dist;\r\n }\r\n return dists;\r\n}\r\nfunction addClipPath(moveable, e) {\r\n var _a = __read(calculatePointerDist(moveable, e), 2), distX = _a[0], distY = _a[1];\r\n var _b = e.datas, clipPath = _b.clipPath, clipIndex = _b.clipIndex;\r\n var _c = clipPath, clipType = _c.type, clipPoses = _c.poses, splitter = _c.splitter;\r\n var poses = clipPoses.map(function (pos) { return pos.pos; });\r\n if (clipType === \"polygon\") {\r\n poses.splice(clipIndex, 0, [distX, distY]);\r\n }\r\n else if (clipType === \"inset\") {\r\n var horizontalIndex = HORIZONTAL_RADIUS_ORDER.indexOf(clipIndex);\r\n var verticalIndex = VERTICAL_RADIUS_ORDER.indexOf(clipIndex);\r\n var length_1 = clipPoses.length;\r\n addRadiusPos(clipPoses, poses, 8, horizontalIndex, verticalIndex, distX, distY, poses[4][0], poses[4][1], poses[0][0], poses[0][1]);\r\n if (length_1 === clipPoses.length) {\r\n return;\r\n }\r\n }\r\n else {\r\n return;\r\n }\r\n var clipStyles = getClipStyles(moveable, clipPath, poses);\r\n var clipStyle = \"\".concat(clipType, \"(\").concat(clipStyles.join(splitter), \")\");\r\n triggerEvent(moveable, \"onClip\", fillParams(moveable, e, __assign({ clipEventType: \"added\", clipType: clipType, poses: poses, clipStyles: clipStyles, clipStyle: clipStyle, distX: 0, distY: 0 }, fillCSSObject({\r\n clipPath: clipStyle,\r\n }, e))));\r\n}\r\nfunction removeClipPath(moveable, e) {\r\n var _a = e.datas, clipPath = _a.clipPath, clipIndex = _a.clipIndex;\r\n var _b = clipPath, clipType = _b.type, clipPoses = _b.poses, splitter = _b.splitter;\r\n var poses = clipPoses.map(function (pos) { return pos.pos; });\r\n var length = poses.length;\r\n if (clipType === \"polygon\") {\r\n clipPoses.splice(clipIndex, 1);\r\n poses.splice(clipIndex, 1);\r\n }\r\n else if (clipType === \"inset\") {\r\n if (clipIndex < 8) {\r\n return;\r\n }\r\n removeRadiusPos(clipPoses, poses, clipIndex, 8, length);\r\n if (length === clipPoses.length) {\r\n return;\r\n }\r\n }\r\n else {\r\n return;\r\n }\r\n var clipStyles = getClipStyles(moveable, clipPath, poses);\r\n var clipStyle = \"\".concat(clipType, \"(\").concat(clipStyles.join(splitter), \")\");\r\n triggerEvent(moveable, \"onClip\", fillParams(moveable, e, __assign({ clipEventType: \"removed\", clipType: clipType, poses: poses, clipStyles: clipStyles, clipStyle: clipStyle, distX: 0, distY: 0 }, fillCSSObject({\r\n clipPath: clipStyle,\r\n }, e))));\r\n}\r\n/**\r\n * @namespace Moveable.Clippable\r\n * @description Whether to clip the target.\r\n */\r\nvar Clippable = {\r\n name: \"clippable\",\r\n props: [\r\n \"clippable\",\r\n \"defaultClipPath\",\r\n \"customClipPath\",\r\n \"keepRatio\",\r\n \"clipRelative\",\r\n \"clipArea\",\r\n \"dragWithClip\",\r\n \"clipTargetBounds\",\r\n \"clipVerticalGuidelines\",\r\n \"clipHorizontalGuidelines\",\r\n \"clipSnapThreshold\",\r\n ],\r\n events: [\r\n \"clipStart\",\r\n \"clip\",\r\n \"clipEnd\",\r\n ],\r\n css: [\r\n \".control.clip-control {\\nbackground: #6d6;\\ncursor: pointer;\\n}\\n.control.clip-control.clip-radius {\\nbackground: #d66;\\n}\\n.line.clip-line {\\nbackground: #6e6;\\ncursor: move;\\nz-index: 1;\\n}\\n.clip-area {\\nposition: absolute;\\ntop: 0;\\nleft: 0;\\n}\\n.clip-ellipse {\\nposition: absolute;\\ncursor: move;\\nborder: 1px solid #6d6;\\nborder: var(--zoompx) solid #6d6;\\nborder-radius: 50%;\\ntransform-origin: 0px 0px;\\n}\",\r\n \":host {\\n--bounds-color: #d66;\\n}\",\r\n \".guideline {\\npointer-events: none;\\nz-index: 2;\\n}\",\r\n \".line.guideline.bounds {\\nbackground: #d66;\\nbackground: var(--bounds-color);\\n}\",\r\n ],\r\n render: function (moveable, React) {\r\n var _a = moveable.props, customClipPath = _a.customClipPath, defaultClipPath = _a.defaultClipPath, clipArea = _a.clipArea, zoom = _a.zoom, groupable = _a.groupable;\r\n var _b = moveable.getState(), target = _b.target, width = _b.width, height = _b.height, allMatrix = _b.allMatrix, is3d = _b.is3d, left = _b.left, top = _b.top, pos1 = _b.pos1, pos2 = _b.pos2, pos3 = _b.pos3, pos4 = _b.pos4, clipPathState = _b.clipPathState, snapBoundInfos = _b.snapBoundInfos, rotationRad = _b.rotation;\r\n if (!target || groupable) {\r\n return [];\r\n }\r\n var clipPath = getClipPath(target, width, height, defaultClipPath || \"inset\", clipPathState || customClipPath);\r\n if (!clipPath) {\r\n return [];\r\n }\r\n var n = is3d ? 4 : 3;\r\n var type = clipPath.type;\r\n var clipPoses = clipPath.poses;\r\n var poses = clipPoses.map(function (pos) {\r\n // return [x, y];\r\n var calculatedPos = calculatePosition(allMatrix, pos.pos, n);\r\n return [\r\n calculatedPos[0] - left,\r\n calculatedPos[1] - top,\r\n ];\r\n });\r\n var controls = [];\r\n var lines = [];\r\n var isRect = type === \"rect\";\r\n var isInset = type === \"inset\";\r\n var isPolygon = type === \"polygon\";\r\n if (isRect || isInset || isPolygon) {\r\n var linePoses_1 = isInset ? poses.slice(0, 8) : poses;\r\n lines = linePoses_1.map(function (to, i) {\r\n var from = i === 0 ? linePoses_1[linePoses_1.length - 1] : linePoses_1[i - 1];\r\n var rad = getRad(from, to);\r\n var dist = getDiagonalSize(from, to);\r\n return React.createElement(\"div\", { key: \"clipLine\".concat(i), className: prefix(\"line\", \"clip-line\", \"snap-control\"), \"data-clip-index\": i, style: {\r\n width: \"\".concat(dist, \"px\"),\r\n transform: \"translate(\".concat(from[0], \"px, \").concat(from[1], \"px) rotate(\").concat(rad, \"rad) scaleY(\").concat(zoom, \")\"),\r\n } });\r\n });\r\n }\r\n controls = poses.map(function (pos, i) {\r\n return React.createElement(\"div\", { key: \"clipControl\".concat(i), className: prefix(\"control\", \"clip-control\", \"snap-control\"), \"data-clip-index\": i, style: {\r\n transform: \"translate(\".concat(pos[0], \"px, \").concat(pos[1], \"px) rotate(\").concat(rotationRad, \"rad) scale(\").concat(zoom, \")\"),\r\n } });\r\n });\r\n if (isInset) {\r\n controls.push.apply(controls, __spreadArray([], __read(poses.slice(8).map(function (pos, i) {\r\n return React.createElement(\"div\", { key: \"clipRadiusControl\".concat(i), className: prefix(\"control\", \"clip-control\", \"clip-radius\", \"snap-control\"), \"data-clip-index\": 8 + i, style: {\r\n transform: \"translate(\".concat(pos[0], \"px, \").concat(pos[1], \"px) rotate(\").concat(rotationRad, \"rad) scale(\").concat(zoom, \")\"),\r\n } });\r\n })), false));\r\n }\r\n if (type === \"circle\" || type === \"ellipse\") {\r\n var clipLeft = clipPath.left, clipTop = clipPath.top, radiusX = clipPath.radiusX, radiusY = clipPath.radiusY;\r\n var _c = __read(minus(calculatePosition(allMatrix, [clipLeft, clipTop], n), calculatePosition(allMatrix, [0, 0], n)), 2), distLeft = _c[0], distTop = _c[1];\r\n var ellipseClipPath = \"none\";\r\n if (!clipArea) {\r\n var piece = Math.max(10, radiusX / 5, radiusY / 5);\r\n var areaPoses = [];\r\n for (var i = 0; i <= piece; ++i) {\r\n var rad = Math.PI * 2 / piece * i;\r\n areaPoses.push([\r\n radiusX + (radiusX - zoom) * Math.cos(rad),\r\n radiusY + (radiusY - zoom) * Math.sin(rad),\r\n ]);\r\n }\r\n areaPoses.push([radiusX, -2]);\r\n areaPoses.push([-2, -2]);\r\n areaPoses.push([-2, radiusY * 2 + 2]);\r\n areaPoses.push([radiusX * 2 + 2, radiusY * 2 + 2]);\r\n areaPoses.push([radiusX * 2 + 2, -2]);\r\n areaPoses.push([radiusX, -2]);\r\n ellipseClipPath = \"polygon(\".concat(areaPoses.map(function (pos) { return \"\".concat(pos[0], \"px \").concat(pos[1], \"px\"); }).join(\", \"), \")\");\r\n }\r\n controls.push(React.createElement(\"div\", { key: \"clipEllipse\", className: prefix(\"clip-ellipse\", \"snap-control\"), style: {\r\n width: \"\".concat(radiusX * 2, \"px\"),\r\n height: \"\".concat(radiusY * 2, \"px\"),\r\n clipPath: ellipseClipPath,\r\n transform: \"translate(\".concat(-left + distLeft, \"px, \").concat(-top + distTop, \"px) \").concat(makeMatrixCSS(allMatrix)),\r\n } }));\r\n }\r\n if (clipArea) {\r\n var _d = getRect(__spreadArray([pos1, pos2, pos3, pos4], __read(poses), false)), allWidth = _d.width, allHeight = _d.height, allLeft_1 = _d.left, allTop_1 = _d.top;\r\n if (isPolygon || isRect || isInset) {\r\n var areaPoses = isInset ? poses.slice(0, 8) : poses;\r\n controls.push(React.createElement(\"div\", { key: \"clipArea\", className: prefix(\"clip-area\", \"snap-control\"), style: {\r\n width: \"\".concat(allWidth, \"px\"),\r\n height: \"\".concat(allHeight, \"px\"),\r\n transform: \"translate(\".concat(allLeft_1, \"px, \").concat(allTop_1, \"px)\"),\r\n clipPath: \"polygon(\".concat(areaPoses.map(function (pos) { return \"\".concat(pos[0] - allLeft_1, \"px \").concat(pos[1] - allTop_1, \"px\"); }).join(\", \"), \")\"),\r\n } }));\r\n }\r\n }\r\n if (snapBoundInfos) {\r\n [\"vertical\", \"horizontal\"].forEach(function (directionType) {\r\n var info = snapBoundInfos[directionType];\r\n var isHorizontal = directionType === \"horizontal\";\r\n if (info.isSnap) {\r\n lines.push.apply(lines, __spreadArray([], __read(info.snap.posInfos.map(function (_a, i) {\r\n var pos = _a.pos;\r\n var snapPos1 = minus(calculatePosition(allMatrix, isHorizontal ? [0, pos] : [pos, 0], n), [left, top]);\r\n var snapPos2 = minus(calculatePosition(allMatrix, isHorizontal ? [width, pos] : [pos, height], n), [left, top]);\r\n return renderLine(React, \"\", snapPos1, snapPos2, zoom, \"clip\".concat(directionType, \"snap\").concat(i), \"guideline\");\r\n })), false));\r\n }\r\n if (info.isBound) {\r\n lines.push.apply(lines, __spreadArray([], __read(info.bounds.map(function (_a, i) {\r\n var pos = _a.pos;\r\n var snapPos1 = minus(calculatePosition(allMatrix, isHorizontal ? [0, pos] : [pos, 0], n), [left, top]);\r\n var snapPos2 = minus(calculatePosition(allMatrix, isHorizontal ? [width, pos] : [pos, height], n), [left, top]);\r\n return renderLine(React, \"\", snapPos1, snapPos2, zoom, \"clip\".concat(directionType, \"bounds\").concat(i), \"guideline\", \"bounds\", \"bold\");\r\n })), false));\r\n }\r\n });\r\n }\r\n return __spreadArray(__spreadArray([], __read(controls), false), __read(lines), false);\r\n },\r\n dragControlCondition: function (moveable, e) {\r\n return e.inputEvent && (e.inputEvent.target.getAttribute(\"class\") || \"\").indexOf(\"clip\") > -1;\r\n },\r\n dragStart: function (moveable, e) {\r\n var props = moveable.props;\r\n var _a = props.dragWithClip, dragWithClip = _a === void 0 ? true : _a;\r\n if (dragWithClip) {\r\n return false;\r\n }\r\n return this.dragControlStart(moveable, e);\r\n },\r\n drag: function (moveable, e) {\r\n return this.dragControl(moveable, __assign(__assign({}, e), { isDragTarget: true }));\r\n },\r\n dragEnd: function (moveable, e) {\r\n return this.dragControlEnd(moveable, e);\r\n },\r\n dragControlStart: function (moveable, e) {\r\n var state = moveable.state;\r\n var _a = moveable.props, defaultClipPath = _a.defaultClipPath, customClipPath = _a.customClipPath;\r\n var target = state.target, width = state.width, height = state.height;\r\n var inputTarget = e.inputEvent ? e.inputEvent.target : null;\r\n var className = (inputTarget && inputTarget.getAttribute(\"class\")) || \"\";\r\n var datas = e.datas;\r\n var clipPath = getClipPath(target, width, height, defaultClipPath || \"inset\", customClipPath);\r\n if (!clipPath) {\r\n return false;\r\n }\r\n var clipText = clipPath.clipText, type = clipPath.type, poses = clipPath.poses;\r\n var result = triggerEvent(moveable, \"onClipStart\", fillParams(moveable, e, {\r\n clipType: type,\r\n clipStyle: clipText,\r\n poses: poses.map(function (pos) { return pos.pos; }),\r\n }));\r\n if (result === false) {\r\n datas.isClipStart = false;\r\n return false;\r\n }\r\n datas.isControl = className && className.indexOf(\"clip-control\") > -1;\r\n datas.isLine = className.indexOf(\"clip-line\") > -1;\r\n datas.isArea = className.indexOf(\"clip-area\") > -1 || className.indexOf(\"clip-ellipse\") > -1;\r\n datas.clipIndex = inputTarget ? parseInt(inputTarget.getAttribute(\"data-clip-index\"), 10) : -1;\r\n datas.clipPath = clipPath;\r\n datas.isClipStart = true;\r\n state.clipPathState = clipText;\r\n setDragStart(moveable, e);\r\n return true;\r\n },\r\n dragControl: function (moveable, e) {\r\n var _a, _b, _c;\r\n var datas = e.datas, originalDatas = e.originalDatas, isDragTarget = e.isDragTarget;\r\n if (!datas.isClipStart) {\r\n return false;\r\n }\r\n var _d = datas, isControl = _d.isControl, isLine = _d.isLine, isArea = _d.isArea, clipIndex = _d.clipIndex, clipPath = _d.clipPath;\r\n if (!clipPath) {\r\n return false;\r\n }\r\n var props = getProps(moveable.props, \"clippable\");\r\n var keepRatio = props.keepRatio;\r\n var distX = 0;\r\n var distY = 0;\r\n var originalDraggable = originalDatas.draggable;\r\n var originalDist = getDragDist(e);\r\n if (isDragTarget && originalDraggable) {\r\n _a = __read(originalDraggable.prevBeforeDist, 2), distX = _a[0], distY = _a[1];\r\n }\r\n else {\r\n _b = __read(originalDist, 2), distX = _b[0], distY = _b[1];\r\n }\r\n var firstDist = [distX, distY];\r\n var state = moveable.state;\r\n var width = state.width, height = state.height;\r\n var isDragWithTarget = !isArea && !isControl && !isLine;\r\n var clipType = clipPath.type, clipPoses = clipPath.poses, splitter = clipPath.splitter;\r\n var poses = clipPoses.map(function (pos) { return pos.pos; });\r\n if (isDragWithTarget) {\r\n distX = -distX;\r\n distY = -distY;\r\n }\r\n var isAll = !isControl || clipPoses[clipIndex].direction === \"nesw\";\r\n var isRect = clipType === \"inset\" || clipType === \"rect\";\r\n var dists = clipPoses.map(function () { return [0, 0]; });\r\n if (isControl && !isAll) {\r\n var _e = clipPoses[clipIndex], horizontal = _e.horizontal, vertical = _e.vertical;\r\n var dist = [\r\n distX * abs(horizontal),\r\n distY * abs(vertical),\r\n ];\r\n dists = moveControlPos(clipPoses, clipIndex, dist, isRect, keepRatio);\r\n }\r\n else if (isAll) {\r\n dists = poses.map(function () { return [distX, distY]; });\r\n }\r\n var nextPoses = poses.map(function (pos, i) { return plus(pos, dists[i]); });\r\n var guidePoses = __spreadArray([], __read(nextPoses), false);\r\n state.snapBoundInfos = null;\r\n var isCircle = clipPath.type === \"circle\";\r\n var isEllipse = clipPath.type === \"ellipse\";\r\n if (isCircle || isEllipse) {\r\n var guideRect = getRect(nextPoses);\r\n var ry = abs(guideRect.bottom - guideRect.top);\r\n var rx = abs(isEllipse ? guideRect.right - guideRect.left : ry);\r\n var bottom = nextPoses[0][1] + ry;\r\n var left = nextPoses[0][0] - rx;\r\n var right = nextPoses[0][0] + rx;\r\n // right\r\n if (isCircle) {\r\n guidePoses.push([right, guideRect.bottom]);\r\n dists.push([1, 0]);\r\n }\r\n // bottom\r\n guidePoses.push([guideRect.left, bottom]);\r\n dists.push([0, 1]);\r\n // left\r\n guidePoses.push([left, guideRect.bottom]);\r\n dists.push([1, 0]);\r\n }\r\n var guidelines = getDefaultGuidelines((props.clipHorizontalGuidelines || []).map(function (v) { return convertUnitSize(\"\".concat(v), height); }), (props.clipVerticalGuidelines || []).map(function (v) { return convertUnitSize(\"\".concat(v), width); }), width, height);\r\n var guideXPoses = [];\r\n var guideYPoses = [];\r\n if (isCircle || isEllipse) {\r\n guideXPoses = [guidePoses[4][0], guidePoses[2][0]];\r\n guideYPoses = [guidePoses[1][1], guidePoses[3][1]];\r\n }\r\n else if (isRect) {\r\n var rectPoses = [guidePoses[0], guidePoses[2], guidePoses[4], guidePoses[6]];\r\n var rectDists_1 = [dists[0], dists[2], dists[4], dists[6]];\r\n guideXPoses = rectPoses.filter(function (_, i) { return rectDists_1[i][0]; }).map(function (pos) { return pos[0]; });\r\n guideYPoses = rectPoses.filter(function (_, i) { return rectDists_1[i][1]; }).map(function (pos) { return pos[1]; });\r\n }\r\n else {\r\n guideXPoses = guidePoses.filter(function (_, i) { return dists[i][0]; }).map(function (pos) { return pos[0]; });\r\n guideYPoses = guidePoses.filter(function (_, i) { return dists[i][1]; }).map(function (pos) { return pos[1]; });\r\n }\r\n var boundDelta = [0, 0];\r\n var _f = checkSnapBounds(guidelines, props.clipTargetBounds && { left: 0, top: 0, right: width, bottom: height }, guideXPoses, guideYPoses, 5), horizontalSnapInfo = _f.horizontal, verticalSnapInfo = _f.vertical;\r\n var snapOffsetY = horizontalSnapInfo.offset;\r\n var snapOffsetX = verticalSnapInfo.offset;\r\n if (horizontalSnapInfo.isBound) {\r\n boundDelta[1] += snapOffsetY;\r\n }\r\n if (verticalSnapInfo.isBound) {\r\n boundDelta[0] += snapOffsetX;\r\n }\r\n if ((isEllipse || isCircle) && dists[0][0] === 0 && dists[0][1] === 0) {\r\n var guideRect = getRect(nextPoses);\r\n var cy = guideRect.bottom - guideRect.top;\r\n var cx = isEllipse ? guideRect.right - guideRect.left : cy;\r\n var distSnapX = verticalSnapInfo.isBound\r\n ? abs(snapOffsetX)\r\n : (verticalSnapInfo.snapIndex === 0 ? -snapOffsetX : snapOffsetX);\r\n var distSnapY = horizontalSnapInfo.isBound\r\n ? abs(snapOffsetY)\r\n : (horizontalSnapInfo.snapIndex === 0 ? -snapOffsetY : snapOffsetY);\r\n cx -= distSnapX;\r\n cy -= distSnapY;\r\n if (isCircle) {\r\n cy = checkSnapBoundPriority(verticalSnapInfo, horizontalSnapInfo) > 0 ? cy : cx;\r\n cx = cy;\r\n }\r\n var center = guidePoses[0];\r\n guidePoses[1][1] = center[1] - cy;\r\n guidePoses[2][0] = center[0] + cx;\r\n guidePoses[3][1] = center[1] + cy;\r\n guidePoses[4][0] = center[0] - cx;\r\n }\r\n else if (isRect && keepRatio && isControl) {\r\n var _g = __read(getControlSize(clipPoses), 2), width_1 = _g[0], height_1 = _g[1];\r\n var ratio = width_1 && height_1 ? width_1 / height_1 : 0;\r\n var clipPose = clipPoses[clipIndex];\r\n var direction = clipPose.direction || \"\";\r\n var top_2 = guidePoses[1][1];\r\n var bottom = guidePoses[5][1];\r\n var left = guidePoses[7][0];\r\n var right = guidePoses[3][0];\r\n if (abs(snapOffsetY) <= abs(snapOffsetX)) {\r\n snapOffsetY = sign(snapOffsetY) * abs(snapOffsetX) / ratio;\r\n }\r\n else {\r\n snapOffsetX = sign(snapOffsetX) * abs(snapOffsetY) * ratio;\r\n }\r\n if (direction.indexOf(\"w\") > -1) {\r\n left -= snapOffsetX;\r\n }\r\n else if (direction.indexOf(\"e\") > -1) {\r\n right -= snapOffsetX;\r\n }\r\n else {\r\n left += snapOffsetX / 2;\r\n right -= snapOffsetX / 2;\r\n }\r\n if (direction.indexOf(\"n\") > -1) {\r\n top_2 -= snapOffsetY;\r\n }\r\n else if (direction.indexOf(\"s\") > -1) {\r\n bottom -= snapOffsetY;\r\n }\r\n else {\r\n top_2 += snapOffsetY / 2;\r\n bottom -= snapOffsetY / 2;\r\n }\r\n var nextControlPoses_2 = getRectPoses(top_2, right, bottom, left);\r\n guidePoses.forEach(function (pos, i) {\r\n var _a;\r\n _a = __read(nextControlPoses_2[i].pos, 2), pos[0] = _a[0], pos[1] = _a[1];\r\n });\r\n }\r\n else {\r\n guidePoses.forEach(function (pos, j) {\r\n var dist = dists[j];\r\n if (dist[0]) {\r\n pos[0] -= snapOffsetX;\r\n }\r\n if (dist[1]) {\r\n pos[1] -= snapOffsetY;\r\n }\r\n });\r\n }\r\n var nextClipStyles = getClipStyles(moveable, clipPath, nextPoses);\r\n var clipStyle = \"\".concat(clipType, \"(\").concat(nextClipStyles.join(splitter), \")\");\r\n state.clipPathState = clipStyle;\r\n if (isCircle || isEllipse) {\r\n guideXPoses = [guidePoses[4][0], guidePoses[2][0]];\r\n guideYPoses = [guidePoses[1][1], guidePoses[3][1]];\r\n }\r\n else if (isRect) {\r\n var rectPoses = [guidePoses[0], guidePoses[2], guidePoses[4], guidePoses[6]];\r\n guideXPoses = rectPoses.map(function (pos) { return pos[0]; });\r\n guideYPoses = rectPoses.map(function (pos) { return pos[1]; });\r\n }\r\n else {\r\n guideXPoses = guidePoses.map(function (pos) { return pos[0]; });\r\n guideYPoses = guidePoses.map(function (pos) { return pos[1]; });\r\n }\r\n state.snapBoundInfos = checkSnapBounds(guidelines, props.clipTargetBounds && { left: 0, top: 0, right: width, bottom: height }, guideXPoses, guideYPoses, 1);\r\n if (originalDraggable) {\r\n var is3d = state.is3d, allMatrix = state.allMatrix;\r\n var n = is3d ? 4 : 3;\r\n var dragDist = boundDelta;\r\n if (isDragTarget) {\r\n dragDist = [\r\n firstDist[0] + boundDelta[0] - originalDist[0],\r\n firstDist[1] + boundDelta[1] - originalDist[1],\r\n ];\r\n }\r\n originalDraggable.deltaOffset = multiply(allMatrix, [dragDist[0], dragDist[1], 0, 0], n);\r\n }\r\n triggerEvent(moveable, \"onClip\", fillParams(moveable, e, __assign({ clipEventType: \"changed\", clipType: clipType, poses: nextPoses, clipStyle: clipStyle, clipStyles: nextClipStyles, distX: distX, distY: distY }, fillCSSObject((_c = {},\r\n _c[clipType === \"rect\" ? \"clip\" : \"clipPath\"] = clipStyle,\r\n _c), e))));\r\n return true;\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n this.unset(moveable);\r\n var isDrag = e.isDrag, datas = e.datas, isDouble = e.isDouble;\r\n var isLine = datas.isLine, isClipStart = datas.isClipStart, isControl = datas.isControl;\r\n if (!isClipStart) {\r\n return false;\r\n }\r\n triggerEvent(moveable, \"onClipEnd\", fillEndParams(moveable, e, {}));\r\n if (isDouble) {\r\n if (isControl) {\r\n removeClipPath(moveable, e);\r\n }\r\n else if (isLine) {\r\n // add\r\n addClipPath(moveable, e);\r\n }\r\n }\r\n return isDouble || isDrag;\r\n },\r\n unset: function (moveable) {\r\n moveable.state.clipPathState = \"\";\r\n moveable.state.snapBoundInfos = null;\r\n },\r\n};\r\n/**\r\n * Whether to clip the target. (default: false)\r\n * @name Moveable.Clippable#clippable\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * clippable: true,\r\n * defaultClipPath: \"inset\",\r\n * customClipPath: \"\",\r\n * clipRelative: false,\r\n * clipArea: false,\r\n * dragWithClip: true,\r\n * });\r\n * moveable.on(\"clipStart\", e => {\r\n * console.log(e);\r\n * }).on(\"clip\", e => {\r\n * if (e.clipType === \"rect\") {\r\n * e.target.style.clip = e.clipStyle;\r\n * } else {\r\n * e.target.style.clipPath = e.clipStyle;\r\n * }\r\n * }).on(\"clipEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * If clippath is not set, the default value can be set. (defaultClipPath < style < customClipPath < dragging clipPath)\r\n * @name Moveable.Clippable#defaultClipPath\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * clippable: true,\r\n * defaultClipPath: \"inset\",\r\n * customClipPath: \"\",\r\n * clipRelative: false,\r\n * clipArea: false,\r\n * dragWithClip: true,\r\n * });\r\n * moveable.on(\"clipStart\", e => {\r\n * console.log(e);\r\n * }).on(\"clip\", e => {\r\n * if (e.clipType === \"rect\") {\r\n * e.target.style.clip = e.clipStyle;\r\n * } else {\r\n * e.target.style.clipPath = e.clipStyle;\r\n * }\r\n * }).on(\"clipEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * % Can be used instead of the absolute px (`rect` not possible) (default: false)\r\n * @name Moveable.Clippable#clipRelative\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * clippable: true,\r\n * defaultClipPath: \"inset\",\r\n * customClipPath: \"\",\r\n * clipRelative: false,\r\n * clipArea: false,\r\n * dragWithClip: true,\r\n * });\r\n * moveable.on(\"clipStart\", e => {\r\n * console.log(e);\r\n * }).on(\"clip\", e => {\r\n * if (e.clipType === \"rect\") {\r\n * e.target.style.clip = e.clipStyle;\r\n * } else {\r\n * e.target.style.clipPath = e.clipStyle;\r\n * }\r\n * }).on(\"clipEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * You can force the custom clipPath. (defaultClipPath < style < customClipPath < dragging clipPath)\r\n * @name Moveable.Clippable#customClipPath\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * clippable: true,\r\n * defaultClipPath: \"inset\",\r\n * customClipPath: \"\",\r\n * clipRelative: false,\r\n * clipArea: false,\r\n * dragWithClip: true,\r\n * });\r\n * moveable.on(\"clipStart\", e => {\r\n * console.log(e);\r\n * }).on(\"clip\", e => {\r\n * if (e.clipType === \"rect\") {\r\n * e.target.style.clip = e.clipStyle;\r\n * } else {\r\n * e.target.style.clipPath = e.clipStyle;\r\n * }\r\n * }).on(\"clipEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * When dragging the target, the clip also moves. (default: true)\r\n * @name Moveable.Clippable#dragWithClip\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * clippable: true,\r\n * defaultClipPath: \"inset\",\r\n * customClipPath: \"\",\r\n * clipRelative: false,\r\n * clipArea: false,\r\n * dragWithClip: true,\r\n * });\r\n * moveable.on(\"clipStart\", e => {\r\n * console.log(e);\r\n * }).on(\"clip\", e => {\r\n * if (e.clipType === \"rect\") {\r\n * e.target.style.clip = e.clipStyle;\r\n * } else {\r\n * e.target.style.clipPath = e.clipStyle;\r\n * }\r\n * }).on(\"clipEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * You can drag the clip by setting clipArea.\r\n * @name Moveable.Clippable#clipArea\r\n * @default false\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * clippable: true,\r\n * defaultClipPath: \"inset\",\r\n * customClipPath: \"\",\r\n * clipRelative: false,\r\n * clipArea: false,\r\n * dragWithClip: true,\r\n * });\r\n * moveable.on(\"clipStart\", e => {\r\n * console.log(e);\r\n * }).on(\"clip\", e => {\r\n * if (e.clipType === \"rect\") {\r\n * e.target.style.clip = e.clipStyle;\r\n * } else {\r\n * e.target.style.clipPath = e.clipStyle;\r\n * }\r\n * }).on(\"clipEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n* Whether the clip is bound to the target.\r\n* @name Moveable.Clippable#clipTargetBounds\r\n* @default false\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* clippable: true,\r\n* defaultClipPath: \"inset\",\r\n* customClipPath: \"\",\r\n* clipRelative: false,\r\n* clipArea: false,\r\n* dragWithClip: true,\r\n* clipTargetBounds: true,\r\n* });\r\n* moveable.on(\"clipStart\", e => {\r\n* console.log(e);\r\n* }).on(\"clip\", e => {\r\n* if (e.clipType === \"rect\") {\r\n* e.target.style.clip = e.clipStyle;\r\n* } else {\r\n* e.target.style.clipPath = e.clipStyle;\r\n* }\r\n* }).on(\"clipEnd\", e => {\r\n* console.log(e);\r\n* });\r\n*/\r\n/**\r\n * Add clip guidelines in the vertical direction.\r\n * @name Moveable.Clippable#clipVerticalGuidelines\r\n * @default 0\r\n * @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* clippable: true,\r\n* defaultClipPath: \"inset\",\r\n* customClipPath: \"\",\r\n* clipRelative: false,\r\n* clipArea: false,\r\n* dragWithClip: true,\r\n* clipVerticalGuidelines: [0, 100, 200],\r\n* clipHorizontalGuidelines: [0, 100, 200],\r\n* clipSnapThreshold: 5,\r\n* });\r\n*/\r\n/**\r\n* Add clip guidelines in the horizontal direction.\r\n* @name Moveable.Clippable#clipHorizontalGuidelines\r\n* @default []\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* clippable: true,\r\n* defaultClipPath: \"inset\",\r\n* customClipPath: \"\",\r\n* clipRelative: false,\r\n* clipArea: false,\r\n* dragWithClip: true,\r\n* clipVerticalGuidelines: [0, 100, 200],\r\n* clipHorizontalGuidelines: [0, 100, 200],\r\n* clipSnapThreshold: 5,\r\n* });\r\n*/\r\n/**\r\n* istance value that can snap to clip guidelines.\r\n* @name Moveable.Clippable#clipSnapThreshold\r\n* @default 5\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* clippable: true,\r\n* defaultClipPath: \"inset\",\r\n* customClipPath: \"\",\r\n* clipRelative: false,\r\n* clipArea: false,\r\n* dragWithClip: true,\r\n* clipVerticalGuidelines: [0, 100, 200],\r\n* clipHorizontalGuidelines: [0, 100, 200],\r\n* clipSnapThreshold: 5,\r\n* });\r\n*/\r\n/**\r\n * When drag start the clip area or controls, the `clipStart` event is called.\r\n * @memberof Moveable.Clippable\r\n * @event clipStart\r\n * @param {Moveable.Clippable.OnClipStart} - Parameters for the `clipStart` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * clippable: true,\r\n * defaultClipPath: \"inset\",\r\n * customClipPath: \"\",\r\n * clipRelative: false,\r\n * clipArea: false,\r\n * dragWithClip: true,\r\n * });\r\n * moveable.on(\"clipStart\", e => {\r\n * console.log(e);\r\n * }).on(\"clip\", e => {\r\n * if (e.clipType === \"rect\") {\r\n * e.target.style.clip = e.clipStyle;\r\n * } else {\r\n * e.target.style.clipPath = e.clipStyle;\r\n * }\r\n * }).on(\"clipEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * When drag the clip area or controls, the `clip` event is called.\r\n * @memberof Moveable.Clippable\r\n * @event clip\r\n * @param {Moveable.Clippable.OnClip} - Parameters for the `clip` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * clippable: true,\r\n * defaultClipPath: \"inset\",\r\n * customClipPath: \"\",\r\n * clipRelative: false,\r\n * clipArea: false,\r\n * dragWithClip: true,\r\n * });\r\n * moveable.on(\"clipStart\", e => {\r\n * console.log(e);\r\n * }).on(\"clip\", e => {\r\n * if (e.clipType === \"rect\") {\r\n * e.target.style.clip = e.clipStyle;\r\n * } else {\r\n * e.target.style.clipPath = e.clipStyle;\r\n * }\r\n * }).on(\"clipEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * When drag end the clip area or controls, the `clipEnd` event is called.\r\n * @memberof Moveable.Clippable\r\n * @event clipEnd\r\n * @param {Moveable.Clippable.OnClipEnd} - Parameters for the `clipEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * clippable: true,\r\n * defaultClipPath: \"inset\",\r\n * customClipPath: \"\",\r\n * clipRelative: false,\r\n * clipArea: false,\r\n * dragWithClip: true,\r\n * });\r\n * moveable.on(\"clipStart\", e => {\r\n * console.log(e);\r\n * }).on(\"clip\", e => {\r\n * if (e.clipType === \"rect\") {\r\n * e.target.style.clip = e.clipStyle;\r\n * } else {\r\n * e.target.style.clipPath = e.clipStyle;\r\n * }\r\n * }).on(\"clipEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\n\n/**\r\n * @namespace OriginDraggable\r\n * @memberof Moveable\r\n * @description Whether to drag origin (default: false)\r\n */\r\nvar OriginDraggable = {\r\n name: \"originDraggable\",\r\n props: [\r\n \"originDraggable\",\r\n \"originRelative\",\r\n ],\r\n events: [\r\n \"dragOriginStart\",\r\n \"dragOrigin\",\r\n \"dragOriginEnd\",\r\n ],\r\n css: [\r\n \":host[data-able-origindraggable] .control.origin {\\npointer-events: auto;\\n}\",\r\n ],\r\n dragControlCondition: function (_, e) {\r\n if (e.isRequest) {\r\n return e.requestAble === \"originDraggable\";\r\n }\r\n return hasClass(e.inputEvent.target, prefix(\"origin\"));\r\n },\r\n dragControlStart: function (moveable, e) {\r\n var datas = e.datas;\r\n setDragStart(moveable, e);\r\n var params = fillParams(moveable, e, {\r\n dragStart: Draggable.dragStart(moveable, new CustomGesto().dragStart([0, 0], e)),\r\n });\r\n var result = triggerEvent(moveable, \"onDragOriginStart\", params);\r\n datas.startOrigin = moveable.state.transformOrigin;\r\n datas.startTargetOrigin = moveable.state.targetOrigin;\r\n datas.prevOrigin = [0, 0];\r\n datas.isDragOrigin = true;\r\n if (result === false) {\r\n datas.isDragOrigin = false;\r\n return false;\r\n }\r\n return params;\r\n },\r\n dragControl: function (moveable, e) {\r\n var datas = e.datas, isPinch = e.isPinch, isRequest = e.isRequest;\r\n if (!datas.isDragOrigin) {\r\n return false;\r\n }\r\n var _a = __read(getDragDist(e), 2), distX = _a[0], distY = _a[1];\r\n var state = moveable.state;\r\n var width = state.width, height = state.height, offsetMatrix = state.offsetMatrix, targetMatrix = state.targetMatrix, is3d = state.is3d;\r\n var _b = moveable.props.originRelative, originRelative = _b === void 0 ? true : _b;\r\n var n = is3d ? 4 : 3;\r\n var dist = [distX, distY];\r\n if (isRequest) {\r\n var distOrigin = e.distOrigin;\r\n if (distOrigin[0] || distOrigin[1]) {\r\n dist = distOrigin;\r\n }\r\n }\r\n var origin = plus(datas.startOrigin, dist);\r\n var targetOrigin = plus(datas.startTargetOrigin, dist);\r\n var delta = minus(dist, datas.prevOrigin);\r\n var nextMatrix = getNextMatrix(offsetMatrix, targetMatrix, origin, n);\r\n var rect = moveable.getRect();\r\n var nextRect = getRect(calculatePoses(nextMatrix, width, height, n));\r\n var dragDelta = [\r\n rect.left - nextRect.left,\r\n rect.top - nextRect.top,\r\n ];\r\n datas.prevOrigin = dist;\r\n var transformOrigin = [\r\n convertCSSSize(targetOrigin[0], width, originRelative),\r\n convertCSSSize(targetOrigin[1], height, originRelative),\r\n ].join(\" \");\r\n var result = Draggable.drag(moveable, setCustomDrag(e, moveable.state, dragDelta, !!isPinch, false));\r\n var params = fillParams(moveable, e, __assign(__assign({ width: width, height: height, origin: origin, dist: dist, delta: delta, transformOrigin: transformOrigin, drag: result }, fillCSSObject({\r\n transformOrigin: transformOrigin,\r\n transform: result.transform,\r\n }, e)), { afterTransform: result.transform }));\r\n triggerEvent(moveable, \"onDragOrigin\", params);\r\n return params;\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n var datas = e.datas;\r\n if (!datas.isDragOrigin) {\r\n return false;\r\n }\r\n triggerEvent(moveable, \"onDragOriginEnd\", fillEndParams(moveable, e, {}));\r\n return true;\r\n },\r\n dragGroupControlCondition: function (moveable, e) {\r\n return this.dragControlCondition(moveable, e);\r\n },\r\n dragGroupControlStart: function (moveable, e) {\r\n var params = this.dragControlStart(moveable, e);\r\n if (!params) {\r\n return false;\r\n }\r\n return true;\r\n },\r\n dragGroupControl: function (moveable, e) {\r\n var params = this.dragControl(moveable, e);\r\n if (!params) {\r\n return false;\r\n }\r\n moveable.transformOrigin = params.transformOrigin;\r\n return true;\r\n },\r\n /**\r\n * @method Moveable.OriginDraggable#request\r\n * @param {object} e - the OriginDraggable's request parameter\r\n * @param {number} [e.x] - x position\r\n * @param {number} [e.y] - y position\r\n * @param {number} [e.deltaX] - x number to move\r\n * @param {number} [e.deltaY] - y number to move\r\n * @param {array} [e.deltaOrigin] - left, top number to move transform-origin\r\n * @param {array} [e.origin] - transform-origin position\r\n * @param {number} [e.isInstant] - Whether to execute the request instantly\r\n * @return {Moveable.Requester} Moveable Requester\r\n * @example\r\n\n * // Instantly Request (requestStart - request - requestEnd)\r\n * // Use Relative Value\r\n * moveable.request(\"originDraggable\", { deltaX: 10, deltaY: 10 }, true);\r\n * // Use Absolute Value\r\n * moveable.request(\"originDraggable\", { x: 200, y: 100 }, true);\r\n * // Use Transform Value\r\n * moveable.request(\"originDraggable\", { deltaOrigin: [10, 0] }, true);\r\n * moveable.request(\"originDraggable\", { origin: [100, 0] }, true);\r\n * // requestStart\r\n * const requester = moveable.request(\"originDraggable\");\r\n *\r\n * // request\r\n * // Use Relative Value\r\n * requester.request({ deltaX: 10, deltaY: 10 });\r\n * requester.request({ deltaX: 10, deltaY: 10 });\r\n * requester.request({ deltaX: 10, deltaY: 10 });\r\n * // Use Absolute Value\r\n * moveable.request(\"originDraggable\", { x: 200, y: 100 });\r\n * moveable.request(\"originDraggable\", { x: 220, y: 100 });\r\n * moveable.request(\"originDraggable\", { x: 240, y: 100 });\r\n *\r\n * // requestEnd\r\n * requester.requestEnd();\r\n */\r\n request: function (moveable) {\r\n var datas = {};\r\n var rect = moveable.getRect();\r\n var distX = 0;\r\n var distY = 0;\r\n var transformOrigin = rect.transformOrigin;\r\n var distOrigin = [0, 0];\r\n return {\r\n isControl: true,\r\n requestStart: function () {\r\n return { datas: datas };\r\n },\r\n request: function (e) {\r\n if (\"deltaOrigin\" in e) {\r\n distOrigin[0] += e.deltaOrigin[0];\r\n distOrigin[1] += e.deltaOrigin[1];\r\n }\r\n else if (\"origin\" in e) {\r\n distOrigin[0] = e.origin[0] - transformOrigin[0];\r\n distOrigin[1] = e.origin[1] - transformOrigin[1];\r\n }\r\n else {\r\n if (\"x\" in e) {\r\n distX = e.x - rect.left;\r\n }\r\n else if (\"deltaX\" in e) {\r\n distX += e.deltaX;\r\n }\r\n if (\"y\" in e) {\r\n distY = e.y - rect.top;\r\n }\r\n else if (\"deltaY\" in e) {\r\n distY += e.deltaY;\r\n }\r\n }\r\n return { datas: datas, distX: distX, distY: distY, distOrigin: distOrigin };\r\n },\r\n requestEnd: function () {\r\n return { datas: datas, isDrag: true };\r\n },\r\n };\r\n },\r\n};\r\n/**\r\n * Whether to drag origin (default: false)\r\n * @name Moveable.OriginDraggable#originDraggable\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * originDraggable: true,\r\n * });\r\n * let translate = [0, 0];\r\n * moveable.on(\"dragOriginStart\", e => {\r\n * e.dragStart && e.dragStart.set(translate);\r\n * }).on(\"dragOrigin\", e => {\r\n * translate = e.drag.beforeTranslate;\r\n * e.target.style.cssText\r\n * = `transform-origin: ${e.transformOrigin};`\r\n * + `transform: translate(${translate[0]}px, ${translate[1]}px)`;\r\n * }).on(\"dragOriginEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * % Can be used instead of the absolute px (default: true)\r\n * @name Moveable.OriginDraggable#originRelative\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * originDraggable: true,\r\n * originRelative: false,\r\n * });\r\n * moveable.originRelative = true;\r\n */\r\n/**\r\n* When drag start the origin, the `dragOriginStart` event is called.\r\n* @memberof Moveable.OriginDraggable\r\n* @event dragOriginStart\r\n* @param {Moveable.OriginDraggable.OnDragOriginStart} - Parameters for the `dragOriginStart` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* originDraggable: true,\r\n* });\r\n* let translate = [0, 0];\r\n* moveable.on(\"dragOriginStart\", e => {\r\n* e.dragStart && e.dragStart.set(translate);\r\n* }).on(\"dragOrigin\", e => {\r\n* translate = e.drag.beforeTranslate;\r\n* e.target.style.cssText\r\n* = `transform-origin: ${e.transformOrigin};`\r\n* + `transform: translate(${translate[0]}px, ${translate[1]}px)`;\r\n* }).on(\"dragOriginEnd\", e => {\r\n* console.log(e);\r\n* });\r\n*/\r\n/**\r\n* When drag the origin, the `dragOrigin` event is called.\r\n* @memberof Moveable.OriginDraggable\r\n* @event dragOrigin\r\n* @param {Moveable.OriginDraggable.OnDragOrigin} - Parameters for the `dragOrigin` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* originDraggable: true,\r\n* });\r\n* let translate = [0, 0];\r\n* moveable.on(\"dragOriginStart\", e => {\r\n* e.dragStart && e.dragStart.set(translate);\r\n* }).on(\"dragOrigin\", e => {\r\n* translate = e.drag.beforeTranslate;\r\n* e.target.style.cssText\r\n* = `transform-origin: ${e.transformOrigin};`\r\n* + `transform: translate(${translate[0]}px, ${translate[1]}px)`;\r\n* }).on(\"dragOriginEnd\", e => {\r\n* console.log(e);\r\n* });\r\n*/\r\n/**\r\n* When drag end the origin, the `dragOriginEnd` event is called.\r\n* @memberof Moveable.OriginDraggable\r\n* @event dragOriginEnd\r\n* @param {Moveable.OriginDraggable.OnDragOriginEnd} - Parameters for the `dragOriginEnd` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* originDraggable: true,\r\n* });\r\n* let translate = [0, 0];\r\n* moveable.on(\"dragOriginStart\", e => {\r\n* e.dragStart && e.dragStart.set(translate);\r\n* }).on(\"dragOrigin\", e => {\r\n* translate = e.drag.beforeTranslate;\r\n* e.target.style.cssText\r\n* = `transform-origin: ${e.transformOrigin};`\r\n* + `transform: translate(${translate[0]}px, ${translate[1]}px)`;\r\n* }).on(\"dragOriginEnd\", e => {\r\n* console.log(e);\r\n* });\r\n*/\n\nfunction addBorderRadiusByLine(controlPoses, lineIndex, distX, distY) {\r\n // lineIndex\r\n // 0 top\r\n // 1 right\r\n // 2 bottom\r\n // 3 left\r\n var horizontalsLength = controlPoses.filter(function (_a) {\r\n var virtual = _a.virtual, horizontal = _a.horizontal;\r\n return horizontal && !virtual;\r\n }).length;\r\n var verticalsLength = controlPoses.filter(function (_a) {\r\n var virtual = _a.virtual, vertical = _a.vertical;\r\n return vertical && !virtual;\r\n }).length;\r\n var controlIndex = -1;\r\n //top\r\n if (lineIndex === 0) {\r\n if (horizontalsLength === 0) {\r\n controlIndex = 0;\r\n }\r\n else if (horizontalsLength === 1) {\r\n controlIndex = 1;\r\n }\r\n }\r\n // bottom\r\n if (lineIndex === 2) {\r\n if (horizontalsLength <= 2) {\r\n controlIndex = 2;\r\n }\r\n else if (horizontalsLength <= 3) {\r\n controlIndex = 3;\r\n }\r\n }\r\n // left\r\n if (lineIndex === 3) {\r\n if (verticalsLength === 0) {\r\n controlIndex = 4;\r\n }\r\n else if (verticalsLength < 4) {\r\n controlIndex = 7;\r\n }\r\n }\r\n // right\r\n if (lineIndex === 1) {\r\n if (verticalsLength <= 1) {\r\n controlIndex = 5;\r\n }\r\n else if (verticalsLength <= 2) {\r\n controlIndex = 6;\r\n }\r\n }\r\n if (controlIndex === -1 || !controlPoses[controlIndex].virtual) {\r\n return;\r\n }\r\n var controlPoseInfo = controlPoses[controlIndex];\r\n addBorderRadius(controlPoses, controlIndex);\r\n if (controlIndex < 4) {\r\n controlPoseInfo.pos[0] = distX;\r\n }\r\n else {\r\n controlPoseInfo.pos[1] = distY;\r\n }\r\n}\r\nfunction addBorderRadius(controlPoses, index) {\r\n if (index < 4) {\r\n controlPoses.slice(0, index + 1).forEach(function (info) {\r\n info.virtual = false;\r\n });\r\n }\r\n else {\r\n if (controlPoses[0].virtual) {\r\n controlPoses[0].virtual = false;\r\n }\r\n controlPoses.slice(4, index + 1).forEach(function (info) {\r\n info.virtual = false;\r\n });\r\n }\r\n}\r\nfunction removeBorderRadius(controlPoses, index) {\r\n if (index < 4) {\r\n controlPoses.slice(index, 4).forEach(function (info) {\r\n info.virtual = true;\r\n });\r\n }\r\n else {\r\n controlPoses.slice(index).forEach(function (info) {\r\n info.virtual = true;\r\n });\r\n }\r\n}\r\nfunction getBorderRadius(borderRadius, width, height, minCounts, full) {\r\n if (minCounts === void 0) { minCounts = [0, 0]; }\r\n var values = [];\r\n if (!borderRadius || borderRadius === \"0px\") {\r\n values = [];\r\n }\r\n else {\r\n values = splitSpace(borderRadius);\r\n }\r\n return getRadiusValues(values, width, height, 0, 0, minCounts, full);\r\n}\r\nfunction triggerRoundEvent(moveable, e, dist, delta, nextPoses) {\r\n var state = moveable.state;\r\n var width = state.width, height = state.height;\r\n var _a = getRadiusStyles(nextPoses, moveable.props.roundRelative, width, height), raws = _a.raws, styles = _a.styles, radiusPoses = _a.radiusPoses;\r\n var _b = splitRadiusPoses(radiusPoses, raws), horizontals = _b.horizontals, verticals = _b.verticals;\r\n var borderRadius = styles.join(\" \");\r\n state.borderRadiusState = borderRadius;\r\n var params = fillParams(moveable, e, __assign({ horizontals: horizontals, verticals: verticals, borderRadius: borderRadius, width: width, height: height, delta: delta, dist: dist }, fillCSSObject({\r\n borderRadius: borderRadius,\r\n }, e)));\r\n triggerEvent(moveable, \"onRound\", params);\r\n return params;\r\n}\r\nfunction getStyleBorderRadius(moveable) {\r\n var _a, _b;\r\n var style = moveable.getState().style;\r\n var borderRadius = style.borderRadius || \"\";\r\n if (!borderRadius && moveable.props.groupable) {\r\n var firstMoveable = moveable.moveables[0];\r\n var firstTarget = moveable.getTargets()[0];\r\n if (firstTarget) {\r\n if ((firstMoveable === null || firstMoveable === void 0 ? void 0 : firstMoveable.props.target) === firstTarget) {\r\n borderRadius = (_b = (_a = moveable.moveables[0]) === null || _a === void 0 ? void 0 : _a.state.style.borderRadius) !== null && _b !== void 0 ? _b : \"\";\r\n style.borderRadius = borderRadius;\r\n }\r\n else {\r\n borderRadius = getComputedStyle(firstTarget).borderRadius;\r\n style.borderRadius = borderRadius;\r\n }\r\n }\r\n }\r\n return borderRadius;\r\n}\r\n/**\r\n * @namespace Moveable.Roundable\r\n * @description Whether to show and drag or double click border-radius\r\n */\r\nvar Roundable = {\r\n name: \"roundable\",\r\n props: [\r\n \"roundable\",\r\n \"roundRelative\",\r\n \"minRoundControls\",\r\n \"maxRoundControls\",\r\n \"roundClickable\",\r\n \"roundPadding\",\r\n \"isDisplayShadowRoundControls\",\r\n ],\r\n events: [\r\n \"roundStart\",\r\n \"round\",\r\n \"roundEnd\",\r\n \"roundGroupStart\",\r\n \"roundGroup\",\r\n \"roundGroupEnd\",\r\n ],\r\n css: [\r\n \".control.border-radius {\\nbackground: #d66;\\ncursor: pointer;\\nz-index: 3;\\n}\",\r\n \".control.border-radius.vertical {\\nbackground: #d6d;\\nz-index: 2;\\n}\",\r\n \".control.border-radius.virtual {\\nopacity: 0.5;\\nz-index: 1;\\n}\",\r\n \":host.round-line-clickable .line.direction {\\ncursor: pointer;\\n}\",\r\n ],\r\n className: function (moveable) {\r\n var roundClickable = moveable.props.roundClickable;\r\n return roundClickable === true || roundClickable === \"line\" ? prefix(\"round-line-clickable\") : \"\";\r\n },\r\n requestStyle: function () {\r\n return [\"borderRadius\"];\r\n },\r\n requestChildStyle: function () {\r\n return [\"borderRadius\"];\r\n },\r\n render: function (moveable, React) {\r\n var _a = moveable.getState(), target = _a.target, width = _a.width, height = _a.height, allMatrix = _a.allMatrix, is3d = _a.is3d, left = _a.left, top = _a.top, borderRadiusState = _a.borderRadiusState;\r\n var _b = moveable.props, _c = _b.minRoundControls, minRoundControls = _c === void 0 ? [0, 0] : _c, _d = _b.maxRoundControls, maxRoundControls = _d === void 0 ? [4, 4] : _d, zoom = _b.zoom, _e = _b.roundPadding, roundPadding = _e === void 0 ? 0 : _e, isDisplayShadowRoundControls = _b.isDisplayShadowRoundControls, groupable = _b.groupable;\r\n if (!target) {\r\n return null;\r\n }\r\n var borderRadius = borderRadiusState || getStyleBorderRadius(moveable);\r\n var n = is3d ? 4 : 3;\r\n var radiusValues = getBorderRadius(borderRadius, width, height, minRoundControls, true);\r\n if (!radiusValues) {\r\n return null;\r\n }\r\n var verticalCount = 0;\r\n var horizontalCount = 0;\r\n var basePos = groupable ? [0, 0] : [left, top];\r\n return radiusValues.map(function (v, i) {\r\n var horizontal = v.horizontal;\r\n var vertical = v.vertical;\r\n var direction = v.direction || \"\";\r\n var originalPos = __spreadArray([], __read(v.pos), false);\r\n horizontalCount += Math.abs(horizontal);\r\n verticalCount += Math.abs(vertical);\r\n if (horizontal && direction.indexOf(\"n\") > -1) {\r\n originalPos[1] -= roundPadding;\r\n }\r\n if (vertical && direction.indexOf(\"w\") > -1) {\r\n originalPos[0] -= roundPadding;\r\n }\r\n if (horizontal && direction.indexOf(\"s\") > -1) {\r\n originalPos[1] += roundPadding;\r\n }\r\n if (vertical && direction.indexOf(\"e\") > -1) {\r\n originalPos[0] += roundPadding;\r\n }\r\n var pos = minus(calculatePosition(allMatrix, originalPos, n), basePos);\r\n var isDisplayVerticalShadow = isDisplayShadowRoundControls\r\n && isDisplayShadowRoundControls !== \"horizontal\";\r\n var isDisplay = v.vertical\r\n ? verticalCount <= maxRoundControls[1] && (isDisplayVerticalShadow || !v.virtual)\r\n : horizontalCount <= maxRoundControls[0] && (isDisplayShadowRoundControls || !v.virtual);\r\n return React.createElement(\"div\", { key: \"borderRadiusControl\".concat(i), className: prefix(\"control\", \"border-radius\", v.vertical ? \"vertical\" : \"\", v.virtual ? \"virtual\" : \"\"), \"data-radius-index\": i, style: {\r\n display: isDisplay ? \"block\" : \"none\",\r\n transform: \"translate(\".concat(pos[0], \"px, \").concat(pos[1], \"px) scale(\").concat(zoom, \")\"),\r\n } });\r\n });\r\n },\r\n dragControlCondition: function (moveable, e) {\r\n if (!e.inputEvent || e.isRequest) {\r\n return false;\r\n }\r\n var className = (e.inputEvent.target.getAttribute(\"class\") || \"\");\r\n return className.indexOf(\"border-radius\") > -1\r\n || (className.indexOf(\"moveable-line\") > -1 && className.indexOf(\"moveable-direction\") > -1);\r\n },\r\n dragGroupControlCondition: function (moveable, e) {\r\n return this.dragControlCondition(moveable, e);\r\n },\r\n dragControlStart: function (moveable, e) {\r\n var inputEvent = e.inputEvent, datas = e.datas;\r\n var inputTarget = inputEvent.target;\r\n var className = (inputTarget.getAttribute(\"class\") || \"\");\r\n var isControl = className.indexOf(\"border-radius\") > -1;\r\n var isLine = className.indexOf(\"moveable-line\") > -1 && className.indexOf(\"moveable-direction\") > -1;\r\n var controlIndex = isControl ? parseInt(inputTarget.getAttribute(\"data-radius-index\"), 10) : -1;\r\n var lineIndex = -1;\r\n if (isLine) {\r\n var indexAttr = inputTarget.getAttribute(\"data-line-key\") || \"\";\r\n if (indexAttr) {\r\n lineIndex = parseInt(indexAttr.replace(/render-line-/g, \"\"), 10);\r\n if (isNaN(lineIndex)) {\r\n lineIndex = -1;\r\n }\r\n }\r\n }\r\n if (!isControl && !isLine) {\r\n return false;\r\n }\r\n var params = fillParams(moveable, e, {});\r\n var result = triggerEvent(moveable, \"onRoundStart\", params);\r\n if (result === false) {\r\n return false;\r\n }\r\n datas.lineIndex = lineIndex;\r\n datas.controlIndex = controlIndex;\r\n datas.isControl = isControl;\r\n datas.isLine = isLine;\r\n setDragStart(moveable, e);\r\n var _a = moveable.props, roundRelative = _a.roundRelative, _b = _a.minRoundControls, minRoundControls = _b === void 0 ? [0, 0] : _b;\r\n var state = moveable.state;\r\n var width = state.width, height = state.height;\r\n datas.isRound = true;\r\n datas.prevDist = [0, 0];\r\n var borderRadius = getStyleBorderRadius(moveable);\r\n var controlPoses = getBorderRadius(borderRadius || \"\", width, height, minRoundControls, true) || [];\r\n datas.controlPoses = controlPoses;\r\n state.borderRadiusState = getRadiusStyles(controlPoses, roundRelative, width, height).styles.join(\" \");\r\n return params;\r\n },\r\n dragControl: function (moveable, e) {\r\n var datas = e.datas;\r\n var controlPoses = datas.controlPoses;\r\n if (!datas.isRound || !datas.isControl || !controlPoses.length) {\r\n return false;\r\n }\r\n var index = datas.controlIndex;\r\n var _a = __read(getDragDist(e), 2), distX = _a[0], distY = _a[1];\r\n var dist = [distX, distY];\r\n var delta = minus(dist, datas.prevDist);\r\n var _b = moveable.props.maxRoundControls, maxRoundControls = _b === void 0 ? [4, 4] : _b;\r\n var _c = moveable.state, width = _c.width, height = _c.height;\r\n var selectedControlPose = controlPoses[index];\r\n var selectedVertical = selectedControlPose.vertical;\r\n var selectedHorizontal = selectedControlPose.horizontal;\r\n // 0: [0, 1, 2, 3] maxCount === 1\r\n // 0: [0, 2] maxCount === 2\r\n // 1: [1, 3] maxCount === 2\r\n // 0: [0] maxCount === 3\r\n // 1: [1, 3] maxCount === 3\r\n var dists = controlPoses.map(function (pose) {\r\n var horizontal = pose.horizontal, vertical = pose.vertical;\r\n var poseDist = [\r\n horizontal * selectedHorizontal * dist[0],\r\n vertical * selectedVertical * dist[1],\r\n ];\r\n if (horizontal) {\r\n if (maxRoundControls[0] === 1) {\r\n return poseDist;\r\n }\r\n else if (maxRoundControls[0] < 4 && horizontal !== selectedHorizontal) {\r\n return poseDist;\r\n }\r\n }\r\n else if (maxRoundControls[1] === 0) {\r\n poseDist[1] = vertical * selectedHorizontal * dist[0] / width * height;\r\n return poseDist;\r\n }\r\n else if (selectedVertical) {\r\n if (maxRoundControls[1] === 1) {\r\n return poseDist;\r\n }\r\n else if (maxRoundControls[1] < 4 && vertical !== selectedVertical) {\r\n return poseDist;\r\n }\r\n }\r\n return [0, 0];\r\n });\r\n dists[index] = dist;\r\n var nextPoses = controlPoses.map(function (info, i) {\r\n return __assign(__assign({}, info), { pos: plus(info.pos, dists[i]) });\r\n });\r\n if (index < 4) {\r\n nextPoses.slice(0, index + 1).forEach(function (info) {\r\n info.virtual = false;\r\n });\r\n }\r\n else {\r\n nextPoses.slice(4, index + 1).forEach(function (info) {\r\n info.virtual = false;\r\n });\r\n }\r\n datas.prevDist = [distX, distY];\r\n return triggerRoundEvent(moveable, e, dist, delta, nextPoses);\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n var state = moveable.state;\r\n state.borderRadiusState = \"\";\r\n var datas = e.datas, isDouble = e.isDouble;\r\n if (!datas.isRound) {\r\n return false;\r\n }\r\n var isControl = datas.isControl, controlIndex = datas.controlIndex, isLine = datas.isLine, lineIndex = datas.lineIndex;\r\n var controlPoses = datas.controlPoses;\r\n var length = controlPoses.filter(function (_a) {\r\n var virtual = _a.virtual;\r\n return virtual;\r\n }).length;\r\n var _a = moveable.props.roundClickable, roundClickable = _a === void 0 ? true : _a;\r\n if (isDouble && roundClickable) {\r\n if (isControl && (roundClickable === true || roundClickable === \"control\")) {\r\n removeBorderRadius(controlPoses, controlIndex);\r\n }\r\n else if (isLine && (roundClickable === true || roundClickable === \"line\")) {\r\n var _b = __read(calculatePointerDist(moveable, e), 2), distX = _b[0], distY = _b[1];\r\n addBorderRadiusByLine(controlPoses, lineIndex, distX, distY);\r\n }\r\n if (length !== controlPoses.filter(function (_a) {\r\n var virtual = _a.virtual;\r\n return virtual;\r\n }).length) {\r\n triggerRoundEvent(moveable, e, [0, 0], [0, 0], controlPoses);\r\n }\r\n }\r\n var params = fillEndParams(moveable, e, {});\r\n triggerEvent(moveable, \"onRoundEnd\", params);\r\n state.borderRadiusState = \"\";\r\n return params;\r\n },\r\n dragGroupControlStart: function (moveable, e) {\r\n var result = this.dragControlStart(moveable, e);\r\n if (!result) {\r\n return false;\r\n }\r\n var moveables = moveable.moveables;\r\n var targets = moveable.props.targets;\r\n var events = fillChildEvents(moveable, \"roundable\", e);\r\n var nextParams = __assign({ targets: moveable.props.targets, events: events.map(function (ev, i) {\r\n return __assign(__assign({}, ev), { target: targets[i], moveable: moveables[i], currentTarget: moveables[i] });\r\n }) }, result);\r\n triggerEvent(moveable, \"onRoundGroupStart\", nextParams);\r\n return result;\r\n },\r\n dragGroupControl: function (moveable, e) {\r\n var result = this.dragControl(moveable, e);\r\n if (!result) {\r\n return false;\r\n }\r\n var moveables = moveable.moveables;\r\n var targets = moveable.props.targets;\r\n var events = fillChildEvents(moveable, \"roundable\", e);\r\n var nextParams = __assign({ targets: moveable.props.targets, events: events.map(function (ev, i) {\r\n return __assign(__assign(__assign({}, ev), { target: targets[i], moveable: moveables[i], currentTarget: moveables[i] }), fillCSSObject({\r\n borderRadius: result.borderRadius,\r\n }, ev));\r\n }) }, result);\r\n triggerEvent(moveable, \"onRoundGroup\", nextParams);\r\n return nextParams;\r\n },\r\n dragGroupControlEnd: function (moveable, e) {\r\n var moveables = moveable.moveables;\r\n var targets = moveable.props.targets;\r\n var events = fillChildEvents(moveable, \"roundable\", e);\r\n catchEvent(moveable, \"onRound\", function (parentEvent) {\r\n var nextParams = __assign({ targets: moveable.props.targets, events: events.map(function (ev, i) {\r\n return __assign(__assign(__assign({}, ev), { target: targets[i], moveable: moveables[i], currentTarget: moveables[i] }), fillCSSObject({\r\n borderRadius: parentEvent.borderRadius,\r\n }, ev));\r\n }) }, parentEvent);\r\n triggerEvent(moveable, \"onRoundGroup\", nextParams);\r\n });\r\n var result = this.dragControlEnd(moveable, e);\r\n if (!result) {\r\n return false;\r\n }\r\n var nextParams = __assign({ targets: moveable.props.targets, events: events.map(function (ev, i) {\r\n var _a;\r\n return __assign(__assign({}, ev), { target: targets[i], moveable: moveables[i], currentTarget: moveables[i], lastEvent: (_a = ev.datas) === null || _a === void 0 ? void 0 : _a.lastEvent });\r\n }) }, result);\r\n triggerEvent(moveable, \"onRoundGroupEnd\", nextParams);\r\n return nextParams;\r\n },\r\n unset: function (moveable) {\r\n moveable.state.borderRadiusState = \"\";\r\n },\r\n};\r\n/**\r\n * Whether to show and drag or double click border-radius, (default: false)\r\n * @name Moveable.Roundable#roundable\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * roundRelative: false,\r\n * });\r\n * moveable.on(\"roundStart\", e => {\r\n * console.log(e);\r\n * }).on(\"round\", e => {\r\n * e.target.style.borderRadius = e.borderRadius;\r\n * }).on(\"roundEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * % Can be used instead of the absolute px\r\n * @name Moveable.Roundable#roundRelative\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * roundRelative: false,\r\n * });\r\n * moveable.on(\"roundStart\", e => {\r\n * console.log(e);\r\n * }).on(\"round\", e => {\r\n * e.target.style.borderRadius = e.borderRadius;\r\n * }).on(\"roundEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * Minimum number of round controls. It moves in proportion by control. [horizontal, vertical] (default: [0, 0])\r\n * @name Moveable.Roundable#minRoundControls\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * roundRelative: false,\r\n * minRoundControls: [0, 0],\r\n * });\r\n * moveable.minRoundControls = [1, 0];\r\n */\r\n/**\r\n * Maximum number of round controls. It moves in proportion by control. [horizontal, vertical] (default: [4, 4])\r\n * @name Moveable.Roundable#maxRoundControls\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * roundRelative: false,\r\n * maxRoundControls: [4, 4],\r\n * });\r\n * moveable.maxRoundControls = [1, 0];\r\n */\r\n/**\r\n * Whether you can add/delete round controls by double-clicking a line or control.\r\n * @name Moveable.Roundable#roundClickable\r\n * @default true\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * roundRelative: false,\r\n * roundClickable: true,\r\n * });\r\n * moveable.roundClickable = false;\r\n */\r\n/**\r\n * Whether to show a round control that does not actually exist as a shadow\r\n * @name Moveable.Roundable#isDisplayShadowRoundControls\r\n * @default false\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * isDisplayShadowRoundControls: false,\r\n * });\r\n * moveable.isDisplayShadowRoundControls = true;\r\n */\r\n/**\r\n * The padding value of the position of the round control\r\n * @name Moveable.Roundable#roundPadding\r\n * @default false\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * roundPadding: 0,\r\n * });\r\n * moveable.roundPadding = 15;\r\n */\r\n/**\r\n * When drag start the clip area or controls, the `roundStart` event is called.\r\n * @memberof Moveable.Roundable\r\n * @event roundStart\r\n * @param {Moveable.Roundable.OnRoundStart} - Parameters for the `roundStart` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * roundRelative: false,\r\n * });\r\n * moveable.on(\"roundStart\", e => {\r\n * console.log(e);\r\n * }).on(\"round\", e => {\r\n * e.target.style.borderRadius = e.borderRadius;\r\n * }).on(\"roundEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * When drag or double click the border area or controls, the `round` event is called.\r\n * @memberof Moveable.Roundable\r\n * @event round\r\n * @param {Moveable.Roundable.OnRound} - Parameters for the `round` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * roundRelative: false,\r\n * });\r\n * moveable.on(\"roundStart\", e => {\r\n * console.log(e);\r\n * }).on(\"round\", e => {\r\n * e.target.style.borderRadius = e.borderRadius;\r\n * }).on(\"roundEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * When drag end the border area or controls, the `roundEnd` event is called.\r\n * @memberof Moveable.Roundable\r\n * @event roundEnd\r\n * @param {Moveable.Roundable.onRoundEnd} - Parameters for the `roundEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * roundRelative: false,\r\n * });\r\n * moveable.on(\"roundStart\", e => {\r\n * console.log(e);\r\n * }).on(\"round\", e => {\r\n * e.target.style.borderRadius = e.borderRadius;\r\n * }).on(\"roundEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * When drag start the clip area or controls, the `roundGroupStart` event is called.\r\n * @memberof Moveable.Roundable\r\n * @event roundGroupStart\r\n * @param {Moveable.Roundable.OnRoundGroupStart} - Parameters for the `roundGroupStart` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * targets: [target1, target2, target3],\r\n * roundable: true,\r\n * });\r\n * moveable.on(\"roundGroupStart\", e => {\r\n * console.log(e.targets);\r\n * }).on(\"roundGroup\", e => {\r\n * e.events.forEach(ev => {\r\n * ev.target.style.cssText += ev.cssText;\r\n * });\r\n * }).on(\"roundGroupEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * When drag or double click the border area or controls, the `roundGroup` event is called.\r\n * @memberof Moveable.Roundable\r\n * @event roundGroup\r\n * @param {Moveable.Roundable.OnRoundGroup} - Parameters for the `roundGroup` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * targets: [target1, target2, target3],\r\n * roundable: true,\r\n * });\r\n * moveable.on(\"roundGroupStart\", e => {\r\n * console.log(e.targets);\r\n * }).on(\"roundGroup\", e => {\r\n * e.events.forEach(ev => {\r\n * ev.target.style.cssText += ev.cssText;\r\n * });\r\n * }).on(\"roundGroupEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * When drag end the border area or controls, the `roundGroupEnd` event is called.\r\n * @memberof Moveable.Roundable\r\n * @event roundGroupEnd\r\n * @param {Moveable.Roundable.onRoundGroupEnd} - Parameters for the `roundGroupEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * targets: [target1, target2, target3],\r\n * roundable: true,\r\n * });\r\n * moveable.on(\"roundGroupStart\", e => {\r\n * console.log(e.targets);\r\n * }).on(\"roundGroup\", e => {\r\n * e.events.forEach(ev => {\r\n * ev.target.style.cssText += ev.cssText;\r\n * });\r\n * }).on(\"roundGroupEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\n\nfunction isIdentityMatrix(matrix, is3d) {\r\n var n = is3d ? 4 : 3;\r\n var identityMatrix = createIdentityMatrix(n);\r\n var value = \"matrix\".concat(is3d ? \"3d\" : \"\", \"(\").concat(identityMatrix.join(\",\"), \")\");\r\n return matrix === value || matrix === \"matrix(1,0,0,1,0,0)\";\r\n}\r\nvar BeforeRenderable = {\r\n isPinch: true,\r\n name: \"beforeRenderable\",\r\n props: [],\r\n events: [\r\n \"beforeRenderStart\",\r\n \"beforeRender\",\r\n \"beforeRenderEnd\",\r\n \"beforeRenderGroupStart\",\r\n \"beforeRenderGroup\",\r\n \"beforeRenderGroupEnd\",\r\n ],\r\n dragRelation: \"weak\",\r\n setTransform: function (moveable, e) {\r\n var _a = moveable.state, is3d = _a.is3d, targetMatrix = _a.targetMatrix, inlineTransform = _a.inlineTransform;\r\n var cssMatrix = is3d\r\n ? \"matrix3d(\".concat(targetMatrix.join(\",\"), \")\")\r\n : \"matrix(\".concat(convertMatrixtoCSS(targetMatrix, true), \")\");\r\n var startTransform = !inlineTransform || inlineTransform === \"none\" ? cssMatrix : inlineTransform;\r\n e.datas.startTransforms = isIdentityMatrix(startTransform, is3d) ? [] : splitSpace(startTransform);\r\n },\r\n resetStyle: function (e) {\r\n var datas = e.datas;\r\n datas.nextStyle = {};\r\n datas.nextTransforms = e.datas.startTransforms;\r\n datas.nextTransformAppendedIndexes = [];\r\n },\r\n fillDragStartParams: function (moveable, e) {\r\n return fillParams(moveable, e, {\r\n setTransform: function (transform) {\r\n e.datas.startTransforms = isArray(transform) ? transform : splitSpace(transform);\r\n },\r\n isPinch: !!e.isPinch,\r\n });\r\n },\r\n fillDragParams: function (moveable, e) {\r\n return fillParams(moveable, e, {\r\n isPinch: !!e.isPinch,\r\n });\r\n },\r\n dragStart: function (moveable, e) {\r\n this.setTransform(moveable, e);\r\n this.resetStyle(e);\r\n triggerEvent(moveable, \"onBeforeRenderStart\", this.fillDragStartParams(moveable, e));\r\n },\r\n drag: function (moveable, e) {\r\n if (!e.datas.startTransforms) {\r\n this.setTransform(moveable, e);\r\n }\r\n this.resetStyle(e);\r\n triggerEvent(moveable, \"onBeforeRender\", fillParams(moveable, e, {\r\n isPinch: !!e.isPinch,\r\n }));\r\n },\r\n dragEnd: function (moveable, e) {\r\n if (!e.datas.startTransforms) {\r\n this.setTransform(moveable, e);\r\n this.resetStyle(e);\r\n }\r\n triggerEvent(moveable, \"onBeforeRenderEnd\", fillParams(moveable, e, {\r\n isPinch: !!e.isPinch,\r\n isDrag: e.isDrag,\r\n }));\r\n },\r\n dragGroupStart: function (moveable, e) {\r\n var _this = this;\r\n this.dragStart(moveable, e);\r\n var events = fillChildEvents(moveable, \"beforeRenderable\", e);\r\n var moveables = moveable.moveables;\r\n var params = events.map(function (childEvent, i) {\r\n var childMoveable = moveables[i];\r\n _this.setTransform(childMoveable, childEvent);\r\n _this.resetStyle(childEvent);\r\n return _this.fillDragStartParams(childMoveable, childEvent);\r\n });\r\n triggerEvent(moveable, \"onBeforeRenderGroupStart\", fillParams(moveable, e, {\r\n isPinch: !!e.isPinch,\r\n targets: moveable.props.targets,\r\n setTransform: function () { },\r\n events: params,\r\n }));\r\n },\r\n dragGroup: function (moveable, e) {\r\n var _this = this;\r\n this.drag(moveable, e);\r\n var events = fillChildEvents(moveable, \"beforeRenderable\", e);\r\n var moveables = moveable.moveables;\r\n var params = events.map(function (childEvent, i) {\r\n var childMoveable = moveables[i];\r\n _this.resetStyle(childEvent);\r\n return _this.fillDragParams(childMoveable, childEvent);\r\n });\r\n triggerEvent(moveable, \"onBeforeRenderGroup\", fillParams(moveable, e, {\r\n isPinch: !!e.isPinch,\r\n targets: moveable.props.targets,\r\n events: params,\r\n }));\r\n },\r\n dragGroupEnd: function (moveable, e) {\r\n this.dragEnd(moveable, e);\r\n triggerEvent(moveable, \"onBeforeRenderGroupEnd\", fillParams(moveable, e, {\r\n isPinch: !!e.isPinch,\r\n isDrag: e.isDrag,\r\n targets: moveable.props.targets,\r\n }));\r\n },\r\n dragControlStart: function (moveable, e) {\r\n return this.dragStart(moveable, e);\r\n },\r\n dragControl: function (moveable, e) {\r\n return this.drag(moveable, e);\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n return this.dragEnd(moveable, e);\r\n },\r\n dragGroupControlStart: function (moveable, e) {\r\n return this.dragGroupStart(moveable, e);\r\n },\r\n dragGroupControl: function (moveable, e) {\r\n return this.dragGroup(moveable, e);\r\n },\r\n dragGroupControlEnd: function (moveable, e) {\r\n return this.dragGroupEnd(moveable, e);\r\n },\r\n};\n\nvar Renderable = {\r\n name: \"renderable\",\r\n props: [],\r\n events: [\r\n \"renderStart\",\r\n \"render\",\r\n \"renderEnd\",\r\n \"renderGroupStart\",\r\n \"renderGroup\",\r\n \"renderGroupEnd\",\r\n ],\r\n dragRelation: \"weak\",\r\n dragStart: function (moveable, e) {\r\n triggerEvent(moveable, \"onRenderStart\", fillParams(moveable, e, {\r\n isPinch: !!e.isPinch,\r\n }));\r\n },\r\n drag: function (moveable, e) {\r\n triggerEvent(moveable, \"onRender\", this.fillDragParams(moveable, e));\r\n },\r\n dragAfter: function (moveable, e) {\r\n return this.drag(moveable, e);\r\n },\r\n dragEnd: function (moveable, e) {\r\n triggerEvent(moveable, \"onRenderEnd\", this.fillDragEndParams(moveable, e));\r\n },\r\n dragGroupStart: function (moveable, e) {\r\n triggerEvent(moveable, \"onRenderGroupStart\", fillParams(moveable, e, {\r\n isPinch: !!e.isPinch,\r\n targets: moveable.props.targets,\r\n }));\r\n },\r\n dragGroup: function (moveable, e) {\r\n var _this = this;\r\n var events = fillChildEvents(moveable, \"beforeRenderable\", e);\r\n var moveables = moveable.moveables;\r\n var params = events.map(function (childEvent, i) {\r\n var childMoveable = moveables[i];\r\n return _this.fillDragParams(childMoveable, childEvent);\r\n });\r\n triggerEvent(moveable, \"onRenderGroup\", fillParams(moveable, e, __assign(__assign({ isPinch: !!e.isPinch, targets: moveable.props.targets, transform: getNextTransformText(e), transformObject: {} }, fillCSSObject(getNextStyle(e))), { events: params })));\r\n },\r\n dragGroupEnd: function (moveable, e) {\r\n var _this = this;\r\n var events = fillChildEvents(moveable, \"beforeRenderable\", e);\r\n var moveables = moveable.moveables;\r\n var params = events.map(function (childEvent, i) {\r\n var childMoveable = moveables[i];\r\n return _this.fillDragEndParams(childMoveable, childEvent);\r\n });\r\n triggerEvent(moveable, \"onRenderGroupEnd\", fillParams(moveable, e, __assign({ isPinch: !!e.isPinch, isDrag: e.isDrag, targets: moveable.props.targets, events: params, transformObject: {}, transform: getNextTransformText(e) }, fillCSSObject(getNextStyle(e)))));\r\n },\r\n dragControlStart: function (moveable, e) {\r\n return this.dragStart(moveable, e);\r\n },\r\n dragControl: function (moveable, e) {\r\n return this.drag(moveable, e);\r\n },\r\n dragControlAfter: function (moveable, e) {\r\n return this.dragAfter(moveable, e);\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n return this.dragEnd(moveable, e);\r\n },\r\n dragGroupControlStart: function (moveable, e) {\r\n return this.dragGroupStart(moveable, e);\r\n },\r\n dragGroupControl: function (moveable, e) {\r\n return this.dragGroup(moveable, e);\r\n },\r\n dragGroupControlEnd: function (moveable, e) {\r\n return this.dragGroupEnd(moveable, e);\r\n },\r\n fillDragParams: function (moveable, e) {\r\n var transformObject = {};\r\n parse(getNextTransforms(e) || []).forEach(function (matrixInfo) {\r\n transformObject[matrixInfo.name] = matrixInfo.functionValue;\r\n });\r\n return fillParams(moveable, e, __assign({ isPinch: !!e.isPinch, transformObject: transformObject, transform: getNextTransformText(e) }, fillCSSObject(getNextStyle(e))));\r\n },\r\n fillDragEndParams: function (moveable, e) {\r\n var transformObject = {};\r\n parse(getNextTransforms(e) || []).forEach(function (matrixInfo) {\r\n transformObject[matrixInfo.name] = matrixInfo.functionValue;\r\n });\r\n return fillParams(moveable, e, __assign({ isPinch: !!e.isPinch, isDrag: e.isDrag, transformObject: transformObject, transform: getNextTransformText(e) }, fillCSSObject(getNextStyle(e))));\r\n },\r\n};\n\nfunction triggerAble(moveable, moveableAbles, eventOperations, eventAffix, eventType, e, requestInstant) {\r\n // pre setting\r\n e.clientDistX = e.distX;\r\n e.clientDistY = e.distY;\r\n var isStart = eventType === \"Start\";\r\n var isEnd = eventType === \"End\";\r\n var isAfter = eventType === \"After\";\r\n var target = moveable.state.target;\r\n var isRequest = e.isRequest;\r\n var isControl = eventAffix.indexOf(\"Control\") > -1;\r\n if (!target\r\n || (isStart && isControl && !isRequest && moveable.areaElement === e.inputEvent.target)) {\r\n return false;\r\n }\r\n var ables = __spreadArray([], __read(moveableAbles), false);\r\n if (isRequest) {\r\n var requestAble_1 = e.requestAble;\r\n if (!ables.some(function (able) { return able.name === requestAble_1; })) {\r\n ables.push.apply(ables, __spreadArray([], __read(moveable.props.ables.filter(function (able) { return able.name === requestAble_1; })), false));\r\n }\r\n }\r\n if (!ables.length || ables.every(function (able) { return able.dragRelation; })) {\r\n return false;\r\n }\r\n // \"drag\" \"Control\" \"After\"\r\n var inputEvent = e.inputEvent;\r\n var inputTarget;\r\n if (isEnd && inputEvent) {\r\n inputTarget = document.elementFromPoint(e.clientX, e.clientY) || inputEvent.target;\r\n }\r\n var isDragStop = false;\r\n var stop = function () {\r\n var _a;\r\n isDragStop = true;\r\n (_a = e.stop) === null || _a === void 0 ? void 0 : _a.call(e);\r\n };\r\n var isFirstStart = isStart && (!moveable.targetGesto || !moveable.controlGesto\r\n || (!moveable.targetGesto.isFlag() || !moveable.controlGesto.isFlag()));\r\n if (isFirstStart) {\r\n moveable.updateRect(eventType, true, false);\r\n }\r\n // trigger ables\r\n var datas = e.datas;\r\n var gestoType = isControl ? \"controlGesto\" : \"targetGesto\";\r\n var prevGesto = moveable[gestoType];\r\n var trigger = function (able, eventName, conditionName) {\r\n if (!(eventName in able) || prevGesto !== moveable[gestoType]) {\r\n return false;\r\n }\r\n var ableName = able.name;\r\n var nextDatas = datas[ableName] || (datas[ableName] = {});\r\n if (isStart) {\r\n nextDatas.isEventStart = !conditionName\r\n || !able[conditionName] || able[conditionName](moveable, e);\r\n }\r\n if (!nextDatas.isEventStart) {\r\n return false;\r\n }\r\n var result = able[eventName](moveable, __assign(__assign({}, e), { stop: stop, datas: nextDatas, originalDatas: datas, inputTarget: inputTarget }));\r\n moveable._emitter.off();\r\n if (isStart && result === false) {\r\n nextDatas.isEventStart = false;\r\n }\r\n return result;\r\n };\r\n // unset ables for first drag start\r\n if (isFirstStart) {\r\n ables.forEach(function (able) {\r\n able.unset && able.unset(moveable);\r\n });\r\n }\r\n // BeforeRenderable\r\n trigger(BeforeRenderable, \"drag\".concat(eventAffix).concat(eventType));\r\n var forceEndedCount = 0;\r\n var updatedCount = 0;\r\n eventOperations.forEach(function (eventOperation) {\r\n if (isDragStop) {\r\n return false;\r\n }\r\n var eventName = \"\".concat(eventOperation).concat(eventAffix).concat(eventType);\r\n var conditionName = \"\".concat(eventOperation).concat(eventAffix, \"Condition\");\r\n if (eventType === \"\" && !isRequest) {\r\n // Convert distX, distY\r\n convertDragDist(moveable.state, e);\r\n }\r\n // const isGroup = eventAffix.indexOf(\"Group\") > -1;\r\n var eventAbles = ables.filter(function (able) { return able[eventName]; });\r\n eventAbles = eventAbles.filter(function (able, i) {\r\n return able.name && eventAbles.indexOf(able) === i;\r\n });\r\n var results = eventAbles.filter(function (able) { return trigger(able, eventName, conditionName); });\r\n var isUpdate = results.length;\r\n // end ables\r\n if (isDragStop) {\r\n ++forceEndedCount;\r\n }\r\n if (isUpdate) {\r\n ++updatedCount;\r\n }\r\n if (!isDragStop && isStart && eventAbles.length && !isUpdate) {\r\n forceEndedCount += eventAbles.filter(function (able) {\r\n var ableName = able.name;\r\n var nextDatas = datas[ableName];\r\n if (nextDatas.isEventStart) {\r\n if (able.dragRelation === \"strong\") {\r\n return false;\r\n }\r\n // stop drag\r\n return true;\r\n }\r\n // pre stop drag\r\n return false;\r\n }).length ? 1 : 0;\r\n }\r\n });\r\n if (!isAfter || updatedCount) {\r\n trigger(Renderable, \"drag\".concat(eventAffix).concat(eventType));\r\n }\r\n // stop gesto condition\r\n var isForceEnd = prevGesto !== moveable[gestoType] || forceEndedCount === eventOperations.length;\r\n if (isEnd || isDragStop || isForceEnd) {\r\n moveable.state.gestos = {};\r\n if (moveable.moveables) {\r\n moveable.moveables.forEach(function (childMoveable) {\r\n childMoveable.state.gestos = {};\r\n });\r\n }\r\n ables.forEach(function (able) {\r\n able.unset && able.unset(moveable);\r\n });\r\n }\r\n if (isStart && !isForceEnd && !isRequest && updatedCount && moveable.props.preventDefault) {\r\n e === null || e === void 0 ? void 0 : e.preventDefault();\r\n }\r\n if (moveable.isUnmounted || isForceEnd) {\r\n return false;\r\n }\r\n if ((!isStart && updatedCount && !requestInstant) || isEnd) {\r\n var flushSync = moveable.props.flushSync || defaultSync;\r\n flushSync(function () {\r\n moveable.updateRect(isEnd ? eventType : \"\", true, false);\r\n moveable.forceUpdate();\r\n });\r\n }\r\n if (!isStart && !isEnd && !isAfter && updatedCount && !requestInstant) {\r\n triggerAble(moveable, moveableAbles, eventOperations, eventAffix, eventType + \"After\", e);\r\n }\r\n return true;\r\n}\r\nfunction checkMoveableTarget(moveable) {\r\n return function (e) {\r\n var _a;\r\n var eventTarget = e.inputEvent.target;\r\n var areaElement = moveable.areaElement;\r\n var dragTargetElement = moveable._dragTarget;\r\n if (!dragTargetElement || ((_a = moveable.controlGesto) === null || _a === void 0 ? void 0 : _a.isFlag())) {\r\n return false;\r\n }\r\n return eventTarget === dragTargetElement\r\n || dragTargetElement.contains(eventTarget)\r\n || eventTarget === areaElement\r\n || (!moveable.isMoveableElement(eventTarget) && !moveable.controlBox.contains(eventTarget))\r\n || hasClass(eventTarget, \"moveable-area\")\r\n || hasClass(eventTarget, \"moveable-padding\")\r\n || hasClass(eventTarget, \"moveable-edgeDraggable\");\r\n };\r\n}\r\nfunction getTargetAbleGesto(moveable, moveableTarget, eventAffix) {\r\n var controlBox = moveable.controlBox;\r\n var targets = [];\r\n var props = moveable.props;\r\n var dragArea = props.dragArea;\r\n var target = moveable.state.target;\r\n var dragTarget = props.dragTarget;\r\n targets.push(controlBox);\r\n if (!dragArea || dragTarget) {\r\n targets.push(moveableTarget);\r\n }\r\n if (!dragArea && dragTarget && target && moveableTarget !== target && props.dragTargetSelf) {\r\n targets.push(target);\r\n }\r\n return getAbleGesto(moveable, targets, \"targetAbles\", eventAffix, {\r\n dragStart: checkMoveableTarget(moveable),\r\n pinchStart: checkMoveableTarget(moveable),\r\n });\r\n}\r\nfunction getAbleGesto(moveable, target, ableType, eventAffix, conditionFunctions) {\r\n if (conditionFunctions === void 0) { conditionFunctions = {}; }\r\n var isTargetAbles = ableType === \"targetAbles\";\r\n var _a = moveable.props, pinchOutside = _a.pinchOutside, pinchThreshold = _a.pinchThreshold, preventClickEventOnDrag = _a.preventClickEventOnDrag, preventClickDefault = _a.preventClickDefault, checkInput = _a.checkInput, dragFocusedInput = _a.dragFocusedInput, _b = _a.preventDefault, preventDefault = _b === void 0 ? true : _b, dragContaienrOption = _a.dragContainer;\r\n var dragContainer = getRefTarget(dragContaienrOption, true);\r\n var options = {\r\n preventDefault: preventDefault,\r\n preventRightClick: true,\r\n preventWheelClick: true,\r\n container: dragContainer || getWindow(moveable.getControlBoxElement()),\r\n pinchThreshold: pinchThreshold,\r\n pinchOutside: pinchOutside,\r\n preventClickEventOnDrag: isTargetAbles ? preventClickEventOnDrag : false,\r\n preventClickEventOnDragStart: isTargetAbles ? preventClickDefault : false,\r\n preventClickEventByCondition: isTargetAbles ? null : function (e) {\r\n return moveable.controlBox.contains(e.target);\r\n },\r\n checkInput: isTargetAbles ? checkInput : false,\r\n dragFocusedInput: dragFocusedInput,\r\n };\r\n var gesto = new Gesto(target, options);\r\n var isControl = eventAffix === \"Control\";\r\n [\"drag\", \"pinch\"].forEach(function (eventOperation) {\r\n [\"Start\", \"\", \"End\"].forEach(function (eventType) {\r\n gesto.on(\"\".concat(eventOperation).concat(eventType), function (e) {\r\n var _a;\r\n var eventName = e.eventType;\r\n var isPinchScheduled = eventOperation === \"drag\" && e.isPinch;\r\n if (conditionFunctions[eventName] && !conditionFunctions[eventName](e)) {\r\n e.stop();\r\n return;\r\n }\r\n if (isPinchScheduled) {\r\n return;\r\n }\r\n var eventOperations = eventOperation === \"drag\" ? [eventOperation] : [\"drag\", eventOperation];\r\n var moveableAbles = __spreadArray([], __read(moveable[ableType]), false);\r\n var result = triggerAble(moveable, moveableAbles, eventOperations, eventAffix, eventType, e);\r\n if (!result) {\r\n e.stop();\r\n }\r\n else if (moveable.props.stopPropagation || (eventType === \"Start\" && isControl)) {\r\n (_a = e === null || e === void 0 ? void 0 : e.inputEvent) === null || _a === void 0 ? void 0 : _a.stopPropagation();\r\n }\r\n });\r\n });\r\n });\r\n return gesto;\r\n}\n\nvar EventManager = /*#__PURE__*/ (function () {\r\n function EventManager(target, moveable, eventName) {\r\n var _this = this;\r\n this.target = target;\r\n this.moveable = moveable;\r\n this.eventName = eventName;\r\n this.ables = [];\r\n this._onEvent = function (e) {\r\n var eventName = _this.eventName;\r\n var moveable = _this.moveable;\r\n if (moveable.state.disableNativeEvent) {\r\n return;\r\n }\r\n _this.ables.forEach(function (able) {\r\n able[eventName](moveable, {\r\n inputEvent: e,\r\n });\r\n });\r\n };\r\n target.addEventListener(eventName.toLowerCase(), this._onEvent);\r\n }\r\n EventManager.prototype.setAbles = function (ables) {\r\n this.ables = ables;\r\n };\r\n EventManager.prototype.destroy = function () {\r\n this.target.removeEventListener(this.eventName.toLowerCase(), this._onEvent);\r\n this.target = null;\r\n this.moveable = null;\r\n };\r\n return EventManager;\r\n}());\n\nfunction calculateMatrixStack(target, container, rootContainer, isAbsolute3d) {\r\n var _a;\r\n if (rootContainer === void 0) { rootContainer = container; }\r\n var _b = getMatrixStackInfo(target, container), matrixes = _b.matrixes, is3d = _b.is3d, prevTargetMatrix = _b.targetMatrix, transformOrigin = _b.transformOrigin, targetOrigin = _b.targetOrigin, offsetContainer = _b.offsetContainer, hasFixed = _b.hasFixed, containerZoom = _b.zoom; // prevMatrix\r\n var _c = getCachedMatrixContainerInfo(offsetContainer, rootContainer), rootMatrixes = _c.matrixes, isRoot3d = _c.is3d, offsetRootContainer = _c.offsetContainer, rootZoom = _c.zoom; // prevRootMatrix\r\n // if (rootContainer === document.body) {\r\n // console.log(offsetContainer, rootContainer, rootMatrixes);\r\n // }\r\n var isNext3d = isAbsolute3d || isRoot3d || is3d;\r\n var n = isNext3d ? 4 : 3;\r\n var isSVGGraphicElement = target.tagName.toLowerCase() !== \"svg\" && \"ownerSVGElement\" in target;\r\n var targetMatrix = prevTargetMatrix;\r\n // let allMatrix = prevMatrix ? convertDimension(prevMatrix, prevN!, n) : createIdentityMatrix(n);\r\n // let rootMatrix = prevRootMatrix ? convertDimension(prevRootMatrix, prevN!, n) : createIdentityMatrix(n);\r\n // let beforeMatrix = prevMatrix ? convertDimension(prevMatrix, prevN!, n) : createIdentityMatrix(n);\r\n var allMatrix = createIdentityMatrix(n);\r\n var rootMatrix = createIdentityMatrix(n);\r\n var beforeMatrix = createIdentityMatrix(n);\r\n var offsetMatrix = createIdentityMatrix(n);\r\n var length = matrixes.length;\r\n var nextRootMatrixes = rootMatrixes.map(function (info) {\r\n return __assign(__assign({}, info), { matrix: info.matrix ? __spreadArray([], __read(info.matrix), false) : undefined });\r\n }).reverse();\r\n matrixes.reverse();\r\n if (!is3d && isNext3d) {\r\n targetMatrix = convertDimension(targetMatrix, 3, 4);\r\n convert3DMatrixes(matrixes);\r\n }\r\n if (!isRoot3d && isNext3d) {\r\n convert3DMatrixes(nextRootMatrixes);\r\n }\r\n // rootMatrix = (...) -> container -> offset -> absolute -> offset -> absolute(targetMatrix)\r\n // rootMatrixBeforeOffset = lastOffsetMatrix -> (...) -> container\r\n // beforeMatrix = (... -> container -> offset -> absolute) -> offset -> absolute(targetMatrix)\r\n // offsetMatrix = (... -> container -> offset -> absolute -> offset) -> absolute(targetMatrix)\r\n nextRootMatrixes.forEach(function (info) {\r\n rootMatrix = multiply(rootMatrix, info.matrix, n);\r\n });\r\n var originalRootContainer = rootContainer || getDocumentBody(target);\r\n var endContainer = ((_a = nextRootMatrixes[0]) === null || _a === void 0 ? void 0 : _a.target)\r\n || getOffsetInfo(originalRootContainer, originalRootContainer, true).offsetParent;\r\n var rootMatrixBeforeOffset = nextRootMatrixes.slice(1).reduce(function (matrix, info) {\r\n return multiply(matrix, info.matrix, n);\r\n }, createIdentityMatrix(n));\r\n matrixes.forEach(function (info, i) {\r\n if (length - 2 === i) {\r\n // length - 3\r\n beforeMatrix = allMatrix.slice();\r\n }\r\n if (length - 1 === i) {\r\n // length - 2\r\n offsetMatrix = allMatrix.slice();\r\n }\r\n // calculate for SVGElement\r\n if (!info.matrix) {\r\n var nextInfo = matrixes[i + 1];\r\n var offset = getSVGOffset(info, nextInfo, endContainer, n, multiply(rootMatrixBeforeOffset, allMatrix, n));\r\n info.matrix = createOriginMatrix(offset, n);\r\n }\r\n allMatrix = multiply(allMatrix, info.matrix, n);\r\n });\r\n var isMatrix3d = !isSVGGraphicElement && is3d;\r\n if (!targetMatrix) {\r\n targetMatrix = createIdentityMatrix(isMatrix3d ? 4 : 3);\r\n }\r\n var targetTransform = makeMatrixCSS(isSVGGraphicElement && targetMatrix.length === 16\r\n ? convertDimension(targetMatrix, 4, 3) : targetMatrix, isMatrix3d);\r\n var originalRootMatrix = rootMatrix;\r\n rootMatrix = ignoreDimension(rootMatrix, n, n);\r\n return {\r\n hasZoom: containerZoom !== 1 || rootZoom !== 1,\r\n hasFixed: hasFixed,\r\n matrixes: matrixes,\r\n rootMatrix: rootMatrix,\r\n originalRootMatrix: originalRootMatrix,\r\n beforeMatrix: beforeMatrix,\r\n offsetMatrix: offsetMatrix,\r\n allMatrix: allMatrix,\r\n targetMatrix: targetMatrix,\r\n targetTransform: targetTransform,\r\n inlineTransform: target.style.transform,\r\n transformOrigin: transformOrigin,\r\n targetOrigin: targetOrigin,\r\n is3d: isNext3d,\r\n offsetContainer: offsetContainer,\r\n offsetRootContainer: offsetRootContainer,\r\n };\r\n}\n\nfunction calculateElementInfo(target, container, rootContainer, isAbsolute3d) {\r\n if (rootContainer === void 0) { rootContainer = container; }\r\n var width = 0;\r\n var height = 0;\r\n var rotation = 0;\r\n var allResult = {};\r\n var sizes = getSize(target);\r\n if (target) {\r\n width = sizes.offsetWidth;\r\n height = sizes.offsetHeight;\r\n }\r\n if (target) {\r\n var result = calculateMatrixStack(target, container, rootContainer, isAbsolute3d);\r\n var position = calculateElementPosition(result.allMatrix, result.transformOrigin, width, height);\r\n allResult = __assign(__assign({}, result), position);\r\n var rotationPosition = calculateElementPosition(result.allMatrix, [50, 50], 100, 100);\r\n rotation = getRotationRad([rotationPosition.pos1, rotationPosition.pos2], rotationPosition.direction);\r\n }\r\n var n = isAbsolute3d ? 4 : 3;\r\n return __assign(__assign(__assign({ hasZoom: false, width: width, height: height, rotation: rotation }, sizes), { originalRootMatrix: createIdentityMatrix(n), rootMatrix: createIdentityMatrix(n), beforeMatrix: createIdentityMatrix(n), offsetMatrix: createIdentityMatrix(n), allMatrix: createIdentityMatrix(n), targetMatrix: createIdentityMatrix(n), targetTransform: \"\", inlineTransform: \"\", transformOrigin: [0, 0], targetOrigin: [0, 0], is3d: !!isAbsolute3d, left: 0, top: 0, right: 0, bottom: 0, origin: [0, 0], pos1: [0, 0], pos2: [0, 0], pos3: [0, 0], pos4: [0, 0], direction: 1, hasFixed: false, offsetContainer: null, offsetRootContainer: null, matrixes: [] }), allResult);\r\n}\r\nfunction getElementInfo(target, container, rootContainer) {\r\n if (rootContainer === void 0) { rootContainer = container; }\r\n return calculateElementInfo(target, container, rootContainer, true);\r\n}\n\nfunction getMoveableTargetInfo(moveableElement, target, container, parentContainer, rootContainer, requestStyles) {\r\n if (requestStyles === void 0) { requestStyles = []; }\r\n var beforeDirection = 1;\r\n var beforeOrigin = [0, 0];\r\n var targetClientRect = resetClientRect();\r\n var moveableClientRect = resetClientRect();\r\n var containerClientRect = resetClientRect();\r\n var rootContainerClientRect = resetClientRect();\r\n var offsetDelta = [0, 0];\r\n var style = {};\r\n var result = calculateElementInfo(target, container, rootContainer, true);\r\n if (target) {\r\n var getStyle_1 = getCachedStyle(target);\r\n requestStyles.forEach(function (name) {\r\n style[name] = getStyle_1(name);\r\n });\r\n var n = result.is3d ? 4 : 3;\r\n var beforePosition = calculateElementPosition(result.offsetMatrix, plus(result.transformOrigin, getOrigin(result.targetMatrix, n)), result.width, result.height);\r\n beforeDirection = beforePosition.direction;\r\n beforeOrigin = plus(beforePosition.origin, [beforePosition.left - result.left, beforePosition.top - result.top]);\r\n rootContainerClientRect = getClientRect(result.offsetRootContainer);\r\n var offsetContainer = getOffsetInfo(parentContainer, parentContainer, true).offsetParent\r\n || result.offsetRootContainer;\r\n if (result.hasZoom) {\r\n var absoluteTargetPosition = calculateElementPosition(multiply(result.originalRootMatrix, result.allMatrix), result.transformOrigin, result.width, result.height);\r\n var absoluteContainerPosition = calculateElementPosition(result.originalRootMatrix, getTransformOriginArray(getCachedStyle(offsetContainer)(\"transformOrigin\")).map(function (pos) { return parseFloat(pos); }), offsetContainer.offsetWidth, offsetContainer.offsetHeight);\r\n targetClientRect = getClientRectByPosition(absoluteTargetPosition, rootContainerClientRect);\r\n containerClientRect = getClientRectByPosition(absoluteContainerPosition, rootContainerClientRect, offsetContainer, true);\r\n if (moveableElement) {\r\n var left = absoluteTargetPosition.left;\r\n var top_1 = absoluteTargetPosition.top;\r\n moveableClientRect = getClientRectByPosition({\r\n left: left,\r\n top: top_1,\r\n bottom: top_1,\r\n right: top_1,\r\n }, rootContainerClientRect);\r\n }\r\n }\r\n else {\r\n targetClientRect = getClientRect(target);\r\n containerClientRect = getCachedClientRect(offsetContainer);\r\n if (moveableElement) {\r\n moveableClientRect = getClientRect(moveableElement);\r\n }\r\n var containerClientRectLeft = containerClientRect.left, containerClientRectTop = containerClientRect.top, containterClientLeft = containerClientRect.clientLeft, containerClientTop = containerClientRect.clientTop;\r\n var clientDelta = [\r\n targetClientRect.left - containerClientRectLeft,\r\n targetClientRect.top - containerClientRectTop,\r\n ];\r\n offsetDelta = minus(calculateInversePosition(result.rootMatrix, clientDelta, 4), [containterClientLeft + result.left, containerClientTop + result.top]);\r\n }\r\n }\r\n return __assign({ targetClientRect: targetClientRect, containerClientRect: containerClientRect, moveableClientRect: moveableClientRect, rootContainerClientRect: rootContainerClientRect, beforeDirection: beforeDirection, beforeOrigin: beforeOrigin, originalBeforeOrigin: beforeOrigin, target: target, style: style, offsetDelta: offsetDelta }, result);\r\n}\n\nfunction getPersistState(rect) {\r\n var pos1 = rect.pos1, pos2 = rect.pos2, pos3 = rect.pos3, pos4 = rect.pos4;\r\n if (!pos1 || !pos2 || !pos3 || !pos4) {\r\n return null;\r\n }\r\n var minPos = getMinMaxs([pos1, pos2, pos3, pos4]);\r\n var posDelta = [minPos.minX, minPos.minY];\r\n var origin = minus(rect.origin, posDelta);\r\n pos1 = minus(pos1, posDelta);\r\n pos2 = minus(pos2, posDelta);\r\n pos3 = minus(pos3, posDelta);\r\n pos4 = minus(pos4, posDelta);\r\n return __assign(__assign({}, rect), { left: rect.left, top: rect.top, posDelta: posDelta, pos1: pos1, pos2: pos2, pos3: pos3, pos4: pos4, origin: origin, beforeOrigin: origin, \r\n // originalBeforeOrigin: origin,\r\n isPersisted: true });\r\n}\n\nvar MoveableManager = /*#__PURE__*/ (function (_super) {\r\n __extends(MoveableManager, _super);\r\n function MoveableManager() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.state = __assign({ container: null, gestos: {}, renderPoses: [[0, 0], [0, 0], [0, 0], [0, 0]], disableNativeEvent: false, posDelta: [0, 0] }, getMoveableTargetInfo(null));\r\n _this.renderState = {};\r\n _this.enabledAbles = [];\r\n _this.targetAbles = [];\r\n _this.controlAbles = [];\r\n _this.rotation = 0;\r\n _this.scale = [1, 1];\r\n _this.isMoveableMounted = false;\r\n _this.isUnmounted = false;\r\n _this.events = {\r\n \"mouseEnter\": null,\r\n \"mouseLeave\": null,\r\n };\r\n _this._emitter = new EventEmitter();\r\n _this._prevOriginalDragTarget = null;\r\n _this._originalDragTarget = null;\r\n _this._prevDragTarget = null;\r\n _this._dragTarget = null;\r\n _this._prevPropTarget = null;\r\n _this._propTarget = null;\r\n _this._prevDragArea = false;\r\n _this._isPropTargetChanged = false;\r\n _this._hasFirstTarget = false;\r\n _this._reiszeObserver = null;\r\n _this._observerId = 0;\r\n _this._mutationObserver = null;\r\n _this._rootContainer = null;\r\n _this._viewContainer = null;\r\n _this._viewClassNames = [];\r\n _this._store = {};\r\n _this.checkUpdateRect = function () {\r\n if (_this.isDragging()) {\r\n return;\r\n }\r\n var parentMoveable = _this.props.parentMoveable;\r\n if (parentMoveable) {\r\n parentMoveable.checkUpdateRect();\r\n return;\r\n }\r\n cancelAnimationFrame(_this._observerId);\r\n _this._observerId = requestAnimationFrame(function () {\r\n if (_this.isDragging()) {\r\n return;\r\n }\r\n _this.updateRect();\r\n });\r\n };\r\n _this._onPreventClick = function (e) {\r\n e.stopPropagation();\r\n e.preventDefault();\r\n // removeEvent(window, \"click\", this._onPreventClick, true);\r\n };\r\n return _this;\r\n }\r\n MoveableManager.prototype.render = function () {\r\n var props = this.props;\r\n var state = this.getState();\r\n var parentPosition = props.parentPosition, className = props.className, propsTarget = props.target, zoom = props.zoom, cspNonce = props.cspNonce, translateZ = props.translateZ, ControlBoxElement = props.cssStyled, groupable = props.groupable, linePadding = props.linePadding, controlPadding = props.controlPadding;\r\n this._checkUpdateRootContainer();\r\n this.checkUpdate();\r\n this.updateRenderPoses();\r\n var _a = __read(parentPosition || [0, 0], 2), parentLeft = _a[0], parentTop = _a[1];\r\n var left = state.left, top = state.top, stateTarget = state.target, direction = state.direction, hasFixed = state.hasFixed, offsetDelta = state.offsetDelta;\r\n var groupTargets = props.targets;\r\n var isDragging = this.isDragging();\r\n var ableAttributes = {};\r\n this.getEnabledAbles().forEach(function (able) {\r\n ableAttributes[\"data-able-\".concat(able.name.toLowerCase())] = true;\r\n });\r\n var ableClassName = this._getAbleClassName();\r\n var isDisplay = (groupTargets && groupTargets.length && (stateTarget || groupable))\r\n || propsTarget\r\n || (!this._hasFirstTarget && this.state.isPersisted);\r\n var isVisible = this.controlBox || this.props.firstRenderState || this.props.persistData;\r\n var translate = [left - parentLeft, top - parentTop];\r\n if (!groupable && props.useAccuratePosition) {\r\n translate[0] += offsetDelta[0];\r\n translate[1] += offsetDelta[1];\r\n }\r\n var style = {\r\n \"position\": hasFixed ? \"fixed\" : \"absolute\",\r\n \"display\": isDisplay ? \"block\" : \"none\",\r\n \"visibility\": isVisible ? \"visible\" : \"hidden\",\r\n \"transform\": \"translate3d(\".concat(translate[0], \"px, \").concat(translate[1], \"px, \").concat(translateZ, \")\"),\r\n \"--zoom\": zoom,\r\n \"--zoompx\": \"\".concat(zoom, \"px\"),\r\n };\r\n if (linePadding) {\r\n style[\"--moveable-line-padding\"] = linePadding;\r\n }\r\n if (controlPadding) {\r\n style[\"--moveable-control-padding\"] = controlPadding;\r\n }\r\n return (React.createElement(ControlBoxElement, __assign({ cspNonce: cspNonce, ref: ref(this, \"controlBox\"), className: \"\".concat(prefix(\"control-box\", direction === -1 ? \"reverse\" : \"\", isDragging ? \"dragging\" : \"\"), \" \").concat(ableClassName, \" \").concat(className) }, ableAttributes, { onClick: this._onPreventClick, style: style }),\r\n this.renderAbles(),\r\n this._renderLines()));\r\n };\r\n MoveableManager.prototype.componentDidMount = function () {\r\n this.isMoveableMounted = true;\r\n this.isUnmounted = false;\r\n var props = this.props;\r\n var parentMoveable = props.parentMoveable, container = props.container;\r\n this._checkUpdateRootContainer();\r\n this._checkUpdateViewContainer();\r\n this._updateTargets();\r\n this._updateNativeEvents();\r\n this._updateEvents();\r\n this.updateCheckInput();\r\n this._updateObserver(this.props);\r\n if (!container && !parentMoveable && !this.state.isPersisted) {\r\n this.updateRect(\"\", false, false);\r\n this.forceUpdate();\r\n }\r\n };\r\n MoveableManager.prototype.componentDidUpdate = function (prevProps) {\r\n this._checkUpdateRootContainer();\r\n this._checkUpdateViewContainer();\r\n this._updateNativeEvents();\r\n this._updateTargets();\r\n this._updateEvents();\r\n this.updateCheckInput();\r\n this._updateObserver(prevProps);\r\n };\r\n MoveableManager.prototype.componentWillUnmount = function () {\r\n var _a, _b;\r\n this.isMoveableMounted = false;\r\n this.isUnmounted = true;\r\n this._emitter.off();\r\n (_a = this._reiszeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();\r\n (_b = this._mutationObserver) === null || _b === void 0 ? void 0 : _b.disconnect();\r\n var viewContainer = this._viewContainer;\r\n if (viewContainer) {\r\n this._changeAbleViewClassNames([]);\r\n }\r\n unsetGesto(this, false);\r\n unsetGesto(this, true);\r\n var events = this.events;\r\n for (var name_1 in events) {\r\n var manager = events[name_1];\r\n manager && manager.destroy();\r\n }\r\n };\r\n MoveableManager.prototype.getTargets = function () {\r\n var target = this.props.target;\r\n return target ? [target] : [];\r\n };\r\n /**\r\n * Get the able used in MoveableManager.\r\n * @method Moveable#getAble\r\n * @param - able name\r\n */\r\n MoveableManager.prototype.getAble = function (ableName) {\r\n var ables = this.props.ables || [];\r\n return find(ables, function (able) { return able.name === ableName; });\r\n };\r\n MoveableManager.prototype.getContainer = function () {\r\n var _a = this.props, parentMoveable = _a.parentMoveable, wrapperMoveable = _a.wrapperMoveable, container = _a.container;\r\n return container\r\n || (wrapperMoveable && wrapperMoveable.getContainer())\r\n || (parentMoveable && parentMoveable.getContainer())\r\n || this.controlBox.parentElement;\r\n };\r\n /**\r\n * Returns the element of the control box.\r\n * @method Moveable#getControlBoxElement\r\n */\r\n MoveableManager.prototype.getControlBoxElement = function () {\r\n return this.controlBox;\r\n };\r\n /**\r\n * Target element to be dragged in moveable\r\n * @method Moveable#getDragElement\r\n */\r\n MoveableManager.prototype.getDragElement = function () {\r\n return this._dragTarget;\r\n };\r\n /**\r\n * Check if the target is an element included in the moveable.\r\n * @method Moveable#isMoveableElement\r\n * @param - the target\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * window.addEventListener(\"click\", e => {\r\n * if (!moveable.isMoveableElement(e.target)) {\r\n * moveable.target = e.target;\r\n * }\r\n * });\r\n */\r\n MoveableManager.prototype.isMoveableElement = function (target) {\r\n var _a;\r\n return target && (((_a = target.getAttribute) === null || _a === void 0 ? void 0 : _a.call(target, \"class\")) || \"\").indexOf(PREFIX) > -1;\r\n };\r\n /**\r\n * You can drag start the Moveable through the external `MouseEvent`or `TouchEvent`. (Angular: ngDragStart)\r\n * @method Moveable#dragStart\r\n * @param - external `MouseEvent`or `TouchEvent`\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * document.body.addEventListener(\"mousedown\", e => {\r\n * if (!moveable.isMoveableElement(e.target)) {\r\n * moveable.dragStart(e);\r\n * }\r\n * });\r\n */\r\n MoveableManager.prototype.dragStart = function (e) {\r\n var targetGesto = this.targetGesto;\r\n var controlGesto = this.controlGesto;\r\n if (targetGesto && checkMoveableTarget(this)({ inputEvent: e })) {\r\n if (!targetGesto.isFlag()) {\r\n targetGesto.triggerDragStart(e);\r\n }\r\n }\r\n else if (controlGesto && this.isMoveableElement(e.target)) {\r\n if (!controlGesto.isFlag()) {\r\n controlGesto.triggerDragStart(e);\r\n }\r\n }\r\n return this;\r\n };\r\n /**\r\n * Hit test an element or rect on a moveable target.\r\n * (100% = 100)\r\n * @method Moveable#hitTest\r\n * @param - element or rect to test\r\n * @return - Get hit test rate (rate > 0 is hitted)\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * document.body.addEventListener(\"mousedown\", e => {\r\n * if (moveable.hitTest(e.target) > 0) {\r\n * console.log(\"hiited\");\r\n * }\r\n * });\r\n */\r\n MoveableManager.prototype.hitTest = function (el) {\r\n var _a = this.state, target = _a.target, pos1 = _a.pos1, pos2 = _a.pos2, pos3 = _a.pos3, pos4 = _a.pos4, targetClientRect = _a.targetClientRect;\r\n if (!target) {\r\n return 0;\r\n }\r\n var rect;\r\n if (isNode(el)) {\r\n var clientRect = el.getBoundingClientRect();\r\n rect = {\r\n left: clientRect.left,\r\n top: clientRect.top,\r\n width: clientRect.width,\r\n height: clientRect.height,\r\n };\r\n }\r\n else {\r\n rect = __assign({ width: 0, height: 0 }, el);\r\n }\r\n var rectLeft = rect.left, rectTop = rect.top, rectWidth = rect.width, rectHeight = rect.height;\r\n var points = fitPoints([pos1, pos2, pos4, pos3], targetClientRect);\r\n var size = getOverlapSize(points, [\r\n [rectLeft, rectTop],\r\n [rectLeft + rectWidth, rectTop],\r\n [rectLeft + rectWidth, rectTop + rectHeight],\r\n [rectLeft, rectTop + rectHeight],\r\n ]);\r\n var totalSize = getAreaSize(points);\r\n if (!size || !totalSize) {\r\n return 0;\r\n }\r\n return Math.min(100, size / totalSize * 100);\r\n };\r\n /**\r\n * Whether the coordinates are inside Moveable\r\n * @method Moveable#isInside\r\n * @param - x coordinate\r\n * @param - y coordinate\r\n * @return - True if the coordinate is in moveable or false\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * document.body.addEventListener(\"mousedown\", e => {\r\n * if (moveable.isInside(e.clientX, e.clientY)) {\r\n * console.log(\"inside\");\r\n * }\r\n * });\r\n */\r\n MoveableManager.prototype.isInside = function (clientX, clientY) {\r\n var _a = this.state, target = _a.target, pos1 = _a.pos1, pos2 = _a.pos2, pos3 = _a.pos3, pos4 = _a.pos4, targetClientRect = _a.targetClientRect;\r\n if (!target) {\r\n return false;\r\n }\r\n return isInside([clientX, clientY], fitPoints([pos1, pos2, pos4, pos3], targetClientRect));\r\n };\r\n /**\r\n * If the width, height, left, and top of all elements change, update the shape of the moveable.\r\n * @method Moveable#updateRect\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * window.addEventListener(\"resize\", e => {\r\n * moveable.updateRect();\r\n * });\r\n */\r\n MoveableManager.prototype.updateRect = function (type, isTarget, isSetState) {\r\n if (isSetState === void 0) { isSetState = true; }\r\n var props = this.props;\r\n var isSingle = !props.parentPosition && !props.wrapperMoveable;\r\n if (isSingle) {\r\n setStoreCache(true);\r\n }\r\n var parentMoveable = props.parentMoveable;\r\n var state = this.state;\r\n var target = (state.target || props.target);\r\n var container = this.getContainer();\r\n var rootContainer = parentMoveable\r\n ? parentMoveable._rootContainer\r\n : this._rootContainer;\r\n var nextState = getMoveableTargetInfo(this.controlBox, target, container, container, rootContainer || container, this._getRequestStyles());\r\n if (!target && this._hasFirstTarget && props.persistData) {\r\n var persistState = getPersistState(props.persistData);\r\n for (var name_2 in persistState) {\r\n nextState[name_2] = persistState[name_2];\r\n }\r\n }\r\n if (isSingle) {\r\n setStoreCache();\r\n }\r\n this.updateState(nextState, parentMoveable ? false : isSetState);\r\n };\r\n /**\r\n * Check if the moveable state is being dragged.\r\n * @method Moveable#isDragging\r\n * @param - If you want to check if able is dragging, specify ableName.\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * // false\r\n * console.log(moveable.isDragging());\r\n *\r\n * moveable.on(\"drag\", () => {\r\n * // true\r\n * console.log(moveable.isDragging());\r\n * });\r\n */\r\n MoveableManager.prototype.isDragging = function (ableName) {\r\n var _a, _b;\r\n var targetGesto = this.targetGesto;\r\n var controlGesto = this.controlGesto;\r\n if (targetGesto === null || targetGesto === void 0 ? void 0 : targetGesto.isFlag()) {\r\n if (!ableName) {\r\n return true;\r\n }\r\n var data = targetGesto.getEventData();\r\n return !!((_a = data[ableName]) === null || _a === void 0 ? void 0 : _a.isEventStart);\r\n }\r\n if (controlGesto === null || controlGesto === void 0 ? void 0 : controlGesto.isFlag()) {\r\n if (!ableName) {\r\n return true;\r\n }\r\n var data = controlGesto.getEventData();\r\n return !!((_b = data[ableName]) === null || _b === void 0 ? void 0 : _b.isEventStart);\r\n }\r\n return false;\r\n };\r\n /**\r\n * If the width, height, left, and top of the only target change, update the shape of the moveable.\r\n * Use `.updateRect()` method\r\n * @method Moveable#updateTarget\r\n * @deprecated\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.updateTarget();\r\n */\r\n MoveableManager.prototype.updateTarget = function (type) {\r\n this.updateRect(type, true);\r\n };\r\n /**\r\n * You can get the vertex information, position and offset size information of the target based on the container.\r\n * @method Moveable#getRect\r\n * @return - The Rect Info\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * const rectInfo = moveable.getRect();\r\n */\r\n MoveableManager.prototype.getRect = function () {\r\n var state = this.state;\r\n var poses = getAbsolutePosesByState(this.state);\r\n var _a = __read(poses, 4), pos1 = _a[0], pos2 = _a[1], pos3 = _a[2], pos4 = _a[3];\r\n var rect = getRect(poses);\r\n var offsetWidth = state.width, offsetHeight = state.height;\r\n var width = rect.width, height = rect.height, left = rect.left, top = rect.top;\r\n var statePos = [state.left, state.top];\r\n var origin = plus(statePos, state.origin);\r\n var beforeOrigin = plus(statePos, state.beforeOrigin);\r\n var transformOrigin = state.transformOrigin;\r\n return {\r\n width: width,\r\n height: height,\r\n left: left,\r\n top: top,\r\n pos1: pos1,\r\n pos2: pos2,\r\n pos3: pos3,\r\n pos4: pos4,\r\n offsetWidth: offsetWidth,\r\n offsetHeight: offsetHeight,\r\n beforeOrigin: beforeOrigin,\r\n origin: origin,\r\n transformOrigin: transformOrigin,\r\n rotation: this.getRotation(),\r\n };\r\n };\r\n /**\r\n * Get a manager that manages the moveable's state and props.\r\n * @method Moveable#getManager\r\n * @return - The Rect Info\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * const manager = moveable.getManager(); // real moveable class instance\r\n */\r\n MoveableManager.prototype.getManager = function () {\r\n return this;\r\n };\r\n /**\r\n * You can stop the dragging currently in progress through a method from outside.\r\n * @method Moveable#stopDrag\r\n * @return - The Rect Info\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.stopDrag();\r\n */\r\n MoveableManager.prototype.stopDrag = function (type) {\r\n if (!type || type === \"target\") {\r\n var gesto = this.targetGesto;\r\n if ((gesto === null || gesto === void 0 ? void 0 : gesto.isIdle()) === false) {\r\n unsetAbles(this, false);\r\n }\r\n gesto === null || gesto === void 0 ? void 0 : gesto.stop();\r\n }\r\n if (!type || type === \"control\") {\r\n var gesto = this.controlGesto;\r\n if ((gesto === null || gesto === void 0 ? void 0 : gesto.isIdle()) === false) {\r\n unsetAbles(this, true);\r\n }\r\n gesto === null || gesto === void 0 ? void 0 : gesto.stop();\r\n }\r\n };\r\n MoveableManager.prototype.getRotation = function () {\r\n var _a = this.state, pos1 = _a.pos1, pos2 = _a.pos2, direction = _a.direction;\r\n return getAbsoluteRotation(pos1, pos2, direction);\r\n };\r\n /**\r\n * Request able through a method rather than an event.\r\n * At the moment of execution, requestStart is executed,\r\n * and then request and requestEnd can be executed through Requester.\r\n * @method Moveable#request\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Draggable.html#request|Draggable Requester}\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Resizable.html#request|Resizable Requester}\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Scalable.html#request|Scalable Requester}\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Rotatable.html#request|Rotatable Requester}\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.OriginDraggable.html#request|OriginDraggable Requester}\r\n * @param - ableName\r\n * @param - request to be able params.\r\n * @param - If isInstant is true, request and requestEnd are executed immediately.\r\n * @return - Able Requester. If there is no request in able, nothing will work.\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * // Instantly Request (requestStart - request - requestEnd)\r\n * moveable.request(\"draggable\", { deltaX: 10, deltaY: 10 }, true);\r\n *\r\n * // Start move\r\n * const requester = moveable.request(\"draggable\");\r\n * requester.request({ deltaX: 10, deltaY: 10 });\r\n * requester.request({ deltaX: 10, deltaY: 10 });\r\n * requester.request({ deltaX: 10, deltaY: 10 });\r\n * requester.requestEnd();\r\n */\r\n MoveableManager.prototype.request = function (ableName, param, isInstant) {\r\n if (param === void 0) { param = {}; }\r\n var self = this;\r\n var props = self.props;\r\n var manager = props.parentMoveable || props.wrapperMoveable || self;\r\n var allAbles = manager.props.ables;\r\n var groupable = props.groupable;\r\n var requsetAble = find(allAbles, function (able) { return able.name === ableName; });\r\n if (this.isDragging() || !requsetAble || !requsetAble.request) {\r\n return {\r\n request: function () {\r\n return this;\r\n },\r\n requestEnd: function () {\r\n return this;\r\n },\r\n };\r\n }\r\n var ableRequester = requsetAble.request(self);\r\n var requestInstant = isInstant || param.isInstant;\r\n var ableType = ableRequester.isControl ? \"controlAbles\" : \"targetAbles\";\r\n var eventAffix = \"\".concat((groupable ? \"Group\" : \"\")).concat(ableRequester.isControl ? \"Control\" : \"\");\r\n var moveableAbles = __spreadArray([], __read(manager[ableType]), false);\r\n var requester = {\r\n request: function (ableParam) {\r\n triggerAble(self, moveableAbles, [\"drag\"], eventAffix, \"\", __assign(__assign({}, ableRequester.request(ableParam)), { requestAble: ableName, isRequest: true }), requestInstant);\r\n return requester;\r\n },\r\n requestEnd: function () {\r\n triggerAble(self, moveableAbles, [\"drag\"], eventAffix, \"End\", __assign(__assign({}, ableRequester.requestEnd()), { requestAble: ableName, isRequest: true }), requestInstant);\r\n return requester;\r\n },\r\n };\r\n triggerAble(self, moveableAbles, [\"drag\"], eventAffix, \"Start\", __assign(__assign({}, ableRequester.requestStart(param)), { requestAble: ableName, isRequest: true }), requestInstant);\r\n return requestInstant ? requester.request(param).requestEnd() : requester;\r\n };\r\n /**\r\n * moveable is the top level that manages targets\r\n * `Single`: MoveableManager instance\r\n * `Group`: MoveableGroup instance\r\n * `IndividualGroup`: MoveableIndividaulGroup instance\r\n * Returns leaf target MoveableManagers.\r\n */\r\n MoveableManager.prototype.getMoveables = function () {\r\n return [this];\r\n };\r\n /**\r\n * Remove the Moveable object and the events.\r\n * @method Moveable#destroy\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.destroy();\r\n */\r\n MoveableManager.prototype.destroy = function () {\r\n this.componentWillUnmount();\r\n };\r\n MoveableManager.prototype.updateRenderPoses = function () {\r\n var state = this.getState();\r\n var props = this.props;\r\n var padding = props.padding;\r\n var originalBeforeOrigin = state.originalBeforeOrigin, transformOrigin = state.transformOrigin, allMatrix = state.allMatrix, is3d = state.is3d, pos1 = state.pos1, pos2 = state.pos2, pos3 = state.pos3, pos4 = state.pos4, stateLeft = state.left, stateTop = state.top, isPersisted = state.isPersisted;\r\n if (!padding) {\r\n state.renderPoses = [\r\n pos1,\r\n pos2,\r\n pos3,\r\n pos4,\r\n ];\r\n return;\r\n }\r\n var _a = getPaddingBox(padding), left = _a.left, top = _a.top, bottom = _a.bottom, right = _a.right;\r\n var n = is3d ? 4 : 3;\r\n // const clipPathInfo = getClipPath(\r\n // props.target,\r\n // offsetWidth,\r\n // offsetHeight,\r\n // );\r\n // if (clipPathInfo) {\r\n // left -= Math.max(0, clipPathInfo.left);\r\n // top -= Math.max(0, clipPathInfo.top);\r\n // bottom -= Math.max(0, offsetHeight - clipPathInfo.bottom);\r\n // right -= Math.max(0, offsetWidth - clipPathInfo.right);\r\n // }\r\n var absoluteOrigin = [];\r\n if (isPersisted) {\r\n absoluteOrigin = transformOrigin;\r\n }\r\n else if (this.controlBox && props.groupable) {\r\n absoluteOrigin = originalBeforeOrigin;\r\n }\r\n else {\r\n absoluteOrigin = plus(originalBeforeOrigin, [stateLeft, stateTop]);\r\n }\r\n var nextMatrix = multiplies(n, createOriginMatrix(absoluteOrigin.map(function (v) { return -v; }), n), allMatrix, createOriginMatrix(transformOrigin, n));\r\n state.renderPoses = [\r\n calculatePadding(nextMatrix, pos1, [-left, -top], n),\r\n calculatePadding(nextMatrix, pos2, [right, -top], n),\r\n calculatePadding(nextMatrix, pos3, [-left, bottom], n),\r\n calculatePadding(nextMatrix, pos4, [right, bottom], n),\r\n ];\r\n };\r\n MoveableManager.prototype.checkUpdate = function () {\r\n this._isPropTargetChanged = false;\r\n var _a = this.props, target = _a.target, container = _a.container, parentMoveable = _a.parentMoveable;\r\n var _b = this.state, stateTarget = _b.target, stateContainer = _b.container;\r\n if (!stateTarget && !target) {\r\n return;\r\n }\r\n this.updateAbles();\r\n var isTargetChanged = !equals(stateTarget, target);\r\n var isChanged = isTargetChanged || !equals(stateContainer, container);\r\n if (!isChanged) {\r\n return;\r\n }\r\n var moveableContainer = container || this.controlBox;\r\n if (moveableContainer) {\r\n this.unsetAbles();\r\n }\r\n this.updateState({ target: target, container: container });\r\n if (!parentMoveable && moveableContainer) {\r\n this.updateRect(\"End\", false, false);\r\n }\r\n this._isPropTargetChanged = isTargetChanged;\r\n };\r\n MoveableManager.prototype.waitToChangeTarget = function () {\r\n return new Promise(function () { });\r\n };\r\n MoveableManager.prototype.triggerEvent = function (name, e) {\r\n var props = this.props;\r\n this._emitter.trigger(name, e);\r\n if (props.parentMoveable && e.isRequest && !e.isRequestChild) {\r\n return props.parentMoveable.triggerEvent(name, e, true);\r\n }\r\n var callback = props[name];\r\n return callback && callback(e);\r\n };\r\n MoveableManager.prototype.useCSS = function (tag, css) {\r\n var customStyleMap = this.props.customStyledMap;\r\n var key = tag + css;\r\n if (!customStyleMap[key]) {\r\n customStyleMap[key] = styled(tag, css);\r\n }\r\n return customStyleMap[key];\r\n };\r\n MoveableManager.prototype.getState = function () {\r\n var _a;\r\n var props = this.props;\r\n if (props.target || ((_a = props.targets) === null || _a === void 0 ? void 0 : _a.length)) {\r\n this._hasFirstTarget = true;\r\n }\r\n var hasControlBox = this.controlBox;\r\n var persistData = props.persistData;\r\n var firstRenderState = props.firstRenderState;\r\n if (firstRenderState && !hasControlBox) {\r\n return firstRenderState;\r\n }\r\n if (!this._hasFirstTarget && persistData) {\r\n var persistState = getPersistState(persistData);\r\n if (persistState) {\r\n this.updateState(persistState, false);\r\n return this.state;\r\n }\r\n }\r\n this.state.isPersisted = false;\r\n return this.state;\r\n };\r\n MoveableManager.prototype.updateSelectors = function () { };\r\n MoveableManager.prototype.unsetAbles = function () {\r\n var _this = this;\r\n this.targetAbles.forEach(function (able) {\r\n if (able.unset) {\r\n able.unset(_this);\r\n }\r\n });\r\n };\r\n MoveableManager.prototype.updateAbles = function (ables, eventAffix) {\r\n if (ables === void 0) { ables = this.props.ables; }\r\n if (eventAffix === void 0) { eventAffix = \"\"; }\r\n var props = this.props;\r\n var triggerAblesSimultaneously = props.triggerAblesSimultaneously;\r\n var enabledAbles = this.getEnabledAbles(ables);\r\n var dragStart = \"drag\".concat(eventAffix, \"Start\");\r\n var pinchStart = \"pinch\".concat(eventAffix, \"Start\");\r\n var dragControlStart = \"drag\".concat(eventAffix, \"ControlStart\");\r\n var targetAbles = filterAbles(enabledAbles, [dragStart, pinchStart], triggerAblesSimultaneously);\r\n var controlAbles = filterAbles(enabledAbles, [dragControlStart], triggerAblesSimultaneously);\r\n this.enabledAbles = enabledAbles;\r\n this.targetAbles = targetAbles;\r\n this.controlAbles = controlAbles;\r\n };\r\n MoveableManager.prototype.updateState = function (nextState, isSetState) {\r\n if (isSetState) {\r\n if (this.isUnmounted) {\r\n return;\r\n }\r\n this.setState(nextState);\r\n }\r\n else {\r\n var state = this.state;\r\n for (var name_3 in nextState) {\r\n state[name_3] = nextState[name_3];\r\n }\r\n }\r\n };\r\n MoveableManager.prototype.getEnabledAbles = function (ables) {\r\n if (ables === void 0) { ables = this.props.ables; }\r\n var props = this.props;\r\n return ables.filter(function (able) { return able && ((able.always && props[able.name] !== false)\r\n || props[able.name]); });\r\n };\r\n MoveableManager.prototype.renderAbles = function () {\r\n var _this = this;\r\n var props = this.props;\r\n var triggerAblesSimultaneously = props.triggerAblesSimultaneously;\r\n var Renderer = {\r\n createElement: createElement,\r\n };\r\n this.renderState = {};\r\n return groupByMap(flat(filterAbles(this.getEnabledAbles(), [\"render\"], triggerAblesSimultaneously).map(function (_a) {\r\n var render = _a.render;\r\n return render(_this, Renderer) || [];\r\n })).filter(function (el) { return el; }), function (_a) {\r\n var key = _a.key;\r\n return key;\r\n }).map(function (group) { return group[0]; });\r\n };\r\n MoveableManager.prototype.updateCheckInput = function () {\r\n this.targetGesto && (this.targetGesto.options.checkInput = this.props.checkInput);\r\n };\r\n MoveableManager.prototype._getRequestStyles = function () {\r\n var styleNames = this.getEnabledAbles().reduce(function (names, able) {\r\n var _a, _b;\r\n var ableStyleNames = ((_b = (_a = able.requestStyle) === null || _a === void 0 ? void 0 : _a.call(able)) !== null && _b !== void 0 ? _b : []);\r\n return __spreadArray(__spreadArray([], __read(names), false), __read(ableStyleNames), false);\r\n }, __spreadArray([], __read((this.props.requestStyles || [])), false));\r\n return styleNames;\r\n };\r\n MoveableManager.prototype._updateObserver = function (prevProps) {\r\n this._updateResizeObserver(prevProps);\r\n this._updateMutationObserver(prevProps);\r\n };\r\n MoveableManager.prototype._updateEvents = function () {\r\n var controlBoxElement = this.controlBox;\r\n var hasTargetAble = this.targetAbles.length;\r\n var hasControlAble = this.controlAbles.length;\r\n var target = this._dragTarget;\r\n var isUnset = (!hasTargetAble && this.targetGesto)\r\n || this._isTargetChanged(true);\r\n if (isUnset) {\r\n unsetGesto(this, false);\r\n this.updateState({ gestos: {} });\r\n }\r\n if (!hasControlAble) {\r\n unsetGesto(this, true);\r\n }\r\n if (target && hasTargetAble && !this.targetGesto) {\r\n this.targetGesto = getTargetAbleGesto(this, target, \"\");\r\n }\r\n if (!this.controlGesto && hasControlAble) {\r\n this.controlGesto = getAbleGesto(this, controlBoxElement, \"controlAbles\", \"Control\");\r\n }\r\n };\r\n MoveableManager.prototype._updateTargets = function () {\r\n var props = this.props;\r\n this._prevPropTarget = this._propTarget;\r\n this._prevDragTarget = this._dragTarget;\r\n this._prevOriginalDragTarget = this._originalDragTarget;\r\n this._prevDragArea = props.dragArea;\r\n this._propTarget = props.target;\r\n this._originalDragTarget = props.dragTarget || props.target;\r\n this._dragTarget = getRefTarget(this._originalDragTarget, true);\r\n };\r\n MoveableManager.prototype._renderLines = function () {\r\n var props = this.props;\r\n var _a = props, zoom = _a.zoom, hideDefaultLines = _a.hideDefaultLines, hideChildMoveableDefaultLines = _a.hideChildMoveableDefaultLines, parentMoveable = _a.parentMoveable;\r\n if (hideDefaultLines || (parentMoveable && hideChildMoveableDefaultLines)) {\r\n return [];\r\n }\r\n var renderPoses = this.getState().renderPoses;\r\n var Renderer = {\r\n createElement: createElement,\r\n };\r\n return [\r\n [0, 1],\r\n [1, 3],\r\n [3, 2],\r\n [2, 0],\r\n ].map(function (_a, i) {\r\n var _b = __read(_a, 2), from = _b[0], to = _b[1];\r\n return renderLine(Renderer, \"\", renderPoses[from], renderPoses[to], zoom, \"render-line-\".concat(i));\r\n });\r\n };\r\n MoveableManager.prototype._isTargetChanged = function (useDragArea) {\r\n var props = this.props;\r\n var nextTarget = props.dragTarget || props.target;\r\n var prevTarget = this._prevOriginalDragTarget;\r\n var prevDragArea = this._prevDragArea;\r\n var dragArea = props.dragArea;\r\n // check target without dragArea\r\n var isDragTargetChanged = !dragArea && prevTarget !== nextTarget;\r\n var isDragAreaChanged = (useDragArea || dragArea) && prevDragArea !== dragArea;\r\n return isDragTargetChanged || isDragAreaChanged || this._prevPropTarget != this._propTarget;\r\n };\r\n MoveableManager.prototype._updateNativeEvents = function () {\r\n var _this = this;\r\n var props = this.props;\r\n var target = props.dragArea ? this.areaElement : this.state.target;\r\n var events = this.events;\r\n var eventKeys = getKeys(events);\r\n if (this._isTargetChanged()) {\r\n for (var eventName in events) {\r\n var manager = events[eventName];\r\n manager && manager.destroy();\r\n events[eventName] = null;\r\n }\r\n }\r\n if (!target) {\r\n return;\r\n }\r\n var enabledAbles = this.enabledAbles;\r\n eventKeys.forEach(function (eventName) {\r\n var ables = filterAbles(enabledAbles, [eventName]);\r\n var hasAbles = ables.length > 0;\r\n var manager = events[eventName];\r\n if (!hasAbles) {\r\n if (manager) {\r\n manager.destroy();\r\n events[eventName] = null;\r\n }\r\n return;\r\n }\r\n if (!manager) {\r\n manager = new EventManager(target, _this, eventName);\r\n events[eventName] = manager;\r\n }\r\n manager.setAbles(ables);\r\n });\r\n };\r\n MoveableManager.prototype._checkUpdateRootContainer = function () {\r\n var rootContainer = this.props.rootContainer;\r\n if (!this._rootContainer && rootContainer) {\r\n this._rootContainer = getRefTarget(rootContainer, true);\r\n }\r\n };\r\n MoveableManager.prototype._checkUpdateViewContainer = function () {\r\n var viewContainerOption = this.props.viewContainer;\r\n if (!this._viewContainer && viewContainerOption) {\r\n this._viewContainer = getRefTarget(viewContainerOption, true);\r\n }\r\n var viewContainer = this._viewContainer;\r\n if (viewContainer) {\r\n this._changeAbleViewClassNames(__spreadArray(__spreadArray([], __read(this._getAbleViewClassNames()), false), [\r\n this.isDragging() ? VIEW_DRAGGING : \"\",\r\n ], false));\r\n }\r\n };\r\n MoveableManager.prototype._changeAbleViewClassNames = function (classNames) {\r\n var viewContainer = this._viewContainer;\r\n var nextClassNames = groupBy(classNames.filter(Boolean), function (el) { return el; }).map(function (_a) {\r\n var _b = __read(_a, 1), className = _b[0];\r\n return className;\r\n });\r\n var prevClassNames = this._viewClassNames;\r\n var _a = diff$1(prevClassNames, nextClassNames), removed = _a.removed, added = _a.added;\r\n removed.forEach(function (index) {\r\n removeClass(viewContainer, prevClassNames[index]);\r\n });\r\n added.forEach(function (index) {\r\n addClass(viewContainer, nextClassNames[index]);\r\n });\r\n this._viewClassNames = nextClassNames;\r\n };\r\n MoveableManager.prototype._getAbleViewClassNames = function () {\r\n var _this = this;\r\n return (this.getEnabledAbles().map(function (able) {\r\n var _a;\r\n return (((_a = able.viewClassName) === null || _a === void 0 ? void 0 : _a.call(able, _this)) || \"\");\r\n }).join(\" \") + \" \".concat(this._getAbleClassName(\"-view\"))).split(/\\s+/g);\r\n };\r\n MoveableManager.prototype._getAbleClassName = function (classPrefix) {\r\n var _this = this;\r\n if (classPrefix === void 0) { classPrefix = \"\"; }\r\n var ables = this.getEnabledAbles();\r\n var targetGesto = this.targetGesto;\r\n var controlGesto = this.controlGesto;\r\n var targetGestoData = (targetGesto === null || targetGesto === void 0 ? void 0 : targetGesto.isFlag())\r\n ? targetGesto.getEventData() : {};\r\n var controlGestoData = (controlGesto === null || controlGesto === void 0 ? void 0 : controlGesto.isFlag())\r\n ? controlGesto.getEventData() : {};\r\n return ables.map(function (able) {\r\n var _a, _b, _c;\r\n var name = able.name;\r\n var className = ((_a = able.className) === null || _a === void 0 ? void 0 : _a.call(able, _this)) || \"\";\r\n if (((_b = targetGestoData[name]) === null || _b === void 0 ? void 0 : _b.isEventStart)\r\n || ((_c = controlGestoData[name]) === null || _c === void 0 ? void 0 : _c.isEventStart)) {\r\n className += \" \".concat(prefix(\"\".concat(name).concat(classPrefix, \"-dragging\")));\r\n }\r\n return className.trim();\r\n }).filter(Boolean).join(\" \");\r\n };\r\n MoveableManager.prototype._updateResizeObserver = function (prevProps) {\r\n var _a;\r\n var props = this.props;\r\n var target = props.target;\r\n var win = getWindow(this.getControlBoxElement());\r\n if (!win.ResizeObserver || !target || !props.useResizeObserver) {\r\n (_a = this._reiszeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();\r\n return;\r\n }\r\n if (prevProps.target === target && this._reiszeObserver) {\r\n return;\r\n }\r\n var observer = new win.ResizeObserver(this.checkUpdateRect);\r\n observer.observe(target, {\r\n box: \"border-box\",\r\n });\r\n this._reiszeObserver = observer;\r\n };\r\n MoveableManager.prototype._updateMutationObserver = function (prevProps) {\r\n var _this = this;\r\n var _a;\r\n var props = this.props;\r\n var target = props.target;\r\n var win = getWindow(this.getControlBoxElement());\r\n if (!win.MutationObserver || !target || !props.useMutationObserver) {\r\n (_a = this._mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();\r\n return;\r\n }\r\n if (prevProps.target === target && this._mutationObserver) {\r\n return;\r\n }\r\n var observer = new win.MutationObserver(function (records) {\r\n var e_1, _a;\r\n try {\r\n for (var records_1 = __values(records), records_1_1 = records_1.next(); !records_1_1.done; records_1_1 = records_1.next()) {\r\n var mutation = records_1_1.value;\r\n if (mutation.type === \"attributes\" && mutation.attributeName === \"style\") {\r\n _this.checkUpdateRect();\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (records_1_1 && !records_1_1.done && (_a = records_1.return)) _a.call(records_1);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n });\r\n observer.observe(target, {\r\n attributes: true,\r\n });\r\n this._mutationObserver = observer;\r\n };\r\n MoveableManager.defaultProps = {\r\n dragTargetSelf: false,\r\n target: null,\r\n dragTarget: null,\r\n container: null,\r\n rootContainer: null,\r\n origin: true,\r\n parentMoveable: null,\r\n wrapperMoveable: null,\r\n isWrapperMounted: false,\r\n parentPosition: null,\r\n warpSelf: false,\r\n svgOrigin: \"\",\r\n dragContainer: null,\r\n useResizeObserver: false,\r\n useMutationObserver: false,\r\n preventDefault: true,\r\n linePadding: 0,\r\n controlPadding: 0,\r\n ables: [],\r\n pinchThreshold: 20,\r\n dragArea: false,\r\n passDragArea: false,\r\n transformOrigin: \"\",\r\n className: \"\",\r\n zoom: 1,\r\n triggerAblesSimultaneously: false,\r\n padding: {},\r\n pinchOutside: true,\r\n checkInput: false,\r\n dragFocusedInput: false,\r\n groupable: false,\r\n hideDefaultLines: false,\r\n cspNonce: \"\",\r\n translateZ: 0,\r\n cssStyled: null,\r\n customStyledMap: {},\r\n props: {},\r\n stopPropagation: false,\r\n preventClickDefault: false,\r\n preventClickEventOnDrag: true,\r\n flushSync: defaultSync,\r\n firstRenderState: null,\r\n persistData: null,\r\n viewContainer: null,\r\n requestStyles: [],\r\n useAccuratePosition: false,\r\n };\r\n return MoveableManager;\r\n}(React.PureComponent));\r\n/**\r\n * The target to indicate Moveable Control Box.\r\n * @name Moveable#target\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n * moveable.target = document.querySelector(\".target\");\r\n */\r\n/**\r\n * Zooms in the elements of a moveable.\r\n * @name Moveable#zoom\r\n * @default 1\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n * moveable.zoom = 2;\r\n */\r\n/**\r\n * Whether the target size is detected and updated whenever it changes.\r\n * @name Moveable#useResizeObserver\r\n * @default false\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n * moveable.useResizeObserver = true;\r\n */\r\n/**\r\n * Resize, Scale Events at edges\r\n * @name Moveable#edge\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n * moveable.edge = true;\r\n */\r\n/**\r\n * You can specify the className of the moveable controlbox.\r\n * @name Moveable#className\r\n * @default \"\"\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * className: \"\",\r\n * });\r\n *\r\n * moveable.className = \"moveable1\";\r\n */\r\n/**\r\n * The target(s) to drag Moveable target(s)\r\n * @name Moveable#dragTarget\r\n * @default target\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n * moveable.target = document.querySelector(\".target\");\r\n * moveable.dragTarget = document.querySelector(\".dragTarget\");\r\n */\r\n/**\r\n * `renderStart` event occurs at the first start of all events.\r\n * @memberof Moveable\r\n * @event renderStart\r\n * @param {Moveable.OnRenderStart} - Parameters for the `renderStart` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: document.querySelector(\".target\"),\r\n * });\r\n * moveable.on(\"renderStart\", ({ target }) => {\r\n * console.log(\"onRenderStart\", target);\r\n * });\r\n */\r\n/**\r\n * `render` event occurs before the target is drawn on the screen.\r\n * @memberof Moveable\r\n * @event render\r\n * @param {Moveable.OnRender} - Parameters for the `render` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: document.querySelector(\".target\"),\r\n * });\r\n * moveable.on(\"render\", ({ target }) => {\r\n * console.log(\"onRender\", target);\r\n * });\r\n */\r\n/**\r\n * `renderEnd` event occurs at the end of all events.\r\n * @memberof Moveable\r\n * @event renderEnd\r\n * @param {Moveable.OnRenderEnd} - Parameters for the `renderEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: document.querySelector(\".target\"),\r\n * });\r\n * moveable.on(\"renderEnd\", ({ target }) => {\r\n * console.log(\"onRenderEnd\", target);\r\n * });\r\n */\r\n/**\r\n * `renderGroupStart` event occurs at the first start of all events in group.\r\n * @memberof Moveable\r\n * @event renderGroupStart\r\n * @param {Moveable.OnRenderGroupStart} - Parameters for the `renderGroupStart` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * });\r\n * moveable.on(\"renderGroupStart\", ({ targets }) => {\r\n * console.log(\"onRenderGroupStart\", targets);\r\n * });\r\n */\r\n/**\r\n * `renderGroup` event occurs before the target is drawn on the screen in group.\r\n * @memberof Moveable\r\n * @event renderGroup\r\n * @param {Moveable.OnRenderGroup} - Parameters for the `renderGroup` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * });\r\n * moveable.on(\"renderGroup\", ({ targets }) => {\r\n * console.log(\"onRenderGroup\", targets);\r\n * });\r\n */\r\n/**\r\n * `renderGroupEnd` event occurs at the end of all events in group.\r\n * @memberof Moveable\r\n * @event renderGroupEnd\r\n * @param {Moveable.OnRenderGroupEnd} - Parameters for the `renderGroupEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * });\r\n * moveable.on(\"renderGroupEnd\", ({ targets }) => {\r\n * console.log(\"onRenderGroupEnd\", targets);\r\n * });\r\n */\n\nvar Groupable = {\r\n name: \"groupable\",\r\n props: [\r\n \"defaultGroupRotate\",\r\n \"useDefaultGroupRotate\",\r\n \"defaultGroupOrigin\",\r\n \"groupable\",\r\n \"groupableProps\",\r\n \"targetGroups\",\r\n \"hideChildMoveableDefaultLines\",\r\n ],\r\n events: [],\r\n render: function (moveable, React) {\r\n var _a;\r\n var props = moveable.props;\r\n var targets = props.targets || [];\r\n var _b = moveable.getState(), left = _b.left, top = _b.top, isPersisted = _b.isPersisted;\r\n var zoom = props.zoom || 1;\r\n var renderGroupRects = moveable.renderGroupRects;\r\n var persistDatChildren = ((_a = props.persistData) === null || _a === void 0 ? void 0 : _a.children) || [];\r\n if (isPersisted) {\r\n targets = persistDatChildren.map(function () { return null; });\r\n }\r\n else {\r\n persistDatChildren = [];\r\n }\r\n var parentPosition = watchValue(moveable, \"parentPosition\", [left, top], function (styles) { return styles.join(\",\"); });\r\n var requestStyles = watchValue(moveable, \"requestStyles\", moveable.getRequestChildStyles(), function (styles) { return styles.join(\",\"); });\r\n moveable.moveables = moveable.moveables.slice(0, targets.length);\r\n return __spreadArray(__spreadArray([], __read(targets.map(function (target, i) {\r\n return React.createElement(MoveableManager, { key: \"moveable\" + i, ref: refs(moveable, \"moveables\", i), target: target, origin: false, requestStyles: requestStyles, cssStyled: props.cssStyled, customStyledMap: props.customStyledMap, useResizeObserver: props.useResizeObserver, useMutationObserver: props.useMutationObserver, hideChildMoveableDefaultLines: props.hideChildMoveableDefaultLines, parentMoveable: moveable, parentPosition: [left, top], persistData: persistDatChildren[i], zoom: zoom });\r\n })), false), __read(flat(renderGroupRects.map(function (_a, i) {\r\n var pos1 = _a.pos1, pos2 = _a.pos2, pos3 = _a.pos3, pos4 = _a.pos4;\r\n var poses = [pos1, pos2, pos3, pos4];\r\n return [\r\n [0, 1],\r\n [1, 3],\r\n [3, 2],\r\n [2, 0],\r\n ].map(function (_a, j) {\r\n var _b = __read(_a, 2), from = _b[0], to = _b[1];\r\n return renderLine(React, \"\", minus(poses[from], parentPosition), minus(poses[to], parentPosition), zoom, \"group-rect-\".concat(i, \"-\").concat(j));\r\n });\r\n }))), false);\r\n },\r\n};\n\nvar Clickable = makeAble(\"clickable\", {\r\n props: [\r\n \"clickable\",\r\n ],\r\n events: [\r\n \"click\",\r\n \"clickGroup\",\r\n ],\r\n always: true,\r\n dragRelation: \"weak\",\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n dragStart: function () {\r\n return;\r\n },\r\n dragControlStart: function () {\r\n return;\r\n },\r\n dragGroupStart: function (moveable, e) {\r\n e.datas.inputTarget = e.inputEvent && e.inputEvent.target;\r\n },\r\n dragEnd: function (moveable, e) {\r\n var target = moveable.props.target;\r\n var inputEvent = e.inputEvent;\r\n var inputTarget = e.inputTarget;\r\n var isMoveableElement = moveable.isMoveableElement(inputTarget);\r\n var containsElement = !isMoveableElement && moveable.controlBox.contains(inputTarget);\r\n if (!inputEvent || !inputTarget || e.isDrag\r\n || moveable.isMoveableElement(inputTarget)\r\n || containsElement\r\n // External event duplicate target or dragAreaElement\r\n ) {\r\n return;\r\n }\r\n var containsTarget = target.contains(inputTarget);\r\n triggerEvent(moveable, \"onClick\", fillParams(moveable, e, {\r\n isDouble: e.isDouble,\r\n inputTarget: inputTarget,\r\n isTarget: target === inputTarget,\r\n moveableTarget: moveable.props.target,\r\n containsTarget: containsTarget,\r\n }));\r\n },\r\n dragGroupEnd: function (moveable, e) {\r\n var inputEvent = e.inputEvent;\r\n var inputTarget = e.inputTarget;\r\n if (!inputEvent || !inputTarget || e.isDrag\r\n || moveable.isMoveableElement(inputTarget)\r\n // External event duplicate target or dragAreaElement\r\n || e.datas.inputTarget === inputTarget) {\r\n return;\r\n }\r\n var targets = moveable.props.targets;\r\n var targetIndex = targets.indexOf(inputTarget);\r\n var isTarget = targetIndex > -1;\r\n var containsTarget = false;\r\n if (targetIndex === -1) {\r\n targetIndex = findIndex(targets, function (parentTarget) { return parentTarget.contains(inputTarget); });\r\n containsTarget = targetIndex > -1;\r\n }\r\n triggerEvent(moveable, \"onClickGroup\", fillParams(moveable, e, {\r\n isDouble: e.isDouble,\r\n targets: targets,\r\n inputTarget: inputTarget,\r\n targetIndex: targetIndex,\r\n isTarget: isTarget,\r\n containsTarget: containsTarget,\r\n moveableTarget: targets[targetIndex],\r\n }));\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n this.dragEnd(moveable, e);\r\n },\r\n dragGroupControlEnd: function (moveable, e) {\r\n this.dragEnd(moveable, e);\r\n },\r\n});\r\n/**\r\n * When you click on the element, the `click` event is called.\r\n * @memberof Moveable\r\n * @event click\r\n * @param {Moveable.OnClick} - Parameters for the `click` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: document.querySelector(\".target\"),\r\n * });\r\n * moveable.on(\"click\", ({ hasTarget, containsTarget, targetIndex }) => {\r\n * // If you click on an element other than the target and not included in the target, index is -1.\r\n * console.log(\"onClickGroup\", target, hasTarget, containsTarget, targetIndex);\r\n * });\r\n */\r\n/**\r\n * When you click on the element inside the group, the `clickGroup` event is called.\r\n * @memberof Moveable\r\n * @event clickGroup\r\n * @param {Moveable.OnClickGroup} - Parameters for the `clickGroup` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * });\r\n * moveable.on(\"clickGroup\", ({ inputTarget, isTarget, containsTarget, targetIndex }) => {\r\n * // If you click on an element other than the target and not included in the target, index is -1.\r\n * console.log(\"onClickGroup\", inputTarget, isTarget, containsTarget, targetIndex);\r\n * });\r\n */\n\nfunction getDraggableEvent(e) {\r\n var datas = e.originalDatas.draggable;\r\n if (!datas) {\r\n e.originalDatas.draggable = {};\r\n datas = e.originalDatas.draggable;\r\n }\r\n return __assign(__assign({}, e), { datas: datas });\r\n}\r\nvar edgeDraggable = makeAble(\"edgeDraggable\", {\r\n css: [\r\n \".edge.edgeDraggable.line {\\ncursor: move;\\n}\",\r\n ],\r\n render: function (moveable, React) {\r\n var props = moveable.props;\r\n var edge = props.edgeDraggable;\r\n if (!edge) {\r\n return [];\r\n }\r\n return renderEdgeLines(React, \"edgeDraggable\", edge, moveable.getState().renderPoses, props.zoom);\r\n },\r\n dragCondition: function (moveable, e) {\r\n var _a;\r\n var props = moveable.props;\r\n var target = (_a = e.inputEvent) === null || _a === void 0 ? void 0 : _a.target;\r\n if (!props.edgeDraggable || !target) {\r\n return false;\r\n }\r\n return !props.draggable\r\n && hasClass(target, prefix(\"direction\"))\r\n && hasClass(target, prefix(\"edge\"))\r\n && hasClass(target, prefix(\"edgeDraggable\"));\r\n },\r\n dragStart: function (moveable, e) {\r\n return Draggable.dragStart(moveable, getDraggableEvent(e));\r\n },\r\n drag: function (moveable, e) {\r\n return Draggable.drag(moveable, getDraggableEvent(e));\r\n },\r\n dragEnd: function (moveable, e) {\r\n return Draggable.dragEnd(moveable, getDraggableEvent(e));\r\n },\r\n dragGroupCondition: function (moveable, e) {\r\n var _a;\r\n var props = moveable.props;\r\n var target = (_a = e.inputEvent) === null || _a === void 0 ? void 0 : _a.target;\r\n if (!props.edgeDraggable || !target) {\r\n return false;\r\n }\r\n return !props.draggable && hasClass(target, prefix(\"direction\")) && hasClass(target, prefix(\"line\"));\r\n },\r\n dragGroupStart: function (moveable, e) {\r\n return Draggable.dragGroupStart(moveable, getDraggableEvent(e));\r\n },\r\n dragGroup: function (moveable, e) {\r\n return Draggable.dragGroup(moveable, getDraggableEvent(e));\r\n },\r\n dragGroupEnd: function (moveable, e) {\r\n return Draggable.dragGroupEnd(moveable, getDraggableEvent(e));\r\n },\r\n unset: function (moveable) {\r\n return Draggable.unset(moveable);\r\n },\r\n});\r\n/**\r\n * Whether to move by dragging the edge line (default: false)\r\n * @name Moveable.Draggable#edgeDraggable\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * draggable: true,\r\n * edgeDraggable: false,\r\n * });\r\n *\r\n * moveable.edgeDraggable = true;\r\n */\n\nvar IndividualGroupable = {\r\n name: \"individualGroupable\",\r\n props: [\r\n \"individualGroupable\",\r\n \"individualGroupableProps\",\r\n ],\r\n events: [],\r\n};\n\nvar MOVEABLE_ABLES = [\r\n BeforeRenderable,\r\n Default, Snappable, Pinchable,\r\n Draggable, edgeDraggable,\r\n Resizable, Scalable, Warpable, Rotatable,\r\n Scrollable, Padding, Origin,\r\n OriginDraggable,\r\n Clippable, Roundable, Groupable, IndividualGroupable,\r\n Clickable,\r\n DragArea,\r\n Renderable,\r\n];\r\nvar MOVEABLE_EVENTS = /*#__PURE__*/ MOVEABLE_ABLES.reduce(function (current, able) {\r\n (able.events || []).forEach(function (name) {\r\n pushSet(current, name);\r\n });\r\n return current;\r\n}, []);\r\nvar MOVEABLE_PROPS = /*#__PURE__*/ MOVEABLE_ABLES.reduce(function (current, able) {\r\n (able.props || []).forEach(function (name) {\r\n pushSet(current, name);\r\n });\r\n return current;\r\n}, []);\n\nfunction solveConstantsDistance(_a, pos) {\r\n var _b = __read(_a, 3), a = _b[0], b = _b[1], c = _b[2];\r\n return (a * pos[0] + b * pos[1] + c) / Math.sqrt(a * a + b * b);\r\n}\r\nfunction solveC(_a, pos) {\r\n var _b = __read(_a, 2), a = _b[0], b = _b[1];\r\n // ax + by + c = 0\r\n // -ax -by;\r\n return -a * pos[0] - b * pos[1];\r\n}\n\nfunction getMaxPos(poses, index) {\r\n return Math.max.apply(Math, __spreadArray([], __read(poses.map(function (_a) {\r\n var _b = __read(_a, 4), pos1 = _b[0], pos2 = _b[1], pos3 = _b[2], pos4 = _b[3];\r\n return Math.max(pos1[index], pos2[index], pos3[index], pos4[index]);\r\n })), false));\r\n}\r\nfunction getMinPos(poses, index) {\r\n return Math.min.apply(Math, __spreadArray([], __read(poses.map(function (_a) {\r\n var _b = __read(_a, 4), pos1 = _b[0], pos2 = _b[1], pos3 = _b[2], pos4 = _b[3];\r\n return Math.min(pos1[index], pos2[index], pos3[index], pos4[index]);\r\n })), false));\r\n}\r\nfunction getGroupRect(parentPoses, rotation) {\r\n var _a, _b, _c;\r\n var pos1 = [0, 0];\r\n var pos2 = [0, 0];\r\n var pos3 = [0, 0];\r\n var pos4 = [0, 0];\r\n var width = 0;\r\n var height = 0;\r\n if (!parentPoses.length) {\r\n return {\r\n pos1: pos1,\r\n pos2: pos2,\r\n pos3: pos3,\r\n pos4: pos4,\r\n minX: 0,\r\n minY: 0,\r\n maxX: 0,\r\n maxY: 0,\r\n width: width,\r\n height: height,\r\n rotation: rotation,\r\n };\r\n }\r\n var fixedRotation = throttle(rotation, TINY_NUM);\r\n if (fixedRotation % 90) {\r\n var rad = fixedRotation / 180 * Math.PI;\r\n var a1_1 = Math.tan(rad);\r\n var a2_1 = -1 / a1_1;\r\n // ax = y // -ax + y = 0 // 0 => 1\r\n // -ax = y // ax + y = 0 // 0 => 3\r\n var a1MinMax_1 = [MAX_NUM, MIN_NUM];\r\n var a1MinMaxPos_1 = [[0, 0], [0, 0]];\r\n var a2MinMax_1 = [MAX_NUM, MIN_NUM];\r\n var a2MinMaxPos_1 = [[0, 0], [0, 0]];\r\n parentPoses.forEach(function (poses) {\r\n poses.forEach(function (pos) {\r\n // const b1 = pos[1] - a1 * pos[0];\r\n // const b2 = pos[1] - a2 * pos[0];\r\n var a1Dist = solveConstantsDistance([-a1_1, 1, 0], pos);\r\n var a2Dist = solveConstantsDistance([-a2_1, 1, 0], pos);\r\n if (a1MinMax_1[0] > a1Dist) {\r\n a1MinMaxPos_1[0] = pos;\r\n a1MinMax_1[0] = a1Dist;\r\n }\r\n if (a1MinMax_1[1] < a1Dist) {\r\n a1MinMaxPos_1[1] = pos;\r\n a1MinMax_1[1] = a1Dist;\r\n }\r\n if (a2MinMax_1[0] > a2Dist) {\r\n a2MinMaxPos_1[0] = pos;\r\n a2MinMax_1[0] = a2Dist;\r\n }\r\n if (a2MinMax_1[1] < a2Dist) {\r\n a2MinMaxPos_1[1] = pos;\r\n a2MinMax_1[1] = a2Dist;\r\n }\r\n });\r\n });\r\n var _d = __read(a1MinMaxPos_1, 2), a1MinPos = _d[0], a1MaxPos = _d[1];\r\n var _e = __read(a2MinMaxPos_1, 2), a2MinPos = _e[0], a2MaxPos = _e[1];\r\n var minHorizontalLine = [-a1_1, 1, solveC([-a1_1, 1], a1MinPos)];\r\n var maxHorizontalLine = [-a1_1, 1, solveC([-a1_1, 1], a1MaxPos)];\r\n var minVerticalLine = [-a2_1, 1, solveC([-a2_1, 1], a2MinPos)];\r\n var maxVerticalLine = [-a2_1, 1, solveC([-a2_1, 1], a2MaxPos)];\r\n _a = __read([\r\n [minHorizontalLine, minVerticalLine],\r\n [minHorizontalLine, maxVerticalLine],\r\n [maxHorizontalLine, minVerticalLine],\r\n [maxHorizontalLine, maxVerticalLine],\r\n ].map(function (_a) {\r\n var _b = __read(_a, 2), line1 = _b[0], line2 = _b[1];\r\n return getIntersectionPointsByConstants(line1, line2)[0];\r\n }), 4), pos1 = _a[0], pos2 = _a[1], pos3 = _a[2], pos4 = _a[3];\r\n width = a2MinMax_1[1] - a2MinMax_1[0];\r\n height = a1MinMax_1[1] - a1MinMax_1[0];\r\n }\r\n else {\r\n var minX_1 = getMinPos(parentPoses, 0);\r\n var minY_1 = getMinPos(parentPoses, 1);\r\n var maxX_1 = getMaxPos(parentPoses, 0);\r\n var maxY_1 = getMaxPos(parentPoses, 1);\r\n pos1 = [minX_1, minY_1];\r\n pos2 = [maxX_1, minY_1];\r\n pos3 = [minX_1, maxY_1];\r\n pos4 = [maxX_1, maxY_1];\r\n width = maxX_1 - minX_1;\r\n height = maxY_1 - minY_1;\r\n if (fixedRotation % 180) {\r\n // 0\r\n // 1 2\r\n // 3 4\r\n // 90\r\n // 3 1\r\n // 4 2\r\n // 180\r\n // 4 3\r\n // 2 1\r\n // 270\r\n // 2 4\r\n // 1 3\r\n // 1, 2, 3,4 = 3 1 4 2\r\n var changedX = [pos3, pos1, pos4, pos2];\r\n _b = __read(changedX, 4), pos1 = _b[0], pos2 = _b[1], pos3 = _b[2], pos4 = _b[3];\r\n width = maxY_1 - minY_1;\r\n height = maxX_1 - minX_1;\r\n }\r\n }\r\n if (fixedRotation % 360 > 180) {\r\n // 1 2 4 3\r\n // 3 4 2 1\r\n var changedX = [pos4, pos3, pos2, pos1];\r\n _c = __read(changedX, 4), pos1 = _c[0], pos2 = _c[1], pos3 = _c[2], pos4 = _c[3];\r\n }\r\n var _f = getMinMaxs([pos1, pos2, pos3, pos4]), minX = _f.minX, minY = _f.minY, maxX = _f.maxX, maxY = _f.maxY;\r\n return {\r\n pos1: pos1,\r\n pos2: pos2,\r\n pos3: pos3,\r\n pos4: pos4,\r\n width: width,\r\n height: height,\r\n minX: minX,\r\n minY: minY,\r\n maxX: maxX,\r\n maxY: maxY,\r\n rotation: rotation,\r\n };\r\n}\r\nfunction findMoveableGroups(moveables, childTargetGroups) {\r\n var groups = childTargetGroups.map(function (targetGroup) {\r\n if (isArray(targetGroup)) {\r\n var childMoveableGroups = findMoveableGroups(moveables, targetGroup);\r\n var length_1 = childMoveableGroups.length;\r\n if (length_1 > 1) {\r\n return childMoveableGroups;\r\n }\r\n else if (length_1 === 1) {\r\n return childMoveableGroups[0];\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n else {\r\n var checked = find(moveables, function (_a) {\r\n var manager = _a.manager;\r\n return manager.props.target === targetGroup;\r\n });\r\n if (checked) {\r\n checked.finded = true;\r\n return checked.manager;\r\n }\r\n return null;\r\n }\r\n }).filter(Boolean);\r\n if (groups.length === 1 && isArray(groups[0])) {\r\n return groups[0];\r\n }\r\n return groups;\r\n}\r\n/**\r\n * @namespace Moveable.Group\r\n * @description You can make targets moveable.\r\n */\r\nvar MoveableGroup = /*#__PURE__*/ (function (_super) {\r\n __extends(MoveableGroup, _super);\r\n function MoveableGroup() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.differ = new ChildrenDiffer();\r\n _this.moveables = [];\r\n _this.transformOrigin = \"50% 50%\";\r\n _this.renderGroupRects = [];\r\n _this._targetGroups = [];\r\n _this._hasFirstTargets = false;\r\n return _this;\r\n }\r\n MoveableGroup.prototype.componentDidMount = function () {\r\n _super.prototype.componentDidMount.call(this);\r\n };\r\n MoveableGroup.prototype.checkUpdate = function () {\r\n this._isPropTargetChanged = false;\r\n this.updateAbles();\r\n };\r\n MoveableGroup.prototype.getTargets = function () {\r\n return this.props.targets;\r\n };\r\n MoveableGroup.prototype.updateRect = function (type, isTarget, isSetState) {\r\n var _a;\r\n if (isSetState === void 0) { isSetState = true; }\r\n var state = this.state;\r\n if (!this.controlBox || state.isPersisted) {\r\n return;\r\n }\r\n setStoreCache(true);\r\n this.moveables.forEach(function (moveable) {\r\n moveable.updateRect(type, false, false);\r\n });\r\n var props = this.props;\r\n var moveables = this.moveables;\r\n var target = state.target || props.target;\r\n var checkeds = moveables.map(function (moveable) { return ({ finded: false, manager: moveable }); });\r\n var targetGroups = this.props.targetGroups || [];\r\n var moveableGroups = findMoveableGroups(checkeds, targetGroups);\r\n var useDefaultGroupRotate = props.useDefaultGroupRotate;\r\n moveableGroups.push.apply(moveableGroups, __spreadArray([], __read(checkeds.filter(function (_a) {\r\n var finded = _a.finded;\r\n return !finded;\r\n }).map(function (_a) {\r\n var manager = _a.manager;\r\n return manager;\r\n })), false));\r\n var renderGroupRects = [];\r\n var isReset = !isTarget || (type !== \"\" && props.updateGroup);\r\n var defaultGroupRotate = props.defaultGroupRotate || 0;\r\n if (!this._hasFirstTargets) {\r\n var persistedRoatation = (_a = props.persistData) === null || _a === void 0 ? void 0 : _a.rotation;\r\n if (persistedRoatation != null) {\r\n defaultGroupRotate = persistedRoatation;\r\n }\r\n }\r\n function getMoveableGroupRect(group, parentRotation, isRoot) {\r\n var posesRotations = group.map(function (moveable) {\r\n if (isArray(moveable)) {\r\n var rect = getMoveableGroupRect(moveable, parentRotation);\r\n var poses = [rect.pos1, rect.pos2, rect.pos3, rect.pos4];\r\n renderGroupRects.push(rect);\r\n return { poses: poses, rotation: rect.rotation };\r\n }\r\n else {\r\n return {\r\n poses: getAbsolutePosesByState(moveable.state),\r\n rotation: moveable.getRotation(),\r\n };\r\n }\r\n });\r\n var rotations = posesRotations.map(function (_a) {\r\n var rotation = _a.rotation;\r\n return rotation;\r\n });\r\n var groupRotation = 0;\r\n var firstRotation = rotations[0];\r\n var isSameRotation = rotations.every(function (nextRotation) {\r\n return Math.abs(firstRotation - nextRotation) < 0.1;\r\n });\r\n if (isReset) {\r\n groupRotation = !useDefaultGroupRotate && isSameRotation ? firstRotation : defaultGroupRotate;\r\n }\r\n else {\r\n groupRotation = !useDefaultGroupRotate && !isRoot && isSameRotation ? firstRotation : parentRotation;\r\n }\r\n var groupPoses = posesRotations.map(function (_a) {\r\n var poses = _a.poses;\r\n return poses;\r\n });\r\n var groupRect = getGroupRect(groupPoses, groupRotation);\r\n return groupRect;\r\n }\r\n var rootGroupRect = getMoveableGroupRect(moveableGroups, this.rotation, true);\r\n if (isReset) {\r\n // reset rotataion\r\n this.rotation = rootGroupRect.rotation;\r\n this.transformOrigin = props.defaultGroupOrigin || \"50% 50%\";\r\n this.scale = [1, 1];\r\n }\r\n this._targetGroups = targetGroups;\r\n this.renderGroupRects = renderGroupRects;\r\n var transformOrigin = this.transformOrigin;\r\n var rotation = this.rotation;\r\n var scale = this.scale;\r\n var width = rootGroupRect.width, height = rootGroupRect.height, minX = rootGroupRect.minX, minY = rootGroupRect.minY;\r\n var posesInfo = rotatePosesInfo([\r\n [0, 0],\r\n [width, 0],\r\n [0, height],\r\n [width, height],\r\n ], convertTransformOriginArray(transformOrigin, width, height), this.rotation / 180 * Math.PI);\r\n var _b = getMinMaxs(posesInfo.result), deltaX = _b.minX, deltaY = _b.minY;\r\n var rotateScale = \" rotate(\".concat(rotation, \"deg)\")\r\n + \" scale(\".concat(sign(scale[0]), \", \").concat(sign(scale[1]), \")\");\r\n var transform = \"translate(\".concat(-deltaX, \"px, \").concat(-deltaY, \"px)\").concat(rotateScale);\r\n this.controlBox.style.transform\r\n = \"translate3d(\".concat(minX, \"px, \").concat(minY, \"px, \").concat(this.props.translateZ || 0, \")\");\r\n target.style.cssText += \"left:0px;top:0px;\"\r\n + \"transform-origin:\".concat(transformOrigin, \";\")\r\n + \"width:\".concat(width, \"px;height:\").concat(height, \"px;\")\r\n + \"transform: \".concat(transform);\r\n state.width = width;\r\n state.height = height;\r\n var container = this.getContainer();\r\n var info = getMoveableTargetInfo(this.controlBox, target, this.controlBox, this.getContainer(), this._rootContainer || container, []);\r\n var pos = [info.left, info.top];\r\n var _c = __read(getAbsolutePosesByState(info), 4), pos1 = _c[0], pos2 = _c[1], pos3 = _c[2], pos4 = _c[3]; // info.left + info.pos(1 ~ 4)\r\n var minPos = getMinMaxs([pos1, pos2, pos3, pos4]);\r\n var delta = [minPos.minX, minPos.minY];\r\n var direction = sign(scale[0] * scale[1]);\r\n info.pos1 = minus(pos1, delta);\r\n info.pos2 = minus(pos2, delta);\r\n info.pos3 = minus(pos3, delta);\r\n info.pos4 = minus(pos4, delta);\r\n // info.left = info.left + delta[0];\r\n // info.top = info.top + delta[1];\r\n info.left = minX - info.left + delta[0];\r\n info.top = minY - info.top + delta[1];\r\n info.origin = minus(plus(pos, info.origin), delta);\r\n info.beforeOrigin = minus(plus(pos, info.beforeOrigin), delta);\r\n info.originalBeforeOrigin = plus(pos, info.originalBeforeOrigin);\r\n info.transformOrigin = minus(plus(pos, info.transformOrigin), delta);\r\n target.style.transform\r\n = \"translate(\".concat(-deltaX - delta[0], \"px, \").concat(-deltaY - delta[1], \"px)\")\r\n + rotateScale;\r\n setStoreCache();\r\n this.updateState(__assign(__assign({}, info), { posDelta: delta, direction: direction, beforeDirection: direction }), isSetState);\r\n };\r\n MoveableGroup.prototype.getRect = function () {\r\n return __assign(__assign({}, _super.prototype.getRect.call(this)), { children: this.moveables.map(function (child) { return child.getRect(); }) });\r\n };\r\n MoveableGroup.prototype.triggerEvent = function (name, e, isManager) {\r\n if (isManager || name.indexOf(\"Group\") > -1) {\r\n return _super.prototype.triggerEvent.call(this, name, e);\r\n }\r\n else {\r\n this._emitter.trigger(name, e);\r\n }\r\n };\r\n MoveableGroup.prototype.getRequestChildStyles = function () {\r\n var styleNames = this.getEnabledAbles().reduce(function (names, able) {\r\n var _a, _b;\r\n var ableStyleNames = ((_b = (_a = able.requestChildStyle) === null || _a === void 0 ? void 0 : _a.call(able)) !== null && _b !== void 0 ? _b : []);\r\n return __spreadArray(__spreadArray([], __read(names), false), __read(ableStyleNames), false);\r\n }, []);\r\n return styleNames;\r\n };\r\n MoveableGroup.prototype.getMoveables = function () {\r\n return __spreadArray([], __read(this.moveables), false);\r\n };\r\n MoveableGroup.prototype.updateAbles = function () {\r\n _super.prototype.updateAbles.call(this, __spreadArray(__spreadArray([], __read(this.props.ables), false), [Groupable], false), \"Group\");\r\n };\r\n MoveableGroup.prototype._updateTargets = function () {\r\n _super.prototype._updateTargets.call(this);\r\n this._originalDragTarget = this.props.dragTarget || this.areaElement;\r\n this._dragTarget = getRefTarget(this._originalDragTarget, true);\r\n };\r\n MoveableGroup.prototype._updateEvents = function () {\r\n var state = this.state;\r\n var props = this.props;\r\n var prevTarget = this._prevDragTarget;\r\n var nextTarget = props.dragTarget || this.areaElement;\r\n var targets = props.targets;\r\n var _a = this.differ.update(targets), added = _a.added, changed = _a.changed, removed = _a.removed;\r\n var isTargetChanged = added.length || removed.length;\r\n if (isTargetChanged || this._prevOriginalDragTarget !== this._originalDragTarget) {\r\n unsetGesto(this, false);\r\n unsetGesto(this, true);\r\n this.updateState({ gestos: {} });\r\n }\r\n if (prevTarget !== nextTarget) {\r\n state.target = null;\r\n }\r\n if (!state.target) {\r\n state.target = this.areaElement;\r\n this.controlBox.style.display = \"block\";\r\n }\r\n if (state.target) {\r\n if (!this.targetGesto) {\r\n this.targetGesto = getTargetAbleGesto(this, this._dragTarget, \"Group\");\r\n }\r\n if (!this.controlGesto) {\r\n this.controlGesto = getAbleGesto(this, this.controlBox, \"controlAbles\", \"GroupControl\");\r\n }\r\n }\r\n var isContainerChanged = !equals(state.container, props.container);\r\n if (isContainerChanged) {\r\n state.container = props.container;\r\n }\r\n if (isContainerChanged\r\n || isTargetChanged\r\n || this.transformOrigin !== (props.defaultGroupOrigin || \"50% 50%\")\r\n || changed.length\r\n || targets.length && !isDeepArrayEquals(this._targetGroups, props.targetGroups || [])) {\r\n this.updateRect();\r\n this._hasFirstTargets = true;\r\n }\r\n this._isPropTargetChanged = !!isTargetChanged;\r\n };\r\n MoveableGroup.prototype._updateObserver = function () { };\r\n MoveableGroup.defaultProps = __assign(__assign({}, MoveableManager.defaultProps), { transformOrigin: [\"50%\", \"50%\"], groupable: true, dragArea: true, keepRatio: true, targets: [], defaultGroupRotate: 0, defaultGroupOrigin: \"50% 50%\" });\r\n return MoveableGroup;\r\n}(MoveableManager));\n\n/**\r\n * @namespace Moveable.IndividualGroup\r\n * @description Create targets individually, not as a group.Create targets individually, not as a group.\r\n */\r\nvar MoveableIndividualGroup = /*#__PURE__*/ (function (_super) {\r\n __extends(MoveableIndividualGroup, _super);\r\n function MoveableIndividualGroup() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.moveables = [];\r\n return _this;\r\n }\r\n MoveableIndividualGroup.prototype.render = function () {\r\n var _this = this;\r\n var _a;\r\n var props = this.props;\r\n var cspNonce = props.cspNonce, ControlBoxElement = props.cssStyled, persistData = props.persistData;\r\n var targets = props.targets || [];\r\n var length = targets.length;\r\n var canPersist = this.isUnmounted || !length;\r\n var persistDatChildren = (_a = persistData === null || persistData === void 0 ? void 0 : persistData.children) !== null && _a !== void 0 ? _a : [];\r\n if (canPersist && !length && persistDatChildren.length) {\r\n targets = persistDatChildren.map(function () { return null; });\r\n }\r\n else if (!canPersist) {\r\n persistDatChildren = [];\r\n }\r\n return React.createElement(ControlBoxElement, { cspNonce: cspNonce, ref: ref(this, \"controlBox\"), className: prefix(\"control-box\") }, targets.map(function (target, i) {\r\n var _a, _b;\r\n var individualProps = (_b = (_a = props.individualGroupableProps) === null || _a === void 0 ? void 0 : _a.call(props, target, i)) !== null && _b !== void 0 ? _b : {};\r\n return React.createElement(MoveableManager, __assign({ key: \"moveable\" + i, ref: refs(_this, \"moveables\", i) }, props, individualProps, { target: target, wrapperMoveable: _this, isWrapperMounted: _this.isMoveableMounted, persistData: persistDatChildren[i] }));\r\n }));\r\n };\r\n MoveableIndividualGroup.prototype.componentDidMount = function () { };\r\n MoveableIndividualGroup.prototype.componentDidUpdate = function () { };\r\n MoveableIndividualGroup.prototype.getTargets = function () {\r\n return this.props.targets;\r\n };\r\n MoveableIndividualGroup.prototype.updateRect = function (type, isTarget, isSetState) {\r\n if (isSetState === void 0) { isSetState = true; }\r\n setStoreCache(true);\r\n this.moveables.forEach(function (moveable) {\r\n moveable.updateRect(type, isTarget, isSetState);\r\n });\r\n setStoreCache();\r\n };\r\n MoveableIndividualGroup.prototype.getRect = function () {\r\n return __assign(__assign({}, _super.prototype.getRect.call(this)), { children: this.moveables.map(function (child) { return child.getRect(); }) });\r\n };\r\n MoveableIndividualGroup.prototype.request = function (ableName, param, isInstant) {\r\n if (param === void 0) { param = {}; }\r\n var results = this.moveables.map(function (m) { return m.request(ableName, __assign(__assign({}, param), { isInstant: false }), false); });\r\n var requestInstant = isInstant || param.isInstant;\r\n var requester = {\r\n request: function (ableParam) {\r\n results.forEach(function (r) { return r.request(ableParam); });\r\n return this;\r\n },\r\n requestEnd: function () {\r\n results.forEach(function (r) { return r.requestEnd(); });\r\n return this;\r\n },\r\n };\r\n return requestInstant ? requester.request(param).requestEnd() : requester;\r\n };\r\n MoveableIndividualGroup.prototype.dragStart = function (e) {\r\n var inputTarget = e.target;\r\n var childMoveable = find(this.moveables, function (child) {\r\n var target = child.getTargets()[0];\r\n var controlBoxElement = child.getControlBoxElement();\r\n var dragElement = child.getDragElement();\r\n if (!target || !dragElement) {\r\n return false;\r\n }\r\n return dragElement === inputTarget || dragElement.contains(inputTarget)\r\n || (dragElement !== target && target === inputTarget || target.contains(inputTarget))\r\n || controlBoxElement === inputTarget || controlBoxElement.contains(inputTarget);\r\n });\r\n if (childMoveable) {\r\n childMoveable.dragStart(e);\r\n }\r\n return this;\r\n };\r\n MoveableIndividualGroup.prototype.hitTest = function () {\r\n return 0;\r\n };\r\n MoveableIndividualGroup.prototype.isInside = function () {\r\n return false;\r\n };\r\n MoveableIndividualGroup.prototype.isDragging = function () {\r\n return false;\r\n };\r\n MoveableIndividualGroup.prototype.getDragElement = function () {\r\n return null;\r\n };\r\n MoveableIndividualGroup.prototype.getMoveables = function () {\r\n return __spreadArray([], __read(this.moveables), false);\r\n };\r\n MoveableIndividualGroup.prototype.updateRenderPoses = function () { };\r\n MoveableIndividualGroup.prototype.checkUpdate = function () { };\r\n MoveableIndividualGroup.prototype.triggerEvent = function () { };\r\n MoveableIndividualGroup.prototype.updateAbles = function () { };\r\n MoveableIndividualGroup.prototype._updateEvents = function () { };\r\n MoveableIndividualGroup.prototype._updateObserver = function () { };\r\n return MoveableIndividualGroup;\r\n}(MoveableManager));\n\nfunction getElementTargets(refTargets, selectorMap) {\r\n var elementTargets = [];\r\n refTargets.forEach(function (target) {\r\n if (!target) {\r\n return;\r\n }\r\n if (isString(target)) {\r\n if (selectorMap[target]) {\r\n elementTargets.push.apply(elementTargets, __spreadArray([], __read(selectorMap[target]), false));\r\n }\r\n return;\r\n }\r\n if (isArray(target)) {\r\n elementTargets.push.apply(elementTargets, __spreadArray([], __read(getElementTargets(target, selectorMap)), false));\r\n }\r\n else {\r\n elementTargets.push(target);\r\n }\r\n });\r\n return elementTargets;\r\n}\r\nfunction getTargetGroups(refTargets, selectorMap) {\r\n var targetGroups = [];\r\n refTargets.forEach(function (target) {\r\n if (!target) {\r\n return;\r\n }\r\n if (isString(target)) {\r\n if (selectorMap[target]) {\r\n targetGroups.push.apply(targetGroups, __spreadArray([], __read(selectorMap[target]), false));\r\n }\r\n return;\r\n }\r\n if (isArray(target)) {\r\n targetGroups.push(getTargetGroups(target, selectorMap));\r\n }\r\n else {\r\n targetGroups.push(target);\r\n }\r\n });\r\n return targetGroups;\r\n}\r\nfunction compareRefTargets(prevRefTargets, nextRefTargets) {\r\n return (prevRefTargets.length !== nextRefTargets.length) || prevRefTargets.some(function (target, i) {\r\n var nextTarget = nextRefTargets[i];\r\n if (!target && !nextTarget) {\r\n return false;\r\n }\r\n else if (target != nextTarget) {\r\n if (isArray(target) && isArray(nextTarget)) {\r\n return compareRefTargets(target, nextTarget);\r\n }\r\n return true;\r\n }\r\n return false;\r\n });\r\n}\r\nvar InitialMoveable = /*#__PURE__*/ (function (_super) {\r\n __extends(InitialMoveable, _super);\r\n function InitialMoveable() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.refTargets = [];\r\n _this.selectorMap = {};\r\n _this._differ = new ChildrenDiffer();\r\n _this._elementTargets = [];\r\n _this._tmpRefTargets = [];\r\n _this._tmpSelectorMap = {};\r\n _this._onChangeTargets = null;\r\n return _this;\r\n }\r\n InitialMoveable.makeStyled = function () {\r\n var cssMap = {};\r\n var ables = this.getTotalAbles();\r\n ables.forEach(function (_a) {\r\n var css = _a.css;\r\n if (!css) {\r\n return;\r\n }\r\n css.forEach(function (text) {\r\n cssMap[text] = true;\r\n });\r\n });\r\n var style = getKeys(cssMap).join(\"\\n\");\r\n this.defaultStyled = styled(\"div\", prefixCSS(PREFIX, MOVEABLE_CSS + style));\r\n };\r\n InitialMoveable.getTotalAbles = function () {\r\n return __spreadArray([Default, Groupable, IndividualGroupable, DragArea], __read(this.defaultAbles), false);\r\n };\r\n InitialMoveable.prototype.render = function () {\r\n var _a;\r\n var moveableContructor = this.constructor;\r\n if (!moveableContructor.defaultStyled) {\r\n moveableContructor.makeStyled();\r\n }\r\n var _b = this.props, userAbles = _b.ables, userProps = _b.props, props = __rest(_b, [\"ables\", \"props\"]);\r\n var _c = __read(this._updateRefs(true), 2), refTargets = _c[0], nextSelectorMap = _c[1];\r\n var elementTargets = getElementTargets(refTargets, nextSelectorMap);\r\n var isGroup = elementTargets.length > 1;\r\n var totalAbles = moveableContructor.getTotalAbles();\r\n var ables = __spreadArray(__spreadArray([], __read(totalAbles), false), __read((userAbles || [])), false);\r\n var nextProps = __assign(__assign(__assign({}, props), (userProps || {})), { ables: ables, cssStyled: moveableContructor.defaultStyled, customStyledMap: moveableContructor.customStyledMap });\r\n this._elementTargets = elementTargets;\r\n var firstRenderState = null;\r\n var prevMoveable = this.moveable;\r\n var persistData = props.persistData;\r\n if (persistData === null || persistData === void 0 ? void 0 : persistData.children) {\r\n isGroup = true;\r\n }\r\n // Even one child is treated as a group if individualGroupable is enabled. #867\r\n if (props.individualGroupable) {\r\n return React.createElement(MoveableIndividualGroup, __assign({ key: \"individual-group\", ref: ref(this, \"moveable\") }, nextProps, { target: null, targets: elementTargets }));\r\n }\r\n if (isGroup) {\r\n var targetGroups = getTargetGroups(refTargets, nextSelectorMap);\r\n // manager\r\n if (prevMoveable && !prevMoveable.props.groupable && !prevMoveable.props.individualGroupable) {\r\n var target = prevMoveable.props.target;\r\n if (target && elementTargets.indexOf(target) > -1) {\r\n firstRenderState = __assign({}, prevMoveable.state);\r\n }\r\n }\r\n return React.createElement(MoveableGroup, __assign({ key: \"group\", ref: ref(this, \"moveable\") }, nextProps, (_a = props.groupableProps) !== null && _a !== void 0 ? _a : {}, { target: null, targets: elementTargets, targetGroups: targetGroups, firstRenderState: firstRenderState }));\r\n }\r\n else {\r\n var target_1 = elementTargets[0];\r\n // manager\r\n if (prevMoveable && (prevMoveable.props.groupable || prevMoveable.props.individualGroupable)) {\r\n var moveables = prevMoveable.moveables || [];\r\n var prevTargetMoveable = find(moveables, function (mv) { return mv.props.target === target_1; });\r\n if (prevTargetMoveable) {\r\n firstRenderState = __assign({}, prevTargetMoveable.state);\r\n }\r\n }\r\n return React.createElement(MoveableManager, __assign({ key: \"single\", ref: ref(this, \"moveable\") }, nextProps, { target: target_1, firstRenderState: firstRenderState }));\r\n }\r\n };\r\n InitialMoveable.prototype.componentDidMount = function () {\r\n this._checkChangeTargets();\r\n };\r\n InitialMoveable.prototype.componentDidUpdate = function () {\r\n this._checkChangeTargets();\r\n };\r\n InitialMoveable.prototype.componentWillUnmount = function () {\r\n this.selectorMap = {};\r\n this.refTargets = [];\r\n };\r\n /**\r\n * Get targets set in moveable through target or targets of props.\r\n * @method Moveable#getTargets\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [targetRef, \".target\", document.querySelectorAll(\".target\")],\r\n * });\r\n *\r\n * console.log(moveable.getTargets());\r\n */\r\n InitialMoveable.prototype.getTargets = function () {\r\n var _a, _b;\r\n return (_b = (_a = this.moveable) === null || _a === void 0 ? void 0 : _a.getTargets()) !== null && _b !== void 0 ? _b : [];\r\n };\r\n /**\r\n * If the element list corresponding to the selector among the targets is changed, it is updated.\r\n * @method Moveable#updateSelectors\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: \".target\",\r\n * });\r\n *\r\n * moveable.updateSelectors();\r\n */\r\n InitialMoveable.prototype.updateSelectors = function () {\r\n this.selectorMap = {};\r\n this._updateRefs();\r\n };\r\n /**\r\n * User changes target and waits for target to change.\r\n * @method Moveable#waitToChangeTarget\r\n * @story combination-with-other-components--components-selecto\r\n * @example\r\n * document.querySelector(\".target\").addEventListener(\"mousedown\", e => {\r\n * moveable.waitToChangeTarget().then(() => {\r\n * moveable.dragStart(e.currentTarget);\r\n * });\r\n * moveable.target = e.currentTarget;\r\n * });\r\n */\r\n InitialMoveable.prototype.waitToChangeTarget = function () {\r\n // let resolvePromise: (e: OnChangeTarget) => void;\r\n var _this = this;\r\n // this._onChangeTargets = () => {\r\n // this._onChangeTargets = null;\r\n // resolvePromise({\r\n // moveable: this.getManager(),\r\n // targets: this._elementTargets,\r\n // });\r\n // };\r\n // return new Promise(resolve => {\r\n // resolvePromise = resolve;\r\n // });\r\n var resolvePromise;\r\n this._onChangeTargets = function () {\r\n _this._onChangeTargets = null;\r\n resolvePromise();\r\n };\r\n return new Promise(function (resolve) {\r\n resolvePromise = resolve;\r\n });\r\n };\r\n InitialMoveable.prototype.waitToChangeTargets = function () {\r\n return this.waitToChangeTarget();\r\n };\r\n InitialMoveable.prototype.getManager = function () {\r\n return this.moveable;\r\n };\r\n InitialMoveable.prototype.getMoveables = function () {\r\n return this.moveable.getMoveables();\r\n };\r\n InitialMoveable.prototype.getDragElement = function () {\r\n return this.moveable.getDragElement();\r\n };\r\n InitialMoveable.prototype._updateRefs = function (isRender) {\r\n var prevRefTargets = this.refTargets;\r\n var nextRefTargets = getRefTargets((this.props.target || this.props.targets));\r\n var isBrowser = typeof document !== \"undefined\";\r\n var isUpdate = compareRefTargets(prevRefTargets, nextRefTargets);\r\n var selectorMap = this.selectorMap;\r\n var nextSelectorMap = {};\r\n this.refTargets.forEach(function updateSelectorMap(target) {\r\n if (isString(target)) {\r\n var selectorTarget = selectorMap[target];\r\n if (selectorTarget) {\r\n nextSelectorMap[target] = selectorMap[target];\r\n }\r\n else if (isBrowser) {\r\n isUpdate = true;\r\n nextSelectorMap[target] = [].slice.call(document.querySelectorAll(target));\r\n }\r\n }\r\n else if (isArray(target)) {\r\n target.forEach(updateSelectorMap);\r\n }\r\n });\r\n this._tmpRefTargets = nextRefTargets;\r\n this._tmpSelectorMap = nextSelectorMap;\r\n return [\r\n nextRefTargets,\r\n nextSelectorMap,\r\n !isRender && isUpdate,\r\n ];\r\n };\r\n InitialMoveable.prototype._checkChangeTargets = function () {\r\n var _a, _b, _c;\r\n this.refTargets = this._tmpRefTargets;\r\n this.selectorMap = this._tmpSelectorMap;\r\n var _d = this._differ.update(this._elementTargets), added = _d.added, removed = _d.removed;\r\n var isTargetChanged = added.length || removed.length;\r\n if (isTargetChanged) {\r\n (_b = (_a = this.props).onChangeTargets) === null || _b === void 0 ? void 0 : _b.call(_a, {\r\n moveable: this.moveable,\r\n targets: this._elementTargets,\r\n });\r\n (_c = this._onChangeTargets) === null || _c === void 0 ? void 0 : _c.call(this);\r\n }\r\n var _e = __read(this._updateRefs(), 3), refTargets = _e[0], selectorMap = _e[1], isUpdate = _e[2];\r\n this.refTargets = refTargets;\r\n this.selectorMap = selectorMap;\r\n if (isUpdate) {\r\n this.forceUpdate();\r\n }\r\n };\r\n InitialMoveable.defaultAbles = [];\r\n InitialMoveable.customStyledMap = {};\r\n InitialMoveable.defaultStyled = null;\r\n __decorate([\r\n withMethods(MOVEABLE_METHODS)\r\n ], InitialMoveable.prototype, \"moveable\", void 0);\r\n return InitialMoveable;\r\n}(React.PureComponent));\n\nvar Moveable = /*#__PURE__*/ (function (_super) {\r\n __extends(Moveable, _super);\r\n function Moveable() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Moveable.defaultAbles = MOVEABLE_ABLES;\r\n return Moveable;\r\n}(InitialMoveable));\n\nfunction makeMoveable(ables) {\r\n var _a;\r\n return _a = /*#__PURE__*/ (function (_super) {\r\n __extends(Moveable, _super);\r\n function Moveable() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return Moveable;\r\n }(InitialMoveable)),\r\n _a.defaultAbles = ables,\r\n _a;\r\n}\n\nexport { Clippable, DIRECTIONS, Draggable, edgeDraggable as EdgeDraggable, InitialMoveable, MOVEABLE_ABLES, MOVEABLE_EVENTS, MOVEABLE_METHODS, MOVEABLE_PROPS, Pinchable, Resizable, Rotatable, Roundable, Scalable, Snappable, Warpable, calculateElementPosition, Moveable as default, getElementInfo, makeAble, makeMoveable };\n//# sourceMappingURL=moveable.esm.js.map\n","import * as React from \"react\";\nimport Moveable from \"react-moveable\";\nimport { ref } from \"framework-utils\";\n\nexport default class InnerMoveable extends React.Component {\n public state: any = {};\n public moveable!: Moveable;\n constructor(props: any) {\n super(props);\n this.state = this.props;\n }\n public render(): React.ReactNode {\n return ;\n }\n}\n","import {\n MOVEABLE_PROPS,\n MOVEABLE_METHODS,\n MOVEABLE_EVENTS,\n} from \"react-moveable\";\n\nexport const PROPERTIES: string[] = MOVEABLE_PROPS;\nexport const METHODS: string[] = MOVEABLE_METHODS;\nexport const EVENTS: string[] = MOVEABLE_EVENTS;\n","import { ref, Properties } from \"framework-utils\";\nimport * as React from \"react\";\nimport { renderSelf, ContainerProvider } from \"croact\";\nimport InnerMoveable from \"./InnerMoveable\";\nimport {\n MoveableInterface,\n MoveableOptions, MoveableProperties,\n} from \"react-moveable/types\";\nimport { camelize, getDocument, isArray } from \"@daybrush/utils\";\nimport { MoveableEventsParameters } from \"./types\";\nimport { PROPERTIES, EVENTS, METHODS } from \"./consts\";\nimport EventEmitter from \"@scena/event-emitter\";\n/**\n * Moveable is Draggable! Resizable! Scalable! Rotatable!\n * @sort 1\n * @alias Moveable\n * @extends EventEmitter\n */\n@Properties(METHODS, (prototype, property) => {\n if (prototype[property]) {\n return;\n }\n prototype[property] = function(...args: any[]) {\n const self = this.getMoveable();\n\n if (!self || !self[property]) {\n return;\n }\n return self[property](...args);\n };\n})\n@Properties(PROPERTIES, (prototype, property) => {\n Object.defineProperty(prototype, property, {\n get() {\n return this.getMoveable().props[property];\n },\n set(value) {\n this.setState({\n [property]: value,\n });\n },\n enumerable: true,\n configurable: true,\n });\n})\nclass MoveableManager extends EventEmitter {\n private innerMoveable!: InnerMoveable | null;\n private containerProvider: ContainerProvider | null = null;\n private selfElement: HTMLElement | null = null;\n private _warp = false;\n /**\n *\n */\n constructor(parentElement: HTMLElement, options: MoveableOptions = {}) {\n super();\n const nextOptions = { ...options };\n\n const events: any = {};\n\n EVENTS.forEach(name => {\n events[camelize(`on ${name}`)] = (e: any) => this.trigger(name, e);\n });\n let selfElement!: HTMLElement;\n\n if (options.warpSelf) {\n delete options.warpSelf;\n this._warp = true;\n selfElement = parentElement;\n } else {\n selfElement = getDocument(parentElement).createElement(\"div\");\n parentElement.appendChild(selfElement);\n }\n this.containerProvider = renderSelf(\n as any,\n selfElement,\n );\n\n this.selfElement = selfElement;\n const target = nextOptions.target!;\n if (isArray(target) && target.length > 1) {\n this.updateRect();\n }\n }\n public setState(state: Partial, callback?: () => any) {\n this.innerMoveable!.setState(state, callback);\n }\n public forceUpdate(callback?: () => any) {\n this.innerMoveable!.forceUpdate(callback);\n }\n public dragStart(e: MouseEvent | TouchEvent) {\n const innerMoveable = this.innerMoveable;\n if ((innerMoveable as any).$_timer) {\n this.forceUpdate();\n }\n this.getMoveable().dragStart(e);\n }\n public destroy() {\n const selfElement = this.selfElement!;\n\n renderSelf(\n null,\n selfElement!,\n this.containerProvider,\n );\n if (!this._warp) {\n selfElement?.parentElement?.removeChild(selfElement);\n }\n this.containerProvider = null;\n\n this.off();\n this.selfElement = null;\n this.innerMoveable = null;\n }\n private getMoveable() {\n return this.innerMoveable!.moveable;\n }\n}\n\ninterface MoveableManager extends MoveableInterface, MoveableProperties {\n}\n\nexport default MoveableManager;\n","import MoveableManager from \"./MoveableManager\";\n\nexport default class Moveable extends MoveableManager {}\n","import { Able, DefaultProps } from \"react-moveable/types\";\nimport { getElementInfo as getElementInfoFunction, makeAble as makeAbleFunction } from \"react-moveable\";\n\nexport function getElementInfo(\n target: SVGElement | HTMLElement,\n container?: SVGElement | HTMLElement | null,\n rootContainer?: SVGElement | HTMLElement | null | undefined,\n) {\n return getElementInfoFunction(target, container, rootContainer);\n};\nexport function makeAble<\n Name extends string,\n AbleObject extends Partial>,\n>(name: Name, able: AbleObject) {\n return makeAbleFunction(name, able);\n}\n","import Moveable, * as modules from \"./index\";\n\nfor (const name in modules) {\n (Moveable as any)[name] = (modules as any)[name];\n}\n\nexport default Moveable;\n"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","constructor","create","__assign","assign","t","s","i","n","arguments","length","apply","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","__decorate","decorators","target","key","desc","c","r","getOwnPropertyDescriptor","Reflect","decorate","defineProperty","__values","o","Symbol","iterator","m","next","value","done","__read","ar","push","error","__spreadArray","to","from","pack","l","slice","concat","makeAble","name","able","events","props","DIRECTIONS4","DIRECTIONS","getSVGCursor","scale","degree","getCursorCSS","x1","degree45","Math","round","defaultCursor","agent","getAgent","IS_WEBKIT","browser","webkit","IS_WEBKIT605","navi","window","userAgent","navigator","res","exec","toLowerCase","parseFloat","browserName","browserVersion","parseInt","version","IS_CHROME","IS_CHROMIUM","chromium","chromiumVersion","IS_CHROMIUM109","IS_FIREFOX","IS_SAFARI_ABOVE15","webkitVersion","PREFIX","directionCSS","map","dir","top","left","originX","originY","offset","join","MOVEABLE_CSS","NEARBY_POS","FLOAT_POINT_NUM","TINY_NUM","MIN_SCALE","MAX_NUM","pow","MIN_NUM","DIRECTION_REGION_TO_DIRECTION","w","nw","ne","sw","se","DIRECTION_INDEXES","DIRECTION_ROTATIONS","MOVEABLE_METHODS","setCustomDrag","state","delta","isPinch","isConvert","ableName","_a","_b","result","gestos","move","inputEvent","datas","originalDatas","ableDatas","convertDragDist","parentEvent","CustomGesto","prevX","prevY","startX","startY","isDrag","isFlag","draggable","dragStart","client","type","drag","clientX","clientY","isFirstDrag","isPrevDrag","distX","distY","deltaX","deltaY","parentGesto","calculateElementPosition","matrix","origin","width","height","is3d","poses","calculatePoses","y1","_c","x2","y2","_d","x3","y3","_e","x4","y4","_f","calculatePosition","min","right","max","bottom","sx","sy","direction","sign","pos1","pos2","pos3","pos4","calculatePointerDist","moveable","moveableClientRect","rootMatrix","minus","calculateInversePosition","posX","posY","getDragDist","setDragStart","allMatrix","beforeMatrix","offsetMatrix","targetMatrix","transformOrigin","inverseMatrix","invert","inverseBeforeMatrix","absoluteOrigin","convertPositionMatrix","plus","startDragBeforeDist","calculate","startDragDist","getTransformDirection","beforeTransform","resolveTransformEvent","event","functionName","beforeRenderable","index","transformIndex","nextTransforms","nextTransformAppendedIndexes","nextIndex","findIndex","text","match","find","info","filter","convertTransformInfo","targetFunction","matFunctionName","beforeFunctionTexts","afterFunctionTexts","beforeFunctionMatrix","beforeTransform2","beforeFunctionMatrix2","targetTansform","targetFunctionMatrix","afterTransform","afterFunctionMatrix","afterTransform2","afterFunctionMatrix2","targetAllTransform","allFunctionMatrix","splice","isAppendTransform","isAppend","convertTransformFormat","dist","getTransformDist","getBeforeDragDist","bx","by","getTransfromMatrix","fromTranslation","isAfter","nextTargetMatrix","multiply","res1","afterTargetMatrix","isBefore","getInverseDragDist","calculateTransformOrigin","prevWidth","prevHeight","prevOrigin","pos","splitUnit","unit","prevSize","size","isNaN","measureRatio","getPosIndexesByDirection","indexes","getPosesByDirection","getPosByDirection","xRatio","yRatio","dot","getDist","startPos","fixedDirection","fixedPos","getNextMatrix","getAbsoluteMatrix","getNextTransformMatrix","transform","isAllTransform","targetTransform","isString","convertDimension","parseMat","scaleMatrix","createScaleMatrix","fillTransformStartEvent","getBeforeRenderableDatas","setTransform","startTransforms","isArray","splitSpace","setTransformIndex","setDefaultTransformIndex","property","func","parse","v","offsetWidth","offsetHeight","startValue","functionValue","fillOriginalTransform","getNextTransforms","getNextTransformText","getNextStyle","nextStyle","fillTransformEvent","nextTransform","Draggable","fillCSSObject","getTranslateFixedPosition","fixedOffset","nextMatrix","nextFixedPosition","getDirectionOffset","getTranslateDist","fixedPosition","groupable","groupLeft","groupTop","getScaleDist","getDirectionByPos","fixedOffsetPosition","getRotateDist","rotateDist","getResizeDist","nextOrigin","getAbsolutePosition","getAbsolutePosesByState","getGestoData","targetGesto","controlGesto","data","getEventData","getShadowRoot","parentElement","getRootNode","rootNode","nodeType","getIndividualTransforms","getStyle","rotate","translate","individualTransforms","split","getMatrixStackInfo","container","checkContainer","el","matrixes","documentElement","getDocumentElement","getDocumentBody","requestEnd","isEnd","targetTransformOrigin","hasFixed","offsetContainer","getOffsetInfo","offsetParent","zoom","getCachedStyle","position","getElementTransform","isFixed","convertCSStoMatrix","getTransformMatrix","isOffsetEnd","isStatic","parentClientLeft","parentClientTop","fixedClientLeft","fixedClientTop","fixedInfo","hasTransform","fixedContainer","getPositionFixedInfo","length_1","convert3DMatrixes","getOffsetPosInfo","tagName","hasOffset","isSVG","origin_1","targetOrigin","offsetPos","offsetLeft","offsetTop","getSVGMatrix","createIdentityMatrix","targetZoom","offsetInfo","offsetZoom","isCustomElement","parentSlotElement","customOffsetParent","customOffsetLeft","customOffsetTop","clientLeft","clientTop","margin","getBodyOffset","isElementTarget","scrollLeft","scrollTop","createOriginMatrix","cacheStyleMap","clientRectStyleMap","matrixContainerInfos","setStoreCache","useCache","Map","getCachedClientRect","clientRect","get","nextClientRect","getClientRect","set","getCachedMatrixContainerInfo","result_1","element","cache","nextStyle_1","getWindow","getComputedStyle","style","cached","fillChildEvents","groupableDatas","childDatas","moveables","_","isRequestChild","triggerChildGesto","isStart","childs","ev","childMoveable","childEvent","childGestos","parentFlag","child","triggerChildAbles","eachEvent","callback","startChildDist","parentDatas","startPositions","createRotateMatrix","rotation","PI","originalX","originalY","renderDirectionControlsByInfos","renderDirections","React","getState","renderPoses","rotationRad","getProps","degRotation","absDegree","directionMap","renderState","renderDirectionMap","forEach","directionSign","classNames","directionRotation","throttle","dataAttrs","getKeys","createElement","className","prefix","getControlTransform","renderDirectionControls","defaultDirections","directions","displayAroundControls","renderAroundControls","renderLine","_i","rad","getRad","getLineStyle","renderEdgeLines","edge","index1","index2","Boolean","getRenderDirections","renderDiagonalDirections","renderAllDirections","checkBoundPoses","bounds","verticalPoses","horizontalPoses","Infinity","nextBounds","vertical","checkBounds","horizontal","getBounds","externalBounds","containerClientRect","containerHeight","clientHeight","containerWidth","clientWidth","snapOffset","snapOffsetLeft","snapOffsetTop","snapOffsetRight","snapOffsetBottom","isCSS","_g","checkBoundKeepRatio","endPos","endX","endY","dx","dy","abs","isBottom","isRight","verticalInfo","isBound","horizontalInfo","a","y","x","isVertical","startBoundPos","endBoundPos","minPos","maxPos","boundInfos","sort","isBoundRotate$1","relativePoses","boundRect","nextPoses","some","boundRotate","vec","boundPos","getDistSize","nextPos","sqrt","checkRotateBounds","prevPoses","relativeLeft","relativeRight","relativeTop","relativeBottom","relativeRad1","relativeRad2","nextRad","VERTICAL_NAMES","HORIZONTAL_NAMES","SNAP_SKIP_NAMES_MAP","VERTICAL_NAMES_MAP","start","end","center","HORIZONTAL_NAMES_MAP","getInitialBounds","hasGuidelines","snappable","innerBounds","verticalGuidelines","horizontalGuidelines","snapGridWidth","snapGridHeight","guidelines","enableSnap","getSnapDirections","snapDirections","mapSnapDirectionPoses","snapPoses","nextSnapDirections","nextSnapPoses","name_1","splitSnapDirectionPoses","horizontalNames","verticalNames","calculateContainerPos","containerRect","clientPos","solveLineConstants","point1","point2","TINY_NUM$1","checkMoveableSnapPoses","posesX","posesY","dirXs","dirYs","customSnapThreshold","snapThreshold","selectValue","checkSnapPoses","checkSnap","checkSnapKeepRatio","getTinyDist","isSnap","verticalSnapInfo","horizontalSnapInfo","posInfos","getNearestSnapGuidelineInfo","isVerticalSnap","verticalGuideline","guideline","isHorizontalSnap","horizontalGuideline","horizontalPos","verticalPos","getStringDirection","stringDirection","checkSnaps","rect","horizontalDirection","verticalDirection","snapInfo","posInfo","guidelineInfo","guidelineInfos","targetType","targetPoses","dirs","posType","snapPosInfos","targetPos","snapPosInfo","getSnapInfosByDirection","snapDirection","arr","nextDir","keepRatio","xs","ys","checkSnapBoundPriority","aDist","bDist","getNearOffsetInfo","offsets","aSign","bSign","aOffset","bOffset","getCheckSnapDirections","endDirection_1","signX","signY","nextDirection","signs","isStartLine","line","cx","average","cy","hitTestLine","test1","test2","isSameStartLine","dots","centerSign","every","checkInnerBoundDot","threshold","checkInnerBound","verticalSign","horizontalSign","lineConstants","isAllBound","isVerticalBound","isHorizontalBound","leftLine","topLine","rightLine","bottomLine","topBoundInfo","checkLineBoundCollision","bottomBoundInfo","leftBoundInfo","rightBoundInfo","isAllVerticalBound","isAllHorizontalBound","verticalOffset","maxOffset","horizontalOffset","boundLine","isRender","dot1","boundDot1","boundDot2","dy2","dx2","hasDx","hasDy","slope","getInnerBoundInfo","lineInfos","multiple","sizeOffset","getInnerBoundDragInfo","lines","getCheckInnerBoundLineInfos","innerBoundInfo","widthOffsetInfo","heightOffsetInfo","getCheckSnapLineDirections","lineDirections","virtualPoses","dir1","dir2","virtualLine","isBoundRotate","boundDots","getDistPointLine","solveReverseLine","checkRotateInnerBounds","dotInfos","lineRad","lineDist","dotDist","dotRad","distRad","acos","nextRad1","nextRad2","reduce","prev","cur","checkInnerBoundPoses","boundMap","getRect","lineInfo","isHorizontalStart","isVerticalStart","solveEquation","solveNextOffset","isOutside","getDist$1","dist1","dist2","widthOffset","heightOffset","getSnapBound","boundInfo","checkThrottleDragRotate","throttleDragRotate","_h","offsetX","offsetY","adjustPoses","adjustPos","prevDistY","checkSnapBoundsDrag","ignoreSnap","getAbsolutePoses","absolutePoses","boundPoses","middle","checkMoveableSnapBounds","verticalSnapBoundInfo","horizontalSnapBoundInfo","verticalInnerBoundInfo","horizontalInnerBoundInfo","horizontalBoundInfos","verticalBoundInfos","horizontalDist","verticalDist","snapIndex","snap","checkSnapBounds","guideines","checkSnapRightLine","snapBoundInfo","rad180","isHorizontalLine","isVerticalLine","getSnapBoundInfo","isRequest","startDirection","endDirection","otherStartPos","otherEndPos","checkSnapBoundsKeepRatio","otherHorizontalOffset","isOtherHorizontalBound","isOtherHorizontalSnap","otherVerticalOffset","isOtherVerticalBound","isOtherVerticalSnap","snapLine","getSnapBoundOffset","horizontalBoundInfo","verticalBoundInfo","checkMaxBounds","maxWidth","maxHeight","left_1","top_1","right_1","bottom_1","otherDirection","isCheckVertical","isCheckHorizontal","otherPos","deg","nextOtherPos","isHeightOutside","isWidthOutside","requestStyle","requestChildStyle","render","hideThrottleDragRotateLine","dragInfo","beforeOrigin","startCheckSnapDrag","prevDist","prevBeforeDist","deltaOffset","params","fillParams","triggerEvent","startRect","useSnap","parentMoveable","throttleDrag","dragRotateRad","startDragRotate","ry","cos","rx","sin","beforeTranslate","throttleArray","beforeDist","beforeDelta","passDelta","passDist","num","dragAfter","dragEnd","param","fillEndParams","dragGroupStart","nextParams","targets","dragGroup","dragGroupEnd","request","isControl","requestStart","unset","getFixedDirectionInfo","getOffsetFixedDirectionInfo","nextFixedOffset","getOffsetFixedPositionInfo","offsetFixedPosition","directionCondition$2","getDirectionCondition","Resizable","ableGroup","canPinch","dragControlCondition","viewClassName","getDirectionViewClassName","dragControlStart","isGroup","parentDirection","parentFixedDirection","getTotalDirection","resizable","startOffsetWidth","startOffsetHeight","minSize","startWidth","inlineCSSWidth","cssWidth","startHeight","inlineCSSHeight","cssHeight","maxSize","minOffsetWidth","minOffsetHeight","maxOffsetWidth","maxOffsetHeight","startOffsetMatrix","startTransformOrigin","isWidth","parentIsWidth","setRatio","ratio","isFinite","setFixedDirection","setFixedPosition","setMin","convertUnitSize","setMax","nextMaxSize","isNumber","startRatio","setOrigin","startFixedDirection","startFixedPosition","isResize","snapRenderInfo","dragControl","parentKeepRatio","dragClient","parentDist","resolveMatrix","targetN","nextAllMatrix","resizeFormat","throttleResize","keepRatioFinally","sizeDirection","distWidth","distHeight","getNextBoundingSize","nextSize","getOffsetSizeDist","nextWidth","nextHeight","boundingWidth","boundingHeight","nextFixedDirection","setSize","snapDist","checkSnapResize","computeSize","isNoSnap","calculateBoundSize","inverseDelta","fillAfterTransform","dragControlAfter","checkResizableError","errorWidth","errorHeight","isErrorWidth","isErrorHeight","dragControlEnd","dragGroupControlCondition","dragGroupControlStart","originalEvents","parentStartOffsetWidth","parentStartOffsetHeight","updateGroupMin","originalMinSize","childMinSize","childStartOffsetWidth","childStartOffsetHeight","parentMinWidth","parentMinHeight","updateGroupMax","originalMaxSize","childMaxSize","parentMaxWidth","parentMaxHeight","dragGroupControl","catchEvent","parentScale","dragGroupControlEnd","deltaWidth","deltaHeight","setRotateStartInfo","startAbsoluteOrigin","prevDeg","defaultDeg","prevSnapDeg","loop","startDist","getAbsoluteDist","normalizedPrevDeg","floor","getAbsoluteDistByClient","getRotateInfo","moveableRect","throttleRotate","snapRotation","checkSnapRotate","snapDeg","getRotationPositions","rotationPosition","radPoses","getRotationRad","isReverse","requestAble","hasClass","rotateAroundControls","rotationTarget","getRefTargets","contains","css","Rotatable","isDragging","rotatable","resolveAblesWithRotatable","positions","jsxs","ables","resolveMap_1","directionControlInfos","resolve","parentRotate","beforeDirection","resizeStart","startClientX","startClientY","externalRotate","beforeInfo","afterInfo","absoluteInfo","inputTarget","regionDirection","getAttribute","controlDirection","isAroundControl","resolveAble","clientPoses","calculateMoveableClientPositions","originalFixedPosition_1","getOrigin","fixedBeforeOrigin","fixedAfterOrigin","posDelta","parentPosition","controlPosition","parentFixedPosition","getTotalOrigin","rotatation","isRotate","clientDistX","clientDistY","groupDelta","targetDirection","beforeRotation","absoluteDelta","absoluteDist","absoluteRotation","startRotation","absoluteStartRotation","nextClientX","nextClientY","setRotation","nextRotation","inverseDist","prevInverseDist","requestValue","dragEvent","transformEvent","parentDistance","resize","undefined","resizeEvent","beforeRotate","absoluteRotate","parentLeft","parentTop","parentBeforeOrigin","childClient","startGroupClient","groupClient","prevClientX","prevClientY","setGroupRotation","distRotate","getRotation","deltaRotate","renderGuideline","isHorizontal","scaleType","renderInnerGuideline","sizeValue","posValue","renderSnapPoses","renderPos","renderGuidelines","targetRect","isDisplayInnerSnapDigit","mainNames","targetStart","targetEnd","hide","elementRect","renderDigitLine","lineType","gap","snapDigit","isDisplaySnapDigit","snapDistFormat","sizeName","absGap","snapSize","toFixed","groupByElementGuidelines","otherIndex","names","groupBy","nextGuidelines","inner","elementRect1","elementRect2","nextPos1","nextPos2","elementDirection","total","renderDashedGuidelines","rendered","groups","sideNames","sidePos","prevRect","nextRect","size1","size2","renderPos1","renderPos2","renderGapGuidelines","targetSideStart","targetSideEnd","gapRects","sideStartPos","sideEndPos","sideCenterPos","getTotalGuidelines","overflow","scrollHeight","scrollWidth","containerClientHeight","containerClientWidth","snapGap","maxSnapElementGuidelineDistance","isDisplayGridGuidelines","elementGuidelines","getElementGuidelines","totalGuidelines","getGapGuidelines","getGridGuidelines","getDefaultGuidelines","checkBetweenRects","maxSnapElementGapDistance","elementRects","gapGuidelines","targetCenter","targetStart2","targetEnd2","nextElementRects","snapRect1","snapRect2","rect1","rect2","rect1Start","rect1End","rect2Start","rect2End","isCenter","distance","prevValues","snapRect","refresh","nextElementGuidelines","isObject","getRefTarget","diff","maintained","added","nextValues","prevIndex","getSnapElementRects","elementSnapDirections","topValue","leftValue","rightValue","bottomValue","centerValue","middleValue","rectTop","rectLeft","sizes","getObjectGuidelines","containerSize","posGuideline","snapWidth","snapHeight","values","offsetDelta","containerLeft","containerTop","getBoundingClientRect","elementLeft","elementTop","elementRight","elementBottom","checkSnapInfo","snapContainer","snapContainerTarget","snapContainerRect","offset1","getDragDistByState","offset2","getNextFixedPoses","nextFixedPos","normalized","getSizeOffsetInfo","innerBoundLineInfos","recheckSizeByTwoDirection","snapPos","nextWidthOffset","nextHeightOffset","checkSizeDist","getNextPoses","isWidthBound","isHeightBound","widthDist","heightDist","isGetWidthOffset","bumpDegree","baseDeg","count","deg1","deg2","getMinDegreeDistance","deg3","snapRotationThreshold","NAME_snapRotationThreshold","snapRotationDegrees","NAME_snapRotationDegrees","origin2_1","rad_1","sorted","firstDegree","checkSnapScale","sizeDist","getSnapGuidelines","addBoundGuidelines","verticalSnapPoses","horizontalSnapPoses","innerBoundMap","verticalInnerBoundPoses","horizontalInnerBoundPoses","innerPos","directionCondition$1","Snappable","dragRelation","targetTop","targetLeft","snapRenderThreshold","watchValue","JSON","stringify","minLeft","minTop","externalPoses","snapInfos","hasExternalPoses","externalRect","verticalPosInfos","horizontalPosInfos","allGuidelines","elements","gaps","nextBoundMap","nextInnerBoundMap","pinchStart","multiply2","prefixNames","defaultSync","fn","multiplies","measureSVGSize","viewBox","getSVGViewBox","ownerSVGElement","getBeforeTransformOrigin","relativeOrigin","getTransformOrigin","getTransformOriginArray","computedTransform","list","baseVal","_loop_1","chr","lastParent","isParent","checkZoom","getTargetStyle","hasSlot","assignedSlotParentElement","assignedSlot","targetPosition","willChange","slotParentNode","parentNode","targetParentNode","host","isUndefined","getSVGGraphicsOffset","getBodyStyle","bodyPosition","marginLeft","marginTop","body","makeMatrixCSS","convertMatrixtoCSS","viewBoxWidth","viewBoxHeight","scaleX","scaleY","preserveAspectRatio","align","meetOrSlice","svgOrigin","xAlign","yAlign","scaleDimension","isGTarget","getBBox","isFillBox","bbox","rectWidth","rectHeight","calculateRect","getSVGOffset","targetInfo","getSize","mat","prevLeft","prevTop","posOrigin","rectOrigin","mat2","nextLeft","nextTop","distLeft","distTop","rootClientRect","rootPoses","getDiagonalSize","self","contentWidth","contentHeight","minWidth","minHeight","svg","targetStyle","boxSizing","borderLeft","borderRight","borderTop","borderBottom","paddingLeft","paddingRight","paddingTop","paddingBottom","horizontalPadding","verticalPadding","horizontalBorder","verticalBorder","getParentStyle","between","resetClientRect","getExtendsRect","isRoot","extendsRect","getClientRectByPosition","base","isExtends","baseTop","baseLeft","convertTransformOriginArray","getDirection","direciton","unsetAbles","unsetGesto","gestoName","gesto","isIdle","resolvedEvent","cssText","decamelize","prevEvent","nextEvent","isBeforeEvent","currentTarget","isTrusted","stopAble","isEventStart","stopDrag","stop","isStartEvent","lastEvent","isDouble","_emitter","on","isManager","pseudoElt","filterAbles","methods","triggerAblesSimultaneously","enabledAbles","ableGroups","method","equals","a1","a2","groupKeys","groupKey","keyIndex","group","groupByMap","flat","args","calculatePadding","xAdded","yAdded","nextAdded","convertCSSSize","isRelative","checkAbles","transforms","matrixInfos","beforeFunctionTexts2","targetFunctionText","afterFunctionTexts2","beforeFunctions","beforeFunctions2","afterFunctions","afterFunctions2","targetFunctions","toMat","isArrayFormat","isNode","isSelector","document","querySelector","isFunction","isWindow","current","userTargets","querySelectorAll","getAbsoluteRotation","calculateMatrixDist","getSizeDistByDist","startSize","standardRad","signSize","startWidthSize","startHeightSize","secondRad","atan2","firstRad","distSize","pinchScale","directionsDists","directionRatios","ratioDistance","dist_1","convertTransformUnit","xy","leftOrigin","rightOrigin","originObject","nextOriginObject","rotatePosesInfo","isDeepArrayEquals","arr1","arr2","value1","value2","isArray1","isArray2","nextValue","valueKey","defaultValue","store","_store","prevValue","countEach","counter","getPaddingBox","padding","Pinchable","angle","pinchable","eventName","controlEventName","pinchAbles","controlAbles","ableEvent","pinch","pinchEnd","pinchGroupStart","pinchGroup","pinchGroupEnd","directionCondition","Scalable","setMinScaleSize","minScaleSize","setMaxScaleSize","maxScaleSize","isScale","throttleScale","tempScaleValue","getNextScale","stateDirection","setScale","nextScale","isSelfPinch","startOffsetSize","scaleSize","distText","scaleText","isZeroScale","scaleEndParam","moveableScale","getMiddleLinePos","getTriangleRad","rad1","rad2","isValidPos","poses1","poses2","pi","Warpable","scalable","warpable","linePosFrom1","linePosFrom2","linePosFrom3","linePosFrom4","linePosTo1","linePosTo2","linePosTo3","linePosTo4","warpTargetMatrix","targetInverseMatrix","ignoreDimension","prevMatrix","posIndexes","isWarp","selectedPoses","nearByPoses","h","createWarpMatrix","afterMatrix","totalMatrix","AREA_PIECES","AREA_PIECE","AVOID","VIEW_DRAGGING","restoreStyle","areaElement","removeClass","renderPieces","DragArea","dragArea","passDragArea","ref","isDragArea","rects","children","nextElementSibling","addClass","disableNativeEvent","enableNativeEvent","requestAnimationFrame","Origin","originStyle","getDefaultScrollPosition","scrollContainer","Scrollable","getContainer","scrollOptions","dragScroll","DragScroll","scrollContainerElement","scrollBy","getCurrentEvent","checkScroll","scrollThreshold","scrollThrottleTime","getScrollPosition","throttleTime","dragGroupControEnd","Default","Padding","paddingDirections","paddingPos1","paddingPos2","paddingPos3","paddingPos4","RADIUS_DIRECTIONS","calculateRatio","sumSize","sumRatio","HORIZONTAL_RADIUS_ORDER","VERTICAL_RADIUS_ORDER","HORIZONTAL_RADIUS_DIRECTIONS","VERTICAL_RADIUS_DIRECTIONS","getRadiusStyles","clipStyles","radiusPoses","virtual","raws","rawPos","styles","getRadiusRange","controlPoses","horizontalRange","verticalRange","clipPose","sub","getRadiusValues","minCounts","full","splitIndex","splitLength","horizontalValues","verticalValues","horizontalValuesLength","verticalValuesLength","hasVerticalValues","nwValue","neValue","seValue","_j","swValue","_k","_l","wnValue","_m","enValue","_o","esValue","_p","wsValue","horizontalRawPoses","verticalRawPoses","nextHorizontalPoses","nextVerticalPoses","raw","removeRadiusPos","startIndex","radiuslIndex","deleteCount","addRadiusPos","horizontalIndex","verticalIndex","radiusX","radiusY","startVerticalIndex","splitRadiusPoses","horizontals","verticals","CLIP_DIRECTIONS","CLIP_RECT_DIRECTIONS","getClipStyles","clipPath","clipRelative","clipType","clipPoses","isRect","isCircle","subWidth","subHeight","getRectPoses","dirx","diry","getControlSize","xRange","yRange","getClipPath","defaultClip","customClip","clipText","splitBracket","clipPrefix","splitter","splitComma","xPos","yPos","minMaxs","getMinMaxs","minX","maxX","minY","maxY","radiusX_1","radiusY_1","radius","xRadius","yRadius","centerPos_1","roundIndex","rectLength","radiusValues","_q","_r","_s","top_2","_t","nextRight","nextBottom","_u","top_3","moveControlPos","dists","verticalDirections","horizontalDirections","verticalDirection_1","horizontalDirection_1","fixedIndex","nextDist","nextControlPoses_1","controlPose","controlDir","dirDir","dirHorizontal","dirVertical","addClipPath","clipIndex","clipStyle","clipEventType","removeClipPath","Clippable","customClipPath","defaultClipPath","clipArea","clipPathState","snapBoundInfos","calculatedPos","controls","isInset","isPolygon","linePoses_1","clipLeft","clipTop","ellipseClipPath","piece","areaPoses","allWidth","allHeight","allLeft_1","allTop_1","directionType","snapPos1","snapPos2","dragWithClip","isDragTarget","isClipStart","isLine","isArea","originalDraggable","originalDist","firstDist","isDragWithTarget","isAll","guidePoses","isEllipse","guideRect","clipHorizontalGuidelines","clipVerticalGuidelines","guideXPoses","guideYPoses","rectPoses","rectDists_1","boundDelta","clipTargetBounds","snapOffsetY","snapOffsetX","distSnapX","distSnapY","width_1","height_1","nextControlPoses_2","j","nextClipStyles","dragDist","OriginDraggable","startOrigin","startTargetOrigin","isDragOrigin","originRelative","distOrigin","dragDelta","deltaOrigin","addBorderRadiusByLine","lineIndex","horizontalsLength","verticalsLength","controlIndex","controlPoseInfo","addBorderRadius","removeBorderRadius","getBorderRadius","borderRadius","triggerRoundEvent","roundRelative","borderRadiusState","getStyleBorderRadius","firstMoveable","firstTarget","getTargets","Roundable","roundClickable","minRoundControls","maxRoundControls","roundPadding","isDisplayShadowRoundControls","verticalCount","horizontalCount","basePos","originalPos","isDisplayVerticalShadow","isDisplay","display","indexAttr","replace","isRound","selectedControlPose","selectedVertical","selectedHorizontal","pose","poseDist","isIdentityMatrix","identityMatrix","BeforeRenderable","inlineTransform","cssMatrix","startTransform","resetStyle","fillDragStartParams","fillDragParams","_this","Renderable","fillDragEndParams","transformObject","matrixInfo","triggerAble","moveableAbles","eventOperations","eventAffix","eventType","requestInstant","requestAble_1","elementFromPoint","isDragStop","isFirstStart","updateRect","gestoType","prevGesto","trigger","conditionName","nextDatas","off","forceEndedCount","updatedCount","eventOperation","eventAbles","results","isUpdate","isForceEnd","preventDefault","isUnmounted","flushSync","forceUpdate","checkMoveableTarget","eventTarget","dragTargetElement","_dragTarget","isMoveableElement","controlBox","getTargetAbleGesto","moveableTarget","dragTarget","dragTargetSelf","getAbleGesto","ableType","conditionFunctions","isTargetAbles","pinchOutside","pinchThreshold","preventClickEventOnDrag","preventClickDefault","checkInput","dragFocusedInput","dragContaienrOption","dragContainer","options","preventRightClick","preventWheelClick","getControlBoxElement","preventClickEventOnDragStart","preventClickEventByCondition","Gesto","isPinchScheduled","stopPropagation","EventManager","_onEvent","addEventListener","setAbles","destroy","removeEventListener","calculateMatrixStack","rootContainer","isAbsolute3d","prevTargetMatrix","containerZoom","rootMatrixes","isRoot3d","offsetRootContainer","rootZoom","isNext3d","isSVGGraphicElement","nextRootMatrixes","reverse","originalRootContainer","endContainer","rootMatrixBeforeOffset","nextInfo","isMatrix3d","originalRootMatrix","hasZoom","calculateElementInfo","allResult","getElementInfo","getMoveableTargetInfo","moveableElement","parentContainer","requestStyles","targetClientRect","rootContainerClientRect","getStyle_1","beforePosition","absoluteTargetPosition","absoluteContainerPosition","containerClientRectLeft","containerClientRectTop","containterClientLeft","containerClientTop","clientDelta","originalBeforeOrigin","getPersistState","isPersisted","MoveableManager","_super","targetAbles","isMoveableMounted","EventEmitter","_prevOriginalDragTarget","_originalDragTarget","_prevDragTarget","_prevPropTarget","_propTarget","_prevDragArea","_isPropTargetChanged","_hasFirstTarget","_reiszeObserver","_observerId","_mutationObserver","_rootContainer","_viewContainer","_viewClassNames","checkUpdateRect","cancelAnimationFrame","_onPreventClick","propsTarget","cspNonce","translateZ","ControlBoxElement","cssStyled","linePadding","controlPadding","_checkUpdateRootContainer","checkUpdate","updateRenderPoses","stateTarget","groupTargets","ableAttributes","getEnabledAbles","ableClassName","_getAbleClassName","isVisible","firstRenderState","persistData","useAccuratePosition","onClick","renderAbles","_renderLines","componentDidMount","_checkUpdateViewContainer","_updateTargets","_updateNativeEvents","_updateEvents","updateCheckInput","_updateObserver","componentDidUpdate","prevProps","componentWillUnmount","disconnect","viewContainer","_changeAbleViewClassNames","manager","getAble","wrapperMoveable","getDragElement","triggerDragStart","hitTest","points","fitPoints","getOverlapSize","totalSize","getAreaSize","isInside","isTarget","isSetState","isSingle","nextState","_getRequestStyles","persistState","name_2","updateState","updateTarget","statePos","getManager","isInstant","allAbles","requsetAble","ableRequester","requester","ableParam","getMoveables","stateLeft","stateTop","stateContainer","updateAbles","isTargetChanged","isChanged","moveableContainer","waitToChangeTarget","Promise","useCSS","tag","customStyleMap","customStyledMap","styled","hasControlBox","updateSelectors","setState","name_3","always","Renderer","styleNames","ableStyleNames","_updateResizeObserver","_updateMutationObserver","controlBoxElement","hasTargetAble","hasControlAble","isUnset","_isTargetChanged","hideDefaultLines","hideChildMoveableDefaultLines","useDragArea","nextTarget","prevTarget","prevDragArea","isDragTargetChanged","isDragAreaChanged","eventKeys","hasAbles","viewContainerOption","_getAbleViewClassNames","nextClassNames","prevClassNames","diff$1","removed","classPrefix","targetGestoData","controlGestoData","trim","win","ResizeObserver","useResizeObserver","observer","observe","box","MutationObserver","useMutationObserver","records","e_1","records_1","records_1_1","mutation","attributeName","e_1_1","return","attributes","defaultProps","isWrapperMounted","warpSelf","Groupable","renderGroupRects","persistDatChildren","getRequestChildStyles","refs","Clickable","containsElement","containsTarget","targetIndex","parentTarget","getDraggableEvent","edgeDraggable","dragCondition","dragGroupCondition","IndividualGroupable","MOVEABLE_ABLES","MOVEABLE_EVENTS","pushSet","MOVEABLE_PROPS","solveConstantsDistance","solveC","getMaxPos","getMinPos","getGroupRect","parentPoses","fixedRotation","a1_1","tan","a2_1","a1MinMax_1","a1MinMaxPos_1","a2MinMax_1","a2MinMaxPos_1","a1Dist","a2Dist","a1MinPos","a1MaxPos","a2MinPos","a2MaxPos","minHorizontalLine","maxHorizontalLine","minVerticalLine","maxVerticalLine","line1","line2","getIntersectionPointsByConstants","minX_1","minY_1","maxX_1","maxY_1","changedX","findMoveableGroups","childTargetGroups","targetGroup","childMoveableGroups","checked","finded","MoveableGroup","differ","ChildrenDiffer","_targetGroups","_hasFirstTargets","checkeds","targetGroups","moveableGroups","useDefaultGroupRotate","isReset","updateGroup","defaultGroupRotate","persistedRoatation","getMoveableGroupRect","parentRotation","posesRotations","rotations","groupRotation","firstRotation","isSameRotation","groupPoses","groupRect","rootGroupRect","defaultGroupOrigin","posesInfo","rotateScale","update","changed","isContainerChanged","MoveableIndividualGroup","canPersist","individualProps","individualGroupableProps","dragElement","getElementTargets","refTargets","selectorMap","elementTargets","getTargetGroups","compareRefTargets","prevRefTargets","nextRefTargets","InitialMoveable","_differ","_elementTargets","_tmpRefTargets","_tmpSelectorMap","_onChangeTargets","makeStyled","cssMap","getTotalAbles","defaultStyled","prefixCSS","defaultAbles","moveableContructor","userAbles","userProps","_updateRefs","nextSelectorMap","totalAbles","nextProps","prevMoveable","individualGroupable","groupableProps","target_1","prevTargetMoveable","mv","_checkChangeTargets","resolvePromise","waitToChangeTargets","isBrowser","updateSelectorMap","selectorTarget","onChangeTargets","withMethods","Moveable","InnerMoveable","PROPERTIES","METHODS","EVENTS","containerProvider","selfElement","_warp","nextOptions","camelize","getDocument","appendChild","renderSelf","innerMoveable","$_timer","getMoveable","removeChild","Properties","enumerable","configurable","getElement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AeusB,QAAf,GAA0B,IAA1B,CAAA;IACH,GAAA;IAxSW,CAAhB,CAAA;IA0SA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IAEA,SAASuC,qBAAT,CAA+B3Z,cAA/B,EAA+C/K,cAA/C,EAA+D;IAC3D,EAAA,IAAI4C,aAAa,GAAGlD,iBAAiB,CAACqL,cAAD,EAAiB/K,cAAjB,CAArC,CAAA;IACA,EAAA,IAAIuC,WAAW,GAAG,CAAC,CAAD,EAAI,CAAJ,CAAlB,CAAA;MACA,OAAO;IACHK,IAAAA,aAAa,EAAEA,aADZ;IAEH5C,IAAAA,cAAc,EAAEA,cAFb;IAGHuC,IAAAA,WAAW,EAAEA,WAAAA;OAHjB,CAAA;IAKH,CAAA;;IACD,SAASoiB,2BAAT,CAAqC/uB,KAArC,EAA4CoK,cAA5C,EAA4D;IACxD;IACA,EAAA,IAAIrF,SAAS,GAAG/E,KAAK,CAAC+E,SAAtB;IAAA,MAAiC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AAkC,IAAlC,CAAA;IACH,GAAA;IAlhBW,CAAhB,CAAA;IAohBA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IAEA;IACA;IACA;IACA;IACA;;IACA,SAAS8F,kBAAT,CAA4BxxB,QAA5B,EAAsC3D,KAAtC,EAA6CiB,OAA7C,EAAsDC,OAAtD,EAA+Doe,IAA/D,EAAqE;IACjE,EAAA,IAAIhT,SAAS,GAAG3I,QAAQ,CAACxI,KAAT,CAAemR,SAA/B,CAAA;IACA,EAAA,IAAIjN,KAAK,GAAGsE,QAAQ,CAACtE,K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A+ZA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IAEA,SAASi7B,eAAT,CAAyB11B,IAAzB,EAA+B+O,KAA/B,EAAsC;IAClC,EAAA,IAAItV,EAAJ,CAAA;;IACA,EAAA,IAAI0D,SAAS,GAAG6C,IAAI,CAAC7C,SAArB;IAAA,MAAgCwS,UAAU,GAAG3P,IAAI,CAAC2P,UAAlD;IAAA,MAA8D/M,IAAI,GAAG5C,IAAI,CAAC4C,IAA1E;IAAA,MAAgFJ,GAAG,GAAGxC,IAAI,CAACwC,GAA3F;IAAA,MAAgGwG,IAAI,GAAGhJ,IAAI,CAACgJ,IAA5G;IAAA,MAAkH7V,GAAG,GAAG6M,IAAI,CAAC7M,GAA7H,CAAA;IACA,EAAA,IAAIwiC,YAAY,GAAGx4B,SAAS,KAAK,YAAjC,CAAA;MACA,IAAIy4B,SAAS,GAAGD,YAAY,GAAG,GAAH,GAAS,GAArC,CAJkC;;IAMlC,EAAA,OAAO5mB,KAAK,CAACiB,aAAN,CAAoB,KAApB,EAA2B;IAC9B7c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V,EAAoB;IACvB,IAAA,IAAItE,KAAK,GAAGsE,QAAQ,CAACtE,KAArB,CAAA;QACAA,KAAK,CAACod,UAAN,GAAmB,KAAnB,CAAA;QACApd,KAAK,CAACmd,UAAN,GAAmB,EAAnB,CAAA;QACAnd,KAAK,CAACkyB,cAAN,GAAuB,IAAvB,CAAA;QACAlyB,KAAK,CAAC+gC,YAAN,GAAqB,EAArB,CAAA;IACH,GAAA;IAvMW,CAAhB,CAAA;IAyMA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IAC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,CAAL,CAAT,EAAkB;IAAE+0B,MAAAA,OAAO,EAAEjqB,QAAQ,CAACxI,KAAT,CAAeyyB,OAAAA;IAA1B,KAAlB,CAAhC,CAAP,CAAA;IACH,GAAA;IAtGiC,CAAd,CAAxB,CAAA;IAwGA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IAEA,IAAIyoB,kBAAkB,GAAG5nB,qBAAqB,CAAC,UAAD,CAA9C,CAAA;IACA;IACA;IACA;IACA;IACA;;IACA,IAAI6nB,QAAQ,GAAG;IACXt7C,EAAAA,IAAI,EAAE,UADK;IAEX2zB,EAAAA,SAAS,EAAE,MAFA;IAGXC,EAAAA,QAAQ,EAAE,IAHC;IAIXzzB,EAAAA,KAAK,EAAE,CACH,UADG,EAEH,eAFG,EAGH,kBAHG,EAIH,WAJG,EAKH,MALG,EAMH,uBANG,CAJI;IAYXD,EAAAA,MAAM,EAAE,CACJ,YADI,EAEJ,aAFI,EAGJ,OAHI,EAIJ,UAJI,EAKJ,iBALI,EAMJ,kBANI,EAOJ,YAPI,EAQJ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;aAHb,CAAA;WAJD;UAUHyB,OAAO,EAAE,UAAUl1B,CAAV,EAAa;YAClBs5B,SAAS,IAAIt5B,CAAC,CAACo8B,UAAf,CAAA;YACA7C,UAAU,IAAIv5B,CAAC,CAACq8B,WAAhB,CAAA;YACA,OAAO;IACHl1B,UAAAA,KAAK,EAAEA,KADJ;IAEH2xB,UAAAA,UAAU,EAAE,CAACQ,SAAD,EAAYC,UAAZ,CAFT;cAGHX,eAAe,EAAE54B,CAAC,CAAC2nB,SAHhB;IAIH8L,UAAAA,OAAO,EAAEA,OAAAA;aAJb,CAAA;WAbD;IAoBH5d,MAAAA,UAAU,EAAE,YAAY;YACpB,OAAO;IAAE1O,UAAAA,KAAK,EAAEA,KAAT;IAAgBU,UAAAA,MAAM,EAAE,IAAxB;IAA8B4rB,UAAAA,OAAO,EAAEA,OAAAA;aAA9C,CAAA;IACH,OAAA;SAtBL,CAAA;IAwBH,GAAA;IArYU,CAAf,CAAA;IAuYA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA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MAGK,IAAIwtD,MAAJ,EAAY;IACb;IACA/B,QAAAA,WAAW,CAAC3gD,QAAD,EAAW9K,CAAX,CAAX,CAAA;IACH,OAAA;IACJ,KAAA;;QACD,OAAOi3C,QAAQ,IAAIpvC,MAAnB,CAAA;OA3ZQ;MA6ZZwtB,KAAK,EAAE,UAAUvqB,QAAV,EAAoB;IACvBA,IAAAA,QAAQ,CAACtE,KAAT,CAAe0lD,aAAf,GAA+B,EAA/B,CAAA;IACAphD,IAAAA,QAAQ,CAACtE,KAAT,CAAe2lD,cAAf,GAAgC,IAAhC,CAAA;IACH,GAAA;IAhaW,CAAhB,CAAA;IAkaA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IAEA;IACA;IACA;IACA;IACA;;IACA,IAAIiD,eAAe,GAAG;IAClBjtD,EAAAA,IAAI,EAAE,iBADY;IAElBG,EAAAA,KAAK,EAAE,CACH,iBADG,EAEH,gBAFG,CAFW;IAMlBD,EAAAA,MAAM,EAAE,CACJ,iBADI,EAEJ,YAFI,EAGJ,eAHI,CANU;MAWlB67B,GAAG,EAAE,CACD,8EADC,CAXa;IAclBlI,EAAAA,oBAAoB,EAAE,UAAUrb,CAAV,EAAa3a,CAAb,EAAgB;QAClC,IAAIA,CAAC,CAAC4wB,SAAN,EAAiB;IACb,MAAA,OAAO5wB,CAAC,CAAC49B,WAAF,KAAkB,iBAAzB,CAAA;IACH,KAAA;;IACD,IAAA,OAAOC,QAAQ,CAAC79B,CAAC,CAACkH,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AAA;IACJ,SAAA;;YACD,OAAO;IAAExB,UAAAA,KAAK,EAAEA,KAAT;IAAgBqB,UAAAA,KAAK,EAAEA,KAAvB;IAA8BC,UAAAA,KAAK,EAAEA,KAArC;IAA4CgnD,UAAAA,UAAU,EAAEA,UAAAA;aAA/D,CAAA;WA5BD;IA8BH55C,MAAAA,UAAU,EAAE,YAAY;YACpB,OAAO;IAAE1O,UAAAA,KAAK,EAAEA,KAAT;IAAgBU,UAAAA,MAAM,EAAE,IAAA;aAA/B,CAAA;IACH,OAAA;SAhCL,CAAA;IAkCH,GAAA;IArLiB,CAAtB,CAAA;IAuLA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IAEA,SAAS+nD,qBAAT,CAA+BnL,YAA/B,EAA6CoL,SAA7C,EAAwDrnD,KAAxD,EAA+DC,KAA/D,EAAsE;IAClE;IACA;IACA;IACA;IACA;MACA,IAAIqnD,iBAAiB,GAAGrL,YAAY,CAACp3C,MAAb,CAAoB,UAAUxG,EAAV,EAAc;IACtD,IAAA,IAAIu9C,OAAO,GAAGv9C,EAAE,CAACu9C,OAAjB;IAAA,QAA0BllC,UAAU,GAAGrY,EAAE,CAACqY,UAA1C,CAAA;QACA,OAAOA,UAAU,IAAI,CAACklC,OAA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;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IAEA,SAAS0B,gBAAT,CAA0BppD,MAA1B,EAAkCI,IAAlC,EAAwC;IACpC,EAAA,IAAIvJ,CAAC,GAAGuJ,IAAI,GAAG,CAAH,GAAO,CAAnB,CAAA;IACA,EAAA,IAAIipD,cAAc,GAAGl6C,oBAAoB,CAACtY,CAAD,CAAzC,CAAA;MACA,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AAAA,UAAU,EAAE,CAlCe;IAmC3BE,IAAAA,SAAS,EAAE,IAnCgB;IAoC3B0E,IAAAA,eAAe,EAAE,EApCU;IAqC3Bx9D,IAAAA,KAAK,EAAE,EArCoB;IAsC3Bo0D,IAAAA,eAAe,EAAE,KAtCU;IAuC3Bb,IAAAA,mBAAmB,EAAE,KAvCM;IAwC3BD,IAAAA,uBAAuB,EAAE,IAxCE;IAyC3BlB,IAAAA,SAAS,EAAEtlB,WAzCgB;IA0C3B6sB,IAAAA,gBAAgB,EAAE,IA1CS;IA2C3BC,IAAAA,WAAW,EAAE,IA3Cc;IA4C3BgB,IAAAA,aAAa,EAAE,IA5CY;IA6C3BvE,IAAAA,aAAa,EAAE,EA7CY;IA8C3BwD,IAAAA,mBAAmB,EAAE,KAAA;OA9CzB,CAAA;IAgDA,EAAA,OAAOzC,eAAP,CAAA;IACH,CAn/BoC,CAm/BnCv9C,aAn/BmC,CAArC,CAAA;IAo/BA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA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Y,EAAE,IAAA;SAVlB,CAAA,CAAA;IAYH,GAbU,CAcU,CAAA,EAAfpT,eAAe,CAAf,CAAA;IA2EN,EAAA,OAACA,eAAD,CAAA;IAAC,CA3ED,CAA8BI,cAA9B,CAAA;;AC3CA,QAAA6R,QAAA,gBAAA,UAAAhS,MAAA,EAAA;IAAsC36D,EAAAA,WAAe,CAAA2sE,QAAA,EAAAhS,MAAA,CAAf,CAAA;;IAAtC,EAAA,SAAAgS,QAAA,GAAA;;IAAwD,GAAA;;IAAD,EAAA,OAACA,QAAD,CAAA;IAAvD,CAAA,CAAsCjS,eAAtC;;aCCgBnB,eACZj4D,QACAgV,WACA4hD,eAA2D;IAE3D,EAAA,OAAO6V,gBAAsB,CAACzsE,MAAD,EAASgV,SAAT,EAAoB4hD,aAApB,CAA7B,CAAA;IACH,CAAA;IACe,SAAAh1D,QAAA,CAGdC,IAHc,EAGFC,IAHE,EAGc;IAC1B,EAAA,OAAO4qE,UAAgB,CAAmB7qE,IAAnB,EAAyBC,IAAzB,CAAvB,CAAA;IACH;;;;;;;;;;;;ICbD,KAAK,IAAM+hB,MAAX,IAAmB8oD,OAAnB,EAA4B;IACvBtB,EAAAA,QAAgB,CAACxnD,MAAD,CAAhB,GAA0B8oD,OAAe,CAAC9oD,MAAD,CAAzC,CAAA;IACJ;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"moveable.js","sources":["../../react-moveable/dist/moveable.esm.js","../src/InnerMoveable.tsx","../src/consts.ts","../src/MoveableManager.tsx","../src/Moveable.tsx","../src/utils.ts","../src/index.umd.ts"],"sourcesContent":["/*\nCopyright (c) 2019 Daybrush\nname: react-moveable\nlicense: MIT\nauthor: Daybrush\nrepository: https://github.com/daybrush/moveable/blob/master/packages/react-moveable\nversion: 0.55.0\n*/\nimport getAgent from '@egjs/agent';\nimport { prefixNames, ref, refs, prefixCSS, withMethods } from 'framework-utils';\nimport { findIndex, find, isArray, splitSpace, splitUnit, dot, isString, getDocumentElement, getDocumentBody, getWindow, throttle, getKeys, getRad, TINY_NUM as TINY_NUM$1, average, getDist as getDist$1, throttleArray, calculateBoundSize, convertUnitSize, isNumber, hasClass, isObject, flat as flat$1, decamelize, isNode, isFunction, isWindow, counter, isUndefined, between, addClass, requestAnimationFrame, removeClass, splitBracket, splitComma, cancelAnimationFrame, pushSet } from '@daybrush/utils';\nimport { minus, invert, convertPositionMatrix, plus, calculate, fromTranslation, multiply, convertDimension, createScaleMatrix, convertCSStoMatrix, createIdentityMatrix, createOriginMatrix, createRotateMatrix, rotate, getOrigin, multiplies, convertMatrixtoCSS, ignoreDimension, createWarpMatrix } from '@scena/matrix';\nimport { parse, parseMat, toMat, calculateMatrixDist } from 'css-to-mat';\nimport ChildrenDiffer, { diff } from '@egjs/children-differ';\nimport DragScroll from '@scena/dragscroll';\nimport { getMinMaxs, fitPoints, getOverlapSize, getAreaSize, isInside, getIntersectionPointsByConstants } from 'overlap-area';\nimport * as React from 'react';\nimport { createElement } from 'react';\nimport Gesto from 'gesto';\nimport { styled } from 'react-css-styled';\nimport EventEmitter from '@scena/event-emitter';\nimport { diff as diff$1 } from '@egjs/list-differ';\n\n/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nfunction __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nfunction __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nfunction __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nfunction __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\n\nfunction makeAble(name, able) {\r\n return __assign({ events: [], props: [], name: name }, able);\r\n}\n\nvar DIRECTIONS4 = [\"n\", \"w\", \"s\", \"e\"];\r\nvar DIRECTIONS = [\"n\", \"w\", \"s\", \"e\", \"nw\", \"ne\", \"sw\", \"se\"];\r\nfunction getSVGCursor(scale, degree) {\r\n return \"data:image/svg+xml;utf8,\");\r\n}\r\nfunction getCursorCSS(degree) {\r\n var x1 = getSVGCursor(1, degree);\r\n // const x2 = getSVGCursor(2, degree);\r\n var degree45 = (Math.round(degree / 45) * 45) % 180;\r\n var defaultCursor = \"ns-resize\";\r\n if (degree45 === 135) {\r\n defaultCursor = \"nwse-resize\";\r\n }\r\n else if (degree45 === 45) {\r\n defaultCursor = \"nesw-resize\";\r\n }\r\n else if (degree45 === 90) {\r\n defaultCursor = \"ew-resize\";\r\n }\r\n // tslint:disable-next-line: max-line-length\r\n return \"cursor:\".concat(defaultCursor, \";cursor: url('\").concat(x1, \"') 16 16, \").concat(defaultCursor, \";\");\r\n}\r\nvar agent = getAgent();\r\nvar IS_WEBKIT = agent.browser.webkit;\r\nvar IS_WEBKIT605 = IS_WEBKIT && (function () {\r\n var navi = typeof window === \"undefined\" ? { userAgent: \"\" } : window.navigator;\r\n var res = /applewebkit\\/([^\\s]+)/g.exec(navi.userAgent.toLowerCase());\r\n return res ? parseFloat(res[1]) < 605 : false;\r\n})();\r\nvar browserName = agent.browser.name;\r\nvar browserVersion = parseInt(agent.browser.version, 10);\r\nvar IS_CHROME = browserName === \"chrome\";\r\nvar IS_CHROMIUM = agent.browser.chromium;\r\nvar chromiumVersion = parseInt(agent.browser.chromiumVersion, 10) || 0;\r\nvar IS_CHROMIUM109 = (IS_CHROME && browserVersion >= 109)\r\n || (IS_CHROMIUM && chromiumVersion >= 109);\r\nvar IS_FIREFOX = browserName === \"firefox\";\r\nvar IS_SAFARI_ABOVE15 = parseInt(agent.browser.webkitVersion, 10) >= 612\r\n || browserVersion >= 15;\r\nvar PREFIX = \"moveable-\";\r\nvar directionCSS = DIRECTIONS.map(function (dir) {\r\n var top = \"\";\r\n var left = \"\";\r\n var originX = \"center\";\r\n var originY = \"center\";\r\n var offset = \"calc(var(--moveable-control-padding, 20) * -1px)\";\r\n if (dir.indexOf(\"n\") > -1) {\r\n top = \"top: \".concat(offset, \";\");\r\n originY = \"bottom\";\r\n }\r\n if (dir.indexOf(\"s\") > -1) {\r\n top = \"top: 0px;\";\r\n originY = \"top\";\r\n }\r\n if (dir.indexOf(\"w\") > -1) {\r\n left = \"left: \".concat(offset, \";\");\r\n originX = \"right\";\r\n }\r\n if (dir.indexOf(\"e\") > -1) {\r\n left = \"left: 0px;\";\r\n originX = \"left\";\r\n }\r\n return \".around-control[data-direction*=\\\"\".concat(dir, \"\\\"] {\\n \").concat(left).concat(top, \"\\n transform-origin: \").concat(originX, \" \").concat(originY, \";\\n }\");\r\n}).join(\"\\n\");\r\nvar MOVEABLE_CSS = \"\\n{\\nposition: absolute;\\nwidth: 1px;\\nheight: 1px;\\nleft: 0;\\ntop: 0;\\nz-index: 3000;\\n--moveable-color: #4af;\\n--zoom: 1;\\n--zoompx: 1px;\\n--moveable-line-padding: 0;\\n--moveable-control-padding: 0;\\nwill-change: transform;\\noutline: 1px solid transparent;\\n}\\n.control-box {\\nz-index: 0;\\n}\\n.line, .control {\\nposition: absolute;\\nleft: 0;\\ntop: 0;\\nwill-change: transform;\\n}\\n.control {\\nwidth: 14px;\\nheight: 14px;\\nborder-radius: 50%;\\nborder: 2px solid #fff;\\nbox-sizing: border-box;\\nbackground: #4af;\\nbackground: var(--moveable-color);\\nmargin-top: -7px;\\nmargin-left: -7px;\\nborder: 2px solid #fff;\\nz-index: 10;\\n}\\n.around-control {\\nposition: absolute;\\nwill-change: transform;\\nwidth: calc(var(--moveable-control-padding, 20) * 1px);\\nheight: calc(var(--moveable-control-padding, 20) * 1px);\\nleft: calc(var(--moveable-control-padding, 20) * -0.5px);\\ntop: calc(var(--moveable-control-padding, 20) * -0.5px);\\nbox-sizing: border-box;\\nbackground: transparent;\\nz-index: 8;\\ncursor: alias;\\ntransform-origin: center center;\\n}\\n\".concat(directionCSS, \"\\n.padding {\\nposition: absolute;\\ntop: 0px;\\nleft: 0px;\\nwidth: 100px;\\nheight: 100px;\\ntransform-origin: 0 0;\\n}\\n.line {\\nwidth: 1px;\\nheight: 1px;\\nbackground: #4af;\\nbackground: var(--moveable-color);\\ntransform-origin: 0px 50%;\\n}\\n.line.edge {\\nz-index: 1;\\nbackground: transparent;\\n}\\n.line.dashed {\\nbox-sizing: border-box;\\nbackground: transparent;\\n}\\n.line.dashed.horizontal {\\nborder-top: 1px dashed #4af;\\nborder-top-color: #4af;\\nborder-top-color: var(--moveable-color);\\n}\\n.line.dashed.vertical {\\nborder-left: 1px dashed #4af;\\nborder-left-color: #4af;\\nborder-left-color: var(--moveable-color);\\n}\\n.line.vertical {\\ntransform: translateX(-50%);\\n}\\n.line.horizontal {\\ntransform: translateY(-50%);\\n}\\n.line.vertical.bold {\\nwidth: 2px;\\n}\\n.line.horizontal.bold {\\nheight: 2px;\\n}\\n\\n.control.origin {\\nborder-color: #f55;\\nbackground: #fff;\\nwidth: 12px;\\nheight: 12px;\\nmargin-top: -6px;\\nmargin-left: -6px;\\npointer-events: none;\\n}\\n\").concat([0, 15, 30, 45, 60, 75, 90, 105, 120, 135, 150, 165].map(function (degree) { return \"\\n.direction[data-rotation=\\\"\".concat(degree, \"\\\"], :global .view-control-rotation\").concat(degree, \" {\\n\").concat(getCursorCSS(degree), \"\\n}\\n\"); }).join(\"\\n\"), \"\\n\\n.line.direction:before {\\ncontent: \\\"\\\";\\nposition: absolute;\\nwidth: 100%;\\nheight: calc(var(--moveable-line-padding, 0) * 1px);\\nbottom: 0;\\nleft: 0;\\n}\\n.group {\\nz-index: -1;\\n}\\n.area {\\nposition: absolute;\\n}\\n.area-pieces {\\nposition: absolute;\\ntop: 0;\\nleft: 0;\\ndisplay: none;\\n}\\n.area.avoid, .area.pass {\\npointer-events: none;\\n}\\n.area.avoid+.area-pieces {\\ndisplay: block;\\n}\\n.area-piece {\\nposition: absolute;\\n}\\n\\n\").concat(IS_WEBKIT605 ? \":global svg *:before {\\ncontent:\\\"\\\";\\ntransform-origin: inherit;\\n}\" : \"\", \"\\n\");\r\nvar NEARBY_POS = [\r\n [0, 1, 2],\r\n [1, 0, 3],\r\n [2, 0, 3],\r\n [3, 1, 2],\r\n];\r\nvar FLOAT_POINT_NUM = 0.0001;\r\nvar TINY_NUM = 0.0000001;\r\nvar MIN_SCALE = 0.000000001;\r\nvar MAX_NUM = Math.pow(10, 10);\r\nvar MIN_NUM = -MAX_NUM;\r\nvar DIRECTION_REGION_TO_DIRECTION = {\r\n n: [0, -1],\r\n e: [1, 0],\r\n s: [0, 1],\r\n w: [-1, 0],\r\n nw: [-1, -1],\r\n ne: [1, -1],\r\n sw: [-1, 1],\r\n se: [1, 1],\r\n};\r\nvar DIRECTION_INDEXES = {\r\n n: [0, 1],\r\n e: [1, 3],\r\n s: [3, 2],\r\n w: [2, 0],\r\n nw: [0],\r\n ne: [1],\r\n sw: [2],\r\n se: [3],\r\n};\r\nvar DIRECTION_ROTATIONS = {\r\n n: 0,\r\n s: 180,\r\n w: 270,\r\n e: 90,\r\n nw: 315,\r\n ne: 45,\r\n sw: 225,\r\n se: 135,\r\n};\r\nvar MOVEABLE_METHODS = [\r\n \"isMoveableElement\",\r\n \"updateRect\",\r\n \"updateTarget\",\r\n \"destroy\",\r\n \"dragStart\",\r\n \"isInside\",\r\n \"hitTest\",\r\n \"setState\",\r\n \"getRect\",\r\n \"request\",\r\n \"isDragging\",\r\n \"getManager\",\r\n \"forceUpdate\",\r\n \"waitToChangeTarget\",\r\n \"updateSelectors\",\r\n \"getTargets\",\r\n \"stopDrag\",\r\n \"getControlBoxElement\",\r\n \"getMoveables\",\r\n \"getDragElement\",\r\n];\n\nfunction setCustomDrag(e, state, delta, isPinch, isConvert, ableName) {\r\n var _a, _b;\r\n if (ableName === void 0) { ableName = \"draggable\"; }\r\n var result = (_b = (_a = state.gestos[ableName]) === null || _a === void 0 ? void 0 : _a.move(delta, e.inputEvent)) !== null && _b !== void 0 ? _b : {};\r\n var datas = result.originalDatas || result.datas;\r\n var ableDatas = datas[ableName] || (datas[ableName] = {});\r\n return __assign(__assign({}, (isConvert ? convertDragDist(state, result) : result)), { isPinch: !!isPinch, parentEvent: true, datas: ableDatas, originalDatas: e.originalDatas });\r\n}\r\nvar CustomGesto = /*#__PURE__*/ (function () {\r\n function CustomGesto(ableName) {\r\n var _a;\r\n if (ableName === void 0) { ableName = \"draggable\"; }\r\n this.ableName = ableName;\r\n this.prevX = 0;\r\n this.prevY = 0;\r\n this.startX = 0;\r\n this.startY = 0;\r\n this.isDrag = false;\r\n this.isFlag = false;\r\n this.datas = {\r\n draggable: {},\r\n };\r\n this.datas = (_a = {},\r\n _a[ableName] = {},\r\n _a);\r\n }\r\n CustomGesto.prototype.dragStart = function (client, e) {\r\n this.isDrag = false;\r\n this.isFlag = false;\r\n var originalDatas = e.originalDatas;\r\n this.datas = originalDatas;\r\n if (!originalDatas[this.ableName]) {\r\n originalDatas[this.ableName] = {};\r\n }\r\n return __assign(__assign({}, this.move(client, e.inputEvent)), { type: \"dragstart\" });\r\n };\r\n CustomGesto.prototype.drag = function (client, inputEvent) {\r\n return this.move([\r\n client[0] - this.prevX,\r\n client[1] - this.prevY,\r\n ], inputEvent);\r\n };\r\n CustomGesto.prototype.move = function (delta, inputEvent) {\r\n var clientX;\r\n var clientY;\r\n var isFirstDrag = false;\r\n if (!this.isFlag) {\r\n this.prevX = delta[0];\r\n this.prevY = delta[1];\r\n this.startX = delta[0];\r\n this.startY = delta[1];\r\n clientX = delta[0];\r\n clientY = delta[1];\r\n this.isFlag = true;\r\n }\r\n else {\r\n var isPrevDrag = this.isDrag;\r\n clientX = this.prevX + delta[0];\r\n clientY = this.prevY + delta[1];\r\n if (delta[0] || delta[1]) {\r\n this.isDrag = true;\r\n }\r\n if (!isPrevDrag && this.isDrag) {\r\n isFirstDrag = true;\r\n }\r\n }\r\n this.prevX = clientX;\r\n this.prevY = clientY;\r\n return {\r\n type: \"drag\",\r\n clientX: clientX,\r\n clientY: clientY,\r\n inputEvent: inputEvent,\r\n isFirstDrag: isFirstDrag,\r\n isDrag: this.isDrag,\r\n distX: clientX - this.startX,\r\n distY: clientY - this.startY,\r\n deltaX: delta[0],\r\n deltaY: delta[1],\r\n datas: this.datas[this.ableName],\r\n originalDatas: this.datas,\r\n parentEvent: true,\r\n parentGesto: this,\r\n };\r\n };\r\n return CustomGesto;\r\n}());\n\nfunction calculateElementPosition(matrix, origin, width, height) {\r\n var is3d = matrix.length === 16;\r\n var n = is3d ? 4 : 3;\r\n var poses = calculatePoses(matrix, width, height, n);\r\n var _a = __read(poses, 4), _b = __read(_a[0], 2), x1 = _b[0], y1 = _b[1], _c = __read(_a[1], 2), x2 = _c[0], y2 = _c[1], _d = __read(_a[2], 2), x3 = _d[0], y3 = _d[1], _e = __read(_a[3], 2), x4 = _e[0], y4 = _e[1];\r\n var _f = __read(calculatePosition(matrix, origin, n), 2), originX = _f[0], originY = _f[1];\r\n var left = Math.min(x1, x2, x3, x4);\r\n var top = Math.min(y1, y2, y3, y4);\r\n var right = Math.max(x1, x2, x3, x4);\r\n var bottom = Math.max(y1, y2, y3, y4);\r\n x1 = (x1 - left) || 0;\r\n x2 = (x2 - left) || 0;\r\n x3 = (x3 - left) || 0;\r\n x4 = (x4 - left) || 0;\r\n y1 = (y1 - top) || 0;\r\n y2 = (y2 - top) || 0;\r\n y3 = (y3 - top) || 0;\r\n y4 = (y4 - top) || 0;\r\n originX = (originX - left) || 0;\r\n originY = (originY - top) || 0;\r\n var sx = matrix[0];\r\n var sy = matrix[n + 1];\r\n var direction = sign(sx * sy);\r\n return {\r\n left: left,\r\n top: top,\r\n right: right,\r\n bottom: bottom,\r\n origin: [originX, originY],\r\n pos1: [x1, y1],\r\n pos2: [x2, y2],\r\n pos3: [x3, y3],\r\n pos4: [x4, y4],\r\n direction: direction,\r\n };\r\n}\n\nfunction calculatePointerDist(moveable, e) {\r\n var clientX = e.clientX, clientY = e.clientY, datas = e.datas;\r\n var _a = moveable.state, moveableClientRect = _a.moveableClientRect, rootMatrix = _a.rootMatrix, is3d = _a.is3d, pos1 = _a.pos1;\r\n var left = moveableClientRect.left, top = moveableClientRect.top;\r\n var n = is3d ? 4 : 3;\r\n var _b = __read(minus(calculateInversePosition(rootMatrix, [clientX - left, clientY - top], n), pos1), 2), posX = _b[0], posY = _b[1];\r\n var _c = __read(getDragDist({ datas: datas, distX: posX, distY: posY }), 2), distX = _c[0], distY = _c[1];\r\n return [distX, distY];\r\n}\r\nfunction setDragStart(moveable, _a) {\r\n var datas = _a.datas;\r\n var _b = moveable.state, allMatrix = _b.allMatrix, beforeMatrix = _b.beforeMatrix, is3d = _b.is3d, left = _b.left, top = _b.top, origin = _b.origin, offsetMatrix = _b.offsetMatrix, targetMatrix = _b.targetMatrix, transformOrigin = _b.transformOrigin;\r\n var n = is3d ? 4 : 3;\r\n datas.is3d = is3d;\r\n datas.matrix = allMatrix;\r\n datas.targetMatrix = targetMatrix;\r\n datas.beforeMatrix = beforeMatrix;\r\n datas.offsetMatrix = offsetMatrix;\r\n datas.transformOrigin = transformOrigin;\r\n datas.inverseMatrix = invert(allMatrix, n);\r\n datas.inverseBeforeMatrix = invert(beforeMatrix, n);\r\n datas.absoluteOrigin = convertPositionMatrix(plus([left, top], origin), n);\r\n datas.startDragBeforeDist = calculate(datas.inverseBeforeMatrix, datas.absoluteOrigin, n);\r\n datas.startDragDist = calculate(datas.inverseMatrix, datas.absoluteOrigin, n);\r\n}\r\nfunction getTransformDirection(e) {\r\n return calculateElementPosition(e.datas.beforeTransform, [50, 50], 100, 100).direction;\r\n}\r\nfunction resolveTransformEvent(moveable, event, functionName) {\r\n var datas = event.datas, originalDatas = event.originalDatas.beforeRenderable;\r\n var index = datas.transformIndex;\r\n var nextTransforms = originalDatas.nextTransforms;\r\n var length = nextTransforms.length;\r\n var nextTransformAppendedIndexes = originalDatas.nextTransformAppendedIndexes;\r\n var nextIndex = -1;\r\n if (index === -1) {\r\n // translate => rotate => scale\r\n if (functionName === \"translate\") {\r\n nextIndex = 0;\r\n }\r\n else if (functionName === \"rotate\") {\r\n nextIndex = findIndex(nextTransforms, function (text) { return text.match(/scale\\(/g); });\r\n }\r\n if (nextIndex === -1) {\r\n nextIndex = nextTransforms.length;\r\n }\r\n datas.transformIndex = nextIndex;\r\n }\r\n else if (find(nextTransformAppendedIndexes, function (info) { return info.index === index && info.functionName === functionName; })) {\r\n nextIndex = index;\r\n }\r\n else {\r\n nextIndex = index + nextTransformAppendedIndexes.filter(function (info) { return info.index < index; }).length;\r\n }\r\n var result = convertTransformInfo(nextTransforms, moveable.state, nextIndex);\r\n var targetFunction = result.targetFunction;\r\n var matFunctionName = functionName === \"rotate\" ? \"rotateZ\" : functionName;\r\n datas.beforeFunctionTexts = result.beforeFunctionTexts;\r\n datas.afterFunctionTexts = result.afterFunctionTexts;\r\n datas.beforeTransform = result.beforeFunctionMatrix;\r\n datas.beforeTransform2 = result.beforeFunctionMatrix2;\r\n datas.targetTansform = result.targetFunctionMatrix;\r\n datas.afterTransform = result.afterFunctionMatrix;\r\n datas.afterTransform2 = result.afterFunctionMatrix2;\r\n datas.targetAllTransform = result.allFunctionMatrix;\r\n if (targetFunction.functionName === matFunctionName) {\r\n datas.afterFunctionTexts.splice(0, 1);\r\n datas.isAppendTransform = false;\r\n }\r\n else if (length > nextIndex) {\r\n datas.isAppendTransform = true;\r\n originalDatas.nextTransformAppendedIndexes = __spreadArray(__spreadArray([], __read(nextTransformAppendedIndexes), false), [{\r\n functionName: functionName,\r\n index: nextIndex,\r\n isAppend: true,\r\n }], false);\r\n }\r\n}\r\nfunction convertTransformFormat(datas, value, dist) {\r\n return \"\".concat(datas.beforeFunctionTexts.join(\" \"), \" \").concat(datas.isAppendTransform ? dist : value, \" \").concat(datas.afterFunctionTexts.join(\" \"));\r\n}\r\nfunction getTransformDist(_a) {\r\n var datas = _a.datas, distX = _a.distX, distY = _a.distY;\r\n var _b = __read(getBeforeDragDist({ datas: datas, distX: distX, distY: distY }), 2), bx = _b[0], by = _b[1];\r\n // B * [tx, ty] * A = [bx, by] * targetMatrix;\r\n // [tx, ty] = B-1 * [bx, by] * targetMatrix * A-1 * [0, 0];\r\n var res = getTransfromMatrix(datas, fromTranslation([bx, by], 4));\r\n return calculate(res, convertPositionMatrix([0, 0, 0], 4), 4);\r\n}\r\nfunction getTransfromMatrix(datas, targetMatrix, isAfter) {\r\n var beforeTransform = datas.beforeTransform, afterTransform = datas.afterTransform, beforeTransform2 = datas.beforeTransform2, afterTransform2 = datas.afterTransform2, targetAllTransform = datas.targetAllTransform;\r\n // B * afterTargetMatrix * A = (targetMatrix * targetAllTransform)\r\n // afterTargetMatrix = B-1 * targetMatrix * targetAllTransform * A-1\r\n // nextTargetMatrix = (targetMatrix * targetAllTransform)\r\n var nextTargetMatrix = isAfter\r\n ? multiply(targetAllTransform, targetMatrix, 4)\r\n : multiply(targetMatrix, targetAllTransform, 4);\r\n // res1 = B-1 * nextTargetMatrix\r\n var res1 = multiply(invert(isAfter ? beforeTransform2 : beforeTransform, 4), nextTargetMatrix, 4);\r\n // res3 = res2 * A-1\r\n var afterTargetMatrix = multiply(res1, invert(isAfter ? afterTransform2 : afterTransform, 4), 4);\r\n return afterTargetMatrix;\r\n}\r\nfunction getBeforeDragDist(_a) {\r\n var datas = _a.datas, distX = _a.distX, distY = _a.distY;\r\n // TT = BT\r\n var inverseBeforeMatrix = datas.inverseBeforeMatrix, is3d = datas.is3d, startDragBeforeDist = datas.startDragBeforeDist, absoluteOrigin = datas.absoluteOrigin;\r\n var n = is3d ? 4 : 3;\r\n // ABS_ORIGIN * [distX, distY] = BM * (ORIGIN + [tx, ty])\r\n // BM -1 * ABS_ORIGIN * [distX, distY] - ORIGIN = [tx, ty]\r\n return minus(calculate(inverseBeforeMatrix, plus(absoluteOrigin, [distX, distY]), n), startDragBeforeDist);\r\n}\r\nfunction getDragDist(_a, isBefore) {\r\n var datas = _a.datas, distX = _a.distX, distY = _a.distY;\r\n var inverseBeforeMatrix = datas.inverseBeforeMatrix, inverseMatrix = datas.inverseMatrix, is3d = datas.is3d, startDragBeforeDist = datas.startDragBeforeDist, startDragDist = datas.startDragDist, absoluteOrigin = datas.absoluteOrigin;\r\n var n = is3d ? 4 : 3;\r\n return minus(calculate(isBefore ? inverseBeforeMatrix : inverseMatrix, plus(absoluteOrigin, [distX, distY]), n), isBefore ? startDragBeforeDist : startDragDist);\r\n}\r\nfunction getInverseDragDist(_a, isBefore) {\r\n var datas = _a.datas, distX = _a.distX, distY = _a.distY;\r\n var beforeMatrix = datas.beforeMatrix, matrix = datas.matrix, is3d = datas.is3d, startDragBeforeDist = datas.startDragBeforeDist, startDragDist = datas.startDragDist, absoluteOrigin = datas.absoluteOrigin;\r\n var n = is3d ? 4 : 3;\r\n return minus(calculate(isBefore ? beforeMatrix : matrix, plus(isBefore ? startDragBeforeDist : startDragDist, [distX, distY]), n), absoluteOrigin);\r\n}\r\nfunction calculateTransformOrigin(transformOrigin, width, height, prevWidth, prevHeight, prevOrigin) {\r\n if (prevWidth === void 0) { prevWidth = width; }\r\n if (prevHeight === void 0) { prevHeight = height; }\r\n if (prevOrigin === void 0) { prevOrigin = [0, 0]; }\r\n if (!transformOrigin) {\r\n return prevOrigin;\r\n }\r\n return transformOrigin.map(function (pos, i) {\r\n var _a = splitUnit(pos), value = _a.value, unit = _a.unit;\r\n var prevSize = (i ? prevHeight : prevWidth);\r\n var size = (i ? height : width);\r\n if (pos === \"%\" || isNaN(value)) {\r\n // no value but %\r\n var measureRatio = prevSize ? prevOrigin[i] / prevSize : 0;\r\n return size * measureRatio;\r\n }\r\n else if (unit !== \"%\") {\r\n return value;\r\n }\r\n return size * value / 100;\r\n });\r\n}\r\nfunction getPosIndexesByDirection(direction) {\r\n var indexes = [];\r\n if (direction[1] >= 0) {\r\n if (direction[0] >= 0) {\r\n indexes.push(3);\r\n }\r\n if (direction[0] <= 0) {\r\n indexes.push(2);\r\n }\r\n }\r\n if (direction[1] <= 0) {\r\n if (direction[0] >= 0) {\r\n indexes.push(1);\r\n }\r\n if (direction[0] <= 0) {\r\n indexes.push(0);\r\n }\r\n }\r\n return indexes;\r\n}\r\nfunction getPosesByDirection(poses, direction) {\r\n /*\r\n [-1, -1](pos1) [0, -1](pos1,pos2) [1, -1](pos2)\r\n [-1, 0](pos1, pos3) [1, 0](pos2, pos4)\r\n [-1, 1](pos3) [0, 1](pos3, pos4) [1, 1](pos4)\r\n */\r\n return getPosIndexesByDirection(direction).map(function (index) { return poses[index]; });\r\n}\r\nfunction getPosBySingleDirection(poses, direction) {\r\n var ratio = (direction + 1) / 2;\r\n return [\r\n dot(poses[0][0], poses[1][0], ratio, 1 - ratio),\r\n dot(poses[0][1], poses[1][1], ratio, 1 - ratio),\r\n ];\r\n}\r\nfunction getPosByDirection(poses, direction) {\r\n var top = getPosBySingleDirection([poses[0], poses[1]], direction[0]);\r\n var bottom = getPosBySingleDirection([poses[2], poses[3]], direction[0]);\r\n return getPosBySingleDirection([top, bottom], direction[1]);\r\n}\r\nfunction getDist(startPos, matrix, width, height, n, fixedDirection) {\r\n var poses = calculatePoses(matrix, width, height, n);\r\n var fixedPos = getPosByDirection(poses, fixedDirection);\r\n var distX = startPos[0] - fixedPos[0];\r\n var distY = startPos[1] - fixedPos[1];\r\n return [distX, distY];\r\n}\r\nfunction getNextMatrix(offsetMatrix, targetMatrix, origin, n) {\r\n return multiply(offsetMatrix, getAbsoluteMatrix(targetMatrix, n, origin), n);\r\n}\r\nfunction getNextTransformMatrix(state, datas, transform, isAllTransform) {\r\n var transformOrigin = state.transformOrigin, offsetMatrix = state.offsetMatrix, is3d = state.is3d;\r\n var n = is3d ? 4 : 3;\r\n var targetTransform;\r\n if (isString(transform)) {\r\n var beforeTransform = datas.beforeTransform, afterTransform = datas.afterTransform;\r\n if (isAllTransform) {\r\n targetTransform = convertDimension(parseMat(transform), 4, n);\r\n }\r\n else {\r\n targetTransform = convertDimension(multiply(multiply(beforeTransform, parseMat([transform]), 4), afterTransform, 4), 4, n);\r\n }\r\n }\r\n else {\r\n targetTransform = transform;\r\n }\r\n return getNextMatrix(offsetMatrix, targetTransform, transformOrigin, n);\r\n}\r\nfunction scaleMatrix(state, scale) {\r\n var transformOrigin = state.transformOrigin, offsetMatrix = state.offsetMatrix, is3d = state.is3d, targetMatrix = state.targetMatrix, targetAllTransform = state.targetAllTransform;\r\n var n = is3d ? 4 : 3;\r\n return getNextMatrix(offsetMatrix, multiply(targetAllTransform || targetMatrix, createScaleMatrix(scale, n), n), transformOrigin, n);\r\n}\r\nfunction fillTransformStartEvent(moveable, e) {\r\n var originalDatas = getBeforeRenderableDatas(e);\r\n return {\r\n setTransform: function (transform, index) {\r\n if (index === void 0) { index = -1; }\r\n originalDatas.startTransforms = isArray(transform) ? transform : splitSpace(transform);\r\n setTransformIndex(moveable, e, index);\r\n },\r\n setTransformIndex: function (index) {\r\n setTransformIndex(moveable, e, index);\r\n },\r\n };\r\n}\r\nfunction setDefaultTransformIndex(moveable, e, property) {\r\n var originalDatas = getBeforeRenderableDatas(e);\r\n var startTransforms = originalDatas.startTransforms;\r\n setTransformIndex(moveable, e, findIndex(startTransforms, function (func) { return func.indexOf(\"\".concat(property, \"(\")) === 0; }));\r\n}\r\nfunction setTransformIndex(moveable, e, index) {\r\n var originalDatas = getBeforeRenderableDatas(e);\r\n var datas = e.datas;\r\n datas.transformIndex = index;\r\n if (index === -1) {\r\n return;\r\n }\r\n var transform = originalDatas.startTransforms[index];\r\n if (!transform) {\r\n return;\r\n }\r\n var state = moveable.state;\r\n var info = parse([transform], {\r\n \"x%\": function (v) { return v / 100 * state.offsetWidth; },\r\n \"y%\": function (v) { return v / 100 * state.offsetHeight; },\r\n });\r\n datas.startValue = info[0].functionValue;\r\n}\r\nfunction fillOriginalTransform(e, transform) {\r\n var originalDatas = getBeforeRenderableDatas(e);\r\n originalDatas.nextTransforms = splitSpace(transform);\r\n // originalDatas.nextTargetMatrix = parseMat(transform);\r\n}\r\nfunction getBeforeRenderableDatas(e) {\r\n return e.originalDatas.beforeRenderable;\r\n}\r\nfunction getNextTransforms(e) {\r\n var originalDatas = e.originalDatas.beforeRenderable;\r\n return originalDatas.nextTransforms;\r\n}\r\nfunction getNextTransformText(e) {\r\n return (getNextTransforms(e) || []).join(\" \");\r\n}\r\nfunction getNextStyle(e) {\r\n return getBeforeRenderableDatas(e).nextStyle;\r\n}\r\nfunction fillTransformEvent(moveable, nextTransform, delta, isPinch, e) {\r\n fillOriginalTransform(e, nextTransform);\r\n var drag = Draggable.drag(moveable, setCustomDrag(e, moveable.state, delta, isPinch, false));\r\n var afterTransform = drag ? drag.transform : nextTransform;\r\n return __assign(__assign({ transform: nextTransform, drag: drag }, fillCSSObject({\r\n transform: afterTransform,\r\n }, e)), { afterTransform: afterTransform });\r\n}\r\nfunction getTranslateFixedPosition(moveable, transform, fixedDirection, fixedOffset, datas, isAllTransform) {\r\n var nextMatrix = getNextTransformMatrix(moveable.state, datas, transform, isAllTransform);\r\n var nextFixedPosition = getDirectionOffset(moveable, fixedDirection, fixedOffset, nextMatrix);\r\n return nextFixedPosition;\r\n}\r\nfunction getTranslateDist(moveable, transform, fixedDirection, fixedPosition, fixedOffset, datas, isAllTransform) {\r\n var nextFixedPosition = getTranslateFixedPosition(moveable, transform, fixedDirection, fixedOffset, datas, isAllTransform);\r\n var state = moveable.state;\r\n var left = state.left, top = state.top;\r\n var groupable = moveable.props.groupable;\r\n var groupLeft = groupable ? left : 0;\r\n var groupTop = groupable ? top : 0;\r\n var dist = minus(fixedPosition, nextFixedPosition);\r\n return minus(dist, [groupLeft, groupTop]);\r\n}\r\nfunction getScaleDist(moveable, transform, fixedDirection, fixedPosition, fixedOffset, datas, isAllTransform) {\r\n var dist = getTranslateDist(moveable, transform, fixedDirection, fixedPosition, fixedOffset, datas, isAllTransform);\r\n return dist;\r\n}\r\nfunction getDirectionByPos(pos, width, height) {\r\n return [\r\n width ? -1 + pos[0] / (width / 2) : 0,\r\n height ? -1 + pos[1] / (height / 2) : 0,\r\n ];\r\n}\r\nfunction getDirectionOffset(moveable, fixedDirection, fixedOffset, nextMatrix) {\r\n if (nextMatrix === void 0) { nextMatrix = moveable.state.allMatrix; }\r\n var _a = moveable.state, width = _a.width, height = _a.height, is3d = _a.is3d;\r\n var n = is3d ? 4 : 3;\r\n var fixedOffsetPosition = [\r\n width / 2 * (1 + fixedDirection[0]) + fixedOffset[0],\r\n height / 2 * (1 + fixedDirection[1]) + fixedOffset[1],\r\n ];\r\n return calculatePosition(nextMatrix, fixedOffsetPosition, n);\r\n}\r\nfunction getRotateDist(moveable, rotateDist, datas) {\r\n var fixedDirection = datas.fixedDirection;\r\n var fixedPosition = datas.fixedPosition;\r\n var fixedOffset = datas.fixedOffset;\r\n return getTranslateDist(moveable, \"rotate(\".concat(rotateDist, \"deg)\"), fixedDirection, fixedPosition, fixedOffset, datas);\r\n}\r\nfunction getResizeDist(moveable, width, height, fixedPosition, transformOrigin, datas) {\r\n var groupable = moveable.props.groupable;\r\n var state = moveable.state;\r\n var prevOrigin = state.transformOrigin, offsetMatrix = state.offsetMatrix, is3d = state.is3d, prevWidth = state.width, prevHeight = state.height, left = state.left, top = state.top;\r\n var fixedDirection = datas.fixedDirection;\r\n var targetMatrix = datas.nextTargetMatrix || state.targetMatrix;\r\n var n = is3d ? 4 : 3;\r\n var nextOrigin = calculateTransformOrigin(transformOrigin, width, height, prevWidth, prevHeight, prevOrigin);\r\n var groupLeft = groupable ? left : 0;\r\n var groupTop = groupable ? top : 0;\r\n var nextMatrix = getNextMatrix(offsetMatrix, targetMatrix, nextOrigin, n);\r\n var dist = getDist(fixedPosition, nextMatrix, width, height, n, fixedDirection);\r\n return minus(dist, [groupLeft, groupTop]);\r\n}\r\nfunction getAbsolutePosition(moveable, direction) {\r\n return getPosByDirection(getAbsolutePosesByState(moveable.state), direction);\r\n}\n\nfunction getGestoData(moveable, ableName) {\r\n var targetGesto = moveable.targetGesto;\r\n var controlGesto = moveable.controlGesto;\r\n var data;\r\n if (targetGesto === null || targetGesto === void 0 ? void 0 : targetGesto.isFlag()) {\r\n data = targetGesto.getEventData()[ableName];\r\n }\r\n if (!data && (controlGesto === null || controlGesto === void 0 ? void 0 : controlGesto.isFlag())) {\r\n data = controlGesto.getEventData()[ableName];\r\n }\r\n return data || {};\r\n}\n\nfunction getShadowRoot(parentElement) {\r\n if (parentElement && parentElement.getRootNode) {\r\n var rootNode = parentElement.getRootNode();\r\n if (rootNode.nodeType === 11) {\r\n return rootNode;\r\n }\r\n }\r\n return;\r\n}\r\nfunction getIndividualTransforms(getStyle) {\r\n var scale = getStyle(\"scale\");\r\n var rotate = getStyle(\"rotate\");\r\n var translate = getStyle(\"translate\");\r\n var individualTransforms = [];\r\n if (translate && translate !== \"0px\" && translate !== \"none\") {\r\n individualTransforms.push(\"translate(\".concat(translate.split(/\\s+/).join(\",\"), \")\"));\r\n }\r\n if (rotate && rotate !== \"1\" && rotate !== \"none\") {\r\n individualTransforms.push(\"rotate(\".concat(rotate, \")\"));\r\n }\r\n if (scale && scale !== \"1\" && scale !== \"none\") {\r\n individualTransforms.push(\"scale(\".concat(scale.split(/\\s+/).join(\",\"), \")\"));\r\n }\r\n return individualTransforms;\r\n}\r\nfunction getMatrixStackInfo(target, container, checkContainer) {\r\n var el = target;\r\n var matrixes = [];\r\n var documentElement = getDocumentElement(target) || getDocumentBody(target);\r\n var requestEnd = !checkContainer && target === container || target === documentElement;\r\n var isEnd = requestEnd;\r\n var is3d = false;\r\n var n = 3;\r\n var transformOrigin;\r\n var targetTransformOrigin;\r\n var targetMatrix;\r\n var hasFixed = false;\r\n var offsetContainer = getOffsetInfo(container, container, true).offsetParent;\r\n var zoom = 1;\r\n while (el && !isEnd) {\r\n isEnd = requestEnd;\r\n var getStyle = getCachedStyle(el);\r\n var position = getStyle(\"position\");\r\n var transform = getElementTransform(el);\r\n var isFixed = position === \"fixed\";\r\n var individualTransforms = getIndividualTransforms(getStyle);\r\n var matrix = convertCSStoMatrix(getTransformMatrix(transform));\r\n var offsetParent = void 0;\r\n var isOffsetEnd = false;\r\n var isStatic = false;\r\n var parentClientLeft = 0;\r\n var parentClientTop = 0;\r\n var fixedClientLeft = 0;\r\n var fixedClientTop = 0;\r\n var fixedInfo = {\r\n hasTransform: false,\r\n fixedContainer: null,\r\n };\r\n if (isFixed) {\r\n hasFixed = true;\r\n fixedInfo = getPositionFixedInfo(el);\r\n offsetContainer = fixedInfo.fixedContainer;\r\n }\r\n // convert 3 to 4\r\n var length_1 = matrix.length;\r\n if (!is3d && (length_1 === 16 || individualTransforms.length)) {\r\n is3d = true;\r\n n = 4;\r\n convert3DMatrixes(matrixes);\r\n if (targetMatrix) {\r\n targetMatrix = convertDimension(targetMatrix, 3, 4);\r\n }\r\n }\r\n if (is3d && length_1 === 9) {\r\n matrix = convertDimension(matrix, 3, 4);\r\n }\r\n var _a = getOffsetPosInfo(el, target), tagName = _a.tagName, hasOffset = _a.hasOffset, isSVG = _a.isSVG, origin_1 = _a.origin, targetOrigin = _a.targetOrigin, offsetPos = _a.offset;\r\n var _b = __read(offsetPos, 2), offsetLeft = _b[0], offsetTop = _b[1];\r\n if (tagName === \"svg\" && !target.ownerSVGElement && targetMatrix) {\r\n // scale matrix for svg's SVGElements.\r\n matrixes.push({\r\n type: \"target\",\r\n target: el,\r\n matrix: getSVGMatrix(el, n),\r\n });\r\n matrixes.push({\r\n type: \"offset\",\r\n target: el,\r\n matrix: createIdentityMatrix(n),\r\n });\r\n }\r\n var targetZoom = parseFloat(getStyle(\"zoom\")) || 1;\r\n if (isFixed) {\r\n offsetParent = fixedInfo.fixedContainer;\r\n isOffsetEnd = true;\r\n }\r\n else {\r\n var offsetInfo = getOffsetInfo(el, container, false, true, getStyle);\r\n var offsetZoom = offsetInfo.offsetZoom;\r\n offsetParent = offsetInfo.offsetParent;\r\n isOffsetEnd = offsetInfo.isEnd;\r\n isStatic = offsetInfo.isStatic;\r\n zoom *= offsetZoom;\r\n if ((offsetInfo.isCustomElement || offsetZoom !== 1) && isStatic) {\r\n offsetLeft -= offsetParent.offsetLeft;\r\n offsetTop -= offsetParent.offsetTop;\r\n }\r\n else if (IS_FIREFOX || IS_CHROMIUM109) {\r\n var parentSlotElement = offsetInfo.parentSlotElement;\r\n if (parentSlotElement) {\r\n var customOffsetParent = offsetParent;\r\n var customOffsetLeft = 0;\r\n var customOffsetTop = 0;\r\n while (customOffsetParent) {\r\n if (!getShadowRoot(customOffsetParent)) {\r\n break;\r\n }\r\n customOffsetLeft += customOffsetParent.offsetLeft;\r\n customOffsetTop += customOffsetParent.offsetTop;\r\n customOffsetParent = customOffsetParent.offsetParent;\r\n }\r\n offsetLeft -= customOffsetLeft;\r\n offsetTop -= customOffsetTop;\r\n }\r\n }\r\n }\r\n if (IS_WEBKIT && !IS_SAFARI_ABOVE15\r\n && hasOffset && !isSVG && isStatic\r\n && (position === \"relative\" || position === \"static\")) {\r\n offsetLeft -= offsetParent.offsetLeft;\r\n offsetTop -= offsetParent.offsetTop;\r\n requestEnd = requestEnd || isOffsetEnd;\r\n }\r\n if (isFixed) {\r\n if (hasOffset && fixedInfo.hasTransform) {\r\n // border\r\n fixedClientLeft = offsetParent.clientLeft;\r\n fixedClientTop = offsetParent.clientTop;\r\n }\r\n }\r\n else {\r\n if (hasOffset && offsetContainer !== offsetParent) {\r\n // border\r\n parentClientLeft = offsetParent.clientLeft;\r\n parentClientTop = offsetParent.clientTop;\r\n }\r\n if (hasOffset && offsetParent === documentElement) {\r\n var margin = getBodyOffset(el, false);\r\n offsetLeft += margin[0];\r\n offsetTop += margin[1];\r\n }\r\n }\r\n matrixes.push({\r\n type: \"target\",\r\n target: el,\r\n matrix: getAbsoluteMatrix(matrix, n, origin_1),\r\n });\r\n if (individualTransforms.length) {\r\n matrixes.push({\r\n type: \"offset\",\r\n target: el,\r\n matrix: createIdentityMatrix(n),\r\n });\r\n matrixes.push({\r\n type: \"target\",\r\n target: el,\r\n matrix: getAbsoluteMatrix(parseMat(individualTransforms), n, origin_1),\r\n });\r\n }\r\n if (hasOffset) {\r\n var isElementTarget = el === target;\r\n var scrollLeft = isElementTarget ? 0 : el.scrollLeft;\r\n var scrollTop = isElementTarget ? 0 : el.scrollTop;\r\n matrixes.push({\r\n type: \"offset\",\r\n target: el,\r\n matrix: createOriginMatrix([\r\n offsetLeft - scrollLeft + parentClientLeft - fixedClientLeft,\r\n offsetTop - scrollTop + parentClientTop - fixedClientTop,\r\n ], n),\r\n });\r\n }\r\n else {\r\n // svg\r\n matrixes.push({\r\n type: \"offset\",\r\n target: el,\r\n origin: origin_1,\r\n });\r\n }\r\n // transform으로 계산되지 않는 zoom을 위한 (0, 0) 을 기준 matrix 추가.\r\n if (targetZoom !== 1) {\r\n matrixes.push({\r\n type: \"zoom\",\r\n target: el,\r\n matrix: getAbsoluteMatrix(createScaleMatrix([targetZoom, targetZoom], n), n, [0, 0]),\r\n });\r\n }\r\n if (!targetMatrix) {\r\n targetMatrix = matrix;\r\n }\r\n if (!transformOrigin) {\r\n transformOrigin = origin_1;\r\n }\r\n if (!targetTransformOrigin) {\r\n targetTransformOrigin = targetOrigin;\r\n }\r\n if (isEnd || isFixed) {\r\n break;\r\n }\r\n else {\r\n el = offsetParent;\r\n requestEnd = isOffsetEnd;\r\n }\r\n if (!checkContainer || el === documentElement) {\r\n isEnd = requestEnd;\r\n }\r\n }\r\n if (!targetMatrix) {\r\n targetMatrix = createIdentityMatrix(n);\r\n }\r\n if (!transformOrigin) {\r\n transformOrigin = [0, 0];\r\n }\r\n if (!targetTransformOrigin) {\r\n targetTransformOrigin = [0, 0];\r\n }\r\n return {\r\n zoom: zoom,\r\n offsetContainer: offsetContainer,\r\n matrixes: matrixes,\r\n targetMatrix: targetMatrix,\r\n transformOrigin: transformOrigin,\r\n targetOrigin: targetTransformOrigin,\r\n is3d: is3d,\r\n hasFixed: hasFixed,\r\n };\r\n}\n\nvar cacheStyleMap = null;\r\nvar clientRectStyleMap = null;\r\nvar matrixContainerInfos = null;\r\nfunction setStoreCache(useCache) {\r\n if (useCache) {\r\n if (window.Map) {\r\n cacheStyleMap = new Map();\r\n clientRectStyleMap = new Map();\r\n }\r\n matrixContainerInfos = [];\r\n }\r\n else {\r\n cacheStyleMap = null;\r\n matrixContainerInfos = null;\r\n clientRectStyleMap = null;\r\n }\r\n}\r\nfunction getCachedClientRect(el) {\r\n var clientRect = clientRectStyleMap === null || clientRectStyleMap === void 0 ? void 0 : clientRectStyleMap.get(el);\r\n if (clientRect) {\r\n return clientRect;\r\n }\r\n var nextClientRect = getClientRect(el, true);\r\n if (clientRectStyleMap) {\r\n clientRectStyleMap.set(el, nextClientRect);\r\n }\r\n return nextClientRect;\r\n}\r\nfunction getCachedMatrixContainerInfo(target, container) {\r\n if (matrixContainerInfos) {\r\n var result_1 = find(matrixContainerInfos, function (info) { return info[0][0] == target && info[0][1] == container; });\r\n if (result_1) {\r\n return result_1[1];\r\n }\r\n }\r\n var result = getMatrixStackInfo(target, container, true);\r\n if (matrixContainerInfos) {\r\n matrixContainerInfos.push([[target, container], result]);\r\n }\r\n return result;\r\n}\r\nfunction getCachedStyle(element) {\r\n var cache = cacheStyleMap === null || cacheStyleMap === void 0 ? void 0 : cacheStyleMap.get(element);\r\n if (!cache) {\r\n var nextStyle_1 = getWindow(element).getComputedStyle(element);\r\n if (!cacheStyleMap) {\r\n return function (property) {\r\n return nextStyle_1[property];\r\n };\r\n }\r\n cache = {\r\n style: nextStyle_1,\r\n cached: {},\r\n };\r\n cacheStyleMap.set(element, cache);\r\n }\r\n var cached = cache.cached;\r\n var style = cache.style;\r\n return function (property) {\r\n if (!(property in cached)) {\r\n cached[property] = style[property];\r\n }\r\n return cached[property];\r\n };\r\n}\n\nfunction fillChildEvents(moveable, name, e) {\r\n var datas = e.originalDatas;\r\n datas.groupable = datas.groupable || {};\r\n var groupableDatas = datas.groupable;\r\n groupableDatas.childDatas = groupableDatas.childDatas || [];\r\n var childDatas = groupableDatas.childDatas;\r\n return moveable.moveables.map(function (_, i) {\r\n childDatas[i] = childDatas[i] || {};\r\n childDatas[i][name] = childDatas[i][name] || {};\r\n return __assign(__assign({}, e), { isRequestChild: true, datas: childDatas[i][name], originalDatas: childDatas[i] });\r\n });\r\n}\r\nfunction triggerChildGesto(moveable, able, type, delta, e, isConvert, ableName) {\r\n var isStart = !!type.match(/Start$/g);\r\n var isEnd = !!type.match(/End$/g);\r\n var isPinch = e.isPinch;\r\n var datas = e.datas;\r\n var events = fillChildEvents(moveable, able.name, e);\r\n var moveables = moveable.moveables;\r\n var childEvents = [];\r\n var eventParams = events.map(function (ev, i) {\r\n var childMoveable = moveables[i];\r\n var state = childMoveable.state;\r\n var gestos = state.gestos;\r\n var childEvent = ev;\r\n if (isStart) {\r\n childEvent = new CustomGesto(ableName).dragStart(delta, ev);\r\n childEvents.push(childEvent);\r\n }\r\n else {\r\n if (!gestos[ableName]) {\r\n gestos[ableName] = datas.childGestos[i];\r\n }\r\n if (!gestos[ableName]) {\r\n return;\r\n }\r\n childEvent = setCustomDrag(ev, state, delta, isPinch, isConvert, ableName);\r\n childEvents.push(childEvent);\r\n }\r\n var result = able[type](childMoveable, __assign(__assign({}, childEvent), { parentFlag: true }));\r\n if (isEnd) {\r\n gestos[ableName] = null;\r\n }\r\n return result;\r\n });\r\n if (isStart) {\r\n datas.childGestos = moveables.map(function (child) { return child.state.gestos[ableName]; });\r\n }\r\n return {\r\n eventParams: eventParams,\r\n childEvents: childEvents,\r\n };\r\n}\r\nfunction triggerChildAbles(moveable, able, type, e, eachEvent, callback) {\r\n if (eachEvent === void 0) { eachEvent = function (_, ev) { return ev; }; }\r\n var isEnd = !!type.match(/End$/g);\r\n var events = fillChildEvents(moveable, able.name, e);\r\n var moveables = moveable.moveables;\r\n var childs = events.map(function (ev, i) {\r\n var childMoveable = moveables[i];\r\n var childEvent = ev;\r\n childEvent = eachEvent(childMoveable, ev);\r\n var result = able[type](childMoveable, __assign(__assign({}, childEvent), { parentFlag: true }));\r\n result && callback && callback(childMoveable, ev, result, i);\r\n if (isEnd) {\r\n childMoveable.state.gestos = {};\r\n }\r\n return result;\r\n });\r\n return childs;\r\n}\r\nfunction startChildDist(moveable, child, parentDatas, childEvent) {\r\n var fixedDirection = parentDatas.fixedDirection;\r\n var fixedPosition = parentDatas.fixedPosition;\r\n var startPositions = childEvent.datas.startPositions || getAbsolutePosesByState(child.state);\r\n var pos = getPosByDirection(startPositions, fixedDirection);\r\n var _a = __read(calculate(createRotateMatrix(-moveable.rotation / 180 * Math.PI, 3), [pos[0] - fixedPosition[0], pos[1] - fixedPosition[1], 1], 3), 2), originalX = _a[0], originalY = _a[1];\r\n childEvent.datas.originalX = originalX;\r\n childEvent.datas.originalY = originalY;\r\n return childEvent;\r\n}\n\nfunction renderDirectionControlsByInfos(moveable, ableName, renderDirections, React) {\r\n var _a = moveable.getState(), renderPoses = _a.renderPoses, rotationRad = _a.rotation, direction = _a.direction;\r\n var zoom = getProps(moveable.props, ableName).zoom;\r\n var degRotation = absDegree(rotationRad / Math.PI * 180);\r\n var directionMap = {};\r\n var renderState = moveable.renderState;\r\n if (!renderState.renderDirectionMap) {\r\n renderState.renderDirectionMap = {};\r\n }\r\n var renderDirectionMap = renderState.renderDirectionMap;\r\n renderDirections.forEach(function (_a) {\r\n var dir = _a.dir;\r\n directionMap[dir] = true;\r\n });\r\n var directionSign = sign(direction);\r\n return renderDirections.map(function (_a) {\r\n var data = _a.data, classNames = _a.classNames, dir = _a.dir;\r\n var indexes = DIRECTION_INDEXES[dir];\r\n if (!indexes || !directionMap[dir]) {\r\n return null;\r\n }\r\n renderDirectionMap[dir] = true;\r\n var directionRotation = (throttle(degRotation, 15) + directionSign * DIRECTION_ROTATIONS[dir] + 720) % 180;\r\n var dataAttrs = {};\r\n getKeys(data).forEach(function (name) {\r\n dataAttrs[\"data-\".concat(name)] = data[name];\r\n });\r\n return (React.createElement(\"div\", __assign({ className: prefix.apply(void 0, __spreadArray([\"control\", \"direction\", dir, ableName], __read(classNames), false)), \"data-rotation\": directionRotation, \"data-direction\": dir }, dataAttrs, { key: \"direction-\".concat(dir), style: getControlTransform.apply(void 0, __spreadArray([rotationRad, zoom], __read(indexes.map(function (index) { return renderPoses[index]; })), false)) })));\r\n });\r\n}\r\nfunction renderDirectionControls(moveable, defaultDirections, ableName, React) {\r\n var _a = getProps(moveable.props, ableName), _b = _a.renderDirections, directions = _b === void 0 ? defaultDirections : _b, displayAroundControls = _a.displayAroundControls;\r\n if (!directions) {\r\n return [];\r\n }\r\n var renderDirections = directions === true ? DIRECTIONS : directions;\r\n return __spreadArray(__spreadArray([], __read((displayAroundControls ? renderAroundControls(moveable, React, ableName, renderDirections) : [])), false), __read(renderDirectionControlsByInfos(moveable, ableName, renderDirections.map(function (dir) {\r\n return {\r\n data: {},\r\n classNames: [],\r\n dir: dir,\r\n };\r\n }), React)), false);\r\n}\r\nfunction renderLine(React, direction, pos1, pos2, zoom, key) {\r\n var classNames = [];\r\n for (var _i = 6; _i < arguments.length; _i++) {\r\n classNames[_i - 6] = arguments[_i];\r\n }\r\n var rad = getRad(pos1, pos2);\r\n var rotation = direction ? (throttle(rad / Math.PI * 180, 15)) % 180 : -1;\r\n return React.createElement(\"div\", { key: \"line-\".concat(key), className: prefix.apply(void 0, __spreadArray([\"line\", \"direction\", direction ? \"edge\" : \"\", direction], __read(classNames), false)), \"data-rotation\": rotation, \"data-line-key\": key, \"data-direction\": direction, style: getLineStyle(pos1, pos2, zoom, rad) });\r\n}\r\nfunction renderEdgeLines(React, ableName, edge, poses, zoom) {\r\n var directions = edge === true ? DIRECTIONS4 : edge;\r\n return directions.map(function (direction, i) {\r\n var _a = __read(DIRECTION_INDEXES[direction], 2), index1 = _a[0], index2 = _a[1];\r\n if (index2 == null) {\r\n return;\r\n }\r\n return renderLine(React, direction, poses[index1], poses[index2], zoom, \"\".concat(ableName, \"Edge\").concat(i), ableName);\r\n }).filter(Boolean);\r\n}\r\nfunction getRenderDirections(ableName) {\r\n return function (moveable, React) {\r\n var edge = getProps(moveable.props, ableName).edge;\r\n if (edge && (edge === true || edge.length)) {\r\n return __spreadArray(__spreadArray([], __read(renderEdgeLines(React, ableName, edge, moveable.getState().renderPoses, moveable.props.zoom)), false), __read(renderDiagonalDirections(moveable, ableName, React)), false);\r\n }\r\n return renderAllDirections(moveable, ableName, React);\r\n };\r\n}\r\nfunction renderAllDirections(moveable, ableName, React) {\r\n return renderDirectionControls(moveable, DIRECTIONS, ableName, React);\r\n}\r\nfunction renderDiagonalDirections(moveable, ableName, React) {\r\n return renderDirectionControls(moveable, [\"nw\", \"ne\", \"sw\", \"se\"], ableName, React);\r\n}\r\nfunction renderAroundControls(moveable, React, ableName, renderDirections) {\r\n var renderState = moveable.renderState;\r\n if (!renderState.renderDirectionMap) {\r\n renderState.renderDirectionMap = {};\r\n }\r\n var _a = moveable.getState(), renderPoses = _a.renderPoses, rotationRad = _a.rotation, direction = _a.direction;\r\n var renderDirectionMap = renderState.renderDirectionMap;\r\n var zoom = moveable.props.zoom;\r\n var directionSign = sign(direction);\r\n var degRotation = rotationRad / Math.PI * 180;\r\n return (renderDirections || getKeys(renderDirectionMap)).map(function (dir) {\r\n var indexes = DIRECTION_INDEXES[dir];\r\n if (!indexes) {\r\n return null;\r\n }\r\n var directionRotation = (throttle(degRotation, 15) + directionSign * DIRECTION_ROTATIONS[dir] + 720) % 180;\r\n var classNames = [\"around-control\"];\r\n if (ableName) {\r\n classNames.push(\"direction\", ableName);\r\n }\r\n return (React.createElement(\"div\", { className: prefix.apply(void 0, __spreadArray([], __read(classNames), false)), \"data-rotation\": directionRotation, \"data-direction\": dir, key: \"direction-around-\".concat(dir), style: getControlTransform.apply(void 0, __spreadArray([rotationRad, zoom], __read(indexes.map(function (index) { return renderPoses[index]; })), false)) }));\r\n });\r\n}\n\nfunction checkBoundPoses(bounds, verticalPoses, horizontalPoses) {\r\n var _a = bounds || {}, _b = _a.position, position = _b === void 0 ? \"client\" : _b, _c = _a.left, left = _c === void 0 ? -Infinity : _c, _d = _a.top, top = _d === void 0 ? -Infinity : _d, _e = _a.right, right = _e === void 0 ? Infinity : _e, _f = _a.bottom, bottom = _f === void 0 ? Infinity : _f;\r\n var nextBounds = {\r\n position: position,\r\n left: left,\r\n top: top,\r\n right: right,\r\n bottom: bottom,\r\n };\r\n return {\r\n vertical: checkBounds(nextBounds, verticalPoses, true),\r\n horizontal: checkBounds(nextBounds, horizontalPoses, false),\r\n };\r\n}\r\nfunction getBounds(moveable, externalBounds) {\r\n var _a = moveable.state, _b = _a.containerClientRect, containerHeight = _b.clientHeight, containerWidth = _b.clientWidth, clientLeft = _b.clientLeft, clientTop = _b.clientTop, _c = _a.snapOffset, snapOffsetLeft = _c.left, snapOffsetTop = _c.top, snapOffsetRight = _c.right, snapOffsetBottom = _c.bottom;\r\n var bounds = externalBounds || moveable.props.bounds || {};\r\n var position = bounds.position || \"client\";\r\n var isCSS = position === \"css\";\r\n var _d = bounds.left, left = _d === void 0 ? -Infinity : _d, _e = bounds.top, top = _e === void 0 ? -Infinity : _e;\r\n var _f = bounds.right, right = _f === void 0 ? isCSS ? -Infinity : Infinity : _f, _g = bounds.bottom, bottom = _g === void 0 ? isCSS ? -Infinity : Infinity : _g;\r\n if (isCSS) {\r\n right = containerWidth + snapOffsetRight - snapOffsetLeft - right;\r\n bottom = containerHeight + snapOffsetBottom - snapOffsetTop - bottom;\r\n }\r\n return {\r\n left: left + snapOffsetLeft - clientLeft,\r\n right: right + snapOffsetLeft - clientLeft,\r\n top: top + snapOffsetTop - clientTop,\r\n bottom: bottom + snapOffsetTop - clientTop,\r\n };\r\n}\r\nfunction checkBoundKeepRatio(moveable, startPos, endPos) {\r\n var _a = getBounds(moveable), left = _a.left, top = _a.top, right = _a.right, bottom = _a.bottom;\r\n var _b = __read(endPos, 2), endX = _b[0], endY = _b[1];\r\n var _c = __read(minus(endPos, startPos), 2), dx = _c[0], dy = _c[1];\r\n if (abs(dx) < TINY_NUM) {\r\n dx = 0;\r\n }\r\n if (abs(dy) < TINY_NUM) {\r\n dy = 0;\r\n }\r\n var isBottom = dy > 0;\r\n var isRight = dx > 0;\r\n var verticalInfo = {\r\n isBound: false,\r\n offset: 0,\r\n pos: 0,\r\n };\r\n var horizontalInfo = {\r\n isBound: false,\r\n offset: 0,\r\n pos: 0,\r\n };\r\n if (dx === 0 && dy === 0) {\r\n return {\r\n vertical: verticalInfo,\r\n horizontal: horizontalInfo,\r\n };\r\n }\r\n else if (dx === 0) {\r\n if (isBottom) {\r\n if (bottom < endY) {\r\n horizontalInfo.pos = bottom;\r\n horizontalInfo.offset = endY - bottom;\r\n }\r\n }\r\n else {\r\n if (top > endY) {\r\n horizontalInfo.pos = top;\r\n horizontalInfo.offset = endY - top;\r\n }\r\n }\r\n }\r\n else if (dy === 0) {\r\n if (isRight) {\r\n if (right < endX) {\r\n verticalInfo.pos = right;\r\n verticalInfo.offset = endX - right;\r\n }\r\n }\r\n else {\r\n if (left > endX) {\r\n verticalInfo.pos = left;\r\n verticalInfo.offset = endX - left;\r\n }\r\n }\r\n }\r\n else {\r\n // y - y1 = a * (x - x1)\r\n var a = dy / dx;\r\n var b = endPos[1] - a * endX;\r\n var y = 0;\r\n var x = 0;\r\n var isBound = false;\r\n if (isRight && right <= endX) {\r\n y = a * right + b;\r\n x = right;\r\n isBound = true;\r\n }\r\n else if (!isRight && endX <= left) {\r\n y = a * left + b;\r\n x = left;\r\n isBound = true;\r\n }\r\n if (isBound) {\r\n if (y < top || y > bottom) {\r\n isBound = false;\r\n }\r\n }\r\n if (!isBound) {\r\n if (isBottom && bottom <= endY) {\r\n y = bottom;\r\n x = (y - b) / a;\r\n isBound = true;\r\n }\r\n else if (!isBottom && endY <= top) {\r\n y = top;\r\n x = (y - b) / a;\r\n isBound = true;\r\n }\r\n }\r\n if (isBound) {\r\n verticalInfo.isBound = true;\r\n verticalInfo.pos = x;\r\n verticalInfo.offset = endX - x;\r\n horizontalInfo.isBound = true;\r\n horizontalInfo.pos = y;\r\n horizontalInfo.offset = endY - y;\r\n }\r\n }\r\n return {\r\n vertical: verticalInfo,\r\n horizontal: horizontalInfo,\r\n };\r\n}\r\nfunction checkBounds(bounds, poses, isVertical) {\r\n // 0 [100 - 200] 300\r\n var startBoundPos = bounds[isVertical ? \"left\" : \"top\"];\r\n var endBoundPos = bounds[isVertical ? \"right\" : \"bottom\"];\r\n // 450\r\n var minPos = Math.min.apply(Math, __spreadArray([], __read(poses), false));\r\n var maxPos = Math.max.apply(Math, __spreadArray([], __read(poses), false));\r\n var boundInfos = [];\r\n if (startBoundPos + 1 > minPos) {\r\n boundInfos.push({\r\n direction: \"start\",\r\n isBound: true,\r\n offset: minPos - startBoundPos,\r\n pos: startBoundPos,\r\n });\r\n }\r\n if (endBoundPos - 1 < maxPos) {\r\n boundInfos.push({\r\n direction: \"end\",\r\n isBound: true,\r\n offset: maxPos - endBoundPos,\r\n pos: endBoundPos,\r\n });\r\n }\r\n if (!boundInfos.length) {\r\n boundInfos.push({\r\n isBound: false,\r\n offset: 0,\r\n pos: 0,\r\n });\r\n }\r\n return boundInfos.sort(function (a, b) { return abs(b.offset) - abs(a.offset); });\r\n}\r\nfunction isBoundRotate$1(relativePoses, boundRect, rad) {\r\n var nextPoses = rad ? relativePoses.map(function (pos) { return rotate(pos, rad); }) : relativePoses;\r\n return nextPoses.some(function (pos) {\r\n return (pos[0] < boundRect.left && abs(pos[0] - boundRect.left) > 0.1)\r\n || (pos[0] > boundRect.right && abs(pos[0] - boundRect.right) > 0.1)\r\n || (pos[1] < boundRect.top && abs(pos[1] - boundRect.top) > 0.1)\r\n || (pos[1] > boundRect.bottom && abs(pos[1] - boundRect.bottom) > 0.1);\r\n });\r\n}\r\nfunction boundRotate(vec, boundPos, index) {\r\n var r = getDistSize(vec);\r\n var nextPos = Math.sqrt(r * r - boundPos * boundPos) || 0;\r\n return [nextPos, -nextPos].sort(function (a, b) {\r\n return abs(a - vec[index ? 0 : 1]) - abs(b - vec[index ? 0 : 1]);\r\n }).map(function (pos) {\r\n return getRad([0, 0], index ? [pos, boundPos] : [boundPos, pos]);\r\n });\r\n}\r\nfunction checkRotateBounds(moveable, prevPoses, nextPoses, origin, rotation) {\r\n if (!moveable.props.bounds) {\r\n return [];\r\n }\r\n var rad = rotation * Math.PI / 180;\r\n var _a = getBounds(moveable), left = _a.left, top = _a.top, right = _a.right, bottom = _a.bottom;\r\n var relativeLeft = left - origin[0];\r\n var relativeRight = right - origin[0];\r\n var relativeTop = top - origin[1];\r\n var relativeBottom = bottom - origin[1];\r\n var boundRect = {\r\n left: relativeLeft,\r\n top: relativeTop,\r\n right: relativeRight,\r\n bottom: relativeBottom,\r\n };\r\n if (!isBoundRotate$1(nextPoses, boundRect, 0)) {\r\n return [];\r\n }\r\n var result = [];\r\n [\r\n [relativeLeft, 0],\r\n [relativeRight, 0],\r\n [relativeTop, 1],\r\n [relativeBottom, 1],\r\n ].forEach(function (_a) {\r\n var _b = __read(_a, 2), boundPos = _b[0], index = _b[1];\r\n nextPoses.forEach(function (nextPos) {\r\n var relativeRad1 = getRad([0, 0], nextPos);\r\n result.push.apply(result, __spreadArray([], __read(boundRotate(nextPos, boundPos, index)\r\n .map(function (relativeRad2) { return rad + relativeRad2 - relativeRad1; })\r\n .filter(function (nextRad) { return !isBoundRotate$1(prevPoses, boundRect, nextRad); })\r\n .map(function (nextRad) { return throttle(nextRad * 180 / Math.PI, TINY_NUM); })), false));\r\n });\r\n });\r\n return result;\r\n}\n\nvar VERTICAL_NAMES = [\"left\", \"right\", \"center\"];\r\nvar HORIZONTAL_NAMES = [\"top\", \"bottom\", \"middle\"];\r\nvar SNAP_SKIP_NAMES_MAP = {\r\n \"left\": \"start\",\r\n \"right\": \"end\",\r\n \"center\": \"center\",\r\n \"top\": \"start\",\r\n \"bottom\": \"end\",\r\n \"middle\": \"center\",\r\n};\r\nvar VERTICAL_NAMES_MAP = {\r\n start: \"left\",\r\n end: \"right\",\r\n center: \"center\",\r\n};\r\nvar HORIZONTAL_NAMES_MAP = {\r\n start: \"top\",\r\n end: \"bottom\",\r\n center: \"middle\",\r\n};\r\nfunction getInitialBounds() {\r\n return {\r\n left: false,\r\n top: false,\r\n right: false,\r\n bottom: false,\r\n };\r\n}\r\nfunction hasGuidelines(moveable, ableName) {\r\n var _a = moveable.props, snappable = _a.snappable, bounds = _a.bounds, innerBounds = _a.innerBounds, verticalGuidelines = _a.verticalGuidelines, horizontalGuidelines = _a.horizontalGuidelines, snapGridWidth = _a.snapGridWidth, snapGridHeight = _a.snapGridHeight, _b = moveable.state, guidelines = _b.guidelines, enableSnap = _b.enableSnap;\r\n if (!snappable ||\r\n !enableSnap ||\r\n (ableName && snappable !== true && snappable.indexOf(ableName) < 0)) {\r\n return false;\r\n }\r\n if (snapGridWidth ||\r\n snapGridHeight ||\r\n bounds ||\r\n innerBounds ||\r\n (guidelines && guidelines.length) ||\r\n (verticalGuidelines && verticalGuidelines.length) ||\r\n (horizontalGuidelines && horizontalGuidelines.length)) {\r\n return true;\r\n }\r\n return false;\r\n}\r\nfunction getSnapDirections(snapDirections) {\r\n if (snapDirections === false) {\r\n return {};\r\n }\r\n else if (snapDirections === true || !snapDirections) {\r\n return { left: true, right: true, top: true, bottom: true };\r\n }\r\n return snapDirections;\r\n}\r\nfunction mapSnapDirectionPoses(snapDirections, snapPoses) {\r\n var nextSnapDirections = getSnapDirections(snapDirections);\r\n var nextSnapPoses = {};\r\n for (var name_1 in nextSnapDirections) {\r\n if (name_1 in snapPoses && nextSnapDirections[name_1]) {\r\n nextSnapPoses[name_1] = snapPoses[name_1];\r\n }\r\n }\r\n return nextSnapPoses;\r\n}\r\nfunction splitSnapDirectionPoses(snapDirections, snapPoses) {\r\n var nextSnapPoses = mapSnapDirectionPoses(snapDirections, snapPoses);\r\n var horizontalNames = HORIZONTAL_NAMES.filter(function (name) { return name in nextSnapPoses; });\r\n var verticalNames = VERTICAL_NAMES.filter(function (name) { return name in nextSnapPoses; });\r\n return {\r\n horizontalNames: horizontalNames,\r\n verticalNames: verticalNames,\r\n horizontal: horizontalNames.map(function (name) { return nextSnapPoses[name]; }),\r\n vertical: verticalNames.map(function (name) { return nextSnapPoses[name]; }),\r\n };\r\n}\r\nfunction calculateContainerPos(rootMatrix, containerRect, n) {\r\n var clientPos = calculatePosition(rootMatrix, [containerRect.clientLeft, containerRect.clientTop], n);\r\n return [\r\n containerRect.left + clientPos[0],\r\n containerRect.top + clientPos[1],\r\n ];\r\n}\r\nfunction solveLineConstants(_a) {\r\n var _b = __read(_a, 2), point1 = _b[0], point2 = _b[1];\r\n var dx = point2[0] - point1[0];\r\n var dy = point2[1] - point1[1];\r\n if (Math.abs(dx) < TINY_NUM$1) {\r\n dx = 0;\r\n }\r\n if (Math.abs(dy) < TINY_NUM$1) {\r\n dy = 0;\r\n }\r\n // b > 0\r\n // ax + by + c = 0\r\n var a = 0;\r\n var b = 0;\r\n var c = 0;\r\n if (!dx) {\r\n // -x + 1 = 0\r\n a = -1;\r\n c = point1[0];\r\n }\r\n else if (!dy) {\r\n // y - 1 = 0\r\n b = 1;\r\n c = -point1[1];\r\n }\r\n else {\r\n // y = -a(x - x1) + y1\r\n // ax + y + a * x1 - y1 = 0\r\n a = -dy / dx;\r\n b = 1;\r\n c = a * point1[0] - point1[1];\r\n }\r\n return [a, b, c].map(function (v) { return throttle(v, TINY_NUM$1); });\r\n}\n\nfunction checkMoveableSnapPoses(moveable, posesX, posesY, dirXs, dirYs, customSnapThreshold) {\r\n var _a;\r\n if (dirXs === void 0) { dirXs = []; }\r\n if (dirYs === void 0) { dirYs = []; }\r\n var props = moveable.props;\r\n var snapThresholdMultiples = ((_a = moveable.state.snapThresholdInfo) === null || _a === void 0 ? void 0 : _a.multiples) || [1, 1];\r\n var snapThreshold = selectValue(customSnapThreshold, props.snapThreshold, 5);\r\n return checkSnapPoses(moveable.state.guidelines, posesX, posesY, dirXs, dirYs, snapThreshold, snapThresholdMultiples);\r\n}\r\nfunction checkSnapPoses(guidelines, posesX, posesY, dirXs, dirYs, snapThreshold, multiples) {\r\n return {\r\n vertical: checkSnap(guidelines, \"vertical\", posesX, snapThreshold * multiples[0], dirXs),\r\n horizontal: checkSnap(guidelines, \"horizontal\", posesY, snapThreshold * multiples[1], dirYs),\r\n };\r\n}\r\nfunction checkSnapKeepRatio(moveable, startPos, endPos) {\r\n var _a = __read(endPos, 2), endX = _a[0], endY = _a[1];\r\n var _b = __read(startPos, 2), startX = _b[0], startY = _b[1];\r\n var _c = __read(minus(endPos, startPos), 2), dx = _c[0], dy = _c[1];\r\n var isBottom = dy > 0;\r\n var isRight = dx > 0;\r\n dx = getTinyDist(dx);\r\n dy = getTinyDist(dy);\r\n var verticalInfo = {\r\n isSnap: false,\r\n offset: 0,\r\n pos: 0,\r\n };\r\n var horizontalInfo = {\r\n isSnap: false,\r\n offset: 0,\r\n pos: 0,\r\n };\r\n if (dx === 0 && dy === 0) {\r\n return {\r\n vertical: verticalInfo,\r\n horizontal: horizontalInfo,\r\n };\r\n }\r\n var _d = checkMoveableSnapPoses(moveable, dx ? [endX] : [], dy ? [endY] : []), verticalSnapInfo = _d.vertical, horizontalSnapInfo = _d.horizontal;\r\n verticalSnapInfo.posInfos.filter(function (_a) {\r\n var pos = _a.pos;\r\n return isRight ? pos >= startX : pos <= startX;\r\n });\r\n horizontalSnapInfo.posInfos.filter(function (_a) {\r\n var pos = _a.pos;\r\n return isBottom ? pos >= startY : pos <= startY;\r\n });\r\n verticalSnapInfo.isSnap = verticalSnapInfo.posInfos.length > 0;\r\n horizontalSnapInfo.isSnap = horizontalSnapInfo.posInfos.length > 0;\r\n var _e = getNearestSnapGuidelineInfo(verticalSnapInfo), isVerticalSnap = _e.isSnap, verticalGuideline = _e.guideline;\r\n var _f = getNearestSnapGuidelineInfo(horizontalSnapInfo), isHorizontalSnap = _f.isSnap, horizontalGuideline = _f.guideline;\r\n var horizontalPos = isHorizontalSnap ? horizontalGuideline.pos[1] : 0;\r\n var verticalPos = isVerticalSnap ? verticalGuideline.pos[0] : 0;\r\n if (dx === 0) {\r\n if (isHorizontalSnap) {\r\n horizontalInfo.isSnap = true;\r\n horizontalInfo.pos = horizontalGuideline.pos[1];\r\n horizontalInfo.offset = endY - horizontalInfo.pos;\r\n }\r\n }\r\n else if (dy === 0) {\r\n if (isVerticalSnap) {\r\n verticalInfo.isSnap = true;\r\n verticalInfo.pos = verticalPos;\r\n verticalInfo.offset = endX - verticalPos;\r\n }\r\n }\r\n else {\r\n // y - y1 = a * (x - x1)\r\n var a = dy / dx;\r\n var b = endPos[1] - a * endX;\r\n var y = 0;\r\n var x = 0;\r\n var isSnap = false;\r\n if (isVerticalSnap) {\r\n x = verticalPos;\r\n y = a * x + b;\r\n isSnap = true;\r\n }\r\n else if (isHorizontalSnap) {\r\n y = horizontalPos;\r\n x = (y - b) / a;\r\n isSnap = true;\r\n }\r\n if (isSnap) {\r\n verticalInfo.isSnap = true;\r\n verticalInfo.pos = x;\r\n verticalInfo.offset = endX - x;\r\n horizontalInfo.isSnap = true;\r\n horizontalInfo.pos = y;\r\n horizontalInfo.offset = endY - y;\r\n }\r\n }\r\n return {\r\n vertical: verticalInfo,\r\n horizontal: horizontalInfo,\r\n };\r\n}\r\nfunction getStringDirection(dir) {\r\n var stringDirection = \"\";\r\n if (dir === -1 || dir === \"top\" || dir === \"left\") {\r\n stringDirection = \"start\";\r\n }\r\n else if (dir === 0 || dir === \"center\" || dir === \"middle\") {\r\n stringDirection = \"center\";\r\n }\r\n else if (dir === 1 || dir === \"right\" || dir === \"bottom\") {\r\n stringDirection = \"end\";\r\n }\r\n return stringDirection;\r\n}\r\nfunction checkSnaps(moveable, rect, customSnapThreshold) {\r\n var poses = splitSnapDirectionPoses(moveable.props.snapDirections, rect);\r\n var result = checkMoveableSnapPoses(moveable, poses.vertical, poses.horizontal, poses.verticalNames.map(function (name) { return getStringDirection(name); }), poses.horizontalNames.map(function (name) { return getStringDirection(name); }), customSnapThreshold);\r\n var horizontalDirection = getStringDirection(poses.horizontalNames[result.horizontal.index]);\r\n var verticalDirection = getStringDirection(poses.verticalNames[result.vertical.index]);\r\n return {\r\n vertical: __assign(__assign({}, result.vertical), { direction: verticalDirection }),\r\n horizontal: __assign(__assign({}, result.horizontal), { direction: horizontalDirection }),\r\n };\r\n}\r\nfunction getNearestSnapGuidelineInfo(snapInfo) {\r\n var isSnap = snapInfo.isSnap;\r\n if (!isSnap) {\r\n return {\r\n isSnap: false,\r\n offset: 0,\r\n dist: -1,\r\n pos: 0,\r\n guideline: null,\r\n };\r\n }\r\n var posInfo = snapInfo.posInfos[0];\r\n var guidelineInfo = posInfo.guidelineInfos[0];\r\n var offset = guidelineInfo.offset;\r\n var dist = guidelineInfo.dist;\r\n var guideline = guidelineInfo.guideline;\r\n return {\r\n isSnap: isSnap,\r\n offset: offset,\r\n dist: dist,\r\n pos: posInfo.pos,\r\n guideline: guideline,\r\n };\r\n}\r\nfunction checkSnap(guidelines, targetType, targetPoses, snapThreshold, dirs) {\r\n var _a, _b;\r\n if (dirs === void 0) { dirs = []; }\r\n if (!guidelines || !guidelines.length) {\r\n return {\r\n isSnap: false,\r\n index: -1,\r\n direction: \"\",\r\n posInfos: [],\r\n };\r\n }\r\n var isVertical = targetType === \"vertical\";\r\n var posType = isVertical ? 0 : 1;\r\n var snapPosInfos = targetPoses.map(function (targetPos, index) {\r\n var direction = dirs[index] || \"\";\r\n var guidelineInfos = guidelines.map(function (guideline) {\r\n var pos = guideline.pos;\r\n var offset = targetPos - pos[posType];\r\n return {\r\n offset: offset,\r\n dist: abs(offset),\r\n guideline: guideline,\r\n direction: direction,\r\n };\r\n }).filter(function (_a) {\r\n var guideline = _a.guideline, dist = _a.dist;\r\n var type = guideline.type;\r\n if (type !== targetType\r\n || dist > snapThreshold) {\r\n return false;\r\n }\r\n return true;\r\n }).sort(function (a, b) { return a.dist - b.dist; });\r\n return {\r\n pos: targetPos,\r\n index: index,\r\n guidelineInfos: guidelineInfos,\r\n direction: direction,\r\n };\r\n }).filter(function (snapPosInfo) {\r\n return snapPosInfo.guidelineInfos.length > 0;\r\n }).sort(function (a, b) {\r\n return a.guidelineInfos[0].dist - b.guidelineInfos[0].dist;\r\n });\r\n var isSnap = snapPosInfos.length > 0;\r\n return {\r\n isSnap: isSnap,\r\n index: isSnap ? snapPosInfos[0].index : -1,\r\n direction: (_b = (_a = snapPosInfos[0]) === null || _a === void 0 ? void 0 : _a.direction) !== null && _b !== void 0 ? _b : \"\",\r\n posInfos: snapPosInfos,\r\n };\r\n}\r\nfunction getSnapInfosByDirection(moveable, \r\n// pos1 pos2 pos3 pos4\r\nposes, snapDirection, snapThreshold) {\r\n if (snapThreshold === void 0) { snapThreshold = 1; }\r\n var dirs = [];\r\n if (snapDirection[0] && snapDirection[1]) {\r\n dirs = [\r\n snapDirection,\r\n [-snapDirection[0], snapDirection[1]],\r\n [snapDirection[0], -snapDirection[1]],\r\n ];\r\n }\r\n else if (!snapDirection[0] && !snapDirection[1]) {\r\n [\r\n [-1, -1],\r\n [1, -1],\r\n [1, 1],\r\n [-1, 1],\r\n ].forEach(function (dir, i, arr) {\r\n var nextDir = (arr[i + 1] || arr[0]);\r\n dirs.push(dir);\r\n dirs.push([\r\n (dir[0] + nextDir[0]) / 2,\r\n (dir[1] + nextDir[1]) / 2,\r\n ]);\r\n });\r\n }\r\n else {\r\n if (moveable.props.keepRatio) {\r\n dirs.push([-1, -1], [-1, 1], [1, -1], [1, 1], snapDirection);\r\n }\r\n else {\r\n dirs.push.apply(dirs, __spreadArray([], __read(getPosesByDirection([\r\n [-1, -1],\r\n [1, -1],\r\n [-1, -1],\r\n [1, 1],\r\n ], snapDirection)), false));\r\n if (dirs.length > 1) {\r\n dirs.push([\r\n (dirs[0][0] + dirs[1][0]) / 2,\r\n (dirs[0][1] + dirs[1][1]) / 2,\r\n ]);\r\n }\r\n }\r\n }\r\n var nextPoses = dirs.map(function (dir) { return getPosByDirection(poses, dir); });\r\n var xs = nextPoses.map(function (pos) { return pos[0]; });\r\n var ys = nextPoses.map(function (pos) { return pos[1]; });\r\n var result = checkMoveableSnapPoses(moveable, xs, ys, dirs.map(function (dir) { return getStringDirection(dir[0]); }), dirs.map(function (dir) { return getStringDirection(dir[1]); }), snapThreshold);\r\n var verticalDirection = getStringDirection(dirs.map(function (dir) { return dir[0]; })[result.vertical.index]);\r\n var horizontalDirection = getStringDirection(dirs.map(function (dir) { return dir[1]; })[result.horizontal.index]);\r\n return {\r\n vertical: __assign(__assign({}, result.vertical), { direction: verticalDirection }),\r\n horizontal: __assign(__assign({}, result.horizontal), { direction: horizontalDirection }),\r\n };\r\n}\r\nfunction checkSnapBoundPriority(a, b) {\r\n var aDist = abs(a.offset);\r\n var bDist = abs(b.offset);\r\n if (a.isBound && b.isBound) {\r\n return bDist - aDist;\r\n }\r\n else if (a.isBound) {\r\n return -1;\r\n }\r\n else if (b.isBound) {\r\n return 1;\r\n }\r\n else if (a.isSnap && b.isSnap) {\r\n return bDist - aDist;\r\n }\r\n else if (a.isSnap) {\r\n return -1;\r\n }\r\n else if (b.isSnap) {\r\n return 1;\r\n }\r\n else if (aDist < TINY_NUM) {\r\n return 1;\r\n }\r\n else if (bDist < TINY_NUM) {\r\n return -1;\r\n }\r\n return aDist - bDist;\r\n}\r\nfunction getNearOffsetInfo(offsets, index) {\r\n return offsets.slice().sort(function (a, b) {\r\n var aSign = a.sign[index];\r\n var bSign = b.sign[index];\r\n var aOffset = a.offset[index];\r\n var bOffset = b.offset[index];\r\n // -1 The positions of a and b do not change.\r\n // 1 The positions of a and b are reversed.\r\n if (!aSign) {\r\n return 1;\r\n }\r\n else if (!bSign) {\r\n return -1;\r\n }\r\n return checkSnapBoundPriority({ isBound: a.isBound, isSnap: a.isSnap, offset: aOffset }, { isBound: b.isBound, isSnap: b.isSnap, offset: bOffset });\r\n })[0];\r\n}\r\nfunction getCheckSnapDirections(direction, fixedDirection, keepRatio) {\r\n var directions = [];\r\n // const fixedDirection = [-direction[0], -direction[1]];\r\n if (keepRatio) {\r\n if (abs(fixedDirection[0]) !== 1 || abs(fixedDirection[1]) !== 1) {\r\n directions.push([fixedDirection, [-1, -1]], [fixedDirection, [-1, 1]], [fixedDirection, [1, -1]], [fixedDirection, [1, 1]]);\r\n }\r\n else {\r\n directions.push([fixedDirection, [direction[0], -direction[1]]], [fixedDirection, [-direction[0], direction[1]]]);\r\n }\r\n directions.push([fixedDirection, direction]);\r\n }\r\n else {\r\n if ((direction[0] && direction[1]) || (!direction[0] && !direction[1])) {\r\n var endDirection_1 = direction[0] ? direction : [1, 1];\r\n [1, -1].forEach(function (signX) {\r\n [1, -1].forEach(function (signY) {\r\n var nextDirection = [signX * endDirection_1[0], signY * endDirection_1[1]];\r\n if (fixedDirection[0] === nextDirection[0]\r\n && fixedDirection[1] === nextDirection[1]) {\r\n return;\r\n }\r\n directions.push([fixedDirection, nextDirection]);\r\n });\r\n });\r\n }\r\n else if (direction[0]) {\r\n var signs = abs(fixedDirection[0]) === 1 ? [1] : [1, -1];\r\n signs.forEach(function (sign) {\r\n directions.push([\r\n [fixedDirection[0], -1],\r\n [sign * direction[0], -1],\r\n ], [\r\n [fixedDirection[0], 0],\r\n [sign * direction[0], 0],\r\n ], [\r\n [fixedDirection[0], 1],\r\n [sign * direction[0], 1],\r\n ]);\r\n });\r\n }\r\n else if (direction[1]) {\r\n var signs = abs(fixedDirection[1]) === 1 ? [1] : [1, -1];\r\n signs.forEach(function (sign) {\r\n directions.push([\r\n [-1, fixedDirection[1]],\r\n [-1, sign * direction[1]],\r\n ], [\r\n [0, fixedDirection[1]],\r\n [0, sign * direction[1]],\r\n ], [\r\n [1, fixedDirection[1]],\r\n [1, sign * direction[1]],\r\n ]);\r\n });\r\n }\r\n }\r\n return directions;\r\n}\n\nfunction isStartLine(dot, line) {\r\n // l o => true\r\n // o l => false\r\n var cx = average([line[0][0], line[1][0]]);\r\n var cy = average([line[0][1], line[1][1]]);\r\n return {\r\n vertical: cx <= dot[0],\r\n horizontal: cy <= dot[1],\r\n };\r\n}\r\nfunction hitTestLine(dot, _a) {\r\n var _b = __read(_a, 2), pos1 = _b[0], pos2 = _b[1];\r\n var dx = pos2[0] - pos1[0];\r\n var dy = pos2[1] - pos1[1];\r\n if (abs(dx) < TINY_NUM) {\r\n dx = 0;\r\n }\r\n if (abs(dy) < TINY_NUM) {\r\n dy = 0;\r\n }\r\n var test1;\r\n var test2;\r\n if (!dx) {\r\n test1 = pos1[0];\r\n test2 = dot[0];\r\n }\r\n else if (!dy) {\r\n test1 = pos1[1];\r\n test2 = dot[1];\r\n }\r\n else {\r\n var a = dy / dx;\r\n // y = a * (x - pos1) + pos1\r\n test1 = a * (dot[0] - pos1[0]) + pos1[1];\r\n test2 = dot[1];\r\n }\r\n return test1 - test2;\r\n}\r\nfunction isSameStartLine(dots, line, centerSign, error) {\r\n if (error === void 0) { error = TINY_NUM; }\r\n return dots.every(function (dot) {\r\n var value = hitTestLine(dot, line);\r\n var sign = value <= 0;\r\n return sign === centerSign || abs(value) <= error;\r\n });\r\n}\r\nfunction checkInnerBoundDot(pos, start, end, isStart, threshold) {\r\n if (threshold === void 0) { threshold = 0; }\r\n if ((isStart && start - threshold <= pos)\r\n || (!isStart && pos <= end + threshold)) {\r\n // false 402 565 602 => 37 ([0, 37])\r\n // true 400 524.9712603540036 600 => 124 ([124, 0])\r\n // true 400 410 600 => 10 ([10, 0])\r\n return {\r\n isBound: true,\r\n offset: isStart ? start - pos : end - pos,\r\n };\r\n }\r\n return {\r\n isBound: false,\r\n offset: 0,\r\n };\r\n}\r\nfunction checkInnerBound(moveable, _a) {\r\n var line = _a.line, centerSign = _a.centerSign, verticalSign = _a.verticalSign, horizontalSign = _a.horizontalSign, lineConstants = _a.lineConstants;\r\n var bounds = moveable.props.innerBounds;\r\n if (!bounds) {\r\n return {\r\n isAllBound: false,\r\n isBound: false,\r\n isVerticalBound: false,\r\n isHorizontalBound: false,\r\n offset: [0, 0],\r\n };\r\n }\r\n var left = bounds.left, top = bounds.top, width = bounds.width, height = bounds.height;\r\n var leftLine = [[left, top], [left, top + height]];\r\n var topLine = [[left, top], [left + width, top]];\r\n var rightLine = [[left + width, top], [left + width, top + height]];\r\n var bottomLine = [[left, top + height], [left + width, top + height]];\r\n if (isSameStartLine([\r\n [left, top],\r\n [left + width, top],\r\n [left, top + height],\r\n [left + width, top + height],\r\n ], line, centerSign)) {\r\n return {\r\n isAllBound: false,\r\n isBound: false,\r\n isVerticalBound: false,\r\n isHorizontalBound: false,\r\n offset: [0, 0],\r\n };\r\n }\r\n // test vertical\r\n var topBoundInfo = checkLineBoundCollision(line, lineConstants, topLine, verticalSign);\r\n var bottomBoundInfo = checkLineBoundCollision(line, lineConstants, bottomLine, verticalSign);\r\n // test horizontal\r\n var leftBoundInfo = checkLineBoundCollision(line, lineConstants, leftLine, horizontalSign);\r\n var rightBoundInfo = checkLineBoundCollision(line, lineConstants, rightLine, horizontalSign);\r\n var isAllVerticalBound = topBoundInfo.isBound && bottomBoundInfo.isBound;\r\n var isVerticalBound = topBoundInfo.isBound || bottomBoundInfo.isBound;\r\n var isAllHorizontalBound = leftBoundInfo.isBound && rightBoundInfo.isBound;\r\n var isHorizontalBound = leftBoundInfo.isBound || rightBoundInfo.isBound;\r\n var verticalOffset = maxOffset(topBoundInfo.offset, bottomBoundInfo.offset);\r\n var horizontalOffset = maxOffset(leftBoundInfo.offset, rightBoundInfo.offset);\r\n var offset = [0, 0];\r\n var isBound = false;\r\n var isAllBound = false;\r\n if (abs(horizontalOffset) < abs(verticalOffset)) {\r\n offset = [verticalOffset, 0];\r\n isBound = isVerticalBound;\r\n isAllBound = isAllVerticalBound;\r\n }\r\n else {\r\n offset = [0, horizontalOffset];\r\n isBound = isHorizontalBound;\r\n isAllBound = isAllHorizontalBound;\r\n }\r\n return {\r\n isAllBound: isAllBound,\r\n isVerticalBound: isVerticalBound,\r\n isHorizontalBound: isHorizontalBound,\r\n isBound: isBound,\r\n offset: offset,\r\n };\r\n}\r\nfunction checkLineBoundCollision(line, _a, boundLine, isStart, threshold, isRender) {\r\n var _b = __read(_a, 2), a = _b[0], b = _b[1];\r\n var dot1 = line[0];\r\n // const dot2 = line[1];\r\n var boundDot1 = boundLine[0];\r\n var boundDot2 = boundLine[1];\r\n // const dy1 = getTinyDist(dot2[1] - dot1[1]);\r\n // const dx1 = getTinyDist(dot2[0] - dot1[0]);\r\n var dy2 = getTinyDist(boundDot2[1] - boundDot1[1]);\r\n var dx2 = getTinyDist(boundDot2[0] - boundDot1[0]);\r\n var hasDx = b;\r\n var hasDy = a;\r\n var slope = -a / b;\r\n // lineConstants\r\n // ax + by + c = 0\r\n // dx2 or dy2 is zero\r\n if (!dx2) {\r\n // vertical\r\n // by + c = 0\r\n if (isRender && !hasDy) {\r\n // 90deg\r\n return {\r\n isBound: false,\r\n offset: 0,\r\n };\r\n }\r\n else if (hasDx) {\r\n // ax + by + c = 0\r\n // const y = dy1 ? dy1 / dx1 * (boundDot1[0] - dot1[0]) + dot1[1] : dot1[1];\r\n var y = slope * (boundDot1[0] - dot1[0]) + dot1[1];\r\n // boundDot1[1] <= y <= boundDot2[1]\r\n return checkInnerBoundDot(y, boundDot1[1], boundDot2[1], isStart, threshold);\r\n }\r\n else {\r\n // ax + c = 0\r\n var offset = boundDot1[0] - dot1[0];\r\n var isBound = abs(offset) <= (threshold || 0);\r\n return {\r\n isBound: isBound,\r\n offset: isBound ? offset : 0,\r\n };\r\n }\r\n }\r\n else if (!dy2) {\r\n // horizontal\r\n if (isRender && !hasDx) {\r\n // 90deg\r\n return {\r\n isBound: false,\r\n offset: 0,\r\n };\r\n }\r\n else if (hasDy) {\r\n // y = a * (x - x1) + y1\r\n // x = (y - y1) / a + x1\r\n // const a = dy1 / dx1;\r\n // const x = dx1 ? (boundDot1[1] - dot1[1]) / a + dot1[0] : dot1[0];\r\n var x = (boundDot1[1] - dot1[1]) / slope + dot1[0];\r\n // boundDot1[0] <= x && x <= boundDot2[0]\r\n return checkInnerBoundDot(x, boundDot1[0], boundDot2[0], isStart, threshold);\r\n }\r\n else {\r\n var offset = boundDot1[1] - dot1[1];\r\n var isBound = abs(offset) <= (threshold || 0);\r\n return {\r\n isBound: isBound,\r\n offset: isBound ? offset : 0,\r\n };\r\n }\r\n }\r\n return {\r\n isBound: false,\r\n offset: 0,\r\n };\r\n}\r\nfunction getInnerBoundInfo(moveable, lineInfos, datas) {\r\n return lineInfos.map(function (info) {\r\n var _a = checkInnerBound(moveable, info), isBound = _a.isBound, offset = _a.offset, isVerticalBound = _a.isVerticalBound, isHorizontalBound = _a.isHorizontalBound;\r\n var multiple = info.multiple;\r\n var sizeOffset = getDragDist({\r\n datas: datas,\r\n distX: offset[0],\r\n distY: offset[1],\r\n }).map(function (size, i) { return size * (multiple[i] ? 2 / multiple[i] : 0); });\r\n return {\r\n sign: multiple,\r\n isBound: isBound,\r\n isVerticalBound: isVerticalBound,\r\n isHorizontalBound: isHorizontalBound,\r\n isSnap: false,\r\n offset: sizeOffset,\r\n };\r\n });\r\n}\r\nfunction getInnerBoundDragInfo(moveable, poses, datas) {\r\n var _a;\r\n var lines = getCheckInnerBoundLineInfos(moveable, poses, [0, 0], false).map(function (info) {\r\n return __assign(__assign({}, info), { multiple: info.multiple.map(function (dir) { return abs(dir) * 2; }) });\r\n });\r\n var innerBoundInfo = getInnerBoundInfo(moveable, lines, datas);\r\n var widthOffsetInfo = getNearOffsetInfo(innerBoundInfo, 0);\r\n var heightOffsetInfo = getNearOffsetInfo(innerBoundInfo, 1);\r\n var verticalOffset = 0;\r\n var horizontalOffset = 0;\r\n var isVerticalBound = widthOffsetInfo.isVerticalBound || heightOffsetInfo.isVerticalBound;\r\n var isHorizontalBound = widthOffsetInfo.isHorizontalBound || heightOffsetInfo.isHorizontalBound;\r\n if (isVerticalBound || isHorizontalBound) {\r\n _a = __read(getInverseDragDist({\r\n datas: datas,\r\n distX: -widthOffsetInfo.offset[0],\r\n distY: -heightOffsetInfo.offset[1],\r\n }), 2), verticalOffset = _a[0], horizontalOffset = _a[1];\r\n }\r\n return {\r\n vertical: {\r\n isBound: isVerticalBound,\r\n offset: verticalOffset,\r\n },\r\n horizontal: {\r\n isBound: isHorizontalBound,\r\n offset: horizontalOffset,\r\n },\r\n };\r\n}\r\nfunction getCheckSnapLineDirections(direction, keepRatio) {\r\n var lineDirections = [];\r\n var x = direction[0];\r\n var y = direction[1];\r\n if (x && y) {\r\n lineDirections.push([[0, y * 2], direction, [-x, y]], [[x * 2, 0], direction, [x, -y]]);\r\n }\r\n else if (x) {\r\n // vertcal\r\n lineDirections.push([[x * 2, 0], [x, 1], [x, -1]]);\r\n if (keepRatio) {\r\n lineDirections.push([[0, -1], [x, -1], [-x, -1]], [[0, 1], [x, 1], [-x, 1]]);\r\n }\r\n }\r\n else if (y) {\r\n // horizontal\r\n lineDirections.push([[0, y * 2], [1, y], [-1, y]]);\r\n if (keepRatio) {\r\n lineDirections.push([[-1, 0], [-1, y], [-1, -y]], [[1, 0], [1, y], [1, -y]]);\r\n }\r\n }\r\n else {\r\n // [0, 0] to all direction\r\n lineDirections.push([[-1, 0], [-1, -1], [-1, 1]], [[1, 0], [1, -1], [1, 1]], [[0, -1], [-1, -1], [1, -1]], [[0, 1], [-1, 1], [1, 1]]);\r\n }\r\n return lineDirections;\r\n}\r\nfunction getCheckInnerBoundLineInfos(moveable, poses, direction, keepRatio) {\r\n var _a = moveable.state, allMatrix = _a.allMatrix, is3d = _a.is3d;\r\n var virtualPoses = calculatePoses(allMatrix, 100, 100, is3d ? 4 : 3);\r\n var center = getPosByDirection(virtualPoses, [0, 0]);\r\n return getCheckSnapLineDirections(direction, keepRatio).map(function (_a) {\r\n var _b = __read(_a, 3), multiple = _b[0], dir1 = _b[1], dir2 = _b[2];\r\n var virtualLine = [\r\n getPosByDirection(virtualPoses, dir1),\r\n getPosByDirection(virtualPoses, dir2),\r\n ];\r\n var lineConstants = solveLineConstants(virtualLine);\r\n var _c = isStartLine(center, virtualLine), verticalSign = _c.vertical, horizontalSign = _c.horizontal;\r\n var centerSign = hitTestLine(center, virtualLine) <= 0;\r\n return {\r\n multiple: multiple,\r\n centerSign: centerSign,\r\n verticalSign: verticalSign,\r\n horizontalSign: horizontalSign,\r\n lineConstants: lineConstants,\r\n line: [\r\n getPosByDirection(poses, dir1),\r\n getPosByDirection(poses, dir2),\r\n ],\r\n };\r\n });\r\n}\r\nfunction isBoundRotate(relativePoses, boundDots, center, rad) {\r\n var nextPoses = rad ? relativePoses.map(function (pos) { return rotate(pos, rad); }) : relativePoses;\r\n return [\r\n [nextPoses[0], nextPoses[1]],\r\n [nextPoses[1], nextPoses[3]],\r\n [nextPoses[3], nextPoses[2]],\r\n [nextPoses[2], nextPoses[0]],\r\n ].some(function (line) {\r\n var centerSign = hitTestLine(center, line) <= 0;\r\n return !isSameStartLine(boundDots, line, centerSign);\r\n });\r\n}\r\nfunction getDistPointLine(_a) {\r\n // x = 0, y = 0\r\n // d = (ax + by + c) / root(a2 + b2)\r\n var _b = __read(_a, 2), pos1 = _b[0], pos2 = _b[1];\r\n var dx = pos2[0] - pos1[0];\r\n var dy = pos2[1] - pos1[1];\r\n if (!dx) {\r\n return abs(pos1[0]);\r\n }\r\n if (!dy) {\r\n return abs(pos1[1]);\r\n }\r\n // y - y1 = a(x - x1)\r\n // 0 = ax -y + -a * x1 + y1\r\n var a = dy / dx;\r\n return abs((-a * pos1[0] + pos1[1]) / Math.sqrt(Math.pow(a, 2) + 1));\r\n}\r\nfunction solveReverseLine(_a) {\r\n var _b = __read(_a, 2), pos1 = _b[0], pos2 = _b[1];\r\n var dx = pos2[0] - pos1[0];\r\n var dy = pos2[1] - pos1[1];\r\n if (!dx) {\r\n return [pos1[0], 0];\r\n }\r\n if (!dy) {\r\n return [0, pos1[1]];\r\n }\r\n var a = dy / dx;\r\n // y - y1 = a (x - x1)\r\n // y = ax - a * x1 + y1\r\n var b = -a * pos1[0] + pos1[1];\r\n // y = ax + b = -1/a x\r\n // x = -b / (a + 1 / a)\r\n // y = b / (1 + 1 / a^2)\r\n return [\r\n -b / (a + 1 / a),\r\n b / ((a * a) + 1),\r\n ];\r\n}\r\nfunction checkRotateInnerBounds(moveable, prevPoses, nextPoses, origin, rotation) {\r\n var bounds = moveable.props.innerBounds;\r\n var rad = rotation * Math.PI / 180;\r\n if (!bounds) {\r\n return [];\r\n }\r\n var left = bounds.left, top = bounds.top, width = bounds.width, height = bounds.height;\r\n var relativeLeft = left - origin[0];\r\n var relativeRight = left + width - origin[0];\r\n var relativeTop = top - origin[1];\r\n var relativeBottom = top + height - origin[1];\r\n var dots = [\r\n [relativeLeft, relativeTop],\r\n [relativeRight, relativeTop],\r\n [relativeLeft, relativeBottom],\r\n [relativeRight, relativeBottom],\r\n ];\r\n var center = getPosByDirection(nextPoses, [0, 0]);\r\n if (!isBoundRotate(nextPoses, dots, center, 0)) {\r\n return [];\r\n }\r\n var result = [];\r\n var dotInfos = dots.map(function (dot) { return [\r\n getDistSize(dot),\r\n getRad([0, 0], dot),\r\n ]; });\r\n [\r\n [nextPoses[0], nextPoses[1]],\r\n [nextPoses[1], nextPoses[3]],\r\n [nextPoses[3], nextPoses[2]],\r\n [nextPoses[2], nextPoses[0]],\r\n ].forEach(function (line) {\r\n var lineRad = getRad([0, 0], solveReverseLine(line));\r\n var lineDist = getDistPointLine(line);\r\n result.push.apply(result, __spreadArray([], __read(dotInfos\r\n .filter(function (_a) {\r\n var _b = __read(_a, 1), dotDist = _b[0];\r\n return dotDist && lineDist <= dotDist;\r\n })\r\n .map(function (_a) {\r\n var _b = __read(_a, 2), dotDist = _b[0], dotRad = _b[1];\r\n var distRad = Math.acos(dotDist ? lineDist / dotDist : 0);\r\n var nextRad1 = dotRad + distRad;\r\n var nextRad2 = dotRad - distRad;\r\n return [\r\n rad + nextRad1 - lineRad,\r\n rad + nextRad2 - lineRad,\r\n ];\r\n })\r\n .reduce(function (prev, cur) {\r\n prev.push.apply(prev, __spreadArray([], __read(cur), false));\r\n return prev;\r\n }, [])\r\n .filter(function (nextRad) { return !isBoundRotate(prevPoses, dots, center, nextRad); })\r\n .map(function (nextRad) { return throttle(nextRad * 180 / Math.PI, TINY_NUM); })), false));\r\n });\r\n return result;\r\n}\r\nfunction checkInnerBoundPoses(moveable) {\r\n var innerBounds = moveable.props.innerBounds;\r\n var boundMap = getInitialBounds();\r\n if (!innerBounds) {\r\n return {\r\n boundMap: boundMap,\r\n vertical: [],\r\n horizontal: [],\r\n };\r\n }\r\n var _a = moveable.getRect(), pos1 = _a.pos1, pos2 = _a.pos2, pos3 = _a.pos3, pos4 = _a.pos4;\r\n var poses = [pos1, pos2, pos3, pos4];\r\n var center = getPosByDirection(poses, [0, 0]);\r\n var left = innerBounds.left, top = innerBounds.top, width = innerBounds.width, height = innerBounds.height;\r\n var leftLine = [[left, top], [left, top + height]];\r\n var topLine = [[left, top], [left + width, top]];\r\n var rightLine = [[left + width, top], [left + width, top + height]];\r\n var bottomLine = [[left, top + height], [left + width, top + height]];\r\n var lineInfos = getCheckInnerBoundLineInfos(moveable, poses, [0, 0], false);\r\n var horizontalPoses = [];\r\n var verticalPoses = [];\r\n lineInfos.forEach(function (lineInfo) {\r\n var line = lineInfo.line, lineConstants = lineInfo.lineConstants;\r\n var _a = isStartLine(center, line), isHorizontalStart = _a.horizontal, isVerticalStart = _a.vertical;\r\n // test vertical\r\n var topBoundInfo = checkLineBoundCollision(line, lineConstants, topLine, isVerticalStart, 1, true);\r\n var bottomBoundInfo = checkLineBoundCollision(line, lineConstants, bottomLine, isVerticalStart, 1, true);\r\n // test horizontal\r\n var leftBoundInfo = checkLineBoundCollision(line, lineConstants, leftLine, isHorizontalStart, 1, true);\r\n var rightBoundInfo = checkLineBoundCollision(line, lineConstants, rightLine, isHorizontalStart, 1, true);\r\n if (topBoundInfo.isBound && !boundMap.top) {\r\n horizontalPoses.push(top);\r\n boundMap.top = true;\r\n }\r\n if (bottomBoundInfo.isBound && !boundMap.bottom) {\r\n horizontalPoses.push(top + height);\r\n boundMap.bottom = true;\r\n }\r\n if (leftBoundInfo.isBound && !boundMap.left) {\r\n verticalPoses.push(left);\r\n boundMap.left = true;\r\n }\r\n if (rightBoundInfo.isBound && !boundMap.right) {\r\n verticalPoses.push(left + width);\r\n boundMap.right = true;\r\n }\r\n });\r\n return {\r\n boundMap: boundMap,\r\n horizontal: horizontalPoses,\r\n vertical: verticalPoses,\r\n };\r\n}\n\nfunction solveEquation(pos1, pos2, snapOffset, isVertical) {\r\n var dx = pos2[0] - pos1[0];\r\n var dy = pos2[1] - pos1[1];\r\n if (abs(dx) < TINY_NUM$1) {\r\n dx = 0;\r\n }\r\n if (abs(dy) < TINY_NUM$1) {\r\n dy = 0;\r\n }\r\n if (!dx) {\r\n // y = 0 * x + b\r\n // only horizontal\r\n if (!isVertical) {\r\n return [0, snapOffset];\r\n }\r\n return [0, 0];\r\n }\r\n if (!dy) {\r\n // only vertical\r\n if (isVertical) {\r\n return [snapOffset, 0];\r\n }\r\n return [0, 0];\r\n }\r\n // y = ax + b\r\n var a = dy / dx;\r\n var b = pos1[1] - a * pos1[0];\r\n if (isVertical) {\r\n // y = a * x + b\r\n var y = a * (pos2[0] + snapOffset) + b;\r\n return [snapOffset, y - pos2[1]];\r\n }\r\n else {\r\n // x = (y - b) / a\r\n var x = (pos2[1] + snapOffset - b) / a;\r\n return [x - pos2[0], snapOffset];\r\n }\r\n}\r\nfunction solveNextOffset(pos1, pos2, offset, isVertical, datas) {\r\n var sizeOffset = solveEquation(pos1, pos2, offset, isVertical);\r\n if (!sizeOffset) {\r\n return {\r\n isOutside: false,\r\n offset: [0, 0],\r\n };\r\n }\r\n var size = getDist$1(pos1, pos2);\r\n var dist1 = getDist$1(sizeOffset, pos1);\r\n var dist2 = getDist$1(sizeOffset, pos2);\r\n var isOutside = dist1 > size || dist2 > size;\r\n var _a = __read(getDragDist({\r\n datas: datas,\r\n distX: sizeOffset[0],\r\n distY: sizeOffset[1],\r\n }), 2), widthOffset = _a[0], heightOffset = _a[1];\r\n return {\r\n offset: [widthOffset, heightOffset],\r\n isOutside: isOutside,\r\n };\r\n}\r\nfunction getSnapBound(boundInfo, snapInfo) {\r\n if (boundInfo.isBound) {\r\n return boundInfo.offset;\r\n }\r\n else if (snapInfo.isSnap) {\r\n return getNearestSnapGuidelineInfo(snapInfo).offset;\r\n }\r\n return 0;\r\n}\r\nfunction checkThrottleDragRotate(throttleDragRotate, _a, _b, _c, _d) {\r\n var _e = __read(_a, 2), distX = _e[0], distY = _e[1];\r\n var _f = __read(_b, 2), isVerticalBound = _f[0], isHorizontalBound = _f[1];\r\n var _g = __read(_c, 2), isVerticalSnap = _g[0], isHorizontalSnap = _g[1];\r\n var _h = __read(_d, 2), verticalOffset = _h[0], horizontalOffset = _h[1];\r\n var offsetX = -verticalOffset;\r\n var offsetY = -horizontalOffset;\r\n if (throttleDragRotate && distX && distY) {\r\n offsetX = 0;\r\n offsetY = 0;\r\n var adjustPoses = [];\r\n if (isVerticalBound && isHorizontalBound) {\r\n adjustPoses.push([0, horizontalOffset], [verticalOffset, 0]);\r\n }\r\n else if (isVerticalBound) {\r\n adjustPoses.push([verticalOffset, 0]);\r\n }\r\n else if (isHorizontalBound) {\r\n adjustPoses.push([0, horizontalOffset]);\r\n }\r\n else if (isVerticalSnap && isHorizontalSnap) {\r\n adjustPoses.push([0, horizontalOffset], [verticalOffset, 0]);\r\n }\r\n else if (isVerticalSnap) {\r\n adjustPoses.push([verticalOffset, 0]);\r\n }\r\n else if (isHorizontalSnap) {\r\n adjustPoses.push([0, horizontalOffset]);\r\n }\r\n if (adjustPoses.length) {\r\n adjustPoses.sort(function (a, b) {\r\n return (getDistSize(minus([distX, distY], a)) -\r\n getDistSize(minus([distX, distY], b)));\r\n });\r\n var adjustPos = adjustPoses[0];\r\n if (adjustPos[0] && abs(distX) > TINY_NUM$1) {\r\n offsetX = -adjustPos[0];\r\n offsetY =\r\n (distY * abs(distX + offsetX)) / abs(distX) -\r\n distY;\r\n }\r\n else if (adjustPos[1] && abs(distY) > TINY_NUM$1) {\r\n var prevDistY = distY;\r\n offsetY = -adjustPos[1];\r\n offsetX =\r\n (distX * abs(distY + offsetY)) / abs(prevDistY) -\r\n distX;\r\n }\r\n if (throttleDragRotate && isHorizontalBound && isVerticalBound) {\r\n if (abs(offsetX) > TINY_NUM$1 &&\r\n abs(offsetX) < abs(verticalOffset)) {\r\n var scale = abs(verticalOffset) / abs(offsetX);\r\n offsetX *= scale;\r\n offsetY *= scale;\r\n }\r\n else if (abs(offsetY) > TINY_NUM$1 &&\r\n abs(offsetY) < abs(horizontalOffset)) {\r\n var scale = abs(horizontalOffset) / abs(offsetY);\r\n offsetX *= scale;\r\n offsetY *= scale;\r\n }\r\n else {\r\n offsetX = maxOffset(-verticalOffset, offsetX);\r\n offsetY = maxOffset(-horizontalOffset, offsetY);\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n offsetX = distX || isVerticalBound ? -verticalOffset : 0;\r\n offsetY = distY || isHorizontalBound ? -horizontalOffset : 0;\r\n }\r\n return [offsetX, offsetY];\r\n}\r\nfunction checkSnapBoundsDrag(moveable, distX, distY, throttleDragRotate, ignoreSnap, datas) {\r\n if (!hasGuidelines(moveable, \"draggable\")) {\r\n return [\r\n {\r\n isSnap: false,\r\n isBound: false,\r\n offset: 0,\r\n },\r\n {\r\n isSnap: false,\r\n isBound: false,\r\n offset: 0,\r\n },\r\n ];\r\n }\r\n var poses = getAbsolutePoses(datas.absolutePoses, [distX, distY]);\r\n var _a = getRect(poses), left = _a.left, right = _a.right, top = _a.top, bottom = _a.bottom;\r\n var boundPoses = {\r\n horizontal: poses.map(function (pos) { return pos[1]; }),\r\n vertical: poses.map(function (pos) { return pos[0]; }),\r\n };\r\n var snapDirections = getSnapDirections(moveable.props.snapDirections);\r\n var snapPoses = splitSnapDirectionPoses(snapDirections, {\r\n left: left,\r\n right: right,\r\n top: top,\r\n bottom: bottom,\r\n center: (left + right) / 2,\r\n middle: (top + bottom) / 2,\r\n });\r\n var _b = checkMoveableSnapBounds(moveable, ignoreSnap, snapPoses, boundPoses), verticalSnapBoundInfo = _b.vertical, horizontalSnapBoundInfo = _b.horizontal;\r\n var _c = getInnerBoundDragInfo(moveable, poses, datas), verticalInnerBoundInfo = _c.vertical, horizontalInnerBoundInfo = _c.horizontal;\r\n var isVerticalSnap = verticalSnapBoundInfo.isSnap;\r\n var isHorizontalSnap = horizontalSnapBoundInfo.isSnap;\r\n var isVerticalBound = verticalSnapBoundInfo.isBound || verticalInnerBoundInfo.isBound;\r\n var isHorizontalBound = horizontalSnapBoundInfo.isBound || horizontalInnerBoundInfo.isBound;\r\n var verticalOffset = maxOffset(verticalSnapBoundInfo.offset, verticalInnerBoundInfo.offset);\r\n var horizontalOffset = maxOffset(horizontalSnapBoundInfo.offset, horizontalInnerBoundInfo.offset);\r\n var _d = __read(checkThrottleDragRotate(throttleDragRotate, [distX, distY], [isVerticalBound, isHorizontalBound], [isVerticalSnap, isHorizontalSnap], [verticalOffset, horizontalOffset]), 2), offsetX = _d[0], offsetY = _d[1];\r\n return [\r\n {\r\n isBound: isVerticalBound,\r\n isSnap: isVerticalSnap,\r\n offset: offsetX,\r\n },\r\n {\r\n isBound: isHorizontalBound,\r\n isSnap: isHorizontalSnap,\r\n offset: offsetY,\r\n },\r\n ];\r\n}\r\nfunction checkMoveableSnapBounds(moveable, ignoreSnap, poses, boundPoses) {\r\n if (boundPoses === void 0) { boundPoses = poses; }\r\n var _a = checkBoundPoses(getBounds(moveable), boundPoses.vertical, boundPoses.horizontal), horizontalBoundInfos = _a.horizontal, verticalBoundInfos = _a.vertical;\r\n var _b = ignoreSnap ? {\r\n horizontal: { isSnap: false, index: -1 },\r\n vertical: { isSnap: false, index: -1 },\r\n } : checkMoveableSnapPoses(moveable, poses.vertical, poses.horizontal), horizontalSnapInfo = _b.horizontal, verticalSnapInfo = _b.vertical;\r\n var horizontalOffset = getSnapBound(horizontalBoundInfos[0], horizontalSnapInfo);\r\n var verticalOffset = getSnapBound(verticalBoundInfos[0], verticalSnapInfo);\r\n var horizontalDist = abs(horizontalOffset);\r\n var verticalDist = abs(verticalOffset);\r\n return {\r\n horizontal: {\r\n isBound: horizontalBoundInfos[0].isBound,\r\n isSnap: horizontalSnapInfo.isSnap,\r\n snapIndex: horizontalSnapInfo.index,\r\n offset: horizontalOffset,\r\n dist: horizontalDist,\r\n bounds: horizontalBoundInfos,\r\n snap: horizontalSnapInfo,\r\n },\r\n vertical: {\r\n isBound: verticalBoundInfos[0].isBound,\r\n isSnap: verticalSnapInfo.isSnap,\r\n snapIndex: verticalSnapInfo.index,\r\n offset: verticalOffset,\r\n dist: verticalDist,\r\n bounds: verticalBoundInfos,\r\n snap: verticalSnapInfo,\r\n },\r\n };\r\n}\r\nfunction checkSnapBounds(guideines, bounds, posesX, posesY, snapThreshold, multiples) {\r\n if (multiples === void 0) { multiples = [1, 1]; }\r\n var _a = checkBoundPoses(bounds, posesX, posesY), horizontalBoundInfos = _a.horizontal, verticalBoundInfos = _a.vertical;\r\n // options.isRequest ? {\r\n // horizontal: { isSnap: false, index: -1 } as SnapInfo,\r\n // vertical: { isSnap: false, index: -1 } as SnapInfo,\r\n // } :\r\n var _b = checkSnapPoses(guideines, posesX, posesY, [], [], snapThreshold, multiples), horizontalSnapInfo = _b.horizontal, verticalSnapInfo = _b.vertical;\r\n var horizontalOffset = getSnapBound(horizontalBoundInfos[0], horizontalSnapInfo);\r\n var verticalOffset = getSnapBound(verticalBoundInfos[0], verticalSnapInfo);\r\n var horizontalDist = abs(horizontalOffset);\r\n var verticalDist = abs(verticalOffset);\r\n return {\r\n horizontal: {\r\n isBound: horizontalBoundInfos[0].isBound,\r\n isSnap: horizontalSnapInfo.isSnap,\r\n snapIndex: horizontalSnapInfo.index,\r\n offset: horizontalOffset,\r\n dist: horizontalDist,\r\n bounds: horizontalBoundInfos,\r\n snap: horizontalSnapInfo,\r\n },\r\n vertical: {\r\n isBound: verticalBoundInfos[0].isBound,\r\n isSnap: verticalSnapInfo.isSnap,\r\n snapIndex: verticalSnapInfo.index,\r\n offset: verticalOffset,\r\n dist: verticalDist,\r\n bounds: verticalBoundInfos,\r\n snap: verticalSnapInfo,\r\n },\r\n };\r\n}\r\nfunction checkSnapRightLine(startPos, endPos, snapBoundInfo, keepRatio) {\r\n var rad = (getRad(startPos, endPos) / Math.PI) * 180;\r\n var _a = snapBoundInfo.vertical, isVerticalBound = _a.isBound, isVerticalSnap = _a.isSnap, verticalDist = _a.dist, _b = snapBoundInfo.horizontal, isHorizontalBound = _b.isBound, isHorizontalSnap = _b.isSnap, horizontalDist = _b.dist;\r\n var rad180 = rad % 180;\r\n var isHorizontalLine = rad180 < 3 || rad180 > 177;\r\n var isVerticalLine = rad180 > 87 && rad180 < 93;\r\n if (horizontalDist < verticalDist) {\r\n if (isVerticalBound ||\r\n (isVerticalSnap &&\r\n !isVerticalLine &&\r\n (!keepRatio || !isHorizontalLine))) {\r\n return \"vertical\";\r\n }\r\n }\r\n if (isHorizontalBound ||\r\n (isHorizontalSnap &&\r\n !isHorizontalLine &&\r\n (!keepRatio || !isVerticalLine))) {\r\n return \"horizontal\";\r\n }\r\n return \"\";\r\n}\r\nfunction getSnapBoundInfo(moveable, poses, directions, keepRatio, isRequest, datas) {\r\n return directions.map(function (_a) {\r\n var _b = __read(_a, 2), startDirection = _b[0], endDirection = _b[1];\r\n var otherStartPos = getPosByDirection(poses, startDirection);\r\n var otherEndPos = getPosByDirection(poses, endDirection);\r\n var snapBoundInfo = keepRatio\r\n ? checkSnapBoundsKeepRatio(moveable, otherStartPos, otherEndPos, isRequest)\r\n : checkMoveableSnapBounds(moveable, isRequest, {\r\n vertical: [otherEndPos[0]],\r\n horizontal: [otherEndPos[1]],\r\n });\r\n var _c = snapBoundInfo.horizontal, \r\n // dist: otherHorizontalDist,\r\n otherHorizontalOffset = _c.offset, isOtherHorizontalBound = _c.isBound, isOtherHorizontalSnap = _c.isSnap, _d = snapBoundInfo.vertical, \r\n // dist: otherVerticalDist,\r\n otherVerticalOffset = _d.offset, isOtherVerticalBound = _d.isBound, isOtherVerticalSnap = _d.isSnap;\r\n var multiple = minus(endDirection, startDirection);\r\n if (!otherVerticalOffset && !otherHorizontalOffset) {\r\n return {\r\n isBound: isOtherVerticalBound || isOtherHorizontalBound,\r\n isSnap: isOtherVerticalSnap || isOtherHorizontalSnap,\r\n sign: multiple,\r\n offset: [0, 0],\r\n };\r\n }\r\n var snapLine = checkSnapRightLine(otherStartPos, otherEndPos, snapBoundInfo, keepRatio);\r\n if (!snapLine) {\r\n return {\r\n sign: multiple,\r\n isBound: false,\r\n isSnap: false,\r\n offset: [0, 0],\r\n };\r\n }\r\n var isVertical = snapLine === \"vertical\";\r\n var sizeOffset = [0, 0];\r\n if (!keepRatio\r\n && abs(endDirection[0]) === 1\r\n && abs(endDirection[1]) === 1\r\n && startDirection[0] !== endDirection[0]\r\n && startDirection[1] !== endDirection[1]) {\r\n sizeOffset = getDragDist({\r\n datas: datas,\r\n distX: -otherVerticalOffset,\r\n distY: -otherHorizontalOffset,\r\n });\r\n }\r\n else {\r\n sizeOffset = solveNextOffset(otherStartPos, otherEndPos, -(isVertical ? otherVerticalOffset : otherHorizontalOffset), isVertical, datas).offset;\r\n }\r\n sizeOffset = sizeOffset.map(function (size, i) { return size * (multiple[i] ? 2 / multiple[i] : 0); });\r\n return {\r\n sign: multiple,\r\n isBound: isVertical ? isOtherVerticalBound : isOtherHorizontalBound,\r\n isSnap: isVertical ? isOtherVerticalSnap : isOtherHorizontalSnap,\r\n offset: sizeOffset,\r\n };\r\n });\r\n}\r\nfunction getSnapBoundOffset(boundInfo, snapInfo) {\r\n if (boundInfo.isBound) {\r\n return boundInfo.offset;\r\n }\r\n else if (snapInfo.isSnap) {\r\n return snapInfo.offset;\r\n }\r\n return 0;\r\n}\r\nfunction checkSnapBoundsKeepRatio(moveable, startPos, endPos, isRequest) {\r\n var _a = checkBoundKeepRatio(moveable, startPos, endPos), horizontalBoundInfo = _a.horizontal, verticalBoundInfo = _a.vertical;\r\n var _b = isRequest ? {\r\n horizontal: { isSnap: false },\r\n vertical: { isSnap: false },\r\n } : checkSnapKeepRatio(moveable, startPos, endPos), horizontalSnapInfo = _b.horizontal, verticalSnapInfo = _b.vertical;\r\n var horizontalOffset = getSnapBoundOffset(horizontalBoundInfo, horizontalSnapInfo);\r\n var verticalOffset = getSnapBoundOffset(verticalBoundInfo, verticalSnapInfo);\r\n var horizontalDist = abs(horizontalOffset);\r\n var verticalDist = abs(verticalOffset);\r\n return {\r\n horizontal: {\r\n isBound: horizontalBoundInfo.isBound,\r\n isSnap: horizontalSnapInfo.isSnap,\r\n offset: horizontalOffset,\r\n dist: horizontalDist,\r\n },\r\n vertical: {\r\n isBound: verticalBoundInfo.isBound,\r\n isSnap: verticalSnapInfo.isSnap,\r\n offset: verticalOffset,\r\n dist: verticalDist,\r\n },\r\n };\r\n}\r\nfunction checkMaxBounds(moveable, poses, direction, fixedPosition, datas) {\r\n var fixedDirection = [-direction[0], -direction[1]];\r\n var _a = moveable.state, width = _a.width, height = _a.height;\r\n var bounds = moveable.props.bounds;\r\n var maxWidth = Infinity;\r\n var maxHeight = Infinity;\r\n if (bounds) {\r\n var directions = [\r\n [direction[0], -direction[1]],\r\n [-direction[0], direction[1]],\r\n ];\r\n var _b = bounds.left, left_1 = _b === void 0 ? -Infinity : _b, _c = bounds.top, top_1 = _c === void 0 ? -Infinity : _c, _d = bounds.right, right_1 = _d === void 0 ? Infinity : _d, _e = bounds.bottom, bottom_1 = _e === void 0 ? Infinity : _e;\r\n directions.forEach(function (otherDirection) {\r\n var isCheckVertical = otherDirection[0] !== fixedDirection[0];\r\n var isCheckHorizontal = otherDirection[1] !== fixedDirection[1];\r\n var otherPos = getPosByDirection(poses, otherDirection);\r\n var deg = (getRad(fixedPosition, otherPos) * 360) / Math.PI;\r\n if (isCheckHorizontal) {\r\n var nextOtherPos = otherPos.slice();\r\n if (abs(deg - 360) < 2 || abs(deg - 180) < 2) {\r\n nextOtherPos[1] = fixedPosition[1];\r\n }\r\n var _a = solveNextOffset(fixedPosition, nextOtherPos, (fixedPosition[1] < otherPos[1] ? bottom_1 : top_1) -\r\n otherPos[1], false, datas), _b = __read(_a.offset, 2), heightOffset = _b[1], isHeightOutside = _a.isOutside;\r\n if (!isNaN(heightOffset)) {\r\n maxHeight = height + (isHeightOutside ? 1 : -1) * abs(heightOffset);\r\n }\r\n }\r\n if (isCheckVertical) {\r\n var nextOtherPos = otherPos.slice();\r\n if (abs(deg - 90) < 2 || abs(deg - 270) < 2) {\r\n nextOtherPos[0] = fixedPosition[0];\r\n }\r\n var _c = solveNextOffset(fixedPosition, nextOtherPos, (fixedPosition[0] < otherPos[0] ? right_1 : left_1) - otherPos[0], true, datas), _d = __read(_c.offset, 1), widthOffset = _d[0], isWidthOutside = _c.isOutside;\r\n if (!isNaN(widthOffset)) {\r\n maxWidth = width + (isWidthOutside ? 1 : -1) * abs(widthOffset);\r\n }\r\n }\r\n });\r\n }\r\n return {\r\n maxWidth: maxWidth,\r\n maxHeight: maxHeight,\r\n };\r\n}\n\n/**\r\n * @namespace Draggable\r\n * @memberof Moveable\r\n * @description Draggable refers to the ability to drag and move targets.\r\n */\r\nvar Draggable = {\r\n name: \"draggable\",\r\n props: [\r\n \"draggable\",\r\n \"throttleDrag\",\r\n \"throttleDragRotate\",\r\n \"hideThrottleDragRotateLine\",\r\n \"startDragRotate\",\r\n \"edgeDraggable\",\r\n ],\r\n events: [\r\n \"dragStart\",\r\n \"drag\",\r\n \"dragEnd\",\r\n \"dragGroupStart\",\r\n \"dragGroup\",\r\n \"dragGroupEnd\",\r\n ],\r\n requestStyle: function () {\r\n return [\"left\", \"top\", \"right\", \"bottom\"];\r\n },\r\n requestChildStyle: function () {\r\n return [\"left\", \"top\", \"right\", \"bottom\"];\r\n },\r\n render: function (moveable, React) {\r\n var _a = moveable.props, hideThrottleDragRotateLine = _a.hideThrottleDragRotateLine, throttleDragRotate = _a.throttleDragRotate, zoom = _a.zoom;\r\n var _b = moveable.getState(), dragInfo = _b.dragInfo, beforeOrigin = _b.beforeOrigin;\r\n if (hideThrottleDragRotateLine || !throttleDragRotate || !dragInfo) {\r\n return [];\r\n }\r\n var dist = dragInfo.dist;\r\n if (!dist[0] && !dist[1]) {\r\n return [];\r\n }\r\n var width = getDistSize(dist);\r\n var rad = getRad(dist, [0, 0]);\r\n return [React.createElement(\"div\", { className: prefix(\"line\", \"horizontal\", \"dragline\", \"dashed\"), key: \"dragRotateGuideline\", style: {\r\n width: \"\".concat(width, \"px\"),\r\n transform: \"translate(\".concat(beforeOrigin[0], \"px, \").concat(beforeOrigin[1], \"px) rotate(\").concat(rad, \"rad) scaleY(\").concat(zoom, \")\"),\r\n } })];\r\n },\r\n dragStart: function (moveable, e) {\r\n var datas = e.datas, parentEvent = e.parentEvent, parentGesto = e.parentGesto;\r\n var state = moveable.state;\r\n var gestos = state.gestos, style = state.style;\r\n if (gestos.draggable) {\r\n return false;\r\n }\r\n gestos.draggable = parentGesto || moveable.targetGesto;\r\n datas.datas = {};\r\n datas.left = parseFloat(style.left || \"\") || 0;\r\n datas.top = parseFloat(style.top || \"\") || 0;\r\n datas.bottom = parseFloat(style.bottom || \"\") || 0;\r\n datas.right = parseFloat(style.right || \"\") || 0;\r\n datas.startValue = [0, 0];\r\n setDragStart(moveable, e);\r\n setDefaultTransformIndex(moveable, e, \"translate\");\r\n startCheckSnapDrag(moveable, datas);\r\n datas.prevDist = [0, 0];\r\n datas.prevBeforeDist = [0, 0];\r\n datas.isDrag = false;\r\n datas.deltaOffset = [0, 0];\r\n var params = fillParams(moveable, e, __assign({ set: function (translate) {\r\n datas.startValue = translate;\r\n } }, fillTransformStartEvent(moveable, e)));\r\n var result = parentEvent || triggerEvent(moveable, \"onDragStart\", params);\r\n if (result !== false) {\r\n datas.isDrag = true;\r\n moveable.state.dragInfo = {\r\n startRect: moveable.getRect(),\r\n dist: [0, 0],\r\n };\r\n }\r\n else {\r\n gestos.draggable = null;\r\n datas.isPinch = false;\r\n }\r\n return datas.isDrag ? params : false;\r\n },\r\n drag: function (moveable, e) {\r\n if (!e) {\r\n return;\r\n }\r\n resolveTransformEvent(moveable, e, \"translate\");\r\n var datas = e.datas, parentEvent = e.parentEvent, parentFlag = e.parentFlag, isPinch = e.isPinch, deltaOffset = e.deltaOffset, useSnap = e.useSnap, isRequest = e.isRequest, isGroup = e.isGroup, parentThrottleDrag = e.parentThrottleDrag;\r\n var distX = e.distX, distY = e.distY;\r\n var isDrag = datas.isDrag, prevDist = datas.prevDist, prevBeforeDist = datas.prevBeforeDist, startValue = datas.startValue;\r\n if (!isDrag) {\r\n return;\r\n }\r\n if (deltaOffset) {\r\n distX += deltaOffset[0];\r\n distY += deltaOffset[1];\r\n }\r\n var props = moveable.props;\r\n var parentMoveable = props.parentMoveable;\r\n var throttleDrag = isGroup ? 0 : (props.throttleDrag || parentThrottleDrag || 0);\r\n var throttleDragRotate = parentEvent ? 0 : (props.throttleDragRotate || 0);\r\n var dragRotateRad = 0;\r\n var isVerticalSnap = false;\r\n var isVerticalBound = false;\r\n var isHorizontalSnap = false;\r\n var isHorizontalBound = false;\r\n if (!parentEvent && throttleDragRotate > 0 && (distX || distY)) {\r\n var startDragRotate = props.startDragRotate || 0;\r\n var deg = throttle(startDragRotate + getRad([0, 0], [distX, distY]) * 180 / Math.PI, throttleDragRotate)\r\n - startDragRotate;\r\n var ry = distY * Math.abs(Math.cos((deg - 90) / 180 * Math.PI));\r\n var rx = distX * Math.abs(Math.cos(deg / 180 * Math.PI));\r\n var r = getDistSize([rx, ry]);\r\n dragRotateRad = deg * Math.PI / 180;\r\n distX = r * Math.cos(dragRotateRad);\r\n distY = r * Math.sin(dragRotateRad);\r\n }\r\n if (!isPinch && !parentEvent && !parentFlag) {\r\n var _a = __read(checkSnapBoundsDrag(moveable, distX, distY, throttleDragRotate, (!useSnap && isRequest) || deltaOffset, datas), 2), verticalInfo = _a[0], horizontalInfo = _a[1];\r\n isVerticalSnap = verticalInfo.isSnap;\r\n isVerticalBound = verticalInfo.isBound;\r\n isHorizontalSnap = horizontalInfo.isSnap;\r\n isHorizontalBound = horizontalInfo.isBound;\r\n var verticalOffset = verticalInfo.offset;\r\n var horizontalOffset = horizontalInfo.offset;\r\n distX += verticalOffset;\r\n distY += horizontalOffset;\r\n }\r\n var beforeTranslate = plus(getBeforeDragDist({ datas: datas, distX: distX, distY: distY }), startValue);\r\n var translate = plus(getTransformDist({ datas: datas, distX: distX, distY: distY }), startValue);\r\n throttleArray(translate, TINY_NUM);\r\n throttleArray(beforeTranslate, TINY_NUM);\r\n if (!throttleDragRotate) {\r\n if (!isVerticalSnap && !isVerticalBound) {\r\n translate[0] = throttle(translate[0], throttleDrag);\r\n beforeTranslate[0] = throttle(beforeTranslate[0], throttleDrag);\r\n }\r\n if (!isHorizontalSnap && !isHorizontalBound) {\r\n translate[1] = throttle(translate[1], throttleDrag);\r\n beforeTranslate[1] = throttle(beforeTranslate[1], throttleDrag);\r\n }\r\n }\r\n var beforeDist = minus(beforeTranslate, startValue);\r\n var dist = minus(translate, startValue);\r\n var delta = minus(dist, prevDist);\r\n var beforeDelta = minus(beforeDist, prevBeforeDist);\r\n datas.prevDist = dist;\r\n datas.prevBeforeDist = beforeDist;\r\n datas.passDelta = delta; //distX - (datas.passDistX || 0);\r\n // datas.passDeltaY = distY - (datas.passDistY || 0);\r\n datas.passDist = dist; //distX;\r\n // datas.passDistY = distY;\r\n var left = datas.left + beforeDist[0];\r\n var top = datas.top + beforeDist[1];\r\n var right = datas.right - beforeDist[0];\r\n var bottom = datas.bottom - beforeDist[1];\r\n var nextTransform = convertTransformFormat(datas, \"translate(\".concat(translate[0], \"px, \").concat(translate[1], \"px)\"), \"translate(\".concat(dist[0], \"px, \").concat(dist[1], \"px)\"));\r\n fillOriginalTransform(e, nextTransform);\r\n moveable.state.dragInfo.dist = parentEvent ? [0, 0] : dist;\r\n if (!parentEvent && !parentMoveable && delta.every(function (num) { return !num; }) && beforeDelta.some(function (num) { return !num; })) {\r\n return;\r\n }\r\n var _b = moveable.state, width = _b.width, height = _b.height;\r\n var params = fillParams(moveable, e, __assign({ transform: nextTransform, dist: dist, delta: delta, translate: translate, beforeDist: beforeDist, beforeDelta: beforeDelta, beforeTranslate: beforeTranslate, left: left, top: top, right: right, bottom: bottom, width: width, height: height, isPinch: isPinch }, fillCSSObject({\r\n transform: nextTransform,\r\n }, e)));\r\n !parentEvent && triggerEvent(moveable, \"onDrag\", params);\r\n return params;\r\n },\r\n dragAfter: function (moveable, e) {\r\n var datas = e.datas;\r\n var deltaOffset = datas.deltaOffset;\r\n if (deltaOffset[0] || deltaOffset[1]) {\r\n datas.deltaOffset = [0, 0];\r\n return this.drag(moveable, __assign(__assign({}, e), { deltaOffset: deltaOffset }));\r\n }\r\n return false;\r\n },\r\n dragEnd: function (moveable, e) {\r\n var parentEvent = e.parentEvent, datas = e.datas;\r\n moveable.state.dragInfo = null;\r\n if (!datas.isDrag) {\r\n return;\r\n }\r\n datas.isDrag = false;\r\n var param = fillEndParams(moveable, e, {});\r\n !parentEvent && triggerEvent(moveable, \"onDragEnd\", param);\r\n return param;\r\n },\r\n dragGroupStart: function (moveable, e) {\r\n var _a, _b;\r\n var datas = e.datas, clientX = e.clientX, clientY = e.clientY;\r\n var params = this.dragStart(moveable, e);\r\n if (!params) {\r\n return false;\r\n }\r\n var _c = triggerChildGesto(moveable, this, \"dragStart\", [\r\n clientX || 0,\r\n clientY || 0,\r\n ], e, false, \"draggable\"), childEvents = _c.childEvents, eventParams = _c.eventParams;\r\n var nextParams = __assign(__assign({}, params), { targets: moveable.props.targets, events: eventParams });\r\n var result = triggerEvent(moveable, \"onDragGroupStart\", nextParams);\r\n datas.isDrag = result !== false;\r\n // find data.startValue and based on first child moveable\r\n var startValue = (_b = (_a = childEvents[0]) === null || _a === void 0 ? void 0 : _a.datas.startValue) !== null && _b !== void 0 ? _b : [0, 0];\r\n datas.throttleOffset = [startValue[0] % 1, startValue[1] % 1];\r\n return datas.isDrag ? params : false;\r\n },\r\n dragGroup: function (moveable, e) {\r\n var datas = e.datas;\r\n if (!datas.isDrag) {\r\n return;\r\n }\r\n var params = this.drag(moveable, __assign(__assign({}, e), { parentThrottleDrag: moveable.props.throttleDrag }));\r\n var passDelta = e.datas.passDelta;\r\n var eventParams = triggerChildGesto(moveable, this, \"drag\", passDelta, e, false, \"draggable\").eventParams;\r\n if (!params) {\r\n return;\r\n }\r\n var nextParams = __assign({ targets: moveable.props.targets, events: eventParams }, params);\r\n triggerEvent(moveable, \"onDragGroup\", nextParams);\r\n return nextParams;\r\n },\r\n dragGroupEnd: function (moveable, e) {\r\n var isDrag = e.isDrag, datas = e.datas;\r\n if (!datas.isDrag) {\r\n return;\r\n }\r\n this.dragEnd(moveable, e);\r\n var eventParams = triggerChildGesto(moveable, this, \"dragEnd\", [0, 0], e, false, \"draggable\").eventParams;\r\n triggerEvent(moveable, \"onDragGroupEnd\", fillEndParams(moveable, e, {\r\n targets: moveable.props.targets,\r\n events: eventParams,\r\n }));\r\n return isDrag;\r\n },\r\n /**\r\n * @method Moveable.Draggable#request\r\n * @param {object} [e] - the draggable's request parameter\r\n * @param {number} [e.x] - x position\r\n * @param {number} [e.y] - y position\r\n * @param {number} [e.deltaX] - X number to move\r\n * @param {number} [e.deltaY] - Y number to move\r\n * @return {Moveable.Requester} Moveable Requester\r\n * @example\r\n\n * // Instantly Request (requestStart - request - requestEnd)\r\n * // Use Relative Value\r\n * moveable.request(\"draggable\", { deltaX: 10, deltaY: 10 }, true);\r\n * // Use Absolute Value\r\n * moveable.request(\"draggable\", { x: 200, y: 100 }, true);\r\n *\r\n * // requestStart\r\n * const requester = moveable.request(\"draggable\");\r\n *\r\n * // request\r\n * // Use Relative Value\r\n * requester.request({ deltaX: 10, deltaY: 10 });\r\n * requester.request({ deltaX: 10, deltaY: 10 });\r\n * requester.request({ deltaX: 10, deltaY: 10 });\r\n * // Use Absolute Value\r\n * moveable.request(\"draggable\", { x: 200, y: 100 });\r\n * moveable.request(\"draggable\", { x: 220, y: 100 });\r\n * moveable.request(\"draggable\", { x: 240, y: 100 });\r\n *\r\n * // requestEnd\r\n * requester.requestEnd();\r\n */\r\n request: function (moveable) {\r\n var datas = {};\r\n var rect = moveable.getRect();\r\n var distX = 0;\r\n var distY = 0;\r\n var useSnap = false;\r\n return {\r\n isControl: false,\r\n requestStart: function (e) {\r\n useSnap = e.useSnap;\r\n return { datas: datas, useSnap: useSnap };\r\n },\r\n request: function (e) {\r\n if (\"x\" in e) {\r\n distX = e.x - rect.left;\r\n }\r\n else if (\"deltaX\" in e) {\r\n distX += e.deltaX;\r\n }\r\n if (\"y\" in e) {\r\n distY = e.y - rect.top;\r\n }\r\n else if (\"deltaY\" in e) {\r\n distY += e.deltaY;\r\n }\r\n return { datas: datas, distX: distX, distY: distY, useSnap: useSnap };\r\n },\r\n requestEnd: function () {\r\n return { datas: datas, isDrag: true, useSnap: useSnap };\r\n },\r\n };\r\n },\r\n unset: function (moveable) {\r\n moveable.state.gestos.draggable = null;\r\n moveable.state.dragInfo = null;\r\n },\r\n};\r\n/**\r\n * Whether or not target can be dragged. (default: false)\r\n * @name Moveable.Draggable#draggable\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.draggable = true;\r\n */\r\n/**\r\n * throttle of x, y when drag.\r\n * @name Moveable.Draggable#throttleDrag\r\n * @default 0\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.throttleDrag = 1;\r\n */\r\n/**\r\n* throttle of angle of x, y when drag.\r\n* @name Moveable.Draggable#throttleDragRotate\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body);\r\n*\r\n* moveable.throttleDragRotate = 45;\r\n*/\r\n/**\r\n* start angle of throttleDragRotate of x, y when drag.\r\n* @name Moveable.Draggable#startDragRotate\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body);\r\n*\r\n* // 45, 135, 225, 315\r\n* moveable.throttleDragRotate = 90;\r\n* moveable.startDragRotate = 45;\r\n*/\r\n/**\r\n * When the drag starts, the dragStart event is called.\r\n * @memberof Moveable.Draggable\r\n * @event dragStart\r\n * @param {Moveable.Draggable.OnDragStart} - Parameters for the dragStart event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { draggable: true });\r\n * moveable.on(\"dragStart\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n */\r\n/**\r\n * When dragging, the drag event is called.\r\n * @memberof Moveable.Draggable\r\n * @event drag\r\n * @param {Moveable.Draggable.OnDrag} - Parameters for the drag event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { draggable: true });\r\n * moveable.on(\"drag\", ({ target, transform }) => {\r\n * target.style.transform = transform;\r\n * });\r\n */\r\n/**\r\n * When the drag finishes, the dragEnd event is called.\r\n * @memberof Moveable.Draggable\r\n * @event dragEnd\r\n * @param {Moveable.Draggable.OnDragEnd} - Parameters for the dragEnd event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { draggable: true });\r\n * moveable.on(\"dragEnd\", ({ target, isDrag }) => {\r\n * console.log(target, isDrag);\r\n * });\r\n */\r\n/**\r\n* When the group drag starts, the `dragGroupStart` event is called.\r\n* @memberof Moveable.Draggable\r\n* @event dragGroupStart\r\n* @param {Moveable.Draggable.OnDragGroupStart} - Parameters for the `dragGroupStart` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* target: [].slice.call(document.querySelectorAll(\".target\")),\r\n* draggable: true\r\n* });\r\n* moveable.on(\"dragGroupStart\", ({ targets }) => {\r\n* console.log(\"onDragGroupStart\", targets);\r\n* });\r\n*/\r\n/**\r\n* When the group drag, the `dragGroup` event is called.\r\n* @memberof Moveable.Draggable\r\n* @event dragGroup\r\n* @param {Moveable.Draggable.OnDragGroup} - Parameters for the `dragGroup` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* target: [].slice.call(document.querySelectorAll(\".target\")),\r\n* draggable: true\r\n* });\r\n* moveable.on(\"dragGroup\", ({ targets, events }) => {\r\n* console.log(\"onDragGroup\", targets);\r\n* events.forEach(ev => {\r\n* // drag event\r\n* console.log(\"onDrag left, top\", ev.left, ev.top);\r\n* // ev.target!.style.left = `${ev.left}px`;\r\n* // ev.target!.style.top = `${ev.top}px`;\r\n* console.log(\"onDrag translate\", ev.dist);\r\n* ev.target!.style.transform = ev.transform;)\r\n* });\r\n* });\r\n*/\r\n/**\r\n * When the group drag finishes, the `dragGroupEnd` event is called.\r\n * @memberof Moveable.Draggable\r\n * @event dragGroupEnd\r\n * @param {Moveable.Draggable.OnDragGroupEnd} - Parameters for the `dragGroupEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * draggable: true\r\n * });\r\n * moveable.on(\"dragGroupEnd\", ({ targets, isDrag }) => {\r\n * console.log(\"onDragGroupEnd\", targets, isDrag);\r\n * });\r\n */\n\nfunction getFixedDirectionInfo(startPositions, fixedDirection) {\r\n var fixedPosition = getPosByDirection(startPositions, fixedDirection);\r\n var fixedOffset = [0, 0];\r\n return {\r\n fixedPosition: fixedPosition,\r\n fixedDirection: fixedDirection,\r\n fixedOffset: fixedOffset,\r\n };\r\n}\r\nfunction getOffsetFixedDirectionInfo(state, fixedDirection) {\r\n // for start\r\n var allMatrix = state.allMatrix, is3d = state.is3d, width = state.width, height = state.height;\r\n var n = is3d ? 4 : 3;\r\n var nextFixedOffset = [\r\n width / 2 * (1 + fixedDirection[0]),\r\n height / 2 * (1 + fixedDirection[1]),\r\n ];\r\n var fixedPosition = calculatePosition(allMatrix, nextFixedOffset, n);\r\n var fixedOffset = [0, 0];\r\n return {\r\n fixedPosition: fixedPosition,\r\n fixedDirection: fixedDirection,\r\n fixedOffset: fixedOffset,\r\n };\r\n}\r\nfunction getOffsetFixedPositionInfo(state, offsetFixedPosition) {\r\n // for start\r\n var allMatrix = state.allMatrix, is3d = state.is3d, width = state.width, height = state.height;\r\n var n = is3d ? 4 : 3;\r\n var fixedDirection = getDirectionByPos(offsetFixedPosition, width, height);\r\n var nextFixedPosition = calculatePosition(allMatrix, offsetFixedPosition, n);\r\n var fixedOffset = [\r\n width ? 0 : offsetFixedPosition[0],\r\n height ? 0 : offsetFixedPosition[1],\r\n ];\r\n return {\r\n fixedPosition: nextFixedPosition,\r\n fixedDirection: fixedDirection,\r\n fixedOffset: fixedOffset,\r\n };\r\n}\n\n/**\r\n * @namespace Resizable\r\n * @memberof Moveable\r\n * @description Resizable indicates whether the target's width and height can be increased or decreased.\r\n */\r\nvar directionCondition$2 = getDirectionCondition(\"resizable\");\r\nvar Resizable = {\r\n name: \"resizable\",\r\n ableGroup: \"size\",\r\n canPinch: true,\r\n props: [\r\n \"resizable\",\r\n \"throttleResize\",\r\n \"renderDirections\",\r\n \"displayAroundControls\",\r\n \"keepRatio\",\r\n \"resizeFormat\",\r\n \"keepRatioFinally\",\r\n \"edge\",\r\n \"checkResizableError\",\r\n ],\r\n events: [\r\n \"resizeStart\",\r\n \"beforeResize\",\r\n \"resize\",\r\n \"resizeEnd\",\r\n \"resizeGroupStart\",\r\n \"beforeResizeGroup\",\r\n \"resizeGroup\",\r\n \"resizeGroupEnd\",\r\n ],\r\n render: getRenderDirections(\"resizable\"),\r\n dragControlCondition: directionCondition$2,\r\n viewClassName: getDirectionViewClassName(\"resizable\"),\r\n dragControlStart: function (moveable, e) {\r\n var _a;\r\n var inputEvent = e.inputEvent, isPinch = e.isPinch, isGroup = e.isGroup, parentDirection = e.parentDirection, parentGesto = e.parentGesto, datas = e.datas, parentFixedDirection = e.parentFixedDirection, parentEvent = e.parentEvent;\r\n var direction = getTotalDirection(parentDirection, isPinch, inputEvent, datas);\r\n var state = moveable.state;\r\n var target = state.target, width = state.width, height = state.height, gestos = state.gestos;\r\n if (!direction || !target) {\r\n return false;\r\n }\r\n if (gestos.resizable) {\r\n return false;\r\n }\r\n gestos.resizable = parentGesto || moveable.controlGesto;\r\n !isPinch && setDragStart(moveable, e);\r\n datas.datas = {};\r\n datas.direction = direction;\r\n datas.startOffsetWidth = width;\r\n datas.startOffsetHeight = height;\r\n datas.prevWidth = 0;\r\n datas.prevHeight = 0;\r\n datas.minSize = [0, 0];\r\n datas.startWidth = state.inlineCSSWidth || state.cssWidth;\r\n datas.startHeight = state.inlineCSSHeight || state.cssHeight;\r\n datas.maxSize = [Infinity, Infinity];\r\n if (!isGroup) {\r\n datas.minSize = [\r\n state.minOffsetWidth,\r\n state.minOffsetHeight,\r\n ];\r\n datas.maxSize = [\r\n state.maxOffsetWidth,\r\n state.maxOffsetHeight,\r\n ];\r\n }\r\n var transformOrigin = moveable.props.transformOrigin || \"% %\";\r\n datas.transformOrigin = transformOrigin && isString(transformOrigin)\r\n ? transformOrigin.split(\" \")\r\n : transformOrigin;\r\n datas.startOffsetMatrix = state.offsetMatrix;\r\n datas.startTransformOrigin = state.transformOrigin;\r\n datas.isWidth = (_a = e === null || e === void 0 ? void 0 : e.parentIsWidth) !== null && _a !== void 0 ? _a : ((!direction[0] && !direction[1]) || direction[0] || !direction[1]);\r\n function setRatio(ratio) {\r\n datas.ratio = ratio && isFinite(ratio) ? ratio : 0;\r\n }\r\n datas.startPositions = getAbsolutePosesByState(moveable.state);\r\n function setFixedDirection(fixedDirection) {\r\n var result = getFixedDirectionInfo(datas.startPositions, fixedDirection);\r\n datas.fixedDirection = result.fixedDirection;\r\n datas.fixedPosition = result.fixedPosition;\r\n datas.fixedOffset = result.fixedOffset;\r\n }\r\n function setFixedPosition(fixedPosition) {\r\n var result = getOffsetFixedPositionInfo(moveable.state, fixedPosition);\r\n datas.fixedDirection = result.fixedDirection;\r\n datas.fixedPosition = result.fixedPosition;\r\n datas.fixedOffset = result.fixedOffset;\r\n }\r\n function setMin(minSize) {\r\n datas.minSize = [\r\n convertUnitSize(\"\".concat(minSize[0]), 0) || 0,\r\n convertUnitSize(\"\".concat(minSize[1]), 0) || 0,\r\n ];\r\n }\r\n function setMax(maxSize) {\r\n var nextMaxSize = [\r\n maxSize[0] || Infinity,\r\n maxSize[1] || Infinity,\r\n ];\r\n if (!isNumber(nextMaxSize[0]) || isFinite(nextMaxSize[0])) {\r\n nextMaxSize[0] = convertUnitSize(\"\".concat(nextMaxSize[0]), 0) || Infinity;\r\n }\r\n if (!isNumber(nextMaxSize[1]) || isFinite(nextMaxSize[1])) {\r\n nextMaxSize[1] = convertUnitSize(\"\".concat(nextMaxSize[1]), 0) || Infinity;\r\n }\r\n datas.maxSize = nextMaxSize;\r\n }\r\n setRatio(width / height);\r\n setFixedDirection(parentFixedDirection || [-direction[0], -direction[1]]);\r\n datas.setFixedDirection = setFixedDirection;\r\n datas.setFixedPosition = setFixedPosition;\r\n datas.setMin = setMin;\r\n datas.setMax = setMax;\r\n var params = fillParams(moveable, e, {\r\n direction: direction,\r\n startRatio: datas.ratio,\r\n set: function (_a) {\r\n var _b = __read(_a, 2), startWidth = _b[0], startHeight = _b[1];\r\n datas.startWidth = startWidth;\r\n datas.startHeight = startHeight;\r\n },\r\n setMin: setMin,\r\n setMax: setMax,\r\n setRatio: setRatio,\r\n setFixedDirection: setFixedDirection,\r\n setFixedPosition: setFixedPosition,\r\n setOrigin: function (origin) {\r\n datas.transformOrigin = origin;\r\n },\r\n dragStart: Draggable.dragStart(moveable, new CustomGesto().dragStart([0, 0], e)),\r\n });\r\n var result = parentEvent || triggerEvent(moveable, \"onResizeStart\", params);\r\n datas.startFixedDirection = datas.fixedDirection;\r\n datas.startFixedPosition = datas.fixedPosition;\r\n if (result !== false) {\r\n datas.isResize = true;\r\n moveable.state.snapRenderInfo = {\r\n request: e.isRequest,\r\n direction: direction,\r\n };\r\n }\r\n return datas.isResize ? params : false;\r\n },\r\n dragControl: function (moveable, e) {\r\n var _a;\r\n var datas = e.datas, parentFlag = e.parentFlag, isPinch = e.isPinch, parentKeepRatio = e.parentKeepRatio, dragClient = e.dragClient, parentDist = e.parentDist, useSnap = e.useSnap, isRequest = e.isRequest, isGroup = e.isGroup, parentEvent = e.parentEvent, resolveMatrix = e.resolveMatrix;\r\n var isResize = datas.isResize, transformOrigin = datas.transformOrigin, startWidth = datas.startWidth, startHeight = datas.startHeight, prevWidth = datas.prevWidth, prevHeight = datas.prevHeight, minSize = datas.minSize, maxSize = datas.maxSize, ratio = datas.ratio, startOffsetWidth = datas.startOffsetWidth, startOffsetHeight = datas.startOffsetHeight, isWidth = datas.isWidth;\r\n if (!isResize) {\r\n return;\r\n }\r\n if (resolveMatrix) {\r\n var is3d = moveable.state.is3d;\r\n var startOffsetMatrix = datas.startOffsetMatrix, startTransformOrigin = datas.startTransformOrigin;\r\n var n = is3d ? 4 : 3;\r\n var targetMatrix = parseMat(getNextTransforms(e));\r\n var targetN = Math.sqrt(targetMatrix.length);\r\n if (n !== targetN) {\r\n targetMatrix = convertDimension(targetMatrix, targetN, n);\r\n }\r\n var nextAllMatrix = getNextMatrix(startOffsetMatrix, targetMatrix, startTransformOrigin, n);\r\n var poses = calculatePoses(nextAllMatrix, startOffsetWidth, startOffsetHeight, n);\r\n datas.startPositions = poses;\r\n datas.nextTargetMatrix = targetMatrix;\r\n datas.nextAllMatrix = nextAllMatrix;\r\n }\r\n var props = getProps(moveable.props, \"resizable\");\r\n var resizeFormat = props.resizeFormat, _b = props.throttleResize, throttleResize = _b === void 0 ? parentFlag ? 0 : 1 : _b, parentMoveable = props.parentMoveable, keepRatioFinally = props.keepRatioFinally;\r\n var direction = datas.direction;\r\n var sizeDirection = direction;\r\n var distWidth = 0;\r\n var distHeight = 0;\r\n if (!direction[0] && !direction[1]) {\r\n sizeDirection = [1, 1];\r\n }\r\n var keepRatio = (ratio && (parentKeepRatio != null ? parentKeepRatio : props.keepRatio)) || false;\r\n function getNextBoundingSize() {\r\n var fixedDirection = datas.fixedDirection;\r\n var nextSize = getOffsetSizeDist(sizeDirection, keepRatio, datas, e);\r\n distWidth = nextSize.distWidth;\r\n distHeight = nextSize.distHeight;\r\n var nextWidth = (sizeDirection[0] - fixedDirection[0]) || keepRatio\r\n ? Math.max(startOffsetWidth + distWidth, TINY_NUM) : startOffsetWidth;\r\n var nextHeight = (sizeDirection[1] - fixedDirection[1]) || keepRatio\r\n ? Math.max(startOffsetHeight + distHeight, TINY_NUM) : startOffsetHeight;\r\n if (keepRatio && startOffsetWidth && startOffsetHeight) {\r\n // startOffsetWidth : startOffsetHeight = nextWidth : nextHeight\r\n if (isWidth) {\r\n nextHeight = nextWidth / ratio;\r\n }\r\n else {\r\n nextWidth = nextHeight * ratio;\r\n }\r\n }\r\n return [nextWidth, nextHeight];\r\n }\r\n var _c = __read(getNextBoundingSize(), 2), boundingWidth = _c[0], boundingHeight = _c[1];\r\n if (!parentEvent) {\r\n datas.setFixedDirection(datas.fixedDirection);\r\n triggerEvent(moveable, \"onBeforeResize\", fillParams(moveable, e, {\r\n startFixedDirection: datas.startFixedDirection,\r\n startFixedPosition: datas.startFixedPosition,\r\n setFixedDirection: function (nextFixedDirection) {\r\n var _a;\r\n datas.setFixedDirection(nextFixedDirection);\r\n _a = __read(getNextBoundingSize(), 2), boundingWidth = _a[0], boundingHeight = _a[1];\r\n return [boundingWidth, boundingHeight];\r\n },\r\n setFixedPosition: function (nextFixedPosition) {\r\n var _a;\r\n datas.setFixedPosition(nextFixedPosition);\r\n _a = __read(getNextBoundingSize(), 2), boundingWidth = _a[0], boundingHeight = _a[1];\r\n return [boundingWidth, boundingHeight];\r\n },\r\n boundingWidth: boundingWidth,\r\n boundingHeight: boundingHeight,\r\n setSize: function (size) {\r\n var _a;\r\n _a = __read(size, 2), boundingWidth = _a[0], boundingHeight = _a[1];\r\n },\r\n }, true));\r\n }\r\n var fixedPosition = dragClient;\r\n if (!dragClient) {\r\n if (!parentFlag && isPinch) {\r\n fixedPosition = getAbsolutePosition(moveable, [0, 0]);\r\n }\r\n else {\r\n fixedPosition = datas.fixedPosition;\r\n }\r\n }\r\n var snapDist = [0, 0];\r\n if (!isPinch) {\r\n snapDist = checkSnapResize(moveable, boundingWidth, boundingHeight, direction, fixedPosition, !useSnap && isRequest, datas);\r\n }\r\n if (parentDist) {\r\n !parentDist[0] && (snapDist[0] = 0);\r\n !parentDist[1] && (snapDist[1] = 0);\r\n }\r\n function computeSize() {\r\n var _a;\r\n if (resizeFormat) {\r\n _a = __read(resizeFormat([boundingWidth, boundingHeight]), 2), boundingWidth = _a[0], boundingHeight = _a[1];\r\n }\r\n boundingWidth = throttle(boundingWidth, throttleResize);\r\n boundingHeight = throttle(boundingHeight, throttleResize);\r\n }\r\n if (keepRatio) {\r\n if (sizeDirection[0] && sizeDirection[1] && snapDist[0] && snapDist[1]) {\r\n if (abs(snapDist[0]) > abs(snapDist[1])) {\r\n snapDist[1] = 0;\r\n }\r\n else {\r\n snapDist[0] = 0;\r\n }\r\n }\r\n var isNoSnap = !snapDist[0] && !snapDist[1];\r\n if (isNoSnap) {\r\n // pre-compute before maintaining the ratio\r\n computeSize();\r\n }\r\n if ((sizeDirection[0] && !sizeDirection[1])\r\n || (snapDist[0] && !snapDist[1])\r\n || (isNoSnap && isWidth)) {\r\n boundingWidth += snapDist[0];\r\n boundingHeight = boundingWidth / ratio;\r\n }\r\n else if ((!sizeDirection[0] && sizeDirection[1])\r\n || (!snapDist[0] && snapDist[1])\r\n || (isNoSnap && !isWidth)) {\r\n boundingHeight += snapDist[1];\r\n boundingWidth = boundingHeight * ratio;\r\n }\r\n }\r\n else {\r\n boundingWidth += snapDist[0];\r\n boundingHeight += snapDist[1];\r\n boundingWidth = Math.max(0, boundingWidth);\r\n boundingHeight = Math.max(0, boundingHeight);\r\n }\r\n _a = __read(calculateBoundSize([boundingWidth, boundingHeight], minSize, maxSize, keepRatio ? ratio : false), 2), boundingWidth = _a[0], boundingHeight = _a[1];\r\n computeSize();\r\n if (keepRatio && (isGroup || keepRatioFinally)) {\r\n if (isWidth) {\r\n boundingHeight = boundingWidth / ratio;\r\n }\r\n else {\r\n boundingWidth = boundingHeight * ratio;\r\n }\r\n }\r\n distWidth = boundingWidth - startOffsetWidth;\r\n distHeight = boundingHeight - startOffsetHeight;\r\n var delta = [distWidth - prevWidth, distHeight - prevHeight];\r\n datas.prevWidth = distWidth;\r\n datas.prevHeight = distHeight;\r\n var inverseDelta = getResizeDist(moveable, boundingWidth, boundingHeight, fixedPosition, transformOrigin, datas);\r\n if (!parentMoveable && delta.every(function (num) { return !num; }) && inverseDelta.every(function (num) { return !num; })) {\r\n return;\r\n }\r\n var drag = Draggable.drag(moveable, setCustomDrag(e, moveable.state, inverseDelta, !!isPinch, false, \"draggable\"));\r\n var transform = drag.transform;\r\n var nextWidth = startWidth + distWidth;\r\n var nextHeight = startHeight + distHeight;\r\n var params = fillParams(moveable, e, __assign({ width: nextWidth, height: nextHeight, offsetWidth: Math.round(boundingWidth), offsetHeight: Math.round(boundingHeight), startRatio: ratio, boundingWidth: boundingWidth, boundingHeight: boundingHeight, direction: direction, dist: [distWidth, distHeight], delta: delta, isPinch: !!isPinch, drag: drag }, fillAfterTransform({\r\n style: {\r\n width: \"\".concat(nextWidth, \"px\"),\r\n height: \"\".concat(nextHeight, \"px\"),\r\n },\r\n transform: transform,\r\n }, drag, e)));\r\n !parentEvent && triggerEvent(moveable, \"onResize\", params);\r\n return params;\r\n },\r\n dragControlAfter: function (moveable, e) {\r\n var datas = e.datas;\r\n var isResize = datas.isResize, startOffsetWidth = datas.startOffsetWidth, startOffsetHeight = datas.startOffsetHeight, prevWidth = datas.prevWidth, prevHeight = datas.prevHeight;\r\n if (!isResize || moveable.props.checkResizableError === false) {\r\n return;\r\n }\r\n var _a = moveable.state, width = _a.width, height = _a.height;\r\n var errorWidth = width - (startOffsetWidth + prevWidth);\r\n var errorHeight = height - (startOffsetHeight + prevHeight);\r\n var isErrorWidth = abs(errorWidth) > 3;\r\n var isErrorHeight = abs(errorHeight) > 3;\r\n if (isErrorWidth) {\r\n datas.startWidth += errorWidth;\r\n datas.startOffsetWidth += errorWidth;\r\n datas.prevWidth += errorWidth;\r\n }\r\n if (isErrorHeight) {\r\n datas.startHeight += errorHeight;\r\n datas.startOffsetHeight += errorHeight;\r\n datas.prevHeight += errorHeight;\r\n }\r\n if (isErrorWidth || isErrorHeight) {\r\n return this.dragControl(moveable, e);\r\n }\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n var datas = e.datas, parentEvent = e.parentEvent;\r\n if (!datas.isResize) {\r\n return;\r\n }\r\n datas.isResize = false;\r\n var params = fillEndParams(moveable, e, {});\r\n !parentEvent && triggerEvent(moveable, \"onResizeEnd\", params);\r\n return params;\r\n },\r\n dragGroupControlCondition: directionCondition$2,\r\n dragGroupControlStart: function (moveable, e) {\r\n var datas = e.datas;\r\n var params = this.dragControlStart(moveable, __assign(__assign({}, e), { isGroup: true }));\r\n if (!params) {\r\n return false;\r\n }\r\n var originalEvents = fillChildEvents(moveable, \"resizable\", e);\r\n var parentStartOffsetWidth = datas.startOffsetWidth, parentStartOffsetHeight = datas.startOffsetHeight;\r\n function updateGroupMin() {\r\n var originalMinSize = datas.minSize;\r\n originalEvents.forEach(function (ev) {\r\n var _a = ev.datas, childMinSize = _a.minSize, childStartOffsetWidth = _a.startOffsetWidth, childStartOffsetHeight = _a.startOffsetHeight;\r\n var parentMinWidth = parentStartOffsetWidth\r\n * (childStartOffsetWidth ? childMinSize[0] / childStartOffsetWidth : 0);\r\n var parentMinHeight = parentStartOffsetHeight\r\n * (childStartOffsetHeight ? childMinSize[1] / childStartOffsetHeight : 0);\r\n originalMinSize[0] = Math.max(originalMinSize[0], parentMinWidth);\r\n originalMinSize[1] = Math.max(originalMinSize[1], parentMinHeight);\r\n });\r\n }\r\n function updateGroupMax() {\r\n var originalMaxSize = datas.maxSize;\r\n originalEvents.forEach(function (ev) {\r\n var _a = ev.datas, childMaxSize = _a.maxSize, childStartOffsetWidth = _a.startOffsetWidth, childStartOffsetHeight = _a.startOffsetHeight;\r\n var parentMaxWidth = parentStartOffsetWidth\r\n * (childStartOffsetWidth ? childMaxSize[0] / childStartOffsetWidth : 0);\r\n var parentMaxHeight = parentStartOffsetHeight\r\n * (childStartOffsetHeight ? childMaxSize[1] / childStartOffsetHeight : 0);\r\n originalMaxSize[0] = Math.min(originalMaxSize[0], parentMaxWidth);\r\n originalMaxSize[1] = Math.min(originalMaxSize[1], parentMaxHeight);\r\n });\r\n }\r\n var events = triggerChildAbles(moveable, this, \"dragControlStart\", e, function (child, ev) {\r\n return startChildDist(moveable, child, datas, ev);\r\n });\r\n updateGroupMin();\r\n updateGroupMax();\r\n var setFixedDirection = function (fixedDirection) {\r\n params.setFixedDirection(fixedDirection);\r\n events.forEach(function (ev, i) {\r\n ev.setFixedDirection(fixedDirection);\r\n startChildDist(moveable, ev.moveable, datas, originalEvents[i]);\r\n });\r\n };\r\n datas.setFixedDirection = setFixedDirection;\r\n var nextParams = __assign(__assign({}, params), { targets: moveable.props.targets, events: events.map(function (ev) {\r\n return __assign(__assign({}, ev), { setMin: function (minSize) {\r\n ev.setMin(minSize);\r\n updateGroupMin();\r\n }, setMax: function (maxSize) {\r\n ev.setMax(maxSize);\r\n updateGroupMax();\r\n } });\r\n }), setFixedDirection: setFixedDirection, setMin: function (minSize) {\r\n params.setMin(minSize);\r\n updateGroupMin();\r\n }, setMax: function (maxSize) {\r\n params.setMax(maxSize);\r\n updateGroupMax();\r\n } });\r\n var result = triggerEvent(moveable, \"onResizeGroupStart\", nextParams);\r\n datas.isResize = result !== false;\r\n return datas.isResize ? params : false;\r\n },\r\n dragGroupControl: function (moveable, e) {\r\n var datas = e.datas;\r\n if (!datas.isResize) {\r\n return;\r\n }\r\n var props = getProps(moveable.props, \"resizable\");\r\n catchEvent(moveable, \"onBeforeResize\", function (parentEvent) {\r\n triggerEvent(moveable, \"onBeforeResizeGroup\", fillParams(moveable, e, __assign(__assign({}, parentEvent), { targets: props.targets }), true));\r\n });\r\n var params = this.dragControl(moveable, __assign(__assign({}, e), { isGroup: true }));\r\n if (!params) {\r\n return;\r\n }\r\n var boundingWidth = params.boundingWidth, boundingHeight = params.boundingHeight, dist = params.dist;\r\n var keepRatio = props.keepRatio;\r\n var parentScale = [\r\n boundingWidth / (boundingWidth - dist[0]),\r\n boundingHeight / (boundingHeight - dist[1]),\r\n ];\r\n var fixedPosition = datas.fixedPosition;\r\n var events = triggerChildAbles(moveable, this, \"dragControl\", e, function (_, ev) {\r\n var _a = __read(calculate(createRotateMatrix(moveable.rotation / 180 * Math.PI, 3), [\r\n ev.datas.originalX * parentScale[0],\r\n ev.datas.originalY * parentScale[1],\r\n 1,\r\n ], 3), 2), clientX = _a[0], clientY = _a[1];\r\n return __assign(__assign({}, ev), { parentDist: null, parentScale: parentScale, dragClient: plus(fixedPosition, [clientX, clientY]), parentKeepRatio: keepRatio });\r\n });\r\n var nextParams = __assign({ targets: props.targets, events: events }, params);\r\n triggerEvent(moveable, \"onResizeGroup\", nextParams);\r\n return nextParams;\r\n },\r\n dragGroupControlEnd: function (moveable, e) {\r\n var isDrag = e.isDrag, datas = e.datas;\r\n if (!datas.isResize) {\r\n return;\r\n }\r\n this.dragControlEnd(moveable, e);\r\n var events = triggerChildAbles(moveable, this, \"dragControlEnd\", e);\r\n var nextParams = fillEndParams(moveable, e, {\r\n targets: moveable.props.targets,\r\n events: events,\r\n });\r\n triggerEvent(moveable, \"onResizeGroupEnd\", nextParams);\r\n return isDrag;\r\n },\r\n /**\r\n * @method Moveable.Resizable#request\r\n * @param {Moveable.Resizable.ResizableRequestParam} e - the Resizable's request parameter\r\n * @return {Moveable.Requester} Moveable Requester\r\n * @example\r\n\n * // Instantly Request (requestStart - request - requestEnd)\r\n * // Use Relative Value\r\n * moveable.request(\"resizable\", { deltaWidth: 10, deltaHeight: 10 }, true);\r\n *\r\n * // Use Absolute Value\r\n * moveable.request(\"resizable\", { offsetWidth: 100, offsetHeight: 100 }, true);\r\n *\r\n * // requestStart\r\n * const requester = moveable.request(\"resizable\");\r\n *\r\n * // request\r\n * // Use Relative Value\r\n * requester.request({ deltaWidth: 10, deltaHeight: 10 });\r\n * requester.request({ deltaWidth: 10, deltaHeight: 10 });\r\n * requester.request({ deltaWidth: 10, deltaHeight: 10 });\r\n *\r\n * // Use Absolute Value\r\n * moveable.request(\"resizable\", { offsetWidth: 100, offsetHeight: 100 });\r\n * moveable.request(\"resizable\", { offsetWidth: 110, offsetHeight: 100 });\r\n * moveable.request(\"resizable\", { offsetWidth: 120, offsetHeight: 100 });\r\n *\r\n * // requestEnd\r\n * requester.requestEnd();\r\n */\r\n request: function (moveable) {\r\n var datas = {};\r\n var distWidth = 0;\r\n var distHeight = 0;\r\n var useSnap = false;\r\n var rect = moveable.getRect();\r\n return {\r\n isControl: true,\r\n requestStart: function (e) {\r\n var _a;\r\n useSnap = e.useSnap;\r\n return {\r\n datas: datas,\r\n parentDirection: e.direction || [1, 1],\r\n parentIsWidth: (_a = e === null || e === void 0 ? void 0 : e.horizontal) !== null && _a !== void 0 ? _a : true,\r\n useSnap: useSnap,\r\n };\r\n },\r\n request: function (e) {\r\n if (\"offsetWidth\" in e) {\r\n distWidth = e.offsetWidth - rect.offsetWidth;\r\n }\r\n else if (\"deltaWidth\" in e) {\r\n distWidth += e.deltaWidth;\r\n }\r\n if (\"offsetHeight\" in e) {\r\n distHeight = e.offsetHeight - rect.offsetHeight;\r\n }\r\n else if (\"deltaHeight\" in e) {\r\n distHeight += e.deltaHeight;\r\n }\r\n return {\r\n datas: datas,\r\n parentDist: [distWidth, distHeight],\r\n parentKeepRatio: e.keepRatio,\r\n useSnap: useSnap,\r\n };\r\n },\r\n requestEnd: function () {\r\n return { datas: datas, isDrag: true, useSnap: useSnap };\r\n },\r\n };\r\n },\r\n unset: function (moveable) {\r\n moveable.state.gestos.resizable = null;\r\n },\r\n};\r\n/**\r\n * Whether or not target can be resized.\r\n * @name Moveable.Resizable#resizable\r\n * @default false\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * resizable: false,\r\n * });\r\n *\r\n * moveable.resizable = true;\r\n */\r\n/**\r\n * throttle of width, height when resize. If throttleResize is set to less than 1, the target may shake.\r\n * @name Moveable.Resizable#throttleResize\r\n * @default 1\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * resizable: true,\r\n * throttleResize: 1,\r\n * });\r\n *\r\n * moveable.throttleResize = 0;\r\n */\r\n/**\r\n * When resize or scale, keeps a ratio of the width, height.\r\n * @name Moveable.Resizable#keepRatio\r\n * @default false\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * resizable: true,\r\n * });\r\n *\r\n * moveable.keepRatio = true;\r\n */\r\n/**\r\n * Set directions to show the control box.\r\n * @name Moveable.Resizable#renderDirections\r\n * @default [\"n\", \"nw\", \"ne\", \"s\", \"se\", \"sw\", \"e\", \"w\"]\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * resizable: true,\r\n * renderDirections: [\"n\", \"nw\", \"ne\", \"s\", \"se\", \"sw\", \"e\", \"w\"],\r\n * });\r\n *\r\n * moveable.renderDirections = [\"nw\", \"ne\", \"sw\", \"se\"];\r\n */\r\n/**\r\n * Function to convert size for resize\r\n * @name Moveable.Resizable#resizeFormat\r\n * @default oneself\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * resizable: true,\r\n * resizeFormat: v => v,\r\n * });\r\n *\r\n * moveable.resizeFormat = (size: number[]) => ([Math.trunc(size[0]), Math.trunc(size[1])];\r\n */\r\n/**\r\n * When the resize starts, the resizeStart event is called.\r\n * @memberof Moveable.Resizable\r\n * @event resizeStart\r\n * @param {Moveable.Resizable.OnResizeStart} - Parameters for the resizeStart event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { resizable: true });\r\n * moveable.on(\"resizeStart\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n */\r\n/**\r\n * When resizing, `beforeResize` is called before `resize` occurs. In `beforeResize`, you can get and set the pre-value before resizing.\r\n * @memberof Moveable.Resizable\r\n * @event beforeResize\r\n * @param {Moveable.Resizable.OnBeforeResize} - Parameters for the `beforeResize` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { resizable: true });\r\n * moveable.on(\"beforeResize\", ({ setFixedDirection }) => {\r\n * if (shiftKey) {\r\n * setFixedDirection([0, 0]);\r\n * }\r\n * });\r\n * moveable.on(\"resize\", ({ target, width, height, drag }) => {\r\n * target.style.width = `${width}px`;\r\n * target.style.height = `${height}px`;\r\n * target.style.transform = drag.transform;\r\n * });\r\n */\r\n/**\r\n * When resizing, the resize event is called.\r\n * @memberof Moveable.Resizable\r\n * @event resize\r\n * @param {Moveable.Resizable.OnResize} - Parameters for the resize event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { resizable: true });\r\n * moveable.on(\"resize\", ({ target, width, height }) => {\r\n * target.style.width = `${e.width}px`;\r\n * target.style.height = `${e.height}px`;\r\n * });\r\n */\r\n/**\r\n * When the resize finishes, the resizeEnd event is called.\r\n * @memberof Moveable.Resizable\r\n * @event resizeEnd\r\n * @param {Moveable.Resizable.OnResizeEnd} - Parameters for the resizeEnd event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { resizable: true });\r\n * moveable.on(\"resizeEnd\", ({ target, isDrag }) => {\r\n * console.log(target, isDrag);\r\n * });\r\n */\r\n/**\r\n* When the group resize starts, the `resizeGroupStart` event is called.\r\n* @memberof Moveable.Resizable\r\n* @event resizeGroupStart\r\n* @param {Moveable.Resizable.OnResizeGroupStart} - Parameters for the `resizeGroupStart` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* target: [].slice.call(document.querySelectorAll(\".target\")),\r\n* resizable: true\r\n* });\r\n* moveable.on(\"resizeGroupStart\", ({ targets }) => {\r\n* console.log(\"onResizeGroupStart\", targets);\r\n* });\r\n*/\r\n/**\r\n* When the group resize, the `resizeGroup` event is called.\r\n* @memberof Moveable.Resizable\r\n* @event resizeGroup\r\n* @param {Moveable.Resizable.onResizeGroup} - Parameters for the `resizeGroup` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* target: [].slice.call(document.querySelectorAll(\".target\")),\r\n* resizable: true\r\n* });\r\n* moveable.on(\"resizeGroup\", ({ targets, events }) => {\r\n* console.log(\"onResizeGroup\", targets);\r\n* events.forEach(ev => {\r\n* const offset = [\r\n* direction[0] < 0 ? -ev.delta[0] : 0,\r\n* direction[1] < 0 ? -ev.delta[1] : 0,\r\n* ];\r\n* // ev.drag is a drag event that occurs when the group resize.\r\n* const left = offset[0] + ev.drag.beforeDist[0];\r\n* const top = offset[1] + ev.drag.beforeDist[1];\r\n* const width = ev.width;\r\n* const top = ev.top;\r\n* });\r\n* });\r\n*/\r\n/**\r\n * When the group resize finishes, the `resizeGroupEnd` event is called.\r\n * @memberof Moveable.Resizable\r\n * @event resizeGroupEnd\r\n * @param {Moveable.Resizable.OnResizeGroupEnd} - Parameters for the `resizeGroupEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * resizable: true\r\n * });\r\n * moveable.on(\"resizeGroupEnd\", ({ targets, isDrag }) => {\r\n * console.log(\"onResizeGroupEnd\", targets, isDrag);\r\n * });\r\n */\n\n/**\r\n * @namespace Rotatable\r\n * @memberof Moveable\r\n * @description Rotatable indicates whether the target can be rotated.\r\n */\r\nfunction setRotateStartInfo(moveable, datas, clientX, clientY, rect) {\r\n var groupable = moveable.props.groupable;\r\n var state = moveable.state;\r\n var n = state.is3d ? 4 : 3;\r\n var origin = datas.origin;\r\n var nextOrigin = calculatePosition(moveable.state.rootMatrix, \r\n // TO-DO #710\r\n minus([origin[0], origin[1]], groupable ? [0, 0] : [state.left, state.top]), n);\r\n var startAbsoluteOrigin = plus([rect.left, rect.top], nextOrigin);\r\n datas.startAbsoluteOrigin = startAbsoluteOrigin;\r\n datas.prevDeg = getRad(startAbsoluteOrigin, [clientX, clientY]) / Math.PI * 180;\r\n datas.defaultDeg = datas.prevDeg;\r\n datas.prevSnapDeg = 0;\r\n datas.loop = 0;\r\n datas.startDist = getDist$1(startAbsoluteOrigin, [clientX, clientY]);\r\n}\r\nfunction getAbsoluteDist(deg, direction, datas) {\r\n var defaultDeg = datas.defaultDeg, prevDeg = datas.prevDeg;\r\n var normalizedPrevDeg = prevDeg % 360;\r\n var loop = Math.floor(prevDeg / 360);\r\n if (normalizedPrevDeg < 0) {\r\n normalizedPrevDeg += 360;\r\n }\r\n if (normalizedPrevDeg > deg && normalizedPrevDeg > 270 && deg < 90) {\r\n // 360 => 0\r\n ++loop;\r\n }\r\n else if (normalizedPrevDeg < deg && normalizedPrevDeg < 90 && deg > 270) {\r\n // 0 => 360\r\n --loop;\r\n }\r\n var dist = direction * (loop * 360 + deg - defaultDeg);\r\n datas.prevDeg = defaultDeg + dist;\r\n return dist;\r\n}\r\nfunction getAbsoluteDistByClient(clientX, clientY, direction, datas) {\r\n return getAbsoluteDist(getRad(datas.startAbsoluteOrigin, [clientX, clientY]) / Math.PI * 180, direction, datas);\r\n}\r\nfunction getRotateInfo(moveable, moveableRect, datas, dist, startValue, checkSnap) {\r\n var _a = moveable.props.throttleRotate, throttleRotate = _a === void 0 ? 0 : _a;\r\n var prevSnapDeg = datas.prevSnapDeg;\r\n var snapRotation = 0;\r\n var isSnap = false;\r\n if (checkSnap) {\r\n var result = checkSnapRotate(moveable, moveableRect, dist, startValue + dist);\r\n isSnap = result.isSnap;\r\n snapRotation = startValue + result.dist;\r\n }\r\n if (!isSnap) {\r\n snapRotation = throttle(startValue + dist, throttleRotate);\r\n }\r\n var snapDeg = snapRotation - startValue;\r\n datas.prevSnapDeg = snapDeg;\r\n return [snapDeg - prevSnapDeg, snapDeg, snapRotation];\r\n}\r\nfunction getRotationPositions(rotationPosition, _a, direction) {\r\n var _b = __read(_a, 4), pos1 = _b[0], pos2 = _b[1], pos3 = _b[2], pos4 = _b[3];\r\n if (rotationPosition === \"none\") {\r\n return [];\r\n }\r\n if (isArray(rotationPosition)) {\r\n return rotationPosition.map(function (child) { return getRotationPositions(child, [pos1, pos2, pos3, pos4], direction)[0]; });\r\n }\r\n var _c = __read((rotationPosition || \"top\").split(\"-\"), 2), dir1 = _c[0], dir2 = _c[1];\r\n var radPoses = [pos1, pos2];\r\n if (dir1 === \"left\") {\r\n radPoses = [pos3, pos1];\r\n }\r\n else if (dir1 === \"right\") {\r\n radPoses = [pos2, pos4];\r\n }\r\n else if (dir1 === \"bottom\") {\r\n radPoses = [pos4, pos3];\r\n }\r\n var pos = [\r\n (radPoses[0][0] + radPoses[1][0]) / 2,\r\n (radPoses[0][1] + radPoses[1][1]) / 2,\r\n ];\r\n var rad = getRotationRad(radPoses, direction);\r\n if (dir2) {\r\n var isStart = dir2 === \"top\" || dir2 === \"left\";\r\n var isReverse = dir1 === \"bottom\" || dir1 === \"left\";\r\n pos = radPoses[(isStart && !isReverse) || (!isStart && isReverse) ? 0 : 1];\r\n }\r\n return [[pos, rad]];\r\n}\r\nfunction dragControlCondition(moveable, e) {\r\n if (e.isRequest) {\r\n return e.requestAble === \"rotatable\";\r\n }\r\n var target = e.inputEvent.target;\r\n if (hasClass(target, prefix(\"rotation-control\"))\r\n || (moveable.props.rotateAroundControls && hasClass(target, prefix(\"around-control\")))\r\n || (hasClass(target, prefix(\"control\")) && hasClass(target, prefix(\"rotatable\")))) {\r\n return true;\r\n }\r\n var rotationTarget = moveable.props.rotationTarget;\r\n if (rotationTarget) {\r\n return getRefTargets(rotationTarget, true).some(function (element) {\r\n if (!element) {\r\n return false;\r\n }\r\n return target === element || target.contains(element);\r\n });\r\n }\r\n return false;\r\n}\r\nvar css = \".rotation {\\nposition: absolute;\\nheight: 40px;\\nwidth: 1px;\\ntransform-origin: 50% 100%;\\nheight: calc(40px * var(--zoom));\\ntop: auto;\\nleft: 0;\\nbottom: 100%;\\nwill-change: transform;\\n}\\n.rotation .rotation-line {\\ndisplay: block;\\nwidth: 100%;\\nheight: 100%;\\ntransform-origin: 50% 50%;\\n}\\n.rotation .rotation-control {\\nborder-color: #4af;\\nborder-color: var(--moveable-color);\\nbackground:#fff;\\ncursor: alias;\\n}\\n:global .view-rotation-dragging, .rotatable.direction.control {\\ncursor: alias;\\n}\\n.rotatable.direction.control.move {\\ncursor: move;\\n}\\n\";\r\nvar Rotatable = {\r\n name: \"rotatable\",\r\n canPinch: true,\r\n props: [\r\n \"rotatable\",\r\n \"rotationPosition\",\r\n \"throttleRotate\",\r\n \"renderDirections\",\r\n \"rotationTarget\",\r\n \"rotateAroundControls\",\r\n \"edge\",\r\n \"resolveAblesWithRotatable\",\r\n \"displayAroundControls\",\r\n ],\r\n events: [\r\n \"rotateStart\",\r\n \"beforeRotate\",\r\n \"rotate\",\r\n \"rotateEnd\",\r\n \"rotateGroupStart\",\r\n \"beforeRotateGroup\",\r\n \"rotateGroup\",\r\n \"rotateGroupEnd\",\r\n ],\r\n css: [css],\r\n viewClassName: function (moveable) {\r\n if (!moveable.isDragging(\"rotatable\")) {\r\n return \"\";\r\n }\r\n return prefix(\"view-rotation-dragging\");\r\n },\r\n render: function (moveable, React) {\r\n var _a = getProps(moveable.props, \"rotatable\"), rotatable = _a.rotatable, rotationPosition = _a.rotationPosition, zoom = _a.zoom, renderDirections = _a.renderDirections, rotateAroundControls = _a.rotateAroundControls, resolveAblesWithRotatable = _a.resolveAblesWithRotatable;\r\n var _b = moveable.getState(), renderPoses = _b.renderPoses, direction = _b.direction;\r\n if (!rotatable) {\r\n return null;\r\n }\r\n var positions = getRotationPositions(rotationPosition, renderPoses, direction);\r\n var jsxs = [];\r\n positions.forEach(function (_a, i) {\r\n var _b = __read(_a, 2), pos = _b[0], rad = _b[1];\r\n jsxs.push(React.createElement(\"div\", { key: \"rotation\".concat(i), className: prefix(\"rotation\"), style: {\r\n // tslint:disable-next-line: max-line-length\r\n transform: \"translate(-50%) translate(\".concat(pos[0], \"px, \").concat(pos[1], \"px) rotate(\").concat(rad, \"rad)\"),\r\n } },\r\n React.createElement(\"div\", { className: prefix(\"line rotation-line\"), style: {\r\n transform: \"scaleX(\".concat(zoom, \")\"),\r\n } }),\r\n React.createElement(\"div\", { className: prefix(\"control rotation-control\"), style: {\r\n transform: \"translate(0.5px) scale(\".concat(zoom, \")\"),\r\n } })));\r\n });\r\n if (renderDirections) {\r\n var ables = getKeys(resolveAblesWithRotatable || {});\r\n var resolveMap_1 = {};\r\n ables.forEach(function (name) {\r\n resolveAblesWithRotatable[name].forEach(function (direction) {\r\n resolveMap_1[direction] = name;\r\n });\r\n });\r\n var directionControlInfos = [];\r\n if (isArray(renderDirections)) {\r\n directionControlInfos = renderDirections.map(function (dir) {\r\n var able = resolveMap_1[dir];\r\n return {\r\n data: able ? { resolve: able } : {},\r\n classNames: able ? [\"move\"] : [],\r\n dir: dir,\r\n };\r\n });\r\n }\r\n jsxs.push.apply(jsxs, __spreadArray([], __read(renderDirectionControlsByInfos(moveable, \"rotatable\", directionControlInfos, React)), false));\r\n }\r\n if (rotateAroundControls) {\r\n jsxs.push.apply(jsxs, __spreadArray([], __read(renderAroundControls(moveable, React)), false));\r\n }\r\n return jsxs;\r\n },\r\n dragControlCondition: dragControlCondition,\r\n dragControlStart: function (moveable, e) {\r\n var _a;\r\n var _b;\r\n var datas = e.datas, clientX = e.clientX, clientY = e.clientY, parentRotate = e.parentRotate, parentFlag = e.parentFlag, isPinch = e.isPinch, isRequest = e.isRequest;\r\n var state = moveable.state;\r\n var target = state.target, left = state.left, top = state.top, direction = state.direction, beforeDirection = state.beforeDirection, targetTransform = state.targetTransform, moveableClientRect = state.moveableClientRect, offsetMatrix = state.offsetMatrix, targetMatrix = state.targetMatrix, allMatrix = state.allMatrix, width = state.width, height = state.height;\r\n if (!isRequest && !target) {\r\n return false;\r\n }\r\n var rect = moveable.getRect();\r\n datas.rect = rect;\r\n datas.transform = targetTransform;\r\n datas.left = left;\r\n datas.top = top;\r\n var setFixedPosition = function (fixedPosition) {\r\n var result = getOffsetFixedPositionInfo(moveable.state, fixedPosition);\r\n datas.fixedDirection = result.fixedDirection;\r\n datas.fixedOffset = result.fixedOffset;\r\n datas.fixedPosition = result.fixedPosition;\r\n if (resizeStart) {\r\n resizeStart.setFixedPosition(fixedPosition);\r\n }\r\n };\r\n var setFixedDirection = function (fixedDirection) {\r\n var result = getOffsetFixedDirectionInfo(moveable.state, fixedDirection);\r\n datas.fixedDirection = result.fixedDirection;\r\n datas.fixedOffset = result.fixedOffset;\r\n datas.fixedPosition = result.fixedPosition;\r\n if (resizeStart) {\r\n resizeStart.setFixedDirection(fixedDirection);\r\n }\r\n };\r\n var startClientX = clientX;\r\n var startClientY = clientY;\r\n if (isRequest || isPinch || parentFlag) {\r\n var externalRotate = parentRotate || 0;\r\n datas.beforeInfo = {\r\n origin: rect.beforeOrigin,\r\n prevDeg: externalRotate,\r\n defaultDeg: externalRotate,\r\n prevSnapDeg: 0,\r\n startDist: 0,\r\n };\r\n datas.afterInfo = __assign(__assign({}, datas.beforeInfo), { origin: rect.origin });\r\n datas.absoluteInfo = __assign(__assign({}, datas.beforeInfo), { origin: rect.origin, startValue: externalRotate });\r\n }\r\n else {\r\n var inputTarget = (_b = e.inputEvent) === null || _b === void 0 ? void 0 : _b.target;\r\n if (inputTarget) {\r\n var regionDirection = inputTarget.getAttribute(\"data-direction\") || \"\";\r\n var controlDirection = DIRECTION_REGION_TO_DIRECTION[regionDirection];\r\n if (controlDirection) {\r\n datas.isControl = true;\r\n datas.isAroundControl = hasClass(inputTarget, prefix(\"around-control\"));\r\n datas.controlDirection = controlDirection;\r\n var resolve = inputTarget.getAttribute(\"data-resolve\");\r\n if (resolve) {\r\n datas.resolveAble = resolve;\r\n }\r\n var clientPoses = calculateMoveableClientPositions(state.rootMatrix, state.renderPoses, moveableClientRect);\r\n _a = __read(getPosByDirection(clientPoses, controlDirection), 2), startClientX = _a[0], startClientY = _a[1];\r\n }\r\n }\r\n datas.beforeInfo = { origin: rect.beforeOrigin };\r\n datas.afterInfo = { origin: rect.origin };\r\n datas.absoluteInfo = {\r\n origin: rect.origin,\r\n startValue: rect.rotation,\r\n };\r\n var originalFixedPosition_1 = setFixedPosition;\r\n setFixedPosition = function (fixedPosition) {\r\n var n = state.is3d ? 4 : 3;\r\n var _a = __read(plus(getOrigin(targetMatrix, n), fixedPosition), 2), originX = _a[0], originY = _a[1];\r\n var fixedBeforeOrigin = calculate(offsetMatrix, convertPositionMatrix([originX, originY], n));\r\n var fixedAfterOrigin = calculate(allMatrix, convertPositionMatrix([fixedPosition[0], fixedPosition[1]], n));\r\n originalFixedPosition_1(fixedPosition);\r\n var posDelta = state.posDelta;\r\n datas.beforeInfo.origin = minus(fixedBeforeOrigin, posDelta);\r\n datas.afterInfo.origin = minus(fixedAfterOrigin, posDelta);\r\n datas.absoluteInfo.origin = minus(fixedAfterOrigin, posDelta);\r\n setRotateStartInfo(moveable, datas.beforeInfo, startClientX, startClientY, moveableClientRect);\r\n setRotateStartInfo(moveable, datas.afterInfo, startClientX, startClientY, moveableClientRect);\r\n setRotateStartInfo(moveable, datas.absoluteInfo, startClientX, startClientY, moveableClientRect);\r\n };\r\n setFixedDirection = function (fixedDirection) {\r\n var fixedPosition = getPosByDirection([\r\n [0, 0],\r\n [width, 0],\r\n [0, height],\r\n [width, height],\r\n ], fixedDirection);\r\n setFixedPosition(fixedPosition);\r\n };\r\n }\r\n datas.startClientX = startClientX;\r\n datas.startClientY = startClientY;\r\n datas.direction = direction;\r\n datas.beforeDirection = beforeDirection;\r\n datas.startValue = 0;\r\n datas.datas = {};\r\n setDefaultTransformIndex(moveable, e, \"rotate\");\r\n var dragStart = false;\r\n var resizeStart = false;\r\n if (datas.isControl && datas.resolveAble) {\r\n var resolveAble = datas.resolveAble;\r\n if (resolveAble === \"resizable\") {\r\n resizeStart = Resizable.dragControlStart(moveable, __assign(__assign({}, (new CustomGesto(\"resizable\").dragStart([0, 0], e))), { parentPosition: datas.controlPosition, parentFixedPosition: datas.fixedPosition }));\r\n }\r\n }\r\n if (!resizeStart) {\r\n dragStart = Draggable.dragStart(moveable, new CustomGesto().dragStart([0, 0], e));\r\n }\r\n setFixedPosition(getTotalOrigin(moveable));\r\n var params = fillParams(moveable, e, __assign(__assign({ set: function (rotatation) {\r\n datas.startValue = rotatation * Math.PI / 180;\r\n }, setFixedDirection: setFixedDirection, setFixedPosition: setFixedPosition }, fillTransformStartEvent(moveable, e)), { dragStart: dragStart, resizeStart: resizeStart }));\r\n var result = triggerEvent(moveable, \"onRotateStart\", params);\r\n datas.isRotate = result !== false;\r\n state.snapRenderInfo = {\r\n request: e.isRequest,\r\n };\r\n return datas.isRotate ? params : false;\r\n },\r\n dragControl: function (moveable, e) {\r\n var _a, _b, _c;\r\n var datas = e.datas, clientDistX = e.clientDistX, clientDistY = e.clientDistY, parentRotate = e.parentRotate, parentFlag = e.parentFlag, isPinch = e.isPinch, groupDelta = e.groupDelta, resolveMatrix = e.resolveMatrix;\r\n var beforeDirection = datas.beforeDirection, beforeInfo = datas.beforeInfo, afterInfo = datas.afterInfo, absoluteInfo = datas.absoluteInfo, isRotate = datas.isRotate, startValue = datas.startValue, rect = datas.rect, startClientX = datas.startClientX, startClientY = datas.startClientY;\r\n if (!isRotate) {\r\n return;\r\n }\r\n resolveTransformEvent(moveable, e, \"rotate\");\r\n var targetDirection = getTransformDirection(e);\r\n var direction = beforeDirection * targetDirection;\r\n var parentMoveable = moveable.props.parentMoveable;\r\n var beforeDelta = 0;\r\n var beforeDist;\r\n var beforeRotation;\r\n var delta = 0;\r\n var dist;\r\n var rotation;\r\n var absoluteDelta = 0;\r\n var absoluteDist;\r\n var absoluteRotation;\r\n var startRotation = 180 / Math.PI * startValue;\r\n var absoluteStartRotation = absoluteInfo.startValue;\r\n var isSnap = false;\r\n var nextClientX = startClientX + clientDistX;\r\n var nextClientY = startClientY + clientDistY;\r\n if (!parentFlag && \"parentDist\" in e) {\r\n var parentDist = e.parentDist;\r\n beforeDist = parentDist;\r\n dist = parentDist;\r\n absoluteDist = parentDist;\r\n }\r\n else if (isPinch || parentFlag) {\r\n beforeDist = getAbsoluteDist(parentRotate, beforeDirection, beforeInfo);\r\n dist = getAbsoluteDist(parentRotate, direction, afterInfo);\r\n absoluteDist = getAbsoluteDist(parentRotate, direction, absoluteInfo);\r\n }\r\n else {\r\n beforeDist = getAbsoluteDistByClient(nextClientX, nextClientY, beforeDirection, beforeInfo);\r\n dist = getAbsoluteDistByClient(nextClientX, nextClientY, direction, afterInfo);\r\n absoluteDist = getAbsoluteDistByClient(nextClientX, nextClientY, direction, absoluteInfo);\r\n isSnap = true;\r\n }\r\n beforeRotation = startRotation + beforeDist;\r\n rotation = startRotation + dist;\r\n absoluteRotation = absoluteStartRotation + absoluteDist;\r\n triggerEvent(moveable, \"onBeforeRotate\", fillParams(moveable, e, {\r\n beforeRotation: beforeRotation,\r\n rotation: rotation,\r\n absoluteRotation: absoluteRotation,\r\n setRotation: function (nextRotation) {\r\n dist = nextRotation - startRotation;\r\n beforeDist = dist;\r\n absoluteDist = dist;\r\n },\r\n }, true));\r\n _a = __read(getRotateInfo(moveable, rect, beforeInfo, beforeDist, startRotation, isSnap), 3), beforeDelta = _a[0], beforeDist = _a[1], beforeRotation = _a[2];\r\n _b = __read(getRotateInfo(moveable, rect, afterInfo, dist, startRotation, isSnap), 3), delta = _b[0], dist = _b[1], rotation = _b[2];\r\n _c = __read(getRotateInfo(moveable, rect, absoluteInfo, absoluteDist, absoluteStartRotation, isSnap), 3), absoluteDelta = _c[0], absoluteDist = _c[1], absoluteRotation = _c[2];\r\n if (!absoluteDelta && !delta && !beforeDelta && !parentMoveable && !resolveMatrix) {\r\n return;\r\n }\r\n var nextTransform = convertTransformFormat(datas, \"rotate(\".concat(rotation, \"deg)\"), \"rotate(\".concat(dist, \"deg)\"));\r\n if (resolveMatrix) {\r\n datas.fixedPosition = getTranslateFixedPosition(moveable, datas.targetAllTransform, datas.fixedDirection, datas.fixedOffset, datas);\r\n }\r\n var inverseDist = getRotateDist(moveable, dist, datas);\r\n var inverseDelta = minus(plus(groupDelta || [0, 0], inverseDist), datas.prevInverseDist || [0, 0]);\r\n datas.prevInverseDist = inverseDist;\r\n datas.requestValue = null;\r\n var dragEvent = fillTransformEvent(moveable, nextTransform, inverseDelta, isPinch, e);\r\n var transformEvent = dragEvent;\r\n var parentDistance = getDist$1([nextClientX, nextClientY], absoluteInfo.startAbsoluteOrigin) - absoluteInfo.startDist;\r\n var resize = undefined;\r\n if (datas.resolveAble === \"resizable\") {\r\n var resizeEvent = Resizable.dragControl(moveable, __assign(__assign({}, setCustomDrag(e, moveable.state, [e.deltaX, e.deltaY], !!isPinch, false, \"resizable\")), { resolveMatrix: true, parentDistance: parentDistance }));\r\n if (resizeEvent) {\r\n resize = resizeEvent;\r\n transformEvent = fillAfterTransform(transformEvent, resizeEvent, e);\r\n }\r\n }\r\n var params = fillParams(moveable, e, __assign(__assign({ delta: delta, dist: dist, rotate: rotation, rotation: rotation, beforeDist: beforeDist, beforeDelta: beforeDelta, beforeRotate: beforeRotation, beforeRotation: beforeRotation, absoluteDist: absoluteDist, absoluteDelta: absoluteDelta, absoluteRotate: absoluteRotation, absoluteRotation: absoluteRotation, isPinch: !!isPinch, resize: resize }, dragEvent), transformEvent));\r\n triggerEvent(moveable, \"onRotate\", params);\r\n return params;\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n var datas = e.datas;\r\n if (!datas.isRotate) {\r\n return;\r\n }\r\n datas.isRotate = false;\r\n var params = fillEndParams(moveable, e, {});\r\n triggerEvent(moveable, \"onRotateEnd\", params);\r\n return params;\r\n },\r\n dragGroupControlCondition: dragControlCondition,\r\n dragGroupControlStart: function (moveable, e) {\r\n var datas = e.datas;\r\n var _a = moveable.state, parentLeft = _a.left, parentTop = _a.top, parentBeforeOrigin = _a.beforeOrigin;\r\n var params = this.dragControlStart(moveable, e);\r\n if (!params) {\r\n return false;\r\n }\r\n params.set(datas.beforeDirection * moveable.rotation);\r\n var events = triggerChildAbles(moveable, this, \"dragControlStart\", e, function (child, ev) {\r\n var _a = child.state, left = _a.left, top = _a.top, beforeOrigin = _a.beforeOrigin;\r\n var childClient = plus(minus([left, top], [parentLeft, parentTop]), minus(beforeOrigin, parentBeforeOrigin));\r\n ev.datas.startGroupClient = childClient;\r\n ev.datas.groupClient = childClient;\r\n return __assign(__assign({}, ev), { parentRotate: 0 });\r\n });\r\n var nextParams = __assign(__assign({}, params), { targets: moveable.props.targets, events: events });\r\n var result = triggerEvent(moveable, \"onRotateGroupStart\", nextParams);\r\n datas.isRotate = result !== false;\r\n return datas.isRotate ? params : false;\r\n },\r\n dragGroupControl: function (moveable, e) {\r\n var datas = e.datas;\r\n if (!datas.isRotate) {\r\n return;\r\n }\r\n catchEvent(moveable, \"onBeforeRotate\", function (parentEvent) {\r\n triggerEvent(moveable, \"onBeforeRotateGroup\", fillParams(moveable, e, __assign(__assign({}, parentEvent), { targets: moveable.props.targets }), true));\r\n });\r\n var params = this.dragControl(moveable, e);\r\n if (!params) {\r\n return;\r\n }\r\n var direction = datas.beforeDirection;\r\n var parentRotate = params.beforeDist;\r\n var rad = parentRotate / 180 * Math.PI;\r\n var events = triggerChildAbles(moveable, this, \"dragControl\", e, function (_, ev) {\r\n var startGroupClient = ev.datas.startGroupClient;\r\n var _a = __read(ev.datas.groupClient, 2), prevClientX = _a[0], prevClientY = _a[1];\r\n var _b = __read(rotate(startGroupClient, rad * direction), 2), clientX = _b[0], clientY = _b[1];\r\n var delta = [clientX - prevClientX, clientY - prevClientY];\r\n ev.datas.groupClient = [clientX, clientY];\r\n return __assign(__assign({}, ev), { parentRotate: parentRotate, groupDelta: delta });\r\n });\r\n moveable.rotation = direction * params.beforeRotation;\r\n var nextParams = __assign({ targets: moveable.props.targets, events: events, set: function (rotation) {\r\n moveable.rotation = rotation;\r\n }, setGroupRotation: function (rotation) {\r\n moveable.rotation = rotation;\r\n } }, params);\r\n triggerEvent(moveable, \"onRotateGroup\", nextParams);\r\n return nextParams;\r\n },\r\n dragGroupControlEnd: function (moveable, e) {\r\n var isDrag = e.isDrag, datas = e.datas;\r\n if (!datas.isRotate) {\r\n return;\r\n }\r\n this.dragControlEnd(moveable, e);\r\n var events = triggerChildAbles(moveable, this, \"dragControlEnd\", e);\r\n var nextParams = fillEndParams(moveable, e, {\r\n targets: moveable.props.targets,\r\n events: events,\r\n });\r\n triggerEvent(moveable, \"onRotateGroupEnd\", nextParams);\r\n return isDrag;\r\n },\r\n /**\r\n * @method Moveable.Rotatable#request\r\n * @param {object} [e] - the Resizable's request parameter\r\n * @param {number} [e.deltaRotate=0] - delta number of rotation\r\n * @param {number} [e.rotate=0] - absolute number of moveable's rotation\r\n * @return {Moveable.Requester} Moveable Requester\r\n * @example\r\n\n * // Instantly Request (requestStart - request - requestEnd)\r\n * moveable.request(\"rotatable\", { deltaRotate: 10 }, true);\r\n *\r\n * * moveable.request(\"rotatable\", { rotate: 10 }, true);\r\n *\r\n * // requestStart\r\n * const requester = moveable.request(\"rotatable\");\r\n *\r\n * // request\r\n * requester.request({ deltaRotate: 10 });\r\n * requester.request({ deltaRotate: 10 });\r\n * requester.request({ deltaRotate: 10 });\r\n *\r\n * requester.request({ rotate: 10 });\r\n * requester.request({ rotate: 20 });\r\n * requester.request({ rotate: 30 });\r\n *\r\n * // requestEnd\r\n * requester.requestEnd();\r\n */\r\n request: function (moveable) {\r\n var datas = {};\r\n var distRotate = 0;\r\n var startRotation = moveable.getRotation();\r\n return {\r\n isControl: true,\r\n requestStart: function () {\r\n return { datas: datas };\r\n },\r\n request: function (e) {\r\n if (\"deltaRotate\" in e) {\r\n distRotate += e.deltaRotate;\r\n }\r\n else if (\"rotate\" in e) {\r\n distRotate = e.rotate - startRotation;\r\n }\r\n return { datas: datas, parentDist: distRotate };\r\n },\r\n requestEnd: function () {\r\n return { datas: datas, isDrag: true };\r\n },\r\n };\r\n },\r\n};\r\n/**\r\n * Whether or not target can be rotated. (default: false)\r\n * @name Moveable.Rotatable#rotatable\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.rotatable = true;\r\n */\r\n/**\r\n * You can specify the position of the rotation. (default: \"top\")\r\n * @name Moveable.Rotatable#rotationPosition\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * rotationPosition: \"top\",\r\n * });\r\n *\r\n * moveable.rotationPosition = \"bottom\"\r\n */\r\n/**\r\n * throttle of angle(degree) when rotate.\r\n * @name Moveable.Rotatable#throttleRotate\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.throttleRotate = 1;\r\n */\r\n/**\r\n * When the rotate starts, the rotateStart event is called.\r\n * @memberof Moveable.Rotatable\r\n * @event rotateStart\r\n * @param {Moveable.Rotatable.OnRotateStart} - Parameters for the rotateStart event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { rotatable: true });\r\n * moveable.on(\"rotateStart\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n */\r\n/**\r\n* When rotating, the rotate event is called.\r\n* @memberof Moveable.Rotatable\r\n* @event rotate\r\n* @param {Moveable.Rotatable.OnRotate} - Parameters for the rotate event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, { rotatable: true });\r\n* moveable.on(\"rotate\", ({ target, transform, dist }) => {\r\n* target.style.transform = transform;\r\n* });\r\n*/\r\n/**\r\n * When the rotate finishes, the rotateEnd event is called.\r\n * @memberof Moveable.Rotatable\r\n * @event rotateEnd\r\n * @param {Moveable.Rotatable.OnRotateEnd} - Parameters for the rotateEnd event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { rotatable: true });\r\n * moveable.on(\"rotateEnd\", ({ target, isDrag }) => {\r\n * console.log(target, isDrag);\r\n * });\r\n */\r\n/**\r\n * When the group rotate starts, the `rotateGroupStart` event is called.\r\n * @memberof Moveable.Rotatable\r\n * @event rotateGroupStart\r\n * @param {Moveable.Rotatable.OnRotateGroupStart} - Parameters for the `rotateGroupStart` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * rotatable: true\r\n * });\r\n * moveable.on(\"rotateGroupStart\", ({ targets }) => {\r\n * console.log(\"onRotateGroupStart\", targets);\r\n * });\r\n */\r\n/**\r\n* When the group rotate, the `rotateGroup` event is called.\r\n* @memberof Moveable.Rotatable\r\n* @event rotateGroup\r\n* @param {Moveable.Rotatable.OnRotateGroup} - Parameters for the `rotateGroup` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* target: [].slice.call(document.querySelectorAll(\".target\")),\r\n* rotatable: true\r\n* });\r\n* moveable.on(\"rotateGroup\", ({ targets, events }) => {\r\n* console.log(\"onRotateGroup\", targets);\r\n* events.forEach(ev => {\r\n* const target = ev.target;\r\n* // ev.drag is a drag event that occurs when the group rotate.\r\n* const left = ev.drag.beforeDist[0];\r\n* const top = ev.drag.beforeDist[1];\r\n* const deg = ev.beforeDist;\r\n* });\r\n* });\r\n*/\r\n/**\r\n * When the group rotate finishes, the `rotateGroupEnd` event is called.\r\n * @memberof Moveable.Rotatable\r\n * @event rotateGroupEnd\r\n * @param {Moveable.Rotatable.OnRotateGroupEnd} - Parameters for the `rotateGroupEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * rotatable: true\r\n * });\r\n * moveable.on(\"rotateGroupEnd\", ({ targets, isDrag }) => {\r\n * console.log(\"onRotateGroupEnd\", targets, isDrag);\r\n * });\r\n */\n\nfunction renderGuideline(info, React) {\r\n var _a;\r\n var direction = info.direction, classNames = info.classNames, size = info.size, pos = info.pos, zoom = info.zoom, key = info.key;\r\n var isHorizontal = direction === \"horizontal\";\r\n var scaleType = isHorizontal ? \"Y\" : \"X\";\r\n // const scaleType2 = isHorizontal ? \"Y\" : \"X\";\r\n return React.createElement(\"div\", {\r\n key: key,\r\n className: classNames.join(\" \"),\r\n style: (_a = {},\r\n _a[isHorizontal ? \"width\" : \"height\"] = \"\".concat(size),\r\n _a.transform = \"translate(\".concat(pos[0], \", \").concat(pos[1], \") translate\").concat(scaleType, \"(-50%) scale\").concat(scaleType, \"(\").concat(zoom, \")\"),\r\n _a),\r\n });\r\n}\r\nfunction renderInnerGuideline(info, React) {\r\n return renderGuideline(__assign(__assign({}, info), { classNames: __spreadArray([\r\n prefix(\"line\", \"guideline\", info.direction)\r\n ], __read(info.classNames), false).filter(function (className) { return className; }), size: info.size || \"\".concat(info.sizeValue, \"px\"), pos: info.pos || info.posValue.map(function (v) { return \"\".concat(throttle(v, 0.1), \"px\"); }) }), React);\r\n}\r\nfunction renderSnapPoses(moveable, direction, snapPoses, minPos, targetPos, size, index, React) {\r\n var zoom = moveable.props.zoom;\r\n return snapPoses.map(function (_a, i) {\r\n var type = _a.type, pos = _a.pos;\r\n var renderPos = [0, 0];\r\n renderPos[index] = minPos;\r\n renderPos[index ? 0 : 1] = -targetPos + pos;\r\n return renderInnerGuideline({\r\n key: \"\".concat(direction, \"TargetGuideline\").concat(i),\r\n classNames: [prefix(\"target\", \"bold\", type)],\r\n posValue: renderPos,\r\n sizeValue: size,\r\n zoom: zoom,\r\n direction: direction,\r\n }, React);\r\n });\r\n}\r\nfunction renderGuidelines(moveable, type, guidelines, targetPos, targetRect, React) {\r\n var _a = moveable.props, zoom = _a.zoom, isDisplayInnerSnapDigit = _a.isDisplayInnerSnapDigit;\r\n var mainNames = type === \"horizontal\" ? VERTICAL_NAMES_MAP : HORIZONTAL_NAMES_MAP;\r\n var targetStart = targetRect[mainNames.start];\r\n var targetEnd = targetRect[mainNames.end];\r\n return guidelines.filter(function (_a) {\r\n var hide = _a.hide, elementRect = _a.elementRect;\r\n if (hide) {\r\n return false;\r\n }\r\n if (isDisplayInnerSnapDigit && elementRect) {\r\n // inner\r\n var rect = elementRect.rect;\r\n if (rect[mainNames.start] <= targetStart && targetEnd <= rect[mainNames.end]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }).map(function (guideline, i) {\r\n var pos = guideline.pos, size = guideline.size, element = guideline.element, className = guideline.className;\r\n var renderPos = [\r\n -targetPos[0] + pos[0],\r\n -targetPos[1] + pos[1],\r\n ];\r\n return renderInnerGuideline({\r\n key: \"\".concat(type, \"-default-guideline-\").concat(i),\r\n classNames: element ? [prefix(\"bold\"), className] : [prefix(\"normal\"), className],\r\n direction: type,\r\n posValue: renderPos,\r\n sizeValue: size,\r\n zoom: zoom,\r\n }, React);\r\n });\r\n}\r\nfunction renderDigitLine(moveable, type, lineType, index, gap, renderPos, className, React) {\r\n var _a;\r\n var _b = moveable.props, _c = _b.snapDigit, snapDigit = _c === void 0 ? 0 : _c, _d = _b.isDisplaySnapDigit, isDisplaySnapDigit = _d === void 0 ? true : _d, _e = _b.snapDistFormat, snapDistFormat = _e === void 0 ? function (v, type) {\r\n // Type can be used render different values.\r\n if (type === 'vertical') {\r\n return v;\r\n }\r\n return v;\r\n } : _e, zoom = _b.zoom;\r\n var scaleType = type === \"horizontal\" ? \"X\" : \"Y\";\r\n var sizeName = type === \"vertical\" ? \"height\" : \"width\";\r\n var absGap = Math.abs(gap);\r\n var snapSize = isDisplaySnapDigit\r\n ? parseFloat(absGap.toFixed(snapDigit))\r\n : 0;\r\n return React.createElement(\"div\", { key: \"\".concat(type, \"-\").concat(lineType, \"-guideline-\").concat(index), className: prefix(\"guideline-group\", type), style: (_a = {\r\n left: \"\".concat(renderPos[0], \"px\"),\r\n top: \"\".concat(renderPos[1], \"px\")\r\n },\r\n _a[sizeName] = \"\".concat(absGap, \"px\"),\r\n _a) },\r\n renderInnerGuideline({\r\n direction: type,\r\n classNames: [prefix(lineType), className],\r\n size: \"100%\",\r\n posValue: [0, 0],\r\n sizeValue: absGap,\r\n zoom: zoom,\r\n }, React),\r\n React.createElement(\"div\", { className: prefix(\"size-value\", \"gap\"), style: {\r\n transform: \"translate\".concat(scaleType, \"(-50%) scale(\").concat(zoom, \")\"),\r\n } }, snapSize > 0 ? snapDistFormat(snapSize, type) : \"\"));\r\n}\r\nfunction groupByElementGuidelines(type, guidelines, targetRect, isDisplayInnerSnapDigit) {\r\n var index = type === \"vertical\" ? 0 : 1;\r\n var otherIndex = type === \"vertical\" ? 1 : 0;\r\n var names = index ? VERTICAL_NAMES_MAP : HORIZONTAL_NAMES_MAP;\r\n var targetStart = targetRect[names.start];\r\n var targetEnd = targetRect[names.end];\r\n return groupBy(guidelines, function (guideline) {\r\n return guideline.pos[index];\r\n }).map(function (nextGuidelines) {\r\n var start = [];\r\n var end = [];\r\n var inner = [];\r\n nextGuidelines.forEach(function (guideline) {\r\n var _a, _b;\r\n var element = guideline.element;\r\n var rect = guideline.elementRect.rect;\r\n if (rect[names.end] < targetStart) {\r\n start.push(guideline);\r\n }\r\n else if (targetEnd < rect[names.start]) {\r\n end.push(guideline);\r\n }\r\n else if (rect[names.start] <= targetStart && targetEnd <= rect[names.end] && isDisplayInnerSnapDigit) {\r\n var pos = guideline.pos;\r\n var elementRect1 = { element: element, rect: __assign(__assign({}, rect), (_a = {}, _a[names.end] = rect[names.start], _a)) };\r\n var elementRect2 = { element: element, rect: __assign(__assign({}, rect), (_b = {}, _b[names.start] = rect[names.end], _b)) };\r\n var nextPos1 = [0, 0];\r\n var nextPos2 = [0, 0];\r\n nextPos1[index] = pos[index];\r\n nextPos1[otherIndex] = pos[otherIndex];\r\n nextPos2[index] = pos[index];\r\n nextPos2[otherIndex] = pos[otherIndex] + guideline.size;\r\n start.push({\r\n type: type,\r\n pos: nextPos1,\r\n size: 0,\r\n elementRect: elementRect1,\r\n direction: \"\",\r\n elementDirection: \"end\",\r\n });\r\n end.push({\r\n type: type,\r\n pos: nextPos2,\r\n size: 0,\r\n elementRect: elementRect2,\r\n direction: \"\",\r\n elementDirection: \"start\",\r\n });\r\n // inner.push(guideline);\r\n }\r\n });\r\n start.sort(function (a, b) {\r\n return b.pos[otherIndex] - a.pos[otherIndex];\r\n });\r\n end.sort(function (a, b) {\r\n return a.pos[otherIndex] - b.pos[otherIndex];\r\n });\r\n return {\r\n total: nextGuidelines,\r\n start: start,\r\n end: end,\r\n inner: inner,\r\n };\r\n });\r\n}\r\nfunction renderDashedGuidelines(moveable, guidelines, targetPos, targetRect, React) {\r\n var isDisplayInnerSnapDigit = moveable.props.isDisplayInnerSnapDigit;\r\n var rendered = [];\r\n [\"vertical\", \"horizontal\"].forEach(function (type) {\r\n var nextGuidelines = guidelines.filter(function (guideline) { return guideline.type === type; });\r\n var index = type === \"vertical\" ? 1 : 0;\r\n var otherIndex = index ? 0 : 1;\r\n var groups = groupByElementGuidelines(type, nextGuidelines, targetRect, isDisplayInnerSnapDigit);\r\n var mainNames = index ? HORIZONTAL_NAMES_MAP : VERTICAL_NAMES_MAP;\r\n var sideNames = index ? VERTICAL_NAMES_MAP : HORIZONTAL_NAMES_MAP;\r\n var targetStart = targetRect[mainNames.start];\r\n var targetEnd = targetRect[mainNames.end];\r\n groups.forEach(function (_a) {\r\n var total = _a.total, start = _a.start, end = _a.end, inner = _a.inner;\r\n var sidePos = targetPos[otherIndex] + total[0].pos[otherIndex] - targetRect[sideNames.start];\r\n var prevRect = targetRect;\r\n start.forEach(function (guideline) {\r\n var nextRect = guideline.elementRect.rect;\r\n var size = prevRect[mainNames.start] - nextRect[mainNames.end];\r\n if (size > 0) {\r\n var renderPos = [0, 0];\r\n renderPos[index] = targetPos[index] + prevRect[mainNames.start] - targetStart - size;\r\n renderPos[otherIndex] = sidePos;\r\n rendered.push(renderDigitLine(moveable, type, \"dashed\", rendered.length, size, renderPos, guideline.className, React));\r\n }\r\n prevRect = nextRect;\r\n });\r\n prevRect = targetRect;\r\n end.forEach(function (guideline) {\r\n var nextRect = guideline.elementRect.rect;\r\n var size = nextRect[mainNames.start] - prevRect[mainNames.end];\r\n if (size > 0) {\r\n var renderPos = [0, 0];\r\n renderPos[index] = targetPos[index] + prevRect[mainNames.end] - targetStart;\r\n renderPos[otherIndex] = sidePos;\r\n rendered.push(renderDigitLine(moveable, type, \"dashed\", rendered.length, size, renderPos, guideline.className, React));\r\n }\r\n prevRect = nextRect;\r\n });\r\n inner.forEach(function (guideline) {\r\n var nextRect = guideline.elementRect.rect;\r\n var size1 = targetStart - nextRect[mainNames.start];\r\n var size2 = nextRect[mainNames.end] - targetEnd;\r\n var renderPos1 = [0, 0];\r\n var renderPos2 = [0, 0];\r\n renderPos1[index] = targetPos[index] - size1;\r\n renderPos1[otherIndex] = sidePos;\r\n renderPos2[index] = targetPos[index] + targetEnd - targetStart;\r\n renderPos2[otherIndex] = sidePos;\r\n rendered.push(renderDigitLine(moveable, type, \"dashed\", rendered.length, size1, renderPos1, guideline.className, React));\r\n rendered.push(renderDigitLine(moveable, type, \"dashed\", rendered.length, size2, renderPos2, guideline.className, React));\r\n });\r\n });\r\n });\r\n return rendered;\r\n}\r\nfunction renderGapGuidelines(moveable, guidelines, targetPos, targetRect, React) {\r\n var rendered = [];\r\n [\"horizontal\", \"vertical\"].forEach(function (type) {\r\n var nextGuidelines = guidelines.filter(function (guideline) { return guideline.type === type; }).slice(0, 1);\r\n var index = type === \"vertical\" ? 0 : 1;\r\n var otherIndex = index ? 0 : 1;\r\n var mainNames = index ? HORIZONTAL_NAMES_MAP : VERTICAL_NAMES_MAP;\r\n var sideNames = index ? VERTICAL_NAMES_MAP : HORIZONTAL_NAMES_MAP;\r\n var targetStart = targetRect[mainNames.start];\r\n var targetEnd = targetRect[mainNames.end];\r\n var targetSideStart = targetRect[sideNames.start];\r\n var targetSideEnd = targetRect[sideNames.end];\r\n nextGuidelines.forEach(function (_a) {\r\n var gap = _a.gap, gapRects = _a.gapRects;\r\n var sideStartPos = Math.max.apply(Math, __spreadArray([targetSideStart], __read(gapRects.map(function (_a) {\r\n var rect = _a.rect;\r\n return rect[sideNames.start];\r\n })), false));\r\n var sideEndPos = Math.min.apply(Math, __spreadArray([targetSideEnd], __read(gapRects.map(function (_a) {\r\n var rect = _a.rect;\r\n return rect[sideNames.end];\r\n })), false));\r\n var sideCenterPos = (sideStartPos + sideEndPos) / 2;\r\n if (sideStartPos === sideEndPos || sideCenterPos === (targetSideStart + targetSideEnd) / 2) {\r\n return;\r\n }\r\n gapRects.forEach(function (_a) {\r\n var rect = _a.rect, className = _a.className;\r\n var renderPos = [targetPos[0], targetPos[1]];\r\n if (rect[mainNames.end] < targetStart) {\r\n renderPos[index] += rect[mainNames.end] - targetStart;\r\n }\r\n else if (targetEnd < rect[mainNames.start]) {\r\n renderPos[index] += rect[mainNames.start] - targetStart - gap;\r\n }\r\n else {\r\n return;\r\n }\r\n renderPos[otherIndex] += sideCenterPos - targetSideStart;\r\n rendered.push(renderDigitLine(moveable, index ? \"vertical\" : \"horizontal\", \"gap\", rendered.length, gap, renderPos, className, React));\r\n });\r\n });\r\n });\r\n return rendered;\r\n}\n\nfunction getTotalGuidelines(moveable) {\r\n var _a, _b;\r\n var state = moveable.state;\r\n var containerClientRect = state.containerClientRect, hasFixed = state.hasFixed;\r\n var overflow = containerClientRect.overflow, containerHeight = containerClientRect.scrollHeight, containerWidth = containerClientRect.scrollWidth, containerClientHeight = containerClientRect.clientHeight, containerClientWidth = containerClientRect.clientWidth, clientLeft = containerClientRect.clientLeft, clientTop = containerClientRect.clientTop;\r\n var _c = moveable.props, _d = _c.snapGap, snapGap = _d === void 0 ? true : _d, verticalGuidelines = _c.verticalGuidelines, horizontalGuidelines = _c.horizontalGuidelines, _e = _c.snapThreshold, snapThreshold = _e === void 0 ? 5 : _e, _f = _c.maxSnapElementGuidelineDistance, maxSnapElementGuidelineDistance = _f === void 0 ? Infinity : _f, isDisplayGridGuidelines = _c.isDisplayGridGuidelines;\r\n var _g = getRect(getAbsolutePosesByState(moveable.state)), top = _g.top, left = _g.left, bottom = _g.bottom, right = _g.right;\r\n var targetRect = { top: top, left: left, bottom: bottom, right: right, center: (left + right) / 2, middle: (top + bottom) / 2 };\r\n var elementGuidelines = getElementGuidelines(moveable);\r\n var totalGuidelines = __spreadArray([], __read(elementGuidelines), false);\r\n var snapThresholdMultiples = ((_b = (_a = state.snapThresholdInfo) === null || _a === void 0 ? void 0 : _a.multiples) !== null && _b !== void 0 ? _b : [1, 1]).map(function (n) { return n * snapThreshold; });\r\n if (snapGap) {\r\n totalGuidelines.push.apply(totalGuidelines, __spreadArray([], __read(getGapGuidelines(moveable, targetRect, snapThresholdMultiples)), false));\r\n }\r\n var snapOffset = __assign({}, (state.snapOffset || {\r\n left: 0,\r\n top: 0,\r\n bottom: 0,\r\n right: 0,\r\n }));\r\n totalGuidelines.push.apply(totalGuidelines, __spreadArray([], __read(getGridGuidelines(moveable, overflow ? containerWidth : containerClientWidth, overflow ? containerHeight : containerClientHeight, clientLeft, clientTop, snapOffset, isDisplayGridGuidelines)), false));\r\n if (hasFixed) {\r\n var left_1 = containerClientRect.left, top_1 = containerClientRect.top;\r\n snapOffset.left += left_1;\r\n snapOffset.top += top_1;\r\n snapOffset.right += left_1;\r\n snapOffset.bottom += top_1;\r\n }\r\n totalGuidelines.push.apply(totalGuidelines, __spreadArray([], __read(getDefaultGuidelines(horizontalGuidelines || false, verticalGuidelines || false, overflow ? containerWidth : containerClientWidth, overflow ? containerHeight : containerClientHeight, clientLeft, clientTop, snapOffset)), false));\r\n totalGuidelines = totalGuidelines.filter(function (_a) {\r\n var element = _a.element, elementRect = _a.elementRect, type = _a.type;\r\n if (!element || !elementRect) {\r\n return true;\r\n }\r\n var rect = elementRect.rect;\r\n return checkBetweenRects(targetRect, rect, type, maxSnapElementGuidelineDistance);\r\n });\r\n return totalGuidelines;\r\n}\r\nfunction getGapGuidelines(moveable, targetRect, snapThresholds) {\r\n var _a = moveable.props, _b = _a.maxSnapElementGuidelineDistance, maxSnapElementGuidelineDistance = _b === void 0 ? Infinity : _b, _c = _a.maxSnapElementGapDistance, maxSnapElementGapDistance = _c === void 0 ? Infinity : _c;\r\n var elementRects = moveable.state.elementRects;\r\n var gapGuidelines = [];\r\n [\r\n [\"vertical\", VERTICAL_NAMES_MAP, HORIZONTAL_NAMES_MAP],\r\n [\"horizontal\", HORIZONTAL_NAMES_MAP, VERTICAL_NAMES_MAP],\r\n ].forEach(function (_a) {\r\n var _b = __read(_a, 3), type = _b[0], mainNames = _b[1], sideNames = _b[2];\r\n var targetStart = targetRect[mainNames.start];\r\n var targetEnd = targetRect[mainNames.end];\r\n var targetCenter = targetRect[mainNames.center];\r\n var targetStart2 = targetRect[sideNames.start];\r\n var targetEnd2 = targetRect[sideNames.end];\r\n // element : moveable\r\n var snapThresholdMap = {\r\n left: snapThresholds[0],\r\n top: snapThresholds[1],\r\n };\r\n function getDist(elementRect) {\r\n var rect = elementRect.rect;\r\n var snapThreshold = snapThresholdMap[mainNames.start];\r\n if (rect[mainNames.end] < targetStart + snapThreshold) {\r\n return targetStart - rect[mainNames.end];\r\n }\r\n else if (targetEnd - snapThreshold < rect[mainNames.start]) {\r\n return rect[mainNames.start] - targetEnd;\r\n }\r\n else {\r\n return -1;\r\n }\r\n }\r\n var nextElementRects = elementRects.filter(function (elementRect) {\r\n var rect = elementRect.rect;\r\n if (rect[sideNames.start] > targetEnd2 || rect[sideNames.end] < targetStart2) {\r\n return false;\r\n }\r\n return getDist(elementRect) > 0;\r\n }).sort(function (a, b) {\r\n return getDist(a) - getDist(b);\r\n });\r\n var groups = [];\r\n nextElementRects.forEach(function (snapRect1) {\r\n nextElementRects.forEach(function (snapRect2) {\r\n if (snapRect1 === snapRect2) {\r\n return;\r\n }\r\n var rect1 = snapRect1.rect;\r\n var rect2 = snapRect2.rect;\r\n var rect1Start = rect1[sideNames.start];\r\n var rect1End = rect1[sideNames.end];\r\n var rect2Start = rect2[sideNames.start];\r\n var rect2End = rect2[sideNames.end];\r\n if (rect1Start > rect2End || rect2Start > rect1End) {\r\n return;\r\n }\r\n groups.push([snapRect1, snapRect2]);\r\n });\r\n });\r\n groups.forEach(function (_a) {\r\n var _b = __read(_a, 2), snapRect1 = _b[0], snapRect2 = _b[1];\r\n var rect1 = snapRect1.rect;\r\n var rect2 = snapRect2.rect;\r\n var rect1Start = rect1[mainNames.start];\r\n var rect1End = rect1[mainNames.end];\r\n var rect2Start = rect2[mainNames.start];\r\n var rect2End = rect2[mainNames.end];\r\n var snapThreshold = snapThresholdMap[mainNames.start];\r\n var gap = 0;\r\n var pos = 0;\r\n var isStart = false;\r\n var isCenter = false;\r\n var isEnd = false;\r\n if (rect1End <= targetStart && targetEnd <= rect2Start) {\r\n // (l)element1(r) : (l)target(r) : (l)element2(r)\r\n isCenter = true;\r\n gap = ((rect2Start - rect1End) - (targetEnd - targetStart)) / 2;\r\n pos = rect1End + gap + (targetEnd - targetStart) / 2;\r\n if (abs(pos - targetCenter) > snapThreshold) {\r\n return;\r\n }\r\n }\r\n else if (rect1End < rect2Start && rect2End < targetStart + snapThreshold) {\r\n // (l)element1(r) : (l)element2(r) : (l)target\r\n isStart = true;\r\n gap = rect2Start - rect1End;\r\n pos = rect2End + gap;\r\n if (abs(pos - targetStart) > snapThreshold) {\r\n return;\r\n }\r\n }\r\n else if (rect1End < rect2Start && targetEnd - snapThreshold < rect1Start) {\r\n // target(r) : (l)element1(r) : (l)element2(r)\r\n isEnd = true;\r\n gap = rect2Start - rect1End;\r\n pos = rect1Start - gap;\r\n if (abs(pos - targetEnd) > snapThreshold) {\r\n return;\r\n }\r\n }\r\n else {\r\n return;\r\n }\r\n if (!gap) {\r\n return;\r\n }\r\n if (!checkBetweenRects(targetRect, rect2, type, maxSnapElementGuidelineDistance)) {\r\n return;\r\n }\r\n if (gap > maxSnapElementGapDistance) {\r\n return;\r\n }\r\n gapGuidelines.push({\r\n type: type,\r\n pos: type === \"vertical\" ? [pos, 0] : [0, pos],\r\n element: snapRect2.element,\r\n size: 0,\r\n className: snapRect2.className,\r\n isStart: isStart,\r\n isCenter: isCenter,\r\n isEnd: isEnd,\r\n gap: gap,\r\n hide: true,\r\n gapRects: [snapRect1, snapRect2],\r\n direction: \"\",\r\n elementDirection: \"\",\r\n });\r\n });\r\n });\r\n return gapGuidelines;\r\n}\r\nfunction startGridGroupGuidelines(moveable, clientLeft, clientTop, snapOffset) {\r\n var _a, _b;\r\n var props = moveable.props;\r\n var state = moveable.state;\r\n var snapGridAll = props.snapGridAll;\r\n var _c = props.snapGridWidth, snapGridWidth = _c === void 0 ? 0 : _c, _d = props.snapGridHeight, snapGridHeight = _d === void 0 ? 0 : _d;\r\n var snapRenderInfo = state.snapRenderInfo;\r\n var hasDirection = snapRenderInfo && (((_a = snapRenderInfo.direction) === null || _a === void 0 ? void 0 : _a[0]) || ((_b = snapRenderInfo.direction) === null || _b === void 0 ? void 0 : _b[1]));\r\n var moveables = moveable.moveables;\r\n // snap group's all child to grid.\r\n if (snapGridAll\r\n && moveables\r\n && hasDirection\r\n && (snapGridWidth || snapGridHeight)) {\r\n if (state.snapThresholdInfo) {\r\n return;\r\n }\r\n state.snapThresholdInfo = {\r\n multiples: [1, 1],\r\n offset: [0, 0],\r\n };\r\n var rect_1 = moveable.getRect();\r\n var children_1 = rect_1.children;\r\n var direction = snapRenderInfo.direction;\r\n if (children_1) {\r\n var result = direction.map(function (dir, i) {\r\n var _a = i === 0 ? {\r\n snapSize: snapGridWidth,\r\n posName: \"left\",\r\n sizeName: \"width\",\r\n clientOffset: snapOffset.left - clientLeft,\r\n } : {\r\n snapSize: snapGridHeight,\r\n posName: \"top\",\r\n sizeName: \"height\",\r\n clientOffset: snapOffset.top - clientTop,\r\n }, snapSize = _a.snapSize, posName = _a.posName, sizeName = _a.sizeName, clientOffset = _a.clientOffset;\r\n if (!snapSize) {\r\n return {\r\n dir: dir,\r\n multiple: 1,\r\n snapSize: snapSize,\r\n snapOffset: 0,\r\n };\r\n }\r\n var rectSize = rect_1[sizeName];\r\n var rectPos = rect_1[posName];\r\n // 사이즈보다 만약 작다면 어떻게 해야되죠?\r\n var childSizes = flat$1(children_1.map(function (child) {\r\n return [\r\n (child[posName] - rectPos),\r\n (child[sizeName]),\r\n (rectSize - child[sizeName] - child[posName] + rectPos),\r\n ];\r\n })).filter(function (v) { return v; }).sort(function (a, b) {\r\n return a - b;\r\n });\r\n var firstChildSize = childSizes[0];\r\n var childSnapSizes = childSizes.map(function (size) { return throttle(size / firstChildSize, 0.1) * snapSize; });\r\n var n = 1;\r\n var rectRatio = throttle(rectSize / firstChildSize, 0.1);\r\n for (n = 1; n <= 10; ++n) {\r\n if (childSnapSizes.every(function (childSize) {\r\n return childSize * n % 1 === 0;\r\n })) {\r\n break;\r\n }\r\n }\r\n // dir 1 (fixed -1)\r\n // dir 0 (fixed 0)\r\n // dir -1 (fixed 1)\r\n var ratio = (-dir + 1) / 2;\r\n var offsetPos = dot(rectPos - clientOffset, rectPos - clientOffset + rectSize, ratio, 1 - ratio);\r\n return {\r\n multiple: rectRatio * n,\r\n dir: dir,\r\n snapSize: snapSize,\r\n snapOffset: Math.round(offsetPos / snapSize),\r\n };\r\n });\r\n var multiples = result.map(function (r) { return r.multiple || 1; });\r\n state.snapThresholdInfo.multiples = multiples;\r\n state.snapThresholdInfo.offset = result.map(function (r) { return r.snapOffset; });\r\n result.forEach(function (r, i) {\r\n if (r.snapSize) ;\r\n });\r\n }\r\n }\r\n else {\r\n state.snapThresholdInfo = null;\r\n }\r\n}\r\nfunction getGridGuidelines(moveable, containerWidth, containerHeight, clientLeft, clientTop, snapOffset, isDisplayGridGuidelines) {\r\n if (clientLeft === void 0) { clientLeft = 0; }\r\n if (clientTop === void 0) { clientTop = 0; }\r\n var props = moveable.props;\r\n var state = moveable.state;\r\n var _a = props.snapGridWidth, snapGridWidth = _a === void 0 ? 0 : _a, _b = props.snapGridHeight, snapGridHeight = _b === void 0 ? 0 : _b;\r\n var guidelines = [];\r\n var snapOffsetLeft = snapOffset.left, snapOffsetTop = snapOffset.top;\r\n var startOffset = [0, 0];\r\n startGridGroupGuidelines(moveable, clientLeft, clientTop, snapOffset);\r\n var snapThresholdInfo = state.snapThresholdInfo;\r\n var defaultSnapGridWidth = snapGridWidth;\r\n var defaultSnapGridHeight = snapGridHeight;\r\n if (snapThresholdInfo) {\r\n snapGridWidth *= snapThresholdInfo.multiples[0] || 1;\r\n snapGridHeight *= snapThresholdInfo.multiples[1] || 1;\r\n startOffset = snapThresholdInfo.offset;\r\n }\r\n if (snapGridHeight) {\r\n var pushGuideline = function (pos) {\r\n guidelines.push({\r\n type: \"horizontal\",\r\n pos: [\r\n snapOffsetLeft,\r\n throttle(startOffset[1] * defaultSnapGridHeight + pos - clientTop + snapOffsetTop, 0.1),\r\n ],\r\n className: prefix(\"grid-guideline\"),\r\n size: containerWidth,\r\n hide: !isDisplayGridGuidelines,\r\n direction: \"\",\r\n grid: true,\r\n });\r\n };\r\n for (var pos = 0; pos <= containerHeight * 2; pos += snapGridHeight) {\r\n pushGuideline(pos);\r\n }\r\n for (var pos = -snapGridHeight; pos >= -containerHeight; pos -= snapGridHeight) {\r\n pushGuideline(pos);\r\n }\r\n }\r\n if (snapGridWidth) {\r\n var pushGuideline = function (pos) {\r\n guidelines.push({\r\n type: \"vertical\",\r\n pos: [\r\n throttle(startOffset[0] * defaultSnapGridWidth + pos - clientLeft + snapOffsetLeft, 0.1),\r\n snapOffsetTop,\r\n ],\r\n className: prefix(\"grid-guideline\"),\r\n size: containerHeight,\r\n hide: !isDisplayGridGuidelines,\r\n direction: \"\",\r\n grid: true,\r\n });\r\n };\r\n for (var pos = 0; pos <= containerWidth * 2; pos += snapGridWidth) {\r\n pushGuideline(pos);\r\n }\r\n for (var pos = -snapGridWidth; pos >= -containerWidth; pos -= snapGridWidth) {\r\n pushGuideline(pos);\r\n }\r\n }\r\n return guidelines;\r\n}\r\nfunction checkBetweenRects(rect1, rect2, type, distance) {\r\n if (type === \"horizontal\") {\r\n return abs(rect1.right - rect2.left) <= distance\r\n || abs(rect1.left - rect2.right) <= distance\r\n || rect1.left <= rect2.right && rect2.left <= rect1.right;\r\n }\r\n else if (type === \"vertical\") {\r\n return abs(rect1.bottom - rect2.top) <= distance\r\n || abs(rect1.top - rect2.bottom) <= distance\r\n || rect1.top <= rect2.bottom && rect2.top <= rect1.bottom;\r\n }\r\n return true;\r\n}\r\nfunction getElementGuidelines(moveable) {\r\n var state = moveable.state;\r\n var _a = moveable.props.elementGuidelines, elementGuidelines = _a === void 0 ? [] : _a;\r\n if (!elementGuidelines.length) {\r\n state.elementRects = [];\r\n return [];\r\n }\r\n var prevValues = (state.elementRects || []).filter(function (snapRect) { return !snapRect.refresh; });\r\n var nextElementGuidelines = elementGuidelines.map(function (el) {\r\n if (isObject(el) && \"element\" in el) {\r\n return __assign(__assign({}, el), { element: getRefTarget(el.element, true) });\r\n }\r\n return {\r\n element: getRefTarget(el, true),\r\n };\r\n }).filter(function (value) {\r\n return value.element;\r\n });\r\n var _b = diff(prevValues.map(function (v) { return v.element; }), nextElementGuidelines.map(function (v) { return v.element; })), maintained = _b.maintained, added = _b.added;\r\n var nextValues = [];\r\n maintained.forEach(function (_a) {\r\n var _b = __read(_a, 2), prevIndex = _b[0], nextIndex = _b[1];\r\n nextValues[nextIndex] = prevValues[prevIndex];\r\n });\r\n getSnapElementRects(moveable, added.map(function (index) { return nextElementGuidelines[index]; })).map(function (rect, i) {\r\n nextValues[added[i]] = rect;\r\n });\r\n state.elementRects = nextValues;\r\n var elementSnapDirections = getSnapDirections(moveable.props.elementSnapDirections);\r\n var nextGuidelines = [];\r\n nextValues.forEach(function (snapRect) {\r\n var element = snapRect.element, _a = snapRect.top, topValue = _a === void 0 ? elementSnapDirections.top : _a, _b = snapRect.left, leftValue = _b === void 0 ? elementSnapDirections.left : _b, _c = snapRect.right, rightValue = _c === void 0 ? elementSnapDirections.right : _c, _d = snapRect.bottom, bottomValue = _d === void 0 ? elementSnapDirections.bottom : _d, _e = snapRect.center, centerValue = _e === void 0 ? elementSnapDirections.center : _e, _f = snapRect.middle, middleValue = _f === void 0 ? elementSnapDirections.middle : _f, className = snapRect.className, rect = snapRect.rect;\r\n var _g = splitSnapDirectionPoses({\r\n top: topValue,\r\n right: rightValue,\r\n left: leftValue,\r\n bottom: bottomValue,\r\n center: centerValue,\r\n middle: middleValue,\r\n }, rect), horizontal = _g.horizontal, vertical = _g.vertical, horizontalNames = _g.horizontalNames, verticalNames = _g.verticalNames;\r\n var rectTop = rect.top;\r\n var rectLeft = rect.left;\r\n var width = rect.right - rectLeft;\r\n var height = rect.bottom - rectTop;\r\n var sizes = [width, height];\r\n vertical.forEach(function (pos, i) {\r\n nextGuidelines.push({\r\n type: \"vertical\",\r\n element: element,\r\n pos: [\r\n throttle(pos, 0.1),\r\n rectTop,\r\n ], size: height,\r\n sizes: sizes,\r\n className: className,\r\n elementRect: snapRect,\r\n elementDirection: SNAP_SKIP_NAMES_MAP[verticalNames[i]] || verticalNames[i],\r\n direction: \"\",\r\n });\r\n });\r\n horizontal.forEach(function (pos, i) {\r\n nextGuidelines.push({\r\n type: \"horizontal\",\r\n element: element,\r\n pos: [\r\n rectLeft,\r\n throttle(pos, 0.1),\r\n ],\r\n size: width,\r\n sizes: sizes,\r\n className: className,\r\n elementRect: snapRect,\r\n elementDirection: SNAP_SKIP_NAMES_MAP[horizontalNames[i]] || horizontalNames[i],\r\n direction: \"\",\r\n });\r\n });\r\n });\r\n return nextGuidelines;\r\n}\r\nfunction getObjectGuidelines(guidelines, containerSize) {\r\n return guidelines ? guidelines.map(function (info) {\r\n var posGuideline = isObject(info) ? info : { pos: info };\r\n var pos = posGuideline.pos;\r\n if (isNumber(pos)) {\r\n return posGuideline;\r\n }\r\n else {\r\n return __assign(__assign({}, posGuideline), { pos: convertUnitSize(pos, containerSize) });\r\n }\r\n }) : [];\r\n}\r\nfunction getDefaultGuidelines(horizontalGuidelines, verticalGuidelines, width, height, clientLeft, clientTop, snapOffset) {\r\n if (clientLeft === void 0) { clientLeft = 0; }\r\n if (clientTop === void 0) { clientTop = 0; }\r\n if (snapOffset === void 0) { snapOffset = { left: 0, top: 0, right: 0, bottom: 0 }; }\r\n var guidelines = [];\r\n var snapOffsetLeft = snapOffset.left, snapOffsetTop = snapOffset.top, snapOffsetBottom = snapOffset.bottom, snapOffsetRight = snapOffset.right;\r\n var snapWidth = width + snapOffsetRight - snapOffsetLeft;\r\n var snapHeight = height + snapOffsetBottom - snapOffsetTop;\r\n getObjectGuidelines(horizontalGuidelines, snapHeight).forEach(function (posInfo) {\r\n guidelines.push({\r\n type: \"horizontal\",\r\n pos: [\r\n snapOffsetLeft,\r\n throttle(posInfo.pos - clientTop + snapOffsetTop, 0.1),\r\n ],\r\n size: snapWidth,\r\n className: posInfo.className,\r\n direction: \"\",\r\n });\r\n });\r\n getObjectGuidelines(verticalGuidelines, snapWidth).forEach(function (posInfo) {\r\n guidelines.push({\r\n type: \"vertical\",\r\n pos: [\r\n throttle(posInfo.pos - clientLeft + snapOffsetLeft, 0.1),\r\n snapOffsetTop,\r\n ],\r\n size: snapHeight,\r\n className: posInfo.className,\r\n direction: \"\",\r\n });\r\n });\r\n return guidelines;\r\n}\r\nfunction getSnapElementRects(moveable, values) {\r\n if (!values.length) {\r\n return [];\r\n }\r\n var groupable = moveable.props.groupable;\r\n var state = moveable.state;\r\n var containerClientRect = state.containerClientRect, \r\n // targetClientRect: {\r\n // top: clientTop,\r\n // left: clientLeft,\r\n // },\r\n rootMatrix = state.rootMatrix, is3d = state.is3d, offsetDelta = state.offsetDelta;\r\n var n = is3d ? 4 : 3;\r\n var _a = __read(calculateContainerPos(rootMatrix, containerClientRect, n), 2), containerLeft = _a[0], containerTop = _a[1];\r\n // const poses = getAbsolutePosesByState(state);\r\n // const {\r\n // minX: targetLeft,\r\n // minY: targetTop,\r\n // } = getMinMaxs(poses);\r\n // const [distLeft, distTop] = minus([targetLeft, targetTop], calculateInversePosition(rootMatrix, [\r\n // clientLeft - containerLeft,\r\n // clientTop - containerTop,\r\n // ], n)).map(pos => roundSign(pos));\r\n var offsetLeft = groupable ? 0 : offsetDelta[0];\r\n var offsetTop = groupable ? 0 : offsetDelta[1];\r\n return values.map(function (value) {\r\n var rect = value.element.getBoundingClientRect();\r\n var left = rect.left - containerLeft - offsetLeft;\r\n var top = rect.top - containerTop - offsetTop;\r\n var bottom = top + rect.height;\r\n var right = left + rect.width;\r\n var _a = __read(calculateInversePosition(rootMatrix, [left, top], n), 2), elementLeft = _a[0], elementTop = _a[1];\r\n var _b = __read(calculateInversePosition(rootMatrix, [right, bottom], n), 2), elementRight = _b[0], elementBottom = _b[1];\r\n return __assign(__assign({}, value), { rect: {\r\n left: elementLeft,\r\n right: elementRight,\r\n top: elementTop,\r\n bottom: elementBottom,\r\n center: (elementLeft + elementRight) / 2,\r\n middle: (elementTop + elementBottom) / 2,\r\n } });\r\n });\r\n}\n\nfunction checkSnapInfo(moveable) {\r\n var state = moveable.state;\r\n var container = state.container;\r\n var snapContainer = moveable.props.snapContainer || container;\r\n if (state.snapContainer === snapContainer && state.guidelines && state.guidelines.length) {\r\n return false;\r\n }\r\n var containerClientRect = state.containerClientRect;\r\n var snapOffset = {\r\n left: 0,\r\n top: 0,\r\n bottom: 0,\r\n right: 0,\r\n };\r\n if (container !== snapContainer) {\r\n var snapContainerTarget = getRefTarget(snapContainer, true);\r\n if (snapContainerTarget) {\r\n var snapContainerRect = getClientRect(snapContainerTarget);\r\n var offset1 = getDragDistByState(state, [\r\n snapContainerRect.left - containerClientRect.left,\r\n snapContainerRect.top - containerClientRect.top,\r\n ]);\r\n var offset2 = getDragDistByState(state, [\r\n snapContainerRect.right - containerClientRect.right,\r\n snapContainerRect.bottom - containerClientRect.bottom,\r\n ]);\r\n snapOffset.left = throttle(offset1[0], 0.00001);\r\n snapOffset.top = throttle(offset1[1], 0.00001);\r\n snapOffset.right = throttle(offset2[0], 0.00001);\r\n snapOffset.bottom = throttle(offset2[1], 0.00001);\r\n }\r\n }\r\n state.snapContainer = snapContainer;\r\n state.snapOffset = snapOffset;\r\n state.guidelines = getTotalGuidelines(moveable);\r\n state.enableSnap = true;\r\n return true;\r\n}\r\nfunction getNextFixedPoses(matrix, width, height, fixedDirection, fixedPos, is3d) {\r\n var nextPoses = calculatePoses(matrix, width, height, is3d ? 4 : 3);\r\n var nextFixedPos = getPosByDirection(nextPoses, fixedDirection);\r\n return getAbsolutePoses(nextPoses, minus(fixedPos, nextFixedPos));\r\n}\r\nfunction normalized(value) {\r\n return value ? value / abs(value) : 0;\r\n}\r\nfunction getSizeOffsetInfo(moveable, poses, direction, keepRatio, isRequest, datas) {\r\n var fixedDirection = datas.fixedDirection;\r\n var directions = getCheckSnapDirections(direction, fixedDirection, keepRatio);\r\n var innerBoundLineInfos = getCheckInnerBoundLineInfos(moveable, poses, direction, keepRatio);\r\n var offsets = __spreadArray(__spreadArray([], __read(getSnapBoundInfo(moveable, poses, directions, keepRatio, isRequest, datas)), false), __read(getInnerBoundInfo(moveable, innerBoundLineInfos, datas)), false);\r\n var widthOffsetInfo = getNearOffsetInfo(offsets, 0);\r\n var heightOffsetInfo = getNearOffsetInfo(offsets, 1);\r\n return {\r\n width: {\r\n isBound: widthOffsetInfo.isBound,\r\n offset: widthOffsetInfo.offset[0],\r\n },\r\n height: {\r\n isBound: heightOffsetInfo.isBound,\r\n offset: heightOffsetInfo.offset[1],\r\n },\r\n };\r\n}\r\nfunction recheckSizeByTwoDirection(moveable, poses, width, height, maxWidth, maxHeight, direction, isRequest, datas) {\r\n var snapPos = getPosByDirection(poses, direction);\r\n var _a = checkMoveableSnapBounds(moveable, isRequest, {\r\n vertical: [snapPos[0]],\r\n horizontal: [snapPos[1]],\r\n }), horizontalOffset = _a.horizontal.offset, verticalOffset = _a.vertical.offset;\r\n if (throttle(verticalOffset, FLOAT_POINT_NUM) || throttle(horizontalOffset, FLOAT_POINT_NUM)) {\r\n var _b = __read(getDragDist({\r\n datas: datas,\r\n distX: -verticalOffset,\r\n distY: -horizontalOffset,\r\n }), 2), nextWidthOffset = _b[0], nextHeightOffset = _b[1];\r\n var nextWidth = Math.min(maxWidth || Infinity, width + direction[0] * nextWidthOffset);\r\n var nextHeight = Math.min(maxHeight || Infinity, height + direction[1] * nextHeightOffset);\r\n return [nextWidth - width, nextHeight - height];\r\n }\r\n return [0, 0];\r\n}\r\nfunction checkSizeDist(moveable, getNextPoses, width, height, direction, fixedPosition, isRequest, datas) {\r\n var poses = getAbsolutePosesByState(moveable.state);\r\n var keepRatio = moveable.props.keepRatio;\r\n var widthOffset = 0;\r\n var heightOffset = 0;\r\n for (var i = 0; i < 2; ++i) {\r\n var nextPoses = getNextPoses(widthOffset, heightOffset);\r\n var _a = getSizeOffsetInfo(moveable, nextPoses, direction, keepRatio, isRequest, datas), widthOffsetInfo = _a.width, heightOffsetInfo = _a.height;\r\n var isWidthBound = widthOffsetInfo.isBound;\r\n var isHeightBound = heightOffsetInfo.isBound;\r\n var nextWidthOffset = widthOffsetInfo.offset;\r\n var nextHeightOffset = heightOffsetInfo.offset;\r\n if (i === 1) {\r\n if (!isWidthBound) {\r\n nextWidthOffset = 0;\r\n }\r\n if (!isHeightBound) {\r\n nextHeightOffset = 0;\r\n }\r\n }\r\n if (i === 0 && isRequest && !isWidthBound && !isHeightBound) {\r\n return [0, 0];\r\n }\r\n if (keepRatio) {\r\n var widthDist = abs(nextWidthOffset) * (width ? 1 / width : 1);\r\n var heightDist = abs(nextHeightOffset) * (height ? 1 / height : 1);\r\n var isGetWidthOffset = isWidthBound && isHeightBound\r\n ? widthDist < heightDist\r\n : isHeightBound ||\r\n (!isWidthBound && widthDist < heightDist);\r\n if (isGetWidthOffset) {\r\n // width : height = ? : heightOffset\r\n nextWidthOffset = (width * nextHeightOffset) / height;\r\n }\r\n else {\r\n // width : height = widthOffset : ?\r\n nextHeightOffset = (height * nextWidthOffset) / width;\r\n }\r\n }\r\n widthOffset += nextWidthOffset;\r\n heightOffset += nextHeightOffset;\r\n }\r\n if (!keepRatio && direction[0] && direction[1]) {\r\n var _b = checkMaxBounds(moveable, poses, direction, fixedPosition, datas), maxWidth = _b.maxWidth, maxHeight = _b.maxHeight;\r\n var _c = __read(recheckSizeByTwoDirection(moveable, getNextPoses(widthOffset, heightOffset).map(function (pos) { return pos.map(function (p) { return throttle(p, FLOAT_POINT_NUM); }); }), width + widthOffset, height + heightOffset, maxWidth, maxHeight, direction, isRequest, datas), 2), nextWidthOffset = _c[0], nextHeightOffset = _c[1];\r\n widthOffset += nextWidthOffset;\r\n heightOffset += nextHeightOffset;\r\n }\r\n return [widthOffset, heightOffset];\r\n}\r\nfunction absDegree(deg) {\r\n if (deg < 0) {\r\n deg = deg % 360 + 360;\r\n }\r\n deg %= 360;\r\n return deg;\r\n}\r\nfunction bumpDegree(baseDeg, snapDeg) {\r\n // baseDeg -80\r\n // snapDeg 270\r\n // return -90\r\n snapDeg = absDegree(snapDeg);\r\n var count = Math.floor(baseDeg / 360);\r\n var deg1 = count * 360 + 360 - snapDeg;\r\n var deg2 = count * 360 + snapDeg;\r\n return abs(baseDeg - deg1) < abs(baseDeg - deg2) ? deg1 : deg2;\r\n}\r\nfunction getMinDegreeDistance(deg1, deg2) {\r\n deg1 = absDegree(deg1);\r\n deg2 = absDegree(deg2);\r\n var deg3 = absDegree(deg1 - deg2);\r\n return Math.min(deg3, 360 - deg3);\r\n}\r\nfunction checkSnapRotate(moveable, rect, dist, rotation) {\r\n var _a;\r\n var props = moveable.props;\r\n var snapRotationThreshold = (_a = props[NAME_snapRotationThreshold]) !== null && _a !== void 0 ? _a : 5;\r\n var snapRotationDegrees = props[NAME_snapRotationDegrees];\r\n if (hasGuidelines(moveable, \"rotatable\")) {\r\n var pos1 = rect.pos1, pos2 = rect.pos2, pos3 = rect.pos3, pos4 = rect.pos4, origin2_1 = rect.origin;\r\n var rad_1 = (dist * Math.PI) / 180;\r\n var prevPoses = [pos1, pos2, pos3, pos4].map(function (pos) { return minus(pos, origin2_1); });\r\n var nextPoses = prevPoses.map(function (pos) { return rotate(pos, rad_1); });\r\n // console.log(moveable.state.left, moveable.state.top, moveable.state.origin);\r\n // console.log(pos1, pos2, pos3, pos4, origin, rad, prevPoses, nextPoses);\r\n var result = __spreadArray(__spreadArray([], __read(checkRotateBounds(moveable, prevPoses, nextPoses, origin2_1, dist)), false), __read(checkRotateInnerBounds(moveable, prevPoses, nextPoses, origin2_1, dist)), false);\r\n result.sort(function (a, b) { return abs(a - dist) - abs(b - dist); });\r\n var isSnap = result.length > 0;\r\n if (isSnap) {\r\n return {\r\n isSnap: isSnap,\r\n dist: isSnap ? result[0] : dist,\r\n };\r\n }\r\n }\r\n if ((snapRotationDegrees === null || snapRotationDegrees === void 0 ? void 0 : snapRotationDegrees.length) && snapRotationThreshold) {\r\n var sorted = snapRotationDegrees.slice().sort(function (a, b) {\r\n return getMinDegreeDistance(a, rotation) - getMinDegreeDistance(b, rotation);\r\n });\r\n var firstDegree = sorted[0];\r\n if (getMinDegreeDistance(firstDegree, rotation) <= snapRotationThreshold) {\r\n return {\r\n isSnap: true,\r\n dist: dist + bumpDegree(rotation, firstDegree) - rotation,\r\n };\r\n }\r\n }\r\n return {\r\n isSnap: false,\r\n dist: dist,\r\n };\r\n}\r\nfunction checkSnapResize(moveable, width, height, direction, fixedPosition, isRequest, datas) {\r\n if (!hasGuidelines(moveable, \"resizable\")) {\r\n return [0, 0];\r\n }\r\n var fixedDirection = datas.fixedDirection, nextAllMatrix = datas.nextAllMatrix;\r\n var _a = moveable.state, allMatrix = _a.allMatrix, is3d = _a.is3d;\r\n return checkSizeDist(moveable, function (widthOffset, heightOffset) {\r\n return getNextFixedPoses(nextAllMatrix || allMatrix, width + widthOffset, height + heightOffset, fixedDirection, fixedPosition, is3d);\r\n }, width, height, direction, fixedPosition, isRequest, datas);\r\n}\r\nfunction checkSnapScale(moveable, scale, direction, isRequest, datas) {\r\n if (!hasGuidelines(moveable, \"scalable\")) {\r\n return [0, 0];\r\n }\r\n var startOffsetWidth = datas.startOffsetWidth, startOffsetHeight = datas.startOffsetHeight, fixedPosition = datas.fixedPosition, fixedDirection = datas.fixedDirection, is3d = datas.is3d;\r\n var sizeDist = checkSizeDist(moveable, function (widthOffset, heightOffset) {\r\n return getNextFixedPoses(scaleMatrix(datas, plus(scale, [widthOffset / startOffsetWidth, heightOffset / startOffsetHeight])), startOffsetWidth, startOffsetHeight, fixedDirection, fixedPosition, is3d);\r\n }, startOffsetWidth, startOffsetHeight, direction, fixedPosition, isRequest, datas);\r\n return [sizeDist[0] / startOffsetWidth, sizeDist[1] / startOffsetHeight];\r\n}\r\nfunction startCheckSnapDrag(moveable, datas) {\r\n datas.absolutePoses = getAbsolutePosesByState(moveable.state);\r\n}\r\nfunction getSnapGuidelines(posInfos) {\r\n var guidelines = [];\r\n posInfos.forEach(function (posInfo) {\r\n posInfo.guidelineInfos.forEach(function (_a) {\r\n var guideline = _a.guideline;\r\n if (find(guidelines, function (info) { return info.guideline === guideline; })) {\r\n return;\r\n }\r\n guideline.direction = \"\";\r\n guidelines.push({ guideline: guideline, posInfo: posInfo });\r\n });\r\n });\r\n return guidelines.map(function (_a) {\r\n var guideline = _a.guideline, posInfo = _a.posInfo;\r\n return __assign(__assign({}, guideline), { direction: posInfo.direction });\r\n });\r\n}\r\nfunction addBoundGuidelines(moveable, verticalPoses, horizontalPoses, verticalSnapPoses, horizontalSnapPoses, externalBounds) {\r\n var _a = checkBoundPoses(getBounds(moveable, externalBounds), verticalPoses, horizontalPoses), verticalBoundInfos = _a.vertical, horizontalBoundInfos = _a.horizontal;\r\n var boundMap = getInitialBounds();\r\n verticalBoundInfos.forEach(function (info) {\r\n if (info.isBound) {\r\n if (info.direction === \"start\") {\r\n boundMap.left = true;\r\n }\r\n if (info.direction === \"end\") {\r\n boundMap.right = true;\r\n }\r\n verticalSnapPoses.push({\r\n type: \"bounds\",\r\n pos: info.pos,\r\n });\r\n }\r\n });\r\n horizontalBoundInfos.forEach(function (info) {\r\n if (info.isBound) {\r\n if (info.direction === \"start\") {\r\n boundMap.top = true;\r\n }\r\n if (info.direction === \"end\") {\r\n boundMap.bottom = true;\r\n }\r\n horizontalSnapPoses.push({\r\n type: \"bounds\",\r\n pos: info.pos,\r\n });\r\n }\r\n });\r\n var _b = checkInnerBoundPoses(moveable), innerBoundMap = _b.boundMap, verticalInnerBoundPoses = _b.vertical, horizontalInnerBoundPoses = _b.horizontal;\r\n verticalInnerBoundPoses.forEach(function (innerPos) {\r\n if (findIndex(verticalSnapPoses, function (_a) {\r\n var type = _a.type, pos = _a.pos;\r\n return type === \"bounds\" && pos === innerPos;\r\n }) >= 0) {\r\n return;\r\n }\r\n verticalSnapPoses.push({\r\n type: \"bounds\",\r\n pos: innerPos,\r\n });\r\n });\r\n horizontalInnerBoundPoses.forEach(function (innerPos) {\r\n if (findIndex(horizontalSnapPoses, function (_a) {\r\n var type = _a.type, pos = _a.pos;\r\n return type === \"bounds\" && pos === innerPos;\r\n }) >= 0) {\r\n return;\r\n }\r\n horizontalSnapPoses.push({\r\n type: \"bounds\",\r\n pos: innerPos,\r\n });\r\n });\r\n return {\r\n boundMap: boundMap,\r\n innerBoundMap: innerBoundMap,\r\n };\r\n}\r\nvar directionCondition$1 = getDirectionCondition(\"\", [\"resizable\", \"scalable\"]);\r\nvar NAME_snapRotationThreshold = \"snapRotationThreshold\";\r\nvar NAME_snapRotationDegrees = \"snapRotationDegrees\";\r\n/**\r\n * @namespace Moveable.Snappable\r\n * @description Whether or not target can be snapped to the guideline. (default: false)\r\n * @sort 2\r\n */\r\nvar Snappable = {\r\n name: \"snappable\",\r\n dragRelation: \"strong\",\r\n props: [\r\n \"snappable\",\r\n \"snapContainer\",\r\n \"snapDirections\",\r\n \"elementSnapDirections\",\r\n \"snapGap\",\r\n \"snapGridWidth\",\r\n \"snapGridHeight\",\r\n \"isDisplaySnapDigit\",\r\n \"isDisplayInnerSnapDigit\",\r\n \"isDisplayGridGuidelines\",\r\n \"snapDigit\",\r\n \"snapThreshold\",\r\n \"snapRenderThreshold\",\r\n \"snapGridAll\",\r\n NAME_snapRotationThreshold,\r\n NAME_snapRotationDegrees,\r\n \"horizontalGuidelines\",\r\n \"verticalGuidelines\",\r\n \"elementGuidelines\",\r\n \"bounds\",\r\n \"innerBounds\",\r\n \"snapDistFormat\",\r\n \"maxSnapElementGuidelineDistance\",\r\n \"maxSnapElementGapDistance\",\r\n ],\r\n events: [\"snap\", \"bound\"],\r\n css: [\r\n \":host {\\n--bounds-color: #d66;\\n}\\n.guideline {\\npointer-events: none;\\nz-index: 2;\\n}\\n.guideline.bounds {\\nbackground: #d66;\\nbackground: var(--bounds-color);\\n}\\n.guideline-group {\\nposition: absolute;\\ntop: 0;\\nleft: 0;\\n}\\n.guideline-group .size-value {\\nposition: absolute;\\ncolor: #f55;\\nfont-size: 12px;\\nfont-size: calc(12px * var(--zoom));\\nfont-weight: bold;\\n}\\n.guideline-group.horizontal .size-value {\\ntransform-origin: 50% 100%;\\ntransform: translateX(-50%);\\nleft: 50%;\\nbottom: 5px;\\nbottom: calc(2px + 3px * var(--zoom));\\n}\\n.guideline-group.vertical .size-value {\\ntransform-origin: 0% 50%;\\ntop: 50%;\\ntransform: translateY(-50%);\\nleft: 5px;\\nleft: calc(2px + 3px * var(--zoom));\\n}\\n.guideline.gap {\\nbackground: #f55;\\n}\\n.size-value.gap {\\ncolor: #f55;\\n}\\n\",\r\n ],\r\n render: function (moveable, React) {\r\n var state = moveable.state;\r\n var targetTop = state.top, targetLeft = state.left, pos1 = state.pos1, pos2 = state.pos2, pos3 = state.pos3, pos4 = state.pos4, snapRenderInfo = state.snapRenderInfo;\r\n var _a = moveable.props.snapRenderThreshold, snapRenderThreshold = _a === void 0 ? 1 : _a;\r\n if (!snapRenderInfo || !snapRenderInfo.render || !hasGuidelines(moveable, \"\")) {\r\n // reset store\r\n watchValue(moveable, \"boundMap\", getInitialBounds(), function (v) { return JSON.stringify(v); });\r\n watchValue(moveable, \"innerBoundMap\", getInitialBounds(), function (v) { return JSON.stringify(v); });\r\n return [];\r\n }\r\n state.guidelines = getTotalGuidelines(moveable);\r\n var minLeft = Math.min(pos1[0], pos2[0], pos3[0], pos4[0]);\r\n var minTop = Math.min(pos1[1], pos2[1], pos3[1], pos4[1]);\r\n var externalPoses = snapRenderInfo.externalPoses || [];\r\n var poses = getAbsolutePosesByState(moveable.state);\r\n var verticalSnapPoses = [];\r\n var horizontalSnapPoses = [];\r\n var verticalGuidelines = [];\r\n var horizontalGuidelines = [];\r\n var snapInfos = [];\r\n var _b = getRect(poses), width = _b.width, height = _b.height, top = _b.top, left = _b.left, bottom = _b.bottom, right = _b.right;\r\n var targetRect = { left: left, right: right, top: top, bottom: bottom, center: (left + right) / 2, middle: (top + bottom) / 2 };\r\n var hasExternalPoses = externalPoses.length > 0;\r\n var externalRect = hasExternalPoses\r\n ? getRect(externalPoses)\r\n : {};\r\n if (!snapRenderInfo.request) {\r\n if (snapRenderInfo.direction) {\r\n snapInfos.push(getSnapInfosByDirection(moveable, poses, snapRenderInfo.direction, snapRenderThreshold));\r\n }\r\n if (snapRenderInfo.snap) {\r\n var rect = getRect(poses);\r\n if (snapRenderInfo.center) {\r\n rect.middle = (rect.top + rect.bottom) / 2;\r\n rect.center = (rect.left + rect.right) / 2;\r\n }\r\n snapInfos.push(checkSnaps(moveable, rect, snapRenderThreshold));\r\n }\r\n if (hasExternalPoses) {\r\n if (snapRenderInfo.center) {\r\n externalRect.middle =\r\n (externalRect.top + externalRect.bottom) / 2;\r\n externalRect.center =\r\n (externalRect.left + externalRect.right) / 2;\r\n }\r\n snapInfos.push(checkSnaps(moveable, externalRect, snapRenderThreshold));\r\n }\r\n snapInfos.forEach(function (snapInfo) {\r\n var verticalPosInfos = snapInfo.vertical.posInfos, horizontalPosInfos = snapInfo.horizontal.posInfos;\r\n verticalSnapPoses.push.apply(verticalSnapPoses, __spreadArray([], __read(verticalPosInfos.filter(function (_a) {\r\n var guidelineInfos = _a.guidelineInfos;\r\n return guidelineInfos.some(function (_a) {\r\n var guideline = _a.guideline;\r\n return !guideline.hide;\r\n });\r\n }).map(function (posInfo) { return ({\r\n type: \"snap\",\r\n pos: posInfo.pos,\r\n }); })), false));\r\n horizontalSnapPoses.push.apply(horizontalSnapPoses, __spreadArray([], __read(horizontalPosInfos.filter(function (_a) {\r\n var guidelineInfos = _a.guidelineInfos;\r\n return guidelineInfos.some(function (_a) {\r\n var guideline = _a.guideline;\r\n return !guideline.hide;\r\n });\r\n }).map(function (posInfo) { return ({\r\n type: \"snap\",\r\n pos: posInfo.pos,\r\n }); })), false));\r\n verticalGuidelines.push.apply(verticalGuidelines, __spreadArray([], __read(getSnapGuidelines(verticalPosInfos)), false));\r\n horizontalGuidelines.push.apply(horizontalGuidelines, __spreadArray([], __read(getSnapGuidelines(horizontalPosInfos)), false));\r\n });\r\n }\r\n var _c = addBoundGuidelines(moveable, [left, right], [top, bottom], verticalSnapPoses, horizontalSnapPoses), boundMap = _c.boundMap, innerBoundMap = _c.innerBoundMap;\r\n if (hasExternalPoses) {\r\n addBoundGuidelines(moveable, [externalRect.left, externalRect.right], [externalRect.top, externalRect.bottom], verticalSnapPoses, horizontalSnapPoses, snapRenderInfo.externalBounds);\r\n }\r\n var allGuidelines = __spreadArray(__spreadArray([], __read(verticalGuidelines), false), __read(horizontalGuidelines), false);\r\n var elementGuidelines = allGuidelines.filter(function (guideline) { return guideline.element && !guideline.gapRects; });\r\n var gapGuidelines = allGuidelines.filter(function (guideline) { return guideline.gapRects; }).sort(function (a, b) {\r\n return a.gap - b.gap;\r\n });\r\n triggerEvent(moveable, \"onSnap\", {\r\n guidelines: allGuidelines.filter(function (_a) {\r\n var element = _a.element;\r\n return !element;\r\n }),\r\n elements: elementGuidelines,\r\n gaps: gapGuidelines,\r\n }, true);\r\n var nextBoundMap = watchValue(moveable, \"boundMap\", boundMap, function (v) { return JSON.stringify(v); }, getInitialBounds());\r\n var nextInnerBoundMap = watchValue(moveable, \"innerBoundMap\", innerBoundMap, function (v) { return JSON.stringify(v); }, getInitialBounds());\r\n if (boundMap === nextBoundMap || innerBoundMap === nextInnerBoundMap) {\r\n triggerEvent(moveable, \"onBound\", {\r\n bounds: boundMap,\r\n innerBounds: innerBoundMap,\r\n }, true);\r\n }\r\n // verticalSnapPoses.\r\n return __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(renderDashedGuidelines(moveable, elementGuidelines, [minLeft, minTop], targetRect, React)), false), __read(renderGapGuidelines(moveable, gapGuidelines, [minLeft, minTop], targetRect, React)), false), __read(renderGuidelines(moveable, \"horizontal\", horizontalGuidelines, [targetLeft, targetTop], targetRect, React)), false), __read(renderGuidelines(moveable, \"vertical\", verticalGuidelines, [targetLeft, targetTop], targetRect, React)), false), __read(renderSnapPoses(moveable, \"horizontal\", horizontalSnapPoses, minLeft, targetTop, width, 0, React)), false), __read(renderSnapPoses(moveable, \"vertical\", verticalSnapPoses, minTop, targetLeft, height, 1, React)), false);\r\n },\r\n dragStart: function (moveable, e) {\r\n moveable.state.snapRenderInfo = {\r\n request: e.isRequest,\r\n snap: true,\r\n center: true,\r\n };\r\n checkSnapInfo(moveable);\r\n },\r\n drag: function (moveable) {\r\n var state = moveable.state;\r\n if (!checkSnapInfo(moveable)) {\r\n state.guidelines = getTotalGuidelines(moveable);\r\n }\r\n if (state.snapRenderInfo) {\r\n state.snapRenderInfo.render = true;\r\n }\r\n },\r\n pinchStart: function (moveable) {\r\n this.unset(moveable);\r\n },\r\n dragEnd: function (moveable) {\r\n this.unset(moveable);\r\n },\r\n dragControlCondition: function (moveable, e) {\r\n if (directionCondition$1(moveable, e) || dragControlCondition(moveable, e)) {\r\n return true;\r\n }\r\n if (!e.isRequest && e.inputEvent) {\r\n return hasClass(e.inputEvent.target, prefix(\"snap-control\"));\r\n }\r\n },\r\n dragControlStart: function (moveable) {\r\n moveable.state.snapRenderInfo = null;\r\n checkSnapInfo(moveable);\r\n },\r\n dragControl: function (moveable) {\r\n this.drag(moveable);\r\n },\r\n dragControlEnd: function (moveable) {\r\n this.unset(moveable);\r\n },\r\n dragGroupStart: function (moveable, e) {\r\n this.dragStart(moveable, e);\r\n },\r\n dragGroup: function (moveable) {\r\n this.drag(moveable);\r\n },\r\n dragGroupEnd: function (moveable) {\r\n this.unset(moveable);\r\n },\r\n dragGroupControlStart: function (moveable) {\r\n moveable.state.snapRenderInfo = null;\r\n checkSnapInfo(moveable);\r\n },\r\n dragGroupControl: function (moveable) {\r\n this.drag(moveable);\r\n },\r\n dragGroupControlEnd: function (moveable) {\r\n this.unset(moveable);\r\n },\r\n unset: function (moveable) {\r\n var state = moveable.state;\r\n state.enableSnap = false;\r\n state.guidelines = [];\r\n state.snapRenderInfo = null;\r\n state.elementRects = [];\r\n },\r\n};\r\n/**\r\n * Whether or not target can be snapped to the guideline. (default: false)\r\n * @name Moveable.Snappable#snappable\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.snappable = true;\r\n */\r\n/**\r\n * A snap container that is the basis for snap, bounds, and innerBounds. (default: null = container)\r\n * @name Moveable.Snappable#snapContainer\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.querySelector(\".container\"));\r\n *\r\n * moveable.snapContainer = document.body;\r\n */\r\n/**\r\n * You can specify the directions to snap to the target. (default: { left: true, top: true, right: true, bottom: true })\r\n * @name Moveable.Snappable#snapDirections\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * snappable: true,\r\n * snapDirections: true,\r\n * });\r\n * // snap center\r\n * moveable.snapDirections = { left: true, top: true, right: true, bottom: true, center: true, middle: true };\r\n */\r\n/**\r\n * You can specify the snap directions of elements. (default: { left: true, ftrue, right: true, bottom: true })\r\n * @name Moveable.Snappable#elementSnapDirections\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * snappable: true,\r\n * elementSnapDirections: true,\r\n * });\r\n * // snap center\r\n * moveable.elementSnapDirections = { left: true, top: true, right: true, bottom: true, center: true, middle: true };\r\n */\r\n/**\r\n * When you drag, make the gap snap in the element guidelines. (default: true)\r\n * @name Moveable.Snappable#snapGap\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * snappable: true,\r\n * snapElement: true,\r\n * snapGap: true,\r\n * });\r\n *\r\n * moveable.snapGap = false;\r\n */\r\n/**\r\n * Distance value that can snap to guidelines. (default: 5)\r\n * @name Moveable.Snappable#snapThreshold\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.snapThreshold = 5;\r\n */\r\n/**\r\n * Add guidelines in the horizontal direction. (default: [])\r\n * @name Moveable.Snappable#horizontalGuidelines\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.horizontalGuidelines = [100, 200, 500];\r\n */\r\n/**\r\n * Add guidelines in the vertical direction. (default: [])\r\n * @name Moveable.Snappable#verticalGuidelines\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.verticalGuidelines = [100, 200, 500];\r\n */\r\n/**\r\n * Add guidelines for the element. (default: [])\r\n * @name Moveable.Snappable#elementGuidelines\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.elementGuidelines = [\r\n * document.querySelector(\".element\"),\r\n * ];\r\n */\r\n/**\r\n * You can set up boundaries.\r\n * @name Moveable.Snappable#bounds\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @default null\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.bounds = { left: 0, right: 1000, top: 0, bottom: 1000};\r\n */\r\n/**\r\n * You can set up inner boundaries.\r\n * @name Moveable.Snappable#innerBounds\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @default null\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.innerBounds = { left: 500, top: 500, width: 100, height: 100};\r\n */\r\n/**\r\n * snap distance digits (default: 0)\r\n * @name Moveable.Snappable#snapDigit\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.snapDigit = 0\r\n */\r\n/**\r\n * If width size is greater than 0, you can vertical snap to the grid. (default: 0)\r\n * @name Moveable.Snappable#snapGridWidth\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.snapGridWidth = 5;\r\n */\r\n/**\r\n * If height size is greater than 0, you can horizontal snap to the grid. (default: 0)\r\n * @name Moveable.Snappable#snapGridHeight\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.snapGridHeight = 5;\r\n */\r\n/**\r\n * Whether to show snap distance (default: true)\r\n * @name Moveable.Snappable#isDisplaySnapDigit\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.isDisplaySnapDigit = true;\r\n */\r\n/**\r\n * Whether to show element inner snap distance (default: false)\r\n * @name Moveable.Snappable#isDisplayInnerSnapDigit\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.isDisplayInnerSnapDigit = true;\r\n */\r\n/**\r\n * You can set the text format of the distance shown in the guidelines. (default: self)\r\n * @name Moveable.Snappable#snapDistFormat\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions}\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * snappable: true,\r\n * snapDistFormat: (v, type) => v,\r\n * });\r\n * moveable.snapDistFormat = (v, type) => `${v}px`;\r\n */\r\n/**\r\n * When you drag or dragControl, the `snap` event is called.\r\n * @memberof Moveable.Snappable\r\n * @event snap\r\n * @param {Moveable.Snappable.OnSnap} - Parameters for the `snap` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * snappable: true\r\n * });\r\n * moveable.on(\"snap\", e => {\r\n * console.log(\"onSnap\", e);\r\n * });\r\n */\n\nfunction multiply2(pos1, pos2) {\r\n return [\r\n pos1[0] * pos2[0],\r\n pos1[1] * pos2[1],\r\n ];\r\n}\r\nfunction prefix() {\r\n var classNames = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n classNames[_i] = arguments[_i];\r\n }\r\n return prefixNames.apply(void 0, __spreadArray([PREFIX], __read(classNames), false));\r\n}\r\nfunction defaultSync(fn) {\r\n fn();\r\n}\r\nfunction getTransformMatrix(transform) {\r\n if (!transform || transform === \"none\") {\r\n return [1, 0, 0, 1, 0, 0];\r\n }\r\n if (isObject(transform)) {\r\n return transform;\r\n }\r\n return parseMat(transform);\r\n}\r\nfunction getAbsoluteMatrix(matrix, n, origin) {\r\n return multiplies(n, createOriginMatrix(origin, n), matrix, createOriginMatrix(origin.map(function (a) { return -a; }), n));\r\n}\r\nfunction measureSVGSize(el, unit, isHorizontal) {\r\n if (unit === \"%\") {\r\n var viewBox = getSVGViewBox(el.ownerSVGElement);\r\n return viewBox[isHorizontal ? \"width\" : \"height\"] / 100;\r\n }\r\n return 1;\r\n}\r\nfunction getBeforeTransformOrigin(el) {\r\n var relativeOrigin = getTransformOrigin(getComputedStyle(el, \":before\"));\r\n return relativeOrigin.map(function (o, i) {\r\n var _a = splitUnit(o), value = _a.value, unit = _a.unit;\r\n return value * measureSVGSize(el, unit, i === 0);\r\n });\r\n}\r\nfunction getTransformOriginArray(transformOrigin) {\r\n return transformOrigin ? transformOrigin.split(\" \") : [\"0\", \"0\"];\r\n}\r\nfunction getTransformOrigin(style) {\r\n return getTransformOriginArray(style.transformOrigin);\r\n}\r\nfunction getElementTransform(target) {\r\n var getStyle = getCachedStyle(target);\r\n var computedTransform = getStyle(\"transform\");\r\n if (computedTransform && computedTransform !== \"none\") {\r\n return computedTransform;\r\n }\r\n if (\"transform\" in target) {\r\n var list = target.transform;\r\n var baseVal = list.baseVal;\r\n if (!baseVal) {\r\n return \"\";\r\n }\r\n var length_1 = baseVal.length;\r\n if (!length_1) {\r\n return \"\";\r\n }\r\n var matrixes = [];\r\n var _loop_1 = function (i) {\r\n var matrix = baseVal[i].matrix;\r\n matrixes.push(\"matrix(\".concat([\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"].map(function (chr) { return matrix[chr]; }).join(\", \"), \")\"));\r\n };\r\n for (var i = 0; i < length_1; ++i) {\r\n _loop_1(i);\r\n }\r\n return matrixes.join(\" \");\r\n }\r\n return \"\";\r\n}\r\nfunction getOffsetInfo(el, lastParent, isParent, checkZoom, getTargetStyle) {\r\n var _a, _b;\r\n var documentElement = getDocumentElement(el) || getDocumentBody(el);\r\n var hasSlot = false;\r\n var target;\r\n var parentSlotElement;\r\n if (!el || isParent) {\r\n target = el;\r\n }\r\n else {\r\n var assignedSlotParentElement = (_a = el === null || el === void 0 ? void 0 : el.assignedSlot) === null || _a === void 0 ? void 0 : _a.parentElement;\r\n var parentElement = el.parentElement;\r\n if (assignedSlotParentElement) {\r\n hasSlot = true;\r\n parentSlotElement = parentElement;\r\n target = assignedSlotParentElement;\r\n }\r\n else {\r\n target = parentElement;\r\n }\r\n }\r\n var isCustomElement = false;\r\n var isEnd = el === lastParent || target === lastParent;\r\n var position = \"relative\";\r\n var offsetZoom = 1;\r\n var targetZoom = parseFloat(getTargetStyle === null || getTargetStyle === void 0 ? void 0 : getTargetStyle(\"zoom\")) || 1;\r\n var targetPosition = getTargetStyle === null || getTargetStyle === void 0 ? void 0 : getTargetStyle(\"position\");\r\n while (target && target !== documentElement) {\r\n if (lastParent === target) {\r\n isEnd = true;\r\n }\r\n var getStyle = getCachedStyle(target);\r\n var tagName = target.tagName.toLowerCase();\r\n var transform = getElementTransform(target);\r\n var willChange = getStyle(\"willChange\");\r\n var zoom = parseFloat(getStyle(\"zoom\")) || 1;\r\n position = getStyle(\"position\");\r\n if (checkZoom && zoom !== 1) {\r\n offsetZoom = zoom;\r\n break;\r\n }\r\n if (\r\n // offsetParent is the parentElement if the target's zoom is not 1 and not absolute.\r\n !isParent && checkZoom && targetZoom !== 1 && targetPosition && targetPosition !== \"absolute\"\r\n || tagName === \"svg\"\r\n || position !== \"static\"\r\n || (transform && transform !== \"none\")\r\n || willChange === \"transform\") {\r\n break;\r\n }\r\n var slotParentNode = (_b = el === null || el === void 0 ? void 0 : el.assignedSlot) === null || _b === void 0 ? void 0 : _b.parentNode;\r\n var targetParentNode = target.parentNode;\r\n if (slotParentNode) {\r\n hasSlot = true;\r\n parentSlotElement = targetParentNode;\r\n }\r\n var parentNode = targetParentNode;\r\n if (parentNode && parentNode.nodeType === 11) {\r\n // Shadow Root\r\n target = parentNode.host;\r\n isCustomElement = true;\r\n position = getCachedStyle(target)(\"position\");\r\n break;\r\n }\r\n target = parentNode;\r\n position = \"relative\";\r\n }\r\n return {\r\n offsetZoom: offsetZoom,\r\n hasSlot: hasSlot,\r\n parentSlotElement: parentSlotElement,\r\n isCustomElement: isCustomElement,\r\n isStatic: position === \"static\",\r\n isEnd: isEnd || !target || target === documentElement,\r\n offsetParent: target || documentElement,\r\n };\r\n}\r\nfunction getOffsetPosInfo(el, target) {\r\n var _a;\r\n var tagName = el.tagName.toLowerCase();\r\n var offsetLeft = el.offsetLeft;\r\n var offsetTop = el.offsetTop;\r\n var getStyle = getCachedStyle(el);\r\n // svg\r\n var isSVG = isUndefined(offsetLeft);\r\n var hasOffset = !isSVG;\r\n var origin;\r\n var targetOrigin;\r\n // inner svg element\r\n if (!hasOffset && (tagName !== \"svg\" || target.ownerSVGElement)) {\r\n origin = IS_WEBKIT605\r\n ? getBeforeTransformOrigin(el)\r\n : getTransformOriginArray(getStyle(\"transformOrigin\")).map(function (pos) { return parseFloat(pos); });\r\n targetOrigin = origin.slice();\r\n hasOffset = true;\r\n if (tagName === \"svg\") {\r\n offsetLeft = 0;\r\n offsetTop = 0;\r\n }\r\n else {\r\n _a = __read(getSVGGraphicsOffset(el, origin, el === target && target.tagName.toLowerCase() === \"g\"), 4), offsetLeft = _a[0], offsetTop = _a[1], origin[0] = _a[2], origin[1] = _a[3];\r\n }\r\n }\r\n else {\r\n origin = getTransformOriginArray(getStyle(\"transformOrigin\")).map(function (pos) { return parseFloat(pos); });\r\n targetOrigin = origin.slice();\r\n }\r\n return {\r\n tagName: tagName,\r\n isSVG: isSVG,\r\n hasOffset: hasOffset,\r\n offset: [offsetLeft || 0, offsetTop || 0],\r\n origin: origin,\r\n targetOrigin: targetOrigin,\r\n };\r\n}\r\nfunction getBodyOffset(el, isSVG) {\r\n var getStyle = getCachedStyle(el);\r\n var getBodyStyle = getCachedStyle(getDocumentBody(el));\r\n var bodyPosition = getBodyStyle(\"position\");\r\n if (!isSVG && (!bodyPosition || bodyPosition === \"static\")) {\r\n return [0, 0];\r\n }\r\n var marginLeft = parseInt(getBodyStyle(\"marginLeft\"), 10);\r\n var marginTop = parseInt(getBodyStyle(\"marginTop\"), 10);\r\n if (getStyle(\"position\") === \"absolute\") {\r\n if (getStyle(\"top\") !== \"auto\" || getStyle(\"bottom\") !== \"auto\") {\r\n marginTop = 0;\r\n }\r\n if (getStyle(\"left\") !== \"auto\" || getStyle(\"right\") !== \"auto\") {\r\n marginLeft = 0;\r\n }\r\n }\r\n return [marginLeft, marginTop];\r\n}\r\nfunction convert3DMatrixes(matrixes) {\r\n matrixes.forEach(function (info) {\r\n var matrix = info.matrix;\r\n if (matrix) {\r\n info.matrix = convertDimension(matrix, 3, 4);\r\n }\r\n });\r\n}\r\nfunction getPositionFixedInfo(el) {\r\n var fixedContainer = el.parentElement;\r\n var hasTransform = false;\r\n var body = getDocumentBody(el);\r\n while (fixedContainer) {\r\n var transform = getComputedStyle(fixedContainer).transform;\r\n if (transform && transform !== \"none\") {\r\n hasTransform = true;\r\n break;\r\n }\r\n if (fixedContainer === body) {\r\n break;\r\n }\r\n fixedContainer = fixedContainer.parentElement;\r\n }\r\n return {\r\n fixedContainer: fixedContainer || body,\r\n hasTransform: hasTransform,\r\n };\r\n}\r\nfunction makeMatrixCSS(matrix, is3d) {\r\n if (is3d === void 0) { is3d = matrix.length > 9; }\r\n return \"\".concat(is3d ? \"matrix3d\" : \"matrix\", \"(\").concat(convertMatrixtoCSS(matrix, !is3d).join(\",\"), \")\");\r\n}\r\nfunction getSVGViewBox(el) {\r\n var clientWidth = el.clientWidth;\r\n var clientHeight = el.clientHeight;\r\n if (!el) {\r\n return { x: 0, y: 0, width: 0, height: 0, clientWidth: clientWidth, clientHeight: clientHeight };\r\n }\r\n var viewBox = el.viewBox;\r\n var baseVal = (viewBox && viewBox.baseVal) || { x: 0, y: 0, width: 0, height: 0 };\r\n return {\r\n x: baseVal.x,\r\n y: baseVal.y,\r\n width: baseVal.width || clientWidth,\r\n height: baseVal.height || clientHeight,\r\n clientWidth: clientWidth,\r\n clientHeight: clientHeight,\r\n };\r\n}\r\nfunction getSVGMatrix(el, n) {\r\n var _a;\r\n var _b = getSVGViewBox(el), viewBoxWidth = _b.width, viewBoxHeight = _b.height, clientWidth = _b.clientWidth, clientHeight = _b.clientHeight;\r\n var scaleX = clientWidth / viewBoxWidth;\r\n var scaleY = clientHeight / viewBoxHeight;\r\n var preserveAspectRatio = el.preserveAspectRatio.baseVal;\r\n // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/preserveAspectRatio\r\n var align = preserveAspectRatio.align;\r\n // 1 : meet 2: slice\r\n var meetOrSlice = preserveAspectRatio.meetOrSlice;\r\n var svgOrigin = [0, 0];\r\n var scale = [scaleX, scaleY];\r\n var translate = [0, 0];\r\n if (align !== 1) {\r\n var xAlign = (align - 2) % 3;\r\n var yAlign = Math.floor((align - 2) / 3);\r\n svgOrigin[0] = viewBoxWidth * xAlign / 2;\r\n svgOrigin[1] = viewBoxHeight * yAlign / 2;\r\n var scaleDimension = meetOrSlice === 2 ? Math.max(scaleY, scaleX) : Math.min(scaleX, scaleY);\r\n scale[0] = scaleDimension;\r\n scale[1] = scaleDimension;\r\n translate[0] = (clientWidth - viewBoxWidth) / 2 * xAlign;\r\n translate[1] = (clientHeight - viewBoxHeight) / 2 * yAlign;\r\n }\r\n var scaleMatrix = createScaleMatrix(scale, n);\r\n _a = __read(translate, 2), scaleMatrix[n * (n - 1)] = _a[0], scaleMatrix[n * (n - 1) + 1] = _a[1];\r\n return getAbsoluteMatrix(scaleMatrix, n, svgOrigin);\r\n}\r\nfunction getSVGGraphicsOffset(el, origin, isGTarget) {\r\n if (!el.getBBox || !isGTarget && el.tagName.toLowerCase() === \"g\") {\r\n return [0, 0, 0, 0];\r\n }\r\n var getStyle = getCachedStyle(el);\r\n var isFillBox = getStyle(\"transform-box\") === \"fill-box\";\r\n var bbox = el.getBBox();\r\n var viewBox = getSVGViewBox(el.ownerSVGElement);\r\n var left = bbox.x - viewBox.x;\r\n var top = bbox.y - viewBox.y;\r\n var originX = isFillBox ? origin[0] : origin[0] - left;\r\n var originY = isFillBox ? origin[1] : origin[1] - top;\r\n return [left, top, originX, originY];\r\n}\r\nfunction calculatePosition(matrix, pos, n) {\r\n return calculate(matrix, convertPositionMatrix(pos, n), n);\r\n}\r\nfunction calculatePoses(matrix, width, height, n) {\r\n return [[0, 0], [width, 0], [0, height], [width, height]].map(function (pos) { return calculatePosition(matrix, pos, n); });\r\n}\r\nfunction getRect(poses) {\r\n var posesX = poses.map(function (pos) { return pos[0]; });\r\n var posesY = poses.map(function (pos) { return pos[1]; });\r\n var left = Math.min.apply(Math, __spreadArray([], __read(posesX), false));\r\n var top = Math.min.apply(Math, __spreadArray([], __read(posesY), false));\r\n var right = Math.max.apply(Math, __spreadArray([], __read(posesX), false));\r\n var bottom = Math.max.apply(Math, __spreadArray([], __read(posesY), false));\r\n var rectWidth = right - left;\r\n var rectHeight = bottom - top;\r\n return {\r\n left: left,\r\n top: top,\r\n right: right,\r\n bottom: bottom,\r\n width: rectWidth,\r\n height: rectHeight,\r\n };\r\n}\r\nfunction calculateRect(matrix, width, height, n) {\r\n var poses = calculatePoses(matrix, width, height, n);\r\n return getRect(poses);\r\n}\r\nfunction getSVGOffset(offsetInfo, targetInfo, container, n, beforeMatrix) {\r\n var _a;\r\n var target = offsetInfo.target;\r\n var origin = offsetInfo.origin;\r\n var targetMatrix = targetInfo.matrix;\r\n var _b = getSize(target), width = _b.offsetWidth, height = _b.offsetHeight;\r\n var containerClientRect = container.getBoundingClientRect();\r\n var margin = [0, 0];\r\n if (container === getDocumentBody(container)) {\r\n margin = getBodyOffset(target, true);\r\n }\r\n var rect = target.getBoundingClientRect();\r\n var rectLeft = rect.left - containerClientRect.left + container.scrollLeft\r\n - (container.clientLeft || 0) + margin[0];\r\n var rectTop = rect.top - containerClientRect.top + container.scrollTop\r\n - (container.clientTop || 0) + margin[1];\r\n var rectWidth = rect.width;\r\n var rectHeight = rect.height;\r\n var mat = multiplies(n, beforeMatrix, targetMatrix);\r\n var _c = calculateRect(mat, width, height, n), prevLeft = _c.left, prevTop = _c.top, prevWidth = _c.width, prevHeight = _c.height;\r\n var posOrigin = calculatePosition(mat, origin, n);\r\n var prevOrigin = minus(posOrigin, [prevLeft, prevTop]);\r\n var rectOrigin = [\r\n rectLeft + prevOrigin[0] * rectWidth / prevWidth,\r\n rectTop + prevOrigin[1] * rectHeight / prevHeight,\r\n ];\r\n var offset = [0, 0];\r\n var count = 0;\r\n while (++count < 10) {\r\n var inverseBeforeMatrix = invert(beforeMatrix, n);\r\n _a = __read(minus(calculatePosition(inverseBeforeMatrix, rectOrigin, n), calculatePosition(inverseBeforeMatrix, posOrigin, n)), 2), offset[0] = _a[0], offset[1] = _a[1];\r\n var mat2 = multiplies(n, beforeMatrix, createOriginMatrix(offset, n), targetMatrix);\r\n var _d = calculateRect(mat2, width, height, n), nextLeft = _d.left, nextTop = _d.top;\r\n var distLeft = nextLeft - rectLeft;\r\n var distTop = nextTop - rectTop;\r\n if (abs(distLeft) < 2 && abs(distTop) < 2) {\r\n break;\r\n }\r\n rectOrigin[0] -= distLeft;\r\n rectOrigin[1] -= distTop;\r\n }\r\n return offset.map(function (p) { return Math.round(p); });\r\n}\r\nfunction calculateMoveableClientPositions(rootMatrix, poses, rootClientRect) {\r\n var is3d = rootMatrix.length === 16;\r\n var n = is3d ? 4 : 3;\r\n var rootPoses = poses.map(function (pos) { return calculatePosition(rootMatrix, pos, n); });\r\n var left = rootClientRect.left, top = rootClientRect.top;\r\n return rootPoses.map(function (pos) {\r\n return [pos[0] + left, pos[1] + top];\r\n });\r\n}\r\nfunction getDistSize(vec) {\r\n return Math.sqrt(vec[0] * vec[0] + vec[1] * vec[1]);\r\n}\r\nfunction getDiagonalSize(pos1, pos2) {\r\n return getDistSize([\r\n pos2[0] - pos1[0],\r\n pos2[1] - pos1[1],\r\n ]);\r\n}\r\nfunction getLineStyle(pos1, pos2, zoom, rad) {\r\n if (zoom === void 0) { zoom = 1; }\r\n if (rad === void 0) { rad = getRad(pos1, pos2); }\r\n var width = getDiagonalSize(pos1, pos2);\r\n return {\r\n transform: \"translateY(-50%) translate(\".concat(pos1[0], \"px, \").concat(pos1[1], \"px) rotate(\").concat(rad, \"rad) scaleY(\").concat(zoom, \")\"),\r\n width: \"\".concat(width, \"px\"),\r\n };\r\n}\r\nfunction getControlTransform(rotation, zoom) {\r\n var poses = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n poses[_i - 2] = arguments[_i];\r\n }\r\n var length = poses.length;\r\n var x = poses.reduce(function (prev, pos) { return prev + pos[0]; }, 0) / length;\r\n var y = poses.reduce(function (prev, pos) { return prev + pos[1]; }, 0) / length;\r\n return {\r\n transform: \"translateZ(0px) translate(\".concat(x, \"px, \").concat(y, \"px) rotate(\").concat(rotation, \"rad) scale(\").concat(zoom, \")\"),\r\n };\r\n}\r\nfunction getProps(props, ableName) {\r\n var self = props[ableName];\r\n if (isObject(self)) {\r\n return __assign(__assign({}, props), self);\r\n }\r\n return props;\r\n}\r\nfunction getSize(target) {\r\n var hasOffset = target && !isUndefined(target.offsetWidth);\r\n var offsetWidth = 0;\r\n var offsetHeight = 0;\r\n var clientWidth = 0;\r\n var clientHeight = 0;\r\n var cssWidth = 0;\r\n var cssHeight = 0;\r\n var contentWidth = 0;\r\n var contentHeight = 0;\r\n var minWidth = 0;\r\n var minHeight = 0;\r\n var minOffsetWidth = 0;\r\n var minOffsetHeight = 0;\r\n var maxWidth = Infinity;\r\n var maxHeight = Infinity;\r\n var maxOffsetWidth = Infinity;\r\n var maxOffsetHeight = Infinity;\r\n var inlineCSSWidth = 0;\r\n var inlineCSSHeight = 0;\r\n var svg = false;\r\n if (target) {\r\n if (!hasOffset && target.ownerSVGElement) {\r\n // check svg elements\r\n var bbox = target.getBBox();\r\n svg = true;\r\n offsetWidth = bbox.width;\r\n offsetHeight = bbox.height;\r\n cssWidth = offsetWidth;\r\n cssHeight = offsetHeight;\r\n contentWidth = offsetWidth;\r\n contentHeight = offsetHeight;\r\n clientWidth = offsetWidth;\r\n clientHeight = offsetHeight;\r\n }\r\n else {\r\n // check html elements\r\n var getStyle = getCachedStyle(target);\r\n var targetStyle = target.style;\r\n var boxSizing = getStyle(\"boxSizing\") === \"border-box\";\r\n var borderLeft = parseFloat(getStyle(\"borderLeftWidth\")) || 0;\r\n var borderRight = parseFloat(getStyle(\"borderRightWidth\")) || 0;\r\n var borderTop = parseFloat(getStyle(\"borderTopWidth\")) || 0;\r\n var borderBottom = parseFloat(getStyle(\"borderBottomWidth\")) || 0;\r\n var paddingLeft = parseFloat(getStyle(\"paddingLeft\")) || 0;\r\n var paddingRight = parseFloat(getStyle(\"paddingRight\")) || 0;\r\n var paddingTop = parseFloat(getStyle(\"paddingTop\")) || 0;\r\n var paddingBottom = parseFloat(getStyle(\"paddingBottom\")) || 0;\r\n var horizontalPadding = paddingLeft + paddingRight;\r\n var verticalPadding = paddingTop + paddingBottom;\r\n var horizontalBorder = borderLeft + borderRight;\r\n var verticalBorder = borderTop + borderBottom;\r\n var horizontalOffset = horizontalPadding + horizontalBorder;\r\n var verticalOffset = verticalPadding + verticalBorder;\r\n var position = getStyle(\"position\");\r\n var containerWidth = 0;\r\n var containerHeight = 0;\r\n // SVGSVGElement, HTMLElement\r\n if (\"clientLeft\" in target) {\r\n var parentElement = null;\r\n if (position === \"absolute\") {\r\n var offsetInfo = getOffsetInfo(target, getDocumentBody(target));\r\n parentElement = offsetInfo.offsetParent;\r\n }\r\n else {\r\n parentElement = target.parentElement;\r\n }\r\n if (parentElement) {\r\n var getParentStyle = getCachedStyle(parentElement);\r\n containerWidth = parseFloat(getParentStyle(\"width\"));\r\n containerHeight = parseFloat(getParentStyle(\"height\"));\r\n }\r\n }\r\n minWidth = Math.max(horizontalPadding, convertUnitSize(getStyle(\"minWidth\"), containerWidth) || 0);\r\n minHeight = Math.max(verticalPadding, convertUnitSize(getStyle(\"minHeight\"), containerHeight) || 0);\r\n maxWidth = convertUnitSize(getStyle(\"maxWidth\"), containerWidth);\r\n maxHeight = convertUnitSize(getStyle(\"maxHeight\"), containerHeight);\r\n if (isNaN(maxWidth)) {\r\n maxWidth = Infinity;\r\n }\r\n if (isNaN(maxHeight)) {\r\n maxHeight = Infinity;\r\n }\r\n inlineCSSWidth = convertUnitSize(targetStyle.width, 0) || 0;\r\n inlineCSSHeight = convertUnitSize(targetStyle.height, 0) || 0;\r\n cssWidth = parseFloat(getStyle(\"width\")) || 0;\r\n cssHeight = parseFloat(getStyle(\"height\")) || 0;\r\n contentWidth = abs(cssWidth - inlineCSSWidth) < 1\r\n ? between(minWidth, inlineCSSWidth || cssWidth, maxWidth)\r\n : cssWidth;\r\n contentHeight = abs(cssHeight - inlineCSSHeight) < 1\r\n ? between(minHeight, inlineCSSHeight || cssHeight, maxHeight)\r\n : cssHeight;\r\n offsetWidth = contentWidth;\r\n offsetHeight = contentHeight;\r\n clientWidth = contentWidth;\r\n clientHeight = contentHeight;\r\n if (boxSizing) {\r\n maxOffsetWidth = maxWidth;\r\n maxOffsetHeight = maxHeight;\r\n minOffsetWidth = minWidth;\r\n minOffsetHeight = minHeight;\r\n contentWidth = offsetWidth - horizontalOffset;\r\n contentHeight = offsetHeight - verticalOffset;\r\n }\r\n else {\r\n maxOffsetWidth = maxWidth + horizontalOffset;\r\n maxOffsetHeight = maxHeight + verticalOffset;\r\n minOffsetWidth = minWidth + horizontalOffset;\r\n minOffsetHeight = minHeight + verticalOffset;\r\n offsetWidth = contentWidth + horizontalOffset;\r\n offsetHeight = contentHeight + verticalOffset;\r\n }\r\n clientWidth = contentWidth + horizontalPadding;\r\n clientHeight = contentHeight + verticalPadding;\r\n }\r\n }\r\n return {\r\n svg: svg,\r\n offsetWidth: offsetWidth,\r\n offsetHeight: offsetHeight,\r\n clientWidth: clientWidth,\r\n clientHeight: clientHeight,\r\n contentWidth: contentWidth,\r\n contentHeight: contentHeight,\r\n inlineCSSWidth: inlineCSSWidth,\r\n inlineCSSHeight: inlineCSSHeight,\r\n cssWidth: cssWidth,\r\n cssHeight: cssHeight,\r\n minWidth: minWidth,\r\n minHeight: minHeight,\r\n maxWidth: maxWidth,\r\n maxHeight: maxHeight,\r\n minOffsetWidth: minOffsetWidth,\r\n minOffsetHeight: minOffsetHeight,\r\n maxOffsetWidth: maxOffsetWidth,\r\n maxOffsetHeight: maxOffsetHeight,\r\n };\r\n}\r\nfunction getRotationRad(poses, direction) {\r\n return getRad(direction > 0 ? poses[0] : poses[1], direction > 0 ? poses[1] : poses[0]);\r\n}\r\nfunction resetClientRect() {\r\n return {\r\n left: 0, top: 0,\r\n width: 0, height: 0,\r\n right: 0,\r\n bottom: 0,\r\n clientLeft: 0, clientTop: 0,\r\n clientWidth: 0, clientHeight: 0,\r\n scrollWidth: 0, scrollHeight: 0,\r\n };\r\n}\r\nfunction getExtendsRect(el, rect) {\r\n var isRoot = el === getDocumentBody(el) || el === getDocumentElement(el);\r\n var extendsRect = {\r\n clientLeft: el.clientLeft,\r\n clientTop: el.clientTop,\r\n clientWidth: el.clientWidth,\r\n clientHeight: el.clientHeight,\r\n scrollWidth: el.scrollWidth,\r\n scrollHeight: el.scrollHeight,\r\n overflow: false,\r\n };\r\n if (isRoot) {\r\n extendsRect.clientHeight = Math.max(rect.height, extendsRect.clientHeight);\r\n extendsRect.scrollHeight = Math.max(rect.height, extendsRect.scrollHeight);\r\n }\r\n extendsRect.overflow = getCachedStyle(el)(\"overflow\") !== \"visible\";\r\n return __assign(__assign({}, rect), extendsRect);\r\n}\r\nfunction getClientRectByPosition(position, base, el, isExtends) {\r\n var left = position.left, right = position.right, top = position.top, bottom = position.bottom;\r\n var baseTop = base.top;\r\n var baseLeft = base.left;\r\n var rect = {\r\n left: baseLeft + left,\r\n top: baseTop + top,\r\n right: baseLeft + right,\r\n bottom: baseTop + bottom,\r\n width: right - left,\r\n height: bottom - top,\r\n };\r\n if (el && isExtends) {\r\n return getExtendsRect(el, rect);\r\n }\r\n return rect;\r\n}\r\nfunction getClientRect(el, isExtends) {\r\n var left = 0;\r\n var top = 0;\r\n var width = 0;\r\n var height = 0;\r\n // let isRoot = false;\r\n if (el) {\r\n var clientRect = el.getBoundingClientRect();\r\n left = clientRect.left;\r\n top = clientRect.top;\r\n width = clientRect.width;\r\n height = clientRect.height;\r\n }\r\n var rect = {\r\n left: left,\r\n top: top,\r\n width: width,\r\n height: height,\r\n right: left + width,\r\n bottom: top + height,\r\n };\r\n if (el && isExtends) {\r\n return getExtendsRect(el, rect);\r\n }\r\n return rect;\r\n}\r\nfunction getTotalOrigin(moveable) {\r\n var _a = moveable.props, groupable = _a.groupable, svgOrigin = _a.svgOrigin;\r\n var _b = moveable.getState(), offsetWidth = _b.offsetWidth, offsetHeight = _b.offsetHeight, svg = _b.svg, transformOrigin = _b.transformOrigin;\r\n if (!groupable && svg && svgOrigin) {\r\n return convertTransformOriginArray(svgOrigin, offsetWidth, offsetHeight);\r\n }\r\n return transformOrigin;\r\n}\r\nfunction getTotalDirection(parentDirection, isPinch, inputEvent, datas) {\r\n var direction;\r\n if (parentDirection) {\r\n direction = parentDirection;\r\n }\r\n else if (isPinch) {\r\n direction = [0, 0];\r\n }\r\n else {\r\n var target = inputEvent.target;\r\n direction = getDirection(target, datas);\r\n }\r\n return direction;\r\n}\r\nfunction getDirection(target, datas) {\r\n if (!target) {\r\n return;\r\n }\r\n var deg = target.getAttribute(\"data-rotation\") || \"\";\r\n var direciton = target.getAttribute(\"data-direction\");\r\n datas.deg = deg;\r\n if (!direciton) {\r\n return;\r\n }\r\n var dir = [0, 0];\r\n (direciton.indexOf(\"w\") > -1) && (dir[0] = -1);\r\n (direciton.indexOf(\"e\") > -1) && (dir[0] = 1);\r\n (direciton.indexOf(\"n\") > -1) && (dir[1] = -1);\r\n (direciton.indexOf(\"s\") > -1) && (dir[1] = 1);\r\n return dir;\r\n}\r\nfunction getAbsolutePoses(poses, dist) {\r\n return [\r\n plus(dist, poses[0]),\r\n plus(dist, poses[1]),\r\n plus(dist, poses[2]),\r\n plus(dist, poses[3]),\r\n ];\r\n}\r\nfunction getAbsolutePosesByState(_a) {\r\n var left = _a.left, top = _a.top, pos1 = _a.pos1, pos2 = _a.pos2, pos3 = _a.pos3, pos4 = _a.pos4;\r\n return getAbsolutePoses([pos1, pos2, pos3, pos4], [left, top]);\r\n}\r\nfunction unsetAbles(self, isControl) {\r\n self[isControl ? \"controlAbles\" : \"targetAbles\"].forEach(function (able) {\r\n able.unset && able.unset(self);\r\n });\r\n}\r\nfunction unsetGesto(self, isControl) {\r\n var gestoName = isControl ? \"controlGesto\" : \"targetGesto\";\r\n var gesto = self[gestoName];\r\n if ((gesto === null || gesto === void 0 ? void 0 : gesto.isIdle()) === false) {\r\n unsetAbles(self, isControl);\r\n }\r\n gesto === null || gesto === void 0 ? void 0 : gesto.unset();\r\n self[gestoName] = null;\r\n}\r\nfunction fillCSSObject(style, resolvedEvent) {\r\n if (resolvedEvent) {\r\n var originalDatas = getBeforeRenderableDatas(resolvedEvent);\r\n originalDatas.nextStyle = __assign(__assign({}, originalDatas.nextStyle), style);\r\n }\r\n return {\r\n style: style,\r\n cssText: getKeys(style).map(function (name) { return \"\".concat(decamelize(name, \"-\"), \": \").concat(style[name], \";\"); }).join(\"\"),\r\n };\r\n}\r\nfunction fillAfterTransform(prevEvent, nextEvent, resolvedEvent) {\r\n var afterTransform = nextEvent.afterTransform || nextEvent.transform;\r\n return __assign(__assign({}, fillCSSObject(__assign(__assign(__assign({}, prevEvent.style), nextEvent.style), { transform: afterTransform }), resolvedEvent)), { afterTransform: afterTransform, transform: prevEvent.transform });\r\n}\r\nfunction fillParams(moveable, e, params, isBeforeEvent) {\r\n var datas = e.datas;\r\n if (!datas.datas) {\r\n datas.datas = {};\r\n }\r\n var nextParams = __assign(__assign({}, params), { target: moveable.state.target, clientX: e.clientX, clientY: e.clientY, inputEvent: e.inputEvent, currentTarget: moveable, moveable: moveable, datas: datas.datas, isRequest: e.isRequest, isRequestChild: e.isRequestChild, isFirstDrag: !!e.isFirstDrag, isTrusted: e.isTrusted !== false, stopAble: function () {\r\n datas.isEventStart = false;\r\n }, stopDrag: function () {\r\n var _a;\r\n (_a = e.stop) === null || _a === void 0 ? void 0 : _a.call(e);\r\n } });\r\n if (!datas.isStartEvent) {\r\n datas.isStartEvent = true;\r\n }\r\n else if (!isBeforeEvent) {\r\n datas.lastEvent = nextParams;\r\n }\r\n return nextParams;\r\n}\r\nfunction fillEndParams(moveable, e, params) {\r\n var datas = e.datas;\r\n var isDrag = \"isDrag\" in params ? params.isDrag : e.isDrag;\r\n if (!datas.datas) {\r\n datas.datas = {};\r\n }\r\n return __assign(__assign({ isDrag: isDrag }, params), { moveable: moveable, target: moveable.state.target, clientX: e.clientX, clientY: e.clientY, inputEvent: e.inputEvent, currentTarget: moveable, lastEvent: datas.lastEvent, isDouble: e.isDouble, datas: datas.datas, isFirstDrag: !!e.isFirstDrag });\r\n}\r\nfunction catchEvent(moveable, name, callback) {\r\n moveable._emitter.on(name, callback);\r\n}\r\nfunction triggerEvent(moveable, name, params, isManager, isRequest) {\r\n return moveable.triggerEvent(name, params, isManager, isRequest);\r\n}\r\nfunction getComputedStyle(el, pseudoElt) {\r\n return getWindow(el).getComputedStyle(el, pseudoElt);\r\n}\r\nfunction filterAbles(ables, methods, triggerAblesSimultaneously) {\r\n var enabledAbles = {};\r\n var ableGroups = {};\r\n return ables.filter(function (able) {\r\n var name = able.name;\r\n if (enabledAbles[name] || !methods.some(function (method) { return able[method]; })) {\r\n return false;\r\n }\r\n if (!triggerAblesSimultaneously && able.ableGroup) {\r\n if (ableGroups[able.ableGroup]) {\r\n return false;\r\n }\r\n ableGroups[able.ableGroup] = true;\r\n }\r\n enabledAbles[name] = true;\r\n return true;\r\n });\r\n}\r\nfunction equals(a1, a2) {\r\n return a1 === a2 || (a1 == null && a2 == null);\r\n}\r\nfunction selectValue() {\r\n var values = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n values[_i] = arguments[_i];\r\n }\r\n var length = values.length - 1;\r\n for (var i = 0; i < length; ++i) {\r\n var value = values[i];\r\n if (!isUndefined(value)) {\r\n return value;\r\n }\r\n }\r\n return values[length];\r\n}\r\nfunction groupBy(arr, func) {\r\n var groups = [];\r\n var groupKeys = [];\r\n arr.forEach(function (el, index) {\r\n var groupKey = func(el, index, arr);\r\n var keyIndex = groupKeys.indexOf(groupKey);\r\n var group = groups[keyIndex] || [];\r\n if (keyIndex === -1) {\r\n groupKeys.push(groupKey);\r\n groups.push(group);\r\n }\r\n group.push(el);\r\n });\r\n return groups;\r\n}\r\nfunction groupByMap(arr, func) {\r\n var groups = [];\r\n var groupKeys = {};\r\n arr.forEach(function (el, index) {\r\n var groupKey = func(el, index, arr);\r\n var group = groupKeys[groupKey];\r\n if (!group) {\r\n group = [];\r\n groupKeys[groupKey] = group;\r\n groups.push(group);\r\n }\r\n group.push(el);\r\n });\r\n return groups;\r\n}\r\nfunction flat(arr) {\r\n return arr.reduce(function (prev, cur) {\r\n return prev.concat(cur);\r\n }, []);\r\n}\r\nfunction maxOffset() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n args.sort(function (a, b) { return abs(b) - abs(a); });\r\n return args[0];\r\n}\r\nfunction calculateInversePosition(matrix, pos, n) {\r\n return calculate(invert(matrix, n), convertPositionMatrix(pos, n), n);\r\n}\r\nfunction convertDragDist(state, e) {\r\n var _a;\r\n var is3d = state.is3d, rootMatrix = state.rootMatrix;\r\n var n = is3d ? 4 : 3;\r\n _a = __read(calculateInversePosition(rootMatrix, [e.distX, e.distY], n), 2), e.distX = _a[0], e.distY = _a[1];\r\n return e;\r\n}\r\nfunction calculatePadding(matrix, pos, added, n) {\r\n if (!added[0] && !added[1]) {\r\n return pos;\r\n }\r\n var xAdded = calculatePosition(matrix, [normalized(added[0] || 1), 0], n);\r\n var yAdded = calculatePosition(matrix, [0, normalized(added[1] || 1)], n);\r\n var nextAdded = calculatePosition(matrix, [\r\n added[0] / getDistSize(xAdded),\r\n added[1] / getDistSize(yAdded),\r\n ], n);\r\n return plus(pos, nextAdded);\r\n}\r\nfunction convertCSSSize(value, size, isRelative) {\r\n return isRelative ? \"\".concat(value / size * 100, \"%\") : \"\".concat(value, \"px\");\r\n}\r\nfunction getTinyDist(v) {\r\n return abs(v) <= TINY_NUM ? 0 : v;\r\n}\r\nfunction getDirectionViewClassName(ableName) {\r\n return function (moveable) {\r\n if (!moveable.isDragging(ableName)) {\r\n return \"\";\r\n }\r\n var data = getGestoData(moveable, ableName);\r\n var deg = data.deg;\r\n if (!deg) {\r\n return \"\";\r\n }\r\n return prefix(\"view-control-rotation\".concat(deg));\r\n };\r\n}\r\nfunction getDirectionCondition(ableName, checkAbles) {\r\n if (checkAbles === void 0) { checkAbles = [ableName]; }\r\n return function (moveable, e) {\r\n if (e.isRequest) {\r\n if (checkAbles.some(function (name) { return e.requestAble === name; })) {\r\n return e.parentDirection;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n var target = e.inputEvent.target;\r\n return hasClass(target, prefix(\"direction\")) && (!ableName || hasClass(target, prefix(ableName)));\r\n };\r\n}\r\nfunction convertTransformInfo(transforms, state, index) {\r\n var _a;\r\n var matrixInfos = parse(transforms, {\r\n \"x%\": function (v) { return v / 100 * state.offsetWidth; },\r\n \"y%\": function (v) { return v / 100 * state.offsetHeight; },\r\n });\r\n var beforeFunctionTexts = transforms.slice(0, index < 0 ? undefined : index);\r\n var beforeFunctionTexts2 = transforms.slice(0, index < 0 ? undefined : index + 1);\r\n var targetFunctionText = transforms[index] || \"\";\r\n var afterFunctionTexts = index < 0 ? [] : transforms.slice(index);\r\n var afterFunctionTexts2 = index < 0 ? [] : transforms.slice(index + 1);\r\n var beforeFunctions = matrixInfos.slice(0, index < 0 ? undefined : index);\r\n var beforeFunctions2 = matrixInfos.slice(0, index < 0 ? undefined : index + 1);\r\n var targetFunction = (_a = matrixInfos[index]) !== null && _a !== void 0 ? _a : parse([\"\"])[0];\r\n var afterFunctions = index < 0 ? [] : matrixInfos.slice(index);\r\n var afterFunctions2 = index < 0 ? [] : matrixInfos.slice(index + 1);\r\n var targetFunctions = targetFunction ? [targetFunction] : [];\r\n var beforeFunctionMatrix = toMat(beforeFunctions);\r\n var beforeFunctionMatrix2 = toMat(beforeFunctions2);\r\n var afterFunctionMatrix = toMat(afterFunctions);\r\n var afterFunctionMatrix2 = toMat(afterFunctions2);\r\n var allFunctionMatrix = multiply(beforeFunctionMatrix, afterFunctionMatrix, 4);\r\n return {\r\n transforms: transforms,\r\n beforeFunctionMatrix: beforeFunctionMatrix,\r\n beforeFunctionMatrix2: beforeFunctionMatrix2,\r\n targetFunctionMatrix: toMat(targetFunctions),\r\n afterFunctionMatrix: afterFunctionMatrix,\r\n afterFunctionMatrix2: afterFunctionMatrix2,\r\n allFunctionMatrix: allFunctionMatrix,\r\n beforeFunctions: beforeFunctions,\r\n beforeFunctions2: beforeFunctions2,\r\n targetFunction: targetFunctions[0],\r\n afterFunctions: afterFunctions,\r\n afterFunctions2: afterFunctions2,\r\n beforeFunctionTexts: beforeFunctionTexts,\r\n beforeFunctionTexts2: beforeFunctionTexts2,\r\n targetFunctionText: targetFunctionText,\r\n afterFunctionTexts: afterFunctionTexts,\r\n afterFunctionTexts2: afterFunctionTexts2,\r\n };\r\n}\r\nfunction isArrayFormat(arr) {\r\n if (!arr || !isObject(arr)) {\r\n return false;\r\n }\r\n if (isNode(arr)) {\r\n return false;\r\n }\r\n return isArray(arr) || \"length\" in arr;\r\n}\r\nfunction getRefTarget(target, isSelector) {\r\n if (!target) {\r\n return null;\r\n }\r\n if (isNode(target)) {\r\n return target;\r\n }\r\n if (isString(target)) {\r\n if (isSelector) {\r\n return document.querySelector(target);\r\n }\r\n return target;\r\n }\r\n if (isFunction(target)) {\r\n return target();\r\n }\r\n if (isWindow(target)) {\r\n return target;\r\n }\r\n if (\"current\" in target) {\r\n return target.current;\r\n }\r\n return target;\r\n}\r\nfunction getRefTargets(targets, isSelector) {\r\n if (!targets) {\r\n return [];\r\n }\r\n var userTargets = isArrayFormat(targets) ? [].slice.call(targets) : [targets];\r\n return userTargets.reduce(function (prev, target) {\r\n if (isString(target) && isSelector) {\r\n return __spreadArray(__spreadArray([], __read(prev), false), __read([].slice.call(document.querySelectorAll(target))), false);\r\n }\r\n if (isArray(target)) {\r\n prev.push(getRefTargets(target, isSelector));\r\n }\r\n else {\r\n prev.push(getRefTarget(target, isSelector));\r\n }\r\n return prev;\r\n }, []);\r\n}\r\nfunction getAbsoluteRotation(pos1, pos2, direction) {\r\n var deg = getRad(pos1, pos2) / Math.PI * 180;\r\n deg = direction >= 0 ? deg : 180 - deg;\r\n deg = deg >= 0 ? deg : 360 + deg;\r\n return deg;\r\n}\r\nfunction getDragDistByState(state, dist) {\r\n var rootMatrix = state.rootMatrix, is3d = state.is3d;\r\n var n = is3d ? 4 : 3;\r\n var inverseMatrix = invert(rootMatrix, n);\r\n if (!is3d) {\r\n inverseMatrix = convertDimension(inverseMatrix, 3, 4);\r\n }\r\n inverseMatrix[12] = 0;\r\n inverseMatrix[13] = 0;\r\n inverseMatrix[14] = 0;\r\n return calculateMatrixDist(inverseMatrix, dist);\r\n}\r\nfunction getSizeDistByDist(startSize, dist, ratio, direction, keepRatio) {\r\n var _a = __read(startSize, 2), startOffsetWidth = _a[0], startOffsetHeight = _a[1];\r\n var distWidth = 0;\r\n var distHeight = 0;\r\n if (keepRatio && startOffsetWidth && startOffsetHeight) {\r\n var rad = getRad([0, 0], dist);\r\n var standardRad = getRad([0, 0], direction);\r\n var size = getDistSize(dist);\r\n var signSize = Math.cos(rad - standardRad) * size;\r\n if (!direction[0]) {\r\n // top, bottom\r\n distHeight = signSize;\r\n distWidth = distHeight * ratio;\r\n }\r\n else if (!direction[1]) {\r\n // left, right\r\n distWidth = signSize;\r\n distHeight = distWidth / ratio;\r\n }\r\n else {\r\n // two-way\r\n var startWidthSize = direction[0] * startOffsetWidth;\r\n var startHeightSize = direction[1] * startOffsetHeight;\r\n var secondRad = Math.atan2(startWidthSize + dist[0], startHeightSize + dist[1]);\r\n var firstRad = Math.atan2(startWidthSize, startHeightSize);\r\n if (secondRad < 0) {\r\n secondRad += Math.PI * 2;\r\n }\r\n if (firstRad < 0) {\r\n firstRad += Math.PI * 2;\r\n }\r\n var rad_1 = 0;\r\n if (abs(secondRad - firstRad) < Math.PI / 2 || abs(secondRad - firstRad) > Math.PI / 2 * 3) {\r\n rad_1 = secondRad - firstRad;\r\n }\r\n else {\r\n firstRad += Math.PI;\r\n rad_1 = secondRad - firstRad;\r\n }\r\n if (rad_1 > Math.PI * 2) {\r\n rad_1 -= Math.PI * 2;\r\n }\r\n else if (rad_1 > Math.PI) {\r\n rad_1 = 2 * Math.PI - rad_1;\r\n }\r\n else if (rad_1 < -Math.PI) {\r\n rad_1 = -2 * Math.PI - rad_1;\r\n }\r\n // 180\r\n // -1, -1, // 1, -1\r\n // 270 90\r\n // -1, 1 // 1, 1\r\n // 0\r\n var distSize = getDistSize([startWidthSize + dist[0], startHeightSize + dist[1]]) * Math.cos(rad_1);\r\n distWidth = distSize * Math.sin(firstRad) - startWidthSize;\r\n distHeight = distSize * Math.cos(firstRad) - startHeightSize;\r\n if (direction[0] < 0) {\r\n distWidth *= -1;\r\n }\r\n if (direction[1] < 0) {\r\n distHeight *= -1;\r\n }\r\n }\r\n }\r\n else {\r\n distWidth = direction[0] * dist[0];\r\n distHeight = direction[1] * dist[1];\r\n }\r\n return [distWidth, distHeight];\r\n}\r\nfunction getOffsetSizeDist(sizeDirection, keepRatio, datas, e) {\r\n var _a;\r\n var ratio = datas.ratio, startOffsetWidth = datas.startOffsetWidth, startOffsetHeight = datas.startOffsetHeight;\r\n var distWidth = 0;\r\n var distHeight = 0;\r\n var distX = e.distX, distY = e.distY, pinchScale = e.pinchScale, parentDistance = e.parentDistance, parentDist = e.parentDist, parentScale = e.parentScale;\r\n var startFixedDirection = datas.fixedDirection;\r\n var directionsDists = [0, 1].map(function (index) {\r\n return abs(sizeDirection[index] - startFixedDirection[index]);\r\n });\r\n var directionRatios = [0, 1].map(function (index) {\r\n var dist = directionsDists[index];\r\n if (dist !== 0) {\r\n dist = 2 / dist;\r\n }\r\n return dist;\r\n });\r\n if (parentDist) {\r\n distWidth = parentDist[0];\r\n distHeight = parentDist[1];\r\n if (keepRatio) {\r\n if (!distWidth) {\r\n distWidth = distHeight * ratio;\r\n }\r\n else if (!distHeight) {\r\n distHeight = distWidth / ratio;\r\n }\r\n }\r\n }\r\n else if (isNumber(pinchScale)) {\r\n distWidth = (pinchScale - 1) * startOffsetWidth;\r\n distHeight = (pinchScale - 1) * startOffsetHeight;\r\n }\r\n else if (parentScale) {\r\n distWidth = (parentScale[0] - 1) * startOffsetWidth;\r\n distHeight = (parentScale[1] - 1) * startOffsetHeight;\r\n }\r\n else if (parentDistance) {\r\n var scaleX = startOffsetWidth * directionsDists[0];\r\n var scaleY = startOffsetHeight * directionsDists[1];\r\n var ratioDistance = getDistSize([scaleX, scaleY]);\r\n distWidth = parentDistance / ratioDistance * scaleX * directionRatios[0];\r\n distHeight = parentDistance / ratioDistance * scaleY * directionRatios[1];\r\n }\r\n else {\r\n var dist_1 = getDragDist({ datas: datas, distX: distX, distY: distY });\r\n dist_1 = directionRatios.map(function (ratio, i) {\r\n return dist_1[i] * ratio;\r\n });\r\n _a = __read(getSizeDistByDist([startOffsetWidth, startOffsetHeight], dist_1, ratio, sizeDirection, keepRatio), 2), distWidth = _a[0], distHeight = _a[1];\r\n }\r\n return {\r\n // direction,\r\n // sizeDirection,\r\n distWidth: distWidth,\r\n distHeight: distHeight,\r\n };\r\n}\r\nfunction convertTransformUnit(origin, xy) {\r\n if (xy) {\r\n if (origin === \"left\") {\r\n return { x: \"0%\", y: \"50%\" };\r\n }\r\n else if (origin === \"top\") {\r\n return { x: \"50%\", y: \"50%\" };\r\n }\r\n else if (origin === \"center\") {\r\n return { x: \"50%\", y: \"50%\" };\r\n }\r\n else if (origin === \"right\") {\r\n return { x: \"100%\", y: \"50%\" };\r\n }\r\n else if (origin === \"bottom\") {\r\n return { x: \"50%\", y: \"100%\" };\r\n }\r\n var _a = __read(origin.split(\" \"), 2), left = _a[0], right = _a[1];\r\n var leftOrigin = convertTransformUnit(left || \"\");\r\n var rightOrigin = convertTransformUnit(right || \"\");\r\n var originObject = __assign(__assign({}, leftOrigin), rightOrigin);\r\n var nextOriginObject = {\r\n x: \"50%\",\r\n y: \"50%\",\r\n };\r\n if (originObject.x) {\r\n nextOriginObject.x = originObject.x;\r\n }\r\n if (originObject.y) {\r\n nextOriginObject.y = originObject.y;\r\n }\r\n if (originObject.value) {\r\n if (originObject.x && !originObject.y) {\r\n nextOriginObject.y = originObject.value;\r\n }\r\n if (!originObject.x && originObject.y) {\r\n nextOriginObject.x = originObject.value;\r\n }\r\n }\r\n return nextOriginObject;\r\n }\r\n if (origin === \"left\") {\r\n return { x: \"0%\" };\r\n }\r\n if (origin === \"right\") {\r\n return { x: \"100%\" };\r\n }\r\n if (origin === \"top\") {\r\n return { y: \"0%\" };\r\n }\r\n if (origin === \"bottom\") {\r\n return { y: \"100%\" };\r\n }\r\n if (!origin) {\r\n return {};\r\n }\r\n if (origin === \"center\") {\r\n return { value: \"50%\" };\r\n }\r\n return { value: origin };\r\n}\r\nfunction convertTransformOriginArray(transformOrigin, width, height) {\r\n var _a = convertTransformUnit(transformOrigin, true), x = _a.x, y = _a.y;\r\n return [\r\n convertUnitSize(x, width) || 0,\r\n convertUnitSize(y, height) || 0,\r\n ];\r\n}\r\nfunction rotatePosesInfo(poses, origin, rad) {\r\n var prevPoses = poses.map(function (pos) { return minus(pos, origin); });\r\n var nextPoses = prevPoses.map(function (pos) { return rotate(pos, rad); });\r\n return {\r\n prev: prevPoses,\r\n next: nextPoses,\r\n result: nextPoses.map(function (pos) { return plus(pos, origin); }),\r\n };\r\n}\r\nfunction isDeepArrayEquals(arr1, arr2) {\r\n return arr1.length === arr2.length && arr1.every(function (value1, i) {\r\n var value2 = arr2[i];\r\n var isArray1 = isArray(value1);\r\n var isArray2 = isArray(value2);\r\n if (isArray1 && isArray2) {\r\n return isDeepArrayEquals(value1, value2);\r\n }\r\n else if (!isArray1 && !isArray2) {\r\n return value1 === value2;\r\n }\r\n return false;\r\n });\r\n}\r\nfunction watchValue(moveable, property, nextValue, valueKey, defaultValue) {\r\n var store = moveable._store;\r\n var prevValue = store[property];\r\n if (!(property in store)) {\r\n if (defaultValue != null) {\r\n store[property] = defaultValue;\r\n prevValue = defaultValue;\r\n }\r\n else {\r\n store[property] = nextValue;\r\n return nextValue;\r\n }\r\n }\r\n if (prevValue === nextValue || valueKey(prevValue) === valueKey(nextValue)) {\r\n return prevValue;\r\n }\r\n store[property] = nextValue;\r\n return nextValue;\r\n}\r\nfunction sign(value) {\r\n return value >= 0 ? 1 : -1;\r\n}\r\nfunction abs(value) {\r\n return Math.abs(value);\r\n}\r\nfunction countEach(count, callback) {\r\n return counter(count).map(function (index) { return callback(index); });\r\n}\r\nfunction getPaddingBox(padding) {\r\n if (isNumber(padding)) {\r\n return {\r\n top: padding,\r\n left: padding,\r\n right: padding,\r\n bottom: padding,\r\n };\r\n }\r\n return {\r\n left: padding.left || 0,\r\n top: padding.top || 0,\r\n right: padding.right || 0,\r\n bottom: padding.bottom || 0,\r\n };\r\n}\n\n/**\r\n * @namespace Moveable.Pinchable\r\n * @description Whether or not target can be pinched with draggable, resizable, scalable, rotatable (default: false)\r\n */\r\nvar Pinchable = makeAble(\"pinchable\", {\r\n props: [\r\n \"pinchable\",\r\n ],\r\n events: [\r\n \"pinchStart\",\r\n \"pinch\",\r\n \"pinchEnd\",\r\n \"pinchGroupStart\",\r\n \"pinchGroup\",\r\n \"pinchGroupEnd\",\r\n ],\r\n dragStart: function () {\r\n return true;\r\n },\r\n pinchStart: function (moveable, e) {\r\n var datas = e.datas, targets = e.targets, angle = e.angle, originalDatas = e.originalDatas;\r\n var _a = moveable.props, pinchable = _a.pinchable, ables = _a.ables;\r\n if (!pinchable) {\r\n return false;\r\n }\r\n var eventName = \"onPinch\".concat(targets ? \"Group\" : \"\", \"Start\");\r\n var controlEventName = \"drag\".concat(targets ? \"Group\" : \"\", \"ControlStart\");\r\n var pinchAbles = (pinchable === true ? moveable.controlAbles : ables.filter(function (able) {\r\n return pinchable.indexOf(able.name) > -1;\r\n })).filter(function (able) { return able.canPinch && able[controlEventName]; });\r\n var params = fillParams(moveable, e, {});\r\n if (targets) {\r\n params.targets = targets;\r\n }\r\n var result = triggerEvent(moveable, eventName, params);\r\n datas.isPinch = result !== false;\r\n datas.ables = pinchAbles;\r\n var isPinch = datas.isPinch;\r\n if (!isPinch) {\r\n return false;\r\n }\r\n pinchAbles.forEach(function (able) {\r\n originalDatas[able.name] = originalDatas[able.name] || {};\r\n if (!able[controlEventName]) {\r\n return;\r\n }\r\n var ableEvent = __assign(__assign({}, e), { datas: originalDatas[able.name], parentRotate: angle, isPinch: true });\r\n able[controlEventName](moveable, ableEvent);\r\n });\r\n moveable.state.snapRenderInfo = {\r\n request: e.isRequest,\r\n direction: [0, 0],\r\n };\r\n return isPinch;\r\n },\r\n pinch: function (moveable, e) {\r\n var datas = e.datas, pinchScale = e.scale, distance = e.distance, originalDatas = e.originalDatas, inputEvent = e.inputEvent, targets = e.targets, angle = e.angle;\r\n if (!datas.isPinch) {\r\n return;\r\n }\r\n var parentDistance = distance * (1 - 1 / pinchScale);\r\n var params = fillParams(moveable, e, {});\r\n if (targets) {\r\n params.targets = targets;\r\n }\r\n var eventName = \"onPinch\".concat(targets ? \"Group\" : \"\");\r\n triggerEvent(moveable, eventName, params);\r\n var ables = datas.ables;\r\n var controlEventName = \"drag\".concat(targets ? \"Group\" : \"\", \"Control\");\r\n ables.forEach(function (able) {\r\n if (!able[controlEventName]) {\r\n return;\r\n }\r\n able[controlEventName](moveable, __assign(__assign({}, e), { datas: originalDatas[able.name], inputEvent: inputEvent, resolveMatrix: true, pinchScale: pinchScale, parentDistance: parentDistance, parentRotate: angle, isPinch: true }));\r\n });\r\n return params;\r\n },\r\n pinchEnd: function (moveable, e) {\r\n var datas = e.datas, isPinch = e.isPinch, inputEvent = e.inputEvent, targets = e.targets, originalDatas = e.originalDatas;\r\n if (!datas.isPinch) {\r\n return;\r\n }\r\n var eventName = \"onPinch\".concat(targets ? \"Group\" : \"\", \"End\");\r\n var params = fillEndParams(moveable, e, { isDrag: isPinch });\r\n if (targets) {\r\n params.targets = targets;\r\n }\r\n triggerEvent(moveable, eventName, params);\r\n var ables = datas.ables;\r\n var controlEventName = \"drag\".concat(targets ? \"Group\" : \"\", \"ControlEnd\");\r\n ables.forEach(function (able) {\r\n if (!able[controlEventName]) {\r\n return;\r\n }\r\n able[controlEventName](moveable, __assign(__assign({}, e), { isDrag: isPinch, datas: originalDatas[able.name], inputEvent: inputEvent, isPinch: true }));\r\n });\r\n return isPinch;\r\n },\r\n pinchGroupStart: function (moveable, e) {\r\n return this.pinchStart(moveable, __assign(__assign({}, e), { targets: moveable.props.targets }));\r\n },\r\n pinchGroup: function (moveable, e) {\r\n return this.pinch(moveable, __assign(__assign({}, e), { targets: moveable.props.targets }));\r\n },\r\n pinchGroupEnd: function (moveable, e) {\r\n return this.pinchEnd(moveable, __assign(__assign({}, e), { targets: moveable.props.targets }));\r\n },\r\n});\r\n/**\r\n * Whether or not target can be pinched with draggable, resizable, scalable, rotatable (default: false)\r\n * @name Moveable.Pinchable#pinchable\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.pinchable = true;\r\n */\r\n/**\r\n * When the pinch starts, the pinchStart event is called with part of scaleStart, rotateStart, resizeStart\r\n * @memberof Moveable.Pinchable\r\n * @event pinchStart\r\n * @param {Moveable.Pinchable.OnPinchStart} - Parameters for the pinchStart event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * rotatable: true,\r\n * scalable: true,\r\n * pinchable: true, // [\"rotatable\", \"scalable\"]\r\n * });\r\n * moveable.on(\"pinchStart\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n * moveable.on(\"rotateStart\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n * moveable.on(\"scaleStart\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n */\r\n/**\r\n * When pinching, the pinch event is called with part of scale, rotate, resize\r\n * @memberof Moveable.Pinchable\r\n * @event pinch\r\n * @param {Moveable.Pinchable.OnPinch} - Parameters for the pinch event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * rotatable: true,\r\n * scalable: true,\r\n * pinchable: true, // [\"rotatable\", \"scalable\"]\r\n * });\r\n * moveable.on(\"pinch\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n * moveable.on(\"rotate\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n * moveable.on(\"scale\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n */\r\n/**\r\n * When the pinch finishes, the pinchEnd event is called.\r\n * @memberof Moveable.Pinchable\r\n * @event pinchEnd\r\n * @param {Moveable.Pinchable.OnPinchEnd} - Parameters for the pinchEnd event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * rotatable: true,\r\n * scalable: true,\r\n * pinchable: true, // [\"rotatable\", \"scalable\"]\r\n * });\r\n * moveable.on(\"pinchEnd\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n * moveable.on(\"rotateEnd\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n * moveable.on(\"scaleEnd\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n */\r\n/**\r\n * When the group pinch starts, the `pinchGroupStart` event is called.\r\n * @memberof Moveable.Pinchable\r\n * @event pinchGroupStart\r\n * @param {Moveable.Pinchable.OnPinchGroupStart} - Parameters for the `pinchGroupStart` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * pinchable: true\r\n * });\r\n * moveable.on(\"pinchGroupStart\", ({ targets }) => {\r\n * console.log(\"onPinchGroupStart\", targets);\r\n * });\r\n */\r\n/**\r\n * When the group pinch, the `pinchGroup` event is called.\r\n * @memberof Moveable.Pinchable\r\n * @event pinchGroup\r\n * @param {Moveable.Pinchable.OnPinchGroup} - Parameters for the `pinchGroup` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * pinchable: true\r\n * });\r\n * moveable.on(\"pinchGroup\", ({ targets, events }) => {\r\n * console.log(\"onPinchGroup\", targets);\r\n * });\r\n */\r\n/**\r\n * When the group pinch finishes, the `pinchGroupEnd` event is called.\r\n * @memberof Moveable.Pinchable\r\n * @event pinchGroupEnd\r\n * @param {Moveable.Pinchable.OnPinchGroupEnd} - Parameters for the `pinchGroupEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * pinchable: true\r\n * });\r\n * moveable.on(\"pinchGroupEnd\", ({ targets, isDrag }) => {\r\n * console.log(\"onPinchGroupEnd\", targets, isDrag);\r\n * });\r\n */\n\nvar directionCondition = getDirectionCondition(\"scalable\");\r\n/**\r\n * @namespace Scalable\r\n * @memberof Moveable\r\n * @description Scalable indicates whether the target's x and y can be scale of transform.\r\n */\r\nvar Scalable = {\r\n name: \"scalable\",\r\n ableGroup: \"size\",\r\n canPinch: true,\r\n props: [\r\n \"scalable\",\r\n \"throttleScale\",\r\n \"renderDirections\",\r\n \"keepRatio\",\r\n \"edge\",\r\n \"displayAroundControls\",\r\n ],\r\n events: [\r\n \"scaleStart\",\r\n \"beforeScale\",\r\n \"scale\",\r\n \"scaleEnd\",\r\n \"scaleGroupStart\",\r\n \"beforeScaleGroup\",\r\n \"scaleGroup\",\r\n \"scaleGroupEnd\",\r\n ],\r\n render: getRenderDirections(\"scalable\"),\r\n dragControlCondition: directionCondition,\r\n viewClassName: getDirectionViewClassName(\"scalable\"),\r\n dragControlStart: function (moveable, e) {\r\n var datas = e.datas, isPinch = e.isPinch, inputEvent = e.inputEvent, parentDirection = e.parentDirection;\r\n var direction = getTotalDirection(parentDirection, isPinch, inputEvent, datas);\r\n var _a = moveable.state, width = _a.width, height = _a.height, targetTransform = _a.targetTransform, target = _a.target, pos1 = _a.pos1, pos2 = _a.pos2, pos4 = _a.pos4;\r\n if (!direction || !target) {\r\n return false;\r\n }\r\n if (!isPinch) {\r\n setDragStart(moveable, e);\r\n }\r\n datas.datas = {};\r\n datas.transform = targetTransform;\r\n datas.prevDist = [1, 1];\r\n datas.direction = direction;\r\n datas.startOffsetWidth = width;\r\n datas.startOffsetHeight = height;\r\n datas.startValue = [1, 1];\r\n // const scaleWidth = getDist(pos1, pos2);\r\n // const scaleHeight = getDist(pos2, pos4);\r\n var isWidth = (!direction[0] && !direction[1]) || direction[0] || !direction[1];\r\n // datas.scaleWidth = scaleWidth;\r\n // datas.scaleHeight = scaleHeight;\r\n // datas.scaleXRatio = scaleWidth / width;\r\n // datas.scaleYRatio = scaleHeight / height;\r\n setDefaultTransformIndex(moveable, e, \"scale\");\r\n datas.isWidth = isWidth;\r\n function setRatio(ratio) {\r\n datas.ratio = ratio && isFinite(ratio) ? ratio : 0;\r\n }\r\n datas.startPositions = getAbsolutePosesByState(moveable.state);\r\n function setFixedDirection(fixedDirection) {\r\n var result = getFixedDirectionInfo(datas.startPositions, fixedDirection);\r\n datas.fixedDirection = result.fixedDirection;\r\n datas.fixedPosition = result.fixedPosition;\r\n datas.fixedOffset = result.fixedOffset;\r\n }\r\n datas.setFixedDirection = setFixedDirection;\r\n setRatio(getDist$1(pos1, pos2) / getDist$1(pos2, pos4));\r\n setFixedDirection([-direction[0], -direction[1]]);\r\n var setMinScaleSize = function (min) {\r\n datas.minScaleSize = min;\r\n };\r\n var setMaxScaleSize = function (max) {\r\n datas.maxScaleSize = max;\r\n };\r\n // const setMinScale = (min: number[]) => {\r\n // };\r\n // const setMaxScale = (max: number[]) => {\r\n // };\r\n setMinScaleSize([-Infinity, -Infinity]);\r\n setMaxScaleSize([Infinity, Infinity]);\r\n var params = fillParams(moveable, e, __assign(__assign({ direction: direction, set: function (scale) {\r\n datas.startValue = scale;\r\n }, setRatio: setRatio, setFixedDirection: setFixedDirection, setMinScaleSize: setMinScaleSize, setMaxScaleSize: setMaxScaleSize }, fillTransformStartEvent(moveable, e)), { dragStart: Draggable.dragStart(moveable, new CustomGesto().dragStart([0, 0], e)) }));\r\n var result = triggerEvent(moveable, \"onScaleStart\", params);\r\n datas.startFixedDirection = datas.fixedDirection;\r\n if (result !== false) {\r\n datas.isScale = true;\r\n moveable.state.snapRenderInfo = {\r\n request: e.isRequest,\r\n direction: direction,\r\n };\r\n }\r\n return datas.isScale ? params : false;\r\n },\r\n dragControl: function (moveable, e) {\r\n resolveTransformEvent(moveable, e, \"scale\");\r\n var datas = e.datas, parentKeepRatio = e.parentKeepRatio, parentFlag = e.parentFlag, isPinch = e.isPinch, dragClient = e.dragClient, isRequest = e.isRequest, useSnap = e.useSnap, resolveMatrix = e.resolveMatrix;\r\n var prevDist = datas.prevDist, direction = datas.direction, startOffsetWidth = datas.startOffsetWidth, startOffsetHeight = datas.startOffsetHeight, isScale = datas.isScale, startValue = datas.startValue, isWidth = datas.isWidth, ratio = datas.ratio;\r\n if (!isScale) {\r\n return false;\r\n }\r\n var props = moveable.props;\r\n var throttleScale = props.throttleScale, parentMoveable = props.parentMoveable;\r\n var sizeDirection = direction;\r\n if (!direction[0] && !direction[1]) {\r\n sizeDirection = [1, 1];\r\n }\r\n var keepRatio = (ratio && (parentKeepRatio != null ? parentKeepRatio : props.keepRatio)) || false;\r\n var state = moveable.state;\r\n var tempScaleValue = [\r\n startValue[0],\r\n startValue[1],\r\n ];\r\n function getNextScale() {\r\n var _a = getOffsetSizeDist(sizeDirection, keepRatio, datas, e), distWidth = _a.distWidth, distHeight = _a.distHeight;\r\n var distX = startOffsetWidth ? (startOffsetWidth + distWidth) / startOffsetWidth : 1;\r\n var distY = startOffsetHeight ? (startOffsetHeight + distHeight) / startOffsetHeight : 1;\r\n if (!startValue[0]) {\r\n tempScaleValue[0] = distWidth / startOffsetWidth;\r\n }\r\n if (!startValue[1]) {\r\n tempScaleValue[1] = distHeight / startOffsetHeight;\r\n }\r\n var scaleX = (sizeDirection[0] || keepRatio ? distX : 1) * tempScaleValue[0];\r\n var scaleY = (sizeDirection[1] || keepRatio ? distY : 1) * tempScaleValue[1];\r\n if (scaleX === 0) {\r\n scaleX = sign(prevDist[0]) * MIN_SCALE;\r\n }\r\n if (scaleY === 0) {\r\n scaleY = sign(prevDist[1]) * MIN_SCALE;\r\n }\r\n return [scaleX, scaleY];\r\n }\r\n var scale = getNextScale();\r\n if (!isPinch && moveable.props.groupable) {\r\n var snapRenderInfo = state.snapRenderInfo || {};\r\n var stateDirection = snapRenderInfo.direction;\r\n if (isArray(stateDirection) && (stateDirection[0] || stateDirection[1])) {\r\n state.snapRenderInfo = { direction: direction, request: e.isRequest };\r\n }\r\n }\r\n triggerEvent(moveable, \"onBeforeScale\", fillParams(moveable, e, {\r\n scale: scale,\r\n setFixedDirection: function (nextFixedDirection) {\r\n datas.setFixedDirection(nextFixedDirection);\r\n scale = getNextScale();\r\n return scale;\r\n },\r\n startFixedDirection: datas.startFixedDirection,\r\n setScale: function (nextScale) {\r\n scale = nextScale;\r\n },\r\n }, true));\r\n var dist = [\r\n scale[0] / tempScaleValue[0],\r\n scale[1] / tempScaleValue[1],\r\n ];\r\n var fixedPosition = dragClient;\r\n var snapDist = [0, 0];\r\n var distSign = sign(dist[0] * dist[1]);\r\n var isSelfPinch = !dragClient && !parentFlag && isPinch;\r\n if (isSelfPinch || resolveMatrix) {\r\n fixedPosition = getTranslateFixedPosition(moveable, datas.targetAllTransform, [0, 0], [0, 0], datas);\r\n }\r\n else if (!dragClient) {\r\n fixedPosition = datas.fixedPosition;\r\n }\r\n if (!isPinch) {\r\n snapDist = checkSnapScale(moveable, dist, direction, !useSnap && isRequest, datas);\r\n }\r\n if (keepRatio) {\r\n if (sizeDirection[0] && sizeDirection[1] && snapDist[0] && snapDist[1]) {\r\n if (Math.abs(snapDist[0] * startOffsetWidth) > Math.abs(snapDist[1] * startOffsetHeight)) {\r\n snapDist[1] = 0;\r\n }\r\n else {\r\n snapDist[0] = 0;\r\n }\r\n }\r\n var isNoSnap = !snapDist[0] && !snapDist[1];\r\n if (isNoSnap) {\r\n // throttle scale value (not absolute scale size)\r\n if (isWidth) {\r\n dist[0] = throttle(dist[0] * tempScaleValue[0], throttleScale) / tempScaleValue[0];\r\n }\r\n else {\r\n dist[1] = throttle(dist[1] * tempScaleValue[1], throttleScale) / tempScaleValue[1];\r\n }\r\n }\r\n if ((sizeDirection[0] && !sizeDirection[1])\r\n || (snapDist[0] && !snapDist[1])\r\n || (isNoSnap && isWidth)) {\r\n dist[0] += snapDist[0];\r\n var snapHeight = startOffsetWidth * dist[0] * tempScaleValue[0] / ratio;\r\n dist[1] = sign(distSign * dist[0]) * abs(snapHeight / startOffsetHeight / tempScaleValue[1]);\r\n }\r\n else if ((!sizeDirection[0] && sizeDirection[1])\r\n || (!snapDist[0] && snapDist[1])\r\n || (isNoSnap && !isWidth)) {\r\n dist[1] += snapDist[1];\r\n var snapWidth = startOffsetHeight * dist[1] * tempScaleValue[1] * ratio;\r\n dist[0] = sign(distSign * dist[1]) * abs(snapWidth / startOffsetWidth / tempScaleValue[0]);\r\n }\r\n }\r\n else {\r\n dist[0] += snapDist[0];\r\n dist[1] += snapDist[1];\r\n if (!snapDist[0]) {\r\n dist[0] = throttle(dist[0] * tempScaleValue[0], throttleScale) / tempScaleValue[0];\r\n }\r\n if (!snapDist[1]) {\r\n dist[1] = throttle(dist[1] * tempScaleValue[1], throttleScale) / tempScaleValue[1];\r\n }\r\n }\r\n if (dist[0] === 0) {\r\n dist[0] = sign(prevDist[0]) * MIN_SCALE;\r\n }\r\n if (dist[1] === 0) {\r\n dist[1] = sign(prevDist[1]) * MIN_SCALE;\r\n }\r\n scale = multiply2(dist, [tempScaleValue[0], tempScaleValue[1]]);\r\n var startOffsetSize = [\r\n startOffsetWidth,\r\n startOffsetHeight,\r\n ];\r\n var scaleSize = [\r\n startOffsetWidth * scale[0],\r\n startOffsetHeight * scale[1],\r\n ];\r\n scaleSize = calculateBoundSize(scaleSize, datas.minScaleSize, datas.maxScaleSize, keepRatio ? ratio : false);\r\n // if (keepRatio && (isGroup || keepRatioFinally)) {\r\n // if (isWidth) {\r\n // boundingHeight = boundingWidth / ratio;\r\n // } else {\r\n // boundingWidth = boundingHeight * ratio;\r\n // }\r\n // }\r\n scale = countEach(2, function (i) {\r\n return startOffsetSize[i] ? scaleSize[i] / startOffsetSize[i] : scaleSize[i];\r\n });\r\n dist = countEach(2, function (i) {\r\n return scale[i] / tempScaleValue[i];\r\n });\r\n var delta = countEach(2, function (i) { return prevDist[i] ? dist[i] / prevDist[i] : dist[i]; });\r\n var distText = \"scale(\".concat(dist.join(\", \"), \")\");\r\n var scaleText = \"scale(\".concat(scale.join(\", \"), \")\");\r\n var nextTransform = convertTransformFormat(datas, scaleText, distText);\r\n var isZeroScale = !startValue[0] || !startValue[1];\r\n var inverseDist = getScaleDist(moveable, isZeroScale ? scaleText : distText, datas.fixedDirection, fixedPosition, datas.fixedOffset, datas, isZeroScale);\r\n var inverseDelta = isSelfPinch ? inverseDist : minus(inverseDist, datas.prevInverseDist || [0, 0]);\r\n datas.prevDist = dist;\r\n datas.prevInverseDist = inverseDist;\r\n if (scale[0] === prevDist[0] && scale[1] === prevDist[1]\r\n && inverseDelta.every(function (num) { return !num; })\r\n && !parentMoveable\r\n && !isSelfPinch) {\r\n return false;\r\n }\r\n var params = fillParams(moveable, e, __assign({ offsetWidth: startOffsetWidth, offsetHeight: startOffsetHeight, direction: direction, scale: scale, dist: dist, delta: delta, isPinch: !!isPinch }, fillTransformEvent(moveable, nextTransform, inverseDelta, isPinch, e)));\r\n triggerEvent(moveable, \"onScale\", params);\r\n return params;\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n var datas = e.datas;\r\n if (!datas.isScale) {\r\n return false;\r\n }\r\n datas.isScale = false;\r\n var scaleEndParam = fillEndParams(moveable, e, {});\r\n triggerEvent(moveable, \"onScaleEnd\", scaleEndParam);\r\n return scaleEndParam;\r\n },\r\n dragGroupControlCondition: directionCondition,\r\n dragGroupControlStart: function (moveable, e) {\r\n var datas = e.datas;\r\n var params = this.dragControlStart(moveable, e);\r\n if (!params) {\r\n return false;\r\n }\r\n var originalEvents = fillChildEvents(moveable, \"resizable\", e);\r\n datas.moveableScale = moveable.scale;\r\n var events = triggerChildAbles(moveable, this, \"dragControlStart\", e, function (child, ev) {\r\n return startChildDist(moveable, child, datas, ev);\r\n });\r\n var setFixedDirection = function (fixedDirection) {\r\n params.setFixedDirection(fixedDirection);\r\n events.forEach(function (ev, i) {\r\n ev.setFixedDirection(fixedDirection);\r\n startChildDist(moveable, ev.moveable, datas, originalEvents[i]);\r\n });\r\n };\r\n datas.setFixedDirection = setFixedDirection;\r\n var nextParams = __assign(__assign({}, params), { targets: moveable.props.targets, events: events, setFixedDirection: setFixedDirection });\r\n var result = triggerEvent(moveable, \"onScaleGroupStart\", nextParams);\r\n datas.isScale = result !== false;\r\n return datas.isScale ? nextParams : false;\r\n },\r\n dragGroupControl: function (moveable, e) {\r\n var datas = e.datas;\r\n if (!datas.isScale) {\r\n return;\r\n }\r\n catchEvent(moveable, \"onBeforeScale\", function (parentEvent) {\r\n triggerEvent(moveable, \"onBeforeScaleGroup\", fillParams(moveable, e, __assign(__assign({}, parentEvent), { targets: moveable.props.targets }), true));\r\n });\r\n var params = this.dragControl(moveable, e);\r\n if (!params) {\r\n return;\r\n }\r\n var dist = params.dist;\r\n var moveableScale = datas.moveableScale;\r\n moveable.scale = [\r\n dist[0] * moveableScale[0],\r\n dist[1] * moveableScale[1],\r\n ];\r\n var keepRatio = moveable.props.keepRatio;\r\n var fixedPosition = datas.fixedPosition;\r\n var events = triggerChildAbles(moveable, this, \"dragControl\", e, function (_, ev) {\r\n var _a = __read(calculate(createRotateMatrix(moveable.rotation / 180 * Math.PI, 3), [\r\n ev.datas.originalX * dist[0],\r\n ev.datas.originalY * dist[1],\r\n 1,\r\n ], 3), 2), clientX = _a[0], clientY = _a[1];\r\n return __assign(__assign({}, ev), { parentDist: null, parentScale: dist, parentKeepRatio: keepRatio, \r\n // recalculate child fixed position for parent group's dragging.\r\n dragClient: plus(fixedPosition, [clientX, clientY]) });\r\n });\r\n var nextParams = __assign({ targets: moveable.props.targets, events: events }, params);\r\n triggerEvent(moveable, \"onScaleGroup\", nextParams);\r\n return nextParams;\r\n },\r\n dragGroupControlEnd: function (moveable, e) {\r\n var isDrag = e.isDrag, datas = e.datas;\r\n if (!datas.isScale) {\r\n return;\r\n }\r\n this.dragControlEnd(moveable, e);\r\n var events = triggerChildAbles(moveable, this, \"dragControlEnd\", e);\r\n var nextParams = fillEndParams(moveable, e, {\r\n targets: moveable.props.targets,\r\n events: events,\r\n });\r\n triggerEvent(moveable, \"onScaleGroupEnd\", nextParams);\r\n return isDrag;\r\n },\r\n /**\r\n * @method Moveable.Scalable#request\r\n * @param {Moveable.Scalable.ScalableRequestParam} e - the Scalable's request parameter\r\n * @return {Moveable.Requester} Moveable Requester\r\n * @example\r\n\n * // Instantly Request (requestStart - request - requestEnd)\r\n * moveable.request(\"scalable\", { deltaWidth: 10, deltaHeight: 10 }, true);\r\n *\r\n * // requestStart\r\n * const requester = moveable.request(\"scalable\");\r\n *\r\n * // request\r\n * requester.request({ deltaWidth: 10, deltaHeight: 10 });\r\n * requester.request({ deltaWidth: 10, deltaHeight: 10 });\r\n * requester.request({ deltaWidth: 10, deltaHeight: 10 });\r\n *\r\n * // requestEnd\r\n * requester.requestEnd();\r\n */\r\n request: function () {\r\n var datas = {};\r\n var distWidth = 0;\r\n var distHeight = 0;\r\n var useSnap = false;\r\n return {\r\n isControl: true,\r\n requestStart: function (e) {\r\n useSnap = e.useSnap;\r\n return {\r\n datas: datas,\r\n parentDirection: e.direction || [1, 1],\r\n useSnap: useSnap,\r\n };\r\n },\r\n request: function (e) {\r\n distWidth += e.deltaWidth;\r\n distHeight += e.deltaHeight;\r\n return {\r\n datas: datas,\r\n parentDist: [distWidth, distHeight],\r\n parentKeepRatio: e.keepRatio,\r\n useSnap: useSnap,\r\n };\r\n },\r\n requestEnd: function () {\r\n return { datas: datas, isDrag: true, useSnap: useSnap };\r\n },\r\n };\r\n },\r\n};\r\n/**\r\n * Whether or not target can scaled.\r\n *\r\n * @name Moveable.Scalable#scalable\r\n * @default false\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.scalable = true;\r\n */\r\n/**\r\n * throttle of scaleX, scaleY when scale.\r\n * @name Moveable.Scalable#throttleScale\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.throttleScale = 0.1;\r\n */\r\n/**\r\n * Set directions to show the control box. (default: [\"n\", \"nw\", \"ne\", \"s\", \"se\", \"sw\", \"e\", \"w\"])\r\n * @name Moveable.Scalable#renderDirections\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * scalable: true,\r\n * renderDirections: [\"n\", \"nw\", \"ne\", \"s\", \"se\", \"sw\", \"e\", \"w\"],\r\n * });\r\n *\r\n * moveable.renderDirections = [\"nw\", \"ne\", \"sw\", \"se\"];\r\n */\r\n/**\r\n * When resize or scale, keeps a ratio of the width, height. (default: false)\r\n * @name Moveable.Scalable#keepRatio\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * scalable: true,\r\n * });\r\n *\r\n * moveable.keepRatio = true;\r\n */\r\n/**\r\n * When the scale starts, the scaleStart event is called.\r\n * @memberof Moveable.Scalable\r\n * @event scaleStart\r\n * @param {Moveable.Scalable.OnScaleStart} - Parameters for the scaleStart event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { scalable: true });\r\n * moveable.on(\"scaleStart\", ({ target }) => {\r\n * console.log(target);\r\n * });\r\n */\r\n/**\r\n * When scaling, `beforeScale` is called before `scale` occurs. In `beforeScale`, you can get and set the pre-value before scaling.\r\n * @memberof Moveable.Scalable\r\n * @event beforeScale\r\n * @param {Moveable.Scalable.OnBeforeScale} - Parameters for the `beforeScale` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { scalable: true });\r\n * moveable.on(\"beforeScale\", ({ setFixedDirection }) => {\r\n * if (shiftKey) {\r\n * setFixedDirection([0, 0]);\r\n * }\r\n * });\r\n * moveable.on(\"scale\", ({ target, transform, dist }) => {\r\n * target.style.transform = transform;\r\n * });\r\n */\r\n/**\r\n * When scaling, the `scale` event is called.\r\n * @memberof Moveable.Scalable\r\n * @event scale\r\n * @param {Moveable.Scalable.OnScale} - Parameters for the `scale` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { scalable: true });\r\n * moveable.on(\"scale\", ({ target, transform, dist }) => {\r\n * target.style.transform = transform;\r\n * });\r\n */\r\n/**\r\n * When the scale finishes, the `scaleEnd` event is called.\r\n * @memberof Moveable.Scalable\r\n * @event scaleEnd\r\n * @param {Moveable.Scalable.OnScaleEnd} - Parameters for the `scaleEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { scalable: true });\r\n * moveable.on(\"scaleEnd\", ({ target, isDrag }) => {\r\n * console.log(target, isDrag);\r\n * });\r\n */\r\n/**\r\n* When the group scale starts, the `scaleGroupStart` event is called.\r\n* @memberof Moveable.Scalable\r\n* @event scaleGroupStart\r\n* @param {Moveable.Scalable.OnScaleGroupStart} - Parameters for the `scaleGroupStart` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* target: [].slice.call(document.querySelectorAll(\".target\")),\r\n* scalable: true\r\n* });\r\n* moveable.on(\"scaleGroupStart\", ({ targets }) => {\r\n* console.log(\"onScaleGroupStart\", targets);\r\n* });\r\n*/\r\n/**\r\n* When the group scale, the `scaleGroup` event is called.\r\n* @memberof Moveable.Scalable\r\n* @event scaleGroup\r\n* @param {Moveable.Scalable.OnScaleGroup} - Parameters for the `scaleGroup` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* target: [].slice.call(document.querySelectorAll(\".target\")),\r\n* scalable: true\r\n* });\r\n* moveable.on(\"scaleGroup\", ({ targets, events }) => {\r\n* console.log(\"onScaleGroup\", targets);\r\n* events.forEach(ev => {\r\n* const target = ev.target;\r\n* // ev.drag is a drag event that occurs when the group scale.\r\n* const left = ev.drag.beforeDist[0];\r\n* const top = ev.drag.beforeDist[1];\r\n* const scaleX = ev.scale[0];\r\n* const scaleY = ev.scale[1];\r\n* });\r\n* });\r\n*/\r\n/**\r\n * When the group scale finishes, the `scaleGroupEnd` event is called.\r\n * @memberof Moveable.Scalable\r\n * @event scaleGroupEnd\r\n * @param {Moveable.Scalable.OnScaleGroupEnd} - Parameters for the `scaleGroupEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * scalable: true\r\n * });\r\n * moveable.on(\"scaleGroupEnd\", ({ targets, isDrag }) => {\r\n * console.log(\"onScaleGroupEnd\", targets, isDrag);\r\n * });\r\n */\n\nfunction getMiddleLinePos(pos1, pos2) {\r\n return pos1.map(function (pos, i) { return dot(pos, pos2[i], 1, 2); });\r\n}\r\nfunction getTriangleRad(pos1, pos2, pos3) {\r\n // pos1 Rad\r\n var rad1 = getRad(pos1, pos2);\r\n var rad2 = getRad(pos1, pos3);\r\n var rad = rad2 - rad1;\r\n return rad >= 0 ? rad : rad + 2 * Math.PI;\r\n}\r\nfunction isValidPos(poses1, poses2) {\r\n var rad1 = getTriangleRad(poses1[0], poses1[1], poses1[2]);\r\n var rad2 = getTriangleRad(poses2[0], poses2[1], poses2[2]);\r\n var pi = Math.PI;\r\n if ((rad1 >= pi && rad2 <= pi) || (rad1 <= pi && rad2 >= pi)) {\r\n return false;\r\n }\r\n return true;\r\n}\r\n/**\r\n * @namespace Moveable.Warpable\r\n * @description Warpable indicates whether the target can be warped(distorted, bented).\r\n */\r\nvar Warpable = {\r\n name: \"warpable\",\r\n ableGroup: \"size\",\r\n props: [\r\n \"warpable\",\r\n \"renderDirections\",\r\n \"edge\",\r\n \"displayAroundControls\",\r\n ],\r\n events: [\r\n \"warpStart\",\r\n \"warp\",\r\n \"warpEnd\",\r\n ],\r\n viewClassName: getDirectionViewClassName(\"warpable\"),\r\n render: function (moveable, React) {\r\n var _a = moveable.props, resizable = _a.resizable, scalable = _a.scalable, warpable = _a.warpable, zoom = _a.zoom;\r\n if (resizable || scalable || !warpable) {\r\n return [];\r\n }\r\n var _b = moveable.state, pos1 = _b.pos1, pos2 = _b.pos2, pos3 = _b.pos3, pos4 = _b.pos4;\r\n var linePosFrom1 = getMiddleLinePos(pos1, pos2);\r\n var linePosFrom2 = getMiddleLinePos(pos2, pos1);\r\n var linePosFrom3 = getMiddleLinePos(pos1, pos3);\r\n var linePosFrom4 = getMiddleLinePos(pos3, pos1);\r\n var linePosTo1 = getMiddleLinePos(pos3, pos4);\r\n var linePosTo2 = getMiddleLinePos(pos4, pos3);\r\n var linePosTo3 = getMiddleLinePos(pos2, pos4);\r\n var linePosTo4 = getMiddleLinePos(pos4, pos2);\r\n return __spreadArray([\r\n React.createElement(\"div\", { className: prefix(\"line\"), key: \"middeLine1\", style: getLineStyle(linePosFrom1, linePosTo1, zoom) }),\r\n React.createElement(\"div\", { className: prefix(\"line\"), key: \"middeLine2\", style: getLineStyle(linePosFrom2, linePosTo2, zoom) }),\r\n React.createElement(\"div\", { className: prefix(\"line\"), key: \"middeLine3\", style: getLineStyle(linePosFrom3, linePosTo3, zoom) }),\r\n React.createElement(\"div\", { className: prefix(\"line\"), key: \"middeLine4\", style: getLineStyle(linePosFrom4, linePosTo4, zoom) })\r\n ], __read(renderAllDirections(moveable, \"warpable\", React)), false);\r\n },\r\n dragControlCondition: function (moveable, e) {\r\n if (e.isRequest) {\r\n return false;\r\n }\r\n var target = e.inputEvent.target;\r\n return hasClass(target, prefix(\"direction\")) && hasClass(target, prefix(\"warpable\"));\r\n },\r\n dragControlStart: function (moveable, e) {\r\n var datas = e.datas, inputEvent = e.inputEvent;\r\n var target = moveable.props.target;\r\n var inputTarget = inputEvent.target;\r\n var direction = getDirection(inputTarget, datas);\r\n if (!direction || !target) {\r\n return false;\r\n }\r\n var state = moveable.state;\r\n var transformOrigin = state.transformOrigin, is3d = state.is3d, targetTransform = state.targetTransform, targetMatrix = state.targetMatrix, width = state.width, height = state.height, left = state.left, top = state.top;\r\n datas.datas = {};\r\n datas.targetTransform = targetTransform;\r\n datas.warpTargetMatrix = is3d ? targetMatrix : convertDimension(targetMatrix, 3, 4);\r\n datas.targetInverseMatrix = ignoreDimension(invert(datas.warpTargetMatrix, 4), 3, 4);\r\n datas.direction = direction;\r\n datas.left = left;\r\n datas.top = top;\r\n datas.poses = [\r\n [0, 0],\r\n [width, 0],\r\n [0, height],\r\n [width, height],\r\n ].map(function (p) { return minus(p, transformOrigin); });\r\n datas.nextPoses = datas.poses.map(function (_a) {\r\n var _b = __read(_a, 2), x = _b[0], y = _b[1];\r\n return calculate(datas.warpTargetMatrix, [x, y, 0, 1], 4);\r\n });\r\n datas.startValue = createIdentityMatrix(4);\r\n datas.prevMatrix = createIdentityMatrix(4);\r\n datas.absolutePoses = getAbsolutePosesByState(state);\r\n datas.posIndexes = getPosIndexesByDirection(direction);\r\n setDragStart(moveable, e);\r\n setDefaultTransformIndex(moveable, e, \"matrix3d\");\r\n state.snapRenderInfo = {\r\n request: e.isRequest,\r\n direction: direction,\r\n };\r\n var params = fillParams(moveable, e, __assign({ set: function (matrix) {\r\n datas.startValue = matrix;\r\n } }, fillTransformStartEvent(moveable, e)));\r\n var result = triggerEvent(moveable, \"onWarpStart\", params);\r\n if (result !== false) {\r\n datas.isWarp = true;\r\n }\r\n return datas.isWarp;\r\n },\r\n dragControl: function (moveable, e) {\r\n var datas = e.datas, isRequest = e.isRequest;\r\n var distX = e.distX, distY = e.distY;\r\n var targetInverseMatrix = datas.targetInverseMatrix, prevMatrix = datas.prevMatrix, isWarp = datas.isWarp, startValue = datas.startValue, poses = datas.poses, posIndexes = datas.posIndexes, absolutePoses = datas.absolutePoses;\r\n if (!isWarp) {\r\n return false;\r\n }\r\n resolveTransformEvent(moveable, e, \"matrix3d\");\r\n if (hasGuidelines(moveable, \"warpable\")) {\r\n var selectedPoses = posIndexes.map(function (index) { return absolutePoses[index]; });\r\n if (selectedPoses.length > 1) {\r\n selectedPoses.push([\r\n (selectedPoses[0][0] + selectedPoses[1][0]) / 2,\r\n (selectedPoses[0][1] + selectedPoses[1][1]) / 2,\r\n ]);\r\n }\r\n var _a = checkMoveableSnapBounds(moveable, isRequest, {\r\n horizontal: selectedPoses.map(function (pos) { return pos[1] + distY; }),\r\n vertical: selectedPoses.map(function (pos) { return pos[0] + distX; }),\r\n }), horizontalSnapInfo = _a.horizontal, verticalSnapInfo = _a.vertical;\r\n distY -= horizontalSnapInfo.offset;\r\n distX -= verticalSnapInfo.offset;\r\n }\r\n var dist = getDragDist({ datas: datas, distX: distX, distY: distY }, true);\r\n var nextPoses = datas.nextPoses.slice();\r\n posIndexes.forEach(function (index) {\r\n nextPoses[index] = plus(nextPoses[index], dist);\r\n });\r\n if (!NEARBY_POS.every(function (nearByPoses) { return isValidPos(nearByPoses.map(function (i) { return poses[i]; }), nearByPoses.map(function (i) { return nextPoses[i]; })); })) {\r\n return false;\r\n }\r\n var h = createWarpMatrix(poses[0], poses[2], poses[1], poses[3], nextPoses[0], nextPoses[2], nextPoses[1], nextPoses[3]);\r\n if (!h.length) {\r\n return false;\r\n }\r\n // B * A * M\r\n var afterMatrix = multiply(targetInverseMatrix, h, 4);\r\n // B * M * A\r\n var matrix = getTransfromMatrix(datas, afterMatrix, true);\r\n var delta = multiply(invert(prevMatrix, 4), matrix, 4);\r\n datas.prevMatrix = matrix;\r\n var totalMatrix = multiply(startValue, matrix, 4);\r\n var nextTransform = convertTransformFormat(datas, \"matrix3d(\".concat(totalMatrix.join(\", \"), \")\"), \"matrix3d(\".concat(matrix.join(\", \"), \")\"));\r\n fillOriginalTransform(e, nextTransform);\r\n triggerEvent(moveable, \"onWarp\", fillParams(moveable, e, __assign({ delta: delta, matrix: totalMatrix, dist: matrix, multiply: multiply, transform: nextTransform }, fillCSSObject({\r\n transform: nextTransform,\r\n }, e))));\r\n return true;\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n var datas = e.datas, isDrag = e.isDrag;\r\n if (!datas.isWarp) {\r\n return false;\r\n }\r\n datas.isWarp = false;\r\n triggerEvent(moveable, \"onWarpEnd\", fillEndParams(moveable, e, {}));\r\n return isDrag;\r\n },\r\n};\r\n/**\r\n * Whether or not target can be warped. (default: false)\r\n * @name Moveable.Warpable#warpable\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.warpable = true;\r\n */\r\n/**\r\n* Set directions to show the control box. (default: [\"n\", \"nw\", \"ne\", \"s\", \"se\", \"sw\", \"e\", \"w\"])\r\n* @name Moveable.Warpable#renderDirections\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* warpable: true,\r\n* renderDirections: [\"n\", \"nw\", \"ne\", \"s\", \"se\", \"sw\", \"e\", \"w\"],\r\n* });\r\n*\r\n* moveable.renderDirections = [\"nw\", \"ne\", \"sw\", \"se\"];\r\n*/\r\n/**\r\n* When the warp starts, the warpStart event is called.\r\n* @memberof Moveable.Warpable\r\n* @event warpStart\r\n* @param {Moveable.Warpable.OnWarpStart} - Parameters for the warpStart event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, { warpable: true });\r\n* moveable.on(\"warpStart\", ({ target }) => {\r\n* console.log(target);\r\n* });\r\n*/\r\n/**\r\n * When warping, the warp event is called.\r\n * @memberof Moveable.Warpable\r\n * @event warp\r\n * @param {Moveable.Warpable.OnWarp} - Parameters for the warp event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n * let matrix = [\r\n * 1, 0, 0, 0,\r\n * 0, 1, 0, 0,\r\n * 0, 0, 1, 0,\r\n * 0, 0, 0, 1,\r\n * ];\r\n * const moveable = new Moveable(document.body, { warpable: true });\r\n * moveable.on(\"warp\", ({ target, transform, delta, multiply }) => {\r\n * // target.style.transform = transform;\r\n * matrix = multiply(matrix, delta);\r\n * target.style.transform = `matrix3d(${matrix.join(\",\")})`;\r\n * });\r\n */\r\n/**\r\n * When the warp finishes, the warpEnd event is called.\r\n * @memberof Moveable.Warpable\r\n * @event warpEnd\r\n * @param {Moveable.Warpable.OnWarpEnd} - Parameters for the warpEnd event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, { warpable: true });\r\n * moveable.on(\"warpEnd\", ({ target, isDrag }) => {\r\n * console.log(target, isDrag);\r\n * });\r\n */\n\nvar AREA_PIECES = /*#__PURE__*/ prefix(\"area-pieces\");\r\nvar AREA_PIECE = /*#__PURE__*/ prefix(\"area-piece\");\r\nvar AVOID = /*#__PURE__*/ prefix(\"avoid\");\r\nvar VIEW_DRAGGING = prefix(\"view-dragging\");\n\nfunction restoreStyle(moveable) {\r\n var el = moveable.areaElement;\r\n if (!el) {\r\n return;\r\n }\r\n var _a = moveable.state, width = _a.width, height = _a.height;\r\n removeClass(el, AVOID);\r\n el.style.cssText += \"left: 0px; top: 0px; width: \".concat(width, \"px; height: \").concat(height, \"px\");\r\n}\r\nfunction renderPieces(React) {\r\n return (React.createElement(\"div\", { key: \"area_pieces\", className: AREA_PIECES },\r\n React.createElement(\"div\", { className: AREA_PIECE }),\r\n React.createElement(\"div\", { className: AREA_PIECE }),\r\n React.createElement(\"div\", { className: AREA_PIECE }),\r\n React.createElement(\"div\", { className: AREA_PIECE })));\r\n}\r\nvar DragArea = {\r\n name: \"dragArea\",\r\n props: [\r\n \"dragArea\",\r\n \"passDragArea\",\r\n ],\r\n events: [\r\n \"click\",\r\n \"clickGroup\",\r\n ],\r\n render: function (moveable, React) {\r\n var _a = moveable.props, target = _a.target, dragArea = _a.dragArea, groupable = _a.groupable, passDragArea = _a.passDragArea;\r\n var _b = moveable.getState(), width = _b.width, height = _b.height, renderPoses = _b.renderPoses;\r\n var className = passDragArea ? prefix(\"area\", \"pass\") : prefix(\"area\");\r\n if (groupable) {\r\n return [\r\n React.createElement(\"div\", { key: \"area\", ref: ref(moveable, \"areaElement\"), className: className }),\r\n renderPieces(React),\r\n ];\r\n }\r\n if (!target || !dragArea) {\r\n return [];\r\n }\r\n var h = createWarpMatrix([0, 0], [width, 0], [0, height], [width, height], renderPoses[0], renderPoses[1], renderPoses[2], renderPoses[3]);\r\n var transform = h.length ? makeMatrixCSS(h, true) : \"none\";\r\n return [\r\n React.createElement(\"div\", { key: \"area\", ref: ref(moveable, \"areaElement\"), className: className, style: {\r\n top: \"0px\",\r\n left: \"0px\",\r\n width: \"\".concat(width, \"px\"),\r\n height: \"\".concat(height, \"px\"),\r\n transformOrigin: \"0 0\",\r\n transform: transform,\r\n } }),\r\n renderPieces(React),\r\n ];\r\n },\r\n dragStart: function (moveable, _a) {\r\n var datas = _a.datas, clientX = _a.clientX, clientY = _a.clientY, inputEvent = _a.inputEvent;\r\n if (!inputEvent) {\r\n return false;\r\n }\r\n datas.isDragArea = false;\r\n var areaElement = moveable.areaElement;\r\n var state = moveable.state;\r\n var moveableClientRect = state.moveableClientRect, renderPoses = state.renderPoses, rootMatrix = state.rootMatrix, is3d = state.is3d;\r\n var left = moveableClientRect.left, top = moveableClientRect.top;\r\n var _b = getRect(renderPoses), relativeLeft = _b.left, relativeTop = _b.top, width = _b.width, height = _b.height;\r\n var n = is3d ? 4 : 3;\r\n var _c = __read(calculateInversePosition(rootMatrix, [clientX - left, clientY - top], n), 2), posX = _c[0], posY = _c[1];\r\n posX -= relativeLeft;\r\n posY -= relativeTop;\r\n var rects = [\r\n { left: relativeLeft, top: relativeTop, width: width, height: posY - 10 },\r\n { left: relativeLeft, top: relativeTop, width: posX - 10, height: height },\r\n { left: relativeLeft, top: relativeTop + posY + 10, width: width, height: height - posY - 10 },\r\n { left: relativeLeft + posX + 10, top: relativeTop, width: width - posX - 10, height: height },\r\n ];\r\n var children = [].slice.call(areaElement.nextElementSibling.children);\r\n rects.forEach(function (rect, i) {\r\n children[i].style.cssText\r\n = \"left: \".concat(rect.left, \"px;top: \").concat(rect.top, \"px; width: \").concat(rect.width, \"px; height: \").concat(rect.height, \"px;\");\r\n });\r\n addClass(areaElement, AVOID);\r\n state.disableNativeEvent = true;\r\n return;\r\n },\r\n drag: function (moveable, _a) {\r\n var datas = _a.datas, inputEvent = _a.inputEvent;\r\n this.enableNativeEvent(moveable);\r\n if (!inputEvent) {\r\n return false;\r\n }\r\n if (!datas.isDragArea) {\r\n datas.isDragArea = true;\r\n restoreStyle(moveable);\r\n }\r\n },\r\n dragEnd: function (moveable, e) {\r\n this.enableNativeEvent(moveable);\r\n var inputEvent = e.inputEvent, datas = e.datas;\r\n if (!inputEvent) {\r\n return false;\r\n }\r\n if (!datas.isDragArea) {\r\n restoreStyle(moveable);\r\n }\r\n },\r\n dragGroupStart: function (moveable, e) {\r\n return this.dragStart(moveable, e);\r\n },\r\n dragGroup: function (moveable, e) {\r\n return this.drag(moveable, e);\r\n },\r\n dragGroupEnd: function (moveable, e) {\r\n return this.dragEnd(moveable, e);\r\n },\r\n unset: function (moveable) {\r\n restoreStyle(moveable);\r\n moveable.state.disableNativeEvent = false;\r\n },\r\n enableNativeEvent: function (moveable) {\r\n var state = moveable.state;\r\n if (state.disableNativeEvent) {\r\n requestAnimationFrame(function () {\r\n state.disableNativeEvent = false;\r\n });\r\n }\r\n },\r\n};\r\n/**\r\n * Add an event to the moveable area instead of the target for stopPropagation. (default: false, true in group)\r\n * @name Moveable#dragArea\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * dragArea: false,\r\n * });\r\n */\r\n/**\r\n * Set `pointerEvents: none;` css to pass events in dragArea. (default: false)\r\n * @name Moveable#passDragArea\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * dragArea: false,\r\n * });\r\n */\n\nvar Origin = makeAble(\"origin\", {\r\n props: [\"origin\", \"svgOrigin\"],\r\n render: function (moveable, React) {\r\n var _a = moveable.props, zoom = _a.zoom, svgOrigin = _a.svgOrigin, groupable = _a.groupable;\r\n var _b = moveable.getState(), beforeOrigin = _b.beforeOrigin, rotation = _b.rotation, svg = _b.svg, allMatrix = _b.allMatrix, is3d = _b.is3d, left = _b.left, top = _b.top, offsetWidth = _b.offsetWidth, offsetHeight = _b.offsetHeight;\r\n var originStyle;\r\n if (!groupable && svg && svgOrigin) {\r\n var _c = __read(convertTransformOriginArray(svgOrigin, offsetWidth, offsetHeight), 2), originX = _c[0], originY = _c[1];\r\n var n = is3d ? 4 : 3;\r\n var result = calculatePosition(allMatrix, [originX, originY], n);\r\n originStyle = getControlTransform(rotation, zoom, minus(result, [left, top]));\r\n }\r\n else {\r\n originStyle = getControlTransform(rotation, zoom, beforeOrigin);\r\n }\r\n return [\r\n React.createElement(\"div\", { className: prefix(\"control\", \"origin\"), style: originStyle, key: \"beforeOrigin\" }),\r\n ];\r\n },\r\n});\r\n/**\r\n * Whether or not the origin controlbox will be visible or not (default: true)\r\n * @name Moveable#origin\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.origin = true;\r\n */\n\nfunction getDefaultScrollPosition(e) {\r\n var scrollContainer = e.scrollContainer;\r\n return [\r\n scrollContainer.scrollLeft,\r\n scrollContainer.scrollTop,\r\n ];\r\n}\r\n/**\r\n * @namespace Moveable.Scrollable\r\n * @description Whether or not target can be scrolled to the scroll container (default: false)\r\n */\r\nvar Scrollable = {\r\n name: \"scrollable\",\r\n canPinch: true,\r\n props: [\r\n \"scrollable\",\r\n \"scrollContainer\",\r\n \"scrollThreshold\",\r\n \"scrollThrottleTime\",\r\n \"getScrollPosition\",\r\n \"scrollOptions\",\r\n ],\r\n events: [\r\n \"scroll\",\r\n \"scrollGroup\",\r\n ],\r\n dragRelation: \"strong\",\r\n dragStart: function (moveable, e) {\r\n var props = moveable.props;\r\n var _a = props.scrollContainer, scrollContainer = _a === void 0 ? moveable.getContainer() : _a, scrollOptions = props.scrollOptions;\r\n var dragScroll = new DragScroll();\r\n var scrollContainerElement = getRefTarget(scrollContainer, true);\r\n e.datas.dragScroll = dragScroll;\r\n moveable.state.dragScroll = dragScroll;\r\n var gestoName = e.isControl ? \"controlGesto\" : \"targetGesto\";\r\n var targets = e.targets;\r\n dragScroll.on(\"scroll\", function (_a) {\r\n var container = _a.container, direction = _a.direction;\r\n var params = fillParams(moveable, e, {\r\n scrollContainer: container,\r\n direction: direction,\r\n });\r\n var eventName = targets ? \"onScrollGroup\" : \"onScroll\";\r\n if (targets) {\r\n params.targets = targets;\r\n }\r\n triggerEvent(moveable, eventName, params);\r\n }).on(\"move\", function (_a) {\r\n var offsetX = _a.offsetX, offsetY = _a.offsetY, inputEvent = _a.inputEvent;\r\n moveable[gestoName].scrollBy(offsetX, offsetY, inputEvent.inputEvent, false);\r\n }).on(\"scrollDrag\", function (_a) {\r\n var next = _a.next;\r\n next(moveable[gestoName].getCurrentEvent());\r\n });\r\n dragScroll.dragStart(e, __assign({ container: scrollContainerElement }, scrollOptions));\r\n },\r\n checkScroll: function (moveable, e) {\r\n var dragScroll = e.datas.dragScroll;\r\n if (!dragScroll) {\r\n return;\r\n }\r\n var _a = moveable.props, _b = _a.scrollContainer, scrollContainer = _b === void 0 ? moveable.getContainer() : _b, _c = _a.scrollThreshold, scrollThreshold = _c === void 0 ? 0 : _c, _d = _a.scrollThrottleTime, scrollThrottleTime = _d === void 0 ? 0 : _d, _e = _a.getScrollPosition, getScrollPosition = _e === void 0 ? getDefaultScrollPosition : _e, scrollOptions = _a.scrollOptions;\r\n dragScroll.drag(e, __assign({ container: scrollContainer, threshold: scrollThreshold, throttleTime: scrollThrottleTime, getScrollPosition: function (ev) {\r\n return getScrollPosition({ scrollContainer: ev.container, direction: ev.direction });\r\n } }, scrollOptions));\r\n return true;\r\n },\r\n drag: function (moveable, e) {\r\n return this.checkScroll(moveable, e);\r\n },\r\n dragEnd: function (moveable, e) {\r\n e.datas.dragScroll.dragEnd();\r\n e.datas.dragScroll = null;\r\n },\r\n dragControlStart: function (moveable, e) {\r\n return this.dragStart(moveable, __assign(__assign({}, e), { isControl: true }));\r\n },\r\n dragControl: function (moveable, e) {\r\n return this.drag(moveable, e);\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n return this.dragEnd(moveable, e);\r\n },\r\n dragGroupStart: function (moveable, e) {\r\n return this.dragStart(moveable, __assign(__assign({}, e), { targets: moveable.props.targets }));\r\n },\r\n dragGroup: function (moveable, e) {\r\n return this.drag(moveable, __assign(__assign({}, e), { targets: moveable.props.targets }));\r\n },\r\n dragGroupEnd: function (moveable, e) {\r\n return this.dragEnd(moveable, __assign(__assign({}, e), { targets: moveable.props.targets }));\r\n },\r\n dragGroupControlStart: function (moveable, e) {\r\n return this.dragStart(moveable, __assign(__assign({}, e), { targets: moveable.props.targets, isControl: true }));\r\n },\r\n dragGroupControl: function (moveable, e) {\r\n return this.drag(moveable, __assign(__assign({}, e), { targets: moveable.props.targets }));\r\n },\r\n dragGroupControEnd: function (moveable, e) {\r\n return this.dragEnd(moveable, __assign(__assign({}, e), { targets: moveable.props.targets }));\r\n },\r\n unset: function (moveable) {\r\n var _a;\r\n var state = moveable.state;\r\n (_a = state.dragScroll) === null || _a === void 0 ? void 0 : _a.dragEnd();\r\n state.dragScroll = null;\r\n },\r\n};\r\n/**\r\n * When the drag cursor leaves the scrollContainer, the `scroll` event occur to scroll.\r\n * @memberof Moveable.Scrollable\r\n * @event scroll\r\n * @param {Moveable.Scrollable.OnScroll} - Parameters for the `scroll` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: document.querySelector(\".target\"),\r\n * });\r\n * moveable.on(\"scroll\", ({ scrollContainer, direction }) => {\r\n * scrollContainer.scrollLeft += direction[0] * 10;\r\n * scrollContainer.scrollTop += direction[1] * 10;\r\n * });\r\n */\r\n/**\r\n * When the drag cursor leaves the scrollContainer, the `scrollGroup` event occur to scroll in group.\r\n * @memberof Moveable.Scrollable\r\n * @event scrollGroup\r\n * @param {Moveable.Scrollable.OnScrollGroup} - Parameters for the `scrollGroup` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * });\r\n * moveable.on(\"scroll\", ({ scrollContainer, direction }) => {\r\n * scrollContainer.scrollLeft += direction[0] * 10;\r\n * scrollContainer.scrollTop += direction[1] * 10;\r\n * });\r\n */\n\nvar Default = {\r\n name: \"\",\r\n props: [\r\n \"target\",\r\n \"dragTargetSelf\",\r\n \"dragTarget\",\r\n \"dragContainer\",\r\n \"container\",\r\n \"warpSelf\",\r\n \"rootContainer\",\r\n \"useResizeObserver\",\r\n \"useMutationObserver\",\r\n \"zoom\",\r\n \"dragFocusedInput\",\r\n \"transformOrigin\",\r\n \"ables\",\r\n \"className\",\r\n \"pinchThreshold\",\r\n \"pinchOutside\",\r\n \"triggerAblesSimultaneously\",\r\n \"checkInput\",\r\n \"cspNonce\",\r\n \"translateZ\",\r\n \"hideDefaultLines\",\r\n \"props\",\r\n \"flushSync\",\r\n \"stopPropagation\",\r\n \"preventClickEventOnDrag\",\r\n \"preventClickDefault\",\r\n \"viewContainer\",\r\n \"persistData\",\r\n \"useAccuratePosition\",\r\n \"firstRenderState\",\r\n \"linePadding\",\r\n \"controlPadding\",\r\n \"preventDefault\",\r\n \"requestStyles\",\r\n ],\r\n events: [\r\n \"changeTargets\",\r\n ],\r\n};\n\nvar Padding = makeAble(\"padding\", {\r\n props: [\"padding\"],\r\n render: function (moveable, React) {\r\n var props = moveable.props;\r\n if (props.dragArea) {\r\n return [];\r\n }\r\n var _a = getPaddingBox(props.padding || {}), left = _a.left, top = _a.top, right = _a.right, bottom = _a.bottom;\r\n var _b = moveable.getState(), renderPoses = _b.renderPoses, pos1 = _b.pos1, pos2 = _b.pos2, pos3 = _b.pos3, pos4 = _b.pos4;\r\n var poses = [pos1, pos2, pos3, pos4];\r\n var paddingDirections = [];\r\n if (left > 0) {\r\n paddingDirections.push([0, 2]);\r\n }\r\n if (top > 0) {\r\n paddingDirections.push([0, 1]);\r\n }\r\n if (right > 0) {\r\n paddingDirections.push([1, 3]);\r\n }\r\n if (bottom > 0) {\r\n paddingDirections.push([2, 3]);\r\n }\r\n return paddingDirections.map(function (_a, i) {\r\n var _b = __read(_a, 2), dir1 = _b[0], dir2 = _b[1];\r\n var paddingPos1 = poses[dir1];\r\n var paddingPos2 = poses[dir2];\r\n var paddingPos3 = renderPoses[dir1];\r\n var paddingPos4 = renderPoses[dir2];\r\n var h = createWarpMatrix([0, 0], [100, 0], [0, 100], [100, 100], paddingPos1, paddingPos2, paddingPos3, paddingPos4);\r\n if (!h.length) {\r\n return undefined;\r\n }\r\n return (React.createElement(\"div\", { key: \"padding\".concat(i), className: prefix(\"padding\"), style: {\r\n transform: makeMatrixCSS(h, true),\r\n } }));\r\n });\r\n },\r\n});\r\n/**\r\n * Add padding around the target to increase the drag area.\r\n * @name Moveable#padding\r\n * @default null\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: document.querySelector(\".target\"),\r\n * padding: { left: 0, top: 0, right: 0, bottom: 0 },\r\n * });\r\n * moveable.padding = { left: 10, top: 10, right: 10, bottom: 10 },\r\n * moveable.updateRect();\r\n */\n\nvar RADIUS_DIRECTIONS = [\"nw\", \"ne\", \"se\", \"sw\"];\r\nfunction calculateRatio(values, size) {\r\n var sumSize = values[0] + values[1];\r\n var sumRatio = sumSize > size ? size / sumSize : 1;\r\n values[0] *= sumRatio;\r\n values[1] = size - values[1] * sumRatio;\r\n return values;\r\n}\r\nvar HORIZONTAL_RADIUS_ORDER = [1, 2, 5, 6];\r\nvar VERTICAL_RADIUS_ORDER = [0, 3, 4, 7];\r\nvar HORIZONTAL_RADIUS_DIRECTIONS = [1, -1, -1, 1];\r\nvar VERTICAL_RADIUS_DIRECTIONS = [1, 1, -1, -1];\r\nfunction getRadiusStyles(nextPoses, isRelative, width, height, left, top, right, bottom) {\r\n if (left === void 0) { left = 0; }\r\n if (top === void 0) { top = 0; }\r\n if (right === void 0) { right = width; }\r\n if (bottom === void 0) { bottom = height; }\r\n var clipStyles = [];\r\n var isVertical = false;\r\n var radiusPoses = nextPoses.filter(function (pos) { return !pos.virtual; });\r\n var raws = radiusPoses.map(function (posInfo) {\r\n var horizontal = posInfo.horizontal, vertical = posInfo.vertical, pos = posInfo.pos;\r\n if (vertical && !isVertical) {\r\n isVertical = true;\r\n clipStyles.push(\"/\");\r\n }\r\n if (isVertical) {\r\n var rawPos = Math.max(0, vertical === 1 ? pos[1] - top : bottom - pos[1]);\r\n clipStyles.push(convertCSSSize(rawPos, height, isRelative));\r\n return rawPos;\r\n }\r\n else {\r\n var rawPos = Math.max(0, horizontal === 1 ? pos[0] - left : right - pos[0]);\r\n clipStyles.push(convertCSSSize(rawPos, width, isRelative));\r\n return rawPos;\r\n }\r\n });\r\n return {\r\n radiusPoses: radiusPoses,\r\n styles: clipStyles,\r\n raws: raws,\r\n };\r\n}\r\nfunction getRadiusRange(controlPoses) {\r\n // [start, length]\r\n var horizontalRange = [0, 0];\r\n var verticalRange = [0, 0];\r\n var length = controlPoses.length;\r\n for (var i = 0; i < length; ++i) {\r\n var clipPose = controlPoses[i];\r\n if (!clipPose.sub) {\r\n continue;\r\n }\r\n if (clipPose.horizontal) {\r\n if (horizontalRange[1] === 0) {\r\n horizontalRange[0] = i;\r\n }\r\n horizontalRange[1] = i - horizontalRange[0] + 1;\r\n verticalRange[0] = i + 1;\r\n }\r\n if (clipPose.vertical) {\r\n if (verticalRange[1] === 0) {\r\n verticalRange[0] = i;\r\n }\r\n verticalRange[1] = i - verticalRange[0] + 1;\r\n }\r\n }\r\n return {\r\n horizontalRange: horizontalRange,\r\n verticalRange: verticalRange,\r\n };\r\n}\r\nfunction getRadiusValues(values, width, height, left, top, minCounts, full) {\r\n var _a, _b, _c, _d;\r\n if (minCounts === void 0) { minCounts = [0, 0]; }\r\n if (full === void 0) { full = false; }\r\n var splitIndex = values.indexOf(\"/\");\r\n var splitLength = (splitIndex > -1 ? values.slice(0, splitIndex) : values).length;\r\n var horizontalValues = values.slice(0, splitLength);\r\n var verticalValues = values.slice(splitLength + 1);\r\n var horizontalValuesLength = horizontalValues.length;\r\n var verticalValuesLength = verticalValues.length;\r\n var hasVerticalValues = verticalValuesLength > 0;\r\n var _e = __read(horizontalValues, 4), _f = _e[0], nwValue = _f === void 0 ? \"0px\" : _f, _g = _e[1], neValue = _g === void 0 ? nwValue : _g, _h = _e[2], seValue = _h === void 0 ? nwValue : _h, _j = _e[3], swValue = _j === void 0 ? neValue : _j;\r\n var _k = __read(verticalValues, 4), _l = _k[0], wnValue = _l === void 0 ? nwValue : _l, _m = _k[1], enValue = _m === void 0 ? hasVerticalValues ? wnValue : neValue : _m, _o = _k[2], esValue = _o === void 0 ? hasVerticalValues ? wnValue : seValue : _o, _p = _k[3], wsValue = _p === void 0 ? hasVerticalValues ? enValue : swValue : _p;\r\n var horizontalRawPoses = [nwValue, neValue, seValue, swValue].map(function (pos) { return convertUnitSize(pos, width); });\r\n var verticalRawPoses = [wnValue, enValue, esValue, wsValue].map(function (pos) { return convertUnitSize(pos, height); });\r\n var horizontalPoses = horizontalRawPoses.slice();\r\n var verticalPoses = verticalRawPoses.slice();\r\n _a = __read(calculateRatio([horizontalPoses[0], horizontalPoses[1]], width), 2), horizontalPoses[0] = _a[0], horizontalPoses[1] = _a[1];\r\n _b = __read(calculateRatio([horizontalPoses[3], horizontalPoses[2]], width), 2), horizontalPoses[3] = _b[0], horizontalPoses[2] = _b[1];\r\n _c = __read(calculateRatio([verticalPoses[0], verticalPoses[3]], height), 2), verticalPoses[0] = _c[0], verticalPoses[3] = _c[1];\r\n _d = __read(calculateRatio([verticalPoses[1], verticalPoses[2]], height), 2), verticalPoses[1] = _d[0], verticalPoses[2] = _d[1];\r\n var nextHorizontalPoses = full\r\n ? horizontalPoses\r\n : horizontalPoses.slice(0, Math.max(minCounts[0], horizontalValuesLength));\r\n var nextVerticalPoses = full\r\n ? verticalPoses\r\n : verticalPoses.slice(0, Math.max(minCounts[1], verticalValuesLength));\r\n return __spreadArray(__spreadArray([], __read(nextHorizontalPoses.map(function (pos, i) {\r\n var direction = RADIUS_DIRECTIONS[i];\r\n return {\r\n virtual: i >= horizontalValuesLength,\r\n horizontal: HORIZONTAL_RADIUS_DIRECTIONS[i],\r\n vertical: 0,\r\n pos: [left + pos, top + (VERTICAL_RADIUS_DIRECTIONS[i] === -1 ? height : 0)],\r\n sub: true,\r\n raw: horizontalRawPoses[i],\r\n direction: direction,\r\n };\r\n })), false), __read(nextVerticalPoses.map(function (pos, i) {\r\n var direction = RADIUS_DIRECTIONS[i];\r\n return {\r\n virtual: i >= verticalValuesLength,\r\n horizontal: 0,\r\n vertical: VERTICAL_RADIUS_DIRECTIONS[i],\r\n pos: [left + (HORIZONTAL_RADIUS_DIRECTIONS[i] === -1 ? width : 0), top + pos],\r\n sub: true,\r\n raw: verticalRawPoses[i],\r\n direction: direction,\r\n };\r\n })), false);\r\n}\r\nfunction removeRadiusPos(controlPoses, poses, index, startIndex, length) {\r\n if (length === void 0) { length = poses.length; }\r\n var _a = getRadiusRange(controlPoses.slice(startIndex)), horizontalRange = _a.horizontalRange, verticalRange = _a.verticalRange;\r\n var radiuslIndex = index - startIndex;\r\n var deleteCount = 0;\r\n if (radiuslIndex === 0) {\r\n deleteCount = length;\r\n }\r\n else if (radiuslIndex > 0 && radiuslIndex < horizontalRange[1]) {\r\n deleteCount = horizontalRange[1] - radiuslIndex;\r\n }\r\n else if (radiuslIndex >= verticalRange[0]) {\r\n deleteCount = verticalRange[0] + verticalRange[1] - radiuslIndex;\r\n }\r\n else {\r\n return;\r\n }\r\n controlPoses.splice(index, deleteCount);\r\n poses.splice(index, deleteCount);\r\n}\r\nfunction addRadiusPos(controlPoses, poses, startIndex, horizontalIndex, verticalIndex, distX, distY, right, bottom, left, top) {\r\n if (left === void 0) { left = 0; }\r\n if (top === void 0) { top = 0; }\r\n var _a = getRadiusRange(controlPoses.slice(startIndex)), horizontalRange = _a.horizontalRange, verticalRange = _a.verticalRange;\r\n if (horizontalIndex > -1) {\r\n var radiusX = HORIZONTAL_RADIUS_DIRECTIONS[horizontalIndex] === 1\r\n ? distX - left\r\n : right - distX;\r\n for (var i = horizontalRange[1]; i <= horizontalIndex; ++i) {\r\n var y = VERTICAL_RADIUS_DIRECTIONS[i] === 1 ? top : bottom;\r\n var x = 0;\r\n if (horizontalIndex === i) {\r\n x = distX;\r\n }\r\n else if (i === 0) {\r\n x = left + radiusX;\r\n }\r\n else if (HORIZONTAL_RADIUS_DIRECTIONS[i] === -1) {\r\n x = right - (poses[startIndex][0] - left);\r\n }\r\n controlPoses.splice(startIndex + i, 0, {\r\n horizontal: HORIZONTAL_RADIUS_DIRECTIONS[i],\r\n vertical: 0,\r\n pos: [x, y],\r\n });\r\n poses.splice(startIndex + i, 0, [x, y]);\r\n if (i === 0) {\r\n break;\r\n }\r\n }\r\n }\r\n else if (verticalIndex > -1) {\r\n var radiusY = VERTICAL_RADIUS_DIRECTIONS[verticalIndex] === 1\r\n ? distY - top\r\n : bottom - distY;\r\n if (horizontalRange[1] === 0 && verticalRange[1] === 0) {\r\n var pos = [\r\n left + radiusY,\r\n top,\r\n ];\r\n controlPoses.push({\r\n horizontal: HORIZONTAL_RADIUS_DIRECTIONS[0],\r\n vertical: 0,\r\n pos: pos,\r\n });\r\n poses.push(pos);\r\n }\r\n var startVerticalIndex = verticalRange[0];\r\n for (var i = verticalRange[1]; i <= verticalIndex; ++i) {\r\n var x = HORIZONTAL_RADIUS_DIRECTIONS[i] === 1 ? left : right;\r\n var y = 0;\r\n if (verticalIndex === i) {\r\n y = distY;\r\n }\r\n else if (i === 0) {\r\n y = top + radiusY;\r\n }\r\n else if (VERTICAL_RADIUS_DIRECTIONS[i] === 1) {\r\n y = poses[startIndex + startVerticalIndex][1];\r\n }\r\n else if (VERTICAL_RADIUS_DIRECTIONS[i] === -1) {\r\n y = bottom - (poses[startIndex + startVerticalIndex][1] - top);\r\n }\r\n controlPoses.push({\r\n horizontal: 0,\r\n vertical: VERTICAL_RADIUS_DIRECTIONS[i],\r\n pos: [x, y],\r\n });\r\n poses.push([x, y]);\r\n if (i === 0) {\r\n break;\r\n }\r\n }\r\n }\r\n}\r\nfunction splitRadiusPoses(controlPoses, raws) {\r\n if (raws === void 0) { raws = controlPoses.map(function (pos) { return pos.raw; }); }\r\n var horizontals = controlPoses\r\n .map(function (pos, i) { return pos.horizontal ? raws[i] : null; }).filter(function (pos) { return pos != null; });\r\n var verticals = controlPoses\r\n .map(function (pos, i) { return pos.vertical ? raws[i] : null; }).filter(function (pos) { return pos != null; });\r\n return {\r\n horizontals: horizontals,\r\n verticals: verticals,\r\n };\r\n}\n\nvar CLIP_DIRECTIONS = [\r\n [0, -1, \"n\"],\r\n [1, 0, \"e\"],\r\n];\r\nvar CLIP_RECT_DIRECTIONS = [\r\n [-1, -1, \"nw\"],\r\n [0, -1, \"n\"],\r\n [1, -1, \"ne\"],\r\n [1, 0, \"e\"],\r\n [1, 1, \"se\"],\r\n [0, 1, \"s\"],\r\n [-1, 1, \"sw\"],\r\n [-1, 0, \"w\"],\r\n];\r\n// 1 2 5 6 0 3 4 7\r\n// 0 1 2 3 4 5 6 7\r\nfunction getClipStyles(moveable, clipPath, poses) {\r\n var clipRelative = moveable.props.clipRelative;\r\n var _a = moveable.state, width = _a.width, height = _a.height;\r\n var _b = clipPath, clipType = _b.type, clipPoses = _b.poses;\r\n var isRect = clipType === \"rect\";\r\n var isCircle = clipType === \"circle\";\r\n if (clipType === \"polygon\") {\r\n return poses.map(function (pos) { return \"\".concat(convertCSSSize(pos[0], width, clipRelative), \" \").concat(convertCSSSize(pos[1], height, clipRelative)); });\r\n }\r\n else if (isRect || clipType === \"inset\") {\r\n var top_1 = poses[1][1];\r\n var right = poses[3][0];\r\n var left = poses[7][0];\r\n var bottom = poses[5][1];\r\n if (isRect) {\r\n return [\r\n top_1,\r\n right,\r\n bottom,\r\n left,\r\n ].map(function (pos) { return \"\".concat(pos, \"px\"); });\r\n }\r\n var clipStyles = [top_1, width - right, height - bottom, left]\r\n .map(function (pos, i) { return convertCSSSize(pos, i % 2 ? width : height, clipRelative); });\r\n if (poses.length > 8) {\r\n var _c = __read(minus(poses[4], poses[0]), 2), subWidth = _c[0], subHeight = _c[1];\r\n clipStyles.push.apply(clipStyles, __spreadArray([\"round\"], __read(getRadiusStyles(clipPoses.slice(8).map(function (info, i) {\r\n return __assign(__assign({}, info), { pos: poses[i] });\r\n }), clipRelative, subWidth, subHeight, left, top_1, right, bottom).styles), false));\r\n }\r\n return clipStyles;\r\n }\r\n else if (isCircle || clipType === \"ellipse\") {\r\n var center = poses[0];\r\n var ry = convertCSSSize(abs(poses[1][1] - center[1]), isCircle ? Math.sqrt((width * width + height * height) / 2) : height, clipRelative);\r\n var clipStyles = isCircle ? [ry]\r\n : [convertCSSSize(abs(poses[2][0] - center[0]), width, clipRelative), ry];\r\n clipStyles.push(\"at\", convertCSSSize(center[0], width, clipRelative), convertCSSSize(center[1], height, clipRelative));\r\n return clipStyles;\r\n }\r\n}\r\nfunction getRectPoses(top, right, bottom, left) {\r\n var xs = [left, (left + right) / 2, right];\r\n var ys = [top, (top + bottom) / 2, bottom];\r\n return CLIP_RECT_DIRECTIONS.map(function (_a) {\r\n var _b = __read(_a, 3), dirx = _b[0], diry = _b[1], dir = _b[2];\r\n var x = xs[dirx + 1];\r\n var y = ys[diry + 1];\r\n return {\r\n vertical: abs(diry),\r\n horizontal: abs(dirx),\r\n direction: dir,\r\n pos: [x, y],\r\n };\r\n });\r\n}\r\nfunction getControlSize(controlPoses) {\r\n var xRange = [Infinity, -Infinity];\r\n var yRange = [Infinity, -Infinity];\r\n controlPoses.forEach(function (_a) {\r\n var pos = _a.pos;\r\n xRange[0] = Math.min(xRange[0], pos[0]);\r\n xRange[1] = Math.max(xRange[1], pos[0]);\r\n yRange[0] = Math.min(yRange[0], pos[1]);\r\n yRange[1] = Math.max(yRange[1], pos[1]);\r\n });\r\n return [\r\n abs(xRange[1] - xRange[0]),\r\n abs(yRange[1] - yRange[0]),\r\n ];\r\n}\r\nfunction getClipPath(target, width, height, defaultClip, customClip) {\r\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\r\n if (!target) {\r\n return;\r\n }\r\n var clipText = customClip;\r\n if (!clipText) {\r\n var getStyle = getCachedStyle(target);\r\n var clipPath = getStyle(\"clipPath\");\r\n clipText = clipPath !== \"none\" ? clipPath : getStyle(\"clip\");\r\n }\r\n if (!clipText || clipText === \"none\" || clipText === \"auto\") {\r\n clipText = defaultClip;\r\n if (!clipText) {\r\n return;\r\n }\r\n }\r\n var _k = splitBracket(clipText), _l = _k.prefix, clipPrefix = _l === void 0 ? clipText : _l, _m = _k.value, value = _m === void 0 ? \"\" : _m;\r\n var isCircle = clipPrefix === \"circle\";\r\n var splitter = \" \";\r\n if (clipPrefix === \"polygon\") {\r\n var values = splitComma(value || \"0% 0%, 100% 0%, 100% 100%, 0% 100%\");\r\n splitter = \",\";\r\n var poses = values.map(function (pos) {\r\n var _a = __read(pos.split(\" \"), 2), xPos = _a[0], yPos = _a[1];\r\n return {\r\n vertical: 1,\r\n horizontal: 1,\r\n pos: [\r\n convertUnitSize(xPos, width),\r\n convertUnitSize(yPos, height),\r\n ],\r\n };\r\n });\r\n var minMaxs = getMinMaxs(poses.map(function (pos) { return pos.pos; }));\r\n return {\r\n type: clipPrefix,\r\n clipText: clipText,\r\n poses: poses,\r\n splitter: splitter,\r\n left: minMaxs.minX,\r\n right: minMaxs.maxX,\r\n top: minMaxs.minY,\r\n bottom: minMaxs.maxY,\r\n };\r\n }\r\n else if (isCircle || clipPrefix === \"ellipse\") {\r\n var xPos = \"\";\r\n var yPos = \"\";\r\n var radiusX_1 = 0;\r\n var radiusY_1 = 0;\r\n var values = splitSpace(value);\r\n if (isCircle) {\r\n var radius = \"\";\r\n _a = __read(values, 4), _b = _a[0], radius = _b === void 0 ? \"50%\" : _b, _c = _a[2], xPos = _c === void 0 ? \"50%\" : _c, _d = _a[3], yPos = _d === void 0 ? \"50%\" : _d;\r\n radiusX_1 = convertUnitSize(radius, Math.sqrt((width * width + height * height) / 2));\r\n radiusY_1 = radiusX_1;\r\n }\r\n else {\r\n var xRadius = \"\";\r\n var yRadius = \"\";\r\n _e = __read(values, 5), _f = _e[0], xRadius = _f === void 0 ? \"50%\" : _f, _g = _e[1], yRadius = _g === void 0 ? \"50%\" : _g, _h = _e[3], xPos = _h === void 0 ? \"50%\" : _h, _j = _e[4], yPos = _j === void 0 ? \"50%\" : _j;\r\n radiusX_1 = convertUnitSize(xRadius, width);\r\n radiusY_1 = convertUnitSize(yRadius, height);\r\n }\r\n var centerPos_1 = [\r\n convertUnitSize(xPos, width),\r\n convertUnitSize(yPos, height),\r\n ];\r\n var poses = __spreadArray([\r\n {\r\n vertical: 1,\r\n horizontal: 1,\r\n pos: centerPos_1,\r\n direction: \"nesw\",\r\n }\r\n ], __read(CLIP_DIRECTIONS.slice(0, isCircle ? 1 : 2).map(function (dir) { return ({\r\n vertical: abs(dir[1]),\r\n horizontal: dir[0],\r\n direction: dir[2],\r\n sub: true,\r\n pos: [\r\n centerPos_1[0] + dir[0] * radiusX_1,\r\n centerPos_1[1] + dir[1] * radiusY_1,\r\n ],\r\n }); })), false);\r\n return {\r\n type: clipPrefix,\r\n clipText: clipText,\r\n radiusX: radiusX_1,\r\n radiusY: radiusY_1,\r\n left: centerPos_1[0] - radiusX_1,\r\n top: centerPos_1[1] - radiusY_1,\r\n right: centerPos_1[0] + radiusX_1,\r\n bottom: centerPos_1[1] + radiusY_1,\r\n poses: poses,\r\n splitter: splitter,\r\n };\r\n }\r\n else if (clipPrefix === \"inset\") {\r\n var values = splitSpace(value || \"0 0 0 0\");\r\n var roundIndex = values.indexOf(\"round\");\r\n var rectLength = (roundIndex > -1 ? values.slice(0, roundIndex) : values).length;\r\n var radiusValues = values.slice(rectLength + 1);\r\n var _o = __read(values.slice(0, rectLength), 4), topValue = _o[0], _p = _o[1], rightValue = _p === void 0 ? topValue : _p, _q = _o[2], bottomValue = _q === void 0 ? topValue : _q, _r = _o[3], leftValue = _r === void 0 ? rightValue : _r;\r\n var _s = __read([topValue, bottomValue].map(function (pos) { return convertUnitSize(pos, height); }), 2), top_2 = _s[0], bottom = _s[1];\r\n var _t = __read([leftValue, rightValue].map(function (pos) { return convertUnitSize(pos, width); }), 2), left = _t[0], right = _t[1];\r\n var nextRight = width - right;\r\n var nextBottom = height - bottom;\r\n var radiusPoses = getRadiusValues(radiusValues, nextRight - left, nextBottom - top_2, left, top_2);\r\n var poses = __spreadArray(__spreadArray([], __read(getRectPoses(top_2, nextRight, nextBottom, left)), false), __read(radiusPoses), false);\r\n return {\r\n type: \"inset\",\r\n clipText: clipText,\r\n poses: poses,\r\n top: top_2,\r\n left: left,\r\n right: nextRight,\r\n bottom: nextBottom,\r\n radius: radiusValues,\r\n splitter: splitter,\r\n };\r\n }\r\n else if (clipPrefix === \"rect\") {\r\n // top right bottom left\r\n var values = splitComma(value || \"0px, \".concat(width, \"px, \").concat(height, \"px, 0px\"));\r\n splitter = \",\";\r\n var _u = __read(values.map(function (pos) {\r\n var posValue = splitUnit(pos).value;\r\n return posValue;\r\n }), 4), top_3 = _u[0], right = _u[1], bottom = _u[2], left = _u[3];\r\n var poses = getRectPoses(top_3, right, bottom, left);\r\n return {\r\n type: \"rect\",\r\n clipText: clipText,\r\n poses: poses,\r\n top: top_3,\r\n right: right,\r\n bottom: bottom,\r\n left: left,\r\n values: values,\r\n splitter: splitter,\r\n };\r\n }\r\n return;\r\n}\n\nfunction moveControlPos(controlPoses, index, dist, isRect, keepRatio) {\r\n var _a = controlPoses[index], direction = _a.direction, sub = _a.sub;\r\n var dists = controlPoses.map(function () { return [0, 0]; });\r\n var directions = direction ? direction.split(\"\") : [];\r\n if (isRect && index < 8) {\r\n var verticalDirections = directions.filter(function (dir) { return dir === \"w\" || dir === \"e\"; });\r\n var horizontalDirections = directions.filter(function (dir) { return dir === \"n\" || dir === \"s\"; });\r\n var verticalDirection_1 = verticalDirections[0];\r\n var horizontalDirection_1 = horizontalDirections[0];\r\n dists[index] = dist;\r\n var _b = __read(getControlSize(controlPoses), 2), width = _b[0], height = _b[1];\r\n var ratio = width && height ? width / height : 0;\r\n if (ratio && keepRatio) {\r\n // 0 1 2\r\n // 7 3\r\n // 6 5 4\r\n var fixedIndex = (index + 4) % 8;\r\n var fixedPosition = controlPoses[fixedIndex].pos;\r\n var sizeDirection = [0, 0];\r\n if (direction.indexOf(\"w\") > -1) {\r\n sizeDirection[0] = -1;\r\n }\r\n else if (direction.indexOf(\"e\") > -1) {\r\n sizeDirection[0] = 1;\r\n }\r\n if (direction.indexOf(\"n\") > -1) {\r\n sizeDirection[1] = -1;\r\n }\r\n else if (direction.indexOf(\"s\") > -1) {\r\n sizeDirection[1] = 1;\r\n }\r\n var nextDist = getSizeDistByDist([width, height], dist, ratio, sizeDirection, true);\r\n var nextWidth = width + nextDist[0];\r\n var nextHeight = height + nextDist[1];\r\n var top_1 = fixedPosition[1];\r\n var bottom = fixedPosition[1];\r\n var left = fixedPosition[0];\r\n var right = fixedPosition[0];\r\n if (sizeDirection[0] === -1) {\r\n left = right - nextWidth;\r\n }\r\n else if (sizeDirection[0] === 1) {\r\n right = left + nextWidth;\r\n }\r\n else {\r\n left = left - nextWidth / 2;\r\n right = right + nextWidth / 2;\r\n }\r\n if (sizeDirection[1] === -1) {\r\n top_1 = bottom - nextHeight;\r\n }\r\n else if (sizeDirection[1] === 1) {\r\n bottom = top_1 + nextHeight;\r\n }\r\n else {\r\n top_1 = bottom - nextHeight / 2;\r\n bottom = top_1 + nextHeight;\r\n }\r\n var nextControlPoses_1 = getRectPoses(top_1, right, bottom, left);\r\n controlPoses.forEach(function (controlPose, i) {\r\n dists[i][0] = nextControlPoses_1[i].pos[0] - controlPose.pos[0];\r\n dists[i][1] = nextControlPoses_1[i].pos[1] - controlPose.pos[1];\r\n });\r\n }\r\n else {\r\n controlPoses.forEach(function (controlPose, i) {\r\n var controlDir = controlPose.direction;\r\n if (!controlDir) {\r\n return;\r\n }\r\n if (controlDir.indexOf(verticalDirection_1) > -1) {\r\n dists[i][0] = dist[0];\r\n }\r\n if (controlDir.indexOf(horizontalDirection_1) > -1) {\r\n dists[i][1] = dist[1];\r\n }\r\n });\r\n if (verticalDirection_1) {\r\n dists[1][0] = dist[0] / 2;\r\n dists[5][0] = dist[0] / 2;\r\n }\r\n if (horizontalDirection_1) {\r\n dists[3][1] = dist[1] / 2;\r\n dists[7][1] = dist[1] / 2;\r\n }\r\n }\r\n }\r\n else if (direction && !sub) {\r\n directions.forEach(function (dir) {\r\n var isVertical = dir === \"n\" || dir === \"s\";\r\n controlPoses.forEach(function (controlPose, i) {\r\n var dirDir = controlPose.direction, dirHorizontal = controlPose.horizontal, dirVertical = controlPose.vertical;\r\n if (!dirDir || dirDir.indexOf(dir) === -1) {\r\n return;\r\n }\r\n dists[i] = [\r\n isVertical || !dirHorizontal ? 0 : dist[0],\r\n !isVertical || !dirVertical ? 0 : dist[1],\r\n ];\r\n });\r\n });\r\n }\r\n else {\r\n dists[index] = dist;\r\n }\r\n return dists;\r\n}\r\nfunction addClipPath(moveable, e) {\r\n var _a = __read(calculatePointerDist(moveable, e), 2), distX = _a[0], distY = _a[1];\r\n var _b = e.datas, clipPath = _b.clipPath, clipIndex = _b.clipIndex;\r\n var _c = clipPath, clipType = _c.type, clipPoses = _c.poses, splitter = _c.splitter;\r\n var poses = clipPoses.map(function (pos) { return pos.pos; });\r\n if (clipType === \"polygon\") {\r\n poses.splice(clipIndex, 0, [distX, distY]);\r\n }\r\n else if (clipType === \"inset\") {\r\n var horizontalIndex = HORIZONTAL_RADIUS_ORDER.indexOf(clipIndex);\r\n var verticalIndex = VERTICAL_RADIUS_ORDER.indexOf(clipIndex);\r\n var length_1 = clipPoses.length;\r\n addRadiusPos(clipPoses, poses, 8, horizontalIndex, verticalIndex, distX, distY, poses[4][0], poses[4][1], poses[0][0], poses[0][1]);\r\n if (length_1 === clipPoses.length) {\r\n return;\r\n }\r\n }\r\n else {\r\n return;\r\n }\r\n var clipStyles = getClipStyles(moveable, clipPath, poses);\r\n var clipStyle = \"\".concat(clipType, \"(\").concat(clipStyles.join(splitter), \")\");\r\n triggerEvent(moveable, \"onClip\", fillParams(moveable, e, __assign({ clipEventType: \"added\", clipType: clipType, poses: poses, clipStyles: clipStyles, clipStyle: clipStyle, distX: 0, distY: 0 }, fillCSSObject({\r\n clipPath: clipStyle,\r\n }, e))));\r\n}\r\nfunction removeClipPath(moveable, e) {\r\n var _a = e.datas, clipPath = _a.clipPath, clipIndex = _a.clipIndex;\r\n var _b = clipPath, clipType = _b.type, clipPoses = _b.poses, splitter = _b.splitter;\r\n var poses = clipPoses.map(function (pos) { return pos.pos; });\r\n var length = poses.length;\r\n if (clipType === \"polygon\") {\r\n clipPoses.splice(clipIndex, 1);\r\n poses.splice(clipIndex, 1);\r\n }\r\n else if (clipType === \"inset\") {\r\n if (clipIndex < 8) {\r\n return;\r\n }\r\n removeRadiusPos(clipPoses, poses, clipIndex, 8, length);\r\n if (length === clipPoses.length) {\r\n return;\r\n }\r\n }\r\n else {\r\n return;\r\n }\r\n var clipStyles = getClipStyles(moveable, clipPath, poses);\r\n var clipStyle = \"\".concat(clipType, \"(\").concat(clipStyles.join(splitter), \")\");\r\n triggerEvent(moveable, \"onClip\", fillParams(moveable, e, __assign({ clipEventType: \"removed\", clipType: clipType, poses: poses, clipStyles: clipStyles, clipStyle: clipStyle, distX: 0, distY: 0 }, fillCSSObject({\r\n clipPath: clipStyle,\r\n }, e))));\r\n}\r\n/**\r\n * @namespace Moveable.Clippable\r\n * @description Whether to clip the target.\r\n */\r\nvar Clippable = {\r\n name: \"clippable\",\r\n props: [\r\n \"clippable\",\r\n \"defaultClipPath\",\r\n \"customClipPath\",\r\n \"keepRatio\",\r\n \"clipRelative\",\r\n \"clipArea\",\r\n \"dragWithClip\",\r\n \"clipTargetBounds\",\r\n \"clipVerticalGuidelines\",\r\n \"clipHorizontalGuidelines\",\r\n \"clipSnapThreshold\",\r\n ],\r\n events: [\r\n \"clipStart\",\r\n \"clip\",\r\n \"clipEnd\",\r\n ],\r\n css: [\r\n \".control.clip-control {\\nbackground: #6d6;\\ncursor: pointer;\\n}\\n.control.clip-control.clip-radius {\\nbackground: #d66;\\n}\\n.line.clip-line {\\nbackground: #6e6;\\ncursor: move;\\nz-index: 1;\\n}\\n.clip-area {\\nposition: absolute;\\ntop: 0;\\nleft: 0;\\n}\\n.clip-ellipse {\\nposition: absolute;\\ncursor: move;\\nborder: 1px solid #6d6;\\nborder: var(--zoompx) solid #6d6;\\nborder-radius: 50%;\\ntransform-origin: 0px 0px;\\n}\",\r\n \":host {\\n--bounds-color: #d66;\\n}\",\r\n \".guideline {\\npointer-events: none;\\nz-index: 2;\\n}\",\r\n \".line.guideline.bounds {\\nbackground: #d66;\\nbackground: var(--bounds-color);\\n}\",\r\n ],\r\n render: function (moveable, React) {\r\n var _a = moveable.props, customClipPath = _a.customClipPath, defaultClipPath = _a.defaultClipPath, clipArea = _a.clipArea, zoom = _a.zoom, groupable = _a.groupable;\r\n var _b = moveable.getState(), target = _b.target, width = _b.width, height = _b.height, allMatrix = _b.allMatrix, is3d = _b.is3d, left = _b.left, top = _b.top, pos1 = _b.pos1, pos2 = _b.pos2, pos3 = _b.pos3, pos4 = _b.pos4, clipPathState = _b.clipPathState, snapBoundInfos = _b.snapBoundInfos, rotationRad = _b.rotation;\r\n if (!target || groupable) {\r\n return [];\r\n }\r\n var clipPath = getClipPath(target, width, height, defaultClipPath || \"inset\", clipPathState || customClipPath);\r\n if (!clipPath) {\r\n return [];\r\n }\r\n var n = is3d ? 4 : 3;\r\n var type = clipPath.type;\r\n var clipPoses = clipPath.poses;\r\n var poses = clipPoses.map(function (pos) {\r\n // return [x, y];\r\n var calculatedPos = calculatePosition(allMatrix, pos.pos, n);\r\n return [\r\n calculatedPos[0] - left,\r\n calculatedPos[1] - top,\r\n ];\r\n });\r\n var controls = [];\r\n var lines = [];\r\n var isRect = type === \"rect\";\r\n var isInset = type === \"inset\";\r\n var isPolygon = type === \"polygon\";\r\n if (isRect || isInset || isPolygon) {\r\n var linePoses_1 = isInset ? poses.slice(0, 8) : poses;\r\n lines = linePoses_1.map(function (to, i) {\r\n var from = i === 0 ? linePoses_1[linePoses_1.length - 1] : linePoses_1[i - 1];\r\n var rad = getRad(from, to);\r\n var dist = getDiagonalSize(from, to);\r\n return React.createElement(\"div\", { key: \"clipLine\".concat(i), className: prefix(\"line\", \"clip-line\", \"snap-control\"), \"data-clip-index\": i, style: {\r\n width: \"\".concat(dist, \"px\"),\r\n transform: \"translate(\".concat(from[0], \"px, \").concat(from[1], \"px) rotate(\").concat(rad, \"rad) scaleY(\").concat(zoom, \")\"),\r\n } });\r\n });\r\n }\r\n controls = poses.map(function (pos, i) {\r\n return React.createElement(\"div\", { key: \"clipControl\".concat(i), className: prefix(\"control\", \"clip-control\", \"snap-control\"), \"data-clip-index\": i, style: {\r\n transform: \"translate(\".concat(pos[0], \"px, \").concat(pos[1], \"px) rotate(\").concat(rotationRad, \"rad) scale(\").concat(zoom, \")\"),\r\n } });\r\n });\r\n if (isInset) {\r\n controls.push.apply(controls, __spreadArray([], __read(poses.slice(8).map(function (pos, i) {\r\n return React.createElement(\"div\", { key: \"clipRadiusControl\".concat(i), className: prefix(\"control\", \"clip-control\", \"clip-radius\", \"snap-control\"), \"data-clip-index\": 8 + i, style: {\r\n transform: \"translate(\".concat(pos[0], \"px, \").concat(pos[1], \"px) rotate(\").concat(rotationRad, \"rad) scale(\").concat(zoom, \")\"),\r\n } });\r\n })), false));\r\n }\r\n if (type === \"circle\" || type === \"ellipse\") {\r\n var clipLeft = clipPath.left, clipTop = clipPath.top, radiusX = clipPath.radiusX, radiusY = clipPath.radiusY;\r\n var _c = __read(minus(calculatePosition(allMatrix, [clipLeft, clipTop], n), calculatePosition(allMatrix, [0, 0], n)), 2), distLeft = _c[0], distTop = _c[1];\r\n var ellipseClipPath = \"none\";\r\n if (!clipArea) {\r\n var piece = Math.max(10, radiusX / 5, radiusY / 5);\r\n var areaPoses = [];\r\n for (var i = 0; i <= piece; ++i) {\r\n var rad = Math.PI * 2 / piece * i;\r\n areaPoses.push([\r\n radiusX + (radiusX - zoom) * Math.cos(rad),\r\n radiusY + (radiusY - zoom) * Math.sin(rad),\r\n ]);\r\n }\r\n areaPoses.push([radiusX, -2]);\r\n areaPoses.push([-2, -2]);\r\n areaPoses.push([-2, radiusY * 2 + 2]);\r\n areaPoses.push([radiusX * 2 + 2, radiusY * 2 + 2]);\r\n areaPoses.push([radiusX * 2 + 2, -2]);\r\n areaPoses.push([radiusX, -2]);\r\n ellipseClipPath = \"polygon(\".concat(areaPoses.map(function (pos) { return \"\".concat(pos[0], \"px \").concat(pos[1], \"px\"); }).join(\", \"), \")\");\r\n }\r\n controls.push(React.createElement(\"div\", { key: \"clipEllipse\", className: prefix(\"clip-ellipse\", \"snap-control\"), style: {\r\n width: \"\".concat(radiusX * 2, \"px\"),\r\n height: \"\".concat(radiusY * 2, \"px\"),\r\n clipPath: ellipseClipPath,\r\n transform: \"translate(\".concat(-left + distLeft, \"px, \").concat(-top + distTop, \"px) \").concat(makeMatrixCSS(allMatrix)),\r\n } }));\r\n }\r\n if (clipArea) {\r\n var _d = getRect(__spreadArray([pos1, pos2, pos3, pos4], __read(poses), false)), allWidth = _d.width, allHeight = _d.height, allLeft_1 = _d.left, allTop_1 = _d.top;\r\n if (isPolygon || isRect || isInset) {\r\n var areaPoses = isInset ? poses.slice(0, 8) : poses;\r\n controls.push(React.createElement(\"div\", { key: \"clipArea\", className: prefix(\"clip-area\", \"snap-control\"), style: {\r\n width: \"\".concat(allWidth, \"px\"),\r\n height: \"\".concat(allHeight, \"px\"),\r\n transform: \"translate(\".concat(allLeft_1, \"px, \").concat(allTop_1, \"px)\"),\r\n clipPath: \"polygon(\".concat(areaPoses.map(function (pos) { return \"\".concat(pos[0] - allLeft_1, \"px \").concat(pos[1] - allTop_1, \"px\"); }).join(\", \"), \")\"),\r\n } }));\r\n }\r\n }\r\n if (snapBoundInfos) {\r\n [\"vertical\", \"horizontal\"].forEach(function (directionType) {\r\n var info = snapBoundInfos[directionType];\r\n var isHorizontal = directionType === \"horizontal\";\r\n if (info.isSnap) {\r\n lines.push.apply(lines, __spreadArray([], __read(info.snap.posInfos.map(function (_a, i) {\r\n var pos = _a.pos;\r\n var snapPos1 = minus(calculatePosition(allMatrix, isHorizontal ? [0, pos] : [pos, 0], n), [left, top]);\r\n var snapPos2 = minus(calculatePosition(allMatrix, isHorizontal ? [width, pos] : [pos, height], n), [left, top]);\r\n return renderLine(React, \"\", snapPos1, snapPos2, zoom, \"clip\".concat(directionType, \"snap\").concat(i), \"guideline\");\r\n })), false));\r\n }\r\n if (info.isBound) {\r\n lines.push.apply(lines, __spreadArray([], __read(info.bounds.map(function (_a, i) {\r\n var pos = _a.pos;\r\n var snapPos1 = minus(calculatePosition(allMatrix, isHorizontal ? [0, pos] : [pos, 0], n), [left, top]);\r\n var snapPos2 = minus(calculatePosition(allMatrix, isHorizontal ? [width, pos] : [pos, height], n), [left, top]);\r\n return renderLine(React, \"\", snapPos1, snapPos2, zoom, \"clip\".concat(directionType, \"bounds\").concat(i), \"guideline\", \"bounds\", \"bold\");\r\n })), false));\r\n }\r\n });\r\n }\r\n return __spreadArray(__spreadArray([], __read(controls), false), __read(lines), false);\r\n },\r\n dragControlCondition: function (moveable, e) {\r\n return e.inputEvent && (e.inputEvent.target.getAttribute(\"class\") || \"\").indexOf(\"clip\") > -1;\r\n },\r\n dragStart: function (moveable, e) {\r\n var props = moveable.props;\r\n var _a = props.dragWithClip, dragWithClip = _a === void 0 ? true : _a;\r\n if (dragWithClip) {\r\n return false;\r\n }\r\n return this.dragControlStart(moveable, e);\r\n },\r\n drag: function (moveable, e) {\r\n return this.dragControl(moveable, __assign(__assign({}, e), { isDragTarget: true }));\r\n },\r\n dragEnd: function (moveable, e) {\r\n return this.dragControlEnd(moveable, e);\r\n },\r\n dragControlStart: function (moveable, e) {\r\n var state = moveable.state;\r\n var _a = moveable.props, defaultClipPath = _a.defaultClipPath, customClipPath = _a.customClipPath;\r\n var target = state.target, width = state.width, height = state.height;\r\n var inputTarget = e.inputEvent ? e.inputEvent.target : null;\r\n var className = (inputTarget && inputTarget.getAttribute(\"class\")) || \"\";\r\n var datas = e.datas;\r\n var clipPath = getClipPath(target, width, height, defaultClipPath || \"inset\", customClipPath);\r\n if (!clipPath) {\r\n return false;\r\n }\r\n var clipText = clipPath.clipText, type = clipPath.type, poses = clipPath.poses;\r\n var result = triggerEvent(moveable, \"onClipStart\", fillParams(moveable, e, {\r\n clipType: type,\r\n clipStyle: clipText,\r\n poses: poses.map(function (pos) { return pos.pos; }),\r\n }));\r\n if (result === false) {\r\n datas.isClipStart = false;\r\n return false;\r\n }\r\n datas.isControl = className && className.indexOf(\"clip-control\") > -1;\r\n datas.isLine = className.indexOf(\"clip-line\") > -1;\r\n datas.isArea = className.indexOf(\"clip-area\") > -1 || className.indexOf(\"clip-ellipse\") > -1;\r\n datas.clipIndex = inputTarget ? parseInt(inputTarget.getAttribute(\"data-clip-index\"), 10) : -1;\r\n datas.clipPath = clipPath;\r\n datas.isClipStart = true;\r\n state.clipPathState = clipText;\r\n setDragStart(moveable, e);\r\n return true;\r\n },\r\n dragControl: function (moveable, e) {\r\n var _a, _b, _c;\r\n var datas = e.datas, originalDatas = e.originalDatas, isDragTarget = e.isDragTarget;\r\n if (!datas.isClipStart) {\r\n return false;\r\n }\r\n var _d = datas, isControl = _d.isControl, isLine = _d.isLine, isArea = _d.isArea, clipIndex = _d.clipIndex, clipPath = _d.clipPath;\r\n if (!clipPath) {\r\n return false;\r\n }\r\n var props = getProps(moveable.props, \"clippable\");\r\n var keepRatio = props.keepRatio;\r\n var distX = 0;\r\n var distY = 0;\r\n var originalDraggable = originalDatas.draggable;\r\n var originalDist = getDragDist(e);\r\n if (isDragTarget && originalDraggable) {\r\n _a = __read(originalDraggable.prevBeforeDist, 2), distX = _a[0], distY = _a[1];\r\n }\r\n else {\r\n _b = __read(originalDist, 2), distX = _b[0], distY = _b[1];\r\n }\r\n var firstDist = [distX, distY];\r\n var state = moveable.state;\r\n var width = state.width, height = state.height;\r\n var isDragWithTarget = !isArea && !isControl && !isLine;\r\n var clipType = clipPath.type, clipPoses = clipPath.poses, splitter = clipPath.splitter;\r\n var poses = clipPoses.map(function (pos) { return pos.pos; });\r\n if (isDragWithTarget) {\r\n distX = -distX;\r\n distY = -distY;\r\n }\r\n var isAll = !isControl || clipPoses[clipIndex].direction === \"nesw\";\r\n var isRect = clipType === \"inset\" || clipType === \"rect\";\r\n var dists = clipPoses.map(function () { return [0, 0]; });\r\n if (isControl && !isAll) {\r\n var _e = clipPoses[clipIndex], horizontal = _e.horizontal, vertical = _e.vertical;\r\n var dist = [\r\n distX * abs(horizontal),\r\n distY * abs(vertical),\r\n ];\r\n dists = moveControlPos(clipPoses, clipIndex, dist, isRect, keepRatio);\r\n }\r\n else if (isAll) {\r\n dists = poses.map(function () { return [distX, distY]; });\r\n }\r\n var nextPoses = poses.map(function (pos, i) { return plus(pos, dists[i]); });\r\n var guidePoses = __spreadArray([], __read(nextPoses), false);\r\n state.snapBoundInfos = null;\r\n var isCircle = clipPath.type === \"circle\";\r\n var isEllipse = clipPath.type === \"ellipse\";\r\n if (isCircle || isEllipse) {\r\n var guideRect = getRect(nextPoses);\r\n var ry = abs(guideRect.bottom - guideRect.top);\r\n var rx = abs(isEllipse ? guideRect.right - guideRect.left : ry);\r\n var bottom = nextPoses[0][1] + ry;\r\n var left = nextPoses[0][0] - rx;\r\n var right = nextPoses[0][0] + rx;\r\n // right\r\n if (isCircle) {\r\n guidePoses.push([right, guideRect.bottom]);\r\n dists.push([1, 0]);\r\n }\r\n // bottom\r\n guidePoses.push([guideRect.left, bottom]);\r\n dists.push([0, 1]);\r\n // left\r\n guidePoses.push([left, guideRect.bottom]);\r\n dists.push([1, 0]);\r\n }\r\n var guidelines = getDefaultGuidelines((props.clipHorizontalGuidelines || []).map(function (v) { return convertUnitSize(\"\".concat(v), height); }), (props.clipVerticalGuidelines || []).map(function (v) { return convertUnitSize(\"\".concat(v), width); }), width, height);\r\n var guideXPoses = [];\r\n var guideYPoses = [];\r\n if (isCircle || isEllipse) {\r\n guideXPoses = [guidePoses[4][0], guidePoses[2][0]];\r\n guideYPoses = [guidePoses[1][1], guidePoses[3][1]];\r\n }\r\n else if (isRect) {\r\n var rectPoses = [guidePoses[0], guidePoses[2], guidePoses[4], guidePoses[6]];\r\n var rectDists_1 = [dists[0], dists[2], dists[4], dists[6]];\r\n guideXPoses = rectPoses.filter(function (_, i) { return rectDists_1[i][0]; }).map(function (pos) { return pos[0]; });\r\n guideYPoses = rectPoses.filter(function (_, i) { return rectDists_1[i][1]; }).map(function (pos) { return pos[1]; });\r\n }\r\n else {\r\n guideXPoses = guidePoses.filter(function (_, i) { return dists[i][0]; }).map(function (pos) { return pos[0]; });\r\n guideYPoses = guidePoses.filter(function (_, i) { return dists[i][1]; }).map(function (pos) { return pos[1]; });\r\n }\r\n var boundDelta = [0, 0];\r\n var _f = checkSnapBounds(guidelines, props.clipTargetBounds && { left: 0, top: 0, right: width, bottom: height }, guideXPoses, guideYPoses, 5), horizontalSnapInfo = _f.horizontal, verticalSnapInfo = _f.vertical;\r\n var snapOffsetY = horizontalSnapInfo.offset;\r\n var snapOffsetX = verticalSnapInfo.offset;\r\n if (horizontalSnapInfo.isBound) {\r\n boundDelta[1] += snapOffsetY;\r\n }\r\n if (verticalSnapInfo.isBound) {\r\n boundDelta[0] += snapOffsetX;\r\n }\r\n if ((isEllipse || isCircle) && dists[0][0] === 0 && dists[0][1] === 0) {\r\n var guideRect = getRect(nextPoses);\r\n var cy = guideRect.bottom - guideRect.top;\r\n var cx = isEllipse ? guideRect.right - guideRect.left : cy;\r\n var distSnapX = verticalSnapInfo.isBound\r\n ? abs(snapOffsetX)\r\n : (verticalSnapInfo.snapIndex === 0 ? -snapOffsetX : snapOffsetX);\r\n var distSnapY = horizontalSnapInfo.isBound\r\n ? abs(snapOffsetY)\r\n : (horizontalSnapInfo.snapIndex === 0 ? -snapOffsetY : snapOffsetY);\r\n cx -= distSnapX;\r\n cy -= distSnapY;\r\n if (isCircle) {\r\n cy = checkSnapBoundPriority(verticalSnapInfo, horizontalSnapInfo) > 0 ? cy : cx;\r\n cx = cy;\r\n }\r\n var center = guidePoses[0];\r\n guidePoses[1][1] = center[1] - cy;\r\n guidePoses[2][0] = center[0] + cx;\r\n guidePoses[3][1] = center[1] + cy;\r\n guidePoses[4][0] = center[0] - cx;\r\n }\r\n else if (isRect && keepRatio && isControl) {\r\n var _g = __read(getControlSize(clipPoses), 2), width_1 = _g[0], height_1 = _g[1];\r\n var ratio = width_1 && height_1 ? width_1 / height_1 : 0;\r\n var clipPose = clipPoses[clipIndex];\r\n var direction = clipPose.direction || \"\";\r\n var top_2 = guidePoses[1][1];\r\n var bottom = guidePoses[5][1];\r\n var left = guidePoses[7][0];\r\n var right = guidePoses[3][0];\r\n if (abs(snapOffsetY) <= abs(snapOffsetX)) {\r\n snapOffsetY = sign(snapOffsetY) * abs(snapOffsetX) / ratio;\r\n }\r\n else {\r\n snapOffsetX = sign(snapOffsetX) * abs(snapOffsetY) * ratio;\r\n }\r\n if (direction.indexOf(\"w\") > -1) {\r\n left -= snapOffsetX;\r\n }\r\n else if (direction.indexOf(\"e\") > -1) {\r\n right -= snapOffsetX;\r\n }\r\n else {\r\n left += snapOffsetX / 2;\r\n right -= snapOffsetX / 2;\r\n }\r\n if (direction.indexOf(\"n\") > -1) {\r\n top_2 -= snapOffsetY;\r\n }\r\n else if (direction.indexOf(\"s\") > -1) {\r\n bottom -= snapOffsetY;\r\n }\r\n else {\r\n top_2 += snapOffsetY / 2;\r\n bottom -= snapOffsetY / 2;\r\n }\r\n var nextControlPoses_2 = getRectPoses(top_2, right, bottom, left);\r\n guidePoses.forEach(function (pos, i) {\r\n var _a;\r\n _a = __read(nextControlPoses_2[i].pos, 2), pos[0] = _a[0], pos[1] = _a[1];\r\n });\r\n }\r\n else {\r\n guidePoses.forEach(function (pos, j) {\r\n var dist = dists[j];\r\n if (dist[0]) {\r\n pos[0] -= snapOffsetX;\r\n }\r\n if (dist[1]) {\r\n pos[1] -= snapOffsetY;\r\n }\r\n });\r\n }\r\n var nextClipStyles = getClipStyles(moveable, clipPath, nextPoses);\r\n var clipStyle = \"\".concat(clipType, \"(\").concat(nextClipStyles.join(splitter), \")\");\r\n state.clipPathState = clipStyle;\r\n if (isCircle || isEllipse) {\r\n guideXPoses = [guidePoses[4][0], guidePoses[2][0]];\r\n guideYPoses = [guidePoses[1][1], guidePoses[3][1]];\r\n }\r\n else if (isRect) {\r\n var rectPoses = [guidePoses[0], guidePoses[2], guidePoses[4], guidePoses[6]];\r\n guideXPoses = rectPoses.map(function (pos) { return pos[0]; });\r\n guideYPoses = rectPoses.map(function (pos) { return pos[1]; });\r\n }\r\n else {\r\n guideXPoses = guidePoses.map(function (pos) { return pos[0]; });\r\n guideYPoses = guidePoses.map(function (pos) { return pos[1]; });\r\n }\r\n state.snapBoundInfos = checkSnapBounds(guidelines, props.clipTargetBounds && { left: 0, top: 0, right: width, bottom: height }, guideXPoses, guideYPoses, 1);\r\n if (originalDraggable) {\r\n var is3d = state.is3d, allMatrix = state.allMatrix;\r\n var n = is3d ? 4 : 3;\r\n var dragDist = boundDelta;\r\n if (isDragTarget) {\r\n dragDist = [\r\n firstDist[0] + boundDelta[0] - originalDist[0],\r\n firstDist[1] + boundDelta[1] - originalDist[1],\r\n ];\r\n }\r\n originalDraggable.deltaOffset = multiply(allMatrix, [dragDist[0], dragDist[1], 0, 0], n);\r\n }\r\n triggerEvent(moveable, \"onClip\", fillParams(moveable, e, __assign({ clipEventType: \"changed\", clipType: clipType, poses: nextPoses, clipStyle: clipStyle, clipStyles: nextClipStyles, distX: distX, distY: distY }, fillCSSObject((_c = {},\r\n _c[clipType === \"rect\" ? \"clip\" : \"clipPath\"] = clipStyle,\r\n _c), e))));\r\n return true;\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n this.unset(moveable);\r\n var isDrag = e.isDrag, datas = e.datas, isDouble = e.isDouble;\r\n var isLine = datas.isLine, isClipStart = datas.isClipStart, isControl = datas.isControl;\r\n if (!isClipStart) {\r\n return false;\r\n }\r\n triggerEvent(moveable, \"onClipEnd\", fillEndParams(moveable, e, {}));\r\n if (isDouble) {\r\n if (isControl) {\r\n removeClipPath(moveable, e);\r\n }\r\n else if (isLine) {\r\n // add\r\n addClipPath(moveable, e);\r\n }\r\n }\r\n return isDouble || isDrag;\r\n },\r\n unset: function (moveable) {\r\n moveable.state.clipPathState = \"\";\r\n moveable.state.snapBoundInfos = null;\r\n },\r\n};\r\n/**\r\n * Whether to clip the target. (default: false)\r\n * @name Moveable.Clippable#clippable\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * clippable: true,\r\n * defaultClipPath: \"inset\",\r\n * customClipPath: \"\",\r\n * clipRelative: false,\r\n * clipArea: false,\r\n * dragWithClip: true,\r\n * });\r\n * moveable.on(\"clipStart\", e => {\r\n * console.log(e);\r\n * }).on(\"clip\", e => {\r\n * if (e.clipType === \"rect\") {\r\n * e.target.style.clip = e.clipStyle;\r\n * } else {\r\n * e.target.style.clipPath = e.clipStyle;\r\n * }\r\n * }).on(\"clipEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * If clippath is not set, the default value can be set. (defaultClipPath < style < customClipPath < dragging clipPath)\r\n * @name Moveable.Clippable#defaultClipPath\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * clippable: true,\r\n * defaultClipPath: \"inset\",\r\n * customClipPath: \"\",\r\n * clipRelative: false,\r\n * clipArea: false,\r\n * dragWithClip: true,\r\n * });\r\n * moveable.on(\"clipStart\", e => {\r\n * console.log(e);\r\n * }).on(\"clip\", e => {\r\n * if (e.clipType === \"rect\") {\r\n * e.target.style.clip = e.clipStyle;\r\n * } else {\r\n * e.target.style.clipPath = e.clipStyle;\r\n * }\r\n * }).on(\"clipEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * % Can be used instead of the absolute px (`rect` not possible) (default: false)\r\n * @name Moveable.Clippable#clipRelative\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * clippable: true,\r\n * defaultClipPath: \"inset\",\r\n * customClipPath: \"\",\r\n * clipRelative: false,\r\n * clipArea: false,\r\n * dragWithClip: true,\r\n * });\r\n * moveable.on(\"clipStart\", e => {\r\n * console.log(e);\r\n * }).on(\"clip\", e => {\r\n * if (e.clipType === \"rect\") {\r\n * e.target.style.clip = e.clipStyle;\r\n * } else {\r\n * e.target.style.clipPath = e.clipStyle;\r\n * }\r\n * }).on(\"clipEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * You can force the custom clipPath. (defaultClipPath < style < customClipPath < dragging clipPath)\r\n * @name Moveable.Clippable#customClipPath\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * clippable: true,\r\n * defaultClipPath: \"inset\",\r\n * customClipPath: \"\",\r\n * clipRelative: false,\r\n * clipArea: false,\r\n * dragWithClip: true,\r\n * });\r\n * moveable.on(\"clipStart\", e => {\r\n * console.log(e);\r\n * }).on(\"clip\", e => {\r\n * if (e.clipType === \"rect\") {\r\n * e.target.style.clip = e.clipStyle;\r\n * } else {\r\n * e.target.style.clipPath = e.clipStyle;\r\n * }\r\n * }).on(\"clipEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * When dragging the target, the clip also moves. (default: true)\r\n * @name Moveable.Clippable#dragWithClip\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * clippable: true,\r\n * defaultClipPath: \"inset\",\r\n * customClipPath: \"\",\r\n * clipRelative: false,\r\n * clipArea: false,\r\n * dragWithClip: true,\r\n * });\r\n * moveable.on(\"clipStart\", e => {\r\n * console.log(e);\r\n * }).on(\"clip\", e => {\r\n * if (e.clipType === \"rect\") {\r\n * e.target.style.clip = e.clipStyle;\r\n * } else {\r\n * e.target.style.clipPath = e.clipStyle;\r\n * }\r\n * }).on(\"clipEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * You can drag the clip by setting clipArea.\r\n * @name Moveable.Clippable#clipArea\r\n * @default false\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * clippable: true,\r\n * defaultClipPath: \"inset\",\r\n * customClipPath: \"\",\r\n * clipRelative: false,\r\n * clipArea: false,\r\n * dragWithClip: true,\r\n * });\r\n * moveable.on(\"clipStart\", e => {\r\n * console.log(e);\r\n * }).on(\"clip\", e => {\r\n * if (e.clipType === \"rect\") {\r\n * e.target.style.clip = e.clipStyle;\r\n * } else {\r\n * e.target.style.clipPath = e.clipStyle;\r\n * }\r\n * }).on(\"clipEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n* Whether the clip is bound to the target.\r\n* @name Moveable.Clippable#clipTargetBounds\r\n* @default false\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* clippable: true,\r\n* defaultClipPath: \"inset\",\r\n* customClipPath: \"\",\r\n* clipRelative: false,\r\n* clipArea: false,\r\n* dragWithClip: true,\r\n* clipTargetBounds: true,\r\n* });\r\n* moveable.on(\"clipStart\", e => {\r\n* console.log(e);\r\n* }).on(\"clip\", e => {\r\n* if (e.clipType === \"rect\") {\r\n* e.target.style.clip = e.clipStyle;\r\n* } else {\r\n* e.target.style.clipPath = e.clipStyle;\r\n* }\r\n* }).on(\"clipEnd\", e => {\r\n* console.log(e);\r\n* });\r\n*/\r\n/**\r\n * Add clip guidelines in the vertical direction.\r\n * @name Moveable.Clippable#clipVerticalGuidelines\r\n * @default 0\r\n * @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* clippable: true,\r\n* defaultClipPath: \"inset\",\r\n* customClipPath: \"\",\r\n* clipRelative: false,\r\n* clipArea: false,\r\n* dragWithClip: true,\r\n* clipVerticalGuidelines: [0, 100, 200],\r\n* clipHorizontalGuidelines: [0, 100, 200],\r\n* clipSnapThreshold: 5,\r\n* });\r\n*/\r\n/**\r\n* Add clip guidelines in the horizontal direction.\r\n* @name Moveable.Clippable#clipHorizontalGuidelines\r\n* @default []\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* clippable: true,\r\n* defaultClipPath: \"inset\",\r\n* customClipPath: \"\",\r\n* clipRelative: false,\r\n* clipArea: false,\r\n* dragWithClip: true,\r\n* clipVerticalGuidelines: [0, 100, 200],\r\n* clipHorizontalGuidelines: [0, 100, 200],\r\n* clipSnapThreshold: 5,\r\n* });\r\n*/\r\n/**\r\n* istance value that can snap to clip guidelines.\r\n* @name Moveable.Clippable#clipSnapThreshold\r\n* @default 5\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* clippable: true,\r\n* defaultClipPath: \"inset\",\r\n* customClipPath: \"\",\r\n* clipRelative: false,\r\n* clipArea: false,\r\n* dragWithClip: true,\r\n* clipVerticalGuidelines: [0, 100, 200],\r\n* clipHorizontalGuidelines: [0, 100, 200],\r\n* clipSnapThreshold: 5,\r\n* });\r\n*/\r\n/**\r\n * When drag start the clip area or controls, the `clipStart` event is called.\r\n * @memberof Moveable.Clippable\r\n * @event clipStart\r\n * @param {Moveable.Clippable.OnClipStart} - Parameters for the `clipStart` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * clippable: true,\r\n * defaultClipPath: \"inset\",\r\n * customClipPath: \"\",\r\n * clipRelative: false,\r\n * clipArea: false,\r\n * dragWithClip: true,\r\n * });\r\n * moveable.on(\"clipStart\", e => {\r\n * console.log(e);\r\n * }).on(\"clip\", e => {\r\n * if (e.clipType === \"rect\") {\r\n * e.target.style.clip = e.clipStyle;\r\n * } else {\r\n * e.target.style.clipPath = e.clipStyle;\r\n * }\r\n * }).on(\"clipEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * When drag the clip area or controls, the `clip` event is called.\r\n * @memberof Moveable.Clippable\r\n * @event clip\r\n * @param {Moveable.Clippable.OnClip} - Parameters for the `clip` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * clippable: true,\r\n * defaultClipPath: \"inset\",\r\n * customClipPath: \"\",\r\n * clipRelative: false,\r\n * clipArea: false,\r\n * dragWithClip: true,\r\n * });\r\n * moveable.on(\"clipStart\", e => {\r\n * console.log(e);\r\n * }).on(\"clip\", e => {\r\n * if (e.clipType === \"rect\") {\r\n * e.target.style.clip = e.clipStyle;\r\n * } else {\r\n * e.target.style.clipPath = e.clipStyle;\r\n * }\r\n * }).on(\"clipEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * When drag end the clip area or controls, the `clipEnd` event is called.\r\n * @memberof Moveable.Clippable\r\n * @event clipEnd\r\n * @param {Moveable.Clippable.OnClipEnd} - Parameters for the `clipEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * clippable: true,\r\n * defaultClipPath: \"inset\",\r\n * customClipPath: \"\",\r\n * clipRelative: false,\r\n * clipArea: false,\r\n * dragWithClip: true,\r\n * });\r\n * moveable.on(\"clipStart\", e => {\r\n * console.log(e);\r\n * }).on(\"clip\", e => {\r\n * if (e.clipType === \"rect\") {\r\n * e.target.style.clip = e.clipStyle;\r\n * } else {\r\n * e.target.style.clipPath = e.clipStyle;\r\n * }\r\n * }).on(\"clipEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\n\n/**\r\n * @namespace OriginDraggable\r\n * @memberof Moveable\r\n * @description Whether to drag origin (default: false)\r\n */\r\nvar OriginDraggable = {\r\n name: \"originDraggable\",\r\n props: [\r\n \"originDraggable\",\r\n \"originRelative\",\r\n ],\r\n events: [\r\n \"dragOriginStart\",\r\n \"dragOrigin\",\r\n \"dragOriginEnd\",\r\n ],\r\n css: [\r\n \":host[data-able-origindraggable] .control.origin {\\npointer-events: auto;\\n}\",\r\n ],\r\n dragControlCondition: function (_, e) {\r\n if (e.isRequest) {\r\n return e.requestAble === \"originDraggable\";\r\n }\r\n return hasClass(e.inputEvent.target, prefix(\"origin\"));\r\n },\r\n dragControlStart: function (moveable, e) {\r\n var datas = e.datas;\r\n setDragStart(moveable, e);\r\n var params = fillParams(moveable, e, {\r\n dragStart: Draggable.dragStart(moveable, new CustomGesto().dragStart([0, 0], e)),\r\n });\r\n var result = triggerEvent(moveable, \"onDragOriginStart\", params);\r\n datas.startOrigin = moveable.state.transformOrigin;\r\n datas.startTargetOrigin = moveable.state.targetOrigin;\r\n datas.prevOrigin = [0, 0];\r\n datas.isDragOrigin = true;\r\n if (result === false) {\r\n datas.isDragOrigin = false;\r\n return false;\r\n }\r\n return params;\r\n },\r\n dragControl: function (moveable, e) {\r\n var datas = e.datas, isPinch = e.isPinch, isRequest = e.isRequest;\r\n if (!datas.isDragOrigin) {\r\n return false;\r\n }\r\n var _a = __read(getDragDist(e), 2), distX = _a[0], distY = _a[1];\r\n var state = moveable.state;\r\n var width = state.width, height = state.height, offsetMatrix = state.offsetMatrix, targetMatrix = state.targetMatrix, is3d = state.is3d;\r\n var _b = moveable.props.originRelative, originRelative = _b === void 0 ? true : _b;\r\n var n = is3d ? 4 : 3;\r\n var dist = [distX, distY];\r\n if (isRequest) {\r\n var distOrigin = e.distOrigin;\r\n if (distOrigin[0] || distOrigin[1]) {\r\n dist = distOrigin;\r\n }\r\n }\r\n var origin = plus(datas.startOrigin, dist);\r\n var targetOrigin = plus(datas.startTargetOrigin, dist);\r\n var delta = minus(dist, datas.prevOrigin);\r\n var nextMatrix = getNextMatrix(offsetMatrix, targetMatrix, origin, n);\r\n var rect = moveable.getRect();\r\n var nextRect = getRect(calculatePoses(nextMatrix, width, height, n));\r\n var dragDelta = [\r\n rect.left - nextRect.left,\r\n rect.top - nextRect.top,\r\n ];\r\n datas.prevOrigin = dist;\r\n var transformOrigin = [\r\n convertCSSSize(targetOrigin[0], width, originRelative),\r\n convertCSSSize(targetOrigin[1], height, originRelative),\r\n ].join(\" \");\r\n var result = Draggable.drag(moveable, setCustomDrag(e, moveable.state, dragDelta, !!isPinch, false));\r\n var params = fillParams(moveable, e, __assign(__assign({ width: width, height: height, origin: origin, dist: dist, delta: delta, transformOrigin: transformOrigin, drag: result }, fillCSSObject({\r\n transformOrigin: transformOrigin,\r\n transform: result.transform,\r\n }, e)), { afterTransform: result.transform }));\r\n triggerEvent(moveable, \"onDragOrigin\", params);\r\n return params;\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n var datas = e.datas;\r\n if (!datas.isDragOrigin) {\r\n return false;\r\n }\r\n triggerEvent(moveable, \"onDragOriginEnd\", fillEndParams(moveable, e, {}));\r\n return true;\r\n },\r\n dragGroupControlCondition: function (moveable, e) {\r\n return this.dragControlCondition(moveable, e);\r\n },\r\n dragGroupControlStart: function (moveable, e) {\r\n var params = this.dragControlStart(moveable, e);\r\n if (!params) {\r\n return false;\r\n }\r\n return true;\r\n },\r\n dragGroupControl: function (moveable, e) {\r\n var params = this.dragControl(moveable, e);\r\n if (!params) {\r\n return false;\r\n }\r\n moveable.transformOrigin = params.transformOrigin;\r\n return true;\r\n },\r\n /**\r\n * @method Moveable.OriginDraggable#request\r\n * @param {object} e - the OriginDraggable's request parameter\r\n * @param {number} [e.x] - x position\r\n * @param {number} [e.y] - y position\r\n * @param {number} [e.deltaX] - x number to move\r\n * @param {number} [e.deltaY] - y number to move\r\n * @param {array} [e.deltaOrigin] - left, top number to move transform-origin\r\n * @param {array} [e.origin] - transform-origin position\r\n * @param {number} [e.isInstant] - Whether to execute the request instantly\r\n * @return {Moveable.Requester} Moveable Requester\r\n * @example\r\n\n * // Instantly Request (requestStart - request - requestEnd)\r\n * // Use Relative Value\r\n * moveable.request(\"originDraggable\", { deltaX: 10, deltaY: 10 }, true);\r\n * // Use Absolute Value\r\n * moveable.request(\"originDraggable\", { x: 200, y: 100 }, true);\r\n * // Use Transform Value\r\n * moveable.request(\"originDraggable\", { deltaOrigin: [10, 0] }, true);\r\n * moveable.request(\"originDraggable\", { origin: [100, 0] }, true);\r\n * // requestStart\r\n * const requester = moveable.request(\"originDraggable\");\r\n *\r\n * // request\r\n * // Use Relative Value\r\n * requester.request({ deltaX: 10, deltaY: 10 });\r\n * requester.request({ deltaX: 10, deltaY: 10 });\r\n * requester.request({ deltaX: 10, deltaY: 10 });\r\n * // Use Absolute Value\r\n * moveable.request(\"originDraggable\", { x: 200, y: 100 });\r\n * moveable.request(\"originDraggable\", { x: 220, y: 100 });\r\n * moveable.request(\"originDraggable\", { x: 240, y: 100 });\r\n *\r\n * // requestEnd\r\n * requester.requestEnd();\r\n */\r\n request: function (moveable) {\r\n var datas = {};\r\n var rect = moveable.getRect();\r\n var distX = 0;\r\n var distY = 0;\r\n var transformOrigin = rect.transformOrigin;\r\n var distOrigin = [0, 0];\r\n return {\r\n isControl: true,\r\n requestStart: function () {\r\n return { datas: datas };\r\n },\r\n request: function (e) {\r\n if (\"deltaOrigin\" in e) {\r\n distOrigin[0] += e.deltaOrigin[0];\r\n distOrigin[1] += e.deltaOrigin[1];\r\n }\r\n else if (\"origin\" in e) {\r\n distOrigin[0] = e.origin[0] - transformOrigin[0];\r\n distOrigin[1] = e.origin[1] - transformOrigin[1];\r\n }\r\n else {\r\n if (\"x\" in e) {\r\n distX = e.x - rect.left;\r\n }\r\n else if (\"deltaX\" in e) {\r\n distX += e.deltaX;\r\n }\r\n if (\"y\" in e) {\r\n distY = e.y - rect.top;\r\n }\r\n else if (\"deltaY\" in e) {\r\n distY += e.deltaY;\r\n }\r\n }\r\n return { datas: datas, distX: distX, distY: distY, distOrigin: distOrigin };\r\n },\r\n requestEnd: function () {\r\n return { datas: datas, isDrag: true };\r\n },\r\n };\r\n },\r\n};\r\n/**\r\n * Whether to drag origin (default: false)\r\n * @name Moveable.OriginDraggable#originDraggable\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * originDraggable: true,\r\n * });\r\n * let translate = [0, 0];\r\n * moveable.on(\"dragOriginStart\", e => {\r\n * e.dragStart && e.dragStart.set(translate);\r\n * }).on(\"dragOrigin\", e => {\r\n * translate = e.drag.beforeTranslate;\r\n * e.target.style.cssText\r\n * = `transform-origin: ${e.transformOrigin};`\r\n * + `transform: translate(${translate[0]}px, ${translate[1]}px)`;\r\n * }).on(\"dragOriginEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * % Can be used instead of the absolute px (default: true)\r\n * @name Moveable.OriginDraggable#originRelative\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * originDraggable: true,\r\n * originRelative: false,\r\n * });\r\n * moveable.originRelative = true;\r\n */\r\n/**\r\n* When drag start the origin, the `dragOriginStart` event is called.\r\n* @memberof Moveable.OriginDraggable\r\n* @event dragOriginStart\r\n* @param {Moveable.OriginDraggable.OnDragOriginStart} - Parameters for the `dragOriginStart` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* originDraggable: true,\r\n* });\r\n* let translate = [0, 0];\r\n* moveable.on(\"dragOriginStart\", e => {\r\n* e.dragStart && e.dragStart.set(translate);\r\n* }).on(\"dragOrigin\", e => {\r\n* translate = e.drag.beforeTranslate;\r\n* e.target.style.cssText\r\n* = `transform-origin: ${e.transformOrigin};`\r\n* + `transform: translate(${translate[0]}px, ${translate[1]}px)`;\r\n* }).on(\"dragOriginEnd\", e => {\r\n* console.log(e);\r\n* });\r\n*/\r\n/**\r\n* When drag the origin, the `dragOrigin` event is called.\r\n* @memberof Moveable.OriginDraggable\r\n* @event dragOrigin\r\n* @param {Moveable.OriginDraggable.OnDragOrigin} - Parameters for the `dragOrigin` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* originDraggable: true,\r\n* });\r\n* let translate = [0, 0];\r\n* moveable.on(\"dragOriginStart\", e => {\r\n* e.dragStart && e.dragStart.set(translate);\r\n* }).on(\"dragOrigin\", e => {\r\n* translate = e.drag.beforeTranslate;\r\n* e.target.style.cssText\r\n* = `transform-origin: ${e.transformOrigin};`\r\n* + `transform: translate(${translate[0]}px, ${translate[1]}px)`;\r\n* }).on(\"dragOriginEnd\", e => {\r\n* console.log(e);\r\n* });\r\n*/\r\n/**\r\n* When drag end the origin, the `dragOriginEnd` event is called.\r\n* @memberof Moveable.OriginDraggable\r\n* @event dragOriginEnd\r\n* @param {Moveable.OriginDraggable.OnDragOriginEnd} - Parameters for the `dragOriginEnd` event\r\n* @example\r\n* import Moveable from \"moveable\";\r\n*\r\n* const moveable = new Moveable(document.body, {\r\n* originDraggable: true,\r\n* });\r\n* let translate = [0, 0];\r\n* moveable.on(\"dragOriginStart\", e => {\r\n* e.dragStart && e.dragStart.set(translate);\r\n* }).on(\"dragOrigin\", e => {\r\n* translate = e.drag.beforeTranslate;\r\n* e.target.style.cssText\r\n* = `transform-origin: ${e.transformOrigin};`\r\n* + `transform: translate(${translate[0]}px, ${translate[1]}px)`;\r\n* }).on(\"dragOriginEnd\", e => {\r\n* console.log(e);\r\n* });\r\n*/\n\nfunction addBorderRadiusByLine(controlPoses, lineIndex, distX, distY) {\r\n // lineIndex\r\n // 0 top\r\n // 1 right\r\n // 2 bottom\r\n // 3 left\r\n var horizontalsLength = controlPoses.filter(function (_a) {\r\n var virtual = _a.virtual, horizontal = _a.horizontal;\r\n return horizontal && !virtual;\r\n }).length;\r\n var verticalsLength = controlPoses.filter(function (_a) {\r\n var virtual = _a.virtual, vertical = _a.vertical;\r\n return vertical && !virtual;\r\n }).length;\r\n var controlIndex = -1;\r\n //top\r\n if (lineIndex === 0) {\r\n if (horizontalsLength === 0) {\r\n controlIndex = 0;\r\n }\r\n else if (horizontalsLength === 1) {\r\n controlIndex = 1;\r\n }\r\n }\r\n // bottom\r\n if (lineIndex === 2) {\r\n if (horizontalsLength <= 2) {\r\n controlIndex = 2;\r\n }\r\n else if (horizontalsLength <= 3) {\r\n controlIndex = 3;\r\n }\r\n }\r\n // left\r\n if (lineIndex === 3) {\r\n if (verticalsLength === 0) {\r\n controlIndex = 4;\r\n }\r\n else if (verticalsLength < 4) {\r\n controlIndex = 7;\r\n }\r\n }\r\n // right\r\n if (lineIndex === 1) {\r\n if (verticalsLength <= 1) {\r\n controlIndex = 5;\r\n }\r\n else if (verticalsLength <= 2) {\r\n controlIndex = 6;\r\n }\r\n }\r\n if (controlIndex === -1 || !controlPoses[controlIndex].virtual) {\r\n return;\r\n }\r\n var controlPoseInfo = controlPoses[controlIndex];\r\n addBorderRadius(controlPoses, controlIndex);\r\n if (controlIndex < 4) {\r\n controlPoseInfo.pos[0] = distX;\r\n }\r\n else {\r\n controlPoseInfo.pos[1] = distY;\r\n }\r\n}\r\nfunction addBorderRadius(controlPoses, index) {\r\n if (index < 4) {\r\n controlPoses.slice(0, index + 1).forEach(function (info) {\r\n info.virtual = false;\r\n });\r\n }\r\n else {\r\n if (controlPoses[0].virtual) {\r\n controlPoses[0].virtual = false;\r\n }\r\n controlPoses.slice(4, index + 1).forEach(function (info) {\r\n info.virtual = false;\r\n });\r\n }\r\n}\r\nfunction removeBorderRadius(controlPoses, index) {\r\n if (index < 4) {\r\n controlPoses.slice(index, 4).forEach(function (info) {\r\n info.virtual = true;\r\n });\r\n }\r\n else {\r\n controlPoses.slice(index).forEach(function (info) {\r\n info.virtual = true;\r\n });\r\n }\r\n}\r\nfunction getBorderRadius(borderRadius, width, height, minCounts, full) {\r\n if (minCounts === void 0) { minCounts = [0, 0]; }\r\n var values = [];\r\n if (!borderRadius || borderRadius === \"0px\") {\r\n values = [];\r\n }\r\n else {\r\n values = splitSpace(borderRadius);\r\n }\r\n return getRadiusValues(values, width, height, 0, 0, minCounts, full);\r\n}\r\nfunction triggerRoundEvent(moveable, e, dist, delta, nextPoses) {\r\n var state = moveable.state;\r\n var width = state.width, height = state.height;\r\n var _a = getRadiusStyles(nextPoses, moveable.props.roundRelative, width, height), raws = _a.raws, styles = _a.styles, radiusPoses = _a.radiusPoses;\r\n var _b = splitRadiusPoses(radiusPoses, raws), horizontals = _b.horizontals, verticals = _b.verticals;\r\n var borderRadius = styles.join(\" \");\r\n state.borderRadiusState = borderRadius;\r\n var params = fillParams(moveable, e, __assign({ horizontals: horizontals, verticals: verticals, borderRadius: borderRadius, width: width, height: height, delta: delta, dist: dist }, fillCSSObject({\r\n borderRadius: borderRadius,\r\n }, e)));\r\n triggerEvent(moveable, \"onRound\", params);\r\n return params;\r\n}\r\nfunction getStyleBorderRadius(moveable) {\r\n var _a, _b;\r\n var style = moveable.getState().style;\r\n var borderRadius = style.borderRadius || \"\";\r\n if (!borderRadius && moveable.props.groupable) {\r\n var firstMoveable = moveable.moveables[0];\r\n var firstTarget = moveable.getTargets()[0];\r\n if (firstTarget) {\r\n if ((firstMoveable === null || firstMoveable === void 0 ? void 0 : firstMoveable.props.target) === firstTarget) {\r\n borderRadius = (_b = (_a = moveable.moveables[0]) === null || _a === void 0 ? void 0 : _a.state.style.borderRadius) !== null && _b !== void 0 ? _b : \"\";\r\n style.borderRadius = borderRadius;\r\n }\r\n else {\r\n borderRadius = getComputedStyle(firstTarget).borderRadius;\r\n style.borderRadius = borderRadius;\r\n }\r\n }\r\n }\r\n return borderRadius;\r\n}\r\n/**\r\n * @namespace Moveable.Roundable\r\n * @description Whether to show and drag or double click border-radius\r\n */\r\nvar Roundable = {\r\n name: \"roundable\",\r\n props: [\r\n \"roundable\",\r\n \"roundRelative\",\r\n \"minRoundControls\",\r\n \"maxRoundControls\",\r\n \"roundClickable\",\r\n \"roundPadding\",\r\n \"isDisplayShadowRoundControls\",\r\n ],\r\n events: [\r\n \"roundStart\",\r\n \"round\",\r\n \"roundEnd\",\r\n \"roundGroupStart\",\r\n \"roundGroup\",\r\n \"roundGroupEnd\",\r\n ],\r\n css: [\r\n \".control.border-radius {\\nbackground: #d66;\\ncursor: pointer;\\nz-index: 3;\\n}\",\r\n \".control.border-radius.vertical {\\nbackground: #d6d;\\nz-index: 2;\\n}\",\r\n \".control.border-radius.virtual {\\nopacity: 0.5;\\nz-index: 1;\\n}\",\r\n \":host.round-line-clickable .line.direction {\\ncursor: pointer;\\n}\",\r\n ],\r\n className: function (moveable) {\r\n var roundClickable = moveable.props.roundClickable;\r\n return roundClickable === true || roundClickable === \"line\" ? prefix(\"round-line-clickable\") : \"\";\r\n },\r\n requestStyle: function () {\r\n return [\"borderRadius\"];\r\n },\r\n requestChildStyle: function () {\r\n return [\"borderRadius\"];\r\n },\r\n render: function (moveable, React) {\r\n var _a = moveable.getState(), target = _a.target, width = _a.width, height = _a.height, allMatrix = _a.allMatrix, is3d = _a.is3d, left = _a.left, top = _a.top, borderRadiusState = _a.borderRadiusState;\r\n var _b = moveable.props, _c = _b.minRoundControls, minRoundControls = _c === void 0 ? [0, 0] : _c, _d = _b.maxRoundControls, maxRoundControls = _d === void 0 ? [4, 4] : _d, zoom = _b.zoom, _e = _b.roundPadding, roundPadding = _e === void 0 ? 0 : _e, isDisplayShadowRoundControls = _b.isDisplayShadowRoundControls, groupable = _b.groupable;\r\n if (!target) {\r\n return null;\r\n }\r\n var borderRadius = borderRadiusState || getStyleBorderRadius(moveable);\r\n var n = is3d ? 4 : 3;\r\n var radiusValues = getBorderRadius(borderRadius, width, height, minRoundControls, true);\r\n if (!radiusValues) {\r\n return null;\r\n }\r\n var verticalCount = 0;\r\n var horizontalCount = 0;\r\n var basePos = groupable ? [0, 0] : [left, top];\r\n return radiusValues.map(function (v, i) {\r\n var horizontal = v.horizontal;\r\n var vertical = v.vertical;\r\n var direction = v.direction || \"\";\r\n var originalPos = __spreadArray([], __read(v.pos), false);\r\n horizontalCount += Math.abs(horizontal);\r\n verticalCount += Math.abs(vertical);\r\n if (horizontal && direction.indexOf(\"n\") > -1) {\r\n originalPos[1] -= roundPadding;\r\n }\r\n if (vertical && direction.indexOf(\"w\") > -1) {\r\n originalPos[0] -= roundPadding;\r\n }\r\n if (horizontal && direction.indexOf(\"s\") > -1) {\r\n originalPos[1] += roundPadding;\r\n }\r\n if (vertical && direction.indexOf(\"e\") > -1) {\r\n originalPos[0] += roundPadding;\r\n }\r\n var pos = minus(calculatePosition(allMatrix, originalPos, n), basePos);\r\n var isDisplayVerticalShadow = isDisplayShadowRoundControls\r\n && isDisplayShadowRoundControls !== \"horizontal\";\r\n var isDisplay = v.vertical\r\n ? verticalCount <= maxRoundControls[1] && (isDisplayVerticalShadow || !v.virtual)\r\n : horizontalCount <= maxRoundControls[0] && (isDisplayShadowRoundControls || !v.virtual);\r\n return React.createElement(\"div\", { key: \"borderRadiusControl\".concat(i), className: prefix(\"control\", \"border-radius\", v.vertical ? \"vertical\" : \"\", v.virtual ? \"virtual\" : \"\"), \"data-radius-index\": i, style: {\r\n display: isDisplay ? \"block\" : \"none\",\r\n transform: \"translate(\".concat(pos[0], \"px, \").concat(pos[1], \"px) scale(\").concat(zoom, \")\"),\r\n } });\r\n });\r\n },\r\n dragControlCondition: function (moveable, e) {\r\n if (!e.inputEvent || e.isRequest) {\r\n return false;\r\n }\r\n var className = (e.inputEvent.target.getAttribute(\"class\") || \"\");\r\n return className.indexOf(\"border-radius\") > -1\r\n || (className.indexOf(\"moveable-line\") > -1 && className.indexOf(\"moveable-direction\") > -1);\r\n },\r\n dragGroupControlCondition: function (moveable, e) {\r\n return this.dragControlCondition(moveable, e);\r\n },\r\n dragControlStart: function (moveable, e) {\r\n var inputEvent = e.inputEvent, datas = e.datas;\r\n var inputTarget = inputEvent.target;\r\n var className = (inputTarget.getAttribute(\"class\") || \"\");\r\n var isControl = className.indexOf(\"border-radius\") > -1;\r\n var isLine = className.indexOf(\"moveable-line\") > -1 && className.indexOf(\"moveable-direction\") > -1;\r\n var controlIndex = isControl ? parseInt(inputTarget.getAttribute(\"data-radius-index\"), 10) : -1;\r\n var lineIndex = -1;\r\n if (isLine) {\r\n var indexAttr = inputTarget.getAttribute(\"data-line-key\") || \"\";\r\n if (indexAttr) {\r\n lineIndex = parseInt(indexAttr.replace(/render-line-/g, \"\"), 10);\r\n if (isNaN(lineIndex)) {\r\n lineIndex = -1;\r\n }\r\n }\r\n }\r\n if (!isControl && !isLine) {\r\n return false;\r\n }\r\n var params = fillParams(moveable, e, {});\r\n var result = triggerEvent(moveable, \"onRoundStart\", params);\r\n if (result === false) {\r\n return false;\r\n }\r\n datas.lineIndex = lineIndex;\r\n datas.controlIndex = controlIndex;\r\n datas.isControl = isControl;\r\n datas.isLine = isLine;\r\n setDragStart(moveable, e);\r\n var _a = moveable.props, roundRelative = _a.roundRelative, _b = _a.minRoundControls, minRoundControls = _b === void 0 ? [0, 0] : _b;\r\n var state = moveable.state;\r\n var width = state.width, height = state.height;\r\n datas.isRound = true;\r\n datas.prevDist = [0, 0];\r\n var borderRadius = getStyleBorderRadius(moveable);\r\n var controlPoses = getBorderRadius(borderRadius || \"\", width, height, minRoundControls, true) || [];\r\n datas.controlPoses = controlPoses;\r\n state.borderRadiusState = getRadiusStyles(controlPoses, roundRelative, width, height).styles.join(\" \");\r\n return params;\r\n },\r\n dragControl: function (moveable, e) {\r\n var datas = e.datas;\r\n var controlPoses = datas.controlPoses;\r\n if (!datas.isRound || !datas.isControl || !controlPoses.length) {\r\n return false;\r\n }\r\n var index = datas.controlIndex;\r\n var _a = __read(getDragDist(e), 2), distX = _a[0], distY = _a[1];\r\n var dist = [distX, distY];\r\n var delta = minus(dist, datas.prevDist);\r\n var _b = moveable.props.maxRoundControls, maxRoundControls = _b === void 0 ? [4, 4] : _b;\r\n var _c = moveable.state, width = _c.width, height = _c.height;\r\n var selectedControlPose = controlPoses[index];\r\n var selectedVertical = selectedControlPose.vertical;\r\n var selectedHorizontal = selectedControlPose.horizontal;\r\n // 0: [0, 1, 2, 3] maxCount === 1\r\n // 0: [0, 2] maxCount === 2\r\n // 1: [1, 3] maxCount === 2\r\n // 0: [0] maxCount === 3\r\n // 1: [1, 3] maxCount === 3\r\n var dists = controlPoses.map(function (pose) {\r\n var horizontal = pose.horizontal, vertical = pose.vertical;\r\n var poseDist = [\r\n horizontal * selectedHorizontal * dist[0],\r\n vertical * selectedVertical * dist[1],\r\n ];\r\n if (horizontal) {\r\n if (maxRoundControls[0] === 1) {\r\n return poseDist;\r\n }\r\n else if (maxRoundControls[0] < 4 && horizontal !== selectedHorizontal) {\r\n return poseDist;\r\n }\r\n }\r\n else if (maxRoundControls[1] === 0) {\r\n poseDist[1] = vertical * selectedHorizontal * dist[0] / width * height;\r\n return poseDist;\r\n }\r\n else if (selectedVertical) {\r\n if (maxRoundControls[1] === 1) {\r\n return poseDist;\r\n }\r\n else if (maxRoundControls[1] < 4 && vertical !== selectedVertical) {\r\n return poseDist;\r\n }\r\n }\r\n return [0, 0];\r\n });\r\n dists[index] = dist;\r\n var nextPoses = controlPoses.map(function (info, i) {\r\n return __assign(__assign({}, info), { pos: plus(info.pos, dists[i]) });\r\n });\r\n if (index < 4) {\r\n nextPoses.slice(0, index + 1).forEach(function (info) {\r\n info.virtual = false;\r\n });\r\n }\r\n else {\r\n nextPoses.slice(4, index + 1).forEach(function (info) {\r\n info.virtual = false;\r\n });\r\n }\r\n datas.prevDist = [distX, distY];\r\n return triggerRoundEvent(moveable, e, dist, delta, nextPoses);\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n var state = moveable.state;\r\n state.borderRadiusState = \"\";\r\n var datas = e.datas, isDouble = e.isDouble;\r\n if (!datas.isRound) {\r\n return false;\r\n }\r\n var isControl = datas.isControl, controlIndex = datas.controlIndex, isLine = datas.isLine, lineIndex = datas.lineIndex;\r\n var controlPoses = datas.controlPoses;\r\n var length = controlPoses.filter(function (_a) {\r\n var virtual = _a.virtual;\r\n return virtual;\r\n }).length;\r\n var _a = moveable.props.roundClickable, roundClickable = _a === void 0 ? true : _a;\r\n if (isDouble && roundClickable) {\r\n if (isControl && (roundClickable === true || roundClickable === \"control\")) {\r\n removeBorderRadius(controlPoses, controlIndex);\r\n }\r\n else if (isLine && (roundClickable === true || roundClickable === \"line\")) {\r\n var _b = __read(calculatePointerDist(moveable, e), 2), distX = _b[0], distY = _b[1];\r\n addBorderRadiusByLine(controlPoses, lineIndex, distX, distY);\r\n }\r\n if (length !== controlPoses.filter(function (_a) {\r\n var virtual = _a.virtual;\r\n return virtual;\r\n }).length) {\r\n triggerRoundEvent(moveable, e, [0, 0], [0, 0], controlPoses);\r\n }\r\n }\r\n var params = fillEndParams(moveable, e, {});\r\n triggerEvent(moveable, \"onRoundEnd\", params);\r\n state.borderRadiusState = \"\";\r\n return params;\r\n },\r\n dragGroupControlStart: function (moveable, e) {\r\n var result = this.dragControlStart(moveable, e);\r\n if (!result) {\r\n return false;\r\n }\r\n var moveables = moveable.moveables;\r\n var targets = moveable.props.targets;\r\n var events = fillChildEvents(moveable, \"roundable\", e);\r\n var nextParams = __assign({ targets: moveable.props.targets, events: events.map(function (ev, i) {\r\n return __assign(__assign({}, ev), { target: targets[i], moveable: moveables[i], currentTarget: moveables[i] });\r\n }) }, result);\r\n triggerEvent(moveable, \"onRoundGroupStart\", nextParams);\r\n return result;\r\n },\r\n dragGroupControl: function (moveable, e) {\r\n var result = this.dragControl(moveable, e);\r\n if (!result) {\r\n return false;\r\n }\r\n var moveables = moveable.moveables;\r\n var targets = moveable.props.targets;\r\n var events = fillChildEvents(moveable, \"roundable\", e);\r\n var nextParams = __assign({ targets: moveable.props.targets, events: events.map(function (ev, i) {\r\n return __assign(__assign(__assign({}, ev), { target: targets[i], moveable: moveables[i], currentTarget: moveables[i] }), fillCSSObject({\r\n borderRadius: result.borderRadius,\r\n }, ev));\r\n }) }, result);\r\n triggerEvent(moveable, \"onRoundGroup\", nextParams);\r\n return nextParams;\r\n },\r\n dragGroupControlEnd: function (moveable, e) {\r\n var moveables = moveable.moveables;\r\n var targets = moveable.props.targets;\r\n var events = fillChildEvents(moveable, \"roundable\", e);\r\n catchEvent(moveable, \"onRound\", function (parentEvent) {\r\n var nextParams = __assign({ targets: moveable.props.targets, events: events.map(function (ev, i) {\r\n return __assign(__assign(__assign({}, ev), { target: targets[i], moveable: moveables[i], currentTarget: moveables[i] }), fillCSSObject({\r\n borderRadius: parentEvent.borderRadius,\r\n }, ev));\r\n }) }, parentEvent);\r\n triggerEvent(moveable, \"onRoundGroup\", nextParams);\r\n });\r\n var result = this.dragControlEnd(moveable, e);\r\n if (!result) {\r\n return false;\r\n }\r\n var nextParams = __assign({ targets: moveable.props.targets, events: events.map(function (ev, i) {\r\n var _a;\r\n return __assign(__assign({}, ev), { target: targets[i], moveable: moveables[i], currentTarget: moveables[i], lastEvent: (_a = ev.datas) === null || _a === void 0 ? void 0 : _a.lastEvent });\r\n }) }, result);\r\n triggerEvent(moveable, \"onRoundGroupEnd\", nextParams);\r\n return nextParams;\r\n },\r\n unset: function (moveable) {\r\n moveable.state.borderRadiusState = \"\";\r\n },\r\n};\r\n/**\r\n * Whether to show and drag or double click border-radius, (default: false)\r\n * @name Moveable.Roundable#roundable\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * roundRelative: false,\r\n * });\r\n * moveable.on(\"roundStart\", e => {\r\n * console.log(e);\r\n * }).on(\"round\", e => {\r\n * e.target.style.borderRadius = e.borderRadius;\r\n * }).on(\"roundEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * % Can be used instead of the absolute px\r\n * @name Moveable.Roundable#roundRelative\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * roundRelative: false,\r\n * });\r\n * moveable.on(\"roundStart\", e => {\r\n * console.log(e);\r\n * }).on(\"round\", e => {\r\n * e.target.style.borderRadius = e.borderRadius;\r\n * }).on(\"roundEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * Minimum number of round controls. It moves in proportion by control. [horizontal, vertical] (default: [0, 0])\r\n * @name Moveable.Roundable#minRoundControls\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * roundRelative: false,\r\n * minRoundControls: [0, 0],\r\n * });\r\n * moveable.minRoundControls = [1, 0];\r\n */\r\n/**\r\n * Maximum number of round controls. It moves in proportion by control. [horizontal, vertical] (default: [4, 4])\r\n * @name Moveable.Roundable#maxRoundControls\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * roundRelative: false,\r\n * maxRoundControls: [4, 4],\r\n * });\r\n * moveable.maxRoundControls = [1, 0];\r\n */\r\n/**\r\n * Whether you can add/delete round controls by double-clicking a line or control.\r\n * @name Moveable.Roundable#roundClickable\r\n * @default true\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * roundRelative: false,\r\n * roundClickable: true,\r\n * });\r\n * moveable.roundClickable = false;\r\n */\r\n/**\r\n * Whether to show a round control that does not actually exist as a shadow\r\n * @name Moveable.Roundable#isDisplayShadowRoundControls\r\n * @default false\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * isDisplayShadowRoundControls: false,\r\n * });\r\n * moveable.isDisplayShadowRoundControls = true;\r\n */\r\n/**\r\n * The padding value of the position of the round control\r\n * @name Moveable.Roundable#roundPadding\r\n * @default false\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * roundPadding: 0,\r\n * });\r\n * moveable.roundPadding = 15;\r\n */\r\n/**\r\n * When drag start the clip area or controls, the `roundStart` event is called.\r\n * @memberof Moveable.Roundable\r\n * @event roundStart\r\n * @param {Moveable.Roundable.OnRoundStart} - Parameters for the `roundStart` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * roundRelative: false,\r\n * });\r\n * moveable.on(\"roundStart\", e => {\r\n * console.log(e);\r\n * }).on(\"round\", e => {\r\n * e.target.style.borderRadius = e.borderRadius;\r\n * }).on(\"roundEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * When drag or double click the border area or controls, the `round` event is called.\r\n * @memberof Moveable.Roundable\r\n * @event round\r\n * @param {Moveable.Roundable.OnRound} - Parameters for the `round` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * roundRelative: false,\r\n * });\r\n * moveable.on(\"roundStart\", e => {\r\n * console.log(e);\r\n * }).on(\"round\", e => {\r\n * e.target.style.borderRadius = e.borderRadius;\r\n * }).on(\"roundEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * When drag end the border area or controls, the `roundEnd` event is called.\r\n * @memberof Moveable.Roundable\r\n * @event roundEnd\r\n * @param {Moveable.Roundable.onRoundEnd} - Parameters for the `roundEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * roundable: true,\r\n * roundRelative: false,\r\n * });\r\n * moveable.on(\"roundStart\", e => {\r\n * console.log(e);\r\n * }).on(\"round\", e => {\r\n * e.target.style.borderRadius = e.borderRadius;\r\n * }).on(\"roundEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * When drag start the clip area or controls, the `roundGroupStart` event is called.\r\n * @memberof Moveable.Roundable\r\n * @event roundGroupStart\r\n * @param {Moveable.Roundable.OnRoundGroupStart} - Parameters for the `roundGroupStart` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * targets: [target1, target2, target3],\r\n * roundable: true,\r\n * });\r\n * moveable.on(\"roundGroupStart\", e => {\r\n * console.log(e.targets);\r\n * }).on(\"roundGroup\", e => {\r\n * e.events.forEach(ev => {\r\n * ev.target.style.cssText += ev.cssText;\r\n * });\r\n * }).on(\"roundGroupEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * When drag or double click the border area or controls, the `roundGroup` event is called.\r\n * @memberof Moveable.Roundable\r\n * @event roundGroup\r\n * @param {Moveable.Roundable.OnRoundGroup} - Parameters for the `roundGroup` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * targets: [target1, target2, target3],\r\n * roundable: true,\r\n * });\r\n * moveable.on(\"roundGroupStart\", e => {\r\n * console.log(e.targets);\r\n * }).on(\"roundGroup\", e => {\r\n * e.events.forEach(ev => {\r\n * ev.target.style.cssText += ev.cssText;\r\n * });\r\n * }).on(\"roundGroupEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\r\n/**\r\n * When drag end the border area or controls, the `roundGroupEnd` event is called.\r\n * @memberof Moveable.Roundable\r\n * @event roundGroupEnd\r\n * @param {Moveable.Roundable.onRoundGroupEnd} - Parameters for the `roundGroupEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * targets: [target1, target2, target3],\r\n * roundable: true,\r\n * });\r\n * moveable.on(\"roundGroupStart\", e => {\r\n * console.log(e.targets);\r\n * }).on(\"roundGroup\", e => {\r\n * e.events.forEach(ev => {\r\n * ev.target.style.cssText += ev.cssText;\r\n * });\r\n * }).on(\"roundGroupEnd\", e => {\r\n * console.log(e);\r\n * });\r\n */\n\nfunction isIdentityMatrix(matrix, is3d) {\r\n var n = is3d ? 4 : 3;\r\n var identityMatrix = createIdentityMatrix(n);\r\n var value = \"matrix\".concat(is3d ? \"3d\" : \"\", \"(\").concat(identityMatrix.join(\",\"), \")\");\r\n return matrix === value || matrix === \"matrix(1,0,0,1,0,0)\";\r\n}\r\nvar BeforeRenderable = {\r\n isPinch: true,\r\n name: \"beforeRenderable\",\r\n props: [],\r\n events: [\r\n \"beforeRenderStart\",\r\n \"beforeRender\",\r\n \"beforeRenderEnd\",\r\n \"beforeRenderGroupStart\",\r\n \"beforeRenderGroup\",\r\n \"beforeRenderGroupEnd\",\r\n ],\r\n dragRelation: \"weak\",\r\n setTransform: function (moveable, e) {\r\n var _a = moveable.state, is3d = _a.is3d, targetMatrix = _a.targetMatrix, inlineTransform = _a.inlineTransform;\r\n var cssMatrix = is3d\r\n ? \"matrix3d(\".concat(targetMatrix.join(\",\"), \")\")\r\n : \"matrix(\".concat(convertMatrixtoCSS(targetMatrix, true), \")\");\r\n var startTransform = !inlineTransform || inlineTransform === \"none\" ? cssMatrix : inlineTransform;\r\n e.datas.startTransforms = isIdentityMatrix(startTransform, is3d) ? [] : splitSpace(startTransform);\r\n },\r\n resetStyle: function (e) {\r\n var datas = e.datas;\r\n datas.nextStyle = {};\r\n datas.nextTransforms = e.datas.startTransforms;\r\n datas.nextTransformAppendedIndexes = [];\r\n },\r\n fillDragStartParams: function (moveable, e) {\r\n return fillParams(moveable, e, {\r\n setTransform: function (transform) {\r\n e.datas.startTransforms = isArray(transform) ? transform : splitSpace(transform);\r\n },\r\n isPinch: !!e.isPinch,\r\n });\r\n },\r\n fillDragParams: function (moveable, e) {\r\n return fillParams(moveable, e, {\r\n isPinch: !!e.isPinch,\r\n });\r\n },\r\n dragStart: function (moveable, e) {\r\n this.setTransform(moveable, e);\r\n this.resetStyle(e);\r\n triggerEvent(moveable, \"onBeforeRenderStart\", this.fillDragStartParams(moveable, e));\r\n },\r\n drag: function (moveable, e) {\r\n if (!e.datas.startTransforms) {\r\n this.setTransform(moveable, e);\r\n }\r\n this.resetStyle(e);\r\n triggerEvent(moveable, \"onBeforeRender\", fillParams(moveable, e, {\r\n isPinch: !!e.isPinch,\r\n }));\r\n },\r\n dragEnd: function (moveable, e) {\r\n if (!e.datas.startTransforms) {\r\n this.setTransform(moveable, e);\r\n this.resetStyle(e);\r\n }\r\n triggerEvent(moveable, \"onBeforeRenderEnd\", fillParams(moveable, e, {\r\n isPinch: !!e.isPinch,\r\n isDrag: e.isDrag,\r\n }));\r\n },\r\n dragGroupStart: function (moveable, e) {\r\n var _this = this;\r\n this.dragStart(moveable, e);\r\n var events = fillChildEvents(moveable, \"beforeRenderable\", e);\r\n var moveables = moveable.moveables;\r\n var params = events.map(function (childEvent, i) {\r\n var childMoveable = moveables[i];\r\n _this.setTransform(childMoveable, childEvent);\r\n _this.resetStyle(childEvent);\r\n return _this.fillDragStartParams(childMoveable, childEvent);\r\n });\r\n triggerEvent(moveable, \"onBeforeRenderGroupStart\", fillParams(moveable, e, {\r\n isPinch: !!e.isPinch,\r\n targets: moveable.props.targets,\r\n setTransform: function () { },\r\n events: params,\r\n }));\r\n },\r\n dragGroup: function (moveable, e) {\r\n var _this = this;\r\n this.drag(moveable, e);\r\n var events = fillChildEvents(moveable, \"beforeRenderable\", e);\r\n var moveables = moveable.moveables;\r\n var params = events.map(function (childEvent, i) {\r\n var childMoveable = moveables[i];\r\n _this.resetStyle(childEvent);\r\n return _this.fillDragParams(childMoveable, childEvent);\r\n });\r\n triggerEvent(moveable, \"onBeforeRenderGroup\", fillParams(moveable, e, {\r\n isPinch: !!e.isPinch,\r\n targets: moveable.props.targets,\r\n events: params,\r\n }));\r\n },\r\n dragGroupEnd: function (moveable, e) {\r\n this.dragEnd(moveable, e);\r\n triggerEvent(moveable, \"onBeforeRenderGroupEnd\", fillParams(moveable, e, {\r\n isPinch: !!e.isPinch,\r\n isDrag: e.isDrag,\r\n targets: moveable.props.targets,\r\n }));\r\n },\r\n dragControlStart: function (moveable, e) {\r\n return this.dragStart(moveable, e);\r\n },\r\n dragControl: function (moveable, e) {\r\n return this.drag(moveable, e);\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n return this.dragEnd(moveable, e);\r\n },\r\n dragGroupControlStart: function (moveable, e) {\r\n return this.dragGroupStart(moveable, e);\r\n },\r\n dragGroupControl: function (moveable, e) {\r\n return this.dragGroup(moveable, e);\r\n },\r\n dragGroupControlEnd: function (moveable, e) {\r\n return this.dragGroupEnd(moveable, e);\r\n },\r\n};\n\nvar Renderable = {\r\n name: \"renderable\",\r\n props: [],\r\n events: [\r\n \"renderStart\",\r\n \"render\",\r\n \"renderEnd\",\r\n \"renderGroupStart\",\r\n \"renderGroup\",\r\n \"renderGroupEnd\",\r\n ],\r\n dragRelation: \"weak\",\r\n dragStart: function (moveable, e) {\r\n triggerEvent(moveable, \"onRenderStart\", fillParams(moveable, e, {\r\n isPinch: !!e.isPinch,\r\n }));\r\n },\r\n drag: function (moveable, e) {\r\n triggerEvent(moveable, \"onRender\", this.fillDragParams(moveable, e));\r\n },\r\n dragAfter: function (moveable, e) {\r\n return this.drag(moveable, e);\r\n },\r\n dragEnd: function (moveable, e) {\r\n triggerEvent(moveable, \"onRenderEnd\", this.fillDragEndParams(moveable, e));\r\n },\r\n dragGroupStart: function (moveable, e) {\r\n triggerEvent(moveable, \"onRenderGroupStart\", fillParams(moveable, e, {\r\n isPinch: !!e.isPinch,\r\n targets: moveable.props.targets,\r\n }));\r\n },\r\n dragGroup: function (moveable, e) {\r\n var _this = this;\r\n var events = fillChildEvents(moveable, \"beforeRenderable\", e);\r\n var moveables = moveable.moveables;\r\n var params = events.map(function (childEvent, i) {\r\n var childMoveable = moveables[i];\r\n return _this.fillDragParams(childMoveable, childEvent);\r\n });\r\n triggerEvent(moveable, \"onRenderGroup\", fillParams(moveable, e, __assign(__assign({ isPinch: !!e.isPinch, targets: moveable.props.targets, transform: getNextTransformText(e), transformObject: {} }, fillCSSObject(getNextStyle(e))), { events: params })));\r\n },\r\n dragGroupEnd: function (moveable, e) {\r\n var _this = this;\r\n var events = fillChildEvents(moveable, \"beforeRenderable\", e);\r\n var moveables = moveable.moveables;\r\n var params = events.map(function (childEvent, i) {\r\n var childMoveable = moveables[i];\r\n return _this.fillDragEndParams(childMoveable, childEvent);\r\n });\r\n triggerEvent(moveable, \"onRenderGroupEnd\", fillParams(moveable, e, __assign({ isPinch: !!e.isPinch, isDrag: e.isDrag, targets: moveable.props.targets, events: params, transformObject: {}, transform: getNextTransformText(e) }, fillCSSObject(getNextStyle(e)))));\r\n },\r\n dragControlStart: function (moveable, e) {\r\n return this.dragStart(moveable, e);\r\n },\r\n dragControl: function (moveable, e) {\r\n return this.drag(moveable, e);\r\n },\r\n dragControlAfter: function (moveable, e) {\r\n return this.dragAfter(moveable, e);\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n return this.dragEnd(moveable, e);\r\n },\r\n dragGroupControlStart: function (moveable, e) {\r\n return this.dragGroupStart(moveable, e);\r\n },\r\n dragGroupControl: function (moveable, e) {\r\n return this.dragGroup(moveable, e);\r\n },\r\n dragGroupControlEnd: function (moveable, e) {\r\n return this.dragGroupEnd(moveable, e);\r\n },\r\n fillDragParams: function (moveable, e) {\r\n var transformObject = {};\r\n parse(getNextTransforms(e) || []).forEach(function (matrixInfo) {\r\n transformObject[matrixInfo.name] = matrixInfo.functionValue;\r\n });\r\n return fillParams(moveable, e, __assign({ isPinch: !!e.isPinch, transformObject: transformObject, transform: getNextTransformText(e) }, fillCSSObject(getNextStyle(e))));\r\n },\r\n fillDragEndParams: function (moveable, e) {\r\n var transformObject = {};\r\n parse(getNextTransforms(e) || []).forEach(function (matrixInfo) {\r\n transformObject[matrixInfo.name] = matrixInfo.functionValue;\r\n });\r\n return fillParams(moveable, e, __assign({ isPinch: !!e.isPinch, isDrag: e.isDrag, transformObject: transformObject, transform: getNextTransformText(e) }, fillCSSObject(getNextStyle(e))));\r\n },\r\n};\n\nfunction triggerAble(moveable, moveableAbles, eventOperations, eventAffix, eventType, e, requestInstant) {\r\n // pre setting\r\n e.clientDistX = e.distX;\r\n e.clientDistY = e.distY;\r\n var isStart = eventType === \"Start\";\r\n var isEnd = eventType === \"End\";\r\n var isAfter = eventType === \"After\";\r\n var target = moveable.state.target;\r\n var isRequest = e.isRequest;\r\n var isControl = eventAffix.indexOf(\"Control\") > -1;\r\n if (!target\r\n || (isStart && isControl && !isRequest && moveable.areaElement === e.inputEvent.target)) {\r\n return false;\r\n }\r\n var ables = __spreadArray([], __read(moveableAbles), false);\r\n if (isRequest) {\r\n var requestAble_1 = e.requestAble;\r\n if (!ables.some(function (able) { return able.name === requestAble_1; })) {\r\n ables.push.apply(ables, __spreadArray([], __read(moveable.props.ables.filter(function (able) { return able.name === requestAble_1; })), false));\r\n }\r\n }\r\n if (!ables.length || ables.every(function (able) { return able.dragRelation; })) {\r\n return false;\r\n }\r\n // \"drag\" \"Control\" \"After\"\r\n var inputEvent = e.inputEvent;\r\n var inputTarget;\r\n if (isEnd && inputEvent) {\r\n inputTarget = document.elementFromPoint(e.clientX, e.clientY) || inputEvent.target;\r\n }\r\n var isDragStop = false;\r\n var stop = function () {\r\n var _a;\r\n isDragStop = true;\r\n (_a = e.stop) === null || _a === void 0 ? void 0 : _a.call(e);\r\n };\r\n var isFirstStart = isStart && (!moveable.targetGesto || !moveable.controlGesto\r\n || (!moveable.targetGesto.isFlag() || !moveable.controlGesto.isFlag()));\r\n if (isFirstStart) {\r\n moveable.updateRect(eventType, true, false);\r\n }\r\n // trigger ables\r\n var datas = e.datas;\r\n var gestoType = isControl ? \"controlGesto\" : \"targetGesto\";\r\n var prevGesto = moveable[gestoType];\r\n var trigger = function (able, eventName, conditionName) {\r\n if (!(eventName in able) || prevGesto !== moveable[gestoType]) {\r\n return false;\r\n }\r\n var ableName = able.name;\r\n var nextDatas = datas[ableName] || (datas[ableName] = {});\r\n if (isStart) {\r\n nextDatas.isEventStart = !conditionName\r\n || !able[conditionName] || able[conditionName](moveable, e);\r\n }\r\n if (!nextDatas.isEventStart) {\r\n return false;\r\n }\r\n var result = able[eventName](moveable, __assign(__assign({}, e), { stop: stop, datas: nextDatas, originalDatas: datas, inputTarget: inputTarget }));\r\n moveable._emitter.off();\r\n if (isStart && result === false) {\r\n nextDatas.isEventStart = false;\r\n }\r\n return result;\r\n };\r\n // unset ables for first drag start\r\n if (isFirstStart) {\r\n ables.forEach(function (able) {\r\n able.unset && able.unset(moveable);\r\n });\r\n }\r\n // BeforeRenderable\r\n trigger(BeforeRenderable, \"drag\".concat(eventAffix).concat(eventType));\r\n var forceEndedCount = 0;\r\n var updatedCount = 0;\r\n eventOperations.forEach(function (eventOperation) {\r\n if (isDragStop) {\r\n return false;\r\n }\r\n var eventName = \"\".concat(eventOperation).concat(eventAffix).concat(eventType);\r\n var conditionName = \"\".concat(eventOperation).concat(eventAffix, \"Condition\");\r\n if (eventType === \"\" && !isRequest) {\r\n // Convert distX, distY\r\n convertDragDist(moveable.state, e);\r\n }\r\n // const isGroup = eventAffix.indexOf(\"Group\") > -1;\r\n var eventAbles = ables.filter(function (able) { return able[eventName]; });\r\n eventAbles = eventAbles.filter(function (able, i) {\r\n return able.name && eventAbles.indexOf(able) === i;\r\n });\r\n var results = eventAbles.filter(function (able) { return trigger(able, eventName, conditionName); });\r\n var isUpdate = results.length;\r\n // end ables\r\n if (isDragStop) {\r\n ++forceEndedCount;\r\n }\r\n if (isUpdate) {\r\n ++updatedCount;\r\n }\r\n if (!isDragStop && isStart && eventAbles.length && !isUpdate) {\r\n forceEndedCount += eventAbles.filter(function (able) {\r\n var ableName = able.name;\r\n var nextDatas = datas[ableName];\r\n if (nextDatas.isEventStart) {\r\n if (able.dragRelation === \"strong\") {\r\n return false;\r\n }\r\n // stop drag\r\n return true;\r\n }\r\n // pre stop drag\r\n return false;\r\n }).length ? 1 : 0;\r\n }\r\n });\r\n if (!isAfter || updatedCount) {\r\n trigger(Renderable, \"drag\".concat(eventAffix).concat(eventType));\r\n }\r\n // stop gesto condition\r\n var isForceEnd = prevGesto !== moveable[gestoType] || forceEndedCount === eventOperations.length;\r\n if (isEnd || isDragStop || isForceEnd) {\r\n moveable.state.gestos = {};\r\n if (moveable.moveables) {\r\n moveable.moveables.forEach(function (childMoveable) {\r\n childMoveable.state.gestos = {};\r\n });\r\n }\r\n ables.forEach(function (able) {\r\n able.unset && able.unset(moveable);\r\n });\r\n }\r\n if (isStart && !isForceEnd && !isRequest && updatedCount && moveable.props.preventDefault) {\r\n e === null || e === void 0 ? void 0 : e.preventDefault();\r\n }\r\n if (moveable.isUnmounted || isForceEnd) {\r\n return false;\r\n }\r\n if ((!isStart && updatedCount && !requestInstant) || isEnd) {\r\n var flushSync = moveable.props.flushSync || defaultSync;\r\n flushSync(function () {\r\n moveable.updateRect(isEnd ? eventType : \"\", true, false);\r\n moveable.forceUpdate();\r\n });\r\n }\r\n if (!isStart && !isEnd && !isAfter && updatedCount && !requestInstant) {\r\n triggerAble(moveable, moveableAbles, eventOperations, eventAffix, eventType + \"After\", e);\r\n }\r\n return true;\r\n}\r\nfunction checkMoveableTarget(moveable) {\r\n return function (e) {\r\n var _a;\r\n var eventTarget = e.inputEvent.target;\r\n var areaElement = moveable.areaElement;\r\n var dragTargetElement = moveable._dragTarget;\r\n if (!dragTargetElement || ((_a = moveable.controlGesto) === null || _a === void 0 ? void 0 : _a.isFlag())) {\r\n return false;\r\n }\r\n return eventTarget === dragTargetElement\r\n || dragTargetElement.contains(eventTarget)\r\n || eventTarget === areaElement\r\n || (!moveable.isMoveableElement(eventTarget) && !moveable.controlBox.contains(eventTarget))\r\n || hasClass(eventTarget, \"moveable-area\")\r\n || hasClass(eventTarget, \"moveable-padding\")\r\n || hasClass(eventTarget, \"moveable-edgeDraggable\");\r\n };\r\n}\r\nfunction getTargetAbleGesto(moveable, moveableTarget, eventAffix) {\r\n var controlBox = moveable.controlBox;\r\n var targets = [];\r\n var props = moveable.props;\r\n var dragArea = props.dragArea;\r\n var target = moveable.state.target;\r\n var dragTarget = props.dragTarget;\r\n targets.push(controlBox);\r\n if (!dragArea || dragTarget) {\r\n targets.push(moveableTarget);\r\n }\r\n if (!dragArea && dragTarget && target && moveableTarget !== target && props.dragTargetSelf) {\r\n targets.push(target);\r\n }\r\n return getAbleGesto(moveable, targets, \"targetAbles\", eventAffix, {\r\n dragStart: checkMoveableTarget(moveable),\r\n pinchStart: checkMoveableTarget(moveable),\r\n });\r\n}\r\nfunction getAbleGesto(moveable, target, ableType, eventAffix, conditionFunctions) {\r\n if (conditionFunctions === void 0) { conditionFunctions = {}; }\r\n var isTargetAbles = ableType === \"targetAbles\";\r\n var _a = moveable.props, pinchOutside = _a.pinchOutside, pinchThreshold = _a.pinchThreshold, preventClickEventOnDrag = _a.preventClickEventOnDrag, preventClickDefault = _a.preventClickDefault, checkInput = _a.checkInput, dragFocusedInput = _a.dragFocusedInput, _b = _a.preventDefault, preventDefault = _b === void 0 ? true : _b, dragContaienrOption = _a.dragContainer;\r\n var dragContainer = getRefTarget(dragContaienrOption, true);\r\n var options = {\r\n preventDefault: preventDefault,\r\n preventRightClick: true,\r\n preventWheelClick: true,\r\n container: dragContainer || getWindow(moveable.getControlBoxElement()),\r\n pinchThreshold: pinchThreshold,\r\n pinchOutside: pinchOutside,\r\n preventClickEventOnDrag: isTargetAbles ? preventClickEventOnDrag : false,\r\n preventClickEventOnDragStart: isTargetAbles ? preventClickDefault : false,\r\n preventClickEventByCondition: isTargetAbles ? null : function (e) {\r\n return moveable.controlBox.contains(e.target);\r\n },\r\n checkInput: isTargetAbles ? checkInput : false,\r\n dragFocusedInput: dragFocusedInput,\r\n };\r\n var gesto = new Gesto(target, options);\r\n var isControl = eventAffix === \"Control\";\r\n [\"drag\", \"pinch\"].forEach(function (eventOperation) {\r\n [\"Start\", \"\", \"End\"].forEach(function (eventType) {\r\n gesto.on(\"\".concat(eventOperation).concat(eventType), function (e) {\r\n var _a;\r\n var eventName = e.eventType;\r\n var isPinchScheduled = eventOperation === \"drag\" && e.isPinch;\r\n if (conditionFunctions[eventName] && !conditionFunctions[eventName](e)) {\r\n e.stop();\r\n return;\r\n }\r\n if (isPinchScheduled) {\r\n return;\r\n }\r\n var eventOperations = eventOperation === \"drag\" ? [eventOperation] : [\"drag\", eventOperation];\r\n var moveableAbles = __spreadArray([], __read(moveable[ableType]), false);\r\n var result = triggerAble(moveable, moveableAbles, eventOperations, eventAffix, eventType, e);\r\n if (!result) {\r\n e.stop();\r\n }\r\n else if (moveable.props.stopPropagation || (eventType === \"Start\" && isControl)) {\r\n (_a = e === null || e === void 0 ? void 0 : e.inputEvent) === null || _a === void 0 ? void 0 : _a.stopPropagation();\r\n }\r\n });\r\n });\r\n });\r\n return gesto;\r\n}\n\nvar EventManager = /*#__PURE__*/ (function () {\r\n function EventManager(target, moveable, eventName) {\r\n var _this = this;\r\n this.target = target;\r\n this.moveable = moveable;\r\n this.eventName = eventName;\r\n this.ables = [];\r\n this._onEvent = function (e) {\r\n var eventName = _this.eventName;\r\n var moveable = _this.moveable;\r\n if (moveable.state.disableNativeEvent) {\r\n return;\r\n }\r\n _this.ables.forEach(function (able) {\r\n able[eventName](moveable, {\r\n inputEvent: e,\r\n });\r\n });\r\n };\r\n target.addEventListener(eventName.toLowerCase(), this._onEvent);\r\n }\r\n EventManager.prototype.setAbles = function (ables) {\r\n this.ables = ables;\r\n };\r\n EventManager.prototype.destroy = function () {\r\n this.target.removeEventListener(this.eventName.toLowerCase(), this._onEvent);\r\n this.target = null;\r\n this.moveable = null;\r\n };\r\n return EventManager;\r\n}());\n\nfunction calculateMatrixStack(target, container, rootContainer, isAbsolute3d) {\r\n var _a;\r\n if (rootContainer === void 0) { rootContainer = container; }\r\n var _b = getMatrixStackInfo(target, container), matrixes = _b.matrixes, is3d = _b.is3d, prevTargetMatrix = _b.targetMatrix, transformOrigin = _b.transformOrigin, targetOrigin = _b.targetOrigin, offsetContainer = _b.offsetContainer, hasFixed = _b.hasFixed, containerZoom = _b.zoom; // prevMatrix\r\n var _c = getCachedMatrixContainerInfo(offsetContainer, rootContainer), rootMatrixes = _c.matrixes, isRoot3d = _c.is3d, offsetRootContainer = _c.offsetContainer, rootZoom = _c.zoom; // prevRootMatrix\r\n // if (rootContainer === document.body) {\r\n // console.log(offsetContainer, rootContainer, rootMatrixes);\r\n // }\r\n var isNext3d = isAbsolute3d || isRoot3d || is3d;\r\n var n = isNext3d ? 4 : 3;\r\n var isSVGGraphicElement = target.tagName.toLowerCase() !== \"svg\" && \"ownerSVGElement\" in target;\r\n var targetMatrix = prevTargetMatrix;\r\n // let allMatrix = prevMatrix ? convertDimension(prevMatrix, prevN!, n) : createIdentityMatrix(n);\r\n // let rootMatrix = prevRootMatrix ? convertDimension(prevRootMatrix, prevN!, n) : createIdentityMatrix(n);\r\n // let beforeMatrix = prevMatrix ? convertDimension(prevMatrix, prevN!, n) : createIdentityMatrix(n);\r\n var allMatrix = createIdentityMatrix(n);\r\n var rootMatrix = createIdentityMatrix(n);\r\n var beforeMatrix = createIdentityMatrix(n);\r\n var offsetMatrix = createIdentityMatrix(n);\r\n var length = matrixes.length;\r\n var nextRootMatrixes = rootMatrixes.map(function (info) {\r\n return __assign(__assign({}, info), { matrix: info.matrix ? __spreadArray([], __read(info.matrix), false) : undefined });\r\n }).reverse();\r\n matrixes.reverse();\r\n if (!is3d && isNext3d) {\r\n targetMatrix = convertDimension(targetMatrix, 3, 4);\r\n convert3DMatrixes(matrixes);\r\n }\r\n if (!isRoot3d && isNext3d) {\r\n convert3DMatrixes(nextRootMatrixes);\r\n }\r\n // rootMatrix = (...) -> container -> offset -> absolute -> offset -> absolute(targetMatrix)\r\n // rootMatrixBeforeOffset = lastOffsetMatrix -> (...) -> container\r\n // beforeMatrix = (... -> container -> offset -> absolute) -> offset -> absolute(targetMatrix)\r\n // offsetMatrix = (... -> container -> offset -> absolute -> offset) -> absolute(targetMatrix)\r\n nextRootMatrixes.forEach(function (info) {\r\n rootMatrix = multiply(rootMatrix, info.matrix, n);\r\n });\r\n var originalRootContainer = rootContainer || getDocumentBody(target);\r\n var endContainer = ((_a = nextRootMatrixes[0]) === null || _a === void 0 ? void 0 : _a.target)\r\n || getOffsetInfo(originalRootContainer, originalRootContainer, true).offsetParent;\r\n var rootMatrixBeforeOffset = nextRootMatrixes.slice(1).reduce(function (matrix, info) {\r\n return multiply(matrix, info.matrix, n);\r\n }, createIdentityMatrix(n));\r\n matrixes.forEach(function (info, i) {\r\n if (length - 2 === i) {\r\n // length - 3\r\n beforeMatrix = allMatrix.slice();\r\n }\r\n if (length - 1 === i) {\r\n // length - 2\r\n offsetMatrix = allMatrix.slice();\r\n }\r\n // calculate for SVGElement\r\n if (!info.matrix) {\r\n var nextInfo = matrixes[i + 1];\r\n var offset = getSVGOffset(info, nextInfo, endContainer, n, multiply(rootMatrixBeforeOffset, allMatrix, n));\r\n info.matrix = createOriginMatrix(offset, n);\r\n }\r\n allMatrix = multiply(allMatrix, info.matrix, n);\r\n });\r\n var isMatrix3d = !isSVGGraphicElement && is3d;\r\n if (!targetMatrix) {\r\n targetMatrix = createIdentityMatrix(isMatrix3d ? 4 : 3);\r\n }\r\n var targetTransform = makeMatrixCSS(isSVGGraphicElement && targetMatrix.length === 16\r\n ? convertDimension(targetMatrix, 4, 3) : targetMatrix, isMatrix3d);\r\n var originalRootMatrix = rootMatrix;\r\n rootMatrix = ignoreDimension(rootMatrix, n, n);\r\n return {\r\n hasZoom: containerZoom !== 1 || rootZoom !== 1,\r\n hasFixed: hasFixed,\r\n matrixes: matrixes,\r\n rootMatrix: rootMatrix,\r\n originalRootMatrix: originalRootMatrix,\r\n beforeMatrix: beforeMatrix,\r\n offsetMatrix: offsetMatrix,\r\n allMatrix: allMatrix,\r\n targetMatrix: targetMatrix,\r\n targetTransform: targetTransform,\r\n inlineTransform: target.style.transform,\r\n transformOrigin: transformOrigin,\r\n targetOrigin: targetOrigin,\r\n is3d: isNext3d,\r\n offsetContainer: offsetContainer,\r\n offsetRootContainer: offsetRootContainer,\r\n };\r\n}\n\nfunction calculateElementInfo(target, container, rootContainer, isAbsolute3d) {\r\n if (rootContainer === void 0) { rootContainer = container; }\r\n var width = 0;\r\n var height = 0;\r\n var rotation = 0;\r\n var allResult = {};\r\n var sizes = getSize(target);\r\n if (target) {\r\n width = sizes.offsetWidth;\r\n height = sizes.offsetHeight;\r\n }\r\n if (target) {\r\n var result = calculateMatrixStack(target, container, rootContainer, isAbsolute3d);\r\n var position = calculateElementPosition(result.allMatrix, result.transformOrigin, width, height);\r\n allResult = __assign(__assign({}, result), position);\r\n var rotationPosition = calculateElementPosition(result.allMatrix, [50, 50], 100, 100);\r\n rotation = getRotationRad([rotationPosition.pos1, rotationPosition.pos2], rotationPosition.direction);\r\n }\r\n var n = isAbsolute3d ? 4 : 3;\r\n return __assign(__assign(__assign({ hasZoom: false, width: width, height: height, rotation: rotation }, sizes), { originalRootMatrix: createIdentityMatrix(n), rootMatrix: createIdentityMatrix(n), beforeMatrix: createIdentityMatrix(n), offsetMatrix: createIdentityMatrix(n), allMatrix: createIdentityMatrix(n), targetMatrix: createIdentityMatrix(n), targetTransform: \"\", inlineTransform: \"\", transformOrigin: [0, 0], targetOrigin: [0, 0], is3d: !!isAbsolute3d, left: 0, top: 0, right: 0, bottom: 0, origin: [0, 0], pos1: [0, 0], pos2: [0, 0], pos3: [0, 0], pos4: [0, 0], direction: 1, hasFixed: false, offsetContainer: null, offsetRootContainer: null, matrixes: [] }), allResult);\r\n}\r\nfunction getElementInfo(target, container, rootContainer) {\r\n if (rootContainer === void 0) { rootContainer = container; }\r\n return calculateElementInfo(target, container, rootContainer, true);\r\n}\n\nfunction getMoveableTargetInfo(moveableElement, target, container, parentContainer, rootContainer, requestStyles) {\r\n if (requestStyles === void 0) { requestStyles = []; }\r\n var beforeDirection = 1;\r\n var beforeOrigin = [0, 0];\r\n var targetClientRect = resetClientRect();\r\n var moveableClientRect = resetClientRect();\r\n var containerClientRect = resetClientRect();\r\n var rootContainerClientRect = resetClientRect();\r\n var offsetDelta = [0, 0];\r\n var style = {};\r\n var result = calculateElementInfo(target, container, rootContainer, true);\r\n if (target) {\r\n var getStyle_1 = getCachedStyle(target);\r\n requestStyles.forEach(function (name) {\r\n style[name] = getStyle_1(name);\r\n });\r\n var n = result.is3d ? 4 : 3;\r\n var beforePosition = calculateElementPosition(result.offsetMatrix, plus(result.transformOrigin, getOrigin(result.targetMatrix, n)), result.width, result.height);\r\n beforeDirection = beforePosition.direction;\r\n beforeOrigin = plus(beforePosition.origin, [beforePosition.left - result.left, beforePosition.top - result.top]);\r\n rootContainerClientRect = getClientRect(result.offsetRootContainer);\r\n var offsetContainer = getOffsetInfo(parentContainer, parentContainer, true).offsetParent\r\n || result.offsetRootContainer;\r\n if (result.hasZoom) {\r\n var absoluteTargetPosition = calculateElementPosition(multiply(result.originalRootMatrix, result.allMatrix), result.transformOrigin, result.width, result.height);\r\n var absoluteContainerPosition = calculateElementPosition(result.originalRootMatrix, getTransformOriginArray(getCachedStyle(offsetContainer)(\"transformOrigin\")).map(function (pos) { return parseFloat(pos); }), offsetContainer.offsetWidth, offsetContainer.offsetHeight);\r\n targetClientRect = getClientRectByPosition(absoluteTargetPosition, rootContainerClientRect);\r\n containerClientRect = getClientRectByPosition(absoluteContainerPosition, rootContainerClientRect, offsetContainer, true);\r\n if (moveableElement) {\r\n var left = absoluteTargetPosition.left;\r\n var top_1 = absoluteTargetPosition.top;\r\n moveableClientRect = getClientRectByPosition({\r\n left: left,\r\n top: top_1,\r\n bottom: top_1,\r\n right: top_1,\r\n }, rootContainerClientRect);\r\n }\r\n }\r\n else {\r\n targetClientRect = getClientRect(target);\r\n containerClientRect = getCachedClientRect(offsetContainer);\r\n if (moveableElement) {\r\n moveableClientRect = getClientRect(moveableElement);\r\n }\r\n var containerClientRectLeft = containerClientRect.left, containerClientRectTop = containerClientRect.top, containterClientLeft = containerClientRect.clientLeft, containerClientTop = containerClientRect.clientTop;\r\n var clientDelta = [\r\n targetClientRect.left - containerClientRectLeft,\r\n targetClientRect.top - containerClientRectTop,\r\n ];\r\n offsetDelta = minus(calculateInversePosition(result.rootMatrix, clientDelta, 4), [containterClientLeft + result.left, containerClientTop + result.top]);\r\n }\r\n }\r\n return __assign({ targetClientRect: targetClientRect, containerClientRect: containerClientRect, moveableClientRect: moveableClientRect, rootContainerClientRect: rootContainerClientRect, beforeDirection: beforeDirection, beforeOrigin: beforeOrigin, originalBeforeOrigin: beforeOrigin, target: target, style: style, offsetDelta: offsetDelta }, result);\r\n}\n\nfunction getPersistState(rect) {\r\n var pos1 = rect.pos1, pos2 = rect.pos2, pos3 = rect.pos3, pos4 = rect.pos4;\r\n if (!pos1 || !pos2 || !pos3 || !pos4) {\r\n return null;\r\n }\r\n var minPos = getMinMaxs([pos1, pos2, pos3, pos4]);\r\n var posDelta = [minPos.minX, minPos.minY];\r\n var origin = minus(rect.origin, posDelta);\r\n pos1 = minus(pos1, posDelta);\r\n pos2 = minus(pos2, posDelta);\r\n pos3 = minus(pos3, posDelta);\r\n pos4 = minus(pos4, posDelta);\r\n return __assign(__assign({}, rect), { left: rect.left, top: rect.top, posDelta: posDelta, pos1: pos1, pos2: pos2, pos3: pos3, pos4: pos4, origin: origin, beforeOrigin: origin, \r\n // originalBeforeOrigin: origin,\r\n isPersisted: true });\r\n}\n\nvar MoveableManager = /*#__PURE__*/ (function (_super) {\r\n __extends(MoveableManager, _super);\r\n function MoveableManager() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.state = __assign({ container: null, gestos: {}, renderLines: [\r\n [[0, 0], [0, 0]],\r\n [[0, 0], [0, 0]],\r\n [[0, 0], [0, 0]],\r\n [[0, 0], [0, 0]],\r\n ], renderPoses: [[0, 0], [0, 0], [0, 0], [0, 0]], disableNativeEvent: false, posDelta: [0, 0] }, getMoveableTargetInfo(null));\r\n _this.renderState = {};\r\n _this.enabledAbles = [];\r\n _this.targetAbles = [];\r\n _this.controlAbles = [];\r\n _this.rotation = 0;\r\n _this.scale = [1, 1];\r\n _this.isMoveableMounted = false;\r\n _this.isUnmounted = false;\r\n _this.events = {\r\n \"mouseEnter\": null,\r\n \"mouseLeave\": null,\r\n };\r\n _this._emitter = new EventEmitter();\r\n _this._prevOriginalDragTarget = null;\r\n _this._originalDragTarget = null;\r\n _this._prevDragTarget = null;\r\n _this._dragTarget = null;\r\n _this._prevPropTarget = null;\r\n _this._propTarget = null;\r\n _this._prevDragArea = false;\r\n _this._isPropTargetChanged = false;\r\n _this._hasFirstTarget = false;\r\n _this._reiszeObserver = null;\r\n _this._observerId = 0;\r\n _this._mutationObserver = null;\r\n _this._rootContainer = null;\r\n _this._viewContainer = null;\r\n _this._viewClassNames = [];\r\n _this._store = {};\r\n _this.checkUpdateRect = function () {\r\n if (_this.isDragging()) {\r\n return;\r\n }\r\n var parentMoveable = _this.props.parentMoveable;\r\n if (parentMoveable) {\r\n parentMoveable.checkUpdateRect();\r\n return;\r\n }\r\n cancelAnimationFrame(_this._observerId);\r\n _this._observerId = requestAnimationFrame(function () {\r\n if (_this.isDragging()) {\r\n return;\r\n }\r\n _this.updateRect();\r\n });\r\n };\r\n _this._onPreventClick = function (e) {\r\n e.stopPropagation();\r\n e.preventDefault();\r\n // removeEvent(window, \"click\", this._onPreventClick, true);\r\n };\r\n return _this;\r\n }\r\n MoveableManager.prototype.render = function () {\r\n var props = this.props;\r\n var state = this.getState();\r\n var parentPosition = props.parentPosition, className = props.className, propsTarget = props.target, zoom = props.zoom, cspNonce = props.cspNonce, translateZ = props.translateZ, ControlBoxElement = props.cssStyled, groupable = props.groupable, linePadding = props.linePadding, controlPadding = props.controlPadding;\r\n this._checkUpdateRootContainer();\r\n this.checkUpdate();\r\n this.updateRenderPoses();\r\n var _a = __read(parentPosition || [0, 0], 2), parentLeft = _a[0], parentTop = _a[1];\r\n var left = state.left, top = state.top, stateTarget = state.target, direction = state.direction, hasFixed = state.hasFixed, offsetDelta = state.offsetDelta;\r\n var groupTargets = props.targets;\r\n var isDragging = this.isDragging();\r\n var ableAttributes = {};\r\n this.getEnabledAbles().forEach(function (able) {\r\n ableAttributes[\"data-able-\".concat(able.name.toLowerCase())] = true;\r\n });\r\n var ableClassName = this._getAbleClassName();\r\n var isDisplay = (groupTargets && groupTargets.length && (stateTarget || groupable))\r\n || propsTarget\r\n || (!this._hasFirstTarget && this.state.isPersisted);\r\n var isVisible = this.controlBox || this.props.firstRenderState || this.props.persistData;\r\n var translate = [left - parentLeft, top - parentTop];\r\n if (!groupable && props.useAccuratePosition) {\r\n translate[0] += offsetDelta[0];\r\n translate[1] += offsetDelta[1];\r\n }\r\n var style = {\r\n \"position\": hasFixed ? \"fixed\" : \"absolute\",\r\n \"display\": isDisplay ? \"block\" : \"none\",\r\n \"visibility\": isVisible ? \"visible\" : \"hidden\",\r\n \"transform\": \"translate3d(\".concat(translate[0], \"px, \").concat(translate[1], \"px, \").concat(translateZ, \")\"),\r\n \"--zoom\": zoom,\r\n \"--zoompx\": \"\".concat(zoom, \"px\"),\r\n };\r\n if (linePadding) {\r\n style[\"--moveable-line-padding\"] = linePadding;\r\n }\r\n if (controlPadding) {\r\n style[\"--moveable-control-padding\"] = controlPadding;\r\n }\r\n return (React.createElement(ControlBoxElement, __assign({ cspNonce: cspNonce, ref: ref(this, \"controlBox\"), className: \"\".concat(prefix(\"control-box\", direction === -1 ? \"reverse\" : \"\", isDragging ? \"dragging\" : \"\"), \" \").concat(ableClassName, \" \").concat(className) }, ableAttributes, { onClick: this._onPreventClick, style: style }),\r\n this.renderAbles(),\r\n this._renderLines()));\r\n };\r\n MoveableManager.prototype.componentDidMount = function () {\r\n this.isMoveableMounted = true;\r\n this.isUnmounted = false;\r\n var props = this.props;\r\n var parentMoveable = props.parentMoveable, container = props.container;\r\n this._checkUpdateRootContainer();\r\n this._checkUpdateViewContainer();\r\n this._updateTargets();\r\n this._updateNativeEvents();\r\n this._updateEvents();\r\n this.updateCheckInput();\r\n this._updateObserver(this.props);\r\n if (!container && !parentMoveable && !this.state.isPersisted) {\r\n this.updateRect(\"\", false, false);\r\n this.forceUpdate();\r\n }\r\n };\r\n MoveableManager.prototype.componentDidUpdate = function (prevProps) {\r\n this._checkUpdateRootContainer();\r\n this._checkUpdateViewContainer();\r\n this._updateNativeEvents();\r\n this._updateTargets();\r\n this._updateEvents();\r\n this.updateCheckInput();\r\n this._updateObserver(prevProps);\r\n };\r\n MoveableManager.prototype.componentWillUnmount = function () {\r\n var _a, _b;\r\n this.isMoveableMounted = false;\r\n this.isUnmounted = true;\r\n this._emitter.off();\r\n (_a = this._reiszeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();\r\n (_b = this._mutationObserver) === null || _b === void 0 ? void 0 : _b.disconnect();\r\n var viewContainer = this._viewContainer;\r\n if (viewContainer) {\r\n this._changeAbleViewClassNames([]);\r\n }\r\n unsetGesto(this, false);\r\n unsetGesto(this, true);\r\n var events = this.events;\r\n for (var name_1 in events) {\r\n var manager = events[name_1];\r\n manager && manager.destroy();\r\n }\r\n };\r\n MoveableManager.prototype.getTargets = function () {\r\n var target = this.props.target;\r\n return target ? [target] : [];\r\n };\r\n /**\r\n * Get the able used in MoveableManager.\r\n * @method Moveable#getAble\r\n * @param - able name\r\n */\r\n MoveableManager.prototype.getAble = function (ableName) {\r\n var ables = this.props.ables || [];\r\n return find(ables, function (able) { return able.name === ableName; });\r\n };\r\n MoveableManager.prototype.getContainer = function () {\r\n var _a = this.props, parentMoveable = _a.parentMoveable, wrapperMoveable = _a.wrapperMoveable, container = _a.container;\r\n return container\r\n || (wrapperMoveable && wrapperMoveable.getContainer())\r\n || (parentMoveable && parentMoveable.getContainer())\r\n || this.controlBox.parentElement;\r\n };\r\n /**\r\n * Returns the element of the control box.\r\n * @method Moveable#getControlBoxElement\r\n */\r\n MoveableManager.prototype.getControlBoxElement = function () {\r\n return this.controlBox;\r\n };\r\n /**\r\n * Target element to be dragged in moveable\r\n * @method Moveable#getDragElement\r\n */\r\n MoveableManager.prototype.getDragElement = function () {\r\n return this._dragTarget;\r\n };\r\n /**\r\n * Check if the target is an element included in the moveable.\r\n * @method Moveable#isMoveableElement\r\n * @param - the target\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * window.addEventListener(\"click\", e => {\r\n * if (!moveable.isMoveableElement(e.target)) {\r\n * moveable.target = e.target;\r\n * }\r\n * });\r\n */\r\n MoveableManager.prototype.isMoveableElement = function (target) {\r\n var _a;\r\n return target && (((_a = target.getAttribute) === null || _a === void 0 ? void 0 : _a.call(target, \"class\")) || \"\").indexOf(PREFIX) > -1;\r\n };\r\n /**\r\n * You can drag start the Moveable through the external `MouseEvent`or `TouchEvent`. (Angular: ngDragStart)\r\n * @method Moveable#dragStart\r\n * @param - external `MouseEvent`or `TouchEvent`\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * document.body.addEventListener(\"mousedown\", e => {\r\n * if (!moveable.isMoveableElement(e.target)) {\r\n * moveable.dragStart(e);\r\n * }\r\n * });\r\n */\r\n MoveableManager.prototype.dragStart = function (e) {\r\n var targetGesto = this.targetGesto;\r\n var controlGesto = this.controlGesto;\r\n if (targetGesto && checkMoveableTarget(this)({ inputEvent: e })) {\r\n if (!targetGesto.isFlag()) {\r\n targetGesto.triggerDragStart(e);\r\n }\r\n }\r\n else if (controlGesto && this.isMoveableElement(e.target)) {\r\n if (!controlGesto.isFlag()) {\r\n controlGesto.triggerDragStart(e);\r\n }\r\n }\r\n return this;\r\n };\r\n /**\r\n * Hit test an element or rect on a moveable target.\r\n * (100% = 100)\r\n * @method Moveable#hitTest\r\n * @param - element or rect to test\r\n * @return - Get hit test rate (rate > 0 is hitted)\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * document.body.addEventListener(\"mousedown\", e => {\r\n * if (moveable.hitTest(e.target) > 0) {\r\n * console.log(\"hiited\");\r\n * }\r\n * });\r\n */\r\n MoveableManager.prototype.hitTest = function (el) {\r\n var _a = this.state, target = _a.target, pos1 = _a.pos1, pos2 = _a.pos2, pos3 = _a.pos3, pos4 = _a.pos4, targetClientRect = _a.targetClientRect;\r\n if (!target) {\r\n return 0;\r\n }\r\n var rect;\r\n if (isNode(el)) {\r\n var clientRect = el.getBoundingClientRect();\r\n rect = {\r\n left: clientRect.left,\r\n top: clientRect.top,\r\n width: clientRect.width,\r\n height: clientRect.height,\r\n };\r\n }\r\n else {\r\n rect = __assign({ width: 0, height: 0 }, el);\r\n }\r\n var rectLeft = rect.left, rectTop = rect.top, rectWidth = rect.width, rectHeight = rect.height;\r\n var points = fitPoints([pos1, pos2, pos4, pos3], targetClientRect);\r\n var size = getOverlapSize(points, [\r\n [rectLeft, rectTop],\r\n [rectLeft + rectWidth, rectTop],\r\n [rectLeft + rectWidth, rectTop + rectHeight],\r\n [rectLeft, rectTop + rectHeight],\r\n ]);\r\n var totalSize = getAreaSize(points);\r\n if (!size || !totalSize) {\r\n return 0;\r\n }\r\n return Math.min(100, size / totalSize * 100);\r\n };\r\n /**\r\n * Whether the coordinates are inside Moveable\r\n * @method Moveable#isInside\r\n * @param - x coordinate\r\n * @param - y coordinate\r\n * @return - True if the coordinate is in moveable or false\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * document.body.addEventListener(\"mousedown\", e => {\r\n * if (moveable.isInside(e.clientX, e.clientY)) {\r\n * console.log(\"inside\");\r\n * }\r\n * });\r\n */\r\n MoveableManager.prototype.isInside = function (clientX, clientY) {\r\n var _a = this.state, target = _a.target, pos1 = _a.pos1, pos2 = _a.pos2, pos3 = _a.pos3, pos4 = _a.pos4, targetClientRect = _a.targetClientRect;\r\n if (!target) {\r\n return false;\r\n }\r\n return isInside([clientX, clientY], fitPoints([pos1, pos2, pos4, pos3], targetClientRect));\r\n };\r\n /**\r\n * If the width, height, left, and top of all elements change, update the shape of the moveable.\r\n * @method Moveable#updateRect\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * window.addEventListener(\"resize\", e => {\r\n * moveable.updateRect();\r\n * });\r\n */\r\n MoveableManager.prototype.updateRect = function (type, isTarget, isSetState) {\r\n if (isSetState === void 0) { isSetState = true; }\r\n var props = this.props;\r\n var isSingle = !props.parentPosition && !props.wrapperMoveable;\r\n if (isSingle) {\r\n setStoreCache(true);\r\n }\r\n var parentMoveable = props.parentMoveable;\r\n var state = this.state;\r\n var target = (state.target || props.target);\r\n var container = this.getContainer();\r\n var rootContainer = parentMoveable\r\n ? parentMoveable._rootContainer\r\n : this._rootContainer;\r\n var nextState = getMoveableTargetInfo(this.controlBox, target, container, container, rootContainer || container, this._getRequestStyles());\r\n if (!target && this._hasFirstTarget && props.persistData) {\r\n var persistState = getPersistState(props.persistData);\r\n for (var name_2 in persistState) {\r\n nextState[name_2] = persistState[name_2];\r\n }\r\n }\r\n if (isSingle) {\r\n setStoreCache();\r\n }\r\n this.updateState(nextState, parentMoveable ? false : isSetState);\r\n };\r\n /**\r\n * Check if the moveable state is being dragged.\r\n * @method Moveable#isDragging\r\n * @param - If you want to check if able is dragging, specify ableName.\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * // false\r\n * console.log(moveable.isDragging());\r\n *\r\n * moveable.on(\"drag\", () => {\r\n * // true\r\n * console.log(moveable.isDragging());\r\n * });\r\n */\r\n MoveableManager.prototype.isDragging = function (ableName) {\r\n var _a, _b;\r\n var targetGesto = this.targetGesto;\r\n var controlGesto = this.controlGesto;\r\n if (targetGesto === null || targetGesto === void 0 ? void 0 : targetGesto.isFlag()) {\r\n if (!ableName) {\r\n return true;\r\n }\r\n var data = targetGesto.getEventData();\r\n return !!((_a = data[ableName]) === null || _a === void 0 ? void 0 : _a.isEventStart);\r\n }\r\n if (controlGesto === null || controlGesto === void 0 ? void 0 : controlGesto.isFlag()) {\r\n if (!ableName) {\r\n return true;\r\n }\r\n var data = controlGesto.getEventData();\r\n return !!((_b = data[ableName]) === null || _b === void 0 ? void 0 : _b.isEventStart);\r\n }\r\n return false;\r\n };\r\n /**\r\n * If the width, height, left, and top of the only target change, update the shape of the moveable.\r\n * Use `.updateRect()` method\r\n * @method Moveable#updateTarget\r\n * @deprecated\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.updateTarget();\r\n */\r\n MoveableManager.prototype.updateTarget = function (type) {\r\n this.updateRect(type, true);\r\n };\r\n /**\r\n * You can get the vertex information, position and offset size information of the target based on the container.\r\n * @method Moveable#getRect\r\n * @return - The Rect Info\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * const rectInfo = moveable.getRect();\r\n */\r\n MoveableManager.prototype.getRect = function () {\r\n var state = this.state;\r\n var poses = getAbsolutePosesByState(this.state);\r\n var _a = __read(poses, 4), pos1 = _a[0], pos2 = _a[1], pos3 = _a[2], pos4 = _a[3];\r\n var rect = getRect(poses);\r\n var offsetWidth = state.width, offsetHeight = state.height;\r\n var width = rect.width, height = rect.height, left = rect.left, top = rect.top;\r\n var statePos = [state.left, state.top];\r\n var origin = plus(statePos, state.origin);\r\n var beforeOrigin = plus(statePos, state.beforeOrigin);\r\n var transformOrigin = state.transformOrigin;\r\n return {\r\n width: width,\r\n height: height,\r\n left: left,\r\n top: top,\r\n pos1: pos1,\r\n pos2: pos2,\r\n pos3: pos3,\r\n pos4: pos4,\r\n offsetWidth: offsetWidth,\r\n offsetHeight: offsetHeight,\r\n beforeOrigin: beforeOrigin,\r\n origin: origin,\r\n transformOrigin: transformOrigin,\r\n rotation: this.getRotation(),\r\n };\r\n };\r\n /**\r\n * Get a manager that manages the moveable's state and props.\r\n * @method Moveable#getManager\r\n * @return - The Rect Info\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * const manager = moveable.getManager(); // real moveable class instance\r\n */\r\n MoveableManager.prototype.getManager = function () {\r\n return this;\r\n };\r\n /**\r\n * You can stop the dragging currently in progress through a method from outside.\r\n * @method Moveable#stopDrag\r\n * @return - The Rect Info\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.stopDrag();\r\n */\r\n MoveableManager.prototype.stopDrag = function (type) {\r\n if (!type || type === \"target\") {\r\n var gesto = this.targetGesto;\r\n if ((gesto === null || gesto === void 0 ? void 0 : gesto.isIdle()) === false) {\r\n unsetAbles(this, false);\r\n }\r\n gesto === null || gesto === void 0 ? void 0 : gesto.stop();\r\n }\r\n if (!type || type === \"control\") {\r\n var gesto = this.controlGesto;\r\n if ((gesto === null || gesto === void 0 ? void 0 : gesto.isIdle()) === false) {\r\n unsetAbles(this, true);\r\n }\r\n gesto === null || gesto === void 0 ? void 0 : gesto.stop();\r\n }\r\n };\r\n MoveableManager.prototype.getRotation = function () {\r\n var _a = this.state, pos1 = _a.pos1, pos2 = _a.pos2, direction = _a.direction;\r\n return getAbsoluteRotation(pos1, pos2, direction);\r\n };\r\n /**\r\n * Request able through a method rather than an event.\r\n * At the moment of execution, requestStart is executed,\r\n * and then request and requestEnd can be executed through Requester.\r\n * @method Moveable#request\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Draggable.html#request|Draggable Requester}\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Resizable.html#request|Resizable Requester}\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Scalable.html#request|Scalable Requester}\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Rotatable.html#request|Rotatable Requester}\r\n * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.OriginDraggable.html#request|OriginDraggable Requester}\r\n * @param - ableName\r\n * @param - request to be able params.\r\n * @param - If isInstant is true, request and requestEnd are executed immediately.\r\n * @return - Able Requester. If there is no request in able, nothing will work.\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * // Instantly Request (requestStart - request - requestEnd)\r\n * moveable.request(\"draggable\", { deltaX: 10, deltaY: 10 }, true);\r\n *\r\n * // Start move\r\n * const requester = moveable.request(\"draggable\");\r\n * requester.request({ deltaX: 10, deltaY: 10 });\r\n * requester.request({ deltaX: 10, deltaY: 10 });\r\n * requester.request({ deltaX: 10, deltaY: 10 });\r\n * requester.requestEnd();\r\n */\r\n MoveableManager.prototype.request = function (ableName, param, isInstant) {\r\n if (param === void 0) { param = {}; }\r\n var self = this;\r\n var props = self.props;\r\n var manager = props.parentMoveable || props.wrapperMoveable || self;\r\n var allAbles = manager.props.ables;\r\n var groupable = props.groupable;\r\n var requsetAble = find(allAbles, function (able) { return able.name === ableName; });\r\n if (this.isDragging() || !requsetAble || !requsetAble.request) {\r\n return {\r\n request: function () {\r\n return this;\r\n },\r\n requestEnd: function () {\r\n return this;\r\n },\r\n };\r\n }\r\n var ableRequester = requsetAble.request(self);\r\n var requestInstant = isInstant || param.isInstant;\r\n var ableType = ableRequester.isControl ? \"controlAbles\" : \"targetAbles\";\r\n var eventAffix = \"\".concat((groupable ? \"Group\" : \"\")).concat(ableRequester.isControl ? \"Control\" : \"\");\r\n var moveableAbles = __spreadArray([], __read(manager[ableType]), false);\r\n var requester = {\r\n request: function (ableParam) {\r\n triggerAble(self, moveableAbles, [\"drag\"], eventAffix, \"\", __assign(__assign({}, ableRequester.request(ableParam)), { requestAble: ableName, isRequest: true }), requestInstant);\r\n return requester;\r\n },\r\n requestEnd: function () {\r\n triggerAble(self, moveableAbles, [\"drag\"], eventAffix, \"End\", __assign(__assign({}, ableRequester.requestEnd()), { requestAble: ableName, isRequest: true }), requestInstant);\r\n return requester;\r\n },\r\n };\r\n triggerAble(self, moveableAbles, [\"drag\"], eventAffix, \"Start\", __assign(__assign({}, ableRequester.requestStart(param)), { requestAble: ableName, isRequest: true }), requestInstant);\r\n return requestInstant ? requester.request(param).requestEnd() : requester;\r\n };\r\n /**\r\n * moveable is the top level that manages targets\r\n * `Single`: MoveableManager instance\r\n * `Group`: MoveableGroup instance\r\n * `IndividualGroup`: MoveableIndividaulGroup instance\r\n * Returns leaf target MoveableManagers.\r\n */\r\n MoveableManager.prototype.getMoveables = function () {\r\n return [this];\r\n };\r\n /**\r\n * Remove the Moveable object and the events.\r\n * @method Moveable#destroy\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n *\r\n * moveable.destroy();\r\n */\r\n MoveableManager.prototype.destroy = function () {\r\n this.componentWillUnmount();\r\n };\r\n MoveableManager.prototype.updateRenderPoses = function () {\r\n var state = this.getState();\r\n var props = this.props;\r\n var padding = props.padding;\r\n var originalBeforeOrigin = state.originalBeforeOrigin, transformOrigin = state.transformOrigin, allMatrix = state.allMatrix, is3d = state.is3d, pos1 = state.pos1, pos2 = state.pos2, pos3 = state.pos3, pos4 = state.pos4, stateLeft = state.left, stateTop = state.top, isPersisted = state.isPersisted;\r\n var zoom = props.zoom || 1;\r\n if (!padding && zoom <= 1) {\r\n state.renderPoses = [\r\n pos1,\r\n pos2,\r\n pos3,\r\n pos4,\r\n ];\r\n state.renderLines = [\r\n [pos1, pos2],\r\n [pos2, pos4],\r\n [pos4, pos3],\r\n [pos3, pos1],\r\n ];\r\n return;\r\n }\r\n var _a = getPaddingBox(padding || {}), left = _a.left, top = _a.top, bottom = _a.bottom, right = _a.right;\r\n var n = is3d ? 4 : 3;\r\n // const clipPathInfo = getClipPath(\r\n // props.target,\r\n // offsetWidth,\r\n // offsetHeight,\r\n // );\r\n // if (clipPathInfo) {\r\n // left -= Math.max(0, clipPathInfo.left);\r\n // top -= Math.max(0, clipPathInfo.top);\r\n // bottom -= Math.max(0, offsetHeight - clipPathInfo.bottom);\r\n // right -= Math.max(0, offsetWidth - clipPathInfo.right);\r\n // }\r\n var absoluteOrigin = [];\r\n if (isPersisted) {\r\n absoluteOrigin = transformOrigin;\r\n }\r\n else if (this.controlBox && props.groupable) {\r\n absoluteOrigin = originalBeforeOrigin;\r\n }\r\n else {\r\n absoluteOrigin = plus(originalBeforeOrigin, [stateLeft, stateTop]);\r\n }\r\n var nextMatrix = multiplies(n, createOriginMatrix(absoluteOrigin.map(function (v) { return -v; }), n), allMatrix, createOriginMatrix(transformOrigin, n));\r\n var renderPos1 = calculatePadding(nextMatrix, pos1, [-left, -top], n);\r\n var renderPos2 = calculatePadding(nextMatrix, pos2, [right, -top], n);\r\n var renderPos3 = calculatePadding(nextMatrix, pos3, [-left, bottom], n);\r\n var renderPos4 = calculatePadding(nextMatrix, pos4, [right, bottom], n);\r\n state.renderPoses = [\r\n renderPos1,\r\n renderPos2,\r\n renderPos3,\r\n renderPos4,\r\n ];\r\n state.renderLines = [\r\n [renderPos1, renderPos2],\r\n [renderPos2, renderPos4],\r\n [renderPos4, renderPos3],\r\n [renderPos3, renderPos1],\r\n ];\r\n if (zoom) {\r\n var zoomOffset = zoom / 2;\r\n state.renderLines = [\r\n [\r\n calculatePadding(nextMatrix, pos1, [-left - zoomOffset, -top], n),\r\n calculatePadding(nextMatrix, pos2, [right + zoomOffset, -top], n),\r\n ],\r\n [\r\n calculatePadding(nextMatrix, pos2, [right, -top - zoomOffset], n),\r\n calculatePadding(nextMatrix, pos4, [right, bottom + zoomOffset], n),\r\n ],\r\n [\r\n calculatePadding(nextMatrix, pos4, [right + zoomOffset, bottom], n),\r\n calculatePadding(nextMatrix, pos3, [-left - zoomOffset, bottom], n),\r\n ],\r\n [\r\n calculatePadding(nextMatrix, pos3, [-left, bottom + zoomOffset], n),\r\n calculatePadding(nextMatrix, pos1, [-left, -top - zoomOffset], n),\r\n ],\r\n ];\r\n }\r\n };\r\n MoveableManager.prototype.checkUpdate = function () {\r\n this._isPropTargetChanged = false;\r\n var _a = this.props, target = _a.target, container = _a.container, parentMoveable = _a.parentMoveable;\r\n var _b = this.state, stateTarget = _b.target, stateContainer = _b.container;\r\n if (!stateTarget && !target) {\r\n return;\r\n }\r\n this.updateAbles();\r\n var isTargetChanged = !equals(stateTarget, target);\r\n var isChanged = isTargetChanged || !equals(stateContainer, container);\r\n if (!isChanged) {\r\n return;\r\n }\r\n var moveableContainer = container || this.controlBox;\r\n if (moveableContainer) {\r\n this.unsetAbles();\r\n }\r\n this.updateState({ target: target, container: container });\r\n if (!parentMoveable && moveableContainer) {\r\n this.updateRect(\"End\", false, false);\r\n }\r\n this._isPropTargetChanged = isTargetChanged;\r\n };\r\n MoveableManager.prototype.waitToChangeTarget = function () {\r\n return new Promise(function () { });\r\n };\r\n MoveableManager.prototype.triggerEvent = function (name, e) {\r\n var props = this.props;\r\n this._emitter.trigger(name, e);\r\n if (props.parentMoveable && e.isRequest && !e.isRequestChild) {\r\n return props.parentMoveable.triggerEvent(name, e, true);\r\n }\r\n var callback = props[name];\r\n return callback && callback(e);\r\n };\r\n MoveableManager.prototype.useCSS = function (tag, css) {\r\n var customStyleMap = this.props.customStyledMap;\r\n var key = tag + css;\r\n if (!customStyleMap[key]) {\r\n customStyleMap[key] = styled(tag, css);\r\n }\r\n return customStyleMap[key];\r\n };\r\n MoveableManager.prototype.getState = function () {\r\n var _a;\r\n var props = this.props;\r\n if (props.target || ((_a = props.targets) === null || _a === void 0 ? void 0 : _a.length)) {\r\n this._hasFirstTarget = true;\r\n }\r\n var hasControlBox = this.controlBox;\r\n var persistData = props.persistData;\r\n var firstRenderState = props.firstRenderState;\r\n if (firstRenderState && !hasControlBox) {\r\n return firstRenderState;\r\n }\r\n if (!this._hasFirstTarget && persistData) {\r\n var persistState = getPersistState(persistData);\r\n if (persistState) {\r\n this.updateState(persistState, false);\r\n return this.state;\r\n }\r\n }\r\n this.state.isPersisted = false;\r\n return this.state;\r\n };\r\n MoveableManager.prototype.updateSelectors = function () { };\r\n MoveableManager.prototype.unsetAbles = function () {\r\n var _this = this;\r\n this.targetAbles.forEach(function (able) {\r\n if (able.unset) {\r\n able.unset(_this);\r\n }\r\n });\r\n };\r\n MoveableManager.prototype.updateAbles = function (ables, eventAffix) {\r\n if (ables === void 0) { ables = this.props.ables; }\r\n if (eventAffix === void 0) { eventAffix = \"\"; }\r\n var props = this.props;\r\n var triggerAblesSimultaneously = props.triggerAblesSimultaneously;\r\n var enabledAbles = this.getEnabledAbles(ables);\r\n var dragStart = \"drag\".concat(eventAffix, \"Start\");\r\n var pinchStart = \"pinch\".concat(eventAffix, \"Start\");\r\n var dragControlStart = \"drag\".concat(eventAffix, \"ControlStart\");\r\n var targetAbles = filterAbles(enabledAbles, [dragStart, pinchStart], triggerAblesSimultaneously);\r\n var controlAbles = filterAbles(enabledAbles, [dragControlStart], triggerAblesSimultaneously);\r\n this.enabledAbles = enabledAbles;\r\n this.targetAbles = targetAbles;\r\n this.controlAbles = controlAbles;\r\n };\r\n MoveableManager.prototype.updateState = function (nextState, isSetState) {\r\n if (isSetState) {\r\n if (this.isUnmounted) {\r\n return;\r\n }\r\n this.setState(nextState);\r\n }\r\n else {\r\n var state = this.state;\r\n for (var name_3 in nextState) {\r\n state[name_3] = nextState[name_3];\r\n }\r\n }\r\n };\r\n MoveableManager.prototype.getEnabledAbles = function (ables) {\r\n if (ables === void 0) { ables = this.props.ables; }\r\n var props = this.props;\r\n return ables.filter(function (able) { return able && ((able.always && props[able.name] !== false)\r\n || props[able.name]); });\r\n };\r\n MoveableManager.prototype.renderAbles = function () {\r\n var _this = this;\r\n var props = this.props;\r\n var triggerAblesSimultaneously = props.triggerAblesSimultaneously;\r\n var Renderer = {\r\n createElement: createElement,\r\n };\r\n this.renderState = {};\r\n return groupByMap(flat(filterAbles(this.getEnabledAbles(), [\"render\"], triggerAblesSimultaneously).map(function (_a) {\r\n var render = _a.render;\r\n return render(_this, Renderer) || [];\r\n })).filter(function (el) { return el; }), function (_a) {\r\n var key = _a.key;\r\n return key;\r\n }).map(function (group) { return group[0]; });\r\n };\r\n MoveableManager.prototype.updateCheckInput = function () {\r\n this.targetGesto && (this.targetGesto.options.checkInput = this.props.checkInput);\r\n };\r\n MoveableManager.prototype._getRequestStyles = function () {\r\n var styleNames = this.getEnabledAbles().reduce(function (names, able) {\r\n var _a, _b;\r\n var ableStyleNames = ((_b = (_a = able.requestStyle) === null || _a === void 0 ? void 0 : _a.call(able)) !== null && _b !== void 0 ? _b : []);\r\n return __spreadArray(__spreadArray([], __read(names), false), __read(ableStyleNames), false);\r\n }, __spreadArray([], __read((this.props.requestStyles || [])), false));\r\n return styleNames;\r\n };\r\n MoveableManager.prototype._updateObserver = function (prevProps) {\r\n this._updateResizeObserver(prevProps);\r\n this._updateMutationObserver(prevProps);\r\n };\r\n MoveableManager.prototype._updateEvents = function () {\r\n var controlBoxElement = this.controlBox;\r\n var hasTargetAble = this.targetAbles.length;\r\n var hasControlAble = this.controlAbles.length;\r\n var target = this._dragTarget;\r\n var isUnset = (!hasTargetAble && this.targetGesto)\r\n || this._isTargetChanged(true);\r\n if (isUnset) {\r\n unsetGesto(this, false);\r\n this.updateState({ gestos: {} });\r\n }\r\n if (!hasControlAble) {\r\n unsetGesto(this, true);\r\n }\r\n if (target && hasTargetAble && !this.targetGesto) {\r\n this.targetGesto = getTargetAbleGesto(this, target, \"\");\r\n }\r\n if (!this.controlGesto && hasControlAble) {\r\n this.controlGesto = getAbleGesto(this, controlBoxElement, \"controlAbles\", \"Control\");\r\n }\r\n };\r\n MoveableManager.prototype._updateTargets = function () {\r\n var props = this.props;\r\n this._prevPropTarget = this._propTarget;\r\n this._prevDragTarget = this._dragTarget;\r\n this._prevOriginalDragTarget = this._originalDragTarget;\r\n this._prevDragArea = props.dragArea;\r\n this._propTarget = props.target;\r\n this._originalDragTarget = props.dragTarget || props.target;\r\n this._dragTarget = getRefTarget(this._originalDragTarget, true);\r\n };\r\n MoveableManager.prototype._renderLines = function () {\r\n var props = this.props;\r\n var _a = props, zoom = _a.zoom, hideDefaultLines = _a.hideDefaultLines, hideChildMoveableDefaultLines = _a.hideChildMoveableDefaultLines, parentMoveable = _a.parentMoveable;\r\n if (hideDefaultLines || (parentMoveable && hideChildMoveableDefaultLines)) {\r\n return [];\r\n }\r\n var state = this.getState();\r\n var Renderer = {\r\n createElement: createElement,\r\n };\r\n return state.renderLines.map(function (line, i) {\r\n return renderLine(Renderer, \"\", line[0], line[1], zoom, \"render-line-\".concat(i));\r\n });\r\n };\r\n MoveableManager.prototype._isTargetChanged = function (useDragArea) {\r\n var props = this.props;\r\n var nextTarget = props.dragTarget || props.target;\r\n var prevTarget = this._prevOriginalDragTarget;\r\n var prevDragArea = this._prevDragArea;\r\n var dragArea = props.dragArea;\r\n // check target without dragArea\r\n var isDragTargetChanged = !dragArea && prevTarget !== nextTarget;\r\n var isDragAreaChanged = (useDragArea || dragArea) && prevDragArea !== dragArea;\r\n return isDragTargetChanged || isDragAreaChanged || this._prevPropTarget != this._propTarget;\r\n };\r\n MoveableManager.prototype._updateNativeEvents = function () {\r\n var _this = this;\r\n var props = this.props;\r\n var target = props.dragArea ? this.areaElement : this.state.target;\r\n var events = this.events;\r\n var eventKeys = getKeys(events);\r\n if (this._isTargetChanged()) {\r\n for (var eventName in events) {\r\n var manager = events[eventName];\r\n manager && manager.destroy();\r\n events[eventName] = null;\r\n }\r\n }\r\n if (!target) {\r\n return;\r\n }\r\n var enabledAbles = this.enabledAbles;\r\n eventKeys.forEach(function (eventName) {\r\n var ables = filterAbles(enabledAbles, [eventName]);\r\n var hasAbles = ables.length > 0;\r\n var manager = events[eventName];\r\n if (!hasAbles) {\r\n if (manager) {\r\n manager.destroy();\r\n events[eventName] = null;\r\n }\r\n return;\r\n }\r\n if (!manager) {\r\n manager = new EventManager(target, _this, eventName);\r\n events[eventName] = manager;\r\n }\r\n manager.setAbles(ables);\r\n });\r\n };\r\n MoveableManager.prototype._checkUpdateRootContainer = function () {\r\n var rootContainer = this.props.rootContainer;\r\n if (!this._rootContainer && rootContainer) {\r\n this._rootContainer = getRefTarget(rootContainer, true);\r\n }\r\n };\r\n MoveableManager.prototype._checkUpdateViewContainer = function () {\r\n var viewContainerOption = this.props.viewContainer;\r\n if (!this._viewContainer && viewContainerOption) {\r\n this._viewContainer = getRefTarget(viewContainerOption, true);\r\n }\r\n var viewContainer = this._viewContainer;\r\n if (viewContainer) {\r\n this._changeAbleViewClassNames(__spreadArray(__spreadArray([], __read(this._getAbleViewClassNames()), false), [\r\n this.isDragging() ? VIEW_DRAGGING : \"\",\r\n ], false));\r\n }\r\n };\r\n MoveableManager.prototype._changeAbleViewClassNames = function (classNames) {\r\n var viewContainer = this._viewContainer;\r\n var nextClassNames = groupBy(classNames.filter(Boolean), function (el) { return el; }).map(function (_a) {\r\n var _b = __read(_a, 1), className = _b[0];\r\n return className;\r\n });\r\n var prevClassNames = this._viewClassNames;\r\n var _a = diff$1(prevClassNames, nextClassNames), removed = _a.removed, added = _a.added;\r\n removed.forEach(function (index) {\r\n removeClass(viewContainer, prevClassNames[index]);\r\n });\r\n added.forEach(function (index) {\r\n addClass(viewContainer, nextClassNames[index]);\r\n });\r\n this._viewClassNames = nextClassNames;\r\n };\r\n MoveableManager.prototype._getAbleViewClassNames = function () {\r\n var _this = this;\r\n return (this.getEnabledAbles().map(function (able) {\r\n var _a;\r\n return (((_a = able.viewClassName) === null || _a === void 0 ? void 0 : _a.call(able, _this)) || \"\");\r\n }).join(\" \") + \" \".concat(this._getAbleClassName(\"-view\"))).split(/\\s+/g);\r\n };\r\n MoveableManager.prototype._getAbleClassName = function (classPrefix) {\r\n var _this = this;\r\n if (classPrefix === void 0) { classPrefix = \"\"; }\r\n var ables = this.getEnabledAbles();\r\n var targetGesto = this.targetGesto;\r\n var controlGesto = this.controlGesto;\r\n var targetGestoData = (targetGesto === null || targetGesto === void 0 ? void 0 : targetGesto.isFlag())\r\n ? targetGesto.getEventData() : {};\r\n var controlGestoData = (controlGesto === null || controlGesto === void 0 ? void 0 : controlGesto.isFlag())\r\n ? controlGesto.getEventData() : {};\r\n return ables.map(function (able) {\r\n var _a, _b, _c;\r\n var name = able.name;\r\n var className = ((_a = able.className) === null || _a === void 0 ? void 0 : _a.call(able, _this)) || \"\";\r\n if (((_b = targetGestoData[name]) === null || _b === void 0 ? void 0 : _b.isEventStart)\r\n || ((_c = controlGestoData[name]) === null || _c === void 0 ? void 0 : _c.isEventStart)) {\r\n className += \" \".concat(prefix(\"\".concat(name).concat(classPrefix, \"-dragging\")));\r\n }\r\n return className.trim();\r\n }).filter(Boolean).join(\" \");\r\n };\r\n MoveableManager.prototype._updateResizeObserver = function (prevProps) {\r\n var _a;\r\n var props = this.props;\r\n var target = props.target;\r\n var win = getWindow(this.getControlBoxElement());\r\n if (!win.ResizeObserver || !target || !props.useResizeObserver) {\r\n (_a = this._reiszeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();\r\n return;\r\n }\r\n if (prevProps.target === target && this._reiszeObserver) {\r\n return;\r\n }\r\n var observer = new win.ResizeObserver(this.checkUpdateRect);\r\n observer.observe(target, {\r\n box: \"border-box\",\r\n });\r\n this._reiszeObserver = observer;\r\n };\r\n MoveableManager.prototype._updateMutationObserver = function (prevProps) {\r\n var _this = this;\r\n var _a;\r\n var props = this.props;\r\n var target = props.target;\r\n var win = getWindow(this.getControlBoxElement());\r\n if (!win.MutationObserver || !target || !props.useMutationObserver) {\r\n (_a = this._mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();\r\n return;\r\n }\r\n if (prevProps.target === target && this._mutationObserver) {\r\n return;\r\n }\r\n var observer = new win.MutationObserver(function (records) {\r\n var e_1, _a;\r\n try {\r\n for (var records_1 = __values(records), records_1_1 = records_1.next(); !records_1_1.done; records_1_1 = records_1.next()) {\r\n var mutation = records_1_1.value;\r\n if (mutation.type === \"attributes\" && mutation.attributeName === \"style\") {\r\n _this.checkUpdateRect();\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (records_1_1 && !records_1_1.done && (_a = records_1.return)) _a.call(records_1);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n });\r\n observer.observe(target, {\r\n attributes: true,\r\n });\r\n this._mutationObserver = observer;\r\n };\r\n MoveableManager.defaultProps = {\r\n dragTargetSelf: false,\r\n target: null,\r\n dragTarget: null,\r\n container: null,\r\n rootContainer: null,\r\n origin: true,\r\n parentMoveable: null,\r\n wrapperMoveable: null,\r\n isWrapperMounted: false,\r\n parentPosition: null,\r\n warpSelf: false,\r\n svgOrigin: \"\",\r\n dragContainer: null,\r\n useResizeObserver: false,\r\n useMutationObserver: false,\r\n preventDefault: true,\r\n linePadding: 0,\r\n controlPadding: 0,\r\n ables: [],\r\n pinchThreshold: 20,\r\n dragArea: false,\r\n passDragArea: false,\r\n transformOrigin: \"\",\r\n className: \"\",\r\n zoom: 1,\r\n triggerAblesSimultaneously: false,\r\n padding: {},\r\n pinchOutside: true,\r\n checkInput: false,\r\n dragFocusedInput: false,\r\n groupable: false,\r\n hideDefaultLines: false,\r\n cspNonce: \"\",\r\n translateZ: 0,\r\n cssStyled: null,\r\n customStyledMap: {},\r\n props: {},\r\n stopPropagation: false,\r\n preventClickDefault: false,\r\n preventClickEventOnDrag: true,\r\n flushSync: defaultSync,\r\n firstRenderState: null,\r\n persistData: null,\r\n viewContainer: null,\r\n requestStyles: [],\r\n useAccuratePosition: false,\r\n };\r\n return MoveableManager;\r\n}(React.PureComponent));\r\n/**\r\n * The target to indicate Moveable Control Box.\r\n * @name Moveable#target\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n * moveable.target = document.querySelector(\".target\");\r\n */\r\n/**\r\n * Zooms in the elements of a moveable.\r\n * @name Moveable#zoom\r\n * @default 1\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n * moveable.zoom = 2;\r\n */\r\n/**\r\n * Whether the target size is detected and updated whenever it changes.\r\n * @name Moveable#useResizeObserver\r\n * @default false\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n * moveable.useResizeObserver = true;\r\n */\r\n/**\r\n * Resize, Scale Events at edges\r\n * @name Moveable#edge\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n * moveable.edge = true;\r\n */\r\n/**\r\n * You can specify the className of the moveable controlbox.\r\n * @name Moveable#className\r\n * @default \"\"\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * className: \"\",\r\n * });\r\n *\r\n * moveable.className = \"moveable1\";\r\n */\r\n/**\r\n * The target(s) to drag Moveable target(s)\r\n * @name Moveable#dragTarget\r\n * @default target\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body);\r\n * moveable.target = document.querySelector(\".target\");\r\n * moveable.dragTarget = document.querySelector(\".dragTarget\");\r\n */\r\n/**\r\n * `renderStart` event occurs at the first start of all events.\r\n * @memberof Moveable\r\n * @event renderStart\r\n * @param {Moveable.OnRenderStart} - Parameters for the `renderStart` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: document.querySelector(\".target\"),\r\n * });\r\n * moveable.on(\"renderStart\", ({ target }) => {\r\n * console.log(\"onRenderStart\", target);\r\n * });\r\n */\r\n/**\r\n * `render` event occurs before the target is drawn on the screen.\r\n * @memberof Moveable\r\n * @event render\r\n * @param {Moveable.OnRender} - Parameters for the `render` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: document.querySelector(\".target\"),\r\n * });\r\n * moveable.on(\"render\", ({ target }) => {\r\n * console.log(\"onRender\", target);\r\n * });\r\n */\r\n/**\r\n * `renderEnd` event occurs at the end of all events.\r\n * @memberof Moveable\r\n * @event renderEnd\r\n * @param {Moveable.OnRenderEnd} - Parameters for the `renderEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: document.querySelector(\".target\"),\r\n * });\r\n * moveable.on(\"renderEnd\", ({ target }) => {\r\n * console.log(\"onRenderEnd\", target);\r\n * });\r\n */\r\n/**\r\n * `renderGroupStart` event occurs at the first start of all events in group.\r\n * @memberof Moveable\r\n * @event renderGroupStart\r\n * @param {Moveable.OnRenderGroupStart} - Parameters for the `renderGroupStart` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * });\r\n * moveable.on(\"renderGroupStart\", ({ targets }) => {\r\n * console.log(\"onRenderGroupStart\", targets);\r\n * });\r\n */\r\n/**\r\n * `renderGroup` event occurs before the target is drawn on the screen in group.\r\n * @memberof Moveable\r\n * @event renderGroup\r\n * @param {Moveable.OnRenderGroup} - Parameters for the `renderGroup` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * });\r\n * moveable.on(\"renderGroup\", ({ targets }) => {\r\n * console.log(\"onRenderGroup\", targets);\r\n * });\r\n */\r\n/**\r\n * `renderGroupEnd` event occurs at the end of all events in group.\r\n * @memberof Moveable\r\n * @event renderGroupEnd\r\n * @param {Moveable.OnRenderGroupEnd} - Parameters for the `renderGroupEnd` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * });\r\n * moveable.on(\"renderGroupEnd\", ({ targets }) => {\r\n * console.log(\"onRenderGroupEnd\", targets);\r\n * });\r\n */\n\nvar Groupable = {\r\n name: \"groupable\",\r\n props: [\r\n \"defaultGroupRotate\",\r\n \"useDefaultGroupRotate\",\r\n \"defaultGroupOrigin\",\r\n \"groupable\",\r\n \"groupableProps\",\r\n \"targetGroups\",\r\n \"hideChildMoveableDefaultLines\",\r\n ],\r\n events: [],\r\n render: function (moveable, React) {\r\n var _a;\r\n var props = moveable.props;\r\n var targets = props.targets || [];\r\n var _b = moveable.getState(), left = _b.left, top = _b.top, isPersisted = _b.isPersisted;\r\n var zoom = props.zoom || 1;\r\n var renderGroupRects = moveable.renderGroupRects;\r\n var persistDatChildren = ((_a = props.persistData) === null || _a === void 0 ? void 0 : _a.children) || [];\r\n if (isPersisted) {\r\n targets = persistDatChildren.map(function () { return null; });\r\n }\r\n else {\r\n persistDatChildren = [];\r\n }\r\n var parentPosition = watchValue(moveable, \"parentPosition\", [left, top], function (styles) { return styles.join(\",\"); });\r\n var requestStyles = watchValue(moveable, \"requestStyles\", moveable.getRequestChildStyles(), function (styles) { return styles.join(\",\"); });\r\n moveable.moveables = moveable.moveables.slice(0, targets.length);\r\n return __spreadArray(__spreadArray([], __read(targets.map(function (target, i) {\r\n return React.createElement(MoveableManager, { key: \"moveable\" + i, ref: refs(moveable, \"moveables\", i), target: target, origin: false, requestStyles: requestStyles, cssStyled: props.cssStyled, customStyledMap: props.customStyledMap, useResizeObserver: props.useResizeObserver, useMutationObserver: props.useMutationObserver, hideChildMoveableDefaultLines: props.hideChildMoveableDefaultLines, parentMoveable: moveable, parentPosition: [left, top], persistData: persistDatChildren[i], zoom: zoom });\r\n })), false), __read(flat(renderGroupRects.map(function (_a, i) {\r\n var pos1 = _a.pos1, pos2 = _a.pos2, pos3 = _a.pos3, pos4 = _a.pos4;\r\n var poses = [pos1, pos2, pos3, pos4];\r\n return [\r\n [0, 1],\r\n [1, 3],\r\n [3, 2],\r\n [2, 0],\r\n ].map(function (_a, j) {\r\n var _b = __read(_a, 2), from = _b[0], to = _b[1];\r\n return renderLine(React, \"\", minus(poses[from], parentPosition), minus(poses[to], parentPosition), zoom, \"group-rect-\".concat(i, \"-\").concat(j));\r\n });\r\n }))), false);\r\n },\r\n};\n\nvar Clickable = makeAble(\"clickable\", {\r\n props: [\r\n \"clickable\",\r\n ],\r\n events: [\r\n \"click\",\r\n \"clickGroup\",\r\n ],\r\n always: true,\r\n dragRelation: \"weak\",\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n dragStart: function () {\r\n return;\r\n },\r\n dragControlStart: function () {\r\n return;\r\n },\r\n dragGroupStart: function (moveable, e) {\r\n e.datas.inputTarget = e.inputEvent && e.inputEvent.target;\r\n },\r\n dragEnd: function (moveable, e) {\r\n var target = moveable.props.target;\r\n var inputEvent = e.inputEvent;\r\n var inputTarget = e.inputTarget;\r\n var isMoveableElement = moveable.isMoveableElement(inputTarget);\r\n var containsElement = !isMoveableElement && moveable.controlBox.contains(inputTarget);\r\n if (!inputEvent || !inputTarget || e.isDrag\r\n || moveable.isMoveableElement(inputTarget)\r\n || containsElement\r\n // External event duplicate target or dragAreaElement\r\n ) {\r\n return;\r\n }\r\n var containsTarget = target.contains(inputTarget);\r\n triggerEvent(moveable, \"onClick\", fillParams(moveable, e, {\r\n isDouble: e.isDouble,\r\n inputTarget: inputTarget,\r\n isTarget: target === inputTarget,\r\n moveableTarget: moveable.props.target,\r\n containsTarget: containsTarget,\r\n }));\r\n },\r\n dragGroupEnd: function (moveable, e) {\r\n var inputEvent = e.inputEvent;\r\n var inputTarget = e.inputTarget;\r\n if (!inputEvent || !inputTarget || e.isDrag\r\n || moveable.isMoveableElement(inputTarget)\r\n // External event duplicate target or dragAreaElement\r\n || e.datas.inputTarget === inputTarget) {\r\n return;\r\n }\r\n var targets = moveable.props.targets;\r\n var targetIndex = targets.indexOf(inputTarget);\r\n var isTarget = targetIndex > -1;\r\n var containsTarget = false;\r\n if (targetIndex === -1) {\r\n targetIndex = findIndex(targets, function (parentTarget) { return parentTarget.contains(inputTarget); });\r\n containsTarget = targetIndex > -1;\r\n }\r\n triggerEvent(moveable, \"onClickGroup\", fillParams(moveable, e, {\r\n isDouble: e.isDouble,\r\n targets: targets,\r\n inputTarget: inputTarget,\r\n targetIndex: targetIndex,\r\n isTarget: isTarget,\r\n containsTarget: containsTarget,\r\n moveableTarget: targets[targetIndex],\r\n }));\r\n },\r\n dragControlEnd: function (moveable, e) {\r\n this.dragEnd(moveable, e);\r\n },\r\n dragGroupControlEnd: function (moveable, e) {\r\n this.dragEnd(moveable, e);\r\n },\r\n});\r\n/**\r\n * When you click on the element, the `click` event is called.\r\n * @memberof Moveable\r\n * @event click\r\n * @param {Moveable.OnClick} - Parameters for the `click` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: document.querySelector(\".target\"),\r\n * });\r\n * moveable.on(\"click\", ({ hasTarget, containsTarget, targetIndex }) => {\r\n * // If you click on an element other than the target and not included in the target, index is -1.\r\n * console.log(\"onClickGroup\", target, hasTarget, containsTarget, targetIndex);\r\n * });\r\n */\r\n/**\r\n * When you click on the element inside the group, the `clickGroup` event is called.\r\n * @memberof Moveable\r\n * @event clickGroup\r\n * @param {Moveable.OnClickGroup} - Parameters for the `clickGroup` event\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [].slice.call(document.querySelectorAll(\".target\")),\r\n * });\r\n * moveable.on(\"clickGroup\", ({ inputTarget, isTarget, containsTarget, targetIndex }) => {\r\n * // If you click on an element other than the target and not included in the target, index is -1.\r\n * console.log(\"onClickGroup\", inputTarget, isTarget, containsTarget, targetIndex);\r\n * });\r\n */\n\nfunction getDraggableEvent(e) {\r\n var datas = e.originalDatas.draggable;\r\n if (!datas) {\r\n e.originalDatas.draggable = {};\r\n datas = e.originalDatas.draggable;\r\n }\r\n return __assign(__assign({}, e), { datas: datas });\r\n}\r\nvar edgeDraggable = makeAble(\"edgeDraggable\", {\r\n css: [\r\n \".edge.edgeDraggable.line {\\ncursor: move;\\n}\",\r\n ],\r\n render: function (moveable, React) {\r\n var props = moveable.props;\r\n var edge = props.edgeDraggable;\r\n if (!edge) {\r\n return [];\r\n }\r\n return renderEdgeLines(React, \"edgeDraggable\", edge, moveable.getState().renderPoses, props.zoom);\r\n },\r\n dragCondition: function (moveable, e) {\r\n var _a;\r\n var props = moveable.props;\r\n var target = (_a = e.inputEvent) === null || _a === void 0 ? void 0 : _a.target;\r\n if (!props.edgeDraggable || !target) {\r\n return false;\r\n }\r\n return !props.draggable\r\n && hasClass(target, prefix(\"direction\"))\r\n && hasClass(target, prefix(\"edge\"))\r\n && hasClass(target, prefix(\"edgeDraggable\"));\r\n },\r\n dragStart: function (moveable, e) {\r\n return Draggable.dragStart(moveable, getDraggableEvent(e));\r\n },\r\n drag: function (moveable, e) {\r\n return Draggable.drag(moveable, getDraggableEvent(e));\r\n },\r\n dragEnd: function (moveable, e) {\r\n return Draggable.dragEnd(moveable, getDraggableEvent(e));\r\n },\r\n dragGroupCondition: function (moveable, e) {\r\n var _a;\r\n var props = moveable.props;\r\n var target = (_a = e.inputEvent) === null || _a === void 0 ? void 0 : _a.target;\r\n if (!props.edgeDraggable || !target) {\r\n return false;\r\n }\r\n return !props.draggable && hasClass(target, prefix(\"direction\")) && hasClass(target, prefix(\"line\"));\r\n },\r\n dragGroupStart: function (moveable, e) {\r\n return Draggable.dragGroupStart(moveable, getDraggableEvent(e));\r\n },\r\n dragGroup: function (moveable, e) {\r\n return Draggable.dragGroup(moveable, getDraggableEvent(e));\r\n },\r\n dragGroupEnd: function (moveable, e) {\r\n return Draggable.dragGroupEnd(moveable, getDraggableEvent(e));\r\n },\r\n unset: function (moveable) {\r\n return Draggable.unset(moveable);\r\n },\r\n});\r\n/**\r\n * Whether to move by dragging the edge line (default: false)\r\n * @name Moveable.Draggable#edgeDraggable\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * draggable: true,\r\n * edgeDraggable: false,\r\n * });\r\n *\r\n * moveable.edgeDraggable = true;\r\n */\n\nvar IndividualGroupable = {\r\n name: \"individualGroupable\",\r\n props: [\r\n \"individualGroupable\",\r\n \"individualGroupableProps\",\r\n ],\r\n events: [],\r\n};\n\nvar MOVEABLE_ABLES = [\r\n BeforeRenderable,\r\n Default, Snappable, Pinchable,\r\n Draggable, edgeDraggable,\r\n Resizable, Scalable, Warpable, Rotatable,\r\n Scrollable, Padding, Origin,\r\n OriginDraggable,\r\n Clippable, Roundable, Groupable, IndividualGroupable,\r\n Clickable,\r\n DragArea,\r\n Renderable,\r\n];\r\nvar MOVEABLE_EVENTS = /*#__PURE__*/ MOVEABLE_ABLES.reduce(function (current, able) {\r\n (able.events || []).forEach(function (name) {\r\n pushSet(current, name);\r\n });\r\n return current;\r\n}, []);\r\nvar MOVEABLE_PROPS = /*#__PURE__*/ MOVEABLE_ABLES.reduce(function (current, able) {\r\n (able.props || []).forEach(function (name) {\r\n pushSet(current, name);\r\n });\r\n return current;\r\n}, []);\n\nfunction solveConstantsDistance(_a, pos) {\r\n var _b = __read(_a, 3), a = _b[0], b = _b[1], c = _b[2];\r\n return (a * pos[0] + b * pos[1] + c) / Math.sqrt(a * a + b * b);\r\n}\r\nfunction solveC(_a, pos) {\r\n var _b = __read(_a, 2), a = _b[0], b = _b[1];\r\n // ax + by + c = 0\r\n // -ax -by;\r\n return -a * pos[0] - b * pos[1];\r\n}\n\nfunction getMaxPos(poses, index) {\r\n return Math.max.apply(Math, __spreadArray([], __read(poses.map(function (_a) {\r\n var _b = __read(_a, 4), pos1 = _b[0], pos2 = _b[1], pos3 = _b[2], pos4 = _b[3];\r\n return Math.max(pos1[index], pos2[index], pos3[index], pos4[index]);\r\n })), false));\r\n}\r\nfunction getMinPos(poses, index) {\r\n return Math.min.apply(Math, __spreadArray([], __read(poses.map(function (_a) {\r\n var _b = __read(_a, 4), pos1 = _b[0], pos2 = _b[1], pos3 = _b[2], pos4 = _b[3];\r\n return Math.min(pos1[index], pos2[index], pos3[index], pos4[index]);\r\n })), false));\r\n}\r\nfunction getGroupRect(parentPoses, rotation) {\r\n var _a, _b, _c;\r\n var pos1 = [0, 0];\r\n var pos2 = [0, 0];\r\n var pos3 = [0, 0];\r\n var pos4 = [0, 0];\r\n var width = 0;\r\n var height = 0;\r\n if (!parentPoses.length) {\r\n return {\r\n pos1: pos1,\r\n pos2: pos2,\r\n pos3: pos3,\r\n pos4: pos4,\r\n minX: 0,\r\n minY: 0,\r\n maxX: 0,\r\n maxY: 0,\r\n width: width,\r\n height: height,\r\n rotation: rotation,\r\n };\r\n }\r\n var fixedRotation = throttle(rotation, TINY_NUM);\r\n if (fixedRotation % 90) {\r\n var rad = fixedRotation / 180 * Math.PI;\r\n var a1_1 = Math.tan(rad);\r\n var a2_1 = -1 / a1_1;\r\n // ax = y // -ax + y = 0 // 0 => 1\r\n // -ax = y // ax + y = 0 // 0 => 3\r\n var a1MinMax_1 = [MAX_NUM, MIN_NUM];\r\n var a1MinMaxPos_1 = [[0, 0], [0, 0]];\r\n var a2MinMax_1 = [MAX_NUM, MIN_NUM];\r\n var a2MinMaxPos_1 = [[0, 0], [0, 0]];\r\n parentPoses.forEach(function (poses) {\r\n poses.forEach(function (pos) {\r\n // const b1 = pos[1] - a1 * pos[0];\r\n // const b2 = pos[1] - a2 * pos[0];\r\n var a1Dist = solveConstantsDistance([-a1_1, 1, 0], pos);\r\n var a2Dist = solveConstantsDistance([-a2_1, 1, 0], pos);\r\n if (a1MinMax_1[0] > a1Dist) {\r\n a1MinMaxPos_1[0] = pos;\r\n a1MinMax_1[0] = a1Dist;\r\n }\r\n if (a1MinMax_1[1] < a1Dist) {\r\n a1MinMaxPos_1[1] = pos;\r\n a1MinMax_1[1] = a1Dist;\r\n }\r\n if (a2MinMax_1[0] > a2Dist) {\r\n a2MinMaxPos_1[0] = pos;\r\n a2MinMax_1[0] = a2Dist;\r\n }\r\n if (a2MinMax_1[1] < a2Dist) {\r\n a2MinMaxPos_1[1] = pos;\r\n a2MinMax_1[1] = a2Dist;\r\n }\r\n });\r\n });\r\n var _d = __read(a1MinMaxPos_1, 2), a1MinPos = _d[0], a1MaxPos = _d[1];\r\n var _e = __read(a2MinMaxPos_1, 2), a2MinPos = _e[0], a2MaxPos = _e[1];\r\n var minHorizontalLine = [-a1_1, 1, solveC([-a1_1, 1], a1MinPos)];\r\n var maxHorizontalLine = [-a1_1, 1, solveC([-a1_1, 1], a1MaxPos)];\r\n var minVerticalLine = [-a2_1, 1, solveC([-a2_1, 1], a2MinPos)];\r\n var maxVerticalLine = [-a2_1, 1, solveC([-a2_1, 1], a2MaxPos)];\r\n _a = __read([\r\n [minHorizontalLine, minVerticalLine],\r\n [minHorizontalLine, maxVerticalLine],\r\n [maxHorizontalLine, minVerticalLine],\r\n [maxHorizontalLine, maxVerticalLine],\r\n ].map(function (_a) {\r\n var _b = __read(_a, 2), line1 = _b[0], line2 = _b[1];\r\n return getIntersectionPointsByConstants(line1, line2)[0];\r\n }), 4), pos1 = _a[0], pos2 = _a[1], pos3 = _a[2], pos4 = _a[3];\r\n width = a2MinMax_1[1] - a2MinMax_1[0];\r\n height = a1MinMax_1[1] - a1MinMax_1[0];\r\n }\r\n else {\r\n var minX_1 = getMinPos(parentPoses, 0);\r\n var minY_1 = getMinPos(parentPoses, 1);\r\n var maxX_1 = getMaxPos(parentPoses, 0);\r\n var maxY_1 = getMaxPos(parentPoses, 1);\r\n pos1 = [minX_1, minY_1];\r\n pos2 = [maxX_1, minY_1];\r\n pos3 = [minX_1, maxY_1];\r\n pos4 = [maxX_1, maxY_1];\r\n width = maxX_1 - minX_1;\r\n height = maxY_1 - minY_1;\r\n if (fixedRotation % 180) {\r\n // 0\r\n // 1 2\r\n // 3 4\r\n // 90\r\n // 3 1\r\n // 4 2\r\n // 180\r\n // 4 3\r\n // 2 1\r\n // 270\r\n // 2 4\r\n // 1 3\r\n // 1, 2, 3,4 = 3 1 4 2\r\n var changedX = [pos3, pos1, pos4, pos2];\r\n _b = __read(changedX, 4), pos1 = _b[0], pos2 = _b[1], pos3 = _b[2], pos4 = _b[3];\r\n width = maxY_1 - minY_1;\r\n height = maxX_1 - minX_1;\r\n }\r\n }\r\n if (fixedRotation % 360 > 180) {\r\n // 1 2 4 3\r\n // 3 4 2 1\r\n var changedX = [pos4, pos3, pos2, pos1];\r\n _c = __read(changedX, 4), pos1 = _c[0], pos2 = _c[1], pos3 = _c[2], pos4 = _c[3];\r\n }\r\n var _f = getMinMaxs([pos1, pos2, pos3, pos4]), minX = _f.minX, minY = _f.minY, maxX = _f.maxX, maxY = _f.maxY;\r\n return {\r\n pos1: pos1,\r\n pos2: pos2,\r\n pos3: pos3,\r\n pos4: pos4,\r\n width: width,\r\n height: height,\r\n minX: minX,\r\n minY: minY,\r\n maxX: maxX,\r\n maxY: maxY,\r\n rotation: rotation,\r\n };\r\n}\r\nfunction findMoveableGroups(moveables, childTargetGroups) {\r\n var groups = childTargetGroups.map(function (targetGroup) {\r\n if (isArray(targetGroup)) {\r\n var childMoveableGroups = findMoveableGroups(moveables, targetGroup);\r\n var length_1 = childMoveableGroups.length;\r\n if (length_1 > 1) {\r\n return childMoveableGroups;\r\n }\r\n else if (length_1 === 1) {\r\n return childMoveableGroups[0];\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n else {\r\n var checked = find(moveables, function (_a) {\r\n var manager = _a.manager;\r\n return manager.props.target === targetGroup;\r\n });\r\n if (checked) {\r\n checked.finded = true;\r\n return checked.manager;\r\n }\r\n return null;\r\n }\r\n }).filter(Boolean);\r\n if (groups.length === 1 && isArray(groups[0])) {\r\n return groups[0];\r\n }\r\n return groups;\r\n}\r\n/**\r\n * @namespace Moveable.Group\r\n * @description You can make targets moveable.\r\n */\r\nvar MoveableGroup = /*#__PURE__*/ (function (_super) {\r\n __extends(MoveableGroup, _super);\r\n function MoveableGroup() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.differ = new ChildrenDiffer();\r\n _this.moveables = [];\r\n _this.transformOrigin = \"50% 50%\";\r\n _this.renderGroupRects = [];\r\n _this._targetGroups = [];\r\n _this._hasFirstTargets = false;\r\n return _this;\r\n }\r\n MoveableGroup.prototype.componentDidMount = function () {\r\n _super.prototype.componentDidMount.call(this);\r\n };\r\n MoveableGroup.prototype.checkUpdate = function () {\r\n this._isPropTargetChanged = false;\r\n this.updateAbles();\r\n };\r\n MoveableGroup.prototype.getTargets = function () {\r\n return this.props.targets;\r\n };\r\n MoveableGroup.prototype.updateRect = function (type, isTarget, isSetState) {\r\n var _a;\r\n if (isSetState === void 0) { isSetState = true; }\r\n var state = this.state;\r\n if (!this.controlBox || state.isPersisted) {\r\n return;\r\n }\r\n setStoreCache(true);\r\n this.moveables.forEach(function (moveable) {\r\n moveable.updateRect(type, false, false);\r\n });\r\n var props = this.props;\r\n var moveables = this.moveables;\r\n var target = state.target || props.target;\r\n var checkeds = moveables.map(function (moveable) { return ({ finded: false, manager: moveable }); });\r\n var targetGroups = this.props.targetGroups || [];\r\n var moveableGroups = findMoveableGroups(checkeds, targetGroups);\r\n var useDefaultGroupRotate = props.useDefaultGroupRotate;\r\n moveableGroups.push.apply(moveableGroups, __spreadArray([], __read(checkeds.filter(function (_a) {\r\n var finded = _a.finded;\r\n return !finded;\r\n }).map(function (_a) {\r\n var manager = _a.manager;\r\n return manager;\r\n })), false));\r\n var renderGroupRects = [];\r\n var isReset = !isTarget || (type !== \"\" && props.updateGroup);\r\n var defaultGroupRotate = props.defaultGroupRotate || 0;\r\n if (!this._hasFirstTargets) {\r\n var persistedRoatation = (_a = props.persistData) === null || _a === void 0 ? void 0 : _a.rotation;\r\n if (persistedRoatation != null) {\r\n defaultGroupRotate = persistedRoatation;\r\n }\r\n }\r\n function getMoveableGroupRect(group, parentRotation, isRoot) {\r\n var posesRotations = group.map(function (moveable) {\r\n if (isArray(moveable)) {\r\n var rect = getMoveableGroupRect(moveable, parentRotation);\r\n var poses = [rect.pos1, rect.pos2, rect.pos3, rect.pos4];\r\n renderGroupRects.push(rect);\r\n return { poses: poses, rotation: rect.rotation };\r\n }\r\n else {\r\n return {\r\n poses: getAbsolutePosesByState(moveable.state),\r\n rotation: moveable.getRotation(),\r\n };\r\n }\r\n });\r\n var rotations = posesRotations.map(function (_a) {\r\n var rotation = _a.rotation;\r\n return rotation;\r\n });\r\n var groupRotation = 0;\r\n var firstRotation = rotations[0];\r\n var isSameRotation = rotations.every(function (nextRotation) {\r\n return Math.abs(firstRotation - nextRotation) < 0.1;\r\n });\r\n if (isReset) {\r\n groupRotation = !useDefaultGroupRotate && isSameRotation ? firstRotation : defaultGroupRotate;\r\n }\r\n else {\r\n groupRotation = !useDefaultGroupRotate && !isRoot && isSameRotation ? firstRotation : parentRotation;\r\n }\r\n var groupPoses = posesRotations.map(function (_a) {\r\n var poses = _a.poses;\r\n return poses;\r\n });\r\n var groupRect = getGroupRect(groupPoses, groupRotation);\r\n return groupRect;\r\n }\r\n var rootGroupRect = getMoveableGroupRect(moveableGroups, this.rotation, true);\r\n if (isReset) {\r\n // reset rotataion\r\n this.rotation = rootGroupRect.rotation;\r\n this.transformOrigin = props.defaultGroupOrigin || \"50% 50%\";\r\n this.scale = [1, 1];\r\n }\r\n this._targetGroups = targetGroups;\r\n this.renderGroupRects = renderGroupRects;\r\n var transformOrigin = this.transformOrigin;\r\n var rotation = this.rotation;\r\n var scale = this.scale;\r\n var width = rootGroupRect.width, height = rootGroupRect.height, minX = rootGroupRect.minX, minY = rootGroupRect.minY;\r\n var posesInfo = rotatePosesInfo([\r\n [0, 0],\r\n [width, 0],\r\n [0, height],\r\n [width, height],\r\n ], convertTransformOriginArray(transformOrigin, width, height), this.rotation / 180 * Math.PI);\r\n var _b = getMinMaxs(posesInfo.result), deltaX = _b.minX, deltaY = _b.minY;\r\n var rotateScale = \" rotate(\".concat(rotation, \"deg)\")\r\n + \" scale(\".concat(sign(scale[0]), \", \").concat(sign(scale[1]), \")\");\r\n var transform = \"translate(\".concat(-deltaX, \"px, \").concat(-deltaY, \"px)\").concat(rotateScale);\r\n this.controlBox.style.transform\r\n = \"translate3d(\".concat(minX, \"px, \").concat(minY, \"px, \").concat(this.props.translateZ || 0, \")\");\r\n target.style.cssText += \"left:0px;top:0px;\"\r\n + \"transform-origin:\".concat(transformOrigin, \";\")\r\n + \"width:\".concat(width, \"px;height:\").concat(height, \"px;\")\r\n + \"transform: \".concat(transform);\r\n state.width = width;\r\n state.height = height;\r\n var container = this.getContainer();\r\n var info = getMoveableTargetInfo(this.controlBox, target, this.controlBox, this.getContainer(), this._rootContainer || container, []);\r\n var pos = [info.left, info.top];\r\n var _c = __read(getAbsolutePosesByState(info), 4), pos1 = _c[0], pos2 = _c[1], pos3 = _c[2], pos4 = _c[3]; // info.left + info.pos(1 ~ 4)\r\n var minPos = getMinMaxs([pos1, pos2, pos3, pos4]);\r\n var delta = [minPos.minX, minPos.minY];\r\n var direction = sign(scale[0] * scale[1]);\r\n info.pos1 = minus(pos1, delta);\r\n info.pos2 = minus(pos2, delta);\r\n info.pos3 = minus(pos3, delta);\r\n info.pos4 = minus(pos4, delta);\r\n // info.left = info.left + delta[0];\r\n // info.top = info.top + delta[1];\r\n info.left = minX - info.left + delta[0];\r\n info.top = minY - info.top + delta[1];\r\n info.origin = minus(plus(pos, info.origin), delta);\r\n info.beforeOrigin = minus(plus(pos, info.beforeOrigin), delta);\r\n info.originalBeforeOrigin = plus(pos, info.originalBeforeOrigin);\r\n info.transformOrigin = minus(plus(pos, info.transformOrigin), delta);\r\n target.style.transform\r\n = \"translate(\".concat(-deltaX - delta[0], \"px, \").concat(-deltaY - delta[1], \"px)\")\r\n + rotateScale;\r\n setStoreCache();\r\n this.updateState(__assign(__assign({}, info), { posDelta: delta, direction: direction, beforeDirection: direction }), isSetState);\r\n };\r\n MoveableGroup.prototype.getRect = function () {\r\n return __assign(__assign({}, _super.prototype.getRect.call(this)), { children: this.moveables.map(function (child) { return child.getRect(); }) });\r\n };\r\n MoveableGroup.prototype.triggerEvent = function (name, e, isManager) {\r\n if (isManager || name.indexOf(\"Group\") > -1) {\r\n return _super.prototype.triggerEvent.call(this, name, e);\r\n }\r\n else {\r\n this._emitter.trigger(name, e);\r\n }\r\n };\r\n MoveableGroup.prototype.getRequestChildStyles = function () {\r\n var styleNames = this.getEnabledAbles().reduce(function (names, able) {\r\n var _a, _b;\r\n var ableStyleNames = ((_b = (_a = able.requestChildStyle) === null || _a === void 0 ? void 0 : _a.call(able)) !== null && _b !== void 0 ? _b : []);\r\n return __spreadArray(__spreadArray([], __read(names), false), __read(ableStyleNames), false);\r\n }, []);\r\n return styleNames;\r\n };\r\n MoveableGroup.prototype.getMoveables = function () {\r\n return __spreadArray([], __read(this.moveables), false);\r\n };\r\n MoveableGroup.prototype.updateAbles = function () {\r\n _super.prototype.updateAbles.call(this, __spreadArray(__spreadArray([], __read(this.props.ables), false), [Groupable], false), \"Group\");\r\n };\r\n MoveableGroup.prototype._updateTargets = function () {\r\n _super.prototype._updateTargets.call(this);\r\n this._originalDragTarget = this.props.dragTarget || this.areaElement;\r\n this._dragTarget = getRefTarget(this._originalDragTarget, true);\r\n };\r\n MoveableGroup.prototype._updateEvents = function () {\r\n var state = this.state;\r\n var props = this.props;\r\n var prevTarget = this._prevDragTarget;\r\n var nextTarget = props.dragTarget || this.areaElement;\r\n var targets = props.targets;\r\n var _a = this.differ.update(targets), added = _a.added, changed = _a.changed, removed = _a.removed;\r\n var isTargetChanged = added.length || removed.length;\r\n if (isTargetChanged || this._prevOriginalDragTarget !== this._originalDragTarget) {\r\n unsetGesto(this, false);\r\n unsetGesto(this, true);\r\n this.updateState({ gestos: {} });\r\n }\r\n if (prevTarget !== nextTarget) {\r\n state.target = null;\r\n }\r\n if (!state.target) {\r\n state.target = this.areaElement;\r\n this.controlBox.style.display = \"block\";\r\n }\r\n if (state.target) {\r\n if (!this.targetGesto) {\r\n this.targetGesto = getTargetAbleGesto(this, this._dragTarget, \"Group\");\r\n }\r\n if (!this.controlGesto) {\r\n this.controlGesto = getAbleGesto(this, this.controlBox, \"controlAbles\", \"GroupControl\");\r\n }\r\n }\r\n var isContainerChanged = !equals(state.container, props.container);\r\n if (isContainerChanged) {\r\n state.container = props.container;\r\n }\r\n if (isContainerChanged\r\n || isTargetChanged\r\n || this.transformOrigin !== (props.defaultGroupOrigin || \"50% 50%\")\r\n || changed.length\r\n || targets.length && !isDeepArrayEquals(this._targetGroups, props.targetGroups || [])) {\r\n this.updateRect();\r\n this._hasFirstTargets = true;\r\n }\r\n this._isPropTargetChanged = !!isTargetChanged;\r\n };\r\n MoveableGroup.prototype._updateObserver = function () { };\r\n MoveableGroup.defaultProps = __assign(__assign({}, MoveableManager.defaultProps), { transformOrigin: [\"50%\", \"50%\"], groupable: true, dragArea: true, keepRatio: true, targets: [], defaultGroupRotate: 0, defaultGroupOrigin: \"50% 50%\" });\r\n return MoveableGroup;\r\n}(MoveableManager));\n\n/**\r\n * @namespace Moveable.IndividualGroup\r\n * @description Create targets individually, not as a group.Create targets individually, not as a group.\r\n */\r\nvar MoveableIndividualGroup = /*#__PURE__*/ (function (_super) {\r\n __extends(MoveableIndividualGroup, _super);\r\n function MoveableIndividualGroup() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.moveables = [];\r\n return _this;\r\n }\r\n MoveableIndividualGroup.prototype.render = function () {\r\n var _this = this;\r\n var _a;\r\n var props = this.props;\r\n var cspNonce = props.cspNonce, ControlBoxElement = props.cssStyled, persistData = props.persistData;\r\n var targets = props.targets || [];\r\n var length = targets.length;\r\n var canPersist = this.isUnmounted || !length;\r\n var persistDatChildren = (_a = persistData === null || persistData === void 0 ? void 0 : persistData.children) !== null && _a !== void 0 ? _a : [];\r\n if (canPersist && !length && persistDatChildren.length) {\r\n targets = persistDatChildren.map(function () { return null; });\r\n }\r\n else if (!canPersist) {\r\n persistDatChildren = [];\r\n }\r\n return React.createElement(ControlBoxElement, { cspNonce: cspNonce, ref: ref(this, \"controlBox\"), className: prefix(\"control-box\") }, targets.map(function (target, i) {\r\n var _a, _b;\r\n var individualProps = (_b = (_a = props.individualGroupableProps) === null || _a === void 0 ? void 0 : _a.call(props, target, i)) !== null && _b !== void 0 ? _b : {};\r\n return React.createElement(MoveableManager, __assign({ key: \"moveable\" + i, ref: refs(_this, \"moveables\", i) }, props, individualProps, { target: target, wrapperMoveable: _this, isWrapperMounted: _this.isMoveableMounted, persistData: persistDatChildren[i] }));\r\n }));\r\n };\r\n MoveableIndividualGroup.prototype.componentDidMount = function () { };\r\n MoveableIndividualGroup.prototype.componentDidUpdate = function () { };\r\n MoveableIndividualGroup.prototype.getTargets = function () {\r\n return this.props.targets;\r\n };\r\n MoveableIndividualGroup.prototype.updateRect = function (type, isTarget, isSetState) {\r\n if (isSetState === void 0) { isSetState = true; }\r\n setStoreCache(true);\r\n this.moveables.forEach(function (moveable) {\r\n moveable.updateRect(type, isTarget, isSetState);\r\n });\r\n setStoreCache();\r\n };\r\n MoveableIndividualGroup.prototype.getRect = function () {\r\n return __assign(__assign({}, _super.prototype.getRect.call(this)), { children: this.moveables.map(function (child) { return child.getRect(); }) });\r\n };\r\n MoveableIndividualGroup.prototype.request = function (ableName, param, isInstant) {\r\n if (param === void 0) { param = {}; }\r\n var results = this.moveables.map(function (m) { return m.request(ableName, __assign(__assign({}, param), { isInstant: false }), false); });\r\n var requestInstant = isInstant || param.isInstant;\r\n var requester = {\r\n request: function (ableParam) {\r\n results.forEach(function (r) { return r.request(ableParam); });\r\n return this;\r\n },\r\n requestEnd: function () {\r\n results.forEach(function (r) { return r.requestEnd(); });\r\n return this;\r\n },\r\n };\r\n return requestInstant ? requester.request(param).requestEnd() : requester;\r\n };\r\n MoveableIndividualGroup.prototype.dragStart = function (e) {\r\n var inputTarget = e.target;\r\n var childMoveable = find(this.moveables, function (child) {\r\n var target = child.getTargets()[0];\r\n var controlBoxElement = child.getControlBoxElement();\r\n var dragElement = child.getDragElement();\r\n if (!target || !dragElement) {\r\n return false;\r\n }\r\n return dragElement === inputTarget || dragElement.contains(inputTarget)\r\n || (dragElement !== target && target === inputTarget || target.contains(inputTarget))\r\n || controlBoxElement === inputTarget || controlBoxElement.contains(inputTarget);\r\n });\r\n if (childMoveable) {\r\n childMoveable.dragStart(e);\r\n }\r\n return this;\r\n };\r\n MoveableIndividualGroup.prototype.hitTest = function () {\r\n return 0;\r\n };\r\n MoveableIndividualGroup.prototype.isInside = function () {\r\n return false;\r\n };\r\n MoveableIndividualGroup.prototype.isDragging = function () {\r\n return false;\r\n };\r\n MoveableIndividualGroup.prototype.getDragElement = function () {\r\n return null;\r\n };\r\n MoveableIndividualGroup.prototype.getMoveables = function () {\r\n return __spreadArray([], __read(this.moveables), false);\r\n };\r\n MoveableIndividualGroup.prototype.updateRenderPoses = function () { };\r\n MoveableIndividualGroup.prototype.checkUpdate = function () { };\r\n MoveableIndividualGroup.prototype.triggerEvent = function () { };\r\n MoveableIndividualGroup.prototype.updateAbles = function () { };\r\n MoveableIndividualGroup.prototype._updateEvents = function () { };\r\n MoveableIndividualGroup.prototype._updateObserver = function () { };\r\n return MoveableIndividualGroup;\r\n}(MoveableManager));\n\nfunction getElementTargets(refTargets, selectorMap) {\r\n var elementTargets = [];\r\n refTargets.forEach(function (target) {\r\n if (!target) {\r\n return;\r\n }\r\n if (isString(target)) {\r\n if (selectorMap[target]) {\r\n elementTargets.push.apply(elementTargets, __spreadArray([], __read(selectorMap[target]), false));\r\n }\r\n return;\r\n }\r\n if (isArray(target)) {\r\n elementTargets.push.apply(elementTargets, __spreadArray([], __read(getElementTargets(target, selectorMap)), false));\r\n }\r\n else {\r\n elementTargets.push(target);\r\n }\r\n });\r\n return elementTargets;\r\n}\r\nfunction getTargetGroups(refTargets, selectorMap) {\r\n var targetGroups = [];\r\n refTargets.forEach(function (target) {\r\n if (!target) {\r\n return;\r\n }\r\n if (isString(target)) {\r\n if (selectorMap[target]) {\r\n targetGroups.push.apply(targetGroups, __spreadArray([], __read(selectorMap[target]), false));\r\n }\r\n return;\r\n }\r\n if (isArray(target)) {\r\n targetGroups.push(getTargetGroups(target, selectorMap));\r\n }\r\n else {\r\n targetGroups.push(target);\r\n }\r\n });\r\n return targetGroups;\r\n}\r\nfunction compareRefTargets(prevRefTargets, nextRefTargets) {\r\n return (prevRefTargets.length !== nextRefTargets.length) || prevRefTargets.some(function (target, i) {\r\n var nextTarget = nextRefTargets[i];\r\n if (!target && !nextTarget) {\r\n return false;\r\n }\r\n else if (target != nextTarget) {\r\n if (isArray(target) && isArray(nextTarget)) {\r\n return compareRefTargets(target, nextTarget);\r\n }\r\n return true;\r\n }\r\n return false;\r\n });\r\n}\r\nvar InitialMoveable = /*#__PURE__*/ (function (_super) {\r\n __extends(InitialMoveable, _super);\r\n function InitialMoveable() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.refTargets = [];\r\n _this.selectorMap = {};\r\n _this._differ = new ChildrenDiffer();\r\n _this._elementTargets = [];\r\n _this._tmpRefTargets = [];\r\n _this._tmpSelectorMap = {};\r\n _this._onChangeTargets = null;\r\n return _this;\r\n }\r\n InitialMoveable.makeStyled = function () {\r\n var cssMap = {};\r\n var ables = this.getTotalAbles();\r\n ables.forEach(function (_a) {\r\n var css = _a.css;\r\n if (!css) {\r\n return;\r\n }\r\n css.forEach(function (text) {\r\n cssMap[text] = true;\r\n });\r\n });\r\n var style = getKeys(cssMap).join(\"\\n\");\r\n this.defaultStyled = styled(\"div\", prefixCSS(PREFIX, MOVEABLE_CSS + style));\r\n };\r\n InitialMoveable.getTotalAbles = function () {\r\n return __spreadArray([Default, Groupable, IndividualGroupable, DragArea], __read(this.defaultAbles), false);\r\n };\r\n InitialMoveable.prototype.render = function () {\r\n var _a;\r\n var moveableContructor = this.constructor;\r\n if (!moveableContructor.defaultStyled) {\r\n moveableContructor.makeStyled();\r\n }\r\n var _b = this.props, userAbles = _b.ables, userProps = _b.props, props = __rest(_b, [\"ables\", \"props\"]);\r\n var _c = __read(this._updateRefs(true), 2), refTargets = _c[0], nextSelectorMap = _c[1];\r\n var elementTargets = getElementTargets(refTargets, nextSelectorMap);\r\n var isGroup = elementTargets.length > 1;\r\n var totalAbles = moveableContructor.getTotalAbles();\r\n var ables = __spreadArray(__spreadArray([], __read(totalAbles), false), __read((userAbles || [])), false);\r\n var nextProps = __assign(__assign(__assign({}, props), (userProps || {})), { ables: ables, cssStyled: moveableContructor.defaultStyled, customStyledMap: moveableContructor.customStyledMap });\r\n this._elementTargets = elementTargets;\r\n var firstRenderState = null;\r\n var prevMoveable = this.moveable;\r\n var persistData = props.persistData;\r\n if (persistData === null || persistData === void 0 ? void 0 : persistData.children) {\r\n isGroup = true;\r\n }\r\n // Even one child is treated as a group if individualGroupable is enabled. #867\r\n if (props.individualGroupable) {\r\n return React.createElement(MoveableIndividualGroup, __assign({ key: \"individual-group\", ref: ref(this, \"moveable\") }, nextProps, { target: null, targets: elementTargets }));\r\n }\r\n if (isGroup) {\r\n var targetGroups = getTargetGroups(refTargets, nextSelectorMap);\r\n // manager\r\n if (prevMoveable && !prevMoveable.props.groupable && !prevMoveable.props.individualGroupable) {\r\n var target = prevMoveable.props.target;\r\n if (target && elementTargets.indexOf(target) > -1) {\r\n firstRenderState = __assign({}, prevMoveable.state);\r\n }\r\n }\r\n return React.createElement(MoveableGroup, __assign({ key: \"group\", ref: ref(this, \"moveable\") }, nextProps, (_a = props.groupableProps) !== null && _a !== void 0 ? _a : {}, { target: null, targets: elementTargets, targetGroups: targetGroups, firstRenderState: firstRenderState }));\r\n }\r\n else {\r\n var target_1 = elementTargets[0];\r\n // manager\r\n if (prevMoveable && (prevMoveable.props.groupable || prevMoveable.props.individualGroupable)) {\r\n var moveables = prevMoveable.moveables || [];\r\n var prevTargetMoveable = find(moveables, function (mv) { return mv.props.target === target_1; });\r\n if (prevTargetMoveable) {\r\n firstRenderState = __assign({}, prevTargetMoveable.state);\r\n }\r\n }\r\n return React.createElement(MoveableManager, __assign({ key: \"single\", ref: ref(this, \"moveable\") }, nextProps, { target: target_1, firstRenderState: firstRenderState }));\r\n }\r\n };\r\n InitialMoveable.prototype.componentDidMount = function () {\r\n this._checkChangeTargets();\r\n };\r\n InitialMoveable.prototype.componentDidUpdate = function () {\r\n this._checkChangeTargets();\r\n };\r\n InitialMoveable.prototype.componentWillUnmount = function () {\r\n this.selectorMap = {};\r\n this.refTargets = [];\r\n };\r\n /**\r\n * Get targets set in moveable through target or targets of props.\r\n * @method Moveable#getTargets\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: [targetRef, \".target\", document.querySelectorAll(\".target\")],\r\n * });\r\n *\r\n * console.log(moveable.getTargets());\r\n */\r\n InitialMoveable.prototype.getTargets = function () {\r\n var _a, _b;\r\n return (_b = (_a = this.moveable) === null || _a === void 0 ? void 0 : _a.getTargets()) !== null && _b !== void 0 ? _b : [];\r\n };\r\n /**\r\n * If the element list corresponding to the selector among the targets is changed, it is updated.\r\n * @method Moveable#updateSelectors\r\n * @example\r\n * import Moveable from \"moveable\";\r\n *\r\n * const moveable = new Moveable(document.body, {\r\n * target: \".target\",\r\n * });\r\n *\r\n * moveable.updateSelectors();\r\n */\r\n InitialMoveable.prototype.updateSelectors = function () {\r\n this.selectorMap = {};\r\n this._updateRefs();\r\n };\r\n /**\r\n * User changes target and waits for target to change.\r\n * @method Moveable#waitToChangeTarget\r\n * @story combination-with-other-components--components-selecto\r\n * @example\r\n * document.querySelector(\".target\").addEventListener(\"mousedown\", e => {\r\n * moveable.waitToChangeTarget().then(() => {\r\n * moveable.dragStart(e.currentTarget);\r\n * });\r\n * moveable.target = e.currentTarget;\r\n * });\r\n */\r\n InitialMoveable.prototype.waitToChangeTarget = function () {\r\n // let resolvePromise: (e: OnChangeTarget) => void;\r\n var _this = this;\r\n // this._onChangeTargets = () => {\r\n // this._onChangeTargets = null;\r\n // resolvePromise({\r\n // moveable: this.getManager(),\r\n // targets: this._elementTargets,\r\n // });\r\n // };\r\n // return new Promise(resolve => {\r\n // resolvePromise = resolve;\r\n // });\r\n var resolvePromise;\r\n this._onChangeTargets = function () {\r\n _this._onChangeTargets = null;\r\n resolvePromise();\r\n };\r\n return new Promise(function (resolve) {\r\n resolvePromise = resolve;\r\n });\r\n };\r\n InitialMoveable.prototype.waitToChangeTargets = function () {\r\n return this.waitToChangeTarget();\r\n };\r\n InitialMoveable.prototype.getManager = function () {\r\n return this.moveable;\r\n };\r\n InitialMoveable.prototype.getMoveables = function () {\r\n return this.moveable.getMoveables();\r\n };\r\n InitialMoveable.prototype.getDragElement = function () {\r\n return this.moveable.getDragElement();\r\n };\r\n InitialMoveable.prototype._updateRefs = function (isRender) {\r\n var prevRefTargets = this.refTargets;\r\n var nextRefTargets = getRefTargets((this.props.target || this.props.targets));\r\n var isBrowser = typeof document !== \"undefined\";\r\n var isUpdate = compareRefTargets(prevRefTargets, nextRefTargets);\r\n var selectorMap = this.selectorMap;\r\n var nextSelectorMap = {};\r\n this.refTargets.forEach(function updateSelectorMap(target) {\r\n if (isString(target)) {\r\n var selectorTarget = selectorMap[target];\r\n if (selectorTarget) {\r\n nextSelectorMap[target] = selectorMap[target];\r\n }\r\n else if (isBrowser) {\r\n isUpdate = true;\r\n nextSelectorMap[target] = [].slice.call(document.querySelectorAll(target));\r\n }\r\n }\r\n else if (isArray(target)) {\r\n target.forEach(updateSelectorMap);\r\n }\r\n });\r\n this._tmpRefTargets = nextRefTargets;\r\n this._tmpSelectorMap = nextSelectorMap;\r\n return [\r\n nextRefTargets,\r\n nextSelectorMap,\r\n !isRender && isUpdate,\r\n ];\r\n };\r\n InitialMoveable.prototype._checkChangeTargets = function () {\r\n var _a, _b, _c;\r\n this.refTargets = this._tmpRefTargets;\r\n this.selectorMap = this._tmpSelectorMap;\r\n var _d = this._differ.update(this._elementTargets), added = _d.added, removed = _d.removed;\r\n var isTargetChanged = added.length || removed.length;\r\n if (isTargetChanged) {\r\n (_b = (_a = this.props).onChangeTargets) === null || _b === void 0 ? void 0 : _b.call(_a, {\r\n moveable: this.moveable,\r\n targets: this._elementTargets,\r\n });\r\n (_c = this._onChangeTargets) === null || _c === void 0 ? void 0 : _c.call(this);\r\n }\r\n var _e = __read(this._updateRefs(), 3), refTargets = _e[0], selectorMap = _e[1], isUpdate = _e[2];\r\n this.refTargets = refTargets;\r\n this.selectorMap = selectorMap;\r\n if (isUpdate) {\r\n this.forceUpdate();\r\n }\r\n };\r\n InitialMoveable.defaultAbles = [];\r\n InitialMoveable.customStyledMap = {};\r\n InitialMoveable.defaultStyled = null;\r\n __decorate([\r\n withMethods(MOVEABLE_METHODS)\r\n ], InitialMoveable.prototype, \"moveable\", void 0);\r\n return InitialMoveable;\r\n}(React.PureComponent));\n\nvar Moveable = /*#__PURE__*/ (function (_super) {\r\n __extends(Moveable, _super);\r\n function Moveable() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Moveable.defaultAbles = MOVEABLE_ABLES;\r\n return Moveable;\r\n}(InitialMoveable));\n\nfunction makeMoveable(ables) {\r\n var _a;\r\n return _a = /*#__PURE__*/ (function (_super) {\r\n __extends(Moveable, _super);\r\n function Moveable() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return Moveable;\r\n }(InitialMoveable)),\r\n _a.defaultAbles = ables,\r\n _a;\r\n}\n\nexport { Clippable, DIRECTIONS, Draggable, edgeDraggable as EdgeDraggable, InitialMoveable, MOVEABLE_ABLES, MOVEABLE_EVENTS, MOVEABLE_METHODS, MOVEABLE_PROPS, Pinchable, Resizable, Rotatable, Roundable, Scalable, Snappable, Warpable, calculateElementPosition, Moveable as default, getElementInfo, makeAble, makeMoveable };\n//# sourceMappingURL=moveable.esm.js.map\n","import * as React from \"react\";\nimport Moveable from \"react-moveable\";\nimport { ref } from \"framework-utils\";\n\nexport default class InnerMoveable extends React.Component {\n public state: any = {};\n public moveable!: Moveable;\n constructor(props: any) {\n super(props);\n this.state = this.props;\n }\n public render(): React.ReactNode {\n return ;\n }\n}\n","import {\n MOVEABLE_PROPS,\n MOVEABLE_METHODS,\n MOVEABLE_EVENTS,\n} from \"react-moveable\";\n\nexport const PROPERTIES: string[] = MOVEABLE_PROPS;\nexport const METHODS: string[] = MOVEABLE_METHODS;\nexport const EVENTS: string[] = MOVEABLE_EVENTS;\n","import { ref, Properties } from \"framework-utils\";\nimport * as React from \"react\";\nimport { renderSelf, ContainerProvider } from \"croact\";\nimport InnerMoveable from \"./InnerMoveable\";\nimport {\n MoveableInterface,\n MoveableOptions, MoveableProperties,\n} from \"react-moveable/types\";\nimport { camelize, getDocument, isArray } from \"@daybrush/utils\";\nimport { MoveableEventsParameters } from \"./types\";\nimport { PROPERTIES, EVENTS, METHODS } from \"./consts\";\nimport EventEmitter from \"@scena/event-emitter\";\n/**\n * Moveable is Draggable! Resizable! Scalable! Rotatable!\n * @sort 1\n * @alias Moveable\n * @extends EventEmitter\n */\n@Properties(METHODS, (prototype, property) => {\n if (prototype[property]) {\n return;\n }\n prototype[property] = function(...args: any[]) {\n const self = this.getMoveable();\n\n if (!self || !self[property]) {\n return;\n }\n return self[property](...args);\n };\n})\n@Properties(PROPERTIES, (prototype, property) => {\n Object.defineProperty(prototype, property, {\n get() {\n return this.getMoveable().props[property];\n },\n set(value) {\n this.setState({\n [property]: value,\n });\n },\n enumerable: true,\n configurable: true,\n });\n})\nclass MoveableManager extends EventEmitter {\n private innerMoveable!: InnerMoveable | null;\n private containerProvider: ContainerProvider | null = null;\n private selfElement: HTMLElement | null = null;\n private _warp = false;\n /**\n *\n */\n constructor(parentElement: HTMLElement, options: MoveableOptions = {}) {\n super();\n const nextOptions = { ...options };\n\n const events: any = {};\n\n EVENTS.forEach(name => {\n events[camelize(`on ${name}`)] = (e: any) => this.trigger(name, e);\n });\n let selfElement!: HTMLElement;\n\n if (options.warpSelf) {\n delete options.warpSelf;\n this._warp = true;\n selfElement = parentElement;\n } else {\n selfElement = getDocument(parentElement).createElement(\"div\");\n parentElement.appendChild(selfElement);\n }\n this.containerProvider = renderSelf(\n as any,\n selfElement,\n );\n\n this.selfElement = selfElement;\n const target = nextOptions.target!;\n if (isArray(target) && target.length > 1) {\n this.updateRect();\n }\n }\n public setState(state: Partial, callback?: () => any) {\n this.innerMoveable!.setState(state, callback);\n }\n public forceUpdate(callback?: () => any) {\n this.innerMoveable!.forceUpdate(callback);\n }\n public dragStart(e: MouseEvent | TouchEvent) {\n const innerMoveable = this.innerMoveable;\n if ((innerMoveable as any).$_timer) {\n this.forceUpdate();\n }\n this.getMoveable().dragStart(e);\n }\n public destroy() {\n const selfElement = this.selfElement!;\n\n renderSelf(\n null,\n selfElement!,\n this.containerProvider,\n );\n if (!this._warp) {\n selfElement?.parentElement?.removeChild(selfElement);\n }\n this.containerProvider = null;\n\n this.off();\n this.selfElement = null;\n this.innerMoveable = null;\n }\n private getMoveable() {\n return this.innerMoveable!.moveable;\n }\n}\n\ninterface MoveableManager extends MoveableInterface, MoveableProperties {\n}\n\nexport default MoveableManager;\n","import MoveableManager from \"./MoveableManager\";\n\nexport default class Moveable extends MoveableManager {}\n","import { Able, DefaultProps } from \"react-moveable/types\";\nimport { getElementInfo as getElementInfoFunction, makeAble as makeAbleFunction } from \"react-moveable\";\n\nexport function getElementInfo(\n target: SVGElement | HTMLElement,\n container?: SVGElement | HTMLElement | null,\n rootContainer?: SVGElement | HTMLElement | null | undefined,\n) {\n return getElementInfoFunction(target, container, rootContainer);\n};\nexport function makeAble<\n Name extends string,\n AbleObject extends Partial>,\n>(name: Name, able: AbleObject) {\n return makeAbleFunction(name, able);\n}\n","import Moveable, * as modules from \"./index\";\n\nfor (const name in modules) {\n (Moveable as any)[name] = (modules as any)[name];\n}\n\nexport default Moveable;\n"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","constructor","create","__assign","assign","t","s","i","n","arguments","length","apply","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","__decorate","decorators","target","key","desc","c","r","getOwnPropertyDescriptor","Reflect","decorate","defineProperty","__values","o","Symbol","iterator","m","next","value","done","__read","ar","push","error","__spreadArray","to","from","pack","l","slice","concat","makeAble","name","able","events","props","DIRECTIONS4","DIRECTIONS","getSVGCursor","scale","degree","getCursorCSS","x1","degree45","Math","round","defaultCursor","agent","getAgent","IS_WEBKIT","browser","webkit","IS_WEBKIT605","navi","window","userAgent","navigator","res","exec","toLowerCase","parseFloat","browserName","browserVersion","parseInt","version","IS_CHROME","IS_CHROMIUM","chromium","chromiumVersion","IS_CHROMIUM109","IS_FIREFOX","IS_SAFARI_ABOVE15","webkitVersion","PREFIX","directionCSS","map","dir","top","left","originX","originY","offset","join","MOVEABLE_CSS","NEARBY_POS","FLOAT_POINT_NUM","TINY_NUM","MIN_SCALE","MAX_NUM","pow","MIN_NUM","DIRECTION_REGION_TO_DIRECTION","w","nw","ne","sw","se","DIRECTION_INDEXES","DIRECTION_ROTATIONS","MOVEABLE_METHODS","setCustomDrag","state","delta","isPinch","isConvert","ableName","_a","_b","result","gestos","move","inputEvent","datas","originalDatas","ableDatas","convertDragDist","parentEvent","CustomGesto","prevX","prevY","startX","startY","isDrag","isFlag","draggable","dragStart","client","type","drag","clientX","clientY","isFirstDrag","isPrevDrag","distX","distY","deltaX","deltaY","parentGesto","calculateElementPosition","matrix","origin","width","height","is3d","poses","calculatePoses","y1","_c","x2","y2","_d","x3","y3","_e","x4","y4","_f","calculatePosition","min","right","max","bottom","sx","sy","direction","sign","pos1","pos2","pos3","pos4","calculatePointerDist","moveable","moveableClientRect","rootMatrix","minus","calculateInversePosition","posX","posY","getDragDist","setDragStart","allMatrix","beforeMatrix","offsetMatrix","targetMatrix","transformOrigin","inverseMatrix","invert","inverseBeforeMatrix","absoluteOrigin","convertPositionMatrix","plus","startDragBeforeDist","calculate","startDragDist","getTransformDirection","beforeTransform","resolveTransformEvent","event","functionName","beforeRenderable","index","transformIndex","nextTransforms","nextTransformAppendedIndexes","nextIndex","findIndex","text","match","find","info","filter","convertTransformInfo","targetFunction","matFunctionName","beforeFunctionTexts","afterFunctionTexts","beforeFunctionMatrix","beforeTransform2","beforeFunctionMatrix2","targetTansform","targetFunctionMatrix","afterTransform","afterFunctionMatrix","afterTransform2","afterFunctionMatrix2","targetAllTransform","allFunctionMatrix","splice","isAppendTransform","isAppend","convertTransformFormat","dist","getTransformDist","getBeforeDragDist","bx","by","getTransfromMatrix","fromTranslation","isAfter","nextTargetMatrix","multiply","res1","afterTargetMatrix","isBefore","getInverseDragDist","calculateTransformOrigin","prevWidth","prevHeight","prevOrigin","pos","splitUnit","unit","prevSize","size","isNaN","measureRatio","getPosIndexesByDirection","indexes","getPosesByDirection","getPosBySingleDirection","ratio","dot","getPosByDirection","getDist","startPos","fixedDirection","fixedPos","getNextMatrix","getAbsoluteMatrix","getNextTransformMatrix","transform","isAllTransform","targetTransform","isString","convertDimension","parseMat","scaleMatrix","createScaleMatrix","fillTransformStartEvent","getBeforeRenderableDatas","setTransform","startTransforms","isArray","splitSpace","setTransformIndex","setDefaultTransformIndex","property","func","parse","v","offsetWidth","offsetHeight","startValue","functionValue","fillOriginalTransform","getNextTransforms","getNextTransformText","getNextStyle","nextStyle","fillTransformEvent","nextTransform","Draggable","fillCSSObject","getTranslateFixedPosition","fixedOffset","nextMatrix","nextFixedPosition","getDirectionOffset","getTranslateDist","fixedPosition","groupable","groupLeft","groupTop","getScaleDist","getDirectionByPos","fixedOffsetPosition","getRotateDist","rotateDist","getResizeDist","nextOrigin","getAbsolutePosition","getAbsolutePosesByState","getGestoData","targetGesto","controlGesto","data","getEventData","getShadowRoot","parentElement","getRootNode","rootNode","nodeType","getIndividualTransforms","getStyle","rotate","translate","individualTransforms","split","getMatrixStackInfo","container","checkContainer","el","matrixes","documentElement","getDocumentElement","getDocumentBody","requestEnd","isEnd","targetTransformOrigin","hasFixed","offsetContainer","getOffsetInfo","offsetParent","zoom","getCachedStyle","position","getElementTransform","isFixed","convertCSStoMatrix","getTransformMatrix","isOffsetEnd","isStatic","parentClientLeft","parentClientTop","fixedClientLeft","fixedClientTop","fixedInfo","hasTransform","fixedContainer","getPositionFixedInfo","length_1","convert3DMatrixes","getOffsetPosInfo","tagName","hasOffset","isSVG","origin_1","targetOrigin","offsetPos","offsetLeft","offsetTop","ownerSVGElement","getSVGMatrix","createIdentityMatrix","targetZoom","offsetInfo","offsetZoom","isCustomElement","parentSlotElement","customOffsetParent","customOffsetLeft","customOffsetTop","clientLeft","clientTop","margin","getBodyOffset","isElementTarget","scrollLeft","scrollTop","createOriginMatrix","cacheStyleMap","clientRectStyleMap","matrixContainerInfos","setStoreCache","useCache","Map","getCachedClientRect","clientRect","get","nextClientRect","getClientRect","set","getCachedMatrixContainerInfo","result_1","element","cache","nextStyle_1","getWindow","getComputedStyle","style","cached","fillChildEvents","groupableDatas","childDatas","moveables","_","isRequestChild","triggerChildGesto","isStart","childEvents","eventParams","ev","childMoveable","childEvent","childGestos","parentFlag","child","triggerChildAbles","eachEvent","callback","childs","startChildDist","parentDatas","startPositions","createRotateMatrix","rotation","PI","originalX","originalY","renderDirectionControlsByInfos","renderDirections","React","getState","renderPoses","rotationRad","getProps","degRotation","absDegree","directionMap","renderState","renderDirectionMap","forEach","directionSign","classNames","directionRotation","throttle","dataAttrs","getKeys","createElement","className","prefix","getControlTransform","renderDirectionControls","defaultDirections","directions","displayAroundControls","renderAroundControls","renderLine","_i","rad","getRad","getLineStyle","renderEdgeLines","edge","index1","index2","Boolean","getRenderDirections","renderDiagonalDirections","renderAllDirections","checkBoundPoses","bounds","verticalPoses","horizontalPoses","Infinity","nextBounds","vertical","checkBounds","horizontal","getBounds","externalBounds","containerClientRect","containerHeight","clientHeight","containerWidth","clientWidth","snapOffset","snapOffsetLeft","snapOffsetTop","snapOffsetRight","snapOffsetBottom","isCSS","_g","checkBoundKeepRatio","endPos","endX","endY","dx","dy","abs","isBottom","isRight","verticalInfo","isBound","horizontalInfo","a","y","x","isVertical","startBoundPos","endBoundPos","minPos","maxPos","boundInfos","sort","isBoundRotate$1","relativePoses","boundRect","nextPoses","some","boundRotate","vec","boundPos","getDistSize","nextPos","sqrt","checkRotateBounds","prevPoses","relativeLeft","relativeRight","relativeTop","relativeBottom","relativeRad1","relativeRad2","nextRad","VERTICAL_NAMES","HORIZONTAL_NAMES","SNAP_SKIP_NAMES_MAP","VERTICAL_NAMES_MAP","start","end","center","HORIZONTAL_NAMES_MAP","getInitialBounds","hasGuidelines","snappable","innerBounds","verticalGuidelines","horizontalGuidelines","snapGridWidth","snapGridHeight","guidelines","enableSnap","getSnapDirections","snapDirections","mapSnapDirectionPoses","snapPoses","nextSnapDirections","nextSnapPoses","name_1","splitSnapDirectionPoses","horizontalNames","verticalNames","calculateContainerPos","containerRect","clientPos","solveLineConstants","point1","point2","TINY_NUM$1","checkMoveableSnapPoses","posesX","posesY","dirXs","dirYs","customSnapThreshold","snapThresholdMultiples","snapThresholdInfo","multiples","snapThreshold","selectValue","checkSnapPoses","checkSnap","checkSnapKeepRatio","getTinyDist","isSnap","verticalSnapInfo","horizontalSnapInfo","posInfos","getNearestSnapGuidelineInfo","isVerticalSnap","verticalGuideline","guideline","isHorizontalSnap","horizontalGuideline","horizontalPos","verticalPos","getStringDirection","stringDirection","checkSnaps","rect","horizontalDirection","verticalDirection","snapInfo","posInfo","guidelineInfo","guidelineInfos","targetType","targetPoses","dirs","posType","snapPosInfos","targetPos","snapPosInfo","getSnapInfosByDirection","snapDirection","arr","nextDir","keepRatio","xs","ys","checkSnapBoundPriority","aDist","bDist","getNearOffsetInfo","offsets","aSign","bSign","aOffset","bOffset","getCheckSnapDirections","endDirection_1","signX","signY","nextDirection","signs","isStartLine","line","cx","average","cy","hitTestLine","test1","test2","isSameStartLine","dots","centerSign","every","checkInnerBoundDot","threshold","checkInnerBound","verticalSign","horizontalSign","lineConstants","isAllBound","isVerticalBound","isHorizontalBound","leftLine","topLine","rightLine","bottomLine","topBoundInfo","checkLineBoundCollision","bottomBoundInfo","leftBoundInfo","rightBoundInfo","isAllVerticalBound","isAllHorizontalBound","verticalOffset","maxOffset","horizontalOffset","boundLine","isRender","dot1","boundDot1","boundDot2","dy2","dx2","hasDx","hasDy","slope","getInnerBoundInfo","lineInfos","multiple","sizeOffset","getInnerBoundDragInfo","lines","getCheckInnerBoundLineInfos","innerBoundInfo","widthOffsetInfo","heightOffsetInfo","getCheckSnapLineDirections","lineDirections","virtualPoses","dir1","dir2","virtualLine","isBoundRotate","boundDots","getDistPointLine","solveReverseLine","checkRotateInnerBounds","dotInfos","lineRad","lineDist","dotDist","dotRad","distRad","acos","nextRad1","nextRad2","reduce","prev","cur","checkInnerBoundPoses","boundMap","getRect","lineInfo","isHorizontalStart","isVerticalStart","solveEquation","solveNextOffset","isOutside","getDist$1","dist1","dist2","widthOffset","heightOffset","getSnapBound","boundInfo","checkThrottleDragRotate","throttleDragRotate","_h","offsetX","offsetY","adjustPoses","adjustPos","prevDistY","checkSnapBoundsDrag","ignoreSnap","getAbsolutePoses","absolutePoses","boundPoses","middle","checkMoveableSnapBounds","verticalSnapBoundInfo","horizontalSnapBoundInfo","verticalInnerBoundInfo","horizontalInnerBoundInfo","horizontalBoundInfos","verticalBoundInfos","horizontalDist","verticalDist","snapIndex","snap","checkSnapBounds","guideines","checkSnapRightLine","snapBoundInfo","rad180","isHorizontalLine","isVerticalLine","getSnapBoundInfo","isRequest","startDirection","endDirection","otherStartPos","otherEndPos","checkSnapBoundsKeepRatio","otherHorizontalOffset","isOtherHorizontalBound","isOtherHorizontalSnap","otherVerticalOffset","isOtherVerticalBound","isOtherVerticalSnap","snapLine","getSnapBoundOffset","horizontalBoundInfo","verticalBoundInfo","checkMaxBounds","maxWidth","maxHeight","left_1","top_1","right_1","bottom_1","otherDirection","isCheckVertical","isCheckHorizontal","otherPos","deg","nextOtherPos","isHeightOutside","isWidthOutside","requestStyle","requestChildStyle","render","hideThrottleDragRotateLine","dragInfo","beforeOrigin","startCheckSnapDrag","prevDist","prevBeforeDist","deltaOffset","params","fillParams","triggerEvent","startRect","useSnap","isGroup","parentThrottleDrag","parentMoveable","throttleDrag","dragRotateRad","startDragRotate","ry","cos","rx","sin","beforeTranslate","throttleArray","beforeDist","beforeDelta","passDelta","passDist","num","dragAfter","dragEnd","param","fillEndParams","dragGroupStart","nextParams","targets","throttleOffset","dragGroup","dragGroupEnd","request","isControl","requestStart","unset","getFixedDirectionInfo","getOffsetFixedDirectionInfo","nextFixedOffset","getOffsetFixedPositionInfo","offsetFixedPosition","directionCondition$2","getDirectionCondition","Resizable","ableGroup","canPinch","dragControlCondition","viewClassName","getDirectionViewClassName","dragControlStart","parentDirection","parentFixedDirection","getTotalDirection","resizable","startOffsetWidth","startOffsetHeight","minSize","startWidth","inlineCSSWidth","cssWidth","startHeight","inlineCSSHeight","cssHeight","maxSize","minOffsetWidth","minOffsetHeight","maxOffsetWidth","maxOffsetHeight","startOffsetMatrix","startTransformOrigin","isWidth","parentIsWidth","setRatio","isFinite","setFixedDirection","setFixedPosition","setMin","convertUnitSize","setMax","nextMaxSize","isNumber","startRatio","setOrigin","startFixedDirection","startFixedPosition","isResize","snapRenderInfo","dragControl","parentKeepRatio","dragClient","parentDist","resolveMatrix","targetN","nextAllMatrix","resizeFormat","throttleResize","keepRatioFinally","sizeDirection","distWidth","distHeight","getNextBoundingSize","nextSize","getOffsetSizeDist","nextWidth","nextHeight","boundingWidth","boundingHeight","nextFixedDirection","setSize","snapDist","checkSnapResize","computeSize","isNoSnap","calculateBoundSize","inverseDelta","fillAfterTransform","dragControlAfter","checkResizableError","errorWidth","errorHeight","isErrorWidth","isErrorHeight","dragControlEnd","dragGroupControlCondition","dragGroupControlStart","originalEvents","parentStartOffsetWidth","parentStartOffsetHeight","updateGroupMin","originalMinSize","childMinSize","childStartOffsetWidth","childStartOffsetHeight","parentMinWidth","parentMinHeight","updateGroupMax","originalMaxSize","childMaxSize","parentMaxWidth","parentMaxHeight","dragGroupControl","catchEvent","parentScale","dragGroupControlEnd","deltaWidth","deltaHeight","setRotateStartInfo","startAbsoluteOrigin","prevDeg","defaultDeg","prevSnapDeg","loop","startDist","getAbsoluteDist","normalizedPrevDeg","floor","getAbsoluteDistByClient","getRotateInfo","moveableRect","throttleRotate","snapRotation","checkSnapRotate","snapDeg","getRotationPositions","rotationPosition","radPoses","getRotationRad","isReverse","requestAble","hasClass","rotateAroundControls","rotationTarget","getRefTargets","contains","css","Rotatable","isDragging","rotatable","resolveAblesWithRotatable","positions","jsxs","ables","resolveMap_1","directionControlInfos","resolve","parentRotate","beforeDirection","resizeStart","startClientX","startClientY","externalRotate","beforeInfo","afterInfo","absoluteInfo","inputTarget","regionDirection","getAttribute","controlDirection","isAroundControl","resolveAble","clientPoses","calculateMoveableClientPositions","originalFixedPosition_1","getOrigin","fixedBeforeOrigin","fixedAfterOrigin","posDelta","parentPosition","controlPosition","parentFixedPosition","getTotalOrigin","rotatation","isRotate","clientDistX","clientDistY","groupDelta","targetDirection","beforeRotation","absoluteDelta","absoluteDist","absoluteRotation","startRotation","absoluteStartRotation","nextClientX","nextClientY","setRotation","nextRotation","inverseDist","prevInverseDist","requestValue","dragEvent","transformEvent","parentDistance","resize","undefined","resizeEvent","beforeRotate","absoluteRotate","parentLeft","parentTop","parentBeforeOrigin","childClient","startGroupClient","groupClient","prevClientX","prevClientY","setGroupRotation","distRotate","getRotation","deltaRotate","renderGuideline","isHorizontal","scaleType","renderInnerGuideline","sizeValue","posValue","renderSnapPoses","renderPos","renderGuidelines","targetRect","isDisplayInnerSnapDigit","mainNames","targetStart","targetEnd","hide","elementRect","renderDigitLine","lineType","gap","snapDigit","isDisplaySnapDigit","snapDistFormat","sizeName","absGap","snapSize","toFixed","groupByElementGuidelines","otherIndex","names","groupBy","nextGuidelines","inner","elementRect1","elementRect2","nextPos1","nextPos2","elementDirection","total","renderDashedGuidelines","rendered","groups","sideNames","sidePos","prevRect","nextRect","size1","size2","renderPos1","renderPos2","renderGapGuidelines","targetSideStart","targetSideEnd","gapRects","sideStartPos","sideEndPos","sideCenterPos","getTotalGuidelines","overflow","scrollHeight","scrollWidth","containerClientHeight","containerClientWidth","snapGap","maxSnapElementGuidelineDistance","isDisplayGridGuidelines","elementGuidelines","getElementGuidelines","totalGuidelines","getGapGuidelines","getGridGuidelines","getDefaultGuidelines","checkBetweenRects","snapThresholds","maxSnapElementGapDistance","elementRects","gapGuidelines","targetCenter","targetStart2","targetEnd2","snapThresholdMap","nextElementRects","snapRect1","snapRect2","rect1","rect2","rect1Start","rect1End","rect2Start","rect2End","isCenter","startGridGroupGuidelines","snapGridAll","hasDirection","rect_1","children_1","children","posName","clientOffset","rectSize","rectPos","childSizes","flat$1","firstChildSize","childSnapSizes","rectRatio","childSize","startOffset","defaultSnapGridWidth","defaultSnapGridHeight","pushGuideline","grid","distance","prevValues","snapRect","refresh","nextElementGuidelines","isObject","getRefTarget","diff","maintained","added","nextValues","prevIndex","getSnapElementRects","elementSnapDirections","topValue","leftValue","rightValue","bottomValue","centerValue","middleValue","rectTop","rectLeft","sizes","getObjectGuidelines","containerSize","posGuideline","snapWidth","snapHeight","values","offsetDelta","containerLeft","containerTop","getBoundingClientRect","elementLeft","elementTop","elementRight","elementBottom","checkSnapInfo","snapContainer","snapContainerTarget","snapContainerRect","offset1","getDragDistByState","offset2","getNextFixedPoses","nextFixedPos","normalized","getSizeOffsetInfo","innerBoundLineInfos","recheckSizeByTwoDirection","snapPos","nextWidthOffset","nextHeightOffset","checkSizeDist","getNextPoses","isWidthBound","isHeightBound","widthDist","heightDist","isGetWidthOffset","bumpDegree","baseDeg","count","deg1","deg2","getMinDegreeDistance","deg3","snapRotationThreshold","NAME_snapRotationThreshold","snapRotationDegrees","NAME_snapRotationDegrees","origin2_1","rad_1","sorted","firstDegree","checkSnapScale","sizeDist","getSnapGuidelines","addBoundGuidelines","verticalSnapPoses","horizontalSnapPoses","innerBoundMap","verticalInnerBoundPoses","horizontalInnerBoundPoses","innerPos","directionCondition$1","Snappable","dragRelation","targetTop","targetLeft","snapRenderThreshold","watchValue","JSON","stringify","minLeft","minTop","externalPoses","snapInfos","hasExternalPoses","externalRect","verticalPosInfos","horizontalPosInfos","allGuidelines","elements","gaps","nextBoundMap","nextInnerBoundMap","pinchStart","multiply2","prefixNames","defaultSync","fn","multiplies","measureSVGSize","viewBox","getSVGViewBox","getBeforeTransformOrigin","relativeOrigin","getTransformOrigin","getTransformOriginArray","computedTransform","list","baseVal","_loop_1","chr","lastParent","isParent","checkZoom","getTargetStyle","hasSlot","assignedSlotParentElement","assignedSlot","targetPosition","willChange","slotParentNode","parentNode","targetParentNode","host","isUndefined","getSVGGraphicsOffset","getBodyStyle","bodyPosition","marginLeft","marginTop","body","makeMatrixCSS","convertMatrixtoCSS","viewBoxWidth","viewBoxHeight","scaleX","scaleY","preserveAspectRatio","align","meetOrSlice","svgOrigin","xAlign","yAlign","scaleDimension","isGTarget","getBBox","isFillBox","bbox","rectWidth","rectHeight","calculateRect","getSVGOffset","targetInfo","getSize","mat","prevLeft","prevTop","posOrigin","rectOrigin","mat2","nextLeft","nextTop","distLeft","distTop","rootClientRect","rootPoses","getDiagonalSize","self","contentWidth","contentHeight","minWidth","minHeight","svg","targetStyle","boxSizing","borderLeft","borderRight","borderTop","borderBottom","paddingLeft","paddingRight","paddingTop","paddingBottom","horizontalPadding","verticalPadding","horizontalBorder","verticalBorder","getParentStyle","between","resetClientRect","getExtendsRect","isRoot","extendsRect","getClientRectByPosition","base","isExtends","baseTop","baseLeft","convertTransformOriginArray","getDirection","direciton","unsetAbles","unsetGesto","gestoName","gesto","isIdle","resolvedEvent","cssText","decamelize","prevEvent","nextEvent","isBeforeEvent","currentTarget","isTrusted","stopAble","isEventStart","stopDrag","stop","isStartEvent","lastEvent","isDouble","_emitter","on","isManager","pseudoElt","filterAbles","methods","triggerAblesSimultaneously","enabledAbles","ableGroups","method","equals","a1","a2","groupKeys","groupKey","keyIndex","group","groupByMap","flat","args","calculatePadding","xAdded","yAdded","nextAdded","convertCSSSize","isRelative","checkAbles","transforms","matrixInfos","beforeFunctionTexts2","targetFunctionText","afterFunctionTexts2","beforeFunctions","beforeFunctions2","afterFunctions","afterFunctions2","targetFunctions","toMat","isArrayFormat","isNode","isSelector","document","querySelector","isFunction","isWindow","current","userTargets","querySelectorAll","getAbsoluteRotation","calculateMatrixDist","getSizeDistByDist","startSize","standardRad","signSize","startWidthSize","startHeightSize","secondRad","atan2","firstRad","distSize","pinchScale","directionsDists","directionRatios","ratioDistance","dist_1","convertTransformUnit","xy","leftOrigin","rightOrigin","originObject","nextOriginObject","rotatePosesInfo","isDeepArrayEquals","arr1","arr2","value1","value2","isArray1","isArray2","nextValue","valueKey","defaultValue","store","_store","prevValue","countEach","counter","getPaddingBox","padding","Pinchable","angle","pinchable","eventName","controlEventName","pinchAbles","controlAbles","ableEvent","pinch","pinchEnd","pinchGroupStart","pinchGroup","pinchGroupEnd","directionCondition","Scalable","setMinScaleSize","minScaleSize","setMaxScaleSize","maxScaleSize","isScale","throttleScale","tempScaleValue","getNextScale","stateDirection","setScale","nextScale","distSign","isSelfPinch","startOffsetSize","scaleSize","distText","scaleText","isZeroScale","scaleEndParam","moveableScale","getMiddleLinePos","getTriangleRad","rad1","rad2","isValidPos","poses1","poses2","pi","Warpable","scalable","warpable","linePosFrom1","linePosFrom2","linePosFrom3","linePosFrom4","linePosTo1","linePosTo2","linePosTo3","linePosTo4","warpTargetMatrix","targetInverseMatrix","ignoreDimension","prevMatrix","posIndexes","isWarp","selectedPoses","nearByPoses","h","createWarpMatrix","afterMatrix","totalMatrix","AREA_PIECES","AREA_PIECE","AVOID","VIEW_DRAGGING","restoreStyle","areaElement","removeClass","renderPieces","DragArea","dragArea","passDragArea","ref","isDragArea","rects","nextElementSibling","addClass","disableNativeEvent","enableNativeEvent","requestAnimationFrame","Origin","originStyle","getDefaultScrollPosition","scrollContainer","Scrollable","getContainer","scrollOptions","dragScroll","DragScroll","scrollContainerElement","scrollBy","getCurrentEvent","checkScroll","scrollThreshold","scrollThrottleTime","getScrollPosition","throttleTime","dragGroupControEnd","Default","Padding","paddingDirections","paddingPos1","paddingPos2","paddingPos3","paddingPos4","RADIUS_DIRECTIONS","calculateRatio","sumSize","sumRatio","HORIZONTAL_RADIUS_ORDER","VERTICAL_RADIUS_ORDER","HORIZONTAL_RADIUS_DIRECTIONS","VERTICAL_RADIUS_DIRECTIONS","getRadiusStyles","clipStyles","radiusPoses","virtual","raws","rawPos","styles","getRadiusRange","controlPoses","horizontalRange","verticalRange","clipPose","sub","getRadiusValues","minCounts","full","splitIndex","splitLength","horizontalValues","verticalValues","horizontalValuesLength","verticalValuesLength","hasVerticalValues","nwValue","neValue","seValue","_j","swValue","_k","_l","wnValue","_m","enValue","_o","esValue","_p","wsValue","horizontalRawPoses","verticalRawPoses","nextHorizontalPoses","nextVerticalPoses","raw","removeRadiusPos","startIndex","radiuslIndex","deleteCount","addRadiusPos","horizontalIndex","verticalIndex","radiusX","radiusY","startVerticalIndex","splitRadiusPoses","horizontals","verticals","CLIP_DIRECTIONS","CLIP_RECT_DIRECTIONS","getClipStyles","clipPath","clipRelative","clipType","clipPoses","isRect","isCircle","subWidth","subHeight","getRectPoses","dirx","diry","getControlSize","xRange","yRange","getClipPath","defaultClip","customClip","clipText","splitBracket","clipPrefix","splitter","splitComma","xPos","yPos","minMaxs","getMinMaxs","minX","maxX","minY","maxY","radiusX_1","radiusY_1","radius","xRadius","yRadius","centerPos_1","roundIndex","rectLength","radiusValues","_q","_r","_s","top_2","_t","nextRight","nextBottom","_u","top_3","moveControlPos","dists","verticalDirections","horizontalDirections","verticalDirection_1","horizontalDirection_1","fixedIndex","nextDist","nextControlPoses_1","controlPose","controlDir","dirDir","dirHorizontal","dirVertical","addClipPath","clipIndex","clipStyle","clipEventType","removeClipPath","Clippable","customClipPath","defaultClipPath","clipArea","clipPathState","snapBoundInfos","calculatedPos","controls","isInset","isPolygon","linePoses_1","clipLeft","clipTop","ellipseClipPath","piece","areaPoses","allWidth","allHeight","allLeft_1","allTop_1","directionType","snapPos1","snapPos2","dragWithClip","isDragTarget","isClipStart","isLine","isArea","originalDraggable","originalDist","firstDist","isDragWithTarget","isAll","guidePoses","isEllipse","guideRect","clipHorizontalGuidelines","clipVerticalGuidelines","guideXPoses","guideYPoses","rectPoses","rectDists_1","boundDelta","clipTargetBounds","snapOffsetY","snapOffsetX","distSnapX","distSnapY","width_1","height_1","nextControlPoses_2","j","nextClipStyles","dragDist","OriginDraggable","startOrigin","startTargetOrigin","isDragOrigin","originRelative","distOrigin","dragDelta","deltaOrigin","addBorderRadiusByLine","lineIndex","horizontalsLength","verticalsLength","controlIndex","controlPoseInfo","addBorderRadius","removeBorderRadius","getBorderRadius","borderRadius","triggerRoundEvent","roundRelative","borderRadiusState","getStyleBorderRadius","firstMoveable","firstTarget","getTargets","Roundable","roundClickable","minRoundControls","maxRoundControls","roundPadding","isDisplayShadowRoundControls","verticalCount","horizontalCount","basePos","originalPos","isDisplayVerticalShadow","isDisplay","display","indexAttr","replace","isRound","selectedControlPose","selectedVertical","selectedHorizontal","pose","poseDist","isIdentityMatrix","identityMatrix","BeforeRenderable","inlineTransform","cssMatrix","startTransform","resetStyle","fillDragStartParams","fillDragParams","_this","Renderable","fillDragEndParams","transformObject","matrixInfo","triggerAble","moveableAbles","eventOperations","eventAffix","eventType","requestInstant","requestAble_1","elementFromPoint","isDragStop","isFirstStart","updateRect","gestoType","prevGesto","trigger","conditionName","nextDatas","off","forceEndedCount","updatedCount","eventOperation","eventAbles","results","isUpdate","isForceEnd","preventDefault","isUnmounted","flushSync","forceUpdate","checkMoveableTarget","eventTarget","dragTargetElement","_dragTarget","isMoveableElement","controlBox","getTargetAbleGesto","moveableTarget","dragTarget","dragTargetSelf","getAbleGesto","ableType","conditionFunctions","isTargetAbles","pinchOutside","pinchThreshold","preventClickEventOnDrag","preventClickDefault","checkInput","dragFocusedInput","dragContaienrOption","dragContainer","options","preventRightClick","preventWheelClick","getControlBoxElement","preventClickEventOnDragStart","preventClickEventByCondition","Gesto","isPinchScheduled","stopPropagation","EventManager","_onEvent","addEventListener","setAbles","destroy","removeEventListener","calculateMatrixStack","rootContainer","isAbsolute3d","prevTargetMatrix","containerZoom","rootMatrixes","isRoot3d","offsetRootContainer","rootZoom","isNext3d","isSVGGraphicElement","nextRootMatrixes","reverse","originalRootContainer","endContainer","rootMatrixBeforeOffset","nextInfo","isMatrix3d","originalRootMatrix","hasZoom","calculateElementInfo","allResult","getElementInfo","getMoveableTargetInfo","moveableElement","parentContainer","requestStyles","targetClientRect","rootContainerClientRect","getStyle_1","beforePosition","absoluteTargetPosition","absoluteContainerPosition","containerClientRectLeft","containerClientRectTop","containterClientLeft","containerClientTop","clientDelta","originalBeforeOrigin","getPersistState","isPersisted","MoveableManager","_super","renderLines","targetAbles","isMoveableMounted","EventEmitter","_prevOriginalDragTarget","_originalDragTarget","_prevDragTarget","_prevPropTarget","_propTarget","_prevDragArea","_isPropTargetChanged","_hasFirstTarget","_reiszeObserver","_observerId","_mutationObserver","_rootContainer","_viewContainer","_viewClassNames","checkUpdateRect","cancelAnimationFrame","_onPreventClick","propsTarget","cspNonce","translateZ","ControlBoxElement","cssStyled","linePadding","controlPadding","_checkUpdateRootContainer","checkUpdate","updateRenderPoses","stateTarget","groupTargets","ableAttributes","getEnabledAbles","ableClassName","_getAbleClassName","isVisible","firstRenderState","persistData","useAccuratePosition","onClick","renderAbles","_renderLines","componentDidMount","_checkUpdateViewContainer","_updateTargets","_updateNativeEvents","_updateEvents","updateCheckInput","_updateObserver","componentDidUpdate","prevProps","componentWillUnmount","disconnect","viewContainer","_changeAbleViewClassNames","manager","getAble","wrapperMoveable","getDragElement","triggerDragStart","hitTest","points","fitPoints","getOverlapSize","totalSize","getAreaSize","isInside","isTarget","isSetState","isSingle","nextState","_getRequestStyles","persistState","name_2","updateState","updateTarget","statePos","getManager","isInstant","allAbles","requsetAble","ableRequester","requester","ableParam","getMoveables","stateLeft","stateTop","renderPos3","renderPos4","zoomOffset","stateContainer","updateAbles","isTargetChanged","isChanged","moveableContainer","waitToChangeTarget","Promise","useCSS","tag","customStyleMap","customStyledMap","styled","hasControlBox","updateSelectors","setState","name_3","always","Renderer","styleNames","ableStyleNames","_updateResizeObserver","_updateMutationObserver","controlBoxElement","hasTargetAble","hasControlAble","isUnset","_isTargetChanged","hideDefaultLines","hideChildMoveableDefaultLines","useDragArea","nextTarget","prevTarget","prevDragArea","isDragTargetChanged","isDragAreaChanged","eventKeys","hasAbles","viewContainerOption","_getAbleViewClassNames","nextClassNames","prevClassNames","diff$1","removed","classPrefix","targetGestoData","controlGestoData","trim","win","ResizeObserver","useResizeObserver","observer","observe","box","MutationObserver","useMutationObserver","records","e_1","records_1","records_1_1","mutation","attributeName","e_1_1","return","attributes","defaultProps","isWrapperMounted","warpSelf","Groupable","renderGroupRects","persistDatChildren","getRequestChildStyles","refs","Clickable","containsElement","containsTarget","targetIndex","parentTarget","getDraggableEvent","edgeDraggable","dragCondition","dragGroupCondition","IndividualGroupable","MOVEABLE_ABLES","MOVEABLE_EVENTS","pushSet","MOVEABLE_PROPS","solveConstantsDistance","solveC","getMaxPos","getMinPos","getGroupRect","parentPoses","fixedRotation","a1_1","tan","a2_1","a1MinMax_1","a1MinMaxPos_1","a2MinMax_1","a2MinMaxPos_1","a1Dist","a2Dist","a1MinPos","a1MaxPos","a2MinPos","a2MaxPos","minHorizontalLine","maxHorizontalLine","minVerticalLine","maxVerticalLine","line1","line2","getIntersectionPointsByConstants","minX_1","minY_1","maxX_1","maxY_1","changedX","findMoveableGroups","childTargetGroups","targetGroup","childMoveableGroups","checked","finded","MoveableGroup","differ","ChildrenDiffer","_targetGroups","_hasFirstTargets","checkeds","targetGroups","moveableGroups","useDefaultGroupRotate","isReset","updateGroup","defaultGroupRotate","persistedRoatation","getMoveableGroupRect","parentRotation","posesRotations","rotations","groupRotation","firstRotation","isSameRotation","groupPoses","groupRect","rootGroupRect","defaultGroupOrigin","posesInfo","rotateScale","update","changed","isContainerChanged","MoveableIndividualGroup","canPersist","individualProps","individualGroupableProps","dragElement","getElementTargets","refTargets","selectorMap","elementTargets","getTargetGroups","compareRefTargets","prevRefTargets","nextRefTargets","InitialMoveable","_differ","_elementTargets","_tmpRefTargets","_tmpSelectorMap","_onChangeTargets","makeStyled","cssMap","getTotalAbles","defaultStyled","prefixCSS","defaultAbles","moveableContructor","userAbles","userProps","_updateRefs","nextSelectorMap","totalAbles","nextProps","prevMoveable","individualGroupable","groupableProps","target_1","prevTargetMoveable","mv","_checkChangeTargets","resolvePromise","waitToChangeTargets","isBrowser","updateSelectorMap","selectorTarget","onChangeTargets","withMethods","Moveable","InnerMoveable","PROPERTIES","METHODS","EVENTS","containerProvider","selfElement","_warp","nextOptions","camelize","getDocument","appendChild","renderSelf","innerMoveable","$_timer","getMoveable","removeChild","Properties","enumerable","configurable","getElementInfoFunction","makeAbleFunction","modules"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,MAAf,CAAsBe,SAAtB,GAAkC,IAAlC,CAAA;IACA+C,IAAAA,QAAQ,CAACtE,KAAT,CAAe6sB,QAAf,GAA0B,IAA1B,CAAA;IACH,GAAA;IA5SW,CAAhB,CAAA;IA8SA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IAEA,SAAS0C,qBAAT,CAA+Bja,cAA/B,EAA+ClL,cAA/C,EAA+D;IAC3D,EAAA,IAAI4C,aAAa,GAAG/C,iBAAiB,CAACqL,cAAD,EAAiBlL,cAAjB,CAArC,CAAA;IACA,EAAA,IAAIuC,WAAW,GAAG,CAAC,CAAD,EAAI,CAAJ,CAAlB,CAAA;MACA,OAAO;IACHK,IAAAA,aAAa,EAAEA,aADZ;IAEH5C,IAAAA,cAAc,EAAEA,cAFb;IAGHuC,IAAAA,WAAW,EAAEA,WAAAA;OAHjB,CAAA;IAKH,CAAA;;IACD,SAAS6iB,2BAAT,CAAqCxvB,KAArC,EAA4CoK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A3eQ;MAghBZ+B,KAAK,EAAE,UAAUhrB,QAAV,EAAoB;IACvBA,IAAAA,QAAQ,CAACtE,KAAT,CAAeQ,MAAf,CAAsBgwB,SAAtB,GAAkC,IAAlC,CAAA;IACH,GAAA;IAlhBW,CAAhB,CAAA;IAohBA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IAEA;IACA;IACA;IACA;IACA;;IACA,SAAS6F,kBAAT,CAA4B/xB,QAA5B,EAAsC3D,KAAtC,EAA6CiB,OAA7C,EAAsDC,OAAtD,EAA+D0e,IAA/D,EAAqE;IACj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EAAE,IAAA;aAA/B,CAAA;IACH,OAAA;SAhBL,CAAA;IAkBH,GAAA;IA7ZW,CAAhB,CAAA;IA+ZA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IAEA,SAASw7B,eAAT,CAAyBj2B,IAAzB,EAA+BkP,KAA/B,EAAsC;IAClC,EAAA,IAAIzV,EAAJ,CAAA;;IACA,EAAA,IAAI0D,SAAS,GAAG6C,IAAI,CAAC7C,SAArB;IAAA,MAAgC2S,UAAU,GAAG9P,IAAI,CAAC8P,UAAlD;IAAA,MAA8DlN,IAAI,GAAG5C,IAAI,CAAC4C,IAA1E;IAAA,MAAgFJ,GAAG,GAAGxC,IAAI,CAACwC,GAA3F;IAAA,MAAgGwG,IAAI,GAAGhJ,IAAI,CAACgJ,IAA5G;IAAA,MAAkH7V,GAAG,GAAG6M,IAAI,CAAC7M,GAA7H,CAAA;IACA,EAAA,IAAI+iC,YAAY,GAAG/4B,SAAS,KAAK,YAAjC,CAAA;MACA,IAAIg5B,SAAS,GAAGD,YAAY,GAAG,GAAH,GAA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Z4xB,mBAAmB,EAAE,UAAU5xB,QAAV,EAAoB;QACrC,IAAKgrB,CAAAA,KAAL,CAAWhrB,QAAX,CAAA,CAAA;OAhMQ;MAkMZgrB,KAAK,EAAE,UAAUhrB,QAAV,EAAoB;IACvB,IAAA,IAAItE,KAAK,GAAGsE,QAAQ,CAACtE,KAArB,CAAA;QACAA,KAAK,CAACud,UAAN,GAAmB,KAAnB,CAAA;QACAvd,KAAK,CAACsd,UAAN,GAAmB,EAAnB,CAAA;QACAtd,KAAK,CAACyyB,cAAN,GAAuB,IAAvB,CAAA;QACAzyB,KAAK,CAACuhC,YAAN,GAAqB,EAArB,CAAA;IACH,GAAA;IAxMW,CAAhB,CAAA;IA0MA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;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AQ,CAACA,QAAQ,CAAC,EAAD,EAAKU,CAAL,CAAT,EAAkB;IAAEu1B,MAAAA,OAAO,EAAEzqB,QAAQ,CAACxI,KAAT,CAAeizB,OAAAA;IAA1B,KAAlB,CAA7B,CAAP,CAAA;OAlG8B;IAoGlC6pB,EAAAA,aAAa,EAAE,UAAUt0C,QAAV,EAAoB9K,CAApB,EAAuB;IAClC,IAAA,OAAO,IAAKi/C,CAAAA,QAAL,CAAcn0C,QAAd,EAAwBxL,QAAQ,CAACA,QAAQ,CAAC,EAAD,EAAKU,CAAL,CAAT,EAAkB;IAAEu1B,MAAAA,OAAO,EAAEzqB,QAAQ,CAACxI,KAAT,CAAeizB,OAAAA;IAA1B,KAAlB,CAAhC,CAAP,CAAA;IACH,GAAA;IAtGiC,CAAd,CAAxB,CAAA;IAwGA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IAEA,IAAI8pB,kBAAkB,GAAGhpB,qBAAqB,CAAC,UAAD,CAA9C,CAAA;IACA;IACA;IACA;IACA;IACA;;IACA,IAAIipB,Q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GAAA;IAtYU,CAAf,CAAA;IAwYA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IAEA,SAAS4sB,gBAAT,CAA0Bl2C,IAA1B,EAAgCC,IAAhC,EAAsC;MAClC,OAAOD,IAAI,CAAC3F,GAAL,CAAS,UAAU8K,GAAV,EAAelQ,CAAf,EAAkB;IAAE,IAAA,OAAO8Q,GAAG,CAACZ,GAAD,EAAMlF,IAAI,CAAChL,CAAD,CAAV,EAAe,CAAf,EAAkB,CAAlB,CAAV,CAAA;IAAiC,GAA9D,CAAP,CAAA;IACH,CAAA;;IACD,SAASkhD,cAAT,CAAwBn2C,IAAxB,EAA8BC,IAA9B,EAAoCC,IAApC,EAA0C;IACtC;IACA,EAAA,IAAIk2C,IAAI,GAAG1iC,QAAM,CAAC1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IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;I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jB;IAAsBoL,UAAAA,QAAQ,EAAE6P,SAAS,CAACjb,CAAD,CAAzC;IAA8C44C,UAAAA,aAAa,EAAE39B,SAAS,CAACjb,CAAD,CAAtE;IAA2Em5C,UAAAA,SAAS,EAAE,CAAChyC,EAAE,GAAGqU,EAAE,CAAC/T,KAAT,MAAoB,IAApB,IAA4BN,EAAE,KAAK,KAAK,CAAxC,GAA4C,KAAK,CAAjD,GAAqDA,EAAE,CAACgyC,SAAAA;IAA9I,SAAnB,CAAf,CAAA;WAF6D,CAAA;SAA5C,EAGf9xC,MAHe,CAAzB,CAAA;;IAIA8sB,IAAAA,YAAY,CAAC/oB,QAAD,EAAW,iBAAX,EAA8BwqB,UAA9B,CAAZ,CAAA;IACA,IAAA,OAAOA,UAAP,CAAA;OA3RQ;MA6RZQ,KAAK,EAAE,UAAUhrB,QAAV,EAAoB;IACvBA,IAAAA,QAAQ,CAACtE,KAAT,CAAe6rD,iBAAf,GAAmC,EAAnC,CAAA;IACH,GAAA;IA/RW,CAAhB,CAAA;IAiSA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IAEA,SAAS0B,gBAAT,CAA0BjrD,MAA1B,EAAkCI,IAAlC,EAAwC;IACpC,EAAA,IAAIvJ,CAAC,GAAGuJ,IAAI,GAAG,CAAH,GAAO,CAAnB,CAAA;IACA,EAAA,IAAI8qD,cAAc,GAAG97C,oBAAoB,CAACvY,CAAD,CAAzC,CAAA;MACA,IAAI0B,KAAK,GAAG,QAASY,CAAAA,MAAT,CAAgBiH,IAAI,GAAG,IAAH,GAAU,EAA9B,EAAkC,GAAlC,CAAuCjH,CAAAA,MAAvC,CAA8C+xD,cAAc,CAAC3uD,IAAf,CAAoB,GAApB,CAA9C,EAAwE,GAAxE,CAAZ,CAAA;IACA,EAAA,OAAOyD,MAAM,KAAKzH,KAAX,IAAoByH,MAAM,KAAK,qBAAtC,CAAA;IACH,CAAA;;IACD,IAAImrD,gBAAgB,GAAG;IACnBvtD,EAAAA,OAAO,EAAE,IADU;IAEnBvE,EAAAA,IAAI,EAAE,kBAFa;IAGnBG,EAAAA,KAAK,EAAE,EAHY;IAInBD,EAAAA,MAAM,EAAE,CACJ,mBADI,EAEJ,cAFI,EAGJ,iBAHI,EAIJ,wBAJI,E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ACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;;IAEA,IAAIkpD,SAAS,GAAG;IACZrjE,EAAAA,IAAI,EAAE,WADM;IAEZG,EAAAA,KAAK,EAAE,CACH,oBADG,EAEH,uBAFG,EAGH,oBAHG,EAIH,WAJG,EAKH,gBALG,EAMH,cANG,EAOH,+BAPG,CAFK;IAWZD,EAAAA,MAAM,EAAE,EAXI;IAYZ8wB,EAAAA,MAAM,EAAE,UAAUroB,QAAV,EAAoBwR,KAApB,EAA2B;IAC/B,IAAA,IAAIzV,EAAJ,CAAA;;IACA,IAAA,IAAIvE,KAAK,GAAGwI,QAAQ,CAACxI,KAArB,CAAA;IACA,IAAA,IAAIizB,OAAO,GAAGjzB,KAAK,CAACizB,OAAN,IAAiB,EAA/B,CAAA;;IACA,IAAA,IAAIzuB,EAAE,GAAGgE,QAAQ,CAACyR,QAAT,EAAT;IAAA,QAA8BtX,IAAI,GAAG6B,EAAE,CAAC7B,IAAxC;IAAA,QAA8CD,GAAG,GAAG8B,EAAE,CAAC9B,GAAvD;IAAA,QAA4Ds2D,WAAW,GAAGx0D,EAAE,CAACw0D,WAA7E,CAAA;;IACA,IAAA,IAAIllD,IAAI,GAAG9T,KAAK,C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dist/moveable.min.js b/release/latest/dist/moveable.min.js index d6319a0a1..37d8a8b31 100644 --- a/release/latest/dist/moveable.min.js +++ b/release/latest/dist/moveable.min.js @@ -4,7 +4,7 @@ name: moveable license: MIT author: Daybrush repository: https://github.com/daybrush/moveable/blob/master/packages/moveable -version: 0.51.2 +version: 0.52.0 */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Moveable=e()}(this,(function(){"use strict";var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};function e(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 n=function(){return n=Object.assign||function(t){for(var e,n=1,r=arguments.length;n-1?t[r]:n}var B=function(){var t=z(),e=p&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame);return e?e.bind(window):function(e){var n=z();return setTimeout((function(){e(n-t)}),1e3/60)}}(),A=function(){var t=p&&(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame);return t?t.bind(window):function(t){clearTimeout(t)}}();function I(t){return Object.keys(t)}function F(t,e){var n=P(t),r=n.value,i=n.unit;if(x(e)){var o=e[i];if(o){if(D(o))return o(r);if(g[i])return g[i](r,o)}}else if("%"===i)return r*e/100;return g[i]?g[i](r):r}function N(t,e,n){return Math.max(e,Math.min(t,n))}function q(t,e,n,r){return void 0===r&&(r=t[0]/t[1]),[[L(e[0],v),L(e[0]/r,v)],[L(e[1]*r,v),L(e[1],v)]].filter((function(t){return t.every((function(t,r){var i=e[r],o=L(i,v);return n?t<=i||t<=o:t>=i||t>=o}))}))[0]||t}function Y(t,e,n,r){if(!r)return t.map((function(t,r){return N(t,e[r],n[r])}));var i=t[0],o=t[1],a=!0===r?i/o:r,s=q(t,e,!1,a),u=s[0],c=s[1],l=q(t,n,!0,a),f=l[0],p=l[1];return if||o>p)&&(i=f,o=p),[i,o]}function X(t){for(var e=t.length,n=0,r=e-1;r>=0;--r)n+=t[r];return e?n/e:0}function W(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=Math.atan2(r,n);return i>=0?i:i+2*Math.PI}function j(t){var e=function(t){return[0,1].map((function(e){return X(t.map((function(t){return t[e]})))}))}(t),n=W(e,t[0]),r=W(e,t[1]);return nr&&r-n<-Math.PI?1:-1}function H(t,e){return Math.sqrt(Math.pow((e?e[0]:0)-t[0],2)+Math.pow((e?e[1]:0)-t[1],2))}function L(t,e){if(!e)return t;var n=1/e;return Math.round(t/e)/n}function V(t,e){return t.forEach((function(n,r){t[r]=L(t[r],e)})),t}function U(t,e){-1===t.indexOf(e)&&t.push(e)}function $(t,e){return t.classList?t.classList.contains(e):!!t.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}function Z(t,e){t.classList?t.classList.add(e):t.className+=" "+e}function K(t,e){if(t.classList)t.classList.remove(e);else{var n=new RegExp("(\\s|^)"+e+"(\\s|$)");t.className=t.className.replace(n," ")}}function J(t,e,n,r){t.addEventListener(e,n,r)}function Q(t,e,n,r){t.removeEventListener(e,n,r)}function tt(t){return(null==t?void 0:t.ownerDocument)||d}function et(t){return tt(t).documentElement}function nt(t){return tt(t).body}function rt(t){var e;return(null===(e=null==t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView)||window}function it(t){return x(t)&&t.nodeName&&t.nodeType&&"ownerDocument"in t}var ot=function(){function t(){this.keys=[],this.values=[]}var e=t.prototype;return e.get=function(t){return this.values[this.keys.indexOf(t)]},e.set=function(t,e){var n=this.keys,r=this.values,i=n.indexOf(t),o=-1===i?n.length:i;n[o]=t,r[o]=e},t}(),at=function(){function t(){this.object={}}var e=t.prototype;return e.get=function(t){return this.object[t]},e.set=function(t,e){this.object[t]=e},t}(),st="function"==typeof Map,ut=function(){function t(){}var e=t.prototype;return e.connect=function(t,e){this.prev=t,this.next=e,t&&(t.next=this),e&&(e.prev=this)},e.disconnect=function(){var t=this.prev,e=this.next;t&&(t.next=e),e&&(e.prev=t)},e.getIndex=function(){for(var t=this,e=-1;t;)t=t.prev,++e;return e},t}();var ct=function(){function t(t,e,n,r,i,o,a,s){this.prevList=t,this.list=e,this.added=n,this.removed=r,this.changed=i,this.maintained=o,this.changedBeforeAdded=a,this.fixed=s}var e=t.prototype;return Object.defineProperty(e,"ordered",{get:function(){return this.cacheOrdered||this.caculateOrdered(),this.cacheOrdered},enumerable:!0,configurable:!0}),Object.defineProperty(e,"pureChanged",{get:function(){return this.cachePureChanged||this.caculateOrdered(),this.cachePureChanged},enumerable:!0,configurable:!0}),e.caculateOrdered=function(){var t=function(t,e){var n=[],r=[];return t.forEach((function(t){var e=t[0],i=t[1],o=new ut;n[e]=o,r[i]=o})),n.forEach((function(t,e){t.connect(n[e-1])})),t.filter((function(t,n){return!e[n]})).map((function(t,e){var i=t[0],o=t[1];if(i===o)return[0,0];var a=n[i],s=r[o-1],u=a.getIndex();return a.disconnect(),s?a.connect(s,s.next):a.connect(void 0,n[0]),[u,a.getIndex()]}))}(this.changedBeforeAdded,this.fixed),e=this.changed,n=[];this.cacheOrdered=t.filter((function(t,r){var i=t[0],o=t[1],a=e[r],s=a[0],u=a[1];if(i!==o)return n.push([s,u]),!0})),this.cachePureChanged=n},t}();function lt(t,e,n){var r=st?Map:n?at:ot,i=n||function(t){return t},o=[],a=[],s=[],u=t.map(i),c=e.map(i),l=new r,f=new r,p=[],d=[],h={},v=[],g=0,m=0;return u.forEach((function(t,e){l.set(t,e)})),c.forEach((function(t,e){f.set(t,e)})),u.forEach((function(t,e){var n=f.get(t);void 0===n?(++m,a.push(e)):h[n]=m})),c.forEach((function(t,e){var n=l.get(t);void 0===n?(o.push(e),++g):(s.push([n,e]),m=h[e]||0,p.push([n-m,e-g]),d.push(e===n),n!==e&&v.push([n,e]))})),a.reverse(),new ct(t,e,o,a,v,s,p,d)}var ft=function(){function t(t,e){void 0===t&&(t=[]),this.findKeyCallback=e,this.list=[].slice.call(t)}return t.prototype.update=function(t){var e=[].slice.call(t),n=lt(this.list,e,this.findKeyCallback);return this.list=e,n},t}(),pt=function(t,e){return pt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},pt(t,e)};function dt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}pt(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var ht=function(){return ht=Object.assign||function(t){for(var e,n=1,r=arguments.length;ns&&t.push(e),t}),[]).forEach((function(n){Wt(n,n._ps,[n.o],t,e,!0)})),!1;a.o=n,a.ss(r);var l=a.ps;return E(n)||(a.ps=n.props,a.ref=n.ref),Pt(this),a.r(t,e,a.b?l:{},r),!0},e.md=function(){this.rr()},e.ss=function(){},e.ud=function(){this.rr()},e.rr=function(){var t=this,e=t.ref,n=t.fr;e&&e(n?n.current:t.b)},t}();function Rt(){return Object.__CROACT_CURRENT_INSTNACE__}function Pt(t){return Object.__CROACT_CURRENT_INSTNACE__=t,Mt=0,t}var Tt=function(){function t(t,e){void 0===t&&(t={}),this.props=t,this.context=e,this.state={},this.$_timer=0,this.$_state={},this.$_subs=[],this.$_cs={}}var e=t.prototype;return e.render=function(){return null},e.shouldComponentUpdate=function(t,e){return this.props!==t||this.state!==e},e.setState=function(t,e,n){var r=this;r.$_timer||(r.$_state={}),clearTimeout(r.$_timer),r.$_timer=0,r.$_state=ht(ht({},r.$_state),t),n?r.$_setState(e,n):r.$_timer=window.setTimeout((function(){r.$_timer=0,r.$_setState(e,n)}))},e.forceUpdate=function(t){this.setState({},t,!0)},e.componentDidMount=function(){},e.componentDidUpdate=function(t,e){},e.componentWillUnmount=function(){},e.$_setState=function(t,e){var n=[],r=this.$_p;Wt(r.c,[r],[r.o],n,r._cs,ht(ht({},this.state),this.$_state),e)&&(t&&n.push(t),wt(n),Pt(null))},t}(),zt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return dt(e,t),e.prototype.shouldComponentUpdate=function(t,e){return yt(this.props,t)||yt(this.state,e)},e}(Tt);function Gt(t){var e=function(t){e.current=t};return e.current=t,e}var kt=function(t){function e(e,n,r,i,o,a,s){void 0===s&&(s={});var u=t.call(this,e,n,r,i,o,a,xt(s,e.defaultProps))||this;return u.typ="comp",u._usefs=[],u._uefs=[],u._defs=[],u}dt(e,t);var n=e.prototype;return n.s=function(t,e){var n=this.b;return!1!==n.shouldComponentUpdate(xt(t,this.t.defaultProps),e||n.state)},n.r=function(t,e,n){var r,i,o=this,a=o.t;o.ps=xt(o.ps,o.t.defaultProps);var s=o.ps,u=!o.b,c=a.contextType,l=o.b,f=null==c?void 0:c.get(o);o._cs=e,u?(l=function(t,e,n,r){var i,o;return(null===(i=null==t?void 0:t.prototype)||void 0===i?void 0:i.render)?o=new t(e,n):((o=new Tt(e,n)).constructor=t,t._fr?(r.fr=Gt(),o.render=function(){return this.constructor(this.props,r.fr)}):o.render=_t),o.$_p=r,o}(a,s,f,o),o.b=l):(l.props=s,l.context=f);var p=l.state;o._usefs=[],o._uefs=[];var d=l.render();0===(null===(i=null===(r=null==d?void 0:d.props)||void 0===r?void 0:r.children)||void 0===i?void 0:i.length)&&(d.props.children=o.ps.children);var h=ht(ht({},e),l.$_cs);Wt(o,o._ps,d?[d]:[],t,h),u?o._uefs.push((function(){null==c||c.register(o),l.componentDidMount()})):o._uefs.push((function(){l.componentDidUpdate(n,p)})),t.push((function(){o._usefs.forEach((function(t){t()})),u?o.md():o.ud(),o._defs=o._uefs.map((function(t){return t()}))}))},n.ss=function(t){var e=this.b;e&&t&&(e.state=t)},n.un=function(){var t,e=this;e._ps.forEach((function(t){t.un()})),null===(t=e.t.contextType)||void 0===t||t.unregister(e),clearTimeout(e.b.$_timer),e._defs.forEach((function(t){t&&t()})),e.b.componentWillUnmount()},e}(Ot);function Bt(t,e){var n=I(t),r=I(e),i=lt(n,r,(function(t){return t})),o={},a={},s={};return i.added.forEach((function(t){var n=r[t];o[n]=e[n]})),i.removed.forEach((function(e){var r=n[e];a[r]=t[r]})),i.maintained.forEach((function(r){var i=r[0],o=n[i],a=[t[o],e[o]];t[o]!==e[o]&&(s[o]=a)})),{added:o,removed:a,changed:s}}var At=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.typ="elem",e._es={},e._svg=!1,e}dt(e,t);var n=e.prototype;return n.e=function(t,e){var n=this,r=n._es,i=n.b,o=function(t){return t.replace(/^on/g,"").toLowerCase()}(t);e?(Q(i,o,r[t]),delete r[t]):(r[t]=function(e){var r,i;null===(i=(r=n.ps)[t])||void 0===i||i.call(r,e)},J(i,o,r[t]))},n.s=function(t){return yt(this.ps,t)},n.r=function(t,e,n){var r,i=this,o=!i.b,a=i.ps;if(o){var s=Dt(i.c),u=!1;u=!(!i._svg&&"svg"!==i.t)||s&&s.ownerSVGElement,i._svg=u;var c=null===(r=i._hyd)||void 0===r?void 0:r.splice(0,1)[0],l=i.t;if(c)i._hyd=[].slice.call(c.children||[]);else{var f=tt(s);c=u?f.createElementNS("http://www.w3.org/2000/svg",l):f.createElement(l)}i.b=c}Wt(i,i._ps,a.children,t,e);var p=i.b,d=St(n),h=d[0],v=d[1],g=St(a),m=g[0],b=g[1];return function(t,e,n){var r=Bt(Et(t),Et(e)),i=r.added,o=r.removed,a=r.changed;for(var s in i)n.setAttribute(s,i[s]);for(var u in a)n.setAttribute(u,a[u][1]);for(var c in o)n.removeAttribute(c)}(h,m,p),function(t,e,n){var r=Bt(t,e),i=r.added,o=r.removed;for(var a in o)n.e(a,!0);for(var s in i)n.e(s)}(v,b,i),function(t,e,n){var r=n.style,i=Bt(t,e),o=i.added,a=i.removed,s=i.changed;for(var u in o){var c=T(u,"-");r.setProperty(c,o[u])}for(var u in s){var l=T(u,"-");r.setProperty(l,s[u][1])}for(var u in a){var f=T(u,"-");r.removeProperty(f)}}(n.style||{},a.style||{},p),t.push((function(){o?i.md():i.ud()})),!0},n.un=function(){var t=this,e=t._es,n=t.b;for(var r in e)Q(n,r,e[r]);t._ps.forEach((function(t){t.un()})),t._es={},t._sel||Ct(n)},e}(Ot);function It(t){if(!t||it(t))return t;var e=t.$_p._ps;return e.length?It(e[0].b):null}function Ft(t){if(t){if(t.b&&it(t.b))return t;var e=t._ps;return e.length?Ft(e[0]):null}}function Nt(t,e){for(var n=[],r=2;r0}function jt(t,e,n){return!n&&t&&((n=new qt(e.parentElement))._hyd=[e],n._sel=!0),function(t,e,n,r){void 0===n&&(n=e.__CROACT__),void 0===r&&(r={});var i=!!n;n||(n=new qt(e));var o=[];Wt(n,n._ps,t?[t]:[],o,r,void 0,void 0),wt(o),Pt(null),i||(e.__CROACT__=n)}(t,e,n),n}function Ht(t){var e=Rt(),n=e._hs||(e._hs=[]),r=Mt,i=n[r];if(Mt=r+1,i){if(!yt(i.deps,t.deps))return i.updated=!1,i;n[r]=t}else n.push(t);return t.value=t.func(),t.updated=!0,t}function Lt(t){return Ht({func:function(){return Gt(t)},deps:[]}).value}function Vt(t,e,n){var r=Rt(),i=Ht({func:function(){return t},deps:e}),o=n?r._usefs:r._uefs;i.updated?o.push((function(){return i.effect&&i.effect(),i.effect=t(),i.effect})):o.push((function(){return i.effect}))}function Ut(t,e){for(var n=t.length,r=0;r-1&&r.splice(i,1)}}else this._events[t]=[];else this._events={};return this},e.once=function(t,e){var n=this;return e&&this._addEvent(t,e,{once:!0}),new Promise((function(e){n._addEvent(t,e,{once:!0})}))},e.emit=function(t,e){var n=this;void 0===e&&(e={});var r=this._events[t];if(!t||!r)return!0;var i=!1;return e.eventType=t,e.stop=function(){i=!0},e.currentTarget=this,function(){for(var t=0,e=0,n=arguments.length;er-o?(s[1]>a.top||rs[1])&&(u[1]=1),a.left>n-o?(s[0]>a.left||ns[0])&&(u[0]=1),!(!u[0]&&!u[1])&&this._continueDrag(Le(Le({},e),{direction:u,inputEvent:t,isDrag:!0}))}},n.checkScroll=function(t){var e=this;if(this._isWait)return!1;var n=t.prevScrollPos,r=void 0===n?this._prevScrollPos:n,i=t.direction,o=t.throttleTime,a=void 0===o?0:o,s=t.inputEvent,u=t.isDrag,c=this._getScrollPosition(i||[0,0],t),l=c[0]-r[0],f=c[1]-r[1],p=i||[l?Math.abs(l)/l:0,f?Math.abs(f)/f:0];return this._prevScrollPos=c,this._lock=!1,!(!l&&!f)&&(this.emit("move",{offsetX:p[0]?l:0,offsetY:p[1]?f:0,inputEvent:s}),a&&u&&(clearTimeout(this._timer),this._timer=window.setTimeout((function(){e._continueDrag(t)}),a)),!0)},n.dragEnd=function(){this._flag=!1,this._lock=!1,clearTimeout(this._timer),this._unregisterScrollEvent()},n._getScrollPosition=function(t,e){var n=e.container,r=e.getScrollPosition;return(void 0===r?Ve:r)({container:$e(n),direction:t})},n._continueDrag=function(t){var e,n=this,r=t.container,i=t.direction,o=t.throttleTime,a=t.useScroll,s=t.isDrag,u=t.inputEvent;if(!(!this._flag||s&&this._isWait)){var c=z(),l=Math.max(o+this._prevTime-c,0);if(l>0)return clearTimeout(this._timer),this._timer=window.setTimeout((function(){n._continueDrag(t)}),l),!1;this._prevTime=c;var f=this._getScrollPosition(i,t);this._prevScrollPos=f,s&&(this._isWait=!0),a||(this._lock=!0);var p={container:$e(r),direction:i,inputEvent:u};return null===(e=t.requestScroll)||void 0===e||e.call(t,p),this.emit("scroll",p),this._isWait=!1,a||this.checkScroll(Le(Le({},t),{prevScrollPos:f,direction:i,inputEvent:u}))}},n._registerScrollEvent=function(t){this._unregisterScrollEvent();var e=t.checkScrollEvent;if(e){var n=!0===e?Ue:e,r=$e(t.container);!0!==e||r!==document.body&&r!==document.documentElement?this._unregister=n(r,this._onScroll):this._unregister=Ue(window,this._onScroll)}},n._unregisterScrollEvent=function(){var t;null===(t=this._unregister)||void 0===t||t.call(this),this._unregister=null},e}(je),Ke=Ze;function Je(t){return L(t,v)}function Qe(t){return t.length<3?0:Math.abs(function(t){for(var e=0,n=t.length-1;n>=0;--n)e+=t[n];return e}(t.map((function(e,n){var r=t[n+1]||t[0];return e[0]*r[1]-r[0]*e[1]}))))/2}function tn(t,e){var n=e.width,r=e.height,i=e.left,o=e.top,a=en(t),s=a.minX,u=a.minY,c=a.maxX,l=a.maxY,f=n/(c-s),p=r/(l-u);return t.map((function(t){return[i+(t[0]-s)*f,o+(t[1]-u)*p]}))}function en(t){var e=t.map((function(t){return t[0]})),n=t.map((function(t){return t[1]}));return{minX:Math.min.apply(Math,e),minY:Math.min.apply(Math,n),maxX:Math.max.apply(Math,e),maxY:Math.max.apply(Math,n)}}function nn(t,e,n){var r=t[0],i=t[1],o=en(e),a=o.minX,s=o.maxX,u=[[a,i],[s,i]],c=rn(u[0],u[1]),l=sn(e),f=[];if(l.forEach((function(e){var n,r=rn(e[0],e[1]),o=e[0];(n=r,c.every((function(t,e){return 0===Je(t-n[e])})))?f.push({pos:t,line:e,type:"line"}):an(on(c,r),[u,e]).forEach((function(t){e.some((function(e){return r=t,!Je((n=e)[0]-r[0])&&!Je(n[1]-r[1]);var n,r}))?f.push({pos:t,line:e,type:"point"}):0!==Je(o[1]-i)&&f.push({pos:t,line:e,type:"intersection"})}))})),!n&&k(f,(function(t){return t[0]===r})))return!0;var p=0,d={};return f.forEach((function(t){var e=t.pos,n=t.type,o=t.line;if(!(e[0]>r))if("intersection"===n)++p;else{if("line"===n)return;if("point"===n){var a=k(o,(function(t){return t[1]!==i})),s=d[e[0]],u=a[1]>i?1:-1;s?s!==u&&++p:d[e[0]]=u}}})),p%2==1}function rn(t,e){var n=t[0],r=t[1],i=e[0]-n,o=e[1]-r;Math.abs(i)0)return[];r=[[s,a],[u,a]]}}else{var c=Math.max.apply(Math,n.map((function(t){return t[1][0]}))),l=Math.min.apply(Math,n.map((function(t){return t[1][1]})));if(Je(c-l)>0)return[];r=[[o,c],[o,l]]}}return r.length||(r=t.filter((function(t){var e=t[0],r=t[1];return n.every((function(t){return 0<=Je(e-t[0][0])&&0<=Je(t[0][1]-e)&&0<=Je(r-t[1][0])&&0<=Je(t[1][1]-r)}))}))),r.map((function(t){return[Je(t[0]),Je(t[1])]}))}function sn(t){return function(){for(var t=0,e=0,n=arguments.length;e=0?o:o+2*Math.PI)/Math.PI);var e,n,r,i,o}function pn(t){return t?t.touches?function(t){for(var e=Math.min(t.length,2),n=[],r=0;r=-1;if(!r.flag||!n){r._isDragAPI=!0;var i=r.options,o=i.container,a=i.pinchOutside,s=i.preventWheelClick,u=i.preventRightClick,c=i.preventDefault,l=i.checkInput,f=i.dragFocusedInput,p=i.preventClickEventOnDragStart,d=i.preventClickEventOnDrag,h=i.preventClickEventByCondition,v=r._useTouch,g=!r.flag;if(r._isSecondaryButton=3===t.which||2===t.button,s&&(2===t.which||1===t.button)||u&&(3===t.which||2===t.button))return r.stop(),!1;if(g){var m=r._window.document.activeElement,b=t.target;if(b){var x=b.tagName.toLowerCase(),y=bn.indexOf(x)>-1,E=b.isContentEditable;if(y||E){if(l||!f&&m===b)return!1;if(m&&(m===b||E&&m.isContentEditable&&m.contains(b))){if(!f)return!1;b.blur()}}else if((c||"touchstart"===t.type)&&m){var S=m.tagName.toLowerCase();(m.isContentEditable||bn.indexOf(S)>-1)&&m.blur()}(p||d||h)&&J(r._window,"click",r._onClick,!0)}r.clientStores=[new mn(pn(t))],r._isIdle=!1,r.flag=!0,r.isDrag=!1,r._isTrusted=e,r._dragFlag=!0,r._prevInputEvent=t,r.data={},r.doubleFlag=z()-r.prevTime<200,r._isMouseEvent=function(t){return t&&(t.type.indexOf("mouse")>-1||"button"in t)}(t),!r._isMouseEvent&&r._preventMouseEvent&&(r._preventMouseEvent=!1),!1===(r._preventMouseEvent||r.emit("dragStart",ln(ln({data:r.data,datas:r.data,inputEvent:t,isMouseEvent:r._isMouseEvent,isSecondaryButton:r._isSecondaryButton,isTrusted:e,isDouble:r.doubleFlag},r.getCurrentStore().getPosition()),{preventDefault:function(){t.preventDefault()},preventDrag:function(){r._dragFlag=!1}})))&&r.stop(),r._isMouseEvent&&r.flag&&c&&t.preventDefault()}if(!r.flag)return!1;var D=0;if(g?(r._attchDragEvent(),v&&a&&(D=setTimeout((function(){J(o,"touchstart",r.onDragStart,{passive:!1})})))):v&&a&&Q(o,"touchstart",r.onDragStart),r.flag&&function(t){return t.touches&&t.touches.length>=2}(t)){if(clearTimeout(D),g&&t.touches.length!==t.changedTouches.length)return;r.pinchFlag||r.onPinchStart(t)}}}},r.onDrag=function(t,e){if(r.flag){var n=r.options.preventDefault;!r._isMouseEvent&&n&&t.preventDefault(),r._prevInputEvent=t;var i=pn(t),o=r.moveClients(i,t,!1);if(r._dragFlag){if(r.pinchFlag||o.deltaX||o.deltaY)if(!1===(r._preventMouseEvent||r.emit("drag",ln(ln({},o),{isScroll:!!e,inputEvent:t}))))return void r.stop();r.pinchFlag&&r.onPinch(t,i)}r.getCurrentStore().getPosition(i,!0)}},r.onDragEnd=function(t){if(r.flag){var e=r.options,n=e.pinchOutside,i=e.container,o=e.preventClickEventOnDrag,a=e.preventClickEventOnDragStart,s=e.preventClickEventByCondition,u=r.isDrag;(o||a||s)&&requestAnimationFrame((function(){r._allowClickEvent()})),s||a||!o||u||r._allowClickEvent(),r._useTouch&&n&&Q(i,"touchstart",r.onDragStart),r.pinchFlag&&r.onPinchEnd(t);var c=(null==t?void 0:t.touches)?pn(t):[];0!==c.length&&r.options.keepDragging?r._addStore(new mn(c)):r.flag=!1;var l=r._getPosition(),f=z(),p=!u&&r.doubleFlag;r._prevInputEvent=null,r.prevTime=u||p?0:f,r.flag||(r._dettachDragEvent(),r._preventMouseEvent||r.emit("dragEnd",ln({data:r.data,datas:r.data,isDouble:p,isDrag:u,isClick:!u,isMouseEvent:r._isMouseEvent,isSecondaryButton:r._isSecondaryButton,inputEvent:t,isTrusted:r._isTrusted},l)),r.clientStores=[],r._isMouseEvent||(r._preventMouseEvent=!0,requestAnimationFrame((function(){requestAnimationFrame((function(){r._preventMouseEvent=!1}))}))),r._isIdle=!0)}},r.onBlur=function(){r.onDragEnd()},r._allowClickEvent=function(){Q(r._window,"click",r._onClick,!0)},r._onClick=function(t){r._allowClickEvent(),r._preventMouseEvent=!1;var e=r.options.preventClickEventByCondition;(null==e?void 0:e(t))||(t.stopPropagation(),t.preventDefault())},r._onContextMenu=function(t){r.options.preventRightClick?r.onDragEnd(t):t.preventDefault()},r._passCallback=function(){};var i=[].concat(e),o=i[0];r._window=o&&!("document"in o)?rt(o):window,r.options=ln({checkInput:!1,container:o&&!("document"in o)?rt(o):o,preventRightClick:!0,preventWheelClick:!0,preventClickEventOnDragStart:!1,preventClickEventOnDrag:!1,preventClickEventByCondition:null,preventDefault:!0,checkWindowBlur:!1,keepDragging:!1,pinchThreshold:0,events:["touch","mouse"]},n);var a=r.options,s=a.container,u=a.events,c=a.checkWindowBlur;if(r._useDrag=u.indexOf("drag")>-1,r._useTouch=u.indexOf("touch")>-1,r._useMouse=u.indexOf("mouse")>-1,r.targets=i,r._useDrag&&i.forEach((function(t){J(t,"dragstart",r.onDragStart)})),r._useMouse&&(i.forEach((function(t){J(t,"mousedown",r.onDragStart),J(t,"mousemove",r._passCallback)})),J(s,"contextmenu",r._onContextMenu)),c&&J(rt(),"blur",r.onBlur),r._useTouch){var l={passive:!1};i.forEach((function(t){J(t,"touchstart",r.onDragStart,l),J(t,"touchmove",r._passCallback,l)}))}return r}return function(t,e){function n(){this.constructor=t}cn(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.stop=function(){this.isDrag=!1,this.data={},this.clientStores=[],this.pinchFlag=!1,this.doubleFlag=!1,this.prevTime=0,this.flag=!1,this._isIdle=!0,this._allowClickEvent(),this._dettachDragEvent(),this._isDragAPI=!1},e.prototype.getMovement=function(t){return this.getCurrentStore().getMovement(t)+this.clientStores.slice(1).reduce((function(t,e){return t+e.movement}),0)},e.prototype.isDragging=function(){return this.isDrag},e.prototype.isIdle=function(){return this._isIdle},e.prototype.isFlag=function(){return this.flag},e.prototype.isPinchFlag=function(){return this.pinchFlag},e.prototype.isDoubleFlag=function(){return this.doubleFlag},e.prototype.isPinching=function(){return this.isPinch},e.prototype.scrollBy=function(t,e,n,r){void 0===r&&(r=!0),this.flag&&(this.clientStores[0].move(t,e),r&&this.onDrag(n,!0))},e.prototype.move=function(t,e){var n=t[0],r=t[1],i=this.getCurrentStore().prevClients;return this.moveClients(i.map((function(t){var e=t.clientX,i=t.clientY;return{clientX:e+n,clientY:i+r,originalClientX:e,originalClientY:i}})),e,!0)},e.prototype.triggerDragStart=function(t){this.onDragStart(t,!1)},e.prototype.setEventData=function(t){var e=this.data;for(var n in t)e[n]=t[n];return this},e.prototype.setEventDatas=function(t){return this.setEventData(t)},e.prototype.getCurrentEvent=function(t){return void 0===t&&(t=this._prevInputEvent),ln(ln({data:this.data,datas:this.data},this._getPosition()),{movement:this.getMovement(),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:t})},e.prototype.getEventData=function(){return this.data},e.prototype.getEventDatas=function(){return this.data},e.prototype.unset=function(){var t=this,e=this.targets,n=this.options.container;this.off(),Q(this._window,"blur",this.onBlur),this._useDrag&&e.forEach((function(e){Q(e,"dragstart",t.onDragStart)})),this._useMouse&&(e.forEach((function(e){Q(e,"mousedown",t.onDragStart)})),Q(n,"contextmenu",this._onContextMenu)),this._useTouch&&(e.forEach((function(e){Q(e,"touchstart",t.onDragStart)})),Q(n,"touchstart",this.onDragStart)),this._prevInputEvent=null,this._allowClickEvent(),this._dettachDragEvent()},e.prototype.onPinchStart=function(t){var e=this,n=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>n)){var r=new mn(pn(t));this.pinchFlag=!0,this._addStore(r),!1===this.emit("pinchStart",ln(ln({data:this.data,datas:this.data,angle:r.getAngle(),touches:this.getCurrentStore().getPositions()},r.getPosition()),{inputEvent:t,isTrusted:this._isTrusted,preventDefault:function(){t.preventDefault()},preventDrag:function(){e._dragFlag=!1}}))&&(this.pinchFlag=!1)}},e.prototype.onPinch=function(t,e){if(this.flag&&this.pinchFlag&&!(e.length<2)){var n=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",ln(ln({data:this.data,datas:this.data,movement:this.getMovement(e),angle:n.getAngle(e),rotation:n.getRotation(e),touches:n.getPositions(e),scale:n.getScale(e),distance:n.getDistance(e)},n.getPosition(e)),{inputEvent:t,isTrusted:this._isTrusted}))}},e.prototype.onPinchEnd=function(t){if(this.pinchFlag){var e=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var n=this.getCurrentStore();this.emit("pinchEnd",ln(ln({data:this.data,datas:this.data,isPinch:e,touches:n.getPositions()},n.getPosition()),{inputEvent:t}))}},e.prototype.getCurrentStore=function(){return this.clientStores[0]},e.prototype.moveClients=function(t,e,n){var r=this._getPosition(t,n),i=this.isDrag;(r.deltaX||r.deltaY)&&(this.isDrag=!0);var o=!1;return!i&&this.isDrag&&(o=!0),ln(ln({data:this.data,datas:this.data},r),{movement:this.getMovement(t),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,isMouseEvent:this._isMouseEvent,isSecondaryButton:this._isSecondaryButton,inputEvent:e,isTrusted:this._isTrusted,isFirstDrag:o})},e.prototype._addStore=function(t){this.clientStores.splice(0,0,t)},e.prototype._getPosition=function(t,e){var n=this.getCurrentStore().getPosition(t,e),r=this.clientStores.slice(1).reduce((function(t,e){var n=e.getPosition();return t.distX+=n.distX,t.distY+=n.distY,t}),n),i=r.distX,o=r.distY;return ln(ln({},n),{distX:i,distY:o})},e.prototype._attchDragEvent=function(){var t=this._window,e=this.options.container,n={passive:!1};this._isDragAPI&&(J(e,"dragover",this.onDrag,n),J(t,"dragend",this.onDragEnd)),this._useMouse&&(J(e,"mousemove",this.onDrag),J(t,"mouseup",this.onDragEnd)),this._useTouch&&(J(e,"touchmove",this.onDrag,n),J(t,"touchend",this.onDragEnd,n),J(t,"touchcancel",this.onDragEnd,n))},e.prototype._dettachDragEvent=function(){var t=this._window,e=this.options.container;this._isDragAPI&&(Q(e,"dragover",this.onDrag),Q(t,"dragend",this.onDragEnd)),this._useMouse&&(Q(e,"mousemove",this.onDrag),Q(t,"mouseup",this.onDragEnd)),this._useTouch&&(Q(e,"touchstart",this.onDragStart),Q(e,"touchmove",this.onDrag),Q(t,"touchend",this.onDragEnd),Q(t,"touchcancel",this.onDragEnd))},e}(je);var yn=function(t){for(var e=5381,n=t.length;n;)e=33*e^t.charCodeAt(--n);return e>>>0};function En(t,e,n,r,i){var o=tt(r),a=o.createElement("style");return a.setAttribute("type","text/css"),a.setAttribute("data-styled-id",t),a.setAttribute("data-styled-count","1"),n.nonce&&a.setAttribute("nonce",n.nonce),a.innerHTML=function(t,e,n){return n.original?e:e.replace(/([^};{\s}][^};{]*|^\s*){/gm,(function(e,n){var r=n.trim();return(r?O(r):[""]).map((function(e){var n=e.trim();return 0===n.indexOf("@")?n:n.indexOf(":global")>-1?n.replace(/\:global/g,""):n.indexOf(":host")>-1?"".concat(n.replace(/\:host/g,".".concat(t))):n?".".concat(t," ").concat(n):".".concat(t)})).join(", ")+" {"}))}(t,e,n),(i||o.head||o.body).appendChild(a),a}function Sn(t){var e="rCS"+yn(t).toString(36);return{className:e,inject:function(n,r){void 0===r&&(r={});var i=function(t){if(t&&t.getRootNode){var e=t.getRootNode();if(11===e.nodeType)return e}}(n),o=(i||n.ownerDocument||document).querySelector('style[data-styled-id="'.concat(e,'"]'));if(o){var a=parseFloat(o.getAttribute("data-styled-count"))||0;o.setAttribute("data-styled-count","".concat(a+1))}else o=En(e,t,r,n,i);return{destroy:function(){var t,e=parseFloat(o.getAttribute("data-styled-count"))||0;e<=1?(o.remove?o.remove():null===(t=o.parentNode)||void 0===t||t.removeChild(o),o=null):o.setAttribute("data-styled-count","".concat(e-1))}}}}}var Dn=function(){return Dn=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function Rn(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i=109||Xn&&Wn>=109,Hn="firefox"===Nn,Ln=parseInt(An.browser.webkitVersion,10)>=612||qn>=15,Vn="moveable-",Un=zn.map((function(t){var e="",n="",r="center",i="center",o="calc(var(--moveable-control-padding, 20) * -1px)";return t.indexOf("n")>-1&&(e="top: ".concat(o,";"),i="bottom"),t.indexOf("s")>-1&&(e="top: 0px;",i="top"),t.indexOf("w")>-1&&(n="left: ".concat(o,";"),r="right"),t.indexOf("e")>-1&&(n="left: 0px;",r="left"),'.around-control[data-direction*="'.concat(t,'"] {\n ').concat(n).concat(e,"\n transform-origin: ").concat(r," ").concat(i,";\n }")})).join("\n"),$n="\n{\nposition: absolute;\nwidth: 1px;\nheight: 1px;\nleft: 0;\ntop: 0;\nz-index: 3000;\n--moveable-color: #4af;\n--zoom: 1;\n--zoompx: 1px;\n--moveable-line-padding: 0;\n--moveable-control-padding: 0;\nwill-change: transform;\noutline: 1px solid transparent;\n}\n.control-box {\nz-index: 0;\n}\n.line, .control {\nposition: absolute;\nleft: 0;\ntop: 0;\nwill-change: transform;\n}\n.control {\nwidth: 14px;\nheight: 14px;\nborder-radius: 50%;\nborder: 2px solid #fff;\nbox-sizing: border-box;\nbackground: #4af;\nbackground: var(--moveable-color);\nmargin-top: -7px;\nmargin-left: -7px;\nborder: 2px solid #fff;\nz-index: 10;\n}\n.around-control {\nposition: absolute;\nwill-change: transform;\nwidth: calc(var(--moveable-control-padding, 20) * 1px);\nheight: calc(var(--moveable-control-padding, 20) * 1px);\nleft: calc(var(--moveable-control-padding, 20) * -0.5px);\ntop: calc(var(--moveable-control-padding, 20) * -0.5px);\nbox-sizing: border-box;\nbackground: transparent;\nz-index: 8;\ncursor: alias;\ntransform-origin: center center;\n}\n".concat(Un,"\n.padding {\nposition: absolute;\ntop: 0px;\nleft: 0px;\nwidth: 100px;\nheight: 100px;\ntransform-origin: 0 0;\n}\n.line {\nwidth: 1px;\nheight: 1px;\nbackground: #4af;\nbackground: var(--moveable-color);\ntransform-origin: 0px 50%;\n}\n.line.edge {\nz-index: 1;\nbackground: transparent;\n}\n.line.dashed {\nbox-sizing: border-box;\nbackground: transparent;\n}\n.line.dashed.horizontal {\nborder-top: 1px dashed #4af;\nborder-top-color: #4af;\nborder-top-color: var(--moveable-color);\n}\n.line.dashed.vertical {\nborder-left: 1px dashed #4af;\nborder-left-color: #4af;\nborder-left-color: var(--moveable-color);\n}\n.line.vertical {\ntransform: translateX(-50%);\n}\n.line.horizontal {\ntransform: translateY(-50%);\n}\n.line.vertical.bold {\nwidth: 2px;\n}\n.line.horizontal.bold {\nheight: 2px;\n}\n\n.control.origin {\nborder-color: #f55;\nbackground: #fff;\nwidth: 12px;\nheight: 12px;\nmargin-top: -6px;\nmargin-left: -6px;\npointer-events: none;\n}\n").concat([0,15,30,45,60,75,90,105,120,135,150,165].map((function(t){return'\n.direction[data-rotation="'.concat(t,'"], :global .view-control-rotation').concat(t," {\n").concat(function(t){var e=function(t,e){return'data:image/svg+xml;utf8,')}(1,t),n=45*Math.round(t/45)%180,r="ns-resize";return 135===n?r="nwse-resize":45===n?r="nesw-resize":90===n&&(r="ew-resize"),"cursor:".concat(r,";cursor: url('").concat(e,"') 16 16, ").concat(r,";")}(t),"\n}\n")})).join("\n"),'\n\n.line.direction:before {\ncontent: "";\nposition: absolute;\nwidth: 100%;\nheight: calc(var(--moveable-line-padding, 0) * 1px);\nbottom: 0;\nleft: 0;\n}\n.group {\nz-index: -1;\n}\n.area {\nposition: absolute;\n}\n.area-pieces {\nposition: absolute;\ntop: 0;\nleft: 0;\ndisplay: none;\n}\n.area.avoid, .area.pass {\npointer-events: none;\n}\n.area.avoid+.area-pieces {\ndisplay: block;\n}\n.area-piece {\nposition: absolute;\n}\n\n').concat(Fn?':global svg *:before {\ncontent:"";\ntransform-origin: inherit;\n}':"","\n"),Zn=[[0,1,2],[1,0,3],[2,0,3],[3,1,2]],Kn=1e-4,Jn=1e-7,Qn=1e-9,tr=Math.pow(10,10),er=-tr,nr={n:[0,-1],e:[1,0],s:[0,1],w:[-1,0],nw:[-1,-1],ne:[1,-1],sw:[-1,1],se:[1,1]},rr={n:[0,1],e:[1,3],s:[3,2],w:[2,0],nw:[0],ne:[1],sw:[2],se:[3]},ir={n:0,s:180,w:270,e:90,nw:315,ne:45,sw:225,se:135},or=["isMoveableElement","updateRect","updateTarget","destroy","dragStart","isInside","hitTest","setState","getRect","request","isDragging","getManager","forceUpdate","waitToChangeTarget","updateSelectors","getTargets","stopDrag","getControlBoxElement","getMoveables","getDragElement"];function ar(t,e,n,r,i,o){var a,s;void 0===o&&(o="draggable");var u=null!==(s=null===(a=e.gestos[o])||void 0===a?void 0:a.move(n,t.inputEvent))&&void 0!==s?s:{},c=u.originalDatas||u.datas,l=c[o]||(c[o]={});return Mn(Mn({},i?da(e,u):u),{isPinch:!!r,parentEvent:!0,datas:l,originalDatas:t.originalDatas})}var sr=function(){function t(t){var e;void 0===t&&(t="draggable"),this.ableName=t,this.prevX=0,this.prevY=0,this.startX=0,this.startY=0,this.isDrag=!1,this.isFlag=!1,this.datas={draggable:{}},this.datas=((e={})[t]={},e)}var e=t.prototype;return e.dragStart=function(t,e){this.isDrag=!1,this.isFlag=!1;var n=e.originalDatas;return this.datas=n,n[this.ableName]||(n[this.ableName]={}),Mn(Mn({},this.move(t,e.inputEvent)),{type:"dragstart"})},e.drag=function(t,e){return this.move([t[0]-this.prevX,t[1]-this.prevY],e)},e.move=function(t,e){var n,r,i=!1;if(this.isFlag){var o=this.isDrag;n=this.prevX+t[0],r=this.prevY+t[1],(t[0]||t[1])&&(this.isDrag=!0),!o&&this.isDrag&&(i=!0)}else this.prevX=t[0],this.prevY=t[1],this.startX=t[0],this.startY=t[1],n=t[0],r=t[1],this.isFlag=!0;return this.prevX=n,this.prevY=r,{type:"drag",clientX:n,clientY:r,inputEvent:e,isFirstDrag:i,isDrag:this.isDrag,distX:n-this.startX,distY:r-this.startY,deltaX:t[0],deltaY:t[1],datas:this.datas[this.ableName],originalDatas:this.datas,parentEvent:!0,parentGesto:this}},t}();function ur(t,e,n,r){var i=16===t.length?4:3,o=On(Bo(t,n,r,i),4),a=On(o[0],2),s=a[0],u=a[1],c=On(o[1],2),l=c[0],f=c[1],p=On(o[2],2),d=p[0],h=p[1],v=On(o[3],2),g=v[0],m=v[1],b=On(ko(t,e,i),2),x=b[0],y=b[1],E=Math.min(s,l,d,g),S=Math.min(u,f,h,m),D=Math.max(s,l,d,g);return s=s-E||0,{left:E,top:S,right:D,bottom:Math.max(u,f,h,m),origin:[x=x-E||0,y=y-S||0],pos1:[s,u=u-S||0],pos2:[l=l-E||0,f=f-S||0],pos3:[d=d-E||0,h=h-S||0],pos4:[g=g-E||0,m=m-S||0],direction:Oa(t[0]*t[i+1])}}function cr(t,e){var n=e.clientX,r=e.clientY,i=e.datas,o=t.state,a=o.moveableClientRect,s=o.rootMatrix,u=o.is3d,c=o.pos1,l=On(xe(pa(s,[n-a.left,r-a.top],u?4:3),c),2),f=On(gr({datas:i,distX:l[0],distY:l[1]}),2);return[f[0],f[1]]}function lr(t,e){var n=e.datas,r=t.state,i=r.allMatrix,o=r.beforeMatrix,a=r.is3d,s=r.left,u=r.top,c=r.origin,l=r.offsetMatrix,f=r.targetMatrix,p=r.transformOrigin,d=a?4:3;n.is3d=a,n.matrix=i,n.targetMatrix=f,n.beforeMatrix=o,n.offsetMatrix=l,n.transformOrigin=p,n.inverseMatrix=pe(i,d),n.inverseBeforeMatrix=pe(o,d),n.absoluteOrigin=he(be([s,u],c),d),n.startDragBeforeDist=Ee(n.inverseBeforeMatrix,n.absoluteOrigin,d),n.startDragDist=Ee(n.inverseMatrix,n.absoluteOrigin,d)}function fr(t,e,n){var r=e.datas,i=e.originalDatas.beforeRenderable,o=r.transformIndex,a=i.nextTransforms,s=a.length,u=i.nextTransformAppendedIndexes,c=-1;-1===o?("translate"===n?c=0:"rotate"===n&&(c=G(a,(function(t){return t.match(/scale\(/g)}))),-1===c&&(c=a.length),r.transformIndex=c):c=k(u,(function(t){return t.index===o&&t.functionName===n}))?o:o+u.filter((function(t){return t.indexc&&(r.isAppendTransform=!0,i.nextTransformAppendedIndexes=Rn(Rn([],On(u),!1),[{functionName:n,index:c,isAppend:!0}],!1))}function pr(t,e,n){return"".concat(t.beforeFunctionTexts.join(" ")," ").concat(t.isAppendTransform?n:e," ").concat(t.afterFunctionTexts.join(" "))}function dr(t){var e=t.datas,n=On(vr({datas:e,distX:t.distX,distY:t.distY}),2);return Ee(hr(e,function(t,e){for(var n=Pe(e),r=0;r=0&&(t[0]>=0&&e.push(3),t[0]<=0&&e.push(2)),t[1]<=0&&(t[0]>=0&&e.push(1),t[0]<=0&&e.push(0)),e}function br(t,e){var n=(e[0]+1)/2,r=(e[1]+1)/2,i=[m(t[0][0],t[1][0],n,1-n),m(t[0][1],t[1][1],n,1-n)],o=[m(t[2][0],t[3][0],n,1-n),m(t[2][1],t[3][1],n,1-n)];return[m(i[0],o[0],r,1-r),m(i[1],o[1],r,1-r)]}function xr(t,e,n,r){return me(t,So(e,r,n),r)}function yr(t,e){var n=Cr(e);return{setTransform:function(r,i){void 0===i&&(i=-1),n.startTransforms=y(r)?r:M(r),Sr(t,e,i)},setTransformIndex:function(n){Sr(t,e,n)}}}function Er(t,e,n){Sr(t,e,G(Cr(e).startTransforms,(function(t){return 0===t.indexOf("".concat(n,"("))})))}function Sr(t,e,n){var r=Cr(e),i=e.datas;if(i.transformIndex=n,-1!==n){var o=r.startTransforms[n];if(o){var a=t.state,s=Ie([o],{"x%":function(t){return t/100*a.offsetWidth},"y%":function(t){return t/100*a.offsetHeight}});i.startValue=s[0].functionValue}}}function Dr(t,e){Cr(t).nextTransforms=M(e)}function Cr(t){return t.originalDatas.beforeRenderable}function wr(t){return t.originalDatas.beforeRenderable.nextTransforms}function _r(t){return(wr(t)||[]).join(" ")}function Mr(t){return Cr(t).nextStyle}function Or(t,e,n,r,i){Dr(i,e);var o=Ai.drag(t,ar(i,t.state,n,r,!1)),a=o?o.transform:e;return Mn(Mn({transform:e,drag:o},ta({transform:a},i)),{afterTransform:a})}function Rr(t,e,n,r,i,o){var a=function(t,e,n,r){var i,o=t.transformOrigin,a=t.offsetMatrix,s=t.is3d?4:3;if(E(n)){var u=e.beforeTransform,c=e.afterTransform;i=ve(r?Be(n):me(me(u,Be([n]),4),c,4),4,s)}else i=n;return xr(a,i,o,s)}(t.state,i,e,o),s=function(t,e,n,r){void 0===r&&(r=t.state.allMatrix);var i=t.state,o=i.width,a=i.height,s=i.is3d?4:3,u=[o/2*(1+e[0])+n[0],a/2*(1+e[1])+n[1]];return ko(r,u,s)}(t,n,r,a);return s}function Pr(t,e,n,r,i,o,a){var s=Rr(t,e,n,i,o,a),u=t.state,c=u.left,l=u.top,f=t.props.groupable,p=f?c:0,d=f?l:0,h=xe(r,s);return xe(h,[p,d])}function Tr(t,e,n,r,i,o){var a=t.props.groupable,s=t.state,u=s.transformOrigin,c=s.offsetMatrix,l=s.is3d,f=s.width,p=s.height,d=s.left,h=s.top,v=o.fixedDirection,g=o.nextTargetMatrix||s.targetMatrix,m=l?4:3,b=function(t,e,n,r,i,o){return void 0===r&&(r=e),void 0===i&&(i=n),void 0===o&&(o=[0,0]),t?t.map((function(t,a){var s=P(t),u=s.value,c=s.unit,l=a?i:r,f=a?n:e;return"%"===t||isNaN(u)?f*(l?o[a]/l:0):"%"!==c?u:f*u/100})):o}(i,e,n,f,p,u),x=a?d:0,y=a?h:0,E=function(t,e,n,r,i,o){var a=br(Bo(e,n,r,i),o);return[t[0]-a[0],t[1]-a[1]]}(r,xr(c,g,b,m),e,n,m,v);return xe(E,[x,y])}function zr(t){if(t&&t.getRootNode){var e=t.getRootNode();if(11===e.nodeType)return e}}function Gr(t){var e=t("scale"),n=t("rotate"),r=t("translate"),i=[];return r&&"0px"!==r&&"none"!==r&&i.push("translate(".concat(r.split(/\s+/).join(","),")")),n&&"1"!==n&&"none"!==n&&i.push("rotate(".concat(n,")")),e&&"1"!==e&&"none"!==e&&i.push("scale(".concat(e.split(/\s+/).join(","),")")),i}function kr(t,e,n){for(var r,i,o,a,s,u=t,c=[],l=et(t)||nt(t),f=!n&&t===e||t===l,p=f,d=!1,h=3,v=!1,g=_o(e,e,!0).offsetParent,m=1;u&&!p;){p=f;var b=Nr(u),x=b("position"),y=wo(u),E="fixed"===x,S=Gr(b),D=(a=Eo(y),void 0===(s=void 0)&&(s=6===a.length),s?[a[0],a[1],0,a[2],a[3],0,a[4],a[5],1]:a),C=void 0,w=!1,_=!1,M=0,O=0,R=0,P=0,T={hasTransform:!1,fixedContainer:null};E&&(v=!0,g=(T=Po(u)).fixedContainer);var z=D.length;d||16!==z&&!S.length||(d=!0,h=4,Ro(c),o&&(o=ve(o,3,4))),d&&9===z&&(D=ve(D,3,4));var G=Mo(u,t),k=G.tagName,B=G.hasOffset,A=G.isSVG,I=G.origin,F=G.targetOrigin,N=On(G.offset,2),q=N[0],Y=N[1];"svg"===k&&o&&(c.push({type:"target",target:u,matrix:Go(u,h)}),c.push({type:"offset",target:u,matrix:Pe(h)}));var X=parseFloat(b("zoom"))||1;if(E)C=T.fixedContainer,w=!0;else{var W=_o(u,e,!1,!0,b),j=W.offsetZoom;if(C=W.offsetParent,w=W.isEnd,_=W.isStatic,m*=j,(W.isCustomElement||1!==j)&&_)q-=C.offsetLeft,Y-=C.offsetTop;else if(Hn||jn){if(W.parentSlotElement){for(var H=C,L=0,V=0;H&&zr(H);)L+=H.offsetLeft,V+=H.offsetTop,H=H.offsetParent;q-=L,Y-=V}}}if(!In||Ln||!B||A||!_||"relative"!==x&&"static"!==x||(q-=C.offsetLeft,Y-=C.offsetTop,f=f||w),E)B&&T.hasTransform&&(R=C.clientLeft,P=C.clientTop);else if(B&&g!==C&&(M=C.clientLeft,O=C.clientTop),B&&C===l){var U=Oo(u,!1);q+=U[0],Y+=U[1]}if(c.push({type:"target",target:u,matrix:So(D,h,I)}),S.length&&(c.push({type:"offset",target:u,matrix:Pe(h)}),c.push({type:"target",target:u,matrix:So(Be(S),h,I)})),B){var $=u===t,Z=$?0:u.scrollLeft,K=$?0:u.scrollTop;c.push({type:"offset",target:u,matrix:ze([q-Z+M-R,Y-K+O-P],h)})}else c.push({type:"offset",target:u,origin:I});if(1!==X&&c.push({type:"zoom",target:u,matrix:So(Te([X,X],h),h,[0,0])}),o||(o=D),r||(r=I),i||(i=F),p||E)break;u=C,f=w,n&&u!==l||(p=f)}return o||(o=Pe(h)),r||(r=[0,0]),i||(i=[0,0]),{zoom:m,offsetContainer:g,matrixes:c,targetMatrix:o,transformOrigin:r,targetOrigin:i,is3d:d,hasFixed:v}}var Br=null,Ar=null,Ir=null;function Fr(t){t?(window.Map&&(Br=new Map,Ar=new Map),Ir=[]):(Br=null,Ir=null,Ar=null)}function Nr(t){var e=null==Br?void 0:Br.get(t);if(!e){var n=rt(t).getComputedStyle(t);if(!Br)return function(t){return n[t]};e={style:n,cached:{}},Br.set(t,e)}var r=e.cached,i=e.style;return function(t){return t in r||(r[t]=i[t]),r[t]}}function qr(t,e,n){var r=n.originalDatas;r.groupable=r.groupable||{};var i=r.groupable;i.childDatas=i.childDatas||[];var o=i.childDatas;return t.moveables.map((function(t,r){return o[r]=o[r]||{},o[r][e]=o[r][e]||{},Mn(Mn({},n),{isRequestChild:!0,datas:o[r][e],originalDatas:o[r]})}))}function Yr(t,e,n,r,i,o,a){var s=!!n.match(/Start$/g),u=!!n.match(/End$/g),c=i.isPinch,l=i.datas,f=qr(t,e.name,i),p=t.moveables,d=f.map((function(t,i){var f=p[i],d=f.state,h=d.gestos,v=t;if(s)v=new sr(a).dragStart(r,t);else{if(h[a]||(h[a]=l.childGestos[i]),!h[a])return;v=ar(t,d,r,c,o,a)}var g=e[n](f,Mn(Mn({},v),{parentFlag:!0}));return u&&(h[a]=null),g}));return s&&(l.childGestos=p.map((function(t){return t.state.gestos[a]}))),d}function Xr(t,e,n,r,i,o){void 0===i&&(i=function(t,e){return e});var a=!!n.match(/End$/g),s=qr(t,e.name,r),u=t.moveables;return s.map((function(t,r){var s,c=u[r];s=i(c,t);var l=e[n](c,Mn(Mn({},s),{parentFlag:!0}));return l&&o&&o(c,t,l,r),a&&(c.state.gestos={}),l}))}function Wr(t,e,n,r){var i=n.fixedDirection,o=n.fixedPosition,a=br(r.datas.startPositions||Ko(e.state),i),s=On(Ee(Re(-t.rotation/180*Math.PI,3),[a[0]-o[0],a[1]-o[1],1],3),2),u=s[0],c=s[1];return r.datas.originalX=u,r.datas.originalY=c,r}function jr(t,e,n,r){var i=t.getState(),o=i.renderPoses,a=i.rotation,s=i.direction,u=Xo(t.props,e).zoom,c=uo(a/Math.PI*180),l={},f=t.renderState;f.renderDirectionMap||(f.renderDirectionMap={});var p=f.renderDirectionMap;n.forEach((function(t){var e=t.dir;l[e]=!0}));var d=Oa(s);return n.map((function(t){var n=t.data,i=t.classNames,s=t.dir,f=rr[s];if(!f||!l[s])return null;p[s]=!0;var h=(L(c,15)+d*ir[s]+720)%180,v={};return I(n).forEach((function(t){v["data-".concat(t)]=n[t]})),r.createElement("div",Mn({className:xo.apply(void 0,Rn(["control","direction",s,e],On(i),!1)),"data-rotation":h,"data-direction":s},v,{key:"direction-".concat(s),style:Yo.apply(void 0,Rn([a,u],On(f.map((function(t){return o[t]}))),!1))}))}))}function Hr(t,e,n,r){var i=Xo(t.props,n),o=i.renderDirections,a=void 0===o?e:o,s=i.displayAroundControls;if(!a)return[];var u=!0===a?zn:a;return Rn(Rn([],On(s?Zr(t,r,n,u):[]),!1),On(jr(t,n,u.map((function(t){return{data:{},classNames:[],dir:t}})),r)),!1)}function Lr(t,e,n,r,i,o){for(var a=[],s=6;so&&s.push({direction:"start",isBound:!0,offset:o-r,pos:r}),i-1.1||t[0]>e.right&&Ra(t[0]-e.right)>.1||t[1].1||t[1]>e.bottom&&Ra(t[1]-e.bottom)>.1}))}function ei(t,e,n,r,i){if(!t.props.bounds)return[];var o=i*Math.PI/180,a=Jr(t),s=a.left,u=a.top,c=a.right,l=a.bottom,f=s-r[0],p=c-r[0],d=u-r[1],h=l-r[1],v={left:f,top:d,right:p,bottom:h};if(!ti(n,v,0))return[];var g=[];return[[f,0],[p,0],[d,1],[h,1]].forEach((function(t){var r=On(t,2),i=r[0],a=r[1];n.forEach((function(t){var n=W([0,0],t);g.push.apply(g,Rn([],On(function(t,e,n){var r=Fo(t),i=Math.sqrt(r*r-e*e)||0;return[i,-i].sort((function(e,r){return Ra(e-t[n?0:1])-Ra(r-t[n?0:1])})).map((function(t){return W([0,0],n?[t,e]:[e,t])}))}(t,i,a).map((function(t){return o+t-n})).filter((function(t){return!ti(e,v,t)})).map((function(t){return L(180*t/Math.PI,Jn)}))),!1))}))})),g}var ni=["left","right","center"],ri=["top","bottom","middle"],ii={left:"start",right:"end",center:"center",top:"start",bottom:"end",middle:"center"},oi={start:"left",end:"right",center:"center"},ai={start:"top",end:"bottom",center:"middle"};function si(t,e){var n=t.props,r=n.snappable,i=n.bounds,o=n.innerBounds,a=n.verticalGuidelines,s=n.horizontalGuidelines,u=n.snapGridWidth,c=n.snapGridHeight,l=t.state,f=l.guidelines,p=l.enableSnap;return!(!r||!p||e&&!0!==r&&r.indexOf(e)<0)&&!!(u||c||i||o||f&&f.length||a&&a.length||s&&s.length)}function ui(t){return!1===t?{}:!0!==t&&t?t:{left:!0,right:!0,top:!0,bottom:!0}}function ci(t,e){var n=function(t,e){var n=ui(t),r={};for(var i in n)i in e&&n[i]&&(r[i]=e[i]);return r}(t,e),r=ri.filter((function(t){return t in n})),i=ni.filter((function(t){return t in n}));return{horizontalNames:r,verticalNames:i,horizontal:r.map((function(t){return n[t]})),vertical:i.map((function(t){return n[t]}))}}function li(t,e,n,r,i,o){void 0===r&&(r=[]),void 0===i&&(i=[]);var a=function(){for(var t=[],e=0;er)})).sort((function(t,e){return t.dist-e.dist}));return{pos:n,index:o,guidelineInfos:u,direction:a}})).filter((function(t){return t.guidelineInfos.length>0})).sort((function(t,e){return t.guidelineInfos[0].dist-e.guidelineInfos[0].dist})),c=u.length>0;return{isSnap:c,index:c?u[0].index:-1,direction:null!==(a=null===(o=u[0])||void 0===o?void 0:o.direction)&&void 0!==a?a:"",posInfos:u}}function gi(t,e,n,r){void 0===r&&(r=1);var i=[];n[0]&&n[1]?i=[n,[-n[0],n[1]],[n[0],-n[1]]]:n[0]||n[1]?t.props.keepRatio?i.push([-1,-1],[-1,1],[1,-1],[1,1],n):(i.push.apply(i,Rn([],On(function(t,e){return mr(e).map((function(e){return t[e]}))}([[-1,-1],[1,-1],[-1,-1],[1,1]],n)),!1)),i.length>1&&i.push([(i[0][0]+i[1][0])/2,(i[0][1]+i[1][1])/2])):[[-1,-1],[1,-1],[1,1],[-1,1]].forEach((function(t,e,n){var r=n[e+1]||n[0];i.push(t),i.push([(t[0]+r[0])/2,(t[1]+r[1])/2])}));var o=i.map((function(t){return br(e,t)})),a=li(t,o.map((function(t){return t[0]})),o.map((function(t){return t[1]})),i.map((function(t){return pi(t[0])})),i.map((function(t){return pi(t[1])})),r),s=pi(i.map((function(t){return t[0]}))[a.vertical.index]),u=pi(i.map((function(t){return t[1]}))[a.horizontal.index]);return{vertical:Mn(Mn({},a.vertical),{direction:s}),horizontal:Mn(Mn({},a.horizontal),{direction:u})}}function mi(t,e){var n=Ra(t.offset),r=Ra(e.offset);return t.isBound&&e.isBound?r-n:t.isBound?-1:e.isBound?1:t.isSnap&&e.isSnap?r-n:t.isSnap?-1:e.isSnap||na||u>a,l=On(gr({datas:i,distX:o[0],distY:o[1]}),2);return{offset:[l[0],l[1]],isOutside:c}}function Pi(t,e){return t.isBound?t.offset:e.isSnap?hi(e).offset:0}function Ti(t,e,n,r,i,o){if(!si(t,"draggable"))return[{isSnap:!1,isBound:!1,offset:0},{isSnap:!1,isBound:!1,offset:0}];var a=Zo(o.absolutePoses,[e,n]),s=Ao(a),u=s.left,c=s.right,l=s.top,f=s.bottom,p={horizontal:a.map((function(t){return t[1]})),vertical:a.map((function(t){return t[0]}))},d=zi(t,i,ci(ui(t.props.snapDirections),{left:u,right:c,top:l,bottom:f,center:(u+c)/2,middle:(l+f)/2}),p),h=d.vertical,g=d.horizontal,m=wi(t,a,o),b=m.vertical,x=m.horizontal,y=h.isSnap,E=g.isSnap,S=h.isBound||b.isBound,D=g.isBound||x.isBound,C=On(function(t,e,n,r,i){var o=On(e,2),a=o[0],s=o[1],u=On(n,2),c=u[0],l=u[1],f=On(r,2),p=f[0],d=f[1],h=On(i,2),g=h[0],m=h[1],b=-g,x=-m;if(t&&a&&s){b=0,x=0;var y=[];if(c&&l?y.push([0,m],[g,0]):c?y.push([g,0]):l?y.push([0,m]):p&&d?y.push([0,m],[g,0]):p?y.push([g,0]):d&&y.push([0,m]),y.length){y.sort((function(t,e){return Fo(xe([a,s],t))-Fo(xe([a,s],e))}));var E=y[0];if(E[0]&&Ra(a)>v)b=-E[0],x=s*Ra(a+b)/Ra(a)-s;else if(E[1]&&Ra(s)>v){var S=s;x=-E[1],b=a*Ra(s+x)/Ra(S)-a}if(t&&l&&c)if(Ra(b)>v&&Ra(b)v&&Ra(x)0,v=p>0,g={isBound:!1,offset:0,pos:0},m={isBound:!1,offset:0,pos:0};if(0===p&&0===d)return{vertical:g,horizontal:m};if(0===p)h?sl&&(m.pos=o,m.offset=l-o);else if(0===d)v?ac&&(g.pos=i,g.offset=c-i);else{var b=d/p,x=n[1]-b*c,y=0,E=0,S=!1;v&&a<=c?(y=b*a+x,E=a,S=!0):!v&&c<=i&&(y=b*i+x,E=i,S=!0),S&&(ys)&&(S=!1),S||(h&&s<=l?(E=((y=s)-x)/b,S=!0):!h&&l<=o&&(E=((y=o)-x)/b,S=!0)),S&&(g.isBound=!0,g.pos=E,g.offset=c-E,m.isBound=!0,m.pos=y,m.offset=l-y)}return{vertical:g,horizontal:m}}(t,e,n),o=i.horizontal,a=i.vertical,s=r?{horizontal:{isSnap:!1},vertical:{isSnap:!1}}:function(t,e,n){var r=On(n,2),i=r[0],o=r[1],a=On(e,2),s=a[0],u=a[1],c=On(xe(n,e),2),l=c[0],f=c[1],p=f>0,d=l>0;l=ga(l),f=ga(f);var h={isSnap:!1,offset:0,pos:0},v={isSnap:!1,offset:0,pos:0};if(0===l&&0===f)return{vertical:h,horizontal:v};var g=li(t,l?[i]:[],f?[o]:[]),m=g.vertical,b=g.horizontal;m.posInfos.filter((function(t){var e=t.pos;return d?e>=s:e<=s})),b.posInfos.filter((function(t){var e=t.pos;return p?e>=u:e<=u})),m.isSnap=m.posInfos.length>0,b.isSnap=b.posInfos.length>0;var x=hi(m),y=x.isSnap,E=x.guideline,S=hi(b),D=S.isSnap,C=S.guideline,w=D?C.pos[1]:0,_=y?E.pos[0]:0;if(0===l)D&&(v.isSnap=!0,v.pos=C.pos[1],v.offset=o-v.pos);else if(0===f)y&&(h.isSnap=!0,h.pos=_,h.offset=i-_);else{var M=f/l,O=n[1]-M*i,R=0,P=0,T=!1;y?(R=M*(P=_)+O,T=!0):D&&(P=((R=w)-O)/M,T=!0),T&&(h.isSnap=!0,h.pos=P,h.offset=i-P,v.isSnap=!0,v.pos=R,v.offset=o-R)}return{vertical:h,horizontal:v}}(t,e,n),u=s.horizontal,c=s.vertical,l=Bi(o,u),f=Bi(a,c),p=Ra(l),d=Ra(f);return{horizontal:{isBound:o.isBound,isSnap:u.isSnap,offset:l,dist:p},vertical:{isBound:a.isBound,isSnap:c.isSnap,offset:f,dist:d}}}(t,c,l,i):zi(t,i,{vertical:[l[0]],horizontal:[l[1]]}),p=f.horizontal,d=p.offset,h=p.isBound,v=p.isSnap,g=f.vertical,m=g.offset,b=g.isBound,x=g.isSnap,y=xe(u,s);if(!m&&!d)return{isBound:b||h,isSnap:x||v,sign:y,offset:[0,0]};var E=function(t,e,n,r){var i=W(t,e)/Math.PI*180,o=n.vertical,a=o.isBound,s=o.isSnap,u=o.dist,c=n.horizontal,l=c.isBound,f=c.isSnap,p=i%180,d=p<3||p>177,h=p>87&&p<93;return c.dist0&&(c||l)){var C=v.startDragRotate||0,w=L(C+180*W([0,0],[c,l])/Math.PI,b)-C,_=l*Math.abs(Math.cos((w-90)/180*Math.PI)),M=Fo([c*Math.abs(Math.cos(w/180*Math.PI)),_]);x=w*Math.PI/180,c=M*Math.cos(x),l=M*Math.sin(x)}if(!o&&!r&&!i){var O=On(Ti(t,c,l,b,!s&&u||a,n),2),R=O[0],P=O[1];y=R.isSnap,E=R.isBound,S=P.isSnap,D=P.isBound,c+=R.offset,l+=P.offset}var T=be(vr({datas:n,distX:c,distY:l}),h),z=be(dr({datas:n,distX:c,distY:l}),h);V(z,Jn),V(T,Jn),b||(y||E||(z[0]=L(z[0],m),T[0]=L(T[0],m)),S||D||(z[1]=L(z[1],m),T[1]=L(T[1],m)));var G=xe(T,h),k=xe(z,h),B=xe(k,p),A=xe(G,d);n.prevDist=k,n.prevBeforeDist=G,n.passDelta=B,n.passDist=k;var I=n.left+G[0],F=n.top+G[1],N=n.right-G[0],q=n.bottom-G[1],Y=pr(n,"translate(".concat(z[0],"px, ").concat(z[1],"px)"),"translate(".concat(k[0],"px, ").concat(k[1],"px)"));if(Dr(e,Y),t.state.dragInfo.dist=r?[0,0]:k,r||g||!B.every((function(t){return!t}))||!A.some((function(t){return!t}))){var X=t.state,j=X.width,H=X.height,U=na(t,e,Mn({transform:Y,dist:k,delta:B,translate:z,beforeDist:G,beforeDelta:A,beforeTranslate:T,left:I,top:F,right:N,bottom:q,width:j,height:H,isPinch:o},ta({transform:Y},e)));return!r&&oa(t,"onDrag",U),U}}}},dragAfter:function(t,e){var n=e.datas,r=n.deltaOffset;return!(!r[0]&&!r[1])&&(n.deltaOffset=[0,0],this.drag(t,Mn(Mn({},e),{deltaOffset:r})))},dragEnd:function(t,e){var n=e.parentEvent,r=e.datas;if(t.state.dragInfo=null,r.isDrag){r.isDrag=!1;var i=ra(t,e,{});return!n&&oa(t,"onDragEnd",i),i}},dragGroupStart:function(t,e){var n=e.datas,r=e.clientX,i=e.clientY,o=this.dragStart(t,e);if(!o)return!1;var a=Yr(t,this,"dragStart",[r||0,i||0],e,!1,"draggable"),s=oa(t,"onDragGroupStart",Mn(Mn({},o),{targets:t.props.targets,events:a}));return n.isDrag=!1!==s,!!n.isDrag&&o},dragGroup:function(t,e){if(e.datas.isDrag){var n=this.drag(t,e),r=Yr(t,this,"drag",e.datas.passDelta,e,!1,"draggable");if(n){var i=Mn({targets:t.props.targets,events:r},n);return oa(t,"onDragGroup",i),i}}},dragGroupEnd:function(t,e){var n=e.isDrag;if(e.datas.isDrag){this.dragEnd(t,e);var r=Yr(t,this,"dragEnd",[0,0],e,!1,"draggable");return oa(t,"onDragGroupEnd",ra(t,e,{targets:t.props.targets,events:r})),n}},request:function(t){var e={},n=t.getRect(),r=0,i=0,o=!1;return{isControl:!1,requestStart:function(t){return o=t.useSnap,{datas:e,useSnap:o}},request:function(t){return"x"in t?r=t.x-n.left:"deltaX"in t&&(r+=t.deltaX),"y"in t?i=t.y-n.top:"deltaY"in t&&(i+=t.deltaY),{datas:e,distX:r,distY:i,useSnap:o}},requestEnd:function(){return{datas:e,isDrag:!0,useSnap:o}}}},unset:function(t){t.state.gestos.draggable=null,t.state.dragInfo=null}};function Ii(t,e){return{fixedPosition:br(t,e),fixedDirection:e,fixedOffset:[0,0]}}function Fi(t,e){var n=t.allMatrix,r=t.is3d,i=t.width,o=t.height,a=r?4:3,s=function(t,e,n){return[e?t[0]/(e/2)-1:0,n?t[1]/(n/2)-1:0]}(e,i,o);return{fixedPosition:ko(n,e,a),fixedDirection:s,fixedOffset:[i?0:e[0],o?0:e[1]]}}var Ni=ba("resizable"),qi={name:"resizable",ableGroup:"size",canPinch:!0,props:["resizable","throttleResize","renderDirections","displayAroundControls","keepRatio","resizeFormat","keepRatioFinally","edge","checkResizableError"],events:["resizeStart","beforeResize","resize","resizeEnd","resizeGroupStart","beforeResizeGroup","resizeGroup","resizeGroupEnd"],render:Ur("resizable"),dragControlCondition:Ni,viewClassName:ma("resizable"),dragControlStart:function(t,e){var n,r=e.inputEvent,i=e.isPinch,o=e.isGroup,a=e.parentDirection,s=e.parentGesto,u=e.datas,c=e.parentFixedDirection,l=e.parentEvent,f=Uo(a,i,r,u),p=t.state,d=p.target,h=p.width,v=p.height,g=p.gestos;if(!f||!d)return!1;if(g.resizable)return!1;g.resizable=s||t.controlGesto,!i&&lr(t,e),u.datas={},u.direction=f,u.startOffsetWidth=h,u.startOffsetHeight=v,u.prevWidth=0,u.prevHeight=0,u.minSize=[0,0],u.startWidth=p.inlineCSSWidth||p.cssWidth,u.startHeight=p.inlineCSSHeight||p.cssHeight,u.maxSize=[1/0,1/0],o||(u.minSize=[p.minOffsetWidth,p.minOffsetHeight],u.maxSize=[p.maxOffsetWidth,p.maxOffsetHeight]);var m=t.props.transformOrigin||"% %";function b(t){u.ratio=t&&isFinite(t)?t:0}function x(t){var e=Ii(u.startPositions,t);u.fixedDirection=e.fixedDirection,u.fixedPosition=e.fixedPosition,u.fixedOffset=e.fixedOffset}function y(e){var n=Fi(t.state,e);u.fixedDirection=n.fixedDirection,u.fixedPosition=n.fixedPosition,u.fixedOffset=n.fixedOffset}function D(t){u.minSize=[F("".concat(t[0]),0)||0,F("".concat(t[1]),0)||0]}function C(t){var e=[t[0]||1/0,t[1]||1/0];S(e[0])&&!isFinite(e[0])||(e[0]=F("".concat(e[0]),0)||1/0),S(e[1])&&!isFinite(e[1])||(e[1]=F("".concat(e[1]),0)||1/0),u.maxSize=e}u.transformOrigin=m&&E(m)?m.split(" "):m,u.startOffsetMatrix=p.offsetMatrix,u.startTransformOrigin=p.transformOrigin,u.isWidth=null!==(n=null==e?void 0:e.parentIsWidth)&&void 0!==n?n:!f[0]&&!f[1]||f[0]||!f[1],u.startPositions=Ko(t.state),b(h/v),x(c||[-f[0],-f[1]]),u.setFixedDirection=x,u.setFixedPosition=y,u.setMin=D,u.setMax=C;var w=na(t,e,{direction:f,startRatio:u.ratio,set:function(t){var e=On(t,2),n=e[0],r=e[1];u.startWidth=n,u.startHeight=r},setMin:D,setMax:C,setRatio:b,setFixedDirection:x,setFixedPosition:y,setOrigin:function(t){u.transformOrigin=t},dragStart:Ai.dragStart(t,(new sr).dragStart([0,0],e))}),_=l||oa(t,"onResizeStart",w);return u.startFixedDirection=u.fixedDirection,u.startFixedPosition=u.fixedPosition,!1!==_&&(u.isResize=!0,t.state.snapRenderInfo={request:e.isRequest,direction:f}),!!u.isResize&&w},dragControl:function(t,e){var n,r=e.datas,i=e.parentFlag,o=e.isPinch,a=e.parentKeepRatio,s=e.dragClient,u=e.parentDist,c=e.useSnap,l=e.isRequest,f=e.isGroup,p=e.parentEvent,d=e.resolveMatrix,h=r.isResize,v=r.transformOrigin,g=r.startWidth,m=r.startHeight,b=r.prevWidth,x=r.prevHeight,y=r.minSize,E=r.maxSize,S=r.ratio,D=r.startOffsetWidth,C=r.startOffsetHeight,w=r.isWidth;if(h){if(d){var _=t.state.is3d,M=r.startOffsetMatrix,O=r.startTransformOrigin,R=_?4:3,P=Be(wr(e)),T=Math.sqrt(P.length);R!==T&&(P=ve(P,T,R));var z=xr(M,P,O,R),G=Bo(z,D,C,R);r.startPositions=G,r.nextTargetMatrix=P,r.nextAllMatrix=z}var k=Xo(t.props,"resizable"),B=k.resizeFormat,A=k.throttleResize,I=void 0===A?i?0:1:A,F=k.parentMoveable,N=k.keepRatioFinally,q=r.direction,X=q,W=0,j=0;q[0]||q[1]||(X=[1,1]);var H=S&&(null!=a?a:k.keepRatio)||!1,V=On(at(),2),U=V[0],$=V[1];p||(r.setFixedDirection(r.fixedDirection),oa(t,"onBeforeResize",na(t,e,{startFixedDirection:r.startFixedDirection,startFixedPosition:r.startFixedPosition,setFixedDirection:function(t){var e;return r.setFixedDirection(t),e=On(at(),2),U=e[0],$=e[1],[U,$]},setFixedPosition:function(t){var e;return r.setFixedPosition(t),e=On(at(),2),U=e[0],$=e[1],[U,$]},boundingWidth:U,boundingHeight:$,setSize:function(t){var e;e=On(t,2),U=e[0],$=e[1]}},!0)));var Z=s;s||(Z=!i&&o?function(t,e){return br(Ko(t.state),e)}(t,[0,0]):r.fixedPosition);var K=[0,0];if(o||(K=function(t,e,n,r,i,o,a){if(!si(t,"resizable"))return[0,0];var s=a.fixedDirection,u=a.nextAllMatrix,c=t.state,l=c.allMatrix,f=c.is3d;return so(t,(function(t,r){return io(u||l,e+t,n+r,s,i,f)}),e,n,r,i,o,a)}(t,U,$,q,Z,!c&&l,r)),u&&(!u[0]&&(K[0]=0),!u[1]&&(K[1]=0)),H){X[0]&&X[1]&&K[0]&&K[1]&&(Ra(K[0])>Ra(K[1])?K[1]=0:K[0]=0);var J=!K[0]&&!K[1];J&&st(),X[0]&&!X[1]||K[0]&&!K[1]||J&&w?(U+=K[0],$=U/S):(!X[0]&&X[1]||!K[0]&&K[1]||J&&!w)&&($+=K[1],U=$*S)}else U+=K[0],$+=K[1],U=Math.max(0,U),$=Math.max(0,$);n=On(Y([U,$],y,E,!!H&&S),2),U=n[0],$=n[1],st(),H&&(f||N)&&(w?$=U/S:U=$*S);var Q=[(W=U-D)-b,(j=$-C)-x];r.prevWidth=W,r.prevHeight=j;var tt=Tr(t,U,$,Z,v,r);if(F||!Q.every((function(t){return!t}))||!tt.every((function(t){return!t}))){var et=Ai.drag(t,ar(e,t.state,tt,!!o,!1,"draggable")),nt=et.transform,rt=g+W,it=m+j,ot=na(t,e,Mn({width:rt,height:it,offsetWidth:Math.round(U),offsetHeight:Math.round($),startRatio:S,boundingWidth:U,boundingHeight:$,direction:q,dist:[W,j],delta:Q,isPinch:!!o,drag:et},ea({style:{width:"".concat(rt,"px"),height:"".concat(it,"px")},transform:nt},et,e)));return!p&&oa(t,"onResize",ot),ot}}function at(){var t=r.fixedDirection,n=Da(X,H,r,e);W=n.distWidth,j=n.distHeight;var i=X[0]-t[0]||H?Math.max(D+W,Jn):D,o=X[1]-t[1]||H?Math.max(C+j,Jn):C;return H&&D&&C&&(w?o=i/S:i=o*S),[i,o]}function st(){var t;B&&(t=On(B([U,$]),2),U=t[0],$=t[1]),U=L(U,I),$=L($,I)}},dragControlAfter:function(t,e){var n=e.datas,r=n.isResize,i=n.startOffsetWidth,o=n.startOffsetHeight,a=n.prevWidth,s=n.prevHeight;if(r&&!1!==t.props.checkResizableError){var u=t.state,c=u.width-(i+a),l=u.height-(o+s),f=Ra(c)>3,p=Ra(l)>3;return f&&(n.startWidth+=c,n.startOffsetWidth+=c,n.prevWidth+=c),p&&(n.startHeight+=l,n.startOffsetHeight+=l,n.prevHeight+=l),f||p?this.dragControl(t,e):void 0}},dragControlEnd:function(t,e){var n=e.datas,r=e.parentEvent;if(n.isResize){n.isResize=!1;var i=ra(t,e,{});return!r&&oa(t,"onResizeEnd",i),i}},dragGroupControlCondition:Ni,dragGroupControlStart:function(t,e){var n=e.datas,r=this.dragControlStart(t,Mn(Mn({},e),{isGroup:!0}));if(!r)return!1;var i=qr(t,"resizable",e),o=n.startOffsetWidth,a=n.startOffsetHeight;function s(){var t=n.minSize;i.forEach((function(e){var n=e.datas,r=n.minSize,i=n.startOffsetWidth,s=n.startOffsetHeight,u=o*(i?r[0]/i:0),c=a*(s?r[1]/s:0);t[0]=Math.max(t[0],u),t[1]=Math.max(t[1],c)}))}function u(){var t=n.maxSize;i.forEach((function(e){var n=e.datas,r=n.maxSize,i=n.startOffsetWidth,s=n.startOffsetHeight,u=o*(i?r[0]/i:0),c=a*(s?r[1]/s:0);t[0]=Math.min(t[0],u),t[1]=Math.min(t[1],c)}))}var c=Xr(t,this,"dragControlStart",e,(function(e,r){return Wr(t,e,n,r)}));s(),u();var l=function(e){r.setFixedDirection(e),c.forEach((function(r,o){r.setFixedDirection(e),Wr(t,r.moveable,n,i[o])}))};n.setFixedDirection=l;var f=Mn(Mn({},r),{targets:t.props.targets,events:c.map((function(t){return Mn(Mn({},t),{setMin:function(e){t.setMin(e),s()},setMax:function(e){t.setMax(e),u()}})})),setFixedDirection:l,setMin:function(t){r.setMin(t),s()},setMax:function(t){r.setMax(t),u()}}),p=oa(t,"onResizeGroupStart",f);return n.isResize=!1!==p,!!n.isResize&&r},dragGroupControl:function(t,e){var n=e.datas;if(n.isResize){var r=Xo(t.props,"resizable");ia(t,"onBeforeResize",(function(n){oa(t,"onBeforeResizeGroup",na(t,e,Mn(Mn({},n),{targets:r.targets}),!0))}));var i=this.dragControl(t,Mn(Mn({},e),{isGroup:!0}));if(i){var o=i.boundingWidth,a=i.boundingHeight,s=i.dist,u=r.keepRatio,c=[o/(o-s[0]),a/(a-s[1])],l=n.fixedPosition,f=Xr(t,this,"dragControl",e,(function(e,n){var r=On(Ee(Re(t.rotation/180*Math.PI,3),[n.datas.originalX*c[0],n.datas.originalY*c[1],1],3),2),i=r[0],o=r[1];return Mn(Mn({},n),{parentDist:null,parentScale:c,dragClient:be(l,[i,o]),parentKeepRatio:u})})),p=Mn({targets:r.targets,events:f},i);return oa(t,"onResizeGroup",p),p}}},dragGroupControlEnd:function(t,e){var n=e.isDrag;if(e.datas.isResize){this.dragControlEnd(t,e);var r=Xr(t,this,"dragControlEnd",e);return oa(t,"onResizeGroupEnd",ra(t,e,{targets:t.props.targets,events:r})),n}},request:function(t){var e={},n=0,r=0,i=!1,o=t.getRect();return{isControl:!0,requestStart:function(t){var n;return i=t.useSnap,{datas:e,parentDirection:t.direction||[1,1],parentIsWidth:null===(n=null==t?void 0:t.horizontal)||void 0===n||n,useSnap:i}},request:function(t){return"offsetWidth"in t?n=t.offsetWidth-o.offsetWidth:"deltaWidth"in t&&(n+=t.deltaWidth),"offsetHeight"in t?r=t.offsetHeight-o.offsetHeight:"deltaHeight"in t&&(r+=t.deltaHeight),{datas:e,parentDist:[n,r],parentKeepRatio:t.keepRatio,useSnap:i}},requestEnd:function(){return{datas:e,isDrag:!0,useSnap:i}}}},unset:function(t){t.state.gestos.resizable=null}};function Yi(t,e,n,r,i){var o=t.props.groupable,a=t.state,s=a.is3d?4:3,u=e.origin,c=ko(t.state.rootMatrix,xe([u[0],u[1]],o?[0,0]:[a.left,a.top]),s),l=be([i.left,i.top],c);e.startAbsoluteOrigin=l,e.prevDeg=W(l,[n,r])/Math.PI*180,e.defaultDeg=e.prevDeg,e.prevSnapDeg=0,e.loop=0,e.startDist=H(l,[n,r])}function Xi(t,e,n){var r=n.defaultDeg,i=n.prevDeg,o=i%360,a=Math.floor(i/360);o<0&&(o+=360),o>t&&o>270&&t<90?++a:o270&&--a;var s=e*(360*a+t-r);return n.prevDeg=r+s,s}function Wi(t,e,n,r){return Xi(W(r.startAbsoluteOrigin,[t,e])/Math.PI*180,n,r)}function ji(t,e,n,r,i,o){var a=t.props.throttleRotate,s=void 0===a?0:a,u=n.prevSnapDeg,c=0,l=!1;if(o){var f=function(t,e,n,r){var i,o=t.props,a=null!==(i=o[go])&&void 0!==i?i:5,s=o[mo];if(si(t,"rotatable")){var u=e.pos1,c=e.pos2,l=e.pos3,f=e.pos4,p=e.origin,d=n*Math.PI/180,h=[u,c,l,f].map((function(t){return xe(t,p)})),v=h.map((function(t){return _e(t,d)})),g=Rn(Rn([],On(ei(t,h,v,p,n)),!1),On(Oi(t,h,v,p,n)),!1);g.sort((function(t,e){return Ra(t-n)-Ra(e-n)}));var m=g.length>0;if(m)return{isSnap:m,dist:m?g[0]:n}}if((null==s?void 0:s.length)&&a){var b=s.slice().sort((function(t,e){return lo(t,r)-lo(e,r)}))[0];if(lo(b,r)<=a)return{isSnap:!0,dist:n+co(r,b)-r}}return{isSnap:!1,dist:n}}(t,e,r,i+r);l=f.isSnap,c=i+f.dist}l||(c=L(i+r,s));var p=c-i;return n.prevSnapDeg=p,[p-u,p,c]}function Hi(t,e,n){var r=On(e,4),i=r[0],o=r[1],a=r[2],s=r[3];if("none"===t)return[];if(y(t))return t.map((function(t){return Hi(t,[i,o,a,s],n)[0]}));var u=On((t||"top").split("-"),2),c=u[0],l=u[1],f=[i,o];"left"===c?f=[a,i]:"right"===c?f=[o,s]:"bottom"===c&&(f=[s,a]);var p=[(f[0][0]+f[1][0])/2,(f[0][1]+f[1][1])/2],d=jo(f,n);if(l){var h="top"===l||"left"===l,v="bottom"===c||"left"===c;p=f[h&&!v||!h&&v?0:1]}return[[p,d]]}function Li(t,e){if(e.isRequest)return"rotatable"===e.requestAble;var n=e.inputEvent.target;if($(n,xo("rotation-control"))||t.props.rotateAroundControls&&$(n,xo("around-control"))||$(n,xo("control"))&&$(n,xo("rotatable")))return!0;var r=t.props.rotationTarget;return!!r&&ya(r,!0).some((function(t){return!!t&&(n===t||n.contains(t))}))}var Vi={name:"rotatable",canPinch:!0,props:["rotatable","rotationPosition","throttleRotate","renderDirections","rotationTarget","rotateAroundControls","edge","resolveAblesWithRotatable","displayAroundControls"],events:["rotateStart","beforeRotate","rotate","rotateEnd","rotateGroupStart","beforeRotateGroup","rotateGroup","rotateGroupEnd"],css:[".rotation {\nposition: absolute;\nheight: 40px;\nwidth: 1px;\ntransform-origin: 50% 100%;\nheight: calc(40px * var(--zoom));\ntop: auto;\nleft: 0;\nbottom: 100%;\nwill-change: transform;\n}\n.rotation .rotation-line {\ndisplay: block;\nwidth: 100%;\nheight: 100%;\ntransform-origin: 50% 50%;\n}\n.rotation .rotation-control {\nborder-color: #4af;\nborder-color: var(--moveable-color);\nbackground:#fff;\ncursor: alias;\n}\n:global .view-rotation-dragging, .rotatable.direction.control {\ncursor: alias;\n}\n.rotatable.direction.control.move {\ncursor: move;\n}\n"],viewClassName:function(t){return t.isDragging("rotatable")?xo("view-rotation-dragging"):""},render:function(t,e){var n=Xo(t.props,"rotatable"),r=n.rotatable,i=n.rotationPosition,o=n.zoom,a=n.renderDirections,s=n.rotateAroundControls,u=n.resolveAblesWithRotatable,c=t.getState(),l=c.renderPoses,f=c.direction;if(!r)return null;var p=Hi(i,l,f),d=[];if(p.forEach((function(t,n){var r=On(t,2),i=r[0],a=r[1];d.push(e.createElement("div",{key:"rotation".concat(n),className:xo("rotation"),style:{transform:"translate(-50%) translate(".concat(i[0],"px, ").concat(i[1],"px) rotate(").concat(a,"rad)")}},e.createElement("div",{className:xo("line rotation-line"),style:{transform:"scaleX(".concat(o,")")}}),e.createElement("div",{className:xo("control rotation-control"),style:{transform:"translate(0.5px) scale(".concat(o,")")}})))})),a){var h=I(u||{}),v={};h.forEach((function(t){u[t].forEach((function(e){v[e]=t}))}));var g=[];y(a)&&(g=a.map((function(t){var e=v[t];return{data:e?{resolve:e}:{},classNames:e?["move"]:[],dir:t}}))),d.push.apply(d,Rn([],On(jr(t,"rotatable",g,e)),!1))}return s&&d.push.apply(d,Rn([],On(Zr(t,e)),!1)),d},dragControlCondition:Li,dragControlStart:function(t,e){var n,r,i=e.datas,o=e.clientX,a=e.clientY,s=e.parentRotate,u=e.parentFlag,c=e.isPinch,l=e.isRequest,f=t.state,p=f.target,d=f.left,h=f.top,v=f.direction,g=f.beforeDirection,m=f.targetTransform,b=f.moveableClientRect,x=f.offsetMatrix,y=f.targetMatrix,E=f.allMatrix,S=f.width,D=f.height;if(!l&&!p)return!1;var C=t.getRect();i.rect=C,i.transform=m,i.left=d,i.top=h;var w=function(e){var n=Fi(t.state,e);i.fixedDirection=n.fixedDirection,i.fixedOffset=n.fixedOffset,i.fixedPosition=n.fixedPosition,I&&I.setFixedPosition(e)},_=function(e){var n=function(t,e){var n=t.allMatrix,r=t.is3d,i=t.width,o=t.height,a=r?4:3;return{fixedPosition:ko(n,[i/2*(1+e[0]),o/2*(1+e[1])],a),fixedDirection:e,fixedOffset:[0,0]}}(t.state,e);i.fixedDirection=n.fixedDirection,i.fixedOffset=n.fixedOffset,i.fixedPosition=n.fixedPosition,I&&I.setFixedDirection(e)},M=o,O=a;if(l||c||u){var R=s||0;i.beforeInfo={origin:C.beforeOrigin,prevDeg:R,defaultDeg:R,prevSnapDeg:0,startDist:0},i.afterInfo=Mn(Mn({},i.beforeInfo),{origin:C.origin}),i.absoluteInfo=Mn(Mn({},i.beforeInfo),{origin:C.origin,startValue:R})}else{var P=null===(r=e.inputEvent)||void 0===r?void 0:r.target;if(P){var T=P.getAttribute("data-direction")||"",z=nr[T];if(z){i.isControl=!0,i.isAroundControl=$(P,xo("around-control")),i.controlDirection=z;var G=P.getAttribute("data-resolve");G&&(i.resolveAble=G);var k=function(t,e,n){var r=16===t.length?4:3,i=e.map((function(e){return ko(t,e,r)})),o=n.left,a=n.top;return i.map((function(t){return[t[0]+o,t[1]+a]}))}(f.rootMatrix,f.renderPoses,b);n=On(br(k,z),2),M=n[0],O=n[1]}}i.beforeInfo={origin:C.beforeOrigin},i.afterInfo={origin:C.origin},i.absoluteInfo={origin:C.origin,startValue:C.rotation};var B=w;w=function(e){var n=f.is3d?4:3,r=On(be(de(y,n),e),2),o=r[0],a=r[1],s=Ee(x,he([o,a],n)),u=Ee(E,he([e[0],e[1]],n));B(e);var c=f.posDelta;i.beforeInfo.origin=xe(s,c),i.afterInfo.origin=xe(u,c),i.absoluteInfo.origin=xe(u,c),Yi(t,i.beforeInfo,M,O,b),Yi(t,i.afterInfo,M,O,b),Yi(t,i.absoluteInfo,M,O,b)},_=function(t){var e=br([[0,0],[S,0],[0,D],[S,D]],t);w(e)}}i.startClientX=M,i.startClientY=O,i.direction=v,i.beforeDirection=g,i.startValue=0,i.datas={},Er(t,e,"rotate");var A=!1,I=!1;i.isControl&&i.resolveAble&&("resizable"===i.resolveAble&&(I=qi.dragControlStart(t,Mn(Mn({},new sr("resizable").dragStart([0,0],e)),{parentPosition:i.controlPosition,parentFixedPosition:i.fixedPosition}))));I||(A=Ai.dragStart(t,(new sr).dragStart([0,0],e))),w(function(t){var e=t.props,n=e.groupable,r=e.svgOrigin,i=t.getState(),o=i.offsetWidth,a=i.offsetHeight,s=i.svg,u=i.transformOrigin;if(!n&&s&&r)return wa(r,o,a);return u}(t));var F=na(t,e,Mn(Mn({set:function(t){i.startValue=t*Math.PI/180},setFixedDirection:_,setFixedPosition:w},yr(t,e)),{dragStart:A,resizeStart:I})),N=oa(t,"onRotateStart",F);return i.isRotate=!1!==N,f.snapRenderInfo={request:e.isRequest},!!i.isRotate&&F},dragControl:function(t,e){var n,r,i,o=e.datas,a=e.clientDistX,s=e.clientDistY,u=e.parentRotate,c=e.parentFlag,l=e.isPinch,f=e.groupDelta,p=e.resolveMatrix,d=o.beforeDirection,h=o.beforeInfo,v=o.afterInfo,g=o.absoluteInfo,m=o.isRotate,b=o.startValue,x=o.rect,y=o.startClientX,E=o.startClientY;if(m){fr(t,e,"rotate");var S,D,C,w,_,M,O,R,P,T=function(t){return ur(t.datas.beforeTransform,[50,50],100,100).direction}(e),z=d*T,G=t.props.parentMoveable,k=180/Math.PI*b,B=g.startValue,A=!1,I=y+a,F=E+s;if(!c&&"parentDist"in e){var N=e.parentDist;D=N,_=N,R=N}else l||c?(D=Xi(u,d,h),_=Xi(u,z,v),R=Xi(u,z,g)):(D=Wi(I,F,d,h),_=Wi(I,F,z,v),R=Wi(I,F,z,g),A=!0);if(oa(t,"onBeforeRotate",na(t,e,{beforeRotation:C=k+D,rotation:M=k+_,absoluteRotation:P=B+R,setRotation:function(t){D=_=t-k,R=_}},!0)),S=(n=On(ji(t,x,h,D,k,A),3))[0],D=n[1],C=n[2],w=(r=On(ji(t,x,v,_,k,A),3))[0],_=r[1],M=r[2],O=(i=On(ji(t,x,g,R,B,A),3))[0],R=i[1],P=i[2],O||w||S||G||p){var q=pr(o,"rotate(".concat(M,"deg)"),"rotate(".concat(_,"deg)"));p&&(o.fixedPosition=Rr(t,o.targetAllTransform,o.fixedDirection,o.fixedOffset,o));var Y=function(t,e,n){var r=n.fixedDirection,i=n.fixedPosition,o=n.fixedOffset;return Pr(t,"rotate(".concat(e,"deg)"),r,i,o,n)}(t,_,o),X=xe(be(f||[0,0],Y),o.prevInverseDist||[0,0]);o.prevInverseDist=Y,o.requestValue=null;var W=Or(t,q,X,l,e),j=W,L=H([I,F],g.startAbsoluteOrigin)-g.startDist,V=void 0;if("resizable"===o.resolveAble){var U=qi.dragControl(t,Mn(Mn({},ar(e,t.state,[e.deltaX,e.deltaY],!!l,!1,"resizable")),{resolveMatrix:!0,parentDistance:L}));U&&(V=U,j=ea(j,U,e))}var $=na(t,e,Mn(Mn({delta:w,dist:_,rotate:M,rotation:M,beforeDist:D,beforeDelta:S,beforeRotate:C,beforeRotation:C,absoluteDist:R,absoluteDelta:O,absoluteRotate:P,absoluteRotation:P,isPinch:!!l,resize:V},W),j));return oa(t,"onRotate",$),$}}},dragControlEnd:function(t,e){var n=e.datas;if(n.isRotate){n.isRotate=!1;var r=ra(t,e,{});return oa(t,"onRotateEnd",r),r}},dragGroupControlCondition:Li,dragGroupControlStart:function(t,e){var n=e.datas,r=t.state,i=r.left,o=r.top,a=r.beforeOrigin,s=this.dragControlStart(t,e);if(!s)return!1;s.set(n.beforeDirection*t.rotation);var u=Xr(t,this,"dragControlStart",e,(function(t,e){var n=t.state,r=n.left,s=n.top,u=n.beforeOrigin,c=be(xe([r,s],[i,o]),xe(u,a));return e.datas.startGroupClient=c,e.datas.groupClient=c,Mn(Mn({},e),{parentRotate:0})})),c=oa(t,"onRotateGroupStart",Mn(Mn({},s),{targets:t.props.targets,events:u}));return n.isRotate=!1!==c,!!n.isRotate&&s},dragGroupControl:function(t,e){var n=e.datas;if(n.isRotate){ia(t,"onBeforeRotate",(function(n){oa(t,"onBeforeRotateGroup",na(t,e,Mn(Mn({},n),{targets:t.props.targets}),!0))}));var r=this.dragControl(t,e);if(r){var i=n.beforeDirection,o=r.beforeDist,a=o/180*Math.PI,s=Xr(t,this,"dragControl",e,(function(t,e){var n=e.datas.startGroupClient,r=On(e.datas.groupClient,2),s=r[0],u=r[1],c=On(_e(n,a*i),2),l=c[0],f=c[1],p=[l-s,f-u];return e.datas.groupClient=[l,f],Mn(Mn({},e),{parentRotate:o,groupDelta:p})}));t.rotation=i*r.beforeRotation;var u=Mn({targets:t.props.targets,events:s,set:function(e){t.rotation=e},setGroupRotation:function(e){t.rotation=e}},r);return oa(t,"onRotateGroup",u),u}}},dragGroupControlEnd:function(t,e){var n=e.isDrag;if(e.datas.isRotate){this.dragControlEnd(t,e);var r=Xr(t,this,"dragControlEnd",e);return oa(t,"onRotateGroupEnd",ra(t,e,{targets:t.props.targets,events:r})),n}},request:function(t){var e={},n=0,r=t.getRotation();return{isControl:!0,requestStart:function(){return{datas:e}},request:function(t){return"deltaRotate"in t?n+=t.deltaRotate:"rotate"in t&&(n=t.rotate-r),{datas:e,parentDist:n}},requestEnd:function(){return{datas:e,isDrag:!0}}}}};function Ui(t,e){return function(t,e){var n,r=t.direction,i=t.classNames,o=t.size,a=t.pos,s=t.zoom,u=t.key,c="horizontal"===r,l=c?"Y":"X";return e.createElement("div",{key:u,className:i.join(" "),style:(n={},n[c?"width":"height"]="".concat(o),n.transform="translate(".concat(a[0],", ").concat(a[1],") translate").concat(l,"(-50%) scale").concat(l,"(").concat(s,")"),n)})}(Mn(Mn({},t),{classNames:Rn([xo("line","guideline",t.direction)],On(t.classNames),!1).filter((function(t){return t})),size:t.size||"".concat(t.sizeValue,"px"),pos:t.pos||t.posValue.map((function(t){return"".concat(L(t,.1),"px")}))}),e)}function $i(t,e,n,r,i,o,a,s){var u=t.props.zoom;return n.map((function(t,n){var c=t.type,l=t.pos,f=[0,0];return f[a]=r,f[a?0:1]=-i+l,Ui({key:"".concat(e,"TargetGuideline").concat(n),classNames:[xo("target","bold",c)],posValue:f,sizeValue:o,zoom:u,direction:e},s)}))}function Zi(t,e,n,r,i,o){var a=t.props,s=a.zoom,u=a.isDisplayInnerSnapDigit,c="horizontal"===e?oi:ai,l=i[c.start],f=i[c.end];return n.filter((function(t){var e=t.hide,n=t.elementRect;if(e)return!1;if(u&&n){var r=n.rect;if(r[c.start]<=l&&f<=r[c.end])return!1}return!0})).map((function(t,n){var i=t.pos,a=t.size,u=t.element,c=t.className,l=[-r[0]+i[0],-r[1]+i[1]];return Ui({key:"".concat(e,"-default-guideline-").concat(n),classNames:u?[xo("bold"),c]:[xo("normal"),c],direction:e,posValue:l,sizeValue:a,zoom:s},o)}))}function Ki(t,e,n,r,i,o,a,s){var u,c=t.props,l=c.snapDigit,f=void 0===l?0:l,p=c.isDisplaySnapDigit,d=void 0===p||p,h=c.snapDistFormat,v=void 0===h?function(t,e){return t}:h,g=c.zoom,m="horizontal"===e?"X":"Y",b="vertical"===e?"height":"width",x=Math.abs(i),y=d?parseFloat(x.toFixed(f)):0;return s.createElement("div",{key:"".concat(e,"-").concat(n,"-guideline-").concat(r),className:xo("guideline-group",e),style:(u={left:"".concat(o[0],"px"),top:"".concat(o[1],"px")},u[b]="".concat(x,"px"),u)},Ui({direction:e,classNames:[xo(n),a],size:"100%",posValue:[0,0],sizeValue:x,zoom:g},s),s.createElement("div",{className:xo("size-value","gap"),style:{transform:"translate".concat(m,"(-50%) scale(").concat(g,")")}},y>0?v(y,e):""))}function Ji(t,e,n,r,i){var o=t.props.isDisplayInnerSnapDigit,a=[];return["vertical","horizontal"].forEach((function(s){var u=e.filter((function(t){return t.type===s})),c="vertical"===s?1:0,l=c?0:1,f=function(t,e,n,r){var i="vertical"===t?0:1,o="vertical"===t?1:0,a=i?oi:ai,s=n[a.start],u=n[a.end];return ca(e,(function(t){return t.pos[i]})).map((function(e){var n=[],c=[];return e.forEach((function(e){var l,f,p=e.element,d=e.elementRect.rect;if(d[a.end]0){var u=[0,0];u[c]=n[c]+b[p.start]-h-o,u[l]=m,a.push(Ki(t,s,"dashed",a.length,o,u,e.className,i))}b=r})),b=r,f.forEach((function(e){var r=e.elementRect.rect,o=r[p.start]-b[p.end];if(o>0){var u=[0,0];u[c]=n[c]+b[p.end]-h,u[l]=m,a.push(Ki(t,s,"dashed",a.length,o,u,e.className,i))}b=r})),g.forEach((function(e){var r=e.elementRect.rect,o=h-r[p.start],u=r[p.end]-v,f=[0,0],d=[0,0];f[c]=n[c]-o,f[l]=m,d[c]=n[c]+v-h,d[l]=m,a.push(Ki(t,s,"dashed",a.length,o,f,e.className,i)),a.push(Ki(t,s,"dashed",a.length,u,d,e.className,i))}))}))})),a}function Qi(t){var e=t.state,n=e.containerClientRect,r=e.hasFixed,i=n.overflow,o=n.scrollHeight,a=n.scrollWidth,s=n.clientHeight,u=n.clientWidth,c=n.clientLeft,l=n.clientTop,f=t.props,p=f.snapGap,d=void 0===p||p,h=f.verticalGuidelines,v=f.horizontalGuidelines,g=f.snapThreshold,m=void 0===g?5:g,b=f.snapGridWidth,y=void 0===b?0:b,E=f.snapGridHeight,S=void 0===E?0:E,D=f.maxSnapElementGuidelineDistance,C=void 0===D?1/0:D,w=f.isDisplayGridGuidelines,_=Ao(Ko(t.state)),M=_.top,O=_.left,R=_.bottom,P=_.right,T={top:M,left:O,bottom:R,right:P,center:(O+P)/2,middle:(M+R)/2},z=function(t){var e=t.state,n=t.props.elementGuidelines,r=void 0===n?[]:n;if(!r.length)return e.elementRects=[],[];var i=(e.elementRects||[]).filter((function(t){return!t.refresh})),o=r.map((function(t){return x(t)&&"element"in t?Mn(Mn({},t),{element:xa(t.element,!0)}):{element:xa(t,!0)}})).filter((function(t){return t.element})),a=(l=i.map((function(t){return t.element})),f=o.map((function(t){return t.element})),lt(l,f,qe)),s=a.maintained,u=a.added,c=[];var l,f;s.forEach((function(t){var e=On(t,2),n=e[0],r=e[1];c[r]=i[n]})),function(t,e){if(!e.length)return[];var n=t.props.groupable,r=t.state,i=r.containerClientRect,o=r.rootMatrix,a=r.is3d,s=r.offsetDelta,u=a?4:3,c=On(function(t,e,n){var r=ko(t,[e.clientLeft,e.clientTop],n);return[e.left+r[0],e.top+r[1]]}(o,i,u),2),l=c[0],f=c[1],p=n?0:s[0],d=n?0:s[1];return e.map((function(t){var e=t.element.getBoundingClientRect(),n=e.left-l-p,r=e.top-f-d,i=r+e.height,a=n+e.width,s=On(pa(o,[n,r],u),2),c=s[0],h=s[1],v=On(pa(o,[a,i],u),2),g=v[0],m=v[1];return Mn(Mn({},t),{rect:{left:c,right:g,top:h,bottom:m,center:(c+g)/2,middle:(h+m)/2}})}))}(t,u.map((function(t){return o[t]}))).map((function(t,e){c[u[e]]=t})),e.elementRects=c;var p=ui(t.props.elementSnapDirections),d=[];return c.forEach((function(t){var e=t.element,n=t.top,r=void 0===n?p.top:n,i=t.left,o=void 0===i?p.left:i,a=t.right,s=void 0===a?p.right:a,u=t.bottom,c=void 0===u?p.bottom:u,l=t.center,f=void 0===l?p.center:l,h=t.middle,v=void 0===h?p.middle:h,g=t.className,m=t.rect,b=ci({top:r,right:s,left:o,bottom:c,center:f,middle:v},m),x=b.horizontal,y=b.vertical,E=b.horizontalNames,S=b.verticalNames,D=m.top,C=m.left,w=m.right-C,_=m.bottom-D,M=[w,_];y.forEach((function(n,r){d.push({type:"vertical",element:e,pos:[L(n,.1),D],size:_,sizes:M,className:g,elementRect:t,elementDirection:ii[S[r]]||S[r],direction:""})})),x.forEach((function(n,r){d.push({type:"horizontal",element:e,pos:[C,L(n,.1)],size:w,sizes:M,className:g,elementRect:t,elementDirection:ii[E[r]]||E[r],direction:""})}))})),d}(t),G=Rn([],On(z),!1);d&&G.push.apply(G,Rn([],On(function(t,e,n){var r=t.props,i=r.maxSnapElementGuidelineDistance,o=void 0===i?1/0:i,a=r.maxSnapElementGapDistance,s=void 0===a?1/0:a,u=t.state.elementRects,c=[];return[["vertical",oi,ai],["horizontal",ai,oi]].forEach((function(t){var r=On(t,3),i=r[0],a=r[1],l=r[2],f=e[a.start],p=e[a.end],d=e[a.center],h=e[l.start],v=e[l.end];function g(t){var e=t.rect;return e[a.end]v||e[l.end]0})).sort((function(t,e){return g(t)-g(e)})),b=[];m.forEach((function(t){m.forEach((function(e){if(t!==e){var n=t.rect,r=e.rect,i=n[l.start],o=n[l.end],a=r[l.start];i>r[l.end]||a>o||b.push([t,e])}}))})),b.forEach((function(t){var r=On(t,2),u=r[0],l=r[1],h=u.rect,v=l.rect,g=h[a.start],m=h[a.end],b=v[a.start],x=v[a.end],y=0,E=0,S=!1,D=!1,C=!1;if(m<=f&&p<=b){if(D=!0,Ra((E=m+(y=(b-m-(p-f))/2)+(p-f)/2)-d)>n)return}else if(mn)return}else{if(!(mn)return}y&&to(e,v,i,o)&&(y>s||c.push({type:i,pos:"vertical"===i?[E,0]:[0,E],element:l.element,size:0,className:l.className,isStart:S,isCenter:D,isEnd:C,gap:y,hide:!0,gapRects:[u,l],direction:"",elementDirection:""}))}))})),c}(t,T,m)),!1));var k=Mn({},e.snapOffset||{left:0,top:0,bottom:0,right:0});if(G.push.apply(G,Rn([],On(function(t,e,n,r,i,o,a,s){void 0===i&&(i=0);void 0===o&&(o=0);var u=[],c=a.left,l=a.top;if(e)for(var f=0;f<=r;f+=e)u.push({type:"horizontal",pos:[c,L(f-o+l,.1)],className:xo("grid-guideline"),size:n,hide:!s,direction:""});if(t)for(f=0;f<=n;f+=t)u.push({type:"vertical",pos:[L(f-i+c,.1),l],className:xo("grid-guideline"),size:r,hide:!s,direction:""});return u}(y,S,i?a:u,i?o:s,c,l,k,w)),!1)),r){var B=n.left,A=n.top;k.left+=B,k.top+=A,k.right+=B,k.bottom+=A}return G.push.apply(G,Rn([],On(no(v||!1,h||!1,i?a:u,i?o:s,c,l,k)),!1)),G=G.filter((function(t){var e=t.element,n=t.elementRect,r=t.type;if(!e||!n)return!0;var i=n.rect;return to(T,i,r,C)})),G}function to(t,e,n,r){return"horizontal"===n?Ra(t.right-e.left)<=r||Ra(t.left-e.right)<=r||t.left<=e.right&&e.left<=t.right:"vertical"!==n||(Ra(t.bottom-e.top)<=r||Ra(t.top-e.bottom)<=r||t.top<=e.bottom&&e.top<=t.bottom)}function eo(t,e){return t?t.map((function(t){var n=x(t)?t:{pos:t},r=n.pos;return S(r)?n:Mn(Mn({},n),{pos:F(r,e)})})):[]}function no(t,e,n,r,i,o,a){void 0===i&&(i=0),void 0===o&&(o=0),void 0===a&&(a={left:0,top:0,right:0,bottom:0});var s=[],u=a.left,c=a.top,l=a.bottom,f=n+a.right-u,p=r+l-c;return eo(t,p).forEach((function(t){s.push({type:"horizontal",pos:[u,L(t.pos-o+c,.1)],size:f,className:t.className,direction:""})})),eo(e,f).forEach((function(t){s.push({type:"vertical",pos:[L(t.pos-i+u,.1),c],size:p,className:t.className,direction:""})})),s}function ro(t){var e=t.state,n=e.container,r=t.props.snapContainer||n;if(e.snapContainer===r&&e.guidelines&&e.guidelines.length)return!1;var i=e.containerClientRect,o={left:0,top:0,bottom:0,right:0};if(n!==r){var a=xa(r,!0);if(a){var s=Vo(a),u=Ea(e,[s.left-i.left,s.top-i.top]),c=Ea(e,[s.right-i.right,s.bottom-i.bottom]);o.left=L(u[0],1e-5),o.top=L(u[1],1e-5),o.right=L(c[0],1e-5),o.bottom=L(c[1],1e-5)}}return e.snapContainer=r,e.snapOffset=o,e.guidelines=Qi(t),e.enableSnap=!0,!0}function io(t,e,n,r,i,o){var a=Bo(t,e,n,o?4:3);return Zo(a,xe(i,br(a,r)))}function oo(t){return t?t/Ra(t):0}function ao(t,e,n,r,i,o){var a=function(t,e,n){var r=[];if(n)1!==Ra(e[0])||1!==Ra(e[1])?r.push([e,[-1,-1]],[e,[-1,1]],[e,[1,-1]],[e,[1,1]]):r.push([e,[t[0],-t[1]]],[e,[-t[0],t[1]]]),r.push([e,t]);else if(t[0]&&t[1]||!t[0]&&!t[1]){var i=t[0]?t:[1,1];[1,-1].forEach((function(t){[1,-1].forEach((function(n){var o=[t*i[0],n*i[1]];e[0]===o[0]&&e[1]===o[1]||r.push([e,o])}))}))}else t[0]?(1===Ra(e[0])?[1]:[1,-1]).forEach((function(n){r.push([[e[0],-1],[n*t[0],-1]],[[e[0],0],[n*t[0],0]],[[e[0],1],[n*t[0],1]])})):t[1]&&(1===Ra(e[1])?[1]:[1,-1]).forEach((function(n){r.push([[-1,e[1]],[-1,n*t[1]]],[[0,e[1]],[0,n*t[1]]],[[1,e[1]],[1,n*t[1]]])}));return r}(n,o.fixedDirection,r),s=_i(t,e,n,r),u=Rn(Rn([],On(ki(t,e,a,r,i,o)),!1),On(Ci(t,s,o)),!1),c=bi(u,0),l=bi(u,1);return{width:{isBound:c.isBound,offset:c.offset[0]},height:{isBound:l.isBound,offset:l.offset[1]}}}function so(t,e,n,r,i,o,a,s){for(var u=Ko(t.state),c=t.props.keepRatio,l=0,f=0,p=0;p<2;++p){var d=ao(t,e(l,f),i,c,a,s),h=d.width,v=d.height,g=h.isBound,m=v.isBound,b=h.offset,x=v.offset;if(1===p&&(g||(b=0),m||(x=0)),0===p&&a&&!g&&!m)return[0,0];if(c){var y=Ra(b)*(n?1/n:1),E=Ra(x)*(r?1/r:1);(g&&m?y=0||r.push({type:"bounds",pos:t})})),d.forEach((function(t){G(i,(function(e){var n=e.type,r=e.pos;return"bounds"===n&&r===t}))>=0||i.push({type:"bounds",pos:t})})),{boundMap:c,innerBoundMap:f}}var vo=ba("",["resizable","scalable"]),go="snapRotationThreshold",mo="snapRotationDegrees",bo={name:"snappable",dragRelation:"strong",props:["snappable","snapContainer","snapDirections","elementSnapDirections","snapGap","snapGridWidth","snapGridHeight","isDisplaySnapDigit","isDisplayInnerSnapDigit","isDisplayGridGuidelines","snapDigit","snapThreshold","snapRenderThreshold",go,mo,"horizontalGuidelines","verticalGuidelines","elementGuidelines","bounds","innerBounds","snapDistFormat","maxSnapElementGuidelineDistance","maxSnapElementGapDistance"],events:["snap","bound"],css:[":host {\n--bounds-color: #d66;\n}\n.guideline {\npointer-events: none;\nz-index: 2;\n}\n.guideline.bounds {\nbackground: #d66;\nbackground: var(--bounds-color);\n}\n.guideline-group {\nposition: absolute;\ntop: 0;\nleft: 0;\n}\n.guideline-group .size-value {\nposition: absolute;\ncolor: #f55;\nfont-size: 12px;\nfont-size: calc(12px * var(--zoom));\nfont-weight: bold;\n}\n.guideline-group.horizontal .size-value {\ntransform-origin: 50% 100%;\ntransform: translateX(-50%);\nleft: 50%;\nbottom: 5px;\nbottom: calc(2px + 3px * var(--zoom));\n}\n.guideline-group.vertical .size-value {\ntransform-origin: 0% 50%;\ntop: 50%;\ntransform: translateY(-50%);\nleft: 5px;\nleft: calc(2px + 3px * var(--zoom));\n}\n.guideline.gap {\nbackground: #f55;\n}\n.size-value.gap {\ncolor: #f55;\n}\n"],render:function(t,e){var n=t.state,r=n.top,i=n.left,o=n.pos1,a=n.pos2,s=n.pos3,u=n.pos4,c=n.snapRenderInfo,l=t.props.snapRenderThreshold,f=void 0===l?1:l;if(!c||!c.render||!si(t,""))return Ma(t,"boundMap",{left:!1,top:!1,right:!1,bottom:!1},(function(t){return JSON.stringify(t)})),Ma(t,"innerBoundMap",{left:!1,top:!1,right:!1,bottom:!1},(function(t){return JSON.stringify(t)})),[];n.guidelines=Qi(t);var p=Math.min(o[0],a[0],s[0],u[0]),d=Math.min(o[1],a[1],s[1],u[1]),h=c.externalPoses||[],v=Ko(t.state),g=[],m=[],b=[],x=[],y=[],E=Ao(v),S=E.width,D=E.height,C=E.top,w=E.left,_=E.bottom,M=E.right,O={left:w,right:M,top:C,bottom:_,center:(w+M)/2,middle:(C+_)/2},R=h.length>0,P=R?Ao(h):{};if(!c.request){if(c.direction&&y.push(gi(t,v,c.direction,f)),c.snap){var T=Ao(v);c.center&&(T.middle=(T.top+T.bottom)/2,T.center=(T.left+T.right)/2),y.push(di(t,T,f))}R&&(c.center&&(P.middle=(P.top+P.bottom)/2,P.center=(P.left+P.right)/2),y.push(di(t,P,f))),y.forEach((function(t){var e=t.vertical.posInfos,n=t.horizontal.posInfos;g.push.apply(g,Rn([],On(e.filter((function(t){return t.guidelineInfos.some((function(t){return!t.guideline.hide}))})).map((function(t){return{type:"snap",pos:t.pos}}))),!1)),m.push.apply(m,Rn([],On(n.filter((function(t){return t.guidelineInfos.some((function(t){return!t.guideline.hide}))})).map((function(t){return{type:"snap",pos:t.pos}}))),!1)),b.push.apply(b,Rn([],On(po(e)),!1)),x.push.apply(x,Rn([],On(po(n)),!1))}))}var z=ho(t,[w,M],[C,_],g,m),G=z.boundMap,k=z.innerBoundMap;R&&ho(t,[P.left,P.right],[P.top,P.bottom],g,m,c.externalBounds);var B=Rn(Rn([],On(b),!1),On(x),!1),A=B.filter((function(t){return t.element&&!t.gapRects})),I=B.filter((function(t){return t.gapRects})).sort((function(t,e){return t.gap-e.gap}));oa(t,"onSnap",{guidelines:B.filter((function(t){return!t.element})),elements:A,gaps:I},!0);var F=Ma(t,"boundMap",G,(function(t){return JSON.stringify(t)}),{left:!1,top:!1,right:!1,bottom:!1}),N=Ma(t,"innerBoundMap",k,(function(t){return JSON.stringify(t)}),{left:!1,top:!1,right:!1,bottom:!1});return G!==F&&k!==N||oa(t,"onBound",{bounds:G,innerBounds:k},!0),Rn(Rn(Rn(Rn(Rn(Rn([],On(Ji(t,A,[p,d],O,e)),!1),On(function(t,e,n,r,i){var o=[];return["horizontal","vertical"].forEach((function(a){var s=e.filter((function(t){return t.type===a})).slice(0,1),u="vertical"===a?0:1,c=u?0:1,l=u?ai:oi,f=u?oi:ai,p=r[l.start],d=r[l.end],h=r[f.start],v=r[f.end];s.forEach((function(e){var r=e.gap,a=e.gapRects,s=Math.max.apply(Math,Rn([h],On(a.map((function(t){return t.rect[f.start]}))),!1)),g=Math.min.apply(Math,Rn([v],On(a.map((function(t){return t.rect[f.end]}))),!1)),m=(s+g)/2;s!==g&&m!==(h+v)/2&&a.forEach((function(e){var a=e.rect,s=e.className,f=[n[0],n[1]];if(a[l.end]9),"".concat(e?"matrix3d":"matrix","(").concat(ye(t,!e).join(","),")")}function zo(t){var e=t.clientWidth,n=t.clientHeight;if(!t)return{x:0,y:0,width:0,height:0,clientWidth:e,clientHeight:n};var r=t.viewBox,i=r&&r.baseVal||{x:0,y:0,width:0,height:0};return{x:i.x,y:i.y,width:i.width||e,height:i.height||n,clientWidth:e,clientHeight:n}}function Go(t,e){var n,r=zo(t),i=r.width,o=r.height,a=r.clientWidth,s=r.clientHeight,u=a/i,c=s/o,l=t.preserveAspectRatio.baseVal,f=l.align,p=l.meetOrSlice,d=[0,0],h=[u,c],v=[0,0];if(1!==f){var g=(f-2)%3,m=Math.floor((f-2)/3);d[0]=i*g/2,d[1]=o*m/2;var b=2===p?Math.max(c,u):Math.min(u,c);h[0]=b,h[1]=b,v[0]=(a-i)/2*g,v[1]=(s-o)/2*m}var x=Te(h,e);return n=On(v,2),x[e*(e-1)]=n[0],x[e*(e-1)+1]=n[1],So(x,e,d)}function ko(t,e,n){return Ee(t,he(e,n),n)}function Bo(t,e,n,r){return[[0,0],[e,0],[0,n],[e,n]].map((function(e){return ko(t,e,r)}))}function Ao(t){var e=t.map((function(t){return t[0]})),n=t.map((function(t){return t[1]})),r=Math.min.apply(Math,Rn([],On(e),!1)),i=Math.min.apply(Math,Rn([],On(n),!1)),o=Math.max.apply(Math,Rn([],On(e),!1)),a=Math.max.apply(Math,Rn([],On(n),!1));return{left:r,top:i,right:o,bottom:a,width:o-r,height:a-i}}function Io(t,e,n,r){return Ao(Bo(t,e,n,r))}function Fo(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function No(t,e){return Fo([e[0]-t[0],e[1]-t[1]])}function qo(t,e,n,r){void 0===n&&(n=1),void 0===r&&(r=W(t,e));var i=No(t,e);return{transform:"translateY(-50%) translate(".concat(t[0],"px, ").concat(t[1],"px) rotate(").concat(r,"rad) scaleY(").concat(n,")"),width:"".concat(i,"px")}}function Yo(t,e){for(var n=[],r=2;r0?t[0]:t[1],e>0?t[1]:t[0])}function Ho(t,e){var n=t===nt(t)||t===et(t),r={clientLeft:t.clientLeft,clientTop:t.clientTop,clientWidth:t.clientWidth,clientHeight:t.clientHeight,scrollWidth:t.scrollWidth,scrollHeight:t.scrollHeight,overflow:!1};return n&&(r.clientHeight=Math.max(e.height,r.clientHeight),r.scrollHeight=Math.max(e.height,r.scrollHeight)),r.overflow="visible"!==Nr(t)("overflow"),Mn(Mn({},e),r)}function Lo(t,e,n,r){var i=t.left,o=t.right,a=t.top,s=t.bottom,u=e.top,c=e.left,l={left:c+i,top:u+a,right:c+o,bottom:u+s,width:o-i,height:s-a};return n&&r?Ho(n,l):l}function Vo(t,e){var n=0,r=0,i=0,o=0;if(t){var a=t.getBoundingClientRect();n=a.left,r=a.top,i=a.width,o=a.height}var s={left:n,top:r,width:i,height:o,right:n+i,bottom:r+o};return t&&e?Ho(t,s):s}function Uo(t,e,n,r){var i;if(t)i=t;else if(e)i=[0,0];else{i=$o(n.target,r)}return i}function $o(t,e){if(t){var n=t.getAttribute("data-rotation")||"",r=t.getAttribute("data-direction");if(e.deg=n,r){var i=[0,0];return r.indexOf("w")>-1&&(i[0]=-1),r.indexOf("e")>-1&&(i[0]=1),r.indexOf("n")>-1&&(i[1]=-1),r.indexOf("s")>-1&&(i[1]=1),i}}}function Zo(t,e){return[be(e,t[0]),be(e,t[1]),be(e,t[2]),be(e,t[3])]}function Ko(t){var e=t.left,n=t.top;return Zo([t.pos1,t.pos2,t.pos3,t.pos4],[e,n])}function Jo(t,e){t[e?"controlAbles":"targetAbles"].forEach((function(e){e.unset&&e.unset(t)}))}function Qo(t,e){var n=e?"controlGesto":"targetGesto",r=t[n];!1===(null==r?void 0:r.isIdle())&&Jo(t,e),null==r||r.unset(),t[n]=null}function ta(t,e){if(e){var n=Cr(e);n.nextStyle=Mn(Mn({},n.nextStyle),t)}return{style:t,cssText:I(t).map((function(e){return"".concat(T(e,"-"),": ").concat(t[e],";")})).join("")}}function ea(t,e,n){var r=e.afterTransform||e.transform;return Mn(Mn({},ta(Mn(Mn(Mn({},t.style),e.style),{transform:r}),n)),{afterTransform:r,transform:t.transform})}function na(t,e,n,r){var i=e.datas;i.datas||(i.datas={});var o=Mn(Mn({},n),{target:t.state.target,clientX:e.clientX,clientY:e.clientY,inputEvent:e.inputEvent,currentTarget:t,moveable:t,datas:i.datas,isRequest:e.isRequest,isRequestChild:e.isRequestChild,isFirstDrag:!!e.isFirstDrag,isTrusted:!1!==e.isTrusted,stopAble:function(){i.isEventStart=!1},stopDrag:function(){var t;null===(t=e.stop)||void 0===t||t.call(e)}});return i.isStartEvent?r||(i.lastEvent=o):i.isStartEvent=!0,o}function ra(t,e,n){var r=e.datas,i="isDrag"in n?n.isDrag:e.isDrag;return r.datas||(r.datas={}),Mn(Mn({isDrag:i},n),{moveable:t,target:t.state.target,clientX:e.clientX,clientY:e.clientY,inputEvent:e.inputEvent,currentTarget:t,lastEvent:r.lastEvent,isDouble:e.isDouble,datas:r.datas,isFirstDrag:!!e.isFirstDrag})}function ia(t,e,n){t._emitter.on(e,n)}function oa(t,e,n,r,i){return t.triggerEvent(e,n,r,i)}function aa(t,e){return rt(t).getComputedStyle(t,e)}function sa(t,e,n){var r={},i={};return t.filter((function(t){var o=t.name;if(r[o]||!e.some((function(e){return t[e]})))return!1;if(!n&&t.ableGroup){if(i[t.ableGroup])return!1;i[t.ableGroup]=!0}return r[o]=!0,!0}))}function ua(t,e){return t===e||null==t&&null==e}function ca(t,e){var n=[],r=[];return t.forEach((function(i,o){var a=e(i,o,t),s=r.indexOf(a),u=n[s]||[];-1===s&&(r.push(a),n.push(u)),u.push(i)})),n}function la(t){return t.reduce((function(t,e){return t.concat(e)}),[])}function fa(){for(var t=[],e=0;eMath.PI/2*3?g-m:g-(m+=Math.PI))>2*Math.PI?b-=2*Math.PI:b>Math.PI?b=2*Math.PI-b:b<-Math.PI&&(b=-2*Math.PI-b);var x=Fo([h+e[0],v+e[1]])*Math.cos(b);u=x*Math.sin(m)-h,c=x*Math.cos(m)-v,r[0]<0&&(u*=-1),r[1]<0&&(c*=-1)}else c=(u=d)/n;else u=(c=d)*n}else u=r[0]*e[0],c=r[1]*e[1];return[u,c]}function Da(t,e,n,r){var i,o=n.ratio,a=n.startOffsetWidth,s=n.startOffsetHeight,u=0,c=0,l=r.distX,f=r.distY,p=r.pinchScale,d=r.parentDistance,h=r.parentDist,v=r.parentScale,g=n.fixedDirection,m=[0,1].map((function(e){return Ra(t[e]-g[e])})),b=[0,1].map((function(t){var e=m[t];return 0!==e&&(e=2/e),e}));if(h)u=h[0],c=h[1],e&&(u?c||(c=u/o):u=c*o);else if(S(p))u=(p-1)*a,c=(p-1)*s;else if(v)u=(v[0]-1)*a,c=(v[1]-1)*s;else if(d){var x=a*m[0],y=s*m[1],E=Fo([x,y]);u=d/E*x*b[0],c=d/E*y*b[1]}else{var D=gr({datas:n,distX:l,distY:f});D=b.map((function(t,e){return D[e]*t})),u=(i=On(Sa([a,s],D,o,t,e),2))[0],c=i[1]}return{distWidth:u,distHeight:c}}function Ca(t,e){if(e){if("left"===t)return{x:"0%",y:"50%"};if("top"===t)return{x:"50%",y:"50%"};if("center"===t)return{x:"50%",y:"50%"};if("right"===t)return{x:"100%",y:"50%"};if("bottom"===t)return{x:"50%",y:"100%"};var n=On(t.split(" "),2),r=n[0],i=n[1],o=Ca(r||""),a=Ca(i||""),s=Mn(Mn({},o),a),u={x:"50%",y:"50%"};return s.x&&(u.x=s.x),s.y&&(u.y=s.y),s.value&&(s.x&&!s.y&&(u.y=s.value),!s.x&&s.y&&(u.x=s.value)),u}return"left"===t?{x:"0%"}:"right"===t?{x:"100%"}:"top"===t?{y:"0%"}:"bottom"===t?{y:"100%"}:t?"center"===t?{value:"50%"}:{value:t}:{}}function wa(t,e,n){var r=Ca(t,!0),i=r.x,o=r.y;return[F(i,e)||0,F(o,n)||0]}function _a(t,e){return t.length===e.length&&t.every((function(t,n){var r=e[n],i=y(t),o=y(r);return i&&o?_a(t,r):!i&&!o&&t===r}))}function Ma(t,e,n,r,i){var o=t._store,a=o[e];if(!(e in o)){if(null==i)return o[e]=n,n;o[e]=i,a=i}return a===n||r(a)===r(n)?a:(o[e]=n,n)}function Oa(t){return t>=0?1:-1}function Ra(t){return Math.abs(t)}function Pa(t,e){return function(t){for(var e=[],n=0;n-1}))).filter((function(t){return t.canPinch&&t[l]})),p=na(t,e,{});r&&(p.targets=r);var d=oa(t,c,p);n.isPinch=!1!==d,n.ables=f;var h=n.isPinch;return!!h&&(f.forEach((function(n){if(o[n.name]=o[n.name]||{},n[l]){var r=Mn(Mn({},e),{datas:o[n.name],parentRotate:i,isPinch:!0});n[l](t,r)}})),t.state.snapRenderInfo={request:e.isRequest,direction:[0,0]},h)},pinch:function(t,e){var n=e.datas,r=e.scale,i=e.distance,o=e.originalDatas,a=e.inputEvent,s=e.targets,u=e.angle;if(n.isPinch){var c=i*(1-1/r),l=na(t,e,{});s&&(l.targets=s);var f="onPinch".concat(s?"Group":"");oa(t,f,l);var p=n.ables,d="drag".concat(s?"Group":"","Control");return p.forEach((function(n){n[d]&&n[d](t,Mn(Mn({},e),{datas:o[n.name],inputEvent:a,resolveMatrix:!0,pinchScale:r,parentDistance:c,parentRotate:u,isPinch:!0}))})),l}},pinchEnd:function(t,e){var n=e.datas,r=e.isPinch,i=e.inputEvent,o=e.targets,a=e.originalDatas;if(n.isPinch){var s="onPinch".concat(o?"Group":"","End"),u=ra(t,e,{isDrag:r});o&&(u.targets=o),oa(t,s,u);var c=n.ables,l="drag".concat(o?"Group":"","ControlEnd");return c.forEach((function(n){n[l]&&n[l](t,Mn(Mn({},e),{isDrag:r,datas:a[n.name],inputEvent:i,isPinch:!0}))})),r}},pinchGroupStart:function(t,e){return this.pinchStart(t,Mn(Mn({},e),{targets:t.props.targets}))},pinchGroup:function(t,e){return this.pinch(t,Mn(Mn({},e),{targets:t.props.targets}))},pinchGroupEnd:function(t,e){return this.pinchEnd(t,Mn(Mn({},e),{targets:t.props.targets}))}}),Ga=ba("scalable"),ka={name:"scalable",ableGroup:"size",canPinch:!0,props:["scalable","throttleScale","renderDirections","keepRatio","edge","displayAroundControls"],events:["scaleStart","beforeScale","scale","scaleEnd","scaleGroupStart","beforeScaleGroup","scaleGroup","scaleGroupEnd"],render:Ur("scalable"),dragControlCondition:Ga,viewClassName:ma("scalable"),dragControlStart:function(t,e){var n=e.datas,r=e.isPinch,i=e.inputEvent,o=Uo(e.parentDirection,r,i,n),a=t.state,s=a.width,u=a.height,c=a.targetTransform,l=a.target,f=a.pos1,p=a.pos2,d=a.pos4;if(!o||!l)return!1;r||lr(t,e),n.datas={},n.transform=c,n.prevDist=[1,1],n.direction=o,n.startOffsetWidth=s,n.startOffsetHeight=u,n.startValue=[1,1];var h=!o[0]&&!o[1]||o[0]||!o[1];function v(t){n.ratio=t&&isFinite(t)?t:0}function g(t){var e=Ii(n.startPositions,t);n.fixedDirection=e.fixedDirection,n.fixedPosition=e.fixedPosition,n.fixedOffset=e.fixedOffset}Er(t,e,"scale"),n.isWidth=h,n.startPositions=Ko(t.state),n.setFixedDirection=g,v(H(f,p)/H(p,d)),g([-o[0],-o[1]]);var m=function(t){n.minScaleSize=t},b=function(t){n.maxScaleSize=t};m([-1/0,-1/0]),b([1/0,1/0]);var x=na(t,e,Mn(Mn({direction:o,set:function(t){n.startValue=t},setRatio:v,setFixedDirection:g,setMinScaleSize:m,setMaxScaleSize:b},yr(t,e)),{dragStart:Ai.dragStart(t,(new sr).dragStart([0,0],e))})),y=oa(t,"onScaleStart",x);return n.startFixedDirection=n.fixedDirection,!1!==y&&(n.isScale=!0,t.state.snapRenderInfo={request:e.isRequest,direction:o}),!!n.isScale&&x},dragControl:function(t,e){fr(t,e,"scale");var n=e.datas,r=e.parentKeepRatio,i=e.parentFlag,o=e.isPinch,a=e.dragClient,s=e.isRequest,u=e.useSnap,c=e.resolveMatrix,l=n.prevDist,f=n.direction,p=n.startOffsetWidth,d=n.startOffsetHeight,h=n.isScale,v=n.startValue,g=n.isWidth,m=n.ratio;if(!h)return!1;var b=t.props,x=b.throttleScale,E=b.parentMoveable,S=f;f[0]||f[1]||(S=[1,1]);var D=m&&(null!=r?r:b.keepRatio)||!1,C=t.state,w=[v[0],v[1]];function _(){var t=Da(S,D,n,e),r=t.distWidth,i=t.distHeight,o=p?(p+r)/p:1,a=d?(d+i)/d:1;v[0]||(w[0]=r/p),v[1]||(w[1]=i/d);var s=(S[0]||D?o:1)*w[0],u=(S[1]||D?a:1)*w[1];return 0===s&&(s=Oa(l[0])*Qn),0===u&&(u=Oa(l[1])*Qn),[s,u]}var M=_();if(!o&&t.props.groupable){var O=(C.snapRenderInfo||{}).direction;y(O)&&(O[0]||O[1])&&(C.snapRenderInfo={direction:f,request:e.isRequest})}oa(t,"onBeforeScale",na(t,e,{scale:M,setFixedDirection:function(t){return n.setFixedDirection(t),M=_()},startFixedDirection:n.startFixedDirection,setScale:function(t){M=t}},!0));var R,P,T=[M[0]/w[0],M[1]/w[1]],z=a,G=[0,0],k=!a&&!i&&o;if(k||c?z=Rr(t,n.targetAllTransform,[0,0],[0,0],n):a||(z=n.fixedPosition),o||(G=fo(t,T,f,!u&&s,n)),D){S[0]&&S[1]&&G[0]&&G[1]&&(Math.abs(G[0]*p)>Math.abs(G[1]*d)?G[1]=0:G[0]=0);var B=!G[0]&&!G[1];if(B&&(g?T[0]=L(T[0]*w[0],x)/w[0]:T[1]=L(T[1]*w[1],x)/w[1]),S[0]&&!S[1]||G[0]&&!G[1]||B&&g){T[0]+=G[0];var A=p*T[0]*w[0]/m;T[1]=A/d/w[1]}else if(!S[0]&&S[1]||!G[0]&&G[1]||B&&!g){T[1]+=G[1];var I=d*T[1]*w[1]*m;T[0]=I/p/w[0]}}else T[0]+=G[0],T[1]+=G[1],G[0]||(T[0]=L(T[0]*w[0],x)/w[0]),G[1]||(T[1]=L(T[1]*w[1],x)/w[1]);0===T[0]&&(T[0]=Oa(l[0])*Qn),0===T[1]&&(T[1]=Oa(l[1])*Qn),R=T,P=[w[0],w[1]],M=[R[0]*P[0],R[1]*P[1]];var F=[p,d],N=[p*M[0],d*M[1]];N=Y(N,n.minScaleSize,n.maxScaleSize,!!D&&m),M=Pa(2,(function(t){return F[t]?N[t]/F[t]:N[t]})),T=Pa(2,(function(t){return M[t]/w[t]}));var q=Pa(2,(function(t){return l[t]?T[t]/l[t]:T[t]})),X="scale(".concat(T.join(", "),")"),W="scale(".concat(M.join(", "),")"),j=pr(n,W,X),H=!v[0]||!v[1],V=function(t,e,n,r,i,o,a){return Pr(t,e,n,r,i,o,a)}(t,H?W:X,n.fixedDirection,z,n.fixedOffset,n,H),U=k?V:xe(V,n.prevInverseDist||[0,0]);if(n.prevDist=T,n.prevInverseDist=V,M[0]===l[0]&&M[1]===l[1]&&U.every((function(t){return!t}))&&!E&&!k)return!1;var $=na(t,e,Mn({offsetWidth:p,offsetHeight:d,direction:f,scale:M,dist:T,delta:q,isPinch:!!o},Or(t,j,U,o,e)));return oa(t,"onScale",$),$},dragControlEnd:function(t,e){var n=e.datas;if(!n.isScale)return!1;n.isScale=!1;var r=ra(t,e,{});return oa(t,"onScaleEnd",r),r},dragGroupControlCondition:Ga,dragGroupControlStart:function(t,e){var n=e.datas,r=this.dragControlStart(t,e);if(!r)return!1;var i=qr(t,"resizable",e);n.moveableScale=t.scale;var o=Xr(t,this,"dragControlStart",e,(function(e,r){return Wr(t,e,n,r)})),a=function(e){r.setFixedDirection(e),o.forEach((function(r,o){r.setFixedDirection(e),Wr(t,r.moveable,n,i[o])}))};n.setFixedDirection=a;var s=Mn(Mn({},r),{targets:t.props.targets,events:o,setFixedDirection:a}),u=oa(t,"onScaleGroupStart",s);return n.isScale=!1!==u,!!n.isScale&&s},dragGroupControl:function(t,e){var n=e.datas;if(n.isScale){ia(t,"onBeforeScale",(function(n){oa(t,"onBeforeScaleGroup",na(t,e,Mn(Mn({},n),{targets:t.props.targets}),!0))}));var r=this.dragControl(t,e);if(r){var i=r.dist,o=n.moveableScale;t.scale=[i[0]*o[0],i[1]*o[1]];var a=t.props.keepRatio,s=n.fixedPosition,u=Xr(t,this,"dragControl",e,(function(e,n){var r=On(Ee(Re(t.rotation/180*Math.PI,3),[n.datas.originalX*i[0],n.datas.originalY*i[1],1],3),2),o=r[0],u=r[1];return Mn(Mn({},n),{parentDist:null,parentScale:i,parentKeepRatio:a,dragClient:be(s,[o,u])})})),c=Mn({targets:t.props.targets,events:u},r);return oa(t,"onScaleGroup",c),c}}},dragGroupControlEnd:function(t,e){var n=e.isDrag;if(e.datas.isScale){this.dragControlEnd(t,e);var r=Xr(t,this,"dragControlEnd",e);return oa(t,"onScaleGroupEnd",ra(t,e,{targets:t.props.targets,events:r})),n}},request:function(){var t={},e=0,n=0,r=!1;return{isControl:!0,requestStart:function(e){return r=e.useSnap,{datas:t,parentDirection:e.direction||[1,1],useSnap:r}},request:function(i){return e+=i.deltaWidth,n+=i.deltaHeight,{datas:t,parentDist:[e,n],parentKeepRatio:i.keepRatio,useSnap:r}},requestEnd:function(){return{datas:t,isDrag:!0,useSnap:r}}}}};function Ba(t,e){return t.map((function(t,n){return m(t,e[n],1,2)}))}function Aa(t,e,n){var r=W(t,e),i=W(t,n)-r;return i>=0?i:i+2*Math.PI}var Ia={name:"warpable",ableGroup:"size",props:["warpable","renderDirections","edge","displayAroundControls"],events:["warpStart","warp","warpEnd"],viewClassName:ma("warpable"),render:function(t,e){var n=t.props,r=n.resizable,i=n.scalable,o=n.warpable,a=n.zoom;if(r||i||!o)return[];var s=t.state,u=s.pos1,c=s.pos2,l=s.pos3,f=s.pos4,p=Ba(u,c),d=Ba(c,u),h=Ba(u,l),v=Ba(l,u),g=Ba(l,f),m=Ba(f,l),b=Ba(c,f),x=Ba(f,c);return Rn([e.createElement("div",{className:xo("line"),key:"middeLine1",style:qo(p,g,a)}),e.createElement("div",{className:xo("line"),key:"middeLine2",style:qo(d,m,a)}),e.createElement("div",{className:xo("line"),key:"middeLine3",style:qo(h,b,a)}),e.createElement("div",{className:xo("line"),key:"middeLine4",style:qo(v,x,a)})],On($r(t,"warpable",e)),!1)},dragControlCondition:function(t,e){if(e.isRequest)return!1;var n=e.inputEvent.target;return $(n,xo("direction"))&&$(n,xo("warpable"))},dragControlStart:function(t,e){var n=e.datas,r=e.inputEvent,i=t.props.target,o=$o(r.target,n);if(!o||!i)return!1;var a=t.state,s=a.transformOrigin,u=a.is3d,c=a.targetTransform,l=a.targetMatrix,f=a.width,p=a.height,d=a.left,h=a.top;return n.datas={},n.targetTransform=c,n.warpTargetMatrix=u?l:ve(l,3,4),n.targetInverseMatrix=fe(pe(n.warpTargetMatrix,4),3,4),n.direction=o,n.left=d,n.top=h,n.poses=[[0,0],[f,0],[0,p],[f,p]].map((function(t){return xe(t,s)})),n.nextPoses=n.poses.map((function(t){var e=On(t,2),r=e[0],i=e[1];return Ee(n.warpTargetMatrix,[r,i,0,1],4)})),n.startValue=Pe(4),n.prevMatrix=Pe(4),n.absolutePoses=Ko(a),n.posIndexes=mr(o),lr(t,e),Er(t,e,"matrix3d"),a.snapRenderInfo={request:e.isRequest,direction:o},!1!==oa(t,"onWarpStart",na(t,e,Mn({set:function(t){n.startValue=t}},yr(t,e))))&&(n.isWarp=!0),n.isWarp},dragControl:function(t,e){var n=e.datas,r=e.isRequest,i=e.distX,o=e.distY,a=n.targetInverseMatrix,s=n.prevMatrix,u=n.isWarp,c=n.startValue,l=n.poses,f=n.posIndexes,p=n.absolutePoses;if(!u)return!1;if(fr(t,e,"matrix3d"),si(t,"warpable")){var d=f.map((function(t){return p[t]}));d.length>1&&d.push([(d[0][0]+d[1][0])/2,(d[0][1]+d[1][1])/2]);var h=zi(t,r,{horizontal:d.map((function(t){return t[1]+o})),vertical:d.map((function(t){return t[0]+i}))}),v=h.horizontal,g=h.vertical;o-=v.offset,i-=g.offset}var m=gr({datas:n,distX:i,distY:o},!0),b=n.nextPoses.slice();if(f.forEach((function(t){b[t]=be(b[t],m)})),!Zn.every((function(t){return e=t.map((function(t){return l[t]})),n=t.map((function(t){return b[t]})),r=Aa(e[0],e[1],e[2]),i=Aa(n[0],n[1],n[2]),o=Math.PI,!(r>=o&&i<=o||r<=o&&i>=o);var e,n,r,i,o})))return!1;var x=Ge(l[0],l[2],l[1],l[3],b[0],b[2],b[1],b[3]);if(!x.length)return!1;var y=hr(n,me(a,x,4),!0),E=me(pe(s,4),y,4);n.prevMatrix=y;var S=me(c,y,4),D=pr(n,"matrix3d(".concat(S.join(", "),")"),"matrix3d(".concat(y.join(", "),")"));return Dr(e,D),oa(t,"onWarp",na(t,e,Mn({delta:E,matrix:S,dist:y,multiply:me,transform:D},ta({transform:D},e)))),!0},dragControlEnd:function(t,e){var n=e.datas,r=e.isDrag;return!!n.isWarp&&(n.isWarp=!1,oa(t,"onWarpEnd",ra(t,e,{})),r)}},Fa=xo("area-pieces"),Na=xo("area-piece"),qa=xo("avoid"),Ya=xo("view-dragging");function Xa(t){var e=t.areaElement;if(e){var n=t.state,r=n.width,i=n.height;K(e,qa),e.style.cssText+="left: 0px; top: 0px; width: ".concat(r,"px; height: ").concat(i,"px")}}function Wa(t){return t.createElement("div",{key:"area_pieces",className:Fa},t.createElement("div",{className:Na}),t.createElement("div",{className:Na}),t.createElement("div",{className:Na}),t.createElement("div",{className:Na}))}var ja={name:"dragArea",props:["dragArea","passDragArea"],events:["click","clickGroup"],render:function(t,e){var n=t.props,r=n.target,o=n.dragArea,a=n.groupable,s=n.passDragArea,u=t.getState(),c=u.width,l=u.height,f=u.renderPoses,p=s?xo("area","pass"):xo("area");if(a)return[e.createElement("div",{key:"area",ref:i(t,"areaElement"),className:p}),Wa(e)];if(!r||!o)return[];var d=Ge([0,0],[c,0],[0,l],[c,l],f[0],f[1],f[2],f[3]),h=d.length?To(d,!0):"none";return[e.createElement("div",{key:"area",ref:i(t,"areaElement"),className:p,style:{top:"0px",left:"0px",width:"".concat(c,"px"),height:"".concat(l,"px"),transformOrigin:"0 0",transform:h}}),Wa(e)]},dragStart:function(t,e){var n=e.datas,r=e.clientX,i=e.clientY;if(!e.inputEvent)return!1;n.isDragArea=!1;var o=t.areaElement,a=t.state,s=a.moveableClientRect,u=a.renderPoses,c=a.rootMatrix,l=a.is3d,f=s.left,p=s.top,d=Ao(u),h=d.left,v=d.top,g=d.width,m=d.height,b=On(pa(c,[r-f,i-p],l?4:3),2),x=b[0],y=b[1],E=[{left:h,top:v,width:g,height:(y-=v)-10},{left:h,top:v,width:(x-=h)-10,height:m},{left:h,top:v+y+10,width:g,height:m-y-10},{left:h+x+10,top:v,width:g-x-10,height:m}],S=[].slice.call(o.nextElementSibling.children);E.forEach((function(t,e){S[e].style.cssText="left: ".concat(t.left,"px;top: ").concat(t.top,"px; width: ").concat(t.width,"px; height: ").concat(t.height,"px;")})),Z(o,qa),a.disableNativeEvent=!0},drag:function(t,e){var n=e.datas,r=e.inputEvent;if(this.enableNativeEvent(t),!r)return!1;n.isDragArea||(n.isDragArea=!0,Xa(t))},dragEnd:function(t,e){this.enableNativeEvent(t);var n=e.inputEvent,r=e.datas;if(!n)return!1;r.isDragArea||Xa(t)},dragGroupStart:function(t,e){return this.dragStart(t,e)},dragGroup:function(t,e){return this.drag(t,e)},dragGroupEnd:function(t,e){return this.dragEnd(t,e)},unset:function(t){Xa(t),t.state.disableNativeEvent=!1},enableNativeEvent:function(t){var e=t.state;e.disableNativeEvent&&B((function(){e.disableNativeEvent=!1}))}},Ha=Pn("origin",{props:["origin","svgOrigin"],render:function(t,e){var n,r=t.props,i=r.zoom,o=r.svgOrigin,a=r.groupable,s=t.getState(),u=s.beforeOrigin,c=s.rotation,l=s.svg,f=s.allMatrix,p=s.is3d,d=s.left,h=s.top,v=s.offsetWidth,g=s.offsetHeight;if(!a&&l&&o){var m=On(wa(o,v,g),2);n=Yo(c,i,xe(ko(f,[m[0],m[1]],p?4:3),[d,h]))}else n=Yo(c,i,u);return[e.createElement("div",{className:xo("control","origin"),style:n,key:"beforeOrigin"})]}});function La(t){var e=t.scrollContainer;return[e.scrollLeft,e.scrollTop]}var Va={name:"scrollable",canPinch:!0,props:["scrollable","scrollContainer","scrollThreshold","scrollThrottleTime","getScrollPosition","scrollOptions"],events:["scroll","scrollGroup"],dragRelation:"strong",dragStart:function(t,e){var n=t.props,r=n.scrollContainer,i=void 0===r?t.getContainer():r,o=n.scrollOptions,a=new Ke,s=xa(i,!0);e.datas.dragScroll=a,t.state.dragScroll=a;var u=e.isControl?"controlGesto":"targetGesto",c=e.targets;a.on("scroll",(function(n){var r=n.container,i=n.direction,o=na(t,e,{scrollContainer:r,direction:i}),a=c?"onScrollGroup":"onScroll";c&&(o.targets=c),oa(t,a,o)})).on("move",(function(e){var n=e.offsetX,r=e.offsetY,i=e.inputEvent;t[u].scrollBy(n,r,i.inputEvent,!1)})).on("scrollDrag",(function(e){(0,e.next)(t[u].getCurrentEvent())})),a.dragStart(e,Mn({container:s},o))},checkScroll:function(t,e){var n=e.datas.dragScroll;if(n){var r=t.props,i=r.scrollContainer,o=void 0===i?t.getContainer():i,a=r.scrollThreshold,s=void 0===a?0:a,u=r.scrollThrottleTime,c=void 0===u?0:u,l=r.getScrollPosition,f=void 0===l?La:l,p=r.scrollOptions;return n.drag(e,Mn({container:o,threshold:s,throttleTime:c,getScrollPosition:function(t){return f({scrollContainer:t.container,direction:t.direction})}},p)),!0}},drag:function(t,e){return this.checkScroll(t,e)},dragEnd:function(t,e){e.datas.dragScroll.dragEnd(),e.datas.dragScroll=null},dragControlStart:function(t,e){return this.dragStart(t,Mn(Mn({},e),{isControl:!0}))},dragControl:function(t,e){return this.drag(t,e)},dragControlEnd:function(t,e){return this.dragEnd(t,e)},dragGroupStart:function(t,e){return this.dragStart(t,Mn(Mn({},e),{targets:t.props.targets}))},dragGroup:function(t,e){return this.drag(t,Mn(Mn({},e),{targets:t.props.targets}))},dragGroupEnd:function(t,e){return this.dragEnd(t,Mn(Mn({},e),{targets:t.props.targets}))},dragGroupControlStart:function(t,e){return this.dragStart(t,Mn(Mn({},e),{targets:t.props.targets,isControl:!0}))},dragGroupControl:function(t,e){return this.drag(t,Mn(Mn({},e),{targets:t.props.targets}))},dragGroupControEnd:function(t,e){return this.dragEnd(t,Mn(Mn({},e),{targets:t.props.targets}))},unset:function(t){var e,n=t.state;null===(e=n.dragScroll)||void 0===e||e.dragEnd(),n.dragScroll=null}},Ua={name:"",props:["target","dragTargetSelf","dragTarget","dragContainer","container","warpSelf","rootContainer","useResizeObserver","useMutationObserver","zoom","dragFocusedInput","transformOrigin","ables","className","pinchThreshold","pinchOutside","triggerAblesSimultaneously","checkInput","cspNonce","translateZ","hideDefaultLines","props","flushSync","stopPropagation","preventClickEventOnDrag","preventClickDefault","viewContainer","persistData","useAccuratePosition","firstRenderState","linePadding","controlPadding","preventDefault","requestStyles"],events:["changeTargets"]},$a=Pn("padding",{props:["padding"],render:function(t,e){var n=t.props;if(n.dragArea)return[];var r=Ta(n.padding||{}),i=r.left,o=r.top,a=r.right,s=r.bottom,u=t.getState(),c=u.renderPoses,l=[u.pos1,u.pos2,u.pos3,u.pos4],f=[];return i>0&&f.push([0,2]),o>0&&f.push([0,1]),a>0&&f.push([1,3]),s>0&&f.push([2,3]),f.map((function(t,n){var r=On(t,2),i=r[0],o=r[1],a=Ge([0,0],[100,0],[0,100],[100,100],l[i],l[o],c[i],c[o]);if(a.length)return e.createElement("div",{key:"padding".concat(n),className:xo("padding"),style:{transform:To(a,!0)}})}))}}),Za=["nw","ne","se","sw"];function Ka(t,e){var n=t[0]+t[1],r=n>e?e/n:1;return t[0]*=r,t[1]=e-t[1]*r,t}var Ja=[1,2,5,6],Qa=[0,3,4,7],ts=[1,-1,-1,1],es=[1,1,-1,-1];function ns(t,e,n,r,i,o,a,s){void 0===i&&(i=0),void 0===o&&(o=0),void 0===a&&(a=n),void 0===s&&(s=r);var u=[],c=!1,l=t.filter((function(t){return!t.virtual})),f=l.map((function(t){var l=t.horizontal,f=t.vertical,p=t.pos;if(f&&!c&&(c=!0,u.push("/")),c){var d=Math.max(0,1===f?p[1]-o:s-p[1]);return u.push(va(d,r,e)),d}d=Math.max(0,1===l?p[0]-i:a-p[0]);return u.push(va(d,n,e)),d}));return{radiusPoses:l,styles:u,raws:f}}function rs(t){for(var e=[0,0],n=[0,0],r=t.length,i=0;i-1?t.slice(0,f):t).length,d=t.slice(0,p),h=t.slice(p+1),v=d.length,g=h.length,m=g>0,b=On(d,4),x=b[0],y=void 0===x?"0px":x,E=b[1],S=void 0===E?y:E,D=b[2],C=void 0===D?y:D,w=b[3],_=void 0===w?S:w,M=On(h,4),O=M[0],R=void 0===O?y:O,P=M[1],T=void 0===P?m?R:S:P,z=M[2],G=void 0===z?m?R:C:z,k=M[3],B=void 0===k?m?T:_:k,A=[y,S,C,_].map((function(t){return F(t,e)})),I=[R,T,G,B].map((function(t){return F(t,n)})),N=A.slice(),q=I.slice();s=On(Ka([N[0],N[1]],e),2),N[0]=s[0],N[1]=s[1],u=On(Ka([N[3],N[2]],e),2),N[3]=u[0],N[2]=u[1],c=On(Ka([q[0],q[3]],n),2),q[0]=c[0],q[3]=c[1],l=On(Ka([q[1],q[2]],n),2),q[1]=l[0],q[2]=l[1];var Y=a?N:N.slice(0,Math.max(o[0],v)),X=a?q:q.slice(0,Math.max(o[1],g));return Rn(Rn([],On(Y.map((function(t,e){var o=Za[e];return{virtual:e>=v,horizontal:ts[e],vertical:0,pos:[r+t,i+(-1===es[e]?n:0)],sub:!0,raw:A[e],direction:o}}))),!1),On(X.map((function(t,n){var o=Za[n];return{virtual:n>=g,horizontal:0,vertical:es[n],pos:[r+(-1===ts[n]?e:0),i+t],sub:!0,raw:I[n],direction:o}}))),!1)}var os=[[0,-1,"n"],[1,0,"e"]],as=[[-1,-1,"nw"],[0,-1,"n"],[1,-1,"ne"],[1,0,"e"],[1,1,"se"],[0,1,"s"],[-1,1,"sw"],[-1,0,"w"]];function ss(t,e,n){var r=t.props.clipRelative,i=t.state,o=i.width,a=i.height,s=e,u=s.type,c=s.poses,l="rect"===u,f="circle"===u;if("polygon"===u)return n.map((function(t){return"".concat(va(t[0],o,r)," ").concat(va(t[1],a,r))}));if(l||"inset"===u){var p=n[1][1],d=n[3][0],h=n[7][0],v=n[5][1];if(l)return[p,d,v,h].map((function(t){return"".concat(t,"px")}));var g=[p,o-d,a-v,h].map((function(t,e){return va(t,e%2?o:a,r)}));if(n.length>8){var m=On(xe(n[4],n[0]),2),b=m[0],x=m[1];g.push.apply(g,Rn(["round"],On(ns(c.slice(8).map((function(t,e){return Mn(Mn({},t),{pos:n[e]})})),r,b,x,h,p,d,v).styles),!1))}return g}if(f||"ellipse"===u){var y=n[0],E=va(Ra(n[1][1]-y[1]),f?Math.sqrt((o*o+a*a)/2):a,r);return(g=f?[E]:[va(Ra(n[2][0]-y[0]),o,r),E]).push("at",va(y[0],o,r),va(y[1],a,r)),g}}function us(t,e,n,r){var i=[r,(r+e)/2,e],o=[t,(t+n)/2,n];return as.map((function(t){var e=On(t,3),n=e[0],r=e[1],a=e[2],s=i[n+1],u=o[r+1];return{vertical:Ra(r),horizontal:Ra(n),direction:a,pos:[s,u]}}))}function cs(t){var e=[1/0,-1/0],n=[1/0,-1/0];return t.forEach((function(t){var r=t.pos;e[0]=Math.min(e[0],r[0]),e[1]=Math.max(e[1],r[0]),n[0]=Math.min(n[0],r[1]),n[1]=Math.max(n[1],r[1])})),[Ra(e[1]-e[0]),Ra(n[1]-n[0])]}function ls(t,e,n,r,i){var o,a,s,u,c,l,f,p,d;if(t){var h=i;if(!h){var v=Nr(t),g=v("clipPath");h="none"!==g?g:v("clip")}if(h&&"none"!==h&&"auto"!==h||(h=r)){var m=R(h),b=m.prefix,x=void 0===b?h:b,y=m.value,E=void 0===y?"":y,S="circle"===x,D=" ";if("polygon"===x){D=",";var C=(k=O(E||"0% 0%, 100% 0%, 100% 100%, 0% 100%")).map((function(t){var r=On(t.split(" "),2),i=r[0],o=r[1];return{vertical:1,horizontal:1,pos:[F(i,e),F(o,n)]}})),w=en(C.map((function(t){return t.pos})));return{type:x,clipText:h,poses:C,splitter:D,left:w.minX,right:w.maxX,top:w.minY,bottom:w.maxY}}if(S||"ellipse"===x){var _="",T="",z=0,G=0,k=M(E);if(S){var B;B=void 0===(a=(o=On(k,4))[0])?"50%":a,_=void 0===(s=o[2])?"50%":s,T=void 0===(u=o[3])?"50%":u,z=F(B,Math.sqrt((e*e+n*n)/2)),G=z}else{var A,I;A=void 0===(l=(c=On(k,5))[0])?"50%":l,I=void 0===(f=c[1])?"50%":f,_=void 0===(p=c[3])?"50%":p,T=void 0===(d=c[4])?"50%":d,z=F(A,e),G=F(I,n)}var N=[F(_,e),F(T,n)];C=Rn([{vertical:1,horizontal:1,pos:N,direction:"nesw"}],On(os.slice(0,S?1:2).map((function(t){return{vertical:Ra(t[1]),horizontal:t[0],direction:t[2],sub:!0,pos:[N[0]+t[0]*z,N[1]+t[1]*G]}}))),!1);return{type:x,clipText:h,radiusX:z,radiusY:G,left:N[0]-z,top:N[1]-G,right:N[0]+z,bottom:N[1]+G,poses:C,splitter:D}}if("inset"===x){var q=(k=M(E||"0 0 0 0")).indexOf("round"),Y=(q>-1?k.slice(0,q):k).length,X=k.slice(Y+1),W=On(k.slice(0,Y),4),j=W[0],H=W[1],L=void 0===H?j:H,V=W[2],U=void 0===V?j:V,$=W[3],Z=void 0===$?L:$,K=On([j,U].map((function(t){return F(t,n)})),2),J=K[0],Q=K[1],tt=On([Z,L].map((function(t){return F(t,e)})),2),et=tt[0],nt=tt[1],rt=e-nt,it=n-Q,ot=is(X,rt-et,it-J,et,J);return{type:"inset",clipText:h,poses:C=Rn(Rn([],On(us(J,rt,it,et)),!1),On(ot),!1),top:J,left:et,right:rt,bottom:it,radius:X,splitter:D}}if("rect"===x){D=",";var at=On((k=O(E||"0px, ".concat(e,"px, ").concat(n,"px, 0px"))).map((function(t){return P(t).value})),4),st=at[0];return{type:"rect",clipText:h,poses:C=us(st,nt=at[1],Q=at[2],et=at[3]),top:st,right:nt,bottom:Q,left:et,values:k,splitter:D}}}}}function fs(t,e){var n=On(cr(t,e),2),r=n[0],i=n[1],o=e.datas,a=o.clipPath,s=o.clipIndex,u=a,c=u.type,l=u.poses,f=u.splitter,p=l.map((function(t){return t.pos}));if("polygon"===c)p.splice(s,0,[r,i]);else{if("inset"!==c)return;var d=Ja.indexOf(s),h=Qa.indexOf(s),v=l.length;if(function(t,e,n,r,i,o,a,s,u,c,l){void 0===c&&(c=0),void 0===l&&(l=0);var f=rs(t.slice(n)),p=f.horizontalRange,d=f.verticalRange;if(r>-1)for(var h=1===ts[r]?o-c:s-o,v=p[1];v<=r;++v){var g=1===es[v]?l:u,m=0;if(r===v?m=o:0===v?m=c+h:-1===ts[v]&&(m=s-(e[n][0]-c)),t.splice(n+v,0,{horizontal:ts[v],vertical:0,pos:[m,g]}),e.splice(n+v,0,[m,g]),0===v)break}else if(i>-1){var b=1===es[i]?a-l:u-a;if(0===p[1]&&0===d[1]){var x=[c+b,l];t.push({horizontal:ts[0],vertical:0,pos:x}),e.push(x)}var y=d[0];for(v=d[1];v<=i&&(m=1===ts[v]?c:s,g=0,i===v?g=a:0===v?g=l+b:1===es[v]?g=e[n+y][1]:-1===es[v]&&(g=u-(e[n+y][1]-l)),t.push({horizontal:0,vertical:es[v],pos:[m,g]}),e.push([m,g]),0!==v);++v);}}(l,p,8,d,h,r,i,p[4][0],p[4][1],p[0][0],p[0][1]),v===l.length)return}var g=ss(t,a,p),m="".concat(c,"(").concat(g.join(f),")");oa(t,"onClip",na(t,e,Mn({clipEventType:"added",clipType:c,poses:p,clipStyles:g,clipStyle:m,distX:0,distY:0},ta({clipPath:m},e))))}function ps(t,e){var n=e.datas,r=n.clipPath,i=n.clipIndex,o=r,a=o.type,s=o.poses,u=o.splitter,c=s.map((function(t){return t.pos})),l=c.length;if("polygon"===a)s.splice(i,1),c.splice(i,1);else{if("inset"!==a)return;if(i<8)return;if(function(t,e,n,r,i){void 0===i&&(i=e.length);var o=rs(t.slice(r)),a=o.horizontalRange,s=o.verticalRange,u=n-r,c=0;if(0===u)c=i;else if(u>0&&u=s[0]))return;c=s[0]+s[1]-u}t.splice(n,c),e.splice(n,c)}(s,c,i,8,l),l===s.length)return}var f=ss(t,r,c),p="".concat(a,"(").concat(f.join(u),")");oa(t,"onClip",na(t,e,Mn({clipEventType:"removed",clipType:a,poses:c,clipStyles:f,clipStyle:p,distX:0,distY:0},ta({clipPath:p},e))))}var ds={name:"clippable",props:["clippable","defaultClipPath","customClipPath","keepRatio","clipRelative","clipArea","dragWithClip","clipTargetBounds","clipVerticalGuidelines","clipHorizontalGuidelines","clipSnapThreshold"],events:["clipStart","clip","clipEnd"],css:[".control.clip-control {\nbackground: #6d6;\ncursor: pointer;\n}\n.control.clip-control.clip-radius {\nbackground: #d66;\n}\n.line.clip-line {\nbackground: #6e6;\ncursor: move;\nz-index: 1;\n}\n.clip-area {\nposition: absolute;\ntop: 0;\nleft: 0;\n}\n.clip-ellipse {\nposition: absolute;\ncursor: move;\nborder: 1px solid #6d6;\nborder: var(--zoompx) solid #6d6;\nborder-radius: 50%;\ntransform-origin: 0px 0px;\n}",":host {\n--bounds-color: #d66;\n}",".guideline {\npointer-events: none;\nz-index: 2;\n}",".line.guideline.bounds {\nbackground: #d66;\nbackground: var(--bounds-color);\n}"],render:function(t,e){var n=t.props,r=n.customClipPath,i=n.defaultClipPath,o=n.clipArea,a=n.zoom,s=n.groupable,u=t.getState(),c=u.target,l=u.width,f=u.height,p=u.allMatrix,d=u.is3d,h=u.left,v=u.top,g=u.pos1,m=u.pos2,b=u.pos3,x=u.pos4,y=u.clipPathState,E=u.snapBoundInfos,S=u.rotation;if(!c||s)return[];var D=ls(c,l,f,i||"inset",y||r);if(!D)return[];var C=d?4:3,w=D.type,_=D.poses.map((function(t){var e=ko(p,t.pos,C);return[e[0]-h,e[1]-v]})),M=[],O=[],R="rect"===w,P="inset"===w,T="polygon"===w;if(R||P||T){var z=P?_.slice(0,8):_;O=z.map((function(t,n){var r=0===n?z[z.length-1]:z[n-1],i=W(r,t),o=No(r,t);return e.createElement("div",{key:"clipLine".concat(n),className:xo("line","clip-line","snap-control"),"data-clip-index":n,style:{width:"".concat(o,"px"),transform:"translate(".concat(r[0],"px, ").concat(r[1],"px) rotate(").concat(i,"rad) scaleY(").concat(a,")")}})}))}if(M=_.map((function(t,n){return e.createElement("div",{key:"clipControl".concat(n),className:xo("control","clip-control","snap-control"),"data-clip-index":n,style:{transform:"translate(".concat(t[0],"px, ").concat(t[1],"px) rotate(").concat(S,"rad) scale(").concat(a,")")}})})),P&&M.push.apply(M,Rn([],On(_.slice(8).map((function(t,n){return e.createElement("div",{key:"clipRadiusControl".concat(n),className:xo("control","clip-control","clip-radius","snap-control"),"data-clip-index":8+n,style:{transform:"translate(".concat(t[0],"px, ").concat(t[1],"px) rotate(").concat(S,"rad) scale(").concat(a,")")}})}))),!1)),"circle"===w||"ellipse"===w){var G=D.left,k=D.top,B=D.radiusX,A=D.radiusY,I=On(xe(ko(p,[G,k],C),ko(p,[0,0],C)),2),F=I[0],N=I[1],q="none";if(!o){for(var Y=Math.max(10,B/5,A/5),X=[],j=0;j<=Y;++j){var H=2*Math.PI/Y*j;X.push([B+(B-a)*Math.cos(H),A+(A-a)*Math.sin(H)])}X.push([B,-2]),X.push([-2,-2]),X.push([-2,2*A+2]),X.push([2*B+2,2*A+2]),X.push([2*B+2,-2]),X.push([B,-2]),q="polygon(".concat(X.map((function(t){return"".concat(t[0],"px ").concat(t[1],"px")})).join(", "),")")}M.push(e.createElement("div",{key:"clipEllipse",className:xo("clip-ellipse","snap-control"),style:{width:"".concat(2*B,"px"),height:"".concat(2*A,"px"),clipPath:q,transform:"translate(".concat(-h+F,"px, ").concat(-v+N,"px) ").concat(To(p))}}))}if(o){var L=Ao(Rn([g,m,b,x],On(_),!1)),V=L.width,U=L.height,$=L.left,Z=L.top;if(T||R||P){X=P?_.slice(0,8):_;M.push(e.createElement("div",{key:"clipArea",className:xo("clip-area","snap-control"),style:{width:"".concat(V,"px"),height:"".concat(U,"px"),transform:"translate(".concat($,"px, ").concat(Z,"px)"),clipPath:"polygon(".concat(X.map((function(t){return"".concat(t[0]-$,"px ").concat(t[1]-Z,"px")})).join(", "),")")}}))}}return E&&["vertical","horizontal"].forEach((function(t){var n=E[t],r="horizontal"===t;n.isSnap&&O.push.apply(O,Rn([],On(n.snap.posInfos.map((function(n,i){var o=n.pos,s=xe(ko(p,r?[0,o]:[o,0],C),[h,v]),u=xe(ko(p,r?[l,o]:[o,f],C),[h,v]);return Lr(e,"",s,u,a,"clip".concat(t,"snap").concat(i),"guideline")}))),!1)),n.isBound&&O.push.apply(O,Rn([],On(n.bounds.map((function(n,i){var o=n.pos,s=xe(ko(p,r?[0,o]:[o,0],C),[h,v]),u=xe(ko(p,r?[l,o]:[o,f],C),[h,v]);return Lr(e,"",s,u,a,"clip".concat(t,"bounds").concat(i),"guideline","bounds","bold")}))),!1))})),Rn(Rn([],On(M),!1),On(O),!1)},dragControlCondition:function(t,e){return e.inputEvent&&(e.inputEvent.target.getAttribute("class")||"").indexOf("clip")>-1},dragStart:function(t,e){var n=t.props.dragWithClip;return!(void 0===n||n)&&this.dragControlStart(t,e)},drag:function(t,e){return this.dragControl(t,Mn(Mn({},e),{isDragTarget:!0}))},dragEnd:function(t,e){return this.dragControlEnd(t,e)},dragControlStart:function(t,e){var n=t.state,r=t.props,i=r.defaultClipPath,o=r.customClipPath,a=n.target,s=n.width,u=n.height,c=e.inputEvent?e.inputEvent.target:null,l=c&&c.getAttribute("class")||"",f=e.datas,p=ls(a,s,u,i||"inset",o);if(!p)return!1;var d=p.clipText;return!1===oa(t,"onClipStart",na(t,e,{clipType:p.type,clipStyle:d,poses:p.poses.map((function(t){return t.pos}))}))?(f.isClipStart=!1,!1):(f.isControl=l&&l.indexOf("clip-control")>-1,f.isLine=l.indexOf("clip-line")>-1,f.isArea=l.indexOf("clip-area")>-1||l.indexOf("clip-ellipse")>-1,f.clipIndex=c?parseInt(c.getAttribute("data-clip-index"),10):-1,f.clipPath=p,f.isClipStart=!0,n.clipPathState=d,lr(t,e),!0)},dragControl:function(t,e){var n,r,i,o=e.datas,a=e.originalDatas,s=e.isDragTarget;if(!o.isClipStart)return!1;var u=o,c=u.isControl,l=u.isLine,f=u.isArea,p=u.clipIndex,d=u.clipPath;if(!d)return!1;var h=Xo(t.props,"clippable"),v=h.keepRatio,g=0,m=0,b=a.draggable,x=gr(e);s&&b?(n=On(b.prevBeforeDist,2),g=n[0],m=n[1]):(r=On(x,2),g=r[0],m=r[1]);var y=[g,m],E=t.state,S=E.width,D=E.height,C=!f&&!c&&!l,w=d.type,_=d.poses,M=d.splitter,O=_.map((function(t){return t.pos}));C&&(g=-g,m=-m);var R=!c||"nesw"===_[p].direction,P="inset"===w||"rect"===w,T=_.map((function(){return[0,0]}));if(c&&!R){var z=_[p],G=z.horizontal,k=z.vertical,B=[g*Ra(G),m*Ra(k)];T=function(t,e,n,r,i){var o=t[e],a=o.direction,s=o.sub,u=t.map((function(){return[0,0]})),c=a?a.split(""):[];if(r&&e<8){var l=c.filter((function(t){return"w"===t||"e"===t})),f=c.filter((function(t){return"n"===t||"s"===t})),p=l[0],d=f[0];u[e]=n;var h=On(cs(t),2),v=h[0],g=h[1],m=v&&g?v/g:0;if(m&&i){var b=t[(e+4)%8].pos,x=[0,0];a.indexOf("w")>-1?x[0]=-1:a.indexOf("e")>-1&&(x[0]=1),a.indexOf("n")>-1?x[1]=-1:a.indexOf("s")>-1&&(x[1]=1);var y=Sa([v,g],n,m,x,!0),E=v+y[0],S=g+y[1],D=b[1],C=b[1],w=b[0],_=b[0];-1===x[0]?w=_-E:1===x[0]?_=w+E:(w-=E/2,_+=E/2),-1===x[1]?D=C-S:C=1===x[1]?D+S:(D=C-S/2)+S;var M=us(D,_,C,w);t.forEach((function(t,e){u[e][0]=M[e].pos[0]-t.pos[0],u[e][1]=M[e].pos[1]-t.pos[1]}))}else t.forEach((function(t,e){var r=t.direction;r&&(r.indexOf(p)>-1&&(u[e][0]=n[0]),r.indexOf(d)>-1&&(u[e][1]=n[1]))})),p&&(u[1][0]=n[0]/2,u[5][0]=n[0]/2),d&&(u[3][1]=n[1]/2,u[7][1]=n[1]/2)}else a&&!s?c.forEach((function(e){var r="n"===e||"s"===e;t.forEach((function(t,i){var o=t.direction,a=t.horizontal,s=t.vertical;o&&-1!==o.indexOf(e)&&(u[i]=[r||!a?0:n[0],r&&s?n[1]:0])}))})):u[e]=n;return u}(_,p,B,P,v)}else R&&(T=O.map((function(){return[g,m]})));var A=O.map((function(t,e){return be(t,T[e])})),I=Rn([],On(A),!1);E.snapBoundInfos=null;var N="circle"===d.type,q="ellipse"===d.type;if(N||q){var Y=Ra((rt=Ao(A)).bottom-rt.top),X=Ra(q?rt.right-rt.left:Y),W=A[0][1]+Y,j=A[0][0]-X,H=A[0][0]+X;N&&(I.push([H,rt.bottom]),T.push([1,0])),I.push([rt.left,W]),T.push([0,1]),I.push([j,rt.bottom]),T.push([1,0])}var L=no((h.clipHorizontalGuidelines||[]).map((function(t){return F("".concat(t),D)})),(h.clipVerticalGuidelines||[]).map((function(t){return F("".concat(t),S)})),S,D),V=[],U=[];if(N||q)V=[I[4][0],I[2][0]],U=[I[1][1],I[3][1]];else if(P){var $=[I[0],I[2],I[4],I[6]],Z=[T[0],T[2],T[4],T[6]];V=$.filter((function(t,e){return Z[e][0]})).map((function(t){return t[0]})),U=$.filter((function(t,e){return Z[e][1]})).map((function(t){return t[1]}))}else V=I.filter((function(t,e){return T[e][0]})).map((function(t){return t[0]})),U=I.filter((function(t,e){return T[e][1]})).map((function(t){return t[1]}));var K=[0,0],J=Gi(L,h.clipTargetBounds&&{left:0,top:0,right:S,bottom:D},V,U,5),Q=J.horizontal,tt=J.vertical,et=Q.offset,nt=tt.offset;if(Q.isBound&&(K[1]+=et),tt.isBound&&(K[0]+=nt),(q||N)&&0===T[0][0]&&0===T[0][1]){var rt,it=(rt=Ao(A)).bottom-rt.top,ot=q?rt.right-rt.left:it;ot-=tt.isBound?Ra(nt):0===tt.snapIndex?-nt:nt,it-=Q.isBound?Ra(et):0===Q.snapIndex?-et:et,N&&(ot=it=mi(tt,Q)>0?it:ot);var at=I[0];I[1][1]=at[1]-it,I[2][0]=at[0]+ot,I[3][1]=at[1]+it,I[4][0]=at[0]-ot}else if(P&&v&&c){var st=On(cs(_),2),ut=st[0],ct=st[1],lt=ut&&ct?ut/ct:0,ft=_[p].direction||"",pt=I[1][1];W=I[5][1],j=I[7][0],H=I[3][0];Ra(et)<=Ra(nt)?et=Oa(et)*Ra(nt)/lt:nt=Oa(nt)*Ra(et)*lt,ft.indexOf("w")>-1?j-=nt:ft.indexOf("e")>-1?H-=nt:(j+=nt/2,H-=nt/2),ft.indexOf("n")>-1?pt-=et:ft.indexOf("s")>-1?W-=et:(pt+=et/2,W-=et/2);var dt=us(pt,H,W,j);I.forEach((function(t,e){var n;n=On(dt[e].pos,2),t[0]=n[0],t[1]=n[1]}))}else I.forEach((function(t,e){var n=T[e];n[0]&&(t[0]-=nt),n[1]&&(t[1]-=et)}));var ht=ss(t,d,A),vt="".concat(w,"(").concat(ht.join(M),")");if(E.clipPathState=vt,N||q)V=[I[4][0],I[2][0]],U=[I[1][1],I[3][1]];else if(P){V=($=[I[0],I[2],I[4],I[6]]).map((function(t){return t[0]})),U=$.map((function(t){return t[1]}))}else V=I.map((function(t){return t[0]})),U=I.map((function(t){return t[1]}));if(E.snapBoundInfos=Gi(L,h.clipTargetBounds&&{left:0,top:0,right:S,bottom:D},V,U,1),b){var gt=E.is3d,mt=E.allMatrix,bt=gt?4:3,xt=K;s&&(xt=[y[0]+K[0]-x[0],y[1]+K[1]-x[1]]),b.deltaOffset=me(mt,[xt[0],xt[1],0,0],bt)}return oa(t,"onClip",na(t,e,Mn({clipEventType:"changed",clipType:w,poses:A,clipStyle:vt,clipStyles:ht,distX:g,distY:m},ta(((i={})["rect"===w?"clip":"clipPath"]=vt,i),e)))),!0},dragControlEnd:function(t,e){this.unset(t);var n=e.isDrag,r=e.datas,i=e.isDouble,o=r.isLine,a=r.isClipStart,s=r.isControl;return!!a&&(oa(t,"onClipEnd",ra(t,e,{})),i&&(s?ps(t,e):o&&fs(t,e)),i||n)},unset:function(t){t.state.clipPathState="",t.state.snapBoundInfos=null}},hs={name:"originDraggable",props:["originDraggable","originRelative"],events:["dragOriginStart","dragOrigin","dragOriginEnd"],css:[":host[data-able-origindraggable] .control.origin {\npointer-events: auto;\n}"],dragControlCondition:function(t,e){return e.isRequest?"originDraggable"===e.requestAble:$(e.inputEvent.target,xo("origin"))},dragControlStart:function(t,e){var n=e.datas;lr(t,e);var r=na(t,e,{dragStart:Ai.dragStart(t,(new sr).dragStart([0,0],e))}),i=oa(t,"onDragOriginStart",r);return n.startOrigin=t.state.transformOrigin,n.startTargetOrigin=t.state.targetOrigin,n.prevOrigin=[0,0],n.isDragOrigin=!0,!1===i?(n.isDragOrigin=!1,!1):r},dragControl:function(t,e){var n=e.datas,r=e.isPinch,i=e.isRequest;if(!n.isDragOrigin)return!1;var o=On(gr(e),2),a=o[0],s=o[1],u=t.state,c=u.width,l=u.height,f=u.offsetMatrix,p=u.targetMatrix,d=u.is3d,h=t.props.originRelative,v=void 0===h||h,g=d?4:3,m=[a,s];if(i){var b=e.distOrigin;(b[0]||b[1])&&(m=b)}var x=be(n.startOrigin,m),y=be(n.startTargetOrigin,m),E=xe(m,n.prevOrigin),S=xr(f,p,x,g),D=t.getRect(),C=Ao(Bo(S,c,l,g)),w=[D.left-C.left,D.top-C.top];n.prevOrigin=m;var _=[va(y[0],c,v),va(y[1],l,v)].join(" "),M=Ai.drag(t,ar(e,t.state,w,!!r,!1)),O=na(t,e,Mn(Mn({width:c,height:l,origin:x,dist:m,delta:E,transformOrigin:_,drag:M},ta({transformOrigin:_,transform:M.transform},e)),{afterTransform:M.transform}));return oa(t,"onDragOrigin",O),O},dragControlEnd:function(t,e){return!!e.datas.isDragOrigin&&(oa(t,"onDragOriginEnd",ra(t,e,{})),!0)},dragGroupControlCondition:function(t,e){return this.dragControlCondition(t,e)},dragGroupControlStart:function(t,e){return!!this.dragControlStart(t,e)},dragGroupControl:function(t,e){var n=this.dragControl(t,e);return!!n&&(t.transformOrigin=n.transformOrigin,!0)},request:function(t){var e={},n=t.getRect(),r=0,i=0,o=n.transformOrigin,a=[0,0];return{isControl:!0,requestStart:function(){return{datas:e}},request:function(t){return"deltaOrigin"in t?(a[0]+=t.deltaOrigin[0],a[1]+=t.deltaOrigin[1]):"origin"in t?(a[0]=t.origin[0]-o[0],a[1]=t.origin[1]-o[1]):("x"in t?r=t.x-n.left:"deltaX"in t&&(r+=t.deltaX),"y"in t?i=t.y-n.top:"deltaY"in t&&(i+=t.deltaY)),{datas:e,distX:r,distY:i,distOrigin:a}},requestEnd:function(){return{datas:e,isDrag:!0}}}}};function vs(t,e,n,r,i){void 0===r&&(r=[0,0]);return is(t&&"0px"!==t?M(t):[],e,n,0,0,r,i)}function gs(t,e,n,r,i){var o=t.state,a=o.width,s=o.height,u=ns(i,t.props.roundRelative,a,s),c=u.raws,l=u.styles,f=function(t,e){return void 0===e&&(e=t.map((function(t){return t.raw}))),{horizontals:t.map((function(t,n){return t.horizontal?e[n]:null})).filter((function(t){return null!=t})),verticals:t.map((function(t,n){return t.vertical?e[n]:null})).filter((function(t){return null!=t}))}}(u.radiusPoses,c),p=f.horizontals,d=f.verticals,h=l.join(" ");o.borderRadiusState=h;var v=na(t,e,Mn({horizontals:p,verticals:d,borderRadius:h,width:a,height:s,delta:r,dist:n},ta({borderRadius:h},e)));return oa(t,"onRound",v),v}function ms(t){var e,n,r=t.getState().style,i=r.borderRadius||"";if(!i&&t.props.groupable){var o=t.moveables[0],a=t.getTargets()[0];a&&((null==o?void 0:o.props.target)===a?(i=null!==(n=null===(e=t.moveables[0])||void 0===e?void 0:e.state.style.borderRadius)&&void 0!==n?n:"",r.borderRadius=i):(i=aa(a).borderRadius,r.borderRadius=i))}return i}var bs={name:"roundable",props:["roundable","roundRelative","minRoundControls","maxRoundControls","roundClickable","roundPadding","isDisplayShadowRoundControls"],events:["roundStart","round","roundEnd","roundGroupStart","roundGroup","roundGroupEnd"],css:[".control.border-radius {\nbackground: #d66;\ncursor: pointer;\nz-index: 3;\n}",".control.border-radius.vertical {\nbackground: #d6d;\nz-index: 2;\n}",".control.border-radius.virtual {\nopacity: 0.5;\nz-index: 1;\n}",":host.round-line-clickable .line.direction {\ncursor: pointer;\n}"],className:function(t){var e=t.props.roundClickable;return!0===e||"line"===e?xo("round-line-clickable"):""},requestStyle:function(){return["borderRadius"]},requestChildStyle:function(){return["borderRadius"]},render:function(t,e){var n=t.getState(),r=n.target,i=n.width,o=n.height,a=n.allMatrix,s=n.is3d,u=n.left,c=n.top,l=n.borderRadiusState,f=t.props,p=f.minRoundControls,d=void 0===p?[0,0]:p,h=f.maxRoundControls,v=void 0===h?[4,4]:h,g=f.zoom,m=f.roundPadding,b=void 0===m?0:m,x=f.isDisplayShadowRoundControls,y=f.groupable;if(!r)return null;var E=l||ms(t),S=s?4:3,D=vs(E,i,o,d,!0);if(!D)return null;var C=0,w=0,_=y?[0,0]:[u,c];return D.map((function(t,n){var r=t.horizontal,i=t.vertical,o=t.direction||"",s=Rn([],On(t.pos),!1);w+=Math.abs(r),C+=Math.abs(i),r&&o.indexOf("n")>-1&&(s[1]-=b),i&&o.indexOf("w")>-1&&(s[0]-=b),r&&o.indexOf("s")>-1&&(s[1]+=b),i&&o.indexOf("e")>-1&&(s[0]+=b);var u=xe(ko(a,s,S),_),c=x&&"horizontal"!==x,l=t.vertical?C<=v[1]&&(c||!t.virtual):w<=v[0]&&(x||!t.virtual);return e.createElement("div",{key:"borderRadiusControl".concat(n),className:xo("control","border-radius",t.vertical?"vertical":"",t.virtual?"virtual":""),"data-radius-index":n,style:{display:l?"block":"none",transform:"translate(".concat(u[0],"px, ").concat(u[1],"px) scale(").concat(g,")")}})}))},dragControlCondition:function(t,e){if(!e.inputEvent||e.isRequest)return!1;var n=e.inputEvent.target.getAttribute("class")||"";return n.indexOf("border-radius")>-1||n.indexOf("moveable-line")>-1&&n.indexOf("moveable-direction")>-1},dragGroupControlCondition:function(t,e){return this.dragControlCondition(t,e)},dragControlStart:function(t,e){var n=e.inputEvent,r=e.datas,i=n.target,o=i.getAttribute("class")||"",a=o.indexOf("border-radius")>-1,s=o.indexOf("moveable-line")>-1&&o.indexOf("moveable-direction")>-1,u=a?parseInt(i.getAttribute("data-radius-index"),10):-1,c=-1;if(s){var l=i.getAttribute("data-line-key")||"";l&&(c=parseInt(l.replace(/render-line-/g,""),10),isNaN(c)&&(c=-1))}if(!a&&!s)return!1;var f=na(t,e,{});if(!1===oa(t,"onRoundStart",f))return!1;r.lineIndex=c,r.controlIndex=u,r.isControl=a,r.isLine=s,lr(t,e);var p=t.props,d=p.roundRelative,h=p.minRoundControls,v=void 0===h?[0,0]:h,g=t.state,m=g.width,b=g.height;r.isRound=!0,r.prevDist=[0,0];var x=vs(ms(t)||"",m,b,v,!0)||[];return r.controlPoses=x,g.borderRadiusState=ns(x,d,m,b).styles.join(" "),f},dragControl:function(t,e){var n=e.datas,r=n.controlPoses;if(!n.isRound||!n.isControl||!r.length)return!1;var i=n.controlIndex,o=On(gr(e),2),a=o[0],s=o[1],u=[a,s],c=xe(u,n.prevDist),l=t.props.maxRoundControls,f=void 0===l?[4,4]:l,p=t.state,d=p.width,h=p.height,v=r[i],g=v.vertical,m=v.horizontal,b=r.map((function(t){var e=t.horizontal,n=t.vertical,r=[e*m*u[0],n*g*u[1]];if(e){if(1===f[0])return r;if(f[0]<4&&e!==m)return r}else{if(0===f[1])return r[1]=n*m*u[0]/d*h,r;if(g){if(1===f[1])return r;if(f[1]<4&&n!==g)return r}}return[0,0]}));b[i]=u;var x=r.map((function(t,e){return Mn(Mn({},t),{pos:be(t.pos,b[e])})}));return i<4?x.slice(0,i+1).forEach((function(t){t.virtual=!1})):x.slice(4,i+1).forEach((function(t){t.virtual=!1})),n.prevDist=[a,s],gs(t,e,u,c,x)},dragControlEnd:function(t,e){var n=t.state;n.borderRadiusState="";var r=e.datas,i=e.isDouble;if(!r.isRound)return!1;var o=r.isControl,a=r.controlIndex,s=r.isLine,u=r.lineIndex,c=r.controlPoses,l=c.filter((function(t){return t.virtual})).length,f=t.props.roundClickable,p=void 0===f||f;if(i&&p){if(!o||!0!==p&&"control"!==p){if(s&&(!0===p||"line"===p)){var d=On(cr(t,e),2);!function(t,e,n,r){var i=t.filter((function(t){var e=t.virtual;return t.horizontal&&!e})).length,o=t.filter((function(t){var e=t.virtual;return t.vertical&&!e})).length,a=-1;if(0===e&&(0===i?a=0:1===i&&(a=1)),2===e&&(i<=2?a=2:i<=3&&(a=3)),3===e&&(0===o?a=4:o<4&&(a=7)),1===e&&(o<=1?a=5:o<=2&&(a=6)),-1!==a&&t[a].virtual){var s=t[a];!function(t,e){e<4?t.slice(0,e+1).forEach((function(t){t.virtual=!1})):(t[0].virtual&&(t[0].virtual=!1),t.slice(4,e+1).forEach((function(t){t.virtual=!1})))}(t,a),a<4?s.pos[0]=n:s.pos[1]=r}}(c,u,d[0],d[1])}}else!function(t,e){e<4?t.slice(e,4).forEach((function(t){t.virtual=!0})):t.slice(e).forEach((function(t){t.virtual=!0}))}(c,a);l!==c.filter((function(t){return t.virtual})).length&&gs(t,e,[0,0],[0,0],c)}var h=ra(t,e,{});return oa(t,"onRoundEnd",h),n.borderRadiusState="",h},dragGroupControlStart:function(t,e){var n=this.dragControlStart(t,e);if(!n)return!1;var r=t.moveables,i=t.props.targets,o=qr(t,"roundable",e);return oa(t,"onRoundGroupStart",Mn({targets:t.props.targets,events:o.map((function(t,e){return Mn(Mn({},t),{target:i[e],moveable:r[e],currentTarget:r[e]})}))},n)),n},dragGroupControl:function(t,e){var n=this.dragControl(t,e);if(!n)return!1;var r=t.moveables,i=t.props.targets,o=qr(t,"roundable",e),a=Mn({targets:t.props.targets,events:o.map((function(t,e){return Mn(Mn(Mn({},t),{target:i[e],moveable:r[e],currentTarget:r[e]}),ta({borderRadius:n.borderRadius},t))}))},n);return oa(t,"onRoundGroup",a),a},dragGroupControlEnd:function(t,e){var n=t.moveables,r=t.props.targets,i=qr(t,"roundable",e);ia(t,"onRound",(function(e){var o=Mn({targets:t.props.targets,events:i.map((function(t,i){return Mn(Mn(Mn({},t),{target:r[i],moveable:n[i],currentTarget:n[i]}),ta({borderRadius:e.borderRadius},t))}))},e);oa(t,"onRoundGroup",o)}));var o=this.dragControlEnd(t,e);if(!o)return!1;var a=Mn({targets:t.props.targets,events:i.map((function(t,e){var i;return Mn(Mn({},t),{target:r[e],moveable:n[e],currentTarget:n[e],lastEvent:null===(i=t.datas)||void 0===i?void 0:i.lastEvent})}))},o);return oa(t,"onRoundGroupEnd",a),a},unset:function(t){t.state.borderRadiusState=""}};var xs={isPinch:!0,name:"beforeRenderable",props:[],events:["beforeRenderStart","beforeRender","beforeRenderEnd","beforeRenderGroupStart","beforeRenderGroup","beforeRenderGroupEnd"],dragRelation:"weak",setTransform:function(t,e){var n=t.state,r=n.is3d,i=n.targetMatrix,o=n.inlineTransform,a=r?"matrix3d(".concat(i.join(","),")"):"matrix(".concat(ye(i,!0),")"),s=o&&"none"!==o?o:a;e.datas.startTransforms=function(t,e){var n=Pe(e?4:3);return t==="matrix".concat(e?"3d":"","(").concat(n.join(","),")")||"matrix(1,0,0,1,0,0)"===t}(s,r)?[]:M(s)},resetStyle:function(t){var e=t.datas;e.nextStyle={},e.nextTransforms=t.datas.startTransforms,e.nextTransformAppendedIndexes=[]},fillDragStartParams:function(t,e){return na(t,e,{setTransform:function(t){e.datas.startTransforms=y(t)?t:M(t)},isPinch:!!e.isPinch})},fillDragParams:function(t,e){return na(t,e,{isPinch:!!e.isPinch})},dragStart:function(t,e){this.setTransform(t,e),this.resetStyle(e),oa(t,"onBeforeRenderStart",this.fillDragStartParams(t,e))},drag:function(t,e){e.datas.startTransforms||this.setTransform(t,e),this.resetStyle(e),oa(t,"onBeforeRender",na(t,e,{isPinch:!!e.isPinch}))},dragEnd:function(t,e){e.datas.startTransforms||(this.setTransform(t,e),this.resetStyle(e)),oa(t,"onBeforeRenderEnd",na(t,e,{isPinch:!!e.isPinch,isDrag:e.isDrag}))},dragGroupStart:function(t,e){var n=this;this.dragStart(t,e);var r=qr(t,"beforeRenderable",e),i=t.moveables,o=r.map((function(t,e){var r=i[e];return n.setTransform(r,t),n.resetStyle(t),n.fillDragStartParams(r,t)}));oa(t,"onBeforeRenderGroupStart",na(t,e,{isPinch:!!e.isPinch,targets:t.props.targets,setTransform:function(){},events:o}))},dragGroup:function(t,e){var n=this;this.drag(t,e);var r=qr(t,"beforeRenderable",e),i=t.moveables,o=r.map((function(t,e){var r=i[e];return n.resetStyle(t),n.fillDragParams(r,t)}));oa(t,"onBeforeRenderGroup",na(t,e,{isPinch:!!e.isPinch,targets:t.props.targets,events:o}))},dragGroupEnd:function(t,e){this.dragEnd(t,e),oa(t,"onBeforeRenderGroupEnd",na(t,e,{isPinch:!!e.isPinch,isDrag:e.isDrag,targets:t.props.targets}))},dragControlStart:function(t,e){return this.dragStart(t,e)},dragControl:function(t,e){return this.drag(t,e)},dragControlEnd:function(t,e){return this.dragEnd(t,e)},dragGroupControlStart:function(t,e){return this.dragGroupStart(t,e)},dragGroupControl:function(t,e){return this.dragGroup(t,e)},dragGroupControlEnd:function(t,e){return this.dragGroupEnd(t,e)}},ys={name:"renderable",props:[],events:["renderStart","render","renderEnd","renderGroupStart","renderGroup","renderGroupEnd"],dragRelation:"weak",dragStart:function(t,e){oa(t,"onRenderStart",na(t,e,{isPinch:!!e.isPinch}))},drag:function(t,e){oa(t,"onRender",this.fillDragParams(t,e))},dragAfter:function(t,e){return this.drag(t,e)},dragEnd:function(t,e){oa(t,"onRenderEnd",this.fillDragEndParams(t,e))},dragGroupStart:function(t,e){oa(t,"onRenderGroupStart",na(t,e,{isPinch:!!e.isPinch,targets:t.props.targets}))},dragGroup:function(t,e){var n=this,r=qr(t,"beforeRenderable",e),i=t.moveables,o=r.map((function(t,e){var r=i[e];return n.fillDragParams(r,t)}));oa(t,"onRenderGroup",na(t,e,Mn(Mn({isPinch:!!e.isPinch,targets:t.props.targets,transform:_r(e),transformObject:{}},ta(Mr(e))),{events:o})))},dragGroupEnd:function(t,e){var n=this,r=qr(t,"beforeRenderable",e),i=t.moveables,o=r.map((function(t,e){var r=i[e];return n.fillDragEndParams(r,t)}));oa(t,"onRenderGroupEnd",na(t,e,Mn({isPinch:!!e.isPinch,isDrag:e.isDrag,targets:t.props.targets,events:o,transformObject:{},transform:_r(e)},ta(Mr(e)))))},dragControlStart:function(t,e){return this.dragStart(t,e)},dragControl:function(t,e){return this.drag(t,e)},dragControlAfter:function(t,e){return this.dragAfter(t,e)},dragControlEnd:function(t,e){return this.dragEnd(t,e)},dragGroupControlStart:function(t,e){return this.dragGroupStart(t,e)},dragGroupControl:function(t,e){return this.dragGroup(t,e)},dragGroupControlEnd:function(t,e){return this.dragGroupEnd(t,e)},fillDragParams:function(t,e){var n={};return Ie(wr(e)||[]).forEach((function(t){n[t.name]=t.functionValue})),na(t,e,Mn({isPinch:!!e.isPinch,transformObject:n,transform:_r(e)},ta(Mr(e))))},fillDragEndParams:function(t,e){var n={};return Ie(wr(e)||[]).forEach((function(t){n[t.name]=t.functionValue})),na(t,e,Mn({isPinch:!!e.isPinch,isDrag:e.isDrag,transformObject:n,transform:_r(e)},ta(Mr(e))))}};function Es(t,e,n,r,i,o,a){o.clientDistX=o.distX,o.clientDistY=o.distY;var s="Start"===i,u="End"===i,c="After"===i,l=t.state.target,f=o.isRequest,p=r.indexOf("Control")>-1;if(!l||s&&p&&!f&&t.areaElement===o.inputEvent.target)return!1;var d=Rn([],On(e),!1);if(f){var h=o.requestAble;d.some((function(t){return t.name===h}))||d.push.apply(d,Rn([],On(t.props.ables.filter((function(t){return t.name===h}))),!1))}if(!d.length||d.every((function(t){return t.dragRelation})))return!1;var v,g=o.inputEvent;u&&g&&(v=document.elementFromPoint(o.clientX,o.clientY)||g.target);var m=!1,b=function(){var t;m=!0,null===(t=o.stop)||void 0===t||t.call(o)},x=s&&(!t.targetGesto||!t.controlGesto||!t.targetGesto.isFlag()||!t.controlGesto.isFlag());x&&t.updateRect(i,!0,!1);var y=o.datas,E=p?"controlGesto":"targetGesto",S=t[E],D=function(e,n,r){if(!(n in e)||S!==t[E])return!1;var i=e.name,a=y[i]||(y[i]={});if(s&&(a.isEventStart=!r||!e[r]||e[r](t,o)),!a.isEventStart)return!1;var u=e[n](t,Mn(Mn({},o),{stop:b,datas:a,originalDatas:y,inputTarget:v}));return t._emitter.off(),s&&!1===u&&(a.isEventStart=!1),u};x&&d.forEach((function(e){e.unset&&e.unset(t)})),D(xs,"drag".concat(r).concat(i));var C=0,w=0;n.forEach((function(e){if(m)return!1;var n="".concat(e).concat(r).concat(i),a="".concat(e).concat(r,"Condition");""!==i||f||da(t.state,o);var u=d.filter((function(t){return t[n]})),c=(u=u.filter((function(t,e){return t.name&&u.indexOf(t)===e}))).filter((function(t){return D(t,n,a)})).length;m&&++C,c&&++w,!m&&s&&u.length&&!c&&(C+=u.filter((function(t){var e=t.name;return!!y[e].isEventStart&&"strong"!==t.dragRelation})).length?1:0)})),c&&!w||D(ys,"drag".concat(r).concat(i));var _=S!==t[E]||C===n.length;if((u||m||_)&&(t.state.gestos={},t.moveables&&t.moveables.forEach((function(t){t.state.gestos={}})),d.forEach((function(e){e.unset&&e.unset(t)}))),s&&!_&&!f&&w&&t.props.preventDefault&&(null==o||o.preventDefault()),t.isUnmounted||_)return!1;(!s&&w&&!a||u)&&(t.props.flushSync||yo)((function(){t.updateRect(u?i:"",!0,!1),t.forceUpdate()}));return s||u||c||!w||a||Es(t,e,n,r,i+"After",o),!0}function Ss(t){return function(e){var n,r=e.inputEvent.target,i=t.areaElement,o=t._dragTarget;return!(!o||(null===(n=t.controlGesto)||void 0===n?void 0:n.isFlag()))&&(r===o||o.contains(r)||r===i||!t.isMoveableElement(r)&&!t.controlBox.contains(r)||$(r,"moveable-area")||$(r,"moveable-padding")||$(r,"moveable-edgeDraggable"))}}function Ds(t,e,n){var r=t.controlBox,i=[],o=t.props,a=o.dragArea,s=t.state.target,u=o.dragTarget;return i.push(r),a&&!u||i.push(e),!a&&u&&s&&e!==s&&o.dragTargetSelf&&i.push(s),Cs(t,i,"targetAbles",n,{dragStart:Ss(t),pinchStart:Ss(t)})}function Cs(t,e,n,r,i){void 0===i&&(i={});var o="targetAbles"===n,a=t.props,s=a.pinchOutside,u=a.pinchThreshold,c=a.preventClickEventOnDrag,l=a.preventClickDefault,f=a.checkInput,p=a.dragFocusedInput,d=a.preventDefault,h={preventDefault:void 0===d||d,preventRightClick:!0,preventWheelClick:!0,container:xa(a.dragContainer,!0)||rt(t.getControlBoxElement()),pinchThreshold:u,pinchOutside:s,preventClickEventOnDrag:!!o&&c,preventClickEventOnDragStart:!!o&&l,preventClickEventByCondition:o?null:function(e){return t.controlBox.contains(e.target)},checkInput:!!o&&f,dragFocusedInput:p},v=new xn(e,h),g="Control"===r;return["drag","pinch"].forEach((function(e){["Start","","End"].forEach((function(o){v.on("".concat(e).concat(o),(function(a){var s,u=a.eventType,c="drag"===e&&a.isPinch;if(!i[u]||i[u](a)){if(!c){var l="drag"===e?[e]:["drag",e],f=Rn([],On(t[n]),!1);Es(t,f,l,r,o,a)?(t.props.stopPropagation||"Start"===o&&g)&&(null===(s=null==a?void 0:a.inputEvent)||void 0===s||s.stopPropagation()):a.stop()}}else a.stop()}))}))})),v}var ws=function(){function t(t,e,n){var r=this;this.target=t,this.moveable=e,this.eventName=n,this.ables=[],this._onEvent=function(t){var e=r.eventName,n=r.moveable;n.state.disableNativeEvent||r.ables.forEach((function(r){r[e](n,{inputEvent:t})}))},t.addEventListener(n.toLowerCase(),this._onEvent)}var e=t.prototype;return e.setAbles=function(t){this.ables=t},e.destroy=function(){this.target.removeEventListener(this.eventName.toLowerCase(),this._onEvent),this.target=null,this.moveable=null},t}();function _s(t,e,n,r){var i;void 0===n&&(n=e);var o=kr(t,e),a=o.matrixes,s=o.is3d,u=o.targetMatrix,c=o.transformOrigin,l=o.targetOrigin,f=o.offsetContainer,p=o.hasFixed,d=o.zoom,h=function(t,e){if(Ir){var n=k(Ir,(function(n){return n[0][0]==t&&n[0][1]==e}));if(n)return n[1]}var r=kr(t,e,!0);return Ir&&Ir.push([[t,e],r]),r}(f,n),v=h.matrixes,g=h.is3d,m=h.offsetContainer,b=h.zoom,x=r||g||s,y=x?4:3,E="svg"!==t.tagName.toLowerCase()&&"ownerSVGElement"in t,S=u,D=Pe(y),C=Pe(y),w=Pe(y),_=Pe(y),M=a.length,O=v.map((function(t){return Mn(Mn({},t),{matrix:t.matrix?Rn([],On(t.matrix),!1):void 0})})).reverse();a.reverse(),!s&&x&&(S=ve(S,3,4),Ro(a)),!g&&x&&Ro(O),O.forEach((function(t){C=me(C,t.matrix,y)}));var R=n||nt(t),P=(null===(i=O[0])||void 0===i?void 0:i.target)||_o(R,R,!0).offsetParent,T=O.slice(1).reduce((function(t,e){return me(t,e.matrix,y)}),Pe(y));a.forEach((function(t,e){if(M-2===e&&(w=D.slice()),M-1===e&&(_=D.slice()),!t.matrix){var n=function(t,e,n,r,i){var o,a=t.target,s=t.origin,u=e.matrix,c=Wo(a),l=c.offsetWidth,f=c.offsetHeight,p=n.getBoundingClientRect(),d=[0,0];n===nt(n)&&(d=Oo(a,!0));for(var h=a.getBoundingClientRect(),v=h.left-p.left+n.scrollLeft-(n.clientLeft||0)+d[0],g=h.top-p.top+n.scrollTop-(n.clientTop||0)+d[1],m=h.width,b=h.height,x=ge(r,i,u),y=Io(x,l,f,r),E=y.left,S=y.top,D=y.width,C=y.height,w=ko(x,s,r),_=xe(w,[E,S]),M=[v+_[0]*m/D,g+_[1]*b/C],O=[0,0],R=0;++R<10;){var P=pe(i,r);o=On(xe(ko(P,M,r),ko(P,w,r)),2),O[0]=o[0],O[1]=o[1];var T=Io(ge(r,i,ze(O,r),u),l,f,r),z=T.left-v,G=T.top-g;if(Ra(z)<2&&Ra(G)<2)break;M[0]-=z,M[1]-=G}return O.map((function(t){return Math.round(t)}))}(t,a[e+1],P,y,me(T,D,y));t.matrix=ze(n,y)}D=me(D,t.matrix,y)}));var z=!E&&s;S||(S=Pe(z?4:3));var G=To(E&&16===S.length?ve(S,4,3):S,z),B=C;return C=fe(C,y,y),{hasZoom:1!==d||1!==b,hasFixed:p,matrixes:a,rootMatrix:C,originalRootMatrix:B,beforeMatrix:w,offsetMatrix:_,allMatrix:D,targetMatrix:S,targetTransform:G,inlineTransform:t.style.transform,transformOrigin:c,targetOrigin:l,is3d:x,offsetContainer:f,offsetRootContainer:m}}function Ms(t,e,n,r){void 0===n&&(n=e);var i=0,o=0,a=0,s={},u=Wo(t);if(t&&(i=u.offsetWidth,o=u.offsetHeight),t){var c=_s(t,e,n,r),l=ur(c.allMatrix,c.transformOrigin,i,o);s=Mn(Mn({},c),l);var f=ur(c.allMatrix,[50,50],100,100);a=jo([f.pos1,f.pos2],f.direction)}var p=r?4:3;return Mn(Mn(Mn({hasZoom:!1,width:i,height:o,rotation:a},u),{originalRootMatrix:Pe(p),rootMatrix:Pe(p),beforeMatrix:Pe(p),offsetMatrix:Pe(p),allMatrix:Pe(p),targetMatrix:Pe(p),targetTransform:"",inlineTransform:"",transformOrigin:[0,0],targetOrigin:[0,0],is3d:!!r,left:0,top:0,right:0,bottom:0,origin:[0,0],pos1:[0,0],pos2:[0,0],pos3:[0,0],pos4:[0,0],direction:1,hasFixed:!1,offsetContainer:null,offsetRootContainer:null,matrixes:[]}),s)}function Os(t,e,n,r,i,o){void 0===o&&(o=[]);var a=1,s=[0,0],u={left:0,top:0,width:0,height:0,right:0,bottom:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},c={left:0,top:0,width:0,height:0,right:0,bottom:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},l={left:0,top:0,width:0,height:0,right:0,bottom:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},f={left:0,top:0,width:0,height:0,right:0,bottom:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},p=[0,0],d={},h=Ms(e,n,i,!0);if(e){var v=Nr(e);o.forEach((function(t){d[t]=v(t)}));var g=h.is3d?4:3,m=ur(h.offsetMatrix,be(h.transformOrigin,de(h.targetMatrix,g)),h.width,h.height);a=m.direction,s=be(m.origin,[m.left-h.left,m.top-h.top]),f=Vo(h.offsetRootContainer);var b=_o(r,r,!0).offsetParent||h.offsetRootContainer;if(h.hasZoom){var x=ur(me(h.originalRootMatrix,h.allMatrix),h.transformOrigin,h.width,h.height),y=ur(h.originalRootMatrix,Co(Nr(b)("transformOrigin")).map((function(t){return parseFloat(t)})),b.offsetWidth,b.offsetHeight);if(u=Lo(x,f),l=Lo(y,f,b,!0),t){var E=x.left,S=x.top;c=Lo({left:E,top:S,bottom:S,right:S},f)}}else{u=Vo(e),l=function(t){var e=null==Ar?void 0:Ar.get(t);if(e)return e;var n=Vo(t,!0);return Ar&&Ar.set(t,n),n}(b),t&&(c=Vo(t));var D=l.left,C=l.top,w=l.clientLeft,_=l.clientTop,M=[u.left-D,u.top-C];p=xe(pa(h.rootMatrix,M,4),[w+h.left,_+h.top])}}return Mn({targetClientRect:u,containerClientRect:l,moveableClientRect:c,rootContainerClientRect:f,beforeDirection:a,beforeOrigin:s,originalBeforeOrigin:s,target:e,style:d,offsetDelta:p},h)}function Rs(t){var e=t.pos1,n=t.pos2,r=t.pos3,i=t.pos4;if(!(e&&n&&r&&i))return null;var o=en([e,n,r,i]),a=[o.minX,o.minY],s=xe(t.origin,a);return e=xe(e,a),n=xe(n,a),r=xe(r,a),i=xe(i,a),Mn(Mn({},t),{left:t.left,top:t.top,posDelta:a,pos1:e,pos2:n,pos3:r,pos4:i,origin:s,beforeOrigin:s,isPersisted:!0})}var Ps=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=Mn({container:null,gestos:{},renderPoses:[[0,0],[0,0],[0,0],[0,0]],disableNativeEvent:!1,posDelta:[0,0]},Os(null)),e.renderState={},e.enabledAbles=[],e.targetAbles=[],e.controlAbles=[],e.rotation=0,e.scale=[1,1],e.isMoveableMounted=!1,e.isUnmounted=!1,e.events={mouseEnter:null,mouseLeave:null},e._emitter=new je,e._prevOriginalDragTarget=null,e._originalDragTarget=null,e._prevDragTarget=null,e._dragTarget=null,e._prevPropTarget=null,e._propTarget=null,e._prevDragArea=!1,e._isPropTargetChanged=!1,e._hasFirstTarget=!1,e._reiszeObserver=null,e._observerId=0,e._mutationObserver=null,e._rootContainer=null,e._viewContainer=null,e._viewClassNames=[],e._store={},e.checkUpdateRect=function(){if(!e.isDragging()){var t=e.props.parentMoveable;t?t.checkUpdateRect():(A(e._observerId),e._observerId=B((function(){e.isDragging()||e.updateRect()})))}},e._onPreventClick=function(t){t.stopPropagation(),t.preventDefault()},e}_n(e,t);var n=e.prototype;return n.render=function(){var t=this.props,e=this.getState(),n=t.parentPosition,r=t.className,o=t.target,a=t.zoom,s=t.cspNonce,u=t.translateZ,c=t.cssStyled,l=t.groupable,f=t.linePadding,p=t.controlPadding;this._checkUpdateRootContainer(),this.checkUpdate(),this.updateRenderPoses();var d=On(n||[0,0],2),h=d[0],v=d[1],g=e.left,m=e.top,b=e.target,x=e.direction,y=e.hasFixed,E=e.offsetDelta,S=t.targets,D=this.isDragging(),C={};this.getEnabledAbles().forEach((function(t){C["data-able-".concat(t.name.toLowerCase())]=!0}));var w=this._getAbleClassName(),_=S&&S.length&&(b||l)||o||!this._hasFirstTarget&&this.state.isPersisted,M=this.controlBox||this.props.firstRenderState||this.props.persistData,O=[g-h,m-v];!l&&t.useAccuratePosition&&(O[0]+=E[0],O[1]+=E[1]);var R={position:y?"fixed":"absolute",display:_?"block":"none",visibility:M?"visible":"hidden",transform:"translate3d(".concat(O[0],"px, ").concat(O[1],"px, ").concat(u,")"),"--zoom":a,"--zoompx":"".concat(a,"px")};return f&&(R["--moveable-line-padding"]=f),p&&(R["--moveable-control-padding"]=p),Nt(c,Mn({cspNonce:s,ref:i(this,"controlBox"),className:"".concat(xo("control-box",-1===x?"reverse":"",D?"dragging":"")," ").concat(w," ").concat(r)},C,{onClick:this._onPreventClick,style:R}),this.renderAbles(),this._renderLines())},n.componentDidMount=function(){this.isMoveableMounted=!0,this.isUnmounted=!1;var t=this.props,e=t.parentMoveable,n=t.container;this._checkUpdateRootContainer(),this._checkUpdateViewContainer(),this._updateTargets(),this._updateNativeEvents(),this._updateEvents(),this.updateCheckInput(),this._updateObserver(this.props),n||e||this.state.isPersisted||(this.updateRect("",!1,!1),this.forceUpdate())},n.componentDidUpdate=function(t){this._checkUpdateRootContainer(),this._checkUpdateViewContainer(),this._updateNativeEvents(),this._updateTargets(),this._updateEvents(),this.updateCheckInput(),this._updateObserver(t)},n.componentWillUnmount=function(){var t,e;this.isMoveableMounted=!1,this.isUnmounted=!0,this._emitter.off(),null===(t=this._reiszeObserver)||void 0===t||t.disconnect(),null===(e=this._mutationObserver)||void 0===e||e.disconnect(),this._viewContainer&&this._changeAbleViewClassNames([]),Qo(this,!1),Qo(this,!0);var n=this.events;for(var r in n){var i=n[r];i&&i.destroy()}},n.getTargets=function(){var t=this.props.target;return t?[t]:[]},n.getAble=function(t){return k(this.props.ables||[],(function(e){return e.name===t}))},n.getContainer=function(){var t=this.props,e=t.parentMoveable,n=t.wrapperMoveable;return t.container||n&&n.getContainer()||e&&e.getContainer()||this.controlBox.parentElement},n.getControlBoxElement=function(){return this.controlBox},n.getDragElement=function(){return this._dragTarget},n.isMoveableElement=function(t){var e;return t&&((null===(e=t.getAttribute)||void 0===e?void 0:e.call(t,"class"))||"").indexOf(Vn)>-1},n.dragStart=function(t){var e=this.targetGesto,n=this.controlGesto;return e&&Ss(this)({inputEvent:t})?e.isFlag()||e.triggerDragStart(t):n&&this.isMoveableElement(t.target)&&(n.isFlag()||n.triggerDragStart(t)),this},n.hitTest=function(t){var e,n=this.state,r=n.target,i=n.pos1,o=n.pos2,a=n.pos3,s=n.pos4,u=n.targetClientRect;if(!r)return 0;if(it(t)){var c=t.getBoundingClientRect();e={left:c.left,top:c.top,width:c.width,height:c.height}}else e=Mn({width:0,height:0},t);var l=e.left,f=e.top,p=e.width,d=e.height,h=tn([i,o,s,a],u),v=Qe(un(h,[[l,f],[l+p,f],[l+p,f+d],[l,f+d]])),g=Qe(h);return v&&g?Math.min(100,v/g*100):0},n.isInside=function(t,e){var n=this.state,r=n.target,i=n.pos1,o=n.pos2,a=n.pos3,s=n.pos4,u=n.targetClientRect;return!!r&&nn([t,e],tn([i,o,s,a],u))},n.updateRect=function(t,e,n){void 0===n&&(n=!0);var r=this.props,i=!r.parentPosition&&!r.wrapperMoveable;i&&Fr(!0);var o=r.parentMoveable,a=this.state.target||r.target,s=this.getContainer(),u=o?o._rootContainer:this._rootContainer,c=Os(this.controlBox,a,s,s,u||s,this._getRequestStyles());if(!a&&this._hasFirstTarget&&r.persistData){var l=Rs(r.persistData);for(var f in l)c[f]=l[f]}i&&Fr(),this.updateState(c,!o&&n)},n.isDragging=function(t){var e,n,r=this.targetGesto,i=this.controlGesto;return(null==r?void 0:r.isFlag())?!t||!!(null===(e=r.getEventData()[t])||void 0===e?void 0:e.isEventStart):!!(null==i?void 0:i.isFlag())&&(!t||!!(null===(n=i.getEventData()[t])||void 0===n?void 0:n.isEventStart))},n.updateTarget=function(t){this.updateRect(t,!0)},n.getRect=function(){var t=this.state,e=Ko(this.state),n=On(e,4),r=n[0],i=n[1],o=n[2],a=n[3],s=Ao(e),u=t.width,c=t.height,l=s.width,f=s.height,p=s.left,d=s.top,h=[t.left,t.top],v=be(h,t.origin);return{width:l,height:f,left:p,top:d,pos1:r,pos2:i,pos3:o,pos4:a,offsetWidth:u,offsetHeight:c,beforeOrigin:be(h,t.beforeOrigin),origin:v,transformOrigin:t.transformOrigin,rotation:this.getRotation()}},n.getManager=function(){return this},n.stopDrag=function(t){var e;t&&"target"!==t||(!1===(null==(e=this.targetGesto)?void 0:e.isIdle())&&Jo(this,!1),null==e||e.stop());t&&"control"!==t||(!1===(null==(e=this.controlGesto)?void 0:e.isIdle())&&Jo(this,!0),null==e||e.stop())},n.getRotation=function(){var t=this.state;return function(t,e,n){var r=W(t,e)/Math.PI*180;return(r=n>=0?r:180-r)>=0?r:360+r}(t.pos1,t.pos2,t.direction)},n.request=function(t,e,n){void 0===e&&(e={});var r=this,i=r.props,o=i.parentMoveable||i.wrapperMoveable||r,a=o.props.ables,s=i.groupable,u=k(a,(function(e){return e.name===t}));if(this.isDragging()||!u||!u.request)return{request:function(){return this},requestEnd:function(){return this}};var c=u.request(r),l=n||e.isInstant,f=c.isControl?"controlAbles":"targetAbles",p="".concat(s?"Group":"").concat(c.isControl?"Control":""),d=Rn([],On(o[f]),!1),h={request:function(e){return Es(r,d,["drag"],p,"",Mn(Mn({},c.request(e)),{requestAble:t,isRequest:!0}),l),h},requestEnd:function(){return Es(r,d,["drag"],p,"End",Mn(Mn({},c.requestEnd()),{requestAble:t,isRequest:!0}),l),h}};return Es(r,d,["drag"],p,"Start",Mn(Mn({},c.requestStart(e)),{requestAble:t,isRequest:!0}),l),l?h.request(e).requestEnd():h},n.getMoveables=function(){return[this]},n.destroy=function(){this.componentWillUnmount()},n.updateRenderPoses=function(){var t=this.getState(),e=this.props,n=e.padding,r=t.originalBeforeOrigin,i=t.transformOrigin,o=t.allMatrix,a=t.is3d,s=t.pos1,u=t.pos2,c=t.pos3,l=t.pos4,f=t.left,p=t.top,d=t.isPersisted;if(n){var h=Ta(n),v=h.left,g=h.top,m=h.bottom,b=h.right,x=a?4:3,y=ge(x,ze((d?i:this.controlBox&&e.groupable?r:be(r,[f,p])).map((function(t){return-t})),x),o,ze(i,x));t.renderPoses=[ha(y,s,[-v,-g],x),ha(y,u,[b,-g],x),ha(y,c,[-v,m],x),ha(y,l,[b,m],x)]}else t.renderPoses=[s,u,c,l]},n.checkUpdate=function(){this._isPropTargetChanged=!1;var t=this.props,e=t.target,n=t.container,r=t.parentMoveable,i=this.state,o=i.target,a=i.container;if(o||e){this.updateAbles();var s=!ua(o,e);if(s||!ua(a,n)){var u=n||this.controlBox;u&&this.unsetAbles(),this.updateState({target:e,container:n}),!r&&u&&this.updateRect("End",!1,!1),this._isPropTargetChanged=s}}},n.waitToChangeTarget=function(){return new Promise((function(){}))},n.triggerEvent=function(t,e){var n=this.props;if(this._emitter.trigger(t,e),n.parentMoveable&&e.isRequest&&!e.isRequestChild)return n.parentMoveable.triggerEvent(t,e,!0);var r=n[t];return r&&r(e)},n.useCSS=function(t,e){var n=this.props.customStyledMap,r=t+e;return n[r]||(n[r]=Cn(t,e)),n[r]},n.getState=function(){var t,e=this.props;(e.target||(null===(t=e.targets)||void 0===t?void 0:t.length))&&(this._hasFirstTarget=!0);var n=this.controlBox,r=e.persistData,i=e.firstRenderState;if(i&&!n)return i;if(!this._hasFirstTarget&&r){var o=Rs(r);if(o)return this.updateState(o,!1),this.state}return this.state.isPersisted=!1,this.state},n.updateSelectors=function(){},n.unsetAbles=function(){var t=this;this.targetAbles.forEach((function(e){e.unset&&e.unset(t)}))},n.updateAbles=function(t,e){void 0===t&&(t=this.props.ables),void 0===e&&(e="");var n=this.props.triggerAblesSimultaneously,r=this.getEnabledAbles(t),i="drag".concat(e,"Start"),o="pinch".concat(e,"Start"),a="drag".concat(e,"ControlStart"),s=sa(r,[i,o],n),u=sa(r,[a],n);this.enabledAbles=r,this.targetAbles=s,this.controlAbles=u},n.updateState=function(t,e){if(e){if(this.isUnmounted)return;this.setState(t)}else{var n=this.state;for(var r in t)n[r]=t[r]}},n.getEnabledAbles=function(t){void 0===t&&(t=this.props.ables);var e=this.props;return t.filter((function(t){return t&&(t.always&&!1!==e[t.name]||e[t.name])}))},n.renderAbles=function(){var t,e,n,r,i=this,o=this.props.triggerAblesSimultaneously,a={createElement:Nt};return this.renderState={},(t=la(sa(this.getEnabledAbles(),["render"],o).map((function(t){return(0,t.render)(i,a)||[]}))).filter((function(t){return t})),e=function(t){return t.key},n=[],r={},t.forEach((function(i,o){var a=e(i,o,t),s=r[a];s||(s=[],r[a]=s,n.push(s)),s.push(i)})),n).map((function(t){return t[0]}))},n.updateCheckInput=function(){this.targetGesto&&(this.targetGesto.options.checkInput=this.props.checkInput)},n._getRequestStyles=function(){return this.getEnabledAbles().reduce((function(t,e){var n,r,i=null!==(r=null===(n=e.requestStyle)||void 0===n?void 0:n.call(e))&&void 0!==r?r:[];return Rn(Rn([],On(t),!1),On(i),!1)}),Rn([],On(this.props.requestStyles||[]),!1))},n._updateObserver=function(t){this._updateResizeObserver(t),this._updateMutationObserver(t)},n._updateEvents=function(){var t=this.controlBox,e=this.targetAbles.length,n=this.controlAbles.length,r=this._dragTarget;(!e&&this.targetGesto||this._isTargetChanged(!0))&&(Qo(this,!1),this.updateState({gestos:{}})),n||Qo(this,!0),r&&e&&!this.targetGesto&&(this.targetGesto=Ds(this,r,"")),!this.controlGesto&&n&&(this.controlGesto=Cs(this,t,"controlAbles","Control"))},n._updateTargets=function(){var t=this.props;this._prevPropTarget=this._propTarget,this._prevDragTarget=this._dragTarget,this._prevOriginalDragTarget=this._originalDragTarget,this._prevDragArea=t.dragArea,this._propTarget=t.target,this._originalDragTarget=t.dragTarget||t.target,this._dragTarget=xa(this._originalDragTarget,!0)},n._renderLines=function(){var t=this.props,e=t.zoom,n=t.hideDefaultLines,r=t.hideChildMoveableDefaultLines,i=t.parentMoveable;if(n||i&&r)return[];var o=this.getState().renderPoses,a={createElement:Nt};return[[0,1],[1,3],[3,2],[2,0]].map((function(t,n){var r=On(t,2),i=r[0],s=r[1];return Lr(a,"",o[i],o[s],e,"render-line-".concat(n))}))},n._isTargetChanged=function(t){var e=this.props,n=e.dragTarget||e.target,r=this._prevOriginalDragTarget,i=this._prevDragArea,o=e.dragArea;return!o&&r!==n||(t||o)&&i!==o||this._prevPropTarget!=this._propTarget},n._updateNativeEvents=function(){var t=this,e=this.props.dragArea?this.areaElement:this.state.target,n=this.events,r=I(n);if(this._isTargetChanged())for(var i in n){var o=n[i];o&&o.destroy(),n[i]=null}if(e){var a=this.enabledAbles;r.forEach((function(r){var i=sa(a,[r]),o=i.length>0,s=n[r];o?(s||(s=new ws(e,t,r),n[r]=s),s.setAbles(i)):s&&(s.destroy(),n[r]=null)}))}},n._checkUpdateRootContainer=function(){var t=this.props.rootContainer;!this._rootContainer&&t&&(this._rootContainer=xa(t,!0))},n._checkUpdateViewContainer=function(){var t=this.props.viewContainer;!this._viewContainer&&t&&(this._viewContainer=xa(t,!0)),this._viewContainer&&this._changeAbleViewClassNames(Rn(Rn([],On(this._getAbleViewClassNames()),!1),[this.isDragging()?Ya:""],!1))},n._changeAbleViewClassNames=function(t){var e=this._viewContainer,n=ca(t.filter(Boolean),(function(t){return t})).map((function(t){return On(t,1)[0]})),r=this._viewClassNames,i=lt(r,n),o=i.removed,a=i.added;o.forEach((function(t){K(e,r[t])})),a.forEach((function(t){Z(e,n[t])})),this._viewClassNames=n},n._getAbleViewClassNames=function(){var t=this;return(this.getEnabledAbles().map((function(e){var n;return(null===(n=e.viewClassName)||void 0===n?void 0:n.call(e,t))||""})).join(" ")+" ".concat(this._getAbleClassName("-view"))).split(/\s+/g)},n._getAbleClassName=function(t){var e=this;void 0===t&&(t="");var n=this.getEnabledAbles(),r=this.targetGesto,i=this.controlGesto,o=(null==r?void 0:r.isFlag())?r.getEventData():{},a=(null==i?void 0:i.isFlag())?i.getEventData():{};return n.map((function(n){var r,i,s,u=n.name,c=(null===(r=n.className)||void 0===r?void 0:r.call(n,e))||"";return((null===(i=o[u])||void 0===i?void 0:i.isEventStart)||(null===(s=a[u])||void 0===s?void 0:s.isEventStart))&&(c+=" ".concat(xo("".concat(u).concat(t,"-dragging")))),c.trim()})).filter(Boolean).join(" ")},n._updateResizeObserver=function(t){var e,n=this.props,r=n.target,i=rt(this.getControlBoxElement());if(i.ResizeObserver&&r&&n.useResizeObserver){if(t.target!==r||!this._reiszeObserver){var o=new i.ResizeObserver(this.checkUpdateRect);o.observe(r,{box:"border-box"}),this._reiszeObserver=o}}else null===(e=this._reiszeObserver)||void 0===e||e.disconnect()},n._updateMutationObserver=function(t){var e,n=this,r=this.props,i=r.target,o=rt(this.getControlBoxElement());if(o.MutationObserver&&i&&r.useMutationObserver){if(t.target!==i||!this._mutationObserver){var a=new o.MutationObserver((function(t){var e,r;try{for(var i=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),o=i.next();!o.done;o=i.next()){var a=o.value;"attributes"===a.type&&"style"===a.attributeName&&n.checkUpdateRect()}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}}));a.observe(i,{attributes:!0}),this._mutationObserver=a}}else null===(e=this._mutationObserver)||void 0===e||e.disconnect()},e.defaultProps={dragTargetSelf:!1,target:null,dragTarget:null,container:null,rootContainer:null,origin:!0,parentMoveable:null,wrapperMoveable:null,isWrapperMounted:!1,parentPosition:null,warpSelf:!1,svgOrigin:"",dragContainer:null,useResizeObserver:!1,useMutationObserver:!1,preventDefault:!0,linePadding:0,controlPadding:0,ables:[],pinchThreshold:20,dragArea:!1,passDragArea:!1,transformOrigin:"",className:"",zoom:1,triggerAblesSimultaneously:!1,padding:{},pinchOutside:!0,checkInput:!1,dragFocusedInput:!1,groupable:!1,hideDefaultLines:!1,cspNonce:"",translateZ:0,cssStyled:null,customStyledMap:{},props:{},stopPropagation:!1,preventClickDefault:!1,preventClickEventOnDrag:!0,flushSync:yo,firstRenderState:null,persistData:null,viewContainer:null,requestStyles:[],useAccuratePosition:!1},e}(zt),Ts={name:"groupable",props:["defaultGroupRotate","useDefaultGroupRotate","defaultGroupOrigin","groupable","groupableProps","targetGroups","hideChildMoveableDefaultLines"],events:[],render:function(t,e){var n,r=t.props,i=r.targets||[],a=t.getState(),s=a.left,u=a.top,c=a.isPersisted,l=r.zoom||1,f=t.renderGroupRects,p=(null===(n=r.persistData)||void 0===n?void 0:n.children)||[];c?i=p.map((function(){return null})):p=[];var d=Ma(t,"parentPosition",[s,u],(function(t){return t.join(",")})),h=Ma(t,"requestStyles",t.getRequestChildStyles(),(function(t){return t.join(",")}));return t.moveables=t.moveables.slice(0,i.length),Rn(Rn([],On(i.map((function(n,i){return e.createElement(Ps,{key:"moveable"+i,ref:o(t,"moveables",i),target:n,origin:!1,requestStyles:h,cssStyled:r.cssStyled,customStyledMap:r.customStyledMap,useResizeObserver:r.useResizeObserver,useMutationObserver:r.useMutationObserver,hideChildMoveableDefaultLines:r.hideChildMoveableDefaultLines,parentMoveable:t,parentPosition:[s,u],persistData:p[i],zoom:l})}))),!1),On(la(f.map((function(t,n){var r=[t.pos1,t.pos2,t.pos3,t.pos4];return[[0,1],[1,3],[3,2],[2,0]].map((function(t,i){var o=On(t,2),a=o[0],s=o[1];return Lr(e,"",xe(r[a],d),xe(r[s],d),l,"group-rect-".concat(n,"-").concat(i))}))})))),!1)}},zs=Pn("clickable",{props:["clickable"],events:["click","clickGroup"],always:!0,dragRelation:"weak",dragStart:function(){},dragControlStart:function(){},dragGroupStart:function(t,e){e.datas.inputTarget=e.inputEvent&&e.inputEvent.target},dragEnd:function(t,e){var n=t.props.target,r=e.inputEvent,i=e.inputTarget,o=!t.isMoveableElement(i)&&t.controlBox.contains(i);if(r&&i&&!e.isDrag&&!t.isMoveableElement(i)&&!o){var a=n.contains(i);oa(t,"onClick",na(t,e,{isDouble:e.isDouble,inputTarget:i,isTarget:n===i,moveableTarget:t.props.target,containsTarget:a}))}},dragGroupEnd:function(t,e){var n=e.inputEvent,r=e.inputTarget;if(n&&r&&!e.isDrag&&!t.isMoveableElement(r)&&e.datas.inputTarget!==r){var i=t.props.targets,o=i.indexOf(r),a=o>-1,s=!1;-1===o&&(s=(o=G(i,(function(t){return t.contains(r)})))>-1),oa(t,"onClickGroup",na(t,e,{isDouble:e.isDouble,targets:i,inputTarget:r,targetIndex:o,isTarget:a,containsTarget:s,moveableTarget:i[o]}))}},dragControlEnd:function(t,e){this.dragEnd(t,e)},dragGroupControlEnd:function(t,e){this.dragEnd(t,e)}});function Gs(t){var e=t.originalDatas.draggable;return e||(t.originalDatas.draggable={},e=t.originalDatas.draggable),Mn(Mn({},t),{datas:e})}var ks=Pn("edgeDraggable",{css:[".edge.edgeDraggable.line {\ncursor: move;\n}"],render:function(t,e){var n=t.props,r=n.edgeDraggable;return r?Vr(e,"edgeDraggable",r,t.getState().renderPoses,n.zoom):[]},dragCondition:function(t,e){var n,r=t.props,i=null===(n=e.inputEvent)||void 0===n?void 0:n.target;return!(!r.edgeDraggable||!i)&&(!r.draggable&&$(i,xo("direction"))&&$(i,xo("edge"))&&$(i,xo("edgeDraggable")))},dragStart:function(t,e){return Ai.dragStart(t,Gs(e))},drag:function(t,e){return Ai.drag(t,Gs(e))},dragEnd:function(t,e){return Ai.dragEnd(t,Gs(e))},dragGroupCondition:function(t,e){var n,r=t.props,i=null===(n=e.inputEvent)||void 0===n?void 0:n.target;return!(!r.edgeDraggable||!i)&&(!r.draggable&&$(i,xo("direction"))&&$(i,xo("line")))},dragGroupStart:function(t,e){return Ai.dragGroupStart(t,Gs(e))},dragGroup:function(t,e){return Ai.dragGroup(t,Gs(e))},dragGroupEnd:function(t,e){return Ai.dragGroupEnd(t,Gs(e))},unset:function(t){return Ai.unset(t)}}),Bs={name:"individualGroupable",props:["individualGroupable","individualGroupableProps"],events:[]},As=[xs,Ua,bo,za,Ai,ks,qi,ka,Ia,Vi,Va,$a,Ha,hs,ds,bs,Ts,Bs,zs,ja,ys],Is=As.reduce((function(t,e){return(e.events||[]).forEach((function(e){U(t,e)})),t}),[]),Fs=As.reduce((function(t,e){return(e.props||[]).forEach((function(e){U(t,e)})),t}),[]);function Ns(t,e){var n=On(t,3),r=n[0],i=n[1],o=n[2];return(r*e[0]+i*e[1]+o)/Math.sqrt(r*r+i*i)}function qs(t,e){var n=On(t,2),r=n[0],i=n[1];return-r*e[0]-i*e[1]}function Ys(t,e){return Math.max.apply(Math,Rn([],On(t.map((function(t){var n=On(t,4),r=n[0],i=n[1],o=n[2],a=n[3];return Math.max(r[e],i[e],o[e],a[e])}))),!1))}function Xs(t,e){return Math.min.apply(Math,Rn([],On(t.map((function(t){var n=On(t,4),r=n[0],i=n[1],o=n[2],a=n[3];return Math.min(r[e],i[e],o[e],a[e])}))),!1))}function Ws(t,e){var n=e.map((function(e){if(y(e)){var n=Ws(t,e),r=n.length;return r>1?n:1===r?n[0]:null}var i=k(t,(function(t){return t.manager.props.target===e}));return i?(i.finded=!0,i.manager):null})).filter(Boolean);return 1===n.length&&y(n[0])?n[0]:n}var js=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.differ=new Ye,e.moveables=[],e.transformOrigin="50% 50%",e.renderGroupRects=[],e._targetGroups=[],e._hasFirstTargets=!1,e}_n(e,t);var n=e.prototype;return n.componentDidMount=function(){t.prototype.componentDidMount.call(this)},n.checkUpdate=function(){this._isPropTargetChanged=!1,this.updateAbles()},n.getTargets=function(){return this.props.targets},n.updateRect=function(t,e,n){var r;void 0===n&&(n=!0);var i=this.state;if(this.controlBox&&!i.isPersisted){Fr(!0),this.moveables.forEach((function(e){e.updateRect(t,!1,!1)}));var o=this.props,a=this.moveables,s=i.target||o.target,u=a.map((function(t){return{finded:!1,manager:t}})),c=this.props.targetGroups||[],l=Ws(u,c),f=o.useDefaultGroupRotate;l.push.apply(l,Rn([],On(u.filter((function(t){return!t.finded})).map((function(t){return t.manager}))),!1));var p=[],d=!e||""!==t&&o.updateGroup,h=o.defaultGroupRotate||0;if(!this._hasFirstTargets){var v=null===(r=o.persistData)||void 0===r?void 0:r.rotation;null!=v&&(h=v)}var g=function t(e,n,r){var i=e.map((function(e){if(y(e)){var r=t(e,n),i=[r.pos1,r.pos2,r.pos3,r.pos4];return p.push(r),{poses:i,rotation:r.rotation}}return{poses:Ko(e.state),rotation:e.getRotation()}})),o=i.map((function(t){return t.rotation})),a=0,s=o[0],u=o.every((function(t){return Math.abs(s-t)<.1}));a=d?!f&&u?s:h:f||r||!u?n:s;var c=i.map((function(t){return t.poses})),l=function(t,e){var n,r,i,o=[0,0],a=[0,0],s=[0,0],u=[0,0],c=0,l=0;if(!t.length)return{pos1:o,pos2:a,pos3:s,pos4:u,minX:0,minY:0,maxX:0,maxY:0,width:c,height:l,rotation:e};var f=L(e,Jn);if(f%90){var p=f/180*Math.PI,d=Math.tan(p),h=-1/d,v=[tr,er],g=[[0,0],[0,0]],m=[tr,er],b=[[0,0],[0,0]];t.forEach((function(t){t.forEach((function(t){var e=Ns([-d,1,0],t),n=Ns([-h,1,0],t);v[0]>e&&(g[0]=t,v[0]=e),v[1]n&&(b[0]=t,m[0]=n),m[1]180&&(o=(i=On([u,s,a,o],4))[0],a=i[1],s=i[2],u=i[3]);var G=en([o,a,s,u]);return{pos1:o,pos2:a,pos3:s,pos4:u,width:c,height:l,minX:G.minX,minY:G.minY,maxX:G.maxX,maxY:G.maxY,rotation:e}}(c,a);return l}(l,this.rotation,!0);d&&(this.rotation=g.rotation,this.transformOrigin=o.defaultGroupOrigin||"50% 50%",this.scale=[1,1]),this._targetGroups=c,this.renderGroupRects=p;var m,b,x,E,S,D=this.transformOrigin,C=this.rotation,w=this.scale,_=g.width,M=g.height,O=g.minX,R=g.minY,P=(m=[[0,0],[_,0],[0,M],[_,M]],b=wa(D,_,M),x=this.rotation/180*Math.PI,E=m.map((function(t){return xe(t,b)})),S=E.map((function(t){return _e(t,x)})),{prev:E,next:S,result:S.map((function(t){return be(t,b)}))}),T=en(P.result),z=T.minX,G=T.minY,k=" rotate(".concat(C,"deg)")+" scale(".concat(Oa(w[0]),", ").concat(Oa(w[1]),")"),B="translate(".concat(-z,"px, ").concat(-G,"px)").concat(k);this.controlBox.style.transform="translate3d(".concat(O,"px, ").concat(R,"px, ").concat(this.props.translateZ||0,")"),s.style.cssText+="left:0px;top:0px;"+"transform-origin:".concat(D,";")+"width:".concat(_,"px;height:").concat(M,"px;")+"transform: ".concat(B),i.width=_,i.height=M;var A=this.getContainer(),I=Os(this.controlBox,s,this.controlBox,this.getContainer(),this._rootContainer||A,[]),F=[I.left,I.top],N=On(Ko(I),4),q=N[0],Y=N[1],X=N[2],W=N[3],j=en([q,Y,X,W]),H=[j.minX,j.minY],V=Oa(w[0]*w[1]);I.pos1=xe(q,H),I.pos2=xe(Y,H),I.pos3=xe(X,H),I.pos4=xe(W,H),I.left=O-I.left+H[0],I.top=R-I.top+H[1],I.origin=xe(be(F,I.origin),H),I.beforeOrigin=xe(be(F,I.beforeOrigin),H),I.originalBeforeOrigin=be(F,I.originalBeforeOrigin),I.transformOrigin=xe(be(F,I.transformOrigin),H),s.style.transform="translate(".concat(-z-H[0],"px, ").concat(-G-H[1],"px)")+k,Fr(),this.updateState(Mn(Mn({},I),{posDelta:H,direction:V,beforeDirection:V}),n)}},n.getRect=function(){return Mn(Mn({},t.prototype.getRect.call(this)),{children:this.moveables.map((function(t){return t.getRect()}))})},n.triggerEvent=function(e,n,r){if(r||e.indexOf("Group")>-1)return t.prototype.triggerEvent.call(this,e,n);this._emitter.trigger(e,n)},n.getRequestChildStyles=function(){return this.getEnabledAbles().reduce((function(t,e){var n,r,i=null!==(r=null===(n=e.requestChildStyle)||void 0===n?void 0:n.call(e))&&void 0!==r?r:[];return Rn(Rn([],On(t),!1),On(i),!1)}),[])},n.getMoveables=function(){return Rn([],On(this.moveables),!1)},n.updateAbles=function(){t.prototype.updateAbles.call(this,Rn(Rn([],On(this.props.ables),!1),[Ts],!1),"Group")},n._updateTargets=function(){t.prototype._updateTargets.call(this),this._originalDragTarget=this.props.dragTarget||this.areaElement,this._dragTarget=xa(this._originalDragTarget,!0)},n._updateEvents=function(){var t=this.state,e=this.props,n=this._prevDragTarget,r=e.dragTarget||this.areaElement,i=e.targets,o=this.differ.update(i),a=o.added,s=o.changed,u=o.removed,c=a.length||u.length;(c||this._prevOriginalDragTarget!==this._originalDragTarget)&&(Qo(this,!1),Qo(this,!0),this.updateState({gestos:{}})),n!==r&&(t.target=null),t.target||(t.target=this.areaElement,this.controlBox.style.display="block"),t.target&&(this.targetGesto||(this.targetGesto=Ds(this,this._dragTarget,"Group")),this.controlGesto||(this.controlGesto=Cs(this,this.controlBox,"controlAbles","GroupControl")));var l=!ua(t.container,e.container);l&&(t.container=e.container),(l||c||this.transformOrigin!==(e.defaultGroupOrigin||"50% 50%")||s.length||i.length&&!_a(this._targetGroups,e.targetGroups||[]))&&(this.updateRect(),this._hasFirstTargets=!0),this._isPropTargetChanged=!!c},n._updateObserver=function(){},e.defaultProps=Mn(Mn({},Ps.defaultProps),{transformOrigin:["50%","50%"],groupable:!0,dragArea:!0,keepRatio:!0,targets:[],defaultGroupRotate:0,defaultGroupOrigin:"50% 50%"}),e}(Ps),Hs=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.moveables=[],e}_n(e,t);var n=e.prototype;return n.render=function(){var t,e=this,n=this.props,r=n.cspNonce,a=n.cssStyled,s=n.persistData,u=n.targets||[],c=u.length,l=this.isUnmounted||!c,f=null!==(t=null==s?void 0:s.children)&&void 0!==t?t:[];return l&&!c&&f.length?u=f.map((function(){return null})):l||(f=[]),Nt(a,{cspNonce:r,ref:i(this,"controlBox"),className:xo("control-box")},u.map((function(t,r){var i,a,s=null!==(a=null===(i=n.individualGroupableProps)||void 0===i?void 0:i.call(n,t,r))&&void 0!==a?a:{};return Nt(Ps,Mn({key:"moveable"+r,ref:o(e,"moveables",r)},n,s,{target:t,wrapperMoveable:e,isWrapperMounted:e.isMoveableMounted,persistData:f[r]}))})))},n.componentDidMount=function(){},n.componentDidUpdate=function(){},n.getTargets=function(){return this.props.targets},n.updateRect=function(t,e,n){void 0===n&&(n=!0),Fr(!0),this.moveables.forEach((function(r){r.updateRect(t,e,n)})),Fr()},n.getRect=function(){return Mn(Mn({},t.prototype.getRect.call(this)),{children:this.moveables.map((function(t){return t.getRect()}))})},n.request=function(t,e,n){void 0===e&&(e={});var r=this.moveables.map((function(n){return n.request(t,Mn(Mn({},e),{isInstant:!1}),!1)})),i={request:function(t){return r.forEach((function(e){return e.request(t)})),this},requestEnd:function(){return r.forEach((function(t){return t.requestEnd()})),this}};return n||e.isInstant?i.request(e).requestEnd():i},n.dragStart=function(t){var e=t.target,n=k(this.moveables,(function(t){var n=t.getTargets()[0],r=t.getControlBoxElement(),i=t.getDragElement();return!(!n||!i)&&(i===e||i.contains(e)||i!==n&&n===e||n.contains(e)||r===e||r.contains(e))}));return n&&n.dragStart(t),this},n.hitTest=function(){return 0},n.isInside=function(){return!1},n.isDragging=function(){return!1},n.getDragElement=function(){return null},n.getMoveables=function(){return Rn([],On(this.moveables),!1)},n.updateRenderPoses=function(){},n.checkUpdate=function(){},n.triggerEvent=function(){},n.updateAbles=function(){},n._updateEvents=function(){},n._updateObserver=function(){},e}(Ps);function Ls(t,e){var n=[];return t.forEach((function(t){t&&(E(t)?e[t]&&n.push.apply(n,Rn([],On(e[t]),!1)):y(t)?n.push.apply(n,Rn([],On(Ls(t,e)),!1)):n.push(t))})),n}function Vs(t,e){var n=[];return t.forEach((function(t){t&&(E(t)?e[t]&&n.push.apply(n,Rn([],On(e[t]),!1)):y(t)?n.push(Vs(t,e)):n.push(t))})),n}function Us(t,e){return t.length!==e.length||t.some((function(t,n){var r=e[n];return!(!t&&!r)&&(t!=r&&(!y(t)||!y(r)||Us(t,r)))}))}var $s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.refTargets=[],e.selectorMap={},e._differ=new Ye,e._elementTargets=[],e._tmpRefTargets=[],e._tmpSelectorMap={},e._onChangeTargets=null,e}_n(e,t);var n,r,o=e.prototype;return e.makeStyled=function(){var t={};this.getTotalAbles().forEach((function(e){var n=e.css;n&&n.forEach((function(e){t[e]=!0}))}));var e=I(t).join("\n");this.defaultStyled=Cn("div",function(t,e){return e.replace(/([^}{]*){/gm,(function(e,n){return n.replace(/\.([^{,\s\d.]+)/g,"."+t+"$1")+"{"}))}(Vn,$n+e))},e.getTotalAbles=function(){return Rn([Ua,Ts,Bs,ja],On(this.defaultAbles),!1)},o.render=function(){var t,e=this.constructor;e.defaultStyled||e.makeStyled();var n=this.props,r=n.ables,o=n.props,a=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i1,p=Rn(Rn([],On(e.getTotalAbles()),!1),On(r||[]),!1),d=Mn(Mn(Mn({},a),o||{}),{ables:p,cssStyled:e.defaultStyled,customStyledMap:e.customStyledMap});this._elementTargets=l;var h=null,v=this.moveable,g=a.persistData;if((null==g?void 0:g.children)&&(f=!0),a.individualGroupable)return Nt(Hs,Mn({key:"individual-group",ref:i(this,"moveable")},d,{target:null,targets:l}));if(f){var m=Vs(u,c);if(v&&!v.props.groupable&&!v.props.individualGroupable){var b=v.props.target;b&&l.indexOf(b)>-1&&(h=Mn({},v.state))}return Nt(js,Mn({key:"group",ref:i(this,"moveable")},d,null!==(t=a.groupableProps)&&void 0!==t?t:{},{target:null,targets:l,targetGroups:m,firstRenderState:h}))}var x=l[0];if(v&&(v.props.groupable||v.props.individualGroupable)){var y=k(v.moveables||[],(function(t){return t.props.target===x}));y&&(h=Mn({},y.state))}return Nt(Ps,Mn({key:"single",ref:i(this,"moveable")},d,{target:x,firstRenderState:h}))},o.componentDidMount=function(){this._checkChangeTargets()},o.componentDidUpdate=function(){this._checkChangeTargets()},o.componentWillUnmount=function(){this.selectorMap={},this.refTargets=[]},o.getTargets=function(){var t,e;return null!==(e=null===(t=this.moveable)||void 0===t?void 0:t.getTargets())&&void 0!==e?e:[]},o.updateSelectors=function(){this.selectorMap={},this._updateRefs()},o.waitToChangeTarget=function(){var t,e=this;return this._onChangeTargets=function(){e._onChangeTargets=null,t()},new Promise((function(e){t=e}))},o.waitToChangeTargets=function(){return this.waitToChangeTarget()},o.getManager=function(){return this.moveable},o.getMoveables=function(){return this.moveable.getMoveables()},o.getDragElement=function(){return this.moveable.getDragElement()},o._updateRefs=function(t){var e=this.refTargets,n=ya(this.props.target||this.props.targets),r="undefined"!=typeof document,i=Us(e,n),o=this.selectorMap,a={};return this.refTargets.forEach((function t(e){E(e)?o[e]?a[e]=o[e]:r&&(i=!0,a[e]=[].slice.call(document.querySelectorAll(e))):y(e)&&e.forEach(t)})),this._tmpRefTargets=n,this._tmpSelectorMap=a,[n,a,!t&&i]},o._checkChangeTargets=function(){var t,e,n;this.refTargets=this._tmpRefTargets,this.selectorMap=this._tmpSelectorMap;var r=this._differ.update(this._elementTargets),i=r.added,o=r.removed;(i.length||o.length)&&(null===(e=(t=this.props).onChangeTargets)||void 0===e||e.call(t,{moveable:this.moveable,targets:this._elementTargets}),null===(n=this._onChangeTargets)||void 0===n||n.call(this));var a=On(this._updateRefs(),3),s=a[0],u=a[1],c=a[2];this.refTargets=s,this.selectorMap=u,c&&this.forceUpdate()},e.defaultAbles=[],e.customStyledMap={},e.defaultStyled=null,function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);o>3&&a&&Object.defineProperty(e,n,a)}([(n=or,void 0===r&&(r={}),function(t,e){n.forEach((function(n){var i=r[n]||n;i in t||(t[i]=function(){for(var t,r=[],i=0;i1&&o.updateRect(),o}e(r,t);var o=r.prototype;return o.setState=function(t,e){this.innerMoveable.setState(t,e)},o.forceUpdate=function(t){this.innerMoveable.forceUpdate(t)},o.dragStart=function(t){this.innerMoveable.$_timer&&this.forceUpdate(),this.getMoveable().dragStart(t)},o.destroy=function(){var t,e=this.selfElement;jt(null,e,this.containerProvider),this._warp||null===(t=null==e?void 0:e.parentElement)||void 0===t||t.removeChild(e),this.containerProvider=null,this.off(),this.selfElement=null,this.innerMoveable=null},o.getMoveable=function(){return this.innerMoveable.moveable},r=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}([a(Qs,(function(t,e){t[e]||(t[e]=function(){for(var t=[],n=0;n-1?t[r]:n}var B=function(){var t=z(),e=p&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame);return e?e.bind(window):function(e){var n=z();return setTimeout((function(){e(n-t)}),1e3/60)}}(),A=function(){var t=p&&(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame);return t?t.bind(window):function(t){clearTimeout(t)}}();function I(t){return Object.keys(t)}function F(t,e){var n=P(t),r=n.value,i=n.unit;if(x(e)){var o=e[i];if(o){if(D(o))return o(r);if(g[i])return g[i](r,o)}}else if("%"===i)return r*e/100;return g[i]?g[i](r):r}function N(t,e,n){return Math.max(e,Math.min(t,n))}function q(t,e,n,r){return void 0===r&&(r=t[0]/t[1]),[[L(e[0],v),L(e[0]/r,v)],[L(e[1]*r,v),L(e[1],v)]].filter((function(t){return t.every((function(t,r){var i=e[r],o=L(i,v);return n?t<=i||t<=o:t>=i||t>=o}))}))[0]||t}function Y(t,e,n,r){if(!r)return t.map((function(t,r){return N(t,e[r],n[r])}));var i=t[0],o=t[1],a=!0===r?i/o:r,s=q(t,e,!1,a),u=s[0],c=s[1],l=q(t,n,!0,a),f=l[0],p=l[1];return if||o>p)&&(i=f,o=p),[i,o]}function X(t){for(var e=t.length,n=0,r=e-1;r>=0;--r)n+=t[r];return e?n/e:0}function W(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=Math.atan2(r,n);return i>=0?i:i+2*Math.PI}function j(t){var e=function(t){return[0,1].map((function(e){return X(t.map((function(t){return t[e]})))}))}(t),n=W(e,t[0]),r=W(e,t[1]);return nr&&r-n<-Math.PI?1:-1}function H(t,e){return Math.sqrt(Math.pow((e?e[0]:0)-t[0],2)+Math.pow((e?e[1]:0)-t[1],2))}function L(t,e){if(!e)return t;var n=1/e;return Math.round(t/e)/n}function V(t,e){return t.forEach((function(n,r){t[r]=L(t[r],e)})),t}function U(t){return t.reduce((function(t,e){return t.concat(e)}),[])}function $(t,e){-1===t.indexOf(e)&&t.push(e)}function Z(t,e){return t.classList?t.classList.contains(e):!!t.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}function K(t,e){t.classList?t.classList.add(e):t.className+=" "+e}function J(t,e){if(t.classList)t.classList.remove(e);else{var n=new RegExp("(\\s|^)"+e+"(\\s|$)");t.className=t.className.replace(n," ")}}function Q(t,e,n,r){t.addEventListener(e,n,r)}function tt(t,e,n,r){t.removeEventListener(e,n,r)}function et(t){return(null==t?void 0:t.ownerDocument)||d}function nt(t){return et(t).documentElement}function rt(t){return et(t).body}function it(t){var e;return(null===(e=null==t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView)||window}function ot(t){return x(t)&&t.nodeName&&t.nodeType&&"ownerDocument"in t}var at=function(){function t(){this.keys=[],this.values=[]}var e=t.prototype;return e.get=function(t){return this.values[this.keys.indexOf(t)]},e.set=function(t,e){var n=this.keys,r=this.values,i=n.indexOf(t),o=-1===i?n.length:i;n[o]=t,r[o]=e},t}(),st=function(){function t(){this.object={}}var e=t.prototype;return e.get=function(t){return this.object[t]},e.set=function(t,e){this.object[t]=e},t}(),ut="function"==typeof Map,ct=function(){function t(){}var e=t.prototype;return e.connect=function(t,e){this.prev=t,this.next=e,t&&(t.next=this),e&&(e.prev=this)},e.disconnect=function(){var t=this.prev,e=this.next;t&&(t.next=e),e&&(e.prev=t)},e.getIndex=function(){for(var t=this,e=-1;t;)t=t.prev,++e;return e},t}();var lt=function(){function t(t,e,n,r,i,o,a,s){this.prevList=t,this.list=e,this.added=n,this.removed=r,this.changed=i,this.maintained=o,this.changedBeforeAdded=a,this.fixed=s}var e=t.prototype;return Object.defineProperty(e,"ordered",{get:function(){return this.cacheOrdered||this.caculateOrdered(),this.cacheOrdered},enumerable:!0,configurable:!0}),Object.defineProperty(e,"pureChanged",{get:function(){return this.cachePureChanged||this.caculateOrdered(),this.cachePureChanged},enumerable:!0,configurable:!0}),e.caculateOrdered=function(){var t=function(t,e){var n=[],r=[];return t.forEach((function(t){var e=t[0],i=t[1],o=new ct;n[e]=o,r[i]=o})),n.forEach((function(t,e){t.connect(n[e-1])})),t.filter((function(t,n){return!e[n]})).map((function(t,e){var i=t[0],o=t[1];if(i===o)return[0,0];var a=n[i],s=r[o-1],u=a.getIndex();return a.disconnect(),s?a.connect(s,s.next):a.connect(void 0,n[0]),[u,a.getIndex()]}))}(this.changedBeforeAdded,this.fixed),e=this.changed,n=[];this.cacheOrdered=t.filter((function(t,r){var i=t[0],o=t[1],a=e[r],s=a[0],u=a[1];if(i!==o)return n.push([s,u]),!0})),this.cachePureChanged=n},t}();function ft(t,e,n){var r=ut?Map:n?st:at,i=n||function(t){return t},o=[],a=[],s=[],u=t.map(i),c=e.map(i),l=new r,f=new r,p=[],d=[],h={},v=[],g=0,m=0;return u.forEach((function(t,e){l.set(t,e)})),c.forEach((function(t,e){f.set(t,e)})),u.forEach((function(t,e){var n=f.get(t);void 0===n?(++m,a.push(e)):h[n]=m})),c.forEach((function(t,e){var n=l.get(t);void 0===n?(o.push(e),++g):(s.push([n,e]),m=h[e]||0,p.push([n-m,e-g]),d.push(e===n),n!==e&&v.push([n,e]))})),a.reverse(),new lt(t,e,o,a,v,s,p,d)}var pt=function(){function t(t,e){void 0===t&&(t=[]),this.findKeyCallback=e,this.list=[].slice.call(t)}return t.prototype.update=function(t){var e=[].slice.call(t),n=ft(this.list,e,this.findKeyCallback);return this.list=e,n},t}(),dt=function(t,e){return dt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},dt(t,e)};function ht(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}dt(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var vt=function(){return vt=Object.assign||function(t){for(var e,n=1,r=arguments.length;ns&&t.push(e),t}),[]).forEach((function(n){jt(n,n._ps,[n.o],t,e,!0)})),!1;a.o=n,a.ss(r);var l=a.ps;return E(n)||(a.ps=n.props,a.ref=n.ref),Tt(this),a.r(t,e,a.b?l:{},r),!0},e.md=function(){this.rr()},e.ss=function(){},e.ud=function(){this.rr()},e.rr=function(){var t=this,e=t.ref,n=t.fr;e&&e(n?n.current:t.b)},t}();function Pt(){return Object.__CROACT_CURRENT_INSTNACE__}function Tt(t){return Object.__CROACT_CURRENT_INSTNACE__=t,Ot=0,t}var zt=function(){function t(t,e){void 0===t&&(t={}),this.props=t,this.context=e,this.state={},this.$_timer=0,this.$_state={},this.$_subs=[],this.$_cs={}}var e=t.prototype;return e.render=function(){return null},e.shouldComponentUpdate=function(t,e){return this.props!==t||this.state!==e},e.setState=function(t,e,n){var r=this;r.$_timer||(r.$_state={}),clearTimeout(r.$_timer),r.$_timer=0,r.$_state=vt(vt({},r.$_state),t),n?r.$_setState(e,n):r.$_timer=window.setTimeout((function(){r.$_timer=0,r.$_setState(e,n)}))},e.forceUpdate=function(t){this.setState({},t,!0)},e.componentDidMount=function(){},e.componentDidUpdate=function(t,e){},e.componentWillUnmount=function(){},e.$_setState=function(t,e){var n=[],r=this.$_p;jt(r.c,[r],[r.o],n,r._cs,vt(vt({},this.state),this.$_state),e)&&(t&&n.push(t),_t(n),Tt(null))},t}(),Gt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ht(e,t),e.prototype.shouldComponentUpdate=function(t,e){return Et(this.props,t)||Et(this.state,e)},e}(zt);function kt(t){var e=function(t){e.current=t};return e.current=t,e}var Bt=function(t){function e(e,n,r,i,o,a,s){void 0===s&&(s={});var u=t.call(this,e,n,r,i,o,a,yt(s,e.defaultProps))||this;return u.typ="comp",u._usefs=[],u._uefs=[],u._defs=[],u}ht(e,t);var n=e.prototype;return n.s=function(t,e){var n=this.b;return!1!==n.shouldComponentUpdate(yt(t,this.t.defaultProps),e||n.state)},n.r=function(t,e,n){var r,i,o=this,a=o.t;o.ps=yt(o.ps,o.t.defaultProps);var s=o.ps,u=!o.b,c=a.contextType,l=o.b,f=null==c?void 0:c.get(o);o._cs=e,u?(l=function(t,e,n,r){var i,o;return(null===(i=null==t?void 0:t.prototype)||void 0===i?void 0:i.render)?o=new t(e,n):((o=new zt(e,n)).constructor=t,t._fr?(r.fr=kt(),o.render=function(){return this.constructor(this.props,r.fr)}):o.render=Mt),o.$_p=r,o}(a,s,f,o),o.b=l):(l.props=s,l.context=f);var p=l.state;o._usefs=[],o._uefs=[];var d=l.render();0===(null===(i=null===(r=null==d?void 0:d.props)||void 0===r?void 0:r.children)||void 0===i?void 0:i.length)&&(d.props.children=o.ps.children);var h=vt(vt({},e),l.$_cs);jt(o,o._ps,d?[d]:[],t,h),u?o._uefs.push((function(){null==c||c.register(o),l.componentDidMount()})):o._uefs.push((function(){l.componentDidUpdate(n,p)})),t.push((function(){o._usefs.forEach((function(t){t()})),u?o.md():o.ud(),o._defs=o._uefs.map((function(t){return t()}))}))},n.ss=function(t){var e=this.b;e&&t&&(e.state=t)},n.un=function(){var t,e=this;e._ps.forEach((function(t){t.un()})),null===(t=e.t.contextType)||void 0===t||t.unregister(e),clearTimeout(e.b.$_timer),e._defs.forEach((function(t){t&&t()})),e.b.componentWillUnmount()},e}(Rt);function At(t,e){var n=I(t),r=I(e),i=ft(n,r,(function(t){return t})),o={},a={},s={};return i.added.forEach((function(t){var n=r[t];o[n]=e[n]})),i.removed.forEach((function(e){var r=n[e];a[r]=t[r]})),i.maintained.forEach((function(r){var i=r[0],o=n[i],a=[t[o],e[o]];t[o]!==e[o]&&(s[o]=a)})),{added:o,removed:a,changed:s}}var It=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.typ="elem",e._es={},e._svg=!1,e}ht(e,t);var n=e.prototype;return n.e=function(t,e){var n=this,r=n._es,i=n.b,o=function(t){return t.replace(/^on/g,"").toLowerCase()}(t);e?(tt(i,o,r[t]),delete r[t]):(r[t]=function(e){var r,i;null===(i=(r=n.ps)[t])||void 0===i||i.call(r,e)},Q(i,o,r[t]))},n.s=function(t){return Et(this.ps,t)},n.r=function(t,e,n){var r,i=this,o=!i.b,a=i.ps;if(o){var s=Ct(i.c),u=!1;u=!(!i._svg&&"svg"!==i.t)||s&&s.ownerSVGElement,i._svg=u;var c=null===(r=i._hyd)||void 0===r?void 0:r.splice(0,1)[0],l=i.t;if(c)i._hyd=[].slice.call(c.children||[]);else{var f=et(s);c=u?f.createElementNS("http://www.w3.org/2000/svg",l):f.createElement(l)}i.b=c}jt(i,i._ps,a.children,t,e);var p=i.b,d=Dt(n),h=d[0],v=d[1],g=Dt(a),m=g[0],b=g[1];return function(t,e,n){var r=At(St(t),St(e)),i=r.added,o=r.removed,a=r.changed;for(var s in i)n.setAttribute(s,i[s]);for(var u in a)n.setAttribute(u,a[u][1]);for(var c in o)n.removeAttribute(c)}(h,m,p),function(t,e,n){var r=At(t,e),i=r.added,o=r.removed;for(var a in o)n.e(a,!0);for(var s in i)n.e(s)}(v,b,i),function(t,e,n){var r=n.style,i=At(t,e),o=i.added,a=i.removed,s=i.changed;for(var u in o){var c=T(u,"-");r.setProperty(c,o[u])}for(var u in s){var l=T(u,"-");r.setProperty(l,s[u][1])}for(var u in a){var f=T(u,"-");r.removeProperty(f)}}(n.style||{},a.style||{},p),t.push((function(){o?i.md():i.ud()})),!0},n.un=function(){var t=this,e=t._es,n=t.b;for(var r in e)tt(n,r,e[r]);t._ps.forEach((function(t){t.un()})),t._es={},t._sel||wt(n)},e}(Rt);function Ft(t){if(!t||ot(t))return t;var e=t.$_p._ps;return e.length?Ft(e[0].b):null}function Nt(t){if(t){if(t.b&&ot(t.b))return t;var e=t._ps;return e.length?Nt(e[0]):null}}function qt(t,e){for(var n=[],r=2;r0}function Ht(t,e,n){return!n&&t&&((n=new Yt(e.parentElement))._hyd=[e],n._sel=!0),function(t,e,n,r){void 0===n&&(n=e.__CROACT__),void 0===r&&(r={});var i=!!n;n||(n=new Yt(e));var o=[];jt(n,n._ps,t?[t]:[],o,r,void 0,void 0),_t(o),Tt(null),i||(e.__CROACT__=n)}(t,e,n),n}function Lt(t){var e=Pt(),n=e._hs||(e._hs=[]),r=Ot,i=n[r];if(Ot=r+1,i){if(!Et(i.deps,t.deps))return i.updated=!1,i;n[r]=t}else n.push(t);return t.value=t.func(),t.updated=!0,t}function Vt(t){return Lt({func:function(){return kt(t)},deps:[]}).value}function Ut(t,e,n){var r=Pt(),i=Lt({func:function(){return t},deps:e}),o=n?r._usefs:r._uefs;i.updated?o.push((function(){return i.effect&&i.effect(),i.effect=t(),i.effect})):o.push((function(){return i.effect}))}function $t(t,e){for(var n=t.length,r=0;r-1&&r.splice(i,1)}}else this._events[t]=[];else this._events={};return this},e.once=function(t,e){var n=this;return e&&this._addEvent(t,e,{once:!0}),new Promise((function(e){n._addEvent(t,e,{once:!0})}))},e.emit=function(t,e){var n=this;void 0===e&&(e={});var r=this._events[t];if(!t||!r)return!0;var i=!1;return e.eventType=t,e.stop=function(){i=!0},e.currentTarget=this,function(){for(var t=0,e=0,n=arguments.length;er-o?(s[1]>a.top||rs[1])&&(u[1]=1),a.left>n-o?(s[0]>a.left||ns[0])&&(u[0]=1),!(!u[0]&&!u[1])&&this._continueDrag(Ve(Ve({},e),{direction:u,inputEvent:t,isDrag:!0}))}},n.checkScroll=function(t){var e=this;if(this._isWait)return!1;var n=t.prevScrollPos,r=void 0===n?this._prevScrollPos:n,i=t.direction,o=t.throttleTime,a=void 0===o?0:o,s=t.inputEvent,u=t.isDrag,c=this._getScrollPosition(i||[0,0],t),l=c[0]-r[0],f=c[1]-r[1],p=i||[l?Math.abs(l)/l:0,f?Math.abs(f)/f:0];return this._prevScrollPos=c,this._lock=!1,!(!l&&!f)&&(this.emit("move",{offsetX:p[0]?l:0,offsetY:p[1]?f:0,inputEvent:s}),a&&u&&(clearTimeout(this._timer),this._timer=window.setTimeout((function(){e._continueDrag(t)}),a)),!0)},n.dragEnd=function(){this._flag=!1,this._lock=!1,clearTimeout(this._timer),this._unregisterScrollEvent()},n._getScrollPosition=function(t,e){var n=e.container,r=e.getScrollPosition;return(void 0===r?Ue:r)({container:Ze(n),direction:t})},n._continueDrag=function(t){var e,n=this,r=t.container,i=t.direction,o=t.throttleTime,a=t.useScroll,s=t.isDrag,u=t.inputEvent;if(!(!this._flag||s&&this._isWait)){var c=z(),l=Math.max(o+this._prevTime-c,0);if(l>0)return clearTimeout(this._timer),this._timer=window.setTimeout((function(){n._continueDrag(t)}),l),!1;this._prevTime=c;var f=this._getScrollPosition(i,t);this._prevScrollPos=f,s&&(this._isWait=!0),a||(this._lock=!0);var p={container:Ze(r),direction:i,inputEvent:u};return null===(e=t.requestScroll)||void 0===e||e.call(t,p),this.emit("scroll",p),this._isWait=!1,a||this.checkScroll(Ve(Ve({},t),{prevScrollPos:f,direction:i,inputEvent:u}))}},n._registerScrollEvent=function(t){this._unregisterScrollEvent();var e=t.checkScrollEvent;if(e){var n=!0===e?$e:e,r=Ze(t.container);!0!==e||r!==document.body&&r!==document.documentElement?this._unregister=n(r,this._onScroll):this._unregister=$e(window,this._onScroll)}},n._unregisterScrollEvent=function(){var t;null===(t=this._unregister)||void 0===t||t.call(this),this._unregister=null},e}(He),Je=Ke;function Qe(t){return L(t,v)}function tn(t){return t.length<3?0:Math.abs(function(t){for(var e=0,n=t.length-1;n>=0;--n)e+=t[n];return e}(t.map((function(e,n){var r=t[n+1]||t[0];return e[0]*r[1]-r[0]*e[1]}))))/2}function en(t,e){var n=e.width,r=e.height,i=e.left,o=e.top,a=nn(t),s=a.minX,u=a.minY,c=a.maxX,l=a.maxY,f=n/(c-s),p=r/(l-u);return t.map((function(t){return[i+(t[0]-s)*f,o+(t[1]-u)*p]}))}function nn(t){var e=t.map((function(t){return t[0]})),n=t.map((function(t){return t[1]}));return{minX:Math.min.apply(Math,e),minY:Math.min.apply(Math,n),maxX:Math.max.apply(Math,e),maxY:Math.max.apply(Math,n)}}function rn(t,e,n){var r=t[0],i=t[1],o=nn(e),a=o.minX,s=o.maxX,u=[[a,i],[s,i]],c=on(u[0],u[1]),l=un(e),f=[];if(l.forEach((function(e){var n,r=on(e[0],e[1]),o=e[0];(n=r,c.every((function(t,e){return 0===Qe(t-n[e])})))?f.push({pos:t,line:e,type:"line"}):sn(an(c,r),[u,e]).forEach((function(t){e.some((function(e){return r=t,!Qe((n=e)[0]-r[0])&&!Qe(n[1]-r[1]);var n,r}))?f.push({pos:t,line:e,type:"point"}):0!==Qe(o[1]-i)&&f.push({pos:t,line:e,type:"intersection"})}))})),!n&&k(f,(function(t){return t[0]===r})))return!0;var p=0,d={};return f.forEach((function(t){var e=t.pos,n=t.type,o=t.line;if(!(e[0]>r))if("intersection"===n)++p;else{if("line"===n)return;if("point"===n){var a=k(o,(function(t){return t[1]!==i})),s=d[e[0]],u=a[1]>i?1:-1;s?s!==u&&++p:d[e[0]]=u}}})),p%2==1}function on(t,e){var n=t[0],r=t[1],i=e[0]-n,o=e[1]-r;Math.abs(i)0)return[];r=[[s,a],[u,a]]}}else{var c=Math.max.apply(Math,n.map((function(t){return t[1][0]}))),l=Math.min.apply(Math,n.map((function(t){return t[1][1]})));if(Qe(c-l)>0)return[];r=[[o,c],[o,l]]}}return r.length||(r=t.filter((function(t){var e=t[0],r=t[1];return n.every((function(t){return 0<=Qe(e-t[0][0])&&0<=Qe(t[0][1]-e)&&0<=Qe(r-t[1][0])&&0<=Qe(t[1][1]-r)}))}))),r.map((function(t){return[Qe(t[0]),Qe(t[1])]}))}function un(t){return function(){for(var t=0,e=0,n=arguments.length;e=0?o:o+2*Math.PI)/Math.PI);var e,n,r,i,o}function dn(t){return t?t.touches?function(t){for(var e=Math.min(t.length,2),n=[],r=0;r=-1;if(!r.flag||!n){r._isDragAPI=!0;var i=r.options,o=i.container,a=i.pinchOutside,s=i.preventWheelClick,u=i.preventRightClick,c=i.preventDefault,l=i.checkInput,f=i.dragFocusedInput,p=i.preventClickEventOnDragStart,d=i.preventClickEventOnDrag,h=i.preventClickEventByCondition,v=r._useTouch,g=!r.flag;if(r._isSecondaryButton=3===t.which||2===t.button,s&&(2===t.which||1===t.button)||u&&(3===t.which||2===t.button))return r.stop(),!1;if(g){var m=r._window.document.activeElement,b=t.target;if(b){var x=b.tagName.toLowerCase(),y=xn.indexOf(x)>-1,E=b.isContentEditable;if(y||E){if(l||!f&&m===b)return!1;if(m&&(m===b||E&&m.isContentEditable&&m.contains(b))){if(!f)return!1;b.blur()}}else if((c||"touchstart"===t.type)&&m){var S=m.tagName.toLowerCase();(m.isContentEditable||xn.indexOf(S)>-1)&&m.blur()}(p||d||h)&&Q(r._window,"click",r._onClick,!0)}r.clientStores=[new bn(dn(t))],r._isIdle=!1,r.flag=!0,r.isDrag=!1,r._isTrusted=e,r._dragFlag=!0,r._prevInputEvent=t,r.data={},r.doubleFlag=z()-r.prevTime<200,r._isMouseEvent=function(t){return t&&(t.type.indexOf("mouse")>-1||"button"in t)}(t),!r._isMouseEvent&&r._preventMouseEvent&&(r._preventMouseEvent=!1),!1===(r._preventMouseEvent||r.emit("dragStart",fn(fn({data:r.data,datas:r.data,inputEvent:t,isMouseEvent:r._isMouseEvent,isSecondaryButton:r._isSecondaryButton,isTrusted:e,isDouble:r.doubleFlag},r.getCurrentStore().getPosition()),{preventDefault:function(){t.preventDefault()},preventDrag:function(){r._dragFlag=!1}})))&&r.stop(),r._isMouseEvent&&r.flag&&c&&t.preventDefault()}if(!r.flag)return!1;var D=0;if(g?(r._attchDragEvent(),v&&a&&(D=setTimeout((function(){Q(o,"touchstart",r.onDragStart,{passive:!1})})))):v&&a&&tt(o,"touchstart",r.onDragStart),r.flag&&function(t){return t.touches&&t.touches.length>=2}(t)){if(clearTimeout(D),g&&t.touches.length!==t.changedTouches.length)return;r.pinchFlag||r.onPinchStart(t)}}}},r.onDrag=function(t,e){if(r.flag){var n=r.options.preventDefault;!r._isMouseEvent&&n&&t.preventDefault(),r._prevInputEvent=t;var i=dn(t),o=r.moveClients(i,t,!1);if(r._dragFlag){if(r.pinchFlag||o.deltaX||o.deltaY)if(!1===(r._preventMouseEvent||r.emit("drag",fn(fn({},o),{isScroll:!!e,inputEvent:t}))))return void r.stop();r.pinchFlag&&r.onPinch(t,i)}r.getCurrentStore().getPosition(i,!0)}},r.onDragEnd=function(t){if(r.flag){var e=r.options,n=e.pinchOutside,i=e.container,o=e.preventClickEventOnDrag,a=e.preventClickEventOnDragStart,s=e.preventClickEventByCondition,u=r.isDrag;(o||a||s)&&requestAnimationFrame((function(){r._allowClickEvent()})),s||a||!o||u||r._allowClickEvent(),r._useTouch&&n&&tt(i,"touchstart",r.onDragStart),r.pinchFlag&&r.onPinchEnd(t);var c=(null==t?void 0:t.touches)?dn(t):[];0!==c.length&&r.options.keepDragging?r._addStore(new bn(c)):r.flag=!1;var l=r._getPosition(),f=z(),p=!u&&r.doubleFlag;r._prevInputEvent=null,r.prevTime=u||p?0:f,r.flag||(r._dettachDragEvent(),r._preventMouseEvent||r.emit("dragEnd",fn({data:r.data,datas:r.data,isDouble:p,isDrag:u,isClick:!u,isMouseEvent:r._isMouseEvent,isSecondaryButton:r._isSecondaryButton,inputEvent:t,isTrusted:r._isTrusted},l)),r.clientStores=[],r._isMouseEvent||(r._preventMouseEvent=!0,requestAnimationFrame((function(){requestAnimationFrame((function(){r._preventMouseEvent=!1}))}))),r._isIdle=!0)}},r.onBlur=function(){r.onDragEnd()},r._allowClickEvent=function(){tt(r._window,"click",r._onClick,!0)},r._onClick=function(t){r._allowClickEvent(),r._preventMouseEvent=!1;var e=r.options.preventClickEventByCondition;(null==e?void 0:e(t))||(t.stopPropagation(),t.preventDefault())},r._onContextMenu=function(t){r.options.preventRightClick?r.onDragEnd(t):t.preventDefault()},r._passCallback=function(){};var i=[].concat(e),o=i[0];r._window=o&&!("document"in o)?it(o):window,r.options=fn({checkInput:!1,container:o&&!("document"in o)?it(o):o,preventRightClick:!0,preventWheelClick:!0,preventClickEventOnDragStart:!1,preventClickEventOnDrag:!1,preventClickEventByCondition:null,preventDefault:!0,checkWindowBlur:!1,keepDragging:!1,pinchThreshold:0,events:["touch","mouse"]},n);var a=r.options,s=a.container,u=a.events,c=a.checkWindowBlur;if(r._useDrag=u.indexOf("drag")>-1,r._useTouch=u.indexOf("touch")>-1,r._useMouse=u.indexOf("mouse")>-1,r.targets=i,r._useDrag&&i.forEach((function(t){Q(t,"dragstart",r.onDragStart)})),r._useMouse&&(i.forEach((function(t){Q(t,"mousedown",r.onDragStart),Q(t,"mousemove",r._passCallback)})),Q(s,"contextmenu",r._onContextMenu)),c&&Q(it(),"blur",r.onBlur),r._useTouch){var l={passive:!1};i.forEach((function(t){Q(t,"touchstart",r.onDragStart,l),Q(t,"touchmove",r._passCallback,l)}))}return r}return function(t,e){function n(){this.constructor=t}ln(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.stop=function(){this.isDrag=!1,this.data={},this.clientStores=[],this.pinchFlag=!1,this.doubleFlag=!1,this.prevTime=0,this.flag=!1,this._isIdle=!0,this._allowClickEvent(),this._dettachDragEvent(),this._isDragAPI=!1},e.prototype.getMovement=function(t){return this.getCurrentStore().getMovement(t)+this.clientStores.slice(1).reduce((function(t,e){return t+e.movement}),0)},e.prototype.isDragging=function(){return this.isDrag},e.prototype.isIdle=function(){return this._isIdle},e.prototype.isFlag=function(){return this.flag},e.prototype.isPinchFlag=function(){return this.pinchFlag},e.prototype.isDoubleFlag=function(){return this.doubleFlag},e.prototype.isPinching=function(){return this.isPinch},e.prototype.scrollBy=function(t,e,n,r){void 0===r&&(r=!0),this.flag&&(this.clientStores[0].move(t,e),r&&this.onDrag(n,!0))},e.prototype.move=function(t,e){var n=t[0],r=t[1],i=this.getCurrentStore().prevClients;return this.moveClients(i.map((function(t){var e=t.clientX,i=t.clientY;return{clientX:e+n,clientY:i+r,originalClientX:e,originalClientY:i}})),e,!0)},e.prototype.triggerDragStart=function(t){this.onDragStart(t,!1)},e.prototype.setEventData=function(t){var e=this.data;for(var n in t)e[n]=t[n];return this},e.prototype.setEventDatas=function(t){return this.setEventData(t)},e.prototype.getCurrentEvent=function(t){return void 0===t&&(t=this._prevInputEvent),fn(fn({data:this.data,datas:this.data},this._getPosition()),{movement:this.getMovement(),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:t})},e.prototype.getEventData=function(){return this.data},e.prototype.getEventDatas=function(){return this.data},e.prototype.unset=function(){var t=this,e=this.targets,n=this.options.container;this.off(),tt(this._window,"blur",this.onBlur),this._useDrag&&e.forEach((function(e){tt(e,"dragstart",t.onDragStart)})),this._useMouse&&(e.forEach((function(e){tt(e,"mousedown",t.onDragStart)})),tt(n,"contextmenu",this._onContextMenu)),this._useTouch&&(e.forEach((function(e){tt(e,"touchstart",t.onDragStart)})),tt(n,"touchstart",this.onDragStart)),this._prevInputEvent=null,this._allowClickEvent(),this._dettachDragEvent()},e.prototype.onPinchStart=function(t){var e=this,n=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>n)){var r=new bn(dn(t));this.pinchFlag=!0,this._addStore(r),!1===this.emit("pinchStart",fn(fn({data:this.data,datas:this.data,angle:r.getAngle(),touches:this.getCurrentStore().getPositions()},r.getPosition()),{inputEvent:t,isTrusted:this._isTrusted,preventDefault:function(){t.preventDefault()},preventDrag:function(){e._dragFlag=!1}}))&&(this.pinchFlag=!1)}},e.prototype.onPinch=function(t,e){if(this.flag&&this.pinchFlag&&!(e.length<2)){var n=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",fn(fn({data:this.data,datas:this.data,movement:this.getMovement(e),angle:n.getAngle(e),rotation:n.getRotation(e),touches:n.getPositions(e),scale:n.getScale(e),distance:n.getDistance(e)},n.getPosition(e)),{inputEvent:t,isTrusted:this._isTrusted}))}},e.prototype.onPinchEnd=function(t){if(this.pinchFlag){var e=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var n=this.getCurrentStore();this.emit("pinchEnd",fn(fn({data:this.data,datas:this.data,isPinch:e,touches:n.getPositions()},n.getPosition()),{inputEvent:t}))}},e.prototype.getCurrentStore=function(){return this.clientStores[0]},e.prototype.moveClients=function(t,e,n){var r=this._getPosition(t,n),i=this.isDrag;(r.deltaX||r.deltaY)&&(this.isDrag=!0);var o=!1;return!i&&this.isDrag&&(o=!0),fn(fn({data:this.data,datas:this.data},r),{movement:this.getMovement(t),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,isMouseEvent:this._isMouseEvent,isSecondaryButton:this._isSecondaryButton,inputEvent:e,isTrusted:this._isTrusted,isFirstDrag:o})},e.prototype._addStore=function(t){this.clientStores.splice(0,0,t)},e.prototype._getPosition=function(t,e){var n=this.getCurrentStore().getPosition(t,e),r=this.clientStores.slice(1).reduce((function(t,e){var n=e.getPosition();return t.distX+=n.distX,t.distY+=n.distY,t}),n),i=r.distX,o=r.distY;return fn(fn({},n),{distX:i,distY:o})},e.prototype._attchDragEvent=function(){var t=this._window,e=this.options.container,n={passive:!1};this._isDragAPI&&(Q(e,"dragover",this.onDrag,n),Q(t,"dragend",this.onDragEnd)),this._useMouse&&(Q(e,"mousemove",this.onDrag),Q(t,"mouseup",this.onDragEnd)),this._useTouch&&(Q(e,"touchmove",this.onDrag,n),Q(t,"touchend",this.onDragEnd,n),Q(t,"touchcancel",this.onDragEnd,n))},e.prototype._dettachDragEvent=function(){var t=this._window,e=this.options.container;this._isDragAPI&&(tt(e,"dragover",this.onDrag),tt(t,"dragend",this.onDragEnd)),this._useMouse&&(tt(e,"mousemove",this.onDrag),tt(t,"mouseup",this.onDragEnd)),this._useTouch&&(tt(e,"touchstart",this.onDragStart),tt(e,"touchmove",this.onDrag),tt(t,"touchend",this.onDragEnd),tt(t,"touchcancel",this.onDragEnd))},e}(He);var En=function(t){for(var e=5381,n=t.length;n;)e=33*e^t.charCodeAt(--n);return e>>>0};function Sn(t,e,n,r,i){var o=et(r),a=o.createElement("style");return a.setAttribute("type","text/css"),a.setAttribute("data-styled-id",t),a.setAttribute("data-styled-count","1"),n.nonce&&a.setAttribute("nonce",n.nonce),a.innerHTML=function(t,e,n){return n.original?e:e.replace(/([^};{\s}][^};{]*|^\s*){/gm,(function(e,n){var r=n.trim();return(r?O(r):[""]).map((function(e){var n=e.trim();return 0===n.indexOf("@")?n:n.indexOf(":global")>-1?n.replace(/\:global/g,""):n.indexOf(":host")>-1?"".concat(n.replace(/\:host/g,".".concat(t))):n?".".concat(t," ").concat(n):".".concat(t)})).join(", ")+" {"}))}(t,e,n),(i||o.head||o.body).appendChild(a),a}function Dn(t){var e="rCS"+En(t).toString(36);return{className:e,inject:function(n,r){void 0===r&&(r={});var i=function(t){if(t&&t.getRootNode){var e=t.getRootNode();if(11===e.nodeType)return e}}(n),o=(i||n.ownerDocument||document).querySelector('style[data-styled-id="'.concat(e,'"]'));if(o){var a=parseFloat(o.getAttribute("data-styled-count"))||0;o.setAttribute("data-styled-count","".concat(a+1))}else o=Sn(e,t,r,n,i);return{destroy:function(){var t,e=parseFloat(o.getAttribute("data-styled-count"))||0;e<=1?(o.remove?o.remove():null===(t=o.parentNode)||void 0===t||t.removeChild(o),o=null):o.setAttribute("data-styled-count","".concat(e-1))}}}}}var Cn=function(){return Cn=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function Pn(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i=109||Wn&&jn>=109,Ln="firefox"===qn,Vn=parseInt(In.browser.webkitVersion,10)>=612||Yn>=15,Un="moveable-",$n=Gn.map((function(t){var e="",n="",r="center",i="center",o="calc(var(--moveable-control-padding, 20) * -1px)";return t.indexOf("n")>-1&&(e="top: ".concat(o,";"),i="bottom"),t.indexOf("s")>-1&&(e="top: 0px;",i="top"),t.indexOf("w")>-1&&(n="left: ".concat(o,";"),r="right"),t.indexOf("e")>-1&&(n="left: 0px;",r="left"),'.around-control[data-direction*="'.concat(t,'"] {\n ').concat(n).concat(e,"\n transform-origin: ").concat(r," ").concat(i,";\n }")})).join("\n"),Zn="\n{\nposition: absolute;\nwidth: 1px;\nheight: 1px;\nleft: 0;\ntop: 0;\nz-index: 3000;\n--moveable-color: #4af;\n--zoom: 1;\n--zoompx: 1px;\n--moveable-line-padding: 0;\n--moveable-control-padding: 0;\nwill-change: transform;\noutline: 1px solid transparent;\n}\n.control-box {\nz-index: 0;\n}\n.line, .control {\nposition: absolute;\nleft: 0;\ntop: 0;\nwill-change: transform;\n}\n.control {\nwidth: 14px;\nheight: 14px;\nborder-radius: 50%;\nborder: 2px solid #fff;\nbox-sizing: border-box;\nbackground: #4af;\nbackground: var(--moveable-color);\nmargin-top: -7px;\nmargin-left: -7px;\nborder: 2px solid #fff;\nz-index: 10;\n}\n.around-control {\nposition: absolute;\nwill-change: transform;\nwidth: calc(var(--moveable-control-padding, 20) * 1px);\nheight: calc(var(--moveable-control-padding, 20) * 1px);\nleft: calc(var(--moveable-control-padding, 20) * -0.5px);\ntop: calc(var(--moveable-control-padding, 20) * -0.5px);\nbox-sizing: border-box;\nbackground: transparent;\nz-index: 8;\ncursor: alias;\ntransform-origin: center center;\n}\n".concat($n,"\n.padding {\nposition: absolute;\ntop: 0px;\nleft: 0px;\nwidth: 100px;\nheight: 100px;\ntransform-origin: 0 0;\n}\n.line {\nwidth: 1px;\nheight: 1px;\nbackground: #4af;\nbackground: var(--moveable-color);\ntransform-origin: 0px 50%;\n}\n.line.edge {\nz-index: 1;\nbackground: transparent;\n}\n.line.dashed {\nbox-sizing: border-box;\nbackground: transparent;\n}\n.line.dashed.horizontal {\nborder-top: 1px dashed #4af;\nborder-top-color: #4af;\nborder-top-color: var(--moveable-color);\n}\n.line.dashed.vertical {\nborder-left: 1px dashed #4af;\nborder-left-color: #4af;\nborder-left-color: var(--moveable-color);\n}\n.line.vertical {\ntransform: translateX(-50%);\n}\n.line.horizontal {\ntransform: translateY(-50%);\n}\n.line.vertical.bold {\nwidth: 2px;\n}\n.line.horizontal.bold {\nheight: 2px;\n}\n\n.control.origin {\nborder-color: #f55;\nbackground: #fff;\nwidth: 12px;\nheight: 12px;\nmargin-top: -6px;\nmargin-left: -6px;\npointer-events: none;\n}\n").concat([0,15,30,45,60,75,90,105,120,135,150,165].map((function(t){return'\n.direction[data-rotation="'.concat(t,'"], :global .view-control-rotation').concat(t," {\n").concat(function(t){var e=function(t,e){return'data:image/svg+xml;utf8,')}(1,t),n=45*Math.round(t/45)%180,r="ns-resize";return 135===n?r="nwse-resize":45===n?r="nesw-resize":90===n&&(r="ew-resize"),"cursor:".concat(r,";cursor: url('").concat(e,"') 16 16, ").concat(r,";")}(t),"\n}\n")})).join("\n"),'\n\n.line.direction:before {\ncontent: "";\nposition: absolute;\nwidth: 100%;\nheight: calc(var(--moveable-line-padding, 0) * 1px);\nbottom: 0;\nleft: 0;\n}\n.group {\nz-index: -1;\n}\n.area {\nposition: absolute;\n}\n.area-pieces {\nposition: absolute;\ntop: 0;\nleft: 0;\ndisplay: none;\n}\n.area.avoid, .area.pass {\npointer-events: none;\n}\n.area.avoid+.area-pieces {\ndisplay: block;\n}\n.area-piece {\nposition: absolute;\n}\n\n').concat(Nn?':global svg *:before {\ncontent:"";\ntransform-origin: inherit;\n}':"","\n"),Kn=[[0,1,2],[1,0,3],[2,0,3],[3,1,2]],Jn=1e-4,Qn=1e-7,tr=1e-9,er=Math.pow(10,10),nr=-er,rr={n:[0,-1],e:[1,0],s:[0,1],w:[-1,0],nw:[-1,-1],ne:[1,-1],sw:[-1,1],se:[1,1]},ir={n:[0,1],e:[1,3],s:[3,2],w:[2,0],nw:[0],ne:[1],sw:[2],se:[3]},or={n:0,s:180,w:270,e:90,nw:315,ne:45,sw:225,se:135},ar=["isMoveableElement","updateRect","updateTarget","destroy","dragStart","isInside","hitTest","setState","getRect","request","isDragging","getManager","forceUpdate","waitToChangeTarget","updateSelectors","getTargets","stopDrag","getControlBoxElement","getMoveables","getDragElement"];function sr(t,e,n,r,i,o){var a,s;void 0===o&&(o="draggable");var u=null!==(s=null===(a=e.gestos[o])||void 0===a?void 0:a.move(n,t.inputEvent))&&void 0!==s?s:{},c=u.originalDatas||u.datas,l=c[o]||(c[o]={});return On(On({},i?va(e,u):u),{isPinch:!!r,parentEvent:!0,datas:l,originalDatas:t.originalDatas})}var ur=function(){function t(t){var e;void 0===t&&(t="draggable"),this.ableName=t,this.prevX=0,this.prevY=0,this.startX=0,this.startY=0,this.isDrag=!1,this.isFlag=!1,this.datas={draggable:{}},this.datas=((e={})[t]={},e)}var e=t.prototype;return e.dragStart=function(t,e){this.isDrag=!1,this.isFlag=!1;var n=e.originalDatas;return this.datas=n,n[this.ableName]||(n[this.ableName]={}),On(On({},this.move(t,e.inputEvent)),{type:"dragstart"})},e.drag=function(t,e){return this.move([t[0]-this.prevX,t[1]-this.prevY],e)},e.move=function(t,e){var n,r,i=!1;if(this.isFlag){var o=this.isDrag;n=this.prevX+t[0],r=this.prevY+t[1],(t[0]||t[1])&&(this.isDrag=!0),!o&&this.isDrag&&(i=!0)}else this.prevX=t[0],this.prevY=t[1],this.startX=t[0],this.startY=t[1],n=t[0],r=t[1],this.isFlag=!0;return this.prevX=n,this.prevY=r,{type:"drag",clientX:n,clientY:r,inputEvent:e,isFirstDrag:i,isDrag:this.isDrag,distX:n-this.startX,distY:r-this.startY,deltaX:t[0],deltaY:t[1],datas:this.datas[this.ableName],originalDatas:this.datas,parentEvent:!0,parentGesto:this}},t}();function cr(t,e,n,r){var i=16===t.length?4:3,o=Rn(Io(t,n,r,i),4),a=Rn(o[0],2),s=a[0],u=a[1],c=Rn(o[1],2),l=c[0],f=c[1],p=Rn(o[2],2),d=p[0],h=p[1],v=Rn(o[3],2),g=v[0],m=v[1],b=Rn(Ao(t,e,i),2),x=b[0],y=b[1],E=Math.min(s,l,d,g),S=Math.min(u,f,h,m),D=Math.max(s,l,d,g);return s=s-E||0,{left:E,top:S,right:D,bottom:Math.max(u,f,h,m),origin:[x=x-E||0,y=y-S||0],pos1:[s,u=u-S||0],pos2:[l=l-E||0,f=f-S||0],pos3:[d=d-E||0,h=h-S||0],pos4:[g=g-E||0,m=m-S||0],direction:Pa(t[0]*t[i+1])}}function lr(t,e){var n=e.clientX,r=e.clientY,i=e.datas,o=t.state,a=o.moveableClientRect,s=o.rootMatrix,u=o.is3d,c=o.pos1,l=Rn(ye(ha(s,[n-a.left,r-a.top],u?4:3),c),2),f=Rn(mr({datas:i,distX:l[0],distY:l[1]}),2);return[f[0],f[1]]}function fr(t,e){var n=e.datas,r=t.state,i=r.allMatrix,o=r.beforeMatrix,a=r.is3d,s=r.left,u=r.top,c=r.origin,l=r.offsetMatrix,f=r.targetMatrix,p=r.transformOrigin,d=a?4:3;n.is3d=a,n.matrix=i,n.targetMatrix=f,n.beforeMatrix=o,n.offsetMatrix=l,n.transformOrigin=p,n.inverseMatrix=de(i,d),n.inverseBeforeMatrix=de(o,d),n.absoluteOrigin=ve(xe([s,u],c),d),n.startDragBeforeDist=Se(n.inverseBeforeMatrix,n.absoluteOrigin,d),n.startDragDist=Se(n.inverseMatrix,n.absoluteOrigin,d)}function pr(t,e,n){var r=e.datas,i=e.originalDatas.beforeRenderable,o=r.transformIndex,a=i.nextTransforms,s=a.length,u=i.nextTransformAppendedIndexes,c=-1;-1===o?("translate"===n?c=0:"rotate"===n&&(c=G(a,(function(t){return t.match(/scale\(/g)}))),-1===c&&(c=a.length),r.transformIndex=c):c=k(u,(function(t){return t.index===o&&t.functionName===n}))?o:o+u.filter((function(t){return t.indexc&&(r.isAppendTransform=!0,i.nextTransformAppendedIndexes=Pn(Pn([],Rn(u),!1),[{functionName:n,index:c,isAppend:!0}],!1))}function dr(t,e,n){return"".concat(t.beforeFunctionTexts.join(" ")," ").concat(t.isAppendTransform?n:e," ").concat(t.afterFunctionTexts.join(" "))}function hr(t){var e=t.datas,n=Rn(gr({datas:e,distX:t.distX,distY:t.distY}),2);return Se(vr(e,function(t,e){for(var n=Te(e),r=0;r=0&&(t[0]>=0&&e.push(3),t[0]<=0&&e.push(2)),t[1]<=0&&(t[0]>=0&&e.push(1),t[0]<=0&&e.push(0)),e}function xr(t,e){var n=(e+1)/2;return[m(t[0][0],t[1][0],n,1-n),m(t[0][1],t[1][1],n,1-n)]}function yr(t,e){var n=xr([t[0],t[1]],e[0]),r=xr([t[2],t[3]],e[0]);return xr([n,r],e[1])}function Er(t,e,n,r){return be(t,Co(e,r,n),r)}function Sr(t,e){var n=_r(e);return{setTransform:function(r,i){void 0===i&&(i=-1),n.startTransforms=y(r)?r:M(r),Cr(t,e,i)},setTransformIndex:function(n){Cr(t,e,n)}}}function Dr(t,e,n){Cr(t,e,G(_r(e).startTransforms,(function(t){return 0===t.indexOf("".concat(n,"("))})))}function Cr(t,e,n){var r=_r(e),i=e.datas;if(i.transformIndex=n,-1!==n){var o=r.startTransforms[n];if(o){var a=t.state,s=Fe([o],{"x%":function(t){return t/100*a.offsetWidth},"y%":function(t){return t/100*a.offsetHeight}});i.startValue=s[0].functionValue}}}function wr(t,e){_r(t).nextTransforms=M(e)}function _r(t){return t.originalDatas.beforeRenderable}function Mr(t){return t.originalDatas.beforeRenderable.nextTransforms}function Or(t){return(Mr(t)||[]).join(" ")}function Rr(t){return _r(t).nextStyle}function Pr(t,e,n,r,i){wr(i,e);var o=Fi.drag(t,sr(i,t.state,n,r,!1)),a=o?o.transform:e;return On(On({transform:e,drag:o},na({transform:a},i)),{afterTransform:a})}function Tr(t,e,n,r,i,o){var a=function(t,e,n,r){var i,o=t.transformOrigin,a=t.offsetMatrix,s=t.is3d?4:3;if(E(n)){var u=e.beforeTransform,c=e.afterTransform;i=ge(r?Ae(n):be(be(u,Ae([n]),4),c,4),4,s)}else i=n;return Er(a,i,o,s)}(t.state,i,e,o),s=function(t,e,n,r){void 0===r&&(r=t.state.allMatrix);var i=t.state,o=i.width,a=i.height,s=i.is3d?4:3,u=[o/2*(1+e[0])+n[0],a/2*(1+e[1])+n[1]];return Ao(r,u,s)}(t,n,r,a);return s}function zr(t,e,n,r,i,o,a){var s=Tr(t,e,n,i,o,a),u=t.state,c=u.left,l=u.top,f=t.props.groupable,p=f?c:0,d=f?l:0,h=ye(r,s);return ye(h,[p,d])}function Gr(t,e,n,r,i,o){var a=t.props.groupable,s=t.state,u=s.transformOrigin,c=s.offsetMatrix,l=s.is3d,f=s.width,p=s.height,d=s.left,h=s.top,v=o.fixedDirection,g=o.nextTargetMatrix||s.targetMatrix,m=l?4:3,b=function(t,e,n,r,i,o){return void 0===r&&(r=e),void 0===i&&(i=n),void 0===o&&(o=[0,0]),t?t.map((function(t,a){var s=P(t),u=s.value,c=s.unit,l=a?i:r,f=a?n:e;return"%"===t||isNaN(u)?f*(l?o[a]/l:0):"%"!==c?u:f*u/100})):o}(i,e,n,f,p,u),x=a?d:0,y=a?h:0,E=function(t,e,n,r,i,o){var a=yr(Io(e,n,r,i),o);return[t[0]-a[0],t[1]-a[1]]}(r,Er(c,g,b,m),e,n,m,v);return ye(E,[x,y])}function kr(t){if(t&&t.getRootNode){var e=t.getRootNode();if(11===e.nodeType)return e}}function Br(t){var e=t("scale"),n=t("rotate"),r=t("translate"),i=[];return r&&"0px"!==r&&"none"!==r&&i.push("translate(".concat(r.split(/\s+/).join(","),")")),n&&"1"!==n&&"none"!==n&&i.push("rotate(".concat(n,")")),e&&"1"!==e&&"none"!==e&&i.push("scale(".concat(e.split(/\s+/).join(","),")")),i}function Ar(t,e,n){for(var r,i,o,a,s,u=t,c=[],l=nt(t)||rt(t),f=!n&&t===e||t===l,p=f,d=!1,h=3,v=!1,g=Oo(e,e,!0).offsetParent,m=1;u&&!p;){p=f;var b=Yr(u),x=b("position"),y=Mo(u),E="fixed"===x,S=Br(b),D=(a=Do(y),void 0===(s=void 0)&&(s=6===a.length),s?[a[0],a[1],0,a[2],a[3],0,a[4],a[5],1]:a),C=void 0,w=!1,_=!1,M=0,O=0,R=0,P=0,T={hasTransform:!1,fixedContainer:null};E&&(v=!0,g=(T=zo(u)).fixedContainer);var z=D.length;d||16!==z&&!S.length||(d=!0,h=4,To(c),o&&(o=ge(o,3,4))),d&&9===z&&(D=ge(D,3,4));var G=Ro(u,t),k=G.tagName,B=G.hasOffset,A=G.isSVG,I=G.origin,F=G.targetOrigin,N=Rn(G.offset,2),q=N[0],Y=N[1];"svg"===k&&!t.ownerSVGElement&&o&&(c.push({type:"target",target:u,matrix:Bo(u,h)}),c.push({type:"offset",target:u,matrix:Te(h)}));var X=parseFloat(b("zoom"))||1;if(E)C=T.fixedContainer,w=!0;else{var W=Oo(u,e,!1,!0,b),j=W.offsetZoom;if(C=W.offsetParent,w=W.isEnd,_=W.isStatic,m*=j,(W.isCustomElement||1!==j)&&_)q-=C.offsetLeft,Y-=C.offsetTop;else if(Ln||Hn){if(W.parentSlotElement){for(var H=C,L=0,V=0;H&&kr(H);)L+=H.offsetLeft,V+=H.offsetTop,H=H.offsetParent;q-=L,Y-=V}}}if(!Fn||Vn||!B||A||!_||"relative"!==x&&"static"!==x||(q-=C.offsetLeft,Y-=C.offsetTop,f=f||w),E)B&&T.hasTransform&&(R=C.clientLeft,P=C.clientTop);else if(B&&g!==C&&(M=C.clientLeft,O=C.clientTop),B&&C===l){var U=Po(u,!1);q+=U[0],Y+=U[1]}if(c.push({type:"target",target:u,matrix:Co(D,h,I)}),S.length&&(c.push({type:"offset",target:u,matrix:Te(h)}),c.push({type:"target",target:u,matrix:Co(Ae(S),h,I)})),B){var $=u===t,Z=$?0:u.scrollLeft,K=$?0:u.scrollTop;c.push({type:"offset",target:u,matrix:Ge([q-Z+M-R,Y-K+O-P],h)})}else c.push({type:"offset",target:u,origin:I});if(1!==X&&c.push({type:"zoom",target:u,matrix:Co(ze([X,X],h),h,[0,0])}),o||(o=D),r||(r=I),i||(i=F),p||E)break;u=C,f=w,n&&u!==l||(p=f)}return o||(o=Te(h)),r||(r=[0,0]),i||(i=[0,0]),{zoom:m,offsetContainer:g,matrixes:c,targetMatrix:o,transformOrigin:r,targetOrigin:i,is3d:d,hasFixed:v}}var Ir=null,Fr=null,Nr=null;function qr(t){t?(window.Map&&(Ir=new Map,Fr=new Map),Nr=[]):(Ir=null,Nr=null,Fr=null)}function Yr(t){var e=null==Ir?void 0:Ir.get(t);if(!e){var n=it(t).getComputedStyle(t);if(!Ir)return function(t){return n[t]};e={style:n,cached:{}},Ir.set(t,e)}var r=e.cached,i=e.style;return function(t){return t in r||(r[t]=i[t]),r[t]}}function Xr(t,e,n){var r=n.originalDatas;r.groupable=r.groupable||{};var i=r.groupable;i.childDatas=i.childDatas||[];var o=i.childDatas;return t.moveables.map((function(t,r){return o[r]=o[r]||{},o[r][e]=o[r][e]||{},On(On({},n),{isRequestChild:!0,datas:o[r][e],originalDatas:o[r]})}))}function Wr(t,e,n,r,i,o,a){var s=!!n.match(/Start$/g),u=!!n.match(/End$/g),c=i.isPinch,l=i.datas,f=Xr(t,e.name,i),p=t.moveables,d=[],h=f.map((function(t,i){var f=p[i],h=f.state,v=h.gestos,g=t;if(s)g=new ur(a).dragStart(r,t),d.push(g);else{if(v[a]||(v[a]=l.childGestos[i]),!v[a])return;g=sr(t,h,r,c,o,a),d.push(g)}var m=e[n](f,On(On({},g),{parentFlag:!0}));return u&&(v[a]=null),m}));return s&&(l.childGestos=p.map((function(t){return t.state.gestos[a]}))),{eventParams:h,childEvents:d}}function jr(t,e,n,r,i,o){void 0===i&&(i=function(t,e){return e});var a=!!n.match(/End$/g),s=Xr(t,e.name,r),u=t.moveables;return s.map((function(t,r){var s,c=u[r];s=i(c,t);var l=e[n](c,On(On({},s),{parentFlag:!0}));return l&&o&&o(c,t,l,r),a&&(c.state.gestos={}),l}))}function Hr(t,e,n,r){var i=n.fixedDirection,o=n.fixedPosition,a=yr(r.datas.startPositions||Qo(e.state),i),s=Rn(Se(Pe(-t.rotation/180*Math.PI,3),[a[0]-o[0],a[1]-o[1],1],3),2),u=s[0],c=s[1];return r.datas.originalX=u,r.datas.originalY=c,r}function Lr(t,e,n,r){var i=t.getState(),o=i.renderPoses,a=i.rotation,s=i.direction,u=jo(t.props,e).zoom,c=lo(a/Math.PI*180),l={},f=t.renderState;f.renderDirectionMap||(f.renderDirectionMap={});var p=f.renderDirectionMap;n.forEach((function(t){var e=t.dir;l[e]=!0}));var d=Pa(s);return n.map((function(t){var n=t.data,i=t.classNames,s=t.dir,f=ir[s];if(!f||!l[s])return null;p[s]=!0;var h=(L(c,15)+d*or[s]+720)%180,v={};return I(n).forEach((function(t){v["data-".concat(t)]=n[t]})),r.createElement("div",On({className:Eo.apply(void 0,Pn(["control","direction",s,e],Rn(i),!1)),"data-rotation":h,"data-direction":s},v,{key:"direction-".concat(s),style:Wo.apply(void 0,Pn([a,u],Rn(f.map((function(t){return o[t]}))),!1))}))}))}function Vr(t,e,n,r){var i=jo(t.props,n),o=i.renderDirections,a=void 0===o?e:o,s=i.displayAroundControls;if(!a)return[];var u=!0===a?Gn:a;return Pn(Pn([],Rn(s?Jr(t,r,n,u):[]),!1),Rn(Lr(t,n,u.map((function(t){return{data:{},classNames:[],dir:t}})),r)),!1)}function Ur(t,e,n,r,i,o){for(var a=[],s=6;so&&s.push({direction:"start",isBound:!0,offset:o-r,pos:r}),i-1.1||t[0]>e.right&&Ta(t[0]-e.right)>.1||t[1].1||t[1]>e.bottom&&Ta(t[1]-e.bottom)>.1}))}function ri(t,e,n,r,i){if(!t.props.bounds)return[];var o=i*Math.PI/180,a=ti(t),s=a.left,u=a.top,c=a.right,l=a.bottom,f=s-r[0],p=c-r[0],d=u-r[1],h=l-r[1],v={left:f,top:d,right:p,bottom:h};if(!ni(n,v,0))return[];var g=[];return[[f,0],[p,0],[d,1],[h,1]].forEach((function(t){var r=Rn(t,2),i=r[0],a=r[1];n.forEach((function(t){var n=W([0,0],t);g.push.apply(g,Pn([],Rn(function(t,e,n){var r=qo(t),i=Math.sqrt(r*r-e*e)||0;return[i,-i].sort((function(e,r){return Ta(e-t[n?0:1])-Ta(r-t[n?0:1])})).map((function(t){return W([0,0],n?[t,e]:[e,t])}))}(t,i,a).map((function(t){return o+t-n})).filter((function(t){return!ni(e,v,t)})).map((function(t){return L(180*t/Math.PI,Qn)}))),!1))}))})),g}var ii=["left","right","center"],oi=["top","bottom","middle"],ai={left:"start",right:"end",center:"center",top:"start",bottom:"end",middle:"center"},si={start:"left",end:"right",center:"center"},ui={start:"top",end:"bottom",center:"middle"};function ci(t,e){var n=t.props,r=n.snappable,i=n.bounds,o=n.innerBounds,a=n.verticalGuidelines,s=n.horizontalGuidelines,u=n.snapGridWidth,c=n.snapGridHeight,l=t.state,f=l.guidelines,p=l.enableSnap;return!(!r||!p||e&&!0!==r&&r.indexOf(e)<0)&&!!(u||c||i||o||f&&f.length||a&&a.length||s&&s.length)}function li(t){return!1===t?{}:!0!==t&&t?t:{left:!0,right:!0,top:!0,bottom:!0}}function fi(t,e){var n=function(t,e){var n=li(t),r={};for(var i in n)i in e&&n[i]&&(r[i]=e[i]);return r}(t,e),r=oi.filter((function(t){return t in n})),i=ii.filter((function(t){return t in n}));return{horizontalNames:r,verticalNames:i,horizontal:r.map((function(t){return n[t]})),vertical:i.map((function(t){return n[t]}))}}function pi(t,e,n,r,i,o){var a;void 0===r&&(r=[]),void 0===i&&(i=[]);var s=t.props,u=(null===(a=t.state.snapThresholdInfo)||void 0===a?void 0:a.multiples)||[1,1],c=function(){for(var t=[],e=0;er)})).sort((function(t,e){return t.dist-e.dist}));return{pos:n,index:o,guidelineInfos:u,direction:a}})).filter((function(t){return t.guidelineInfos.length>0})).sort((function(t,e){return t.guidelineInfos[0].dist-e.guidelineInfos[0].dist})),c=u.length>0;return{isSnap:c,index:c?u[0].index:-1,direction:null!==(a=null===(o=u[0])||void 0===o?void 0:o.direction)&&void 0!==a?a:"",posInfos:u}}function bi(t,e,n,r){void 0===r&&(r=1);var i=[];n[0]&&n[1]?i=[n,[-n[0],n[1]],[n[0],-n[1]]]:n[0]||n[1]?t.props.keepRatio?i.push([-1,-1],[-1,1],[1,-1],[1,1],n):(i.push.apply(i,Pn([],Rn(function(t,e){return br(e).map((function(e){return t[e]}))}([[-1,-1],[1,-1],[-1,-1],[1,1]],n)),!1)),i.length>1&&i.push([(i[0][0]+i[1][0])/2,(i[0][1]+i[1][1])/2])):[[-1,-1],[1,-1],[1,1],[-1,1]].forEach((function(t,e,n){var r=n[e+1]||n[0];i.push(t),i.push([(t[0]+r[0])/2,(t[1]+r[1])/2])}));var o=i.map((function(t){return yr(e,t)})),a=pi(t,o.map((function(t){return t[0]})),o.map((function(t){return t[1]})),i.map((function(t){return hi(t[0])})),i.map((function(t){return hi(t[1])})),r),s=hi(i.map((function(t){return t[0]}))[a.vertical.index]),u=hi(i.map((function(t){return t[1]}))[a.horizontal.index]);return{vertical:On(On({},a.vertical),{direction:s}),horizontal:On(On({},a.horizontal),{direction:u})}}function xi(t,e){var n=Ta(t.offset),r=Ta(e.offset);return t.isBound&&e.isBound?r-n:t.isBound?-1:e.isBound?1:t.isSnap&&e.isSnap?r-n:t.isSnap?-1:e.isSnap||na||u>a,l=Rn(mr({datas:i,distX:o[0],distY:o[1]}),2);return{offset:[l[0],l[1]],isOutside:c}}function zi(t,e){return t.isBound?t.offset:e.isSnap?gi(e).offset:0}function Gi(t,e,n,r,i,o){if(!ci(t,"draggable"))return[{isSnap:!1,isBound:!1,offset:0},{isSnap:!1,isBound:!1,offset:0}];var a=Jo(o.absolutePoses,[e,n]),s=Fo(a),u=s.left,c=s.right,l=s.top,f=s.bottom,p={horizontal:a.map((function(t){return t[1]})),vertical:a.map((function(t){return t[0]}))},d=ki(t,i,fi(li(t.props.snapDirections),{left:u,right:c,top:l,bottom:f,center:(u+c)/2,middle:(l+f)/2}),p),h=d.vertical,g=d.horizontal,m=Mi(t,a,o),b=m.vertical,x=m.horizontal,y=h.isSnap,E=g.isSnap,S=h.isBound||b.isBound,D=g.isBound||x.isBound,C=Rn(function(t,e,n,r,i){var o=Rn(e,2),a=o[0],s=o[1],u=Rn(n,2),c=u[0],l=u[1],f=Rn(r,2),p=f[0],d=f[1],h=Rn(i,2),g=h[0],m=h[1],b=-g,x=-m;if(t&&a&&s){b=0,x=0;var y=[];if(c&&l?y.push([0,m],[g,0]):c?y.push([g,0]):l?y.push([0,m]):p&&d?y.push([0,m],[g,0]):p?y.push([g,0]):d&&y.push([0,m]),y.length){y.sort((function(t,e){return qo(ye([a,s],t))-qo(ye([a,s],e))}));var E=y[0];if(E[0]&&Ta(a)>v)b=-E[0],x=s*Ta(a+b)/Ta(a)-s;else if(E[1]&&Ta(s)>v){var S=s;x=-E[1],b=a*Ta(s+x)/Ta(S)-a}if(t&&l&&c)if(Ta(b)>v&&Ta(b)v&&Ta(x)0,v=p>0,g={isBound:!1,offset:0,pos:0},m={isBound:!1,offset:0,pos:0};if(0===p&&0===d)return{vertical:g,horizontal:m};if(0===p)h?sl&&(m.pos=o,m.offset=l-o);else if(0===d)v?ac&&(g.pos=i,g.offset=c-i);else{var b=d/p,x=n[1]-b*c,y=0,E=0,S=!1;v&&a<=c?(y=b*a+x,E=a,S=!0):!v&&c<=i&&(y=b*i+x,E=i,S=!0),S&&(ys)&&(S=!1),S||(h&&s<=l?(E=((y=s)-x)/b,S=!0):!h&&l<=o&&(E=((y=o)-x)/b,S=!0)),S&&(g.isBound=!0,g.pos=E,g.offset=c-E,m.isBound=!0,m.pos=y,m.offset=l-y)}return{vertical:g,horizontal:m}}(t,e,n),o=i.horizontal,a=i.vertical,s=r?{horizontal:{isSnap:!1},vertical:{isSnap:!1}}:function(t,e,n){var r=Rn(n,2),i=r[0],o=r[1],a=Rn(e,2),s=a[0],u=a[1],c=Rn(ye(n,e),2),l=c[0],f=c[1],p=f>0,d=l>0;l=ba(l),f=ba(f);var h={isSnap:!1,offset:0,pos:0},v={isSnap:!1,offset:0,pos:0};if(0===l&&0===f)return{vertical:h,horizontal:v};var g=pi(t,l?[i]:[],f?[o]:[]),m=g.vertical,b=g.horizontal;m.posInfos.filter((function(t){var e=t.pos;return d?e>=s:e<=s})),b.posInfos.filter((function(t){var e=t.pos;return p?e>=u:e<=u})),m.isSnap=m.posInfos.length>0,b.isSnap=b.posInfos.length>0;var x=gi(m),y=x.isSnap,E=x.guideline,S=gi(b),D=S.isSnap,C=S.guideline,w=D?C.pos[1]:0,_=y?E.pos[0]:0;if(0===l)D&&(v.isSnap=!0,v.pos=C.pos[1],v.offset=o-v.pos);else if(0===f)y&&(h.isSnap=!0,h.pos=_,h.offset=i-_);else{var M=f/l,O=n[1]-M*i,R=0,P=0,T=!1;y?(R=M*(P=_)+O,T=!0):D&&(P=((R=w)-O)/M,T=!0),T&&(h.isSnap=!0,h.pos=P,h.offset=i-P,v.isSnap=!0,v.pos=R,v.offset=o-R)}return{vertical:h,horizontal:v}}(t,e,n),u=s.horizontal,c=s.vertical,l=Ii(o,u),f=Ii(a,c),p=Ta(l),d=Ta(f);return{horizontal:{isBound:o.isBound,isSnap:u.isSnap,offset:l,dist:p},vertical:{isBound:a.isBound,isSnap:c.isSnap,offset:f,dist:d}}}(t,c,l,i):ki(t,i,{vertical:[l[0]],horizontal:[l[1]]}),p=f.horizontal,d=p.offset,h=p.isBound,v=p.isSnap,g=f.vertical,m=g.offset,b=g.isBound,x=g.isSnap,y=ye(u,s);if(!m&&!d)return{isBound:b||h,isSnap:x||v,sign:y,offset:[0,0]};var E=function(t,e,n,r){var i=W(t,e)/Math.PI*180,o=n.vertical,a=o.isBound,s=o.isSnap,u=o.dist,c=n.horizontal,l=c.isBound,f=c.isSnap,p=i%180,d=p<3||p>177,h=p>87&&p<93;return c.dist0&&(f||p)){var _=m.startDragRotate||0,M=L(_+180*W([0,0],[f,p])/Math.PI,y)-_,O=p*Math.abs(Math.cos((M-90)/180*Math.PI)),R=qo([f*Math.abs(Math.cos(M/180*Math.PI)),O]);E=M*Math.PI/180,f=R*Math.cos(E),p=R*Math.sin(E)}if(!o&&!r&&!i){var P=Rn(Gi(t,f,p,y,!s&&u||a,n),2),T=P[0],z=P[1];S=T.isSnap,D=T.isBound,C=z.isSnap,w=z.isBound,f+=T.offset,p+=z.offset}var G=xe(gr({datas:n,distX:f,distY:p}),g),k=xe(hr({datas:n,distX:f,distY:p}),g);V(k,Qn),V(G,Qn),y||(S||D||(k[0]=L(k[0],x),G[0]=L(G[0],x)),C||w||(k[1]=L(k[1],x),G[1]=L(G[1],x)));var B=ye(G,g),A=ye(k,g),I=ye(A,h),F=ye(B,v);n.prevDist=A,n.prevBeforeDist=B,n.passDelta=I,n.passDist=A;var N=n.left+B[0],q=n.top+B[1],Y=n.right-B[0],X=n.bottom-B[1],j=dr(n,"translate(".concat(k[0],"px, ").concat(k[1],"px)"),"translate(".concat(A[0],"px, ").concat(A[1],"px)"));if(wr(e,j),t.state.dragInfo.dist=r?[0,0]:A,r||b||!I.every((function(t){return!t}))||!F.some((function(t){return!t}))){var H=t.state,U=H.width,$=H.height,Z=ia(t,e,On({transform:j,dist:A,delta:I,translate:k,beforeDist:B,beforeDelta:F,beforeTranslate:G,left:N,top:q,right:Y,bottom:X,width:U,height:$,isPinch:o},na({transform:j},e)));return!r&&sa(t,"onDrag",Z),Z}}}},dragAfter:function(t,e){var n=e.datas,r=n.deltaOffset;return!(!r[0]&&!r[1])&&(n.deltaOffset=[0,0],this.drag(t,On(On({},e),{deltaOffset:r})))},dragEnd:function(t,e){var n=e.parentEvent,r=e.datas;if(t.state.dragInfo=null,r.isDrag){r.isDrag=!1;var i=oa(t,e,{});return!n&&sa(t,"onDragEnd",i),i}},dragGroupStart:function(t,e){var n,r,i=e.datas,o=e.clientX,a=e.clientY,s=this.dragStart(t,e);if(!s)return!1;var u=Wr(t,this,"dragStart",[o||0,a||0],e,!1,"draggable"),c=u.childEvents,l=u.eventParams,f=sa(t,"onDragGroupStart",On(On({},s),{targets:t.props.targets,events:l}));i.isDrag=!1!==f;var p=null!==(r=null===(n=c[0])||void 0===n?void 0:n.datas.startValue)&&void 0!==r?r:[0,0];return i.throttleOffset=[p[0]%1,p[1]%1],!!i.isDrag&&s},dragGroup:function(t,e){if(e.datas.isDrag){var n=this.drag(t,On(On({},e),{parentThrottleDrag:t.props.throttleDrag})),r=Wr(t,this,"drag",e.datas.passDelta,e,!1,"draggable").eventParams;if(n){var i=On({targets:t.props.targets,events:r},n);return sa(t,"onDragGroup",i),i}}},dragGroupEnd:function(t,e){var n=e.isDrag;if(e.datas.isDrag){this.dragEnd(t,e);var r=Wr(t,this,"dragEnd",[0,0],e,!1,"draggable").eventParams;return sa(t,"onDragGroupEnd",oa(t,e,{targets:t.props.targets,events:r})),n}},request:function(t){var e={},n=t.getRect(),r=0,i=0,o=!1;return{isControl:!1,requestStart:function(t){return o=t.useSnap,{datas:e,useSnap:o}},request:function(t){return"x"in t?r=t.x-n.left:"deltaX"in t&&(r+=t.deltaX),"y"in t?i=t.y-n.top:"deltaY"in t&&(i+=t.deltaY),{datas:e,distX:r,distY:i,useSnap:o}},requestEnd:function(){return{datas:e,isDrag:!0,useSnap:o}}}},unset:function(t){t.state.gestos.draggable=null,t.state.dragInfo=null}};function Ni(t,e){return{fixedPosition:yr(t,e),fixedDirection:e,fixedOffset:[0,0]}}function qi(t,e){var n=t.allMatrix,r=t.is3d,i=t.width,o=t.height,a=r?4:3,s=function(t,e,n){return[e?t[0]/(e/2)-1:0,n?t[1]/(n/2)-1:0]}(e,i,o);return{fixedPosition:Ao(n,e,a),fixedDirection:s,fixedOffset:[i?0:e[0],o?0:e[1]]}}var Yi=ya("resizable"),Xi={name:"resizable",ableGroup:"size",canPinch:!0,props:["resizable","throttleResize","renderDirections","displayAroundControls","keepRatio","resizeFormat","keepRatioFinally","edge","checkResizableError"],events:["resizeStart","beforeResize","resize","resizeEnd","resizeGroupStart","beforeResizeGroup","resizeGroup","resizeGroupEnd"],render:Zr("resizable"),dragControlCondition:Yi,viewClassName:xa("resizable"),dragControlStart:function(t,e){var n,r=e.inputEvent,i=e.isPinch,o=e.isGroup,a=e.parentDirection,s=e.parentGesto,u=e.datas,c=e.parentFixedDirection,l=e.parentEvent,f=Zo(a,i,r,u),p=t.state,d=p.target,h=p.width,v=p.height,g=p.gestos;if(!f||!d)return!1;if(g.resizable)return!1;g.resizable=s||t.controlGesto,!i&&fr(t,e),u.datas={},u.direction=f,u.startOffsetWidth=h,u.startOffsetHeight=v,u.prevWidth=0,u.prevHeight=0,u.minSize=[0,0],u.startWidth=p.inlineCSSWidth||p.cssWidth,u.startHeight=p.inlineCSSHeight||p.cssHeight,u.maxSize=[1/0,1/0],o||(u.minSize=[p.minOffsetWidth,p.minOffsetHeight],u.maxSize=[p.maxOffsetWidth,p.maxOffsetHeight]);var m=t.props.transformOrigin||"% %";function b(t){u.ratio=t&&isFinite(t)?t:0}function x(t){var e=Ni(u.startPositions,t);u.fixedDirection=e.fixedDirection,u.fixedPosition=e.fixedPosition,u.fixedOffset=e.fixedOffset}function y(e){var n=qi(t.state,e);u.fixedDirection=n.fixedDirection,u.fixedPosition=n.fixedPosition,u.fixedOffset=n.fixedOffset}function D(t){u.minSize=[F("".concat(t[0]),0)||0,F("".concat(t[1]),0)||0]}function C(t){var e=[t[0]||1/0,t[1]||1/0];S(e[0])&&!isFinite(e[0])||(e[0]=F("".concat(e[0]),0)||1/0),S(e[1])&&!isFinite(e[1])||(e[1]=F("".concat(e[1]),0)||1/0),u.maxSize=e}u.transformOrigin=m&&E(m)?m.split(" "):m,u.startOffsetMatrix=p.offsetMatrix,u.startTransformOrigin=p.transformOrigin,u.isWidth=null!==(n=null==e?void 0:e.parentIsWidth)&&void 0!==n?n:!f[0]&&!f[1]||f[0]||!f[1],u.startPositions=Qo(t.state),b(h/v),x(c||[-f[0],-f[1]]),u.setFixedDirection=x,u.setFixedPosition=y,u.setMin=D,u.setMax=C;var w=ia(t,e,{direction:f,startRatio:u.ratio,set:function(t){var e=Rn(t,2),n=e[0],r=e[1];u.startWidth=n,u.startHeight=r},setMin:D,setMax:C,setRatio:b,setFixedDirection:x,setFixedPosition:y,setOrigin:function(t){u.transformOrigin=t},dragStart:Fi.dragStart(t,(new ur).dragStart([0,0],e))}),_=l||sa(t,"onResizeStart",w);return u.startFixedDirection=u.fixedDirection,u.startFixedPosition=u.fixedPosition,!1!==_&&(u.isResize=!0,t.state.snapRenderInfo={request:e.isRequest,direction:f}),!!u.isResize&&w},dragControl:function(t,e){var n,r=e.datas,i=e.parentFlag,o=e.isPinch,a=e.parentKeepRatio,s=e.dragClient,u=e.parentDist,c=e.useSnap,l=e.isRequest,f=e.isGroup,p=e.parentEvent,d=e.resolveMatrix,h=r.isResize,v=r.transformOrigin,g=r.startWidth,m=r.startHeight,b=r.prevWidth,x=r.prevHeight,y=r.minSize,E=r.maxSize,S=r.ratio,D=r.startOffsetWidth,C=r.startOffsetHeight,w=r.isWidth;if(h){if(d){var _=t.state.is3d,M=r.startOffsetMatrix,O=r.startTransformOrigin,R=_?4:3,P=Ae(Mr(e)),T=Math.sqrt(P.length);R!==T&&(P=ge(P,T,R));var z=Er(M,P,O,R),G=Io(z,D,C,R);r.startPositions=G,r.nextTargetMatrix=P,r.nextAllMatrix=z}var k=jo(t.props,"resizable"),B=k.resizeFormat,A=k.throttleResize,I=void 0===A?i?0:1:A,F=k.parentMoveable,N=k.keepRatioFinally,q=r.direction,X=q,W=0,j=0;q[0]||q[1]||(X=[1,1]);var H=S&&(null!=a?a:k.keepRatio)||!1,V=Rn(at(),2),U=V[0],$=V[1];p||(r.setFixedDirection(r.fixedDirection),sa(t,"onBeforeResize",ia(t,e,{startFixedDirection:r.startFixedDirection,startFixedPosition:r.startFixedPosition,setFixedDirection:function(t){var e;return r.setFixedDirection(t),e=Rn(at(),2),U=e[0],$=e[1],[U,$]},setFixedPosition:function(t){var e;return r.setFixedPosition(t),e=Rn(at(),2),U=e[0],$=e[1],[U,$]},boundingWidth:U,boundingHeight:$,setSize:function(t){var e;e=Rn(t,2),U=e[0],$=e[1]}},!0)));var Z=s;s||(Z=!i&&o?function(t,e){return yr(Qo(t.state),e)}(t,[0,0]):r.fixedPosition);var K=[0,0];if(o||(K=function(t,e,n,r,i,o,a){if(!ci(t,"resizable"))return[0,0];var s=a.fixedDirection,u=a.nextAllMatrix,c=t.state,l=c.allMatrix,f=c.is3d;return co(t,(function(t,r){return ao(u||l,e+t,n+r,s,i,f)}),e,n,r,i,o,a)}(t,U,$,q,Z,!c&&l,r)),u&&(!u[0]&&(K[0]=0),!u[1]&&(K[1]=0)),H){X[0]&&X[1]&&K[0]&&K[1]&&(Ta(K[0])>Ta(K[1])?K[1]=0:K[0]=0);var J=!K[0]&&!K[1];J&&st(),X[0]&&!X[1]||K[0]&&!K[1]||J&&w?(U+=K[0],$=U/S):(!X[0]&&X[1]||!K[0]&&K[1]||J&&!w)&&($+=K[1],U=$*S)}else U+=K[0],$+=K[1],U=Math.max(0,U),$=Math.max(0,$);n=Rn(Y([U,$],y,E,!!H&&S),2),U=n[0],$=n[1],st(),H&&(f||N)&&(w?$=U/S:U=$*S);var Q=[(W=U-D)-b,(j=$-C)-x];r.prevWidth=W,r.prevHeight=j;var tt=Gr(t,U,$,Z,v,r);if(F||!Q.every((function(t){return!t}))||!tt.every((function(t){return!t}))){var et=Fi.drag(t,sr(e,t.state,tt,!!o,!1,"draggable")),nt=et.transform,rt=g+W,it=m+j,ot=ia(t,e,On({width:rt,height:it,offsetWidth:Math.round(U),offsetHeight:Math.round($),startRatio:S,boundingWidth:U,boundingHeight:$,direction:q,dist:[W,j],delta:Q,isPinch:!!o,drag:et},ra({style:{width:"".concat(rt,"px"),height:"".concat(it,"px")},transform:nt},et,e)));return!p&&sa(t,"onResize",ot),ot}}function at(){var t=r.fixedDirection,n=wa(X,H,r,e);W=n.distWidth,j=n.distHeight;var i=X[0]-t[0]||H?Math.max(D+W,Qn):D,o=X[1]-t[1]||H?Math.max(C+j,Qn):C;return H&&D&&C&&(w?o=i/S:i=o*S),[i,o]}function st(){var t;B&&(t=Rn(B([U,$]),2),U=t[0],$=t[1]),U=L(U,I),$=L($,I)}},dragControlAfter:function(t,e){var n=e.datas,r=n.isResize,i=n.startOffsetWidth,o=n.startOffsetHeight,a=n.prevWidth,s=n.prevHeight;if(r&&!1!==t.props.checkResizableError){var u=t.state,c=u.width-(i+a),l=u.height-(o+s),f=Ta(c)>3,p=Ta(l)>3;return f&&(n.startWidth+=c,n.startOffsetWidth+=c,n.prevWidth+=c),p&&(n.startHeight+=l,n.startOffsetHeight+=l,n.prevHeight+=l),f||p?this.dragControl(t,e):void 0}},dragControlEnd:function(t,e){var n=e.datas,r=e.parentEvent;if(n.isResize){n.isResize=!1;var i=oa(t,e,{});return!r&&sa(t,"onResizeEnd",i),i}},dragGroupControlCondition:Yi,dragGroupControlStart:function(t,e){var n=e.datas,r=this.dragControlStart(t,On(On({},e),{isGroup:!0}));if(!r)return!1;var i=Xr(t,"resizable",e),o=n.startOffsetWidth,a=n.startOffsetHeight;function s(){var t=n.minSize;i.forEach((function(e){var n=e.datas,r=n.minSize,i=n.startOffsetWidth,s=n.startOffsetHeight,u=o*(i?r[0]/i:0),c=a*(s?r[1]/s:0);t[0]=Math.max(t[0],u),t[1]=Math.max(t[1],c)}))}function u(){var t=n.maxSize;i.forEach((function(e){var n=e.datas,r=n.maxSize,i=n.startOffsetWidth,s=n.startOffsetHeight,u=o*(i?r[0]/i:0),c=a*(s?r[1]/s:0);t[0]=Math.min(t[0],u),t[1]=Math.min(t[1],c)}))}var c=jr(t,this,"dragControlStart",e,(function(e,r){return Hr(t,e,n,r)}));s(),u();var l=function(e){r.setFixedDirection(e),c.forEach((function(r,o){r.setFixedDirection(e),Hr(t,r.moveable,n,i[o])}))};n.setFixedDirection=l;var f=On(On({},r),{targets:t.props.targets,events:c.map((function(t){return On(On({},t),{setMin:function(e){t.setMin(e),s()},setMax:function(e){t.setMax(e),u()}})})),setFixedDirection:l,setMin:function(t){r.setMin(t),s()},setMax:function(t){r.setMax(t),u()}}),p=sa(t,"onResizeGroupStart",f);return n.isResize=!1!==p,!!n.isResize&&r},dragGroupControl:function(t,e){var n=e.datas;if(n.isResize){var r=jo(t.props,"resizable");aa(t,"onBeforeResize",(function(n){sa(t,"onBeforeResizeGroup",ia(t,e,On(On({},n),{targets:r.targets}),!0))}));var i=this.dragControl(t,On(On({},e),{isGroup:!0}));if(i){var o=i.boundingWidth,a=i.boundingHeight,s=i.dist,u=r.keepRatio,c=[o/(o-s[0]),a/(a-s[1])],l=n.fixedPosition,f=jr(t,this,"dragControl",e,(function(e,n){var r=Rn(Se(Pe(t.rotation/180*Math.PI,3),[n.datas.originalX*c[0],n.datas.originalY*c[1],1],3),2),i=r[0],o=r[1];return On(On({},n),{parentDist:null,parentScale:c,dragClient:xe(l,[i,o]),parentKeepRatio:u})})),p=On({targets:r.targets,events:f},i);return sa(t,"onResizeGroup",p),p}}},dragGroupControlEnd:function(t,e){var n=e.isDrag;if(e.datas.isResize){this.dragControlEnd(t,e);var r=jr(t,this,"dragControlEnd",e);return sa(t,"onResizeGroupEnd",oa(t,e,{targets:t.props.targets,events:r})),n}},request:function(t){var e={},n=0,r=0,i=!1,o=t.getRect();return{isControl:!0,requestStart:function(t){var n;return i=t.useSnap,{datas:e,parentDirection:t.direction||[1,1],parentIsWidth:null===(n=null==t?void 0:t.horizontal)||void 0===n||n,useSnap:i}},request:function(t){return"offsetWidth"in t?n=t.offsetWidth-o.offsetWidth:"deltaWidth"in t&&(n+=t.deltaWidth),"offsetHeight"in t?r=t.offsetHeight-o.offsetHeight:"deltaHeight"in t&&(r+=t.deltaHeight),{datas:e,parentDist:[n,r],parentKeepRatio:t.keepRatio,useSnap:i}},requestEnd:function(){return{datas:e,isDrag:!0,useSnap:i}}}},unset:function(t){t.state.gestos.resizable=null}};function Wi(t,e,n,r,i){var o=t.props.groupable,a=t.state,s=a.is3d?4:3,u=e.origin,c=Ao(t.state.rootMatrix,ye([u[0],u[1]],o?[0,0]:[a.left,a.top]),s),l=xe([i.left,i.top],c);e.startAbsoluteOrigin=l,e.prevDeg=W(l,[n,r])/Math.PI*180,e.defaultDeg=e.prevDeg,e.prevSnapDeg=0,e.loop=0,e.startDist=H(l,[n,r])}function ji(t,e,n){var r=n.defaultDeg,i=n.prevDeg,o=i%360,a=Math.floor(i/360);o<0&&(o+=360),o>t&&o>270&&t<90?++a:o270&&--a;var s=e*(360*a+t-r);return n.prevDeg=r+s,s}function Hi(t,e,n,r){return ji(W(r.startAbsoluteOrigin,[t,e])/Math.PI*180,n,r)}function Li(t,e,n,r,i,o){var a=t.props.throttleRotate,s=void 0===a?0:a,u=n.prevSnapDeg,c=0,l=!1;if(o){var f=function(t,e,n,r){var i,o=t.props,a=null!==(i=o[bo])&&void 0!==i?i:5,s=o[xo];if(ci(t,"rotatable")){var u=e.pos1,c=e.pos2,l=e.pos3,f=e.pos4,p=e.origin,d=n*Math.PI/180,h=[u,c,l,f].map((function(t){return ye(t,p)})),v=h.map((function(t){return Me(t,d)})),g=Pn(Pn([],Rn(ri(t,h,v,p,n)),!1),Rn(Pi(t,h,v,p,n)),!1);g.sort((function(t,e){return Ta(t-n)-Ta(e-n)}));var m=g.length>0;if(m)return{isSnap:m,dist:m?g[0]:n}}if((null==s?void 0:s.length)&&a){var b=s.slice().sort((function(t,e){return po(t,r)-po(e,r)}))[0];if(po(b,r)<=a)return{isSnap:!0,dist:n+fo(r,b)-r}}return{isSnap:!1,dist:n}}(t,e,r,i+r);l=f.isSnap,c=i+f.dist}l||(c=L(i+r,s));var p=c-i;return n.prevSnapDeg=p,[p-u,p,c]}function Vi(t,e,n){var r=Rn(e,4),i=r[0],o=r[1],a=r[2],s=r[3];if("none"===t)return[];if(y(t))return t.map((function(t){return Vi(t,[i,o,a,s],n)[0]}));var u=Rn((t||"top").split("-"),2),c=u[0],l=u[1],f=[i,o];"left"===c?f=[a,i]:"right"===c?f=[o,s]:"bottom"===c&&(f=[s,a]);var p=[(f[0][0]+f[1][0])/2,(f[0][1]+f[1][1])/2],d=Lo(f,n);if(l){var h="top"===l||"left"===l,v="bottom"===c||"left"===c;p=f[h&&!v||!h&&v?0:1]}return[[p,d]]}function Ui(t,e){if(e.isRequest)return"rotatable"===e.requestAble;var n=e.inputEvent.target;if(Z(n,Eo("rotation-control"))||t.props.rotateAroundControls&&Z(n,Eo("around-control"))||Z(n,Eo("control"))&&Z(n,Eo("rotatable")))return!0;var r=t.props.rotationTarget;return!!r&&Sa(r,!0).some((function(t){return!!t&&(n===t||n.contains(t))}))}var $i={name:"rotatable",canPinch:!0,props:["rotatable","rotationPosition","throttleRotate","renderDirections","rotationTarget","rotateAroundControls","edge","resolveAblesWithRotatable","displayAroundControls"],events:["rotateStart","beforeRotate","rotate","rotateEnd","rotateGroupStart","beforeRotateGroup","rotateGroup","rotateGroupEnd"],css:[".rotation {\nposition: absolute;\nheight: 40px;\nwidth: 1px;\ntransform-origin: 50% 100%;\nheight: calc(40px * var(--zoom));\ntop: auto;\nleft: 0;\nbottom: 100%;\nwill-change: transform;\n}\n.rotation .rotation-line {\ndisplay: block;\nwidth: 100%;\nheight: 100%;\ntransform-origin: 50% 50%;\n}\n.rotation .rotation-control {\nborder-color: #4af;\nborder-color: var(--moveable-color);\nbackground:#fff;\ncursor: alias;\n}\n:global .view-rotation-dragging, .rotatable.direction.control {\ncursor: alias;\n}\n.rotatable.direction.control.move {\ncursor: move;\n}\n"],viewClassName:function(t){return t.isDragging("rotatable")?Eo("view-rotation-dragging"):""},render:function(t,e){var n=jo(t.props,"rotatable"),r=n.rotatable,i=n.rotationPosition,o=n.zoom,a=n.renderDirections,s=n.rotateAroundControls,u=n.resolveAblesWithRotatable,c=t.getState(),l=c.renderPoses,f=c.direction;if(!r)return null;var p=Vi(i,l,f),d=[];if(p.forEach((function(t,n){var r=Rn(t,2),i=r[0],a=r[1];d.push(e.createElement("div",{key:"rotation".concat(n),className:Eo("rotation"),style:{transform:"translate(-50%) translate(".concat(i[0],"px, ").concat(i[1],"px) rotate(").concat(a,"rad)")}},e.createElement("div",{className:Eo("line rotation-line"),style:{transform:"scaleX(".concat(o,")")}}),e.createElement("div",{className:Eo("control rotation-control"),style:{transform:"translate(0.5px) scale(".concat(o,")")}})))})),a){var h=I(u||{}),v={};h.forEach((function(t){u[t].forEach((function(e){v[e]=t}))}));var g=[];y(a)&&(g=a.map((function(t){var e=v[t];return{data:e?{resolve:e}:{},classNames:e?["move"]:[],dir:t}}))),d.push.apply(d,Pn([],Rn(Lr(t,"rotatable",g,e)),!1))}return s&&d.push.apply(d,Pn([],Rn(Jr(t,e)),!1)),d},dragControlCondition:Ui,dragControlStart:function(t,e){var n,r,i=e.datas,o=e.clientX,a=e.clientY,s=e.parentRotate,u=e.parentFlag,c=e.isPinch,l=e.isRequest,f=t.state,p=f.target,d=f.left,h=f.top,v=f.direction,g=f.beforeDirection,m=f.targetTransform,b=f.moveableClientRect,x=f.offsetMatrix,y=f.targetMatrix,E=f.allMatrix,S=f.width,D=f.height;if(!l&&!p)return!1;var C=t.getRect();i.rect=C,i.transform=m,i.left=d,i.top=h;var w=function(e){var n=qi(t.state,e);i.fixedDirection=n.fixedDirection,i.fixedOffset=n.fixedOffset,i.fixedPosition=n.fixedPosition,I&&I.setFixedPosition(e)},_=function(e){var n=function(t,e){var n=t.allMatrix,r=t.is3d,i=t.width,o=t.height,a=r?4:3;return{fixedPosition:Ao(n,[i/2*(1+e[0]),o/2*(1+e[1])],a),fixedDirection:e,fixedOffset:[0,0]}}(t.state,e);i.fixedDirection=n.fixedDirection,i.fixedOffset=n.fixedOffset,i.fixedPosition=n.fixedPosition,I&&I.setFixedDirection(e)},M=o,O=a;if(l||c||u){var R=s||0;i.beforeInfo={origin:C.beforeOrigin,prevDeg:R,defaultDeg:R,prevSnapDeg:0,startDist:0},i.afterInfo=On(On({},i.beforeInfo),{origin:C.origin}),i.absoluteInfo=On(On({},i.beforeInfo),{origin:C.origin,startValue:R})}else{var P=null===(r=e.inputEvent)||void 0===r?void 0:r.target;if(P){var T=P.getAttribute("data-direction")||"",z=rr[T];if(z){i.isControl=!0,i.isAroundControl=Z(P,Eo("around-control")),i.controlDirection=z;var G=P.getAttribute("data-resolve");G&&(i.resolveAble=G);var k=function(t,e,n){var r=16===t.length?4:3,i=e.map((function(e){return Ao(t,e,r)})),o=n.left,a=n.top;return i.map((function(t){return[t[0]+o,t[1]+a]}))}(f.rootMatrix,f.renderPoses,b);n=Rn(yr(k,z),2),M=n[0],O=n[1]}}i.beforeInfo={origin:C.beforeOrigin},i.afterInfo={origin:C.origin},i.absoluteInfo={origin:C.origin,startValue:C.rotation};var B=w;w=function(e){var n=f.is3d?4:3,r=Rn(xe(he(y,n),e),2),o=r[0],a=r[1],s=Se(x,ve([o,a],n)),u=Se(E,ve([e[0],e[1]],n));B(e);var c=f.posDelta;i.beforeInfo.origin=ye(s,c),i.afterInfo.origin=ye(u,c),i.absoluteInfo.origin=ye(u,c),Wi(t,i.beforeInfo,M,O,b),Wi(t,i.afterInfo,M,O,b),Wi(t,i.absoluteInfo,M,O,b)},_=function(t){var e=yr([[0,0],[S,0],[0,D],[S,D]],t);w(e)}}i.startClientX=M,i.startClientY=O,i.direction=v,i.beforeDirection=g,i.startValue=0,i.datas={},Dr(t,e,"rotate");var A=!1,I=!1;i.isControl&&i.resolveAble&&("resizable"===i.resolveAble&&(I=Xi.dragControlStart(t,On(On({},new ur("resizable").dragStart([0,0],e)),{parentPosition:i.controlPosition,parentFixedPosition:i.fixedPosition}))));I||(A=Fi.dragStart(t,(new ur).dragStart([0,0],e))),w(function(t){var e=t.props,n=e.groupable,r=e.svgOrigin,i=t.getState(),o=i.offsetWidth,a=i.offsetHeight,s=i.svg,u=i.transformOrigin;if(!n&&s&&r)return Ma(r,o,a);return u}(t));var F=ia(t,e,On(On({set:function(t){i.startValue=t*Math.PI/180},setFixedDirection:_,setFixedPosition:w},Sr(t,e)),{dragStart:A,resizeStart:I})),N=sa(t,"onRotateStart",F);return i.isRotate=!1!==N,f.snapRenderInfo={request:e.isRequest},!!i.isRotate&&F},dragControl:function(t,e){var n,r,i,o=e.datas,a=e.clientDistX,s=e.clientDistY,u=e.parentRotate,c=e.parentFlag,l=e.isPinch,f=e.groupDelta,p=e.resolveMatrix,d=o.beforeDirection,h=o.beforeInfo,v=o.afterInfo,g=o.absoluteInfo,m=o.isRotate,b=o.startValue,x=o.rect,y=o.startClientX,E=o.startClientY;if(m){pr(t,e,"rotate");var S,D,C,w,_,M,O,R,P,T=function(t){return cr(t.datas.beforeTransform,[50,50],100,100).direction}(e),z=d*T,G=t.props.parentMoveable,k=180/Math.PI*b,B=g.startValue,A=!1,I=y+a,F=E+s;if(!c&&"parentDist"in e){var N=e.parentDist;D=N,_=N,R=N}else l||c?(D=ji(u,d,h),_=ji(u,z,v),R=ji(u,z,g)):(D=Hi(I,F,d,h),_=Hi(I,F,z,v),R=Hi(I,F,z,g),A=!0);if(sa(t,"onBeforeRotate",ia(t,e,{beforeRotation:C=k+D,rotation:M=k+_,absoluteRotation:P=B+R,setRotation:function(t){D=_=t-k,R=_}},!0)),S=(n=Rn(Li(t,x,h,D,k,A),3))[0],D=n[1],C=n[2],w=(r=Rn(Li(t,x,v,_,k,A),3))[0],_=r[1],M=r[2],O=(i=Rn(Li(t,x,g,R,B,A),3))[0],R=i[1],P=i[2],O||w||S||G||p){var q=dr(o,"rotate(".concat(M,"deg)"),"rotate(".concat(_,"deg)"));p&&(o.fixedPosition=Tr(t,o.targetAllTransform,o.fixedDirection,o.fixedOffset,o));var Y=function(t,e,n){var r=n.fixedDirection,i=n.fixedPosition,o=n.fixedOffset;return zr(t,"rotate(".concat(e,"deg)"),r,i,o,n)}(t,_,o),X=ye(xe(f||[0,0],Y),o.prevInverseDist||[0,0]);o.prevInverseDist=Y,o.requestValue=null;var W=Pr(t,q,X,l,e),j=W,L=H([I,F],g.startAbsoluteOrigin)-g.startDist,V=void 0;if("resizable"===o.resolveAble){var U=Xi.dragControl(t,On(On({},sr(e,t.state,[e.deltaX,e.deltaY],!!l,!1,"resizable")),{resolveMatrix:!0,parentDistance:L}));U&&(V=U,j=ra(j,U,e))}var $=ia(t,e,On(On({delta:w,dist:_,rotate:M,rotation:M,beforeDist:D,beforeDelta:S,beforeRotate:C,beforeRotation:C,absoluteDist:R,absoluteDelta:O,absoluteRotate:P,absoluteRotation:P,isPinch:!!l,resize:V},W),j));return sa(t,"onRotate",$),$}}},dragControlEnd:function(t,e){var n=e.datas;if(n.isRotate){n.isRotate=!1;var r=oa(t,e,{});return sa(t,"onRotateEnd",r),r}},dragGroupControlCondition:Ui,dragGroupControlStart:function(t,e){var n=e.datas,r=t.state,i=r.left,o=r.top,a=r.beforeOrigin,s=this.dragControlStart(t,e);if(!s)return!1;s.set(n.beforeDirection*t.rotation);var u=jr(t,this,"dragControlStart",e,(function(t,e){var n=t.state,r=n.left,s=n.top,u=n.beforeOrigin,c=xe(ye([r,s],[i,o]),ye(u,a));return e.datas.startGroupClient=c,e.datas.groupClient=c,On(On({},e),{parentRotate:0})})),c=sa(t,"onRotateGroupStart",On(On({},s),{targets:t.props.targets,events:u}));return n.isRotate=!1!==c,!!n.isRotate&&s},dragGroupControl:function(t,e){var n=e.datas;if(n.isRotate){aa(t,"onBeforeRotate",(function(n){sa(t,"onBeforeRotateGroup",ia(t,e,On(On({},n),{targets:t.props.targets}),!0))}));var r=this.dragControl(t,e);if(r){var i=n.beforeDirection,o=r.beforeDist,a=o/180*Math.PI,s=jr(t,this,"dragControl",e,(function(t,e){var n=e.datas.startGroupClient,r=Rn(e.datas.groupClient,2),s=r[0],u=r[1],c=Rn(Me(n,a*i),2),l=c[0],f=c[1],p=[l-s,f-u];return e.datas.groupClient=[l,f],On(On({},e),{parentRotate:o,groupDelta:p})}));t.rotation=i*r.beforeRotation;var u=On({targets:t.props.targets,events:s,set:function(e){t.rotation=e},setGroupRotation:function(e){t.rotation=e}},r);return sa(t,"onRotateGroup",u),u}}},dragGroupControlEnd:function(t,e){var n=e.isDrag;if(e.datas.isRotate){this.dragControlEnd(t,e);var r=jr(t,this,"dragControlEnd",e);return sa(t,"onRotateGroupEnd",oa(t,e,{targets:t.props.targets,events:r})),n}},request:function(t){var e={},n=0,r=t.getRotation();return{isControl:!0,requestStart:function(){return{datas:e}},request:function(t){return"deltaRotate"in t?n+=t.deltaRotate:"rotate"in t&&(n=t.rotate-r),{datas:e,parentDist:n}},requestEnd:function(){return{datas:e,isDrag:!0}}}}};function Zi(t,e){return function(t,e){var n,r=t.direction,i=t.classNames,o=t.size,a=t.pos,s=t.zoom,u=t.key,c="horizontal"===r,l=c?"Y":"X";return e.createElement("div",{key:u,className:i.join(" "),style:(n={},n[c?"width":"height"]="".concat(o),n.transform="translate(".concat(a[0],", ").concat(a[1],") translate").concat(l,"(-50%) scale").concat(l,"(").concat(s,")"),n)})}(On(On({},t),{classNames:Pn([Eo("line","guideline",t.direction)],Rn(t.classNames),!1).filter((function(t){return t})),size:t.size||"".concat(t.sizeValue,"px"),pos:t.pos||t.posValue.map((function(t){return"".concat(L(t,.1),"px")}))}),e)}function Ki(t,e,n,r,i,o,a,s){var u=t.props.zoom;return n.map((function(t,n){var c=t.type,l=t.pos,f=[0,0];return f[a]=r,f[a?0:1]=-i+l,Zi({key:"".concat(e,"TargetGuideline").concat(n),classNames:[Eo("target","bold",c)],posValue:f,sizeValue:o,zoom:u,direction:e},s)}))}function Ji(t,e,n,r,i,o){var a=t.props,s=a.zoom,u=a.isDisplayInnerSnapDigit,c="horizontal"===e?si:ui,l=i[c.start],f=i[c.end];return n.filter((function(t){var e=t.hide,n=t.elementRect;if(e)return!1;if(u&&n){var r=n.rect;if(r[c.start]<=l&&f<=r[c.end])return!1}return!0})).map((function(t,n){var i=t.pos,a=t.size,u=t.element,c=t.className,l=[-r[0]+i[0],-r[1]+i[1]];return Zi({key:"".concat(e,"-default-guideline-").concat(n),classNames:u?[Eo("bold"),c]:[Eo("normal"),c],direction:e,posValue:l,sizeValue:a,zoom:s},o)}))}function Qi(t,e,n,r,i,o,a,s){var u,c=t.props,l=c.snapDigit,f=void 0===l?0:l,p=c.isDisplaySnapDigit,d=void 0===p||p,h=c.snapDistFormat,v=void 0===h?function(t,e){return t}:h,g=c.zoom,m="horizontal"===e?"X":"Y",b="vertical"===e?"height":"width",x=Math.abs(i),y=d?parseFloat(x.toFixed(f)):0;return s.createElement("div",{key:"".concat(e,"-").concat(n,"-guideline-").concat(r),className:Eo("guideline-group",e),style:(u={left:"".concat(o[0],"px"),top:"".concat(o[1],"px")},u[b]="".concat(x,"px"),u)},Zi({direction:e,classNames:[Eo(n),a],size:"100%",posValue:[0,0],sizeValue:x,zoom:g},s),s.createElement("div",{className:Eo("size-value","gap"),style:{transform:"translate".concat(m,"(-50%) scale(").concat(g,")")}},y>0?v(y,e):""))}function to(t,e,n,r,i){var o=t.props.isDisplayInnerSnapDigit,a=[];return["vertical","horizontal"].forEach((function(s){var u=e.filter((function(t){return t.type===s})),c="vertical"===s?1:0,l=c?0:1,f=function(t,e,n,r){var i="vertical"===t?0:1,o="vertical"===t?1:0,a=i?si:ui,s=n[a.start],u=n[a.end];return fa(e,(function(t){return t.pos[i]})).map((function(e){var n=[],c=[];return e.forEach((function(e){var l,f,p=e.element,d=e.elementRect.rect;if(d[a.end]0){var u=[0,0];u[c]=n[c]+b[p.start]-h-o,u[l]=m,a.push(Qi(t,s,"dashed",a.length,o,u,e.className,i))}b=r})),b=r,f.forEach((function(e){var r=e.elementRect.rect,o=r[p.start]-b[p.end];if(o>0){var u=[0,0];u[c]=n[c]+b[p.end]-h,u[l]=m,a.push(Qi(t,s,"dashed",a.length,o,u,e.className,i))}b=r})),g.forEach((function(e){var r=e.elementRect.rect,o=h-r[p.start],u=r[p.end]-v,f=[0,0],d=[0,0];f[c]=n[c]-o,f[l]=m,d[c]=n[c]+v-h,d[l]=m,a.push(Qi(t,s,"dashed",a.length,o,f,e.className,i)),a.push(Qi(t,s,"dashed",a.length,u,d,e.className,i))}))}))})),a}function eo(t){var e,n,r=t.state,i=r.containerClientRect,o=r.hasFixed,a=i.overflow,s=i.scrollHeight,u=i.scrollWidth,c=i.clientHeight,l=i.clientWidth,f=i.clientLeft,p=i.clientTop,d=t.props,h=d.snapGap,v=void 0===h||h,g=d.verticalGuidelines,b=d.horizontalGuidelines,y=d.snapThreshold,E=void 0===y?5:y,S=d.maxSnapElementGuidelineDistance,D=void 0===S?1/0:S,C=d.isDisplayGridGuidelines,w=Fo(Qo(t.state)),_=w.top,M=w.left,O=w.bottom,R=w.right,P={top:_,left:M,bottom:O,right:R,center:(M+R)/2,middle:(_+O)/2},T=function(t){var e=t.state,n=t.props.elementGuidelines,r=void 0===n?[]:n;if(!r.length)return e.elementRects=[],[];var i=(e.elementRects||[]).filter((function(t){return!t.refresh})),o=r.map((function(t){return x(t)&&"element"in t?On(On({},t),{element:Ea(t.element,!0)}):{element:Ea(t,!0)}})).filter((function(t){return t.element})),a=(l=i.map((function(t){return t.element})),f=o.map((function(t){return t.element})),ft(l,f,Ye)),s=a.maintained,u=a.added,c=[];var l,f;s.forEach((function(t){var e=Rn(t,2),n=e[0],r=e[1];c[r]=i[n]})),function(t,e){if(!e.length)return[];var n=t.props.groupable,r=t.state,i=r.containerClientRect,o=r.rootMatrix,a=r.is3d,s=r.offsetDelta,u=a?4:3,c=Rn(function(t,e,n){var r=Ao(t,[e.clientLeft,e.clientTop],n);return[e.left+r[0],e.top+r[1]]}(o,i,u),2),l=c[0],f=c[1],p=n?0:s[0],d=n?0:s[1];return e.map((function(t){var e=t.element.getBoundingClientRect(),n=e.left-l-p,r=e.top-f-d,i=r+e.height,a=n+e.width,s=Rn(ha(o,[n,r],u),2),c=s[0],h=s[1],v=Rn(ha(o,[a,i],u),2),g=v[0],m=v[1];return On(On({},t),{rect:{left:c,right:g,top:h,bottom:m,center:(c+g)/2,middle:(h+m)/2}})}))}(t,u.map((function(t){return o[t]}))).map((function(t,e){c[u[e]]=t})),e.elementRects=c;var p=li(t.props.elementSnapDirections),d=[];return c.forEach((function(t){var e=t.element,n=t.top,r=void 0===n?p.top:n,i=t.left,o=void 0===i?p.left:i,a=t.right,s=void 0===a?p.right:a,u=t.bottom,c=void 0===u?p.bottom:u,l=t.center,f=void 0===l?p.center:l,h=t.middle,v=void 0===h?p.middle:h,g=t.className,m=t.rect,b=fi({top:r,right:s,left:o,bottom:c,center:f,middle:v},m),x=b.horizontal,y=b.vertical,E=b.horizontalNames,S=b.verticalNames,D=m.top,C=m.left,w=m.right-C,_=m.bottom-D,M=[w,_];y.forEach((function(n,r){d.push({type:"vertical",element:e,pos:[L(n,.1),D],size:_,sizes:M,className:g,elementRect:t,elementDirection:ai[S[r]]||S[r],direction:""})})),x.forEach((function(n,r){d.push({type:"horizontal",element:e,pos:[C,L(n,.1)],size:w,sizes:M,className:g,elementRect:t,elementDirection:ai[E[r]]||E[r],direction:""})}))})),d}(t),z=Pn([],Rn(T),!1),G=(null!==(n=null===(e=r.snapThresholdInfo)||void 0===e?void 0:e.multiples)&&void 0!==n?n:[1,1]).map((function(t){return t*E}));v&&z.push.apply(z,Pn([],Rn(function(t,e,n){var r=t.props,i=r.maxSnapElementGuidelineDistance,o=void 0===i?1/0:i,a=r.maxSnapElementGapDistance,s=void 0===a?1/0:a,u=t.state.elementRects,c=[];return[["vertical",si,ui],["horizontal",ui,si]].forEach((function(t){var r=Rn(t,3),i=r[0],a=r[1],l=r[2],f=e[a.start],p=e[a.end],d=e[a.center],h=e[l.start],v=e[l.end],g={left:n[0],top:n[1]};function m(t){var e=t.rect,n=g[a.start];return e[a.end]v||e[l.end]0})).sort((function(t,e){return m(t)-m(e)})),x=[];b.forEach((function(t){b.forEach((function(e){if(t!==e){var n=t.rect,r=e.rect,i=n[l.start],o=n[l.end],a=r[l.start];i>r[l.end]||a>o||x.push([t,e])}}))})),x.forEach((function(t){var n=Rn(t,2),r=n[0],u=n[1],l=r.rect,h=u.rect,v=l[a.start],m=l[a.end],b=h[a.start],x=h[a.end],y=g[a.start],E=0,S=0,D=!1,C=!1,w=!1;if(m<=f&&p<=b){if(C=!0,Ta((S=m+(E=(b-m-(p-f))/2)+(p-f)/2)-d)>y)return}else if(my)return}else{if(!(my)return}E&&no(e,h,i,o)&&(E>s||c.push({type:i,pos:"vertical"===i?[S,0]:[0,S],element:u.element,size:0,className:u.className,isStart:D,isCenter:C,isEnd:w,gap:E,hide:!0,gapRects:[r,u],direction:"",elementDirection:""}))}))})),c}(t,P,G)),!1));var k=On({},r.snapOffset||{left:0,top:0,bottom:0,right:0});if(z.push.apply(z,Pn([],Rn(function(t,e,n,r,i,o,a){void 0===r&&(r=0);void 0===i&&(i=0);var s=t.props,u=t.state,c=s.snapGridWidth,l=void 0===c?0:c,f=s.snapGridHeight,p=void 0===f?0:f,d=[],h=o.left,v=o.top,g=[0,0];!function(t,e,n,r){var i,o,a=t.props,s=t.state,u=a.snapGridAll,c=a.snapGridWidth,l=void 0===c?0:c,f=a.snapGridHeight,p=void 0===f?0:f,d=s.snapRenderInfo,h=d&&((null===(i=d.direction)||void 0===i?void 0:i[0])||(null===(o=d.direction)||void 0===o?void 0:o[1])),v=t.moveables;if(u&&v&&h&&(l||p)){if(s.snapThresholdInfo)return;s.snapThresholdInfo={multiples:[1,1],offset:[0,0]};var g=t.getRect(),b=g.children,x=d.direction;if(b){var y=x.map((function(t,i){var o=0===i?{snapSize:l,posName:"left",sizeName:"width",clientOffset:r.left-e}:{snapSize:p,posName:"top",sizeName:"height",clientOffset:r.top-n},a=o.snapSize,s=o.posName,u=o.sizeName,c=o.clientOffset;if(!a)return{dir:t,multiple:1,snapSize:a,snapOffset:0};var f=g[u],d=g[s],h=U(b.map((function(t){return[t[s]-d,t[u],f-t[u]-t[s]+d]}))).filter((function(t){return t})).sort((function(t,e){return t-e})),v=h[0],x=h.map((function(t){return L(t/v,.1)*a})),y=1,E=L(f/v,.1);for(y=1;y<=10&&!x.every((function(t){return t*y%1==0}));++y);var S=(1-t)/2,D=m(d-c,d-c+f,S,1-S);return{multiple:E*y,dir:t,snapSize:a,snapOffset:Math.round(D/a)}})),E=y.map((function(t){return t.multiple||1}));s.snapThresholdInfo.multiples=E,s.snapThresholdInfo.offset=y.map((function(t){return t.snapOffset})),y.forEach((function(t,e){t.snapSize}))}}else s.snapThresholdInfo=null}(t,r,i,o);var b=u.snapThresholdInfo,x=l,y=p;b&&(l*=b.multiples[0]||1,p*=b.multiples[1]||1,g=b.offset);if(p){for(var E=function(t){d.push({type:"horizontal",pos:[h,L(g[1]*y+t-i+v,.1)],className:Eo("grid-guideline"),size:e,hide:!a,direction:"",grid:!0})},S=0;S<=2*n;S+=p)E(S);for(S=-p;S>=-n;S-=p)E(S)}if(l){for(E=function(t){d.push({type:"vertical",pos:[L(g[0]*x+t-r+h,.1),v],className:Eo("grid-guideline"),size:n,hide:!a,direction:"",grid:!0})},S=0;S<=2*e;S+=l)E(S);for(S=-l;S>=-e;S-=l)E(S)}return d}(t,a?u:l,a?s:c,f,p,k,C)),!1)),o){var B=i.left,A=i.top;k.left+=B,k.top+=A,k.right+=B,k.bottom+=A}return z.push.apply(z,Pn([],Rn(io(b||!1,g||!1,a?u:l,a?s:c,f,p,k)),!1)),z=z.filter((function(t){var e=t.element,n=t.elementRect,r=t.type;if(!e||!n)return!0;var i=n.rect;return no(P,i,r,D)})),z}function no(t,e,n,r){return"horizontal"===n?Ta(t.right-e.left)<=r||Ta(t.left-e.right)<=r||t.left<=e.right&&e.left<=t.right:"vertical"!==n||(Ta(t.bottom-e.top)<=r||Ta(t.top-e.bottom)<=r||t.top<=e.bottom&&e.top<=t.bottom)}function ro(t,e){return t?t.map((function(t){var n=x(t)?t:{pos:t},r=n.pos;return S(r)?n:On(On({},n),{pos:F(r,e)})})):[]}function io(t,e,n,r,i,o,a){void 0===i&&(i=0),void 0===o&&(o=0),void 0===a&&(a={left:0,top:0,right:0,bottom:0});var s=[],u=a.left,c=a.top,l=a.bottom,f=n+a.right-u,p=r+l-c;return ro(t,p).forEach((function(t){s.push({type:"horizontal",pos:[u,L(t.pos-o+c,.1)],size:f,className:t.className,direction:""})})),ro(e,f).forEach((function(t){s.push({type:"vertical",pos:[L(t.pos-i+u,.1),c],size:p,className:t.className,direction:""})})),s}function oo(t){var e=t.state,n=e.container,r=t.props.snapContainer||n;if(e.snapContainer===r&&e.guidelines&&e.guidelines.length)return!1;var i=e.containerClientRect,o={left:0,top:0,bottom:0,right:0};if(n!==r){var a=Ea(r,!0);if(a){var s=$o(a),u=Da(e,[s.left-i.left,s.top-i.top]),c=Da(e,[s.right-i.right,s.bottom-i.bottom]);o.left=L(u[0],1e-5),o.top=L(u[1],1e-5),o.right=L(c[0],1e-5),o.bottom=L(c[1],1e-5)}}return e.snapContainer=r,e.snapOffset=o,e.guidelines=eo(t),e.enableSnap=!0,!0}function ao(t,e,n,r,i,o){var a=Io(t,e,n,o?4:3);return Jo(a,ye(i,yr(a,r)))}function so(t){return t?t/Ta(t):0}function uo(t,e,n,r,i,o){var a=function(t,e,n){var r=[];if(n)1!==Ta(e[0])||1!==Ta(e[1])?r.push([e,[-1,-1]],[e,[-1,1]],[e,[1,-1]],[e,[1,1]]):r.push([e,[t[0],-t[1]]],[e,[-t[0],t[1]]]),r.push([e,t]);else if(t[0]&&t[1]||!t[0]&&!t[1]){var i=t[0]?t:[1,1];[1,-1].forEach((function(t){[1,-1].forEach((function(n){var o=[t*i[0],n*i[1]];e[0]===o[0]&&e[1]===o[1]||r.push([e,o])}))}))}else t[0]?(1===Ta(e[0])?[1]:[1,-1]).forEach((function(n){r.push([[e[0],-1],[n*t[0],-1]],[[e[0],0],[n*t[0],0]],[[e[0],1],[n*t[0],1]])})):t[1]&&(1===Ta(e[1])?[1]:[1,-1]).forEach((function(n){r.push([[-1,e[1]],[-1,n*t[1]]],[[0,e[1]],[0,n*t[1]]],[[1,e[1]],[1,n*t[1]]])}));return r}(n,o.fixedDirection,r),s=Oi(t,e,n,r),u=Pn(Pn([],Rn(Ai(t,e,a,r,i,o)),!1),Rn(_i(t,s,o)),!1),c=yi(u,0),l=yi(u,1);return{width:{isBound:c.isBound,offset:c.offset[0]},height:{isBound:l.isBound,offset:l.offset[1]}}}function co(t,e,n,r,i,o,a,s){for(var u=Qo(t.state),c=t.props.keepRatio,l=0,f=0,p=0;p<2;++p){var d=uo(t,e(l,f),i,c,a,s),h=d.width,v=d.height,g=h.isBound,m=v.isBound,b=h.offset,x=v.offset;if(1===p&&(g||(b=0),m||(x=0)),0===p&&a&&!g&&!m)return[0,0];if(c){var y=Ta(b)*(n?1/n:1),E=Ta(x)*(r?1/r:1);(g&&m?y=0||r.push({type:"bounds",pos:t})})),d.forEach((function(t){G(i,(function(e){var n=e.type,r=e.pos;return"bounds"===n&&r===t}))>=0||i.push({type:"bounds",pos:t})})),{boundMap:c,innerBoundMap:f}}var mo=ya("",["resizable","scalable"]),bo="snapRotationThreshold",xo="snapRotationDegrees",yo={name:"snappable",dragRelation:"strong",props:["snappable","snapContainer","snapDirections","elementSnapDirections","snapGap","snapGridWidth","snapGridHeight","isDisplaySnapDigit","isDisplayInnerSnapDigit","isDisplayGridGuidelines","snapDigit","snapThreshold","snapRenderThreshold","snapGridAll",bo,xo,"horizontalGuidelines","verticalGuidelines","elementGuidelines","bounds","innerBounds","snapDistFormat","maxSnapElementGuidelineDistance","maxSnapElementGapDistance"],events:["snap","bound"],css:[":host {\n--bounds-color: #d66;\n}\n.guideline {\npointer-events: none;\nz-index: 2;\n}\n.guideline.bounds {\nbackground: #d66;\nbackground: var(--bounds-color);\n}\n.guideline-group {\nposition: absolute;\ntop: 0;\nleft: 0;\n}\n.guideline-group .size-value {\nposition: absolute;\ncolor: #f55;\nfont-size: 12px;\nfont-size: calc(12px * var(--zoom));\nfont-weight: bold;\n}\n.guideline-group.horizontal .size-value {\ntransform-origin: 50% 100%;\ntransform: translateX(-50%);\nleft: 50%;\nbottom: 5px;\nbottom: calc(2px + 3px * var(--zoom));\n}\n.guideline-group.vertical .size-value {\ntransform-origin: 0% 50%;\ntop: 50%;\ntransform: translateY(-50%);\nleft: 5px;\nleft: calc(2px + 3px * var(--zoom));\n}\n.guideline.gap {\nbackground: #f55;\n}\n.size-value.gap {\ncolor: #f55;\n}\n"],render:function(t,e){var n=t.state,r=n.top,i=n.left,o=n.pos1,a=n.pos2,s=n.pos3,u=n.pos4,c=n.snapRenderInfo,l=t.props.snapRenderThreshold,f=void 0===l?1:l;if(!c||!c.render||!ci(t,""))return Ra(t,"boundMap",{left:!1,top:!1,right:!1,bottom:!1},(function(t){return JSON.stringify(t)})),Ra(t,"innerBoundMap",{left:!1,top:!1,right:!1,bottom:!1},(function(t){return JSON.stringify(t)})),[];n.guidelines=eo(t);var p=Math.min(o[0],a[0],s[0],u[0]),d=Math.min(o[1],a[1],s[1],u[1]),h=c.externalPoses||[],v=Qo(t.state),g=[],m=[],b=[],x=[],y=[],E=Fo(v),S=E.width,D=E.height,C=E.top,w=E.left,_=E.bottom,M=E.right,O={left:w,right:M,top:C,bottom:_,center:(w+M)/2,middle:(C+_)/2},R=h.length>0,P=R?Fo(h):{};if(!c.request){if(c.direction&&y.push(bi(t,v,c.direction,f)),c.snap){var T=Fo(v);c.center&&(T.middle=(T.top+T.bottom)/2,T.center=(T.left+T.right)/2),y.push(vi(t,T,f))}R&&(c.center&&(P.middle=(P.top+P.bottom)/2,P.center=(P.left+P.right)/2),y.push(vi(t,P,f))),y.forEach((function(t){var e=t.vertical.posInfos,n=t.horizontal.posInfos;g.push.apply(g,Pn([],Rn(e.filter((function(t){return t.guidelineInfos.some((function(t){return!t.guideline.hide}))})).map((function(t){return{type:"snap",pos:t.pos}}))),!1)),m.push.apply(m,Pn([],Rn(n.filter((function(t){return t.guidelineInfos.some((function(t){return!t.guideline.hide}))})).map((function(t){return{type:"snap",pos:t.pos}}))),!1)),b.push.apply(b,Pn([],Rn(vo(e)),!1)),x.push.apply(x,Pn([],Rn(vo(n)),!1))}))}var z=go(t,[w,M],[C,_],g,m),G=z.boundMap,k=z.innerBoundMap;R&&go(t,[P.left,P.right],[P.top,P.bottom],g,m,c.externalBounds);var B=Pn(Pn([],Rn(b),!1),Rn(x),!1),A=B.filter((function(t){return t.element&&!t.gapRects})),I=B.filter((function(t){return t.gapRects})).sort((function(t,e){return t.gap-e.gap}));sa(t,"onSnap",{guidelines:B.filter((function(t){return!t.element})),elements:A,gaps:I},!0);var F=Ra(t,"boundMap",G,(function(t){return JSON.stringify(t)}),{left:!1,top:!1,right:!1,bottom:!1}),N=Ra(t,"innerBoundMap",k,(function(t){return JSON.stringify(t)}),{left:!1,top:!1,right:!1,bottom:!1});return G!==F&&k!==N||sa(t,"onBound",{bounds:G,innerBounds:k},!0),Pn(Pn(Pn(Pn(Pn(Pn([],Rn(to(t,A,[p,d],O,e)),!1),Rn(function(t,e,n,r,i){var o=[];return["horizontal","vertical"].forEach((function(a){var s=e.filter((function(t){return t.type===a})).slice(0,1),u="vertical"===a?0:1,c=u?0:1,l=u?ui:si,f=u?si:ui,p=r[l.start],d=r[l.end],h=r[f.start],v=r[f.end];s.forEach((function(e){var r=e.gap,a=e.gapRects,s=Math.max.apply(Math,Pn([h],Rn(a.map((function(t){return t.rect[f.start]}))),!1)),g=Math.min.apply(Math,Pn([v],Rn(a.map((function(t){return t.rect[f.end]}))),!1)),m=(s+g)/2;s!==g&&m!==(h+v)/2&&a.forEach((function(e){var a=e.rect,s=e.className,f=[n[0],n[1]];if(a[l.end]9),"".concat(e?"matrix3d":"matrix","(").concat(Ee(t,!e).join(","),")")}function ko(t){var e=t.clientWidth,n=t.clientHeight;if(!t)return{x:0,y:0,width:0,height:0,clientWidth:e,clientHeight:n};var r=t.viewBox,i=r&&r.baseVal||{x:0,y:0,width:0,height:0};return{x:i.x,y:i.y,width:i.width||e,height:i.height||n,clientWidth:e,clientHeight:n}}function Bo(t,e){var n,r=ko(t),i=r.width,o=r.height,a=r.clientWidth,s=r.clientHeight,u=a/i,c=s/o,l=t.preserveAspectRatio.baseVal,f=l.align,p=l.meetOrSlice,d=[0,0],h=[u,c],v=[0,0];if(1!==f){var g=(f-2)%3,m=Math.floor((f-2)/3);d[0]=i*g/2,d[1]=o*m/2;var b=2===p?Math.max(c,u):Math.min(u,c);h[0]=b,h[1]=b,v[0]=(a-i)/2*g,v[1]=(s-o)/2*m}var x=ze(h,e);return n=Rn(v,2),x[e*(e-1)]=n[0],x[e*(e-1)+1]=n[1],Co(x,e,d)}function Ao(t,e,n){return Se(t,ve(e,n),n)}function Io(t,e,n,r){return[[0,0],[e,0],[0,n],[e,n]].map((function(e){return Ao(t,e,r)}))}function Fo(t){var e=t.map((function(t){return t[0]})),n=t.map((function(t){return t[1]})),r=Math.min.apply(Math,Pn([],Rn(e),!1)),i=Math.min.apply(Math,Pn([],Rn(n),!1)),o=Math.max.apply(Math,Pn([],Rn(e),!1)),a=Math.max.apply(Math,Pn([],Rn(n),!1));return{left:r,top:i,right:o,bottom:a,width:o-r,height:a-i}}function No(t,e,n,r){return Fo(Io(t,e,n,r))}function qo(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Yo(t,e){return qo([e[0]-t[0],e[1]-t[1]])}function Xo(t,e,n,r){void 0===n&&(n=1),void 0===r&&(r=W(t,e));var i=Yo(t,e);return{transform:"translateY(-50%) translate(".concat(t[0],"px, ").concat(t[1],"px) rotate(").concat(r,"rad) scaleY(").concat(n,")"),width:"".concat(i,"px")}}function Wo(t,e){for(var n=[],r=2;r0?t[0]:t[1],e>0?t[1]:t[0])}function Vo(t,e){var n=t===rt(t)||t===nt(t),r={clientLeft:t.clientLeft,clientTop:t.clientTop,clientWidth:t.clientWidth,clientHeight:t.clientHeight,scrollWidth:t.scrollWidth,scrollHeight:t.scrollHeight,overflow:!1};return n&&(r.clientHeight=Math.max(e.height,r.clientHeight),r.scrollHeight=Math.max(e.height,r.scrollHeight)),r.overflow="visible"!==Yr(t)("overflow"),On(On({},e),r)}function Uo(t,e,n,r){var i=t.left,o=t.right,a=t.top,s=t.bottom,u=e.top,c=e.left,l={left:c+i,top:u+a,right:c+o,bottom:u+s,width:o-i,height:s-a};return n&&r?Vo(n,l):l}function $o(t,e){var n=0,r=0,i=0,o=0;if(t){var a=t.getBoundingClientRect();n=a.left,r=a.top,i=a.width,o=a.height}var s={left:n,top:r,width:i,height:o,right:n+i,bottom:r+o};return t&&e?Vo(t,s):s}function Zo(t,e,n,r){var i;if(t)i=t;else if(e)i=[0,0];else{i=Ko(n.target,r)}return i}function Ko(t,e){if(t){var n=t.getAttribute("data-rotation")||"",r=t.getAttribute("data-direction");if(e.deg=n,r){var i=[0,0];return r.indexOf("w")>-1&&(i[0]=-1),r.indexOf("e")>-1&&(i[0]=1),r.indexOf("n")>-1&&(i[1]=-1),r.indexOf("s")>-1&&(i[1]=1),i}}}function Jo(t,e){return[xe(e,t[0]),xe(e,t[1]),xe(e,t[2]),xe(e,t[3])]}function Qo(t){var e=t.left,n=t.top;return Jo([t.pos1,t.pos2,t.pos3,t.pos4],[e,n])}function ta(t,e){t[e?"controlAbles":"targetAbles"].forEach((function(e){e.unset&&e.unset(t)}))}function ea(t,e){var n=e?"controlGesto":"targetGesto",r=t[n];!1===(null==r?void 0:r.isIdle())&&ta(t,e),null==r||r.unset(),t[n]=null}function na(t,e){if(e){var n=_r(e);n.nextStyle=On(On({},n.nextStyle),t)}return{style:t,cssText:I(t).map((function(e){return"".concat(T(e,"-"),": ").concat(t[e],";")})).join("")}}function ra(t,e,n){var r=e.afterTransform||e.transform;return On(On({},na(On(On(On({},t.style),e.style),{transform:r}),n)),{afterTransform:r,transform:t.transform})}function ia(t,e,n,r){var i=e.datas;i.datas||(i.datas={});var o=On(On({},n),{target:t.state.target,clientX:e.clientX,clientY:e.clientY,inputEvent:e.inputEvent,currentTarget:t,moveable:t,datas:i.datas,isRequest:e.isRequest,isRequestChild:e.isRequestChild,isFirstDrag:!!e.isFirstDrag,isTrusted:!1!==e.isTrusted,stopAble:function(){i.isEventStart=!1},stopDrag:function(){var t;null===(t=e.stop)||void 0===t||t.call(e)}});return i.isStartEvent?r||(i.lastEvent=o):i.isStartEvent=!0,o}function oa(t,e,n){var r=e.datas,i="isDrag"in n?n.isDrag:e.isDrag;return r.datas||(r.datas={}),On(On({isDrag:i},n),{moveable:t,target:t.state.target,clientX:e.clientX,clientY:e.clientY,inputEvent:e.inputEvent,currentTarget:t,lastEvent:r.lastEvent,isDouble:e.isDouble,datas:r.datas,isFirstDrag:!!e.isFirstDrag})}function aa(t,e,n){t._emitter.on(e,n)}function sa(t,e,n,r,i){return t.triggerEvent(e,n,r,i)}function ua(t,e){return it(t).getComputedStyle(t,e)}function ca(t,e,n){var r={},i={};return t.filter((function(t){var o=t.name;if(r[o]||!e.some((function(e){return t[e]})))return!1;if(!n&&t.ableGroup){if(i[t.ableGroup])return!1;i[t.ableGroup]=!0}return r[o]=!0,!0}))}function la(t,e){return t===e||null==t&&null==e}function fa(t,e){var n=[],r=[];return t.forEach((function(i,o){var a=e(i,o,t),s=r.indexOf(a),u=n[s]||[];-1===s&&(r.push(a),n.push(u)),u.push(i)})),n}function pa(t){return t.reduce((function(t,e){return t.concat(e)}),[])}function da(){for(var t=[],e=0;eMath.PI/2*3?g-m:g-(m+=Math.PI))>2*Math.PI?b-=2*Math.PI:b>Math.PI?b=2*Math.PI-b:b<-Math.PI&&(b=-2*Math.PI-b);var x=qo([h+e[0],v+e[1]])*Math.cos(b);u=x*Math.sin(m)-h,c=x*Math.cos(m)-v,r[0]<0&&(u*=-1),r[1]<0&&(c*=-1)}else c=(u=d)/n;else u=(c=d)*n}else u=r[0]*e[0],c=r[1]*e[1];return[u,c]}function wa(t,e,n,r){var i,o=n.ratio,a=n.startOffsetWidth,s=n.startOffsetHeight,u=0,c=0,l=r.distX,f=r.distY,p=r.pinchScale,d=r.parentDistance,h=r.parentDist,v=r.parentScale,g=n.fixedDirection,m=[0,1].map((function(e){return Ta(t[e]-g[e])})),b=[0,1].map((function(t){var e=m[t];return 0!==e&&(e=2/e),e}));if(h)u=h[0],c=h[1],e&&(u?c||(c=u/o):u=c*o);else if(S(p))u=(p-1)*a,c=(p-1)*s;else if(v)u=(v[0]-1)*a,c=(v[1]-1)*s;else if(d){var x=a*m[0],y=s*m[1],E=qo([x,y]);u=d/E*x*b[0],c=d/E*y*b[1]}else{var D=mr({datas:n,distX:l,distY:f});D=b.map((function(t,e){return D[e]*t})),u=(i=Rn(Ca([a,s],D,o,t,e),2))[0],c=i[1]}return{distWidth:u,distHeight:c}}function _a(t,e){if(e){if("left"===t)return{x:"0%",y:"50%"};if("top"===t)return{x:"50%",y:"50%"};if("center"===t)return{x:"50%",y:"50%"};if("right"===t)return{x:"100%",y:"50%"};if("bottom"===t)return{x:"50%",y:"100%"};var n=Rn(t.split(" "),2),r=n[0],i=n[1],o=_a(r||""),a=_a(i||""),s=On(On({},o),a),u={x:"50%",y:"50%"};return s.x&&(u.x=s.x),s.y&&(u.y=s.y),s.value&&(s.x&&!s.y&&(u.y=s.value),!s.x&&s.y&&(u.x=s.value)),u}return"left"===t?{x:"0%"}:"right"===t?{x:"100%"}:"top"===t?{y:"0%"}:"bottom"===t?{y:"100%"}:t?"center"===t?{value:"50%"}:{value:t}:{}}function Ma(t,e,n){var r=_a(t,!0),i=r.x,o=r.y;return[F(i,e)||0,F(o,n)||0]}function Oa(t,e){return t.length===e.length&&t.every((function(t,n){var r=e[n],i=y(t),o=y(r);return i&&o?Oa(t,r):!i&&!o&&t===r}))}function Ra(t,e,n,r,i){var o=t._store,a=o[e];if(!(e in o)){if(null==i)return o[e]=n,n;o[e]=i,a=i}return a===n||r(a)===r(n)?a:(o[e]=n,n)}function Pa(t){return t>=0?1:-1}function Ta(t){return Math.abs(t)}function za(t,e){return function(t){for(var e=[],n=0;n-1}))).filter((function(t){return t.canPinch&&t[l]})),p=ia(t,e,{});r&&(p.targets=r);var d=sa(t,c,p);n.isPinch=!1!==d,n.ables=f;var h=n.isPinch;return!!h&&(f.forEach((function(n){if(o[n.name]=o[n.name]||{},n[l]){var r=On(On({},e),{datas:o[n.name],parentRotate:i,isPinch:!0});n[l](t,r)}})),t.state.snapRenderInfo={request:e.isRequest,direction:[0,0]},h)},pinch:function(t,e){var n=e.datas,r=e.scale,i=e.distance,o=e.originalDatas,a=e.inputEvent,s=e.targets,u=e.angle;if(n.isPinch){var c=i*(1-1/r),l=ia(t,e,{});s&&(l.targets=s);var f="onPinch".concat(s?"Group":"");sa(t,f,l);var p=n.ables,d="drag".concat(s?"Group":"","Control");return p.forEach((function(n){n[d]&&n[d](t,On(On({},e),{datas:o[n.name],inputEvent:a,resolveMatrix:!0,pinchScale:r,parentDistance:c,parentRotate:u,isPinch:!0}))})),l}},pinchEnd:function(t,e){var n=e.datas,r=e.isPinch,i=e.inputEvent,o=e.targets,a=e.originalDatas;if(n.isPinch){var s="onPinch".concat(o?"Group":"","End"),u=oa(t,e,{isDrag:r});o&&(u.targets=o),sa(t,s,u);var c=n.ables,l="drag".concat(o?"Group":"","ControlEnd");return c.forEach((function(n){n[l]&&n[l](t,On(On({},e),{isDrag:r,datas:a[n.name],inputEvent:i,isPinch:!0}))})),r}},pinchGroupStart:function(t,e){return this.pinchStart(t,On(On({},e),{targets:t.props.targets}))},pinchGroup:function(t,e){return this.pinch(t,On(On({},e),{targets:t.props.targets}))},pinchGroupEnd:function(t,e){return this.pinchEnd(t,On(On({},e),{targets:t.props.targets}))}}),Ba=ya("scalable"),Aa={name:"scalable",ableGroup:"size",canPinch:!0,props:["scalable","throttleScale","renderDirections","keepRatio","edge","displayAroundControls"],events:["scaleStart","beforeScale","scale","scaleEnd","scaleGroupStart","beforeScaleGroup","scaleGroup","scaleGroupEnd"],render:Zr("scalable"),dragControlCondition:Ba,viewClassName:xa("scalable"),dragControlStart:function(t,e){var n=e.datas,r=e.isPinch,i=e.inputEvent,o=Zo(e.parentDirection,r,i,n),a=t.state,s=a.width,u=a.height,c=a.targetTransform,l=a.target,f=a.pos1,p=a.pos2,d=a.pos4;if(!o||!l)return!1;r||fr(t,e),n.datas={},n.transform=c,n.prevDist=[1,1],n.direction=o,n.startOffsetWidth=s,n.startOffsetHeight=u,n.startValue=[1,1];var h=!o[0]&&!o[1]||o[0]||!o[1];function v(t){n.ratio=t&&isFinite(t)?t:0}function g(t){var e=Ni(n.startPositions,t);n.fixedDirection=e.fixedDirection,n.fixedPosition=e.fixedPosition,n.fixedOffset=e.fixedOffset}Dr(t,e,"scale"),n.isWidth=h,n.startPositions=Qo(t.state),n.setFixedDirection=g,v(H(f,p)/H(p,d)),g([-o[0],-o[1]]);var m=function(t){n.minScaleSize=t},b=function(t){n.maxScaleSize=t};m([-1/0,-1/0]),b([1/0,1/0]);var x=ia(t,e,On(On({direction:o,set:function(t){n.startValue=t},setRatio:v,setFixedDirection:g,setMinScaleSize:m,setMaxScaleSize:b},Sr(t,e)),{dragStart:Fi.dragStart(t,(new ur).dragStart([0,0],e))})),y=sa(t,"onScaleStart",x);return n.startFixedDirection=n.fixedDirection,!1!==y&&(n.isScale=!0,t.state.snapRenderInfo={request:e.isRequest,direction:o}),!!n.isScale&&x},dragControl:function(t,e){pr(t,e,"scale");var n=e.datas,r=e.parentKeepRatio,i=e.parentFlag,o=e.isPinch,a=e.dragClient,s=e.isRequest,u=e.useSnap,c=e.resolveMatrix,l=n.prevDist,f=n.direction,p=n.startOffsetWidth,d=n.startOffsetHeight,h=n.isScale,v=n.startValue,g=n.isWidth,m=n.ratio;if(!h)return!1;var b=t.props,x=b.throttleScale,E=b.parentMoveable,S=f;f[0]||f[1]||(S=[1,1]);var D=m&&(null!=r?r:b.keepRatio)||!1,C=t.state,w=[v[0],v[1]];function _(){var t=wa(S,D,n,e),r=t.distWidth,i=t.distHeight,o=p?(p+r)/p:1,a=d?(d+i)/d:1;v[0]||(w[0]=r/p),v[1]||(w[1]=i/d);var s=(S[0]||D?o:1)*w[0],u=(S[1]||D?a:1)*w[1];return 0===s&&(s=Pa(l[0])*tr),0===u&&(u=Pa(l[1])*tr),[s,u]}var M=_();if(!o&&t.props.groupable){var O=(C.snapRenderInfo||{}).direction;y(O)&&(O[0]||O[1])&&(C.snapRenderInfo={direction:f,request:e.isRequest})}sa(t,"onBeforeScale",ia(t,e,{scale:M,setFixedDirection:function(t){return n.setFixedDirection(t),M=_()},startFixedDirection:n.startFixedDirection,setScale:function(t){M=t}},!0));var R,P,T=[M[0]/w[0],M[1]/w[1]],z=a,G=[0,0],k=Pa(T[0]*T[1]),B=!a&&!i&&o;if(B||c?z=Tr(t,n.targetAllTransform,[0,0],[0,0],n):a||(z=n.fixedPosition),o||(G=ho(t,T,f,!u&&s,n)),D){S[0]&&S[1]&&G[0]&&G[1]&&(Math.abs(G[0]*p)>Math.abs(G[1]*d)?G[1]=0:G[0]=0);var A=!G[0]&&!G[1];if(A&&(g?T[0]=L(T[0]*w[0],x)/w[0]:T[1]=L(T[1]*w[1],x)/w[1]),S[0]&&!S[1]||G[0]&&!G[1]||A&&g){T[0]+=G[0];var I=p*T[0]*w[0]/m;T[1]=Pa(k*T[0])*Ta(I/d/w[1])}else if(!S[0]&&S[1]||!G[0]&&G[1]||A&&!g){T[1]+=G[1];var F=d*T[1]*w[1]*m;T[0]=Pa(k*T[1])*Ta(F/p/w[0])}}else T[0]+=G[0],T[1]+=G[1],G[0]||(T[0]=L(T[0]*w[0],x)/w[0]),G[1]||(T[1]=L(T[1]*w[1],x)/w[1]);0===T[0]&&(T[0]=Pa(l[0])*tr),0===T[1]&&(T[1]=Pa(l[1])*tr),R=T,P=[w[0],w[1]],M=[R[0]*P[0],R[1]*P[1]];var N=[p,d],q=[p*M[0],d*M[1]];q=Y(q,n.minScaleSize,n.maxScaleSize,!!D&&m),M=za(2,(function(t){return N[t]?q[t]/N[t]:q[t]})),T=za(2,(function(t){return M[t]/w[t]}));var X=za(2,(function(t){return l[t]?T[t]/l[t]:T[t]})),W="scale(".concat(T.join(", "),")"),j="scale(".concat(M.join(", "),")"),H=dr(n,j,W),V=!v[0]||!v[1],U=function(t,e,n,r,i,o,a){return zr(t,e,n,r,i,o,a)}(t,V?j:W,n.fixedDirection,z,n.fixedOffset,n,V),$=B?U:ye(U,n.prevInverseDist||[0,0]);if(n.prevDist=T,n.prevInverseDist=U,M[0]===l[0]&&M[1]===l[1]&&$.every((function(t){return!t}))&&!E&&!B)return!1;var Z=ia(t,e,On({offsetWidth:p,offsetHeight:d,direction:f,scale:M,dist:T,delta:X,isPinch:!!o},Pr(t,H,$,o,e)));return sa(t,"onScale",Z),Z},dragControlEnd:function(t,e){var n=e.datas;if(!n.isScale)return!1;n.isScale=!1;var r=oa(t,e,{});return sa(t,"onScaleEnd",r),r},dragGroupControlCondition:Ba,dragGroupControlStart:function(t,e){var n=e.datas,r=this.dragControlStart(t,e);if(!r)return!1;var i=Xr(t,"resizable",e);n.moveableScale=t.scale;var o=jr(t,this,"dragControlStart",e,(function(e,r){return Hr(t,e,n,r)})),a=function(e){r.setFixedDirection(e),o.forEach((function(r,o){r.setFixedDirection(e),Hr(t,r.moveable,n,i[o])}))};n.setFixedDirection=a;var s=On(On({},r),{targets:t.props.targets,events:o,setFixedDirection:a}),u=sa(t,"onScaleGroupStart",s);return n.isScale=!1!==u,!!n.isScale&&s},dragGroupControl:function(t,e){var n=e.datas;if(n.isScale){aa(t,"onBeforeScale",(function(n){sa(t,"onBeforeScaleGroup",ia(t,e,On(On({},n),{targets:t.props.targets}),!0))}));var r=this.dragControl(t,e);if(r){var i=r.dist,o=n.moveableScale;t.scale=[i[0]*o[0],i[1]*o[1]];var a=t.props.keepRatio,s=n.fixedPosition,u=jr(t,this,"dragControl",e,(function(e,n){var r=Rn(Se(Pe(t.rotation/180*Math.PI,3),[n.datas.originalX*i[0],n.datas.originalY*i[1],1],3),2),o=r[0],u=r[1];return On(On({},n),{parentDist:null,parentScale:i,parentKeepRatio:a,dragClient:xe(s,[o,u])})})),c=On({targets:t.props.targets,events:u},r);return sa(t,"onScaleGroup",c),c}}},dragGroupControlEnd:function(t,e){var n=e.isDrag;if(e.datas.isScale){this.dragControlEnd(t,e);var r=jr(t,this,"dragControlEnd",e);return sa(t,"onScaleGroupEnd",oa(t,e,{targets:t.props.targets,events:r})),n}},request:function(){var t={},e=0,n=0,r=!1;return{isControl:!0,requestStart:function(e){return r=e.useSnap,{datas:t,parentDirection:e.direction||[1,1],useSnap:r}},request:function(i){return e+=i.deltaWidth,n+=i.deltaHeight,{datas:t,parentDist:[e,n],parentKeepRatio:i.keepRatio,useSnap:r}},requestEnd:function(){return{datas:t,isDrag:!0,useSnap:r}}}}};function Ia(t,e){return t.map((function(t,n){return m(t,e[n],1,2)}))}function Fa(t,e,n){var r=W(t,e),i=W(t,n)-r;return i>=0?i:i+2*Math.PI}var Na={name:"warpable",ableGroup:"size",props:["warpable","renderDirections","edge","displayAroundControls"],events:["warpStart","warp","warpEnd"],viewClassName:xa("warpable"),render:function(t,e){var n=t.props,r=n.resizable,i=n.scalable,o=n.warpable,a=n.zoom;if(r||i||!o)return[];var s=t.state,u=s.pos1,c=s.pos2,l=s.pos3,f=s.pos4,p=Ia(u,c),d=Ia(c,u),h=Ia(u,l),v=Ia(l,u),g=Ia(l,f),m=Ia(f,l),b=Ia(c,f),x=Ia(f,c);return Pn([e.createElement("div",{className:Eo("line"),key:"middeLine1",style:Xo(p,g,a)}),e.createElement("div",{className:Eo("line"),key:"middeLine2",style:Xo(d,m,a)}),e.createElement("div",{className:Eo("line"),key:"middeLine3",style:Xo(h,b,a)}),e.createElement("div",{className:Eo("line"),key:"middeLine4",style:Xo(v,x,a)})],Rn(Kr(t,"warpable",e)),!1)},dragControlCondition:function(t,e){if(e.isRequest)return!1;var n=e.inputEvent.target;return Z(n,Eo("direction"))&&Z(n,Eo("warpable"))},dragControlStart:function(t,e){var n=e.datas,r=e.inputEvent,i=t.props.target,o=Ko(r.target,n);if(!o||!i)return!1;var a=t.state,s=a.transformOrigin,u=a.is3d,c=a.targetTransform,l=a.targetMatrix,f=a.width,p=a.height,d=a.left,h=a.top;return n.datas={},n.targetTransform=c,n.warpTargetMatrix=u?l:ge(l,3,4),n.targetInverseMatrix=pe(de(n.warpTargetMatrix,4),3,4),n.direction=o,n.left=d,n.top=h,n.poses=[[0,0],[f,0],[0,p],[f,p]].map((function(t){return ye(t,s)})),n.nextPoses=n.poses.map((function(t){var e=Rn(t,2),r=e[0],i=e[1];return Se(n.warpTargetMatrix,[r,i,0,1],4)})),n.startValue=Te(4),n.prevMatrix=Te(4),n.absolutePoses=Qo(a),n.posIndexes=br(o),fr(t,e),Dr(t,e,"matrix3d"),a.snapRenderInfo={request:e.isRequest,direction:o},!1!==sa(t,"onWarpStart",ia(t,e,On({set:function(t){n.startValue=t}},Sr(t,e))))&&(n.isWarp=!0),n.isWarp},dragControl:function(t,e){var n=e.datas,r=e.isRequest,i=e.distX,o=e.distY,a=n.targetInverseMatrix,s=n.prevMatrix,u=n.isWarp,c=n.startValue,l=n.poses,f=n.posIndexes,p=n.absolutePoses;if(!u)return!1;if(pr(t,e,"matrix3d"),ci(t,"warpable")){var d=f.map((function(t){return p[t]}));d.length>1&&d.push([(d[0][0]+d[1][0])/2,(d[0][1]+d[1][1])/2]);var h=ki(t,r,{horizontal:d.map((function(t){return t[1]+o})),vertical:d.map((function(t){return t[0]+i}))}),v=h.horizontal,g=h.vertical;o-=v.offset,i-=g.offset}var m=mr({datas:n,distX:i,distY:o},!0),b=n.nextPoses.slice();if(f.forEach((function(t){b[t]=xe(b[t],m)})),!Kn.every((function(t){return e=t.map((function(t){return l[t]})),n=t.map((function(t){return b[t]})),r=Fa(e[0],e[1],e[2]),i=Fa(n[0],n[1],n[2]),o=Math.PI,!(r>=o&&i<=o||r<=o&&i>=o);var e,n,r,i,o})))return!1;var x=ke(l[0],l[2],l[1],l[3],b[0],b[2],b[1],b[3]);if(!x.length)return!1;var y=vr(n,be(a,x,4),!0),E=be(de(s,4),y,4);n.prevMatrix=y;var S=be(c,y,4),D=dr(n,"matrix3d(".concat(S.join(", "),")"),"matrix3d(".concat(y.join(", "),")"));return wr(e,D),sa(t,"onWarp",ia(t,e,On({delta:E,matrix:S,dist:y,multiply:be,transform:D},na({transform:D},e)))),!0},dragControlEnd:function(t,e){var n=e.datas,r=e.isDrag;return!!n.isWarp&&(n.isWarp=!1,sa(t,"onWarpEnd",oa(t,e,{})),r)}},qa=Eo("area-pieces"),Ya=Eo("area-piece"),Xa=Eo("avoid"),Wa=Eo("view-dragging");function ja(t){var e=t.areaElement;if(e){var n=t.state,r=n.width,i=n.height;J(e,Xa),e.style.cssText+="left: 0px; top: 0px; width: ".concat(r,"px; height: ").concat(i,"px")}}function Ha(t){return t.createElement("div",{key:"area_pieces",className:qa},t.createElement("div",{className:Ya}),t.createElement("div",{className:Ya}),t.createElement("div",{className:Ya}),t.createElement("div",{className:Ya}))}var La={name:"dragArea",props:["dragArea","passDragArea"],events:["click","clickGroup"],render:function(t,e){var n=t.props,r=n.target,o=n.dragArea,a=n.groupable,s=n.passDragArea,u=t.getState(),c=u.width,l=u.height,f=u.renderPoses,p=s?Eo("area","pass"):Eo("area");if(a)return[e.createElement("div",{key:"area",ref:i(t,"areaElement"),className:p}),Ha(e)];if(!r||!o)return[];var d=ke([0,0],[c,0],[0,l],[c,l],f[0],f[1],f[2],f[3]),h=d.length?Go(d,!0):"none";return[e.createElement("div",{key:"area",ref:i(t,"areaElement"),className:p,style:{top:"0px",left:"0px",width:"".concat(c,"px"),height:"".concat(l,"px"),transformOrigin:"0 0",transform:h}}),Ha(e)]},dragStart:function(t,e){var n=e.datas,r=e.clientX,i=e.clientY;if(!e.inputEvent)return!1;n.isDragArea=!1;var o=t.areaElement,a=t.state,s=a.moveableClientRect,u=a.renderPoses,c=a.rootMatrix,l=a.is3d,f=s.left,p=s.top,d=Fo(u),h=d.left,v=d.top,g=d.width,m=d.height,b=Rn(ha(c,[r-f,i-p],l?4:3),2),x=b[0],y=b[1],E=[{left:h,top:v,width:g,height:(y-=v)-10},{left:h,top:v,width:(x-=h)-10,height:m},{left:h,top:v+y+10,width:g,height:m-y-10},{left:h+x+10,top:v,width:g-x-10,height:m}],S=[].slice.call(o.nextElementSibling.children);E.forEach((function(t,e){S[e].style.cssText="left: ".concat(t.left,"px;top: ").concat(t.top,"px; width: ").concat(t.width,"px; height: ").concat(t.height,"px;")})),K(o,Xa),a.disableNativeEvent=!0},drag:function(t,e){var n=e.datas,r=e.inputEvent;if(this.enableNativeEvent(t),!r)return!1;n.isDragArea||(n.isDragArea=!0,ja(t))},dragEnd:function(t,e){this.enableNativeEvent(t);var n=e.inputEvent,r=e.datas;if(!n)return!1;r.isDragArea||ja(t)},dragGroupStart:function(t,e){return this.dragStart(t,e)},dragGroup:function(t,e){return this.drag(t,e)},dragGroupEnd:function(t,e){return this.dragEnd(t,e)},unset:function(t){ja(t),t.state.disableNativeEvent=!1},enableNativeEvent:function(t){var e=t.state;e.disableNativeEvent&&B((function(){e.disableNativeEvent=!1}))}},Va=Tn("origin",{props:["origin","svgOrigin"],render:function(t,e){var n,r=t.props,i=r.zoom,o=r.svgOrigin,a=r.groupable,s=t.getState(),u=s.beforeOrigin,c=s.rotation,l=s.svg,f=s.allMatrix,p=s.is3d,d=s.left,h=s.top,v=s.offsetWidth,g=s.offsetHeight;if(!a&&l&&o){var m=Rn(Ma(o,v,g),2);n=Wo(c,i,ye(Ao(f,[m[0],m[1]],p?4:3),[d,h]))}else n=Wo(c,i,u);return[e.createElement("div",{className:Eo("control","origin"),style:n,key:"beforeOrigin"})]}});function Ua(t){var e=t.scrollContainer;return[e.scrollLeft,e.scrollTop]}var $a={name:"scrollable",canPinch:!0,props:["scrollable","scrollContainer","scrollThreshold","scrollThrottleTime","getScrollPosition","scrollOptions"],events:["scroll","scrollGroup"],dragRelation:"strong",dragStart:function(t,e){var n=t.props,r=n.scrollContainer,i=void 0===r?t.getContainer():r,o=n.scrollOptions,a=new Je,s=Ea(i,!0);e.datas.dragScroll=a,t.state.dragScroll=a;var u=e.isControl?"controlGesto":"targetGesto",c=e.targets;a.on("scroll",(function(n){var r=n.container,i=n.direction,o=ia(t,e,{scrollContainer:r,direction:i}),a=c?"onScrollGroup":"onScroll";c&&(o.targets=c),sa(t,a,o)})).on("move",(function(e){var n=e.offsetX,r=e.offsetY,i=e.inputEvent;t[u].scrollBy(n,r,i.inputEvent,!1)})).on("scrollDrag",(function(e){(0,e.next)(t[u].getCurrentEvent())})),a.dragStart(e,On({container:s},o))},checkScroll:function(t,e){var n=e.datas.dragScroll;if(n){var r=t.props,i=r.scrollContainer,o=void 0===i?t.getContainer():i,a=r.scrollThreshold,s=void 0===a?0:a,u=r.scrollThrottleTime,c=void 0===u?0:u,l=r.getScrollPosition,f=void 0===l?Ua:l,p=r.scrollOptions;return n.drag(e,On({container:o,threshold:s,throttleTime:c,getScrollPosition:function(t){return f({scrollContainer:t.container,direction:t.direction})}},p)),!0}},drag:function(t,e){return this.checkScroll(t,e)},dragEnd:function(t,e){e.datas.dragScroll.dragEnd(),e.datas.dragScroll=null},dragControlStart:function(t,e){return this.dragStart(t,On(On({},e),{isControl:!0}))},dragControl:function(t,e){return this.drag(t,e)},dragControlEnd:function(t,e){return this.dragEnd(t,e)},dragGroupStart:function(t,e){return this.dragStart(t,On(On({},e),{targets:t.props.targets}))},dragGroup:function(t,e){return this.drag(t,On(On({},e),{targets:t.props.targets}))},dragGroupEnd:function(t,e){return this.dragEnd(t,On(On({},e),{targets:t.props.targets}))},dragGroupControlStart:function(t,e){return this.dragStart(t,On(On({},e),{targets:t.props.targets,isControl:!0}))},dragGroupControl:function(t,e){return this.drag(t,On(On({},e),{targets:t.props.targets}))},dragGroupControEnd:function(t,e){return this.dragEnd(t,On(On({},e),{targets:t.props.targets}))},unset:function(t){var e,n=t.state;null===(e=n.dragScroll)||void 0===e||e.dragEnd(),n.dragScroll=null}},Za={name:"",props:["target","dragTargetSelf","dragTarget","dragContainer","container","warpSelf","rootContainer","useResizeObserver","useMutationObserver","zoom","dragFocusedInput","transformOrigin","ables","className","pinchThreshold","pinchOutside","triggerAblesSimultaneously","checkInput","cspNonce","translateZ","hideDefaultLines","props","flushSync","stopPropagation","preventClickEventOnDrag","preventClickDefault","viewContainer","persistData","useAccuratePosition","firstRenderState","linePadding","controlPadding","preventDefault","requestStyles"],events:["changeTargets"]},Ka=Tn("padding",{props:["padding"],render:function(t,e){var n=t.props;if(n.dragArea)return[];var r=Ga(n.padding||{}),i=r.left,o=r.top,a=r.right,s=r.bottom,u=t.getState(),c=u.renderPoses,l=[u.pos1,u.pos2,u.pos3,u.pos4],f=[];return i>0&&f.push([0,2]),o>0&&f.push([0,1]),a>0&&f.push([1,3]),s>0&&f.push([2,3]),f.map((function(t,n){var r=Rn(t,2),i=r[0],o=r[1],a=ke([0,0],[100,0],[0,100],[100,100],l[i],l[o],c[i],c[o]);if(a.length)return e.createElement("div",{key:"padding".concat(n),className:Eo("padding"),style:{transform:Go(a,!0)}})}))}}),Ja=["nw","ne","se","sw"];function Qa(t,e){var n=t[0]+t[1],r=n>e?e/n:1;return t[0]*=r,t[1]=e-t[1]*r,t}var ts=[1,2,5,6],es=[0,3,4,7],ns=[1,-1,-1,1],rs=[1,1,-1,-1];function is(t,e,n,r,i,o,a,s){void 0===i&&(i=0),void 0===o&&(o=0),void 0===a&&(a=n),void 0===s&&(s=r);var u=[],c=!1,l=t.filter((function(t){return!t.virtual})),f=l.map((function(t){var l=t.horizontal,f=t.vertical,p=t.pos;if(f&&!c&&(c=!0,u.push("/")),c){var d=Math.max(0,1===f?p[1]-o:s-p[1]);return u.push(ma(d,r,e)),d}d=Math.max(0,1===l?p[0]-i:a-p[0]);return u.push(ma(d,n,e)),d}));return{radiusPoses:l,styles:u,raws:f}}function os(t){for(var e=[0,0],n=[0,0],r=t.length,i=0;i-1?t.slice(0,f):t).length,d=t.slice(0,p),h=t.slice(p+1),v=d.length,g=h.length,m=g>0,b=Rn(d,4),x=b[0],y=void 0===x?"0px":x,E=b[1],S=void 0===E?y:E,D=b[2],C=void 0===D?y:D,w=b[3],_=void 0===w?S:w,M=Rn(h,4),O=M[0],R=void 0===O?y:O,P=M[1],T=void 0===P?m?R:S:P,z=M[2],G=void 0===z?m?R:C:z,k=M[3],B=void 0===k?m?T:_:k,A=[y,S,C,_].map((function(t){return F(t,e)})),I=[R,T,G,B].map((function(t){return F(t,n)})),N=A.slice(),q=I.slice();s=Rn(Qa([N[0],N[1]],e),2),N[0]=s[0],N[1]=s[1],u=Rn(Qa([N[3],N[2]],e),2),N[3]=u[0],N[2]=u[1],c=Rn(Qa([q[0],q[3]],n),2),q[0]=c[0],q[3]=c[1],l=Rn(Qa([q[1],q[2]],n),2),q[1]=l[0],q[2]=l[1];var Y=a?N:N.slice(0,Math.max(o[0],v)),X=a?q:q.slice(0,Math.max(o[1],g));return Pn(Pn([],Rn(Y.map((function(t,e){var o=Ja[e];return{virtual:e>=v,horizontal:ns[e],vertical:0,pos:[r+t,i+(-1===rs[e]?n:0)],sub:!0,raw:A[e],direction:o}}))),!1),Rn(X.map((function(t,n){var o=Ja[n];return{virtual:n>=g,horizontal:0,vertical:rs[n],pos:[r+(-1===ns[n]?e:0),i+t],sub:!0,raw:I[n],direction:o}}))),!1)}var ss=[[0,-1,"n"],[1,0,"e"]],us=[[-1,-1,"nw"],[0,-1,"n"],[1,-1,"ne"],[1,0,"e"],[1,1,"se"],[0,1,"s"],[-1,1,"sw"],[-1,0,"w"]];function cs(t,e,n){var r=t.props.clipRelative,i=t.state,o=i.width,a=i.height,s=e,u=s.type,c=s.poses,l="rect"===u,f="circle"===u;if("polygon"===u)return n.map((function(t){return"".concat(ma(t[0],o,r)," ").concat(ma(t[1],a,r))}));if(l||"inset"===u){var p=n[1][1],d=n[3][0],h=n[7][0],v=n[5][1];if(l)return[p,d,v,h].map((function(t){return"".concat(t,"px")}));var g=[p,o-d,a-v,h].map((function(t,e){return ma(t,e%2?o:a,r)}));if(n.length>8){var m=Rn(ye(n[4],n[0]),2),b=m[0],x=m[1];g.push.apply(g,Pn(["round"],Rn(is(c.slice(8).map((function(t,e){return On(On({},t),{pos:n[e]})})),r,b,x,h,p,d,v).styles),!1))}return g}if(f||"ellipse"===u){var y=n[0],E=ma(Ta(n[1][1]-y[1]),f?Math.sqrt((o*o+a*a)/2):a,r);return(g=f?[E]:[ma(Ta(n[2][0]-y[0]),o,r),E]).push("at",ma(y[0],o,r),ma(y[1],a,r)),g}}function ls(t,e,n,r){var i=[r,(r+e)/2,e],o=[t,(t+n)/2,n];return us.map((function(t){var e=Rn(t,3),n=e[0],r=e[1],a=e[2],s=i[n+1],u=o[r+1];return{vertical:Ta(r),horizontal:Ta(n),direction:a,pos:[s,u]}}))}function fs(t){var e=[1/0,-1/0],n=[1/0,-1/0];return t.forEach((function(t){var r=t.pos;e[0]=Math.min(e[0],r[0]),e[1]=Math.max(e[1],r[0]),n[0]=Math.min(n[0],r[1]),n[1]=Math.max(n[1],r[1])})),[Ta(e[1]-e[0]),Ta(n[1]-n[0])]}function ps(t,e,n,r,i){var o,a,s,u,c,l,f,p,d;if(t){var h=i;if(!h){var v=Yr(t),g=v("clipPath");h="none"!==g?g:v("clip")}if(h&&"none"!==h&&"auto"!==h||(h=r)){var m=R(h),b=m.prefix,x=void 0===b?h:b,y=m.value,E=void 0===y?"":y,S="circle"===x,D=" ";if("polygon"===x){D=",";var C=(k=O(E||"0% 0%, 100% 0%, 100% 100%, 0% 100%")).map((function(t){var r=Rn(t.split(" "),2),i=r[0],o=r[1];return{vertical:1,horizontal:1,pos:[F(i,e),F(o,n)]}})),w=nn(C.map((function(t){return t.pos})));return{type:x,clipText:h,poses:C,splitter:D,left:w.minX,right:w.maxX,top:w.minY,bottom:w.maxY}}if(S||"ellipse"===x){var _="",T="",z=0,G=0,k=M(E);if(S){var B;B=void 0===(a=(o=Rn(k,4))[0])?"50%":a,_=void 0===(s=o[2])?"50%":s,T=void 0===(u=o[3])?"50%":u,z=F(B,Math.sqrt((e*e+n*n)/2)),G=z}else{var A,I;A=void 0===(l=(c=Rn(k,5))[0])?"50%":l,I=void 0===(f=c[1])?"50%":f,_=void 0===(p=c[3])?"50%":p,T=void 0===(d=c[4])?"50%":d,z=F(A,e),G=F(I,n)}var N=[F(_,e),F(T,n)];C=Pn([{vertical:1,horizontal:1,pos:N,direction:"nesw"}],Rn(ss.slice(0,S?1:2).map((function(t){return{vertical:Ta(t[1]),horizontal:t[0],direction:t[2],sub:!0,pos:[N[0]+t[0]*z,N[1]+t[1]*G]}}))),!1);return{type:x,clipText:h,radiusX:z,radiusY:G,left:N[0]-z,top:N[1]-G,right:N[0]+z,bottom:N[1]+G,poses:C,splitter:D}}if("inset"===x){var q=(k=M(E||"0 0 0 0")).indexOf("round"),Y=(q>-1?k.slice(0,q):k).length,X=k.slice(Y+1),W=Rn(k.slice(0,Y),4),j=W[0],H=W[1],L=void 0===H?j:H,V=W[2],U=void 0===V?j:V,$=W[3],Z=void 0===$?L:$,K=Rn([j,U].map((function(t){return F(t,n)})),2),J=K[0],Q=K[1],tt=Rn([Z,L].map((function(t){return F(t,e)})),2),et=tt[0],nt=tt[1],rt=e-nt,it=n-Q,ot=as(X,rt-et,it-J,et,J);return{type:"inset",clipText:h,poses:C=Pn(Pn([],Rn(ls(J,rt,it,et)),!1),Rn(ot),!1),top:J,left:et,right:rt,bottom:it,radius:X,splitter:D}}if("rect"===x){D=",";var at=Rn((k=O(E||"0px, ".concat(e,"px, ").concat(n,"px, 0px"))).map((function(t){return P(t).value})),4),st=at[0];return{type:"rect",clipText:h,poses:C=ls(st,nt=at[1],Q=at[2],et=at[3]),top:st,right:nt,bottom:Q,left:et,values:k,splitter:D}}}}}function ds(t,e){var n=Rn(lr(t,e),2),r=n[0],i=n[1],o=e.datas,a=o.clipPath,s=o.clipIndex,u=a,c=u.type,l=u.poses,f=u.splitter,p=l.map((function(t){return t.pos}));if("polygon"===c)p.splice(s,0,[r,i]);else{if("inset"!==c)return;var d=ts.indexOf(s),h=es.indexOf(s),v=l.length;if(function(t,e,n,r,i,o,a,s,u,c,l){void 0===c&&(c=0),void 0===l&&(l=0);var f=os(t.slice(n)),p=f.horizontalRange,d=f.verticalRange;if(r>-1)for(var h=1===ns[r]?o-c:s-o,v=p[1];v<=r;++v){var g=1===rs[v]?l:u,m=0;if(r===v?m=o:0===v?m=c+h:-1===ns[v]&&(m=s-(e[n][0]-c)),t.splice(n+v,0,{horizontal:ns[v],vertical:0,pos:[m,g]}),e.splice(n+v,0,[m,g]),0===v)break}else if(i>-1){var b=1===rs[i]?a-l:u-a;if(0===p[1]&&0===d[1]){var x=[c+b,l];t.push({horizontal:ns[0],vertical:0,pos:x}),e.push(x)}var y=d[0];for(v=d[1];v<=i&&(m=1===ns[v]?c:s,g=0,i===v?g=a:0===v?g=l+b:1===rs[v]?g=e[n+y][1]:-1===rs[v]&&(g=u-(e[n+y][1]-l)),t.push({horizontal:0,vertical:rs[v],pos:[m,g]}),e.push([m,g]),0!==v);++v);}}(l,p,8,d,h,r,i,p[4][0],p[4][1],p[0][0],p[0][1]),v===l.length)return}var g=cs(t,a,p),m="".concat(c,"(").concat(g.join(f),")");sa(t,"onClip",ia(t,e,On({clipEventType:"added",clipType:c,poses:p,clipStyles:g,clipStyle:m,distX:0,distY:0},na({clipPath:m},e))))}function hs(t,e){var n=e.datas,r=n.clipPath,i=n.clipIndex,o=r,a=o.type,s=o.poses,u=o.splitter,c=s.map((function(t){return t.pos})),l=c.length;if("polygon"===a)s.splice(i,1),c.splice(i,1);else{if("inset"!==a)return;if(i<8)return;if(function(t,e,n,r,i){void 0===i&&(i=e.length);var o=os(t.slice(r)),a=o.horizontalRange,s=o.verticalRange,u=n-r,c=0;if(0===u)c=i;else if(u>0&&u=s[0]))return;c=s[0]+s[1]-u}t.splice(n,c),e.splice(n,c)}(s,c,i,8,l),l===s.length)return}var f=cs(t,r,c),p="".concat(a,"(").concat(f.join(u),")");sa(t,"onClip",ia(t,e,On({clipEventType:"removed",clipType:a,poses:c,clipStyles:f,clipStyle:p,distX:0,distY:0},na({clipPath:p},e))))}var vs={name:"clippable",props:["clippable","defaultClipPath","customClipPath","keepRatio","clipRelative","clipArea","dragWithClip","clipTargetBounds","clipVerticalGuidelines","clipHorizontalGuidelines","clipSnapThreshold"],events:["clipStart","clip","clipEnd"],css:[".control.clip-control {\nbackground: #6d6;\ncursor: pointer;\n}\n.control.clip-control.clip-radius {\nbackground: #d66;\n}\n.line.clip-line {\nbackground: #6e6;\ncursor: move;\nz-index: 1;\n}\n.clip-area {\nposition: absolute;\ntop: 0;\nleft: 0;\n}\n.clip-ellipse {\nposition: absolute;\ncursor: move;\nborder: 1px solid #6d6;\nborder: var(--zoompx) solid #6d6;\nborder-radius: 50%;\ntransform-origin: 0px 0px;\n}",":host {\n--bounds-color: #d66;\n}",".guideline {\npointer-events: none;\nz-index: 2;\n}",".line.guideline.bounds {\nbackground: #d66;\nbackground: var(--bounds-color);\n}"],render:function(t,e){var n=t.props,r=n.customClipPath,i=n.defaultClipPath,o=n.clipArea,a=n.zoom,s=n.groupable,u=t.getState(),c=u.target,l=u.width,f=u.height,p=u.allMatrix,d=u.is3d,h=u.left,v=u.top,g=u.pos1,m=u.pos2,b=u.pos3,x=u.pos4,y=u.clipPathState,E=u.snapBoundInfos,S=u.rotation;if(!c||s)return[];var D=ps(c,l,f,i||"inset",y||r);if(!D)return[];var C=d?4:3,w=D.type,_=D.poses.map((function(t){var e=Ao(p,t.pos,C);return[e[0]-h,e[1]-v]})),M=[],O=[],R="rect"===w,P="inset"===w,T="polygon"===w;if(R||P||T){var z=P?_.slice(0,8):_;O=z.map((function(t,n){var r=0===n?z[z.length-1]:z[n-1],i=W(r,t),o=Yo(r,t);return e.createElement("div",{key:"clipLine".concat(n),className:Eo("line","clip-line","snap-control"),"data-clip-index":n,style:{width:"".concat(o,"px"),transform:"translate(".concat(r[0],"px, ").concat(r[1],"px) rotate(").concat(i,"rad) scaleY(").concat(a,")")}})}))}if(M=_.map((function(t,n){return e.createElement("div",{key:"clipControl".concat(n),className:Eo("control","clip-control","snap-control"),"data-clip-index":n,style:{transform:"translate(".concat(t[0],"px, ").concat(t[1],"px) rotate(").concat(S,"rad) scale(").concat(a,")")}})})),P&&M.push.apply(M,Pn([],Rn(_.slice(8).map((function(t,n){return e.createElement("div",{key:"clipRadiusControl".concat(n),className:Eo("control","clip-control","clip-radius","snap-control"),"data-clip-index":8+n,style:{transform:"translate(".concat(t[0],"px, ").concat(t[1],"px) rotate(").concat(S,"rad) scale(").concat(a,")")}})}))),!1)),"circle"===w||"ellipse"===w){var G=D.left,k=D.top,B=D.radiusX,A=D.radiusY,I=Rn(ye(Ao(p,[G,k],C),Ao(p,[0,0],C)),2),F=I[0],N=I[1],q="none";if(!o){for(var Y=Math.max(10,B/5,A/5),X=[],j=0;j<=Y;++j){var H=2*Math.PI/Y*j;X.push([B+(B-a)*Math.cos(H),A+(A-a)*Math.sin(H)])}X.push([B,-2]),X.push([-2,-2]),X.push([-2,2*A+2]),X.push([2*B+2,2*A+2]),X.push([2*B+2,-2]),X.push([B,-2]),q="polygon(".concat(X.map((function(t){return"".concat(t[0],"px ").concat(t[1],"px")})).join(", "),")")}M.push(e.createElement("div",{key:"clipEllipse",className:Eo("clip-ellipse","snap-control"),style:{width:"".concat(2*B,"px"),height:"".concat(2*A,"px"),clipPath:q,transform:"translate(".concat(-h+F,"px, ").concat(-v+N,"px) ").concat(Go(p))}}))}if(o){var L=Fo(Pn([g,m,b,x],Rn(_),!1)),V=L.width,U=L.height,$=L.left,Z=L.top;if(T||R||P){X=P?_.slice(0,8):_;M.push(e.createElement("div",{key:"clipArea",className:Eo("clip-area","snap-control"),style:{width:"".concat(V,"px"),height:"".concat(U,"px"),transform:"translate(".concat($,"px, ").concat(Z,"px)"),clipPath:"polygon(".concat(X.map((function(t){return"".concat(t[0]-$,"px ").concat(t[1]-Z,"px")})).join(", "),")")}}))}}return E&&["vertical","horizontal"].forEach((function(t){var n=E[t],r="horizontal"===t;n.isSnap&&O.push.apply(O,Pn([],Rn(n.snap.posInfos.map((function(n,i){var o=n.pos,s=ye(Ao(p,r?[0,o]:[o,0],C),[h,v]),u=ye(Ao(p,r?[l,o]:[o,f],C),[h,v]);return Ur(e,"",s,u,a,"clip".concat(t,"snap").concat(i),"guideline")}))),!1)),n.isBound&&O.push.apply(O,Pn([],Rn(n.bounds.map((function(n,i){var o=n.pos,s=ye(Ao(p,r?[0,o]:[o,0],C),[h,v]),u=ye(Ao(p,r?[l,o]:[o,f],C),[h,v]);return Ur(e,"",s,u,a,"clip".concat(t,"bounds").concat(i),"guideline","bounds","bold")}))),!1))})),Pn(Pn([],Rn(M),!1),Rn(O),!1)},dragControlCondition:function(t,e){return e.inputEvent&&(e.inputEvent.target.getAttribute("class")||"").indexOf("clip")>-1},dragStart:function(t,e){var n=t.props.dragWithClip;return!(void 0===n||n)&&this.dragControlStart(t,e)},drag:function(t,e){return this.dragControl(t,On(On({},e),{isDragTarget:!0}))},dragEnd:function(t,e){return this.dragControlEnd(t,e)},dragControlStart:function(t,e){var n=t.state,r=t.props,i=r.defaultClipPath,o=r.customClipPath,a=n.target,s=n.width,u=n.height,c=e.inputEvent?e.inputEvent.target:null,l=c&&c.getAttribute("class")||"",f=e.datas,p=ps(a,s,u,i||"inset",o);if(!p)return!1;var d=p.clipText;return!1===sa(t,"onClipStart",ia(t,e,{clipType:p.type,clipStyle:d,poses:p.poses.map((function(t){return t.pos}))}))?(f.isClipStart=!1,!1):(f.isControl=l&&l.indexOf("clip-control")>-1,f.isLine=l.indexOf("clip-line")>-1,f.isArea=l.indexOf("clip-area")>-1||l.indexOf("clip-ellipse")>-1,f.clipIndex=c?parseInt(c.getAttribute("data-clip-index"),10):-1,f.clipPath=p,f.isClipStart=!0,n.clipPathState=d,fr(t,e),!0)},dragControl:function(t,e){var n,r,i,o=e.datas,a=e.originalDatas,s=e.isDragTarget;if(!o.isClipStart)return!1;var u=o,c=u.isControl,l=u.isLine,f=u.isArea,p=u.clipIndex,d=u.clipPath;if(!d)return!1;var h=jo(t.props,"clippable"),v=h.keepRatio,g=0,m=0,b=a.draggable,x=mr(e);s&&b?(n=Rn(b.prevBeforeDist,2),g=n[0],m=n[1]):(r=Rn(x,2),g=r[0],m=r[1]);var y=[g,m],E=t.state,S=E.width,D=E.height,C=!f&&!c&&!l,w=d.type,_=d.poses,M=d.splitter,O=_.map((function(t){return t.pos}));C&&(g=-g,m=-m);var R=!c||"nesw"===_[p].direction,P="inset"===w||"rect"===w,T=_.map((function(){return[0,0]}));if(c&&!R){var z=_[p],G=z.horizontal,k=z.vertical,B=[g*Ta(G),m*Ta(k)];T=function(t,e,n,r,i){var o=t[e],a=o.direction,s=o.sub,u=t.map((function(){return[0,0]})),c=a?a.split(""):[];if(r&&e<8){var l=c.filter((function(t){return"w"===t||"e"===t})),f=c.filter((function(t){return"n"===t||"s"===t})),p=l[0],d=f[0];u[e]=n;var h=Rn(fs(t),2),v=h[0],g=h[1],m=v&&g?v/g:0;if(m&&i){var b=t[(e+4)%8].pos,x=[0,0];a.indexOf("w")>-1?x[0]=-1:a.indexOf("e")>-1&&(x[0]=1),a.indexOf("n")>-1?x[1]=-1:a.indexOf("s")>-1&&(x[1]=1);var y=Ca([v,g],n,m,x,!0),E=v+y[0],S=g+y[1],D=b[1],C=b[1],w=b[0],_=b[0];-1===x[0]?w=_-E:1===x[0]?_=w+E:(w-=E/2,_+=E/2),-1===x[1]?D=C-S:C=1===x[1]?D+S:(D=C-S/2)+S;var M=ls(D,_,C,w);t.forEach((function(t,e){u[e][0]=M[e].pos[0]-t.pos[0],u[e][1]=M[e].pos[1]-t.pos[1]}))}else t.forEach((function(t,e){var r=t.direction;r&&(r.indexOf(p)>-1&&(u[e][0]=n[0]),r.indexOf(d)>-1&&(u[e][1]=n[1]))})),p&&(u[1][0]=n[0]/2,u[5][0]=n[0]/2),d&&(u[3][1]=n[1]/2,u[7][1]=n[1]/2)}else a&&!s?c.forEach((function(e){var r="n"===e||"s"===e;t.forEach((function(t,i){var o=t.direction,a=t.horizontal,s=t.vertical;o&&-1!==o.indexOf(e)&&(u[i]=[r||!a?0:n[0],r&&s?n[1]:0])}))})):u[e]=n;return u}(_,p,B,P,v)}else R&&(T=O.map((function(){return[g,m]})));var A=O.map((function(t,e){return xe(t,T[e])})),I=Pn([],Rn(A),!1);E.snapBoundInfos=null;var N="circle"===d.type,q="ellipse"===d.type;if(N||q){var Y=Ta((rt=Fo(A)).bottom-rt.top),X=Ta(q?rt.right-rt.left:Y),W=A[0][1]+Y,j=A[0][0]-X,H=A[0][0]+X;N&&(I.push([H,rt.bottom]),T.push([1,0])),I.push([rt.left,W]),T.push([0,1]),I.push([j,rt.bottom]),T.push([1,0])}var L=io((h.clipHorizontalGuidelines||[]).map((function(t){return F("".concat(t),D)})),(h.clipVerticalGuidelines||[]).map((function(t){return F("".concat(t),S)})),S,D),V=[],U=[];if(N||q)V=[I[4][0],I[2][0]],U=[I[1][1],I[3][1]];else if(P){var $=[I[0],I[2],I[4],I[6]],Z=[T[0],T[2],T[4],T[6]];V=$.filter((function(t,e){return Z[e][0]})).map((function(t){return t[0]})),U=$.filter((function(t,e){return Z[e][1]})).map((function(t){return t[1]}))}else V=I.filter((function(t,e){return T[e][0]})).map((function(t){return t[0]})),U=I.filter((function(t,e){return T[e][1]})).map((function(t){return t[1]}));var K=[0,0],J=Bi(L,h.clipTargetBounds&&{left:0,top:0,right:S,bottom:D},V,U,5),Q=J.horizontal,tt=J.vertical,et=Q.offset,nt=tt.offset;if(Q.isBound&&(K[1]+=et),tt.isBound&&(K[0]+=nt),(q||N)&&0===T[0][0]&&0===T[0][1]){var rt,it=(rt=Fo(A)).bottom-rt.top,ot=q?rt.right-rt.left:it;ot-=tt.isBound?Ta(nt):0===tt.snapIndex?-nt:nt,it-=Q.isBound?Ta(et):0===Q.snapIndex?-et:et,N&&(ot=it=xi(tt,Q)>0?it:ot);var at=I[0];I[1][1]=at[1]-it,I[2][0]=at[0]+ot,I[3][1]=at[1]+it,I[4][0]=at[0]-ot}else if(P&&v&&c){var st=Rn(fs(_),2),ut=st[0],ct=st[1],lt=ut&&ct?ut/ct:0,ft=_[p].direction||"",pt=I[1][1];W=I[5][1],j=I[7][0],H=I[3][0];Ta(et)<=Ta(nt)?et=Pa(et)*Ta(nt)/lt:nt=Pa(nt)*Ta(et)*lt,ft.indexOf("w")>-1?j-=nt:ft.indexOf("e")>-1?H-=nt:(j+=nt/2,H-=nt/2),ft.indexOf("n")>-1?pt-=et:ft.indexOf("s")>-1?W-=et:(pt+=et/2,W-=et/2);var dt=ls(pt,H,W,j);I.forEach((function(t,e){var n;n=Rn(dt[e].pos,2),t[0]=n[0],t[1]=n[1]}))}else I.forEach((function(t,e){var n=T[e];n[0]&&(t[0]-=nt),n[1]&&(t[1]-=et)}));var ht=cs(t,d,A),vt="".concat(w,"(").concat(ht.join(M),")");if(E.clipPathState=vt,N||q)V=[I[4][0],I[2][0]],U=[I[1][1],I[3][1]];else if(P){V=($=[I[0],I[2],I[4],I[6]]).map((function(t){return t[0]})),U=$.map((function(t){return t[1]}))}else V=I.map((function(t){return t[0]})),U=I.map((function(t){return t[1]}));if(E.snapBoundInfos=Bi(L,h.clipTargetBounds&&{left:0,top:0,right:S,bottom:D},V,U,1),b){var gt=E.is3d,mt=E.allMatrix,bt=gt?4:3,xt=K;s&&(xt=[y[0]+K[0]-x[0],y[1]+K[1]-x[1]]),b.deltaOffset=be(mt,[xt[0],xt[1],0,0],bt)}return sa(t,"onClip",ia(t,e,On({clipEventType:"changed",clipType:w,poses:A,clipStyle:vt,clipStyles:ht,distX:g,distY:m},na(((i={})["rect"===w?"clip":"clipPath"]=vt,i),e)))),!0},dragControlEnd:function(t,e){this.unset(t);var n=e.isDrag,r=e.datas,i=e.isDouble,o=r.isLine,a=r.isClipStart,s=r.isControl;return!!a&&(sa(t,"onClipEnd",oa(t,e,{})),i&&(s?hs(t,e):o&&ds(t,e)),i||n)},unset:function(t){t.state.clipPathState="",t.state.snapBoundInfos=null}},gs={name:"originDraggable",props:["originDraggable","originRelative"],events:["dragOriginStart","dragOrigin","dragOriginEnd"],css:[":host[data-able-origindraggable] .control.origin {\npointer-events: auto;\n}"],dragControlCondition:function(t,e){return e.isRequest?"originDraggable"===e.requestAble:Z(e.inputEvent.target,Eo("origin"))},dragControlStart:function(t,e){var n=e.datas;fr(t,e);var r=ia(t,e,{dragStart:Fi.dragStart(t,(new ur).dragStart([0,0],e))}),i=sa(t,"onDragOriginStart",r);return n.startOrigin=t.state.transformOrigin,n.startTargetOrigin=t.state.targetOrigin,n.prevOrigin=[0,0],n.isDragOrigin=!0,!1===i?(n.isDragOrigin=!1,!1):r},dragControl:function(t,e){var n=e.datas,r=e.isPinch,i=e.isRequest;if(!n.isDragOrigin)return!1;var o=Rn(mr(e),2),a=o[0],s=o[1],u=t.state,c=u.width,l=u.height,f=u.offsetMatrix,p=u.targetMatrix,d=u.is3d,h=t.props.originRelative,v=void 0===h||h,g=d?4:3,m=[a,s];if(i){var b=e.distOrigin;(b[0]||b[1])&&(m=b)}var x=xe(n.startOrigin,m),y=xe(n.startTargetOrigin,m),E=ye(m,n.prevOrigin),S=Er(f,p,x,g),D=t.getRect(),C=Fo(Io(S,c,l,g)),w=[D.left-C.left,D.top-C.top];n.prevOrigin=m;var _=[ma(y[0],c,v),ma(y[1],l,v)].join(" "),M=Fi.drag(t,sr(e,t.state,w,!!r,!1)),O=ia(t,e,On(On({width:c,height:l,origin:x,dist:m,delta:E,transformOrigin:_,drag:M},na({transformOrigin:_,transform:M.transform},e)),{afterTransform:M.transform}));return sa(t,"onDragOrigin",O),O},dragControlEnd:function(t,e){return!!e.datas.isDragOrigin&&(sa(t,"onDragOriginEnd",oa(t,e,{})),!0)},dragGroupControlCondition:function(t,e){return this.dragControlCondition(t,e)},dragGroupControlStart:function(t,e){return!!this.dragControlStart(t,e)},dragGroupControl:function(t,e){var n=this.dragControl(t,e);return!!n&&(t.transformOrigin=n.transformOrigin,!0)},request:function(t){var e={},n=t.getRect(),r=0,i=0,o=n.transformOrigin,a=[0,0];return{isControl:!0,requestStart:function(){return{datas:e}},request:function(t){return"deltaOrigin"in t?(a[0]+=t.deltaOrigin[0],a[1]+=t.deltaOrigin[1]):"origin"in t?(a[0]=t.origin[0]-o[0],a[1]=t.origin[1]-o[1]):("x"in t?r=t.x-n.left:"deltaX"in t&&(r+=t.deltaX),"y"in t?i=t.y-n.top:"deltaY"in t&&(i+=t.deltaY)),{datas:e,distX:r,distY:i,distOrigin:a}},requestEnd:function(){return{datas:e,isDrag:!0}}}}};function ms(t,e,n,r,i){void 0===r&&(r=[0,0]);return as(t&&"0px"!==t?M(t):[],e,n,0,0,r,i)}function bs(t,e,n,r,i){var o=t.state,a=o.width,s=o.height,u=is(i,t.props.roundRelative,a,s),c=u.raws,l=u.styles,f=function(t,e){return void 0===e&&(e=t.map((function(t){return t.raw}))),{horizontals:t.map((function(t,n){return t.horizontal?e[n]:null})).filter((function(t){return null!=t})),verticals:t.map((function(t,n){return t.vertical?e[n]:null})).filter((function(t){return null!=t}))}}(u.radiusPoses,c),p=f.horizontals,d=f.verticals,h=l.join(" ");o.borderRadiusState=h;var v=ia(t,e,On({horizontals:p,verticals:d,borderRadius:h,width:a,height:s,delta:r,dist:n},na({borderRadius:h},e)));return sa(t,"onRound",v),v}function xs(t){var e,n,r=t.getState().style,i=r.borderRadius||"";if(!i&&t.props.groupable){var o=t.moveables[0],a=t.getTargets()[0];a&&((null==o?void 0:o.props.target)===a?(i=null!==(n=null===(e=t.moveables[0])||void 0===e?void 0:e.state.style.borderRadius)&&void 0!==n?n:"",r.borderRadius=i):(i=ua(a).borderRadius,r.borderRadius=i))}return i}var ys={name:"roundable",props:["roundable","roundRelative","minRoundControls","maxRoundControls","roundClickable","roundPadding","isDisplayShadowRoundControls"],events:["roundStart","round","roundEnd","roundGroupStart","roundGroup","roundGroupEnd"],css:[".control.border-radius {\nbackground: #d66;\ncursor: pointer;\nz-index: 3;\n}",".control.border-radius.vertical {\nbackground: #d6d;\nz-index: 2;\n}",".control.border-radius.virtual {\nopacity: 0.5;\nz-index: 1;\n}",":host.round-line-clickable .line.direction {\ncursor: pointer;\n}"],className:function(t){var e=t.props.roundClickable;return!0===e||"line"===e?Eo("round-line-clickable"):""},requestStyle:function(){return["borderRadius"]},requestChildStyle:function(){return["borderRadius"]},render:function(t,e){var n=t.getState(),r=n.target,i=n.width,o=n.height,a=n.allMatrix,s=n.is3d,u=n.left,c=n.top,l=n.borderRadiusState,f=t.props,p=f.minRoundControls,d=void 0===p?[0,0]:p,h=f.maxRoundControls,v=void 0===h?[4,4]:h,g=f.zoom,m=f.roundPadding,b=void 0===m?0:m,x=f.isDisplayShadowRoundControls,y=f.groupable;if(!r)return null;var E=l||xs(t),S=s?4:3,D=ms(E,i,o,d,!0);if(!D)return null;var C=0,w=0,_=y?[0,0]:[u,c];return D.map((function(t,n){var r=t.horizontal,i=t.vertical,o=t.direction||"",s=Pn([],Rn(t.pos),!1);w+=Math.abs(r),C+=Math.abs(i),r&&o.indexOf("n")>-1&&(s[1]-=b),i&&o.indexOf("w")>-1&&(s[0]-=b),r&&o.indexOf("s")>-1&&(s[1]+=b),i&&o.indexOf("e")>-1&&(s[0]+=b);var u=ye(Ao(a,s,S),_),c=x&&"horizontal"!==x,l=t.vertical?C<=v[1]&&(c||!t.virtual):w<=v[0]&&(x||!t.virtual);return e.createElement("div",{key:"borderRadiusControl".concat(n),className:Eo("control","border-radius",t.vertical?"vertical":"",t.virtual?"virtual":""),"data-radius-index":n,style:{display:l?"block":"none",transform:"translate(".concat(u[0],"px, ").concat(u[1],"px) scale(").concat(g,")")}})}))},dragControlCondition:function(t,e){if(!e.inputEvent||e.isRequest)return!1;var n=e.inputEvent.target.getAttribute("class")||"";return n.indexOf("border-radius")>-1||n.indexOf("moveable-line")>-1&&n.indexOf("moveable-direction")>-1},dragGroupControlCondition:function(t,e){return this.dragControlCondition(t,e)},dragControlStart:function(t,e){var n=e.inputEvent,r=e.datas,i=n.target,o=i.getAttribute("class")||"",a=o.indexOf("border-radius")>-1,s=o.indexOf("moveable-line")>-1&&o.indexOf("moveable-direction")>-1,u=a?parseInt(i.getAttribute("data-radius-index"),10):-1,c=-1;if(s){var l=i.getAttribute("data-line-key")||"";l&&(c=parseInt(l.replace(/render-line-/g,""),10),isNaN(c)&&(c=-1))}if(!a&&!s)return!1;var f=ia(t,e,{});if(!1===sa(t,"onRoundStart",f))return!1;r.lineIndex=c,r.controlIndex=u,r.isControl=a,r.isLine=s,fr(t,e);var p=t.props,d=p.roundRelative,h=p.minRoundControls,v=void 0===h?[0,0]:h,g=t.state,m=g.width,b=g.height;r.isRound=!0,r.prevDist=[0,0];var x=ms(xs(t)||"",m,b,v,!0)||[];return r.controlPoses=x,g.borderRadiusState=is(x,d,m,b).styles.join(" "),f},dragControl:function(t,e){var n=e.datas,r=n.controlPoses;if(!n.isRound||!n.isControl||!r.length)return!1;var i=n.controlIndex,o=Rn(mr(e),2),a=o[0],s=o[1],u=[a,s],c=ye(u,n.prevDist),l=t.props.maxRoundControls,f=void 0===l?[4,4]:l,p=t.state,d=p.width,h=p.height,v=r[i],g=v.vertical,m=v.horizontal,b=r.map((function(t){var e=t.horizontal,n=t.vertical,r=[e*m*u[0],n*g*u[1]];if(e){if(1===f[0])return r;if(f[0]<4&&e!==m)return r}else{if(0===f[1])return r[1]=n*m*u[0]/d*h,r;if(g){if(1===f[1])return r;if(f[1]<4&&n!==g)return r}}return[0,0]}));b[i]=u;var x=r.map((function(t,e){return On(On({},t),{pos:xe(t.pos,b[e])})}));return i<4?x.slice(0,i+1).forEach((function(t){t.virtual=!1})):x.slice(4,i+1).forEach((function(t){t.virtual=!1})),n.prevDist=[a,s],bs(t,e,u,c,x)},dragControlEnd:function(t,e){var n=t.state;n.borderRadiusState="";var r=e.datas,i=e.isDouble;if(!r.isRound)return!1;var o=r.isControl,a=r.controlIndex,s=r.isLine,u=r.lineIndex,c=r.controlPoses,l=c.filter((function(t){return t.virtual})).length,f=t.props.roundClickable,p=void 0===f||f;if(i&&p){if(!o||!0!==p&&"control"!==p){if(s&&(!0===p||"line"===p)){var d=Rn(lr(t,e),2);!function(t,e,n,r){var i=t.filter((function(t){var e=t.virtual;return t.horizontal&&!e})).length,o=t.filter((function(t){var e=t.virtual;return t.vertical&&!e})).length,a=-1;if(0===e&&(0===i?a=0:1===i&&(a=1)),2===e&&(i<=2?a=2:i<=3&&(a=3)),3===e&&(0===o?a=4:o<4&&(a=7)),1===e&&(o<=1?a=5:o<=2&&(a=6)),-1!==a&&t[a].virtual){var s=t[a];!function(t,e){e<4?t.slice(0,e+1).forEach((function(t){t.virtual=!1})):(t[0].virtual&&(t[0].virtual=!1),t.slice(4,e+1).forEach((function(t){t.virtual=!1})))}(t,a),a<4?s.pos[0]=n:s.pos[1]=r}}(c,u,d[0],d[1])}}else!function(t,e){e<4?t.slice(e,4).forEach((function(t){t.virtual=!0})):t.slice(e).forEach((function(t){t.virtual=!0}))}(c,a);l!==c.filter((function(t){return t.virtual})).length&&bs(t,e,[0,0],[0,0],c)}var h=oa(t,e,{});return sa(t,"onRoundEnd",h),n.borderRadiusState="",h},dragGroupControlStart:function(t,e){var n=this.dragControlStart(t,e);if(!n)return!1;var r=t.moveables,i=t.props.targets,o=Xr(t,"roundable",e);return sa(t,"onRoundGroupStart",On({targets:t.props.targets,events:o.map((function(t,e){return On(On({},t),{target:i[e],moveable:r[e],currentTarget:r[e]})}))},n)),n},dragGroupControl:function(t,e){var n=this.dragControl(t,e);if(!n)return!1;var r=t.moveables,i=t.props.targets,o=Xr(t,"roundable",e),a=On({targets:t.props.targets,events:o.map((function(t,e){return On(On(On({},t),{target:i[e],moveable:r[e],currentTarget:r[e]}),na({borderRadius:n.borderRadius},t))}))},n);return sa(t,"onRoundGroup",a),a},dragGroupControlEnd:function(t,e){var n=t.moveables,r=t.props.targets,i=Xr(t,"roundable",e);aa(t,"onRound",(function(e){var o=On({targets:t.props.targets,events:i.map((function(t,i){return On(On(On({},t),{target:r[i],moveable:n[i],currentTarget:n[i]}),na({borderRadius:e.borderRadius},t))}))},e);sa(t,"onRoundGroup",o)}));var o=this.dragControlEnd(t,e);if(!o)return!1;var a=On({targets:t.props.targets,events:i.map((function(t,e){var i;return On(On({},t),{target:r[e],moveable:n[e],currentTarget:n[e],lastEvent:null===(i=t.datas)||void 0===i?void 0:i.lastEvent})}))},o);return sa(t,"onRoundGroupEnd",a),a},unset:function(t){t.state.borderRadiusState=""}};var Es={isPinch:!0,name:"beforeRenderable",props:[],events:["beforeRenderStart","beforeRender","beforeRenderEnd","beforeRenderGroupStart","beforeRenderGroup","beforeRenderGroupEnd"],dragRelation:"weak",setTransform:function(t,e){var n=t.state,r=n.is3d,i=n.targetMatrix,o=n.inlineTransform,a=r?"matrix3d(".concat(i.join(","),")"):"matrix(".concat(Ee(i,!0),")"),s=o&&"none"!==o?o:a;e.datas.startTransforms=function(t,e){var n=Te(e?4:3);return t==="matrix".concat(e?"3d":"","(").concat(n.join(","),")")||"matrix(1,0,0,1,0,0)"===t}(s,r)?[]:M(s)},resetStyle:function(t){var e=t.datas;e.nextStyle={},e.nextTransforms=t.datas.startTransforms,e.nextTransformAppendedIndexes=[]},fillDragStartParams:function(t,e){return ia(t,e,{setTransform:function(t){e.datas.startTransforms=y(t)?t:M(t)},isPinch:!!e.isPinch})},fillDragParams:function(t,e){return ia(t,e,{isPinch:!!e.isPinch})},dragStart:function(t,e){this.setTransform(t,e),this.resetStyle(e),sa(t,"onBeforeRenderStart",this.fillDragStartParams(t,e))},drag:function(t,e){e.datas.startTransforms||this.setTransform(t,e),this.resetStyle(e),sa(t,"onBeforeRender",ia(t,e,{isPinch:!!e.isPinch}))},dragEnd:function(t,e){e.datas.startTransforms||(this.setTransform(t,e),this.resetStyle(e)),sa(t,"onBeforeRenderEnd",ia(t,e,{isPinch:!!e.isPinch,isDrag:e.isDrag}))},dragGroupStart:function(t,e){var n=this;this.dragStart(t,e);var r=Xr(t,"beforeRenderable",e),i=t.moveables,o=r.map((function(t,e){var r=i[e];return n.setTransform(r,t),n.resetStyle(t),n.fillDragStartParams(r,t)}));sa(t,"onBeforeRenderGroupStart",ia(t,e,{isPinch:!!e.isPinch,targets:t.props.targets,setTransform:function(){},events:o}))},dragGroup:function(t,e){var n=this;this.drag(t,e);var r=Xr(t,"beforeRenderable",e),i=t.moveables,o=r.map((function(t,e){var r=i[e];return n.resetStyle(t),n.fillDragParams(r,t)}));sa(t,"onBeforeRenderGroup",ia(t,e,{isPinch:!!e.isPinch,targets:t.props.targets,events:o}))},dragGroupEnd:function(t,e){this.dragEnd(t,e),sa(t,"onBeforeRenderGroupEnd",ia(t,e,{isPinch:!!e.isPinch,isDrag:e.isDrag,targets:t.props.targets}))},dragControlStart:function(t,e){return this.dragStart(t,e)},dragControl:function(t,e){return this.drag(t,e)},dragControlEnd:function(t,e){return this.dragEnd(t,e)},dragGroupControlStart:function(t,e){return this.dragGroupStart(t,e)},dragGroupControl:function(t,e){return this.dragGroup(t,e)},dragGroupControlEnd:function(t,e){return this.dragGroupEnd(t,e)}},Ss={name:"renderable",props:[],events:["renderStart","render","renderEnd","renderGroupStart","renderGroup","renderGroupEnd"],dragRelation:"weak",dragStart:function(t,e){sa(t,"onRenderStart",ia(t,e,{isPinch:!!e.isPinch}))},drag:function(t,e){sa(t,"onRender",this.fillDragParams(t,e))},dragAfter:function(t,e){return this.drag(t,e)},dragEnd:function(t,e){sa(t,"onRenderEnd",this.fillDragEndParams(t,e))},dragGroupStart:function(t,e){sa(t,"onRenderGroupStart",ia(t,e,{isPinch:!!e.isPinch,targets:t.props.targets}))},dragGroup:function(t,e){var n=this,r=Xr(t,"beforeRenderable",e),i=t.moveables,o=r.map((function(t,e){var r=i[e];return n.fillDragParams(r,t)}));sa(t,"onRenderGroup",ia(t,e,On(On({isPinch:!!e.isPinch,targets:t.props.targets,transform:Or(e),transformObject:{}},na(Rr(e))),{events:o})))},dragGroupEnd:function(t,e){var n=this,r=Xr(t,"beforeRenderable",e),i=t.moveables,o=r.map((function(t,e){var r=i[e];return n.fillDragEndParams(r,t)}));sa(t,"onRenderGroupEnd",ia(t,e,On({isPinch:!!e.isPinch,isDrag:e.isDrag,targets:t.props.targets,events:o,transformObject:{},transform:Or(e)},na(Rr(e)))))},dragControlStart:function(t,e){return this.dragStart(t,e)},dragControl:function(t,e){return this.drag(t,e)},dragControlAfter:function(t,e){return this.dragAfter(t,e)},dragControlEnd:function(t,e){return this.dragEnd(t,e)},dragGroupControlStart:function(t,e){return this.dragGroupStart(t,e)},dragGroupControl:function(t,e){return this.dragGroup(t,e)},dragGroupControlEnd:function(t,e){return this.dragGroupEnd(t,e)},fillDragParams:function(t,e){var n={};return Fe(Mr(e)||[]).forEach((function(t){n[t.name]=t.functionValue})),ia(t,e,On({isPinch:!!e.isPinch,transformObject:n,transform:Or(e)},na(Rr(e))))},fillDragEndParams:function(t,e){var n={};return Fe(Mr(e)||[]).forEach((function(t){n[t.name]=t.functionValue})),ia(t,e,On({isPinch:!!e.isPinch,isDrag:e.isDrag,transformObject:n,transform:Or(e)},na(Rr(e))))}};function Ds(t,e,n,r,i,o,a){o.clientDistX=o.distX,o.clientDistY=o.distY;var s="Start"===i,u="End"===i,c="After"===i,l=t.state.target,f=o.isRequest,p=r.indexOf("Control")>-1;if(!l||s&&p&&!f&&t.areaElement===o.inputEvent.target)return!1;var d=Pn([],Rn(e),!1);if(f){var h=o.requestAble;d.some((function(t){return t.name===h}))||d.push.apply(d,Pn([],Rn(t.props.ables.filter((function(t){return t.name===h}))),!1))}if(!d.length||d.every((function(t){return t.dragRelation})))return!1;var v,g=o.inputEvent;u&&g&&(v=document.elementFromPoint(o.clientX,o.clientY)||g.target);var m=!1,b=function(){var t;m=!0,null===(t=o.stop)||void 0===t||t.call(o)},x=s&&(!t.targetGesto||!t.controlGesto||!t.targetGesto.isFlag()||!t.controlGesto.isFlag());x&&t.updateRect(i,!0,!1);var y=o.datas,E=p?"controlGesto":"targetGesto",S=t[E],D=function(e,n,r){if(!(n in e)||S!==t[E])return!1;var i=e.name,a=y[i]||(y[i]={});if(s&&(a.isEventStart=!r||!e[r]||e[r](t,o)),!a.isEventStart)return!1;var u=e[n](t,On(On({},o),{stop:b,datas:a,originalDatas:y,inputTarget:v}));return t._emitter.off(),s&&!1===u&&(a.isEventStart=!1),u};x&&d.forEach((function(e){e.unset&&e.unset(t)})),D(Es,"drag".concat(r).concat(i));var C=0,w=0;n.forEach((function(e){if(m)return!1;var n="".concat(e).concat(r).concat(i),a="".concat(e).concat(r,"Condition");""!==i||f||va(t.state,o);var u=d.filter((function(t){return t[n]})),c=(u=u.filter((function(t,e){return t.name&&u.indexOf(t)===e}))).filter((function(t){return D(t,n,a)})).length;m&&++C,c&&++w,!m&&s&&u.length&&!c&&(C+=u.filter((function(t){var e=t.name;return!!y[e].isEventStart&&"strong"!==t.dragRelation})).length?1:0)})),c&&!w||D(Ss,"drag".concat(r).concat(i));var _=S!==t[E]||C===n.length;if((u||m||_)&&(t.state.gestos={},t.moveables&&t.moveables.forEach((function(t){t.state.gestos={}})),d.forEach((function(e){e.unset&&e.unset(t)}))),s&&!_&&!f&&w&&t.props.preventDefault&&(null==o||o.preventDefault()),t.isUnmounted||_)return!1;(!s&&w&&!a||u)&&(t.props.flushSync||So)((function(){t.updateRect(u?i:"",!0,!1),t.forceUpdate()}));return s||u||c||!w||a||Ds(t,e,n,r,i+"After",o),!0}function Cs(t){return function(e){var n,r=e.inputEvent.target,i=t.areaElement,o=t._dragTarget;return!(!o||(null===(n=t.controlGesto)||void 0===n?void 0:n.isFlag()))&&(r===o||o.contains(r)||r===i||!t.isMoveableElement(r)&&!t.controlBox.contains(r)||Z(r,"moveable-area")||Z(r,"moveable-padding")||Z(r,"moveable-edgeDraggable"))}}function ws(t,e,n){var r=t.controlBox,i=[],o=t.props,a=o.dragArea,s=t.state.target,u=o.dragTarget;return i.push(r),a&&!u||i.push(e),!a&&u&&s&&e!==s&&o.dragTargetSelf&&i.push(s),_s(t,i,"targetAbles",n,{dragStart:Cs(t),pinchStart:Cs(t)})}function _s(t,e,n,r,i){void 0===i&&(i={});var o="targetAbles"===n,a=t.props,s=a.pinchOutside,u=a.pinchThreshold,c=a.preventClickEventOnDrag,l=a.preventClickDefault,f=a.checkInput,p=a.dragFocusedInput,d=a.preventDefault,h={preventDefault:void 0===d||d,preventRightClick:!0,preventWheelClick:!0,container:Ea(a.dragContainer,!0)||it(t.getControlBoxElement()),pinchThreshold:u,pinchOutside:s,preventClickEventOnDrag:!!o&&c,preventClickEventOnDragStart:!!o&&l,preventClickEventByCondition:o?null:function(e){return t.controlBox.contains(e.target)},checkInput:!!o&&f,dragFocusedInput:p},v=new yn(e,h),g="Control"===r;return["drag","pinch"].forEach((function(e){["Start","","End"].forEach((function(o){v.on("".concat(e).concat(o),(function(a){var s,u=a.eventType,c="drag"===e&&a.isPinch;if(!i[u]||i[u](a)){if(!c){var l="drag"===e?[e]:["drag",e],f=Pn([],Rn(t[n]),!1);Ds(t,f,l,r,o,a)?(t.props.stopPropagation||"Start"===o&&g)&&(null===(s=null==a?void 0:a.inputEvent)||void 0===s||s.stopPropagation()):a.stop()}}else a.stop()}))}))})),v}var Ms=function(){function t(t,e,n){var r=this;this.target=t,this.moveable=e,this.eventName=n,this.ables=[],this._onEvent=function(t){var e=r.eventName,n=r.moveable;n.state.disableNativeEvent||r.ables.forEach((function(r){r[e](n,{inputEvent:t})}))},t.addEventListener(n.toLowerCase(),this._onEvent)}var e=t.prototype;return e.setAbles=function(t){this.ables=t},e.destroy=function(){this.target.removeEventListener(this.eventName.toLowerCase(),this._onEvent),this.target=null,this.moveable=null},t}();function Os(t,e,n,r){var i;void 0===n&&(n=e);var o=Ar(t,e),a=o.matrixes,s=o.is3d,u=o.targetMatrix,c=o.transformOrigin,l=o.targetOrigin,f=o.offsetContainer,p=o.hasFixed,d=o.zoom,h=function(t,e){if(Nr){var n=k(Nr,(function(n){return n[0][0]==t&&n[0][1]==e}));if(n)return n[1]}var r=Ar(t,e,!0);return Nr&&Nr.push([[t,e],r]),r}(f,n),v=h.matrixes,g=h.is3d,m=h.offsetContainer,b=h.zoom,x=r||g||s,y=x?4:3,E="svg"!==t.tagName.toLowerCase()&&"ownerSVGElement"in t,S=u,D=Te(y),C=Te(y),w=Te(y),_=Te(y),M=a.length,O=v.map((function(t){return On(On({},t),{matrix:t.matrix?Pn([],Rn(t.matrix),!1):void 0})})).reverse();a.reverse(),!s&&x&&(S=ge(S,3,4),To(a)),!g&&x&&To(O),O.forEach((function(t){C=be(C,t.matrix,y)}));var R=n||rt(t),P=(null===(i=O[0])||void 0===i?void 0:i.target)||Oo(R,R,!0).offsetParent,T=O.slice(1).reduce((function(t,e){return be(t,e.matrix,y)}),Te(y));a.forEach((function(t,e){if(M-2===e&&(w=D.slice()),M-1===e&&(_=D.slice()),!t.matrix){var n=function(t,e,n,r,i){var o,a=t.target,s=t.origin,u=e.matrix,c=Ho(a),l=c.offsetWidth,f=c.offsetHeight,p=n.getBoundingClientRect(),d=[0,0];n===rt(n)&&(d=Po(a,!0));for(var h=a.getBoundingClientRect(),v=h.left-p.left+n.scrollLeft-(n.clientLeft||0)+d[0],g=h.top-p.top+n.scrollTop-(n.clientTop||0)+d[1],m=h.width,b=h.height,x=me(r,i,u),y=No(x,l,f,r),E=y.left,S=y.top,D=y.width,C=y.height,w=Ao(x,s,r),_=ye(w,[E,S]),M=[v+_[0]*m/D,g+_[1]*b/C],O=[0,0],R=0;++R<10;){var P=de(i,r);o=Rn(ye(Ao(P,M,r),Ao(P,w,r)),2),O[0]=o[0],O[1]=o[1];var T=No(me(r,i,Ge(O,r),u),l,f,r),z=T.left-v,G=T.top-g;if(Ta(z)<2&&Ta(G)<2)break;M[0]-=z,M[1]-=G}return O.map((function(t){return Math.round(t)}))}(t,a[e+1],P,y,be(T,D,y));t.matrix=Ge(n,y)}D=be(D,t.matrix,y)}));var z=!E&&s;S||(S=Te(z?4:3));var G=Go(E&&16===S.length?ge(S,4,3):S,z),B=C;return C=pe(C,y,y),{hasZoom:1!==d||1!==b,hasFixed:p,matrixes:a,rootMatrix:C,originalRootMatrix:B,beforeMatrix:w,offsetMatrix:_,allMatrix:D,targetMatrix:S,targetTransform:G,inlineTransform:t.style.transform,transformOrigin:c,targetOrigin:l,is3d:x,offsetContainer:f,offsetRootContainer:m}}function Rs(t,e,n,r){void 0===n&&(n=e);var i=0,o=0,a=0,s={},u=Ho(t);if(t&&(i=u.offsetWidth,o=u.offsetHeight),t){var c=Os(t,e,n,r),l=cr(c.allMatrix,c.transformOrigin,i,o);s=On(On({},c),l);var f=cr(c.allMatrix,[50,50],100,100);a=Lo([f.pos1,f.pos2],f.direction)}var p=r?4:3;return On(On(On({hasZoom:!1,width:i,height:o,rotation:a},u),{originalRootMatrix:Te(p),rootMatrix:Te(p),beforeMatrix:Te(p),offsetMatrix:Te(p),allMatrix:Te(p),targetMatrix:Te(p),targetTransform:"",inlineTransform:"",transformOrigin:[0,0],targetOrigin:[0,0],is3d:!!r,left:0,top:0,right:0,bottom:0,origin:[0,0],pos1:[0,0],pos2:[0,0],pos3:[0,0],pos4:[0,0],direction:1,hasFixed:!1,offsetContainer:null,offsetRootContainer:null,matrixes:[]}),s)}function Ps(t,e,n,r,i,o){void 0===o&&(o=[]);var a=1,s=[0,0],u={left:0,top:0,width:0,height:0,right:0,bottom:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},c={left:0,top:0,width:0,height:0,right:0,bottom:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},l={left:0,top:0,width:0,height:0,right:0,bottom:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},f={left:0,top:0,width:0,height:0,right:0,bottom:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},p=[0,0],d={},h=Rs(e,n,i,!0);if(e){var v=Yr(e);o.forEach((function(t){d[t]=v(t)}));var g=h.is3d?4:3,m=cr(h.offsetMatrix,xe(h.transformOrigin,he(h.targetMatrix,g)),h.width,h.height);a=m.direction,s=xe(m.origin,[m.left-h.left,m.top-h.top]),f=$o(h.offsetRootContainer);var b=Oo(r,r,!0).offsetParent||h.offsetRootContainer;if(h.hasZoom){var x=cr(be(h.originalRootMatrix,h.allMatrix),h.transformOrigin,h.width,h.height),y=cr(h.originalRootMatrix,_o(Yr(b)("transformOrigin")).map((function(t){return parseFloat(t)})),b.offsetWidth,b.offsetHeight);if(u=Uo(x,f),l=Uo(y,f,b,!0),t){var E=x.left,S=x.top;c=Uo({left:E,top:S,bottom:S,right:S},f)}}else{u=$o(e),l=function(t){var e=null==Fr?void 0:Fr.get(t);if(e)return e;var n=$o(t,!0);return Fr&&Fr.set(t,n),n}(b),t&&(c=$o(t));var D=l.left,C=l.top,w=l.clientLeft,_=l.clientTop,M=[u.left-D,u.top-C];p=ye(ha(h.rootMatrix,M,4),[w+h.left,_+h.top])}}return On({targetClientRect:u,containerClientRect:l,moveableClientRect:c,rootContainerClientRect:f,beforeDirection:a,beforeOrigin:s,originalBeforeOrigin:s,target:e,style:d,offsetDelta:p},h)}function Ts(t){var e=t.pos1,n=t.pos2,r=t.pos3,i=t.pos4;if(!(e&&n&&r&&i))return null;var o=nn([e,n,r,i]),a=[o.minX,o.minY],s=ye(t.origin,a);return e=ye(e,a),n=ye(n,a),r=ye(r,a),i=ye(i,a),On(On({},t),{left:t.left,top:t.top,posDelta:a,pos1:e,pos2:n,pos3:r,pos4:i,origin:s,beforeOrigin:s,isPersisted:!0})}var zs=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=On({container:null,gestos:{},renderLines:[[[0,0],[0,0]],[[0,0],[0,0]],[[0,0],[0,0]],[[0,0],[0,0]]],renderPoses:[[0,0],[0,0],[0,0],[0,0]],disableNativeEvent:!1,posDelta:[0,0]},Ps(null)),e.renderState={},e.enabledAbles=[],e.targetAbles=[],e.controlAbles=[],e.rotation=0,e.scale=[1,1],e.isMoveableMounted=!1,e.isUnmounted=!1,e.events={mouseEnter:null,mouseLeave:null},e._emitter=new He,e._prevOriginalDragTarget=null,e._originalDragTarget=null,e._prevDragTarget=null,e._dragTarget=null,e._prevPropTarget=null,e._propTarget=null,e._prevDragArea=!1,e._isPropTargetChanged=!1,e._hasFirstTarget=!1,e._reiszeObserver=null,e._observerId=0,e._mutationObserver=null,e._rootContainer=null,e._viewContainer=null,e._viewClassNames=[],e._store={},e.checkUpdateRect=function(){if(!e.isDragging()){var t=e.props.parentMoveable;t?t.checkUpdateRect():(A(e._observerId),e._observerId=B((function(){e.isDragging()||e.updateRect()})))}},e._onPreventClick=function(t){t.stopPropagation(),t.preventDefault()},e}Mn(e,t);var n=e.prototype;return n.render=function(){var t=this.props,e=this.getState(),n=t.parentPosition,r=t.className,o=t.target,a=t.zoom,s=t.cspNonce,u=t.translateZ,c=t.cssStyled,l=t.groupable,f=t.linePadding,p=t.controlPadding;this._checkUpdateRootContainer(),this.checkUpdate(),this.updateRenderPoses();var d=Rn(n||[0,0],2),h=d[0],v=d[1],g=e.left,m=e.top,b=e.target,x=e.direction,y=e.hasFixed,E=e.offsetDelta,S=t.targets,D=this.isDragging(),C={};this.getEnabledAbles().forEach((function(t){C["data-able-".concat(t.name.toLowerCase())]=!0}));var w=this._getAbleClassName(),_=S&&S.length&&(b||l)||o||!this._hasFirstTarget&&this.state.isPersisted,M=this.controlBox||this.props.firstRenderState||this.props.persistData,O=[g-h,m-v];!l&&t.useAccuratePosition&&(O[0]+=E[0],O[1]+=E[1]);var R={position:y?"fixed":"absolute",display:_?"block":"none",visibility:M?"visible":"hidden",transform:"translate3d(".concat(O[0],"px, ").concat(O[1],"px, ").concat(u,")"),"--zoom":a,"--zoompx":"".concat(a,"px")};return f&&(R["--moveable-line-padding"]=f),p&&(R["--moveable-control-padding"]=p),qt(c,On({cspNonce:s,ref:i(this,"controlBox"),className:"".concat(Eo("control-box",-1===x?"reverse":"",D?"dragging":"")," ").concat(w," ").concat(r)},C,{onClick:this._onPreventClick,style:R}),this.renderAbles(),this._renderLines())},n.componentDidMount=function(){this.isMoveableMounted=!0,this.isUnmounted=!1;var t=this.props,e=t.parentMoveable,n=t.container;this._checkUpdateRootContainer(),this._checkUpdateViewContainer(),this._updateTargets(),this._updateNativeEvents(),this._updateEvents(),this.updateCheckInput(),this._updateObserver(this.props),n||e||this.state.isPersisted||(this.updateRect("",!1,!1),this.forceUpdate())},n.componentDidUpdate=function(t){this._checkUpdateRootContainer(),this._checkUpdateViewContainer(),this._updateNativeEvents(),this._updateTargets(),this._updateEvents(),this.updateCheckInput(),this._updateObserver(t)},n.componentWillUnmount=function(){var t,e;this.isMoveableMounted=!1,this.isUnmounted=!0,this._emitter.off(),null===(t=this._reiszeObserver)||void 0===t||t.disconnect(),null===(e=this._mutationObserver)||void 0===e||e.disconnect(),this._viewContainer&&this._changeAbleViewClassNames([]),ea(this,!1),ea(this,!0);var n=this.events;for(var r in n){var i=n[r];i&&i.destroy()}},n.getTargets=function(){var t=this.props.target;return t?[t]:[]},n.getAble=function(t){return k(this.props.ables||[],(function(e){return e.name===t}))},n.getContainer=function(){var t=this.props,e=t.parentMoveable,n=t.wrapperMoveable;return t.container||n&&n.getContainer()||e&&e.getContainer()||this.controlBox.parentElement},n.getControlBoxElement=function(){return this.controlBox},n.getDragElement=function(){return this._dragTarget},n.isMoveableElement=function(t){var e;return t&&((null===(e=t.getAttribute)||void 0===e?void 0:e.call(t,"class"))||"").indexOf(Un)>-1},n.dragStart=function(t){var e=this.targetGesto,n=this.controlGesto;return e&&Cs(this)({inputEvent:t})?e.isFlag()||e.triggerDragStart(t):n&&this.isMoveableElement(t.target)&&(n.isFlag()||n.triggerDragStart(t)),this},n.hitTest=function(t){var e,n=this.state,r=n.target,i=n.pos1,o=n.pos2,a=n.pos3,s=n.pos4,u=n.targetClientRect;if(!r)return 0;if(ot(t)){var c=t.getBoundingClientRect();e={left:c.left,top:c.top,width:c.width,height:c.height}}else e=On({width:0,height:0},t);var l=e.left,f=e.top,p=e.width,d=e.height,h=en([i,o,s,a],u),v=tn(cn(h,[[l,f],[l+p,f],[l+p,f+d],[l,f+d]])),g=tn(h);return v&&g?Math.min(100,v/g*100):0},n.isInside=function(t,e){var n=this.state,r=n.target,i=n.pos1,o=n.pos2,a=n.pos3,s=n.pos4,u=n.targetClientRect;return!!r&&rn([t,e],en([i,o,s,a],u))},n.updateRect=function(t,e,n){void 0===n&&(n=!0);var r=this.props,i=!r.parentPosition&&!r.wrapperMoveable;i&&qr(!0);var o=r.parentMoveable,a=this.state.target||r.target,s=this.getContainer(),u=o?o._rootContainer:this._rootContainer,c=Ps(this.controlBox,a,s,s,u||s,this._getRequestStyles());if(!a&&this._hasFirstTarget&&r.persistData){var l=Ts(r.persistData);for(var f in l)c[f]=l[f]}i&&qr(),this.updateState(c,!o&&n)},n.isDragging=function(t){var e,n,r=this.targetGesto,i=this.controlGesto;return(null==r?void 0:r.isFlag())?!t||!!(null===(e=r.getEventData()[t])||void 0===e?void 0:e.isEventStart):!!(null==i?void 0:i.isFlag())&&(!t||!!(null===(n=i.getEventData()[t])||void 0===n?void 0:n.isEventStart))},n.updateTarget=function(t){this.updateRect(t,!0)},n.getRect=function(){var t=this.state,e=Qo(this.state),n=Rn(e,4),r=n[0],i=n[1],o=n[2],a=n[3],s=Fo(e),u=t.width,c=t.height,l=s.width,f=s.height,p=s.left,d=s.top,h=[t.left,t.top],v=xe(h,t.origin);return{width:l,height:f,left:p,top:d,pos1:r,pos2:i,pos3:o,pos4:a,offsetWidth:u,offsetHeight:c,beforeOrigin:xe(h,t.beforeOrigin),origin:v,transformOrigin:t.transformOrigin,rotation:this.getRotation()}},n.getManager=function(){return this},n.stopDrag=function(t){var e;t&&"target"!==t||(!1===(null==(e=this.targetGesto)?void 0:e.isIdle())&&ta(this,!1),null==e||e.stop());t&&"control"!==t||(!1===(null==(e=this.controlGesto)?void 0:e.isIdle())&&ta(this,!0),null==e||e.stop())},n.getRotation=function(){var t=this.state;return function(t,e,n){var r=W(t,e)/Math.PI*180;return(r=n>=0?r:180-r)>=0?r:360+r}(t.pos1,t.pos2,t.direction)},n.request=function(t,e,n){void 0===e&&(e={});var r=this,i=r.props,o=i.parentMoveable||i.wrapperMoveable||r,a=o.props.ables,s=i.groupable,u=k(a,(function(e){return e.name===t}));if(this.isDragging()||!u||!u.request)return{request:function(){return this},requestEnd:function(){return this}};var c=u.request(r),l=n||e.isInstant,f=c.isControl?"controlAbles":"targetAbles",p="".concat(s?"Group":"").concat(c.isControl?"Control":""),d=Pn([],Rn(o[f]),!1),h={request:function(e){return Ds(r,d,["drag"],p,"",On(On({},c.request(e)),{requestAble:t,isRequest:!0}),l),h},requestEnd:function(){return Ds(r,d,["drag"],p,"End",On(On({},c.requestEnd()),{requestAble:t,isRequest:!0}),l),h}};return Ds(r,d,["drag"],p,"Start",On(On({},c.requestStart(e)),{requestAble:t,isRequest:!0}),l),l?h.request(e).requestEnd():h},n.getMoveables=function(){return[this]},n.destroy=function(){this.componentWillUnmount()},n.updateRenderPoses=function(){var t=this.getState(),e=this.props,n=e.padding,r=t.originalBeforeOrigin,i=t.transformOrigin,o=t.allMatrix,a=t.is3d,s=t.pos1,u=t.pos2,c=t.pos3,l=t.pos4,f=t.left,p=t.top,d=t.isPersisted,h=e.zoom||1;if(!n&&h<=1)return t.renderPoses=[s,u,c,l],void(t.renderLines=[[s,u],[u,l],[l,c],[c,s]]);var v=Ga(n||{}),g=v.left,m=v.top,b=v.bottom,x=v.right,y=a?4:3,E=me(y,Ge((d?i:this.controlBox&&e.groupable?r:xe(r,[f,p])).map((function(t){return-t})),y),o,Ge(i,y)),S=ga(E,s,[-g,-m],y),D=ga(E,u,[x,-m],y),C=ga(E,c,[-g,b],y),w=ga(E,l,[x,b],y);if(t.renderPoses=[S,D,C,w],t.renderLines=[[S,D],[D,w],[w,C],[C,S]],h){var _=h/2;t.renderLines=[[ga(E,s,[-g-_,-m],y),ga(E,u,[x+_,-m],y)],[ga(E,u,[x,-m-_],y),ga(E,l,[x,b+_],y)],[ga(E,l,[x+_,b],y),ga(E,c,[-g-_,b],y)],[ga(E,c,[-g,b+_],y),ga(E,s,[-g,-m-_],y)]]}},n.checkUpdate=function(){this._isPropTargetChanged=!1;var t=this.props,e=t.target,n=t.container,r=t.parentMoveable,i=this.state,o=i.target,a=i.container;if(o||e){this.updateAbles();var s=!la(o,e);if(s||!la(a,n)){var u=n||this.controlBox;u&&this.unsetAbles(),this.updateState({target:e,container:n}),!r&&u&&this.updateRect("End",!1,!1),this._isPropTargetChanged=s}}},n.waitToChangeTarget=function(){return new Promise((function(){}))},n.triggerEvent=function(t,e){var n=this.props;if(this._emitter.trigger(t,e),n.parentMoveable&&e.isRequest&&!e.isRequestChild)return n.parentMoveable.triggerEvent(t,e,!0);var r=n[t];return r&&r(e)},n.useCSS=function(t,e){var n=this.props.customStyledMap,r=t+e;return n[r]||(n[r]=wn(t,e)),n[r]},n.getState=function(){var t,e=this.props;(e.target||(null===(t=e.targets)||void 0===t?void 0:t.length))&&(this._hasFirstTarget=!0);var n=this.controlBox,r=e.persistData,i=e.firstRenderState;if(i&&!n)return i;if(!this._hasFirstTarget&&r){var o=Ts(r);if(o)return this.updateState(o,!1),this.state}return this.state.isPersisted=!1,this.state},n.updateSelectors=function(){},n.unsetAbles=function(){var t=this;this.targetAbles.forEach((function(e){e.unset&&e.unset(t)}))},n.updateAbles=function(t,e){void 0===t&&(t=this.props.ables),void 0===e&&(e="");var n=this.props.triggerAblesSimultaneously,r=this.getEnabledAbles(t),i="drag".concat(e,"Start"),o="pinch".concat(e,"Start"),a="drag".concat(e,"ControlStart"),s=ca(r,[i,o],n),u=ca(r,[a],n);this.enabledAbles=r,this.targetAbles=s,this.controlAbles=u},n.updateState=function(t,e){if(e){if(this.isUnmounted)return;this.setState(t)}else{var n=this.state;for(var r in t)n[r]=t[r]}},n.getEnabledAbles=function(t){void 0===t&&(t=this.props.ables);var e=this.props;return t.filter((function(t){return t&&(t.always&&!1!==e[t.name]||e[t.name])}))},n.renderAbles=function(){var t,e,n,r,i=this,o=this.props.triggerAblesSimultaneously,a={createElement:qt};return this.renderState={},(t=pa(ca(this.getEnabledAbles(),["render"],o).map((function(t){return(0,t.render)(i,a)||[]}))).filter((function(t){return t})),e=function(t){return t.key},n=[],r={},t.forEach((function(i,o){var a=e(i,o,t),s=r[a];s||(s=[],r[a]=s,n.push(s)),s.push(i)})),n).map((function(t){return t[0]}))},n.updateCheckInput=function(){this.targetGesto&&(this.targetGesto.options.checkInput=this.props.checkInput)},n._getRequestStyles=function(){return this.getEnabledAbles().reduce((function(t,e){var n,r,i=null!==(r=null===(n=e.requestStyle)||void 0===n?void 0:n.call(e))&&void 0!==r?r:[];return Pn(Pn([],Rn(t),!1),Rn(i),!1)}),Pn([],Rn(this.props.requestStyles||[]),!1))},n._updateObserver=function(t){this._updateResizeObserver(t),this._updateMutationObserver(t)},n._updateEvents=function(){var t=this.controlBox,e=this.targetAbles.length,n=this.controlAbles.length,r=this._dragTarget;(!e&&this.targetGesto||this._isTargetChanged(!0))&&(ea(this,!1),this.updateState({gestos:{}})),n||ea(this,!0),r&&e&&!this.targetGesto&&(this.targetGesto=ws(this,r,"")),!this.controlGesto&&n&&(this.controlGesto=_s(this,t,"controlAbles","Control"))},n._updateTargets=function(){var t=this.props;this._prevPropTarget=this._propTarget,this._prevDragTarget=this._dragTarget,this._prevOriginalDragTarget=this._originalDragTarget,this._prevDragArea=t.dragArea,this._propTarget=t.target,this._originalDragTarget=t.dragTarget||t.target,this._dragTarget=Ea(this._originalDragTarget,!0)},n._renderLines=function(){var t=this.props,e=t.zoom,n=t.hideDefaultLines,r=t.hideChildMoveableDefaultLines,i=t.parentMoveable;if(n||i&&r)return[];var o=this.getState(),a={createElement:qt};return o.renderLines.map((function(t,n){return Ur(a,"",t[0],t[1],e,"render-line-".concat(n))}))},n._isTargetChanged=function(t){var e=this.props,n=e.dragTarget||e.target,r=this._prevOriginalDragTarget,i=this._prevDragArea,o=e.dragArea;return!o&&r!==n||(t||o)&&i!==o||this._prevPropTarget!=this._propTarget},n._updateNativeEvents=function(){var t=this,e=this.props.dragArea?this.areaElement:this.state.target,n=this.events,r=I(n);if(this._isTargetChanged())for(var i in n){var o=n[i];o&&o.destroy(),n[i]=null}if(e){var a=this.enabledAbles;r.forEach((function(r){var i=ca(a,[r]),o=i.length>0,s=n[r];o?(s||(s=new Ms(e,t,r),n[r]=s),s.setAbles(i)):s&&(s.destroy(),n[r]=null)}))}},n._checkUpdateRootContainer=function(){var t=this.props.rootContainer;!this._rootContainer&&t&&(this._rootContainer=Ea(t,!0))},n._checkUpdateViewContainer=function(){var t=this.props.viewContainer;!this._viewContainer&&t&&(this._viewContainer=Ea(t,!0)),this._viewContainer&&this._changeAbleViewClassNames(Pn(Pn([],Rn(this._getAbleViewClassNames()),!1),[this.isDragging()?Wa:""],!1))},n._changeAbleViewClassNames=function(t){var e=this._viewContainer,n=fa(t.filter(Boolean),(function(t){return t})).map((function(t){return Rn(t,1)[0]})),r=this._viewClassNames,i=ft(r,n),o=i.removed,a=i.added;o.forEach((function(t){J(e,r[t])})),a.forEach((function(t){K(e,n[t])})),this._viewClassNames=n},n._getAbleViewClassNames=function(){var t=this;return(this.getEnabledAbles().map((function(e){var n;return(null===(n=e.viewClassName)||void 0===n?void 0:n.call(e,t))||""})).join(" ")+" ".concat(this._getAbleClassName("-view"))).split(/\s+/g)},n._getAbleClassName=function(t){var e=this;void 0===t&&(t="");var n=this.getEnabledAbles(),r=this.targetGesto,i=this.controlGesto,o=(null==r?void 0:r.isFlag())?r.getEventData():{},a=(null==i?void 0:i.isFlag())?i.getEventData():{};return n.map((function(n){var r,i,s,u=n.name,c=(null===(r=n.className)||void 0===r?void 0:r.call(n,e))||"";return((null===(i=o[u])||void 0===i?void 0:i.isEventStart)||(null===(s=a[u])||void 0===s?void 0:s.isEventStart))&&(c+=" ".concat(Eo("".concat(u).concat(t,"-dragging")))),c.trim()})).filter(Boolean).join(" ")},n._updateResizeObserver=function(t){var e,n=this.props,r=n.target,i=it(this.getControlBoxElement());if(i.ResizeObserver&&r&&n.useResizeObserver){if(t.target!==r||!this._reiszeObserver){var o=new i.ResizeObserver(this.checkUpdateRect);o.observe(r,{box:"border-box"}),this._reiszeObserver=o}}else null===(e=this._reiszeObserver)||void 0===e||e.disconnect()},n._updateMutationObserver=function(t){var e,n=this,r=this.props,i=r.target,o=it(this.getControlBoxElement());if(o.MutationObserver&&i&&r.useMutationObserver){if(t.target!==i||!this._mutationObserver){var a=new o.MutationObserver((function(t){var e,r;try{for(var i=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),o=i.next();!o.done;o=i.next()){var a=o.value;"attributes"===a.type&&"style"===a.attributeName&&n.checkUpdateRect()}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}}));a.observe(i,{attributes:!0}),this._mutationObserver=a}}else null===(e=this._mutationObserver)||void 0===e||e.disconnect()},e.defaultProps={dragTargetSelf:!1,target:null,dragTarget:null,container:null,rootContainer:null,origin:!0,parentMoveable:null,wrapperMoveable:null,isWrapperMounted:!1,parentPosition:null,warpSelf:!1,svgOrigin:"",dragContainer:null,useResizeObserver:!1,useMutationObserver:!1,preventDefault:!0,linePadding:0,controlPadding:0,ables:[],pinchThreshold:20,dragArea:!1,passDragArea:!1,transformOrigin:"",className:"",zoom:1,triggerAblesSimultaneously:!1,padding:{},pinchOutside:!0,checkInput:!1,dragFocusedInput:!1,groupable:!1,hideDefaultLines:!1,cspNonce:"",translateZ:0,cssStyled:null,customStyledMap:{},props:{},stopPropagation:!1,preventClickDefault:!1,preventClickEventOnDrag:!0,flushSync:So,firstRenderState:null,persistData:null,viewContainer:null,requestStyles:[],useAccuratePosition:!1},e}(Gt),Gs={name:"groupable",props:["defaultGroupRotate","useDefaultGroupRotate","defaultGroupOrigin","groupable","groupableProps","targetGroups","hideChildMoveableDefaultLines"],events:[],render:function(t,e){var n,r=t.props,i=r.targets||[],a=t.getState(),s=a.left,u=a.top,c=a.isPersisted,l=r.zoom||1,f=t.renderGroupRects,p=(null===(n=r.persistData)||void 0===n?void 0:n.children)||[];c?i=p.map((function(){return null})):p=[];var d=Ra(t,"parentPosition",[s,u],(function(t){return t.join(",")})),h=Ra(t,"requestStyles",t.getRequestChildStyles(),(function(t){return t.join(",")}));return t.moveables=t.moveables.slice(0,i.length),Pn(Pn([],Rn(i.map((function(n,i){return e.createElement(zs,{key:"moveable"+i,ref:o(t,"moveables",i),target:n,origin:!1,requestStyles:h,cssStyled:r.cssStyled,customStyledMap:r.customStyledMap,useResizeObserver:r.useResizeObserver,useMutationObserver:r.useMutationObserver,hideChildMoveableDefaultLines:r.hideChildMoveableDefaultLines,parentMoveable:t,parentPosition:[s,u],persistData:p[i],zoom:l})}))),!1),Rn(pa(f.map((function(t,n){var r=[t.pos1,t.pos2,t.pos3,t.pos4];return[[0,1],[1,3],[3,2],[2,0]].map((function(t,i){var o=Rn(t,2),a=o[0],s=o[1];return Ur(e,"",ye(r[a],d),ye(r[s],d),l,"group-rect-".concat(n,"-").concat(i))}))})))),!1)}},ks=Tn("clickable",{props:["clickable"],events:["click","clickGroup"],always:!0,dragRelation:"weak",dragStart:function(){},dragControlStart:function(){},dragGroupStart:function(t,e){e.datas.inputTarget=e.inputEvent&&e.inputEvent.target},dragEnd:function(t,e){var n=t.props.target,r=e.inputEvent,i=e.inputTarget,o=!t.isMoveableElement(i)&&t.controlBox.contains(i);if(r&&i&&!e.isDrag&&!t.isMoveableElement(i)&&!o){var a=n.contains(i);sa(t,"onClick",ia(t,e,{isDouble:e.isDouble,inputTarget:i,isTarget:n===i,moveableTarget:t.props.target,containsTarget:a}))}},dragGroupEnd:function(t,e){var n=e.inputEvent,r=e.inputTarget;if(n&&r&&!e.isDrag&&!t.isMoveableElement(r)&&e.datas.inputTarget!==r){var i=t.props.targets,o=i.indexOf(r),a=o>-1,s=!1;-1===o&&(s=(o=G(i,(function(t){return t.contains(r)})))>-1),sa(t,"onClickGroup",ia(t,e,{isDouble:e.isDouble,targets:i,inputTarget:r,targetIndex:o,isTarget:a,containsTarget:s,moveableTarget:i[o]}))}},dragControlEnd:function(t,e){this.dragEnd(t,e)},dragGroupControlEnd:function(t,e){this.dragEnd(t,e)}});function Bs(t){var e=t.originalDatas.draggable;return e||(t.originalDatas.draggable={},e=t.originalDatas.draggable),On(On({},t),{datas:e})}var As=Tn("edgeDraggable",{css:[".edge.edgeDraggable.line {\ncursor: move;\n}"],render:function(t,e){var n=t.props,r=n.edgeDraggable;return r?$r(e,"edgeDraggable",r,t.getState().renderPoses,n.zoom):[]},dragCondition:function(t,e){var n,r=t.props,i=null===(n=e.inputEvent)||void 0===n?void 0:n.target;return!(!r.edgeDraggable||!i)&&(!r.draggable&&Z(i,Eo("direction"))&&Z(i,Eo("edge"))&&Z(i,Eo("edgeDraggable")))},dragStart:function(t,e){return Fi.dragStart(t,Bs(e))},drag:function(t,e){return Fi.drag(t,Bs(e))},dragEnd:function(t,e){return Fi.dragEnd(t,Bs(e))},dragGroupCondition:function(t,e){var n,r=t.props,i=null===(n=e.inputEvent)||void 0===n?void 0:n.target;return!(!r.edgeDraggable||!i)&&(!r.draggable&&Z(i,Eo("direction"))&&Z(i,Eo("line")))},dragGroupStart:function(t,e){return Fi.dragGroupStart(t,Bs(e))},dragGroup:function(t,e){return Fi.dragGroup(t,Bs(e))},dragGroupEnd:function(t,e){return Fi.dragGroupEnd(t,Bs(e))},unset:function(t){return Fi.unset(t)}}),Is={name:"individualGroupable",props:["individualGroupable","individualGroupableProps"],events:[]},Fs=[Es,Za,yo,ka,Fi,As,Xi,Aa,Na,$i,$a,Ka,Va,gs,vs,ys,Gs,Is,ks,La,Ss],Ns=Fs.reduce((function(t,e){return(e.events||[]).forEach((function(e){$(t,e)})),t}),[]),qs=Fs.reduce((function(t,e){return(e.props||[]).forEach((function(e){$(t,e)})),t}),[]);function Ys(t,e){var n=Rn(t,3),r=n[0],i=n[1],o=n[2];return(r*e[0]+i*e[1]+o)/Math.sqrt(r*r+i*i)}function Xs(t,e){var n=Rn(t,2),r=n[0],i=n[1];return-r*e[0]-i*e[1]}function Ws(t,e){return Math.max.apply(Math,Pn([],Rn(t.map((function(t){var n=Rn(t,4),r=n[0],i=n[1],o=n[2],a=n[3];return Math.max(r[e],i[e],o[e],a[e])}))),!1))}function js(t,e){return Math.min.apply(Math,Pn([],Rn(t.map((function(t){var n=Rn(t,4),r=n[0],i=n[1],o=n[2],a=n[3];return Math.min(r[e],i[e],o[e],a[e])}))),!1))}function Hs(t,e){var n=e.map((function(e){if(y(e)){var n=Hs(t,e),r=n.length;return r>1?n:1===r?n[0]:null}var i=k(t,(function(t){return t.manager.props.target===e}));return i?(i.finded=!0,i.manager):null})).filter(Boolean);return 1===n.length&&y(n[0])?n[0]:n}var Ls=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.differ=new Xe,e.moveables=[],e.transformOrigin="50% 50%",e.renderGroupRects=[],e._targetGroups=[],e._hasFirstTargets=!1,e}Mn(e,t);var n=e.prototype;return n.componentDidMount=function(){t.prototype.componentDidMount.call(this)},n.checkUpdate=function(){this._isPropTargetChanged=!1,this.updateAbles()},n.getTargets=function(){return this.props.targets},n.updateRect=function(t,e,n){var r;void 0===n&&(n=!0);var i=this.state;if(this.controlBox&&!i.isPersisted){qr(!0),this.moveables.forEach((function(e){e.updateRect(t,!1,!1)}));var o=this.props,a=this.moveables,s=i.target||o.target,u=a.map((function(t){return{finded:!1,manager:t}})),c=this.props.targetGroups||[],l=Hs(u,c),f=o.useDefaultGroupRotate;l.push.apply(l,Pn([],Rn(u.filter((function(t){return!t.finded})).map((function(t){return t.manager}))),!1));var p=[],d=!e||""!==t&&o.updateGroup,h=o.defaultGroupRotate||0;if(!this._hasFirstTargets){var v=null===(r=o.persistData)||void 0===r?void 0:r.rotation;null!=v&&(h=v)}var g=function t(e,n,r){var i=e.map((function(e){if(y(e)){var r=t(e,n),i=[r.pos1,r.pos2,r.pos3,r.pos4];return p.push(r),{poses:i,rotation:r.rotation}}return{poses:Qo(e.state),rotation:e.getRotation()}})),o=i.map((function(t){return t.rotation})),a=0,s=o[0],u=o.every((function(t){return Math.abs(s-t)<.1}));a=d?!f&&u?s:h:f||r||!u?n:s;var c=i.map((function(t){return t.poses})),l=function(t,e){var n,r,i,o=[0,0],a=[0,0],s=[0,0],u=[0,0],c=0,l=0;if(!t.length)return{pos1:o,pos2:a,pos3:s,pos4:u,minX:0,minY:0,maxX:0,maxY:0,width:c,height:l,rotation:e};var f=L(e,Qn);if(f%90){var p=f/180*Math.PI,d=Math.tan(p),h=-1/d,v=[er,nr],g=[[0,0],[0,0]],m=[er,nr],b=[[0,0],[0,0]];t.forEach((function(t){t.forEach((function(t){var e=Ys([-d,1,0],t),n=Ys([-h,1,0],t);v[0]>e&&(g[0]=t,v[0]=e),v[1]n&&(b[0]=t,m[0]=n),m[1]180&&(o=(i=Rn([u,s,a,o],4))[0],a=i[1],s=i[2],u=i[3]);var G=nn([o,a,s,u]);return{pos1:o,pos2:a,pos3:s,pos4:u,width:c,height:l,minX:G.minX,minY:G.minY,maxX:G.maxX,maxY:G.maxY,rotation:e}}(c,a);return l}(l,this.rotation,!0);d&&(this.rotation=g.rotation,this.transformOrigin=o.defaultGroupOrigin||"50% 50%",this.scale=[1,1]),this._targetGroups=c,this.renderGroupRects=p;var m,b,x,E,S,D=this.transformOrigin,C=this.rotation,w=this.scale,_=g.width,M=g.height,O=g.minX,R=g.minY,P=(m=[[0,0],[_,0],[0,M],[_,M]],b=Ma(D,_,M),x=this.rotation/180*Math.PI,E=m.map((function(t){return ye(t,b)})),S=E.map((function(t){return Me(t,x)})),{prev:E,next:S,result:S.map((function(t){return xe(t,b)}))}),T=nn(P.result),z=T.minX,G=T.minY,k=" rotate(".concat(C,"deg)")+" scale(".concat(Pa(w[0]),", ").concat(Pa(w[1]),")"),B="translate(".concat(-z,"px, ").concat(-G,"px)").concat(k);this.controlBox.style.transform="translate3d(".concat(O,"px, ").concat(R,"px, ").concat(this.props.translateZ||0,")"),s.style.cssText+="left:0px;top:0px;"+"transform-origin:".concat(D,";")+"width:".concat(_,"px;height:").concat(M,"px;")+"transform: ".concat(B),i.width=_,i.height=M;var A=this.getContainer(),I=Ps(this.controlBox,s,this.controlBox,this.getContainer(),this._rootContainer||A,[]),F=[I.left,I.top],N=Rn(Qo(I),4),q=N[0],Y=N[1],X=N[2],W=N[3],j=nn([q,Y,X,W]),H=[j.minX,j.minY],V=Pa(w[0]*w[1]);I.pos1=ye(q,H),I.pos2=ye(Y,H),I.pos3=ye(X,H),I.pos4=ye(W,H),I.left=O-I.left+H[0],I.top=R-I.top+H[1],I.origin=ye(xe(F,I.origin),H),I.beforeOrigin=ye(xe(F,I.beforeOrigin),H),I.originalBeforeOrigin=xe(F,I.originalBeforeOrigin),I.transformOrigin=ye(xe(F,I.transformOrigin),H),s.style.transform="translate(".concat(-z-H[0],"px, ").concat(-G-H[1],"px)")+k,qr(),this.updateState(On(On({},I),{posDelta:H,direction:V,beforeDirection:V}),n)}},n.getRect=function(){return On(On({},t.prototype.getRect.call(this)),{children:this.moveables.map((function(t){return t.getRect()}))})},n.triggerEvent=function(e,n,r){if(r||e.indexOf("Group")>-1)return t.prototype.triggerEvent.call(this,e,n);this._emitter.trigger(e,n)},n.getRequestChildStyles=function(){return this.getEnabledAbles().reduce((function(t,e){var n,r,i=null!==(r=null===(n=e.requestChildStyle)||void 0===n?void 0:n.call(e))&&void 0!==r?r:[];return Pn(Pn([],Rn(t),!1),Rn(i),!1)}),[])},n.getMoveables=function(){return Pn([],Rn(this.moveables),!1)},n.updateAbles=function(){t.prototype.updateAbles.call(this,Pn(Pn([],Rn(this.props.ables),!1),[Gs],!1),"Group")},n._updateTargets=function(){t.prototype._updateTargets.call(this),this._originalDragTarget=this.props.dragTarget||this.areaElement,this._dragTarget=Ea(this._originalDragTarget,!0)},n._updateEvents=function(){var t=this.state,e=this.props,n=this._prevDragTarget,r=e.dragTarget||this.areaElement,i=e.targets,o=this.differ.update(i),a=o.added,s=o.changed,u=o.removed,c=a.length||u.length;(c||this._prevOriginalDragTarget!==this._originalDragTarget)&&(ea(this,!1),ea(this,!0),this.updateState({gestos:{}})),n!==r&&(t.target=null),t.target||(t.target=this.areaElement,this.controlBox.style.display="block"),t.target&&(this.targetGesto||(this.targetGesto=ws(this,this._dragTarget,"Group")),this.controlGesto||(this.controlGesto=_s(this,this.controlBox,"controlAbles","GroupControl")));var l=!la(t.container,e.container);l&&(t.container=e.container),(l||c||this.transformOrigin!==(e.defaultGroupOrigin||"50% 50%")||s.length||i.length&&!Oa(this._targetGroups,e.targetGroups||[]))&&(this.updateRect(),this._hasFirstTargets=!0),this._isPropTargetChanged=!!c},n._updateObserver=function(){},e.defaultProps=On(On({},zs.defaultProps),{transformOrigin:["50%","50%"],groupable:!0,dragArea:!0,keepRatio:!0,targets:[],defaultGroupRotate:0,defaultGroupOrigin:"50% 50%"}),e}(zs),Vs=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.moveables=[],e}Mn(e,t);var n=e.prototype;return n.render=function(){var t,e=this,n=this.props,r=n.cspNonce,a=n.cssStyled,s=n.persistData,u=n.targets||[],c=u.length,l=this.isUnmounted||!c,f=null!==(t=null==s?void 0:s.children)&&void 0!==t?t:[];return l&&!c&&f.length?u=f.map((function(){return null})):l||(f=[]),qt(a,{cspNonce:r,ref:i(this,"controlBox"),className:Eo("control-box")},u.map((function(t,r){var i,a,s=null!==(a=null===(i=n.individualGroupableProps)||void 0===i?void 0:i.call(n,t,r))&&void 0!==a?a:{};return qt(zs,On({key:"moveable"+r,ref:o(e,"moveables",r)},n,s,{target:t,wrapperMoveable:e,isWrapperMounted:e.isMoveableMounted,persistData:f[r]}))})))},n.componentDidMount=function(){},n.componentDidUpdate=function(){},n.getTargets=function(){return this.props.targets},n.updateRect=function(t,e,n){void 0===n&&(n=!0),qr(!0),this.moveables.forEach((function(r){r.updateRect(t,e,n)})),qr()},n.getRect=function(){return On(On({},t.prototype.getRect.call(this)),{children:this.moveables.map((function(t){return t.getRect()}))})},n.request=function(t,e,n){void 0===e&&(e={});var r=this.moveables.map((function(n){return n.request(t,On(On({},e),{isInstant:!1}),!1)})),i={request:function(t){return r.forEach((function(e){return e.request(t)})),this},requestEnd:function(){return r.forEach((function(t){return t.requestEnd()})),this}};return n||e.isInstant?i.request(e).requestEnd():i},n.dragStart=function(t){var e=t.target,n=k(this.moveables,(function(t){var n=t.getTargets()[0],r=t.getControlBoxElement(),i=t.getDragElement();return!(!n||!i)&&(i===e||i.contains(e)||i!==n&&n===e||n.contains(e)||r===e||r.contains(e))}));return n&&n.dragStart(t),this},n.hitTest=function(){return 0},n.isInside=function(){return!1},n.isDragging=function(){return!1},n.getDragElement=function(){return null},n.getMoveables=function(){return Pn([],Rn(this.moveables),!1)},n.updateRenderPoses=function(){},n.checkUpdate=function(){},n.triggerEvent=function(){},n.updateAbles=function(){},n._updateEvents=function(){},n._updateObserver=function(){},e}(zs);function Us(t,e){var n=[];return t.forEach((function(t){t&&(E(t)?e[t]&&n.push.apply(n,Pn([],Rn(e[t]),!1)):y(t)?n.push.apply(n,Pn([],Rn(Us(t,e)),!1)):n.push(t))})),n}function $s(t,e){var n=[];return t.forEach((function(t){t&&(E(t)?e[t]&&n.push.apply(n,Pn([],Rn(e[t]),!1)):y(t)?n.push($s(t,e)):n.push(t))})),n}function Zs(t,e){return t.length!==e.length||t.some((function(t,n){var r=e[n];return!(!t&&!r)&&(t!=r&&(!y(t)||!y(r)||Zs(t,r)))}))}var Ks=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.refTargets=[],e.selectorMap={},e._differ=new Xe,e._elementTargets=[],e._tmpRefTargets=[],e._tmpSelectorMap={},e._onChangeTargets=null,e}Mn(e,t);var n,r,o=e.prototype;return e.makeStyled=function(){var t={};this.getTotalAbles().forEach((function(e){var n=e.css;n&&n.forEach((function(e){t[e]=!0}))}));var e=I(t).join("\n");this.defaultStyled=wn("div",function(t,e){return e.replace(/([^}{]*){/gm,(function(e,n){return n.replace(/\.([^{,\s\d.]+)/g,"."+t+"$1")+"{"}))}(Un,Zn+e))},e.getTotalAbles=function(){return Pn([Za,Gs,Is,La],Rn(this.defaultAbles),!1)},o.render=function(){var t,e=this.constructor;e.defaultStyled||e.makeStyled();var n=this.props,r=n.ables,o=n.props,a=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i1,p=Pn(Pn([],Rn(e.getTotalAbles()),!1),Rn(r||[]),!1),d=On(On(On({},a),o||{}),{ables:p,cssStyled:e.defaultStyled,customStyledMap:e.customStyledMap});this._elementTargets=l;var h=null,v=this.moveable,g=a.persistData;if((null==g?void 0:g.children)&&(f=!0),a.individualGroupable)return qt(Vs,On({key:"individual-group",ref:i(this,"moveable")},d,{target:null,targets:l}));if(f){var m=$s(u,c);if(v&&!v.props.groupable&&!v.props.individualGroupable){var b=v.props.target;b&&l.indexOf(b)>-1&&(h=On({},v.state))}return qt(Ls,On({key:"group",ref:i(this,"moveable")},d,null!==(t=a.groupableProps)&&void 0!==t?t:{},{target:null,targets:l,targetGroups:m,firstRenderState:h}))}var x=l[0];if(v&&(v.props.groupable||v.props.individualGroupable)){var y=k(v.moveables||[],(function(t){return t.props.target===x}));y&&(h=On({},y.state))}return qt(zs,On({key:"single",ref:i(this,"moveable")},d,{target:x,firstRenderState:h}))},o.componentDidMount=function(){this._checkChangeTargets()},o.componentDidUpdate=function(){this._checkChangeTargets()},o.componentWillUnmount=function(){this.selectorMap={},this.refTargets=[]},o.getTargets=function(){var t,e;return null!==(e=null===(t=this.moveable)||void 0===t?void 0:t.getTargets())&&void 0!==e?e:[]},o.updateSelectors=function(){this.selectorMap={},this._updateRefs()},o.waitToChangeTarget=function(){var t,e=this;return this._onChangeTargets=function(){e._onChangeTargets=null,t()},new Promise((function(e){t=e}))},o.waitToChangeTargets=function(){return this.waitToChangeTarget()},o.getManager=function(){return this.moveable},o.getMoveables=function(){return this.moveable.getMoveables()},o.getDragElement=function(){return this.moveable.getDragElement()},o._updateRefs=function(t){var e=this.refTargets,n=Sa(this.props.target||this.props.targets),r="undefined"!=typeof document,i=Zs(e,n),o=this.selectorMap,a={};return this.refTargets.forEach((function t(e){E(e)?o[e]?a[e]=o[e]:r&&(i=!0,a[e]=[].slice.call(document.querySelectorAll(e))):y(e)&&e.forEach(t)})),this._tmpRefTargets=n,this._tmpSelectorMap=a,[n,a,!t&&i]},o._checkChangeTargets=function(){var t,e,n;this.refTargets=this._tmpRefTargets,this.selectorMap=this._tmpSelectorMap;var r=this._differ.update(this._elementTargets),i=r.added,o=r.removed;(i.length||o.length)&&(null===(e=(t=this.props).onChangeTargets)||void 0===e||e.call(t,{moveable:this.moveable,targets:this._elementTargets}),null===(n=this._onChangeTargets)||void 0===n||n.call(this));var a=Rn(this._updateRefs(),3),s=a[0],u=a[1],c=a[2];this.refTargets=s,this.selectorMap=u,c&&this.forceUpdate()},e.defaultAbles=[],e.customStyledMap={},e.defaultStyled=null,function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);o>3&&a&&Object.defineProperty(e,n,a)}([(n=ar,void 0===r&&(r={}),function(t,e){n.forEach((function(n){var i=r[n]||n;i in t||(t[i]=function(){for(var t,r=[],i=0;i1&&o.updateRect(),o}e(r,t);var o=r.prototype;return o.setState=function(t,e){this.innerMoveable.setState(t,e)},o.forceUpdate=function(t){this.innerMoveable.forceUpdate(t)},o.dragStart=function(t){this.innerMoveable.$_timer&&this.forceUpdate(),this.getMoveable().dragStart(t)},o.destroy=function(){var t,e=this.selfElement;Ht(null,e,this.containerProvider),this._warp||null===(t=null==e?void 0:e.parentElement)||void 0===t||t.removeChild(e),this.containerProvider=null,this.off(),this.selfElement=null,this.innerMoveable=null},o.getMoveable=function(){return this.innerMoveable.moveable},r=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}([a(eu,(function(t,e){t[e]||(t[e]=function(){for(var t=[],n=0;nType:
- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/Moveable.Clippable.html b/release/latest/doc/Moveable.Clippable.html index b7a16935d..373254d42 100644 --- a/release/latest/doc/Moveable.Clippable.html +++ b/release/latest/doc/Moveable.Clippable.html @@ -1036,7 +1036,7 @@

ClippableOptions

Source:
@@ -1512,7 +1512,7 @@

OnClip

Source:
@@ -2231,7 +2231,7 @@

OnClipEnd

Source:
@@ -2755,7 +2755,7 @@

OnClipStart

Source:
@@ -3769,7 +3769,7 @@
Example

- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/Moveable.Draggable.html b/release/latest/doc/Moveable.Draggable.html index 76bcf2bd2..2c24b37b5 100644 --- a/release/latest/doc/Moveable.Draggable.html +++ b/release/latest/doc/Moveable.Draggable.html @@ -136,7 +136,7 @@

thr
Source:
@@ -209,7 +209,7 @@

throttleD
Source:
@@ -236,6 +236,11 @@

throttleD + +
Default Value:
+
    +
  • 0
  • +
@@ -282,7 +287,7 @@

startD
Source:
@@ -433,7 +438,7 @@

draggableSource:
@@ -516,7 +521,7 @@

requestSource:
@@ -815,7 +820,7 @@

DraggableOptions

Source:
@@ -1116,7 +1121,7 @@

DraggableRequestParam

Source:
@@ -1422,7 +1427,7 @@

OnDrag

Source:
@@ -2351,7 +2356,7 @@

OnDragEnd

Source:
@@ -2875,7 +2880,7 @@

OnDragGroup

Source:
@@ -3016,7 +3021,7 @@

OnDragGroupEnd

Source:
@@ -3157,7 +3162,7 @@

OnDragGroupStart

Source:
@@ -3298,7 +3303,7 @@

OnDragStart

Source:
@@ -3851,7 +3856,7 @@

drag

Source:
@@ -3993,7 +3998,7 @@

dragEnd

Source:
@@ -4135,7 +4140,7 @@

dragGroup

Source:
@@ -4288,7 +4293,7 @@

dragGroupEnd

Source:
@@ -4433,7 +4438,7 @@

dragGroupStart

Source:
@@ -4578,7 +4583,7 @@

dragStart

Source:
@@ -4729,7 +4734,7 @@
Example

- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/Moveable.Group.html b/release/latest/doc/Moveable.Group.html index fa0b0ca6c..97adfa030 100644 --- a/release/latest/doc/Moveable.Group.html +++ b/release/latest/doc/Moveable.Group.html @@ -387,7 +387,7 @@

GroupableOptions

Source:
@@ -706,7 +706,7 @@
Type:

- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/Moveable.OriginDraggable.html b/release/latest/doc/Moveable.OriginDraggable.html index 2c70eca4a..c5ec1c568 100644 --- a/release/latest/doc/Moveable.OriginDraggable.html +++ b/release/latest/doc/Moveable.OriginDraggable.html @@ -675,7 +675,7 @@

OnDragOrigin

Source:
@@ -1426,7 +1426,7 @@

OnDragOriginEnd

Source:
@@ -1950,7 +1950,7 @@

OnDragOriginStart

Source:
@@ -2412,7 +2412,7 @@

OriginDraggableOptions

Source:
@@ -3040,7 +3040,7 @@
Example

- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/Moveable.Pinchable.html b/release/latest/doc/Moveable.Pinchable.html index deb2dd000..9d2893ea3 100644 --- a/release/latest/doc/Moveable.Pinchable.html +++ b/release/latest/doc/Moveable.Pinchable.html @@ -217,7 +217,7 @@

OnPinch

Source:
@@ -648,7 +648,7 @@

OnPinchEnd

Source:
@@ -1172,7 +1172,7 @@

OnPinchGroup

Source:
@@ -1282,7 +1282,7 @@

OnPinchGroupEnd

Source:
@@ -1392,7 +1392,7 @@

OnPinchGroupStart

Source:
@@ -1502,7 +1502,7 @@

OnPinchStart

Source:
@@ -1933,7 +1933,7 @@

PinchableOptions

Source:
@@ -2959,7 +2959,7 @@
Example

- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/Moveable.Resizable.html b/release/latest/doc/Moveable.Resizable.html index 270a10046..a1615268e 100644 --- a/release/latest/doc/Moveable.Resizable.html +++ b/release/latest/doc/Moveable.Resizable.html @@ -732,7 +732,7 @@

OnBeforeResize

Source:
@@ -1324,7 +1324,7 @@

OnBeforeResizeGroup

Source:
@@ -1435,7 +1435,7 @@

OnResize

Source:
@@ -2378,7 +2378,7 @@

OnResizeEnd

Source:
@@ -2902,7 +2902,7 @@

OnResizeGroup

Source:
@@ -3043,7 +3043,7 @@

OnResizeGroupEnd

Source:
@@ -3184,7 +3184,7 @@

OnResizeGroupStart

Source:
@@ -3325,7 +3325,7 @@

OnResizeStart

Source:
@@ -4069,7 +4069,7 @@

ResizableOptions

Source:
@@ -4534,7 +4534,7 @@

ResizableRequestParam

Source:
@@ -5981,7 +5981,7 @@
Example

- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/Moveable.Rotatable.html b/release/latest/doc/Moveable.Rotatable.html index d43636123..22c9d5517 100644 --- a/release/latest/doc/Moveable.Rotatable.html +++ b/release/latest/doc/Moveable.Rotatable.html @@ -632,7 +632,7 @@

OnBeforeRotate

Source:
@@ -1195,7 +1195,7 @@

OnBeforeRotateGroup

Source:
@@ -1310,7 +1310,7 @@

OnRotate

Source:
@@ -2353,7 +2353,7 @@

OnRotateEnd

Source:
@@ -2877,7 +2877,7 @@

OnRotateGroup

Source:
@@ -3088,7 +3088,7 @@

OnRotateGroupEnd

Source:
@@ -3229,7 +3229,7 @@

OnRotateGroupStart

Source:
@@ -3370,7 +3370,7 @@

OnRotateStart

Source:
@@ -4047,7 +4047,7 @@

RotatableOptions

Source:
@@ -4475,7 +4475,7 @@

RotatableRequestParam

Source:
@@ -5572,7 +5572,7 @@
Example

- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/Moveable.Roundable.html b/release/latest/doc/Moveable.Roundable.html index 4de070a18..148928768 100644 --- a/release/latest/doc/Moveable.Roundable.html +++ b/release/latest/doc/Moveable.Roundable.html @@ -699,7 +699,7 @@

OnRound

Source:
@@ -1411,7 +1411,7 @@

OnRoundEnd

Source:
@@ -1935,7 +1935,7 @@

OnRoundGroup

Source:
@@ -2078,7 +2078,7 @@

OnRoundGroupEnd

Source:
@@ -2221,7 +2221,7 @@

OnRoundGroupStart

Source:
@@ -2364,7 +2364,7 @@

OnRoundStart

Source:
@@ -2795,7 +2795,7 @@

RoundableOptions

Source:
@@ -4052,7 +4052,7 @@
Example

- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/Moveable.Scalable.html b/release/latest/doc/Moveable.Scalable.html index 517c2e2b8..955061a80 100644 --- a/release/latest/doc/Moveable.Scalable.html +++ b/release/latest/doc/Moveable.Scalable.html @@ -63,7 +63,7 @@

Source:
@@ -136,7 +136,7 @@

throttle
Source:
@@ -209,7 +209,7 @@

scalableSource:
@@ -287,7 +287,7 @@

rende
Source:
@@ -363,7 +363,7 @@

keepRatioSource:
@@ -448,7 +448,7 @@

requestSource:
@@ -621,7 +621,7 @@

OnBeforeScale

Source:
@@ -1181,7 +1181,7 @@

OnBeforeScaleGroup

Source:
@@ -1291,7 +1291,7 @@

OnScale

Source:
@@ -2099,7 +2099,7 @@

OnScaleEnd

Source:
@@ -2623,7 +2623,7 @@

OnScaleGroup

Source:
@@ -2764,7 +2764,7 @@

OnScaleGroupEnd

Source:
@@ -2905,7 +2905,7 @@

OnScaleGroupStart

Source:
@@ -3046,7 +3046,7 @@

OnScaleStart

Source:
@@ -3799,7 +3799,7 @@

ScalableOptions

Source:
@@ -4153,7 +4153,7 @@

ScalableRequestParam

Source:
@@ -4474,7 +4474,7 @@

beforeScale

Source:
@@ -4621,7 +4621,7 @@

scale

Source:
@@ -4763,7 +4763,7 @@

scaleEnd

Source:
@@ -4905,7 +4905,7 @@

scaleGroup

Source:
@@ -5058,7 +5058,7 @@

scaleGroupEnd

Source:
@@ -5203,7 +5203,7 @@

scaleGroupStart

Source:
@@ -5348,7 +5348,7 @@

scaleStart

Source:
@@ -5499,7 +5499,7 @@
Example

- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/Moveable.Scrollable.html b/release/latest/doc/Moveable.Scrollable.html index 0262ab75b..8b411048e 100644 --- a/release/latest/doc/Moveable.Scrollable.html +++ b/release/latest/doc/Moveable.Scrollable.html @@ -140,7 +140,7 @@

OnScroll

Source:
@@ -633,7 +633,7 @@

OnScrollGroup

Source:
@@ -743,7 +743,7 @@

ScrollableOptions

Source:
@@ -1377,7 +1377,7 @@
Example

- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/Moveable.Snappable.html b/release/latest/doc/Moveable.Snappable.html index 80aa316e7..0d58cf578 100644 --- a/release/latest/doc/Moveable.Snappable.html +++ b/release/latest/doc/Moveable.Snappable.html @@ -136,7 +136,7 @@

ver
Source:
@@ -216,7 +216,7 @@

snapThre
Source:
@@ -296,7 +296,7 @@

snappableSource:
@@ -376,7 +376,7 @@

snapGrid
Source:
@@ -456,7 +456,7 @@

snapGri
Source:
@@ -536,7 +536,7 @@

snapGapSource:
@@ -620,7 +620,7 @@

snapDis
Source:
@@ -702,7 +702,7 @@

snapDir
Source:
@@ -785,7 +785,7 @@

snapDigitSource:
@@ -865,7 +865,7 @@

snapCont
Source:
@@ -945,7 +945,7 @@

isD
Source:
@@ -1025,7 +1025,7 @@

Source:
@@ -1105,7 +1105,7 @@

innerBound
Source:
@@ -1190,7 +1190,7 @@

h
Source:
@@ -1270,7 +1270,7 @@

Source:
@@ -1353,7 +1353,7 @@

elem
Source:
@@ -1435,7 +1435,7 @@

boundsSource:
@@ -1528,7 +1528,7 @@

BoundType

Source:
@@ -1768,7 +1768,7 @@

ElementGuidelineValue

Source:
@@ -2196,7 +2196,7 @@

ElementGuidelineValue

Source:
@@ -2603,7 +2603,7 @@

ElementGuidelineValueOptionSource:
@@ -3010,7 +3010,7 @@

GapGuideline

Source:
@@ -3151,7 +3151,7 @@

InnerBoundType

Source:
@@ -3354,7 +3354,7 @@

NumericPosGuideline

Source:
@@ -3464,7 +3464,7 @@

OnBound

Source:
@@ -3605,7 +3605,7 @@

OnSnap

Source:
@@ -3780,7 +3780,7 @@

PosGuideline

Source:
@@ -3928,7 +3928,7 @@

RenderGuidelineInfo

Source:
@@ -4255,7 +4255,7 @@

SnapDirections

Source:
@@ -4556,7 +4556,7 @@

SnapElementGuideline

Source:
@@ -4626,7 +4626,7 @@

SnapGuideline

Source:
@@ -4907,6 +4907,37 @@
Properties:
+ + + +
+ +
+ + + + +
+ +
+ grid + optional + +
+ + + + + + + +
+ + grid?: +boolean + + +
@@ -5201,7 +5232,7 @@

SnappableOptions

Source:
@@ -5724,6 +5755,44 @@
Properties:
+ + +
+ +
+ snapGridAll + optional + +
+ + + + + + +
+ Default Value: false + +
+ + +
+ + snapGridAll?: +boolean + + + +
+ + +
+ In the case of a group, if `snapGridWidth` and `snapGridHeight` are used, all children can be snapped. +Custom fixed directions are not yet allowed. Also, it cannot be applied if rotated. + +
+ +
@@ -6142,7 +6211,7 @@

snap

Source:
@@ -6295,7 +6364,7 @@
Example

- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/Moveable.Warpable.html b/release/latest/doc/Moveable.Warpable.html index 7a9dd226f..4aa52ad83 100644 --- a/release/latest/doc/Moveable.Warpable.html +++ b/release/latest/doc/Moveable.Warpable.html @@ -293,7 +293,7 @@

OnWarp

Source:
@@ -948,7 +948,7 @@

OnWarpEnd

Source:
@@ -1472,7 +1472,7 @@

OnWarpStart

Source:
@@ -2010,7 +2010,7 @@

WarpableOptions

Source:
@@ -2704,7 +2704,7 @@
Example

- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/Moveable.html b/release/latest/doc/Moveable.html index c8f48b5a8..46295796f 100644 --- a/release/latest/doc/Moveable.html +++ b/release/latest/doc/Moveable.html @@ -304,7 +304,7 @@

zoomSource:
@@ -381,7 +381,7 @@

useR
Source:
@@ -458,7 +458,7 @@

targetSource:
@@ -757,7 +757,7 @@

edgeSource:
@@ -829,7 +829,7 @@

dragTarget<
Source:
@@ -980,7 +980,7 @@

classNameSource:
@@ -1193,7 +1193,7 @@

updateTar
Source:
@@ -1440,7 +1440,7 @@

updateRect<
Source:
@@ -2001,7 +2001,7 @@

stopDragSource:
@@ -2168,7 +2168,7 @@

requestSource:
@@ -3287,7 +3287,7 @@

isMo
Source:
@@ -3436,7 +3436,7 @@

isInsideSource:
@@ -3618,7 +3618,7 @@

isDragging<
Source:
@@ -3769,7 +3769,7 @@

hitTestSource:
@@ -4040,7 +4040,7 @@

getRectSource:
@@ -4159,7 +4159,7 @@

getManager<
Source:
@@ -4278,7 +4278,7 @@

getDrag
Source:
@@ -4384,7 +4384,7 @@

g
Source:
@@ -4490,7 +4490,7 @@

getAble<T e
Source:
@@ -4995,7 +4995,7 @@

dragStartSource:
@@ -5144,7 +5144,7 @@

destroySource:
@@ -5261,7 +5261,7 @@

AbleRequesters

Source:
@@ -5562,7 +5562,7 @@

AbleRequestParam

Source:
@@ -5704,7 +5704,7 @@

CSSObject

Source:
@@ -7152,7 +7152,7 @@

DragAreaOptions

Source:
@@ -7305,7 +7305,7 @@

ElementSizes

Source:
@@ -7973,7 +7973,7 @@

GroupRect

Source:
@@ -8393,7 +8393,7 @@

HitRect

Source:
@@ -8596,7 +8596,7 @@

In

Source:
@@ -8660,7 +8660,7 @@

LineDirection

Source:
@@ -8730,7 +8730,7 @@

MoveableDefaultEvents

Source:
@@ -8840,7 +8840,7 @@

MoveableDefaultProps

Source:
@@ -8950,7 +8950,7 @@

MoveableGroupInterface<T, U>
Source:
@@ -10465,7 +10465,7 @@

MoveableInterface

Source:
@@ -11236,7 +11236,7 @@

MoveableManagerInterface<T, U
Source:
@@ -12596,7 +12596,7 @@

MoveableOptions

Source:
@@ -15765,7 +15765,7 @@

MoveableRefObject<T extends Element
Source:
@@ -15875,7 +15875,7 @@

MoveableRefTargetType

Source:
@@ -15945,7 +15945,7 @@

MoveableRefType<T extends Element = HT
Source:
@@ -16015,7 +16015,7 @@

MoveableTargetGroupsType

Source:
@@ -16085,7 +16085,7 @@

OnBeforeRender

Source:
@@ -16551,7 +16551,7 @@

OnBeforeRenderEnd

Source:
@@ -17048,7 +17048,7 @@

OnBeforeRenderGroup

Source:
@@ -17572,7 +17572,7 @@

OnBeforeRenderGroupEnd

Source:
@@ -18096,7 +18096,7 @@

OnBeforeRenderGroupStart

Source:
@@ -18651,7 +18651,7 @@

OnBeforeRenderStart

Source:
@@ -19148,7 +19148,7 @@

OnChangeTargets

Source:
@@ -19291,7 +19291,7 @@

OnClick

Source:
@@ -19882,7 +19882,7 @@

OnClickGroup

Source:
@@ -20537,7 +20537,7 @@

OnEndEvent

Source:
@@ -21061,7 +21061,7 @@

OnEvent

Source:
@@ -21492,7 +21492,7 @@

OnRender

Source:
@@ -22088,7 +22088,7 @@

OnRenderEnd

Source:
@@ -22716,7 +22716,7 @@

OnRenderGroup

Source:
@@ -23370,7 +23370,7 @@

OnRenderGroupEnd

Source:
@@ -24056,7 +24056,7 @@

OnRenderGroupStart

Source:
@@ -24549,7 +24549,7 @@

OnRenderStart

Source:
@@ -25015,7 +25015,7 @@

OnTransformEvent

Source:
@@ -25254,7 +25254,7 @@

OnTransformStartEvent

Source:
@@ -25409,7 +25409,7 @@

OriginOptions

Source:
@@ -25570,7 +25570,7 @@

PaddingBox

Source:
@@ -25773,7 +25773,7 @@

PaddingOptions

Source:
@@ -25889,7 +25889,7 @@

PersistRectData

Source:
@@ -25959,7 +25959,7 @@

RectInfo

Source:
@@ -26518,7 +26518,7 @@

RenderDirections

Source:
@@ -26723,7 +26723,7 @@

Requester<RequestParam = AbleRequestParam>
Source:
@@ -26879,7 +26879,7 @@

TransformObject

Source:
@@ -27386,7 +27386,7 @@

render

Source:
@@ -27530,7 +27530,7 @@

renderEnd

Source:
@@ -27674,7 +27674,7 @@

renderGroup

Source:
@@ -27818,7 +27818,7 @@

renderGroupEnd

Source:
@@ -27962,7 +27962,7 @@

renderGroupStart

Source:
@@ -28106,7 +28106,7 @@

renderStart

Source:
@@ -28259,7 +28259,7 @@
Example

- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/global.html b/release/latest/doc/global.html index c02661bcb..d1ff1c3c0 100644 --- a/release/latest/doc/global.html +++ b/release/latest/doc/global.html @@ -133,7 +133,7 @@

getMoveab
Source:
@@ -1758,7 +1758,7 @@

Type:

- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/index.html b/release/latest/doc/index.html index c75885863..a556aba2d 100644 --- a/release/latest/doc/index.html +++ b/release/latest/doc/index.html @@ -392,7 +392,7 @@

📝 License


- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/node_modules_@scena_event-emitter_src_EventEmitter.ts.html b/release/latest/doc/node_modules_@scena_event-emitter_src_EventEmitter.ts.html index 908c01748..7aeed9e74 100644 --- a/release/latest/doc/node_modules_@scena_event-emitter_src_EventEmitter.ts.html +++ b/release/latest/doc/node_modules_@scena_event-emitter_src_EventEmitter.ts.html @@ -280,7 +280,7 @@

node_modules/@scena/event-emitter/src/EventEmitter.ts

- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/node_modules_@scena_event-emitter_src_types.ts.html b/release/latest/doc/node_modules_@scena_event-emitter_src_types.ts.html index ec8628216..725c9a079 100644 --- a/release/latest/doc/node_modules_@scena_event-emitter_src_types.ts.html +++ b/release/latest/doc/node_modules_@scena_event-emitter_src_types.ts.html @@ -113,7 +113,7 @@

node_modules/@scena/event-emitter/src/types.ts


- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/packages_moveable_src_MoveableManager.tsx.html b/release/latest/doc/packages_moveable_src_MoveableManager.tsx.html index 701af143f..aa06e4b0b 100644 --- a/release/latest/doc/packages_moveable_src_MoveableManager.tsx.html +++ b/release/latest/doc/packages_moveable_src_MoveableManager.tsx.html @@ -192,7 +192,7 @@

packages/moveable/src/MoveableManager.tsx


- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/packages_react-moveable_src_InitialMoveable.tsx.html b/release/latest/doc/packages_react-moveable_src_InitialMoveable.tsx.html index 35211d13a..8604e0815 100644 --- a/release/latest/doc/packages_react-moveable_src_InitialMoveable.tsx.html +++ b/release/latest/doc/packages_react-moveable_src_InitialMoveable.tsx.html @@ -437,7 +437,7 @@

packages/react-moveable/src/InitialMoveable.tsx


- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/packages_react-moveable_src_MoveableGroup.tsx.html b/release/latest/doc/packages_react-moveable_src_MoveableGroup.tsx.html index f79dcea8f..4dfaab677 100644 --- a/release/latest/doc/packages_react-moveable_src_MoveableGroup.tsx.html +++ b/release/latest/doc/packages_react-moveable_src_MoveableGroup.tsx.html @@ -601,7 +601,7 @@

packages/react-moveable/src/MoveableGroup.tsx


- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/packages_react-moveable_src_MoveableManager.tsx.html b/release/latest/doc/packages_react-moveable_src_MoveableManager.tsx.html index cd5d01c29..2246a757c 100644 --- a/release/latest/doc/packages_react-moveable_src_MoveableManager.tsx.html +++ b/release/latest/doc/packages_react-moveable_src_MoveableManager.tsx.html @@ -141,6 +141,12 @@

packages/react-moveable/src/MoveableManager.tsx

public state: MoveableManagerState = { container: null, gestos: {}, + renderLines: [ + [[0, 0], [0, 0]], + [[0, 0], [0, 0]], + [[0, 0], [0, 0]], + [[0, 0], [0, 0]], + ], renderPoses: [[0, 0], [0, 0], [0, 0], [0, 0]], disableNativeEvent: false, posDelta: [0, 0], @@ -804,14 +810,21 @@

packages/react-moveable/src/MoveableManager.tsx

top: stateTop, isPersisted, } = state; + const zoom = props.zoom || 1; - if (!padding) { + if (!padding && zoom <= 1) { state.renderPoses = [ pos1, pos2, pos3, pos4, ]; + state.renderLines = [ + [pos1, pos2], + [pos2, pos4], + [pos4, pos3], + [pos3, pos1], + ]; return; } const { @@ -819,7 +832,7 @@

packages/react-moveable/src/MoveableManager.tsx

top, bottom, right, - } = getPaddingBox(padding); + } = getPaddingBox(padding || {}); const n = is3d ? 4 : 3; // const clipPathInfo = getClipPath( @@ -852,12 +865,46 @@

packages/react-moveable/src/MoveableManager.tsx

createOriginMatrix(transformOrigin, n), ); + const renderPos1 = calculatePadding(nextMatrix, pos1, [-left, -top], n); + const renderPos2 = calculatePadding(nextMatrix, pos2, [right, -top], n); + const renderPos3 = calculatePadding(nextMatrix, pos3, [-left, bottom], n); + const renderPos4 = calculatePadding(nextMatrix, pos4, [right, bottom], n); + state.renderPoses = [ - calculatePadding(nextMatrix, pos1, [-left, -top], n), - calculatePadding(nextMatrix, pos2, [right, -top], n), - calculatePadding(nextMatrix, pos3, [-left, bottom], n), - calculatePadding(nextMatrix, pos4, [right, bottom], n), + renderPos1, + renderPos2, + renderPos3, + renderPos4, ]; + state.renderLines = [ + [renderPos1, renderPos2], + [renderPos2, renderPos4], + [renderPos4, renderPos3], + [renderPos3, renderPos1], + ]; + + if (zoom) { + const zoomOffset = zoom / 2; + + state.renderLines = [ + [ + calculatePadding(nextMatrix, pos1, [-left - zoomOffset, -top], n), + calculatePadding(nextMatrix, pos2, [right + zoomOffset, -top], n), + ], + [ + calculatePadding(nextMatrix, pos2, [right, -top - zoomOffset], n), + calculatePadding(nextMatrix, pos4, [right, bottom + zoomOffset], n), + ], + [ + calculatePadding(nextMatrix, pos4, [right + zoomOffset, bottom], n), + calculatePadding(nextMatrix, pos3, [-left - zoomOffset, bottom], n), + ], + [ + calculatePadding(nextMatrix, pos3, [-left, bottom + zoomOffset], n), + calculatePadding(nextMatrix, pos1, [-left, -top - zoomOffset], n), + ], + ]; + } } public checkUpdate() { this._isPropTargetChanged = false; @@ -1087,18 +1134,13 @@

packages/react-moveable/src/MoveableManager.tsx

if (hideDefaultLines || (parentMoveable && hideChildMoveableDefaultLines)) { return []; } - const renderPoses = this.getState().renderPoses; + const state = this.getState(); const Renderer = { createElement, }; - return [ - [0, 1], - [1, 3], - [3, 2], - [2, 0], - ].map(([from, to], i) => { - return renderLine(Renderer, "", renderPoses[from], renderPoses[to], zoom!, `render-line-${i}`); + return state.renderLines.map((line, i) => { + return renderLine(Renderer, "", line[0], line[1], zoom!, `render-line-${i}`); }); } private _onPreventClick = (e: any) => { @@ -1464,7 +1506,7 @@

packages/react-moveable/src/MoveableManager.tsx


- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/packages_react-moveable_src_ables_Clickable.ts.html b/release/latest/doc/packages_react-moveable_src_ables_Clickable.ts.html index 30b7b88ad..54615e9c2 100644 --- a/release/latest/doc/packages_react-moveable_src_ables_Clickable.ts.html +++ b/release/latest/doc/packages_react-moveable_src_ables_Clickable.ts.html @@ -192,7 +192,7 @@

packages/react-moveable/src/ables/Clickable.ts


- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/packages_react-moveable_src_ables_Clippable.tsx.html b/release/latest/doc/packages_react-moveable_src_ables_Clippable.tsx.html index da03fdb6e..314c2f3ab 100644 --- a/release/latest/doc/packages_react-moveable_src_ables_Clippable.tsx.html +++ b/release/latest/doc/packages_react-moveable_src_ables_Clippable.tsx.html @@ -1227,7 +1227,7 @@

packages/react-moveable/src/ables/Clippable.tsx


- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/packages_react-moveable_src_ables_DragArea.tsx.html b/release/latest/doc/packages_react-moveable_src_ables_DragArea.tsx.html index da98ebab0..e71b0f927 100644 --- a/release/latest/doc/packages_react-moveable_src_ables_DragArea.tsx.html +++ b/release/latest/doc/packages_react-moveable_src_ables_DragArea.tsx.html @@ -253,7 +253,7 @@

packages/react-moveable/src/ables/DragArea.tsx


- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/packages_react-moveable_src_ables_Draggable.tsx.html b/release/latest/doc/packages_react-moveable_src_ables_Draggable.tsx.html index 3371f04a9..f49d88979 100644 --- a/release/latest/doc/packages_react-moveable_src_ables_Draggable.tsx.html +++ b/release/latest/doc/packages_react-moveable_src_ables_Draggable.tsx.html @@ -189,6 +189,8 @@

packages/react-moveable/src/ables/Draggable.tsx

parentFlag, isPinch, deltaOffset, useSnap, isRequest, + isGroup, + parentThrottleDrag, } = e; let { distX, distY } = e; const { isDrag, prevDist, prevBeforeDist, startValue } = datas; @@ -204,7 +206,7 @@

packages/react-moveable/src/ables/Draggable.tsx

const props = moveable.props; const parentMoveable = props.parentMoveable; - const throttleDrag = parentEvent ? 0 : (props.throttleDrag || 0); + const throttleDrag = isGroup ? 0 : (props.throttleDrag || parentThrottleDrag || 0); const throttleDragRotate = parentEvent ? 0 : (props.throttleDragRotate || 0); let dragRotateRad = 0; @@ -357,7 +359,10 @@

packages/react-moveable/src/ables/Draggable.tsx

if (!params) { return false; } - const events = triggerChildGesto(moveable, this, "dragStart", [ + const { + childEvents, + eventParams, + } = triggerChildGesto(moveable, this, "dragStart", [ clientX || 0, clientY || 0, ], e, false, "draggable"); @@ -365,12 +370,19 @@

packages/react-moveable/src/ables/Draggable.tsx

const nextParams: OnDragGroupStart = { ...params, targets: moveable.props.targets!, - events, + events: eventParams, }; const result = triggerEvent(moveable, "onDragGroupStart", nextParams); datas.isDrag = result !== false; + + // find data.startValue and based on first child moveable + const startValue = childEvents[0]?.datas.startValue ?? [0, 0]; + + + datas.throttleOffset = [startValue[0] % 1, startValue[1] % 1]; + return datas.isDrag ? params : false; }, dragGroup(moveable: MoveableGroupInterface<any, any>, e: any) { @@ -379,16 +391,22 @@

packages/react-moveable/src/ables/Draggable.tsx

if (!datas.isDrag) { return; } - const params = this.drag(moveable, e); + const params = this.drag(moveable, { + ...e, + parentThrottleDrag: moveable.props.throttleDrag, + }); const { passDelta } = e.datas; - const events = triggerChildGesto(moveable, this, "drag", passDelta, e, false, "draggable"); + const { + eventParams, + } = triggerChildGesto(moveable, this, "drag", passDelta, e, false, "draggable"); if (!params) { return; } + const nextParams: OnDragGroup = { targets: moveable.props.targets!, - events, + events: eventParams, ...params, }; @@ -402,10 +420,12 @@

packages/react-moveable/src/ables/Draggable.tsx

return; } this.dragEnd(moveable, e); - const events = triggerChildGesto(moveable, this, "dragEnd", [0, 0], e, false, "draggable"); + const { + eventParams, + } = triggerChildGesto(moveable, this, "dragEnd", [0, 0], e, false, "draggable"); triggerEvent(moveable, "onDragGroupEnd", fillEndParams<OnDragGroupEnd>(moveable, e, { targets: moveable.props.targets!, - events, + events: eventParams, })); return isDrag; @@ -494,6 +514,7 @@

packages/react-moveable/src/ables/Draggable.tsx

/** * throttle of x, y when drag. * @name Moveable.Draggable#throttleDrag + * @default 0 * @example * import Moveable from "moveable"; * @@ -648,7 +669,7 @@

packages/react-moveable/src/ables/Draggable.tsx


- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/packages_react-moveable_src_ables_Origin.tsx.html b/release/latest/doc/packages_react-moveable_src_ables_Origin.tsx.html index d09e5d4fd..fa3722bc0 100644 --- a/release/latest/doc/packages_react-moveable_src_ables_Origin.tsx.html +++ b/release/latest/doc/packages_react-moveable_src_ables_Origin.tsx.html @@ -110,7 +110,7 @@

packages/react-moveable/src/ables/Origin.tsx


- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/packages_react-moveable_src_ables_OriginDraggable.tsx.html b/release/latest/doc/packages_react-moveable_src_ables_OriginDraggable.tsx.html index 872360e86..1c3e46906 100644 --- a/release/latest/doc/packages_react-moveable_src_ables_OriginDraggable.tsx.html +++ b/release/latest/doc/packages_react-moveable_src_ables_OriginDraggable.tsx.html @@ -421,7 +421,7 @@

packages/react-moveable/src/ables/OriginDraggable.tsx

- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/packages_react-moveable_src_ables_Padding.tsx.html b/release/latest/doc/packages_react-moveable_src_ables_Padding.tsx.html index dbb47a352..facd740cf 100644 --- a/release/latest/doc/packages_react-moveable_src_ables_Padding.tsx.html +++ b/release/latest/doc/packages_react-moveable_src_ables_Padding.tsx.html @@ -147,7 +147,7 @@

packages/react-moveable/src/ables/Padding.tsx


- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/packages_react-moveable_src_ables_Pinchable.ts.html b/release/latest/doc/packages_react-moveable_src_ables_Pinchable.ts.html index d6a5e8e26..491efc4eb 100644 --- a/release/latest/doc/packages_react-moveable_src_ables_Pinchable.ts.html +++ b/release/latest/doc/packages_react-moveable_src_ables_Pinchable.ts.html @@ -362,7 +362,7 @@

packages/react-moveable/src/ables/Pinchable.ts


- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/packages_react-moveable_src_ables_Resizable.ts.html b/release/latest/doc/packages_react-moveable_src_ables_Resizable.ts.html index f221472c6..a2c88434e 100644 --- a/release/latest/doc/packages_react-moveable_src_ables_Resizable.ts.html +++ b/release/latest/doc/packages_react-moveable_src_ables_Resizable.ts.html @@ -1092,7 +1092,7 @@

packages/react-moveable/src/ables/Resizable.ts


- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/packages_react-moveable_src_ables_Rotatable.tsx.html b/release/latest/doc/packages_react-moveable_src_ables_Rotatable.tsx.html index e288f9fdd..5e32e0435 100644 --- a/release/latest/doc/packages_react-moveable_src_ables_Rotatable.tsx.html +++ b/release/latest/doc/packages_react-moveable_src_ables_Rotatable.tsx.html @@ -1131,7 +1131,7 @@

packages/react-moveable/src/ables/Rotatable.tsx


- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/packages_react-moveable_src_ables_Roundable.tsx.html b/release/latest/doc/packages_react-moveable_src_ables_Roundable.tsx.html index 4e321e458..7df66270e 100644 --- a/release/latest/doc/packages_react-moveable_src_ables_Roundable.tsx.html +++ b/release/latest/doc/packages_react-moveable_src_ables_Roundable.tsx.html @@ -973,7 +973,7 @@

packages/react-moveable/src/ables/Roundable.tsx


- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/packages_react-moveable_src_ables_Scalable.ts.html b/release/latest/doc/packages_react-moveable_src_ables_Scalable.ts.html index 757473562..d4facc2f6 100644 --- a/release/latest/doc/packages_react-moveable_src_ables_Scalable.ts.html +++ b/release/latest/doc/packages_react-moveable_src_ables_Scalable.ts.html @@ -45,7 +45,8 @@

packages/react-moveable/src/ables/Scalable.ts

import {
     triggerEvent, multiply2,
     fillParams, fillEndParams, getAbsolutePosesByState,
-    catchEvent, getOffsetSizeDist, getDirectionCondition, getDirectionViewClassName, getTotalDirection, sign, countEach,
+    catchEvent, getOffsetSizeDist, getDirectionCondition,
+    getDirectionViewClassName, getTotalDirection, sign, countEach, abs,
 } from "../utils";
 import { MIN_SCALE } from "../consts";
 import {
@@ -330,6 +331,7 @@ 

packages/react-moveable/src/ables/Scalable.ts

let fixedPosition = dragClient; let snapDist = [0, 0]; + const distSign = sign(dist[0] * dist[1]); const isSelfPinch = !dragClient && !parentFlag && isPinch; if (isSelfPinch || resolveMatrix) { @@ -381,7 +383,7 @@

packages/react-moveable/src/ables/Scalable.ts

dist[0] += snapDist[0]; const snapHeight = startOffsetWidth * dist[0] * tempScaleValue[0] / ratio; - dist[1] = snapHeight / startOffsetHeight / tempScaleValue[1]; + dist[1] = sign(distSign * dist[0]) * abs(snapHeight / startOffsetHeight / tempScaleValue[1]); } else if ( (!sizeDirection[0] && sizeDirection[1]) || (!snapDist[0] && snapDist[1]) @@ -390,11 +392,12 @@

packages/react-moveable/src/ables/Scalable.ts

dist[1] += snapDist[1]; const snapWidth = startOffsetHeight * dist[1] * tempScaleValue[1] * ratio; - dist[0] = snapWidth / startOffsetWidth / tempScaleValue[0]; + dist[0] = sign(distSign * dist[1]) * abs(snapWidth / startOffsetWidth / tempScaleValue[0]); } } else { dist[0] += snapDist[0]; dist[1] += snapDist[1]; + if (!snapDist[0]) { dist[0] = throttle(dist[0] * tempScaleValue[0], throttleScale!) / tempScaleValue[0]; } @@ -875,7 +878,7 @@

packages/react-moveable/src/ables/Scalable.ts


- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/packages_react-moveable_src_ables_Scrollable.ts.html b/release/latest/doc/packages_react-moveable_src_ables_Scrollable.ts.html index f77ef67f1..739ce5cb4 100644 --- a/release/latest/doc/packages_react-moveable_src_ables_Scrollable.ts.html +++ b/release/latest/doc/packages_react-moveable_src_ables_Scrollable.ts.html @@ -240,7 +240,7 @@

packages/react-moveable/src/ables/Scrollable.ts


- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/packages_react-moveable_src_ables_Snappable.tsx.html b/release/latest/doc/packages_react-moveable_src_ables_Snappable.tsx.html index 32a2b42b4..a6596fe2f 100644 --- a/release/latest/doc/packages_react-moveable_src_ables_Snappable.tsx.html +++ b/release/latest/doc/packages_react-moveable_src_ables_Snappable.tsx.html @@ -679,6 +679,7 @@

packages/react-moveable/src/ables/Snappable.tsx

"snapDigit", "snapThreshold", "snapRenderThreshold", + "snapGridAll", NAME_snapRotationThreshold, NAME_snapRotationDegrees, "horizontalGuidelines", @@ -1319,7 +1320,7 @@

packages/react-moveable/src/ables/Snappable.tsx


- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/packages_react-moveable_src_ables_Warpable.tsx.html b/release/latest/doc/packages_react-moveable_src_ables_Warpable.tsx.html index aef46fd30..e9c3b3b3e 100644 --- a/release/latest/doc/packages_react-moveable_src_ables_Warpable.tsx.html +++ b/release/latest/doc/packages_react-moveable_src_ables_Warpable.tsx.html @@ -416,7 +416,7 @@

packages/react-moveable/src/ables/Warpable.tsx


- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/packages_react-moveable_src_ables_edgeDraggable.tsx.html b/release/latest/doc/packages_react-moveable_src_ables_edgeDraggable.tsx.html index 437e85873..0f5255978 100644 --- a/release/latest/doc/packages_react-moveable_src_ables_edgeDraggable.tsx.html +++ b/release/latest/doc/packages_react-moveable_src_ables_edgeDraggable.tsx.html @@ -160,7 +160,7 @@

packages/react-moveable/src/ables/edgeDraggable.tsx


- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/release/latest/doc/packages_react-moveable_src_types.ts.html b/release/latest/doc/packages_react-moveable_src_types.ts.html index cfd34cb7f..e5f349f05 100644 --- a/release/latest/doc/packages_react-moveable_src_types.ts.html +++ b/release/latest/doc/packages_react-moveable_src_types.ts.html @@ -317,6 +317,7 @@

packages/react-moveable/src/types.ts

container: SVGElement | HTMLElement | null | undefined; disableNativeEvent: boolean; gestos: Record<string, Gesto | CustomGesto | null>; + renderLines: number[][][]; renderPoses: number[][]; posDelta: number[]; style: Partial<Writable<CSSStyleDeclaration>>; @@ -388,6 +389,7 @@

packages/react-moveable/src/types.ts

isEnd?: boolean; isCenter?: boolean; isInner?: boolean; + grid?: boolean; pos: number[]; size: number; @@ -2678,6 +2680,12 @@

packages/react-moveable/src/types.ts

* @default 0 (0 is not used) */ snapGridHeight?: number; + /** + * In the case of a group, if `snapGridWidth` and `snapGridHeight` are used, all children can be snapped. + * Custom fixed directions are not yet allowed. Also, it cannot be applied if rotated. + * @default false + */ + snapGridAll?: boolean; /** * Whether to show snap distance. * @default true @@ -2960,6 +2968,7 @@

packages/react-moveable/src/types.ts

snapContainer: MoveableRefType<HTMLElement | SVGElement>; snapOffset: { left: number, top: number, bottom: number, right: number } snapRenderInfo?: SnapRenderInfo | null; + snapThresholdInfo?: { multiples: number[]; offset: number[]; } | null; enableSnap: boolean; } export interface SnapRenderInfo { @@ -3536,7 +3545,7 @@

packages/react-moveable/src/types.ts


- Documentation generated by JSDoc 0.4.7 on Wed Sep 20 2023 03:30:55 GMT+0900 (대한민국 표준시) using the docdash theme. + Documentation generated by JSDoc 0.4.7 on Sat Oct 28 2023 15:02:47 GMT+0900 (대한민국 표준시) using the docdash theme.
diff --git a/storybook/iframe.html b/storybook/iframe.html index 51b2f3209..053b65da7 100644 --- a/storybook/iframe.html +++ b/storybook/iframe.html @@ -383,4 +383,4 @@ - window['STORIES'] = [{"titlePrefix":"","directory":"./stories","files":"**/*.stories.mdx","importPathMatcher":"^\\.[\\\\/](?:stories(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.mdx)$"},{"titlePrefix":"","directory":"./stories","files":"**/*.stories.@(js|jsx|ts|tsx)","importPathMatcher":"^\\.[\\\\/](?:stories(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.(js|jsx|ts|tsx))$"}]; \ No newline at end of file + window['STORIES'] = [{"titlePrefix":"","directory":"./stories","files":"**/*.stories.mdx","importPathMatcher":"^\\.[\\\\/](?:stories(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.mdx)$"},{"titlePrefix":"","directory":"./stories","files":"**/*.stories.@(js|jsx|ts|tsx)","importPathMatcher":"^\\.[\\\\/](?:stories(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.(js|jsx|ts|tsx))$"}]; \ No newline at end of file diff --git a/storybook/main.c28e5f47.iframe.bundle.js b/storybook/main.c28e5f47.iframe.bundle.js new file mode 100644 index 000000000..373f61ddd --- /dev/null +++ b/storybook/main.c28e5f47.iframe.bundle.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{"../../node_modules/@storybook/builder-webpack4/node_modules/css-loader/dist/cjs.js?!../../node_modules/postcss-loader/dist/cjs.js?!./stories/99-Tests/safari.css":function(module,exports,__webpack_require__){(exports=__webpack_require__("../../node_modules/@storybook/builder-webpack4/node_modules/css-loader/dist/runtime/api.js")(!1)).push([module.i,".safari-canvas {\n margin-top: 125px;\n overflow: inherit;\n height: 1000px;\n margin-left: 120px;\n padding: 4rem 10rem;\n position: relative;\n background: #eee;\n}\n\n.safari-pages {\n -webkit-transform: scale(1.45);\n transform: scale(1.45);\n -webkit-transform-origin: center top 0px;\n transform-origin: center top 0px;\n height: 1726.35px;\n}\n\n.safari-target {\n border: 1px solid red;\n min-height: 50px;\n max-width: 100px;\n width: 100px;\n }\n",""]),module.exports=exports},"../../node_modules/@storybook/builder-webpack4/node_modules/css-loader/dist/cjs.js?!../../node_modules/postcss-loader/dist/cjs.js?!./stories/99-Tests/snap.css":function(module,exports,__webpack_require__){(exports=__webpack_require__("../../node_modules/@storybook/builder-webpack4/node_modules/css-loader/dist/runtime/api.js")(!1)).push([module.i,".snapGrid {\n background: green;\n margin-top: 20px;\n min-height: 300px;\n width: 100%;\n}\n",""]),module.exports=exports},"../../node_modules/@storybook/builder-webpack4/node_modules/css-loader/dist/cjs.js?!../../node_modules/postcss-loader/dist/cjs.js?!./stories/common.css":function(module,exports,__webpack_require__){(exports=__webpack_require__("../../node_modules/@storybook/builder-webpack4/node_modules/css-loader/dist/runtime/api.js")(!1)).push([module.i,".dark {\n color: white;\n}\n",""]),module.exports=exports},"../../node_modules/@storybook/builder-webpack4/node_modules/css-loader/dist/cjs.js?!../../node_modules/postcss-loader/dist/cjs.js?!./stories/templates/default.css":function(module,exports,__webpack_require__){(exports=__webpack_require__("../../node_modules/@storybook/builder-webpack4/node_modules/css-loader/dist/runtime/api.js")(!1)).push([module.i,'html,\nbody {\n position: relative;\n height: 100%;\n margin: 0;\n padding: 0;\n}\n\nhtml:has(.no-relative),\nbody:has(.no-relative) {\n margin: 8px;\n padding: 8px;\n position: static;\n /* border: 8px solid red; */\n}\n\nhtml:has(.no-relative) {\n position: relative;\n}\n\nhtml:has(.margin),\nbody:has(.margin) {\n /* margin-top: 50px; */\n}\n\n.margin .root {\n position: static;\n}\n\n.description {\n padding: 10px;\n}\n\n.root {\n position: relative;\n}\n\n.container {\n position: relative;\n margin-top: 50px;\n}\n\n.will-change-container {\n padding-left: 100px;\n padding-top: 100px;\n will-change: transform;\n}\n\n.will-change-target {\n position: relative;\n width: 100px;\n height: 100px;\n line-height: 100px;\n text-align: center;\n background: #ee8;\n color: #333;\n font-weight: bold;\n border: 1px solid #333;\n box-sizing: border-box;\n}\n\n.target {\n position: absolute;\n width: 100px;\n height: 100px;\n top: 150px;\n left: 100px;\n line-height: 100px;\n text-align: center;\n background: #ee8;\n color: #333;\n font-weight: bold;\n border: 1px solid #333;\n box-sizing: border-box;\n}\n\n.target1 {\n left: 120px;\n top: 120px;\n}\n\n.target2 {\n left: 300px;\n top: 140px;\n}\n\n.target3 {\n left: 180px;\n top: 250px;\n}\n\n.nested {\n position: absolute;\n border: 4px solid #ccc;\n width: 100px;\n height: 100px;\n top: 50px;\n left: 70px;\n color: #333;\n /* box-sizing: border-box; */\n}\n\n.nested.first {\n top: 150px;\n}\n\n.nested.rotate {\n -webkit-transform-origin: 0 0;\n transform-origin: 0 0;\n -webkit-transform: rotate(-30deg);\n transform: rotate(-30deg);\n}\n\n.nested.scale {\n -webkit-transform: scale(1.5, 1.5);\n transform: scale(1.5, 1.5);\n}\n\n.nested .target {\n top: 50px;\n left: 50px\n}\n\n\n/* pos guidelines */\n.moveable-normal.red {\n background: red !important;\n}\n\n/* gap guidelines */\n.moveable-gap.red {\n background: red !important;\n}\n\n/* When snapped to an element in elementGuidelines */\n.moveable-bold.red {\n background: red !important;\n}\n\n/* A dashed line between target and element */\n.moveable-dashed.red {\n border-top-color: red !important;\n border-left-color: red !important;\n}\n\n/* pos guidelines */\n.moveable-normal.green {\n background: green !important;\n}\n\n/* gap guidelines */\n.moveable-gap.green {\n background: green !important;\n}\n\n/* When snapped to an element in elementGuidelines */\n.moveable-bold.green {\n background: green !important;\n}\n\n/* A dashed line between target and element */\n.moveable-dashed.green {\n border-top-color: green !important;\n border-left-color: green !important;\n}\n\n.scrollArea {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: calc(100vh - 100px);\n overflow: auto;\n}\n\n.scrollArea:before {\n content: "";\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n height: 300%;\n width: 100%;\n background: linear-gradient(#333,\n #fff);\n}\n\n.infinite-viewer {\n height: 500px;\n}\n\n.control-padding .moveable-around-control {\n background: #f55 !important;\n}\n\n\n.cube {\n display: inline-block;\n border-radius: 5px;\n width: 40px;\n height: 40px;\n margin: 4px;\n background: #eee;\n --color: #4af;\n color: #333;\n line-height: 40px;\n text-align: center;\n}\n\n.cube .cube {\n background: #ddd;\n margin-left: 20px;\n}\n',""]),module.exports=exports},"../../node_modules/raw-loader/dist/cjs.js!./stories/0-Introduction/readme.stories.mdx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_exports__.default='\nimport { Meta } from "@storybook/addon-docs";\n\n\n\n

\n

Moveable

\n

\n\n npm version\n Github actions\n \n \n React\n Preact\n Angular\n \n \n Svelte\n Lit\n

\n

Moveable is Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable, Snappable

\n

\n Github /\n Demo /\n Storybook /\n API /\n Main Project\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Moveable
DraggableResizableScalableRotatable
\n\n\n\n\n\n\n\n
WarpablePinchableGroupableSnappable
ClippableRoundableOriginDraggableSelecto
\n\n\n## 🔥 Features\n* **Draggable** refers to the ability to drag and move targets.\n* **Resizable** indicates whether the target\'s width and height can be increased or decreased.\n* **Scalable** indicates whether the target\'s x and y can be scale of transform.\n* **Rotatable** indicates whether the target can be rotated.\n* **Warpable** indicates whether the target can be warped (distorted, bented).\n* **Pinchable** indicates whether the target can be pinched with draggable, resizable, scalable, rotatable.\n* **Groupable** indicates Whether the targets can be moved in group with draggable, resizable, scalable, rotatable.\n* **Snappable** indicates whether to snap to the guideline.\n* **OriginDraggable*** indicates Whether to drag origin.\n* **Clippable** indicates Whether to clip the target.\n* **Roundable** indicates Whether to show and drag or double click border-radius.\n* Support SVG Elements (svg, path, line, ellipse, g, rect, ...etc)\n* Support Major Browsers\n* Support 3d Transform\n\n\n## ⚙️ Installation\n### npm\n```sh\n$ npm i moveable\n```\n\n### scripts\n```html\n