const require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_pisell_components = require("../../theme/pisell-components.js");
const require_ReadOnlyView = require("./components/ReadOnlyView.js");
const require_EditView = require("./components/EditView.js");
const require_DisabledView = require("./components/DisabledView.js");
let react = require("react");
react = require_runtime.__toESM(react);
let _pisell_utils = require("@pisell/utils");
let antd = require("antd");
require("./PisellCurrency.less");
//#region src/components/pisellCurrency/PisellCurrency.tsx
/**
* PisellCurrency 货币组件
* 
* 基于 PisellNumber 派生，专门处理货币数据。
* 默认启用千分位和2位小数，符合财务规范。
* 
* @param props 组件 Props
* 
* @example
* // 受控模式
* const [price, setPrice] = useState(0);
* <PisellCurrency 
*   value={price}
*   onChange={setPrice}
*   currencySymbol="¥"
* />
* 
* @example
* // 非受控模式
* <PisellCurrency 
*   defaultValue={100}
*   currencySymbol="$"
* />
* 
* @example
* // 只读态
* <PisellCurrency 
*   mode="read"
*   value={1234.56}
*   currencySymbol="¥"
* />
* // 显示: ¥1,234.56
*/
const PisellCurrency = (props) => {
	const { mode = "edit", disabled = false } = props;
	const displayState = (0, _pisell_utils.getDisplayState)(mode, disabled);
	const render = () => {
		switch (displayState) {
			case "read": return /* @__PURE__ */ react.default.createElement(require_ReadOnlyView.default, props);
			case "edit": return /* @__PURE__ */ react.default.createElement(require_EditView.default, props);
			case "disabled": return /* @__PURE__ */ react.default.createElement(require_DisabledView.default, props);
			default: return null;
		}
	};
	const theme = require_pisell_components.getPisellComponentsThemeConfig();
	return /* @__PURE__ */ react.default.createElement(antd.ConfigProvider, { theme }, render());
};
const MemoizedPisellCurrency = react.default.memo(PisellCurrency, (prevProps, nextProps) => {
	return prevProps.value === nextProps.value && prevProps.mode === nextProps.mode && prevProps.disabled === nextProps.disabled && prevProps.currencySymbol === nextProps.currencySymbol && prevProps.symbolPosition === nextProps.symbolPosition;
});
//#endregion
exports.default = MemoizedPisellCurrency;
