!function(o){o.formbuilder.icpx=o.formbuilder.icpx||{};var e=o.formbuilder.toolbox,t={},a={};function i(){t.DefaultObjectValue=o.extend(!0,{},e.textbox,a.DefaultObjectValue||{}),t.DescriptionValue=o.extend(!0,{},e.textarea,a.DescriptionValue||{}),t.DateTimeValue=o.extend(!0,{},e.datetime,a.DateTimeValue||{}),t.DateValue=o.extend(!0,{},e.date,a.DateValue||{}),t.TimeValue=o.extend(!0,{},e.time,a.TimeValue||{}),t.ObjectIDValue=o.extend(!0,{},e.editbutton,a.ObjectIDValue||{}),t.SingleUserValue=o.extend(!0,{},e.editbutton,a.SingleUserValue||{}),t.MultiUserValue=o.extend(!0,{},e.editbutton,a.MultiUserValue||{}),t.SingleRoleValue=o.extend(!0,{},e.editbutton,a.SingleRoleValue||{}),t.MultiRoleValue=o.extend(!0,{},e.editbutton,a.MultiRoleValue||{}),t.SingleGroupValue=o.extend(!0,{},e.editbutton,a.SingleGroupValue||{}),t.MultiGroupValue=o.extend(!0,{},e.editbutton,a.MultiGroupValue||{}),t.EnumValue=o.extend(!0,{},e.select,{options:{choice:"single"},property:{filterable:{hidden:!0},choice:{hidden:!0}}},a.EnumValue||{}),t.MultiEnumValue=o.extend(!0,{},e.select,{options:{choice:"multiple"},property:{filterable:{hidden:!0},choice:{hidden:!0}}},a.MultiEnumValue||{}),t.MultiLovListValue=o.extend(!0,{},e.select,a.MultiLovListValue||{}),t.FileUploadValue=o.extend(!0,{},e.fileupload,a.FileUploadValue||{}),t.ImageUploadValue=o.extend(!0,{},e.fileupload,{accept:"image/*"},a.ImageUploadValue||{}),t.BoolValue=o.extend(!0,{},e.select,{property:{filterable:{hidden:!0},choice:{hidden:!0}},options:{filterable:!1}},a.BoolValue||{}),t.LovListValue=o.extend(!0,{},e.select,a.LovListValue||{}),t.LovListRadio=o.extend(!0,{},e.select,a.LovListRadio||{}),t.EnumRadioValue=o.extend(!0,{},e.select,a.EnumRadioValue||{}),t.CheckBoxListValue=o.extend(!0,{},e.select,a.CheckBoxListValue||{}),t.CodeValue=o.extend(!0,{},e.editbutton,{property:{objectId:{text:"objectId",type:"textarea"}}},a.CodeValue||{}),t.LabelValue=o.extend(!0,{},e.label,a.LabelValue||{}),t.SingleOrgValue=o.extend(!0,{},e.editbutton,a.SingleOrgValue||{}),t.HBCustomSelect=o.extend(!0,{},e.editbutton,a.HBCustomSelect||{}),t.SingleDeptValue=o.extend(!0,{},e.editbutton,a.SingleDeptValue||{}),t.SinglePostValue=o.extend(!0,{},e.editbutton,a.SinglePostValue||{}),t.MultiPostValue=o.extend(!0,{},e.editbutton,a.MultiPostValue||{}),t.MultiDeptValue=o.extend(!0,{},e.editbutton,a.MultiDeptValue||{}),t.ProjectListSelect=o.extend(!0,{},e.editbutton,a.ProjectListSelect||{}),t.ConponentSelect=o.extend(!0,{},e.editbutton,a.ConponentSelect||{}),t.BasicDatabaseSelect=o.extend(!0,{},e.editbutton,a.BasicDatabaseSelect||{}),t.BasicDatabaseTableSelect=o.extend(!0,{},e.editbutton,a.BasicDatabaseTableSelect||{}),t.ProductVersion=o.extend(!0,{},e.editbutton,a.ProductVersion||{}),t.HBDynamicSelect=o.extend(!0,{},e.select,a.HBDynamicSelect||{}),o.formbuilder.icpx.modelTypes=t}i(),o.formbuilder.icpx.setComponentConfig=function(e,t={}){return e&&("string"==typeof e&&(a[e]=t),Array.isArray(e)&&e.forEach(e=>{e&&(a[e]=t)})),i(),o.formbuilder.icpx.modelTypes},o.formbuilder.icpx.buildOption=function(e){const a=e.events.customControlClick;return e.events.customControlClick=function(e){console.log(e);let t={};try{t=e.options.tag.Params}catch(e){console.error(e)}var o={type:e.options.type||"",value:e.options.value||"",text:e.text||"",param:t,autoQueryAllFields:e.autoQueryAllFields||!1,row:e.row,attribute:{objectId:e.options.objectId||""},resolve:e.resolve,options:e.options};console.log(o),a(o,e)},e}}(jQuery,window),function(o){o.formbuilder.icpx=o.formbuilder.icpx||{},o.formbuilder.icpx.design={generateToolbox:function(e,t){const s={toolbox:{},control:{order:[]}},d=o.formbuilder.icpx.modelTypes;return e&&0{const r={master:n.Master,text:n.ObjTypeText,expand:!1,children:[]},{PropertyControlData:t,...u}=n;var o=JSON.parse(n.PropertyControlData);r.children=o.map(t=>{var{DisposeType:o,InfoType:a,Text:i}=t,l=d[o];if(l){t={options:{tag:{...u,...t}}},t=_.defaultsDeep({},t,l);t.title=i;let e=""+n.ObjTypeName+a;return"LabelValue"===o&&(e="Label"+e,t.options.value=i,t.property.value.hidden=!0),r.master&&(t.property["relation-position"].hidden=!0,t.property["extension-direction"].hidden=!0),s.toolbox[e]=t,e}}).filter(e=>e),s.control.order.push(r)}),s.control.order.push({text:t?t.basicText:"",expand:!1,children:["label","link","datasetindex","image"]}),s},formatLoadData:function(e){return e?JSON.parse(e):{}},formatSaveData:function(e){var t={AssistantGid:{},UsedFields:[],LayoutData:JSON.stringify(e)};return t.UsedFields=JSON.stringify((e=>{const a=new Map,i=(e.controls.forEach(e=>{var t,o;e.tag&&({DisposeType:e,ObjTypeName:t,InfoType:o}=e.tag,e&&"LabelValue"!==e&&a.set(t+"."+o,!0))}),[]);return a.forEach((e,t,o)=>{var[t,a]=t.split(".");i.push({ObjTypeName:t,InfoType:a})}),i})(e)),t.AssistantGid=JSON.stringify((e=>{var t={};if(e?.datasets?.template){e=e?.datasets?.template;if(e)for(var[o,a]of Object.entries(e))Array.isArray(a)&&0(void 0!==t.tag&&(e[t.type]=a.extend(!0,{},o[t.tag.DisposeType])),e),{})},formatLoadData(e,t){var o,i,s,e=(e=>{var t=void 0!==e.multi?e.multi:[""];if(e&&t[0]){var o,a,i={};for([o,a]of Object.entries(e))if("mainObjType"!==o&&!o.endsWith("_StartPosition")&&"multi"!=o&&e.mainObjType.length&&0!==e.mainObjType.length){var l=e.mainObjType[0];if(o===l){i.ObjectType=l;for(var[n,r]of Object.entries(JSON.parse(a[0])))i[n]=r}else{i.children||(i.children=[]);var u={option:{ChildObjType:o}};if(e[o+"_StartPosition"]&&(u.option[o+"_StartPosition"]=e[o+"_StartPosition"]),a.length&&0{let o=new Map;return Object.entries(e?.datasets.template).forEach(([t,e])=>{e.forEach(e=>{e.tag&&(o.has(t)?o.get(t).push(e.tag.InfoType):o.set(t,[e.tag.InfoType]))})}),o})(t);o=e,t?.controls.map(e=>{"object"==typeof e.tag&&"LabelValue"!==e.tag.DisposeType&&e.tag.Master&&(e.value=o[e.tag.InfoType]||"",e.text=o[e.tag.InfoType+"_DisplayValue"])}),i=t,s=a,(t=e).children&&t.children.forEach(e=>{const{option:t,line:o}=e;e=t.ChildObjType,e=t[e+"_StartPosition"];const a=new Map;if(void 0!==e){e.forEach((e,t)=>{a.has(e)?a.get(e).rows.push(o[t]):a.set(e,{id:e,rows:[o[t]]})});for(var[n,r]of a.entries()){const u=s.get(n);let i=[],l=new Map;if(r.rows.forEach((t,o)=>{void 0===t.PAGENUMEBR?1!==i.length?(i.push([[]]),u?.forEach(e=>{i[0][o].push({value:t[e]||"",text:t[e]||""})})):(i[0].push([]),u?.forEach(e=>{i[0][o].push({value:t[e]||"",text:t[e]||""})})):l.has(t.PAGENUMEBR)?l.get(t.PAGENUMEBR).push(t):l.set(t.PAGENUMEBR,[t])}),0!==[...l.values()].length)for(let[a,e]of l.entries())i.push([]),e.forEach((t,o)=>{i[parseInt(a)-1].push([]),u.forEach(e=>{i[parseInt(a)-1][o].push({value:t[e]||""})})});r.rows=i}i.datasets.data.push(...a.values())}})},formatSaveData(a){if(0!==a.controls.lenth){let o="";const i={};let e={},l={};if(a.controls.forEach(e=>{var t=e["tag"];"object"==typeof t&&t.Master&&"LabelValue"!==t.DisposeType&&(o=t.ObjTypeName,i[e.tag.InfoType]=e?.value||"")}),a.datasets?.data){const r=new Map;for(let[t,e]of Object.entries(a.datasets.template))e.forEach(e=>{e.tag&&r.set(t,e.tag.ObjTypeName)});let i=new Map;a.datasets.data.forEach(e=>{const{id:a,rows:t}=e;l[r.get(a)+"_StartPosition"]=[],t.forEach((e,o)=>{e.forEach(e=>{let t={PAGENUMBER:o+1};e.forEach(e=>{t[e.tag.InfoType]=e.value}),i.has(a)?i.get(a).push(t):i.set(a,[t]),l[r.get(a)+"_StartPosition"].push(a)})})});for(var[t,n]of i.entries())r.has(t)&&(e={[r.get(t)]:n,...e})}return{[o]:i,...e,...l}}}}}(jQuery,window),function(e){e.formbuilder.icpx=e.formbuilder.icpx||{}}(jQuery,window);