function _extends() { _extends = Object.assign ? Object.assign.bind() : 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; }; return _extends.apply(this, arguments); }
import React, { forwardRef, useImperativeHandle, useRef } from 'react';
import { locales } from '@pisell/utils';
import localeTexts from "./locales";
import { useEngineLocale } from "./hooks";
import { ToBPayProvider } from "./store";
import { ToBPayContent } from "./components";
var ToBPay = /*#__PURE__*/forwardRef(function (props, ref) {
  var toBPayRef = useRef(null);
  var engineLocale = useEngineLocale();
  // 注册多语言
  locales.init(localeTexts, engineLocale);
  useImperativeHandle(ref, function () {
    var _toBPayRef$current;
    return {
      open: (_toBPayRef$current = toBPayRef.current) === null || _toBPayRef$current === void 0 ? void 0 : _toBPayRef$current.open
    };
  });
  console.log('toBPayProps', props);
  return /*#__PURE__*/React.createElement(ToBPayProvider, null, /*#__PURE__*/React.createElement(ToBPayContent, _extends({}, props || {}, {
    ref: toBPayRef
  })));
});
export default ToBPay;