text: 'use strict';
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  
  var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
  
  var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  
  var _points = require('points');
  
  var addCurves = function addCurves(a, b) {
    var c = [];
  
    for (var i = 0, l = a.length; i < l; i++) {
      if (!a[i].curve && b[i].curve) {
        c.push(_extends({}, a[i], { curve: {
            type: 'cubic',
            x1: a[i - 1].x,
            y1: a[i - 1].y,
            x2: a[i].x,
            y2: a[i].y
          } }));
      } else {
        c.push(a[i]);
      }
    }
  
    return c;
  };
  
  var normaliseCurves = function normaliseCurves(a, b) {
    return [addCurves(a, b), addCurves(b, a)];
  };
  
  var normalisePoints = function normalisePoints(a, b) {
    var c = (0, _points.cubify)((0, _points.remove)(a));
    var d = (0, _points.cubify)((0, _points.remove)(b));
  
    if (d.length > c.length) {
      c = (0, _points.add)(c, d.length);
    } else if (c.length > d.length) {
      d = (0, _points.add)(d, c.length);
    }
  
    return normaliseCurves(c, d);
  };
  
  var normalise = function normalise(a, b) {
    var _normalisePoints = normalisePoints(a.points, b.points);
  
    var _normalisePoints2 = _slicedToArray(_normalisePoints, 2);
  
    var c = _normalisePoints2[0];
    var d = _normalisePoints2[1];
  
    return [_extends({}, a, { points: c }), _extends({}, b, { points: d })];
  };
  
  exports.default = normalise;