require("../../../_virtual/_rolldown/runtime.js");
const require_objectSpread2 = require("../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
const require_payGroup = require("./payGroup.js");
let _pisell_utils = require("@pisell/utils");
//#region src/components/pay/toC/model.tsx
const defaultState = {
	platform: void 0,
	order: null,
	status: "init",
	payCallback: () => {},
	history: null,
	walletSetting: {
		name: "",
		popup_status: null
	},
	payGroup: { wait_amount: 0 }
};
const { Provider, Context } = (0, _pisell_utils.miniRedux)({
	namespace: "state",
	state: defaultState,
	reducers: {
		setState(state, payload) {
			return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, state), payload);
		},
		setPayGroup(state, payload) {
			let res = require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, state.payGroup), payload);
			require_payGroup.syncPayGroupToStorage(res);
			return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, state), {}, { payGroup: res });
		},
		setWalletSetting(state, payload) {
			return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, state), {}, { walletSetting: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, state.walletSetting), payload) });
		},
		init(state, payload) {
			return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, defaultState), payload);
		},
		setMiniProgramPayment(state, payload) {
			return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, state), {}, { miniProgramPayment: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, state.miniProgramPayment), payload) });
		}
	}
});
//#endregion
exports.Context = Context;
exports.Provider = Provider;
