lu-lowcode-package-form 0.11.68 → 0.11.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -421,7 +421,7 @@ function print() { __p += __j.call(arguments, '') }
421
421
  }
422
422
  }
423
423
  `,zdt=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Hdt,n=q.useContext(f6e),r=n.csp;q.useEffect(function(){Xu(t,"@ant-design-icons",{prepend:!0,csp:r})},[])},Vdt=["icon","className","onClick","style","primaryColor","secondaryColor"],UC={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function Udt(e){var t=e.primaryColor,n=e.secondaryColor;UC.primaryColor=t,UC.secondaryColor=n||k6e(t),UC.calculated=!!n}function Wdt(){return ge({},UC)}var Dy=function(t){var n=t.icon,r=t.className,o=t.onClick,i=t.style,a=t.primaryColor,s=t.secondaryColor,l=fn(t,Vdt),u=UC;if(a&&(u={primaryColor:a,secondaryColor:s||k6e(a)}),zdt(),_dt(Ite(n),"icon should be icon definiton, but got ".concat(n)),!Ite(n))return null;var c=n;return c&&typeof c.icon=="function"&&(c=ge(ge({},c),{},{icon:c.icon(u.primaryColor,u.secondaryColor)})),Vk(c.icon,"svg-".concat(c.name),ge({className:r,onClick:o,style:i,"data-icon":c.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},l))};Dy.displayName="IconReact";Dy.getTwoToneColors=Wdt;Dy.setTwoToneColors=Udt;function j6e(e){var t=L6e(e),n=we(t,2),r=n[0],o=n[1];return Dy.setTwoToneColors({primaryColor:r,secondaryColor:o})}function Kdt(){var e=Dy.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor}var Gdt=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];j6e("#1890ff");var Ap=$.forwardRef(function(e,t){var n=e.className,r=e.icon,o=e.spin,i=e.rotate,a=e.tabIndex,s=e.onClick,l=e.twoToneColor,u=fn(e,Gdt),c=$.useContext(f6e),f=c.prefixCls,d=f===void 0?"anticon":f,p=c.rootClassName,g=Pe(p,d,pe(pe({},"".concat(d,"-").concat(r.name),!!r.name),"".concat(d,"-spin"),!!o||r.name==="loading"),n),m=a;m===void 0&&s&&(m=-1);var h=i?{msTransform:"rotate(".concat(i,"deg)"),transform:"rotate(".concat(i,"deg)")}:void 0,y=L6e(l),v=we(y,2),b=v[0],C=v[1];return $.createElement("span",ge(ge({role:"img","aria-label":r.name},u),{},{ref:t,tabIndex:m,onClick:s,className:g}),$.createElement(Dy,{icon:r,primaryColor:b,secondaryColor:C,style:h}))});Ap.displayName="AntdIcon";Ap.getTwoToneColor=Kdt;Ap.setTwoToneColor=j6e;var Ydt=function(t,n){return $.createElement(Ap,ge(ge({},t),{},{ref:n,icon:Pst}))},_6e=$.forwardRef(Ydt);process.env.NODE_ENV!=="production"&&(_6e.displayName="CopyOutlined");var Xdt=function(t,n){return $.createElement(Ap,ge(ge({},t),{},{ref:n,icon:MTe}))},tU=$.forwardRef(Xdt);process.env.NODE_ENV!=="production"&&(tU.displayName="DeleteOutlined");var qdt=function(t,n){return $.createElement(Ap,ge(ge({},t),{},{ref:n,icon:uTe}))},H6e=$.forwardRef(qdt);process.env.NODE_ENV!=="production"&&(H6e.displayName="EyeOutlined");var Qdt=function(t,n){return $.createElement(Ap,ge(ge({},t),{},{ref:n,icon:A3e}))},z6e=$.forwardRef(Qdt);process.env.NODE_ENV!=="production"&&(z6e.displayName="PlusOutlined");var Zdt=function(t,n){return $.createElement(Ap,ge(ge({},t),{},{ref:n,icon:Jst}))},V6e=$.forwardRef(Zdt);process.env.NODE_ENV!=="production"&&(V6e.displayName="UploadOutlined");const Jdt=()=>{let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}};function U6e(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"id",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"title",r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"parentId",o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"children",i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:0;return ept(e,t,n,r,o,i,s=>({value:s[t],title:s[n],key:s[t],disabled:s[t]===a}))}function ept(e,t,n,r,o,i,a){if(!Array.isArray(e)||e.length===0)return[];const s=e.map(l=>({...l,...a(l)}));return s.filter(l=>{const u=s.filter(c=>l[t]===c[r]);return l[o]=u.length>0?u:[],l[r]===i})}const W6e=e=>{let{request:t,title:n,disabledValue:r,callError:o,...i}=e;const[a,s]=q.useState(!1),[l,u]=q.useState([]);q.useEffect(()=>{c()},[]);const c=async()=>{if(t&&typeof t=="function"){var f;const d=await t();if(d.code>0){o&&typeof o=="function"&&o(d.message);return}let p=U6e(((f=d.data)===null||f===void 0?void 0:f.list)||d.data||[],"id",n||"title",i.parentId||"parentId","children",0,r);p=[{value:0,title:"根节点",children:p}],i.treeData=p,u(p)}i.treeData&&u(i.treeData),s(!0)};return Ge.jsx(Mo,{...i,children:a&&Ge.jsx(xp,{...i,treeData:l,treeDefaultExpandAll:!0,style:{width:"100%"}})})};var tpt=function(e){return typeof e=="function"},npt=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";function Mte(e){npt&&(tpt(e)||console.error("useMemoizedFn expected parameter is a function, got ".concat(typeof e)));var t=q.useRef(e);t.current=q.useMemo(function(){return e},[e]);var n=q.useRef();return n.current||(n.current=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return t.current.apply(this,r)}),n.current}function rpt(e,t){if(e===t)return!0;for(var n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}function opt(e,t){var n=q.useRef({deps:t,obj:void 0,initialized:!1}).current;return(n.initialized===!1||!rpt(n.deps,t))&&(n.deps=t,n.obj=e(),n.initialized=!0),n.obj}function ipt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var K6e=ipt;function apt(e,t){return function(n){return e(t(n))}}var spt=apt;const nU=q.forwardRef((e,t)=>{let{addWrapper:n=!0,form:r,fieldName:o,fieldsValue:i,shouldUpdateKey:a,value:s,type:l,defaultValue:u,onChange:c,option_label:f,option_value:d,option_search:p,options:g,request:m,requestParams:h,callError:y,subRequest:v,sub_option_label:b="label",mode:C="single",sub_option_value:E="id",rightIconRender:S,rightIcon:w,rightIconClick:x,recordFieldsChange:O,getAllWithIds:T,removeLastFieldsValues:A,...N}=e;const[P,R]=q.useState([]),[M,B]=q.useState(!1),k=q.useRef(1),V=10,z=q.useRef(!1),L=q.useRef(!1);opt(()=>Jdt(),[]);const F=q.useRef([]),j=q.useRef(null);q.useEffect(()=>{if(s&&s!==null&&s!==void 0&&s.value){console.log(`SearchSelect ${o} value`,s);let oe=null;Array.isArray(P)&&P.length>0&&(oe=P.find(Y=>Y.value==(s==null?void 0:s.value)||Y.value==s),oe&&!_u.isEqual(oe,s)&&(console.log("new value /////",oe),typeof c=="function"&&c(oe))),oe||_(s)}},[s]),q.useEffect(()=>{H(h)},[a,h]);const _=async oe=>{m&&d&&(console.log(`[${N==null?void 0:N.label}]loadSelectOptions loadValue2`,oe),W({...h,[d]:oe==null?void 0:oe.value},null,Y=>{if(Y&&Y.length>0){let Z=Y.find(re=>re.value==(oe==null?void 0:oe.value)||re.value==oe);Z&&!_u.isEqual(Z,oe)&&typeof c=="function"&&c(Z)}}))},H=async oe=>{const Y={};k.current=1,z.current=!1,m&&typeof m=="function"&&W(oe,Y),g&&g.length>0&&R(g)},K=async oe=>{const Y={...h};Y[p]=oe,await W(Y)},W=(oe,Y,Z)=>{typeof Z=="function"&&F.current.push(Z),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{const re=F.current;F.current=[],Q(oe,Y,o).then(ue=>{for(;re.length>0;){const ie=re.shift();typeof ie=="function"&&ie(ue)}})},200)},G=async(oe,Y,Z)=>{let re=[];if(!(Y&&Object.values(Y).some(ie=>ie==="##norequest##"))){var ue;B(!0);const ie=await m({...oe,ruleParams:Y},r,Z);console.log(`[${N==null?void 0:N.label}]fetchList response`,ie),B(!1),ie.code>0?y&&typeof y=="function"&&y(ie.message):re=((ue=ie.data)===null||ue===void 0?void 0:ue.list)||ie.data}return re},X=async oe=>{if(Array.isArray(oe)){for(let Y=0;Y<oe.length;Y++){const Z=oe[Y];if(typeof v=="function"){let re=[];const{data:ue}=await v(Z);ue!=null&&ue.list&&Array.isArray(ue.list)&&(re=ue.list.map(ie=>({label:`${Z[f]}-${ie[b]}`,value:`${Z[d]}-${ie[E]}`}))),oe[Y]={...Z,label:Z[f],title:Z[f],options:re}}oe[Y]={...Z,label:Z[f],value:Z[d]}}P.length>0&&!_u.isEqual(P,oe)&&console.log(`[${N==null?void 0:N.label}]handleOptions onChange(undefined)`)}return oe},Q=async(oe,Y,Z)=>{try{let re=await G(oe,Y,Z);return re=await X(re),R(Array.isArray(re)?re:[]),re}catch(re){console.error("fetchOptions",re),B(!1)}finally{}},ee=oe=>{console.log(`[${N==null?void 0:N.label}]handleChange value`,oe),Array.isArray(oe)?c(oe.map(Y=>P.find(Z=>Z.value===Y))):c(P.find(Y=>Y.value===oe))},J=oe=>{const{target:Y}=oe;Y.scrollTop+Y.clientHeight>=Y.scrollHeight-50&&ne()},ne=async()=>{if(!(z.current||L.current)){L.current=!0;try{const oe={...h,page:k.current+1,pageSize:V};let Y=await G(oe,null,o);Y=await X(Y),Array.isArray(Y)&&Y.length>0?R(Z=>{const re=new Set(Z.map(ie=>ie.value)),ue=Y.filter(ie=>!re.has(ie.value));return[...Z,...ue]}):z.current=!0,k.current+=1}catch(oe){console.error("加载更多选项时出错",oe)}finally{L.current=!1}}};return n?Ge.jsxs(Mo,{...N,children:[Ge.jsx(oc,{ref:t,notFoundContent:M?Ge.jsx(jE,{size:"small"}):null,value:s,...N,filterOption:!1,showSearch:!!(m&&p),onSearch:m&&p?K:null,onChange:ee,style:{width:"100%",flex:1},options:P,onPopupScroll:typeof m=="function"?J:null,mode:C}),!(N!=null&&N.disabled)&&w,!(N!=null&&N.disabled)&&typeof S=="function"&&S({value:s,onChange:c,form:r,fieldName:o,recordFieldsChange:O,getAllWithIds:T,removeLastFieldsValues:A})]}):Ge.jsxs(Ge.Fragment,{children:[Ge.jsx(oc,{ref:t,notFoundContent:M?Ge.jsx(jE,{size:"small"}):null,value:s,...N,filterOption:!1,showSearch:!!(m&&p),onSearch:m&&p?K:null,onChange:ee,style:{width:"100%"},options:P,onPopupScroll:typeof m=="function"?J:null,mode:C}),!(N!=null&&N.disabled)&&w,!(N!=null&&N.disabled)&&typeof S=="function"&&S({value:s,onChange:c,form:r,fieldName:o,recordFieldsChange:O,getAllWithIds:T,removeLastFieldsValues:A})]})}),rU=e=>{let{request:t,option_label:n="label",option_value:r="id",disabledValue:o,callError:i,options:a,addWrapper:s=!0,...l}=e;const[u,c]=q.useState([]);q.useEffect(()=>{f()},[]);const f=async()=>{if(t&&typeof t=="function"){var d;const p=await t();if(p.code>0){i&&typeof i=="function"&&i(p.message);return}let g=((d=p.data)===null||d===void 0?void 0:d.list)||p.data;Array.isArray(g)&&g.length>0&&c(g.map(m=>({label:m[n],value:m[r]})))}a&&a.length>0&&c(a)};return s?Ge.jsx(Mo,{...l,children:Ge.jsx(oc,{...l,options:u,style:{width:"100%"}})}):Ge.jsx(oc,{...l,options:u,style:{width:"100%"}})},lpt=e=>{let{...t}=e;return Ge.jsx(rU,{...t,mode:"single"})},upt=e=>{let{onChange:t,value:n,...r}=e;const[o,i]=q.useState([]);return q.useEffect(()=>{if(n&&typeof n=="string")try{n=JSON.parse(n),t(n)}catch{}n&&i(n)},[n]),Ge.jsx(rU,{...r,onChange:t,mode:"multiple",value:o})},G6e=e=>{var t,n;let{readItemRender:r,readonly:o,onChange:i,onCustomChange:a,value:s,form:l,fieldName:u,...c}=e;return q.useEffect(()=>{if(s&&typeof s=="string")try{s=JSON.parse(s),l==null||l.setFieldValue(u,s),console.log("WithSingleSelect useEffect onChange////// form",l),console.log("WithSingleSelect useEffect onChange////// fieldName",u),console.log("WithSingleSelect useEffect onChange////// value",s)}catch(f){console.log("WithSingleSelect useEffect error",f)}},[s]),o?Ge.jsx("div",{className:" fmin-h-8 fflex fitems-center fgap-2 w-full fborder fborder-[#dadada] frounded fbox-border fpx-2 fpy-1 ",children:s&&s.label&&Ge.jsx(Ge.Fragment,{children:r&&typeof r=="function"?r(s):Ge.jsx("span",{children:(t=s)===null||t===void 0?void 0:t.label},`btn_${(n=s)===null||n===void 0?void 0:n.value}`)})}):Ge.jsx(nU,{addWrapper:!1,form:l,fieldName:u,...c,onChange:i,value:s,mode:"single",className:" fflex-1 foverflow-hidden"})},Y6e=e=>{let{readItemRender:t,readonly:n,onChange:r,value:o,form:i,fieldName:a,...s}=e;return q.useEffect(()=>{if(o&&typeof o=="string")try{o=JSON.parse(o),r(o)}catch{}},[o]),n?Ge.jsx("div",{className:" fh-8 fflex fitems-center fgap-2",children:Array.isArray(o)&&o.map((l,u)=>Ge.jsxs(Ge.Fragment,{children:[" ",t&&typeof t=="function"?t(l):Ge.jsx("span",{children:l==null?void 0:l.label},`btn_${l==null?void 0:l.value}`),u<o.length-1?Ge.jsx("span",{className:" ftext-gray-400",children:","}):null]}))}):Ge.jsx(nU,{addWrapper:!1,form:i,fieldName:a,...s,onChange:r,value:o,mode:"multiple",className:" fflex-1 foverflow-hidden"})},cpt=e=>{let{customComponent:t,...n}=e;return t?Ge.jsx(Mo,{...n,children:Ge.jsx(t,{...n})}):Ge.jsx(Mo,{...n,children:Ge.jsx(mc,{...n})})},X6e=e=>{let{onChange:t,value:n,multiple:r,...o}=e;const[i,a]=q.useState();q.useEffect(()=>{if(n&&typeof n=="string")try{n=JSON.parse(n),t(n);return}catch{}r?Array.isArray(n)&&a(n):(Array.isArray(n)&&(n=n[0]),a(n))},[n]);const s=l=>{Array.isArray(l)||(l=[l]),t&&typeof t=="function"&&t(l)};return Ge.jsx(W6e,{...o,onChange:s,value:i,multiple:r})},fpt=e=>{let{FetchDeptList:t,...n}=e;return Ge.jsx(X6e,{...n,title:"deptName",request:t})},dpt=e=>{let{FetchPostList:t,...n}=e;return Ge.jsx(X6e,{...n,title:"postName",request:t})};G6e.displayName="WithSingleSelect";Y6e.displayName="WithMultipleSelect";const ppt=q.forwardRef((e,t)=>(q.useImperativeHandle(t,()=>({handleChange:n=>{e==null||e.onChange(n)}}),[]),Ge.jsx(Mo,{...e,children:Ge.jsx(G6e,{...e})}))),hpt=q.forwardRef((e,t)=>(q.useImperativeHandle(t,()=>({handleChange:n=>{e==null||e.onChange(n)}}),[]),Ge.jsx(Mo,{...e,children:Ge.jsx(Y6e,{...e})}))),vpt=q.forwardRef((e,t)=>{let{value:n,onChange:r,...o}=e;const i=q.useRef(0),a=()=>{i.current++,r(i.current)};return Ge.jsxs(Mo,{...o,children:[Ge.jsxs("div",{ref:t,children:["form-set-value:",n]}),Ge.jsx(ns,{onClick:a,children:"test"})]})});var gpt=function(){},mpt=gpt(),Gv=function(e){return e!==mpt&&e!==null},ypt=Gv,bpt=Array.prototype.forEach,Cpt=Object.create,Ept=function(e,t){var n;for(n in e)t[n]=e[n]},q6e=function(e){var t=Cpt(null);return bpt.call(arguments,function(n){ypt(n)&&Ept(Object(n),t)}),t},Spt=function(){var e=Math.sign;return typeof e!="function"?!1:e(10)===1&&e(-20)===-1},$5,Fte;function wpt(){return Fte||(Fte=1,$5=function(e){return e=Number(e),isNaN(e)||e===0?e:e>0?1:-1}),$5}var xpt=Spt()?Math.sign:wpt(),Apt=xpt,Opt=Math.abs,Dpt=Math.floor,Tpt=function(e){return isNaN(e)?0:(e=Number(e),e===0||!isFinite(e)?e:Apt(e)*Dpt(Opt(e)))},$pt=Tpt,Npt=Math.max,Yv=function(e){return Npt(0,$pt(e))},Ppt=Yv,Q6e=function(e,t,n){var r;return isNaN(e)?(r=t,r>=0?n&&r?r-1:r:1):e===!1?!1:Ppt(e)},Op=function(e){if(typeof e!="function")throw new TypeError(e+" is not a function");return e},Ipt=Gv,Ty=function(e){if(!Ipt(e))throw new TypeError("Cannot use null or undefined");return e},Rpt=Op,Mpt=Ty,Fpt=Function.prototype.bind,Bte=Function.prototype.call,Bpt=Object.keys,kpt=Object.prototype.propertyIsEnumerable,Lpt=function(e,t){return function(n,r){var o,i=arguments[2],a=arguments[3];return n=Object(Mpt(n)),Rpt(r),o=Bpt(n),a&&o.sort(typeof a=="function"?Fpt.call(a,n):void 0),typeof e!="function"&&(e=o[e]),Bte.call(e,o,function(s,l){return kpt.call(n,s)?Bte.call(r,i,n[s],s,n,l):t})}},S6=Lpt("forEach"),Xv={},Z6e={exports:{}},jpt=function(){var e=Object.assign,t;return typeof e!="function"?!1:(t={foo:"raz"},e(t,{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")},N5,kte;function _pt(){return kte||(kte=1,N5=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),N5}var P5,Lte;function Hpt(){if(Lte)return P5;Lte=1;var e=Gv,t=Object.keys;return P5=function(n){return t(e(n)?Object(n):n)},P5}var I5,jte;function zpt(){return jte||(jte=1,I5=_pt()()?Object.keys:Hpt()),I5}var R5,_te;function Vpt(){if(_te)return R5;_te=1;var e=zpt(),t=Ty,n=Math.max;return R5=function(r,o){var i,a,s=n(arguments.length,2),l;for(r=Object(t(r)),l=function(u){try{r[u]=o[u]}catch(c){i||(i=c)}},a=1;a<s;++a)o=arguments[a],e(o).forEach(l);if(i!==void 0)throw i;return r},R5}var J6e=jpt()?Object.assign:Vpt(),Upt=Gv,Wpt={function:!0,object:!0},Kpt=function(e){return Upt(e)&&Wpt[typeof e]||!1};(function(e){var t=J6e,n=Kpt,r=Gv,o=Error.captureStackTrace;e.exports=function(i){var a=new Error(i),s=arguments[1],l=arguments[2];return r(l)||n(s)&&(l=s,s=null),r(l)&&t(a,l),r(s)&&(a.code=s),o&&o(a,e.exports),a}})(Z6e);var Gpt=Z6e.exports,Uk={exports:{}},M5,Hte;function e$e(){if(Hte)return M5;Hte=1;var e=Ty,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,o=Object.getOwnPropertySymbols;return M5=function(i,a){var s,l=Object(e(a));if(i=Object(e(i)),r(l).forEach(function(u){try{t(i,u,n(a,u))}catch(c){s=c}}),typeof o=="function"&&o(l).forEach(function(u){try{t(i,u,n(a,u))}catch(c){s=c}}),s!==void 0)throw s;return i},M5}var zte=Yv,t$e=function(e,t){return t},F5,Vte,Ute,Wte;try{Object.defineProperty(t$e,"length",{configurable:!0,writable:!1,enumerable:!1,value:1})}catch{}t$e.length===1?(F5={configurable:!0,writable:!1,enumerable:!1},Vte=Object.defineProperty,Uk.exports=function(e,t){return t=zte(t),e.length===t?e:(F5.value=t,Vte(e,"length",F5))}):(Wte=e$e(),Ute=function(){var e=[];return function(t){var n,r=0;if(e[t])return e[t];for(n=[];t--;)n.push("a"+(++r).toString(36));return new Function("fn","return function ("+n.join(", ")+") { return fn.apply(this, arguments); };")}}(),Uk.exports=function(e,t){var n;if(t=zte(t),e.length===t)return e;n=Ute(t)(e);try{Wte(n,e)}catch{}return n});var n$e=Uk.exports,r$e={exports:{}},Ypt=void 0,o$e=function(e){return e!==Ypt&&e!==null},Xpt=o$e,qpt={object:!0,function:!0,undefined:!0},Qpt=function(e){return Xpt(e)?hasOwnProperty.call(qpt,typeof e):!1},Zpt=Qpt,Jpt=function(e){if(!Zpt(e))return!1;try{return e.constructor?e.constructor.prototype===e:!1}catch{return!1}},eht=Jpt,tht=function(e){if(typeof e!="function"||!hasOwnProperty.call(e,"length"))return!1;try{if(typeof e.length!="number"||typeof e.call!="function"||typeof e.apply!="function")return!1}catch{return!1}return!eht(e)},nht=tht,rht=/^\s*class[\s{/}]/,oht=Function.prototype.toString,iht=function(e){return!(!nht(e)||rht.test(oht.call(e)))},B5="razdwatrzy",aht=function(){return typeof B5.contains!="function"?!1:B5.contains("dwa")===!0&&B5.contains("foo")===!1},k5,Kte;function sht(){if(Kte)return k5;Kte=1;var e=String.prototype.indexOf;return k5=function(t){return e.call(this,t,arguments[1])>-1},k5}var lht=aht()?String.prototype.contains:sht(),$O=o$e,Gte=iht,i$e=J6e,a$e=q6e,WC=lht,uht=r$e.exports=function(e,t){var n,r,o,i,a;return arguments.length<2||typeof e!="string"?(i=t,t=e,e=null):i=arguments[2],$O(e)?(n=WC.call(e,"c"),r=WC.call(e,"e"),o=WC.call(e,"w")):(n=o=!0,r=!1),a={value:t,configurable:n,enumerable:r,writable:o},i?i$e(a$e(i),a):a};uht.gs=function(e,t,n){var r,o,i,a;return typeof e!="string"?(i=n,n=t,t=e,e=null):i=arguments[3],$O(t)?Gte(t)?$O(n)?Gte(n)||(i=n,n=void 0):n=void 0:(i=t,t=n=void 0):t=void 0,$O(e)?(r=WC.call(e,"c"),o=WC.call(e,"e")):(r=!0,o=!1),a={get:t,set:n,configurable:r,enumerable:o},i?i$e(a$e(i),a):a};var qv=r$e.exports,Wk={exports:{}};(function(e,t){var n=qv,r=Op,o=Function.prototype.apply,i=Function.prototype.call,a=Object.create,s=Object.defineProperty,l=Object.defineProperties,u=Object.prototype.hasOwnProperty,c={configurable:!0,enumerable:!1,writable:!0},f,d,p,g,m,h,y;f=function(v,b){var C;return r(b),u.call(this,"__ee__")?C=this.__ee__:(C=c.value=a(null),s(this,"__ee__",c),c.value=null),C[v]?typeof C[v]=="object"?C[v].push(b):C[v]=[C[v],b]:C[v]=b,this},d=function(v,b){var C,E;return r(b),E=this,f.call(this,v,C=function(){p.call(E,v,C),o.call(b,this,arguments)}),C.__eeOnceListener__=b,this},p=function(v,b){var C,E,S,w;if(r(b),!u.call(this,"__ee__"))return this;if(C=this.__ee__,!C[v])return this;if(E=C[v],typeof E=="object")for(w=0;S=E[w];++w)(S===b||S.__eeOnceListener__===b)&&(E.length===2?C[v]=E[w?0:1]:E.splice(w,1));else(E===b||E.__eeOnceListener__===b)&&delete C[v];return this},g=function(v){var b,C,E,S,w;if(u.call(this,"__ee__")&&(S=this.__ee__[v],!!S))if(typeof S=="object"){for(C=arguments.length,w=new Array(C-1),b=1;b<C;++b)w[b-1]=arguments[b];for(S=S.slice(),b=0;E=S[b];++b)o.call(E,this,w)}else switch(arguments.length){case 1:i.call(S,this);break;case 2:i.call(S,this,arguments[1]);break;case 3:i.call(S,this,arguments[1],arguments[2]);break;default:for(C=arguments.length,w=new Array(C-1),b=1;b<C;++b)w[b-1]=arguments[b];o.call(S,this,w)}},m={on:f,once:d,off:p,emit:g},h={on:n(f),once:n(d),off:n(p),emit:n(g)},y=l({},h),e.exports=t=function(v){return v==null?a(y):l(Object(v),h)},t.methods=m})(Wk,Wk.exports);var cht=Wk.exports,L5,Yte;function fht(){return Yte||(Yte=1,L5=function(){var e=Array.from,t,n;return typeof e!="function"?!1:(t=["raz","dwa"],n=e(t),!!(n&&n!==t&&n[1]==="dwa"))}),L5}var j5,Xte;function dht(){return Xte||(Xte=1,j5=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}),j5}var _5,qte;function pht(){if(qte)return _5;qte=1;var e=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};return _5=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return e()}try{return __global__||e()}finally{delete Object.prototype.__global__}}(),_5}var H5,Qte;function w6(){return Qte||(Qte=1,H5=dht()()?globalThis:pht()),H5}var z5,Zte;function hht(){if(Zte)return z5;Zte=1;var e=w6(),t={object:!0,symbol:!0};return z5=function(){var n=e.Symbol,r;if(typeof n!="function")return!1;r=n("test symbol");try{String(r)}catch{return!1}return!(!t[typeof n.iterator]||!t[typeof n.toPrimitive]||!t[typeof n.toStringTag])},z5}var V5,Jte;function vht(){return Jte||(Jte=1,V5=function(e){return e?typeof e=="symbol"?!0:!e.constructor||e.constructor.name!=="Symbol"?!1:e[e.constructor.toStringTag]==="Symbol":!1}),V5}var U5,ene;function s$e(){if(ene)return U5;ene=1;var e=vht();return U5=function(t){if(!e(t))throw new TypeError(t+" is not a symbol");return t},U5}var W5,tne;function ght(){if(tne)return W5;tne=1;var e=qv,t=Object.create,n=Object.defineProperty,r=Object.prototype,o=t(null);return W5=function(i){for(var a=0,s,l;o[i+(a||"")];)++a;return i+=a||"",o[i]=!0,s="@@"+i,n(r,s,e.gs(null,function(u){l||(l=!0,n(this,s,e(u)),l=!1)})),s},W5}var K5,nne;function mht(){if(nne)return K5;nne=1;var e=qv,t=w6().Symbol;return K5=function(n){return Object.defineProperties(n,{hasInstance:e("",t&&t.hasInstance||n("hasInstance")),isConcatSpreadable:e("",t&&t.isConcatSpreadable||n("isConcatSpreadable")),iterator:e("",t&&t.iterator||n("iterator")),match:e("",t&&t.match||n("match")),replace:e("",t&&t.replace||n("replace")),search:e("",t&&t.search||n("search")),species:e("",t&&t.species||n("species")),split:e("",t&&t.split||n("split")),toPrimitive:e("",t&&t.toPrimitive||n("toPrimitive")),toStringTag:e("",t&&t.toStringTag||n("toStringTag")),unscopables:e("",t&&t.unscopables||n("unscopables"))})},K5}var G5,rne;function yht(){if(rne)return G5;rne=1;var e=qv,t=s$e(),n=Object.create(null);return G5=function(r){return Object.defineProperties(r,{for:e(function(o){return n[o]?n[o]:n[o]=r(String(o))}),keyFor:e(function(o){var i;t(o);for(i in n)if(n[i]===o)return i})})},G5}var Y5,one;function bht(){if(one)return Y5;one=1;var e=qv,t=s$e(),n=w6().Symbol,r=ght(),o=mht(),i=yht(),a=Object.create,s=Object.defineProperties,l=Object.defineProperty,u,c,f;if(typeof n=="function")try{String(n()),f=!0}catch{}else n=null;return c=function(p){if(this instanceof c)throw new TypeError("Symbol is not a constructor");return u(p)},Y5=u=function d(p){var g;if(this instanceof d)throw new TypeError("Symbol is not a constructor");return f?n(p):(g=a(c.prototype),p=p===void 0?"":String(p),s(g,{__description__:e("",p),__name__:e("",r(p))}))},o(u),i(u),s(c.prototype,{constructor:e(u),toString:e("",function(){return this.__name__})}),s(u.prototype,{toString:e(function(){return"Symbol ("+t(this).__description__+")"}),valueOf:e(function(){return t(this)})}),l(u.prototype,u.toPrimitive,e("",function(){var d=t(this);return typeof d=="symbol"?d:d.toString()})),l(u.prototype,u.toStringTag,e("c","Symbol")),l(c.prototype,u.toStringTag,e("c",u.prototype[u.toStringTag])),l(c.prototype,u.toPrimitive,e("c",u.prototype[u.toPrimitive])),Y5}var X5,ine;function Cht(){return ine||(ine=1,X5=hht()()?w6().Symbol:bht()),X5}var q5,ane;function Eht(){if(ane)return q5;ane=1;var e=Object.prototype.toString,t=e.call(function(){return arguments}());return q5=function(n){return e.call(n)===t},q5}var Q5,sne;function Sht(){if(sne)return Q5;sne=1;var e=Object.prototype.toString,t=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);return Q5=function(n){return typeof n=="function"&&t(e.call(n))},Q5}var Z5,lne;function wht(){if(lne)return Z5;lne=1;var e=Object.prototype.toString,t=e.call("");return Z5=function(n){return typeof n=="string"||n&&typeof n=="object"&&(n instanceof String||e.call(n)===t)||!1},Z5}var J5,une;function xht(){if(une)return J5;une=1;var e=Cht().iterator,t=Eht(),n=Sht(),r=Yv,o=Op,i=Ty,a=Gv,s=wht(),l=Array.isArray,u=Function.prototype.call,c={configurable:!0,enumerable:!0,writable:!0,value:null},f=Object.defineProperty;return J5=function(d){var p=arguments[1],g=arguments[2],m,h,y,v,b,C,E,S,w,x;if(d=Object(i(d)),a(p)&&o(p),!this||this===Array||!n(this)){if(!p){if(t(d))return b=d.length,b!==1?Array.apply(null,d):(v=new Array(1),v[0]=d[0],v);if(l(d)){for(v=new Array(b=d.length),h=0;h<b;++h)v[h]=d[h];return v}}v=[]}else m=this;if(!l(d)){if((w=d[e])!==void 0){for(E=o(w).call(d),m&&(v=new m),S=E.next(),h=0;!S.done;)x=p?u.call(p,g,S.value,h):S.value,m?(c.value=x,f(v,h,c)):v[h]=x,S=E.next(),++h;b=h}else if(s(d)){for(b=d.length,m&&(v=new m),h=0,y=0;h<b;++h)x=d[h],h+1<b&&(C=x.charCodeAt(0),C>=55296&&C<=56319&&(x+=d[++h])),x=p?u.call(p,g,x,y):x,m?(c.value=x,f(v,y,c)):v[y]=x,++y;b=y}}if(b===void 0)for(b=r(d.length),m&&(v=new m(b)),h=0;h<b;++h)x=p?u.call(p,g,d[h],h):d[h],m?(c.value=x,f(v,h,c)):v[h]=x;return m&&(c.value=null,v.length=b),v},J5}var eI,cne;function oU(){return cne||(cne=1,eI=fht()()?Array.from:xht()),eI}var Aht=oU(),Oht=Array.isArray,Dht=function(e){return Oht(e)?e:Aht(e)},Tht=Dht,$ht=Gv,Nht=Op,Pht=Array.prototype.slice,l$e;l$e=function(e){return this.map(function(t,n){return t?t(e[n]):e[n]}).concat(Pht.call(e,this.length))};var Iht=function(e){return e=Tht(e),e.forEach(function(t){$ht(t)&&Nht(t)}),l$e.bind(e)},Hx=Op,Rht=function(e){var t;return typeof e=="function"?{set:e,get:e}:(t={get:Hx(e.get)},e.set!==void 0?(t.set=Hx(e.set),e.delete&&(t.delete=Hx(e.delete)),e.clear&&(t.clear=Hx(e.clear)),t):(t.set=t.get,t))},zx=Gpt,Vx=n$e,H1=qv,u$e=cht.methods,Mht=Iht,Fht=Rht,tI=Function.prototype.apply,nI=Function.prototype.call,fne=Object.create,Bht=Object.defineProperties,kht=u$e.on,Lht=u$e.emit,jht=function(e,t,n){var r=fne(null),o,i,a,s,l,u,c,f,d,p,g,m,h,y,v;return t!==!1?i=t:isNaN(e.length)?i=1:i=e.length,n.normalizer&&(p=Fht(n.normalizer),a=p.get,s=p.set,l=p.delete,u=p.clear),n.resolvers!=null&&(v=Mht(n.resolvers)),a?y=Vx(function(b){var C,E,S=arguments;if(v&&(S=v(S)),C=a(S),C!==null&&hasOwnProperty.call(r,C))return g&&o.emit("get",C,S,this),r[C];if(S.length===1?E=nI.call(e,this,S[0]):E=tI.call(e,this,S),C===null){if(C=a(S),C!==null)throw zx("Circular invocation","CIRCULAR_INVOCATION");C=s(S)}else if(hasOwnProperty.call(r,C))throw zx("Circular invocation","CIRCULAR_INVOCATION");return r[C]=E,m&&o.emit("set",C,null,E),E},i):t===0?y=function(){var b;if(hasOwnProperty.call(r,"data"))return g&&o.emit("get","data",arguments,this),r.data;if(arguments.length?b=tI.call(e,this,arguments):b=nI.call(e,this),hasOwnProperty.call(r,"data"))throw zx("Circular invocation","CIRCULAR_INVOCATION");return r.data=b,m&&o.emit("set","data",null,b),b}:y=function(b){var C,E=arguments,S;if(v&&(E=v(arguments)),S=String(E[0]),hasOwnProperty.call(r,S))return g&&o.emit("get",S,E,this),r[S];if(E.length===1?C=nI.call(e,this,E[0]):C=tI.call(e,this,E),hasOwnProperty.call(r,S))throw zx("Circular invocation","CIRCULAR_INVOCATION");return r[S]=C,m&&o.emit("set",S,null,C),C},o={original:e,memoized:y,profileName:n.profileName,get:function(b){return v&&(b=v(b)),a?a(b):String(b[0])},has:function(b){return hasOwnProperty.call(r,b)},delete:function(b){var C;hasOwnProperty.call(r,b)&&(l&&l(b),C=r[b],delete r[b],h&&o.emit("delete",b,C))},clear:function(){var b=r;u&&u(),r=fne(null),o.emit("clear",b)},on:function(b,C){return b==="get"?g=!0:b==="set"?m=!0:b==="delete"&&(h=!0),kht.call(this,b,C)},emit:Lht,updateEnv:function(){e=o.original}},a?c=Vx(function(b){var C,E=arguments;v&&(E=v(E)),C=a(E),C!==null&&o.delete(C)},i):t===0?c=function(){return o.delete("data")}:c=function(b){return v&&(b=v(arguments)[0]),o.delete(b)},f=Vx(function(){var b,C=arguments;return t===0?r.data:(v&&(C=v(C)),a?b=a(C):b=String(C[0]),r[b])}),d=Vx(function(){var b,C=arguments;return t===0?o.has("data"):(v&&(C=v(C)),a?b=a(C):b=String(C[0]),b===null?!1:o.has(b))}),Bht(y,{__memoized__:H1(!0),delete:H1(c),clear:H1(o.clear),_get:H1(f),_has:H1(d)}),o},_ht=Op,Hht=S6,dne=Xv,zht=jht,Vht=Q6e,Uht=function e(t){var n,r,o;if(_ht(t),n=Object(arguments[1]),n.async&&n.promise)throw new Error("Options 'async' and 'promise' cannot be used together");return hasOwnProperty.call(t,"__memoized__")&&!n.force?t:(r=Vht(n.length,t.length,n.async&&dne.async),o=zht(t,r,n),Hht(dne,function(i,a){n[a]&&i(n[a],o,n)}),e.__profiler__&&e.__profiler__(o),o.updateEnv(),o.memoized)},rI,pne;function Wht(){return pne||(pne=1,rI=function(e){var t,n,r=e.length;if(!r)return"";for(t=String(e[n=0]);--r;)t+=""+e[++n];return t}),rI}var oI,hne;function Kht(){return hne||(hne=1,oI=function(e){return e?function(t){for(var n=String(t[0]),r=0,o=e;--o;)n+=""+t[++r];return n}:function(){return""}}),oI}var iI,vne;function Ght(){return vne||(vne=1,iI=function(){var e=Number.isNaN;return typeof e!="function"?!1:!e({})&&e(NaN)&&!e(34)}),iI}var aI,gne;function Yht(){return gne||(gne=1,aI=function(e){return e!==e}),aI}var sI,mne;function Xht(){return mne||(mne=1,sI=Ght()()?Number.isNaN:Yht()),sI}var lI,yne;function iU(){if(yne)return lI;yne=1;var e=Xht(),t=Yv,n=Ty,r=Array.prototype.indexOf,o=Object.prototype.hasOwnProperty,i=Math.abs,a=Math.floor;return lI=function(s){var l,u,c,f;if(!e(s))return r.apply(this,arguments);for(u=t(n(this).length),c=arguments[1],isNaN(c)?c=0:c>=0?c=a(c):c=t(this.length)-a(i(c)),l=c;l<u;++l)if(o.call(this,l)&&(f=this[l],e(f)))return l;return-1},lI}var uI,bne;function qht(){if(bne)return uI;bne=1;var e=iU(),t=Object.create;return uI=function(){var n=0,r=[],o=t(null);return{get:function(i){var a=0,s=r,l,u=i.length;if(u===0)return s[u]||null;if(s=s[u]){for(;a<u-1;){if(l=e.call(s[0],i[a]),l===-1)return null;s=s[1][l],++a}return l=e.call(s[0],i[a]),l===-1?null:s[1][l]||null}return null},set:function(i){var a=0,s=r,l,u=i.length;if(u===0)s[u]=++n;else{for(s[u]||(s[u]=[[],[]]),s=s[u];a<u-1;)l=e.call(s[0],i[a]),l===-1&&(l=s[0].push(i[a])-1,s[1].push([[],[]])),s=s[1][l],++a;l=e.call(s[0],i[a]),l===-1&&(l=s[0].push(i[a])-1),s[1][l]=++n}return o[n]=i,n},delete:function(i){var a=0,s=r,l,u=o[i],c=u.length,f=[];if(c===0)delete s[c];else if(s=s[c]){for(;a<c-1;){if(l=e.call(s[0],u[a]),l===-1)return;f.push(s,l),s=s[1][l],++a}if(l=e.call(s[0],u[a]),l===-1)return;for(i=s[1][l],s[0].splice(l,1),s[1].splice(l,1);!s[0].length&&f.length;)l=f.pop(),s=f.pop(),s[0].splice(l,1),s[1].splice(l,1)}delete o[i]},clear:function(){r=[],o=t(null)}}},uI}var cI,Cne;function Qht(){if(Cne)return cI;Cne=1;var e=iU();return cI=function(){var t=0,n=[],r=[];return{get:function(o){var i=e.call(n,o[0]);return i===-1?null:r[i]},set:function(o){return n.push(o[0]),r.push(++t),t},delete:function(o){var i=e.call(r,o);i!==-1&&(n.splice(i,1),r.splice(i,1))},clear:function(){n=[],r=[]}}},cI}var fI,Ene;function Zht(){if(Ene)return fI;Ene=1;var e=iU(),t=Object.create;return fI=function(n){var r=0,o=[[],[]],i=t(null);return{get:function(a){for(var s=0,l=o,u;s<n-1;){if(u=e.call(l[0],a[s]),u===-1)return null;l=l[1][u],++s}return u=e.call(l[0],a[s]),u===-1?null:l[1][u]||null},set:function(a){for(var s=0,l=o,u;s<n-1;)u=e.call(l[0],a[s]),u===-1&&(u=l[0].push(a[s])-1,l[1].push([[],[]])),l=l[1][u],++s;return u=e.call(l[0],a[s]),u===-1&&(u=l[0].push(a[s])-1),l[1][u]=++r,i[r]=a,r},delete:function(a){for(var s=0,l=o,u,c=[],f=i[a];s<n-1;){if(u=e.call(l[0],f[s]),u===-1)return;c.push(l,u),l=l[1][u],++s}if(u=e.call(l[0],f[s]),u!==-1){for(a=l[1][u],l[0].splice(u,1),l[1].splice(u,1);!l[0].length&&c.length;)u=c.pop(),l=c.pop(),l[0].splice(u,1),l[1].splice(u,1);delete i[a]}},clear:function(){o=[[],[]],i=t(null)}}},fI}var Sne={},dI,wne;function c$e(){if(wne)return dI;wne=1;var e=Op,t=S6,n=Function.prototype.call;return dI=function(r,o){var i={},a=arguments[2];return e(o),t(r,function(s,l,u,c){i[l]=n.call(o,a,s,l,u,c)}),i},dI}var pI,xne;function aU(){if(xne)return pI;xne=1;var e=function(n){if(typeof n!="function")throw new TypeError(n+" is not a function");return n},t=function(n){var r=document.createTextNode(""),o,i,a=0;return new n(function(){var s;if(o)i&&(o=i.concat(o));else{if(!i)return;o=i}if(i=o,o=null,typeof i=="function"){s=i,i=null,s();return}for(r.data=a=++a%2;i;)s=i.shift(),i.length||(i=null),s()}).observe(r,{characterData:!0}),function(s){if(e(s),o){typeof o=="function"?o=[o,s]:o.push(s);return}o=s,r.data=a=++a%2}};return pI=function(){if(typeof process=="object"&&process&&typeof process.nextTick=="function")return process.nextTick;if(typeof queueMicrotask=="function")return function(n){queueMicrotask(e(n))};if(typeof document=="object"&&document){if(typeof MutationObserver=="function")return t(MutationObserver);if(typeof WebKitMutationObserver=="function")return t(WebKitMutationObserver)}return typeof setImmediate=="function"?function(n){setImmediate(e(n))}:typeof setTimeout=="function"||typeof setTimeout=="object"?function(n){setTimeout(e(n),0)}:null}(),pI}var Ane;function Jht(){if(Ane)return Sne;Ane=1;var e=oU(),t=c$e(),n=e$e(),r=n$e,o=aU(),i=Array.prototype.slice,a=Function.prototype.apply,s=Object.create;return Xv.async=function(l,u){var c=s(null),f=s(null),d=u.memoized,p=u.original,g,m,h;u.memoized=r(function(y){var v=arguments,b=v[v.length-1];return typeof b=="function"&&(g=b,v=i.call(v,0,-1)),d.apply(m=this,h=v)},d);try{n(u.memoized,d)}catch{}u.on("get",function(y){var v,b,C;if(g){if(c[y]){typeof c[y]=="function"?c[y]=[c[y],g]:c[y].push(g),g=null;return}v=g,b=m,C=h,g=m=h=null,o(function(){var E;hasOwnProperty.call(f,y)?(E=f[y],u.emit("getasync",y,C,b),a.call(v,E.context,E.args)):(g=v,m=b,h=C,d.apply(b,C))})}}),u.original=function(){var y,v,b,C;return g?(y=e(arguments),v=function E(S){var w,x,O=E.id;if(O==null){o(a.bind(E,this,arguments));return}if(delete E.id,w=c[O],delete c[O],!!w)return x=e(arguments),u.has(O)&&(S?u.delete(O):(f[O]={context:this,args:x},u.emit("setasync",O,typeof w=="function"?1:w.length))),typeof w=="function"?C=a.call(w,this,x):w.forEach(function(T){C=a.call(T,this,x)},this),C},b=g,g=m=h=null,y.push(v),C=a.call(p,this,y),v.cb=b,g=v,C):a.call(p,this,arguments)},u.on("set",function(y){if(!g){u.delete(y);return}c[y]?typeof c[y]=="function"?c[y]=[c[y],g.cb]:c[y].push(g.cb):c[y]=g.cb,delete g.cb,g.id=y,g=null}),u.on("delete",function(y){var v;hasOwnProperty.call(c,y)||f[y]&&(v=f[y],delete f[y],u.emit("deleteasync",y,i.call(v.args,1)))}),u.on("clear",function(){var y=f;f=s(null),u.emit("clearasync",t(y,function(v){return i.call(v.args,1)}))})},Sne}var One={},hI,Dne;function evt(){if(Dne)return hI;Dne=1;var e=Array.prototype.forEach,t=Object.create;return hI=function(n){var r=t(null);return e.call(arguments,function(o){r[o]=!0}),r},hI}var vI,Tne;function f$e(){return Tne||(Tne=1,vI=function(e){return typeof e=="function"}),vI}var gI,$ne;function tvt(){if($ne)return gI;$ne=1;var e=f$e();return gI=function(t){try{return t&&e(t.toString)?t.toString():String(t)}catch{throw new TypeError("Passed argument cannot be stringifed")}},gI}var mI,Nne;function nvt(){if(Nne)return mI;Nne=1;var e=Ty,t=tvt();return mI=function(n){return t(e(n))},mI}var yI,Pne;function rvt(){if(Pne)return yI;Pne=1;var e=f$e();return yI=function(t){try{return t&&e(t.toString)?t.toString():String(t)}catch{return"<Non-coercible to string value>"}},yI}var bI,Ine;function ovt(){if(Ine)return bI;Ine=1;var e=rvt(),t=/[\n\r\u2028\u2029]/g;return bI=function(n){var r=e(n);return r.length>100&&(r=r.slice(0,99)+"…"),r=r.replace(t,function(o){return JSON.stringify(o).slice(1,-1)}),r},bI}var Ux={exports:{}},Rne;function d$e(){if(Rne)return Ux.exports;Rne=1,Ux.exports=e,Ux.exports.default=e;function e(t){return!!t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}return Ux.exports}var Mne;function ivt(){if(Mne)return One;Mne=1;var e=c$e(),t=evt(),n=nvt(),r=ovt(),o=d$e(),i=aU(),a=Object.create,s=t("then","then:finally","done","done:finally");return Xv.promise=function(l,u){var c=a(null),f=a(null),d=a(null);if(l===!0)l=null;else if(l=n(l),!s[l])throw new TypeError("'"+r(l)+"' is not valid promise mode");u.on("set",function(p,g,m){var h=!1;if(!o(m)){f[p]=m,u.emit("setasync",p,1);return}c[p]=1,d[p]=m;var y=function(E){var S=c[p];if(h)throw new Error(`Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode)
424
- Consider to rely on 'then' or 'done' mode instead.`);S&&(delete c[p],f[p]=E,u.emit("setasync",p,S))},v=function(){h=!0,c[p]&&(delete c[p],delete d[p],u.delete(p))},b=l;if(b||(b="then"),b==="then"){var C=function(){i(v)};m=m.then(function(E){i(y.bind(this,E))},C),typeof m.finally=="function"&&m.finally(C)}else if(b==="done"){if(typeof m.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");m.done(y,v)}else if(b==="done:finally"){if(typeof m.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if(typeof m.finally!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");m.done(y),m.finally(v)}}),u.on("get",function(p,g,m){var h;if(c[p]){++c[p];return}h=d[p];var y=function(){u.emit("getasync",p,g,m)};o(h)?typeof h.done=="function"?h.done(y):h.then(function(){i(y)}):y()}),u.on("delete",function(p){if(delete d[p],c[p]){delete c[p];return}if(hasOwnProperty.call(f,p)){var g=f[p];delete f[p],u.emit("deleteasync",p,[g])}}),u.on("clear",function(){var p=f;f=a(null),c=a(null),d=a(null),u.emit("clearasync",e(p,function(g){return[g]}))})},One}var Fne={},Bne;function avt(){if(Bne)return Fne;Bne=1;var e=Op,t=S6,n=Xv,r=Function.prototype.apply;return n.dispose=function(o,i,a){var s;if(e(o),a.async&&n.async||a.promise&&n.promise){i.on("deleteasync",s=function(l,u){r.call(o,null,u)}),i.on("clearasync",function(l){t(l,function(u,c){s(c,u)})});return}i.on("delete",s=function(l,u){o(u)}),i.on("clear",function(l){t(l,function(u,c){s(c,u)})})},Fne}var kne={},CI,Lne;function svt(){return Lne||(Lne=1,CI=2147483647),CI}var EI,jne;function lvt(){if(jne)return EI;jne=1;var e=Yv,t=svt();return EI=function(n){if(n=e(n),n>t)throw new TypeError(n+" exceeds maximum possible timeout");return n},EI}var _ne;function uvt(){if(_ne)return kne;_ne=1;var e=oU(),t=S6,n=aU(),r=d$e(),o=lvt(),i=Xv,a=Function.prototype,s=Math.max,l=Math.min,u=Object.create;return i.maxAge=function(c,f,d){var p,g,m,h;c=o(c),c&&(p=u(null),g=d.async&&i.async||d.promise&&i.promise?"async":"",f.on("set"+g,function(y){p[y]=setTimeout(function(){f.delete(y)},c),typeof p[y].unref=="function"&&p[y].unref(),h&&(h[y]&&h[y]!=="nextTick"&&clearTimeout(h[y]),h[y]=setTimeout(function(){delete h[y]},m),typeof h[y].unref=="function"&&h[y].unref())}),f.on("delete"+g,function(y){clearTimeout(p[y]),delete p[y],h&&(h[y]!=="nextTick"&&clearTimeout(h[y]),delete h[y])}),d.preFetch&&(d.preFetch===!0||isNaN(d.preFetch)?m=.333:m=s(l(Number(d.preFetch),1),0),m&&(h={},m=(1-m)*c,f.on("get"+g,function(y,v,b){h[y]||(h[y]="nextTick",n(function(){var C;h[y]==="nextTick"&&(delete h[y],f.delete(y),d.async&&(v=e(v),v.push(a)),C=f.memoized.apply(b,v),d.promise&&r(C)&&(typeof C.done=="function"?C.done(a,a):C.then(a,a)))}))}))),f.on("clear"+g,function(){t(p,function(y){clearTimeout(y)}),p={},h&&(t(h,function(y){y!=="nextTick"&&clearTimeout(y)}),h={})}))},kne}var Hne={},SI,zne;function cvt(){if(zne)return SI;zne=1;var e=Yv,t=Object.create,n=Object.prototype.hasOwnProperty;return SI=function(r){var o=0,i=1,a=t(null),s=t(null),l=0,u;return r=e(r),{hit:function(c){var f=s[c],d=++l;if(a[d]=c,s[c]=d,!f)return++o,o<=r?void 0:(c=a[i],u(c),c);if(delete a[f],i===f)for(;!n.call(a,++i););},delete:u=function(c){var f=s[c];if(f&&(delete a[f],delete s[c],--o,i===f)){if(!o){l=0,i=1;return}for(;!n.call(a,++i););}},clear:function(){o=0,i=1,a=t(null),s=t(null),l=0}}},SI}var Vne;function fvt(){if(Vne)return Hne;Vne=1;var e=Yv,t=cvt(),n=Xv;return n.max=function(r,o,i){var a,s,l;r=e(r),r&&(s=t(r),a=i.async&&n.async||i.promise&&n.promise?"async":"",o.on("set"+a,l=function(u){u=s.hit(u),u!==void 0&&o.delete(u)}),o.on("get"+a,l),o.on("delete"+a,s.delete),o.on("clear"+a,s.clear))},Hne}var Une={},Wne;function dvt(){if(Wne)return Une;Wne=1;var e=qv,t=Xv,n=Object.create,r=Object.defineProperties;return t.refCounter=function(o,i,a){var s,l;s=n(null),l=a.async&&t.async||a.promise&&t.promise?"async":"",i.on("set"+l,function(u,c){s[u]=c||1}),i.on("get"+l,function(u){++s[u]}),i.on("delete"+l,function(u){delete s[u]}),i.on("clear"+l,function(){s={}}),r(i.memoized,{deleteRef:e(function(){var u=i.get(arguments);return u===null||!s[u]?null:--s[u]?!1:(i.delete(u),!0)}),getRefCount:e(function(){var u=i.get(arguments);return u===null||!s[u]?0:s[u]})})},Une}var pvt=q6e,hvt=Q6e,vvt=Uht,gvt=function(e){var t=pvt(arguments[1]),n;return t.normalizer||(n=t.length=hvt(t.length,e.length,t.async),n!==0&&(t.primitive?n===!1?t.normalizer=Wht():n>1&&(t.normalizer=Kht()(n)):n===!1?t.normalizer=qht()():n===1?t.normalizer=Qht()():t.normalizer=Zht()(n))),t.async&&Jht(),t.promise&&ivt(),t.dispose&&avt(),t.maxAge&&uvt(),t.max&&fvt(),t.refCounter&&dvt(),vvt(e,t)};const mvt=ga(gvt),Kk=mvt(e=>{let t="",n="";try{n=`return ${e.join("")}`,console.log("funcCode",n),t=new Function(n)(),typeof t=="object"&&t!==null||(t=t.toString())}catch(r){console.error(`formula (${n}) error`,r)}return t},{primitive:!0,max:1e3,maxAge:1e3*60*1}),yvt="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Da=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=yvt[n[e]&63];return t};var p$e={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function o(l,u,c){this.fn=l,this.context=u,this.once=c||!1}function i(l,u,c,f,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var p=new o(c,f||l,d),g=n?n+u:u;return l._events[g]?l._events[g].fn?l._events[g]=[l._events[g],p]:l._events[g].push(p):(l._events[g]=p,l._eventsCount++),l}function a(l,u){--l._eventsCount===0?l._events=new r:delete l._events[u]}function s(){this._events=new r,this._eventsCount=0}s.prototype.eventNames=function(){var u=[],c,f;if(this._eventsCount===0)return u;for(f in c=this._events)t.call(c,f)&&u.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(c)):u},s.prototype.listeners=function(u){var c=n?n+u:u,f=this._events[c];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,p=f.length,g=new Array(p);d<p;d++)g[d]=f[d].fn;return g},s.prototype.listenerCount=function(u){var c=n?n+u:u,f=this._events[c];return f?f.fn?1:f.length:0},s.prototype.emit=function(u,c,f,d,p,g){var m=n?n+u:u;if(!this._events[m])return!1;var h=this._events[m],y=arguments.length,v,b;if(h.fn){switch(h.once&&this.removeListener(u,h.fn,void 0,!0),y){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,c),!0;case 3:return h.fn.call(h.context,c,f),!0;case 4:return h.fn.call(h.context,c,f,d),!0;case 5:return h.fn.call(h.context,c,f,d,p),!0;case 6:return h.fn.call(h.context,c,f,d,p,g),!0}for(b=1,v=new Array(y-1);b<y;b++)v[b-1]=arguments[b];h.fn.apply(h.context,v)}else{var C=h.length,E;for(b=0;b<C;b++)switch(h[b].once&&this.removeListener(u,h[b].fn,void 0,!0),y){case 1:h[b].fn.call(h[b].context);break;case 2:h[b].fn.call(h[b].context,c);break;case 3:h[b].fn.call(h[b].context,c,f);break;case 4:h[b].fn.call(h[b].context,c,f,d);break;default:if(!v)for(E=1,v=new Array(y-1);E<y;E++)v[E-1]=arguments[E];h[b].fn.apply(h[b].context,v)}}return!0},s.prototype.on=function(u,c,f){return i(this,u,c,f,!1)},s.prototype.once=function(u,c,f){return i(this,u,c,f,!0)},s.prototype.removeListener=function(u,c,f,d){var p=n?n+u:u;if(!this._events[p])return this;if(!c)return a(this,p),this;var g=this._events[p];if(g.fn)g.fn===c&&(!d||g.once)&&(!f||g.context===f)&&a(this,p);else{for(var m=0,h=[],y=g.length;m<y;m++)(g[m].fn!==c||d&&!g[m].once||f&&g[m].context!==f)&&h.push(g[m]);h.length?this._events[p]=h.length===1?h[0]:h:a(this,p)}return this},s.prototype.removeAllListeners=function(u){var c;return u?(c=n?n+u:u,this._events[c]&&a(this,c)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s})(p$e);var bvt=p$e.exports;const Cvt=ga(bvt),KC=new Cvt,Evt=e=>{let{children:t,layout:n,onTableAddRow:r,onTableRemoveRow:o,form:i,initializeFormRender:a,recordFieldsChange:s,mode:l,getTableWithIds:u,removeLastFieldsValues:c,getDependencyMapItem:f,renderKey:d}=e;n=n||"1";const p=v=>{const b=v.split(",").map(Number),C=24;return b.map(E=>E/b.reduce((S,w)=>S+w)*C)},g=q.useMemo(()=>p(n),[n]),m=v=>{if(typeof f=="function"){const b=f(v);if(b)return b==null?void 0:b.show}return!0},h=q.useRef({}),y=q.useMemo(()=>q.Children.toArray(t).map((v,b)=>{var C,E;const S=v.props,w=(S==null?void 0:S.componentId)||(S==null?void 0:S.__id),x=w;var O=((C=v.type)===null||C===void 0?void 0:C.displayName)||((E=v.props)===null||E===void 0?void 0:E._componentName);x in h.current||(h.current[x]=Da());const T=((S==null?void 0:S.calcHidden)||!m(x))&&l!="desgin",A=[];if(S!=null&&S.isRequired&&A.push({required:!0,message:`${S.label}必须填写`}),S!=null&&S.rules)if(Array.isArray(S.rules)){const R=S.rules.join("|");A.push({pattern:new RegExp(R),message:S.rulesFailMessage?S.rulesFailMessage:`${S.label}格式错误`})}else A.push({pattern:new RegExp(S.rules),message:S.rulesFailMessage?S.rulesFailMessage:`${S.label}格式错误`});const N=R=>{i.setFieldValue(x,R)};let P=null;return O=="Field.Table"?P=q.cloneElement(v,{onTableAddRow:r,onTableRemoveRow:o,form:i,fieldName:w,initializeFormRender:a,mode:l,recordFieldsChange:s,getTableWithIds:u,removeLastFieldsValues:c,getDependencyMapItem:f,renderKey:d}):O==="Field.WithSingleSelect"||O==="Field.WithMultipleSelect"||O==="Show.WithTable"?P=Ge.jsx(So.Item,{hidden:T,style:{margin:0},shouldUpdate:(R,M)=>{let B=!1;if(Array.isArray(S.filterRules)&&S.filterRules.length>0)for(let k of S.filterRules){if(k.valueType!="variable")continue;let V,z;if(V=R==null?void 0:R[k.value.field_key],z=M==null?void 0:M[k.value.field_key],V!==z){B=!0;break}}return B&&(h.current[x]=Da()),B},children:R=>{let{getFieldsValue:M}=R;const B=M();let k=q.cloneElement(v,{onTableAddRow:r,onTableRemoveRow:o,form:i,fieldName:x,onCustomChange:N,fieldsValue:B,initializeFormRender:a,recordFieldsChange:s,getTableWithIds:u,removeLastFieldsValues:c,shouldUpdateKey:h.current[x]});return O==="Show.WithTable"?Ge.jsx(Ge.Fragment,{children:k}):Ge.jsx(So.Item,{style:{marginBottom:0},label:"",name:x,rules:A,children:k})}}):q.isValidElement(v)?P=Ge.jsx(So.Item,{style:{marginBottom:0},label:"",name:w,rules:A,hidden:T,children:q.cloneElement(v,{form:i,fieldName:w,initializeFormRender:a,recordFieldsChange:s})},`${w}-form-item`):P=v,(g==null?void 0:g[b])&&Ge.jsx(Ay,{span:g[b],children:P},b)}),[t,g,d]);return Ge.jsx(v2,{gutter:24,children:y})},Svt=e=>{let{title:t}=e;return t?Ge.jsx("div",{className:"fh-11 fflex fitems-center ftext-lg ffont-medium ",children:Ge.jsx("span",{className:"fborder-l-4 fborder-slate-300 fpl-2 ",children:t})}):null};function wvt(e,t,n){const r=[];let o=[];const i=(s,l)=>{const u=s-l.length;u>0&&l.push(...new Array(u).fill(q.createElement("div")))};for(const s of e){var a;const{_componentName:l}=(s==null?void 0:s.props)||{},u=((a=s.type)===null||a===void 0?void 0:a.displayName)||l;u&&u.startsWith("Layout.")?(o.length>0&&(i(t,o),r.push(o),o=[]),r.push([s])):(o.push(s),o.filter(f=>{var d,p,g,m;const h=((d=f.props)===null||d===void 0?void 0:d.componentId)||((p=f.props)===null||p===void 0?void 0:p.__id);return(!n.has(h)||((g=n.get(h))===null||g===void 0?void 0:g.show))&&!(f!=null&&(m=f.props)!==null&&m!==void 0&&m.calcHidden)}).length===t&&(r.push(o),o=[]))}return o.length>0&&(i(t,o),r.push(o)),r}const sU=q.forwardRef((e,t)=>{let{cols:n=1,children:r,mode:o="view"}=e;const[i]=So.useForm(),a=q.useRef(null),[s,l]=q.useState(null),u=q.useRef(null),c=()=>{const H=j();_u.isEqual(a.current,H)||(a.current=H,l(H))},f=q.useRef(0),d=q.useRef({currentCycleId:0,updatePath:[],MAX_DEPTH:30,startNewCycle:function(){return this.currentCycleId++,this.updatePath=[],this.currentCycleId},addToPath:function(H){if(this.updatePath.length>=this.MAX_DEPTH){console.warn(`依赖路径深度超过限制(${this.MAX_DEPTH}),可能存在过深嵌套`);return}H&&this.updatePath.push(H)},hasCircularDependency:function(H){return H?this.updatePath.includes(H):!1},getCurrentPath:function(){return[...this.updatePath]},finishField:function(){this.updatePath.length>0&&this.updatePath.pop()}});q.useImperativeHandle(t,()=>({formRef:i,setFieldsValue:H=>{f.current=1;let K={...H,__id:H==null?void 0:H.id};for(let W in H)if(P.current[W]={name:W,value:H[W]},u.current.has(W)&&u.current.get(W).componentName=="Field.Table"&&Array.isArray(H[W]))for(let G=0;G<H[W].length;G++){const X=H[W][G];for(let Q in X)P.current[[W,G,Q]]={name:[W,G,Q],value:X[Q]}}i.setFieldsValue(K),M()},initializeFieldVisibility:H=>{b(H)}}),[]);const p=q.useCallback(_u.throttle(async()=>{await y(),console.log("initializeDependencyMap"),requestAnimationFrame(()=>{c()})},300),[r,n]);q.useEffect(()=>(console.log("UseEffect throttledInitializeFormRender"),p(),()=>{p.cancel()}),[r,n]);const g=()=>{p()},m=q.useRef(null),h=H=>{var K;return(K=m.current)===null||K===void 0?void 0:K[H]},y=async()=>{const H=[];function K(G){var X,Q;let ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;var J=((X=G.type)===null||X===void 0?void 0:X.displayName)||((Q=G.props)===null||Q===void 0?void 0:Q._componentName);const{props:ne}=G;if(J&&(J.startsWith("Field.")||J.startsWith("Layout."))){let Z=(ne==null?void 0:ne.componentId)||(ne==null?void 0:ne.__id),re=[];if(ee&&ee!==null&&ee!==void 0&&ee.props){var oe,Y;Z=`${(ee==null||(oe=ee.props)===null||oe===void 0?void 0:oe.componentId)||(ee==null||(Y=ee.props)===null||Y===void 0?void 0:Y.__id)}.${Z}`}ne!=null&&ne.withId&&re.push(ne==null?void 0:ne.withId),ne!=null&&ne.withIds&&(re=[...re,...ne==null?void 0:ne.withIds]),H.push({identifier:Z,withIds:re,component:G,componentName:J,fillRules:ne==null?void 0:ne.fillRules})}ne!=null&&ne.children&&q.Children.toArray(ne==null?void 0:ne.children).forEach(re=>K(re,J&&J.startsWith("Field.")?G:null))}u.current=new Map,console.log(" fields",H);const W=q.Children.toArray(r);for(let G=0;G<W.length;G++){const X=W[G];K(X)}H.forEach(G=>{const{identifier:X}=G;u.current.set(X,{children:H.filter(Q=>Q.withIds.some(ee=>ee==X)),show:!0,...G})}),await v()},v=async function(){let H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;console.log("initializeFieldVisibility *************************************");const K=i.getFieldsValue();await Promise.all(Array.from(u.current.keys()).map(async W=>{await C(W,K,!0)})),H&&c()},b=_u.debounce(async function(){let H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;await v(H)},100),C=async function(H,K){let W=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,G=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(o=="desgin")return console.log("设计模式下不进行字段级联计算"),!1;console.log("handleFieldsWith identifier",H);let X=!1,Q=[];Array.isArray(H)&&(Q=[...H.slice(0,-1)],H=H.filter(J=>typeof J=="string").join("."));const ee=G||H;if(d.current.hasCircularDependency(ee)){const J=d.current.getCurrentPath();return console.log(`检测到循环依赖链路: ${[...J,ee].join(" -> ")}`),!1}d.current.addToPath(ee);try{if(u.current.has(H)){const J=u.current.get(H),ne=J.children;!W&&J!==null&&J!==void 0&&J.fillRules&&Array.isArray(J==null?void 0:J.fillRules)&&(J==null?void 0:J.fillRules.length)>0&&x(H,Q,K,J==null?void 0:J.fillRules);for(let oe=0;oe<ne.length;oe++){const Y=ne[oe];if(Y.component.props.withVisibleFunc&&typeof Y.component.props.withVisibleFunc=="function"){let Z=O(K,Y,Q);X=X||Z}if(Y.component.props.withVisible){let Z=await T(K,Y,Q,J==null?void 0:J.componentName);X=X||Z}!W&&Y.component.props.withFill&&await A(K,Y,Q,J==null?void 0:J.componentName,ee)}}}finally{d.current.finishField()}return X},E=function(H){let K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(m.current)if(K){const W=Object.keys(m.current);for(let G=0;G<W.length;G++){const X=W[G];X.includes(`${H},`)&&delete m.current[X]}}else delete m.current[H]},S=(H,K)=>{P.current||(P.current={}),P.current[H]=K},w=function(H){let K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;console.log("recordFieldsChange",H,K);var W=Object.keys(H);W.length>0&&(W.forEach(G=>{S(G,H[G])}),K&&M())},x=(H,K,W,G)=>{let X=N("fieldsValue",H,W,null),Q={};Array.isArray(H)&&H.filter(Z=>typeof Z=="string").join(".");let ee=[];for(let Z=0;Z<G.length;Z++){const re=G[Z];let{source:ue,target:ie}=re,le=X==null?void 0:X[ue],be=le;if(Array.isArray(H)&&H.filter(fe=>typeof fe=="string").join("."),Array.isArray(ie)&&ie.filter(fe=>typeof fe=="string").join("."),(re==null?void 0:re.type)==1){if(u.current.has(ie)){var J,ne,oe;let ve=(J=u.current.get(ie))===null||J===void 0||(ne=J.component)===null||ne===void 0||(oe=ne.props)===null||oe===void 0?void 0:oe.children;Array.isArray(ve)&&ve.length>0&&ee.push(ve.map(Ce=>{var Ae,Re;return`${ue}.${(Ce==null||(Ae=Ce.props)===null||Ae===void 0?void 0:Ae.componentId)||(Ce==null||(Re=Ce.props)===null||Re===void 0?void 0:Re.__id)}`}))}if(le&&typeof le=="string")try{le=JSON.parse(le)}catch(ve){console.error("error end",ve)}if(!Array.isArray(le))return;be=le.map((ve,Ce)=>{let Ae={};if(re!=null&&re.subRules&&Array.isArray(re==null?void 0:re.subRules)&&(re==null?void 0:re.subRules.length)>0)for(let Re=0;Re<(re==null?void 0:re.subRules.length);Re++){const{source:Xe,target:Ue}=re==null?void 0:re.subRules[Re];Ae[Ue]=ve==null?void 0:ve[Xe];let qe={name:[ie,Ce,Ue],value:ve==null?void 0:ve[Xe]};Q[qe.name]=qe}return Ae}),E(ie,!0),KC.emit("reloadTable",ie)}else{let fe=0;if(K&&Array.isArray(K)&&K.length>1&&(K.filter(ve=>typeof ve=="string").join("."),fe=K[K.length-1],ie=[...K,ie],Array.isArray(X)&&X.length>fe)){var Y;be=(Y=X[fe])===null||Y===void 0?void 0:Y[ue]}Q[ie]={name:Array.isArray(ie)?ie:[ie],value:be}}(re==null?void 0:re.type)==1&&i.setFieldValue(ie,void 0),i.setFieldValue(ie,be)}setTimeout(()=>{w(Q,!0),ee.length>0&&ee.forEach(Z=>{Array.isArray(Z)&&Z.length>0&&V(Z)})},0)},O=(H,K,W)=>{var G,X;let Q=!1;const ee=K==null||(G=K.component)===null||G===void 0||(X=G.props)===null||X===void 0?void 0:X.withVisibleFunc(H),J=K==null?void 0:K.identifier;if(u.current.has(J)){const ne=u.current.get(J);ne.show!==ee&&(ne.show=ee,u.current.set(J,ne),Q=!0)}return Q},T=async(H,K,W,G)=>{var X,Q;let ee=!1;const J=K==null||(X=K.component)===null||X===void 0?void 0:X.props.withVisible,ne=K==null||(Q=K.component)===null||Q===void 0?void 0:Q.props.withDataFetch;let oe=0,Y=K.identifier,Z=[];if(J!=null&&J.withData&&(J==null?void 0:J.withData.length)>0&&ne&&typeof ne=="function")for(let ie=0;ie<(J==null?void 0:J.withData.length);ie++){const le=J==null?void 0:J.withData[ie];let be={};be.tableName=le.withTable.table_name,be.filter={};for(let ve=0;ve<le.withCondition.length;ve++){var re;const{value:Ce,column:Ae}=le.withCondition[ve];let Re=N(Ce.group_key,Ce.field_key,H,Z);Array.isArray(Re)&&Array.isArray(Y)&&Re.length>oe&&(Re=Re[oe]),G=="Field.WithSingleSelect"&&Re&&(re=Re)!==null&&re!==void 0&&re.value&&(Re=Re.value),be.filter[Ae.column_name]=Re}const fe=await ne(be);fe.code===0&&fe.data.list&&Z.push({id:le.id,data:fe.data.list})}let ue;if(J.value&&J.value.length>0&&(ue=J.value.map(ie=>{let le="";const{insert:be,attributes:fe}=ie;return typeof be!="string"?be!=null&&be.span&&fe&&fe.tagKey&&fe.id&&(le=N(fe.tagKey,fe.id,H,Z),Array.isArray(le)?(Array.isArray(Y)&&le.length>oe&&(le=le[oe]),typeof le=="object"&&le!==null&&(le=JSON.stringify(le))):typeof le=="object"&&le!==null?le=JSON.stringify(le):le.length>0&&(le=`"${le}"`)):le=be,le})),u.current.has(Y)){const ie=u.current.get(Y);if(ue&&ue.length>0){const le=Kk(ue)=="true";ie.show!=le&&(ie.show=le,u.current.set(Y,ie),ee=!0)}}return ee},A=async(H,K,W,G,X)=>{var Q,ee;console.log("handleFieldsWithFill componentName",G);const J=K==null||(Q=K.component)===null||Q===void 0?void 0:Q.props.withFill,ne=K==null||(ee=K.component)===null||ee===void 0?void 0:ee.props.withDataFetch;let oe=0,Y="",Z=K.identifier;if(W&&Array.isArray(W)&&W.length>1)Y=W.filter(ie=>typeof ie=="string").join("."),oe=W[W.length-1],Z.startsWith(`${Y}.`)&&(Z=[...W,Z.replace(`${Y}.`,"")]);else if(Z.indexOf(".")>=0){Z=Z.split(".");let ie=N("fieldsValue",Z[0],H,[]);if(Array.isArray(ie)&&ie.length>0)for(let le=0;le<ie.length;le++)await A(H,K,[Z[0],le],G);return}const re=Array.isArray(Z)?Z.join("."):Z;if(d.current.hasCircularDependency(re)){const ie=d.current.getCurrentPath();console.log(`检测到公式计算中的循环依赖链路: ${[...ie,re].join(" -> ")}`);return}try{let ie=[];if(J!=null&&J.withData&&(J==null?void 0:J.withData.length)>0&&ne&&typeof ne=="function")for(let be=0;be<(J==null?void 0:J.withData.length);be++){const fe=J==null?void 0:J.withData[be];let ve={};ve.tableName=fe.withTable.table_name,ve.filter={};for(let Ae=0;Ae<fe.withCondition.length;Ae++){var ue;const{value:Re,column:Xe}=fe.withCondition[Ae];let Ue=N(Re.group_key,Re.field_key,H,ie);if(Array.isArray(Ue)&&Array.isArray(Z)&&Ue.length>oe&&(Ue=Ue[oe]),Ue&&typeof Ue=="string")try{Ue=JSON.parse(Ue)}catch{}(ue=Ue)!==null&&ue!==void 0&&ue.value&&(Ue=Ue.value),ve.filter[Xe.column_name]=Ue}const Ce=await ne(ve);Ce.code===0&&Ce.data.list&&ie.push({id:fe.id,data:Ce.data.list})}let le;if(J.value&&J.value.length>0&&(le=J.value.map(be=>{let fe="";const{insert:ve,attributes:Ce}=be;return typeof ve!="string"?ve!=null&&ve.span&&Ce&&Ce.tagKey&&Ce.id&&(fe=N(Ce.tagKey,Ce.id,H,ie),Array.isArray(fe)?(Array.isArray(Z)&&fe.length>oe&&(fe=fe[oe]),typeof fe=="object"&&fe!==null&&(fe=JSON.stringify(fe))):typeof fe=="object"&&fe!==null?fe=JSON.stringify(fe):fe.length>0&&(fe=`"${fe}"`)):fe=ve,fe})),le&&le.length>0){const be=Kk(le);console.log(`${Z} 计算公式:`,le),console.log(`${Z} 计算结果:`,be),i.setFieldValue(Z,be),await C(Z,i.getFieldsValue(),!1,re)}}finally{}},N=(H,K,W,G)=>{let X="";if(H=="fieldsValue"){var Q;if(K.indexOf(".")>=0){var ee;const[oe,Y]=K.split("."),Z=(W==null?void 0:W[oe])||[];Array.isArray(Z)?X=Z.map(re=>{var ue;return(ue=re==null?void 0:re[Y])!==null&&ue!==void 0?ue:""}):X=(ee=Z==null?void 0:Z[Y])!==null&&ee!==void 0?ee:""}else X=(Q=W==null?void 0:W[K])!==null&&Q!==void 0?Q:""}else{let oe=G.find(Y=>Y.id===H);if(oe&&oe.data&&oe.data.length>0){var J,ne;X=(J=(ne=oe.data[0])===null||ne===void 0?void 0:ne[K])!==null&&J!==void 0?J:""}}return X},P=q.useRef({}),R=q.useRef(null),M=q.useCallback(()=>{R.current&&clearTimeout(R.current);const H=f.current===1?500:100;R.current=setTimeout(async()=>{console.log("debounceHandleFieldsChange starting"),d.current.startNewCycle();const K=i.getFieldsValue(),W=f.current;f.current=0;let G=!1;m.current||(m.current={});const X=new Set;for(let Q in P.current){let ee=P.current[Q];if(!_u.isEqual(ee.value||"",h(ee.name)||"")){if(console.log("debounceHandleFieldsChange lockStatus_",W),W!=1){const J=Array.isArray(ee.name)?ee.name.map(oe=>typeof oe=="string"?oe:oe.toString()).join("."):ee.name;if(X.has(J)){console.log("跳过已处理的字段 processedFields",J);continue}X.add(J);let ne=await C(ee.name,K,!1,J);G=G||ne}m.current[ee.name]=ee.value}}G&&(console.log("needRefresh",G),c()),P.current={}},H)},[]),B=q.useCallback(H=>{setTimeout(()=>{H.filter(K=>{K.name&&K.name.length>0&&(P.current[K.name]=K)}),console.log("handleFieldsChange",P.current),M()},0)},[]),k=H=>{let K=[];return H.forEach(W=>{if(!u.current.has(W))return;let G=u.current.get(W);G.withIds.length<=0||K.push(...G.withIds.filter(X=>!K.includes(X)))}),K=K.filter(W=>{var G=i.getFieldValue(W);return!(typeof G!="number"&&!G)}),K},V=H=>{let K=k(H);const W=i.getFieldsValue();setTimeout(async()=>{for(let G=0;G<K.length;G++){const X=K[G];await C(X,W)}},0)},z=async H=>{const K=i.getFieldsValue();setTimeout(async()=>{for(let W=0;W<H.length;W++){const G=H[W];await C(G,K)}},0)},L=q.useRef({}),F=H=>u.current&&u.current.has(H)?u.current.get(H):null,j=()=>(console.log("memoizedRenderChildren",u.current),u.current?_():null),_=()=>{console.log("renderChildren");const H=Da(),K=q.Children.toArray(r);return console.log("childrenArray",K),wvt(K,n,u.current).map((G,X)=>Ge.jsx(v2,{gutter:[24,24],children:G.map((Q,ee)=>{var J,ne;const{componentId:oe,__id:Y,_componentName:Z,...re}=Q.props,ue=((J=Q.type)===null||J===void 0?void 0:J.displayName)||Z,ie=oe||Y;ie in L.current||(L.current[ie]=Da());const le=ue&&ue.startsWith("Layout."),be=ue&&ue=="Field.Table",fe=!u.current.has(ie)||((ne=u.current.get(ie))===null||ne===void 0?void 0:ne.show),ve=(re.calcHidden||!fe)&&o!="desgin",Ce=[];if(re.isRequired&&Ce.push({required:!0,message:`${re.label}必须填写`}),re.rules)if(Array.isArray(re.rules)){const Xe=re.rules.join("|");Ce.push({pattern:new RegExp(Xe),message:re.rulesFailMessage?re.rulesFailMessage:`${re.label}格式错误`})}else Ce.push({pattern:new RegExp(re.rules),message:re.rulesFailMessage?re.rulesFailMessage:`${re.label}格式错误`});const Ae=Xe=>{i.setFieldValue(ie,Xe)};let Re;return be||le?Re=q.cloneElement(Q,{onTableAddRow:V,getTableWithIds:k,onTableRemoveRow:z,removeLastFieldsValues:E,form:i,fieldName:ie,onCustomChange:Ae,initializeFormRender:g,mode:o,recordFieldsChange:w,getDependencyMapItem:F,renderKey:H}):ue==="Field.WithSingleSelect"||ue==="Field.WithMultipleSelect"||ue==="Show.WithTable"?Re=Ge.jsx(So.Item,{hidden:ve,style:{margin:0},shouldUpdate:(Xe,Ue)=>{let qe=!1;if(Array.isArray(re.filterRules)&&re.filterRules.length>0)for(let tt of re.filterRules){if(tt.valueType!="variable")continue;let Le,ze;if(Le=Xe==null?void 0:Xe[tt.value.field_key],ze=Ue==null?void 0:Ue[tt.value.field_key],Le!==ze){qe=!0;break}}return qe&&(L.current[ie]=Da(),console.log(ie,Da())),qe},children:Xe=>{let{getFieldsValue:Ue}=Xe;const qe=Ue();let tt=q.cloneElement(Q,{onTableAddRow:V,onTableRemoveRow:z,removeLastFieldsValues:E,form:i,fieldName:ie,onCustomChange:Ae,fieldsValue:qe,initializeFormRender:g,recordFieldsChange:w,shouldUpdateKey:L.current[ie]});return ue==="show.WithTable"?Ge.jsx(Ge.Fragment,{children:tt}):Ge.jsx(So.Item,{style:{marginBottom:0},label:"",name:ie,rules:fe?Ce:[],children:tt})}}):Re=Ge.jsx(So.Item,{hidden:ve,style:{marginBottom:0},label:"",name:ie,rules:fe?Ce:[],children:q.cloneElement(Q,{form:i,fieldName:ie,onCustomChange:Ae,initializeFormRender:g,recordFieldsChange:w,removeLastFieldsValues:E})}),Ge.jsx(Ay,{span:ve?0:le?24:24/n,style:{marginBottom:0},children:Re},ie||`col-${ee}`)})},`row-${X}`))};return Ge.jsx(Su,{theme:{components:{Table:{rowHoverBg:"#ebebeb"}},token:{colorBgContainerDisabled:"rgba(0, 0, 0, 0.02)",colorTextDisabled:"#333"}},children:Ge.jsxs(So,{form:i,className:"form-container fp-0 fw-full fh-full box-border fflex fflex-col "+(o=="desgin"?" fp-6":""),onFieldsChange:B,children:[Ge.jsx(So.Item,{name:"__id",hidden:!0,children:Ge.jsx("input",{type:"hidden"})}),s]})})});function xvt(e){return q.forwardRef((t,n)=>Ge.jsx(e,{...t,ref:n,forwardedRef:n}))}class Urn extends q.PureComponent{render(){const{forwardedRef:t,...n}=this.props;return Ge.jsx(sU,{...n,ref:t})}}const Avt=xvt(e=>{let{forwardedRef:t,...n}=e;return Ge.jsx(sU,{...n,ref:t})});function Ovt(e,t,n){const r=[];let o=[];const i=(a,s)=>{for(;s.length<a;)s.push(Ge.jsx("div",{},Da()))};return e.forEach(a=>{var s,l;const u=((s=a.type)===null||s===void 0?void 0:s.displayName)||((l=a.props)===null||l===void 0?void 0:l._componentName);u&&u.startsWith("Layout.")?(o.length>0&&(i(t,o),r.push(o),o=[]),r.push([a])):(o.push(a),o.filter(f=>{var d,p,g,m;const h=((d=f.props)===null||d===void 0?void 0:d.componentId)||((p=f.props)===null||p===void 0?void 0:p.__id);return(!(n!=null&&n.has(h))||((g=n.get(h))===null||g===void 0?void 0:g.show))&&!((m=f.props)!==null&&m!==void 0&&m.calcHidden)}).length===t&&(r.push(o),o=[]))}),o.length>0&&(i(t,o),r.push(o)),r}const Dvt=e=>{const t=new Map,n=[],r=function(o){var i,a;let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const l=((i=o.type)===null||i===void 0?void 0:i.displayName)||((a=o.props)===null||a===void 0?void 0:a._componentName),{props:u}=o;if(l&&(l.startsWith("Field.")||l.startsWith("Layout."))){let c=(u==null?void 0:u.componentId)||(u==null?void 0:u.__id);s&&(c=`${s}.${c}`);const f=u.withId?[u.withId]:u.withIds?[...u.withIds]:[];n.push({identifier:c,withIds:f,compName:l,fillRules:u==null?void 0:u.fillRules,visibleFunc:u==null?void 0:u.withVisibleFunc})}u!=null&&u.children&&q.Children.forEach(u.children,c=>{r(c,l&&l.startsWith("Field.")?(u==null?void 0:u.componentId)||(u==null?void 0:u.__id):"")})};return q.Children.forEach(e,o=>r(o)),n.forEach(o=>{t.set(o.identifier,{...o,show:!0,children:n.filter(i=>i.withIds.includes(o.identifier))})}),t},Tvt=function(e,t,n){if(!t.has(e))return!1;const r=t.get(e);if(r.visibleFunc&&typeof r.visibleFunc=="function"){const o=r.visibleFunc(n);if(r.show!==o)return r.show=o,!0}if(r.fillRules&&Array.isArray(r.fillRules)&&r.fillRules.length>0){const o=r.fillRules.map(a=>typeof a=="string"?a:""),i=Kk(o)==="true";if(r.show!==i)return r.show=i,!0}return!1},$vt=q.forwardRef((e,t)=>{let{cols:n=1,children:r,mode:o="view"}=e;const[i]=So.useForm(),[a,s]=q.useState(null),l=q.useRef(new Map),u=q.useRef({}),c=q.useRef({}),f=q.useCallback(()=>{l.current=Dvt(r)},[r]),d=q.useCallback(()=>{const h=i.getFieldsValue();let y=!1;l.current.forEach((v,b)=>{const C=Tvt(b,l.current,h);y=y||C}),y&&s(m())},[i]),p=q.useCallback(_u.debounce(()=>{const h=i.getFieldsValue();Object.keys(c.current).forEach(y=>{c.current[y]!==h[y]&&(u.current[y]=h[y])}),c.current={},d()},200),[i,d]),g=function(){for(var h=arguments.length,y=new Array(h),v=0;v<h;v++)y[v]=arguments[v];let[,b]=y;Object.assign(c.current,b),p()},m=q.useCallback(()=>{const h=q.Children.toArray(r);return Ovt(h,n,l.current).map((v,b)=>Ge.jsx(v2,{gutter:[24,24],children:v.map((C,E)=>{var S,w;const{componentId:x,__id:O,_componentName:T,calcHidden:A,...N}=C.props,P=((S=C.type)===null||S===void 0?void 0:S.displayName)||T,R=x||O,M=Da(),B=P&&P.startsWith("Layout."),k=!l.current.has(R)||((w=l.current.get(R))===null||w===void 0?void 0:w.show),V=(A||!k)&&o!=="desgin",z=[];if(N.isRequired&&z.push({required:!0,message:`${N.label}必须填写`}),N.rules){const F=Array.isArray(N.rules)&&N.rules.length>0?N.rules.join("|"):N.rules;z.push({pattern:new RegExp(F),message:N.rulesFailMessage||`${N.label}格式错误`})}let L=null;return B?L=q.cloneElement(C,{form:i,fieldName:R,updateKey:M}):L=Ge.jsx(So.Item,{hidden:V,label:N.label||"",name:R,rules:k?z:[],children:q.cloneElement(C,{form:i,fieldName:R,updateKey:M})}),Ge.jsx(Ay,{span:V?0:B?24:24/n,children:L},R||`col-${E}`)})},`row-${b}`))},[r,n,i,o]);return q.useEffect(()=>{f(),s(m())},[f,m]),q.useImperativeHandle(t,()=>({formRef:i,setFieldsValue:h=>{i.setFieldsValue(h),p()},refreshDependencies:()=>{f(),d()}})),Ge.jsxs(So,{form:i,className:`form-container fp-0 fw-full fh-full box-border fflex fflex-col fgap-y-2${o==="desgin"?" fp-6":""}`,onValuesChange:g,children:[Ge.jsx(So.Item,{name:"__id",hidden:!0,children:Ge.jsx("input",{type:"hidden"})}),a]})}),Nvt=e=>{let{request:t,value:n,onChange:r,callError:o,disabledValue:i,addRoot:a=!0,title:s,...l}=e;const[u,c]=q.useState(!1),[f,d]=q.useState([]);q.useEffect(()=>{p()},[]),q.useEffect(()=>{if(typeof n=="string")try{n=JSON.parse(n),r(n)}catch{}Array.isArray(n)&&y(n)},[n]);const p=async()=>{if(t&&typeof t=="function"){var O;const T=await t();if(T.code>0){o&&typeof o=="function"&&o(T.message);return}let A=U6e(((O=T.data)===null||O===void 0?void 0:O.list)||T.data||[],"id",s||"title",(l==null?void 0:l.parentId)||"parentId","children",0,i);a&&(A=[{value:0,title:"根节点",children:A}]),l.treeData=A,console.log("treeData",A),d(A)}l.treeData&&d(l.treeData),c(!0)},[g,m]=q.useState([]),[h,y]=q.useState([]),[v,b]=q.useState([]),[C,E]=q.useState(!0),S=O=>{console.log("onExpand",O),m(O),E(!1)},w=O=>{console.log("onCheck",O),y(O),r(O)},x=(O,T)=>{console.log("onSelect",T),b(O)};return Ge.jsx(Mo,{...l,children:Ge.jsx(XV,{checkable:!0,onExpand:S,onCheck:w,onSelect:x,expandedKeys:g,autoExpandParent:C,checkedKeys:h,selectedKeys:v,treeData:f})})},Pvt=e=>Ge.jsx(Mo,{...e,children:Ge.jsx(h2,{...e})}),Ivt=e=>Ge.jsx(Mo,{...e,children:Ge.jsx(h2.Group,{...e})}),Rvt=e=>Ge.jsx(Mo,{...e,children:Ge.jsx(l6.Group,{...e})}),h$e=e=>{let{value:t,maxCount:n,multiple:r,onChange:o,...i}=e;q.useEffect(()=>{if(t){if(typeof t=="string")try{t=JSON.parse(t),o(t)}catch{}console.log("value",t),Array.isArray(t)&&s(t)}},[t]),n=n||99,r=r||!0;const[a,s]=q.useState([]),l=u=>{let{fileList:c}=u;console.log("newFileList",c),c=c.map(f=>(f.status=="done"&&f.response&&(f.url=f.response),f)),o(c.map(f=>({uid:f.uid,name:f.name,status:f.status,url:f.url||f.response||"",error:f.error}))),s(c)};return Ge.jsx(y6,{...i,listType:"text",multiple:r,onChange:l,maxCount:n,fileList:a,children:!(i!=null&&i.disabled)&&!(i!=null&&i.readonly)&&a.length<n&&Ge.jsx(ns,{type:(i==null?void 0:i.type)||"default",icon:(i==null?void 0:i.icon)||Ge.jsx(V6e,{}),children:"点击上传文件"})})};h$e.displayName="UploadFile";const Mvt=e=>Ge.jsx(Mo,{...e,children:Ge.jsx(h$e,{...e})}),v$e=e=>{let{maxCount:t,value:n,multiple:r,onChange:o,...i}=e;q.useEffect(()=>{if(n){if(console.log("value",n),typeof n=="string")try{n=JSON.parse(n),o(n)}catch{}let E=[];if(Array.isArray(n))for(let S=0;S<n.length;S++){let w=n[S];var C=g.current.find(x=>x.uid===w.uid);!C||(C.version||0)<(w.version||0)?E.push(w):E.push(C)}s(E)}},[n]),t=t||99,r=r||!0;const[a,s]=q.useState([]),[l,u]=q.useState(""),[c,f]=q.useState(0),[d,p]=q.useState(!1),g=q.useRef([]),m=C=>new Promise((E,S)=>{const w=new FileReader;w.readAsDataURL(C),w.onload=()=>E(w.result),w.onerror=x=>S(x)}),h=async(C,E)=>{!C.url&&!C.preview&&(C.preview=await m(C.originFileObj)),u(C.url||C.preview),f(E),p(!0)},y=async(C,E)=>{i!=null&&i.disabled||s(a.filter((S,w)=>w!==E))},v=Ge.jsx(Ge.Fragment,{children:Ge.jsxs("div",{className:"fw-full fh-full fflex fflex-col fitems-center fjustify-center fborder fborder-dashed fcursor-pointer frounded",children:[Ge.jsx(z6e,{}),Ge.jsx("div",{className:"fmt-2",children:"点击上传"})]})}),b=C=>{let{fileList:E}=C,S=[];for(let O=0;O<E.length;O++){var w=E[O];w.version=new Date().getTime();var x=g.current.find(T=>T.uid===w.uid);console.log("oldfile",JSON.parse(JSON.stringify(x||{}))),x&&x.status!="uploading"?S.push(x):(w.status=="done"&&w.response&&(w.url=w.response),S.push(w))}g.current=S,s(S),o(S.map(O=>({uid:O.uid,name:O.name,status:O.status,url:O.url||O.response||"",error:O.error,version:O.version||0})))};return Ge.jsxs(Ge.Fragment,{children:[Ge.jsx("div",{className:"fflex fgap-3 fflex-wrap",children:Ge.jsx(y6,{...i,itemRender:(C,E,S)=>{console.log("file",E);let w=S.findIndex(x=>x.uid===E.uid);return Ge.jsx(Ge.Fragment,{children:Ge.jsxs("div",{className:"fgroup fw-full fh-full fbg-transparent fborder frounded fflex fitems-center fjustify-center foverflow-hidden fcursor-pointer frelative"+(E.status=="error"?" fborder-red-500":""),children:[Ge.jsxs("div",{className:" fhidden fabsolute fw-full fh-full fbg-gray-900 fbg-opacity-50 fitems-center fjustify-center fz-10 group-hover:fflex ftext-white ftext-lg fgap-2",children:[E.status=="done"&&Ge.jsx(H6e,{onClick:()=>{h(E,w)},className:"hover:ftext-gray-200"}),!(i!=null&&i.disabled)&&!(i!=null&&i.readonly)&&Ge.jsx(tU,{onClick:()=>{y(E,w)},className:"hover:ftext-gray-200"})]}),E.status=="uploading"&&Ge.jsx("div",{className:" fw-full fh-full fflex fitems-center fjustify-center fabsolute ftop-0 fleft-0 ",children:Ge.jsx(jE,{})}),Ge.jsx("img",{src:E.url||E.thumbUrl,alt:"Example Image",className:"fmax-w-full fmax-h-full fobject-contain "})]},`file-${E.uid}`)})},listType:"picture-card",fileList:a,multiple:r,onPreview:h,onChange:b,maxCount:t,children:a.length>=t||i!=null&&i.disabled||i!=null&&i.readonly?null:v})}),l&&Ge.jsx(FD.PreviewGroup,{preview:{visible:d,current:c,onVisibleChange:C=>p(C),onChange:C=>{f(C)}},children:a.map((C,E)=>Ge.jsx(Ge.Fragment,{children:Ge.jsx(FD,{wrapperStyle:{display:"none"},src:C.url})}))})]})};v$e.displayName="UploadImage";const Fvt=e=>Ge.jsx(Mo,{...e,children:Ge.jsx(v$e,{...e})}),Bvt=e=>{let{value:t,onChange:n,form:r,fieldName:o,...i}=e,a=!1;return typeof t=="boolean"?a=t:typeof t=="string"?a=t=="1"||t=="true":typeof t=="number"&&(a=t==1),t!==a&&(r==null||r.setFieldValue(o,a)),Ge.jsx(Mo,{...i,children:Ge.jsx(UV,{...i,onChange:n,value:t})})};var kvt={exports:{}};(function(e,t){(function(n,r){e.exports=r(E4e)})(Cr,function(n){function r(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var o=r(n),i={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(a,s){return s==="W"?a+"周":a+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(a,s){var l=100*a+s;return l<600?"凌晨":l<900?"早上":l<1100?"上午":l<1300?"中午":l<1800?"下午":"晚上"}};return o.default.locale(i,null,!0),i})})(kvt);var Lvt=ge(ge({},_Ae),{},{locale:"zh_CN",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",week:"周",month:"月",year:"年",previousMonth:"上个月 (翻页上键)",nextMonth:"下个月 (翻页下键)",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",previousYear:"上一年 (Control键加左方向键)",nextYear:"下一年 (Control键加右方向键)",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪",yearFormat:"YYYY年",cellDateFormat:"D",monthBeforeYear:!1});const jvt={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]},g$e={lang:Object.assign({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},Lvt),timePickerLocale:Object.assign({},jvt)};g$e.lang.ok="确定";var m$e={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Cr,function(){return function(n,r,o){o.updateLocale=function(i,a){var s=o.Ls[i];if(s)return(a?Object.keys(a):[]).forEach(function(l){s[l]=a[l]}),s}}})})(m$e);var _vt=m$e.exports;const Hvt=ga(_vt);pi.extend(Hvt);pi.extend(T4e);pi.updateLocale("zh-cn",{weekStart:0});const zvt=e=>{let{datetype:t,value:n,defaultNow:r,onChange:o,...i}=e;t=t||"date";const[a,s]=q.useState(i==null?void 0:i.picker),[l,u]=q.useState(i==null?void 0:i.format),[c,f]=q.useState(!1),[d,p]=q.useState(!1),g=q.useRef(!1);q.useEffect(()=>{if(r&&!n){const h=pi().format("YYYY-MM-DD HH:mm:ss");typeof o=="function"&&o(h);return}},[]);const m=(h,y)=>{g.current=!0,o(y)};return q.useEffect(()=>{switch(s("date"),f(!1),t){case"date":s("date"),u("YYYY-MM-DD"),p(!1);break;case"datetime":f(!0),s("datetime"),u("YYYY-MM-DD HH:mm:ss"),p(!0);break;case"month":s("month"),p(!1);break;case"year":s("year"),p(!1);break}},[t]),Ge.jsx(Mo,{...i,children:Ge.jsx(Oy,{locale:g$e,...i,picker:a,format:l,style:{width:"100%"},onChange:m,value:n&&pi(n).isValid()?pi(n):void 0,showTime:c,needConfirm:d})})};var lU={exports:{}},E2={},x6={exports:{}},y$e={},Gk={exports:{}},Wx={exports:{}},Vr={};/** @license React v16.13.1
424
+ Consider to rely on 'then' or 'done' mode instead.`);S&&(delete c[p],f[p]=E,u.emit("setasync",p,S))},v=function(){h=!0,c[p]&&(delete c[p],delete d[p],u.delete(p))},b=l;if(b||(b="then"),b==="then"){var C=function(){i(v)};m=m.then(function(E){i(y.bind(this,E))},C),typeof m.finally=="function"&&m.finally(C)}else if(b==="done"){if(typeof m.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");m.done(y,v)}else if(b==="done:finally"){if(typeof m.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if(typeof m.finally!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");m.done(y),m.finally(v)}}),u.on("get",function(p,g,m){var h;if(c[p]){++c[p];return}h=d[p];var y=function(){u.emit("getasync",p,g,m)};o(h)?typeof h.done=="function"?h.done(y):h.then(function(){i(y)}):y()}),u.on("delete",function(p){if(delete d[p],c[p]){delete c[p];return}if(hasOwnProperty.call(f,p)){var g=f[p];delete f[p],u.emit("deleteasync",p,[g])}}),u.on("clear",function(){var p=f;f=a(null),c=a(null),d=a(null),u.emit("clearasync",e(p,function(g){return[g]}))})},One}var Fne={},Bne;function avt(){if(Bne)return Fne;Bne=1;var e=Op,t=S6,n=Xv,r=Function.prototype.apply;return n.dispose=function(o,i,a){var s;if(e(o),a.async&&n.async||a.promise&&n.promise){i.on("deleteasync",s=function(l,u){r.call(o,null,u)}),i.on("clearasync",function(l){t(l,function(u,c){s(c,u)})});return}i.on("delete",s=function(l,u){o(u)}),i.on("clear",function(l){t(l,function(u,c){s(c,u)})})},Fne}var kne={},CI,Lne;function svt(){return Lne||(Lne=1,CI=2147483647),CI}var EI,jne;function lvt(){if(jne)return EI;jne=1;var e=Yv,t=svt();return EI=function(n){if(n=e(n),n>t)throw new TypeError(n+" exceeds maximum possible timeout");return n},EI}var _ne;function uvt(){if(_ne)return kne;_ne=1;var e=oU(),t=S6,n=aU(),r=d$e(),o=lvt(),i=Xv,a=Function.prototype,s=Math.max,l=Math.min,u=Object.create;return i.maxAge=function(c,f,d){var p,g,m,h;c=o(c),c&&(p=u(null),g=d.async&&i.async||d.promise&&i.promise?"async":"",f.on("set"+g,function(y){p[y]=setTimeout(function(){f.delete(y)},c),typeof p[y].unref=="function"&&p[y].unref(),h&&(h[y]&&h[y]!=="nextTick"&&clearTimeout(h[y]),h[y]=setTimeout(function(){delete h[y]},m),typeof h[y].unref=="function"&&h[y].unref())}),f.on("delete"+g,function(y){clearTimeout(p[y]),delete p[y],h&&(h[y]!=="nextTick"&&clearTimeout(h[y]),delete h[y])}),d.preFetch&&(d.preFetch===!0||isNaN(d.preFetch)?m=.333:m=s(l(Number(d.preFetch),1),0),m&&(h={},m=(1-m)*c,f.on("get"+g,function(y,v,b){h[y]||(h[y]="nextTick",n(function(){var C;h[y]==="nextTick"&&(delete h[y],f.delete(y),d.async&&(v=e(v),v.push(a)),C=f.memoized.apply(b,v),d.promise&&r(C)&&(typeof C.done=="function"?C.done(a,a):C.then(a,a)))}))}))),f.on("clear"+g,function(){t(p,function(y){clearTimeout(y)}),p={},h&&(t(h,function(y){y!=="nextTick"&&clearTimeout(y)}),h={})}))},kne}var Hne={},SI,zne;function cvt(){if(zne)return SI;zne=1;var e=Yv,t=Object.create,n=Object.prototype.hasOwnProperty;return SI=function(r){var o=0,i=1,a=t(null),s=t(null),l=0,u;return r=e(r),{hit:function(c){var f=s[c],d=++l;if(a[d]=c,s[c]=d,!f)return++o,o<=r?void 0:(c=a[i],u(c),c);if(delete a[f],i===f)for(;!n.call(a,++i););},delete:u=function(c){var f=s[c];if(f&&(delete a[f],delete s[c],--o,i===f)){if(!o){l=0,i=1;return}for(;!n.call(a,++i););}},clear:function(){o=0,i=1,a=t(null),s=t(null),l=0}}},SI}var Vne;function fvt(){if(Vne)return Hne;Vne=1;var e=Yv,t=cvt(),n=Xv;return n.max=function(r,o,i){var a,s,l;r=e(r),r&&(s=t(r),a=i.async&&n.async||i.promise&&n.promise?"async":"",o.on("set"+a,l=function(u){u=s.hit(u),u!==void 0&&o.delete(u)}),o.on("get"+a,l),o.on("delete"+a,s.delete),o.on("clear"+a,s.clear))},Hne}var Une={},Wne;function dvt(){if(Wne)return Une;Wne=1;var e=qv,t=Xv,n=Object.create,r=Object.defineProperties;return t.refCounter=function(o,i,a){var s,l;s=n(null),l=a.async&&t.async||a.promise&&t.promise?"async":"",i.on("set"+l,function(u,c){s[u]=c||1}),i.on("get"+l,function(u){++s[u]}),i.on("delete"+l,function(u){delete s[u]}),i.on("clear"+l,function(){s={}}),r(i.memoized,{deleteRef:e(function(){var u=i.get(arguments);return u===null||!s[u]?null:--s[u]?!1:(i.delete(u),!0)}),getRefCount:e(function(){var u=i.get(arguments);return u===null||!s[u]?0:s[u]})})},Une}var pvt=q6e,hvt=Q6e,vvt=Uht,gvt=function(e){var t=pvt(arguments[1]),n;return t.normalizer||(n=t.length=hvt(t.length,e.length,t.async),n!==0&&(t.primitive?n===!1?t.normalizer=Wht():n>1&&(t.normalizer=Kht()(n)):n===!1?t.normalizer=qht()():n===1?t.normalizer=Qht()():t.normalizer=Zht()(n))),t.async&&Jht(),t.promise&&ivt(),t.dispose&&avt(),t.maxAge&&uvt(),t.max&&fvt(),t.refCounter&&dvt(),vvt(e,t)};const mvt=ga(gvt),Kk=mvt(e=>{let t="",n="";try{n=`return ${e.join("")}`,console.log("funcCode",n),t=new Function(n)(),typeof t=="object"&&t!==null||(t=t.toString())}catch(r){console.error(`formula (${n}) error`,r)}return t},{primitive:!0,max:1e3,maxAge:1e3*60*1}),yvt="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Da=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=yvt[n[e]&63];return t};var p$e={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function o(l,u,c){this.fn=l,this.context=u,this.once=c||!1}function i(l,u,c,f,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var p=new o(c,f||l,d),g=n?n+u:u;return l._events[g]?l._events[g].fn?l._events[g]=[l._events[g],p]:l._events[g].push(p):(l._events[g]=p,l._eventsCount++),l}function a(l,u){--l._eventsCount===0?l._events=new r:delete l._events[u]}function s(){this._events=new r,this._eventsCount=0}s.prototype.eventNames=function(){var u=[],c,f;if(this._eventsCount===0)return u;for(f in c=this._events)t.call(c,f)&&u.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(c)):u},s.prototype.listeners=function(u){var c=n?n+u:u,f=this._events[c];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,p=f.length,g=new Array(p);d<p;d++)g[d]=f[d].fn;return g},s.prototype.listenerCount=function(u){var c=n?n+u:u,f=this._events[c];return f?f.fn?1:f.length:0},s.prototype.emit=function(u,c,f,d,p,g){var m=n?n+u:u;if(!this._events[m])return!1;var h=this._events[m],y=arguments.length,v,b;if(h.fn){switch(h.once&&this.removeListener(u,h.fn,void 0,!0),y){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,c),!0;case 3:return h.fn.call(h.context,c,f),!0;case 4:return h.fn.call(h.context,c,f,d),!0;case 5:return h.fn.call(h.context,c,f,d,p),!0;case 6:return h.fn.call(h.context,c,f,d,p,g),!0}for(b=1,v=new Array(y-1);b<y;b++)v[b-1]=arguments[b];h.fn.apply(h.context,v)}else{var C=h.length,E;for(b=0;b<C;b++)switch(h[b].once&&this.removeListener(u,h[b].fn,void 0,!0),y){case 1:h[b].fn.call(h[b].context);break;case 2:h[b].fn.call(h[b].context,c);break;case 3:h[b].fn.call(h[b].context,c,f);break;case 4:h[b].fn.call(h[b].context,c,f,d);break;default:if(!v)for(E=1,v=new Array(y-1);E<y;E++)v[E-1]=arguments[E];h[b].fn.apply(h[b].context,v)}}return!0},s.prototype.on=function(u,c,f){return i(this,u,c,f,!1)},s.prototype.once=function(u,c,f){return i(this,u,c,f,!0)},s.prototype.removeListener=function(u,c,f,d){var p=n?n+u:u;if(!this._events[p])return this;if(!c)return a(this,p),this;var g=this._events[p];if(g.fn)g.fn===c&&(!d||g.once)&&(!f||g.context===f)&&a(this,p);else{for(var m=0,h=[],y=g.length;m<y;m++)(g[m].fn!==c||d&&!g[m].once||f&&g[m].context!==f)&&h.push(g[m]);h.length?this._events[p]=h.length===1?h[0]:h:a(this,p)}return this},s.prototype.removeAllListeners=function(u){var c;return u?(c=n?n+u:u,this._events[c]&&a(this,c)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s})(p$e);var bvt=p$e.exports;const Cvt=ga(bvt),KC=new Cvt,Evt=e=>{let{children:t,layout:n,onTableAddRow:r,onTableRemoveRow:o,form:i,initializeFormRender:a,recordFieldsChange:s,mode:l,getTableWithIds:u,removeLastFieldsValues:c,getDependencyMapItem:f,renderKey:d}=e;n=n||"1";const p=v=>{const b=v.split(",").map(Number),C=24;return b.map(E=>E/b.reduce((S,w)=>S+w)*C)},g=q.useMemo(()=>p(n),[n]),m=v=>{if(typeof f=="function"){const b=f(v);if(b)return b==null?void 0:b.show}return!0},h=q.useRef({}),y=q.useMemo(()=>q.Children.toArray(t).map((v,b)=>{var C,E;const S=v.props,w=(S==null?void 0:S.componentId)||(S==null?void 0:S.__id),x=w;var O=((C=v.type)===null||C===void 0?void 0:C.displayName)||((E=v.props)===null||E===void 0?void 0:E._componentName);x in h.current||(h.current[x]=Da());const T=((S==null?void 0:S.calcHidden)||!m(x))&&l!="desgin",A=[];if(S!=null&&S.isRequired&&A.push({required:!0,message:`${S.label}必须填写`}),S!=null&&S.rules)if(Array.isArray(S.rules)){const R=S.rules.join("|");A.push({pattern:new RegExp(R),message:S.rulesFailMessage?S.rulesFailMessage:`${S.label}格式错误`})}else A.push({pattern:new RegExp(S.rules),message:S.rulesFailMessage?S.rulesFailMessage:`${S.label}格式错误`});const N=R=>{i.setFieldValue(x,R)};let P=null;return O=="Field.Table"?P=q.cloneElement(v,{onTableAddRow:r,onTableRemoveRow:o,form:i,fieldName:w,initializeFormRender:a,mode:l,recordFieldsChange:s,getTableWithIds:u,removeLastFieldsValues:c,getDependencyMapItem:f,renderKey:d}):O==="Field.WithSingleSelect"||O==="Field.WithMultipleSelect"||O==="Show.WithTable"?P=Ge.jsx(So.Item,{hidden:T,style:{margin:0},shouldUpdate:(R,M)=>{let B=!1;if(Array.isArray(S.filterRules)&&S.filterRules.length>0)for(let k of S.filterRules){if(k.valueType!="variable")continue;let V,z;if(V=R==null?void 0:R[k.value.field_key],z=M==null?void 0:M[k.value.field_key],V!==z){B=!0;break}}return B&&(h.current[x]=Da()),B},children:R=>{let{getFieldsValue:M}=R;const B=M();let k=q.cloneElement(v,{onTableAddRow:r,onTableRemoveRow:o,form:i,fieldName:x,onCustomChange:N,fieldsValue:B,initializeFormRender:a,recordFieldsChange:s,getTableWithIds:u,removeLastFieldsValues:c,shouldUpdateKey:h.current[x]});return O==="Show.WithTable"?Ge.jsx(Ge.Fragment,{children:k}):Ge.jsx(So.Item,{style:{marginBottom:0},label:"",name:x,rules:A,children:k})}}):q.isValidElement(v)?P=Ge.jsx(So.Item,{style:{marginBottom:0},label:"",name:w,rules:A,hidden:T,children:q.cloneElement(v,{form:i,fieldName:w,initializeFormRender:a,recordFieldsChange:s})},`${w}-form-item`):P=v,(g==null?void 0:g[b])&&Ge.jsx(Ay,{span:g[b],children:P},b)}),[t,g,d]);return Ge.jsx(v2,{gutter:24,children:y})},Svt=e=>{let{title:t}=e;return t?Ge.jsx("div",{className:"fh-11 fflex fitems-center ftext-lg ffont-medium ",children:Ge.jsx("span",{className:"fborder-l-4 fborder-slate-300 fpl-2 ",children:t})}):null};function wvt(e,t,n){const r=[];let o=[];const i=(s,l)=>{const u=s-l.length;u>0&&l.push(...new Array(u).fill(q.createElement("div")))};for(const s of e){var a;const{_componentName:l}=(s==null?void 0:s.props)||{},u=((a=s.type)===null||a===void 0?void 0:a.displayName)||l;u&&u.startsWith("Layout.")?(o.length>0&&(i(t,o),r.push(o),o=[]),r.push([s])):(o.push(s),o.filter(f=>{var d,p,g,m;const h=((d=f.props)===null||d===void 0?void 0:d.componentId)||((p=f.props)===null||p===void 0?void 0:p.__id);return(!n.has(h)||((g=n.get(h))===null||g===void 0?void 0:g.show))&&!(f!=null&&(m=f.props)!==null&&m!==void 0&&m.calcHidden)}).length===t&&(r.push(o),o=[]))}return o.length>0&&(i(t,o),r.push(o)),r}const sU=q.forwardRef((e,t)=>{let{cols:n=1,children:r,mode:o="view"}=e;const[i]=So.useForm(),a=q.useRef(null),[s,l]=q.useState(null),u=q.useRef(null),c=()=>{const H=j();_u.isEqual(a.current,H)||(a.current=H,l(H))},f=q.useRef(0),d=q.useRef({currentCycleId:0,updatePath:[],MAX_DEPTH:30,startNewCycle:function(){return this.currentCycleId++,this.updatePath=[],this.currentCycleId},addToPath:function(H){if(this.updatePath.length>=this.MAX_DEPTH){console.warn(`依赖路径深度超过限制(${this.MAX_DEPTH}),可能存在过深嵌套`);return}H&&this.updatePath.push(H)},hasCircularDependency:function(H){return H?this.updatePath.includes(H):!1},getCurrentPath:function(){return[...this.updatePath]},finishField:function(){this.updatePath.length>0&&this.updatePath.pop()}});q.useImperativeHandle(t,()=>({formRef:i,setFieldsValue:H=>{f.current=1;let K={...H,__id:H==null?void 0:H.id};for(let W in H)if(P.current[W]={name:W,value:H[W]},u.current.has(W)&&u.current.get(W).componentName=="Field.Table"&&Array.isArray(H[W]))for(let G=0;G<H[W].length;G++){const X=H[W][G];for(let Q in X)P.current[[W,G,Q]]={name:[W,G,Q],value:X[Q]}}i.setFieldsValue(K),M()},initializeFieldVisibility:H=>{b(H)}}),[]);const p=q.useCallback(_u.throttle(async()=>{await y(),console.log("initializeDependencyMap"),requestAnimationFrame(()=>{c()})},300),[r,n]);q.useEffect(()=>(console.log("UseEffect throttledInitializeFormRender"),p(),()=>{p.cancel()}),[r,n]);const g=()=>{p()},m=q.useRef(null),h=H=>{var K;return(K=m.current)===null||K===void 0?void 0:K[H]},y=async()=>{const H=[];function K(G){var X,Q;let ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;var J=((X=G.type)===null||X===void 0?void 0:X.displayName)||((Q=G.props)===null||Q===void 0?void 0:Q._componentName);const{props:ne}=G;if(J&&(J.startsWith("Field.")||J.startsWith("Layout."))){let Z=(ne==null?void 0:ne.componentId)||(ne==null?void 0:ne.__id),re=[];if(ee&&ee!==null&&ee!==void 0&&ee.props){var oe,Y;Z=`${(ee==null||(oe=ee.props)===null||oe===void 0?void 0:oe.componentId)||(ee==null||(Y=ee.props)===null||Y===void 0?void 0:Y.__id)}.${Z}`}ne!=null&&ne.withId&&re.push(ne==null?void 0:ne.withId),ne!=null&&ne.withIds&&(re=[...re,...ne==null?void 0:ne.withIds]),H.push({identifier:Z,withIds:re,component:G,componentName:J,fillRules:ne==null?void 0:ne.fillRules})}ne!=null&&ne.children&&q.Children.toArray(ne==null?void 0:ne.children).forEach(re=>K(re,J&&J.startsWith("Field.")?G:null))}u.current=new Map,console.log(" fields",H);const W=q.Children.toArray(r);for(let G=0;G<W.length;G++){const X=W[G];K(X)}H.forEach(G=>{const{identifier:X}=G;u.current.set(X,{children:H.filter(Q=>Q.withIds.some(ee=>ee==X)),show:!0,...G})}),await v()},v=async function(){let H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;console.log("initializeFieldVisibility *************************************");const K=i.getFieldsValue();await Promise.all(Array.from(u.current.keys()).map(async W=>{await C(W,K,!0)})),H&&c()},b=_u.debounce(async function(){let H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;await v(H)},100),C=async function(H,K){let W=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,G=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(o=="desgin")return console.log("设计模式下不进行字段级联计算"),!1;console.log("handleFieldsWith identifier",H);let X=!1,Q=[];Array.isArray(H)&&(Q=[...H.slice(0,-1)],H=H.filter(J=>typeof J=="string").join("."));const ee=G||H;if(d.current.hasCircularDependency(ee)){const J=d.current.getCurrentPath();return console.log(`检测到循环依赖链路: ${[...J,ee].join(" -> ")}`),!1}d.current.addToPath(ee);try{if(console.log("dependencyMap.current",u.current),console.log("dependencyMap.current identifier",H),u.current.has(H)){const J=u.current.get(H),ne=J.children;!W&&J!==null&&J!==void 0&&J.fillRules&&Array.isArray(J==null?void 0:J.fillRules)&&(J==null?void 0:J.fillRules.length)>0&&x(H,Q,K,J==null?void 0:J.fillRules);for(let oe=0;oe<ne.length;oe++){const Y=ne[oe];if(Y.component.props.withVisibleFunc&&typeof Y.component.props.withVisibleFunc=="function"){let Z=O(K,Y,Q);X=X||Z}if(Y.component.props.withVisible){let Z=await T(K,Y,Q,J==null?void 0:J.componentName);X=X||Z}!W&&Y.component.props.withFill&&await A(K,Y,Q,J==null?void 0:J.componentName,ee)}}}finally{d.current.finishField()}return X},E=function(H){let K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(m.current)if(K){const W=Object.keys(m.current);for(let G=0;G<W.length;G++){const X=W[G];X.includes(`${H},`)&&delete m.current[X]}}else delete m.current[H]},S=(H,K)=>{P.current||(P.current={}),P.current[H]=K},w=function(H){let K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;console.log("recordFieldsChange",H,K);var W=Object.keys(H);W.length>0&&(W.forEach(G=>{S(G,H[G])}),K&&M())},x=(H,K,W,G)=>{let X=N("fieldsValue",H,W,null),Q={};Array.isArray(H)&&H.filter(Z=>typeof Z=="string").join(".");let ee=[];for(let Z=0;Z<G.length;Z++){const re=G[Z];let{source:ue,target:ie}=re,le=X==null?void 0:X[ue],be=le;if(Array.isArray(H)&&H.filter(fe=>typeof fe=="string").join("."),Array.isArray(ie)&&ie.filter(fe=>typeof fe=="string").join("."),(re==null?void 0:re.type)==1){if(u.current.has(ie)){var J,ne,oe;let ve=(J=u.current.get(ie))===null||J===void 0||(ne=J.component)===null||ne===void 0||(oe=ne.props)===null||oe===void 0?void 0:oe.children;Array.isArray(ve)&&ve.length>0&&ee.push(ve.map(Ce=>{var Ae,Re;return`${ue}.${(Ce==null||(Ae=Ce.props)===null||Ae===void 0?void 0:Ae.componentId)||(Ce==null||(Re=Ce.props)===null||Re===void 0?void 0:Re.__id)}`}))}if(le&&typeof le=="string")try{le=JSON.parse(le)}catch(ve){console.error("error end",ve)}if(!Array.isArray(le))return;be=le.map((ve,Ce)=>{let Ae={};if(re!=null&&re.subRules&&Array.isArray(re==null?void 0:re.subRules)&&(re==null?void 0:re.subRules.length)>0)for(let Re=0;Re<(re==null?void 0:re.subRules.length);Re++){const{source:Xe,target:Ue}=re==null?void 0:re.subRules[Re];Ae[Ue]=ve==null?void 0:ve[Xe];let qe={name:[ie,Ce,Ue],value:ve==null?void 0:ve[Xe]};Q[qe.name]=qe}return Ae}),E(ie,!0),KC.emit("reloadTable",ie)}else{let fe=0;if(K&&Array.isArray(K)&&K.length>1&&(K.filter(ve=>typeof ve=="string").join("."),fe=K[K.length-1],ie=[...K,ie],Array.isArray(X)&&X.length>fe)){var Y;be=(Y=X[fe])===null||Y===void 0?void 0:Y[ue]}Q[ie]={name:Array.isArray(ie)?ie:[ie],value:be}}(re==null?void 0:re.type)==1&&i.setFieldValue(ie,void 0),i.setFieldValue(ie,be)}setTimeout(()=>{w(Q,!0),ee.length>0&&ee.forEach(Z=>{Array.isArray(Z)&&Z.length>0&&V(Z)})},0)},O=(H,K,W)=>{var G,X;let Q=!1;const ee=K==null||(G=K.component)===null||G===void 0||(X=G.props)===null||X===void 0?void 0:X.withVisibleFunc(H),J=K==null?void 0:K.identifier;if(u.current.has(J)){const ne=u.current.get(J);ne.show!==ee&&(ne.show=ee,u.current.set(J,ne),Q=!0)}return Q},T=async(H,K,W,G)=>{var X,Q;let ee=!1;const J=K==null||(X=K.component)===null||X===void 0?void 0:X.props.withVisible,ne=K==null||(Q=K.component)===null||Q===void 0?void 0:Q.props.withDataFetch;let oe=0,Y=K.identifier,Z=[];if(J!=null&&J.withData&&(J==null?void 0:J.withData.length)>0&&ne&&typeof ne=="function")for(let ie=0;ie<(J==null?void 0:J.withData.length);ie++){const le=J==null?void 0:J.withData[ie];let be={};be.tableName=le.withTable.table_name,be.filter={};for(let ve=0;ve<le.withCondition.length;ve++){var re;const{value:Ce,column:Ae}=le.withCondition[ve];let Re=N(Ce.group_key,Ce.field_key,H,Z);Array.isArray(Re)&&Array.isArray(Y)&&Re.length>oe&&(Re=Re[oe]),G=="Field.WithSingleSelect"&&Re&&(re=Re)!==null&&re!==void 0&&re.value&&(Re=Re.value),be.filter[Ae.column_name]=Re}const fe=await ne(be);fe.code===0&&fe.data.list&&Z.push({id:le.id,data:fe.data.list})}let ue;if(J.value&&J.value.length>0&&(ue=J.value.map(ie=>{let le="";const{insert:be,attributes:fe}=ie;return typeof be!="string"?be!=null&&be.span&&fe&&fe.tagKey&&fe.id&&(le=N(fe.tagKey,fe.id,H,Z),Array.isArray(le)?(Array.isArray(Y)&&le.length>oe&&(le=le[oe]),typeof le=="object"&&le!==null&&(le=JSON.stringify(le))):typeof le=="object"&&le!==null?le=JSON.stringify(le):le.length>0&&(le=`"${le}"`)):le=be,le})),u.current.has(Y)){const ie=u.current.get(Y);if(ue&&ue.length>0){const le=Kk(ue)=="true";ie.show!=le&&(ie.show=le,u.current.set(Y,ie),ee=!0)}}return ee},A=async(H,K,W,G,X)=>{var Q,ee;console.log("handleFieldsWithFill componentName",G);const J=K==null||(Q=K.component)===null||Q===void 0?void 0:Q.props.withFill,ne=K==null||(ee=K.component)===null||ee===void 0?void 0:ee.props.withDataFetch;let oe=0,Y="",Z=K.identifier;if(W&&Array.isArray(W)&&W.length>1)Y=W.filter(ie=>typeof ie=="string").join("."),oe=W[W.length-1],Z.startsWith(`${Y}.`)&&(Z=[...W,Z.replace(`${Y}.`,"")]);else if(Z.indexOf(".")>=0){Z=Z.split(".");let ie=N("fieldsValue",Z[0],H,[]);if(Array.isArray(ie)&&ie.length>0)for(let le=0;le<ie.length;le++)await A(H,K,[Z[0],le],G);return}const re=Array.isArray(Z)?Z.join("."):Z;if(d.current.hasCircularDependency(re)){const ie=d.current.getCurrentPath();console.log(`检测到公式计算中的循环依赖链路: ${[...ie,re].join(" -> ")}`);return}try{let ie=[];if(J!=null&&J.withData&&(J==null?void 0:J.withData.length)>0&&ne&&typeof ne=="function")for(let be=0;be<(J==null?void 0:J.withData.length);be++){const fe=J==null?void 0:J.withData[be];let ve={};ve.tableName=fe.withTable.table_name,ve.filter={};for(let Ae=0;Ae<fe.withCondition.length;Ae++){var ue;const{value:Re,column:Xe}=fe.withCondition[Ae];let Ue=N(Re.group_key,Re.field_key,H,ie);if(Array.isArray(Ue)&&Array.isArray(Z)&&Ue.length>oe&&(Ue=Ue[oe]),Ue&&typeof Ue=="string")try{Ue=JSON.parse(Ue)}catch{}(ue=Ue)!==null&&ue!==void 0&&ue.value&&(Ue=Ue.value),ve.filter[Xe.column_name]=Ue}const Ce=await ne(ve);Ce.code===0&&Ce.data.list&&ie.push({id:fe.id,data:Ce.data.list})}let le;if(J.value&&J.value.length>0&&(le=J.value.map(be=>{let fe="";const{insert:ve,attributes:Ce}=be;return typeof ve!="string"?ve!=null&&ve.span&&Ce&&Ce.tagKey&&Ce.id&&(fe=N(Ce.tagKey,Ce.id,H,ie),Array.isArray(fe)?(Array.isArray(Z)&&fe.length>oe&&(fe=fe[oe]),typeof fe=="object"&&fe!==null&&(fe=JSON.stringify(fe))):typeof fe=="object"&&fe!==null?fe=JSON.stringify(fe):fe.length>0&&(fe=`"${fe}"`)):fe=ve,fe})),le&&le.length>0){const be=Kk(le);console.log(`${Z} 计算公式:`,le),console.log(`${Z} 计算结果:`,be),i.setFieldValue(Z,be),await C(Z,i.getFieldsValue(),!1,re)}}finally{}},N=(H,K,W,G)=>{let X="";if(H=="fieldsValue"){var Q;if(K.indexOf(".")>=0){var ee;const[oe,Y]=K.split("."),Z=(W==null?void 0:W[oe])||[];Array.isArray(Z)?X=Z.map(re=>{var ue;return(ue=re==null?void 0:re[Y])!==null&&ue!==void 0?ue:""}):X=(ee=Z==null?void 0:Z[Y])!==null&&ee!==void 0?ee:""}else X=(Q=W==null?void 0:W[K])!==null&&Q!==void 0?Q:""}else{let oe=G.find(Y=>Y.id===H);if(oe&&oe.data&&oe.data.length>0){var J,ne;X=(J=(ne=oe.data[0])===null||ne===void 0?void 0:ne[K])!==null&&J!==void 0?J:""}}return X},P=q.useRef({}),R=q.useRef(null),M=q.useCallback(()=>{R.current&&clearTimeout(R.current);const H=f.current===1?500:100;R.current=setTimeout(async()=>{console.log("debounceHandleFieldsChange starting",P.current),d.current.startNewCycle();const K=i.getFieldsValue(),W=f.current;f.current=0;let G=!1;m.current||(m.current={}),console.log("lastFormValues.current",m.current);const X=new Set;for(let Q in P.current){let ee=P.current[Q];if(console.log("debounceHandleFieldsChange field",ee),console.log("debounceHandleFieldsChange getLastFieldValue",h(ee.name)),!_u.isEqual(ee.value||"",h(ee.name)||"")){if(console.log("debounceHandleFieldsChange lockStatus_",W),W!=1){const J=Array.isArray(ee.name)?ee.name.map(oe=>typeof oe=="string"?oe:oe.toString()).join("."):ee.name;if(X.has(J)){console.log("跳过已处理的字段 processedFields",J);continue}X.add(J);let ne=await C(ee.name,K,!1,J);G=G||ne}m.current[ee.name]=ee.value}}G&&(console.log("needRefresh",G),c()),P.current={}},H)},[]),B=q.useCallback(H=>{setTimeout(()=>{H.filter(K=>{K.name&&K.name.length>0&&(P.current[K.name]=K)}),console.log("handleFieldsChange",P.current),M()},0)},[]),k=H=>{let K=[];return H.forEach(W=>{if(!u.current.has(W))return;let G=u.current.get(W);G.withIds.length<=0||K.push(...G.withIds.filter(X=>!K.includes(X)))}),K=K.filter(W=>{var G=i.getFieldValue(W);return!(typeof G!="number"&&!G)}),K},V=H=>{let K=k(H);const W=i.getFieldsValue();setTimeout(async()=>{for(let G=0;G<K.length;G++){const X=K[G];await C(X,W)}},0)},z=async H=>{const K=i.getFieldsValue();setTimeout(async()=>{for(let W=0;W<H.length;W++){const G=H[W];await C(G,K)}},0)},L=q.useRef({}),F=H=>u.current&&u.current.has(H)?u.current.get(H):null,j=()=>(console.log("memoizedRenderChildren",u.current),u.current?_():null),_=()=>{console.log("renderChildren");const H=Da(),K=q.Children.toArray(r);return console.log("childrenArray",K),wvt(K,n,u.current).map((G,X)=>Ge.jsx(v2,{gutter:[24,24],children:G.map((Q,ee)=>{var J,ne;const{componentId:oe,__id:Y,_componentName:Z,...re}=Q.props,ue=((J=Q.type)===null||J===void 0?void 0:J.displayName)||Z,ie=oe||Y;ie in L.current||(L.current[ie]=Da());const le=ue&&ue.startsWith("Layout."),be=ue&&ue=="Field.Table",fe=!u.current.has(ie)||((ne=u.current.get(ie))===null||ne===void 0?void 0:ne.show),ve=(re.calcHidden||!fe)&&o!="desgin",Ce=[];if(re.isRequired&&Ce.push({required:!0,message:`${re.label}必须填写`}),re.rules)if(Array.isArray(re.rules)){const Xe=re.rules.join("|");Ce.push({pattern:new RegExp(Xe),message:re.rulesFailMessage?re.rulesFailMessage:`${re.label}格式错误`})}else Ce.push({pattern:new RegExp(re.rules),message:re.rulesFailMessage?re.rulesFailMessage:`${re.label}格式错误`});const Ae=Xe=>{i.setFieldValue(ie,Xe)};let Re;return be||le?Re=q.cloneElement(Q,{onTableAddRow:V,getTableWithIds:k,onTableRemoveRow:z,removeLastFieldsValues:E,form:i,fieldName:ie,onCustomChange:Ae,initializeFormRender:g,mode:o,recordFieldsChange:w,getDependencyMapItem:F,renderKey:H}):ue==="Field.WithSingleSelect"||ue==="Field.WithMultipleSelect"||ue==="Show.WithTable"?Re=Ge.jsx(So.Item,{hidden:ve,style:{margin:0},shouldUpdate:(Xe,Ue)=>{let qe=!1;if(Array.isArray(re.filterRules)&&re.filterRules.length>0)for(let tt of re.filterRules){if(tt.valueType!="variable")continue;let Le,ze;if(Le=Xe==null?void 0:Xe[tt.value.field_key],ze=Ue==null?void 0:Ue[tt.value.field_key],Le!==ze){qe=!0;break}}return qe&&(L.current[ie]=Da(),console.log(ie,Da())),qe},children:Xe=>{let{getFieldsValue:Ue}=Xe;const qe=Ue();let tt=q.cloneElement(Q,{onTableAddRow:V,onTableRemoveRow:z,removeLastFieldsValues:E,form:i,fieldName:ie,onCustomChange:Ae,fieldsValue:qe,initializeFormRender:g,recordFieldsChange:w,shouldUpdateKey:L.current[ie]});return ue==="show.WithTable"?Ge.jsx(Ge.Fragment,{children:tt}):Ge.jsx(So.Item,{style:{marginBottom:0},label:"",name:ie,rules:fe?Ce:[],children:tt})}}):Re=Ge.jsx(So.Item,{hidden:ve,style:{marginBottom:0},label:"",name:ie,rules:fe?Ce:[],children:q.cloneElement(Q,{form:i,fieldName:ie,onCustomChange:Ae,initializeFormRender:g,recordFieldsChange:w,removeLastFieldsValues:E})}),Ge.jsx(Ay,{span:ve?0:le?24:24/n,style:{marginBottom:0},children:Re},ie||`col-${ee}`)})},`row-${X}`))};return Ge.jsx(Su,{theme:{components:{Table:{rowHoverBg:"#ebebeb"}},token:{colorBgContainerDisabled:"rgba(0, 0, 0, 0.02)",colorTextDisabled:"#333"}},children:Ge.jsxs(So,{form:i,className:"form-container fp-0 fw-full fh-full box-border fflex fflex-col "+(o=="desgin"?" fp-6":""),onFieldsChange:B,children:[Ge.jsx(So.Item,{name:"__id",hidden:!0,children:Ge.jsx("input",{type:"hidden"})}),s]})})});function xvt(e){return q.forwardRef((t,n)=>Ge.jsx(e,{...t,ref:n,forwardedRef:n}))}class Urn extends q.PureComponent{render(){const{forwardedRef:t,...n}=this.props;return Ge.jsx(sU,{...n,ref:t})}}const Avt=xvt(e=>{let{forwardedRef:t,...n}=e;return Ge.jsx(sU,{...n,ref:t})});function Ovt(e,t,n){const r=[];let o=[];const i=(a,s)=>{for(;s.length<a;)s.push(Ge.jsx("div",{},Da()))};return e.forEach(a=>{var s,l;const u=((s=a.type)===null||s===void 0?void 0:s.displayName)||((l=a.props)===null||l===void 0?void 0:l._componentName);u&&u.startsWith("Layout.")?(o.length>0&&(i(t,o),r.push(o),o=[]),r.push([a])):(o.push(a),o.filter(f=>{var d,p,g,m;const h=((d=f.props)===null||d===void 0?void 0:d.componentId)||((p=f.props)===null||p===void 0?void 0:p.__id);return(!(n!=null&&n.has(h))||((g=n.get(h))===null||g===void 0?void 0:g.show))&&!((m=f.props)!==null&&m!==void 0&&m.calcHidden)}).length===t&&(r.push(o),o=[]))}),o.length>0&&(i(t,o),r.push(o)),r}const Dvt=e=>{const t=new Map,n=[],r=function(o){var i,a;let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const l=((i=o.type)===null||i===void 0?void 0:i.displayName)||((a=o.props)===null||a===void 0?void 0:a._componentName),{props:u}=o;if(l&&(l.startsWith("Field.")||l.startsWith("Layout."))){let c=(u==null?void 0:u.componentId)||(u==null?void 0:u.__id);s&&(c=`${s}.${c}`);const f=u.withId?[u.withId]:u.withIds?[...u.withIds]:[];n.push({identifier:c,withIds:f,compName:l,fillRules:u==null?void 0:u.fillRules,visibleFunc:u==null?void 0:u.withVisibleFunc})}u!=null&&u.children&&q.Children.forEach(u.children,c=>{r(c,l&&l.startsWith("Field.")?(u==null?void 0:u.componentId)||(u==null?void 0:u.__id):"")})};return q.Children.forEach(e,o=>r(o)),n.forEach(o=>{t.set(o.identifier,{...o,show:!0,children:n.filter(i=>i.withIds.includes(o.identifier))})}),t},Tvt=function(e,t,n){if(!t.has(e))return!1;const r=t.get(e);if(r.visibleFunc&&typeof r.visibleFunc=="function"){const o=r.visibleFunc(n);if(r.show!==o)return r.show=o,!0}if(r.fillRules&&Array.isArray(r.fillRules)&&r.fillRules.length>0){const o=r.fillRules.map(a=>typeof a=="string"?a:""),i=Kk(o)==="true";if(r.show!==i)return r.show=i,!0}return!1},$vt=q.forwardRef((e,t)=>{let{cols:n=1,children:r,mode:o="view"}=e;const[i]=So.useForm(),[a,s]=q.useState(null),l=q.useRef(new Map),u=q.useRef({}),c=q.useRef({}),f=q.useCallback(()=>{l.current=Dvt(r)},[r]),d=q.useCallback(()=>{const h=i.getFieldsValue();let y=!1;l.current.forEach((v,b)=>{const C=Tvt(b,l.current,h);y=y||C}),y&&s(m())},[i]),p=q.useCallback(_u.debounce(()=>{const h=i.getFieldsValue();Object.keys(c.current).forEach(y=>{c.current[y]!==h[y]&&(u.current[y]=h[y])}),c.current={},d()},200),[i,d]),g=function(){for(var h=arguments.length,y=new Array(h),v=0;v<h;v++)y[v]=arguments[v];let[,b]=y;Object.assign(c.current,b),p()},m=q.useCallback(()=>{const h=q.Children.toArray(r);return Ovt(h,n,l.current).map((v,b)=>Ge.jsx(v2,{gutter:[24,24],children:v.map((C,E)=>{var S,w;const{componentId:x,__id:O,_componentName:T,calcHidden:A,...N}=C.props,P=((S=C.type)===null||S===void 0?void 0:S.displayName)||T,R=x||O,M=Da(),B=P&&P.startsWith("Layout."),k=!l.current.has(R)||((w=l.current.get(R))===null||w===void 0?void 0:w.show),V=(A||!k)&&o!=="desgin",z=[];if(N.isRequired&&z.push({required:!0,message:`${N.label}必须填写`}),N.rules){const F=Array.isArray(N.rules)&&N.rules.length>0?N.rules.join("|"):N.rules;z.push({pattern:new RegExp(F),message:N.rulesFailMessage||`${N.label}格式错误`})}let L=null;return B?L=q.cloneElement(C,{form:i,fieldName:R,updateKey:M}):L=Ge.jsx(So.Item,{hidden:V,label:N.label||"",name:R,rules:k?z:[],children:q.cloneElement(C,{form:i,fieldName:R,updateKey:M})}),Ge.jsx(Ay,{span:V?0:B?24:24/n,children:L},R||`col-${E}`)})},`row-${b}`))},[r,n,i,o]);return q.useEffect(()=>{f(),s(m())},[f,m]),q.useImperativeHandle(t,()=>({formRef:i,setFieldsValue:h=>{i.setFieldsValue(h),p()},refreshDependencies:()=>{f(),d()}})),Ge.jsxs(So,{form:i,className:`form-container fp-0 fw-full fh-full box-border fflex fflex-col fgap-y-2${o==="desgin"?" fp-6":""}`,onValuesChange:g,children:[Ge.jsx(So.Item,{name:"__id",hidden:!0,children:Ge.jsx("input",{type:"hidden"})}),a]})}),Nvt=e=>{let{request:t,value:n,onChange:r,callError:o,disabledValue:i,addRoot:a=!0,title:s,...l}=e;const[u,c]=q.useState(!1),[f,d]=q.useState([]);q.useEffect(()=>{p()},[]),q.useEffect(()=>{if(typeof n=="string")try{n=JSON.parse(n),r(n)}catch{}Array.isArray(n)&&y(n)},[n]);const p=async()=>{if(t&&typeof t=="function"){var O;const T=await t();if(T.code>0){o&&typeof o=="function"&&o(T.message);return}let A=U6e(((O=T.data)===null||O===void 0?void 0:O.list)||T.data||[],"id",s||"title",(l==null?void 0:l.parentId)||"parentId","children",0,i);a&&(A=[{value:0,title:"根节点",children:A}]),l.treeData=A,console.log("treeData",A),d(A)}l.treeData&&d(l.treeData),c(!0)},[g,m]=q.useState([]),[h,y]=q.useState([]),[v,b]=q.useState([]),[C,E]=q.useState(!0),S=O=>{console.log("onExpand",O),m(O),E(!1)},w=O=>{console.log("onCheck",O),y(O),r(O)},x=(O,T)=>{console.log("onSelect",T),b(O)};return Ge.jsx(Mo,{...l,children:Ge.jsx(XV,{checkable:!0,onExpand:S,onCheck:w,onSelect:x,expandedKeys:g,autoExpandParent:C,checkedKeys:h,selectedKeys:v,treeData:f})})},Pvt=e=>Ge.jsx(Mo,{...e,children:Ge.jsx(h2,{...e})}),Ivt=e=>Ge.jsx(Mo,{...e,children:Ge.jsx(h2.Group,{...e})}),Rvt=e=>Ge.jsx(Mo,{...e,children:Ge.jsx(l6.Group,{...e})}),h$e=e=>{let{value:t,maxCount:n,multiple:r,onChange:o,...i}=e;q.useEffect(()=>{if(t){if(typeof t=="string")try{t=JSON.parse(t),o(t)}catch{}console.log("value",t),Array.isArray(t)&&s(t)}},[t]),n=n||99,r=r||!0;const[a,s]=q.useState([]),l=u=>{let{fileList:c}=u;console.log("newFileList",c),c=c.map(f=>(f.status=="done"&&f.response&&(f.url=f.response),f)),o(c.map(f=>({uid:f.uid,name:f.name,status:f.status,url:f.url||f.response||"",error:f.error}))),s(c)};return Ge.jsx(y6,{...i,listType:"text",multiple:r,onChange:l,maxCount:n,fileList:a,children:!(i!=null&&i.disabled)&&!(i!=null&&i.readonly)&&a.length<n&&Ge.jsx(ns,{type:(i==null?void 0:i.type)||"default",icon:(i==null?void 0:i.icon)||Ge.jsx(V6e,{}),children:"点击上传文件"})})};h$e.displayName="UploadFile";const Mvt=e=>Ge.jsx(Mo,{...e,children:Ge.jsx(h$e,{...e})}),v$e=e=>{let{maxCount:t,value:n,multiple:r,onChange:o,...i}=e;q.useEffect(()=>{if(n){if(console.log("value",n),typeof n=="string")try{n=JSON.parse(n),o(n)}catch{}let E=[];if(Array.isArray(n))for(let S=0;S<n.length;S++){let w=n[S];var C=g.current.find(x=>x.uid===w.uid);!C||(C.version||0)<(w.version||0)?E.push(w):E.push(C)}s(E)}},[n]),t=t||99,r=r||!0;const[a,s]=q.useState([]),[l,u]=q.useState(""),[c,f]=q.useState(0),[d,p]=q.useState(!1),g=q.useRef([]),m=C=>new Promise((E,S)=>{const w=new FileReader;w.readAsDataURL(C),w.onload=()=>E(w.result),w.onerror=x=>S(x)}),h=async(C,E)=>{!C.url&&!C.preview&&(C.preview=await m(C.originFileObj)),u(C.url||C.preview),f(E),p(!0)},y=async(C,E)=>{i!=null&&i.disabled||s(a.filter((S,w)=>w!==E))},v=Ge.jsx(Ge.Fragment,{children:Ge.jsxs("div",{className:"fw-full fh-full fflex fflex-col fitems-center fjustify-center fborder fborder-dashed fcursor-pointer frounded",children:[Ge.jsx(z6e,{}),Ge.jsx("div",{className:"fmt-2",children:"点击上传"})]})}),b=C=>{let{fileList:E}=C,S=[];for(let O=0;O<E.length;O++){var w=E[O];w.version=new Date().getTime();var x=g.current.find(T=>T.uid===w.uid);console.log("oldfile",JSON.parse(JSON.stringify(x||{}))),x&&x.status!="uploading"?S.push(x):(w.status=="done"&&w.response&&(w.url=w.response),S.push(w))}g.current=S,s(S),o(S.map(O=>({uid:O.uid,name:O.name,status:O.status,url:O.url||O.response||"",error:O.error,version:O.version||0})))};return Ge.jsxs(Ge.Fragment,{children:[Ge.jsx("div",{className:"fflex fgap-3 fflex-wrap",children:Ge.jsx(y6,{...i,itemRender:(C,E,S)=>{console.log("file",E);let w=S.findIndex(x=>x.uid===E.uid);return Ge.jsx(Ge.Fragment,{children:Ge.jsxs("div",{className:"fgroup fw-full fh-full fbg-transparent fborder frounded fflex fitems-center fjustify-center foverflow-hidden fcursor-pointer frelative"+(E.status=="error"?" fborder-red-500":""),children:[Ge.jsxs("div",{className:" fhidden fabsolute fw-full fh-full fbg-gray-900 fbg-opacity-50 fitems-center fjustify-center fz-10 group-hover:fflex ftext-white ftext-lg fgap-2",children:[E.status=="done"&&Ge.jsx(H6e,{onClick:()=>{h(E,w)},className:"hover:ftext-gray-200"}),!(i!=null&&i.disabled)&&!(i!=null&&i.readonly)&&Ge.jsx(tU,{onClick:()=>{y(E,w)},className:"hover:ftext-gray-200"})]}),E.status=="uploading"&&Ge.jsx("div",{className:" fw-full fh-full fflex fitems-center fjustify-center fabsolute ftop-0 fleft-0 ",children:Ge.jsx(jE,{})}),Ge.jsx("img",{src:E.url||E.thumbUrl,alt:"Example Image",className:"fmax-w-full fmax-h-full fobject-contain "})]},`file-${E.uid}`)})},listType:"picture-card",fileList:a,multiple:r,onPreview:h,onChange:b,maxCount:t,children:a.length>=t||i!=null&&i.disabled||i!=null&&i.readonly?null:v})}),l&&Ge.jsx(FD.PreviewGroup,{preview:{visible:d,current:c,onVisibleChange:C=>p(C),onChange:C=>{f(C)}},children:a.map((C,E)=>Ge.jsx(Ge.Fragment,{children:Ge.jsx(FD,{wrapperStyle:{display:"none"},src:C.url})}))})]})};v$e.displayName="UploadImage";const Fvt=e=>Ge.jsx(Mo,{...e,children:Ge.jsx(v$e,{...e})}),Bvt=e=>{let{value:t,onChange:n,form:r,fieldName:o,...i}=e,a=!1;return typeof t=="boolean"?a=t:typeof t=="string"?a=t=="1"||t=="true":typeof t=="number"&&(a=t==1),t!==a&&(r==null||r.setFieldValue(o,a)),Ge.jsx(Mo,{...i,children:Ge.jsx(UV,{...i,onChange:n,value:t})})};var kvt={exports:{}};(function(e,t){(function(n,r){e.exports=r(E4e)})(Cr,function(n){function r(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var o=r(n),i={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(a,s){return s==="W"?a+"周":a+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(a,s){var l=100*a+s;return l<600?"凌晨":l<900?"早上":l<1100?"上午":l<1300?"中午":l<1800?"下午":"晚上"}};return o.default.locale(i,null,!0),i})})(kvt);var Lvt=ge(ge({},_Ae),{},{locale:"zh_CN",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",week:"周",month:"月",year:"年",previousMonth:"上个月 (翻页上键)",nextMonth:"下个月 (翻页下键)",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",previousYear:"上一年 (Control键加左方向键)",nextYear:"下一年 (Control键加右方向键)",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪",yearFormat:"YYYY年",cellDateFormat:"D",monthBeforeYear:!1});const jvt={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]},g$e={lang:Object.assign({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},Lvt),timePickerLocale:Object.assign({},jvt)};g$e.lang.ok="确定";var m$e={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Cr,function(){return function(n,r,o){o.updateLocale=function(i,a){var s=o.Ls[i];if(s)return(a?Object.keys(a):[]).forEach(function(l){s[l]=a[l]}),s}}})})(m$e);var _vt=m$e.exports;const Hvt=ga(_vt);pi.extend(Hvt);pi.extend(T4e);pi.updateLocale("zh-cn",{weekStart:0});const zvt=e=>{let{datetype:t,value:n,defaultNow:r,onChange:o,...i}=e;t=t||"date";const[a,s]=q.useState(i==null?void 0:i.picker),[l,u]=q.useState(i==null?void 0:i.format),[c,f]=q.useState(!1),[d,p]=q.useState(!1),g=q.useRef(!1);q.useEffect(()=>{if(r&&!n){const h=pi().format("YYYY-MM-DD HH:mm:ss");typeof o=="function"&&o(h);return}},[]);const m=(h,y)=>{g.current=!0,o(y)};return q.useEffect(()=>{switch(s("date"),f(!1),t){case"date":s("date"),u("YYYY-MM-DD"),p(!1);break;case"datetime":f(!0),s("datetime"),u("YYYY-MM-DD HH:mm:ss"),p(!0);break;case"month":s("month"),p(!1);break;case"year":s("year"),p(!1);break}},[t]),Ge.jsx(Mo,{...i,children:Ge.jsx(Oy,{locale:g$e,...i,picker:a,format:l,style:{width:"100%"},onChange:m,value:n&&pi(n).isValid()?pi(n):void 0,showTime:c,needConfirm:d})})};var lU={exports:{}},E2={},x6={exports:{}},y$e={},Gk={exports:{}},Wx={exports:{}},Vr={};/** @license React v16.13.1
425
425
  * react-is.production.min.js
426
426
  *
427
427
  * Copyright (c) Facebook, Inc. and its affiliates.
package/dist/index.es.js CHANGED
@@ -48062,7 +48062,7 @@ const O6e = /* @__PURE__ */ ki((e, t) => {
48062
48062
  }
48063
48063
  d.current.addToPath(J);
48064
48064
  try {
48065
- if (u.current.has(H)) {
48065
+ if (console.log("dependencyMap.current", u.current), console.log("dependencyMap.current identifier", H), u.current.has(H)) {
48066
48066
  const Z = u.current.get(H), te = Z.children;
48067
48067
  !W && Z !== null && Z !== void 0 && Z.fillRules && Array.isArray(Z == null ? void 0 : Z.fillRules) && (Z == null ? void 0 : Z.fillRules.length) > 0 && x(H, q, K, Z == null ? void 0 : Z.fillRules);
48068
48068
  for (let re = 0; re < te.length; re++) {
@@ -48296,15 +48296,15 @@ const O6e = /* @__PURE__ */ ki((e, t) => {
48296
48296
  R.current && clearTimeout(R.current);
48297
48297
  const H = f.current === 1 ? 500 : 100;
48298
48298
  R.current = setTimeout(async () => {
48299
- console.log("debounceHandleFieldsChange starting"), d.current.startNewCycle();
48299
+ console.log("debounceHandleFieldsChange starting", P.current), d.current.startNewCycle();
48300
48300
  const K = i.getFieldsValue(), W = f.current;
48301
48301
  f.current = 0;
48302
48302
  let G = !1;
48303
- m.current || (m.current = {});
48303
+ m.current || (m.current = {}), console.log("lastFormValues.current", m.current);
48304
48304
  const X = /* @__PURE__ */ new Set();
48305
48305
  for (let q in P.current) {
48306
48306
  let J = P.current[q];
48307
- if (!Ku.isEqual(J.value || "", h(J.name) || "")) {
48307
+ if (console.log("debounceHandleFieldsChange field", J), console.log("debounceHandleFieldsChange getLastFieldValue", h(J.name)), !Ku.isEqual(J.value || "", h(J.name) || "")) {
48308
48308
  if (console.log("debounceHandleFieldsChange lockStatus_", W), W != 1) {
48309
48309
  const Z = Array.isArray(J.name) ? J.name.map((re) => typeof re == "string" ? re : re.toString()).join(".") : J.name;
48310
48310
  if (X.has(Z)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lu-lowcode-package-form",
3
- "version": "0.11.68",
3
+ "version": "0.11.70",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^4.8.1",
6
6
  "@dnd-kit/core": "^6.1.0",
@@ -268,6 +268,8 @@ const FormContainer = forwardRef(({ cols = 1, children, mode = "view" }, ref) =>
268
268
  dependencyGraphRef.current.addToPath(currentFieldId);
269
269
 
270
270
  try {
271
+ console.log("dependencyMap.current", dependencyMap.current)
272
+ console.log("dependencyMap.current identifier", identifier)
271
273
  if (dependencyMap.current.has(identifier)) {
272
274
  const dependent = dependencyMap.current.get(identifier)
273
275
  const dependentChildren = dependent.children;
@@ -718,7 +720,7 @@ const FormContainer = forwardRef(({ cols = 1, children, mode = "view" }, ref) =>
718
720
  const delay = lockStatus.current === 1 ? 500 : 100;
719
721
 
720
722
  timeoutRef.current = setTimeout(async () => {
721
- console.log("debounceHandleFieldsChange starting")
723
+ console.log("debounceHandleFieldsChange starting",changedFieldsState.current)
722
724
  // 开始新的更新周期
723
725
  dependencyGraphRef.current.startNewCycle();
724
726
 
@@ -727,11 +729,14 @@ const FormContainer = forwardRef(({ cols = 1, children, mode = "view" }, ref) =>
727
729
  lockStatus.current = 0
728
730
  let needRefresh = false;
729
731
  if (!lastFormValues.current) lastFormValues.current = {}
732
+ console.log("lastFormValues.current",lastFormValues.current)
730
733
 
731
734
  // 创建已处理字段集合,用于避免多次处理同一字段
732
735
  const processedFields = new Set();
733
736
  for (let key in changedFieldsState.current) {
734
737
  let field = changedFieldsState.current[key];
738
+ console.log("debounceHandleFieldsChange field", field)
739
+ console.log("debounceHandleFieldsChange getLastFieldValue", getLastFieldValue(field.name))
735
740
  if (!isEqual(field.value || "", getLastFieldValue(field.name) || "")) {
736
741
  console.log("debounceHandleFieldsChange lockStatus_", lockStatus_)
737
742
  if (lockStatus_ != 1) {