function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

var React = require('react');
var React__default = _interopDefault(React);
var reactLoaderSpinner = require('react-loader-spinner');
var flowbiteReact = require('flowbite-react');

function _inheritsLoose(subClass, superClass) {
  subClass.prototype = Object.create(superClass.prototype);
  subClass.prototype.constructor = subClass;
  _setPrototypeOf(subClass, superClass);
}
function _setPrototypeOf(o, p) {
  _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
    o.__proto__ = p;
    return o;
  };
  return _setPrototypeOf(o, p);
}
function _objectDestructuringEmpty(obj) {
  if (obj == null) throw new TypeError("Cannot destructure " + obj);
}

var DefaultNavbar = /*#__PURE__*/function (_Component) {
  _inheritsLoose(DefaultNavbar, _Component);
  function DefaultNavbar() {
    return _Component.apply(this, arguments) || this;
  }
  var _proto = DefaultNavbar.prototype;
  _proto.render = function render() {
    var _this$props = this.props,
      img = _this$props.img,
      title = _this$props.title,
      dark = _this$props.dark;
    return React__default.createElement("nav", {
      className: dark ? "DefaultNavbar bg-black" : "bg-white "
    }, React__default.createElement("div", {
      className: "max-w-screen-xl flex flex-wrap items-center justify-between mx-auto p-4"
    }, React__default.createElement("a", {
      href: "/",
      className: "flex items-center space-x-3 rtl:space-x-reverse"
    }, React__default.createElement("img", {
      src: img,
      className: "h-8",
      alt: " Logo"
    }), React__default.createElement("span", {
      className: "self-center text-2xl font-semibold whitespace-nowrap dark:text-white"
    }, title)), "s"));
  };
  return DefaultNavbar;
}(React.Component);

var RotatingLine = /*#__PURE__*/function (_React$Component) {
  _inheritsLoose(RotatingLine, _React$Component);
  function RotatingLine() {
    return _React$Component.apply(this, arguments) || this;
  }
  var _proto = RotatingLine.prototype;
  _proto.render = function render() {
    return React__default.createElement("div", null, React__default.createElement(reactLoaderSpinner.RotatingLines, {
      visible: true,
      width: "100",
      strokeWidth: "1",
      animationDuration: "0.75",
      ariaLabel: "rotating-lines-loading",
      strokeColor: "#FF5F00"
    }));
  };
  return RotatingLine;
}(React__default.Component);

var LoopButton = /*#__PURE__*/function (_Component) {
  _inheritsLoose(LoopButton, _Component);
  function LoopButton() {
    return _Component.apply(this, arguments) || this;
  }
  var _proto = LoopButton.prototype;
  _proto.render = function render() {
    var _this$props = this.props,
      text = _this$props.text,
      color = _this$props.color,
      rounded = _this$props.rounded,
      disabled = _this$props.disabled;
    return React__default.createElement("button", {
      className: "w-full text-white focus:outline-none font-medium text-sm px-5 py-2.5 text-center me-2 mb-2 " + (rounded ? "rounded-full" : "rounded-sm") + " " + (color === "primary" ? "bg-[#FF5F00] hover:bg-[#FF3F00]" : color === "secondary" ? "bg-[#ACACAC] hover:bg-gray-400" : "text-black bg-white hover:text-gray-400"),
      disabled: disabled
    }, text);
  };
  return LoopButton;
}(React.Component);

var LoopDivider = /*#__PURE__*/function (_Component) {
  _inheritsLoose(LoopDivider, _Component);
  function LoopDivider() {
    return _Component.apply(this, arguments) || this;
  }
  var _proto = LoopDivider.prototype;
  _proto.render = function render() {
    return React__default.createElement("hr", {
      className: "border border-gray-300 max-w-xl my-2"
    });
  };
  return LoopDivider;
}(React.Component);

var customTheme = {
  textInput: {
    field: {
      input: {
        colors: {
          "default": "bg-white border-gray-300 text-gray-900 focus:border-gray-900"
        }
      }
    }
  }
};
var LoopInput = /*#__PURE__*/function (_Component) {
  _inheritsLoose(LoopInput, _Component);
  function LoopInput() {
    return _Component.apply(this, arguments) || this;
  }
  var _proto = LoopInput.prototype;
  _proto.render = function render() {
    return React__default.createElement(flowbiteReact.Flowbite, {
      theme: {
        theme: customTheme
      }
    }, React__default.createElement(flowbiteReact.TextInput, {
      sizing: 'sm',
      color: 'default'
    }));
  };
  return LoopInput;
}(React.Component);

var LoopHintText = /*#__PURE__*/function (_Component) {
  _inheritsLoose(LoopHintText, _Component);
  function LoopHintText() {
    return _Component.apply(this, arguments) || this;
  }
  var _proto = LoopHintText.prototype;
  _proto.render = function render() {
    _objectDestructuringEmpty(this.props);
    return React__default.createElement("p", {
      className: "text-xs text-gray-400"
    }, "Your personal data will be used to process your order, support your experience throughout this website, and for other purposes described in our privacy policy.");
  };
  return LoopHintText;
}(React.Component);

var LoopLabel = /*#__PURE__*/function (_Component) {
  _inheritsLoose(LoopLabel, _Component);
  function LoopLabel() {
    return _Component.apply(this, arguments) || this;
  }
  var _proto = LoopLabel.prototype;
  _proto.render = function render() {
    var text = this.props.text;
    return React__default.createElement("div", {
      className: "text-md font-medium py-2"
    }, text);
  };
  return LoopLabel;
}(React.Component);

var LoopTitle = /*#__PURE__*/function (_Component) {
  _inheritsLoose(LoopTitle, _Component);
  function LoopTitle() {
    return _Component.apply(this, arguments) || this;
  }
  var _proto = LoopTitle.prototype;
  _proto.render = function render() {
    var text = this.props.text;
    return React__default.createElement("div", {
      className: "text-xl font-semibold py-2 capitalize"
    }, text);
  };
  return LoopTitle;
}(React.Component);

function formartNum(amount) {
  var newAmount = new Intl.NumberFormat().format(Number(amount));
  return newAmount;
}
var LoopTotalAmount = /*#__PURE__*/function (_Component) {
  _inheritsLoose(LoopTotalAmount, _Component);
  function LoopTotalAmount() {
    return _Component.apply(this, arguments) || this;
  }
  var _proto = LoopTotalAmount.prototype;
  _proto.render = function render() {
    var amount = this.props.amount;
    return React__default.createElement("div", {
      className: "text-3xl font-semibold py-2 capitalize"
    }, "KES. \xA0", formartNum({
      amount: amount
    }));
  };
  return LoopTotalAmount;
}(React.Component);

var LoopSubtitle = /*#__PURE__*/function (_Component) {
  _inheritsLoose(LoopSubtitle, _Component);
  function LoopSubtitle() {
    return _Component.apply(this, arguments) || this;
  }
  var _proto = LoopSubtitle.prototype;
  _proto.render = function render() {
    var text = this.props.text;
    return React__default.createElement("div", {
      className: "text-lg font-semibold py-2 capitalize"
    }, text);
  };
  return LoopSubtitle;
}(React.Component);

exports.DefaultNavbar = DefaultNavbar;
exports.LoopButton = LoopButton;
exports.LoopDivider = LoopDivider;
exports.LoopHintText = LoopHintText;
exports.LoopInput = LoopInput;
exports.LoopLabel = LoopLabel;
exports.LoopSubtitle = LoopSubtitle;
exports.LoopTitle = LoopTitle;
exports.LoopTotalAmount = LoopTotalAmount;
exports.RotatingLine = RotatingLine;
//# sourceMappingURL=index.js.map
