import { getPisellComponentsThemeConfig } from "../../theme/pisell-components.js";
import ReadOnlyView from "./components/ReadOnlyView.js";
import EditView from "./components/EditView.js";
import DisabledView from "./components/DisabledView.js";
import React from "react";
import { getDisplayState } from "@pisell/utils";
import { ConfigProvider } from "antd";
import "./PisellUrl.less";
//#region src/components/pisellUrl/PisellUrl.tsx
/**
* PisellUrl URL 链接组件
* 
* URL 链接输入/展示组件，支持只读、编辑、禁用三种状态。
* 基于 Ant Design Input 组件开发，提供 URL 格式校验、协议自动补全、
* 链接跳转和协议/路径显示控制功能。
* 
* @param props 组件 Props
* 
* @example
* // 编辑态（URL 输入）
* <PisellUrl 
*   placeholder="请输入网址"
*   required
* />
* 
* @example
* // 只读态（可跳转）
* <PisellUrl 
*   mode="read"
*   value="https://www.example.com"
*   enableLinkClick
* />
* 
* @example
* // 协议自动补全
* <PisellUrl 
*   autoCompleteProtocol
*   defaultProtocol="https://"
* />
*/
const PisellUrl = (props) => {
	const { mode = "edit", disabled = false } = props;
	const displayState = getDisplayState(mode, disabled);
	const render = () => {
		switch (displayState) {
			case "read": return /* @__PURE__ */ React.createElement(ReadOnlyView, props);
			case "edit": return /* @__PURE__ */ React.createElement(EditView, props);
			case "disabled": return /* @__PURE__ */ React.createElement(DisabledView, props);
			default: return null;
		}
	};
	const theme = getPisellComponentsThemeConfig();
	return /* @__PURE__ */ React.createElement(ConfigProvider, { theme }, render());
};
var PisellUrl_default = React.memo(PisellUrl, (prevProps, nextProps) => {
	return prevProps.value === nextProps.value && prevProps.mode === nextProps.mode && prevProps.disabled === nextProps.disabled && prevProps.autoCompleteProtocol === nextProps.autoCompleteProtocol;
});
//#endregion
export { PisellUrl_default as default };
