"use strict";
Object.defineProperty(exports, "__esModule", {
  value: !0
}), exports.commonAddNode = exports.transferDropData = exports.stagePosition = void 0;
var _amosJsplumb = require("amos-jsplumb");

function ownKeys(t, e) {
  var r, o = Object.keys(t);
  return Object.getOwnPropertySymbols && (r = Object.getOwnPropertySymbols(t), e && (r = r.filter(function(e) {
    return Object.getOwnPropertyDescriptor(t, e).enumerable
  })), o.push.apply(o, r)), o
}

function _objectSpread(t) {
  for (var e = 1; e < arguments.length; e++) {
    var r = null != arguments[e] ? arguments[e] : {};
    e % 2 ? ownKeys(Object(r), !0).forEach(function(e) {
      _defineProperty(t, e, r[e])
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : ownKeys(Object(r)).forEach(function(e) {
      Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e))
    })
  }
  return t
}

function _defineProperty(e, t, r) {
  return t in e ? Object.defineProperty(e, t, {
    value: r,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : e[t] = r, e
}
var stagePosition = {
  spaceX: 110,
  spaceY: 60,
  defaultSpaceY: -150,
  ratio_1: 1,
  ratio_2: 1,
  ratio_3: 3
};
exports.stagePosition = stagePosition;
var transferDropData = function(e) {
  var t = 0 < arguments.length && void 0 !== e ? e : "";
  if (-1 < t.indexOf("#")) {
    e = t.split("#");
    return {
      nodeType: e[0],
      label: e[1]
    }
  }
  return {
    nodeType: t,
    label: "节点"
  }
};
exports.transferDropData = transferDropData;
var commonAddNode = function(e) {
  var t = e.eleType;
  return {
    config: {
      label: e.labelValue,
      type: "giot" === t ? "source" : "both",
      nodeType: t,
      style: _objectSpread({}, e.position)
    },
    id: _amosJsplumb.tools.uuid()
  }
};
exports.commonAddNode = commonAddNode;
