"use strict";const c=e=>JSON.parse(JSON.stringify(e)),f=e=>e==="int"||e==="double"||e==="number"||e==="timestamp",m=(e,t,r)=>{const s=r.find(a=>a.format&&f(a.format)),n=r.find(a=>a.format&&a.format==="boolean"||a.format==="bool");return s&&(!t&&t!==0?t=null:t=o(Number(t))?Number(t):t),n&&(t=S(t)?t:!1),t},g=(e,t,r)=>(t[e]=r,r||""),d=(e,t)=>D(t,e),N=(e,t={})=>{const r=u(e);return typeof r=="object"&&Array.isArray(r)&&r.length>1?r.reduce((n,a)=>n+=`#${a}`,"_formdata_"):r[0]||e},y=e=>/^_formdata_#*/.test(e),p=(e={},t)=>{let r=JSON.parse(JSON.stringify(e)),s={};for(let n in r){let a=b(n);j(s,a,r[n])}return s},b=e=>{let t=e.replace("_formdata_#","");return t=t.split("#").map(r=>o(r)?Number(r):r),t},j=(e,t,r)=>(typeof e!="object"||u(t).reduce((s,n,a,i)=>a===i.length-1?(s[n]=r,null):(n in s||(s[n]=/^[0-9]{1,}$/.test(i[a+1])?[]:{}),s[n]),e),e);function u(e){return Array.isArray(e)?e:e.replace(/\[/g,".").replace(/\]/g,"").split(".")}const D=(e,t,r="undefined")=>{let n=u(t).reduce((a,i)=>(a||{})[i],e);return!n||n!==void 0?n:r},o=e=>!isNaN(Number(e)),S=e=>typeof e=="boolean",h=e=>{let t=!1;for(let r=0;r<e.length;r++)if(e[r].required){t=!0;break}return t},O=(e,t)=>{if(e===t)return e!==0||1/e===1/t;if(e==null||t==null)return e===t;var r=toString.call(e),s=toString.call(t);if(r!==s)return!1;switch(r){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:+e==0?1/+e===1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t}if(r=="[object Object]"){var n=Object.getOwnPropertyNames(e),a=Object.getOwnPropertyNames(t);if(n.length!=a.length)return!1;for(var i=0;i<n.length;i++){var l=n[i];if(e[l]!==t[l])return!1}return!0}if(r=="[object Array]")return e.toString()==t.toString()};exports.deepCopy=c;exports.getDataValue=d;exports.getValue=m;exports.isEqual=O;exports.isRealName=y;exports.isRequiredField=h;exports.rawData=p;exports.realName=N;exports.setDataValue=g;
