var global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {};
import {
  validateTypes
} from "./chunk-D3Y2XBAR.mjs";
import {
  init_define_process_env
} from "./chunk-FOPGQED5.mjs";

// ../../node_modules/@wix/showcase-organize-media/node_modules/pro-gallery/dist/esm/components/gallery/typeValidator/validateTypes.js
init_define_process_env();

// ../../node_modules/@wix/showcase-organize-media/node_modules/pro-gallery/dist/esm/components/gallery/typeValidator/typeErrorsUI.js
init_define_process_env();
import { __extends } from "tslib";
import React from "react";
function typeErrorsUI_default(typeErrors) {
  window.typeErrors = typeErrors;
  return React.createElement(
    "div",
    null,
    React.createElement("ol", null, typeErrors.map(function(errObject, i) {
      return React.createElement(Error, { errObject, key: i });
    })),
    JSON.stringify(typeErrors, null, 4)
  );
}
function Error(_a) {
  var errObject = _a.errObject;
  return React.createElement(
    "li",
    null,
    React.createElement(ErrorDescription, { errObject })
  );
}
var ErrorDescription = (
  /** @class */
  function(_super) {
    __extends(ErrorDescription2, _super);
    function ErrorDescription2(props) {
      var _this = _super.call(this, props) || this;
      _this.state = {
        showFull: false
      };
      _this.toggle = _this.toggle.bind(_this);
      return _this;
    }
    ErrorDescription2.prototype.render = function() {
      var CompToRender = this.state.showFull ? FullError : Text;
      return React.createElement(
        "a",
        { onClick: this.toggle },
        React.createElement(CompToRender, { errObject: this.props.errObject })
      );
    };
    ErrorDescription2.prototype.toggle = function() {
      this.setState({ showFull: !this.state.showFull });
    };
    return ErrorDescription2;
  }(React.Component)
);
function FullError(_a) {
  var errObject = _a.errObject;
  return React.createElement("ul", null, Object.entries(errObject).map(function(entry, i) {
    return React.createElement(Item, { entry, key: i });
  }));
}
function Item(_a) {
  var entry = _a.entry;
  var key = entry[0];
  var value = entry[1];
  var valueText = typeof value === "string" ? value : JSON.stringify(value, null, 4);
  return React.createElement("li", null, "".concat(key, ": ").concat(valueText));
}
function Text(_a) {
  var errObject = _a.errObject;
  return errObject.message;
}

// ../../node_modules/@wix/showcase-organize-media/node_modules/pro-gallery/dist/esm/components/gallery/typeValidator/validateTypes.js
var validate = validateTypes;
export {
  typeErrorsUI_default as typeErrorsUI,
  validate
};
//# sourceMappingURL=validateTypes-OWSYRJSG.mjs.map