"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@aplus-frontend/utils"),r=require("lodash-unified"),m=t=>t?.children&&t?.children?.length>0?r.flatten(t.children?.map(e=>m(e))):[t],y=t=>r.flatten(t?.map(e=>m(e))),a=t=>Object.prototype.toString.call(t)==="[object Array]"?t.map(e=>String(e)).join("."):t??"",x=(t,e,c)=>c?d.toThousand(t,e):d.toFixed(t,e);function C(t){const{records:e,columns:c,configList:s,exclude:i,valueTypeExtension:g}=t;if(!e||e?.length===0)return{};let o=y(c)?.filter(n=>n.valueType==="number"||g?.includes(n.valueType))?.map(n=>({key:n.key||"",dataIndex:n.dataIndex}));s&&s?.length>0&&(o=r.uniqBy(o?.concat(s),"key")),i&&i.length>0&&(o=o.filter(n=>!i.includes(n.key)));const h={};return e?.reduce((n,f)=>(o.forEach(u=>{if(!r.isNil(r.get(f,a(u.dataIndex||u.key)))){const l=u.dataIndex||u.key,p=r.get(n,a(l))||0,b=r.get(f,a(l))||0,k=d.addNumber(p,b)?.toNumber();r.set(n,l,+k)}}),n),h)}exports.computedRecords=C;exports.flattenColumns=y;exports.formatDataIndex=a;exports.formatNumber=x;
