diff --git a/designer-base/src/main/resources/com/fr/design/data/tabledata/datacenter/web/data-choose.main.js b/designer-base/src/main/resources/com/fr/design/data/tabledata/datacenter/web/data-choose.main.js index 94cd6ecf62..d8d7769511 100644 --- a/designer-base/src/main/resources/com/fr/design/data/tabledata/datacenter/web/data-choose.main.js +++ b/designer-base/src/main/resources/com/fr/design/data/tabledata/datacenter/web/data-choose.main.js @@ -190,7 +190,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var ev=m;function uxt(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dxt=typeof Object.is=="function"?Object.is:uxt,fxt=ev.useState,pxt=ev.useEffect,vxt=ev.useLayoutEffect,hxt=ev.useDebugValue;function gxt(e,t){var r=t(),n=fxt({inst:{value:r,getSnapshot:t}}),a=n[0].inst,o=n[1];return vxt(function(){a.value=r,a.getSnapshot=t,LR(a)&&o({inst:a})},[e,r,t]),pxt(function(){return LR(a)&&o({inst:a}),e(function(){LR(a)&&o({inst:a})})},[e]),hxt(r),r}function LR(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!dxt(e,r)}catch{return!0}}function _xt(e,t){return t()}var mxt=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?_xt:gxt;MZ.useSyncExternalStore=ev.useSyncExternalStore!==void 0?ev.useSyncExternalStore:mxt,function(e){e.exports=MZ}(cxt);function LZ(e){e.reaction=new tD("observer".concat(e.name),function(){var t;e.stateVersion=Symbol(),(t=e.onStoreChange)===null||t===void 0||t.call(e)})}function xxt(e,t){t===void 0&&(t="observed");var r=$.useRef(null);if(!r.current){var n={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:t,subscribe:function(l){return NR.unregister(n),n.onStoreChange=l,n.reaction||(LZ(n),n.stateVersion=Symbol()),function(){var s;n.onStoreChange=null,(s=n.reaction)===null||s===void 0||s.dispose(),n.reaction=null}},getSnapshot:function(){return n.stateVersion}};r.current=n}var a=r.current;a.reaction||(LZ(a),NR.register(r,a,a)),$.useDebugValue(a.reaction,axt),MR.useSyncExternalStore(a.subscribe,a.getSnapshot,a.getSnapshot);var o,i;if(a.reaction.track(function(){try{o=e()}catch(l){i=l}}),i)throw i;return o}var zR,BR,zZ=typeof Symbol=="function"&&Symbol.for,bxt=(BR=(zR=Object.getOwnPropertyDescriptor(function(){},"name"))===null||zR===void 0?void 0:zR.configurable)!==null&&BR!==void 0?BR:!1,BZ=zZ?Symbol.for("react.forward_ref"):typeof m.forwardRef=="function"&&m.forwardRef(function(e){return null}).$$typeof,jZ=zZ?Symbol.for("react.memo"):typeof m.memo=="function"&&m.memo(function(e){return null}).$$typeof;function Zl(e,t){var r;if(jZ&&e.$$typeof===jZ)throw new Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");var n=(r=t?.forwardRef)!==null&&r!==void 0?r:!1,a=e,o=e.displayName||e.name;if(BZ&&e.$$typeof===BZ&&(n=!0,a=e.render,typeof a!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var i=function(l,s){return xxt(function(){return a(l,s)},o)};return i.displayName=e.displayName,bxt&&Object.defineProperty(i,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(i.contextTypes=e.contextTypes),n&&(i=m.forwardRef(i)),i=m.memo(i),wxt(e,i),i}var yxt={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function wxt(e,t){Object.keys(e).forEach(function(r){yxt[r]||Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}var jR;nxt(Kr.unstable_batchedUpdates),jR=NR.finalizeAllImmediately;const Dxt=Zl(({className:e,style:t,node:r,hasCheck:n=!1,checked:a,checkArea:o="node",hasJump:i=!1,selected:l,keywords:s,handleMore:c,handleRename:d,namesGetter:f,iconNameGetter:v,tooltipGetter:h,moreButtonMenuItems:g,onClick:_,onCheck:w,onJump:x,disabledCheck:y,tooltipProps:D={}})=>{const[F,S]=m.useState(!1),[I,C]=m.useState([]),[R,P]=m.useState(r.name),[O,N]=m.useState(a??!1),A=(Te.isFunction(g)?g(r):g)??[],z=M=>{d?.({id:r.id,name:M}).then(()=>{P(M)})},k=M=>h?.(M)??tn(gl,{children:[de("div",{children:M.name}),de("div",{children:at("FDI_Position_With_Colon")+M.position})]});return de("div",{style:t,className:ar(e,l&&"selected"),onClick:()=>{_?.(),o==="node"&&n&&(N(!O),w?.(!O))},children:tn("div",{className:"fdi-flex fdi-group",children:[n&&de(id,{disabled:y,className:"fdi-pt-xxs fdi-pr-xs",checked:a??O,onChange:()=>{o==="check"&&(N(!O),w?.(!O))}}),de("div",{className:"node-icon",children:de(Fa,{name:v?v(r):xq(!1,r),size:16})}),de(Xc,{...D,content:de("div",{children:k(r)}),children:tn("div",{className:"fdi-component-flex-w-fill-layout fdi-flex fdi-flex-col fdi-px-lg",children:[F?de(Fq,{className:"fdi-w-full",defaultValue:R,size:"small",onSave:M=>{S(!1),z(M)},onFocus:()=>{f?.(r).then(C)},checkError:M=>ow(M,I,Bl.NAME),validateHelp:M=>iw(M,I,Bl.NAME)}):de($q,{className:"fdi-catalog-search-title fdi-truncate",highlightClassName:"fdi-component-keyword-highlight",autoEscape:!0,textToHighlight:R,searchWords:s}),de("span",{className:"fdi-component-text-secondary fdi-truncate",children:r.position})]})}),A.length>0&&de(XC,{menu:{items:A,onAfterSelect:M=>{M.key===Xr.RENAME?S(!0):c?.(M.key,r)}},trigger:"click",children:de(jr,{className:"fdi-hidden group-hover:fdi-block",size:"small",type:"text-normal",icon:de(Fa,{name:"icon-more"}),onClick:M=>M.stopPropagation()})}),i&&de(jr,{className:"fdi-hidden group-hover:fdi-block",type:"text-normal",size:"small",icon:de(Fa,{name:"icon-enter"}),onClick:M=>{M.stopPropagation(),x?.()}})]})})}),Ixt=[{label:"FDI_All",value:Yn.ALL},{label:"FDI_Table",value:Yn.TABLE},{label:"FDI_Folder",value:Yn.FOLDER},{label:"FDI_Indicator",value:Yn.INDICATOR},{label:"FDI_Dimension",value:Yn.DIMENSION},{label:"FDI_Business_Model",value:Yn.BUSINESS_MODEL}];function Fxt(e){const t=[];let r=!1,n=0,a=0;return e.forEach(i=>{i.forEach(l=>{l.pageCount>0&&(t.push({key:"label",label:l.label}),l.nodes.forEach(s=>{t.push({key:l.value,node:s,nodeIndex:a++})}),n+=l.pageCount)})}),(Te.last(e)?.reduce((i,l)=>i+l.count,0)||0)!==n&&(r=!0),r&&t.push({key:"next"}),t}const UZ=({searchTypes:e,searchResults:t,showFilter:r=!0,onLoadData:n,keyword:a,refreshKey:o,searchNodeProps:i,emptyContent:l})=>{const[s,c]=m.useState(Yn.ALL),[d,f]=m.useState(1),v=m.useMemo(()=>Fxt(t),[t]),[h,g]=m.useState(0);Vl(()=>{g(h+1)},[v]),m.useEffect(()=>{f(1)},[a,s,o]);const{loading:_}=wm(()=>n({keyword:a??"",pageIndex:d,searchType:s}),{refreshDeps:[a,d,s,o],loadingDelay:300});return tn("div",{className:"fdi-search-result fdi-list fdi-component-flex-col-layout fdi-pt-xs",children:[r&&tn(gl,{children:[de("div",{children:Ixt.filter(({value:w})=>e.includes(w)).map(({value:w,label:x})=>de("span",{onClick:()=>c(w),children:de(hrt,{className:ar("fdi-mr-md fdi-mt-md",s===w&&"fdi-component-active-tag"),shape:"roundedRec",children:at(x)})},w))}),de(kW,{direction:"horizontal",style:{marginTop:Tn.token.gap,marginBottom:Tn.token.gap}})]}),tn("div",{className:"fdi-component-flex-h-fill-layout fdi-relative fdi-flex fdi-flex-col fdi-items-stretch",children:[de(sw,{loading:d===1&&_}),!v.length&&l,de(MQe,{items:v,renderItem:w=>{const x={paddingRight:Tn.token.paddingXs,paddingLeft:Tn.token.paddingXs};switch(w.key){case"label":return r?de("div",{style:x,className:"fdi-component-text-secondary",children:at(w.label)}):de(gl,{});case"next":return de("div",{style:x,children:d!==1&&_?de("div",{style:{height:Tn.token.controlHeight},className:"fdi-relative",children:de(sw,{})}):de(jr,{style:{height:Tn.token.controlHeight,width:"100%"},type:"text",onClick:()=>{f(d+1)},children:at("FDI_Load_More")})});default:return de(Dxt,{style:x,className:"fdi-component-list-item",node:w.node,keywords:[a??""],...i?.(w.node,w.nodeIndex,s)},w.node.id)}}},h)]})]})};function $xt(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Sxt(e){return"nodeType"in e}function Ext(e){var t,r;return e?$xt(e)?e:Sxt(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}var HZ;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(HZ||(HZ={}));const Cxt=Object.freeze({x:0,y:0});function Txt(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Rxt(e,t,r){const n=Txt(t);if(!n)return e;const{scaleX:a,scaleY:o,x:i,y:l}=n,s=e.left-i-(1-a)*parseFloat(r),c=e.top-l-(1-o)*parseFloat(r.slice(r.indexOf(" ")+1)),d=a?e.width/a:e.width,f=o?e.height/o:e.height;return{width:d,height:f,top:c,right:s+d,bottom:c+f,left:s}}const Oxt={ignoreTransform:!1};function WZ(e,t){t===void 0&&(t=Oxt);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:d}=Ext(e).getComputedStyle(e);c&&(r=Rxt(r,c,d))}const{top:n,left:a,width:o,height:i,bottom:l,right:s}=r;return{top:n,left:a,width:o,height:i,bottom:l,right:s}}function VZ(e){return WZ(e,{ignoreTransform:!0})}var tv;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(tv||(tv={}));var KZ;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(KZ||(KZ={}));var cl;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"})(cl||(cl={})),cl.Space,cl.Enter,cl.Esc,cl.Space,cl.Enter;var qZ;(function(e){e[e.RightClick=2]="RightClick"})(qZ||(qZ={}));var YZ;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(YZ||(YZ={}));var GZ;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(GZ||(GZ={})),tv.Backward+"",tv.Forward+"",tv.Backward+"",tv.Forward+"";var UR;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(UR||(UR={}));var HR;(function(e){e.Optimized="optimized"})(HR||(HR={})),UR.WhileDragging,HR.Optimized,{...Cxt};var XZ;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(XZ||(XZ={})),cl.Down,cl.Right,cl.Up,cl.Left;var Axt=Object.defineProperty,kxt=Object.getOwnPropertyDescriptor,Pxt=(e,t,r,n)=>{for(var a=n>1?void 0:n?kxt(t,r):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(n?i(t,r,a):i(a))||a);return n&&a&&Axt(t,r,a),a};class Nxt{constructor(t=""){this.loading=!1,this.treeData=[],this.selectedKey="",this.refreshKey=0,this.refreshTreeKey=0,yZ(this),this.selectedKey=t}setTreeData(t){this.treeData=t}setSelectedKey(t){this.selectedKey=t}setRefreshKey(){this.refreshKey+=1}refreshSelectedKey(t){t===this.selectedKey&&this.setRefreshKey(),this.setSelectedKey(t)}setRefreshTreeKey(){this.refreshTreeKey+=1}get selectedNode(){return rl(this.selectedKey,this.treeData)}}Pxt([Bo],Nxt.prototype,"selectedNode",1),m.createContext(null),m.createContext(null);const Mxt=e=>e==null,ZZ=e=>(...t)=>(Lxt(t[1]),e(...t)),QZ=(e,t)=>{const{trigger:r}=e;return r||(["onClick","onChange"].find(o=>!Mxt(t[o]))??"onClick")},JZ=(e,t)=>{if(!e)return;const r=QZ(e,t),n=t[r];t[r]=(...a)=>{console.log("trigger:",QZ(e,t)),console.log("payload:",e.payload),Aft.emit("trackPoint",e.payload),n?.(...a)}},Lxt=e=>{const t=e?.["data-track-point"];t&&(Array.isArray(t)?t.forEach(r=>JZ(r,e)):JZ(t,e))},{jsx:zxt,jsxs:Bxt}=Zee,Ye=ZZ(zxt),zn=ZZ(Bxt);var eQ,tQ=Kr;eQ=tQ.createRoot,tQ.hydrateRoot;const iqt="",lqt="",sqt="",cqt="",ul="v1";function rQ(){return _i.get(`api/dc/${ul}/folders`).then(e=>e.data)}function sD(e){return _i.get(`api/dc/${ul}/folders/tree/${e}`).then(t=>t.data)}function cD(e){return _i.post(`api/dc/${ul}/folders/${e.folderId}/structure`,e).then(t=>t.data)}function jxt(e){return _i.post(`api/dc/${ul}/folders/table/search`,e).then(t=>t.data)}function Uxt(e){return _i.post(`api/dc/${ul}/folders/field/search`,e).then(t=>t.data)}function Hxt(e){return _i.get(`api/dc/${ul}/tables/${e}/data`).then(t=>t.data)}function nQ(e){return _i.get(`api/dc/${ul}/model/${e}/structure`).then(t=>t.data)}function Wxt(e){return _i.get(`api/dc/${ul}/tables/${e}/structure`).then(t=>t.data)}function Vxt(e){return _i.post(`api/dc/${ul}/sql/params`,e).then(t=>t.data)}function Kxt(e){return _i.post(`/api/dc/${ul}/preview/page`,e).then(t=>t.data)}async function qxt(e){return _i.post(`/api/dc/${ul}/model/fields/structure`,e).then(t=>t.data)}var Ea=(e=>(e[e.TABLE=1]="TABLE",e[e.BUSINESS_MODEL=2]="BUSINESS_MODEL",e[e.DIMENSION_INDICATOR=3]="DIMENSION_INDICATOR",e))(Ea||{}),uD=(e=>(e[e.GROUP=1]="GROUP",e[e.DETAIL=2]="DETAIL",e))(uD||{}),Ql=(e=>(e.DIMENSION1="10000",e.TARGET1="30000",e))(Ql||{}),js=(e=>(e[e.SINGLE=1]="SINGLE",e[e.DOUBLE=2]="DOUBLE",e[e.GROUP=3]="GROUP",e))(js||{}),WR=(e=>(e[e.GROUP_BY_VALUE=1]="GROUP_BY_VALUE",e[e.GROUP_BY_CUSTOM=2]="GROUP_BY_CUSTOM",e[e.COUNT=3]="COUNT",e[e.RECORD_COUNT=4]="RECORD_COUNT",e[e.APPEND=5]="APPEND",e[e.RENAME=6]="RENAME",e[e.DELETE=7]="DELETE",e[e.APPROXIMATE_DISTINCT_COUNT=27]="APPROXIMATE_DISTINCT_COUNT",e[e.GROUP_FORMULA=40]="GROUP_FORMULA",e))(WR||{}),dD=(e=>(e[e.GROUP_BY_VALUE=1]="GROUP_BY_VALUE",e[e.CUSTOM_NUMBER_GROUP=2]="CUSTOM_NUMBER_GROUP",e[e.SUM=8]="SUM",e[e.AVG=9]="AVG",e[e.MEDIAN=10]="MEDIAN",e[e.MAX=11]="MAX",e[e.MIN=12]="MIN",e[e.STANDARD_DEVIATION=13]="STANDARD_DEVIATION",e[e.VARIANCE=14]="VARIANCE",e[e.COUNT=15]="COUNT",e[e.RECORD_COUNT=16]="RECORD_COUNT",e[e.NONE=17]="NONE",e[e.PERIOD=18]="PERIOD",e[e.RING=19]="RING",e[e.PERIOD_RATE=20]="PERIOD_RATE",e[e.RING_RATE=21]="RING_RATE",e[e.PERIOD_INCREMENT=36]="PERIOD_INCREMENT",e[e.RING_INCREMENT=37]="RING_INCREMENT",e[e.PERIOD_OR_RING=38]="PERIOD_OR_RING",e[e.YEAR=22]="YEAR",e[e.QUARTER=23]="QUARTER",e[e.MONTH=24]="MONTH",e[e.WEEK=25]="WEEK",e[e.WEEKDAY=26]="WEEKDAY",e[e.APPROXIMATE_DISTINCT_COUNT=33]="APPROXIMATE_DISTINCT_COUNT",e[e.RENAME=27]="RENAME",e[e.DELETE=28]="DELETE",e[e.GROUP_FORMULA=40]="GROUP_FORMULA",e))(dD||{}),VR=(e=>(e[e.DATE=5]="DATE",e[e.YEAR=6]="YEAR",e[e.QUARTER=7]="QUARTER",e[e.MONTH=8]="MONTH",e[e.WEEKDAY=9]="WEEKDAY",e[e.DAY=10]="DAY",e[e.MORE_GROUP=11]="MORE_GROUP",e[e.WEEK_COUNT=12]="WEEK_COUNT",e[e.HOUR=13]="HOUR",e[e.MINUTE=14]="MINUTE",e[e.SECOND=15]="SECOND",e[e.YQ=16]="YQ",e[e.YM=17]="YM",e[e.YW=18]="YW",e[e.YMDH=19]="YMDH",e[e.YMDHM=20]="YMDHM",e[e.YMDHMS=21]="YMDHMS",e[e.MONTH_DAY=48]="MONTH_DAY",e[e.COUNT=29]="COUNT",e[e.RECORD_COUNT=30]="RECORD_COUNT",e[e.ET=31]="ET",e[e.LT=32]="LT",e[e.APPROXIMATE_DISTINCT_COUNT=35]="APPROXIMATE_DISTINCT_COUNT",e[e.RANK=36]="RANK",e[e.ASC=37]="ASC",e[e.DESC=38]="DESC",e[e.RENAME=33]="RENAME",e[e.DELETE=34]="DELETE",e[e.GROUP_FORMULA=40]="GROUP_FORMULA",e))(VR||{}),Lt=(e=>(e.String="String",e.Integer="Integer",e.Double="Double",e.Date="Date",e.Boolean="Boolean",e.Formula="Formula",e.Parameter="Parameter",e.TableColumn="TableColumn",e))(Lt||{}),fD=(e=>(e[e.None=-1]="None",e[e.And=1]="And",e[e.Or=2]="Or",e[e.Leaf=0]="Leaf",e))(fD||{}),Us=(e=>(e[e.Sql=1]="Sql",e[e.Filter=2]="Filter",e))(Us||{}),Jt=(e=>(e[e.Equal=0]="Equal",e[e.NotEqual=1]="NotEqual",e[e.More=2]="More",e[e.MoreEqual=3]="MoreEqual",e[e.Less=4]="Less",e[e.LessEqual=5]="LessEqual",e[e.Beginning=6]="Beginning",e[e.BeginningNot=7]="BeginningNot",e[e.End=8]="End",e[e.EndNot=9]="EndNot",e[e.Include=10]="Include",e[e.NotInclude=11]="NotInclude",e[e.IncludeIn=12]="IncludeIn",e[e.NotIncludeIn=13]="NotIncludeIn",e))(Jt||{});const pD={RESOURCE_TYPE:96,FIELD_TYPE:96},Yxt=({selectedNode:e})=>{const[t,{width:r}]=Lp(),{data:n,loading:a}=wm(()=>Hxt(e.id),{ready:!Te.isNil(e)&&e.nodeType===et.DATA_TABLE,refreshDeps:[e]}),{data:o}=wm(()=>nQ(e.id),{ready:!Te.isNil(e)&&e.nodeType===et.BUSINESS_MODEL,refreshDeps:[e]}),i=()=>[{dataIndex:"resourceType",title:at("FDI_Resource_Type"),width:pD.RESOURCE_TYPE,render:l=>l===sr.DIMENSION?at("FDI_Dimension"):at("FDI_Indicator")},{dataIndex:"fieldType",title:at("FDI_Field_Type"),width:pD.FIELD_TYPE,render:l=>Ye(yd,{text:at(hq(l)),icon:{name:bd(l)}})},{dataIndex:"name",title:at("FDI_Field_Transfer_Name"),width:r-pD.RESOURCE_TYPE-pD.FIELD_TYPE-2}];return zn(gl,{children:[e?.nodeType===et.DATA_TABLE&&Ye(Oq,{className:"fdi-w-full fdi-h-full",tableData:n??{fields:[],data:[]}}),e?.nodeType===et.BUSINESS_MODEL&&Ye("div",{className:"fdi-w-full fdi-h-full",ref:t,children:Ye(Fg,{style:{width:"100%",height:"100%"},dataSource:o?.itemInfos??[],columns:i()})}),!e&&Ye(lw,{className:"fdi-w-full fdi-h-full",description:at("FDI_Please_Choose_Resource")}),Ye(sw,{loading:a})]})},vD={TYPE:96,OPERATE:42},Gxt=({checkedNodes:e,onCheck:t})=>{const[r,{width:n}]=Lp(),a=()=>[{dataIndex:"nodeType",title:at("FDI_Resource_Type"),width:vD.TYPE,render:o=>o===et.DIMENSION?at("FDI_Dimension"):at("FDI_Indicator")},{dataIndex:"_name",title:at("FDI_Field_Transfer_Name"),width:n-vD.OPERATE-vD.TYPE-2,render:(o,i)=>{const l=i.value;return Ye(yd,{text:i.name,icon:{name:bd(l.type)}})}},{dataIndex:"_operate",title:"",width:vD.OPERATE,render:(o,i)=>Ye(jr,{type:"text-normal",icon:Ye(Fa,{name:"icon-delete",onClick:()=>{t?.(e.filter(l=>l.id!==i.id))}})})}];return Ye("div",{className:"fdi-w-full fdi-h-full",ref:r,children:Te.isEmpty(e)?Ye(lw,{className:"fdi-w-full fdi-h-full",description:at("FDI_Please_Choose_Resource")}):Ye(Fg,{style:{width:"100%",height:"100%"},dataSource:e,columns:a()})})},Xxt=({keyword:e,onSelect:t,onJump:r})=>{const[n,a]=m.useState([]),o=m.useMemo(()=>n.map(l=>Iq(l).map(s=>({...s,nodes:s.nodes}))),[n]),i=l=>(l.pageIndex===1&&a([]),jxt(l).then(s=>{a(c=>[...c,s])}));return Ye(UZ,{searchTypes:[Yn.FOLDER,Yn.TABLE,Yn.BUSINESS_MODEL],keyword:e,showFilter:!1,searchResults:o,onLoadData:i,searchNodeProps:l=>{const s=ja(l.nodeType);return{hasJump:s,onClick:()=>{s?t?.(l):r?.(l)},onJump:()=>{r?.(l)}}}})},Zxt=({checkedKeys:e,keyword:t,onCheck:r,onJump:n})=>{const[a,o]=m.useState([]),i=m.useMemo(()=>a.map(s=>Iq(s).map(c=>({...c,nodes:c.nodes}))),[a]),l=s=>(s.pageIndex===1&&o([]),Uxt(s).then(c=>{o(d=>[...d,c])}));return Ye(UZ,{searchTypes:[Yn.FOLDER,Yn.INDICATOR,Yn.DIMENSION],keyword:t,showFilter:!1,searchResults:i,onLoadData:l,searchNodeProps:s=>{const c=ja(s.nodeType);return{hasCheck:c,checked:e?.includes(s.id),hasJump:c,onCheck:d=>{r?.(d,s)},onClick:()=>{!c&&n?.(s)},onJump:()=>{n?.(s)}}}})},Qxt=({selectedNode:e,onSelect:t})=>{const[r,n]=m.useState([]),[a,o]=m.useState(""),[i,l]=m.useState(e?e.id:""),{onLoadData:s,expandedKeys:c,handleExpand:d,handleSelect:f,handleJump:v}=SX({selectedKey:i,setSelectedKey:l,treeData:r,updateTreeData:h=>n(MT(h)),getRootData:()=>rQ().then(nl),getNavigationDataById:(h,g)=>{const _=g??e;return ja(_.nodeType)?_.pId?sD(_.pId).then(w=>cD({folderId:_.pId,resourceTypes:[sr.TABLE,sr.BUSINESS_MODEL,sr.PACKAGE]}).then(x=>PT(_.pId,[nl(w)],()=>({...nl(x)}))[0])):Promise.resolve():sD(h).then(nl)},getChildrenDataById:h=>cD({folderId:h,resourceTypes:[sr.TABLE,sr.BUSINESS_MODEL,sr.PACKAGE]}).then(nl)});return Vl(()=>{const h=rl(i,r);h&&ja(h.nodeType)&&t?.(h)},[i]),zn("div",{className:"fdi-relative fdi-w-full fdi-h-full",children:[Ye($X,{searchable:!0,selectable:!0,keyword:a,sourceData:r,onLoadData:s,selectedKeys:i?[i]:void 0,expandedKeys:c,onExpand:d,onSearch:o,onSelect:h=>{f(h[0])},fixTreeNodeFunc:h=>({selectable:ja(h.nodeType)})}),a&&Ye("div",{className:"fdi-absolute fdi-bg-neutral-light-0 fdi-top-[32px] fdi-left-0 fdi-right-0 fdi-bottom-0",children:Ye(Xxt,{keyword:a,onSelect:h=>f(h.id,h),onJump:h=>{v(h.id,h),Te.delay(()=>{o("")},100)}})})]})},Jxt=({checkedNodes:e,onCheck:t})=>{const[r,n]=m.useState([]),[a,o]=m.useState(""),i=e.map(f=>f.id),{onLoadData:l,expandedKeys:s,handleExpand:c,handleJump:d}=SX({treeData:r,updateTreeData:f=>n(MT(f)),getRootData:()=>rQ().then(nl),getNavigationDataById:(f,v)=>ja(v.nodeType)?sD(v.pId).then(h=>cD({folderId:v.pId,resourceTypes:[sr.INDICATOR,sr.DIMENSION,sr.PACKAGE]}).then(g=>PT(v.pId,[nl(h)],()=>({...nl(g)}))[0])):sD(f).then(nl),getChildrenDataById:f=>cD({folderId:f,resourceTypes:[sr.INDICATOR,sr.DIMENSION,sr.PACKAGE]}).then(nl)});return zn("div",{className:"fdi-relative fdi-w-full fdi-h-full",children:[Ye($X,{searchable:!0,selectable:!0,checkable:!0,keyword:a,checkPos:"middle",sourceData:r,onLoadData:l,expandedKeys:s,checkedKeys:i,onExpand:c,onSearch:o,onCheck:f=>{const v=f.map(h=>rl(h,r));t?.(v)},fixTreeNodeFunc:f=>({selectable:ja(f.nodeType),hasCheck:f.nodeType!==et.FOLDER})}),a&&Ye("div",{className:"fdi-absolute fdi-bg-neutral-light-0 fdi-top-[32px] fdi-left-0 fdi-right-0 fdi-bottom-0",children:Ye(Zxt,{checkedKeys:i,keyword:a,onCheck:(f,v)=>{const h=f?Te.uniq([...e,v]):e.filter(g=>g.id!==v.id);t?.(h)},onJump:f=>{d(f.id,f),Te.delay(()=>{o("")},100)}})})]})},ebt=({data:e,onChange:t})=>{const[r,n]=m.useState(e?.type===Ea.DIMENSION_INDICATOR?"field":"table"),[a,o]=m.useState(e?.type===Ea.TABLE||e?.type===Ea.BUSINESS_MODEL?e.nodes[0]:void 0),[i,l]=m.useState(e?.type===Ea.DIMENSION_INDICATOR?e.nodes:[]);Vl(()=>{r==="table"?t?.(a?{type:a.nodeType===et.DATA_TABLE?Ea.TABLE:Ea.BUSINESS_MODEL,nodes:[a]}:void 0):i.length>0?t?.({type:Ea.DIMENSION_INDICATOR,nodes:i}):t?.(void 0)},[r,a,i]);const s=()=>zn(w1,{activeKey:r,onTabActive:n,className:"fdi-p-lg fdi-flex fdi-flex-col fdi-h-full",theme:"segment",children:[Ye(w1.Item,{tab:at("FDI_Table_And_Model"),className:"fdi-py-lg fdi-component-flex-h-fill-layout",children:Ye(Qxt,{selectedNode:a,onSelect:o})},"table"),Ye(w1.Item,{tab:at("FDI_Indicator_And_Dimension"),className:"fdi-py-lg fdi-component-flex-h-fill-layout",children:Ye(Jxt,{checkedNodes:i,onCheck:l})},"field")]}),c=()=>r==="table"?Ye(Yxt,{selectedNode:a}):Ye(Gxt,{checkedNodes:i,onCheck:l});return Ye("div",{className:"fdi-w-full fdi-h-full",children:Ye(upt,{allowCollapse:!1,activeContent:s(),drivenContent:Ye("div",{className:"fdi-h-full fdi-p-lg fdi-relative",children:c()})})})},aQ=2147483647,oQ=-2147483648,tbt={authority:!0,parameters:[]},iQ={[Lt.String]:"icon-edit-string",[Lt.Integer]:"icon-edit-integer",[Lt.Double]:"icon-edit-double",[Lt.Date]:"icon-edit-date",[Lt.Boolean]:"icon-edit-boolean",[Lt.Formula]:"icon-edit-formula",[Lt.Parameter]:"icon-edit-parameter"},rbt={[Lt.String]:"STRING",[Lt.Integer]:"INT",[Lt.Double]:"DOUBLE",[Lt.Date]:"DATE",[Lt.Boolean]:"BOOLEAN",[Lt.Formula]:"FORMULA",[Lt.Parameter]:"PARAMETER"},lQ=[Lt.String,Lt.Integer,Lt.Double,Lt.Date,Lt.Boolean,Lt.Formula],nbt=[...lQ,Lt.Parameter],abt={[Jt.Equal]:"EQUAL",[Jt.NotEqual]:"NOT_EQUAL",[Jt.More]:"MORE",[Jt.MoreEqual]:"MORE_EQUAL",[Jt.Less]:"LESS",[Jt.LessEqual]:"LESS_EQUAL",[Jt.Beginning]:"BEGINNING_IS",[Jt.BeginningNot]:"BEGINNING_IS_NOT",[Jt.End]:"END_IS",[Jt.EndNot]:"END_IS_NOT",[Jt.Include]:"INCLUDE",[Jt.NotInclude]:"NOT_INCLUDE",[Jt.IncludeIn]:"INCLUDE_IN",[Jt.NotIncludeIn]:"NOT_INCLUDE_IN"},obt={[Gn.AND]:"ADD_FILTER_CONDITION_AND",[Gn.OR]:"ADD_FILTER_CONDITION_OR"},sQ={compare:Jt.Equal,valueType:Lt.String},ibt={[Us.Sql]:"icon-sql",[Us.Filter]:"icon-filter"},lbt=[Jt.Equal,Jt.NotEqual,Jt.Beginning,Jt.BeginningNot,Jt.End,Jt.EndNot,Jt.Include,Jt.NotInclude,Jt.IncludeIn,Jt.NotIncludeIn],sbt=[Jt.Equal,Jt.NotEqual,Jt.More,Jt.MoreEqual,Jt.Less,Jt.LessEqual,Jt.IncludeIn,Jt.NotIncludeIn],cbt=[Jt.Equal,Jt.NotEqual,Jt.More,Jt.Less],ubt={[Jt.Equal]:"EQUAL",[Jt.NotEqual]:"NOT_EQUAL",[Jt.More]:"AFTER_DATE",[Jt.Less]:"BEFORE_DATE"};function dbt(e,t){const r=Te.map(e,"name");return Pft(r,t.name)}function fbt(e,t,r){return{name:t,id:e.id,fieldType:e.fieldType,resourceType:e.resourceType,valid:!0,used:!0,value:r}}function pbt(e){return e===Ql.DIMENSION1}function cQ(e,t){const r=pbt(t);switch(e){case na.NUMBER:return r?[{type:js.SINGLE,value:dD.GROUP_BY_VALUE}]:[{type:js.SINGLE,value:dD.SUM},{type:js.SINGLE,value:dD.NONE}];case na.DATE:return r?[{type:js.SINGLE,value:VR.DATE}]:[{type:js.SINGLE,value:VR.COUNT}];default:return r?[{type:js.SINGLE,value:WR.GROUP_BY_VALUE}]:[{type:js.SINGLE,value:WR.COUNT}]}}var vbt=Object.defineProperty,hbt=Object.getOwnPropertyDescriptor,Jc=(e,t,r,n)=>{for(var a=n>1?void 0:n?hbt(t,r):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(n?i(t,r,a):i(a))||a);return n&&a&&vbt(t,r,a),a};class Jl{constructor(){this.dsName="",this.originSourceInfo=void 0,this.engineType=tl.SPIDER,this.fields=[],this.view={[Ql.DIMENSION1]:[],[Ql.TARGET1]:[]},this.dimensions={},this.filter={},this.parameters=[],this.originSqlParameters=[],yZ(this)}get source(){const t=[],r=[],n=[],a=[];return this.originSourceInfo?.nodes.forEach(o=>{switch(o.nodeType){case et.DATA_TABLE:t.push(o.id);break;case et.BUSINESS_MODEL:r.push(o.id);break;case et.INDICATOR:n.push(o.id);break;case et.DIMENSION:a.push(o.id);break}}),{engineType:this.engineType,type:this.originSourceInfo?.type??Ea.TABLE,tableNames:t,businessModelIds:r,indicatorIds:n,dimensionIds:a}}get queryView(){const t=this.view[Ql.DIMENSION1].concat(this.view[Ql.TARGET1]);return Te.isEmpty(t)?{type:uD.DETAIL,fields:this.fields}:{type:uD.GROUP,view:this.view,dimensions:this.dimensions}}get fieldsTypeMap(){const t={};return Te.each(this.fields,r=>{t[r.id]=r.fieldType}),t}get dateTypeInGroup(){return Te.filter(this.view[Ql.DIMENSION1],t=>this.dimensions[t]?.fieldType===na.DATE)??[]}get allDateGroupTypes(){const t=[],r=this.view[Ql.DIMENSION1],n=this.dimensions[this.dateTypeInGroup[0]];return Te.each(r,a=>{const o=this.dimensions[a];if(o?.fieldType!==na.DATE||o.id!==n?.id)return;const i=Te.first(o.value);i?.type===js.SINGLE?t.push(i.value):i?.childValue&&t.push(i.childValue)}),t}get firstDateDimensionName(){return this.dimensions[this.dateTypeInGroup[0]]?.name}get sqlParameters(){const t={};return this.parameters.forEach(r=>{if(r.group===Us.Sql){const n=this.originSqlParameters.find(a=>a.tableName===r.tableName).values.find(a=>a.name===r.name);t[r.name]={name:r.name,tableName:r.tableName,parameterType:n?.type??na.STRING,value:{value:r.value,type:r.type===Lt.Date?na.DATE:na.STRING}}}}),t}get dataChooseSaveInfo(){return{dsName:this.dsName,source:this.source,parameters:this.parameters,filter:this.filter,queryView:this.queryView}}setOriginSourceInfo(t){this.originSourceInfo=t}setOriginSqlParameters(t){this.originSqlParameters=t}setFields(t){this.fields=t}setDsName(t){this.dsName=t}setDimensions(t){this.dimensions=t}setView(t){this.view=t}setEngineType(t){this.engineType=t}setFilterCondition(t){t.filterType===fD.None?this.filter={}:this.filter=t}setParameters(t){this.parameters=t}reset(){this.engineType=tl.SPIDER,this.fields=[],this.view={[Ql.DIMENSION1]:[],[Ql.TARGET1]:[]},this.dimensions={},this.filter={},this.parameters=[]}addDimension(t,r,n,a){this.dimensions={...this.dimensions,[t]:r},this.view={...this.view,[n]:[...this.view[n].slice(0,a),t,...this.view[n].slice(a)]}}setDimension(t,r){this.dimensions={...this.dimensions,[t]:{...this.dimensions[t],value:r}}}setDimensionName(t,r){this.dimensions={...this.dimensions,[t]:{...this.dimensions[t],name:r}}}setSortBySortInfo(t){const{regionTypes:r}=t,n=t.dimensions,{regionType:a}=t,o=Te.cloneDeep(this.dimensions),i=Te.cloneDeep(this.view);Te.each(r,(l,s)=>{if(l===a)return;const c=o[n[s]];c.value=cQ(c.fieldType,a)}),i[t.regionType]=n,this.dimensions=o,this.view=i}addDimensionByField(t,r,n){Te.each(t,(a,o)=>{const i=AV(),l=dbt(this.dimensions,a),s=cQ(a.fieldType,r);this.addDimension(i,fbt(a,l,s),r,n+o)})}deleteDimension(t){const r=Te.cloneDeep(this.dimensions),n=Te.cloneDeep(this.view);delete r[t],Te.each(n,(a,o)=>{const i=Te.findIndex(a,l=>l===t);i!==-1&&n[o].splice(i,1)}),this.dimensions=r,this.view=n}}Jc([Bo],Jl.prototype,"source",1),Jc([Bo],Jl.prototype,"queryView",1),Jc([Bo],Jl.prototype,"fieldsTypeMap",1),Jc([Bo],Jl.prototype,"dateTypeInGroup",1),Jc([Bo],Jl.prototype,"allDateGroupTypes",1),Jc([Bo],Jl.prototype,"firstDateDimensionName",1),Jc([Bo],Jl.prototype,"sqlParameters",1),Jc([Bo],Jl.prototype,"dataChooseSaveInfo",1);let KR=new Jl;const rv=()=>(KR||(KR=new Jl),KR);async function gbt(e){return new Promise(t=>{if(window.dcHelper?.parseFormulaParameters)return window.dcHelper.parseFormulaParameters(e,r=>{RV(r),t(JSON.parse(r))});t([])})}async function _bt(e){return new Promise(t=>{if(window.dcHelper?.transFilter4Query)return window.dcHelper.transFilter4Query(JSON.stringify(e),r=>{t(JSON.parse(r))});t({})})}async function uQ(e){return new Promise(t=>{if(window.dcHelper?.showFormulaPane)return window.dcHelper.showFormulaPane(e||"",(r,n)=>{t({action:r,content:n})});t({action:"OK",content:""})})}const zd=(e,t)=>{switch(e){case Lt.Parameter:case Lt.String:return typeof t=="string"?t:typeof t=="object"?void 0:t?.toString();case Lt.Integer:return isNaN(parseInt(t))?0:Te.clamp(parseInt(t),oQ,aQ);case Lt.Double:return isNaN(parseInt(t))?0:parseFloat(t);case Lt.Date:return typeof t=="number"&&Number.isInteger(t)?t:null;case Lt.Boolean:return!1;case Lt.Formula:return typeof t=="string"?t:typeof t!="object"&&t?t.toString():"";default:return t}},dQ=Zl(({value:{value:e,type:t},onChange:r,onValueChange:n,columns:a,isFilter:o})=>{const[i,l]=m.useState(!1),[s,c]=m.useState(e),d=h=>{r({type:t,value:h}),n?.(!0)},f=m.useMemo(()=>o?nbt:lQ,[o]),v=h=>{switch(h){case Lt.Parameter:case Lt.String:return Ye(Ss,{placeholder:at("FDI_Please_Input"),value:s,onChange:g=>{c(g)},onBlur:g=>{d(g)},onPressEnter:g=>{d(g.target.value)}});case Lt.Integer:return Ye("div",{className:"fdi-parameter-edit-number fdi-w-full",children:Ye(aC,{value:zd(Lt.Integer,s),onChange:g=>{c(g||0),d(zd(Lt.Integer,g||0))},precision:0,min:oQ,max:aQ})});case Lt.Double:return Ye("div",{className:"fdi-parameter-edit-number",children:Ye(aC,{maxPrecision:20,value:zd(Lt.Double,s),onChange:g=>{c(g||0)},onBlur:g=>{d(zd(Lt.Double,g))},onPressEnter:g=>{d(zd(Lt.Double,g.target.value))}})});case Lt.Date:return Ye(gQe,{value:typeof e=="number"?Dn(e):null,format:"yyyy-MM-dd",onAfterChange:g=>{g&&d(g?.valueOf())}});case Lt.Boolean:return Ye(id,{checked:typeof e=="boolean"?e:e==="true",onChange:(g,_)=>{d(_.target.checked)},children:e?.toString()});case Lt.Formula:return Ye(Ss,{onClick:()=>uQ(e||"").then(({action:g,content:_})=>{g==="OK"&&d(_)}),value:e,onChange:(g,_)=>{_.preventDefault()}});default:return zn("div",{children:[" ",e]})}};return zn("div",{className:ar("fdi-parameter-edit fdi-flex fdi-justify-start fdi-items-center fdi-flex-1 fdi-gap-sm",{"fdi-filter-condition-edit fdi-w-[240px] fdi-flex-none":o}),children:[Ye(b1,{visible:i,arrow:!1,trigger:"click",placement:"bottom-left",overlayClassName:"fdi-description-with-show-list-popover",onVisibleChange:h=>l(h),destroyTooltipOnHide:!0,content:Ye(Igt,{className:"fdi-parameter-value-type-list",reverseSelectable:!1,defaultActiveIndex:Te.findIndex(f,h=>h===t),dataSource:f.map(h=>({id:h,value:at(rbt[h]),iconName:iQ[h]})),onClick:(h,g)=>{if(g===Lt.Formula){const _=zd(Lt.Formula,e);uQ(_).then(({action:w,content:x})=>{w==="OK"?(c(x),r({type:g,value:x}),n?.(!0)):(c(_),r({type:g,value:_}))})}else r({type:g,value:zd(g,e)});g!==t&&n?.(!0),l(!1)}}),children:zn("div",{className:ar("fdi-parameter-edit-icon fdi-flex fdi-leading-[28px] fdi-px-lg fdi-gap-sm fdi-component-list-item",{selected:i}),children:[Ye(Fa,{name:iQ[t]}),Ye(Fa,{name:"icon-down-arrow"})]})}),v(t)]})}),mbt=({columns:e,value:{value:t},onChange:r})=>{const n=typeof t=="object"?t:sQ,{column:a,compare:o,valueType:i,value:l}=n,s=c=>c===na.DATE?cbt:c===na.NUMBER?sbt:lbt;return zn("div",{className:"fdi-filter-condition-pane-item fdi-flex fdi-items-center fdi-gap-md fdi-w-full",children:[Ye(xC,{className:"fdi-filter-condition-pane-select fdi-w-[200px]",placeholder:at("PLEASE_SELECT_DATA_COLUMN"),value:a?.id,options:e.map(c=>{const{id:d,type:f}=c;return{value:d,label:Ye(yd,{text:gq(c),icon:{name:bd(f)}})}}),onChange:c=>{const d=Te.find(e,f=>f.id===c);r({...n,column:d,compare:Te.includes(s(d.type),o)?o:Jt.Equal})}}),Ye(xC,{className:"fdi-filter-condition-pane-select condition-types fdi-w-[120px]",placeholder:at("FDI_Please_Select"),value:o,options:s(a?.type).map(c=>({value:+c,label:at(a?.type===na.DATE?ubt[c]:abt[c])})),onChange:c=>{r({...n,compare:c})}}),Ye(dQ,{isFilter:!0,columns:e,value:{type:i,value:l},onChange:c=>{r({...n,valueType:c.type,value:c.value})}})]})},uqt="",fQ=e=>e?.map(t=>{const{filterType:r,conditions:n,...a}=t;return{type:r===fD.Leaf?Gn.LEAF:r,value:{value:a},children:fQ(n)}}),pQ=e=>e?.map(t=>{const{type:r,value:n={},children:a}=t,o=typeof n=="object"?n.value:sQ;return{filterType:r||fD.Leaf,conditions:pQ(a),...o||{}}}),vQ=async(e,t,r)=>{const n=c=>Te.find(t,d=>d.name===c),a=c=>{!c||Te.isEmpty(c)||c.forEach(d=>{const f=n(d);e.push({name:d,type:f?.type||Lt.String,value:f?f.value:"",group:Us.Filter})})},o=[],i=r?.map(async c=>{const{conditions:d,value:f,valueType:v}=c;v===Lt.Parameter&&f&&a([f]),v===Lt.Formula&&f&&o.push(f),d?.length!==0&&await vQ(e,t,d)});await Promise.all(Te.compact(i));const l=o.map(async c=>await gbt(c));(await Promise.all(l)).forEach(c=>{a(c)})},xbt=Zl(({className:e,onChange:t})=>{const r=rv(),n=m.useRef(null),a=r.fields,o=m.useMemo(()=>{const{filter:l}=r;return!l||Te.isEmpty(l)?[]:fQ([l])},[r.filter,r.originSourceInfo]),i=async()=>{const l=n.current?.getTreeValue(),s=pQ(l),c=r.parameters.filter(f=>f.group===Us.Filter),d=r.parameters.filter(f=>f.group===Us.Sql);await vQ(d,c,s),r.setFilterCondition(s?.[0]??[]),r.setParameters(d),t?.(!0)};return zn(MC,{className:ar("fdi-filter-condition-pane fdi-mb-xxl",e),direction:"vertical",size:4,children:[Ye("span",{className:"fdi-filter-condition-pane-head-text fdi-leading-[28px] fdi-font-600",children:at("FILTER_CONDITION")}),Ye(cft,{ref:n,className:"fdi-filter-condition-pane-content",defaultItems:o,operations:[[Gn.AND,Gn.OR].map(l=>({key:l,value:l,label:at(obt[l])}))],itemRender:()=>Ye(mbt,{columns:a}),onChange:i})]})}),bbt=(e,t)=>{const r=Object.getOwnPropertyNames(e),n=m.useRef(),a={};Te.each(r,s=>{a[s]=Te.cloneDeep(e[s])});const o=AV(),i=BI.inherit(Fix.Model,{state(){return a},childContext:r});BI.model(o,i);const l=s=>()=>{m.useEffect(()=>{n.current&&Fix.set(n.current.store.model,s,Te.cloneDeep(e[s]))},[e[s]])};return r.forEach(s=>{l(s)()}),Ye(EX,{type:"fdi.fix.context",ref:n,_store:()=>BI.Models.getModel(o),children:{...t}})},ybt=Zl(({className:e})=>{const t=rv(),r=bbt(t,{type:"fdi.group.operator.regions",settingStore:t});return Ye("div",{className:ar(e,"fdi-data-group"),children:r})}),wbt=Zl(({className:e})=>{const t=rv(),[r,n]=m.useState([]),[a,o]=m.useState([]),[i,l]=m.useState({limit:L1,pageIndex:1,pageSize:nT,totalRows:0}),[s,c]=m.useState(!1);Vl(()=>{c(!0)},[t.queryView,t.filter,t.parameters]);const{runAsync:d}=wm(async f=>{l({...i,pageIndex:f?.pageIndex??1});const v=await _bt(t.dataChooseSaveInfo);return Kxt({queryView:t.queryView,source:t.source,limit:{rowCount:f?.limit??L1,pageInfo:{pageIndex:f?.pageIndex??1,pageSize:f?.pageSize??nT}},filter:v,parameters:t.sqlParameters})},{manual:!0,onSuccess:f=>{n(f.fields),o(f.data)}});return zn("div",{className:ar("fdi-data-preview fdi-flex fdi-flex-col",e),children:[zn("div",{className:"fdi-h-[32px] fdi-flex fdi-justify-between fdi-items-center",children:[Ye("div",{className:"fdi-component-title-sm",children:at("FDI_Data_Preview")}),zn("div",{children:[s&&Ye("span",{children:at("FDI_Data_Update_Please_Refresh")}),Ye(jr,{type:"text",icon:Ye(Fa,{name:"icon-refresh"}),onClick:()=>{d(),c(!1)},children:at("FDI_Refresh")})]})]}),Ye("div",{className:"fdi-component-flex-h-fill-layout",children:!Te.isNil(t.fields)&&!Te.isEmpty(t.fields)&&Ye(bgt,{hasSegment:!1,defaultActiveTab:FX.PREVIEW,editable:!1,emptyContent:Ye(lw,{description:at("BI-Conf_Calculate_Result_Is_Empty"),image:Ye(Fa,{size:130,name:"svg-empty_widget1"})}),fields:r,data:a,pageInfo:i,onLoadData:f=>d(f)})})]})}),Dbt=Zl(({data:e,onChange:t,onValueChange:r})=>{const{name:n,value:a,type:o,group:i}=e;return zn(fg,{className:"fdi-parameter-table-column fdi-component-border-1 fdi-bg-neutral-light-0 fdi-rounded fdi-py-[6px]",gutter:16,children:[Ye(Hc,{span:12,children:Ye(yd,{className:"fdi-parameter-table-column-name fdi-leading-[28px]",text:n,icon:{name:ibt[i]}})}),Ye(Hc,{span:12,children:Ye(dQ,{onChange:l=>{t(l)},value:{value:a,type:o},onValueChange:l=>{r?.(l)}})})]})}),Ibt=()=>({rowProps:{gutter:16},columns:[{name:at("PARAMETER_NAME"),colProps:{span:12}},{name:at("PARAMETER_VALUE"),colProps:{span:12}}]}),Fbt=Zl(({parameters:e,onChange:t,onValueChange:r})=>Ye(gl,{children:e?.length>0?Ye(Fgt,{className:"fdi-parameter-table fdi-component-border-1 fdi-pt-xs fdi-px-[16px] fdi-pb-lg",header:Ibt(),content:Ye(MC,{direction:"vertical",size:6,children:e.map((n,a)=>{const{name:o,value:i}=n;return Ye(Dbt,{data:n,onChange:l=>{t(e.map(s=>s.name===o?{...s,type:l.type,value:l.value}:s))},onValueChange:l=>{r(l)}},i+a)})})}):Ye(lw,{className:"fdi-parameter-table-empty fdi-bg-neutral-light-1 fdi-rounded fdi-component-border-1 fdi-h-[40px]",iconName:"",text:at("SEARCH_RESULT_NONE")})})),$bt=Zl(({onChange:e})=>{const t=rv(),[r,n]=m.useState(Te.isEmpty(t.parameters)?tbt:{authority:!0,parameters:t.parameters}),[a,o]=m.useState(0),i=s=>{const{parameters:c}=s;n(s),t.setParameters(c)},l=()=>{if(!Te.isEmpty(t.parameters))return Promise.resolve([]);const s=t.originSourceInfo?.nodes;return Te.isEmpty(s)||Te.isNil(s)?Promise.resolve([]):Vxt({items:s.map(c=>({id:c.id,resourceType:c.value.itemType}))}).then(c=>{t.setOriginSqlParameters(c);const d=[];return c.forEach(f=>{f.values?.forEach(v=>{let h;switch(v.type){case na.DATE:case na.DATE_TIME:h=Lt.Date;break;case na.NUMBER:h=Lt.Integer;break;case na.STRING:default:h=Lt.String;break}d.push({name:v.name,value:v.value,type:h,group:Us.Sql,tableName:f.tableName})})}),d})};return m.useEffect(()=>{l().then(s=>{const c=t.parameters?.filter(f=>f.group===Us.Filter)||[],d={...s,parameters:[...s,...c]};i(d),e?.(!1)})},[a]),zn(gl,{children:[zn("div",{className:"fdi-preview-head fdi-flex fdi-justify-between fdi-items-center fdi-leading-[28px]",children:[Ye("span",{className:"fdi-preview-head-title fdi-leading-sm",children:at("PARAMETER")}),Ye(jr,{type:"text",className:"fdi-preview-head-refresh fdi-text-brand-light-6 fdi-py-[3px] fdi-px-xl",onClick:()=>o(a+1),children:Ye(yd,{text:at("FDI_Refresh"),icon:{name:"icon-refresh"}})})]}),Ye("div",{className:"fdi-parameter-container fdi-mt-sm",children:Ye(Fbt,{parameters:t.parameters,onChange:s=>{i({...r,parameters:s})},onValueChange:s=>{s&&e?.(!0)}},a)})]})}),Sbt=Zl(({data:e,isEdit:t,onClickChangeButton:r})=>{const n=rv();return m.useEffect(()=>{!window.dc&&(window.dc={}),window.dc.update=()=>JSON.stringify(n.dataChooseSaveInfo)},[n.dataChooseSaveInfo]),wm(()=>e.type===Ea.DIMENSION_INDICATOR?Promise.resolve(e.nodes.map(a=>({id:a.id,name:a.name,type:a.value.type,fieldType:a.value.type,resourceType:a.value.itemType}))):e.type===Ea.BUSINESS_MODEL?nQ(e.nodes[0].id).then(a=>a.itemInfos.map(o=>({...o,type:o.fieldType}))):Wxt(e.nodes[0].id).then(a=>a.fields.map(o=>({id:o.id,name:o.name,type:o.type,fieldType:o.type,resourceType:sr.FIELD}))),{onSuccess:a=>{n.setFields(a),n.setEngineType(e.nodes[0].value.engineType??tl.SPIDER)}}),zn("div",{className:"fdi-component-flex-col-layout fdi-p-lg fdi-gap-xl",children:[zn("div",{className:"fdi-flex fdi-items-center fdi-gap-xl",children:[Ye("div",{children:at("FDI_Name")}),Ye(Fq,{className:"fdi-component-flex-w-fill-layout",defaultValue:n.dsName,checkError:a=>ow(a,[],Bl.NAME),validateHelp:a=>iw(a,[],Bl.NAME),placeholder:at("FDI_Please_Input"),onSave:a=>{n.setDsName(a)}})]}),!Te.isNil(n.fields)&&Ye(gl,{children:zn("div",{className:"fdi-component-flex-h-fill-layout fdi-flex fdi-gap-xl",children:[Ye("div",{className:"fdi-w-[160px]",children:!Te.isEmpty(n.fields)&&Ye(EX,{type:"fdi.data.group.table.field",hasChange:t,fields:Te.cloneDeep(n.fields),onClickChangeButton:r})}),zn("div",{className:"fdi-component-flex-w-fill-layout fdi-overflow-auto",children:[Ye(ybt,{className:"fdi-w-full fdi-h-[120px]"}),Ye(wbt,{className:"fdi-h-[420px]"}),Ye(xbt,{className:"fdi-w-full"}),Ye($bt,{})]})]})})]})}),Ebt=Zl(()=>{const e=rv(),t=["choose","processing"],[r,n]=m.useState(0),[a,o]=m.useState(!1),i=t[r],l=m.useRef(!1);cw(()=>{s()}),Vl(()=>{if(l.current){l.current=!1;return}e.reset()},[e.originSourceInfo]);const s=async()=>{const{data:d}=window.dc;if(d){const f=JSON.parse(d);if(e.setDsName(f.dsName??""),Te.isNil(f.source))return;o(!0),e.setEngineType(f.source.engineType??tl.SPIDER),e.setFilterCondition(f.filter??{}),e.setParameters(f.parameters??[]);const{queryView:v}=f;if(v.type===uD.DETAIL?e.setFields(v.fields??[]):(v.dimensions&&e.setDimensions(v.dimensions),v.view&&e.setView(v.view)),f.source.type===Ea.TABLE&&e.setOriginSourceInfo({type:Ea.TABLE,nodes:[{id:f.source.tableNames[0],nodeType:et.DATA_TABLE,engineType:f.source.engineType,value:{engineType:f.source.engineType,itemType:sr.TABLE}}]}),f.source.type===Ea.BUSINESS_MODEL&&e.setOriginSourceInfo({type:Ea.BUSINESS_MODEL,nodes:[{id:f.source.businessModelIds[0],nodeType:et.BUSINESS_MODEL,engineType:f.source.engineType,value:{engineType:f.source.engineType,itemType:sr.BUSINESS_MODEL}}]}),f.source.type===Ea.DIMENSION_INDICATOR){const{dimensionIds:h,indicatorIds:g}=f.source,w=(await qxt({items:g.map(x=>({id:x,resourceType:sr.INDICATOR})).concat(h.map(x=>({id:x,resourceType:sr.DIMENSION})))})).itemInfos.map(x=>({id:x.id,name:x.name,nodeType:x.resourceType===sr.INDICATOR?et.INDICATOR:et.DIMENSION,engineType:f.source.engineType,value:{engineType:f.source.engineType,type:x.fieldType,itemType:x.resourceType}}));e.setOriginSourceInfo({type:Ea.DIMENSION_INDICATOR,nodes:w})}n(1),l.current=!0}};return zn("div",{className:"fdi-data-choose-page fdi-component-flex-col-layout",children:[Ye("div",{className:"fdi-component-flex-h-fill-layout",children:(()=>{switch(i){case"choose":return Ye(ebt,{data:e.originSourceInfo,onChange:d=>{e.setOriginSourceInfo(d)}});case"processing":return Ye(Sbt,{isEdit:a,data:e.originSourceInfo,onClickChangeButton:()=>{e.setOriginSourceInfo(void 0),n(0),o(!1)}})}})()}),zn("div",{className:"fdi-flex fdi-justify-end fdi-gap-md fdi-p-lg",children:[Ye(jr,{size:"small",type:"negative",onClick:()=>{window.dcHelper.cancelAction()},children:at("FDI_Cancel")}),r{n(r+1)},children:at("FDI_Next_Step")}),r!==0&&!a&&Ye(jr,{size:"small",type:r===t.length-1?"normal":"primary",onClick:()=>{n(r-1)},children:at("FDI_Previous_Step")}),r===t.length-1&&Ye(jr,{disabled:Te.isEmpty(e.dsName)||Te.isNil(e.dsName),size:"small",type:"primary",onClick:()=>{window.dcHelper.okAction()},children:at("FDI_Finish")})]})]})}),Cbt=()=>{const e=document.getElementById("fdi-data-choose");e&&eQ(e).render(Ye(dft,{...Dft(),children:Ye(Ebt,{})}))};(()=>{window.FDI=window.FDI||{},window.FDI.request=_i})(),Eae(),Fae(),Cbt()}); + */var ev=m;function uxt(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dxt=typeof Object.is=="function"?Object.is:uxt,fxt=ev.useState,pxt=ev.useEffect,vxt=ev.useLayoutEffect,hxt=ev.useDebugValue;function gxt(e,t){var r=t(),n=fxt({inst:{value:r,getSnapshot:t}}),a=n[0].inst,o=n[1];return vxt(function(){a.value=r,a.getSnapshot=t,LR(a)&&o({inst:a})},[e,r,t]),pxt(function(){return LR(a)&&o({inst:a}),e(function(){LR(a)&&o({inst:a})})},[e]),hxt(r),r}function LR(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!dxt(e,r)}catch{return!0}}function _xt(e,t){return t()}var mxt=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?_xt:gxt;MZ.useSyncExternalStore=ev.useSyncExternalStore!==void 0?ev.useSyncExternalStore:mxt,function(e){e.exports=MZ}(cxt);function LZ(e){e.reaction=new tD("observer".concat(e.name),function(){var t;e.stateVersion=Symbol(),(t=e.onStoreChange)===null||t===void 0||t.call(e)})}function xxt(e,t){t===void 0&&(t="observed");var r=$.useRef(null);if(!r.current){var n={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:t,subscribe:function(l){return NR.unregister(n),n.onStoreChange=l,n.reaction||(LZ(n),n.stateVersion=Symbol()),function(){var s;n.onStoreChange=null,(s=n.reaction)===null||s===void 0||s.dispose(),n.reaction=null}},getSnapshot:function(){return n.stateVersion}};r.current=n}var a=r.current;a.reaction||(LZ(a),NR.register(r,a,a)),$.useDebugValue(a.reaction,axt),MR.useSyncExternalStore(a.subscribe,a.getSnapshot,a.getSnapshot);var o,i;if(a.reaction.track(function(){try{o=e()}catch(l){i=l}}),i)throw i;return o}var zR,BR,zZ=typeof Symbol=="function"&&Symbol.for,bxt=(BR=(zR=Object.getOwnPropertyDescriptor(function(){},"name"))===null||zR===void 0?void 0:zR.configurable)!==null&&BR!==void 0?BR:!1,BZ=zZ?Symbol.for("react.forward_ref"):typeof m.forwardRef=="function"&&m.forwardRef(function(e){return null}).$$typeof,jZ=zZ?Symbol.for("react.memo"):typeof m.memo=="function"&&m.memo(function(e){return null}).$$typeof;function Zl(e,t){var r;if(jZ&&e.$$typeof===jZ)throw new Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");var n=(r=t?.forwardRef)!==null&&r!==void 0?r:!1,a=e,o=e.displayName||e.name;if(BZ&&e.$$typeof===BZ&&(n=!0,a=e.render,typeof a!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var i=function(l,s){return xxt(function(){return a(l,s)},o)};return i.displayName=e.displayName,bxt&&Object.defineProperty(i,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(i.contextTypes=e.contextTypes),n&&(i=m.forwardRef(i)),i=m.memo(i),wxt(e,i),i}var yxt={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function wxt(e,t){Object.keys(e).forEach(function(r){yxt[r]||Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}var jR;nxt(Kr.unstable_batchedUpdates),jR=NR.finalizeAllImmediately;const Dxt=Zl(({className:e,style:t,node:r,hasCheck:n=!1,checked:a,checkArea:o="node",hasJump:i=!1,selected:l,keywords:s,handleMore:c,handleRename:d,namesGetter:f,iconNameGetter:v,tooltipGetter:h,moreButtonMenuItems:g,onClick:_,onCheck:w,onJump:x,disabledCheck:y,tooltipProps:D={}})=>{const[F,S]=m.useState(!1),[I,C]=m.useState([]),[R,P]=m.useState(r.name),[O,N]=m.useState(a??!1),A=(Te.isFunction(g)?g(r):g)??[],z=M=>{d?.({id:r.id,name:M}).then(()=>{P(M)})},k=M=>h?.(M)??tn(gl,{children:[de("div",{children:M.name}),de("div",{children:at("FDI_Position_With_Colon")+M.position})]});return de("div",{style:t,className:ar(e,l&&"selected"),onClick:()=>{_?.(),o==="node"&&n&&(N(!O),w?.(!O))},children:tn("div",{className:"fdi-flex fdi-group",children:[n&&de(id,{disabled:y,className:"fdi-pt-xxs fdi-pr-xs",checked:a??O,onChange:()=>{o==="check"&&(N(!O),w?.(!O))}}),de("div",{className:"node-icon",children:de(Fa,{name:v?v(r):xq(!1,r),size:16})}),de(Xc,{...D,content:de("div",{children:k(r)}),children:tn("div",{className:"fdi-component-flex-w-fill-layout fdi-flex fdi-flex-col fdi-px-lg",children:[F?de(Fq,{className:"fdi-w-full",defaultValue:R,size:"small",onSave:M=>{S(!1),z(M)},onFocus:()=>{f?.(r).then(C)},checkError:M=>ow(M,I,Bl.NAME),validateHelp:M=>iw(M,I,Bl.NAME)}):de($q,{className:"fdi-catalog-search-title fdi-truncate",highlightClassName:"fdi-component-keyword-highlight",autoEscape:!0,textToHighlight:R,searchWords:s}),de("span",{className:"fdi-component-text-secondary fdi-truncate",children:r.position})]})}),A.length>0&&de(XC,{menu:{items:A,onAfterSelect:M=>{M.key===Xr.RENAME?S(!0):c?.(M.key,r)}},trigger:"click",children:de(jr,{className:"fdi-hidden group-hover:fdi-block",size:"small",type:"text-normal",icon:de(Fa,{name:"icon-more"}),onClick:M=>M.stopPropagation()})}),i&&de(jr,{className:"fdi-hidden group-hover:fdi-block",type:"text-normal",size:"small",icon:de(Fa,{name:"icon-enter"}),onClick:M=>{M.stopPropagation(),x?.()}})]})})}),Ixt=[{label:"FDI_All",value:Yn.ALL},{label:"FDI_Table",value:Yn.TABLE},{label:"FDI_Folder",value:Yn.FOLDER},{label:"FDI_Indicator",value:Yn.INDICATOR},{label:"FDI_Dimension",value:Yn.DIMENSION},{label:"FDI_Business_Model",value:Yn.BUSINESS_MODEL}];function Fxt(e){const t=[];let r=!1,n=0,a=0;return e.forEach(i=>{i.forEach(l=>{l.pageCount>0&&(t.push({key:"label",label:l.label}),l.nodes.forEach(s=>{t.push({key:l.value,node:s,nodeIndex:a++})}),n+=l.pageCount)})}),(Te.last(e)?.reduce((i,l)=>i+l.count,0)||0)!==n&&(r=!0),r&&t.push({key:"next"}),t}const UZ=({searchTypes:e,searchResults:t,showFilter:r=!0,onLoadData:n,keyword:a,refreshKey:o,searchNodeProps:i,emptyContent:l})=>{const[s,c]=m.useState(Yn.ALL),[d,f]=m.useState(1),v=m.useMemo(()=>Fxt(t),[t]),[h,g]=m.useState(0);Vl(()=>{g(h+1)},[v]),m.useEffect(()=>{f(1)},[a,s,o]);const{loading:_}=wm(()=>n({keyword:a??"",pageIndex:d,searchType:s}),{refreshDeps:[a,d,s,o],loadingDelay:300});return tn("div",{className:"fdi-search-result fdi-list fdi-component-flex-col-layout fdi-pt-xs",children:[r&&tn(gl,{children:[de("div",{children:Ixt.filter(({value:w})=>e.includes(w)).map(({value:w,label:x})=>de("span",{onClick:()=>c(w),children:de(hrt,{className:ar("fdi-mr-md fdi-mt-md",s===w&&"fdi-component-active-tag"),shape:"roundedRec",children:at(x)})},w))}),de(kW,{direction:"horizontal",style:{marginTop:Tn.token.gap,marginBottom:Tn.token.gap}})]}),tn("div",{className:"fdi-component-flex-h-fill-layout fdi-relative fdi-flex fdi-flex-col fdi-items-stretch",children:[de(sw,{loading:d===1&&_}),!v.length&&l,de(MQe,{items:v,renderItem:w=>{const x={paddingRight:Tn.token.paddingXs,paddingLeft:Tn.token.paddingXs};switch(w.key){case"label":return r?de("div",{style:x,className:"fdi-component-text-secondary",children:at(w.label)}):de(gl,{});case"next":return de("div",{style:x,children:d!==1&&_?de("div",{style:{height:Tn.token.controlHeight},className:"fdi-relative",children:de(sw,{})}):de(jr,{style:{height:Tn.token.controlHeight,width:"100%"},type:"text",onClick:()=>{f(d+1)},children:at("FDI_Load_More")})});default:return de(Dxt,{style:x,className:"fdi-component-list-item",node:w.node,keywords:[a??""],...i?.(w.node,w.nodeIndex,s)},w.node.id)}}},h)]})]})};function $xt(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Sxt(e){return"nodeType"in e}function Ext(e){var t,r;return e?$xt(e)?e:Sxt(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}var HZ;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(HZ||(HZ={}));const Cxt=Object.freeze({x:0,y:0});function Txt(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Rxt(e,t,r){const n=Txt(t);if(!n)return e;const{scaleX:a,scaleY:o,x:i,y:l}=n,s=e.left-i-(1-a)*parseFloat(r),c=e.top-l-(1-o)*parseFloat(r.slice(r.indexOf(" ")+1)),d=a?e.width/a:e.width,f=o?e.height/o:e.height;return{width:d,height:f,top:c,right:s+d,bottom:c+f,left:s}}const Oxt={ignoreTransform:!1};function WZ(e,t){t===void 0&&(t=Oxt);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:d}=Ext(e).getComputedStyle(e);c&&(r=Rxt(r,c,d))}const{top:n,left:a,width:o,height:i,bottom:l,right:s}=r;return{top:n,left:a,width:o,height:i,bottom:l,right:s}}function VZ(e){return WZ(e,{ignoreTransform:!0})}var tv;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(tv||(tv={}));var KZ;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(KZ||(KZ={}));var cl;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"})(cl||(cl={})),cl.Space,cl.Enter,cl.Esc,cl.Space,cl.Enter;var qZ;(function(e){e[e.RightClick=2]="RightClick"})(qZ||(qZ={}));var YZ;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(YZ||(YZ={}));var GZ;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(GZ||(GZ={})),tv.Backward+"",tv.Forward+"",tv.Backward+"",tv.Forward+"";var UR;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(UR||(UR={}));var HR;(function(e){e.Optimized="optimized"})(HR||(HR={})),UR.WhileDragging,HR.Optimized,{...Cxt};var XZ;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(XZ||(XZ={})),cl.Down,cl.Right,cl.Up,cl.Left;var Axt=Object.defineProperty,kxt=Object.getOwnPropertyDescriptor,Pxt=(e,t,r,n)=>{for(var a=n>1?void 0:n?kxt(t,r):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(n?i(t,r,a):i(a))||a);return n&&a&&Axt(t,r,a),a};class Nxt{constructor(t=""){this.loading=!1,this.treeData=[],this.selectedKey="",this.refreshKey=0,this.refreshTreeKey=0,yZ(this),this.selectedKey=t}setTreeData(t){this.treeData=t}setSelectedKey(t){this.selectedKey=t}setRefreshKey(){this.refreshKey+=1}refreshSelectedKey(t){t===this.selectedKey&&this.setRefreshKey(),this.setSelectedKey(t)}setRefreshTreeKey(){this.refreshTreeKey+=1}get selectedNode(){return rl(this.selectedKey,this.treeData)}}Pxt([Bo],Nxt.prototype,"selectedNode",1),m.createContext(null),m.createContext(null);const Mxt=e=>e==null,ZZ=e=>(...t)=>(Lxt(t[1]),e(...t)),QZ=(e,t)=>{const{trigger:r}=e;return r||(["onClick","onChange"].find(o=>!Mxt(t[o]))??"onClick")},JZ=(e,t)=>{if(!e)return;const r=QZ(e,t),n=t[r];t[r]=(...a)=>{console.log("trigger:",QZ(e,t)),console.log("payload:",e.payload),Aft.emit("trackPoint",e.payload),n?.(...a)}},Lxt=e=>{const t=e?.["data-track-point"];t&&(Array.isArray(t)?t.forEach(r=>JZ(r,e)):JZ(t,e))},{jsx:zxt,jsxs:Bxt}=Zee,Ye=ZZ(zxt),zn=ZZ(Bxt);var eQ,tQ=Kr;eQ=tQ.createRoot,tQ.hydrateRoot;const iqt="",lqt="",sqt="",cqt="",ul="v1";function rQ(){return _i.get(`api/dc/${ul}/folders`).then(e=>e.data)}function sD(e){return _i.get(`api/dc/${ul}/folders/tree/${e}`).then(t=>t.data)}function cD(e){return _i.post(`api/dc/${ul}/folders/${e.folderId}/structure`,e).then(t=>t.data)}function jxt(e){return _i.post(`api/dc/${ul}/folders/table/search`,e).then(t=>t.data)}function Uxt(e){return _i.post(`api/dc/${ul}/folders/field/search`,e).then(t=>t.data)}function Hxt(e){return _i.get(`api/dc/${ul}/tables/${e}/data`).then(t=>t.data)}function nQ(e){return _i.get(`api/dc/${ul}/model/${e}/structure`).then(t=>t.data)}function Wxt(e){return _i.get(`api/dc/${ul}/tables/${e}/structure`).then(t=>t.data)}function Vxt(e){return _i.post(`api/dc/${ul}/sql/params`,e).then(t=>t.data)}function Kxt(e){return _i.post(`/api/dc/${ul}/preview/page`,e).then(t=>t.data)}async function qxt(e){return _i.post(`/api/dc/${ul}/model/fields/structure`,e).then(t=>t.data)}var Ea=(e=>(e[e.TABLE=1]="TABLE",e[e.BUSINESS_MODEL=2]="BUSINESS_MODEL",e[e.DIMENSION_INDICATOR=3]="DIMENSION_INDICATOR",e))(Ea||{}),uD=(e=>(e[e.GROUP=1]="GROUP",e[e.DETAIL=2]="DETAIL",e))(uD||{}),Ql=(e=>(e.DIMENSION1="10000",e.TARGET1="30000",e))(Ql||{}),js=(e=>(e[e.SINGLE=1]="SINGLE",e[e.DOUBLE=2]="DOUBLE",e[e.GROUP=3]="GROUP",e))(js||{}),WR=(e=>(e[e.GROUP_BY_VALUE=1]="GROUP_BY_VALUE",e[e.GROUP_BY_CUSTOM=2]="GROUP_BY_CUSTOM",e[e.COUNT=3]="COUNT",e[e.RECORD_COUNT=4]="RECORD_COUNT",e[e.APPEND=5]="APPEND",e[e.RENAME=6]="RENAME",e[e.DELETE=7]="DELETE",e[e.APPROXIMATE_DISTINCT_COUNT=27]="APPROXIMATE_DISTINCT_COUNT",e[e.GROUP_FORMULA=40]="GROUP_FORMULA",e))(WR||{}),dD=(e=>(e[e.GROUP_BY_VALUE=1]="GROUP_BY_VALUE",e[e.CUSTOM_NUMBER_GROUP=2]="CUSTOM_NUMBER_GROUP",e[e.SUM=8]="SUM",e[e.AVG=9]="AVG",e[e.MEDIAN=10]="MEDIAN",e[e.MAX=11]="MAX",e[e.MIN=12]="MIN",e[e.STANDARD_DEVIATION=13]="STANDARD_DEVIATION",e[e.VARIANCE=14]="VARIANCE",e[e.COUNT=15]="COUNT",e[e.RECORD_COUNT=16]="RECORD_COUNT",e[e.NONE=17]="NONE",e[e.PERIOD=18]="PERIOD",e[e.RING=19]="RING",e[e.PERIOD_RATE=20]="PERIOD_RATE",e[e.RING_RATE=21]="RING_RATE",e[e.PERIOD_INCREMENT=36]="PERIOD_INCREMENT",e[e.RING_INCREMENT=37]="RING_INCREMENT",e[e.PERIOD_OR_RING=38]="PERIOD_OR_RING",e[e.YEAR=22]="YEAR",e[e.QUARTER=23]="QUARTER",e[e.MONTH=24]="MONTH",e[e.WEEK=25]="WEEK",e[e.WEEKDAY=26]="WEEKDAY",e[e.APPROXIMATE_DISTINCT_COUNT=33]="APPROXIMATE_DISTINCT_COUNT",e[e.RENAME=27]="RENAME",e[e.DELETE=28]="DELETE",e[e.GROUP_FORMULA=40]="GROUP_FORMULA",e))(dD||{}),VR=(e=>(e[e.DATE=5]="DATE",e[e.YEAR=6]="YEAR",e[e.QUARTER=7]="QUARTER",e[e.MONTH=8]="MONTH",e[e.WEEKDAY=9]="WEEKDAY",e[e.DAY=10]="DAY",e[e.MORE_GROUP=11]="MORE_GROUP",e[e.WEEK_COUNT=12]="WEEK_COUNT",e[e.HOUR=13]="HOUR",e[e.MINUTE=14]="MINUTE",e[e.SECOND=15]="SECOND",e[e.YQ=16]="YQ",e[e.YM=17]="YM",e[e.YW=18]="YW",e[e.YMDH=19]="YMDH",e[e.YMDHM=20]="YMDHM",e[e.YMDHMS=21]="YMDHMS",e[e.MONTH_DAY=48]="MONTH_DAY",e[e.COUNT=29]="COUNT",e[e.RECORD_COUNT=30]="RECORD_COUNT",e[e.ET=31]="ET",e[e.LT=32]="LT",e[e.APPROXIMATE_DISTINCT_COUNT=35]="APPROXIMATE_DISTINCT_COUNT",e[e.RANK=36]="RANK",e[e.ASC=37]="ASC",e[e.DESC=38]="DESC",e[e.RENAME=33]="RENAME",e[e.DELETE=34]="DELETE",e[e.GROUP_FORMULA=40]="GROUP_FORMULA",e))(VR||{}),Lt=(e=>(e.String="String",e.Integer="Integer",e.Double="Double",e.Date="Date",e.Boolean="Boolean",e.Formula="Formula",e.Parameter="Parameter",e.TableColumn="TableColumn",e))(Lt||{}),fD=(e=>(e[e.None=-1]="None",e[e.And=1]="And",e[e.Or=2]="Or",e[e.Leaf=0]="Leaf",e))(fD||{}),Us=(e=>(e[e.Sql=1]="Sql",e[e.Filter=2]="Filter",e))(Us||{}),Jt=(e=>(e[e.Equal=0]="Equal",e[e.NotEqual=1]="NotEqual",e[e.More=2]="More",e[e.MoreEqual=3]="MoreEqual",e[e.Less=4]="Less",e[e.LessEqual=5]="LessEqual",e[e.Beginning=6]="Beginning",e[e.BeginningNot=7]="BeginningNot",e[e.End=8]="End",e[e.EndNot=9]="EndNot",e[e.Include=10]="Include",e[e.NotInclude=11]="NotInclude",e[e.IncludeIn=12]="IncludeIn",e[e.NotIncludeIn=13]="NotIncludeIn",e))(Jt||{});const pD={RESOURCE_TYPE:96,FIELD_TYPE:96},Yxt=({selectedNode:e})=>{const[t,{width:r}]=Lp(),{data:n,loading:a}=wm(()=>Hxt(e.id),{ready:!Te.isNil(e)&&e.nodeType===et.DATA_TABLE,refreshDeps:[e]}),{data:o}=wm(()=>nQ(e.id),{ready:!Te.isNil(e)&&e.nodeType===et.BUSINESS_MODEL,refreshDeps:[e]}),i=()=>[{dataIndex:"resourceType",title:at("FDI_Resource_Type"),width:pD.RESOURCE_TYPE,render:l=>l===sr.DIMENSION?at("FDI_Dimension"):at("FDI_Indicator")},{dataIndex:"fieldType",title:at("FDI_Field_Type"),width:pD.FIELD_TYPE,render:l=>Ye(yd,{text:at(hq(l)),icon:{name:bd(l)}})},{dataIndex:"name",title:at("FDI_Field_Transfer_Name"),width:r-pD.RESOURCE_TYPE-pD.FIELD_TYPE-2}];return zn(gl,{children:[e?.nodeType===et.DATA_TABLE&&Ye(Oq,{className:"fdi-w-full fdi-h-full",tableData:n??{fields:[],data:[]}}),e?.nodeType===et.BUSINESS_MODEL&&Ye("div",{className:"fdi-w-full fdi-h-full",ref:t,children:Ye(Fg,{style:{width:"100%",height:"100%"},dataSource:o?.itemInfos??[],columns:i()})}),!e&&Ye(lw,{className:"fdi-w-full fdi-h-full",description:at("FDI_Please_Choose_Resource")}),Ye(sw,{loading:a})]})},vD={TYPE:96,OPERATE:42},Gxt=({checkedNodes:e,onCheck:t})=>{const[r,{width:n}]=Lp(),a=()=>[{dataIndex:"nodeType",title:at("FDI_Resource_Type"),width:vD.TYPE,render:o=>o===et.DIMENSION?at("FDI_Dimension"):at("FDI_Indicator")},{dataIndex:"_name",title:at("FDI_Field_Transfer_Name"),width:n-vD.OPERATE-vD.TYPE-2,render:(o,i)=>{const l=i.value;return Ye(yd,{text:i.name,icon:{name:bd(l.type)}})}},{dataIndex:"_operate",title:"",width:vD.OPERATE,render:(o,i)=>Ye(jr,{type:"text-normal",icon:Ye(Fa,{name:"icon-delete",onClick:()=>{t?.(e.filter(l=>l.id!==i.id))}})})}];return Ye("div",{className:"fdi-w-full fdi-h-full",ref:r,children:Te.isEmpty(e)?Ye(lw,{className:"fdi-w-full fdi-h-full",description:at("FDI_Please_Choose_Resource")}):Ye(Fg,{style:{width:"100%",height:"100%"},dataSource:e,columns:a()})})},Xxt=({keyword:e,onSelect:t,onJump:r})=>{const[n,a]=m.useState([]),o=m.useMemo(()=>n.map(l=>Iq(l).map(s=>({...s,nodes:s.nodes}))),[n]),i=l=>(l.pageIndex===1&&a([]),jxt(l).then(s=>{a(c=>[...c,s])}));return Ye(UZ,{searchTypes:[Yn.FOLDER,Yn.TABLE,Yn.BUSINESS_MODEL],keyword:e,showFilter:!1,searchResults:o,onLoadData:i,searchNodeProps:l=>{const s=ja(l.nodeType);return{hasJump:s,onClick:()=>{s?t?.(l):r?.(l)},onJump:()=>{r?.(l)}}}})},Zxt=({checkedKeys:e,keyword:t,onCheck:r,onJump:n})=>{const[a,o]=m.useState([]),i=m.useMemo(()=>a.map(s=>Iq(s).map(c=>({...c,nodes:c.nodes}))),[a]),l=s=>(s.pageIndex===1&&o([]),Uxt(s).then(c=>{o(d=>[...d,c])}));return Ye(UZ,{searchTypes:[Yn.FOLDER,Yn.INDICATOR,Yn.DIMENSION],keyword:t,showFilter:!1,searchResults:i,onLoadData:l,searchNodeProps:s=>{const c=ja(s.nodeType);return{hasCheck:c,checked:e?.includes(s.id),hasJump:c,onCheck:d=>{r?.(d,s)},onClick:()=>{!c&&n?.(s)},onJump:()=>{n?.(s)}}}})},Qxt=({selectedNode:e,onSelect:t})=>{const[r,n]=m.useState([]),[a,o]=m.useState(""),[i,l]=m.useState(e?e.id:""),{onLoadData:s,expandedKeys:c,handleExpand:d,handleSelect:f,handleJump:v}=SX({selectedKey:i,setSelectedKey:l,treeData:r,updateTreeData:h=>n(MT(h)),getRootData:()=>rQ().then(nl),getNavigationDataById:(h,g)=>{const _=g??e;return ja(_.nodeType)?_.pId?sD(_.pId).then(w=>cD({folderId:_.pId,resourceTypes:[sr.TABLE,sr.BUSINESS_MODEL,sr.PACKAGE]}).then(x=>PT(_.pId,[nl(w)],()=>({...nl(x)}))[0])):Promise.resolve():sD(h).then(nl)},getChildrenDataById:h=>cD({folderId:h,resourceTypes:[sr.TABLE,sr.BUSINESS_MODEL,sr.PACKAGE]}).then(nl)});return Vl(()=>{const h=rl(i,r);h&&ja(h.nodeType)&&t?.(h)},[i]),zn("div",{className:"fdi-relative fdi-w-full fdi-h-full",children:[Ye($X,{searchable:!0,selectable:!0,keyword:a,sourceData:r,onLoadData:s,selectedKeys:i?[i]:void 0,expandedKeys:c,onExpand:d,onSearch:o,onSelect:h=>{f(h[0])},fixTreeNodeFunc:h=>({selectable:ja(h.nodeType)})}),a&&Ye("div",{className:"fdi-absolute fdi-bg-neutral-light-0 fdi-top-[32px] fdi-left-0 fdi-right-0 fdi-bottom-0",children:Ye(Xxt,{keyword:a,onSelect:h=>f(h.id,h),onJump:h=>{v(h.id,h),Te.delay(()=>{o("")},100)}})})]})},Jxt=({checkedNodes:e,onCheck:t})=>{const[r,n]=m.useState([]),[a,o]=m.useState(""),i=e.map(f=>f.id),{onLoadData:l,expandedKeys:s,handleExpand:c,handleJump:d}=SX({treeData:r,updateTreeData:f=>n(MT(f)),getRootData:()=>rQ().then(nl),getNavigationDataById:(f,v)=>ja(v.nodeType)?sD(v.pId).then(h=>cD({folderId:v.pId,resourceTypes:[sr.INDICATOR,sr.DIMENSION,sr.PACKAGE]}).then(g=>PT(v.pId,[nl(h)],()=>({...nl(g)}))[0])):sD(f).then(nl),getChildrenDataById:f=>cD({folderId:f,resourceTypes:[sr.INDICATOR,sr.DIMENSION,sr.PACKAGE]}).then(nl)});return zn("div",{className:"fdi-relative fdi-w-full fdi-h-full",children:[Ye($X,{searchable:!0,selectable:!0,checkable:!0,keyword:a,checkPos:"middle",sourceData:r,onLoadData:l,expandedKeys:s,checkedKeys:i,onExpand:c,onSearch:o,onCheck:f=>{const v=f.map(h=>rl(h,r));t?.(v)},fixTreeNodeFunc:f=>({selectable:ja(f.nodeType),hasCheck:f.nodeType!==et.FOLDER})}),a&&Ye("div",{className:"fdi-absolute fdi-bg-neutral-light-0 fdi-top-[32px] fdi-left-0 fdi-right-0 fdi-bottom-0",children:Ye(Zxt,{checkedKeys:i,keyword:a,onCheck:(f,v)=>{const h=f?Te.uniq([...e,v]):e.filter(g=>g.id!==v.id);t?.(h)},onJump:f=>{d(f.id,f),Te.delay(()=>{o("")},100)}})})]})},ebt=({data:e,onChange:t})=>{const[r,n]=m.useState(e?.type===Ea.DIMENSION_INDICATOR?"field":"table"),[a,o]=m.useState(e?.type===Ea.TABLE||e?.type===Ea.BUSINESS_MODEL?e.nodes[0]:void 0),[i,l]=m.useState(e?.type===Ea.DIMENSION_INDICATOR?e.nodes:[]);Vl(()=>{r==="table"?t?.(a?{type:a.nodeType===et.DATA_TABLE?Ea.TABLE:Ea.BUSINESS_MODEL,nodes:[a]}:void 0):i.length>0?t?.({type:Ea.DIMENSION_INDICATOR,nodes:i}):t?.(void 0)},[r,a,i]);const s=()=>zn(w1,{activeKey:r,onTabActive:n,className:"fdi-p-lg fdi-flex fdi-flex-col fdi-h-full",theme:"segment",children:[Ye(w1.Item,{tab:at("FDI_Table_And_Model"),className:"fdi-py-lg fdi-component-flex-h-fill-layout",children:Ye(Qxt,{selectedNode:a,onSelect:o})},"table"),Ye(w1.Item,{tab:at("FDI_Indicator_And_Dimension"),className:"fdi-py-lg fdi-component-flex-h-fill-layout",children:Ye(Jxt,{checkedNodes:i,onCheck:l})},"field")]}),c=()=>r==="table"?Ye(Yxt,{selectedNode:a}):Ye(Gxt,{checkedNodes:i,onCheck:l});return Ye("div",{className:"fdi-w-full fdi-h-full",children:Ye(upt,{allowCollapse:!1,activeContent:s(),drivenContent:Ye("div",{className:"fdi-h-full fdi-p-lg fdi-relative",children:c()})})})},aQ=2147483647,oQ=-2147483648,tbt={authority:!0,parameters:[]},iQ={[Lt.String]:"icon-edit-string",[Lt.Integer]:"icon-edit-integer",[Lt.Double]:"icon-edit-double",[Lt.Date]:"icon-edit-date",[Lt.Boolean]:"icon-edit-boolean",[Lt.Formula]:"icon-edit-formula",[Lt.Parameter]:"icon-edit-parameter"},rbt={[Lt.String]:"STRING",[Lt.Integer]:"INT",[Lt.Double]:"DOUBLE",[Lt.Date]:"DATE",[Lt.Boolean]:"BOOLEAN",[Lt.Formula]:"FORMULA",[Lt.Parameter]:"PARAMETER"},lQ=[Lt.String,Lt.Integer,Lt.Double,Lt.Date,Lt.Boolean,Lt.Formula],nbt=[...lQ,Lt.Parameter],abt={[Jt.Equal]:"EQUAL",[Jt.NotEqual]:"NOT_EQUAL",[Jt.More]:"MORE",[Jt.MoreEqual]:"MORE_EQUAL",[Jt.Less]:"LESS",[Jt.LessEqual]:"LESS_EQUAL",[Jt.Beginning]:"BEGINNING_IS",[Jt.BeginningNot]:"BEGINNING_IS_NOT",[Jt.End]:"END_IS",[Jt.EndNot]:"END_IS_NOT",[Jt.Include]:"INCLUDE",[Jt.NotInclude]:"NOT_INCLUDE",[Jt.IncludeIn]:"INCLUDE_IN",[Jt.NotIncludeIn]:"NOT_INCLUDE_IN"},obt={[Gn.AND]:"ADD_FILTER_CONDITION_AND",[Gn.OR]:"ADD_FILTER_CONDITION_OR"},sQ={compare:Jt.Equal,valueType:Lt.String},ibt={[Us.Sql]:"icon-sql",[Us.Filter]:"icon-filter"},lbt=[Jt.Equal,Jt.NotEqual,Jt.Beginning,Jt.BeginningNot,Jt.End,Jt.EndNot,Jt.Include,Jt.NotInclude,Jt.IncludeIn,Jt.NotIncludeIn],sbt=[Jt.Equal,Jt.NotEqual,Jt.More,Jt.MoreEqual,Jt.Less,Jt.LessEqual,Jt.IncludeIn,Jt.NotIncludeIn],cbt=[Jt.Equal,Jt.NotEqual,Jt.More,Jt.Less],ubt={[Jt.Equal]:"EQUAL",[Jt.NotEqual]:"NOT_EQUAL",[Jt.More]:"AFTER_DATE",[Jt.Less]:"BEFORE_DATE"};function dbt(e,t){const r=Te.map(e,"name");return Pft(r,t.name)}function fbt(e,t,r){return{name:t,id:e.id,fieldType:e.fieldType,resourceType:e.resourceType,valid:!0,used:!0,value:r}}function pbt(e){return e===Ql.DIMENSION1}function cQ(e,t){const r=pbt(t);switch(e){case na.NUMBER:return r?[{type:js.SINGLE,value:dD.GROUP_BY_VALUE}]:[{type:js.SINGLE,value:dD.SUM},{type:js.SINGLE,value:dD.NONE}];case na.DATE:return r?[{type:js.SINGLE,value:VR.DATE}]:[{type:js.SINGLE,value:VR.COUNT}];default:return r?[{type:js.SINGLE,value:WR.GROUP_BY_VALUE}]:[{type:js.SINGLE,value:WR.COUNT}]}}var vbt=Object.defineProperty,hbt=Object.getOwnPropertyDescriptor,Jc=(e,t,r,n)=>{for(var a=n>1?void 0:n?hbt(t,r):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(n?i(t,r,a):i(a))||a);return n&&a&&vbt(t,r,a),a};class Jl{constructor(){this.dsName="",this.originSourceInfo=void 0,this.engineType=tl.SPIDER,this.fields=[],this.view={[Ql.DIMENSION1]:[],[Ql.TARGET1]:[]},this.dimensions={},this.filter={},this.parameters=[],this.originSqlParameters=[],yZ(this)}get source(){const t=[],r=[],n=[],a=[];return this.originSourceInfo?.nodes.forEach(o=>{switch(o.nodeType){case et.DATA_TABLE:t.push(o.id);break;case et.BUSINESS_MODEL:r.push(o.id);break;case et.INDICATOR:n.push(o.id);break;case et.DIMENSION:a.push(o.id);break}}),{engineType:this.engineType,type:this.originSourceInfo?.type??Ea.TABLE,tableNames:t,businessModelIds:r,indicatorIds:n,dimensionIds:a}}get queryView(){const t=this.view[Ql.DIMENSION1].concat(this.view[Ql.TARGET1]);return Te.isEmpty(t)?{type:uD.DETAIL,fields:this.fields}:{type:uD.GROUP,view:this.view,dimensions:this.dimensions}}get fieldsTypeMap(){const t={};return Te.each(this.fields,r=>{t[r.id]=r.fieldType}),t}get dateTypeInGroup(){return Te.filter(this.view[Ql.DIMENSION1],t=>this.dimensions[t]?.fieldType===na.DATE)??[]}get allDateGroupTypes(){const t=[],r=this.view[Ql.DIMENSION1],n=this.dimensions[this.dateTypeInGroup[0]];return Te.each(r,a=>{const o=this.dimensions[a];if(o?.fieldType!==na.DATE||o.id!==n?.id)return;const i=Te.first(o.value);i?.type===js.SINGLE?t.push(i.value):i?.childValue&&t.push(i.childValue)}),t}get firstDateDimensionName(){return this.dimensions[this.dateTypeInGroup[0]]?.name}get sqlParameters(){const t={};return this.parameters.forEach(r=>{if(r.group===Us.Sql){const n=this.originSqlParameters.find(a=>a.tableName===r.tableName).values.find(a=>a.name===r.name);t[r.name]={name:r.name,tableName:r.tableName,parameterType:n?.type??na.STRING,value:{value:r.value,type:r.type===Lt.Date?na.DATE:na.STRING}}}}),t}get dataChooseSaveInfo(){return{dsName:this.dsName,source:this.source,parameters:this.parameters,filter:this.filter,queryView:this.queryView}}setOriginSourceInfo(t){this.originSourceInfo=t}setOriginSqlParameters(t){this.originSqlParameters=t}setFields(t){this.fields=t}setDsName(t){this.dsName=t}setDimensions(t){this.dimensions=t}setView(t){this.view=t}setEngineType(t){this.engineType=t}setFilterCondition(t){t.filterType===fD.None?this.filter={}:this.filter=t}setParameters(t){this.parameters=t}reset(){this.engineType=tl.SPIDER,this.fields=[],this.view={[Ql.DIMENSION1]:[],[Ql.TARGET1]:[]},this.dimensions={},this.filter={},this.parameters=[]}addDimension(t,r,n,a){this.dimensions={...this.dimensions,[t]:r},this.view={...this.view,[n]:[...this.view[n].slice(0,a),t,...this.view[n].slice(a)]}}setDimension(t,r){this.dimensions={...this.dimensions,[t]:{...this.dimensions[t],value:r}}}setDimensionName(t,r){this.dimensions={...this.dimensions,[t]:{...this.dimensions[t],name:r}}}setSortBySortInfo(t){const{regionTypes:r}=t,n=t.dimensions,{regionType:a}=t,o=Te.cloneDeep(this.dimensions),i=Te.cloneDeep(this.view);Te.each(r,(l,s)=>{if(l===a)return;const c=o[n[s]];c.value=cQ(c.fieldType,a)}),i[t.regionType]=n,this.dimensions=o,this.view=i}addDimensionByField(t,r,n){Te.each(t,(a,o)=>{const i=AV(),l=dbt(this.dimensions,a),s=cQ(a.fieldType,r);this.addDimension(i,fbt(a,l,s),r,n+o)})}deleteDimension(t){const r=Te.cloneDeep(this.dimensions),n=Te.cloneDeep(this.view);delete r[t],Te.each(n,(a,o)=>{const i=Te.findIndex(a,l=>l===t);i!==-1&&n[o].splice(i,1)}),this.dimensions=r,this.view=n}}Jc([Bo],Jl.prototype,"source",1),Jc([Bo],Jl.prototype,"queryView",1),Jc([Bo],Jl.prototype,"fieldsTypeMap",1),Jc([Bo],Jl.prototype,"dateTypeInGroup",1),Jc([Bo],Jl.prototype,"allDateGroupTypes",1),Jc([Bo],Jl.prototype,"firstDateDimensionName",1),Jc([Bo],Jl.prototype,"sqlParameters",1),Jc([Bo],Jl.prototype,"dataChooseSaveInfo",1);let KR=new Jl;const rv=()=>(KR||(KR=new Jl),KR);async function gbt(e){return new Promise(t=>{if(window.dcHelper?.parseFormulaParameters)return window.dcHelper.parseFormulaParameters(e,r=>{RV(r),t(JSON.parse(r))});t([])})}async function _bt(e){return new Promise(t=>{if(window.dcHelper?.transFilter4Query)return window.dcHelper.transFilter4Query(JSON.stringify(e),r=>{t(JSON.parse(r))});t({})})}async function uQ(e){return new Promise(t=>{if(window.dcHelper?.showFormulaPane)return window.dcHelper.showFormulaPane(e||"",(r,n)=>{t({action:r,content:n})});t({action:"OK",content:""})})}const zd=(e,t)=>{switch(e){case Lt.Parameter:case Lt.String:return typeof t=="string"?t:typeof t=="object"?void 0:t?.toString();case Lt.Integer:return isNaN(parseInt(t))?0:Te.clamp(parseInt(t),oQ,aQ);case Lt.Double:return isNaN(parseInt(t))?0:parseFloat(t);case Lt.Date:return typeof t=="number"&&Number.isInteger(t)?t:null;case Lt.Boolean:return!1;case Lt.Formula:return typeof t=="string"?t:typeof t!="object"&&t?t.toString():"";default:return t}},dQ=Zl(({value:{value:e,type:t},onChange:r,onValueChange:n,columns:a,isFilter:o})=>{const[i,l]=m.useState(!1),[s,c]=m.useState(e),d=h=>{r({type:t,value:h}),n?.(!0)},f=m.useMemo(()=>o?nbt:lQ,[o]),v=h=>{switch(h){case Lt.Parameter:case Lt.String:return Ye(Ss,{placeholder:at("FDI_Please_Input"),value:s,onChange:g=>{c(g)},onBlur:g=>{d(g)},onPressEnter:g=>{d(g.target.value)}});case Lt.Integer:return Ye("div",{className:"fdi-parameter-edit-number fdi-w-full",children:Ye(aC,{value:zd(Lt.Integer,s),onChange:g=>{c(g||0),d(zd(Lt.Integer,g||0))},precision:0,min:oQ,max:aQ})});case Lt.Double:return Ye("div",{className:"fdi-parameter-edit-number",children:Ye(aC,{maxPrecision:20,value:zd(Lt.Double,s),onChange:g=>{c(g||0)},onBlur:g=>{d(zd(Lt.Double,g))},onPressEnter:g=>{d(zd(Lt.Double,g.target.value))}})});case Lt.Date:return Ye(gQe,{value:typeof e=="number"?Dn(e):null,format:"yyyy-MM-dd",onAfterChange:g=>{g&&d(g?.valueOf())}});case Lt.Boolean:return Ye(id,{checked:typeof e=="boolean"?e:e==="true",onChange:(g,_)=>{d(_.target.checked)},children:e?.toString()});case Lt.Formula:return Ye(Ss,{onClick:()=>uQ(e||"").then(({action:g,content:_})=>{g==="OK"&&d(_)}),value:e,onChange:(g,_)=>{_.preventDefault()}});default:return zn("div",{children:[" ",e]})}};return zn("div",{className:ar("fdi-parameter-edit fdi-flex fdi-justify-start fdi-items-center fdi-flex-1 fdi-gap-sm",{"fdi-filter-condition-edit fdi-w-[240px] fdi-flex-none":o}),children:[Ye(b1,{visible:i,arrow:!1,trigger:"click",placement:"bottom-left",overlayClassName:"fdi-description-with-show-list-popover",onVisibleChange:h=>l(h),destroyTooltipOnHide:!0,content:Ye(Igt,{className:"fdi-parameter-value-type-list",reverseSelectable:!1,defaultActiveIndex:Te.findIndex(f,h=>h===t),dataSource:f.map(h=>({id:h,value:at(rbt[h]),iconName:iQ[h]})),onClick:(h,g)=>{if(g===Lt.Formula){const _=zd(Lt.Formula,e);uQ(_).then(({action:w,content:x})=>{w==="OK"?(c(x),r({type:g,value:x}),n?.(!0)):(c(_),r({type:g,value:_}))})}else r({type:g,value:zd(g,e)});g!==t&&n?.(!0),l(!1)}}),children:zn("div",{className:ar("fdi-parameter-edit-icon fdi-flex fdi-leading-[28px] fdi-px-lg fdi-gap-sm fdi-component-list-item",{selected:i}),children:[Ye(Fa,{name:iQ[t]}),Ye(Fa,{name:"icon-down-arrow"})]})}),v(t)]})}),mbt=({columns:e,value:{value:t},onChange:r})=>{const n=typeof t=="object"?t:sQ,{column:a,compare:o,valueType:i,value:l}=n,s=c=>c===na.DATE?cbt:c===na.NUMBER?sbt:lbt;return zn("div",{className:"fdi-filter-condition-pane-item fdi-flex fdi-items-center fdi-gap-md fdi-w-full",children:[Ye(xC,{className:"fdi-filter-condition-pane-select fdi-w-[200px]",placeholder:at("PLEASE_SELECT_DATA_COLUMN"),value:a?.id,options:e.map(c=>{const{id:d,type:f}=c;return{value:d,label:Ye(yd,{text:gq(c),icon:{name:bd(f)}})}}),onChange:c=>{const d=Te.find(e,f=>f.id===c);r({...n,column:d,compare:Te.includes(s(d.type),o)?o:Jt.Equal})}}),Ye(xC,{className:"fdi-filter-condition-pane-select condition-types fdi-w-[120px]",placeholder:at("FDI_Please_Select"),value:o,options:s(a?.type).map(c=>({value:+c,label:at(a?.type===na.DATE?ubt[c]:abt[c])})),onChange:c=>{r({...n,compare:c})}}),Ye(dQ,{isFilter:!0,columns:e,value:{type:i,value:l},onChange:c=>{r({...n,valueType:c.type,value:c.value})}})]})},uqt="",fQ=e=>e?.map(t=>{const{filterType:r,conditions:n,...a}=t;return{type:r===fD.Leaf?Gn.LEAF:r,value:{value:a},children:fQ(n)}}),pQ=e=>e?.map(t=>{const{type:r,value:n={},children:a}=t,o=typeof n=="object"?n.value:sQ;return{filterType:r||fD.Leaf,conditions:pQ(a),...o||{}}}),vQ=async(e,t,r)=>{const n=c=>Te.find(t,d=>d.name===c),a=c=>{!c||Te.isEmpty(c)||c.forEach(d=>{const f=n(d);e.push({name:d,type:f?.type||Lt.String,value:f?f.value:"",group:Us.Filter})})},o=[],i=r?.map(async c=>{const{conditions:d,value:f,valueType:v}=c;v===Lt.Parameter&&f&&a([f]),v===Lt.Formula&&f&&o.push(f),d?.length!==0&&await vQ(e,t,d)});await Promise.all(Te.compact(i));const l=o.map(async c=>await gbt(c));(await Promise.all(l)).forEach(c=>{a(c)})},xbt=Zl(({className:e,onChange:t})=>{const r=rv(),n=m.useRef(null),a=r.fields,o=m.useMemo(()=>{const{filter:l}=r;return!l||Te.isEmpty(l)?[]:fQ([l])},[r.filter,r.originSourceInfo]),i=async()=>{const l=n.current?.getTreeValue(),s=pQ(l),c=r.parameters.filter(f=>f.group===Us.Filter),d=r.parameters.filter(f=>f.group===Us.Sql);await vQ(d,c,s),r.setFilterCondition(s?.[0]??{}),r.setParameters(d),t?.(!0)};return zn(MC,{className:ar("fdi-filter-condition-pane fdi-mb-xxl",e),direction:"vertical",size:4,children:[Ye("span",{className:"fdi-filter-condition-pane-head-text fdi-leading-[28px] fdi-font-600",children:at("FILTER_CONDITION")}),Ye(cft,{ref:n,className:"fdi-filter-condition-pane-content",defaultItems:o,operations:[[Gn.AND,Gn.OR].map(l=>({key:l,value:l,label:at(obt[l])}))],itemRender:()=>Ye(mbt,{columns:a}),onChange:i})]})}),bbt=(e,t)=>{const r=Object.getOwnPropertyNames(e),n=m.useRef(),a={};Te.each(r,s=>{a[s]=Te.cloneDeep(e[s])});const o=AV(),i=BI.inherit(Fix.Model,{state(){return a},childContext:r});BI.model(o,i);const l=s=>()=>{m.useEffect(()=>{n.current&&Fix.set(n.current.store.model,s,Te.cloneDeep(e[s]))},[e[s]])};return r.forEach(s=>{l(s)()}),Ye(EX,{type:"fdi.fix.context",ref:n,_store:()=>BI.Models.getModel(o),children:{...t}})},ybt=Zl(({className:e})=>{const t=rv(),r=bbt(t,{type:"fdi.group.operator.regions",settingStore:t});return Ye("div",{className:ar(e,"fdi-data-group"),children:r})}),wbt=Zl(({className:e})=>{const t=rv(),[r,n]=m.useState([]),[a,o]=m.useState([]),[i,l]=m.useState({limit:L1,pageIndex:1,pageSize:nT,totalRows:0}),[s,c]=m.useState(!1);Vl(()=>{c(!0)},[t.queryView,t.filter,t.parameters]);const{runAsync:d}=wm(async f=>{l({...i,pageIndex:f?.pageIndex??1});const v=await _bt(t.dataChooseSaveInfo);return Kxt({queryView:t.queryView,source:t.source,limit:{rowCount:f?.limit??L1,pageInfo:{pageIndex:f?.pageIndex??1,pageSize:f?.pageSize??nT}},filter:v,parameters:t.sqlParameters})},{manual:!0,onSuccess:f=>{n(f.fields),o(f.data)}});return zn("div",{className:ar("fdi-data-preview fdi-flex fdi-flex-col",e),children:[zn("div",{className:"fdi-h-[32px] fdi-flex fdi-justify-between fdi-items-center",children:[Ye("div",{className:"fdi-component-title-sm",children:at("FDI_Data_Preview")}),zn("div",{children:[s&&Ye("span",{children:at("FDI_Data_Update_Please_Refresh")}),Ye(jr,{type:"text",icon:Ye(Fa,{name:"icon-refresh"}),onClick:()=>{d(),c(!1)},children:at("FDI_Refresh")})]})]}),Ye("div",{className:"fdi-component-flex-h-fill-layout",children:!Te.isNil(t.fields)&&!Te.isEmpty(t.fields)&&Ye(bgt,{hasSegment:!1,defaultActiveTab:FX.PREVIEW,editable:!1,emptyContent:Ye(lw,{description:at("BI-Conf_Calculate_Result_Is_Empty"),image:Ye(Fa,{size:130,name:"svg-empty_widget1"})}),fields:r,data:a,pageInfo:i,onLoadData:f=>d(f)})})]})}),Dbt=Zl(({data:e,onChange:t,onValueChange:r})=>{const{name:n,value:a,type:o,group:i}=e;return zn(fg,{className:"fdi-parameter-table-column fdi-component-border-1 fdi-bg-neutral-light-0 fdi-rounded fdi-py-[6px]",gutter:16,children:[Ye(Hc,{span:12,children:Ye(yd,{className:"fdi-parameter-table-column-name fdi-leading-[28px]",text:n,icon:{name:ibt[i]}})}),Ye(Hc,{span:12,children:Ye(dQ,{onChange:l=>{t(l)},value:{value:a,type:o},onValueChange:l=>{r?.(l)}})})]})}),Ibt=()=>({rowProps:{gutter:16},columns:[{name:at("PARAMETER_NAME"),colProps:{span:12}},{name:at("PARAMETER_VALUE"),colProps:{span:12}}]}),Fbt=Zl(({parameters:e,onChange:t,onValueChange:r})=>Ye(gl,{children:e?.length>0?Ye(Fgt,{className:"fdi-parameter-table fdi-component-border-1 fdi-pt-xs fdi-px-[16px] fdi-pb-lg",header:Ibt(),content:Ye(MC,{direction:"vertical",size:6,children:e.map((n,a)=>{const{name:o,value:i}=n;return Ye(Dbt,{data:n,onChange:l=>{t(e.map(s=>s.name===o?{...s,type:l.type,value:l.value}:s))},onValueChange:l=>{r(l)}},i+a)})})}):Ye(lw,{className:"fdi-parameter-table-empty fdi-bg-neutral-light-1 fdi-rounded fdi-component-border-1 fdi-h-[40px]",iconName:"",text:at("SEARCH_RESULT_NONE")})})),$bt=Zl(({onChange:e})=>{const t=rv(),[r,n]=m.useState(Te.isEmpty(t.parameters)?tbt:{authority:!0,parameters:t.parameters}),[a,o]=m.useState(0),i=s=>{const{parameters:c}=s;n(s),t.setParameters(c)},l=()=>{if(!Te.isEmpty(t.parameters))return Promise.resolve([]);const s=t.originSourceInfo?.nodes;return Te.isEmpty(s)||Te.isNil(s)?Promise.resolve([]):Vxt({items:s.map(c=>({id:c.id,resourceType:c.value.itemType}))}).then(c=>{t.setOriginSqlParameters(c);const d=[];return c.forEach(f=>{f.values?.forEach(v=>{let h;switch(v.type){case na.DATE:case na.DATE_TIME:h=Lt.Date;break;case na.NUMBER:h=Lt.Integer;break;case na.STRING:default:h=Lt.String;break}d.push({name:v.name,value:v.value,type:h,group:Us.Sql,tableName:f.tableName})})}),d})};return m.useEffect(()=>{l().then(s=>{const c=t.parameters?.filter(f=>f.group===Us.Filter)||[],d={...s,parameters:[...s,...c]};i(d),e?.(!1)})},[a]),zn(gl,{children:[zn("div",{className:"fdi-preview-head fdi-flex fdi-justify-between fdi-items-center fdi-leading-[28px]",children:[Ye("span",{className:"fdi-preview-head-title fdi-leading-sm",children:at("PARAMETER")}),Ye(jr,{type:"text",className:"fdi-preview-head-refresh fdi-text-brand-light-6 fdi-py-[3px] fdi-px-xl",onClick:()=>o(a+1),children:Ye(yd,{text:at("FDI_Refresh"),icon:{name:"icon-refresh"}})})]}),Ye("div",{className:"fdi-parameter-container fdi-mt-sm",children:Ye(Fbt,{parameters:t.parameters,onChange:s=>{i({...r,parameters:s})},onValueChange:s=>{s&&e?.(!0)}},a)})]})}),Sbt=Zl(({data:e,isEdit:t,onClickChangeButton:r})=>{const n=rv();return m.useEffect(()=>{!window.dc&&(window.dc={}),window.dc.update=()=>JSON.stringify(n.dataChooseSaveInfo)},[n.dataChooseSaveInfo]),wm(()=>e.type===Ea.DIMENSION_INDICATOR?Promise.resolve(e.nodes.map(a=>({id:a.id,name:a.name,type:a.value.type,fieldType:a.value.type,resourceType:a.value.itemType}))):e.type===Ea.BUSINESS_MODEL?nQ(e.nodes[0].id).then(a=>a.itemInfos.map(o=>({...o,type:o.fieldType}))):Wxt(e.nodes[0].id).then(a=>a.fields.map(o=>({id:o.id,name:o.name,type:o.type,fieldType:o.type,resourceType:sr.FIELD}))),{onSuccess:a=>{n.setFields(a),n.setEngineType(e.nodes[0].value.engineType??tl.SPIDER)}}),zn("div",{className:"fdi-component-flex-col-layout fdi-p-lg fdi-gap-xl",children:[zn("div",{className:"fdi-flex fdi-items-center fdi-gap-xl",children:[Ye("div",{children:at("FDI_Name")}),Ye(Fq,{className:"fdi-component-flex-w-fill-layout",defaultValue:n.dsName,checkError:a=>ow(a,[],Bl.NAME),validateHelp:a=>iw(a,[],Bl.NAME),placeholder:at("FDI_Please_Input"),onSave:a=>{n.setDsName(a)}})]}),!Te.isNil(n.fields)&&Ye(gl,{children:zn("div",{className:"fdi-component-flex-h-fill-layout fdi-flex fdi-gap-xl",children:[Ye("div",{className:"fdi-w-[160px]",children:!Te.isEmpty(n.fields)&&Ye(EX,{type:"fdi.data.group.table.field",hasChange:t,fields:Te.cloneDeep(n.fields),onClickChangeButton:r})}),zn("div",{className:"fdi-component-flex-w-fill-layout fdi-overflow-auto",children:[Ye(ybt,{className:"fdi-w-full fdi-h-[120px]"}),Ye(wbt,{className:"fdi-h-[420px]"}),Ye(xbt,{className:"fdi-w-full"}),Ye($bt,{})]})]})})]})}),Ebt=Zl(()=>{const e=rv(),t=["choose","processing"],[r,n]=m.useState(0),[a,o]=m.useState(!1),i=t[r],l=m.useRef(!1);cw(()=>{s()}),Vl(()=>{if(l.current){l.current=!1;return}e.reset()},[e.originSourceInfo]);const s=async()=>{const{data:d}=window.dc;if(d){const f=JSON.parse(d);if(e.setDsName(f.dsName??""),Te.isNil(f.source))return;o(!0),e.setEngineType(f.source.engineType??tl.SPIDER),e.setFilterCondition(f.filter??{}),e.setParameters(f.parameters??[]);const{queryView:v}=f;if(v.type===uD.DETAIL?e.setFields(v.fields??[]):(v.dimensions&&e.setDimensions(v.dimensions),v.view&&e.setView(v.view)),f.source.type===Ea.TABLE&&e.setOriginSourceInfo({type:Ea.TABLE,nodes:[{id:f.source.tableNames[0],nodeType:et.DATA_TABLE,engineType:f.source.engineType,value:{engineType:f.source.engineType,itemType:sr.TABLE}}]}),f.source.type===Ea.BUSINESS_MODEL&&e.setOriginSourceInfo({type:Ea.BUSINESS_MODEL,nodes:[{id:f.source.businessModelIds[0],nodeType:et.BUSINESS_MODEL,engineType:f.source.engineType,value:{engineType:f.source.engineType,itemType:sr.BUSINESS_MODEL}}]}),f.source.type===Ea.DIMENSION_INDICATOR){const{dimensionIds:h,indicatorIds:g}=f.source,w=(await qxt({items:g.map(x=>({id:x,resourceType:sr.INDICATOR})).concat(h.map(x=>({id:x,resourceType:sr.DIMENSION})))})).itemInfos.map(x=>({id:x.id,name:x.name,nodeType:x.resourceType===sr.INDICATOR?et.INDICATOR:et.DIMENSION,engineType:f.source.engineType,value:{engineType:f.source.engineType,type:x.fieldType,itemType:x.resourceType}}));e.setOriginSourceInfo({type:Ea.DIMENSION_INDICATOR,nodes:w})}n(1),l.current=!0}};return zn("div",{className:"fdi-data-choose-page fdi-component-flex-col-layout",children:[Ye("div",{className:"fdi-component-flex-h-fill-layout",children:(()=>{switch(i){case"choose":return Ye(ebt,{data:e.originSourceInfo,onChange:d=>{e.setOriginSourceInfo(d)}});case"processing":return Ye(Sbt,{isEdit:a,data:e.originSourceInfo,onClickChangeButton:()=>{e.setOriginSourceInfo(void 0),n(0),o(!1)}})}})()}),zn("div",{className:"fdi-flex fdi-justify-end fdi-gap-md fdi-p-lg",children:[Ye(jr,{size:"small",type:"negative",onClick:()=>{window.dcHelper.cancelAction()},children:at("FDI_Cancel")}),r{n(r+1)},children:at("FDI_Next_Step")}),r!==0&&!a&&Ye(jr,{size:"small",type:r===t.length-1?"normal":"primary",onClick:()=>{n(r-1)},children:at("FDI_Previous_Step")}),r===t.length-1&&Ye(jr,{disabled:Te.isEmpty(e.dsName)||Te.isNil(e.dsName),size:"small",type:"primary",onClick:()=>{window.dcHelper.okAction()},children:at("FDI_Finish")})]})]})}),Cbt=()=>{const e=document.getElementById("fdi-data-choose");e&&eQ(e).render(Ye(dft,{...Dft(),children:Ye(Ebt,{})}))};(()=>{window.FDI=window.FDI||{},window.FDI.request=_i})(),Eae(),Fae(),Cbt()}); -/*! time: 2024/8/23 17:25:52; branch: fbp/release commit: 0f0ed89c79 */ +/*! time: 2024/8/24 18:36:57; branch: fbp/release commit: 9e54c4aa87 */ window.FineDataIntegrationJs=window.FineDataIntegrationJs||{},window.FineDataIntegrationJs.datachoose=function(e){var t={};function n(o){if(t[o])return t[o].exports;var a=t[o]={i:o,l:!1,exports:{}};return e[o].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(o,a,function(t){return e[t]}.bind(null,a));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";n.d(t,"e",(function(){return a})),n.d(t,"d",(function(){return i})),n.d(t,"f",(function(){return r})),n.d(t,"a",(function(){return s})),n.d(t,"c",(function(){return l})),n.d(t,"b",(function(){return c}));var o=BI.Decorators,a=o.shortcut,i=o.model,r=o.store,s=o.Model,l=o.mixins,c=o.mixin;o.provider},function(e,t,n){var o=n(4);e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,o(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function n(t,o){return e.exports=n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,n(t,o)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){},,function(e,t,n){e.exports=n(19)},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);n(5);var o,a,i,r,s=n(1),l=n.n(s),c=n(3),u=n.n(c),d=n(0),p=n.n(d),I=(n(8),n(2)),f=function(e){return e[e.NONE=0]="NONE",e[e.STRING=16]="STRING",e[e.NUMBER=32]="NUMBER",e[e.DATE=48]="DATE",e}({}),g=function(e){return e.SPIDER="spider",e.DIRECT="direct",e}({}),m=function(e){return e[e.CLICK=0]="CLICK",e[e.CONTROL_CLICK=1]="CONTROL_CLICK",e[e.SHIFT_CLICK=2]="SHIFT_CLICK",e}({}),h=function(e){return e.DIMENSION1="10000",e.DIMENSION2="20000",e.TARGET1="30000",e}({}),E=function(e){return e[e.EMPTY=0]="EMPTY",e[e.CONTENT=1]="CONTENT",e[e.LOADING=2]="LOADING",e}({}),B={STYLE:{AUTO:1,DIGIT:2,PERCENT:3},LEVEL:{NORMAL:1,TEN_THOUSAND:2,MILLION:3,BILLION:4,PERCENT:5,THOUSAND:6},DECIMAL:{NORMAL:-1,ZERO2POINT:0,ONE2POINT:1,TWO2POINT:2},DEFAULT_FORMAT_DECIMAL:2,DEMO_NUMBER:2e7},v=function(e){return e[e.DATA_CATALOG=1]="DATA_CATALOG",e[e.MODEL_CENTER=2]="MODEL_CENTER",e}({}),y=(p()(p()({},v.DATA_CATALOG,"FDI_Data_Catalog"),v.MODEL_CENTER,"FDI_Model_Center"),n(9),Object(I.e)()((a=function(e){function t(){for(var t,n=arguments.length,o=new Array(n),a=0;a1&&(a=IntegrationI18n.getLocale("BI-Conf_Total")+r+IntegrationI18n.getLocale("BI-Conf_Number_Of_Fields"));var s=BI.createWidget(BI.h(y,{extraCls:"dimension-capsule-helper bi-capsule-border bi-field-drag-helper field-draggable bi-card ".concat(o.getFieldCls(t)),width:120,height:20,data:{fields:i},text:a,textAlign:"left"}));return BI.createWidget(BI.h(BI.DefaultLayout,{element:"body"},s)),s.element}}},n.getFieldCls=function(e){switch(e){case f.STRING:return"string-field-helper";case f.NUMBER:return"number-field-helper";case f.DATE:return"date-field-helper";default:return""}},n.mapItems=function(e){var t=this,n=BI.map(e,"value"),o=[];return BI.map(e,(function(e,a){var i=a.text;return BI.extend(a,{drag:t.createDrag(i,a.fieldType,a.value),listeners:[{eventName:x.EVENT.CHANGE,action:function(e,a){var i=t.getMouseHotKey(a),r=t.list.getValue();switch(i){case m.CLICK:o=[e],t.list.setValue(e);break;case m.CONTROL_CLICK:BI.remove(o,e),BI.contains(r,e)&&o.push(e);break;case m.SHIFT_CLICK:var s=BI.indexOf(n,BI.last(o)||0),l=BI.indexOf(n,e),c=BI.filter(n,(function(e){return e>=s&&e<=l||e>=l&&e<=s}));t.list.setValue(BI.concat(o,c))}}}]})}))},n.search=function(){var e=this.searcher.getValue();this.store.search(e)},n.getMouseHotKey=function(e){return null!=e&&e.ctrlKey||null!=e&&e.metaKey?m.CONTROL_CLICK:null!=e&&e.shiftKey?m.SHIFT_CLICK:m.CLICK},t}(BI.Widget),p()(L,"xtype","fdi.data.group.table.field"),R=L))||R)||R,D=Object(I.e)()((V=function(e){function t(){return e.apply(this,arguments)||this}return u()(t,e),t.prototype.render=function(){return BI.h(BI.AbsoluteLayout,null,BI.h("el",{top:0,right:0,bottom:0,left:0},this.options.children))},t}(BI.Widget),p()(V,"xtype","fdi.fix.context"),A=V))||A;n(10),n(11),n(12);function G(e,t){if(!BI.isNumeric(e))return e;var n=t,o={formatStyle:B.STYLE.AUTO,formatDecimal:B.DECIMAL.NORMAL,numLevel:B.LEVEL.NORMAL,numSeparators:!0,unit:""};BI.isNull(n)?n=o:BI.each(o,(function(e){BI.isNull(n[e])&&(n[e]=o[e])}));var a,i,r,s=parseFloat(e),l="";switch(n.formatStyle){case B.STYLE.AUTO:a=B.DECIMAL.NORMAL,i=n.numLevel,r=n.numSeparators;break;case B.STYLE.PERCENT:a=n.formatDecimal,i=B.LEVEL.PERCENT,r=n.numSeparators,l="%";break;case B.STYLE.DIGIT:default:a=n.formatDecimal,i=n.numLevel,r=n.numSeparators}s=BI.div(s,function(e){var t=1;switch(e){case B.LEVEL.THOUSAND:t=1e3;break;case B.LEVEL.TEN_THOUSAND:t=1e4;break;case B.LEVEL.MILLION:t=1e6;break;case B.LEVEL.BILLION:t=1e8;break;case B.LEVEL.PERCENT:t=.01;break;case B.LEVEL.NORMAL:default:t=1}return t}(i));var c="",u=-1,d="".concat(s);if((u=d.indexOf("e"))>-1||(u=d.indexOf("E"))>-1){c=d.slice(u);var p=BI.startWith(d,"-");d=d.slice(p?1:0,u);var I=parseInt(c.slice(1));if(I<0)for(c="",d=d.replace(".","");I++<0;)d=0===I?"0.".concat(d):"0".concat(d);p&&(d="-".concat(d))}var f=function(e,t){var n=t?"#,###.":"#0.",o=[];switch(e){case B.DECIMAL.NORMAL:return t?"#,###.##":"#.##";case B.DECIMAL.ZERO2POINT:return t?"#,###":"#0";default:for(var a=0;a-.01&&g<.01)return function(e){var t="".concat(e),n=BI.startWith(t,"-"),o=n?-1*e:e;if(t.indexOf("e")>-1||t.indexOf("E")>-1){var a="".concat(o),i="",r="";return a.indexOf("e")>-1&&(i=a.slice(0,a.indexOf("e")),r=a.slice(a.indexOf("e"))),a.indexOf("E")>-1&&(i=a.slice(0,a.indexOf("E")),r=a.slice(a.indexOf("E"))),(n?"-":"")+G(i,{})+r}if(0===o)return t;Math.log10=Math.log10||function(e){return Math.log(e)*Math.LOG10E};var s=Math.floor(Math.log10(o)),l=o*Math.pow(10,-s);return"".concat((n?"-":"")+G(l,{}),"e").concat(s)}(g);var m=BI.contentFormat(d,f);return n.formatStyle===B.STYLE.AUTO&&m.indexOf(".")>-1&&"0"===m[m.length-1]&&(m=m.substring(0,m.length-1)),"".concat(m).concat(c).concat(l)}function w(e,t){for(var n=BI.size(e),o=BI.size(t),a={},i=0;i=parseFloat(t.min):parseFloat(e.max)>parseFloat(t.min):""!==e.min&&""===e.max&&""!==t.min&&""!==t.max?e.closeMin&&t.closeMax?parseFloat(e.min)<=parseFloat(t.max):parseFloat(e.min)=parseFloat(t.min):parseFloat(e.max)>parseFloat(t.min):""===e.min&&""===e.max)}var U=function(e){return e[e.SINGLE=1]="SINGLE",e[e.DOUBLE=2]="DOUBLE",e[e.GROUP=3]="GROUP",e}({}),P=function(e){return e[e.AUTO=1]="AUTO",e[e.CUSTOM=2]="CUSTOM",e[e.CUSTOM_STRING=3]="CUSTOM_STRING",e}({}),H=function(e){return e[e.GROUP_BY_VALUE=1]="GROUP_BY_VALUE",e[e.GROUP_BY_CUSTOM=2]="GROUP_BY_CUSTOM",e[e.COUNT=3]="COUNT",e[e.RECORD_COUNT=4]="RECORD_COUNT",e[e.APPEND=5]="APPEND",e[e.RENAME=6]="RENAME",e[e.DELETE=7]="DELETE",e[e.APPROXIMATE_DISTINCT_COUNT=27]="APPROXIMATE_DISTINCT_COUNT",e[e.GROUP_FORMULA=40]="GROUP_FORMULA",e}({}),F=function(e){return e[e.GROUP_BY_VALUE=1]="GROUP_BY_VALUE",e[e.CUSTOM_NUMBER_GROUP=2]="CUSTOM_NUMBER_GROUP",e[e.SUM=8]="SUM",e[e.AVG=9]="AVG",e[e.MEDIAN=10]="MEDIAN",e[e.MAX=11]="MAX",e[e.MIN=12]="MIN",e[e.STANDARD_DEVIATION=13]="STANDARD_DEVIATION",e[e.VARIANCE=14]="VARIANCE",e[e.COUNT=15]="COUNT",e[e.RECORD_COUNT=16]="RECORD_COUNT",e[e.NONE=17]="NONE",e[e.PERIOD=18]="PERIOD",e[e.RING=19]="RING",e[e.PERIOD_RATE=20]="PERIOD_RATE",e[e.RING_RATE=21]="RING_RATE",e[e.PERIOD_INCREMENT=36]="PERIOD_INCREMENT",e[e.RING_INCREMENT=37]="RING_INCREMENT",e[e.PERIOD_OR_RING=38]="PERIOD_OR_RING",e[e.YEAR=22]="YEAR",e[e.QUARTER=23]="QUARTER",e[e.MONTH=24]="MONTH",e[e.WEEK=25]="WEEK",e[e.WEEKDAY=26]="WEEKDAY",e[e.APPROXIMATE_DISTINCT_COUNT=33]="APPROXIMATE_DISTINCT_COUNT",e[e.RENAME=27]="RENAME",e[e.DELETE=28]="DELETE",e[e.GROUP_FORMULA=40]="GROUP_FORMULA",e}({}),Y=function(e){return e[e.DATE=5]="DATE",e[e.YEAR=6]="YEAR",e[e.QUARTER=7]="QUARTER",e[e.MONTH=8]="MONTH",e[e.WEEKDAY=9]="WEEKDAY",e[e.DAY=10]="DAY",e[e.MORE_GROUP=11]="MORE_GROUP",e[e.WEEK_COUNT=12]="WEEK_COUNT",e[e.HOUR=13]="HOUR",e[e.MINUTE=14]="MINUTE",e[e.SECOND=15]="SECOND",e[e.YQ=16]="YQ",e[e.YM=17]="YM",e[e.YW=18]="YW",e[e.YMDH=19]="YMDH",e[e.YMDHM=20]="YMDHM",e[e.YMDHMS=21]="YMDHMS",e[e.MONTH_DAY=48]="MONTH_DAY",e[e.COUNT=29]="COUNT",e[e.RECORD_COUNT=30]="RECORD_COUNT",e[e.ET=31]="ET",e[e.LT=32]="LT",e[e.APPROXIMATE_DISTINCT_COUNT=35]="APPROXIMATE_DISTINCT_COUNT",e[e.RANK=36]="RANK",e[e.ASC=37]="ASC",e[e.DESC=38]="DESC",e[e.RENAME=33]="RENAME",e[e.DELETE=34]="DELETE",e[e.GROUP_FORMULA=40]="GROUP_FORMULA",e}({}),j=function(e){return e[e.GROUP=0]="GROUP",e[e.SUMMARY=1]="SUMMARY",e}({}),W={},K={};function q(){return W=p()(p()(p()({},f.STRING,[[{text:IntegrationI18n.getLocale("BI-Basic_Same_Value_A_Group"),value:H.GROUP_BY_VALUE,$testId:"bi-conf-pack-analysis-group-string-same",bubble:IntegrationI18n.getLocale("BI-Basic_Ensure_Group_By_Value"),cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Custom_Grouping_Dot"),$testId:"bi-conf-pack-analysis-group-string-custom",value:H.GROUP_BY_CUSTOM,cls:"dot-e-font"}],[{text:IntegrationI18n.getLocale("BI-Basic_Rename"),$testId:"bi-conf-pack-analysis-group-string-rename",value:H.RENAME,cls:"rename-font"}],[{text:IntegrationI18n.getLocale("BI-Basic_Remove"),$testId:"bi-conf-pack-analysis-group-string-delete",value:H.DELETE,cls:"delete-font"}]]),f.NUMBER,[[{text:IntegrationI18n.getLocale("BI-Basic_Same_Value_A_Group"),$testId:"bi-conf-pack-analysis-analysis-number-group-by-value",value:F.GROUP_BY_VALUE,bubble:IntegrationI18n.getLocale("BI-Conf_Move_To_Same_Value_Info_Missing"),cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Grouping_Setting"),$testId:"bi-conf-pack-analysis-analysis-number-custom-number-group",value:F.CUSTOM_NUMBER_GROUP,cls:"dot-e-font"}],[{text:IntegrationI18n.getLocale("BI-Basic_Rename"),$testId:"bi-conf-pack-analysis-analysis-number-rename",value:F.RENAME,cls:"rename-font"}],[{text:IntegrationI18n.getLocale("BI-Basic_Remove"),$testId:"bi-conf-pack-analysis-analysis-number-delete",value:F.DELETE,cls:"delete-font"}]]),f.DATE,[[{text:IntegrationI18n.getLocale("BI-Basic_YMD_Date"),$testId:"bi-conf-pack-analysis-group-date-tmd",value:Y.DATE,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Year_Week"),$testId:"bi-conf-pack-analysis-group-date-year-week",value:Y.YW,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Year_Month"),$testId:"bi-conf-pack-analysis-group-date-year-month",value:Y.YM,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Year_Quarter"),$testId:"bi-conf-pack-analysis-group-date-year-quarter",value:Y.YQ,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Multi_Date_Year"),value:Y.YEAR,$testId:"bi-conf-pack-analysis-group-date-year",cls:"dot-e-font"},{el:{text:IntegrationI18n.getLocale("BI-Basic_More_Group"),$testId:"bi-conf-pack-analysis-group-date-more-group",value:Y.MORE_GROUP,iconCls1:"dot-e-font"},children:[{text:IntegrationI18n.getLocale("BI-Basic_Quarter"),$testId:"bi-conf-pack-analysis-group-date-quarter",value:Y.QUARTER,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Month_Fen"),$testId:"bi-conf-pack-analysis-group-date-month",value:Y.MONTH,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Month_Day"),$testId:"bi-conf-pack-analysis-group-date-month-day",value:Y.MONTH_DAY,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Week_Count"),$testId:"bi-conf-pack-analysis-group-date-week-count",value:Y.WEEK_COUNT,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Week_XingQi"),$testId:"bi-conf-pack-analysis-group-date-week",value:Y.WEEKDAY,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Date_Day"),$testId:"bi-conf-pack-analysis-group-date-day",value:Y.DAY,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Hour_Sin"),$testId:"bi-conf-pack-analysis-group-date-hour",value:Y.HOUR,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Minute"),$testId:"bi-conf-pack-analysis-group-date-minute",value:Y.MINUTE,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Seconds"),$testId:"bi-conf-pack-analysis-group-date-second",value:Y.SECOND,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_YMDH"),$testId:"bi-conf-pack-analysis-group-date-ymdh",value:Y.YMDH,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_YMDHM"),$testId:"bi-conf-pack-analysis-group-date-ymdhm",value:Y.YMDHM,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Detail_Date"),$testId:"bi-conf-pack-analysis-group-date-ymdhms",value:Y.YMDHMS,cls:"dot-e-font"}]}],[{text:IntegrationI18n.getLocale("BI-Basic_Rename"),value:Y.RENAME,$testId:"bi-conf-pack-analysis-group-date-rename",cls:"rename-font"}],[{text:IntegrationI18n.getLocale("BI-Basic_Remove"),value:Y.DELETE,$testId:"bi-conf-pack-analysis-group-date-delete",cls:"delete-font"}]]),K=p()(p()(p()({},f.STRING,[[{text:IntegrationI18n.getLocale("BI-Basic_No_Repeat_Count"),$testId:"bi-conf-pack-analysis-analysis-string-count",value:H.COUNT,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Record_Count"),$testId:"bi-conf-pack-analysis-analysis-string-record-count",value:H.RECORD_COUNT,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_String_Summary_By_Connection"),$testId:"bi-conf-pack-analysis-analysis-string-append",value:H.APPEND,cls:"dot-e-font"}],[{text:IntegrationI18n.getLocale("BI-Basic_Rename"),$testId:"bi-conf-pack-analysis-analysis-string-rename",value:H.RENAME,cls:"rename-font"}],[{text:IntegrationI18n.getLocale("BI-Basic_Remove"),$testId:"bi-conf-pack-analysis-analysis-string-delete",value:H.DELETE,cls:"delete-font"}]]),f.NUMBER,[[{text:IntegrationI18n.getLocale("BI-Basic_Calculate_Sum"),$testId:"bi-conf-pack-analysis-analysis-number-sum",value:F.SUM,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Calculate_Avg"),$testId:"bi-conf-pack-analysis-analysis-number-avg",value:F.AVG,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Calculate_Median"),$testId:"bi-conf-pack-analysis-analysis-number-median",value:F.MEDIAN,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Calculate_Max"),$testId:"bi-conf-pack-analysis-analysis-number-max",value:F.MAX,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Calculate_Min"),$testId:"bi-conf-pack-analysis-analysis-number-min",value:F.MIN,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Calculate_Standard_Deviation"),$testId:"bi-conf-pack-analysis-analysis-number-standard-deviation",value:F.STANDARD_DEVIATION,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Calculate_Variance"),$testId:"bi-conf-pack-analysis-analysis-number-variance",value:F.VARIANCE,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_No_Repeat_Count"),$testId:"bi-conf-pack-analysis-analysis-number-count",value:F.COUNT,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Record_Count"),$testId:"bi-conf-pack-analysis-analysis-number-record-count",value:F.RECORD_COUNT,cls:"dot-e-font"}],[{text:IntegrationI18n.getLocale("BI-Basic_None"),$testId:"bi-conf-pack-analysis-analysis-number-none",value:F.NONE,cls:"dot-e-font"},{el:{text:"".concat(IntegrationI18n.getLocale("BI-Basic_Calculate_Same_Period_Rate"),"/").concat(IntegrationI18n.getLocale("BI-Basic_Calculate_Same_Ring_Rate")),value:F.PERIOD_OR_RING},children:[{el:{text:IntegrationI18n.getLocale("BI-Basic_Calculate_Same_Period"),$testId:"bi-conf-pack-analysis-analysis-number-same-period",value:F.PERIOD},children:z()},{el:{text:IntegrationI18n.getLocale("BI-Basic_Calculate_Same_Period_Growth_Value"),value:F.PERIOD_INCREMENT},children:z()},{el:{text:IntegrationI18n.getLocale("BI-Basic_Calculate_Same_Period_Growth_Rate"),$testId:"bi-conf-pack-analysis-analysis-number-period-rate",value:F.PERIOD_RATE},children:z()},{text:IntegrationI18n.getLocale("BI-Basic_Calculate_Same_Ring"),value:F.RING,$testId:"bi-conf-pack-analysis-analysis-number-same-ring",cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Calculate_Same_Ring_Growth_Value"),value:F.RING_INCREMENT,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Calculate_Same_Ring_Growth_Rate"),$testId:"bi-conf-pack-analysis-analysis-number-ring-rate",value:F.RING_RATE,cls:"dot-e-font"}]}],[{text:IntegrationI18n.getLocale("BI-Basic_Rename"),$testId:"bi-conf-pack-analysis-analysis-number-rename",value:F.RENAME,cls:"rename-font"}],[{text:IntegrationI18n.getLocale("BI-Basic_Remove"),$testId:"bi-conf-pack-analysis-analysis-number-delete",value:F.DELETE,cls:"delete-font"}]]),f.DATE,[[{text:IntegrationI18n.getLocale("BI-Basic_No_Repeat_Count"),$testId:"bi-conf-pack-analysis-analysis-date-count",value:Y.COUNT,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Record_Count"),$testId:"bi-conf-pack-analysis-analysis-date-record-count",value:Y.RECORD_COUNT,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Earliest_Time"),$testId:"bi-conf-pack-analysis-analysis-date-et",value:Y.ET,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Latest_Time"),$testId:"bi-conf-pack-analysis-analysis-date-lt",value:Y.LT,cls:"dot-e-font"}],[{text:IntegrationI18n.getLocale("BI-Basic_Rename"),$testId:"bi-conf-pack-analysis-analysis-date-rename",value:Y.RENAME,cls:"rename-font"}],[{text:IntegrationI18n.getLocale("BI-Basic_Remove"),$testId:"bi-conf-pack-analysis-analysis-date-delete",value:Y.DELETE,cls:"delete-font"}]]),[W,K]}function z(){return[{text:IntegrationI18n.getLocale("BI-Basic_Multi_Date_Year"),$testId:"bi-conf-pack-analysis-analysis-number-year",value:F.YEAR,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Quarter"),$testId:"bi-conf-pack-analysis-analysis-number-quarter",value:F.QUARTER,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Multi_Date_Month"),$testId:"bi-conf-pack-analysis-analysis-number-month",value:F.MONTH,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Multi_Date_Week"),$testId:"bi-conf-pack-analysis-analysis-number-week",value:F.WEEK,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Week_XingQi"),$testId:"bi-conf-pack-analysis-analysis-number-weekday",value:F.WEEKDAY,cls:"dot-e-font"}]}p()(p()(p()({},f.STRING,p()(p()(p()({},H.GROUP_BY_VALUE,p()({},f.NUMBER,F.GROUP_BY_VALUE)),H.COUNT,p()(p()({},f.NUMBER,F.COUNT),f.DATE,Y.COUNT)),H.RECORD_COUNT,p()(p()({},f.NUMBER,F.RECORD_COUNT),f.DATE,Y.RECORD_COUNT))),f.NUMBER,p()(p()(p()({},F.GROUP_BY_VALUE,p()({},f.STRING,H.GROUP_BY_VALUE)),F.COUNT,p()(p()({},f.STRING,H.COUNT),f.DATE,Y.COUNT)),F.RECORD_COUNT,p()(p()({},f.STRING,H.RECORD_COUNT),f.DATE,Y.RECORD_COUNT))),f.DATE,p()(p()({},Y.COUNT,p()(p()({},f.STRING,H.COUNT),f.NUMBER,F.COUNT)),Y.RECORD_COUNT,p()(p()({},f.STRING,H.RECORD_COUNT),f.NUMBER,F.RECORD_COUNT)));var Q="YEAR",X="MONTH",J="WEEK",Z="QUARTER",ee="DAY";function te(e,t){return BI.some(e,(function(e,n){return!BI.contains(t,n)}))}function ne(e,t){var n=!0;return BI.each(t,(function(t,o){n=n&&BI.contains(e,o)})),n}function oe(e,t){return BI.some(t,(function(t,n){return BI.contains(e,n)}))}function ae(e){return!te(BI.uniq(e),[Y.YW])}function ie(e){var t=BI.uniq(e);return!te(e,[Y.YQ,Y.YEAR,Y.QUARTER])&&(!!BI.contains(t,Y.YQ)||ne(t,[Y.YEAR,Y.QUARTER]))}function re(e){var t=BI.uniq(e);return ne(t,[Y.YW,Y.WEEKDAY])||ne(t,[Y.YEAR,Y.WEEK_COUNT,Y.WEEKDAY])}function se(e){return ae(e)||ie(e)||function(e){var t=BI.uniq(e);return!te(e,[Y.YQ,Y.YEAR,Y.QUARTER,Y.YM,Y.MONTH])&&(!!BI.contains(t,Y.YM)||oe(t,[Y.YEAR,Y.YQ])&&BI.contains(t,Y.MONTH))}(e)?[Q]:oe(e,[Y.DAY,Y.DATE,Y.MONTH_DAY])?function(e){var t=BI.uniq(e);return ne(t,[Y.YM,Y.DAY])||ne(t,[Y.DATE])||ne(t,[Y.YEAR,Y.MONTH,Y.DAY])}(e)?[Q,Z,X,J]:[]:re(e)?[Q,J]:[]}function le(e){return function(e){return!te(BI.uniq(e),[Y.YEAR])}(e)?[Q]:ie(e)?[Z]:ae(e)?[J]:function(e){var t=BI.uniq(e);return!te(t,[Y.YEAR,Y.MONTH,Y.YQ,Y.YM,Y.QUARTER])&&(ne(t,[Y.YEAR,Y.MONTH,Y.QUARTER])||ne(t,[Y.YM,Y.QUARTER])||ne(t,[Y.YQ,Y.MONTH])||ne(t,[Y.YM])||ne(t,[Y.YEAR,Y.MONTH]))}(e)?[X]:oe(e,[Y.DATE,Y.YEAR,Y.YM,Y.YQ])&&oe(e,[Y.DATE,Y.YM,Y.MONTH])&&oe(e,[Y.DATE,Y.DAY])||re(e)?[ee]:[]}var ce,ue,de={},pe={};function Ie(){return de[f.STRING]=[[{text:IntegrationI18n.getLocale("BI-Basic_Same_Value_A_Group"),value:H.GROUP_BY_VALUE,$testId:"bi-conf-pack-analysis-group-string-same",bubble:IntegrationI18n.getLocale("BI-Basic_Ensure_Group_By_Value"),cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Custom_Grouping_Dot"),$testId:"bi-conf-pack-analysis-group-string-custom",value:H.GROUP_BY_CUSTOM,cls:"dot-e-font"}],[{text:IntegrationI18n.getLocale("BI-Basic_Rename"),$testId:"bi-conf-pack-analysis-group-string-rename",value:H.RENAME,cls:"rename-font"}],[{text:IntegrationI18n.getLocale("BI-Basic_Remove"),$testId:"bi-conf-pack-analysis-group-string-delete",value:H.DELETE,cls:"delete-font"}]],de[f.NUMBER]=[[{text:IntegrationI18n.getLocale("BI-Basic_Same_Value_A_Group"),$testId:"bi-conf-pack-analysis-analysis-number-group-by-value",value:F.GROUP_BY_VALUE,bubble:IntegrationI18n.getLocale("BI-Conf_Move_To_Same_Value_Info_Missing"),cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Grouping_Setting"),$testId:"bi-conf-pack-analysis-analysis-number-custom-number-group",value:F.CUSTOM_NUMBER_GROUP,cls:"dot-e-font"}],[{text:IntegrationI18n.getLocale("BI-Basic_Rename"),$testId:"bi-conf-pack-analysis-analysis-number-rename",value:F.RENAME,cls:"rename-font"}],[{text:IntegrationI18n.getLocale("BI-Basic_Remove"),$testId:"bi-conf-pack-analysis-analysis-number-delete",value:F.DELETE,cls:"delete-font"}]],de[f.DATE]=[[{text:IntegrationI18n.getLocale("BI-Basic_YMD_Date"),$testId:"bi-conf-pack-analysis-group-date-tmd",value:Y.DATE,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Year_Week"),$testId:"bi-conf-pack-analysis-group-date-year-week",value:Y.YW,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Year_Month"),$testId:"bi-conf-pack-analysis-group-date-year-month",value:Y.YM,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Year_Quarter"),$testId:"bi-conf-pack-analysis-group-date-year-quarter",value:Y.YQ,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Multi_Date_Year"),value:Y.YEAR,$testId:"bi-conf-pack-analysis-group-date-year",cls:"dot-e-font"},{el:{text:IntegrationI18n.getLocale("BI-Basic_More_Group"),$testId:"bi-conf-pack-analysis-group-date-more-group",value:Y.MORE_GROUP,cls:"dot-e-font"},children:[{text:IntegrationI18n.getLocale("BI-Basic_Quarter"),$testId:"bi-conf-pack-analysis-group-date-quarter",value:Y.QUARTER,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Month_Fen"),$testId:"bi-conf-pack-analysis-group-date-month",value:Y.MONTH,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Month_Day"),$testId:"bi-conf-pack-analysis-group-date-month-day",value:Y.MONTH_DAY,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Week_Count"),$testId:"bi-conf-pack-analysis-group-date-week-count",value:Y.WEEK_COUNT,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Week_XingQi"),$testId:"bi-conf-pack-analysis-group-date-week",value:Y.WEEKDAY,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Date_Day"),$testId:"bi-conf-pack-analysis-group-date-day",value:Y.DAY,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Hour_Sin"),$testId:"bi-conf-pack-analysis-group-date-hour",value:Y.HOUR,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Minute"),$testId:"bi-conf-pack-analysis-group-date-minute",value:Y.MINUTE,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Seconds"),$testId:"bi-conf-pack-analysis-group-date-second",value:Y.SECOND,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_YMDH"),$testId:"bi-conf-pack-analysis-group-date-ymdh",value:Y.YMDH,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_YMDHM"),$testId:"bi-conf-pack-analysis-group-date-ymdhm",value:Y.YMDHM,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Detail_Date"),$testId:"bi-conf-pack-analysis-group-date-ymdhms",value:Y.YMDHMS,cls:"dot-e-font"}]}],[{text:IntegrationI18n.getLocale("BI-Basic_Rename"),value:Y.RENAME,$testId:"bi-conf-pack-analysis-group-date-rename",cls:"rename-font"}],[{text:IntegrationI18n.getLocale("BI-Basic_Remove"),value:Y.DELETE,$testId:"bi-conf-pack-analysis-group-date-delete",cls:"delete-font"}]],pe[f.STRING]=[[{text:IntegrationI18n.getLocale("BI-Basic_No_Repeat_Count"),$testId:"bi-conf-pack-analysis-analysis-string-count",value:H.COUNT,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Approximate_Distinct_Count"),$testId:"bi-conf-pack-analysis-analysis-string-distinct-count",value:H.APPROXIMATE_DISTINCT_COUNT,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Record_Count"),$testId:"bi-conf-pack-analysis-analysis-string-record-count",value:H.RECORD_COUNT,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_String_Summary_By_Connection"),$testId:"bi-conf-pack-analysis-analysis-string-append",value:H.APPEND,cls:"dot-e-font"}],[{text:IntegrationI18n.getLocale("BI-Basic_Rename"),$testId:"bi-conf-pack-analysis-analysis-string-rename",value:H.RENAME,cls:"rename-font"}],[{text:IntegrationI18n.getLocale("BI-Basic_Remove"),$testId:"bi-conf-pack-analysis-analysis-string-delete",value:H.DELETE,cls:"delete-font"}]],pe[f.NUMBER]=[[{text:IntegrationI18n.getLocale("BI-Basic_Calculate_Sum"),$testId:"bi-conf-pack-analysis-analysis-number-sum",value:F.SUM,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Calculate_Avg"),$testId:"bi-conf-pack-analysis-analysis-number-avg",value:F.AVG,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Calculate_Median"),$testId:"bi-conf-pack-analysis-analysis-number-median",value:F.MEDIAN,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Calculate_Max"),$testId:"bi-conf-pack-analysis-analysis-number-max",value:F.MAX,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Calculate_Min"),$testId:"bi-conf-pack-analysis-analysis-number-min",value:F.MIN,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Calculate_Standard_Deviation"),$testId:"bi-conf-pack-analysis-analysis-number-standard-deviation",value:F.STANDARD_DEVIATION,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Calculate_Variance"),$testId:"bi-conf-pack-analysis-analysis-number-variance",value:F.VARIANCE,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_No_Repeat_Count"),$testId:"bi-conf-pack-analysis-analysis-number-count",value:F.COUNT,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Approximate_Distinct_Count"),title:IntegrationI18n.getLocale("BI-Conf_Approximate_Distinct_Count_Tooltip"),$testId:"bi-conf-pack-analysis-analysis-number-distinct-count",value:F.APPROXIMATE_DISTINCT_COUNT,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Record_Count"),$testId:"bi-conf-pack-analysis-analysis-number-record-count",value:F.RECORD_COUNT,cls:"dot-e-font"}],[{text:IntegrationI18n.getLocale("BI-Basic_Rename"),$testId:"bi-conf-pack-analysis-analysis-number-rename",value:F.RENAME,cls:"rename-font"}],[{text:IntegrationI18n.getLocale("BI-Basic_Remove"),$testId:"bi-conf-pack-analysis-analysis-number-delete",value:F.DELETE,cls:"delete-font"}]],pe[f.DATE]=[[{text:IntegrationI18n.getLocale("BI-Basic_No_Repeat_Count"),$testId:"bi-conf-pack-analysis-analysis-date-count",value:Y.COUNT,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Approximate_Distinct_Count"),$testId:"bi-conf-pack-analysis-analysis-date-distinct-count",value:Y.APPROXIMATE_DISTINCT_COUNT,title:IntegrationI18n.getLocale("BI-Conf_Approximate_Distinct_Count_Tooltip"),cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Record_Count"),$testId:"bi-conf-pack-analysis-analysis-date-record-count",value:Y.RECORD_COUNT,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Earliest_Time"),$testId:"bi-conf-pack-analysis-analysis-date-et",value:Y.ET,cls:"dot-e-font"},{text:IntegrationI18n.getLocale("BI-Basic_Latest_Time"),$testId:"bi-conf-pack-analysis-analysis-date-lt",value:Y.LT,cls:"dot-e-font"}],[{text:IntegrationI18n.getLocale("BI-Basic_Rename"),$testId:"bi-conf-pack-analysis-analysis-date-rename",value:Y.RENAME,cls:"rename-font"}],[{text:IntegrationI18n.getLocale("BI-Basic_Remove"),$testId:"bi-conf-pack-analysis-analysis-date-delete",value:Y.DELETE,cls:"delete-font"}]],[de,pe]}function fe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function ge(e){for(var t=1;t0},sameYearItems:function(){var e=BI.deepClone(t.comboList[j.SUMMARY][f.NUMBER]),n=[];return BI.some(e,(function(e,t){return BI.some(t,(function(e,t){var o;if((t.value||(null===(o=t.el)||void 0===o?void 0:o.value))===F.PERIOD_OR_RING)return n=t.children,!0}))})),BI.isEmptyArray(n)?[]:t.getItems(n,t.model.hasDateTypeInGroup,t.model.allDateGroupTypes,t.model.firstDateDimensionName)},listItems:function(){var e=t.options,n=e.handleType,o=e.fieldType,a=BI.deepClone(t.comboList[n][o]);if(t.model.labelValid){if(n!==j.SUMMARY||o!==f.NUMBER||!BI.isNotEmptyArray(t.model.sameYearItems))return a;var i=BI.deepClone(t.model.sameYearItems),r=BI.some(t.model.fields,(function(e,t){return t.type===f.DATE})),s=BI.every(i,(function(e,t){return BI.has(t,"el")?t.el.disabled:t.disabled}));return BI.some(a,(function(e,n){return BI.some(n,(function(e,n){if((n.value||n.el.value)===F.PERIOD_OR_RING)return n.children=i,n.el.disabled=s,n.el.iconCls1=s?"":"dot-e-font",n.el.warningTitle=function(){return r?t.model.hasDateTypeInGroup?IntegrationI18n.getLocale("BI-Basic_Calculate_{R1}_is_Not_Supported_To_Calculate_{R2}",t.model.firstDateDimensionName,n.el.text):IntegrationI18n.getLocale("BI-Basic_Calculate_Group_Is_Missing_Date_Fields"):IntegrationI18n.getLocale("BI-Basic_Calculate_To_Be_Analyzed_Area_Is_Missing_Date_Fields")},!0}))})),a}return BI.each(a,(function(e,t){BI.each(t,(function(n,o){e===BI.size(a)-1&&n===BI.size(t)-1||(BI.has(o,"el")?o.el.disabled=!0:o.disabled=!0)}))})),a}}),p()(l()(t),"actions",{checkPeriodValid:function(){var e=t.options,n=e.handleType,o=e.fieldType,a=t.model.sameYearItems;if(t.model.labelValid&&n===j.SUMMARY&&o===f.NUMBER){var i=!1,r=BI.deepClone(t.model.selectedValue),s=r&&r[1];if(!BI.contains(ke,BI.get(s,"value")))return void(t.model.numberPeriodError=i);var l={};BI.each(a,(function(e,t){BI.has(t,"el")?l[t.el.value]=!t.el.disabled:l[t.value]=!t.disabled}));var c=l[s.value];c&&BI.has(s,"childValue")&&(c=BI.contains(BI.map(a[0].children,"value"),s.childValue)),c||(i=!0),t.model.numberPeriodError=i}}}),t}u()(t,e);var n=t.prototype;return n.init=function(){this.comboList=this.model.engineType===g.SPIDER?q():Ie()},n.getItems=function(e,t,n,o){var a=function(){return BI.each(e,(function(e,t){BI.has(t,"el")?(t.el.disabled=!0,t.el.iconCls1=""):(t.disabled=!0,t.cls="")})),e};if(!t)return a();var i=[Y.HOUR,Y.MINUTE,Y.SECOND,Y.YMDH,Y.YMDHM,Y.YMDHMS];if(BI.some(n,(function(e,t){return BI.contains(i,t)})))return a();var r,s=(r=n,0===BI.size(r)?[]:se(r)),l=function(e){return 0===BI.size(e)?[]:le(e)}(n),c=z(),u=BI.filter(c,(function(e,t){return BI.contains(BI.reduce(s,(function(e,t){return BI.concat(t,F[e])}),[]),t.value)}));return BI.each(e,(function(e,t){BI.contains(Ge,t.value||t.el.value)?0===u.length?(t.el.disabled=!0,t.el.iconCls1="",t.el.warningTitle=IntegrationI18n.getLocale("BI-Basic_Calculate_{R1}_is_Not_Supported_To_Calculate_{R2}",o,t.el.text)):t.children=BI.deepClone(u):0===BI.size(l)&&(t.disabled=!0,t.cls="",t.warningTitle=IntegrationI18n.getLocale("BI-Basic_Calculate_{R1}_is_Not_Supported_To_Calculate_{R2}",o,t.text))})),e},t}(I.a),p()(ue,"xtype","bi.model.conf.group.operator.dimension.combo"),ce=ue))||ce,Pe=Object(I.e)()(me=Object(I.f)(Ue,{props:function(){var e=this.options;return{handleType:e.handleType,fieldType:e.fieldType,value:e.value}}})((he=function(e){function t(){for(var t,n=arguments.length,o=new Array(n),a=0;a1e3?t.lengthLabel.element.removeClass("group-count-success").addClass("group-count-failure"):t.lengthLabel.element.removeClass("group-count-failure").addClass("group-count-success")}}),t}u()(t,e);var n=t.prototype;return n.render=function(){var e=this;return{type:BI.VerticalLayout.xtype,vgap:$e,items:[{type:BI.HTapeLayout.xtype,height:Fe,items:[{el:{type:BI.VerticalAdaptLayout.xtype,items:[{type:BI.Label.xtype,text:IntegrationI18n.getLocale("BI-Basic_Group_Space"),textAlign:"left"}]},width:Ye},{type:BI.Editor.xtype,simple:!0,value:this.model.groupInterval,ref:function(t){e.spaceEditor=t},validationChecker:function(t){var n=parseFloat(t);if(!BI.isNumeric(t)||n<=0)return e.groupLengthTemp=0,!1;var o=parseFloat("".concat(e.model.gen.genMax))-parseFloat("".concat(e.model.gen.genMin));return e.groupLengthTemp=n?Math.ceil(o/n):0,e.groupLengthTemp<=1e6},errorText:function(){return e.groupLengthTemp<=1e6?IntegrationI18n.getLocale("BI-Conf_Please_Input_Positive_Number"):IntegrationI18n.getLocale("BI-Design_Current_Group_Num_Out_Of_Limit",100)},listeners:[{eventName:BI.Editor.EVENT_CHANGE,action:function(){e.store.setGroupInterval(e.getValue())}}],cls:"bi-border-bottom",height:Fe}]},{type:BI.FloatLeftLayout.xtype,vgap:$e,items:[{type:BI.Layout.xtype,width:Ye,height:Fe},{type:BI.Label.xtype,width:450,whiteSpace:"normal",$testId:"bi-component-custom-group-number-auto-group-count",cls:function(){return e.model.groupLength>1e3?"group-count-failure":"group-count-success"},textAlign:"left",ref:function(t){e.lengthLabel=t},text:this.model.lengthText}]}]}},n.getValue=function(){return this.spaceEditor.getValue()},t}(BI.Widget),p()(ye,"xtype","fdi.component.custom_group.number.auto"),ve=ye))||ve)||ve,We=(n(14),Object(I.e)()((_e=function(e){function t(){for(var t,n=arguments.length,o=new Array(n),a=0;a1e3&&(e+=",".concat(IntegrationI18n.getLocale("BI-Design_Current_Group_Num_Suggest",1e3))),e},showIndex:function(){return t.model.numberGroupLoading?E.LOADING:E.CONTENT},displayMin:function(){return G(t.model.min,{numSeparators:!1})},displayMax:function(){return G(t.model.max,{numSeparators:!1})}}),p()(l()(t),"actions",{getData:function(){var e=t.options.reqFuncOrVal;return t.model.numberGroupLoading=!0,new Promise((function(n){var o=function(e){t.model.numberGroupLoading=!1,t.setMax(e.max),t.setMin(e.min),t.model.gen={interval:e.interval,step:parseFloat(e.step),genMin:e.interval[0],genMax:e.interval[e.interval.length-1]},n()};BI.isFunction(e)?e(o):o(e)}))},setMax:function(e){t.model.max=e},setMin:function(e){t.model.min=e},setType:function(e){t.model.type=e}}),t}return u()(t,e),t.prototype.state=function(){var e=this.options,t=e.value,n=e.type,o=t||{},a=o.useOther,i=o.nodes,r=o.groupInterval,s=IntegrationI18n.getLocale("BI-Basic_Others");return BI.isEmptyString(a)?s=!1:BI.isNotEmptyString(a)&&(s=a),{type:n,max:void 0,min:void 0,useOther:s,nodes:i||null,interval:void 0,groupInterval:parseFloat(r)||void 0,gen:{genMax:0,genMin:0,interval:[]},validText:"",numberGroupLoading:!0}},t}(I.a),p()(Me,"xtype","fdi.model.custom_group.number"),Ve=Me))||Ve;function Ze(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function et(e){for(var t=1;t0?" - ":"",BI.has(n,"childValue"))if(t.model.fieldType===f.NUMBER&&n.value!==F.PERIOD_OR_RING){var i=o[n.value];i=o[n.childValue]+i,a+=i}else a+=o[n.childValue];else a+=o[n.value]})),a},correctFieldType:function(){return t.model.fieldsTypeMap[t.model.dimension.id]},fieldInvalidType:function(){return null},tipTitle:function(){var e=t.model.selectedText.split("-");if(2===e.length){if(!t.model.tipValid&&t.model.fieldInvalidType)return IntegrationI18n.getLocale("BI-Conf_FieldType_Change_Summary_Missing",t.model.fieldName);var n="".concat(IntegrationI18n.getLocale("BI-Basic_Rapid_Calculation{R1}",BI.trim(e[1])),"(");return t.model.tipValid?n+=IntegrationI18n.getLocale("BI-Basic_Calculate_Depend_Date_Field{R1}",t.model.firstDateDimensionName):n+=BI.isNull(t.model.firstDateDimensionName)?IntegrationI18n.getLocale("BI-Basic_Calculate_Depend_Date_Field_Missed"):IntegrationI18n.getLocale("BI-Basic_Calculate_{R1}_is_Not_Supported_To_Calculate_{R2}",t.model.firstDateDimensionName,BI.trim(e[1])),[IntegrationI18n.getLocale("BI-Basic_Group_Type{R1}",e[0]),"".concat(n,")")].join("\n")}return t.model.selectedText},labelValid:function(){return!0},labelTipType:function(){return t.model.labelValid?"success":"warning"},labelMarkCls:function(){return t.model.labelValid?"":" marked-red"},tipValid:function(){return!0},tipMarkCls:function(){return t.model.tipValid?"":" marked-red"},tipTipType:function(){return t.model.tipValid?"success":"warning"}}),p()(l()(t),"actions",{updateCustomGroupPopup:function(e,n){t.model.customGroupSelected=n||null,t.model.customGroupPopupType=e},requestNumberRange:function(e,n,o){var a=t.model.fields.find((function(t){return t.id===e}));return FDI.request.post("/api/dc/v1/field/range",{field:a,source:n}).then((function(e){return t.model.numberRange=e.data,o(e.data),e.data}))},stringDataGetter:function(e,n){var o=t.model.fields.find((function(t){return t.id===e}));return o?FDI.request.post("/api/dc/v1/field/data",{field:o,source:n}).then((function(e){return{data:{fields:BI.map(e.data.value||[],(function(e,t){return{transferName:t}})),fieldsLabel:[]}}})):Promise.resolve({data:{fields:[],fieldsLabel:[]}})},searchDataGetter:function(e,n,o,a){var i=t.model.fields.find((function(t){return t.id===e}));return window.FDI.request.post("/api/dc/v1/field/data/search",{keyword:o,field:i,source:n}).then((function(e){a(e.data,o)}))},validationChecker:function(e){if(e===t.model.fieldName)return!0;var n=BI.map(t.model.dimensions,"name");return!BI.contains(n,e)},setDimensionSelectedById:function(e,n){n&&t.updateCustomGroupPopup(it.NONE)},setFromPopup:function(e){t.model.fromPopup=e}}),t}u()(t,e);var n=t.prototype;return n.state=function(){return{fieldInvalid:!1,numberPeriodError:!1,fromPopup:!1,customGroupSelected:null,customGroupPopupType:it.NONE,numberRange:{},operatorTypeError:!1}},n.init=function(){var e=this.model.engineType===g.SPIDER?q():Ie();this.comboList=e[this.options.handleType]},t}(I.a),p()(nt,"xtype","fdi.model.data.group.dimension"),tt=nt))||tt,xt=(n(15),Object(I.d)()((lt=function(e){function t(){for(var t,n=arguments.length,o=new Array(n),a=0;a1&&void 0!==arguments[1]?arguments[1]:" ";return BI.isString(e)?e.replace(/[\r\n]+/g,t):e}(s);return{type:BI.FloatLeftLayout.xtype,items:[{el:{type:BI.Label.xtype,cls:"".concat(d," button-label"),textAlign:o,whiteSpace:a,textHeight:i,height:r,text:BI.isEmptyString(BI.trim(p))?IntegrationI18n.getLocale("BI-Basic_(Empty)"):p,value:s,py:l,ref:function(t){e.textLeft=t}},hgap:5},{type:BI.Label.xtype,cls:"button-label bi-tips right-text-proportion-width",invisible:!u,textAlign:o,whiteSpace:a,textHeight:i,height:r,text:c,value:n,ref:function(t){e.textRight=t}}]}},n.mounted=function(){var e=this.options,t=e.keywords,n=e.valueRight,o=e.visible;this.doRedMark(t),""!==n&&this.doHighLight(),this.setVisible(o)},n.doRedMark=function(){var e;(e=this.textLeft).doRedMark.apply(e,arguments)},n.unRedMark=function(){var e;(e=this.textLeft).unRedMark.apply(e,arguments)},n.doHighLight=function(){var e;(e=this.textLeft).doHighLight.apply(e,arguments)},n.unHighLight=function(){var e;(e=this.textLeft).unHighLight.apply(e,arguments)},n.getValueLeft=function(){return this.textLeft.getValue()},n.getValueRight=function(){return this.textRight.getValue()},n.getValue=function(){return this.getValueLeft()},t}(BI.BasicButton),p()(Ht,"xtype","fdi.component.custom_group.string.group_expander.button"),Pt=Ht))||Pt,fn=Object(I.d)()(($t=function(e){function t(){for(var t,n=arguments.length,o=new Array(n),a=0;a=1e3)return!0;var a=o.value,i=o.valueRight||"";return n.push({type:In.xtype,title:r?IntegrationI18n.getLocale("BI-Basic_Click_Cancel_Choose_Field"):a+i,valueLeft:a,valueRight:i,selected:o.selected,cls:"item-custom-group bi-card bi-list-item-select bi-border-radius",visible:!!BI.isNull(o.visible)||o.visible,keywords:s?t.model.keywords:"",tgap:5,rgap:5}),!1})),n}}),t}return u()(t,e),t.prototype._init=function(){this.gId=this.options.gId},t}(I.a),p()($t,"xtype","bi.model.component.custom_group.string.group_expander"),Ft=$t))||Ft,gn=Object(I.d)()((jt=function(e){function t(){for(var t,n=arguments.length,o=new Array(n),a=0;a1||a.push(n)}));var i=t.model.groups[0];t.model.groups.splice(0,1,{id:i.id,selected:i.selected,content:i.content.concat(a),value:i.value}),t.model.groups.splice(n,1)}}}),t}return u()(t,e),t}(I.a),p()(Zt,"xtype","bi.model.component.custom_group.string.pane"),Jt=Zt))||Jt)||Jt,vn=Object(I.e)()(en=Object(I.f)(Bn)((tn=function(e){function t(){for(var t,n=arguments.length,o=new Array(n),a=0;a0},checkboxSelected:function(){return!1!==t.model.useOther},copy2ComboAbility:function(){var e=!1;if(BI.isEmptyArray(t.model.groups))e=!0;else{var n=t.model.groups[0];e=BI.isEmptyArray(n.selected)}return t.model.selectsLength>0&&e},copyGroupValues:function(){var e=BI.deepClone(t.model.groupValues);return e.shift(),BI.map(e,(function(e,t){return BI.extend(t,{$testId:"bi-custom-group-string-copy-group-items"})}))},triggerButtonValue:function(){return IntegrationI18n.getLocale("BI-Basic_Has_Selected_{R1}_Item",t.model.selectsLength)},allGroupNames:function(){var e=BI.map(t.model.groups,(function(e,t){return t.value}));return e.push(t.model.useOtherValue),e},unAvailableNames:function(){var e=t.model.groups[0],n=BI.map(e.content,(function(e,t){return t}));return t.model.allGroupNames.concat(n)},groupValues:function(){return BI.map(t.model.groups,(function(e,t){return{id:t.id,value:t.value,title:t.value,$testId:"bi-custom-group-string-move-group-items"}}))},valueMaps:function(){var e={};return BI.each(t.model.groups,(function(t,n){0!==t&&BI.each(n.content,(function(t,o){BI.isArray(e[o])?e[o].push(n.value):e[o]=[n.value]}))})),e},searchCheckboxDisabled:function(){return""===t.model.keywords},allFieldNames:function(){return BI.map(t.model.allFields,"transferName")},allFieldsLabel:function(){return BI.map(t.model.fieldsLabel,(function(e,n){var o=[];return BI.each(n.content,(function(e,n){var a=BI.find(t.model.allFields,(function(e,t){return t.id===n.id}));BI.isNotNull(a)&&o.push({value:a.transferName})})),xn(xn({},n),{},{content:o})}))}}),p()(l()(t),"childContext",["groups","valueMaps","selects","searchCheckboxSelected","unAvailableNames","keywords","allSelected","move2ComboAbility","copy2ComboAbility"]),p()(l()(t),"actions",{initData:function(){return t.options.reqFunc().then((function(e){t.model.allFields=e.data.fields,t.model.fieldsLabel=e.data.fieldsLabel,t.model.allFieldNames&&t.reformat(t.model.allFieldNames.slice(0,1e3))}))},setUseOther:function(e){t.model.useOther=e,!1!==e&&(t.model.useOtherValue=e)},reformat:function(e){var n=t.options,o=BI.deepClone(e);BI.each(BI.isEmptyArray(t.model.allFieldsLabel)?n.group.details:t.model.allFieldsLabel,(function(n,a){var i=BI.map(a.content,"value");BI.each(i,(function(t,n){BI.contains(e,n)&&BI.remove(o,n)})),t.model.groups.push({content:i,id:a.id,value:a.value,selected:[]})})),t.model.groups.unshift({content:o,id:BI.UUID(),value:n.noGroupName,selected:[]})},createGroup:function(e){var n=BI.UUID(),o=e;BI.isNull(o)&&(o=BI.Func.createDistinctName(BI.map(t.model.unAvailableNames,(function(e,t){return{name:t}})),t.options.baseGroupName));var a={content:[],id:n,value:o,selected:[]};return t.model.groups.push(a),a},moveSelectsTo:function(e,n){var o=BI.findIndex(t.model.groups,(function(t,n){return e===n.value})),a=t.model.groups[o];if(0===o){var i=[];BI.each(t.model.groups,(function(e,t){i=i.concat(t.selected)}));var r=BI.any(i,(function(e,n){return-1!==BI.indexOf(t.model.allGroupNames,n)}));if(t.setShowBubble(r),r)return!1}if(!BI.isNull(a)){var s=[];BI.each(t.model.groups,(function(e,n){BI.isEmptyArray(n.selected)||(s=s.concat(n.selected),BI.remove(t.model.groups[e].content,n.selected),t.model.groups[e].selected=[])}));var l=BI.uniq(a.content.concat(s)),c=[];return 0===o&&BI.each(t.model.groups,(function(e,t){0!==e&&BI.each(t.content,(function(e,t){BI.contains(s,t)&&c.push(t)}))})),BI.remove(l,(function(e,t){return BI.contains(c,t)})),t.model.groups.splice(o,1,{id:a.id,value:a.value,selected:[],content:l}),t.resetAllSelected(),!0}},copySelectsToGroup:function(e){var n=BI.deepClone(t.model.selects);BI.each(t.model.groups,(function(o,a){if(-1!==BI.indexOf(e,a.value)){var i=[];BI.each(n,(function(e,t){BI.each(t.content,(function(e,t){i.push(t)}))})),t.model.groups.splice(o,1,{id:a.id,value:a.value,content:BI.uniq(a.content.concat(i)),selected:[]})}})),BI.each(t.model.groups,(function(e,t){t.selected=[]})),t.resetAllSelected()},setShowBubble:function(e){t.model.showBubble=e},setKeywords:function(e){t.model.keywords=e},setAllSelected:function(e){t.model.allSelected=e},resetAllSelected:function(){var e=BI.Constants.getConstant(wt);t.model.allSelected=e.NORMAL_STATE},getValue:function(){var e=BI.map(t.model.groups,(function(e,t){return{content:BI.map(t.content,(function(e,t){return{value:t}})),id:t.id,value:t.value}}));return e.shift(),{details:e,useOther:t.model.useOther||""}}}),t}return u()(t,e),t.prototype.state=function(){var e=this.options;return e.group=BI.deepClone(e.group)||{},BI.isEmptyString(e.group.useOther)&&(e.group.useOther=!1),{useOther:e.group.useOther||!1,groups:[],searchCheckboxSelected:"NONE",useOtherValue:e.group.useOther||IntegrationI18n.getLocale("BI-Basic_Other"),showBubble:!1,keywords:"",allSelected:BI.Constants.getConstant(wt).NORMAL_STATE,allFields:[],fieldsLabel:[]}},t}(I.a),p()(pn,"xtype","bi.model.component.custom_group.string"),dn=pn))||dn,kn=(n(18),26),Un=580,Pn=350,Hn=10,Fn=28,$n=28,Yn=Object(I.e)()(Cn=Object(I.f)(wn,{props:function(){return this.options}})((On=function(e){function t(){for(var n,o=arguments.length,a=new Array(o),i=0;i0&&void 0!==arguments[0]?arguments[0]:[];return e=this.options.regionType===h.DIMENSION1?IntegrationI18n.getLocale("BI-Basic_Group"):IntegrationI18n.getLocale("BI-Basic_Statistic"),n.push(BI.h(BI.Label,{cls:"bi-region-comment bi-tips",text:IntegrationI18n.getLocale("BI-Conf_Drop_Fields_From_Left",e),height:24,key:"tip".concat(this.options.regionType),invisible:!BI.isEmptyArray(n),ref:function(e){t.watermark=e}})),n},n.getDropFieldOption=function(e){var t,n=this,o=this.createPlaceholder(),a=e.getRegionType(),i=!1,r=this.options.settingStore;return{accept:".group-select-fields-item-button",cursorAt:{left:55,top:10},tolerance:"pointer",drop:function(i,s){t&&$(document).unbind("mousemove",t),t=null;var l=s.helper.data("fields"),c=n.getDropIdx(e,o);r.addDimensionByField(l,a,c),$(o).remove()},over:function(){i=!1,n.hideWatermark(),t&&$(document).unbind("mousemove",t),t=function(t){i||n.insertPlaceholder(e.getRegion(),t,o)},$(document).bind("mousemove",t)},out:function(){i=!0,$(o).remove(),t&&$(document).unbind("mousemove",t),t=null,n.showWatermark(BI.get(n.model.view,a))}}},n.getDropIdx=function(e,t){var n=e.getRegionType();if(0===t.next(":not(.bi-region-comment)").length)return this.model.view[n].length;var o=t.next().attr("dimensionId");return BI.indexOf(this.model.view[n],o)},n.insertPlaceholder=function(e,t,n){var o=e.element,a=o.find(".bi-conf-share-group-operator-dimension");!BI.some(a,(function(e,o){if($(o).__isMouseInBounds__(t)){var a=$(o);n.css({width:a.width()});var i=a.offset().left,r=a.width();return t.pageX-i>r/2?a.after(n):a.before(n),!0}}))&&o.__isMouseInBounds__(t)&&0===n.parent().length&&o.append(n)},n.createPlaceholder=function(){var e=BI.createWidget(BI.h(BI.Label,{cls:"ui-sortable-place-holder-region",height:24,width:118}));return e.element.css({margin:"5px 0px 5px 5px",float:"left"}),e.element},n.getSortFieldOption=function(e){var t,n,o=this,a=e.getRegionType(),i=this.options.settingStore,r=function(e){return BI.$(".group-region-container").__isMouseInBounds__(e)};return{connectWith:".group-region-container",cursorAt:{left:55,top:10},tolerance:"pointer",items:".bi-string-dimension-container, .bi-data-dimension-container, .bi-number-dimension-container",placeholder:{element:function(){return o.createPlaceholder()},update:function(){}},helper:function(e,n){t=n.attr("dimensionId");var a=BI.createWidget(BI.h(y,{width:120,height:20,attributes:{dimensionId:t},cls:"dimension-capsule-helper bi-capsule-border field-draggable bi-card",text:o.model.dimensions[t].name,textAlign:"left"}));return BI.createWidget(BI.h(BI.AbsoluteLayout,{element:o.element},BI.h("el",null,a))),a.element},start:function(e,o){t=o.helper.attr("dimensionId"),n&&$(document).unbind("mousemove",n),n=function(e){t&&!r(e)?o.helper.addClass("delete-draggable"):o.helper.removeClass("delete-draggable")},$(document).bind("mousemove",n)},stop:function(e){n&&$(document).unbind("mousemove",n),r(e)||i.deleteDimension(t),t=null,n=null},update:function(){var t=e.getAllDimensions(),n=e.getAllRegionTyeps();i.setSortBySortInfo({dimensions:t,regionType:a,regionTypes:n})},over:function(e,t){o.hideWatermark(),t.placeholder.show()},out:function(e,t){BI.isNotNull(t.helper)&&(o.showWatermark(BI.get(o.model.view,a)),t.placeholder.hide())}}},n.showWatermark=function(e){var t;BI.isEmpty(e)&&(null===(t=this.watermark)||void 0===t||t.setVisible(!0))},n.hideWatermark=function(){var e;null===(e=this.watermark)||void 0===e||e.setVisible(!1)},n.getAllDimensions=function(){return this.center.element.sortable("toArray",{attribute:"dimensionId"})},n.getAllRegionTyeps=function(){return this.center.element.sortable("toArray",{attribute:"regionType"})},n.getRegion=function(){return this.center},n.getWrapper=function(){return this.wrapper},n.getRegionType=function(){return this.options.regionType},n.populate=function(e){var t,n=BI.isEmptyArray(e);this.center.populate(this.createDimensionItems(e)),null===(t=this.watermark)||void 0===t||t.setVisible(n)},n.createStructures=function(e,t){var n=this,o=this.options.settingStore;return BI.map(e,(function(e,a){var i=n.model.dimensions[a].id,r=n.model.fieldsTypeMap[i],s=n.getDimensionCls(r);return BI.h(zn,{cls:"".concat(s," sign-style-editor"),attributes:{dimensionId:a,regionType:t},dId:a,key:a,handleType:n.switchHandleType(t),source:o.source,listeners:[{eventName:zn.EVENT.RENAME,action:function(e,t){o.setDimensionName(e,t)}},{eventName:zn.EVENT.CHANGE,action:function(e,t){o.setDimension(e,Fix.toJSON(t))}},{eventName:zn.EVENT.DELETE,action:function(e){o.deleteDimension(e)}}]})}))},n.getDimensionCls=function(e){switch(e){case f.NUMBER:return"bi-number-dimension-container";case f.DATE:return"bi-data-dimension-container";case f.STRING:default:return"bi-string-dimension-container"}},n.switchHandleType=function(e){return this.isDimensionRegion1ByRegionType(e)?j.GROUP:j.SUMMARY},n.isDimensionRegion1ByRegionType=function(e){return e===h.DIMENSION1},t}(BI.Widget),p()(Sn,"xtype","fdi.group.operator.region"),Mn=Sn))||Mn)||Mn,eo=Object(I.e)()((Gn=function(e){function t(){for(var t,n=arguments.length,o=new Array(n),a=0;a