var e={PHONE:/^\d{10}$/,GSTIN:/^\d{2}[A-Z]{5}\d{4}[A-Z]{1}[A-Z\d]{1}[Z]{1}[A-Z\d]{1}$/,PAN:/^[A-Z]{5}\d{4}[A-Z]{1}$/,EMAIL:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,IFSC:/^[A-Z]{4}0[A-Z0-9]{6}$/,PINCODE:/^\d{6}$/,HSN_SAC:/^\d{4,8}$/};function t(t){return t?e.PHONE.test(t)?null:`Phone must be exactly 10 digits`:null}function n(t){if(!t)return null;let n=t.toUpperCase();return e.GSTIN.test(n)?null:`Invalid GSTIN format (e.g. 22AAAAA0000A1Z5)`}function r(t){if(!t)return null;let n=t.toUpperCase();return e.PAN.test(n)?null:`Invalid PAN format (e.g. ABCDE1234F)`}function i(t){return t?e.EMAIL.test(t)?null:`Invalid email address`:null}function a(t){if(!t)return null;let n=t.toUpperCase();return e.IFSC.test(n)?null:`Invalid IFSC code (e.g. SBIN0001234)`}function o(e){let t={},n=e?.data;if(!n)return t;if(typeof n==`string`)return t._general=n,t;if(typeof n.detail==`string`)return t._general=n.detail,t;for(let[e,r]of Object.entries(n))e===`non_field_errors`?t._general=Array.isArray(r)?r.join(`, `):String(r):t[e]=Array.isArray(r)?r[0]:String(r);return t}export{r as a,a as i,i as n,t as o,n as r,o as t};