import { g as t } from "./alasql-f59e855e.js";
import e from "react";
import { p as n } from "./fontawesome-7bcd29b1.js";
import o from "react-dom";
import { r } from "./clsx-b06d39d3.js";
var a = { exports: {} }, s = {}, i = {}, l = {};
Object.defineProperty(l, "__esModule", { value: true }), l.dontSetMe = function(t2, e2, n2) {
  if (t2[e2])
    return new Error(`Invalid prop ${e2} passed to ${n2} - do not set this, set it on the child.`);
}, l.findInArray = function(t2, e2) {
  for (let n2 = 0, o2 = t2.length; n2 < o2; n2++)
    if (e2.apply(e2, [t2[n2], n2, t2]))
      return t2[n2];
}, l.int = function(t2) {
  return parseInt(t2, 10);
}, l.isFunction = function(t2) {
  return "function" == typeof t2 || "[object Function]" === Object.prototype.toString.call(t2);
}, l.isNum = function(t2) {
  return "number" == typeof t2 && !isNaN(t2);
};
var u = {};
Object.defineProperty(u, "__esModule", { value: true }), u.browserPrefixToKey = f, u.browserPrefixToStyle = function(t2, e2) {
  return e2 ? `-${e2.toLowerCase()}-${t2}` : t2;
}, u.default = void 0, u.getPrefix = c;
const d = ["Moz", "Webkit", "O", "ms"];
function c() {
  var _a, _b;
  let t2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "transform";
  if ("undefined" == typeof window)
    return "";
  const e2 = (_b = (_a = window.document) == null ? void 0 : _a.documentElement) == null ? void 0 : _b.style;
  if (!e2)
    return "";
  if (t2 in e2)
    return "";
  for (let n2 = 0; n2 < d.length; n2++)
    if (f(t2, d[n2]) in e2)
      return d[n2];
  return "";
}
function f(t2, e2) {
  return e2 ? `${e2}${function(t3) {
    let e3 = "", n2 = true;
    for (let o2 = 0; o2 < t3.length; o2++)
      n2 ? (e3 += t3[o2].toUpperCase(), n2 = false) : "-" === t3[o2] ? n2 = true : e3 += t3[o2];
    return e3;
  }(t2)}` : t2;
}
u.default = c(), Object.defineProperty(i, "__esModule", { value: true }), i.addClassName = D, i.addEvent = function(t2, e2, n2, o2) {
  if (!t2)
    return;
  const r2 = { capture: true, ...o2 };
  t2.addEventListener ? t2.addEventListener(e2, n2, r2) : t2.attachEvent ? t2.attachEvent("on" + e2, n2) : t2["on" + e2] = n2;
}, i.addUserSelectStyles = function(t2) {
  if (!t2)
    return;
  let e2 = t2.getElementById("react-draggable-style-el");
  e2 || (e2 = t2.createElement("style"), e2.type = "text/css", e2.id = "react-draggable-style-el", e2.innerHTML = ".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n", e2.innerHTML += ".react-draggable-transparent-selection *::selection {all: inherit;}\n", t2.getElementsByTagName("head")[0].appendChild(e2));
  t2.body && D(t2.body, "react-draggable-transparent-selection");
}, i.createCSSTransform = function(t2, e2) {
  const n2 = y(t2, e2, "px");
  return { [(0, g.browserPrefixToKey)("transform", g.default)]: n2 };
}, i.createSVGTransform = function(t2, e2) {
  return y(t2, e2, "");
}, i.getTouch = function(t2, e2) {
  return t2.targetTouches && (0, p.findInArray)(t2.targetTouches, (t3) => e2 === t3.identifier) || t2.changedTouches && (0, p.findInArray)(t2.changedTouches, (t3) => e2 === t3.identifier);
}, i.getTouchIdentifier = function(t2) {
  if (t2.targetTouches && t2.targetTouches[0])
    return t2.targetTouches[0].identifier;
  if (t2.changedTouches && t2.changedTouches[0])
    return t2.changedTouches[0].identifier;
}, i.getTranslation = y, i.innerHeight = function(t2) {
  let e2 = t2.clientHeight;
  const n2 = t2.ownerDocument.defaultView.getComputedStyle(t2);
  return e2 -= (0, p.int)(n2.paddingTop), e2 -= (0, p.int)(n2.paddingBottom), e2;
}, i.innerWidth = function(t2) {
  let e2 = t2.clientWidth;
  const n2 = t2.ownerDocument.defaultView.getComputedStyle(t2);
  return e2 -= (0, p.int)(n2.paddingLeft), e2 -= (0, p.int)(n2.paddingRight), e2;
}, i.matchesSelector = m, i.matchesSelectorAndParentsTo = function(t2, e2, n2) {
  let o2 = t2;
  do {
    if (m(o2, e2))
      return true;
    if (o2 === n2)
      return false;
    o2 = o2.parentNode;
  } while (o2);
  return false;
}, i.offsetXYFromParent = function(t2, e2, n2) {
  const o2 = e2 === e2.ownerDocument.body ? { left: 0, top: 0 } : e2.getBoundingClientRect(), r2 = (t2.clientX + e2.scrollLeft - o2.left) / n2, a2 = (t2.clientY + e2.scrollTop - o2.top) / n2;
  return { x: r2, y: a2 };
}, i.outerHeight = function(t2) {
  let e2 = t2.clientHeight;
  const n2 = t2.ownerDocument.defaultView.getComputedStyle(t2);
  return e2 += (0, p.int)(n2.borderTopWidth), e2 += (0, p.int)(n2.borderBottomWidth), e2;
}, i.outerWidth = function(t2) {
  let e2 = t2.clientWidth;
  const n2 = t2.ownerDocument.defaultView.getComputedStyle(t2);
  return e2 += (0, p.int)(n2.borderLeftWidth), e2 += (0, p.int)(n2.borderRightWidth), e2;
}, i.removeClassName = v, i.removeEvent = function(t2, e2, n2, o2) {
  if (!t2)
    return;
  const r2 = { capture: true, ...o2 };
  t2.removeEventListener ? t2.removeEventListener(e2, n2, r2) : t2.detachEvent ? t2.detachEvent("on" + e2, n2) : t2["on" + e2] = null;
}, i.scheduleRemoveUserSelectStyles = function(t2) {
  window.requestAnimationFrame ? window.requestAnimationFrame(() => {
    b(t2);
  }) : b(t2);
};
var p = l, g = function(t2, e2) {
  if ("function" == typeof WeakMap)
    var n2 = /* @__PURE__ */ new WeakMap(), o2 = /* @__PURE__ */ new WeakMap();
  return function(t3, e3) {
    if (!e3 && t3 && t3.__esModule)
      return t3;
    var r2, a2, s2 = { __proto__: null, default: t3 };
    if (null === t3 || "object" != typeof t3 && "function" != typeof t3)
      return s2;
    if (r2 = e3 ? o2 : n2) {
      if (r2.has(t3))
        return r2.get(t3);
      r2.set(t3, s2);
    }
    for (const e4 in t3)
      "default" !== e4 && {}.hasOwnProperty.call(t3, e4) && ((a2 = (r2 = Object.defineProperty) && Object.getOwnPropertyDescriptor(t3, e4)) && (a2.get || a2.set) ? r2(s2, e4, a2) : s2[e4] = t3[e4]);
    return s2;
  }(t2, e2);
}(u);
let h = "";
function m(t2, e2) {
  return h || (h = (0, p.findInArray)(["matches", "webkitMatchesSelector", "mozMatchesSelector", "msMatchesSelector", "oMatchesSelector"], function(e3) {
    return (0, p.isFunction)(t2[e3]);
  })), !!(0, p.isFunction)(t2[h]) && t2[h](e2);
}
function y(t2, e2, n2) {
  let { x: o2, y: r2 } = t2, a2 = `translate(${o2}${n2},${r2}${n2})`;
  if (e2) {
    a2 = `translate(${`${"string" == typeof e2.x ? e2.x : e2.x + n2}`}, ${`${"string" == typeof e2.y ? e2.y : e2.y + n2}`})` + a2;
  }
  return a2;
}
function b(t2) {
  if (t2)
    try {
      if (t2.body && v(t2.body, "react-draggable-transparent-selection"), t2.selection)
        t2.selection.empty();
      else {
        const e2 = (t2.defaultView || window).getSelection();
        e2 && "Caret" !== e2.type && e2.removeAllRanges();
      }
    } catch (t3) {
    }
}
function D(t2, e2) {
  t2.classList ? t2.classList.add(e2) : t2.className.match(new RegExp(`(?:^|\\s)${e2}(?!\\S)`)) || (t2.className += ` ${e2}`);
}
function v(t2, e2) {
  t2.classList ? t2.classList.remove(e2) : t2.className = t2.className.replace(new RegExp(`(?:^|\\s)${e2}(?!\\S)`, "g"), "");
}
var S = {};
Object.defineProperty(S, "__esModule", { value: true }), S.canDragX = function(t2) {
  return "both" === t2.props.axis || "x" === t2.props.axis;
}, S.canDragY = function(t2) {
  return "both" === t2.props.axis || "y" === t2.props.axis;
}, S.createCoreData = function(t2, e2, n2) {
  const o2 = !(0, w.isNum)(t2.lastX), r2 = x(t2);
  return o2 ? { node: r2, deltaX: 0, deltaY: 0, lastX: e2, lastY: n2, x: e2, y: n2 } : { node: r2, deltaX: e2 - t2.lastX, deltaY: n2 - t2.lastY, lastX: t2.lastX, lastY: t2.lastY, x: e2, y: n2 };
}, S.createDraggableData = function(t2, e2) {
  const n2 = t2.props.scale;
  return { node: e2.node, x: t2.state.x + e2.deltaX / n2, y: t2.state.y + e2.deltaY / n2, deltaX: e2.deltaX / n2, deltaY: e2.deltaY / n2, lastX: t2.state.x, lastY: t2.state.y };
}, S.getBoundPosition = function(t2, e2, n2) {
  if (!t2.props.bounds)
    return [e2, n2];
  let { bounds: o2 } = t2.props;
  o2 = "string" == typeof o2 ? o2 : function(t3) {
    return { left: t3.left, top: t3.top, right: t3.right, bottom: t3.bottom };
  }(o2);
  const r2 = x(t2);
  if ("string" == typeof o2) {
    const { ownerDocument: t3 } = r2, e3 = t3.defaultView;
    let n3;
    if ("parent" === o2)
      n3 = r2.parentNode;
    else {
      n3 = r2.getRootNode().querySelector(o2);
    }
    if (!(n3 instanceof e3.HTMLElement))
      throw new Error('Bounds selector "' + o2 + '" could not find an element.');
    const a2 = n3, s2 = e3.getComputedStyle(r2), i2 = e3.getComputedStyle(a2);
    o2 = { left: -r2.offsetLeft + (0, w.int)(i2.paddingLeft) + (0, w.int)(s2.marginLeft), top: -r2.offsetTop + (0, w.int)(i2.paddingTop) + (0, w.int)(s2.marginTop), right: (0, M.innerWidth)(a2) - (0, M.outerWidth)(r2) - r2.offsetLeft + (0, w.int)(i2.paddingRight) - (0, w.int)(s2.marginRight), bottom: (0, M.innerHeight)(a2) - (0, M.outerHeight)(r2) - r2.offsetTop + (0, w.int)(i2.paddingBottom) - (0, w.int)(s2.marginBottom) };
  }
  (0, w.isNum)(o2.right) && (e2 = Math.min(e2, o2.right));
  (0, w.isNum)(o2.bottom) && (n2 = Math.min(n2, o2.bottom));
  (0, w.isNum)(o2.left) && (e2 = Math.max(e2, o2.left));
  (0, w.isNum)(o2.top) && (n2 = Math.max(n2, o2.top));
  return [e2, n2];
}, S.getControlPosition = function(t2, e2, n2) {
  const o2 = "number" == typeof e2 ? (0, M.getTouch)(t2, e2) : null;
  if ("number" == typeof e2 && !o2)
    return null;
  const r2 = x(n2), a2 = n2.props.offsetParent || r2.offsetParent || r2.ownerDocument.body;
  return (0, M.offsetXYFromParent)(o2 || t2, a2, n2.props.scale);
}, S.snapToGrid = function(t2, e2, n2) {
  const o2 = Math.round(e2 / t2[0]) * t2[0], r2 = Math.round(n2 / t2[1]) * t2[1];
  return [o2, r2];
};
var w = l, M = i;
function x(t2) {
  const e2 = t2.findDOMNode();
  if (!e2)
    throw new Error("<DraggableCore>: Unmounted during event!");
  return e2;
}
var P = {}, N = {};
Object.defineProperty(N, "__esModule", { value: true }), N.default = function() {
}, Object.defineProperty(P, "__esModule", { value: true }), P.default = void 0;
var T = function(t2, e2) {
  if ("function" == typeof WeakMap)
    var n2 = /* @__PURE__ */ new WeakMap(), o2 = /* @__PURE__ */ new WeakMap();
  return function(t3, e3) {
    if (!e3 && t3 && t3.__esModule)
      return t3;
    var r2, a2, s2 = { __proto__: null, default: t3 };
    if (null === t3 || "object" != typeof t3 && "function" != typeof t3)
      return s2;
    if (r2 = e3 ? o2 : n2) {
      if (r2.has(t3))
        return r2.get(t3);
      r2.set(t3, s2);
    }
    for (const e4 in t3)
      "default" !== e4 && {}.hasOwnProperty.call(t3, e4) && ((a2 = (r2 = Object.defineProperty) && Object.getOwnPropertyDescriptor(t3, e4)) && (a2.get || a2.set) ? r2(s2, e4, a2) : s2[e4] = t3[e4]);
    return s2;
  }(t2, e2);
}(e), C = X(n), E = X(o), O = i, j = S, _ = l, k = X(N);
function X(t2) {
  return t2 && t2.__esModule ? t2 : { default: t2 };
}
function Y(t2, e2, n2) {
  return (e2 = function(t3) {
    var e3 = function(t4, e4) {
      if ("object" != typeof t4 || !t4)
        return t4;
      var n3 = t4[Symbol.toPrimitive];
      if (void 0 !== n3) {
        var o2 = n3.call(t4, e4 || "default");
        if ("object" != typeof o2)
          return o2;
        throw new TypeError("@@toPrimitive must return a primitive value.");
      }
      return ("string" === e4 ? String : Number)(t4);
    }(t3, "string");
    return "symbol" == typeof e3 ? e3 : e3 + "";
  }(e2)) in t2 ? Object.defineProperty(t2, e2, { value: n2, enumerable: true, configurable: true, writable: true }) : t2[e2] = n2, t2;
}
const W = { start: "touchstart", move: "touchmove", stop: "touchend" }, L = { start: "mousedown", move: "mousemove", stop: "mouseup" };
let R = L, A = class extends T.Component {
  constructor() {
    super(...arguments), Y(this, "dragging", false), Y(this, "lastX", NaN), Y(this, "lastY", NaN), Y(this, "touchIdentifier", null), Y(this, "mounted", false), Y(this, "handleDragStart", (t2) => {
      if (this.props.onMouseDown(t2), !this.props.allowAnyClick && "number" == typeof t2.button && 0 !== t2.button)
        return false;
      const e2 = this.findDOMNode();
      if (!e2 || !e2.ownerDocument || !e2.ownerDocument.body)
        throw new Error("<DraggableCore> not mounted on DragStart!");
      const { ownerDocument: n2 } = e2;
      if (this.props.disabled || !(t2.target instanceof n2.defaultView.Node) || this.props.handle && !(0, O.matchesSelectorAndParentsTo)(t2.target, this.props.handle, e2) || this.props.cancel && (0, O.matchesSelectorAndParentsTo)(t2.target, this.props.cancel, e2))
        return;
      "touchstart" !== t2.type || this.props.allowMobileScroll || t2.preventDefault();
      const o2 = (0, O.getTouchIdentifier)(t2);
      this.touchIdentifier = o2;
      const r2 = (0, j.getControlPosition)(t2, o2, this);
      if (null == r2)
        return;
      const { x: a2, y: s2 } = r2, i2 = (0, j.createCoreData)(this, a2, s2);
      (0, k.default)("DraggableCore: handleDragStart: %j", i2), (0, k.default)("calling", this.props.onStart);
      false !== this.props.onStart(t2, i2) && false !== this.mounted && (this.props.enableUserSelectHack && (0, O.addUserSelectStyles)(n2), this.dragging = true, this.lastX = a2, this.lastY = s2, (0, O.addEvent)(n2, R.move, this.handleDrag), (0, O.addEvent)(n2, R.stop, this.handleDragStop));
    }), Y(this, "handleDrag", (t2) => {
      const e2 = (0, j.getControlPosition)(t2, this.touchIdentifier, this);
      if (null == e2)
        return;
      let { x: n2, y: o2 } = e2;
      if (Array.isArray(this.props.grid)) {
        let t3 = n2 - this.lastX, e3 = o2 - this.lastY;
        if ([t3, e3] = (0, j.snapToGrid)(this.props.grid, t3, e3), !t3 && !e3)
          return;
        n2 = this.lastX + t3, o2 = this.lastY + e3;
      }
      const r2 = (0, j.createCoreData)(this, n2, o2);
      (0, k.default)("DraggableCore: handleDrag: %j", r2);
      if (false !== this.props.onDrag(t2, r2) && false !== this.mounted)
        this.lastX = n2, this.lastY = o2;
      else
        try {
          this.handleDragStop(new MouseEvent("mouseup"));
        } catch (t3) {
          const e3 = document.createEvent("MouseEvents");
          e3.initMouseEvent("mouseup", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null), this.handleDragStop(e3);
        }
    }), Y(this, "handleDragStop", (t2) => {
      if (!this.dragging)
        return;
      const e2 = (0, j.getControlPosition)(t2, this.touchIdentifier, this);
      if (null == e2)
        return;
      let { x: n2, y: o2 } = e2;
      if (Array.isArray(this.props.grid)) {
        let t3 = n2 - this.lastX || 0, e3 = o2 - this.lastY || 0;
        [t3, e3] = (0, j.snapToGrid)(this.props.grid, t3, e3), n2 = this.lastX + t3, o2 = this.lastY + e3;
      }
      const r2 = (0, j.createCoreData)(this, n2, o2);
      if (false === this.props.onStop(t2, r2) || false === this.mounted)
        return false;
      const a2 = this.findDOMNode();
      a2 && this.props.enableUserSelectHack && (0, O.scheduleRemoveUserSelectStyles)(a2.ownerDocument), (0, k.default)("DraggableCore: handleDragStop: %j", r2), this.dragging = false, this.lastX = NaN, this.lastY = NaN, a2 && ((0, k.default)("DraggableCore: Removing handlers"), (0, O.removeEvent)(a2.ownerDocument, R.move, this.handleDrag), (0, O.removeEvent)(a2.ownerDocument, R.stop, this.handleDragStop));
    }), Y(this, "onMouseDown", (t2) => (R = L, this.handleDragStart(t2))), Y(this, "onMouseUp", (t2) => (R = L, this.handleDragStop(t2))), Y(this, "onTouchStart", (t2) => (R = W, this.handleDragStart(t2))), Y(this, "onTouchEnd", (t2) => (R = W, this.handleDragStop(t2)));
  }
  componentDidMount() {
    this.mounted = true;
    const t2 = this.findDOMNode();
    t2 && (0, O.addEvent)(t2, W.start, this.onTouchStart, { passive: false });
  }
  componentWillUnmount() {
    this.mounted = false;
    const t2 = this.findDOMNode();
    if (t2) {
      const { ownerDocument: e2 } = t2;
      (0, O.removeEvent)(e2, L.move, this.handleDrag), (0, O.removeEvent)(e2, W.move, this.handleDrag), (0, O.removeEvent)(e2, L.stop, this.handleDragStop), (0, O.removeEvent)(e2, W.stop, this.handleDragStop), (0, O.removeEvent)(t2, W.start, this.onTouchStart, { passive: false }), this.props.enableUserSelectHack && (0, O.scheduleRemoveUserSelectStyles)(e2);
    }
  }
  findDOMNode() {
    var _a, _b, _c;
    return ((_a = this.props) == null ? void 0 : _a.nodeRef) ? (_c = (_b = this.props) == null ? void 0 : _b.nodeRef) == null ? void 0 : _c.current : E.default.findDOMNode(this);
  }
  render() {
    return T.cloneElement(T.Children.only(this.props.children), { onMouseDown: this.onMouseDown, onMouseUp: this.onMouseUp, onTouchEnd: this.onTouchEnd });
  }
};
P.default = A, Y(A, "displayName", "DraggableCore"), Y(A, "propTypes", { allowAnyClick: C.default.bool, allowMobileScroll: C.default.bool, children: C.default.node.isRequired, disabled: C.default.bool, enableUserSelectHack: C.default.bool, offsetParent: function(t2, e2) {
  if (t2[e2] && 1 !== t2[e2].nodeType)
    throw new Error("Draggable's offsetParent must be a DOM Node.");
}, grid: C.default.arrayOf(C.default.number), handle: C.default.string, cancel: C.default.string, nodeRef: C.default.object, onStart: C.default.func, onDrag: C.default.func, onStop: C.default.func, onMouseDown: C.default.func, scale: C.default.number, className: _.dontSetMe, style: _.dontSetMe, transform: _.dontSetMe }), Y(A, "defaultProps", { allowAnyClick: false, allowMobileScroll: false, disabled: false, enableUserSelectHack: true, onStart: function() {
}, onDrag: function() {
}, onStop: function() {
}, onMouseDown: function() {
}, scale: 1 }), function(t2) {
  Object.defineProperty(t2, "__esModule", { value: true }), Object.defineProperty(t2, "DraggableCore", { enumerable: true, get: function() {
    return g2.default;
  } }), t2.default = void 0;
  var a2 = function(t3, e2) {
    if ("function" == typeof WeakMap)
      var n2 = /* @__PURE__ */ new WeakMap(), o2 = /* @__PURE__ */ new WeakMap();
    return function(t4, e3) {
      if (!e3 && t4 && t4.__esModule)
        return t4;
      var r2, a3, s3 = { __proto__: null, default: t4 };
      if (null === t4 || "object" != typeof t4 && "function" != typeof t4)
        return s3;
      if (r2 = e3 ? o2 : n2) {
        if (r2.has(t4))
          return r2.get(t4);
        r2.set(t4, s3);
      }
      for (const e4 in t4)
        "default" !== e4 && {}.hasOwnProperty.call(t4, e4) && ((a3 = (r2 = Object.defineProperty) && Object.getOwnPropertyDescriptor(t4, e4)) && (a3.get || a3.set) ? r2(s3, e4, a3) : s3[e4] = t4[e4]);
      return s3;
    }(t3, e2);
  }(e), s2 = m2(n), u2 = m2(o), d2 = r, c2 = i, f2 = S, p2 = l, g2 = m2(P), h2 = m2(N);
  function m2(t3) {
    return t3 && t3.__esModule ? t3 : { default: t3 };
  }
  function y2() {
    return y2 = Object.assign ? Object.assign.bind() : function(t3) {
      for (var e2 = 1; e2 < arguments.length; e2++) {
        var n2 = arguments[e2];
        for (var o2 in n2)
          ({}).hasOwnProperty.call(n2, o2) && (t3[o2] = n2[o2]);
      }
      return t3;
    }, y2.apply(null, arguments);
  }
  function b2(t3, e2, n2) {
    return (e2 = function(t4) {
      var e3 = function(t5, e4) {
        if ("object" != typeof t5 || !t5)
          return t5;
        var n3 = t5[Symbol.toPrimitive];
        if (void 0 !== n3) {
          var o2 = n3.call(t5, e4 || "default");
          if ("object" != typeof o2)
            return o2;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === e4 ? String : Number)(t5);
      }(t4, "string");
      return "symbol" == typeof e3 ? e3 : e3 + "";
    }(e2)) in t3 ? Object.defineProperty(t3, e2, { value: n2, enumerable: true, configurable: true, writable: true }) : t3[e2] = n2, t3;
  }
  class D2 extends a2.Component {
    static getDerivedStateFromProps(t3, e2) {
      let { position: n2 } = t3, { prevPropsPosition: o2 } = e2;
      return !n2 || o2 && n2.x === o2.x && n2.y === o2.y ? null : ((0, h2.default)("Draggable: getDerivedStateFromProps %j", { position: n2, prevPropsPosition: o2 }), { x: n2.x, y: n2.y, prevPropsPosition: { ...n2 } });
    }
    constructor(t3) {
      super(t3), b2(this, "onDragStart", (t4, e2) => {
        (0, h2.default)("Draggable: onDragStart: %j", e2);
        if (false === this.props.onStart(t4, (0, f2.createDraggableData)(this, e2)))
          return false;
        this.setState({ dragging: true, dragged: true });
      }), b2(this, "onDrag", (t4, e2) => {
        if (!this.state.dragging)
          return false;
        (0, h2.default)("Draggable: onDrag: %j", e2);
        const n2 = (0, f2.createDraggableData)(this, e2), o2 = { x: n2.x, y: n2.y, slackX: 0, slackY: 0 };
        if (this.props.bounds) {
          const { x: t5, y: e3 } = o2;
          o2.x += this.state.slackX, o2.y += this.state.slackY;
          const [r2, a3] = (0, f2.getBoundPosition)(this, o2.x, o2.y);
          o2.x = r2, o2.y = a3, o2.slackX = this.state.slackX + (t5 - o2.x), o2.slackY = this.state.slackY + (e3 - o2.y), n2.x = o2.x, n2.y = o2.y, n2.deltaX = o2.x - this.state.x, n2.deltaY = o2.y - this.state.y;
        }
        if (false === this.props.onDrag(t4, n2))
          return false;
        this.setState(o2);
      }), b2(this, "onDragStop", (t4, e2) => {
        if (!this.state.dragging)
          return false;
        if (false === this.props.onStop(t4, (0, f2.createDraggableData)(this, e2)))
          return false;
        (0, h2.default)("Draggable: onDragStop: %j", e2);
        const n2 = { dragging: false, slackX: 0, slackY: 0 };
        if (Boolean(this.props.position)) {
          const { x: t5, y: e3 } = this.props.position;
          n2.x = t5, n2.y = e3;
        }
        this.setState(n2);
      }), this.state = { dragging: false, dragged: false, x: t3.position ? t3.position.x : t3.defaultPosition.x, y: t3.position ? t3.position.y : t3.defaultPosition.y, prevPropsPosition: { ...t3.position }, slackX: 0, slackY: 0, isElementSVG: false };
    }
    componentDidMount() {
      void 0 !== window.SVGElement && this.findDOMNode() instanceof window.SVGElement && this.setState({ isElementSVG: true });
    }
    componentWillUnmount() {
      this.state.dragging && this.setState({ dragging: false });
    }
    findDOMNode() {
      var _a, _b;
      return ((_b = (_a = this.props) == null ? void 0 : _a.nodeRef) == null ? void 0 : _b.current) ?? u2.default.findDOMNode(this);
    }
    render() {
      const { axis: t3, bounds: e2, children: n2, defaultPosition: o2, defaultClassName: r2, defaultClassNameDragging: s3, defaultClassNameDragged: i2, position: l2, positionOffset: u3, scale: p3, ...h3 } = this.props;
      let m3 = {}, b3 = null;
      const D3 = !Boolean(l2) || this.state.dragging, v2 = l2 || o2, S2 = { x: (0, f2.canDragX)(this) && D3 ? this.state.x : v2.x, y: (0, f2.canDragY)(this) && D3 ? this.state.y : v2.y };
      this.state.isElementSVG ? b3 = (0, c2.createSVGTransform)(S2, u3) : m3 = (0, c2.createCSSTransform)(S2, u3);
      const w2 = (0, d2.clsx)(n2.props.className || "", r2, { [s3]: this.state.dragging, [i2]: this.state.dragged });
      return a2.createElement(g2.default, y2({}, h3, { onStart: this.onDragStart, onDrag: this.onDrag, onStop: this.onDragStop }), a2.cloneElement(a2.Children.only(n2), { className: w2, style: { ...n2.props.style, ...m3 }, transform: b3 }));
    }
  }
  t2.default = D2, b2(D2, "displayName", "Draggable"), b2(D2, "propTypes", { ...g2.default.propTypes, axis: s2.default.oneOf(["both", "x", "y", "none"]), bounds: s2.default.oneOfType([s2.default.shape({ left: s2.default.number, right: s2.default.number, top: s2.default.number, bottom: s2.default.number }), s2.default.string, s2.default.oneOf([false])]), defaultClassName: s2.default.string, defaultClassNameDragging: s2.default.string, defaultClassNameDragged: s2.default.string, defaultPosition: s2.default.shape({ x: s2.default.number, y: s2.default.number }), positionOffset: s2.default.shape({ x: s2.default.oneOfType([s2.default.number, s2.default.string]), y: s2.default.oneOfType([s2.default.number, s2.default.string]) }), position: s2.default.shape({ x: s2.default.number, y: s2.default.number }), className: p2.dontSetMe, style: p2.dontSetMe, transform: p2.dontSetMe }), b2(D2, "defaultProps", { ...g2.default.defaultProps, axis: "both", bounds: false, defaultClassName: "react-draggable", defaultClassNameDragging: "react-draggable-dragging", defaultClassNameDragged: "react-draggable-dragged", defaultPosition: { x: 0, y: 0 }, scale: 1 });
}(s);
const { default: U, DraggableCore: $ } = s;
a.exports = U, a.exports.default = U, a.exports.DraggableCore = $;
var H = a.exports;
const V = t(H);
export {
  V as D,
  H as c
};
