import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
// UniversalDataTool without React bundle
import React from "react";
import ReactDOM from "react-dom";
import Theme from "../components/Theme";
import UniversalSampleEditor from "../components/UniversalSampleEditor";

var open = function open(_ref) {
  var container = _ref.container,
      udt = _ref.udt,
      props = _objectWithoutProperties(_ref, ["container", "udt"]);

  ReactDOM.render(React.createElement(Theme, null, React.createElement(UniversalSampleEditor, _objectSpread(_objectSpread({}, props), {}, {
    dataset: udt,
    onModifySample: function onModifySample(index, output) {
      if (!props.onSaveSample) return;
      props.onSaveSample(_objectSpread(_objectSpread({}, udt.samples[index]), {}, {
        annotation: output
      }), index);
    }
  }))), typeof container === "string" ? document.getElementById(container) : container);
};

window.UniversalDataTool = {
  open: open,
  UniversalDataViewer: open
};