require("../../_virtual/_rolldown/runtime.js");
const require_asyncToGenerator = require("../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js");
const require_index = require("../../utils/index.js");
let _pisell_utils = require("@pisell/utils");
//#region src/plus/walletPassGallery/serve.ts
/**
* 获取钱包列表
* @param params 查询参数
* @returns Promise<{list: IWalletListItemProps[], count: number}> 钱包列表和总数
* @throws 请求失败时抛出错误
*/
const getWalletPassList = function() {
	var _ref = require_asyncToGenerator._asyncToGenerator(function* (params, options) {
		try {
			const { data } = yield require_index.request.getRequest().get(`${(options === null || options === void 0 ? void 0 : options.apiPrefix) || "/h5"}/machinecode/lowcode/list`, params);
			return data || {
				list: [],
				count: 0
			};
		} catch (error) {
			console.error(_pisell_utils.locales.getText("wallet-pass-gallery.log.getWalletListFailed"), error);
			return {
				list: [],
				count: 0
			};
		}
	});
	return function getWalletPassList(_x, _x2) {
		return _ref.apply(this, arguments);
	};
}();
/**
* 通过code绑定客户
* @param params 请求参数，包含code
* @param errCallback 错误回调
* @returns Promise<any> 绑定结果
*/
const bindCodeToCustomer = function() {
	var _ref2 = require_asyncToGenerator._asyncToGenerator(function* (params) {
		const { data } = yield require_index.request.getRequest().put(`/h5/voucher/bind/customer`, params);
		return data;
	});
	return function bindCodeToCustomer(_x3) {
		return _ref2.apply(this, arguments);
	};
}();
/**
* 用户根据code查询待绑定识别码列表
* @param params 请求参数，包含code和tag
* @param errCallback 错误回调函数
* @returns Promise<IWalletListItemProps[] | null> 未绑定的钱包卡列表
*/
const getUnbindList = function() {
	var _ref3 = require_asyncToGenerator._asyncToGenerator(function* (params) {
		const { data } = yield require_index.request.getRequest().get(`/h5/machinecode/unbind/list`, params);
		return data;
	});
	return function getUnbindList(_x4) {
		return _ref3.apply(this, arguments);
	};
}();
(function() {
	var _ref4 = require_asyncToGenerator._asyncToGenerator(function* (params) {
		try {
			const { data } = yield require_index.request.getRequest().post(`/h5/store/order/add`, params);
			return data;
		} catch (error) {
			console.error(_pisell_utils.locales.getText("wallet-pass-gallery.log.orderFailed"), error);
			throw error;
		}
	});
	return function goOrder(_x5) {
		return _ref4.apply(this, arguments);
	};
})();
/**
* 资产明细列表
* @param params 接口请求参数
* @returns 资产明细列表
*/
const getAssetList = function() {
	var _ref5 = require_asyncToGenerator._asyncToGenerator(function* (params) {
		const { data } = yield require_index.request.getRequest().get(`/h5/pay/asset/lowcode/list`, params);
		return data;
	});
	return function getAssetList(_x6) {
		return _ref5.apply(this, arguments);
	};
}();
/**
* 资产明细（admin）
*/
const getActiveLogs = function() {
	var _ref6 = require_asyncToGenerator._asyncToGenerator(function* (params) {
		const { data } = yield require_index.request.getRequest().get(`/shop/asset`, params);
		return data;
	});
	return function getActiveLogs(_x7) {
		return _ref6.apply(this, arguments);
	};
}();
/**
* 获取资产详情
* @param params 接口请求参数
* @returns 资产详情
*/
const getDetailApi = function() {
	var _ref7 = require_asyncToGenerator._asyncToGenerator(function* (params) {
		const { data } = yield require_index.request.getRequest().get(`${params.apiPrefix || "/h5"}/machinecode/lowcode/detail/${params.id}`, {
			order_behavior_count: 1,
			order_behavior_count_customer: 1,
			order_behavior_count_customer_id: params.apiPrefix === "/shop" ? params.order_behavior_count_customer_id : void 0
		}, { isOriginHost: true });
		return data;
	});
	return function getDetailApi(_x8) {
		return _ref7.apply(this, arguments);
	};
}();
/**
* 下单接口
* @param params - 订单参数
* @returns 订单响应数据
*/
const orderRechargeProduct = function() {
	var _ref8 = require_asyncToGenerator._asyncToGenerator(function* (params) {
		const { data } = yield require_index.request.getRequest().post(`/h5/order/order`, params);
		return data;
	});
	return function orderRechargeProduct(_x9) {
		return _ref8.apply(this, arguments);
	};
}();
/**
* @desc: 获取钱包信息
* @author: Arthur
* @date: 2025-11-03 15:30
*/
const getWalletDetail = function() {
	var _ref9 = require_asyncToGenerator._asyncToGenerator(function* (id) {
		return require_index.request.getRequest().get(`/h5/wallet/${id}`, {});
	});
	return function getWalletDetail(_x10) {
		return _ref9.apply(this, arguments);
	};
}();
/**
* 更新卡券持有人
* @param id 卡券ID
* @param params 更新参数
* @returns 更新结果
*/
const updateWalletPassHolder = function() {
	var _ref10 = require_asyncToGenerator._asyncToGenerator(function* (id, params) {
		const { data } = yield require_index.request.getRequest().post(`/h5/machinecode/${id}/bind-holder`, params);
		return data;
	});
	return function updateWalletPassHolder(_x11, _x12) {
		return _ref10.apply(this, arguments);
	};
}();
/**
* 获取卡券详情
* @param id 卡券ID
* @returns 卡券详情
*/
const getWalletPassDetail = function() {
	var _ref11 = require_asyncToGenerator._asyncToGenerator(function* (id, params) {
		const { data } = yield require_index.request.getRequest().get(`/h5/machinecode/lowcode/detail/${id}`, params);
		return data;
	});
	return function getWalletPassDetail(_x13, _x14) {
		return _ref11.apply(this, arguments);
	};
}();
//#endregion
exports.bindCodeToCustomer = bindCodeToCustomer;
exports.getActiveLogs = getActiveLogs;
exports.getAssetList = getAssetList;
exports.getDetailApi = getDetailApi;
exports.getUnbindList = getUnbindList;
exports.getWalletDetail = getWalletDetail;
exports.getWalletPassDetail = getWalletPassDetail;
exports.getWalletPassList = getWalletPassList;
exports.orderRechargeProduct = orderRechargeProduct;
exports.updateWalletPassHolder = updateWalletPassHolder;
