import _objectSpread from "@babel/runtime/helpers/objectSpread2";
import React from "react";
import { i18n } from '@fishx/i18n';
import Block from "./Block";
import { PreviewBox } from "../../../utils";
import { ReactComponent as ContainerIcon } from "@svgr/webpack!../../../assets/icons/container_setting.svg";
export default (function () {
  return {
    name: "pb-editor-page-element-block",
    type: "pb-editor-page-element",
    toolbar: {
      title: i18n('PAGEBUIDER_ELEMENT_CONTAINER'),
      group: "pb-editor-element-group-container",
      toolBarPreview: /*#__PURE__*/React.createElement(ContainerIcon, null),
      preview: function preview() {
        return /*#__PURE__*/React.createElement(PreviewBox, null, /*#__PURE__*/React.createElement(ContainerIcon, null));
      }
    },
    elementType: "block",
    settings: ["pb-editor-page-element-settings-block-set", "pb-editor-page-element-settings-style-set"],
    target: ['document'],
    create: function create() {
      var _options$data, _options$data2;

      var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      return _objectSpread(_objectSpread({
        type: "block"
      }, options), {}, {
        elements: options.elements || [],
        data: _objectSpread(_objectSpread({}, options.data || {}), {}, {
          settings: _objectSpread({
            cols: {
              span: 24,
              offset: 0
            }
          }, ((_options$data = options.data) === null || _options$data === void 0 ? void 0 : _options$data.settings) || {}),
          componentSettings: _objectSpread({}, ((_options$data2 = options.data) === null || _options$data2 === void 0 ? void 0 : _options$data2.componentSettings) || {})
        })
      });
    },
    render: function render(props) {
      return /*#__PURE__*/React.createElement(Block, props);
    }
  };
});
//# sourceMappingURL=index.js.map