@ecan-bi/pivot-table 1.0.58 → 1.0.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @ecan-bi/pivot-table@1.0.58 */
1
+ /*! @ecan-bi/pivot-table@1.0.60 */
2
2
  (function(Je,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("vue"),require("dayjs"),require("lodash-es"),require("axios"),require("ant-design-vue"),require("ant-design-vue/es/input-number/style"),require("ant-design-vue/es/form/style"),require("echarts"),require("vuedraggable")):typeof define=="function"&&define.amd?define(["exports","vue","dayjs","lodash-es","axios","ant-design-vue","ant-design-vue/es/input-number/style","ant-design-vue/es/form/style","echarts","vuedraggable"],v):(Je=typeof globalThis<"u"?globalThis:Je||self,v(Je["@ecan-bi/pivot-table"]={},Je.Vue,Je.Dayjs,Je.LodashEs,Je.Axios,Je.AntDesignVue,null,null,Je.Echarts,Je.Draggable))})(this,function(Je,v,Lo,Ye,PB,ji,XY,qY,HB,Bb){"use strict";function EB(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>i[e]})}}return t.default=i,Object.freeze(t)}const LB=EB(HB),kB=i=>(i.install=t=>{t.component(i.name,i)},i);function Pb(i,t){var e={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&t.indexOf(n)<0&&(e[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function"){var o=0;for(n=Object.getOwnPropertySymbols(i);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(i,n[o])&&(e[n[o]]=i[n[o]])}return e}const FB=()=>{},IB=Object.assign,DB=Array.isArray,pf=i=>typeof i=="function",OB=i=>typeof i=="symbol";let Hb;const mf=()=>Hb||(Hb=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function vf(i){const t=i&&i.__v_raw;return t?vf(t):i}function Eb(i){return!(!i||i.__v_isRef!==!0)}function Mi(i){return Eb(i)?i.value:i}new Set(Object.getOwnPropertyNames(Symbol).filter(i=>i!=="arguments"&&i!=="caller").map(i=>Symbol[i]).filter(OB));const $r=[];function bf(i,...t){if(process.env.NODE_ENV==="production")return;const e=$r.length?$r[$r.length-1].component:null,n=e&&e.appContext.config.warnHandler,o=function(){let r=$r[$r.length-1];if(!r)return[];const s=[];for(;r;){const l=s[0];l&&l.vnode===r?l.recurseCount++:s.push({vnode:r,recurseCount:0});const a=r.component&&r.component.parent;r=a&&a.vnode}return s}();if(n)Cf(n,e,11,[i+t.join(""),e&&e.proxy,o.map(({vnode:r})=>`at <${Nb(e,r.type)}>`).join(`
3
3
  `),o]);else{const r=[`[Vue warn]: ${i}`,...t];o.length&&r.push(`
4
4
  `,...function(s){const l=[];return s.forEach((a,h)=>{l.push(...h===0?[]:[`
@@ -306,7 +306,7 @@
306
306
  border: 1px solid #E6E8ED;
307
307
  }
308
308
  `,document.head.appendChild(i)}u9();const kh="vtable__bubble-tooltip-element",bT=`${kh}__content`,CT=`${kh}__triangle`,Fl=`${kh}--hidden`,Fh=`${kh}--shown`;class c9{constructor(){this._handler=new mc;const t=this._rootElement=xo("div",[kh,Fl]),e=xo("div",[bT]),n=xo("span",[CT]);t.appendChild(n),t.appendChild(e),this._messageElement=t.querySelector(`.${bT}`)||void 0,this._triangleElement=t.querySelector(`.${CT}`)||void 0,t.addEventListener("mousemove",()=>{this._disappearDelayId&&clearTimeout(this._disappearDelayId)}),t.addEventListener("mouseleave",()=>{this._disappearDelay=void 0,this.unbindFromCell()}),e.addEventListener("wheel",o=>{o.stopPropagation()}),e.addEventListener("copy",o=>{r4(e)&&o.stopPropagation()})}bindToCell(t,e,n,o,r){var s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,A,R;this._disappearDelay=o==null?void 0:o.disappearDelay,this._disappearDelayId&&clearTimeout(this._disappearDelayId);const x=this._rootElement,T=this._messageElement,M=this._triangleElement;if(x==null||x.classList.remove(Fh),x==null||x.classList.add(Fl),this._canBindToCell(t,e,n)){if(T.setAttribute("style",""),M.setAttribute("style",""),o!=null&&o.className&&x.classList.add(o.className),!((s=o==null?void 0:o.style)===null||s===void 0)&&s.bgColor&&(T.style.backgroundColor=(l=o==null?void 0:o.style)===null||l===void 0?void 0:l.bgColor),!((a=o==null?void 0:o.style)===null||a===void 0)&&a.bgColor&&(M.style.backgroundColor=(h=o==null?void 0:o.style)===null||h===void 0?void 0:h.bgColor),M.style.display=((d=o==null?void 0:o.style)===null||d===void 0?void 0:d.arrowMark)===!0?"block":"none",!((u=o==null?void 0:o.style)===null||u===void 0)&&u.fontSize&&(T.style.fontSize=((g=(c=o==null?void 0:o.style)===null||c===void 0?void 0:c.fontSize)!==null&&g!==void 0?g:12)+"px"),!((f=o==null?void 0:o.style)===null||f===void 0)&&f.fontFamily&&(T.style.fontFamily=(p=o==null?void 0:o.style)===null||p===void 0?void 0:p.fontFamily),!((m=o==null?void 0:o.style)===null||m===void 0)&&m.color&&(T.style.color=(b=o==null?void 0:o.style)===null||b===void 0?void 0:b.color),!((C=o==null?void 0:o.style)===null||C===void 0)&&C.padding&&(T.style.padding=`${(_=o==null?void 0:o.style)===null||_===void 0?void 0:_.padding.join("px ")}px`),!((w=o==null?void 0:o.style)===null||w===void 0)&&w.maxHeight&&(T.style.maxHeight=`${(y=o==null?void 0:o.style)===null||y===void 0?void 0:y.maxHeight}px`),!((S=o==null?void 0:o.style)===null||S===void 0)&&S.maxWidth&&(T.style.maxWidth=`${(A=o==null?void 0:o.style)===null||A===void 0?void 0:A.maxWidth}px`),T&&(T.textContent=o==null?void 0:o.content),this._bindToCell(t,e,n,o==null?void 0:o.position,o==null?void 0:o.referencePosition,r,(R=o==null?void 0:o.style)===null||R===void 0?void 0:R.arrowMark))return x==null||x.classList.add(Fh),x==null||x.classList.remove(Fl),!0}else this.unbindFromCell();return!1}release(){var t,e;this.unbindFromCell();const n=this._rootElement;n!=null&&n.parentElement&&n.parentElement.removeChild(n),(e=(t=this._handler)===null||t===void 0?void 0:t.release)===null||e===void 0||e.call(t),delete this._rootElement,delete this._messageElement}move(t,e,n,o,r){const s=this._rootElement;this._canBindToCell(t,e,n)?(this._bindToCell(t,e,n,o==null?void 0:o.position,o==null?void 0:o.referencePosition,r),s==null||s.classList.add(Fh),s==null||s.classList.remove(Fl)):this.unbindFromCell()}unbindFromCell(){var t;if(this._disappearDelay)this._disappearDelayId=setTimeout(()=>{const e=this._rootElement;e!=null&&e.parentElement&&(e.classList.remove(Fh),e.classList.add(Fl))},(t=this._disappearDelay)!==null&&t!==void 0?t:0);else{const e=this._rootElement;e!=null&&e.parentElement&&(e.classList.remove(Fh),e.classList.add(Fl))}}_canBindToCell(t,e,n){const o=t.getCellRangeRelativeRect({col:e,row:n}),r=t.getElement(),{bottom:s,left:l,right:a,top:h}=o;if(t.isFrozenCell(e,n))return!0;if(s<t.getFrozenRowsHeight()||a<t.getFrozenColsWidth()||l>t.tableNoFrameWidth-t.getRightFrozenColsWidth()||h>t.tableNoFrameHeight-t.getBottomFrozenRowsHeight())return!1;const{offsetHeight:d,offsetWidth:u}=r;return!(h>d)&&!(l>u)}_bindToCell(t,e,n,o,r,s,l){const a=this._rootElement,h=t.getCellRangeRelativeRect({col:e,row:n}),d=t.internalProps.tooltip.parentElement,u=t.internalProps.element.offsetWidth,{width:c}=h;if(a){let g,f;a.parentElement!==d&&d.appendChild(a),a.style.left="0px";const p=Math.min(.8*u,4*c);a.style.maxWidth=`${p}px`;const m=a.clientWidth,b=a.clientHeight;if(!o&&!r)return!1;{const T=this.getComputedPosition(t,e,n,o,r,s,l);f=T.x,g=T.y}a.style.left=`${f}px`,a.style.top=`${g}px`,rm()&&(a.style.fontSize="11px");const{x1:C,x2:_,y1:w,y2:y}=t.stateManager.menu.bounds,S=f,A=S+m,R=g,x=S+b;return!(t.stateManager.menu.isShow&&C<A&&_>S&&y>R&&w<x)}return!1}getComputedPosition(t,e,n,o,r,s,l){var a;const h=this._rootElement,d=t.getCellRangeRelativeRect({col:e,row:n}),{x:u,y:c}=t.internalProps.tooltip.parentElement.getBoundingClientRect(),{width:g,height:f,x:p,y:m}=t.internalProps.element.getBoundingClientRect(),{width:b}=d;let C,_;const w=Math.min(.8*g,4*b);h.style.maxWidth=`${w}px`;const y=h.clientWidth,S=h.clientHeight,A=l?6:0;if(o)_=o.x,C=o.y+A,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.top="-5px";else if(r){let R=(a=r.placement)!==null&&a!==void 0?a:tn.bottom;const x=r.rect.left+r.rect.width/2,T=r.rect.top+r.rect.height/2,M=r.rect.top,B=r.rect.bottom,P=r.rect.left,F=r.rect.right;let H=0;const E=()=>{H++,H>=4||(this.removeStyleFromTriangle(),R===tn.top?(_=x-y/2,C=M-S-A,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.bottom="-5px",s&&C<0&&(R=tn.right,E())):R===tn.bottom?(_=x-y/2,C=B+A,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.top="-5px",s&&C+S>f&&(R=tn.left,E())):R===tn.left?(C=T-S/2,_=P-y-A,this._triangleElement.style.top="50%",this._triangleElement.style.marginTop="-5px",this._triangleElement.style.right="-5px",s&&_<0&&(R=tn.top,E())):R===tn.right&&(C=T-S/2,_=F+A,this._triangleElement.style.top="50%",this._triangleElement.style.marginTop="-5px",this._triangleElement.style.left="-5px",s&&_+y>g&&(R=tn.bottom,E())))};E()}return s&&(_<0?_=0:_+h.offsetWidth>g&&(_=g-h.offsetWidth)),{x:_+p-u,y:C+m-c}}removeStyleFromTriangle(){this._triangleElement.style.left="",this._triangleElement.style.right="",this._triangleElement.style.top="",this._triangleElement.style.bottom="",this._triangleElement.style.marginLeft="",this._triangleElement.style.marginTop=""}_locate(t,e,n,o,r,s){const l=this.getComputedPosition(t,e,n,o,r,s),a=l.x,h=l.y;this._rootElement.style.left=`${a}px`,this._rootElement.style.top=`${h}px`}}class g9 extends d9{createTooltipElementInternal(){return new c9}}const f9={"bubble-tooltip":function(i){return new g9(i)}};class p9{constructor(t,e){this._table=t,this._tooltipInstances={},this._bindTableEvent(t),this.confine=e}release(){var t,e;const n=this._tooltipInstances;for(const o in n)(e=(t=n[o])===null||t===void 0?void 0:t.release)===null||e===void 0||e.call(t);delete this._tooltipInstances,this._attachInfo=null}_bindToCell(t,e,n){var o;const r=this._attachInfo,s=this._getTooltipInstanceInfo(t,e);if(!r||s&&r.instance===s||((o=r.instance)===null||o===void 0||o.unbindTooltipElement(),this._attachInfo=null),!!s&&s&&s.bindTooltipElement(t,e,n,this.confine)){const l=this._table.getCellRange(t,e);this._attachInfo={range:l,instance:s,tooltipOptions:n}}}_move(t,e,n){const o=this._attachInfo;if(!o||!Yi(o.range,t,e))return;const{instance:r}=o;r==null||r.moveTooltipElement(t,e,n,this.confine)}moveToPosition(t,e,n,o){const r=this._attachInfo;if(!r||!Yi(r.range,t,e))return;const{instance:s}=r;this._attachInfo.tooltipOptions.position=n,this._attachInfo.tooltipOptions.referencePosition=o,s==null||s.locateTooltipElement(t,e,n,o,this.confine)}_unbindFromCell(){const t=this._attachInfo;if(!t)return;const{instance:e}=t;e==null||e.unbindTooltipElement(),this._attachInfo=null}_isBindCell(t,e){const n=this._attachInfo;return!!n&&Yi(n.range,t,e)}_bindTableEvent(t){t.on(at.MOUSEENTER_CELL,e=>{if(rm())return;const{x1:n,x2:o,y1:r,y2:s}=t.stateManager.menu.bounds;if(t.stateManager.menu.isShow&&typeof e.x=="number"&&typeof e.y=="number"&&e.x>n&&e.x<o&&e.y>r&&e.y<s)return;const{col:l,row:a}=e;this.showTooltip(l,a)}),t.on(at.MOUSEMOVE_CELL,e=>{var n,o;if(!rm()){if(!((o=(n=this._attachInfo)===null||n===void 0?void 0:n.tooltipOptions)===null||o===void 0)&&o.referencePosition){const r=this._attachInfo.tooltipOptions.referencePosition,{event:s}=e,{left:l,right:a,top:h,bottom:d}=r.rect,u=t._getMouseAbstractPoint(s,!1);u.inTable&&u.x>=l-5&&u.x<=a+5&&u.y>=h-5&&u.y<=d+5||this._unbindFromCell()}this._attachInfo&&t.stateManager.menu.isShow&&this._bindToCell(e.col,e.row)}}),t.on(at.MOUSELEAVE_CELL,e=>{this._unbindFromCell()}),t.on(at.SELECTED_CELL,e=>{this._isBindCell(e.col,e.row)&&this._unbindFromCell()}),t.on(at.MOUSELEAVE_TABLE,e=>{this._unbindFromCell()}),t.on(at.SCROLL,e=>{this._unbindFromCell()})}showTooltip(t,e){var n,o,r;let s;const l=this._table,a=l.getHeaderDescription(t,e);if(a){const h=l.getCellRangeRelativeRect({col:t,row:e});s={content:a,referencePosition:{placement:tn.bottom,rect:h},disappearDelay:(n=l.internalProps.tooltip.overflowTextTooltipDisappearDelay)!==null&&n!==void 0?n:0,style:l.theme.tooltipStyle}}else if(ue((o=l.internalProps.tooltip)===null||o===void 0?void 0:o.isShowOverflowTextTooltip)?l.internalProps.tooltip.isShowOverflowTextTooltip(t,e,l):l.internalProps.tooltip.isShowOverflowTextTooltip){const h=l.getCellOverflowText(t,e),d=l.getCellRangeRelativeRect({col:t,row:e});h&&(s={content:a?`${a}
309
- ${h}`:h,referencePosition:{placement:tn.bottom,rect:d},disappearDelay:(r=l.internalProps.tooltip.overflowTextTooltipDisappearDelay)!==null&&r!==void 0?r:0,style:l.theme.tooltipStyle})}s?this._bindToCell(t,e,s):this._unbindFromCell()}_getTooltipInstanceInfo(t,e){const n=this._table,o=this._tooltipInstances;return o&&o["bubble-tooltip"]||o&&(o["bubble-tooltip"]=f9["bubble-tooltip"](n))}isBinded(t){var e;return JSON.stringify(t)===JSON.stringify((e=this._attachInfo)===null||e===void 0?void 0:e.tooltipOptions)}}const Mg=()=>{Bt.registerComponent("axis",WV),Bt.registerFunction("computeAxisComponentWidth",jV),Bt.registerFunction("computeAxisComponentHeight",$V),Bt.registerFunction("getAxisConfigInPivotChart",I8)},Bg=()=>{Bt.registerComponent("emptyTip",UV)},Pg=()=>{Bt.registerFunction("createLegend",i9)},Hg=()=>{Bt.registerComponent("menuHandler",a9)},Eg=()=>{Bt.registerComponent("title",h9)},Lg=()=>{Bt.registerComponent("tooltipHandler",p9)};class m9{constructor(t){this.titleRows=[],this.showedTitleRows=[],this.rowNow=-1,this.skipStartRow=-1,this.skipEndRow=-1,this.table=t,this.table.on("scroll",e=>{e.scrollDirection==="vertical"&&this.updateGroupTitle()}),this.table.on("resize_column",e=>{this.updateGroupTitle()})}updateGroupTitle(){this.table.scrollTop===0?(this.titleRows=[],this.showedTitleRows=[]):this.skipStartRow!==-1&&this.skipEndRow!==-1&&this.skipStartRow!==this.table.scenegraph.proxy.bodyTopRow-1?(this.table.scenegraph.proxy.screenTopRow<=this.skipStartRow||this.table.scenegraph.proxy.screenTopRow>=this.skipEndRow)&&(this.skipStartRow=-1,this.skipEndRow=-1,this.updateGroupTitleInfo()):(this.skipStartRow=-1,this.skipEndRow=-1,this.updateGroupTitleInfo()),this.updateScenegraph()}updateGroupTitleInfo(){this.rowNow=this.table.scenegraph.proxy.screenTopRow+this.titleRows.length;const t=this.table.getRecordIndexByCell(0,this.rowNow),e=this.table.getRecordIndexByCell(0,this.rowNow+1);this.getTitleRowsByRecordIndex(t,e)}getTitleRowsByRecordIndex(t,e){lt(t)||(t=[t]),lt(e)||(e=[e]);for(let l=0;l<t.length;l++){const a=t.slice(0,l+1);this.table.dataSource.getRaw(a)}const n=[],o=e.length===t.length+1;let r=t.slice(0,o?t.length:t.length-1);const s=this.table.dataSource.currentIndexedData;for(let l=this.rowNow-this.table.columnHeaderLevelCount;l>=0;l--){const a=s[l];if(lt(a)&&r.length===a.length){let h=!0;for(let d=0;d<a.length;d++)if(a[d]!==r[d]){h=!1;break}h&&(n.push(l+this.table.columnHeaderLevelCount),r=r.slice(0,r.length-1))}else if(a===t[0]){n.push(l+this.table.columnHeaderLevelCount);break}}this.titleRows=n.reverse()}updateScenegraph(){const{table:t}=this,{shadowGroup:e,shadowGroupFrozen:n}=b9(t);this.showedTitleRows.length=0;let o=0;for(let r=0;r<t.colCount;r++){let s;r<t.frozenColCount?(s=new de({x:t.getColsWidth(0,r-1),y:t.getFrozenRowsHeight()}),n.add(s)):(s=new de({x:t.getColsWidth(t.frozenColCount,r-1),y:t.getFrozenRowsHeight()}),e.add(s)),s.col=r;for(let l=0;l<this.titleRows.length;l++){const a=this.titleRows[l];if(v9(a,this.rowNow,t.scenegraph.proxy.screenTopRow,this.titleRows)){r===0&&o++;continue}r===0&&this.showedTitleRows.push(a);const h=t.scenegraph.getCell(r,a);if(h.role==="cell"){const d=yT(h);d.setAttributes({y:40*l}),s.add(d)}else{const d=_o(r,a,t,!0,!0);d.setAttributes({y:40*l}),s.add(d)}}}o>0&&this.skipStartRow===-1&&this.skipEndRow===-1&&(this.skipStartRow=t.scenegraph.proxy.screenTopRow-1,this.skipEndRow=t.scenegraph.proxy.screenTopRow+1)}}function v9(i,t,e,n){return i===t&&i!==e+n.length-1?!0:i===e+n.indexOf(i)+1&&i<t}function yT(i){const t=i.clone();if(t.role=i.role,t.col=i.col,t.row=i.row,t.mergeStartCol=i.mergeStartCol,t.mergeStartRow=i.mergeStartRow,t.mergeEndCol=i.mergeEndCol,t.mergeEndRow=i.mergeEndRow,t.contentWidth=i.contentWidth,t.contentHeight=i.contentHeight,t.role==="cell"){const e=Fe({x:0,y:0,width:t.attribute.width,height:t.attribute.height});t.add(e)}if(i.type==="group"){const e=t;i.forEachChildren(n=>{const o=yT(n);e.add(o)})}return t}function b9(i){const t=i.scenegraph.colHeaderGroup,e=i.scenegraph.cornerHeaderGroup;if(!t.border){const r=Fe({x:0,y:0,width:0,height:0,cursor:"pointer"});t.add(r),t.border=r,r.attachShadow(r.shadowRoot),r.name="border-rect",r.addEventListener("click",s=>{const l=i.listTreeStickCellPlugin.titleRows,{shadowTarget:a}=s.pickParams,h=Hr(a),{col:d,row:u}=h;_T(u-l.indexOf(u),i)})}if(!e.border){const r=Fe({x:0,y:0,width:0,height:0,cursor:"pointer"});e.add(r),e.border=r,r.attachShadow(r.shadowRoot),r.name="border-rect",r.addEventListener("click",s=>{const l=i.listTreeStickCellPlugin.titleRows,{shadowTarget:a}=s.pickParams,h=Hr(a),{col:d,row:u}=h;_T(u-l.indexOf(u),i)})}const n=t.border.shadowRoot,o=e.border.shadowRoot;return n.removeAllChild(),o.removeAllChild(),{shadowGroup:n,shadowGroupFrozen:o}}function _T(i,t){const e=t.getDrawRange();if(z(i)&&i>=t.frozenRowCount){const n=t.getFrozenRowsHeight(),o=t.getRowsHeight(0,i-1);t.scrollTop=Math.min(o-n,t.getAllRowsHeight()-e.height)-1}t.scenegraph.updateNextFrame()}const C9=()=>{Bt.registerComponent("listTreeStickCellPlugin",m9)},y9={};function _9(){return nh(y9,yg)}function w9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C){var _,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j;const G=_9()[d],X=f._getCellStyle(o,r),ht=Lc("padding",X,o,r,f);if(z(ht)&&(a=ht),!i){const gt=ws(o,r,p,f);b&&(i=f.scenegraph.highPerformanceGetCell(o,r,!0))&&i.role==="cell"&&i.setAttributes({x:e,y:n,width:s,height:l,lineWidth:(w=(_=p==null?void 0:p.group)===null||_===void 0?void 0:_.lineWidth)!==null&&w!==void 0?w:void 0,fill:(S=(y=p==null?void 0:p.group)===null||y===void 0?void 0:y.fill)!==null&&S!==void 0?S:void 0,stroke:(R=(A=p==null?void 0:p.group)===null||A===void 0?void 0:A.stroke)!==null&&R!==void 0?R:void 0,strokeArrayWidth:gt,strokeArrayColor:(T=(x=p==null?void 0:p.group)===null||x===void 0?void 0:x.strokeArrayColor)!==null&&T!==void 0?T:void 0,cursor:(B=(M=p==null?void 0:p.group)===null||M===void 0?void 0:M.cursor)!==null&&B!==void 0?B:void 0,lineDash:(F=(P=p==null?void 0:p.group)===null||P===void 0?void 0:P.lineDash)!==null&&F!==void 0?F:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius}),i&&i.role==="cell"||((i=new de({x:e,y:n,width:s,height:l,lineWidth:(E=(H=p==null?void 0:p.group)===null||H===void 0?void 0:H.lineWidth)!==null&&E!==void 0?E:void 0,fill:(I=(k=p==null?void 0:p.group)===null||k===void 0?void 0:k.fill)!==null&&I!==void 0?I:void 0,stroke:(D=(L=p==null?void 0:p.group)===null||L===void 0?void 0:L.stroke)!==null&&D!==void 0?D:void 0,strokeArrayWidth:gt,strokeArrayColor:(N=(O=p==null?void 0:p.group)===null||O===void 0?void 0:O.strokeArrayColor)!==null&&N!==void 0?N:void 0,cursor:($=(W=p==null?void 0:p.group)===null||W===void 0?void 0:W.cursor)!==null&&$!==void 0?$:void 0,lineDash:(Y=(U=p==null?void 0:p.group)===null||U===void 0?void 0:U.lineDash)!==null&&Y!==void 0?Y:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius})).role="cell",i.col=o,i.row=r,t==null||t.addCellGroup(i))}if(i.AABBBounds.width(),C&&Array.isArray(f.getCellValue(o,r))||!C){const gt=new Rl(m,{stroke:!1,x:a[3],y:a[0],canvas:(j=f.canvas)!==null&&j!==void 0?j:f.scenegraph.stage.window.getContext().canvas,mode:f.options.mode,modeParams:f.options.modeParams,spec:u,ClassType:G,width:s-a[3]-a[1],height:l-a[2]-a[0],chartInstance:c,dataId:g,data:f.getCellValue(o,r)||[],cellPadding:a,dpr:f.internalProps.pixelRatio,axes:f.isPivotChart()?f.internalProps.layoutMap.getChartAxes(o,r):[],tableChartOption:f.options.chartOption});i.appendChild(gt),f.internalProps.layoutMap.setChartInstance(o,r,gt.chartInstance)}return i}function S9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b){var C,_,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U;if(!i){const ht=ws(o,r,f,g);b&&(i=g.scenegraph.highPerformanceGetCell(o,r,!0))&&i.role==="cell"&&i.setAttributes({x:e,y:n,width:l,height:a,lineWidth:(_=(C=f==null?void 0:f.group)===null||C===void 0?void 0:C.lineWidth)!==null&&_!==void 0?_:void 0,fill:(y=(w=f==null?void 0:f.group)===null||w===void 0?void 0:w.fill)!==null&&y!==void 0?y:void 0,stroke:(A=(S=f==null?void 0:f.group)===null||S===void 0?void 0:S.stroke)!==null&&A!==void 0?A:void 0,strokeArrayWidth:ht,strokeArrayColor:(x=(R=f==null?void 0:f.group)===null||R===void 0?void 0:R.strokeArrayColor)!==null&&x!==void 0?x:void 0,cursor:(M=(T=f==null?void 0:f.group)===null||T===void 0?void 0:T.cursor)!==null&&M!==void 0?M:void 0,lineDash:(P=(B=f==null?void 0:f.group)===null||B===void 0?void 0:B.lineDash)!==null&&P!==void 0?P:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius}),i&&i.role==="cell"||((i=new de({x:e,y:n,width:l,height:a,lineWidth:(H=(F=f==null?void 0:f.group)===null||F===void 0?void 0:F.lineWidth)!==null&&H!==void 0?H:void 0,fill:(k=(E=f==null?void 0:f.group)===null||E===void 0?void 0:E.fill)!==null&&k!==void 0?k:void 0,stroke:(L=(I=f==null?void 0:f.group)===null||I===void 0?void 0:I.stroke)!==null&&L!==void 0?L:void 0,strokeArrayWidth:ht,strokeArrayColor:(O=(D=f==null?void 0:f.group)===null||D===void 0?void 0:D.strokeArrayColor)!==null&&O!==void 0?O:void 0,cursor:(W=(N=f==null?void 0:f.group)===null||N===void 0?void 0:N.cursor)!==null&&W!==void 0?W:void 0,lineDash:(U=($=f==null?void 0:f.group)===null||$===void 0?void 0:$.lineDash)!==null&&U!==void 0?U:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius})).role="cell",i.col=o,i.row=r,t==null||t.addCellGroup(i))}let Y;if(c){let ht=o,gt=r;m&&(ht=m.start.col,gt=m.start.row),Y=g.getCellIcons(ht,gt)}let j=0,G=0;if(Array.isArray(Y)&&Y.length!==0){const{leftIconWidth:ht,rightIconWidth:gt,absoluteLeftIconWidth:Ct,absoluteRightIconWidth:Q}=Dc(Y,i,m,g);j=ht+gt,G=ht,i.forEachChildren(et=>{et.role==="icon-left"?et.setAttribute("x",et.attribute.x+h[3]):et.role==="icon-right"?et.setAttribute("x",et.attribute.x+l-gt-h[1]):et.role==="icon-absolute-right"&&et.setAttribute("x",et.attribute.x+l-Q-h[1])}),i.forEachChildren(et=>{u==="middle"?et.setAttribute("y",(a-et.AABBBounds.height())/2):u==="bottom"?et.setAttribute("y",a-et.AABBBounds.height()-h[2]):et.setAttribute("y",h[0])})}const X=x9(o,r,s-j,l,a,h,f,p,g);return X&&i.appendChild(X),X.render(),l-=h[1]+h[3]+j,a-=h[0]+h[2],d==="center"?X.setAttribute("x",h[3]+G+(l-X.AABBBounds.width())/2):d==="right"?X.setAttribute("x",h[3]+G+l-X.AABBBounds.width()):X.setAttribute("x",h[3]+G),u==="middle"?X.setAttribute("y",h[0]+(a-X.AABBBounds.height())/2):u==="bottom"?X.setAttribute("y",h[0]+a-X.AABBBounds.height()):X.setAttribute("y",h[0]),i}function x9(i,t,e,n,o,r,s,l,a){var h,d,u,c;const g=a._getCellStyle(i,t),f=wt("size",g,i,t,a),p=wt("spaceBetweenTextAndIcon",g,i,t,a),m=wt("defaultFill",g,i,t,a),b=wt("defaultStroke",g,i,t,a),C=wt("disableFill",g,i,t,a),_=wt("checkedFill",g,i,t,a),w=wt("checkedStroke",g,i,t,a),y=wt("disableCheckedFill",g,i,t,a),S=wt("disableCheckedStroke",g,i,t,a),A=wt("checkIconImage",g,i,t,a),R=wt("indeterminateIconImage",g,i,t,a),x=a.getCellValue(i,t),T=a.getCellOriginValue(i,t);let M,B,P=(h=x)!==null&&h!==void 0?h:"";ge(x)?(M=x.checked,B=x.disable,P=(d=x.text)!==null&&d!==void 0?d:""):typeof x=="boolean"&&(M=x,P=""),M=a.stateManager.syncCheckedState(i,t,l.field,M);const F=lo(i,t,a),H=a._getCellStyle(i,t),E=(u=H.autoWrapText)!==null&&u!==void 0?u:a.internalProps.autoWrapText,{lineClamp:k}=H,{checked:I,disable:L}=l;if(M==null||typeof M=="function"){const Y=ii(I,{col:i,row:t,table:a,context:null,value:x,dataValue:T});M=a.stateManager.syncCheckedState(i,t,l.field,Y)}const D=ii(L,{col:i,row:t,table:a,context:null,value:x,dataValue:T}),O=e==="auto",N=a.isAutoRowHeight(t),W={text:P.length===1?P[0]:P,maxLineWidth:O?1/0:n-(r[1]+r[3]+F)-f-p,textBaseline:"top",autoWrapText:E,lineClamp:k,wordBreak:"break-word",heightLimit:N?-1:o-Math.floor(r[0]+r[2]),pickable:!1,dx:F,whiteSpace:P.length!==1||E?"normal":"no-wrap"},$={x:0,y:0,text:s.text?Object.assign({},s.text,W):W,icon:{width:Math.floor(f/1.4),height:Math.floor(f/1.4)},box:{width:f,height:f},spaceBetweenTextAndIcon:p,disabled:(c=B??D)!==null&&c!==void 0&&c};M==="indeterminate"?($.checked=void 0,$.indeterminate=!0):($.checked=M,$.indeterminate=void 0),m&&($.box.fill=m),b&&($.box.stroke=b),C&&($.box.disableFill=C),_&&($.box.checkedFill=_),w&&($.box.checkedStroke=w),y&&($.box.disableCheckedFill=y),S&&($.box.disableCheckedStroke=S),A&&($.icon.checkIconImage=A),R&&($.icon.indeterminateIconImage=R);const U=new Rr($);return U.name="checkbox",U}function R9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f){var p,m,b,C,_,w,y,S,A,R,x,T;if(!i){const P=ws(o,r,g,c);(i=new de({x:e,y:n,width:l,height:a,lineWidth:(m=(p=g==null?void 0:g.group)===null||p===void 0?void 0:p.lineWidth)!==null&&m!==void 0?m:void 0,fill:(C=(b=g==null?void 0:g.group)===null||b===void 0?void 0:b.fill)!==null&&C!==void 0?C:void 0,stroke:(w=(_=g==null?void 0:g.group)===null||_===void 0?void 0:_.stroke)!==null&&w!==void 0?w:void 0,strokeArrayWidth:P,strokeArrayColor:(S=(y=g==null?void 0:g.group)===null||y===void 0?void 0:y.strokeArrayColor)!==null&&S!==void 0?S:void 0,cursor:(R=(A=g==null?void 0:g.group)===null||A===void 0?void 0:A.cursor)!==null&&R!==void 0?R:void 0,lineDash:(T=(x=g==null?void 0:g.group)===null||x===void 0?void 0:x.lineDash)!==null&&T!==void 0?T:void 0,lineCap:"butt",clip:!0,cornerRadius:g.group.cornerRadius})).role="cell",i.col=o,i.row=r,t==null||t.addCellGroup(i)}const{width:M,height:B}=A9(o,r,s,l,a,h,g,f,i,c);return l-=h[1]+h[3],a-=h[0]+h[2],i.forEachChildren(P=>{d==="center"?P.setAttribute("x",h[3]+P.attribute.x+(l-M)/2):d==="right"?P.setAttribute("x",h[3]+P.attribute.x+l-M):P.setAttribute("x",h[3]+P.attribute.x),u==="middle"?P.setAttribute("y",h[0]+P.attribute.y+(a-B)/2):u==="bottom"?P.setAttribute("y",h[0]+P.attribute.y+a-B):P.setAttribute("y",h[0]+P.attribute.y)}),i}function A9(i,t,e,n,o,r,s,l,a,h){var d,u;const c=h._getCellStyle(i,t);let g=wt("size",c,i,t,h),f=wt("innerRadius",c,i,t,h),p=wt("outerRadius",c,i,t,h);const m=wt("spaceBetweenTextAndIcon",c,i,t,h),b=wt("spaceBetweenRadio",c,i,t,h),C=wt("defaultFill",c,i,t,h),_=wt("defaultStroke",c,i,t,h),w=wt("disableFill",c,i,t,h),y=wt("checkedFill",c,i,t,h),S=wt("checkedStroke",c,i,t,h),A=wt("disableCheckedFill",c,i,t,h),R=wt("disableCheckedStroke",c,i,t,h);ft(p)?g=2*p:p=Math.round(g/2),(!ft(f)||f<0)&&(f=Math.round(p/7*3));const x=h.getCellValue(i,t),T=h.getCellOriginValue(i,t),M=lo(i,t,h),B=h._getCellStyle(i,t),P=(d=B.autoWrapText)!==null&&d!==void 0?d:h.internalProps.autoWrapText,{lineClamp:F}=B,H=e==="auto",E=h.heightMode==="autoHeight",k={maxLineWidth:H?1/0:n-(r[1]+r[3]+M)-g-m,textBaseline:"top",autoWrapText:P,lineClamp:F,wordBreak:"break-word",heightLimit:E?-1:o-Math.floor(r[0]+r[2]),pickable:!1,dx:M},I={x:0,y:0,text:s.text?Object.assign({},s.text,k):k,circle:{innerRadius:f,outerRadius:p},spaceBetweenTextAndIcon:m};C&&(I.circle.fill=C),_&&(I.circle.stroke=_),w&&(I.circle.disableFill=w),y&&(I.circle.checkedFill=y),S&&(I.circle.checkedStroke=S),A&&(I.circle.disableCheckedFill=A),R&&(I.circle.disableCheckedStroke=R);let L=0,D=0;const O=(u=l.radioDirectionInCell)!==null&&u!==void 0?u:"vertical";if(lt(x))x.forEach((N,W)=>{const $=wT(N,T,W,i,t,l,P,I,h);$&&a.appendChild($),$.id=`radio-${i}-${t}-${W}`,$.render();const U=$.AABBBounds;O==="vertical"?($.setAttribute("y",D),D+=U.height()+(W!==x.length-1?b:0),L=Math.max(L,U.width())):O==="horizontal"&&($.setAttribute("x",L),L+=U.width()+(W!==x.length-1?b:0),D=Math.max(D,U.height()))});else{const N=wT(x,T,void 0,i,t,l,P,I,h);N&&a.appendChild(N),N.id=`radio-${i}-${t}`,N.render();const W=N.AABBBounds;L=W.width(),D=W.height()}return{width:L,height:D}}function wT(i,t,e,n,o,r,s,l,a){const h=T9(i,t,e,n,o,r,a),d=M9(i,t,n,o,r,a),u=ge(i)?i.text:bi(i)?"":i??"",c=xt({},l,{checked:h,disabled:d,text:{text:u.length===1?u[0]:u,whiteSpace:u.length!==1||s?"normal":"no-wrap"},boundsPadding:0}),g=new Qa(c);return g.name="radio",g}function T9(i,t,e,n,o,r,s){var l,a;const h=(l=r.radioCheckType)!==null&&l!==void 0?l:"column";let d,u;return ge(i)?d=i.checked:typeof i=="boolean"&&(d=i),d=s.stateManager.syncRadioState(n,o,r.field,h,e,d),d!=null&&typeof d!="function"||(u=ii(r.checked,{col:n,row:o,table:s,context:null,value:i,dataValue:t}),d=s.stateManager.syncRadioState(n,o,r.field,h,e,u)),(a=d??u)!==null&&a!==void 0&&a}function M9(i,t,e,n,o,r){var s;let l;ge(i)&&(l=i.disable);const a=ii(o.disable,{col:e,row:n,table:r,context:null,value:i,dataValue:t});return(s=l??a)!==null&&s!==void 0&&s}const Dr=new tz,Or=new ds;function B9(i,t,e,n,o,r,s,l,a,h,d,u){var c,g,f,p,m,b,C,_,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L;if(!i){const O=ws(o,r,d,h);u&&(i=h.scenegraph.highPerformanceGetCell(o,r,!0))&&i.role==="cell"&&i.setAttributes({x:e,y:n,width:s,height:l,lineWidth:(g=(c=d==null?void 0:d.group)===null||c===void 0?void 0:c.lineWidth)!==null&&g!==void 0?g:void 0,fill:(p=(f=d==null?void 0:d.group)===null||f===void 0?void 0:f.fill)!==null&&p!==void 0?p:void 0,stroke:(b=(m=d==null?void 0:d.group)===null||m===void 0?void 0:m.stroke)!==null&&b!==void 0?b:void 0,strokeArrayWidth:O,strokeArrayColor:(_=(C=d==null?void 0:d.group)===null||C===void 0?void 0:C.strokeArrayColor)!==null&&_!==void 0?_:void 0,cursor:(y=(w=d==null?void 0:d.group)===null||w===void 0?void 0:w.cursor)!==null&&y!==void 0?y:void 0,lineDash:(A=(S=d==null?void 0:d.group)===null||S===void 0?void 0:S.lineDash)!==null&&A!==void 0?A:void 0,lineCap:"butt",clip:!0,cornerRadius:d.group.cornerRadius}),i&&i.role==="cell"||((i=new de({x:e,y:n,width:s,height:l,lineWidth:(x=(R=d==null?void 0:d.group)===null||R===void 0?void 0:R.lineWidth)!==null&&x!==void 0?x:void 0,fill:(M=(T=d==null?void 0:d.group)===null||T===void 0?void 0:T.fill)!==null&&M!==void 0?M:void 0,stroke:(P=(B=d==null?void 0:d.group)===null||B===void 0?void 0:B.stroke)!==null&&P!==void 0?P:void 0,strokeArrayWidth:O,strokeArrayColor:(H=(F=d==null?void 0:d.group)===null||F===void 0?void 0:F.strokeArrayColor)!==null&&H!==void 0?H:void 0,cursor:(k=(E=d==null?void 0:d.group)===null||E===void 0?void 0:E.cursor)!==null&&k!==void 0?k:void 0,lineDash:(L=(I=d==null?void 0:d.group)===null||I===void 0?void 0:I.lineDash)!==null&&L!==void 0?L:void 0,lineCap:"butt",clip:!0,cornerRadius:d.group.cornerRadius})).role="cell",i.col=o,i.row=r,t==null||t.addCellGroup(i))}const D=P9(o,r,s,l,a,h);return D&&i.appendChild(D),i}function P9(i,t,e,n,o,r){let s,l;const a=r.internalProps.layoutMap.getBody(i,t).sparklineSpec,h=r.getCellValue(i,t);if(!Array.isArray(h))return;const d=o[3],u=o[0];e-=o[1]+o[3];const c=n-=o[0]+o[2];if(typeof a=="function"){const _={col:i,row:t,dataValue:r.getCellOriginValue(i,t)||"",value:r.getCellValue(i,t)||"",rect:r.getCellRangeRelativeRect(r.getCellRange(i,t)),table:r};s=a(_),l=ST(s,d,u,e,n)}else s=a,l=ST(a,d,u,e,n);const g=[],f=[];let p,m;if(typeof s.xField=="object")Dr.domain(s.xField.domain),p=s.xField.field;else if(typeof s.xField=="string"){const _=h.map(w=>w[s.xField]);Dr.domain(_),p=s.xField}else Array.isArray(h)&&(Dr.domain(Array.from({length:h.length},(_,w)=>w)),p=s.xField);if(Dr.range([0,e]),typeof s.yField=="object")Or.domain(s.yField.domain),m=s.yField.field;else if(typeof s.yField=="string"){const _=xT(h,s.yField);Or.domain([Math.min(..._),Math.max(..._)]),m=s.yField}else if(Array.isArray(h)){const _=xT(h);Or.domain([Math.min(..._),Math.max(..._)]),m=s.yField}if(Or.range([0,n]),typeof s.xField=="object"&&Array.isArray(s.xField.domain)){const _=h.map(y=>y[s.xField.field]),w=s.xField.domain;for(let y=0;y<w.length;y++){let S=!1;for(let A=0;A<_.length;A++)if(w[y]===_[A]){const R=h[A];if(!z(R[p])||!z(R[m]))break;g.push({x:0+Dr.scale(R[p]),y:c-Or.scale(R[m]),defined:z(R[m])}),f.push(R),S=!0;break}S||(g.push({x:0+Dr.scale(w[y]),y:0,defined:!1}),f.push({[p]:w[y],[m]:null}))}}else for(let _=0;_<h.length;_++){const w=h[_];g.push({x:0+Dr.scale(p?w[p]:_),y:c-Or.scale(m?w[m]:w),defined:z(m?w[m]:w),rawData:w}),f.push(w)}const b=l.getChildByName("sparkline-line");b&&b.setAttribute("points",g),b.bandwidth=Dr.step(),b.min=Or.range()[0],b.max=Or.range()[1];const C=l.getChildByName("sparkline-symbol-group");if(C){const _=s.pointShowRule==="isolatedPoint";if(s.pointShowRule==="all")for(let w=0;w<g.length;w++){const{x:y,y:S,defined:A}=g[w];if(A){const R=Ea({x:y,y:S});C.appendChild(R)}}else if(_)for(let w=0;w<g.length;w++){const{x:y,y:S,defined:A}=g[w];if(A&&(!g[w-1]||!g[w-1].defined)&&(!g[w+1]||!g[w+1].defined)){const R=Ea({x:y,y:S});C.appendChild(R)}}}return l}function ST(i,t,e,n,o){var r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,A,R,x,T;let M;M=typeof i=="function"?i(null):i;const B=new de({x:t,y:e,width:n,height:o,stroke:!1,fill:!1});if(B.name="sparkline",M.type==="line"){const P=fn({x:0,y:0,curveType:M.smooth?"monotoneX":"linear",stroke:(l=(s=(r=M.line)===null||r===void 0?void 0:r.style)===null||s===void 0?void 0:s.stroke)!==null&&l!==void 0?l:"blue",lineWidth:(d=(h=(a=M.line)===null||a===void 0?void 0:a.style)===null||h===void 0?void 0:h.strokeWidth)!==null&&d!==void 0?d:2});P.name="sparkline-line",B.addChild(P),M.crosshair&&(P.hover=(c=(u=M.crosshair)===null||u===void 0?void 0:u.style)!==null&&c!==void 0?c:{stroke:"#000",interpolate:"linear"});const F=new de({x:0,y:0,width:n,height:o,stroke:!1,fill:!1});F.name="sparkline-symbol-group",F.setTheme({symbol:{stroke:(p=(f=(g=M.point)===null||g===void 0?void 0:g.style)===null||f===void 0?void 0:f.stroke)!==null&&p!==void 0?p:"#000",lineWidth:(C=(b=(m=M.point)===null||m===void 0?void 0:m.style)===null||b===void 0?void 0:b.strokeWidth)!==null&&C!==void 0?C:1,fill:(y=(w=(_=M.point)===null||_===void 0?void 0:_.style)===null||w===void 0?void 0:w.fill)!==null&&y!==void 0?y:"#000",size:2*((R=(A=(S=M.point)===null||S===void 0?void 0:S.style)===null||A===void 0?void 0:A.size)!==null&&R!==void 0?R:3),symbolType:"circle"}}),B.addChild(F),F.hover=(T=(x=M.point)===null||x===void 0?void 0:x.hover)!==null&&T!==void 0&&T}return B}function xT(i,t){const e=[];for(let n=0;n<i.length;n++){const o=i[n];z(t)&&z(o[t])?e.push(o[t]):!z(t)&&z(o)&&e.push(o)}return e}const fv=vn();function H9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m){var b,C,_,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht;const gt=g._getCellStyle(n,o),Ct=Lc("padding",gt,n,o,g);!((b=g.options.customConfig)===null||b===void 0)&&b.imageMargin?h=Qt((C=g.options.customConfig)===null||C===void 0?void 0:C.imageMargin):z(Ct)&&(h=Ct),!((_=f==null?void 0:f.text)===null||_===void 0)&&_.textAlign&&(d=(w=f==null?void 0:f.text)===null||w===void 0?void 0:w.textAlign),!((y=f==null?void 0:f.text)===null||y===void 0)&&y.textBaseline&&(u=(S=f==null?void 0:f.text)===null||S===void 0?void 0:S.textBaseline);const Q=ws(n,o,f,g);let et,vt;if(m&&(et=g.scenegraph.highPerformanceGetCell(n,o,!0),et&&et.role==="cell"&&et.setAttributes({x:t,y:e,width:r,height:s,lineWidth:(R=(A=f==null?void 0:f.group)===null||A===void 0?void 0:A.lineWidth)!==null&&R!==void 0?R:void 0,fill:(T=(x=f==null?void 0:f.group)===null||x===void 0?void 0:x.fill)!==null&&T!==void 0?T:void 0,stroke:(B=(M=f==null?void 0:f.group)===null||M===void 0?void 0:M.stroke)!==null&&B!==void 0?B:void 0,strokeArrayWidth:Q,strokeArrayColor:(F=(P=f==null?void 0:f.group)===null||P===void 0?void 0:P.strokeArrayColor)!==null&&F!==void 0?F:void 0,cursor:(E=(H=f==null?void 0:f.group)===null||H===void 0?void 0:H.cursor)!==null&&E!==void 0?E:void 0,lineDash:(I=(k=f==null?void 0:f.group)===null||k===void 0?void 0:k.lineDash)!==null&&I!==void 0?I:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius})),et&&et.role==="cell"||(et=new de({x:t,y:e,width:r,height:s,lineWidth:(D=(L=f==null?void 0:f.group)===null||L===void 0?void 0:L.lineWidth)!==null&&D!==void 0?D:void 0,fill:(N=(O=f==null?void 0:f.group)===null||O===void 0?void 0:O.fill)!==null&&N!==void 0?N:void 0,stroke:($=(W=f==null?void 0:f.group)===null||W===void 0?void 0:W.stroke)!==null&&$!==void 0?$:void 0,strokeArrayWidth:Q,strokeArrayColor:(Y=(U=f==null?void 0:f.group)===null||U===void 0?void 0:U.strokeArrayColor)!==null&&Y!==void 0?Y:void 0,cursor:(G=(j=f==null?void 0:f.group)===null||j===void 0?void 0:j.cursor)!==null&&G!==void 0?G:void 0,lineDash:(ht=(X=f==null?void 0:f.group)===null||X===void 0?void 0:X.lineDash)!==null&&ht!==void 0?ht:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius}),et.role="cell",et.col=n,et.row=o,i==null||i.addCellGroup(et)),c){let _t=n,ct=o;p&&(_t=p.start.col,ct=p.start.row),vt=g.getCellIcons(_t,ct)}let bt=0,dt=0;if(Array.isArray(vt)&&vt.length!==0){const{leftIconWidth:_t,rightIconWidth:ct,absoluteLeftIconWidth:Wt,absoluteRightIconWidth:Yt}=Dc(vt,et,p,g);bt=_t,dt=ct,et.forEachChildren(yt=>{yt.role==="icon-left"?yt.setAttribute("x",yt.attribute.x+h[3]):yt.role==="icon-right"?yt.setAttribute("x",yt.attribute.x+r-ct-h[1]):yt.role==="icon-absolute-right"&&yt.setAttribute("x",yt.attribute.x+r-Yt-h[1])}),et.forEachChildren(yt=>{u==="middle"?yt.setAttribute("y",(s-yt.AABBBounds.height())/2):u==="bottom"?yt.setAttribute("y",s-yt.AABBBounds.height()-h[2]):yt.setAttribute("y",h[0])}),et._cellLeftIconWidth=bt,et._cellRightIconWidth=dt}const ot=g.getCellValue(n,o),ut=document.createElement("video");ut.addEventListener("loadeddata",()=>{a&&dR(n,o,ut.videoWidth,ut.videoHeight,g.scenegraph,h,et);const{width:_t,height:ct,isMerge:Wt}=wl(et,g);if(l){const{width:_e,height:Oe}=Ec(ut.videoWidth,ut.videoHeight,_t-h[1]-h[3],ct-h[0]-h[2]),He=Bm(0,0,_t,ct,_e,Oe,d,u,h);st.setAttributes({width:_e,height:Oe,x:He.x,y:He.y,dx:0})}else st.setAttributes({x:h[3],y:h[0],width:_t-h[1]-h[3],height:ct-h[2]-h[0],dy:0});Wt&&Pm(et.mergeStartCol,et.mergeEndCol,et.mergeStartRow,et.mergeEndRow,g);const{width:Yt,height:yt}=wl(et,g),mt=Math.floor(Math.min(Yt-h[1]-h[3],yt-h[2]-h[0])/2),ie=0+(Yt>st.attribute.width?st.attribute.x-0+st.attribute.width/2:Yt/2),le=0+(yt>st.attribute.height?st.attribute.y-0+st.attribute.height/2:yt/2),Zt=new ps({x:ie-mt/2,y:le-mt/2,width:mt,height:mt,image:fv.play.svg,cursor:fv.play.cursor});Zt.name="play-icon",et.appendChild(Zt),g.scenegraph.updateNextFrame()}),ut.onerror=()=>{st.image=fv.damage_pic.svg},ut.src=ot,ut.setAttribute("preload","auto");const st=gu({x:h[3],y:h[0],width:r-h[1]-h[3],height:s-h[2]-h[0],image:ut,cursor:"pointer"});return st.name="image",st.keepAspectRatio=l,st.textAlign=d,st.textBaseline=u,et.appendChild(st),et}function E9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C){var _,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht,gt,Ct,Q,et;const vt=i._getCellStyle(r,s),bt=Lc("padding",vt,r,s,i);z(bt)&&(d=bt),!((_=m==null?void 0:m.text)===null||_===void 0)&&_.textAlign&&(u=(w=m==null?void 0:m.text)===null||w===void 0?void 0:w.textAlign),!((y=m==null?void 0:m.text)===null||y===void 0)&&y.textBaseline&&(c=(S=m==null?void 0:m.text)===null||S===void 0?void 0:S.textBaseline);const dt=i.isAutoRowHeight(s),ot=l==="auto",ut=(A=vt.autoWrapText)!==null&&A!==void 0?A:i.internalProps.autoWrapText,st=vt.lineClamp,_t=ws(r,s,m,i);let ct;if(C&&(ct=i.scenegraph.getCell(r,s,!0),ct&&ct.role==="cell"&&ct.setAttributes({x:n,y:o,width:a,height:h,lineWidth:(x=(R=m==null?void 0:m.group)===null||R===void 0?void 0:R.lineWidth)!==null&&x!==void 0?x:void 0,fill:(M=(T=m==null?void 0:m.group)===null||T===void 0?void 0:T.fill)!==null&&M!==void 0?M:void 0,stroke:(P=(B=m==null?void 0:m.group)===null||B===void 0?void 0:B.stroke)!==null&&P!==void 0?P:void 0,strokeArrayWidth:_t??void 0,strokeArrayColor:(H=(F=m==null?void 0:m.group)===null||F===void 0?void 0:F.strokeArrayColor)!==null&&H!==void 0?H:void 0,cursor:(k=(E=m==null?void 0:m.group)===null||E===void 0?void 0:E.cursor)!==null&&k!==void 0?k:void 0,lineDash:(L=(I=m==null?void 0:m.group)===null||I===void 0?void 0:I.lineDash)!==null&&L!==void 0?L:void 0,lineCap:"butt",clip:!0,cornerRadius:m.group.cornerRadius})),ct&&ct.role==="cell"||(ct=new de({x:n,y:o,width:a,height:h,lineWidth:(O=(D=m==null?void 0:m.group)===null||D===void 0?void 0:D.lineWidth)!==null&&O!==void 0?O:void 0,fill:(W=(N=m==null?void 0:m.group)===null||N===void 0?void 0:N.fill)!==null&&W!==void 0?W:void 0,stroke:(U=($=m==null?void 0:m.group)===null||$===void 0?void 0:$.stroke)!==null&&U!==void 0?U:void 0,strokeArrayWidth:_t??void 0,strokeArrayColor:(j=(Y=m==null?void 0:m.group)===null||Y===void 0?void 0:Y.strokeArrayColor)!==null&&j!==void 0?j:void 0,cursor:(X=(G=m==null?void 0:m.group)===null||G===void 0?void 0:G.cursor)!==null&&X!==void 0?X:void 0,lineDash:(gt=(ht=m==null?void 0:m.group)===null||ht===void 0?void 0:ht.lineDash)!==null&&gt!==void 0?gt:void 0,lineCap:"butt",clip:!0,cornerRadius:m.group.cornerRadius}),ct.role="cell",ct.col=r,ct.row=s,e==null||e.addCellGroup(ct)),f&&ct.appendChild(f),p){const Wt=t;let Yt;if(g){let yt=r,mt=s;b&&(yt=b.start.col,mt=b.start.row),Yt=i.getCellIcons(yt,mt)}if(Y6(ct,Yt,Wt,d,ot,dt,ut,typeof st=="number"?st:void 0,ct.attribute.width,ct.attribute.height,u,c,i,m,b),(Ct=m==null?void 0:m._vtable)===null||Ct===void 0?void 0:Ct.marked){const yt=n0({x:ct.attribute.width,y:0,startAngle:Math.PI/2,endAngle:Math.PI,outerRadius:6,fill:"#3073F2",pickable:!1});yt.name="mark",ct.appendChild(yt)}}return f&&ct.setAttributes({width:Math.max(ct.attribute.width,(Q=f.attribute.width)!==null&&Q!==void 0?Q:0),height:Math.max(ct.attribute.height,(et=f.attribute.height)!==null&&et!==void 0?et:0)}),ct}function L9(i,t,e,n,o,r,s,l,a,h){var d,u,c,g,f,p;i.dependField&&(o=(u=(d=a.getCellOriginRecord(r,s))===null||d===void 0?void 0:d[i.dependField])!==null&&u!==void 0?u:o),i.barType=(c=i.barType)!==null&&c!==void 0?c:"default",i.min=(g=ii(i.min,{col:r,row:s,table:a,value:n,dataValue:o,cellHeaderPaths:void 0}))!==null&&g!==void 0?g:0,i.max=(f=ii(i.max,{col:r,row:s,table:a,value:n,dataValue:o,cellHeaderPaths:void 0}))!==null&&f!==void 0?f:i.min+100;let m=0;m=h?a.getRowsHeight(h.start.row,h.end.row):a.getRowHeight(s);let b=e,C=m,_=0;ft(a.theme._contentOffset)&&(_=a.theme._contentOffset);const w=new de({x:-_,y:-_,width:b,height:C});w.name="progress-bar";const{showBar:y,barColor:S,barBgColor:A,barPositiveColor:R,barNegativeColor:x,barAxisColor:T,barRightToLeft:M,showBarMark:B,barMarkPositiveColor:P,barMarkNegativeColor:F,barMarkWidth:H,barMarkPosition:E}=t;let{barHeight:k,barBottom:I,barPadding:L}=t;L.length===1?L=[L[0],L[0],L[0],L[0]]:L.length===2?L=[L[0],L[1],L[0],L[1]]:L.length===3&&(L=[L[0],L[1],L[2],L[1]]),L=L.map((G,X)=>{if(typeof G=="string"&&pc.endsWith(G,"%")){const ht=Number(G.substr(0,G.length-1));return X===0||X===2?m*ht/100:e*ht/100}return Number(G)});const D=Qt(wt("borderLineWidth",t,r,s,a)),O=Math.max(L[0],Math.ceil(D[0]/2)),N=Math.max(L[1],Math.floor(D[1]/2)),W=Math.max(L[2],Math.floor(D[2]/2)),$=Math.max(L[3],Math.ceil(D[3]/2));b-=N+$,C-=W+O,s===a.rowCount-1&&[0,"0"].includes(I)&&(C-=1);const U=O,Y=$,j=b;if(typeof k=="string"&&pc.endsWith(k,"%")?(k=Number(k.substr(0,k.length-1)),k=C*k/100):k=Number(k),typeof I=="string"&&pc.endsWith(I,"%")?(I=Number(I.substr(0,I.length-1)),I=C*I/100):I=Number(I),ii(y,{col:r,row:s,table:a,context:null,value:n,dataValue:o})){let G=`${o}`;pc.endsWith(G,"%")&&(G=G.substr(0,G.length-1));const X=Number(G);if(isNaN(X))return w;if(((p=i.barType)!==null&&p!==void 0?p:"default")==="default"){const ht=X<i.min?0:X>i.max?1:(X-i.min)/(i.max-i.min),gt=b,Ct=U+C-k-I;let Q=Math.min(gt*ht,gt);const et=M?Y+j-Q:Y;r!==a.colCount-1||ht!==1||M||(Q-=1);const vt=ii(A,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:ht});if(vt){const ot=Fe({x:et,y:Ct,width:gt,height:k,fill:vt});w.addChild(ot)}const bt=ii(S,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:ht})||"#20a8d8",dt=Fe({x:et,y:Ct,width:Q,height:k,fill:bt});w.addChild(dt)}else if(i.barType==="negative"){const ht=i.min<0?-i.min:0,gt=i.max>0?i.max:0,Ct=ht/(ht+gt),Q=1-Ct,et=X>0?X/gt:0,vt=X<0?-X/ht:0,bt=b,dt=U+C-k-I,ot=Y,ut=ii(A,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:et});if(ut){const He=Fe({x:ot,y:dt,width:bt,height:k,fill:ut});w.addChild(He)}const st=M?Q*bt:Ct*bt,_t=Math.min(bt*Ct*vt,bt),ct=M?{left:ot+st,top:dt,width:_t,height:k}:{left:ot+st-_t,top:dt,width:_t,height:k},Wt=ii(x,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:vt})||"#20a8d8",Yt=Fe({x:ct.left,y:ct.top,width:ct.width,height:ct.height,fill:Wt});w.addChild(Yt);let yt=Math.min(bt*Q*et,bt);r!==a.colCount-1||et!==1||M||(yt-=1);const mt=M?{left:ot+st-yt,top:dt,width:yt,height:k}:{left:ot+st,top:dt,width:yt,height:k},ie=ii(R,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:et})||"#20a8d8",le=Fe({x:mt.left,y:mt.top,width:mt.width,height:mt.height,fill:ie});w.addChild(le);const Zt=M?ct.left:mt.left,_e=ii(T,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:et}),Oe=fn({x:0,y:0,stroke:_e,lineWidth:1,lineDash:[2,2],points:[{x:Zt,y:0},{x:Zt,y:m}]});if(w.addChild(Oe),B&&(et||vt)){const He=H,Ht=[];let Et;if(et>0)if(Et=ii(P,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:et})||"#20a8d8",E==="right"){const Tt=M?mt.left+H/2:mt.left+mt.width-H/2;Ht.push({x:Tt,y:mt.top}),Ht.push({x:Tt,y:mt.top+mt.height})}else E==="bottom"&&(Ht.push({x:mt.left,y:mt.top+mt.height-H/2}),Ht.push({x:mt.left+mt.width,y:mt.top+mt.height-H/2}));else if(vt>0)if(Et=ii(F,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:vt})||"#20a8d8",E==="right"){const Tt=M?ct.left+ct.width-H/2:ct.left+H/2;Ht.push({x:Tt,y:ct.top}),Ht.push({x:Tt,y:ct.top+ct.height})}else E==="bottom"&&(Ht.push({x:ct.left,y:ct.top+ct.height-H/2}),Ht.push({x:ct.left+ct.width,y:ct.top+ct.height-H/2}));const Rt=fn({x:0,y:0,stroke:Et,lineWidth:He,points:Ht});w.addChild(Rt)}}else if(i.barType==="negative_no_axis"){const ht=i.min<0?-i.min:0,gt=i.max>0?i.max:0,Ct=Math.max(ht,gt),Q=Ct===0?0:Math.abs(X)/Ct,et=b;let vt=Math.min(et*Q,et);r!==a.colCount-1||Q!==1||M||(vt-=1);const bt=U+C-k-I,dt=M?Y+j-vt:Y,ot=ii(A,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:Q});if(ot){const ct=Fe({x:dt,y:bt,width:et,height:k,fill:ot});w.addChild(ct)}const ut={left:dt,top:bt,width:vt,height:k};let st;st=X>=0?ii(R,{col:r,row:s,table:a,context:null,value:n,percentile:Q,dataValue:o})||"#20a8d8":ii(x,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:Q})||"#20a8d8";const _t=Fe({x:ut.left,y:ut.top,width:ut.width,height:ut.height,fill:st});if(w.addChild(_t),B&&X){const ct=H,Wt=[];let Yt;if(Yt=X>=0?ii(P,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:Q})||"#20a8d8":ii(F,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:Q})||"#20a8d8",E==="right"){const mt=M?ut.left+H/2:ut.left+ut.width-H/2;Wt.push({x:mt,y:ut.top}),Wt.push({x:mt,y:ut.top+ut.height})}else E==="bottom"&&(Wt.push({x:ut.left,y:ut.top+ut.height-H/2}),Wt.push({x:ut.left+ut.width,y:ut.top+ut.height-H/2}));const yt=fn({x:0,y:0,stroke:Yt,lineWidth:ct,points:Wt});w.addChild(yt)}}}return w}function k9(i,t,e,n,o,r){var s,l,a,h,d,u,c,g,f;if(e!=null&&e.zero&&(i=Math.min(i,0),t=Math.max(t,0)),e==null?void 0:e.expand){const b=i,C=t;z(e.expand.min)&&(i=b-(C-b)*e.expand.min),z(e.expand.max)&&(t=C+(C-b)*e.expand.max)}let p,m;if(ft(e==null?void 0:e.min)&&(i=e.min),ft(e==null?void 0:e.max)&&(t=e.max),(e==null?void 0:e.type)==="log"?(p=new Ya,p.base((s=e==null?void 0:e.base)!==null&&s!==void 0?s:10)):(e==null?void 0:e.type)==="symlog"?(p=new Xa,p.constant((l=e==null?void 0:e.constant)!==null&&l!==void 0?l:10)):p=new ds,p.domain([i,t],!!(e!=null&&e.nice)),e==null?void 0:e.nice){let b=(u=(h=(a=e.tick)===null||a===void 0?void 0:a.forceTickCount)!==null&&h!==void 0?h:(d=e.tick)===null||d===void 0?void 0:d.tickCount)!==null&&u!==void 0?u:10;ue(b)&&(b=b({axisLength:o,labelStyle:(g=(c=e==null?void 0:e.label)===null||c===void 0?void 0:c.style)!==null&&g!==void 0?g:{fontSize:Eh.LABEL_FONT_SIZE}})),e.niceType==="accurateFirst"&&(b=Math.max(10,b)),Mt(e.min)&&Mt(e.max)?p.nice(b):z(e.min)&&Mt(e.max)?p.niceMax(b):Mt(e.min)&&z(e.max)&&p.niceMin(b)}return delete p._niceType,r||(m=p.ticks(ft(e==null?void 0:e.tickCount)?e==null?void 0:e.tickCount:5,{noDecimals:(f=e==null?void 0:e.tick)===null||f===void 0?void 0:f.noDecimals})),{range:p.domain(),ticks:m}}const kg=()=>{Bt.registerFunction("createChartCellGroup",w9),Bt.registerFunction("getAxisDomainRangeAndLabels",k9)},Fg=()=>{Bt.registerFunction("createCheckboxCellGroup",S9)},Ig=()=>{Bt.registerFunction("createImageCellGroup",Z6)},Dg=()=>{Bt.registerFunction("createProgressBarCell",L9)},Og=()=>{Bt.registerFunction("createRadioCellGroup",R9)},zg=()=>{Bt.registerFunction("createSparkLineCellGroup",B9)},Il=()=>{Bt.registerFunction("createTextCellGroup",E9)},Wg=()=>{Bt.registerFunction("createVideoCellGroup",H9)};Mg(),Bg(),Pg(),Hg(),Eg(),Lg(),C9(),kg(),Fg(),Ig(),Dg(),Og(),zg(),Il(),Wg();class F9 extends fT{}Il();class I9 extends fT{}function D9(i,t,e,n,o,r){const s=r.columnHeaderLevelCount,l=[],a=[];for(let c=0;c<e.length;c++)n.includes(e[c])||a.push(o[c]);for(let c=0;c<n.length;c++)if(!e.includes(n[c])){const g={col:i,row:s+c};l.push(g)}let h=r.getParentCellId(i,t),d=r.getRowHeaderCellAddressByCellId(h);const u=[];for(d&&u.push(d);h;)h=r.getParentCellId(d.col,d.row),h&&(d=r.getRowHeaderCellAddressByCellId(h),u.push(d));return{addCellPositions:l,removeCellPositions:a,updateCellPositions:u}}const RT={startInTotal:0,level:0};class lr{constructor(t,e,n,o){var r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y;this.colIndex=0,this._showHeader=!0,this.columnHeaderObjs=[],this.rowHeaderObjs=[],this._cornerHeaderCellFullPathIds=[],this._columnHeaderCellFullPathIds=[],this._rowHeaderCellFullPathIds=[],this._rowHeaderCellFullPathIds_FULL=[],this._cornerHeaderCellIds=[],this._columnHeaderCellIds=[],this._rowHeaderCellIds=[],this._rowHeaderCellIds_FULL=[],this._columnWidths=[],this.columnPaths=[],this._headerObjects=[],this._headerObjectMap={},this._indicators=[],this.indicatorsAsCol=!0,this.hideIndicatorName=!1,this._showRowHeader=!0,this._showColumnHeader=!0,this._indicatorShowType="column",this.rowHierarchyTextStartAlignment=!1,this.rowDimensionKeys=[],this.colDimensionKeys=[],this.indicatorKeys=[],this.indicatorDimensionKey=Xi,this._rowHeaderExtensionTree={},this._extensionRowDimensionKeys=[],this.fullRowDimensionKeys=[],this.leftRowSeriesNumberColumnCount=0,this.rightRowSeriesNumberColumnCount=0,this._useGetBodyCache=!1,this._getBodyCache=new Map,this._useHeaderPathCache=!1,this._colHeaderPathCache=new Map,this._rowHeaderPathCache=new Map,this.sharedVar=t.layoutNodeId,this._table=t,t.options.rowHierarchyType==="tree"&&(this.extensionRows=t.options.extensionRows),this.dataset=e,this._largeCellRangeCache=[],this._CellHeaderPathMap=new Map,this.rowTree=t.internalProps.rowTree,this.columnTree=t.internalProps.columnTree,this.rowsDefine=(r=t.internalProps.rows)!==null&&r!==void 0?r:[],this.columnsDefine=(s=t.internalProps.columns)!==null&&s!==void 0?s:[],this.indicatorsDefine=(l=t.internalProps.indicators)!==null&&l!==void 0?l:[],this.indicatorTitle=t.options.indicatorTitle,this.indicatorsAsCol=(a=t.options.indicatorsAsCol)===null||a===void 0||a,this.hideIndicatorName=(h=t.options.hideIndicatorName)!==null&&h!==void 0&&h,this.showRowHeader=(d=t.options.showRowHeader)===null||d===void 0||d,this.showColumnHeader=(u=t.options.showColumnHeader)===null||u===void 0||u,this.rowHeaderTitle=t.options.rowHeaderTitle,this.columnHeaderTitle=t.options.columnHeaderTitle,this.rowHierarchyType=(c=t.options.rowHierarchyType)!==null&&c!==void 0?c:"grid",this.rowExpandLevel=(g=t.options.rowExpandLevel)!==null&&g!==void 0?g:1,this.rowHierarchyIndent=(f=t.options.rowHierarchyIndent)!==null&&f!==void 0?f:20,this.rowHierarchyTextStartAlignment=t.options.rowHierarchyTextStartAlignment,this.cornerSetting=Object.assign({titleOnDimension:"column",forceShowHeader:!1},t.options.corner),e&&(this.rowTree=e.rowHeaderTree,this.columnTree=e.colHeaderTree),(p=this.indicatorsDefine)===null||p===void 0||p.forEach(x=>{typeof x=="string"?this.indicatorKeys.push(x):this.indicatorKeys.push(x.indicatorKey)}),this.columnDimensionTree=n,this.rowDimensionTree=o,this.colDimensionKeys=this.columnDimensionTree.dimensionKeysIncludeVirtual.valueArr(),this.rowDimensionKeys=this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr(),this.fullRowDimensionKeys=this.fullRowDimensionKeys.concat(this.rowDimensionKeys),this.resetRowHeaderLevelCount(),this._table.isPivotChart()&&(this.hasTwoIndicatorAxes=this.indicatorsDefine.some(x=>{var T,M;if(x.chartSpec&&x.chartSpec.series&&x.chartSpec.series.length>1){const B=(M=(T=x.chartSpec.axes)!==null&&T!==void 0?T:this._table.pivotChartAxes)!==null&&M!==void 0?M:[];if(!B.length||B.every(P=>P.orient!==(this.indicatorsAsCol?"top":"right")||P.visible!==!1))return!0}return!1})),this.resetColumnHeaderLevelCount(),this._generateColHeaderIds(),this.colIndex=0,this._generateRowHeaderIds(),this._rowHeaderCellFullPathIds_FULL=im(this._rowHeaderCellFullPathIds_FULL),t.options.rowHierarchyType==="tree"&&((m=this.extensionRows)===null||m===void 0?void 0:m.length)>=1&&(this.generateExtensionRowTree(),this.extensionRows.forEach(x=>{const T=[];x.rows.forEach(M=>{typeof M=="string"?T.push(M):T.push(M.dimensionKey)}),this._extensionRowDimensionKeys.push(T),this.fullRowDimensionKeys=this.fullRowDimensionKeys.concat(T)})),this.sharedVar.seqId=Math.max(this.sharedVar.seqId,this._headerObjects.length);let S,A=this.columnDimensionTree.dimensionKeysIncludeVirtual.valueArr();!this.dataset||this._table.isPivotChart()||((C=(b=this.dataset.records)===null||b===void 0?void 0:b.length)!==null&&C!==void 0?C:0)!==0||this.dataset.customColTree||(A=this.columnsDefine.map(x=>typeof x=="string"?x:x.dimensionKey),this.indicatorsAsCol&&A.push(this.indicatorDimensionKey)),A=this.columnHeaderTitle?[""].concat(A):A;let R=[];if(this.rowHierarchyType==="tree"&&((_=this.extensionRows)===null||_===void 0?void 0:_.length)>=1){const x=[];x.push(this.rowDimensionKeys[0]),this._extensionRowDimensionKeys.forEach(T=>{x.push(T[0])}),R=this.extensionRows.reduce((T,M)=>T.concat(M.rows),[]),S=this.rowHeaderTitle?[""].concat(x):x}else S=this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr(),!this.dataset||this._table.isPivotChart()||((y=(w=this.dataset.records)===null||w===void 0?void 0:w.length)!==null&&y!==void 0?y:0)!==0||this.dataset.customRowTree||(S=this.rowsDefine.map(x=>typeof x=="string"?x:x.dimensionKey),this.indicatorsAsCol||S.push(this.indicatorDimensionKey)),S=this.rowHeaderTitle?[""].concat(S):S;this.cornerHeaderObjs=this._addCornerHeaders(A,S,this.columnsDefine.concat(...this.rowsDefine,...R)),this.colIndex=0,this._headerObjectMap=this._headerObjects.reduce((x,T)=>(x[T.id]=T,x),{}),this.indicatorsAsCol&&!this.hideIndicatorName?this._indicatorShowType="column":this.indicatorsAsCol||this.hideIndicatorName?this._indicatorShowType="none":this._indicatorShowType="row",this.generateCellIdsConsiderHideHeader(),this.setPagination(t.options.pagination),this._table.isPivotChart()&&(this._chartItemSpanSize=0,this._chartItemBandSize=0,this._indicators.find(x=>{var T,M,B,P,F,H,E,k;!((T=x==null?void 0:x.style)===null||T===void 0)&&T.padding&&(this._chartPadding=x.style.padding),!((M=x.chartSpec)===null||M===void 0)&&M.barWidth&&typeof x.chartSpec.barWidth=="number"&&(this._chartItemSpanSize=(B=x.chartSpec)===null||B===void 0?void 0:B.barWidth);const I=(F=(P=x.chartSpec)===null||P===void 0?void 0:P.axes)===null||F===void 0?void 0:F.find(L=>L.type==="band");return I!=null&&I.bandSize&&(this._chartItemBandSize=I==null?void 0:I.bandSize,this._chartPaddingInner=(H=lt(I.paddingInner)?I.paddingInner[0]:I.paddingInner)!==null&&H!==void 0?H:0,this._chartPaddingOuter=(E=lt(I.paddingOuter)?I.paddingOuter[0]:I.paddingOuter)!==null&&E!==void 0?E:0),this._chartItemSpanSize>0||((k=x.chartSpec.series)===null||k===void 0||k.find(L=>(L.barWidth&&typeof L.barWidth=="number"&&(this._chartItemSpanSize=L.barWidth),this._chartItemSpanSize>0)),!1)})),this.handleRowSeriesNumber(t.internalProps.rowSeriesNumber),this.setColumnWidths()}handleRowSeriesNumber(t){var e,n;t&&(Array.isArray(t)?this.rowSeriesNumberColumn=t.map(o=>{var r,s;return{id:"",title:o.title,define:o,cellType:(r=o.cellType)!==null&&r!==void 0?r:"text",headerType:(s=o.cellType)!==null&&s!==void 0?s:"text",width:o.width,style:o.style,format:o.format,field:o.field,icon:o.icon}}):this.rowSeriesNumberColumn=[{id:"",title:t.title,define:t,cellType:(e=t.cellType)!==null&&e!==void 0?e:"text",headerType:(n=t.cellType)!==null&&n!==void 0?n:"text",style:t.style,width:t.width,format:t.format,field:"",icon:t.icon,isChildNode:!1}],this.leftRowSeriesNumberColumn=this.rowSeriesNumberColumn.filter(o=>!0),this.rightRowSeriesNumberColumn=this.rowSeriesNumberColumn.filter(o=>!1),this.leftRowSeriesNumberColumnCount=this.leftRowSeriesNumberColumn.length,this.rightRowSeriesNumberColumnCount=this.rightRowSeriesNumberColumn.length)}_generateColHeaderIds(){var t,e,n,o,r,s,l,a;if(((t=this.columnDimensionTree.tree.children)===null||t===void 0?void 0:t.length)>=1){let h=0;if(this.dataset&&!this._table.isPivotChart()&&((n=(e=this.dataset.records)===null||e===void 0?void 0:e.length)!==null&&n!==void 0?n:0)===0&&!this.dataset.customColTree&&!this.dataset.customRowTree&&this.indicatorsAsCol&&this.columnDimensionTree.totalLevel<this.columnHeaderLevelCount){h=this.columnHeaderLevelCount-this.columnDimensionTree.totalLevel;for(let d=0;d<h;d++)this._columnHeaderCellFullPathIds.unshift([])}this._addHeaders(this._columnHeaderCellFullPathIds,h,this.columnDimensionTree.tree.children,[],this.columnHeaderObjs)}if(this.columnHeaderTitle){this.sharedVar.seqId=Math.max(this.sharedVar.seqId,this._headerObjects.length);const h=++this.sharedVar.seqId,d=Array(this.colCount-this.rowHeaderLevelCount-this.rightFrozenColCount).fill(h);this._columnHeaderCellFullPathIds.unshift(d);const u={id:h,title:typeof this.columnHeaderTitle.title=="string"?this.columnHeaderTitle.title:this.columnsDefine.reduce((c,g)=>typeof g=="string"?c:c+(c?`/${g.title}`:`${g.title}`),""),field:void 0,headerType:(r=(o=this.columnHeaderTitle)===null||o===void 0?void 0:o.headerType)!==null&&r!==void 0?r:"text",style:(s=this.columnHeaderTitle)===null||s===void 0?void 0:s.headerStyle,define:{id:h,disableHeaderHover:!!(!((l=this.columnHeaderTitle)===null||l===void 0)&&l.disableHeaderHover),disableHeaderSelect:!!(!((a=this.columnHeaderTitle)===null||a===void 0)&&a.disableHeaderSelect)}};this.columnHeaderObjs.push(u),this._headerObjects[h]=u}}_generateRowHeaderIds(){var t,e,n,o,r,s,l,a,h,d;if(((t=this.rowDimensionTree.tree.children)===null||t===void 0?void 0:t.length)>=1)if(this.rowHierarchyType==="tree")this._addHeadersForTreeMode(this._rowHeaderCellFullPathIds_FULL,0,this.rowDimensionTree.tree.children,[],this.rowDimensionTree.totalLevel,!0,this.rowsDefine,this.rowHeaderObjs);else{let u=0;if(this.dataset&&!this._table.isPivotChart()&&((n=(e=this.dataset.records)===null||e===void 0?void 0:e.length)!==null&&n!==void 0?n:0)===0&&!this.dataset.customColTree&&!this.dataset.customRowTree&&!this.indicatorsAsCol&&this.rowDimensionTree.totalLevel<this.rowHeaderLevelCount){u=this.rowHeaderLevelCount-this.rowDimensionTree.totalLevel;for(let c=0;c<u;c++)this._rowHeaderCellFullPathIds_FULL.unshift([])}this._addHeaders(this._rowHeaderCellFullPathIds_FULL,u,this.rowDimensionTree.tree.children,[],this.rowHeaderObjs)}if(this.rowHeaderTitle){this.sharedVar.seqId=Math.max(this.sharedVar.seqId,this._headerObjects.length);const u=++this.sharedVar.seqId,c=Array((r=(o=this._rowHeaderCellFullPathIds_FULL[0])===null||o===void 0?void 0:o.length)!==null&&r!==void 0?r:this.rowDimensionTree.tree.size).fill(u);this._rowHeaderCellFullPathIds_FULL.unshift(c);const g={id:u,title:typeof this.rowHeaderTitle.title=="string"?this.rowHeaderTitle.title:this.rowsDefine.reduce((f,p)=>typeof p=="string"?f:f+(f?`/${p.title}`:`${p.title}`),""),field:void 0,headerType:(l=(s=this.rowHeaderTitle)===null||s===void 0?void 0:s.headerType)!==null&&l!==void 0?l:"text",style:(a=this.rowHeaderTitle)===null||a===void 0?void 0:a.headerStyle,define:{id:u,disableHeaderHover:!!(!((h=this.rowHeaderTitle)===null||h===void 0)&&h.disableHeaderHover),disableHeaderSelect:!!(!((d=this.rowHeaderTitle)===null||d===void 0)&&d.disableHeaderSelect)}};this.rowHeaderObjs.push(g),this._headerObjects[u]=g}}_addHeaders(t,e,n,o,r){const s=this;t[e]||function(l){const a=t[l]=[];if(s.colIndex===0)return a;const h=t[l-1];for(let d=0;d<(h==null?void 0:h.length);d++)a[d]=h[d]}(e);for(let l=0;l<n.length;l++){const a=n[l];R8(a,t,r,o,e,this)}}_addHeadersForTreeMode(t,e,n,o,r,s,l,a){const h=this;t[e]||function(d){const u=t[d]=[];if(h.colIndex===0)return u;const c=t[d-1];for(let g=0;g<(c==null?void 0:c.length);g++)u[g]=c[g]}(e);for(let d=0;d<n.length;d++){const u=n[d];A8(u,t,a,o,e,r,s,l,this)}}_addCornerHeaders(t,e,n){var o,r;const s=[];if(this.cornerSetting.titleOnDimension==="all")if(this.indicatorsAsCol){let l=-1;t&&t.forEach((a,h)=>{var d,u;a===this.indicatorDimensionKey&&(l=h);const c=++this.sharedVar.seqId,g=n.find(p=>typeof p!="string"&&p.dimensionKey===a),f={id:c,title:a===this.indicatorDimensionKey?this.indicatorTitle:g?g.title:a==="axis"?"":a,field:a,style:this.cornerSetting.headerStyle,headerType:(d=this.cornerSetting.headerType)!==null&&d!==void 0?d:"text",showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,define:{showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,dimensionKey:a,id:c,value:a,headerEditor:this.cornerSetting.headerEditor,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect},dropDownMenu:g==null?void 0:g.cornerDropDownMenu,headerIcon:g==null?void 0:g.cornerHeaderIcon,pivotInfo:{value:(u=g==null?void 0:g.title)!==null&&u!==void 0?u:"",dimensionKey:a,isPivotCorner:!0},description:g==null?void 0:g.cornerDescription};s[c]=f,this._headerObjects[c]=f,this._cornerHeaderCellFullPathIds[h]||(this._cornerHeaderCellFullPathIds[h]=[]);for(let p=0;p<this.rowHeaderLevelCount;p++)this._cornerHeaderCellFullPathIds[h][p]=c}),e&&e.forEach((a,h)=>{var d,u;const c=++this.sharedVar.seqId,g=n.find(p=>typeof p!="string"&&p.dimensionKey===a),f={id:c,title:a===this.indicatorDimensionKey?this.indicatorTitle:g?g.title:a==="axis"?"":a,field:a,style:this.cornerSetting.headerStyle,headerType:(d=this.cornerSetting.headerType)!==null&&d!==void 0?d:"text",showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,define:{showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,dimensionKey:a,id:c,value:a,headerEditor:this.cornerSetting.headerEditor,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect},dropDownMenu:g==null?void 0:g.cornerDropDownMenu,headerIcon:g==null?void 0:g.cornerHeaderIcon,pivotInfo:{value:(u=g==null?void 0:g.title)!==null&&u!==void 0?u:"",dimensionKey:a,isPivotCorner:!0},description:g==null?void 0:g.cornerDescription};s[c]=f,this._headerObjects[c]=f,this._cornerHeaderCellFullPathIds[l]||(this._cornerHeaderCellFullPathIds[l]=[]),this._cornerHeaderCellFullPathIds[l][h]=c})}else{let l=-1;e&&e.forEach((a,h)=>{var d,u;a===this.indicatorDimensionKey&&(l=h);const c=++this.sharedVar.seqId,g=n.find(p=>typeof p!="string"&&p.dimensionKey===a),f={id:c,title:a===this.indicatorDimensionKey?this.indicatorTitle:g?g.title:a==="axis"?"":a,field:a,style:this.cornerSetting.headerStyle,headerType:(d=this.cornerSetting.headerType)!==null&&d!==void 0?d:"text",showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,define:{showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,dimensionKey:a,id:c,value:a,headerEditor:this.cornerSetting.headerEditor,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect},dropDownMenu:g==null?void 0:g.cornerDropDownMenu,headerIcon:g==null?void 0:g.cornerHeaderIcon,pivotInfo:{value:(u=g==null?void 0:g.title)!==null&&u!==void 0?u:"",dimensionKey:a,isPivotCorner:!0},description:g==null?void 0:g.cornerDescription};s[c]=f,this._headerObjects[c]=f;for(let p=0;p<this.columnHeaderLevelCount;p++)this._cornerHeaderCellFullPathIds[p]||(this._cornerHeaderCellFullPathIds[p]=[]),this._cornerHeaderCellFullPathIds[p][h]=c}),t&&t.forEach((a,h)=>{var d,u;const c=++this.sharedVar.seqId,g=n.find(p=>typeof p!="string"&&p.dimensionKey===a),f={id:c,title:a===this.indicatorDimensionKey?this.indicatorTitle:g?g.title:a==="axis"?"":a,field:a,style:this.cornerSetting.headerStyle,headerType:(d=this.cornerSetting.headerType)!==null&&d!==void 0?d:"text",showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,define:{showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,dimensionKey:a,id:c,value:a,headerEditor:this.cornerSetting.headerEditor,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect},dropDownMenu:g==null?void 0:g.cornerDropDownMenu,headerIcon:g==null?void 0:g.cornerHeaderIcon,pivotInfo:{value:(u=g==null?void 0:g.title)!==null&&u!==void 0?u:"",dimensionKey:a,isPivotCorner:!0},description:g==null?void 0:g.cornerDescription};s[c]=f,this._headerObjects[c]=f,this._cornerHeaderCellFullPathIds[h][l]=c})}else if(this.cornerSetting.titleOnDimension==="row"||this.cornerSetting.titleOnDimension==="column"){const l=((o=this.cornerSetting)===null||o===void 0?void 0:o.titleOnDimension)==="row"?e:t;l&&l.forEach((a,h)=>{var d,u;const c=++this.sharedVar.seqId,g=n.find(p=>typeof p!="string"&&p.dimensionKey===a),f={id:c,title:a===this.indicatorDimensionKey?this.indicatorTitle:g?g.title:a==="axis"?"":a,field:a,style:this.cornerSetting.headerStyle,headerType:(d=this.cornerSetting.headerType)!==null&&d!==void 0?d:"text",showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,define:{showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,dimensionKey:a,id:c,value:a,headerCustomRender:this.cornerSetting.customRender,headerCustomLayout:this.cornerSetting.customLayout,headerEditor:this.cornerSetting.headerEditor,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect},dropDownMenu:g==null?void 0:g.cornerDropDownMenu,headerIcon:g==null?void 0:g.cornerHeaderIcon,pivotInfo:{value:(u=g==null?void 0:g.title)!==null&&u!==void 0?u:"",dimensionKey:a,isPivotCorner:!0},description:g==null?void 0:g.cornerDescription};if(s[c]=f,this._headerObjects[c]=f,this.cornerSetting.titleOnDimension==="column"){this._cornerHeaderCellFullPathIds[h]||(this._cornerHeaderCellFullPathIds[h]=[]);for(let p=0;p<this.rowHeaderLevelCount;p++)this._cornerHeaderCellFullPathIds[h][p]=c}else if(this.cornerSetting.titleOnDimension==="row")for(let p=0;p<this.columnHeaderLevelCount;p++)this._cornerHeaderCellFullPathIds[p]||(this._cornerHeaderCellFullPathIds[p]=[]),this._cornerHeaderCellFullPathIds[p][h]=c})}else{const l=++this.sharedVar.seqId,a={id:l,title:"",field:"维度名称",style:this.cornerSetting.headerStyle,headerType:(r=this.cornerSetting.headerType)!==null&&r!==void 0?r:"text",define:{dimensionKey:"维度名称",id:l,headerCustomRender:this.cornerSetting.customRender,headerCustomLayout:this.cornerSetting.customLayout,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect}};s[l]=a,this._headerObjects[l]=a;for(let h=0;h<this.columnHeaderLevelCount;h++)for(let d=0;d<this.rowHeaderLevelCount;d++)this._cornerHeaderCellFullPathIds[h]||(this._cornerHeaderCellFullPathIds[h]=[]),this._cornerHeaderCellFullPathIds[h][d]=l}return s}generateExtensionRowTree(){this.extensionRows.forEach((t,e)=>{const n=this._rowHeaderCellFullPathIds_FULL;this._rowHeaderCellFullPathIds_FULL=[],n.forEach((o,r)=>{const s=o[o.length-1];let l,a;if(this.colIndex=0,typeof t.rowTree=="function"){const d=this.findFullCellIds(o);l=t.rowTree(d.map(u=>({dimensionKey:this._headerObjects[u].field,value:this._headerObjects[u].title})))}else l=Ee(t.rowTree);this._rowHeaderExtensionTree[s]?(this._rowHeaderExtensionTree[s].reset(this._rowHeaderExtensionTree[s].tree.children,!0),a=this._rowHeaderExtensionTree[s]):(a=new Pe(l??[],this.sharedVar,this.rowHierarchyType,void 0),this._rowHeaderExtensionTree[s]=a);const h=[];this._addHeadersForTreeMode(h,0,a.tree.children,[],a.totalLevel,!0,t.rows,this.rowHeaderObjs);for(let d=0;d<h[0].length;d++)this._rowHeaderCellFullPathIds_FULL.push(o.concat(h[0][d]))})})}setColumnWidths(){var t,e,n;const o=new Array(this.colCount).fill(void 0);if(this.leftRowSeriesNumberColumnCount&&(o[0]=this.leftRowSeriesNumberColumn[0]),this.showHeader&&this.showRowHeader)if(this.rowHeaderTitle&&(o[0+this.leftRowSeriesNumberColumnCount]={}),this.rowHierarchyType==="tree"){const r=this.rowDimensionKeys[0];if(r){const s=(t=this.rowsDefine)===null||t===void 0?void 0:t.find(l=>typeof l!="string"&&l.dimensionKey===r);s&&(o[0+(this.rowHeaderTitle?1:0)+this.leftRowSeriesNumberColumnCount]={width:s.width,minWidth:s.minWidth,maxWidth:s.maxWidth})}(e=this._extensionRowDimensionKeys)===null||e===void 0||e.forEach((s,l)=>{var a;const h=s[0];if(h){const d=(a=this.extensionRows[l].rows)===null||a===void 0?void 0:a.find(u=>typeof u!="string"&&u.dimensionKey===h);d&&(o[l+1+(this.rowHeaderTitle?1:0)+this.leftRowSeriesNumberColumnCount]={width:d.width,minWidth:d.minWidth,maxWidth:d.maxWidth})}})}else(this.rowDimensionTree.totalLevel>0?this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr():this.rowsDefine.map(r=>typeof r=="string"?r:r.dimensionKey)).forEach((r,s)=>{var l;const a=(l=this.rowsDefine)===null||l===void 0?void 0:l.find(h=>typeof h!="string"&&h.dimensionKey===r);a&&(o[s+(this.rowHeaderTitle?1:0)+this.leftRowSeriesNumberColumnCount]={width:a.width,minWidth:a.minWidth,maxWidth:a.maxWidth})});if(this.indicatorsAsCol)for(let r=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount;r<this.colCount;r++){const s=this.getBody(r,this.columnHeaderLevelCount);o[r]={width:s==null?void 0:s.width,minWidth:s==null?void 0:s.minWidth,maxWidth:s==null?void 0:s.maxWidth}}else{let r,s,l,a=0;(n=this._indicators)===null||n===void 0||n.forEach((h,d)=>{var u,c;typeof h.width=="number"?a=Math.max(h.width,a):h.width==="auto"&&(l=!0),typeof h.minWidth=="number"&&(s=Math.max(h.minWidth,(u=s)!==null&&u!==void 0?u:0)),typeof h.maxWidth=="number"&&(r=Math.min(h.maxWidth,(c=r)!==null&&c!==void 0?c:Number.MAX_VALUE))}),a=a>0?a:l?"auto":void 0,o.fill({width:a,minWidth:s,maxWidth:r},this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount,this.colCount-this.rightFrozenColCount)}this._columnWidths=o}get columnWidths(){return this._columnWidths}getColumnWidthDefined(t){return this._columnWidths[t]}get showHeader(){return this._showHeader}set showHeader(t){this._showHeader=t}get showColumnHeader(){return this._showColumnHeader}set showColumnHeader(t){this._showColumnHeader=t}get showRowHeader(){return this._showRowHeader}set showRowHeader(t){this._showRowHeader=t}get columnHeaderTitle(){return this._columnHeaderTitle}set columnHeaderTitle(t){this._columnHeaderTitle=t}get rowHeaderTitle(){return this._rowHeaderTitle}set rowHeaderTitle(t){this._rowHeaderTitle=t}getHeaderFieldKey(t,e){}getCellLocation(t,e){return this.isCornerHeader(t,e)?"cornerHeader":this.isColumnHeader(t,e)?"columnHeader":this.isRowHeader(t,e)?"rowHeader":"body"}isHeader(t,e){return t>=this.leftRowSeriesNumberColumnCount&&t<this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount||e>=0&&e<this.columnHeaderLevelCount||t>=this.colCount-this.rightHeaderColCount||e>=this.rowCount-this.bottomHeaderRowCount}isCornerHeader(t,e){return t>=0&&t<this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount&&e>=0&&e<this.columnHeaderLevelCount}isColumnHeader(t,e){return t>=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount&&e>=0&&e<this.columnHeaderLevelCount}isRowHeader(t,e){return t>=this.leftRowSeriesNumberColumnCount&&t<this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount&&e>=this.columnHeaderLevelCount}isFrozen(t,e){return this.isFrozenColumn(t)||this.isRightFrozenColumn(t)||this.isBottomFrozenRow(e)||this.isFrozenRow(e)||this.isSeriesNumberInBody(t,e)||this.isSeriesNumberInHeader(t,e)}isFrozenColumn(t,e){if(z(e)){if(t>=0&&t<this.frozenColCount&&e>=this.frozenRowCount&&e<this.rowCount-this.bottomFrozenRowCount)return!0}else if(this.frozenColCount>0&&t>=0&&t<this.frozenColCount)return!0;return!1}isRightFrozenColumn(t,e){if(z(e)){if(t>=this.colCount-this.rightFrozenColCount&&e>=this.frozenRowCount&&e<this.rowCount-this.bottomFrozenRowCount)return!0}else if(this.rightFrozenColCount>0&&t>=this.colCount-this.rightFrozenColCount)return!0;return!1}isFrozenRow(t,e){if(z(e)){if(e>=0&&e<this.frozenRowCount&&t>=this.frozenColCount&&t<this.colCount-this.rightFrozenColCount)return!0}else if(e=t,this.frozenRowCount>0&&e>=0&&e<this.frozenRowCount)return!0;return!1}isBottomFrozenRow(t,e){if(z(e)){if(e>=this.rowCount-this.bottomFrozenRowCount&&t>=this.frozenColCount&&t<this.colCount-this.rightFrozenColCount)return!0}else if(e=t,this.bottomFrozenRowCount>0&&e>=this.rowCount-this.bottomFrozenRowCount)return!0;return!1}isLeftTopCorner(t,e){return t>=0&&t<this.frozenColCount&&e>=0&&e<this.frozenRowCount}isLeftBottomCorner(t,e){return t>=0&&t<this.frozenColCount&&e>=this.rowCount-this.bottomFrozenRowCount}isRightTopCorner(t,e){return t>=this.colCount-this.rightFrozenColCount&&e>=0&&e<this.frozenRowCount}isRightBottomCorner(t,e){return t>=this.colCount-this.rightFrozenColCount&&e>=this.rowCount-this.bottomFrozenRowCount}getColumnHeaderRange(){return{start:{col:this.rowHeaderLevelCount,row:0},end:{col:this.colCount-1,row:this.columnHeaderLevelCount-1}}}getRowHeaderRange(){return{start:{col:0,row:this.columnHeaderLevelCount},end:{col:this.rowHeaderLevelCount-1,row:this.rowCount-1}}}getCornerHeaderRange(){return{start:{col:0,row:0},end:{col:this.rowHeaderLevelCount-1,row:this.columnHeaderLevelCount-1}}}getBodyRange(){return{start:{col:this.rowHeaderLevelCount,row:this.columnHeaderLevelCount},end:{col:this.colCount-1,row:this.rowCount-1}}}resetCellIds(){}get frozenColCount(){return this._table.internalProps.frozenColCount?this.colCount>this._table.internalProps.frozenColCount?this._table.internalProps.frozenColCount:this.colCount:0}get frozenRowCount(){return this._table.internalProps.frozenRowCount?this.rowCount>=this._table.internalProps.frozenRowCount?this._table.internalProps.frozenRowCount:this.rowCount:0}get headerLevelCount(){return this.columnHeaderLevelCount}resetColumnHeaderLevelCount(){var t,e,n,o,r,s,l,a,h,d,u;if(this.showHeader&&this.showColumnHeader){if(this._table.isPivotChart()&&this.indicatorsAsCol&&!(!((e=(t=this.dataset)===null||t===void 0?void 0:t.colKeys)===null||e===void 0)&&e.length)&&((o=(n=this.columnDimensionTree)===null||n===void 0?void 0:n.tree)===null||o===void 0?void 0:o.level)===0&&!this.hasTwoIndicatorAxes)return void(this.columnHeaderLevelCount=0);let c=this.indicatorsAsCol&&this.hideIndicatorName&&this.colDimensionKeys[this.colDimensionKeys.length-1]===this.indicatorDimensionKey?this.columnDimensionTree.totalLevel-1:this.columnDimensionTree.totalLevel;return c===0&&this.dataset&&!(!((r=this.dataset.customColTree)===null||r===void 0)&&r.length)?this.cornerSetting.titleOnDimension==="row"&&this.cornerSetting.forceShowHeader?c=1:this._table.isPivotChart()||((l=(s=this.dataset.records)===null||s===void 0?void 0:s.length)!==null&&l!==void 0?l:0)!==0||this.cornerSetting.titleOnDimension!=="column"&&this.cornerSetting.titleOnDimension!=="all"||(c=(a=this.columnsDefine.length)!==null&&a!==void 0?a:0):!this.dataset||this._table.isPivotChart()||((d=(h=this.dataset.records)===null||h===void 0?void 0:h.length)!==null&&d!==void 0?d:0)!==0||this.dataset.customColTree||this.cornerSetting.titleOnDimension!=="column"&&this.cornerSetting.titleOnDimension!=="all"||(c=(u=this.columnsDefine.length)!==null&&u!==void 0?u:0,!this.hideIndicatorName&&this.indicatorsAsCol&&c++),this.columnHeaderTitle&&(c+=1),this._table.isPivotChart()&&this.indicatorsAsCol&&!this.hasTwoIndicatorAxes&&Lh(this.indicatorsDefine)&&(c-=1),void(this.columnHeaderLevelCount=c)}this.columnHeaderLevelCount=this.indicatorsAsCol?this.hideIndicatorName?0:1:0}resetRowHeaderLevelCount(){var t,e,n,o,r,s,l,a;if(this.showHeader&&this.showRowHeader){if(this.rowHierarchyType==="tree"){const u=(e=(t=this.extensionRows)===null||t===void 0?void 0:t.length)!==null&&e!==void 0?e:0;return this.rowHeaderTitle?void(this.rowHeaderLevelCount=2+u):void(this.rowHeaderLevelCount=1+u)}const h=this.rowDimensionTree.totalLevel;let d=h;return d===0&&this.dataset&&!(!((n=this.dataset.customRowTree)===null||n===void 0)&&n.length)?this.cornerSetting.titleOnDimension==="column"&&this.cornerSetting.forceShowHeader?d=1:this._table.isPivotChart()||((r=(o=this.dataset.records)===null||o===void 0?void 0:o.length)!==null&&r!==void 0?r:0)!==0||this.cornerSetting.titleOnDimension!=="row"&&this.cornerSetting.titleOnDimension!=="all"||(d=(s=this.rowsDefine.length)!==null&&s!==void 0?s:0):!this.dataset||this._table.isPivotChart()||((a=(l=this.dataset.records)===null||l===void 0?void 0:l.length)!==null&&a!==void 0?a:0)!==0||this.dataset.customRowTree||this.cornerSetting.titleOnDimension!=="row"&&this.cornerSetting.titleOnDimension!=="all"||(d=this.rowsDefine.length,this.hideIndicatorName||this.indicatorsAsCol||d++),!this.indicatorsAsCol&&this.hideIndicatorName&&this.rowDimensionKeys[this.rowDimensionKeys.length-1]===this.indicatorDimensionKey&&(d=h-1),this.rowHeaderTitle&&(d+=1),void(this.rowHeaderLevelCount=d)}this.rowHeaderLevelCount=this.indicatorsAsCol||this.hideIndicatorName?0:1}get columnHeaderLevelCount(){return this._columnHeaderLevelCount}set columnHeaderLevelCount(t){this._columnHeaderLevelCount=t}get rowHeaderLevelCount(){return this._rowHeaderLevelCount}set rowHeaderLevelCount(t){this._rowHeaderLevelCount=t}get colCount(){var t;return(this.columnDimensionTree.totalLevel>0||this._table.isPivotChart()||((t=this.dataset.records)===null||t===void 0?void 0:t.length)>0||this.dataset.records&&!Array.isArray(this.dataset.records)?this.columnDimensionTree.tree.size:0)+this.rowHeaderLevelCount+this.rightHeaderColCount+this.leftRowSeriesNumberColumnCount}get rowCount(){var t,e,n,o;return((this._table.records||this.dataset.records)&&(!Array.isArray(this._table.records)||this._table.records.length>0)&&((t=this._indicators)===null||t===void 0?void 0:t.length)>0&&!(!((e=this._rowHeaderCellIds)===null||e===void 0)&&e.length)?1:(o=(n=this._rowHeaderCellIds)===null||n===void 0?void 0:n.length)!==null&&o!==void 0?o:0)+this.columnHeaderLevelCount+this.bottomHeaderRowCount}get bodyRowSpanCount(){return this.rowDimensionTree.tree.size}get bottomFrozenRowCount(){if(!this._table.isPivotChart())return this._table.internalProps.bottomFrozenRowCount?this.rowCount-this.headerLevelCount>=this._table.internalProps.bottomFrozenRowCount?this._table.internalProps.bottomFrozenRowCount:this.rowCount-this.headerLevelCount:0;if(this.indicatorKeys.length>=1&&Lh(this.indicatorsDefine)){const t=this._table.pivotChartAxes.find(e=>e.orient==="bottom");return(t==null?void 0:t.visible)===!1?0:(this.indicatorsAsCol,1)}return 0}get rightFrozenColCount(){if(!this._table.isPivotChart())return this._table.internalProps.rightFrozenColCount?this.colCount-this.rowHeaderLevelCount>=this._table.internalProps.rightFrozenColCount?this._table.internalProps.rightFrozenColCount:this.colCount-this.rowHeaderLevelCount:0;const t=this._table.pivotChartAxes.find(e=>e.orient==="right");return(t==null?void 0:t.visible)===!1||this.indicatorsAsCol?0:this.hasTwoIndicatorAxes?1:0}get bodyRowCount(){return this.rowCount-this.bottomFrozenRowCount-this.headerLevelCount}get bodyColCount(){return this.colCount-this.rightFrozenColCount-this.rowHeaderLevelCount}get headerObjects(){return this._headerObjects}get columnObjects(){return this._indicators}getCellId(t,e){var n,o,r,s,l;if(e>=0&&t>=0){if(this.isSeriesNumber(t,e))return"";if(this.isCornerHeader(t,e))return(n=this._cornerHeaderCellIds[e])===null||n===void 0?void 0:n[t-this.leftRowSeriesNumberColumnCount];if(this.isColumnHeader(t,e))return(o=this._columnHeaderCellIds[e])===null||o===void 0?void 0:o[t-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount];if(this.isRowHeader(t,e))return(r=this._rowHeaderCellIds[e-this.columnHeaderLevelCount])===null||r===void 0?void 0:r[t-this.leftRowSeriesNumberColumnCount];if(this.isRightFrozenColumn(t,e))return(s=this._rowHeaderCellIds[e-this.columnHeaderLevelCount])===null||s===void 0?void 0:s[this.rowHeaderLevelCount-1];if(this.isBottomFrozenRow(t,e))return(l=this._columnHeaderCellIds[this.columnHeaderLevelCount-1])===null||l===void 0?void 0:l[t-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount]}}getHeader(t,e){var n;if(this.isSeriesNumberInHeader(t,e))return this.getSeriesNumberHeader(t,e);const o=this.getCellId(t,e);return(n=this._headerObjectMap[o])!==null&&n!==void 0?n:{id:void 0,field:"",headerType:"text",define:void 0}}getHeaderField(t,e){var n,o;const r=this.getCellId(t,e);return((n=this._headerObjectMap[r])===null||n===void 0?void 0:n.field)||((o=this.getBody(t,e))===null||o===void 0?void 0:o.field)}getHeaderCellAdressById(t){for(let e=0;e<this._columnHeaderCellIds.length;e++){const n=this._columnHeaderCellIds[e];for(let o=0;o<n.length;o++)if(n[o]===t)return{col:o+this._table.frozenColCount,row:e}}for(let e=0;e<this._rowHeaderCellIds.length;e++){const n=this._rowHeaderCellIds[e];for(let o=0;o<n.length;o++)if(n[o]===t)return{col:o,row:e+this._table.frozenRowCount}}for(let e=0;e<this._cornerHeaderCellIds.length;e++){const n=this._cornerHeaderCellIds[e];for(let o=0;o<n.length;o++)if(n[o]===t)return{col:o,row:e}}}getHeaderCellAddressByField(t){const e=this.headerObjects.find(n=>n&&n.field===t);return e&&this.getHeaderCellAdressById(e.id)}getBody(t,e){var n,o,r,s,l,a,h,d,u,c;const g=this.getBodyWidthCache(t,e);if(g)return g;if(this.isSeriesNumber(t,e)){const b=this.getSeriesNumberBody(t,e);return this.setBodyWidthCache(t,e,b),b}const f=this.getCellHeaderPaths(t,e);if(this.indicatorsAsCol){const b=(o=(n=f.colHeaderPaths)===null||n===void 0?void 0:n.find(_=>_.indicatorKey))===null||o===void 0?void 0:o.indicatorKey,C=z(b)&&(l=(s=(r=this._indicators)===null||r===void 0?void 0:r.find(_=>_.indicatorKey===b))!==null&&s!==void 0?s:this._indicators[0])!==null&&l!==void 0?l:{id:"",field:void 0,indicatorKey:void 0,cellType:"text",define:void 0};return this.setBodyWidthCache(t,e,C),C}const p=(h=(a=f.rowHeaderPaths)===null||a===void 0?void 0:a.find(b=>b.indicatorKey))===null||h===void 0?void 0:h.indicatorKey,m=z(p)&&(c=(u=(d=this._indicators)===null||d===void 0?void 0:d.find(b=>b.indicatorKey===p))!==null&&u!==void 0?u:this._indicators[0])!==null&&c!==void 0?c:{id:"",field:void 0,indicatorKey:void 0,cellType:"text",define:void 0};return this.setBodyWidthCache(t,e,m),m}getCellRange(t,e){var n,o;const r={start:{col:t,row:e},end:{col:t,row:e}};if(!this.isHeader(t,e)||t===-1||e===-1||this.isRightFrozenColumn(t,e)||this.isBottomFrozenRow(t,e))return r;if(this._table.isPivotChart()){if(this.isLeftBottomCorner(t,e))return{start:{col:0,row:this.rowCount-this.bottomFrozenRowCount},end:{col:this.frozenColCount-1,row:this.rowCount-1}};if(this.isRightTopCorner(t,e))return{start:{col:this.colCount-this.rightFrozenColCount,row:0},end:{col:this.colCount-1,row:this.frozenRowCount-1}};if(this.isRightBottomCorner(t,e))return{start:{col:this.colCount-this.rightFrozenColCount,row:this.rowCount-this.bottomFrozenRowCount},end:{col:this.colCount-1,row:this.rowCount-1}}}for(let s=0;s<this._largeCellRangeCache.length;s++){const l=this._largeCellRangeCache[s];if(t>=l.start.col&&t<=l.end.col&&e>=l.start.row&&e<=l.end.row)return l}if(this.isHeader(t,e)&&t!==-1&&e!==-1){const s=this.getCellId(t,e);for(let l=t-1;l>=0&&s===this.getCellId(l,e);l--)r.start.col=l;for(let l=t+1;l<((n=this.colCount)!==null&&n!==void 0?n:0)&&s===this.getCellId(l,e);l++)r.end.col=l;for(let l=e-1;l>=0&&s===this.getCellId(t,l);l--)r.start.row=l;for(let l=e+1;l<((o=this.rowCount)!==null&&o!==void 0?o:0)&&!(s!==this.getCellId(t,l)||this.isSeriesNumberInHeader(t,e)&&l>=this.columnHeaderLevelCount);l++)r.end.row=l}return(r.end.col-r.start.col>100||r.end.row-r.start.row>100)&&this._largeCellRangeCache.push(r),r}isCellRangeEqual(t,e,n,o){const r=this.getCellRange(t,e),s=this.getCellRange(n,o);return r.start.col===s.start.col&&r.end.col===s.end.col&&r.start.row===s.start.row&&r.end.row===s.end.row}getBodyIndexByRow(t){return t<this.columnHeaderLevelCount||t>=this.rowCount-this.bottomHeaderRowCount?-1:t-this.columnHeaderLevelCount}get bottomHeaderRowCount(){return this._table.isPivotChart()?this.bottomFrozenRowCount:0}get rightHeaderColCount(){return this._table.isPivotChart()?this.rightFrozenColCount:0}getBodyIndexByCol(t){return t<this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount||t>=this.colCount-this.rightHeaderColCount?-1:t-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount}getRecordStartRowByRecordIndex(t){return this.columnHeaderLevelCount+t}getRecordShowIndexByCell(t,e){}getCellHeaderPathsWithTreeNode(t,e){for(let l=0;l<this._largeCellRangeCache.length;l++){const a=this._largeCellRangeCache[l];if(t>=a.start.col&&t<=a.end.col&&e>=a.start.row&&e<=a.end.row)break}let n=this.getColHeaderPathCache(t,e),o=this.getRowHeaderPathCache(t,e);const r=this.getBodyIndexByCol(t),s=this.getBodyIndexByRow(e)+this.currentPageStartIndex;if(!n&&e>=0&&r>=0&&(n=this.columnDimensionTree.getTreePath(r,this.showHeader&&this.showColumnHeader?e-(this.columnHeaderTitle?1:0):this.columnDimensionTree.totalLevel),this.setColHeaderPathCache(t,e,n)),!o&&t>=0&&s>=0){if(o=[],this.rowHierarchyType==="tree"){const l=this._rowHeaderCellFullPathIds[s];let a=this.rowDimensionTree,h=0;for(;a;){const d=[];let u=l[h];for(d.push(u);;){const g=this._headerObjectMap[u];if(!(g!=null&&g.parentCellId))break;d.unshift(g.parentCellId),u=g.parentCellId}const c=a.getTreePathByCellIds(d);o.push(...c),a=this._rowHeaderExtensionTree[l[h]],h++}}else o=this.rowDimensionTree.getTreePath(s,this.showHeader&&this.showRowHeader?t-(this.rowHeaderTitle?1:0)-this.leftRowSeriesNumberColumnCount:this.rowDimensionTree.totalLevel);this.setRowHeaderPathCache(t,e,o)}return{colHeaderPaths:n,rowHeaderPaths:o,cellLocation:this.getCellLocation(t,e)}}getCellHeaderPaths(t,e){var n,o;const r=this.getCellHeaderPathsWithTreeNode(t,e),s={colHeaderPaths:[],rowHeaderPaths:[],cellLocation:r.cellLocation};return(n=r.colHeaderPaths)===null||n===void 0||n.forEach(l=>{var a,h,d;const u={};u.dimensionKey=l.dimensionKey,u.indicatorKey=l.indicatorKey,u.value=(d=(a=l.value)!==null&&a!==void 0?a:(h=this.getIndicatorInfoByIndicatorKey(l.indicatorKey))===null||h===void 0?void 0:h.title)!==null&&d!==void 0?d:"",u.virtual=l.virtual,s.colHeaderPaths.push(u)}),(o=r.rowHeaderPaths)===null||o===void 0||o.forEach(l=>{var a,h,d;if(l.dimensionKey!=="axis"){const u={};u.dimensionKey=l.dimensionKey,u.indicatorKey=l.indicatorKey,u.value=(d=(a=l.value)!==null&&a!==void 0?a:(h=this.getIndicatorInfoByIndicatorKey(l.indicatorKey))===null||h===void 0?void 0:h.title)!==null&&d!==void 0?d:"",u.virtual=l.virtual,s.rowHeaderPaths.push(u)}}),s}getIndicatorInfoByIndicatorKey(t){var e;return(e=this.indicatorsDefine)===null||e===void 0?void 0:e.find(n=>typeof n!="string"&&!!t&&n.indicatorKey===t)}findFullCellIds(t){const e=[];for(let n=0;n<t.length;n++){let o=t[n];for(e.push(o);;){const r=this._headerObjectMap[o];if(!(r!=null&&r.parentCellId))break;e.unshift(r.parentCellId),o=r.parentCellId}}return e}getHeaderDimension(t,e){var n,o,r;if(this.isHeader(t,e)){const s=this.getHeader(t,e);return(o=(n=this.rowsDefine)===null||n===void 0?void 0:n.find(l=>typeof l!="string"&&l.dimensionKey===s.field))!==null&&o!==void 0?o:(r=this.columnsDefine)===null||r===void 0?void 0:r.find(l=>typeof l!="string"&&l.dimensionKey===s.field)}}isColumnIndicatorHeader(t,e){return this._indicatorShowType==="column"&&e===this.columnHeaderLevelCount-1&&t>=this.rowHeaderLevelCount}isRowIndicatorHeader(t,e){return this._indicatorShowType==="row"&&t===this.rowHeaderLevelCount-1&&e>=this.columnHeaderLevelCount}isIndicatorHeader(t,e){return this.isColumnIndicatorHeader(t,e)||this.isRowIndicatorHeader(t,e)}toggleHierarchyState(t,e){var n,o,r,s,l,a;this.colIndex=0;const h=this._rowHeaderCellFullPathIds_FULL.slice(0),d=h.map((g,f)=>({col:t,row:f+this.columnHeaderLevelCount})),u=this.getHeader(t,e);if(u.define.hierarchyState=u.define.hierarchyState===Vt.collapse?Vt.expand:Vt.collapse,this.rowDimensionTree.reset(this.rowDimensionTree.tree.children,!0),this._rowHeaderCellFullPathIds_FULL=[],this.rowDimensionKeys=this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr(),this.fullRowDimensionKeys=[],this.fullRowDimensionKeys=this.fullRowDimensionKeys.concat(this.rowDimensionKeys),this._addHeadersForTreeMode(this._rowHeaderCellFullPathIds_FULL,0,this.rowDimensionTree.tree.children,[],this.rowDimensionTree.totalLevel,!0,this.rowsDefine,this.rowHeaderObjs),this.rowHeaderTitle){const g=++this.sharedVar.seqId,f=Array(this.rowCount-this.columnHeaderLevelCount).fill(g);this._rowHeaderCellFullPathIds_FULL.unshift(f);const p={id:g,title:typeof this.rowHeaderTitle.title=="string"?this.rowHeaderTitle.title:this.rowsDefine.reduce((m,b)=>typeof b=="string"?m:m+(m?`/${b.title}`:`${b.title}`),""),field:void 0,headerType:(o=(n=this.rowHeaderTitle)===null||n===void 0?void 0:n.headerType)!==null&&o!==void 0?o:"text",style:(r=this.rowHeaderTitle)===null||r===void 0?void 0:r.headerStyle,define:{field:"",headerType:"text",cellType:"text",disableHeaderHover:!!(!((s=this.rowHeaderTitle)===null||s===void 0)&&s.disableHeaderHover),disableHeaderSelect:!!(!((l=this.rowHeaderTitle)===null||l===void 0)&&l.disableHeaderSelect)}};this.rowHeaderObjs.push(p),this._headerObjects[g]=p}this._rowHeaderCellFullPathIds_FULL=im(this._rowHeaderCellFullPathIds_FULL),this.rowHierarchyType==="tree"&&((a=this.extensionRows)===null||a===void 0?void 0:a.length)>=1&&this.generateExtensionRowTree(),this.colIndex=0,this._headerObjectMap=this._headerObjects.reduce((g,f)=>(g[f.id]=f,g),{}),this._CellHeaderPathMap=new Map,this._largeCellRangeCache.length=0;const c=D9(t,e,h.map(g=>g[t-this.leftRowSeriesNumberColumnCount]),this._rowHeaderCellFullPathIds_FULL.map(g=>g[t-this.leftRowSeriesNumberColumnCount]),d,this);return this.generateCellIdsConsiderHideHeader(),this.setPagination(this.pagination),c}isHeaderForColWidth(t,e){return this.isHeader(t,e)}getHeaderForColWidth(t,e){return this.getHeader(t,e)}getPivotCellAdress(t){var e;if(!Array.isArray(t))return;let n,o,r=this.rowTree,s=this.columnTree;for(let h=0;h<t.length;h++){const d=t[h];if((d.isPivotCorner||!z(d.value))&&h===t.length-1){if(((e=this==null?void 0:this.cornerSetting)===null||e===void 0?void 0:e.titleOnDimension)==="row"){let g=0;return this.rowHierarchyType==="grid"&&(g=this.rowDimensionKeys.indexOf(d.dimensionKey)),g===-1?void 0:{col:(this.rowHeaderTitle?g+1:g)+this.leftRowSeriesNumberColumnCount,row:0}}const c=this.colDimensionKeys.indexOf(d.dimensionKey);return c===-1?void 0:{col:0+this.leftRowSeriesNumberColumnCount,row:this.columnHeaderTitle?c+1:c}}let u=!1;for(let c=0;c<s.length;c++){const g=s[c];if((z(d.dimensionKey)&&g.dimensionKey===d.dimensionKey||z(d.indicatorKey)&&g.indicatorKey===d.indicatorKey)&&g.value===d.value){s=g.children,o=g,u=!0;break}}if(!u)for(let c=0;c<r.length;c++){const g=r[c];if((z(d.dimensionKey)&&g.dimensionKey===d.dimensionKey||z(d.indicatorKey)&&g.indicatorKey===d.indicatorKey)&&g.value===d.value){r=g.children,n=g;break}}}let l=0,a=0;if(n){a=this.columnHeaderLevelCount;const{startInTotal:h,level:d}=n;return a+=h,l=this.rowHierarchyType==="grid"?(this.rowHeaderTitle?d+1:d)+this.leftRowSeriesNumberColumnCount:0+this.leftRowSeriesNumberColumnCount,{col:l,row:a}}if(o){l=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount;const{startInTotal:h,level:d}=o;return l+=h,a=this.columnHeaderTitle?d+1:d,{col:l,row:a}}}getPivotDimensionInfo(t,e){var n;const{colHeaderPaths:o,rowHeaderPaths:r}=this.getCellHeaderPaths(t,e),s=[];return o.length?o.forEach((l,a)=>{s.push({dimensionKey:l.dimensionKey,value:l.value,isPivotCorner:!1,indicatorKey:l.indicatorKey})}):r.length?r.forEach((l,a)=>{s.push({dimensionKey:l.dimensionKey,value:l.value,isPivotCorner:!1,indicatorKey:l.indicatorKey})}):this.isCornerHeader(t,e)&&(((n=this==null?void 0:this.cornerSetting)===null||n===void 0?void 0:n.titleOnDimension)==="row"?s.push({dimensionKey:this.rowDimensionKeys[(this.rowHeaderTitle?t-1:t)-this.leftRowSeriesNumberColumnCount],isPivotCorner:!0}):s.push({dimensionKey:this.colDimensionKeys[this.columnHeaderTitle?e-1:e],isPivotCorner:!0})),s}getIndicatorKey(t,e){var n;return(n=this.getBody(t,e))===null||n===void 0?void 0:n.indicatorKey}getParentCellId(t,e){if(e!==0)return this.isColumnHeader(t,e)?this.getCellId(t,e-1):this.isRowHeader(t,e)?this.getCellId(t-1,e):void 0}getRowHeaderCellAddressByCellId(t){let e,n;if(this._rowHeaderCellIds.find((o,r)=>!!o.find((s,l)=>s===t&&(e=l,!0))&&(n=r,!0)),z(e)&&z(n))return{col:e,row:n+this.columnHeaderLevelCount}}canMoveHeaderPosition(t,e){if(this.isSeriesNumberInHeader(e.col,e.row)||this.isSeriesNumberInHeader(t.col,t.row)||this.isCornerHeader(e.col,e.row)||t.col<0||t.row<0||e.col<0||e.row<0)return!1;this.isSeriesNumberInBody(e.col,e.row)&&this.isSeriesNumberInBody(t.col,t.row)&&(t.col=t.col+this.leftRowSeriesNumberColumnCount+this.rowHeaderLevelCount-1,e.col=e.col+this.leftRowSeriesNumberColumnCount+this.rowHeaderLevelCount-1);const n=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row))return this.getParentCellId(t.col,n.start.row)===this.getParentCellId(e.col,n.start.row);if(this.isRowHeader(t.col,t.row)){if(this.rowHierarchyType!=="tree")return this.getParentCellId(n.start.col,t.row)===this.getParentCellId(n.start.col,e.row);{const o=Ee(this.getCellHeaderPathsWithTreeNode(t.col,t.row).rowHeaderPaths),r=Ee(this.getCellHeaderPathsWithTreeNode(e.col,e.row).rowHeaderPaths);if(o.pop(),r.pop(),o.length<=r.length){if(o.length===r.length)return!o.find((s,l)=>s.dimensionKey!==r[l].dimensionKey||s.value!==r[l].value);if(o.length>0){for(let s=0;s<o.length;s++)if(o[s].startInTotal!==r[s].startInTotal)return!1}return!0}}}return!1}moveHeaderPosition(t,e){if(this.canMoveHeaderPosition(t,e)&&!this.isCellRangeEqual(t.col,t.row,e.col,e.row)){const n=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row)){const o=n.end.col-n.start.col+1;let r;const s=this.getCellRange(e.col,n.start.row);if(r=e.col>=t.col?s.end.col-o+1:s.start.col,r===n.start.col)return null;for(let a=0;a<this._columnHeaderCellFullPathIds.length;a++){const h=this._columnHeaderCellFullPathIds[a].splice(n.start.col-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount,o);h.unshift(r-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount,0),Array.prototype.splice.apply(this._columnHeaderCellFullPathIds[a],h)}const l=this._columnWidths.splice(n.start.col-this.leftRowSeriesNumberColumnCount,o);return l.unshift(r-this.leftRowSeriesNumberColumnCount,0),Array.prototype.splice.apply(this._columnWidths,l),this.columnDimensionTree.movePosition(this.getCellHeaderPathsWithTreeNode(t.col,t.row).colHeaderPaths.length-1,n.start.col-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount,s.start.col-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount),this.columnDimensionTree.reset(this.columnDimensionTree.tree.children,!0),this._CellHeaderPathMap=new Map,this._largeCellRangeCache.length=0,{sourceIndex:n.start.col,targetIndex:r,sourceSize:o,targetSize:s.end.col-s.start.col+1,moveType:"column"}}if(this.isRowHeader(t.col,t.row)){let o;const r=this.getCellHeaderPathsWithTreeNode(t.col,t.row).rowHeaderPaths,s=this.getCellHeaderPathsWithTreeNode(e.col,e.row).rowHeaderPaths,l=r[r.length-1],a=s[r.length-1],h=l.size;if(o=e.row>=t.row?a.startInTotal+a.size-h:a.startInTotal,o===n.start.row-this.columnHeaderLevelCount)return null;const d=this._rowHeaderCellIds.splice(n.start.row-this.columnHeaderLevelCount,h);d.unshift(o-this.currentPageStartIndex,0),Array.prototype.splice.apply(this._rowHeaderCellIds,d);const u=this._rowHeaderCellFullPathIds.splice(n.start.row-this.columnHeaderLevelCount,h);u.unshift(o-this.currentPageStartIndex,0),Array.prototype.splice.apply(this._rowHeaderCellFullPathIds,u);const c=this._rowHeaderCellIds_FULL.splice(n.start.row-this.columnHeaderLevelCount+this.currentPageStartIndex,h);c.unshift(o,0),Array.prototype.splice.apply(this._rowHeaderCellIds_FULL,c);const g=this._rowHeaderCellFullPathIds_FULL.splice(n.start.row-this.columnHeaderLevelCount+this.currentPageStartIndex,h);return g.unshift(o,0),Array.prototype.splice.apply(this._rowHeaderCellFullPathIds_FULL,g),this.rowDimensionTree.movePosition(r.length-1,n.start.row-this.columnHeaderLevelCount,o+(e.row>t.row?l.size-1:0)),this.rowDimensionTree.reset(this.rowDimensionTree.tree.children,!0),this._CellHeaderPathMap=new Map,this._largeCellRangeCache.length=0,{sourceIndex:n.start.row,targetIndex:o+this.columnHeaderLevelCount,sourceSize:h,targetSize:a.size,moveType:"row"}}}return null}getCellAdressByHeaderPath(t){var e,n,o,r,s,l;let a,h,d=!1,u=!1;if(Array.isArray(t)){if(t.length>this.rowDimensionKeys.length+this.colDimensionKeys.length)return;a=t.filter(y=>this.colDimensionKeys.indexOf(y.dimensionKey)>=0||this.colDimensionKeys.indexOf(this.indicatorDimensionKey)>=0&&y.indicatorKey),h=t.filter(y=>this.rowDimensionKeys.indexOf(y.dimensionKey)>=0||this.rowDimensionKeys.indexOf(this.indicatorDimensionKey)>=0&&y.indicatorKey)}else a=t.colHeaderPaths,h=t.rowHeaderPaths,(t==null?void 0:t.cellLocation)==="body"&&this._table.isPivotTable()&&(u=!0);if(!Array.isArray(a)&&!Array.isArray(h))return;if(a==null||a.sort((y,S)=>{var A,R;return this.colDimensionKeys.indexOf((A=y.dimensionKey)!==null&&A!==void 0?A:this.indicatorDimensionKey)-this.colDimensionKeys.indexOf((R=S.dimensionKey)!==null&&R!==void 0?R:this.indicatorDimensionKey)}),h==null||h.sort((y,S)=>{var A,R;return this.fullRowDimensionKeys.indexOf((A=y.dimensionKey)!==null&&A!==void 0?A:this.indicatorDimensionKey)-this.fullRowDimensionKeys.indexOf((R=S.dimensionKey)!==null&&R!==void 0?R:this.indicatorDimensionKey)}),a==null||a.forEach(y=>{y.isPivotCorner&&(d=!0)}),h==null||h.forEach(y=>{y.isPivotCorner&&(d=!0)}),d){if(this.cornerSetting.titleOnDimension==="all"&&this.indicatorsAsCol&&a.length===0){for(let y=0;y<this.rowDimensionKeys.length;y++)if(((e=h[0])===null||e===void 0?void 0:e.dimensionKey)===this.rowDimensionKeys[y])return{col:y+this.leftRowSeriesNumberColumnCount,row:this.columnHeaderLevelCount-1}}else if(this.cornerSetting.titleOnDimension!=="all"||this.indicatorsAsCol||h.length!==0){if(this.cornerSetting.titleOnDimension==="row"||this.cornerSetting.titleOnDimension==="all"&&!this.indicatorsAsCol){for(let y=0;y<this.rowDimensionKeys.length;y++)if(((o=h[0])===null||o===void 0?void 0:o.dimensionKey)===this.rowDimensionKeys[y])return{col:y+this.leftRowSeriesNumberColumnCount,row:0}}else for(let y=0;y<this.colDimensionKeys.length;y++)if(((r=a[0])===null||r===void 0?void 0:r.dimensionKey)===this.colDimensionKeys[y])return{col:0,row:y}}else for(let y=0;y<this.colDimensionKeys.length;y++)if(((n=a[0])===null||n===void 0?void 0:n.dimensionKey)===this.colDimensionKeys[y])return{col:this.rowHeaderLevelCount-1,row:y}}let c,g,f,p,m=!1;(a==null?void 0:a.length)>=1&&(h==null?void 0:h.length)>=1&&(m=!0);let b,C,_=this.rowTree,w=this.columnTree;if(a)for(let y=0;y<a.length;y++){const S=a[y];for(let A=0;A<w.length;A++){const R=w[A];if(!z(S.indicatorKey)&&R.dimensionKey===S.dimensionKey&&R.value===S.value||z(S.indicatorKey)&&R.indicatorKey===S.indicatorKey){w=R.children,m&&!w?C=R:m||(C=R);break}}}if((h==null?void 0:h.length)>=1)if(this.rowHierarchyType==="tree"){const y=h[h.length-1],S=this.headerObjects.filter(R=>((R==null?void 0:R.field)===y.dimensionKey||(R==null?void 0:R.field)===y.indicatorKey)&&(R==null?void 0:R.title)===y.value).map(R=>R.id),A=this._rowHeaderCellIds.filter(R=>S.indexOf(R[R.length-1])>=0).find(R=>{const x=this.findFullCellIds(R);return x.length===h.length&&x.every(T=>{const M=this._headerObjectMap[T];return h.find(B=>B.dimensionKey===M.field&&B.value===M.title)})});g=this._rowHeaderCellIds.indexOf(A)+this.columnHeaderLevelCount}else for(let y=0;y<h.length;y++){const S=h[y];for(let A=0;A<_.length;A++){const R=_[A];if(!z(S.indicatorKey)&&R.dimensionKey===S.dimensionKey&&R.value===S.value||z(S.indicatorKey)&&R.indicatorKey===S.indicatorKey&&(!z(S.value)||R.value===S.value)){_=R.children,(!m||_&&!_.some(x=>x.dimensionKey==="axis"))&&m||(b=R);break}}}if(u||!m||(b||z(g))&&C){if(b||u){g=this.columnHeaderLevelCount;const{startInTotal:y,level:S}=(s=b)!==null&&s!==void 0?s:RT;g+=y??0,f=this.rowHierarchyType==="grid"?(this.rowHeaderTitle?S+1:S)+this.leftRowSeriesNumberColumnCount:0}if(C||u){c=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount;const{startInTotal:y,level:S}=(l=C)!==null&&l!==void 0?l:RT;c+=y??0,p=this.columnHeaderTitle?S+1:S}return z(c)||z(g)?{col:c??f,row:g??p}:void 0}}setChartInstance(t,e,n){var o,r,s,l;const a=this.getCellHeaderPaths(t,e);let h;if(this.indicatorsAsCol){const d=(o=a.colHeaderPaths.find(u=>u.indicatorKey))===null||o===void 0?void 0:o.indicatorKey;h=(r=this._indicators)===null||r===void 0?void 0:r.find(u=>u.indicatorKey===d)}else{const d=(s=a.rowHeaderPaths.find(u=>u.indicatorKey))===null||s===void 0?void 0:s.indicatorKey;h=(l=this._indicators)===null||l===void 0?void 0:l.find(u=>u.indicatorKey===d)}typeof(h==null?void 0:h.chartSpec)!="function"&&h&&(h.chartInstance=n)}getChartInstance(t,e){var n,o,r,s;const l=this.getCellHeaderPaths(t,e);let a;if(this.indicatorsAsCol){const h=(n=l.colHeaderPaths.find(d=>d.indicatorKey))===null||n===void 0?void 0:n.indicatorKey;a=(o=this._indicators)===null||o===void 0?void 0:o.find(d=>d.indicatorKey===h)}else{const h=(r=l.rowHeaderPaths.find(d=>d.indicatorKey))===null||r===void 0?void 0:r.indicatorKey;a=(s=this._indicators)===null||s===void 0?void 0:s.find(d=>d.indicatorKey===h)}return a==null?void 0:a.chartInstance}checkHasChart(){return uT(this)}getDimension(t,e){var n,o;return e==="column"?(n=this.columnsDefine)===null||n===void 0?void 0:n.find(r=>typeof r!="string"&&r.dimensionKey===t):e==="row"?(o=this.rowsDefine)===null||o===void 0?void 0:o.find(r=>typeof r!="string"&&r.dimensionKey===t):void 0}getAxisConfigInPivotChart(t,e){if((this.isFrozenColumn(t,e)||this.isRightFrozenColumn(t,e))&&Hl(t,e,"row",this)||(this.isFrozenRow(t,e)||this.isBottomFrozenRow(t,e))&&Hl(t,e,"col",this))return Bt.getFunction("getAxisConfigInPivotChart")(t,e,this)}isEmpty(t,e){return!!this._table.isPivotChart()&&(!!this.isLeftBottomCorner(t,e)||!!this.isRightBottomCorner(t,e)||!!this.isRightTopCorner(t,e))}isAxisCell(t,e){return this._table.isPivotChart()?!!(this.indicatorKeys.length>=1&&Lh(this.indicatorsDefine)&&(this.isBottomFrozenRow(t,e)&&Hl(t,e,"col",this)||this.isRightFrozenColumn(t,e)&&Hl(t,e,"row",this)||this.isRowHeader(t,e)&&t===this.rowHeaderLevelCount-1&&Hl(t,e,"row",this)||this.hasTwoIndicatorAxes&&this.indicatorsAsCol&&e===this.columnHeaderLevelCount-1&&Hl(t,e,"col",this))):!1}getChartAxes(t,e){if(pV(t,e,this)||this.isAxisCell(t,e))return vV(t,e,this)}getRawChartSpec(t,e){return cV(t,e,this)}getChartSpec(t,e){return mV(t,e,this)}isShareChartSpec(t,e){return gV(t,e,this)}getChartDataId(t,e){return dT(t,e,this)}isNoChartDataRenderNothing(t,e){return fV(t,e,this)}setPagination(t){var e,n,o,r,s,l,a;if(this.clearCellRangeMap(),this._table.internalProps.useOneRowHeightFillAll=!1,this.pagination=t,this.rowHierarchyType==="grid"&&z((e=this.pagination)===null||e===void 0?void 0:e.perPageCount)&&z((n=this.pagination)===null||n===void 0?void 0:n.currentPage)){this.indicatorsAsCol===!1&&(this.pagination.perPageCount=Math.ceil(this.pagination.perPageCount/this.indicatorKeys.length)*this.indicatorKeys.length);const{perPageCount:h,currentPage:d}=this.pagination;this.currentPageStartIndex=h*(d||0),this.currentPageEndIndex=this.currentPageStartIndex+h,this._rowHeaderCellIds=(o=this._rowHeaderCellIds_FULL)===null||o===void 0?void 0:o.slice(this.currentPageStartIndex,this.currentPageEndIndex),this._rowHeaderCellFullPathIds=(r=this._rowHeaderCellFullPathIds_FULL)===null||r===void 0?void 0:r.slice(this.currentPageStartIndex,this.currentPageEndIndex)}else this.currentPageStartIndex=0,this.currentPageEndIndex=this._rowHeaderCellIds_FULL.length,this._rowHeaderCellIds=(s=this._rowHeaderCellIds_FULL)===null||s===void 0?void 0:s.slice(this.currentPageStartIndex,this.currentPageEndIndex),this._rowHeaderCellFullPathIds=(l=this._rowHeaderCellFullPathIds_FULL)===null||l===void 0?void 0:l.slice(this.currentPageStartIndex,this.currentPageEndIndex);this.pagination&&(this.pagination.totalCount=(a=this._rowHeaderCellIds_FULL)===null||a===void 0?void 0:a.length)}release(){var t;const e=this._table._getActiveChartInstance();e==null||e.release(),(t=this._indicators)===null||t===void 0||t.forEach(n=>{var o;(o=n.chartInstance)===null||o===void 0||o.release()})}getHeadNode(t,e){var n,o,r;let s;const l=this.getCellHeaderPaths(t,e);return l.rowHeaderPaths&&((o=(n=l.rowHeaderPaths)===null||n===void 0?void 0:n.length)!==null&&o!==void 0?o:0)>0?s=(r=l.rowHeaderPaths)===null||r===void 0?void 0:r.slice(0,l.rowHeaderPaths.length):l.colHeaderPaths&&l.colHeaderPaths.length>0&&(s=l.colHeaderPaths.slice(0,l.colHeaderPaths.length)),this.getHeadNodeByRowOrColDimensions(s,t,e)}getHeadNodeByRowOrColDimensions(t,e,n){var o;if(!Array.isArray(t))return;let r,s,l=this.rowTree,a=this.columnTree;if(z(n)&&z(e)&&this.rowHierarchyType==="tree"&&this.extensionRows&&e>=1+this.leftRowSeriesNumberColumnCount){const h=this.getCellId(e-1,n);l=this._rowHeaderExtensionTree[h].tree.children}for(let h=0;h<t.length;h++){const d=t[h];if((d.isPivotCorner||!z(d.value))&&h===t.length-1)return;let u=!1;for(let c=0;c<a.length;c++){const g=a[c];if(z(d.dimensionKey)&&g.dimensionKey===d.dimensionKey&&g.value===d.value||z(d.indicatorKey)&&g.indicatorKey===d.indicatorKey&&(g.value===d.value||!z(d.value)||!z(g.value))){a=g.children,s=g,u=!0;break}}if(!u)for(let c=0;(o=c<(l==null?void 0:l.length))!==null&&o!==void 0&&o;c++){const g=l[c];if(z(d.dimensionKey)&&g.dimensionKey===d.dimensionKey&&g.value===d.value||z(d.indicatorKey)&&g.indicatorKey===d.indicatorKey&&(g.value===d.value||!z(d.value)||!z(g.value))){l=g.children,r=g;break}}}return r||s||void 0}clearCellRangeMap(){this._largeCellRangeCache.length=0,this._CellHeaderPathMap=new Map}getDimensionKeyInChartSpec(t,e){var n,o,r,s,l,a;let h;if(this.indicatorsAsCol===!1)for(let d=0;d<this.indicatorsDefine.length;d++){const u=this.indicatorsDefine[d].chartSpec;if(u&&(h=(n=u.xField)!==null&&n!==void 0?n:(r=(o=u==null?void 0:u.series)===null||o===void 0?void 0:o[0])===null||r===void 0?void 0:r.xField,h))return h}else for(let d=0;d<this.indicatorsDefine.length;d++){const u=this.indicatorsDefine[d].chartSpec;if(u&&(h=(s=u.yField)!==null&&s!==void 0?s:(a=(l=u==null?void 0:u.series)===null||l===void 0?void 0:l[0])===null||a===void 0?void 0:a.yField,h))return h}return null}_generateChartState(){return{vtable_selected:{filter:t=>{var e;return this._table._selectedDataItemsInChart.length>=1?!!this._table._selectedDataItemsInChart.find(n=>{for(const o in n)if(typeof n[o]!="object"&&n[o]!==t[o])return!1;return!0}):!((e=this._table._selectedDimensionInChart)===null||e===void 0)&&e.length?!!this._table._selectedDimensionInChart.every(n=>typeof n.value=="object"||t[n.key]===n.value):!1}},vtable_selected_reverse:{filter:t=>{var e;return this._table._selectedDataItemsInChart.length>=1?!this._table._selectedDataItemsInChart.find(n=>{for(const o in n)if(typeof n[o]!="object"&&n[o]!==t[o])return!1;return!0}):!((e=this._table._selectedDimensionInChart)===null||e===void 0)&&e.length?!this._table._selectedDimensionInChart.every(n=>typeof n.value=="object"||t[n.key]===n.value):!1}}}}updateDataStateToChartInstance(t){var e;if(((e=t==null?void 0:t.getSpec().select)===null||e===void 0?void 0:e.enable)!==!1){t||(t=this._table._getActiveChartInstance());const n=this._generateChartState();this._indicators.forEach(o=>{var r;const s=o.chartInstance;((r=o.chartSpec.select)===null||r===void 0?void 0:r.enable)!==!1&&s.updateState(n)}),t==null||t.updateState(n)}}updateDataStateToActiveChartInstance(t){var e;if(((e=t==null?void 0:t.getSpec().select)===null||e===void 0?void 0:e.enable)!==!1){t||(t=this._table._getActiveChartInstance());const n=this._generateChartState();t==null||t.updateState(n)}}getIndicatorKeyInChartSpec(t,e){const n=this.getRawChartSpec(t,e),o=[];if(n){if(n.series||n.xField||n.yField)return this.indicatorsAsCol===!1?n.series?n.series.forEach(r=>{const s=r.yField;o.push(s)}):o.push(n.yField):n.series?n.series.forEach(r=>{const s=r.xField;o.push(s)}):o.push(n.xField),o;if(n.valueField&&o.push(n.valueField),o.length>=1)return o}return null}getOptimunHeightForChart(t){var e,n,o,r,s;const l=this.getCellHeaderPaths(this.rowHeaderLevelCount,t).rowHeaderPaths;let a,h;for(const u in this.dataset.collectValuesBy)if(this.dataset.collectValuesBy[u].type==="yField"&&!this.dataset.collectValuesBy[u].range){a=(e=this.dataset.collectedValues[u])===null||e===void 0?void 0:e[l.map(c=>c.value).join(this.dataset.stringJoinChar)];break}if(this._chartItemBandSize)h=AT((n=a==null?void 0:a.length)!==null&&n!==void 0?n:0,this._chartItemBandSize,this._chartPaddingInner,this._chartPaddingOuter);else{const u=this._chartItemSpanSize||25;h=((o=a==null?void 0:a.length)!==null&&o!==void 0?o:0)*(u+u/3)}const d=Qt((s=(r=this._chartPadding)!==null&&r!==void 0?r:this._table.theme.bodyStyle.padding)!==null&&s!==void 0?s:0);return h+d[0]+d[2]}getOptimunWidthForChart(t){var e,n,o,r,s;const l=this.getCellHeaderPaths(t,this.columnHeaderLevelCount).colHeaderPaths;let a,h;for(const u in this.dataset.collectValuesBy)if(this.dataset.collectValuesBy[u].type==="xField"&&!this.dataset.collectValuesBy[u].range){a=(e=this.dataset.collectedValues[u])===null||e===void 0?void 0:e[l.map(c=>c.value).join(this.dataset.stringJoinChar)];break}if(this._chartItemBandSize)h=AT((n=a==null?void 0:a.length)!==null&&n!==void 0?n:0,this._chartItemBandSize,this._chartPaddingInner,this._chartPaddingOuter);else{const u=this._chartItemSpanSize||25;h=((o=a==null?void 0:a.length)!==null&&o!==void 0?o:0)*(u+u/3)}const d=Qt((s=(r=this._chartPadding)!==null&&r!==void 0?r:this._table.theme.bodyStyle.padding)!==null&&s!==void 0?s:0);return h+d[1]+d[3]}get leftAxesCount(){if(!this._table.isPivotChart())return 0;const t=this._table.pivotChartAxes.find(e=>e.orient==="left");return(t==null?void 0:t.visible)===!1?0:(this.indicatorsAsCol,1)}get topAxesCount(){if(!this._table.isPivotChart())return 0;const t=this._table.pivotChartAxes.find(e=>e.orient==="top");return(t==null?void 0:t.visible)===!1?0:this.indicatorsAsCol&&this.hasTwoIndicatorAxes?1:0}get rightAxesCount(){return this.rightFrozenColCount}get bottomAxesCount(){return this.bottomFrozenRowCount}getColKeysPath(t,e){const n=this.getCellHeaderPaths(t,e),o=[];return n.colHeaderPaths.length&&n.colHeaderPaths.forEach(r=>{r.dimensionKey&&o.push(r.value)}),o==null?void 0:o.join(this.dataset.stringJoinChar)}getRowKeysPath(t,e){const n=this.getCellHeaderPaths(t,e),o=[];return n.rowHeaderPaths.length&&n.rowHeaderPaths.forEach(r=>{r.dimensionKey&&o.push(r.value)}),o==null?void 0:o.join(this.dataset.stringJoinChar)}getIndicatorInfo(t,e=""){var n;return(n=this.indicatorsDefine)===null||n===void 0?void 0:n.find(o=>typeof o!="string"&&(t?o.indicatorKey===t:!!e&&o.title===e))}getLayoutColumnTree(){const t=[],e=this.columnDimensionTree.tree.children;return ov(t,e),t}getLayoutRowTree(){const t=[],e=this.rowDimensionTree.tree.children;return ov(t,e),t}getLayoutColumnTreeCount(){const t=this.columnDimensionTree.tree.children;return bg(t,this.rowHierarchyType==="tree")}getLayoutRowTreeCount(){var t;const e=this.rowDimensionTree.tree.children;let n=bg(e,this.rowHierarchyType==="tree");return(t=this.extensionRows)===null||t===void 0||t.forEach(o=>{if(typeof o.rowTree!="function"){const r=bg(o.rowTree,!0);n*=r}}),n}resetHeaderTree(){var t,e,n;this.colIndex=0,this._rowHeaderCellFullPathIds_FULL=[],this._columnHeaderCellFullPathIds=[],this._columnHeaderCellIds=[];const o=this.dataset;this.rowTree=o.rowHeaderTree,this.columnTree=o.colHeaderTree;const r=this.rowDimensionTree.tree.children;(t=this.rowTree)===null||t===void 0||t.forEach((s,l)=>{const a=r.find(h=>h.dimensionKey===s.dimensionKey&&h.value===s.value);a&&this._table._syncHierarchyState(a,s)}),this.columnDimensionTree=new Pe((e=this.columnTree)!==null&&e!==void 0?e:[],this.sharedVar),this.rowDimensionTree=new Pe((n=this.rowTree)!==null&&n!==void 0?n:[],this.sharedVar,this.rowHierarchyType,this.rowHierarchyType==="tree"?this.rowExpandLevel:void 0),this.resetColumnHeaderLevelCount(),this._generateColHeaderIds(),this.colIndex=0,this._generateRowHeaderIds(),this._rowHeaderCellFullPathIds_FULL=im(this._rowHeaderCellFullPathIds_FULL),this._headerObjectMap=this._headerObjects.reduce((s,l)=>(s[l.id]=l,s),{}),this._CellHeaderPathMap=new Map,this._largeCellRangeCache.length=0,this.generateCellIdsConsiderHideHeader(),this.setPagination(this.pagination)}isSeriesNumberInHeader(t,e){return this.leftRowSeriesNumberColumnCount>0&&t>=0&&e>=0&&t<this.leftRowSeriesNumberColumnCount&&e<this.headerLevelCount||this.rightRowSeriesNumberColumnCount>0&&e>=0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e<this.headerLevelCount}isSeriesNumberInBody(t,e){return this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount&&e>=this.headerLevelCount||this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e>=this.headerLevelCount}isSeriesNumber(t,e){return!!(z(t)&&z(e)&&(this.leftRowSeriesNumberColumnCount>0&&t>=0&&e>=0&&t<this.leftRowSeriesNumberColumnCount||this.rightRowSeriesNumberColumnCount>0&&e>=0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount))}getSeriesNumberHeader(t,e){return this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount&&e<this.headerLevelCount?Object.assign({},this.leftRowSeriesNumberColumn[t],{style:this._table.internalProps.rowSeriesNumber.headerStyle}):this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e<this.headerLevelCount&&e<this.headerLevelCount?this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)]:void 0}getSeriesNumberBody(t,e){return this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount&&e>=this.headerLevelCount?this.leftRowSeriesNumberColumn[t]:this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e>=this.headerLevelCount?this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)]:void 0}changeTreeNodeTitle(t,e,n){this.getHeadNode(t,e).value=n;const o=this.getCellId(t,e);this._headerObjectMap[o].title=n}changeCornerTitle(t,e,n){if(this.isCornerHeader(t,e)){const o=this.getCellId(t,e);this._headerObjectMap[o].title=n}}generateCellIdsConsiderHideHeader(){if(this._columnHeaderCellIds=this._columnHeaderCellFullPathIds.slice(),!this.showColumnHeader)if(this.indicatorsAsCol&&!this.hideIndicatorName){const t=this.colDimensionKeys.indexOf(Xi),e=this._columnHeaderCellIds.splice(t,1);this._columnHeaderCellIds.splice(0,this._columnHeaderCellIds.length),this._columnHeaderCellIds.push(e[0])}else this._columnHeaderCellIds.splice(0,this._columnHeaderCellIds.length);if(this._rowHeaderCellIds_FULL=this._rowHeaderCellFullPathIds_FULL.slice(),!this.showRowHeader)if(this.indicatorsAsCol||this.hideIndicatorName)this._rowHeaderCellIds_FULL.forEach((t,e)=>{const n=t.slice();n.splice(0,n.length),this._rowHeaderCellIds_FULL[e]=n});else{const t=this.rowDimensionKeys.indexOf(Xi);this._rowHeaderCellIds_FULL.forEach((e,n)=>{const o=e.slice(),r=o.splice(t,1);o.splice(0,o.length),o.push(r[0]),this._rowHeaderCellIds_FULL[n]=o})}if(this._rowHeaderCellIds=this._rowHeaderCellIds_FULL.slice(),this._cornerHeaderCellIds=this._cornerHeaderCellFullPathIds.slice(),this.rowHeaderLevelCount===0||this.columnHeaderLevelCount===0)this._cornerHeaderCellIds=[];else if(this.cornerSetting.titleOnDimension!=="row"||this.showRowHeader){if(this.cornerSetting.titleOnDimension==="column"&&!this.showColumnHeader)if(this.indicatorsAsCol&&!this.hideIndicatorName){const t=this.colDimensionKeys.indexOf(Xi),e=this._cornerHeaderCellIds.splice(t,1);this._cornerHeaderCellIds.splice(0,this._cornerHeaderCellIds.length),this._cornerHeaderCellIds.push(e[0])}else this._cornerHeaderCellIds.splice(0,this._cornerHeaderCellIds.length)}else if(this.indicatorsAsCol||this.hideIndicatorName)this._cornerHeaderCellIds.forEach((t,e)=>{const n=t.slice();n.splice(0,n.length),this._cornerHeaderCellIds[e]=n});else{const t=this.rowDimensionKeys.indexOf(Xi);this._cornerHeaderCellIds.forEach((e,n)=>{const o=e.slice(),r=o.splice(t,1);o.splice(0,o.length),o.push(r[0]),this._cornerHeaderCellIds[n]=o})}}enableUseGetBodyCache(){this._useGetBodyCache=!0,this._getBodyCache.clear()}disableUseGetBodyCache(){this._useGetBodyCache=!1,this._getBodyCache.clear()}enableUseHeaderPathCache(){this._useHeaderPathCache=!0,this._colHeaderPathCache.clear(),this._rowHeaderPathCache.clear()}disableUseHeaderPathCache(){this._useHeaderPathCache=!1,this._colHeaderPathCache.clear(),this._rowHeaderPathCache.clear()}getBodyWidthCache(t,e){if(this._useGetBodyCache&&!this.isHeader(t,e)&&!this.isSeriesNumber(t,e))return this.indicatorsAsCol&&this._getBodyCache.has(t)?this._getBodyCache.get(t):!this.indicatorsAsCol&&this._getBodyCache.has(e)?this._getBodyCache.get(e):void 0}setBodyWidthCache(t,e,n){!this._useGetBodyCache||this.isHeader(t,e)||this.isSeriesNumber(t,e)||(this.indicatorsAsCol?this._getBodyCache.set(t,n):this._getBodyCache.set(e,n))}getColHeaderPathCache(t,e){if(this._useHeaderPathCache&&!this.isHeader(t,e)&&!this.isSeriesNumber(t,e)&&this._colHeaderPathCache.has(t))return this._colHeaderPathCache.get(t)}setColHeaderPathCache(t,e,n){!this._useHeaderPathCache||this.isHeader(t,e)||this.isSeriesNumber(t,e)||this._colHeaderPathCache.set(t,n)}getRowHeaderPathCache(t,e){if(this._useHeaderPathCache&&!this.isHeader(t,e)&&!this.isSeriesNumber(t,e)&&this._rowHeaderPathCache.has(e))return this._rowHeaderPathCache.get(e)}setRowHeaderPathCache(t,e,n){!this._useHeaderPathCache||this.isHeader(t,e)||this.isSeriesNumber(t,e)||this._rowHeaderPathCache.set(e,n)}}function AT(i,t,e,n){e===1&&(e=0);const o=O9(i,e,n),r=t/(1-e);return Math.ceil(o*r)}function O9(i,t,e){let n;return n=i===1?i+2*e:i-t+2*e,i?n>0?n:1:0}class pv{constructor(t,e){this.tree={},this.beforeChangedTree={},this.colFlatKeys={},this.rowFlatKeys={},this.stringJoinChar=String.fromCharCode(0),this.rowsIsTotal=[],this.colsIsTotal=[],this.dataConfig=t,e&&(this.records=e,typeof window<"u"&&window.performance.now(),this.setRecords(e),typeof window<"u"&&window.performance.now())}changeDataConfig(t){this.dataConfig=t}setRecords(t){this.processRecords()}processRecords(){for(let t=0,e=this.records.length;t<e;t++){const n=this.records[t];this.processRecord(n)}}processRecord(t){var e;const n=[],o=[];for(let r=0,s=this.dataConfig.rows.length;r<s;r++){const l=this.dataConfig.rows[r];t[l]!==void 0&&l!==this.dataConfig.indicatorDimensionKey&&o.push(t[l])}for(let r=0,s=this.dataConfig.columns.length;r<s;r++){const l=this.dataConfig.columns[r];t[l]!==void 0&&l!==this.dataConfig.indicatorDimensionKey&&n.push(t[l])}(e=this.dataConfig.indicators)===null||e===void 0||e.forEach(r=>{const s=t[r];s!==void 0&&(this.dataConfig.indicatorsAsCol?n.push(r):o.push(r));const l=o.join(this.stringJoinChar),a=n.join(this.stringJoinChar);o.length!==0&&(this.rowFlatKeys[l]||(this.rowFlatKeys[l]=1)),n.length!==0&&(this.colFlatKeys[a]||(this.colFlatKeys[a]=1)),n.length===0&&o.length===0||(this.tree[l]||(this.tree[l]={}),s!==void 0&&(this.tree[l][a]={value:s,record:t},this.dataConfig.indicatorsAsCol?n.pop():o.pop()))})}getTreeNode(t=[],e=[],n,o=!0){var r,s,l,a;let h,d;if(typeof t=="string")h=t;else{let u=!1;t.map((c,g)=>{c===n&&(t.splice(g,1),u=!0)}),u&&t.push(n),h=t.join(this.stringJoinChar)}if(typeof e=="string")d=e;else{let u=!1;e.map((c,g)=>{c===n&&(e.splice(g,1),u=!0)}),u&&e.push(n),d=e.join(this.stringJoinChar)}return o?(l=(s=(r=this.tree)===null||r===void 0?void 0:r[h])===null||s===void 0?void 0:s[d])!==null&&l!==void 0?l:void 0:z((a=this.beforeChangedTree[h])===null||a===void 0?void 0:a[d])?{value:this.beforeChangedTree[h][d].value,record:this.beforeChangedTree[h][d].record}:void 0}changeTreeNodeValue(t=[],e=[],n,o){var r,s,l,a,h,d,u;let c,g;if(typeof t=="string")c=t;else{let m=!1;t.map((b,C)=>{b===n&&(t.splice(C,1),m=!0)}),m&&t.push(n),c=t.join(this.stringJoinChar)}if(typeof e=="string")g=e;else{let m=!1;e.map((b,C)=>{b===n&&(e.splice(C,1),m=!0)}),m&&e.push(n),g=e.join(this.stringJoinChar)}const f=(s=(r=this.tree[c])===null||r===void 0?void 0:r[g])===null||s===void 0?void 0:s.value,p=Object.assign({},(a=(l=this.tree[c])===null||l===void 0?void 0:l[g])===null||a===void 0?void 0:a.record);!((d=(h=this.tree[c])===null||h===void 0?void 0:h[g])===null||d===void 0)&&d.record?(this.tree[c][g].record[n]=o,this.tree[c][g].value=o):(this.tree[c]||(this.tree[c]={}),this.tree[c][g]={record:this._buildRecord(t,e,n,o),value:o}),!((u=this.beforeChangedTree[c])===null||u===void 0)&&u[g]||(this.beforeChangedTree[c]={},this.beforeChangedTree[c][g]={record:void 0,value:void 0},this.beforeChangedTree[c][g].record=p,this.beforeChangedTree[c][g].value=f)}_buildRecord(t=[],e=[],n,o){const r={},s=this.dataConfig.rows,l=this.dataConfig.columns;return s.forEach((a,h)=>{a!==this.dataConfig.indicatorDimensionKey&&(r[a]=t[h])}),l.forEach((a,h)=>{a!==this.dataConfig.indicatorDimensionKey&&(r[a]=e[h])}),r[n]=o,this.records.push(r),r}addRecords(t){for(let e=0,n=t.length;e<n;e++){const o=t[e];this.processRecord(o)}this.records.push(t)}changeRecordFieldValue(t,e,n){let o=!1;for(let r=0;r<this.dataConfig.indicators.length;r++)this.dataConfig.indicators[r]===t&&(o=!0);if(!o){for(let r=0,s=this.records.length;r<s;r++){const l=this.records[r];l[t]===e&&(l[t]=n)}this.rowFlatKeys={},this.colFlatKeys={},this.tree={},this.processRecords()}}}function TT(i,t){let e="";for(let n=0;n<i.length;n++)e+=i[n],n!==i.length-1&&(e+=t);return e}class Ih{constructor(t,e,n,o,r,s,l,a,h,d,u,c,g){var f,p,m,b,C,_,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht,gt,Ct,Q,et,vt;this.tree={},this.changedTree={},this.colFlatKeys={},this.rowFlatKeys={},this.colKeys=[],this.rowKeys=[],this.colKeys_normal=[],this.rowKeys_normal=[],this.rowOrder="key_a_to_z",this.colOrder="key_a_to_z",this.sorted=!1,this.indicatorStatistics=[],this.aggregators={},this.stringJoinChar=String.fromCharCode(0),this.rowsIsTotal=[],this.colsIsTotal=[],this.collectedValues={},this.cacheCollectedValues={},this.totalRecordsTree={},this.registerAggregators(),this.dataConfig=t,this.filterRules=(f=this.dataConfig)===null||f===void 0?void 0:f.filterRules,this.rowHierarchyType=a??"grid",this.sortRules=(p=this.dataConfig)===null||p===void 0?void 0:p.sortRules,this.aggregationRules=(m=this.dataConfig)===null||m===void 0?void 0:m.aggregationRules,this.derivedFieldRules=(b=this.dataConfig)===null||b===void 0?void 0:b.derivedFieldRules,this.mappingRules=(C=this.dataConfig)===null||C===void 0?void 0:C.mappingRules,this.calculatedFieldRules=(_=this.dataConfig)===null||_===void 0?void 0:_.calculatedFieldRules,this.calculatedFiledKeys=(y=(w=this.calculatedFieldRules)===null||w===void 0?void 0:w.map(bt=>bt.key))!==null&&y!==void 0?y:[],this.calculatedFieldDependIndicatorKeys=(A=(S=this.calculatedFieldRules)===null||S===void 0?void 0:S.reduce((bt,dt)=>{for(let ot=0;ot<dt.dependIndicatorKeys.length;ot++)bt.indexOf(dt.dependIndicatorKeys[ot])===-1&&bt.push(dt.dependIndicatorKeys[ot]);return bt},[]))!==null&&A!==void 0?A:[],this.totals=(R=this.dataConfig)===null||R===void 0?void 0:R.totals,this.rows=e,this.columns=n,this.indicatorKeys=o,this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys=[...o];for(let bt=0;bt<this.calculatedFieldDependIndicatorKeys.length;bt++)this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys.indexOf(this.calculatedFieldDependIndicatorKeys[bt])===-1&&this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys.push(this.calculatedFieldDependIndicatorKeys[bt]);if(this.indicatorsAsCol=s,this.indicators=r,this.customColTree=h,this.customRowTree=d,this.hasExtensionRowTree=c,this.parseCustomTreeToMatchRecords=g,this.parseCustomTreeToMatchRecords&&(this.customColTreeDimensionPaths=this.customTreeToDimensionPathArr(this.customColTree,"col"),this.hasExtensionRowTree||(this.customRowTreeDimensionPaths=this.customTreeToDimensionPathArr(this.customRowTree,"row"))),this.colGrandTotalLabel=(M=(T=(x=this.totals)===null||x===void 0?void 0:x.column)===null||T===void 0?void 0:T.grandTotalLabel)!==null&&M!==void 0?M:"总计",this.colSubTotalLabel=(F=(P=(B=this.totals)===null||B===void 0?void 0:B.column)===null||P===void 0?void 0:P.subTotalLabel)!==null&&F!==void 0?F:"小计",this.rowGrandTotalLabel=(k=(E=(H=this.totals)===null||H===void 0?void 0:H.row)===null||E===void 0?void 0:E.grandTotalLabel)!==null&&k!==void 0?k:"总计",this.rowSubTotalLabel=(D=(L=(I=this.totals)===null||I===void 0?void 0:I.row)===null||L===void 0?void 0:L.subTotalLabel)!==null&&D!==void 0?D:"小计",this.collectValuesBy=(O=this.dataConfig)===null||O===void 0?void 0:O.collectValuesBy,this.needSplitPositiveAndNegative=u!=null&&u,this.rowsIsTotal=new Array((W=(N=this.rows)===null||N===void 0?void 0:N.length)!==null&&W!==void 0?W:0).fill(!1),this.colsIsTotal=new Array((U=($=this.columns)===null||$===void 0?void 0:$.length)!==null&&U!==void 0?U:0).fill(!1),((Y=this.totals)===null||Y===void 0?void 0:Y.row)&&this.totals.row.showSubTotals!==!1&&this.totals.row.subTotalsDimensions)for(let bt=0,dt=(ht=(X=(G=(j=this.totals)===null||j===void 0?void 0:j.row)===null||G===void 0?void 0:G.subTotalsDimensions)===null||X===void 0?void 0:X.length)!==null&&ht!==void 0?ht:0;bt<dt;bt++){const ot=this.totals.row.subTotalsDimensions[bt],ut=this.rows.indexOf(ot);this.rowsIsTotal[ut]=!0}if(!((gt=this.totals)===null||gt===void 0)&&gt.column&&this.totals.column.showSubTotals!==!1&&this.totals.column.subTotalsDimensions)for(let bt=0,dt=(vt=(et=(Q=(Ct=this.totals)===null||Ct===void 0?void 0:Ct.column)===null||Q===void 0?void 0:Q.subTotalsDimensions)===null||et===void 0?void 0:et.length)!==null&&vt!==void 0?vt:0;bt<dt;bt++){const ot=this.totals.column.subTotalsDimensions[bt],ut=this.columns.indexOf(ot);this.colsIsTotal[ut]=!0}this.setRecords(l)}setRecords(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w;this.records=t,this.collectedValues={},this.cacheCollectedValues={},this.totalRecordsTree={},this.tree={},this.colFlatKeys={},this.rowFlatKeys={},this.colKeys=[],this.rowKeys=[],this.rowsHasValue=[],this.columnsHasValue=[],t&&(this.records=t,typeof window<"u"&&window.performance.now(),this.processRecords(),this.processCollectedValuesWithSumBy(),this.generateCollectedValuesSortRule(),this.processCollectedValuesWithSortBy(),typeof window<"u"&&window.performance.now(),typeof window<"u"&&window.performance.now(),this.totalStatistics(),typeof window<"u"&&window.performance.now(),this.rowKeys_normal=this.rowKeys.slice(),this.colKeys_normal=this.colKeys.slice(),typeof window<"u"&&window.performance.now(),this.sortKeys(),typeof window<"u"&&window.performance.now(),typeof window<"u"&&window.performance.now(),this.customRowTree?this.rowHeaderTree=this.customRowTree:this.rowHierarchyType==="tree"?this.rowHeaderTree=this.ArrToTree1(this.rowKeys,this.rows.filter((y,S)=>this.rowsHasValue[S]),this.indicatorsAsCol?void 0:this.indicators,((n=(e=this.totals)===null||e===void 0?void 0:e.row)===null||n===void 0?void 0:n.showGrandTotals)||!this.indicatorsAsCol&&this.columns.length===0||this.indicatorsAsCol&&this.rows.length===0,this.rowGrandTotalLabel):this.rowHeaderTree=this.ArrToTree(this.rowKeys,this.rows.filter((y,S)=>this.rowsHasValue[S]),this.indicatorsAsCol?void 0:this.indicators,this.rowsIsTotal,((r=(o=this.totals)===null||o===void 0?void 0:o.row)===null||r===void 0?void 0:r.showGrandTotals)||this.indicatorsAsCol&&this.rows.length===0,this.rowGrandTotalLabel,this.rowSubTotalLabel,(a=(l=(s=this.totals)===null||s===void 0?void 0:s.row)===null||l===void 0?void 0:l.showGrandTotalsOnTop)!==null&&a!==void 0&&a,(u=(d=(h=this.totals)===null||h===void 0?void 0:h.row)===null||d===void 0?void 0:d.showSubTotalsOnTop)!==null&&u!==void 0&&u),this.customColTree?this.colHeaderTree=this.customColTree:this.colHeaderTree=this.ArrToTree(this.colKeys,this.columns.filter((y,S)=>this.columnsHasValue[S]),this.indicatorsAsCol?this.indicators:void 0,this.colsIsTotal,((g=(c=this.totals)===null||c===void 0?void 0:c.column)===null||g===void 0?void 0:g.showGrandTotals)||!this.indicatorsAsCol&&this.columns.length===0,this.colGrandTotalLabel,this.colSubTotalLabel,(m=(p=(f=this.totals)===null||f===void 0?void 0:f.column)===null||p===void 0?void 0:p.showGrandTotalsOnLeft)!==null&&m!==void 0&&m,(_=(C=(b=this.totals)===null||b===void 0?void 0:b.column)===null||C===void 0?void 0:C.showSubTotalsOnLeft)!==null&&_!==void 0&&_),typeof window<"u"&&window.performance.now(),!((w=this.dataConfig)===null||w===void 0)&&w.isPivotChart&&this.cacheDeminsionCollectedValues())}registerAggregator(t,e){this.aggregators[t]=e}registerAggregators(){this.registerAggregator(zt.RECORD,Px),this.registerAggregator(zt.SUM,Ex),this.registerAggregator(zt.COUNT,Lx),this.registerAggregator(zt.MAX,Fx),this.registerAggregator(zt.MIN,Ix),this.registerAggregator(zt.AVG,kx),this.registerAggregator(zt.NONE,Hx),this.registerAggregator(zt.RECALCULATE,K4)}processCollectedValuesWithSumBy(){var t,e,n,o,r,s;for(const l in this.collectedValues)if(!((e=(t=this.collectValuesBy)===null||t===void 0?void 0:t[l])===null||e===void 0)&&e.sumBy)for(const a in this.collectedValues[l]){let h;((n=this.collectValuesBy[l])===null||n===void 0?void 0:n.extendRange)==="sum"?(h=Object.values(this.collectedValues[l][a]).reduce((g,f)=>g+f.value(),0),h+=Math.round(h/20)):(h=Object.values(this.collectedValues[l][a]).reduce((g,f)=>f.value()>g?f.value():g,Number.MIN_SAFE_INTEGER),((o=this.collectValuesBy[l])===null||o===void 0?void 0:o.extendRange)==="max"?h+=Math.round(h/20):typeof((r=this.collectValuesBy[l])===null||r===void 0?void 0:r.extendRange)=="number"&&(h=Math.max(h,(s=this.collectValuesBy[l])===null||s===void 0?void 0:s.extendRange)));const d=Object.values(this.collectedValues[l][a]).reduce((g,f)=>f.value()<g?f.value():g,Number.MAX_SAFE_INTEGER);let u,c;this.needSplitPositiveAndNegative&&(u=Object.values(this.collectedValues[l][a]).reduce((g,f)=>f.positiveValue()>g?f.positiveValue():g,Number.MIN_SAFE_INTEGER),c=Object.values(this.collectedValues[l][a]).reduce((g,f)=>f.negativeValue()<g?f.negativeValue():g,Number.MAX_SAFE_INTEGER)),this.collectedValues[l][a]={},this.collectedValues[l][a].max=h,this.collectedValues[l][a].min=d,this.needSplitPositiveAndNegative&&(this.collectedValues[l][a].positiveMax=u,this.collectedValues[l][a].negativeMin=c)}}processCollectedValuesWithSortBy(){var t,e;const n=this;for(const o in this.collectedValues)if(!((e=(t=this.collectValuesBy)===null||t===void 0?void 0:t[o])===null||e===void 0)&&e.sortBy)for(const r in this.collectedValues[o])this.collectedValues[o][r]=this.collectedValues[o][r].sort((s,l)=>{var a,h,d,u;return((h=(a=n.collectValuesBy[o].sortBy)===null||a===void 0?void 0:a.indexOf(s))!==null&&h!==void 0?h:-1)-((u=(d=n.collectValuesBy[o].sortBy)===null||d===void 0?void 0:d.indexOf(l))!==null&&u!==void 0?u:-1)})}generateCollectedValuesSortRule(){for(const t in this.collectedValues)if(this.collectValuesBy&&this.collectValuesBy[t]&&!this.collectValuesBy[t].sortBy){let e=[];for(const n in this.collectedValues[t])Array.isArray(this.collectedValues[t][n])&&(e.push(...this.collectedValues[t][n]),e=Array.from(new Set(e)));e.length>0&&(this.collectValuesBy[t].sortBy=e)}}processRecords(){var t,e;let n=!1;if(((e=(t=this.filterRules)===null||t===void 0?void 0:t.length)!==null&&e!==void 0?e:0)>=1&&(n=!0),Array.isArray(this.records)){this.filteredRecords||(this.filteredRecords=[]);for(let o=0,r=this.records.length;o<r;o++){const s=this.records[o];n&&!this.filterRecord(s)||(this.filteredRecords.push(s),this.processRecord(s))}}else{this.filteredRecords||(this.filteredRecords={});for(const o in this.records)for(let r=0,s=this.records[o].length;r<s;r++){const l=this.records[o][r];n&&!this.filterRecord(l)||(this.filteredRecords[o]||(this.filteredRecords[o]=[]),this.filteredRecords[o].push(l),this.processRecord(l,o))}}this.rowFlatKeys={},this.colFlatKeys={}}filterRecord(t){var e,n;let o=!0;if(this.filterRules)for(let r=0;r<this.filterRules.length;r++){const s=this.filterRules[r];if(s.filterKey){const l=t[s.filterKey];if(((e=s.filteredValues)===null||e===void 0?void 0:e.indexOf(l))===-1){o=!1;break}}else if(!(!((n=s.filterFunc)===null||n===void 0)&&n.call(s,t))){o=!1;break}}return o}processRecord(t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht,gt,Ct,Q,et,vt,bt,dt,ot,ut,st,_t,ct,Wt,Yt,yt,mt,ie,le,Zt,_e,Oe;(n=this.derivedFieldRules)===null||n===void 0||n.forEach((Rt,Tt)=>{Rt.fieldName&&Rt.derivedFunc&&(t[Rt.fieldName]=Rt.derivedFunc(t))});for(const Rt in this.collectValuesBy)if(z(t[Rt])){this.collectedValues[Rt]||(this.collectedValues[Rt]={});const Tt=this.collectValuesBy[Rt].by.map(Nt=>t[Nt]).join(this.stringJoinChar);if(this.collectedValues[Rt][Tt]||(this.collectValuesBy[Rt].sumBy?this.collectedValues[Rt][Tt]={}:this.collectValuesBy[Rt].range?this.collectedValues[Rt][Tt]={min:Number.MAX_SAFE_INTEGER,max:Number.MIN_SAFE_INTEGER}:this.collectedValues[Rt][Tt]=[]),this.collectValuesBy[Rt].sumBy){const Nt=this.collectValuesBy[Rt].sumBy.map(te=>t[te]).join(this.stringJoinChar);this.collectedValues[Rt][Tt][Nt]||(this.collectedValues[Rt][Tt][Nt]=new this.aggregators[zt.SUM]({key:Rt,dimension:Rt,isRecord:void 0,needSplitPositiveAndNegative:this.needSplitPositiveAndNegative})),this.collectedValues[Rt][Tt][Nt].push(t)}else if(this.collectValuesBy[Rt].range){const Nt=this.collectedValues[Rt][Tt],te=Math.max(t[Rt],Nt.max),ae=Math.min(t[Rt],Nt.min);isNaN(te)||(Nt.max=te,Nt.min=ae)}else{const Nt=this.collectedValues[Rt][Tt];Nt.indexOf(t[Rt])===-1&&Nt.push(t[Rt])}}let He=!1;const Ht=[],Et=[];if(!this.parseCustomTreeToMatchRecords||!((o=this.dataConfig)===null||o===void 0)&&o.isPivotChart||!(!((r=this.customRowTree)===null||r===void 0)&&r.length)||e||this.hasExtensionRowTree){const Rt=[];Et.push({rowKey:Rt,indicatorKey:e});for(let Tt=0,Nt=this.rows.length;Tt<Nt;Tt++){const te=this.rows[Tt];if(te in t)this.rowsHasValue[Tt]=!0,Rt.push(t[te]);else if(te!==Xi){if(!((a=(l=(s=this.dataConfig)===null||s===void 0?void 0:s.totals)===null||l===void 0?void 0:l.row)===null||a===void 0)&&a.showGrandTotals&&Tt===0&&!this.rows.find(ae=>ae in t)){Rt.push(this.rowGrandTotalLabel),He=!0;break}if(!((u=(d=(h=this.dataConfig)===null||h===void 0?void 0:h.totals)===null||d===void 0?void 0:d.row)===null||u===void 0)&&u.subTotalsDimensions&&((f=(g=(c=this.dataConfig)===null||c===void 0?void 0:c.totals)===null||g===void 0?void 0:g.row)===null||f===void 0?void 0:f.subTotalsDimensions.indexOf(this.rows[Tt-1]))>=0){this.rowHierarchyType==="grid"&&Rt.push(this.rowSubTotalLabel),He=!0;break}}}}else{const Rt=this.getFieldMatchRowDimensionPaths(t);if(Rt.length>0)for(let Tt=0,Nt=Rt.length;Tt<Nt;Tt++){const te=Rt[Tt],ae=[];let Jt;for(let J=0,be=te.length;J<be;J++)z(te[J].indicatorKey)?Jt=te[J].indicatorKey:ae.push(te[J].value);Et.push({rowKey:ae,indicatorKey:Jt})}}if(!this.parseCustomTreeToMatchRecords||!((p=this.dataConfig)===null||p===void 0)&&p.isPivotChart||!(!((m=this.customColTree)===null||m===void 0)&&m.length)||e||this.hasExtensionRowTree){const Rt=[];Ht.push({colKey:Rt,indicatorKey:e});for(let Tt=0,Nt=this.columns.length;Tt<Nt;Tt++){const te=this.columns[Tt];if(te in t)this.columnsHasValue[Tt]=!0,Rt.push(t[te]);else if(te!==Xi){if(!((_=(C=(b=this.dataConfig)===null||b===void 0?void 0:b.totals)===null||C===void 0?void 0:C.column)===null||_===void 0)&&_.showGrandTotals&&Tt===0&&!this.columns.find(ae=>ae in t)){Rt.push(this.colGrandTotalLabel),He=!0;break}if(!((S=(y=(w=this.dataConfig)===null||w===void 0?void 0:w.totals)===null||y===void 0?void 0:y.column)===null||S===void 0)&&S.subTotalsDimensions&&((x=(R=(A=this.dataConfig)===null||A===void 0?void 0:A.totals)===null||R===void 0?void 0:R.column)===null||x===void 0?void 0:x.subTotalsDimensions.indexOf(this.columns[Tt-1]))>=0){Rt.push(this.colSubTotalLabel),He=!0;break}}}}else{const Rt=this.getFieldMatchColDimensionPaths(t);if(Rt.length>0)for(let Tt=0,Nt=Rt.length;Tt<Nt;Tt++){const te=Rt[Tt],ae=[];let Jt;for(let J=0,be=te.length;J<be;J++)z(te[J].indicatorKey)?Jt=te[J].indicatorKey:ae.push(te[J].value);Ht.push({colKey:ae,indicatorKey:Jt})}}for(let Rt=0;Rt<Et.length;Rt++){const Tt=Et[Rt].rowKey;let Nt;this.indicatorsAsCol||(Nt=Et[Rt].indicatorKey);for(let te=0;te<Ht.length;te++){const ae=Ht[te].colKey;this.indicatorsAsCol&&(Nt=Ht[te].indicatorKey);const Jt=Tt.join(this.stringJoinChar),J=ae.join(this.stringJoinChar);if(He){this.totalRecordsTree[Jt]||(this.totalRecordsTree[Jt]={}),this.totalRecordsTree[Jt][J]||(this.totalRecordsTree[Jt][J]=[]);const Lt=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let Ot=0;Ot<Lt.length;Ot++)if(this.calculatedFiledKeys.indexOf(Lt[Ot])>=0){const Se=(T=this.calculatedFieldRules)===null||T===void 0?void 0:T.find(qe=>qe.key===Lt[Ot]);!((B=(M=this.totalRecordsTree[Jt])===null||M===void 0?void 0:M[J])===null||B===void 0)&&B[Ot]||(this.totalRecordsTree[Jt][J][Ot]=new this.aggregators[zt.RECALCULATE]({key:Lt[Ot],dimension:Lt[Ot],isRecord:!0,formatFun:(F=(P=this.indicators)===null||P===void 0?void 0:P.find(qe=>typeof qe!="string"&&qe.indicatorKey===Lt[Ot]))===null||F===void 0?void 0:F.format,calculateFun:Se==null?void 0:Se.calculateFun,dependAggregators:this.totalRecordsTree[Jt][J],dependIndicatorKeys:Se==null?void 0:Se.dependIndicatorKeys})),Lt[Ot]in t&&((E=(H=this.totalRecordsTree[Jt])===null||H===void 0?void 0:H[J])===null||E===void 0||E[Ot].push(t))}else{const Se=this.getAggregatorRule(Lt[Ot]);!((I=(k=this.totalRecordsTree[Jt])===null||k===void 0?void 0:k[J])===null||I===void 0)&&I[Ot]||(this.totalRecordsTree[Jt][J][Ot]=new this.aggregators[(L=Se==null?void 0:Se.aggregationType)!==null&&L!==void 0?L:zt.SUM]({key:Lt[Ot],dimension:(D=Se==null?void 0:Se.field)!==null&&D!==void 0?D:Lt[Ot],formatFun:(O=Se==null?void 0:Se.formatFun)!==null&&O!==void 0?O:(W=(N=this.indicators)===null||N===void 0?void 0:N.find(qe=>typeof qe!="string"&&qe.indicatorKey===Lt[Ot]))===null||W===void 0?void 0:W.format})),Lt[Ot]in t&&((U=($=this.totalRecordsTree[Jt])===null||$===void 0?void 0:$[J])===null||U===void 0||U[Ot].push(t))}return}Tt.length!==0&&(this.rowFlatKeys[Jt]||(this.rowKeys.push(Tt),this.rowFlatKeys[Jt]=1)),ae.length!==0&&(this.colFlatKeys[J]||(this.colKeys.push(ae),this.colFlatKeys[J]=1)),this.tree[Jt]||(this.tree[Jt]={}),!((Y=this.tree[Jt])===null||Y===void 0)&&Y[J]||(this.tree[Jt][J]=[]);const be=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let Lt=0;Lt<be.length;Lt++)if(this.calculatedFiledKeys.indexOf(be[Lt])>=0){const Ot=(j=this.calculatedFieldRules)===null||j===void 0?void 0:j.find(Se=>Se.key===be[Lt]);!((X=(G=this.tree[Jt])===null||G===void 0?void 0:G[J])===null||X===void 0)&&X[Lt]||(this.tree[Jt][J][Lt]=new this.aggregators[zt.RECALCULATE]({key:be[Lt],dimension:be[Lt],isRecord:!0,formatFun:(gt=(ht=this.indicators)===null||ht===void 0?void 0:ht.find(Se=>typeof Se!="string"&&Se.indicatorKey===be[Lt]))===null||gt===void 0?void 0:gt.format,calculateFun:Ot==null?void 0:Ot.calculateFun,dependAggregators:this.tree[Jt][J],dependIndicatorKeys:Ot==null?void 0:Ot.dependIndicatorKeys})),(Q=(Ct=this.tree[Jt])===null||Ct===void 0?void 0:Ct[J])===null||Q===void 0||Q[Lt].push(t)}else{const Ot=this.getAggregatorRule(be[Lt]);let Se=!1;Nt?e===Nt?be[Lt]===Nt&&(Se=!0):be[Lt]===Nt&&be[Lt]in t&&(Se=!0):Ot!=null&&Ot.field?typeof(Ot==null?void 0:Ot.field)=="string"?(Ot==null?void 0:Ot.field)in t&&(Se=!0):Ot!=null&&Ot.field.find(qe=>qe in t)&&(Se=!0):be[Lt]in t&&(Se=!0),!(!((vt=(et=this.tree[Jt])===null||et===void 0?void 0:et[J])===null||vt===void 0)&&vt[Lt])&&Se&&(this.tree[Jt][J][Lt]=new this.aggregators[(bt=Ot==null?void 0:Ot.aggregationType)!==null&&bt!==void 0?bt:zt.SUM]({key:be[Lt],dimension:(dt=Ot==null?void 0:Ot.field)!==null&&dt!==void 0?dt:be[Lt],formatFun:(ot=Ot==null?void 0:Ot.formatFun)!==null&&ot!==void 0?ot:(st=(ut=this.indicators)===null||ut===void 0?void 0:ut.find(qe=>typeof qe!="string"&&qe.indicatorKey===be[Lt]))===null||st===void 0?void 0:st.format})),Se&&((ct=(_t=this.tree[Jt])===null||_t===void 0?void 0:_t[J])===null||ct===void 0||ct[Lt].push(t))}if(this.mappingRules)for(let Lt=0;Lt<this.indicatorKeys.length;Lt++){if(!this.indicatorStatistics[Lt]){const Ot=this.getAggregatorRule(this.indicatorKeys[Lt]);this.indicatorStatistics[Lt]={max:new this.aggregators[zt.MAX]({key:this.indicatorKeys[Lt],dimension:this.indicatorKeys[Lt]}),min:new this.aggregators[zt.MIN]({key:this.indicatorKeys[Lt],dimension:this.indicatorKeys[Lt]}),total:new this.aggregators[(Wt=Ot==null?void 0:Ot.aggregationType)!==null&&Wt!==void 0?Wt:zt.SUM]({key:this.indicatorKeys[Lt],dimension:(Yt=Ot==null?void 0:Ot.field)!==null&&Yt!==void 0?Yt:this.indicatorKeys[Lt],formatFun:(yt=Ot==null?void 0:Ot.formatFun)!==null&&yt!==void 0?yt:(ie=(mt=this.indicators)===null||mt===void 0?void 0:mt.find(Se=>typeof Se!="string"&&Se.indicatorKey===this.indicatorKeys[Lt]))===null||ie===void 0?void 0:ie.format})}}this.indicatorStatistics[Lt].max.push((Zt=(le=this.tree[Jt])===null||le===void 0?void 0:le[J])===null||Zt===void 0?void 0:Zt[Lt].value()),this.indicatorStatistics[Lt].min.push((Oe=(_e=this.tree[Jt])===null||_e===void 0?void 0:_e[J])===null||Oe===void 0?void 0:Oe[Lt].value()),this.indicatorStatistics[Lt].total.push(t)}}}}updateSortRules(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_;this.sorted=!1,this.sortRules=t,this.sortKeys(),this.customRowTree||(this.rowHierarchyType==="tree"?this.rowHeaderTree=this.ArrToTree1(this.rowKeys,this.rows.filter((w,y)=>this.rowsHasValue[y]),this.indicatorsAsCol?void 0:this.indicators,((n=(e=this.totals)===null||e===void 0?void 0:e.row)===null||n===void 0?void 0:n.showGrandTotals)||!this.indicatorsAsCol&&this.columns.length===0||this.indicatorsAsCol&&this.rows.length===0,this.rowGrandTotalLabel):this.rowHeaderTree=this.ArrToTree(this.rowKeys,this.rows.filter((w,y)=>this.rowsHasValue[y]),this.indicatorsAsCol?void 0:this.indicators,this.rowsIsTotal,((r=(o=this.totals)===null||o===void 0?void 0:o.row)===null||r===void 0?void 0:r.showGrandTotals)||this.indicatorsAsCol&&this.rows.length===0,this.rowGrandTotalLabel,this.rowSubTotalLabel,(a=(l=(s=this.totals)===null||s===void 0?void 0:s.row)===null||l===void 0?void 0:l.showGrandTotalsOnTop)!==null&&a!==void 0&&a,(u=(d=(h=this.totals)===null||h===void 0?void 0:h.row)===null||d===void 0?void 0:d.showSubTotalsOnTop)!==null&&u!==void 0&&u)),this.customColTree||(this.colHeaderTree=this.ArrToTree(this.colKeys,this.columns.filter((w,y)=>this.columnsHasValue[y]),this.indicatorsAsCol?this.indicators:void 0,this.colsIsTotal,((g=(c=this.totals)===null||c===void 0?void 0:c.column)===null||g===void 0?void 0:g.showGrandTotals)||!this.indicatorsAsCol&&this.columns.length===0,this.colGrandTotalLabel,this.colSubTotalLabel,(m=(p=(f=this.totals)===null||f===void 0?void 0:f.column)===null||p===void 0?void 0:p.showGrandTotalsOnLeft)!==null&&m!==void 0&&m,(_=(C=(b=this.totals)===null||b===void 0?void 0:b.column)===null||C===void 0?void 0:C.showSubTotalsOnLeft)!==null&&_!==void 0&&_))}updateFilterRules(t,e=!1){var n,o;if(this.filterRules=t,this.filteredRecords=void 0,e)this.tree={};else for(const r in this.tree)for(const s in this.tree[r])for(let l=0;l<this.tree[r][s].length;l++)(n=this.tree[r][s][l])===null||n===void 0||n.reset();this.collectedValues={},this.processRecords(),this.processCollectedValuesWithSumBy(),this.processCollectedValuesWithSortBy(),this.totalStatistics(),!((o=this.dataConfig)===null||o===void 0)&&o.isPivotChart&&this.cacheDeminsionCollectedValues()}getAggregatorRule(t){var e;return(e=this.aggregationRules)===null||e===void 0?void 0:e.find((n,o)=>t===n.indicatorKey)}getAggregator(t=[],e=[],n,o=!0,r){var s,l,a,h;const d=this.indicatorKeys.indexOf(n);let u,c;typeof t=="string"?u=t:(r&&r.position!=="row"||t.map((f,p)=>{f!==n||z(r==null?void 0:r.index)&&p!==r.index||t.splice(p,1)}),u=TT(t,this.stringJoinChar)),typeof e=="string"?c=e:(r&&r.position!=="col"||e.map((f,p)=>{f!==n||z(r==null?void 0:r.index)&&p!==r.index||e.splice(p,1)}),c=TT(e,this.stringJoinChar));const g=(l=(s=this.tree[u])===null||s===void 0?void 0:s[c])===null||l===void 0?void 0:l[d];if(o&&z((h=(a=this.changedTree[u])===null||a===void 0?void 0:a[c])===null||h===void 0?void 0:h[d])){const f=this.changedTree[u][c][d];return g?{value:()=>f,formatValue:g.formatValue,formatFun:g.formatFun,records:g.records,className:"",recalculate(){},push(){},deleteRecord(){},updateRecord(){},clearCacheValue(){},reset(){}}:{value:()=>f,className:"",push(){},deleteRecord(){},updateRecord(){},recalculate(){},formatValue:()=>f,clearCacheValue(){},reset(){}}}return g||{className:"",push(){},deleteRecord(){},updateRecord(){},recalculate(){},value:()=>null,clearCacheValue(){},reset(){}}}sortKeys(){if(this.colKeys=this.colKeys_normal.slice(),this.rowKeys=this.rowKeys_normal.slice(),!this.sorted){this.sorted=!0,this.rowKeys.sort(this.arrSort(this.rows,!0));const t=this.arrSort(this.columns,!1);this.colKeys.sort(t)}}arrSort(t,e){let n;const o=this,r=function(s){const l=[];for(let a=0,h=t.length;a<h;a++)if(n=t[a],o.sortRules)for(let d=0,u=o.sortRules.length;d<u;d++)o.sortRules[d].sortField===n&&l.push({field:n,fieldIndex:a,sortRule:o.sortRules[d],func:o.getSort(o.sortRules[d],e)});return l}.call(this);return function(s,l){var a,h,d,u;let c,g;for(let f=0;f<r.length;f++){if(g=r[f],(a=g.sortRule)===null||a===void 0?void 0:a.sortByIndicator){let p=s,m=l;g.fieldIndex<t.length-1&&(p=s.slice(0,g.fieldIndex+1),o.rowHierarchyType==="grid"&&e?p.push(o.rowSubTotalLabel):e||p.push(o.colSubTotalLabel),m=l.slice(0,g.fieldIndex+1),o.rowHierarchyType==="grid"&&e?m.push(o.rowSubTotalLabel):e||m.push(o.colSubTotalLabel)),c=g.func(p,m,(h=g.sortRule)===null||h===void 0?void 0:h.sortType)}else c=(d=g.func)===null||d===void 0?void 0:d.call(g,s[g.fieldIndex],l[g.fieldIndex],(u=g.sortRule)===null||u===void 0?void 0:u.sortType);if(c!==0)return c}return 0}}getSort(t,e){const n=this;return t.sortByIndicator?(o,r,s)=>{const l=function(a,h){return n.rowHierarchyType==="grid"&&a.length<n.rows.length&&a[a.length-1]!==n.rowSubTotalLabel&&a[a.length-1]!==n.rowGrandTotalLabel&&a.push(n.rowSubTotalLabel),h.length<n.columns.length&&h[h.length-1]!==n.colSubTotalLabel&&h[h.length-1]!==n.colGrandTotalLabel&&h.push(n.colSubTotalLabel),n.getAggregator(a,h,t.sortByIndicator).value()};return e?bc(l(o,t.query),l(r,t.query),s):bc(l(t.query,o),l(t.query,r),s)}:t.sortBy?X4(t.sortBy):t.sortFunc?t.sortFunc:t.sortType?Y4:bc}totalStatistics(){var t,e,n,o,r,s,l,a,h,d,u,c,g,f;const p=this,m=(b,C)=>{var _,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht,gt,Ct,Q,et,vt,bt,dt,ot,ut,st,_t,ct,Wt,Yt,yt,mt,ie,le,Zt,_e,Oe,He;if(!((w=(_=this.totalRecordsTree)===null||_===void 0?void 0:_[b])===null||w===void 0)&&w[C])return this.tree[b]||(this.tree[b]={}),void(this.tree[b][C]=(S=(y=this.totalRecordsTree)===null||y===void 0?void 0:y[b])===null||S===void 0?void 0:S[C]);const Ht=C.split(this.stringJoinChar);if(!((R=(A=p.totals)===null||A===void 0?void 0:A.column)===null||R===void 0)&&R.subTotalsDimensions&&((M=(T=(x=p.totals)===null||x===void 0?void 0:x.column)===null||T===void 0?void 0:T.subTotalsDimensions)===null||M===void 0?void 0:M.length)>0&&p.totals.column.showSubTotals!==!1)for(let Et=0,Rt=(F=(P=(B=p.totals)===null||B===void 0?void 0:B.column)===null||P===void 0?void 0:P.subTotalsDimensions)===null||F===void 0?void 0:F.length;Et<Rt;Et++){const Tt=p.totals.column.subTotalsDimensions[Et],Nt=p.columns.indexOf(Tt);if(Nt>=0){const te=Ht.slice(0,Nt+1);te.push(p.colSubTotalLabel);const ae=te.join(this.stringJoinChar);if(!((E=(H=this.totalRecordsTree)===null||H===void 0?void 0:H[b])===null||E===void 0)&&E[ae])return void(this.tree[b][ae]=(I=(k=this.totalRecordsTree)===null||k===void 0?void 0:k[b])===null||I===void 0?void 0:I[ae]);this.tree[b][ae]||(this.tree[b][ae]=[]);const Jt=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let J=0;J<Jt.length;J++)if(this.calculatedFiledKeys.indexOf(Jt[J])>=0){const be=(L=this.calculatedFieldRules)===null||L===void 0?void 0:L.find(Lt=>Lt.key===Jt[J]);!((O=(D=this.tree[b])===null||D===void 0?void 0:D[ae])===null||O===void 0)&&O[J]||(this.tree[b][ae][J]=new this.aggregators[zt.RECALCULATE]({key:Jt[J],dimension:Jt[J],isRecord:!0,formatFun:(W=(N=this.indicators)===null||N===void 0?void 0:N.find(Lt=>typeof Lt!="string"&&Lt.indicatorKey===Jt[J]))===null||W===void 0?void 0:W.format,calculateFun:be==null?void 0:be.calculateFun,dependAggregators:this.tree[b][ae],dependIndicatorKeys:be==null?void 0:be.dependIndicatorKeys})),ae!==C&&this.tree[b][ae][J].push((U=($=p.tree[b])===null||$===void 0?void 0:$[C])===null||U===void 0?void 0:U[J])}else{if(!this.tree[b][ae][J]){const be=this.getAggregatorRule(Jt[J]);this.tree[b][ae][J]=new this.aggregators[(Y=be==null?void 0:be.aggregationType)!==null&&Y!==void 0?Y:zt.SUM]({key:Jt[J],dimension:(j=be==null?void 0:be.field)!==null&&j!==void 0?j:Jt[J],formatFun:(G=be==null?void 0:be.formatFun)!==null&&G!==void 0?G:(ht=(X=this.indicators)===null||X===void 0?void 0:X.find(Lt=>typeof Lt!="string"&&Lt.indicatorKey===Jt[J]))===null||ht===void 0?void 0:ht.format})}ae!==C&&this.tree[b][ae][J].push((Ct=(gt=p.tree[b])===null||gt===void 0?void 0:gt[C])===null||Ct===void 0?void 0:Ct[J])}}}if(!((et=(Q=p.totals)===null||Q===void 0?void 0:Q.column)===null||et===void 0)&&et.showGrandTotals||this.rows.length===0){const Et=p.colGrandTotalLabel;if(!((bt=(vt=this.totalRecordsTree)===null||vt===void 0?void 0:vt[b])===null||bt===void 0)&&bt[Et])return void(this.tree[b][Et]=(ot=(dt=this.totalRecordsTree)===null||dt===void 0?void 0:dt[b])===null||ot===void 0?void 0:ot[Et]);this.tree[b][Et]||(this.tree[b][Et]=[]);const Rt=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let Tt=0;Tt<Rt.length;Tt++)if(this.calculatedFiledKeys.indexOf(Rt[Tt])>=0){const Nt=(ut=this.calculatedFieldRules)===null||ut===void 0?void 0:ut.find(te=>te.key===Rt[Tt]);!((_t=(st=this.tree[b])===null||st===void 0?void 0:st[Et])===null||_t===void 0)&&_t[Tt]||(this.tree[b][Et][Tt]=new this.aggregators[zt.RECALCULATE]({key:Rt[Tt],dimension:Rt[Tt],isRecord:!0,formatFun:(Wt=(ct=this.indicators)===null||ct===void 0?void 0:ct.find(te=>typeof te!="string"&&te.indicatorKey===Rt[Tt]))===null||Wt===void 0?void 0:Wt.format,calculateFun:Nt==null?void 0:Nt.calculateFun,dependAggregators:this.tree[b][Et],dependIndicatorKeys:Nt==null?void 0:Nt.dependIndicatorKeys})),Et!==C&&this.tree[b][Et][Tt].push((yt=(Yt=p.tree[b])===null||Yt===void 0?void 0:Yt[C])===null||yt===void 0?void 0:yt[Tt])}else{if(!this.tree[b][Et][Tt]){const Nt=this.getAggregatorRule(Rt[Tt]);this.tree[b][Et][Tt]=new this.aggregators[(mt=Nt==null?void 0:Nt.aggregationType)!==null&&mt!==void 0?mt:zt.SUM]({key:Rt[Tt],dimension:(ie=Nt==null?void 0:Nt.field)!==null&&ie!==void 0?ie:Rt[Tt],formatFun:(le=Nt==null?void 0:Nt.formatFun)!==null&&le!==void 0?le:(_e=(Zt=this.indicators)===null||Zt===void 0?void 0:Zt.find(te=>typeof te!="string"&&te.indicatorKey===Rt[Tt]))===null||_e===void 0?void 0:_e.format})}Et!==C&&this.tree[b][Et][Tt].push((He=(Oe=p.tree[b])===null||Oe===void 0?void 0:Oe[C])===null||He===void 0?void 0:He[Tt])}}};if(!((e=(t=p==null?void 0:p.totals)===null||t===void 0?void 0:t.column)===null||e===void 0)&&e.subTotalsDimensions&&((r=(o=(n=p==null?void 0:p.totals)===null||n===void 0?void 0:n.column)===null||o===void 0?void 0:o.subTotalsDimensions)===null||r===void 0?void 0:r.length)>=1||!((l=(s=p==null?void 0:p.totals)===null||s===void 0?void 0:s.row)===null||l===void 0)&&l.subTotalsDimensions&&((d=(h=(a=p==null?void 0:p.totals)===null||a===void 0?void 0:a.row)===null||h===void 0?void 0:h.subTotalsDimensions)===null||d===void 0?void 0:d.length)>=1||!((c=(u=p==null?void 0:p.totals)===null||u===void 0?void 0:u.column)===null||c===void 0)&&c.showGrandTotals||!((f=(g=p==null?void 0:p.totals)===null||g===void 0?void 0:g.row)===null||f===void 0)&&f.showGrandTotals){const b=[];Object.keys(p.tree).forEach(C=>{const _=C.split(this.stringJoinChar);Object.keys(p.tree[C]).forEach(w=>{var y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht,gt,Ct,Q,et;if(!((S=(y=p.totals)===null||y===void 0?void 0:y.row)===null||S===void 0)&&S.subTotalsDimensions&&((x=(R=(A=p.totals)===null||A===void 0?void 0:A.row)===null||R===void 0?void 0:R.subTotalsDimensions)===null||x===void 0?void 0:x.length)>0&&p.totals.row.showSubTotals!==!1)for(let vt=0,bt=(B=(M=(T=p.totals)===null||T===void 0?void 0:T.row)===null||M===void 0?void 0:M.subTotalsDimensions)===null||B===void 0?void 0:B.length;vt<bt;vt++){const dt=p.totals.row.subTotalsDimensions[vt],ot=p.rows.indexOf(dt);if(ot>=0&&ot<p.rows.length-1){const ut=_.slice(0,ot+1);this.rowHierarchyType==="grid"&&ut.push(p.rowSubTotalLabel);const st=ut.join(this.stringJoinChar);this.tree[st]||(this.tree[st]={},b.push(st)),this.tree[st][w]||(this.tree[st][w]=[]);const _t=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let ct=0;ct<_t.length;ct++){if(!this.tree[st][w][ct])if(this.calculatedFiledKeys.indexOf(_t[ct])>=0){const Wt=(P=this.calculatedFieldRules)===null||P===void 0?void 0:P.find(Yt=>Yt.key===_t[ct]);this.tree[st][w][ct]=new this.aggregators[zt.RECALCULATE]({key:_t[ct],dimension:_t[ct],isRecord:!0,formatFun:(H=(F=this.indicators)===null||F===void 0?void 0:F.find(Yt=>typeof Yt!="string"&&Yt.indicatorKey===_t[ct]))===null||H===void 0?void 0:H.format,calculateFun:Wt==null?void 0:Wt.calculateFun,dependAggregators:this.tree[st][w],dependIndicatorKeys:Wt==null?void 0:Wt.dependIndicatorKeys})}else{const Wt=this.getAggregatorRule(_t[ct]);this.tree[st][w][ct]=new this.aggregators[(E=Wt==null?void 0:Wt.aggregationType)!==null&&E!==void 0?E:zt.SUM]({key:_t[ct],dimension:(k=Wt==null?void 0:Wt.field)!==null&&k!==void 0?k:_t[ct],formatFun:(I=Wt==null?void 0:Wt.formatFun)!==null&&I!==void 0?I:(D=(L=this.indicators)===null||L===void 0?void 0:L.find(Yt=>typeof Yt!="string"&&Yt.indicatorKey===_t[ct]))===null||D===void 0?void 0:D.format})}st!==C&&this.tree[st][w][ct].push((N=(O=p.tree[C])===null||O===void 0?void 0:O[w])===null||N===void 0?void 0:N[ct])}}}if(!(($=(W=p.totals)===null||W===void 0?void 0:W.row)===null||$===void 0)&&$.showGrandTotals||this.columns.length===0){const vt=p.rowGrandTotalLabel;this.tree[vt]||(this.tree[vt]={},b.push(vt)),this.tree[vt][w]||(this.tree[vt][w]=[]);const bt=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let dt=0;dt<bt.length;dt++){if(!this.tree[vt][w][dt])if(this.calculatedFiledKeys.indexOf(bt[dt])>=0){const ot=(U=this.calculatedFieldRules)===null||U===void 0?void 0:U.find(ut=>ut.key===bt[dt]);this.tree[vt][w][dt]=new this.aggregators[zt.RECALCULATE]({key:bt[dt],dimension:bt[dt],isRecord:!0,formatFun:(j=(Y=this.indicators)===null||Y===void 0?void 0:Y.find(ut=>typeof ut!="string"&&ut.indicatorKey===bt[dt]))===null||j===void 0?void 0:j.format,calculateFun:ot==null?void 0:ot.calculateFun,dependAggregators:this.tree[vt][w],dependIndicatorKeys:ot==null?void 0:ot.dependIndicatorKeys})}else{const ot=this.getAggregatorRule(bt[dt]);this.tree[vt][w][dt]=new this.aggregators[(G=ot==null?void 0:ot.aggregationType)!==null&&G!==void 0?G:zt.SUM]({key:bt[dt],dimension:(X=ot==null?void 0:ot.field)!==null&&X!==void 0?X:bt[dt],formatFun:(ht=ot==null?void 0:ot.formatFun)!==null&&ht!==void 0?ht:(Ct=(gt=this.indicators)===null||gt===void 0?void 0:gt.find(ut=>typeof ut!="string"&&ut.indicatorKey===bt[dt]))===null||Ct===void 0?void 0:Ct.format})}vt!==C&&this.tree[vt][w][dt].push((et=(Q=p.tree[C])===null||Q===void 0?void 0:Q[w])===null||et===void 0?void 0:et[dt])}}m(C,w)})}),b.forEach(C=>{Object.keys(p.tree[C]).forEach(_=>{m(C,_)})})}for(const b in p.totalRecordsTree)for(const C in p.totalRecordsTree[b])m(b,C)}ArrToTree1(t,e,n,o,r){const s=[],l=this.stringJoinChar,a=new Map;function h(d){const u=[];let c;d.forEach((g,f)=>{var p;u.push(g);const m=u.join(l);let b=a.get(m);b||(b={value:g,dimensionKey:e[f],children:f===d.length-1&&((p=n==null?void 0:n.length)!==null&&p!==void 0?p:0)>=1?n==null?void 0:n.map(C=>typeof C=="string"?{indicatorKey:C,value:C}:{indicatorKey:C.indicatorKey,value:C.title}):[]},a.set(m,b),c?c.children.push(b):s.push(b)),c=b})}return t.forEach(d=>h(d)),o&&h([r]),s}ArrToTree(t,e,n,o,r,s,l,a,h){var d;let u=[];const c=this.stringJoinChar,g=new Map;if(t!=null&&t.length?t.forEach(f=>function(p){const m=[];let b;p.forEach((C,_)=>{var w,y,S,A;m.push(C);const R=m.join(c);let x=g.get(R);if(!x){if(x={value:C,dimensionKey:e[_],children:_===p.length-1&&((w=n==null?void 0:n.length)!==null&&w!==void 0?w:0)>=1?n==null?void 0:n.map(T=>typeof T=="string"?{indicatorKey:T,value:T}:{indicatorKey:T.indicatorKey,value:T.title}):[]},o[_]){let T=(y=x.children)!==null&&y!==void 0?y:[];const M={value:l,dimensionKey:e[_+1],levelSpan:o.length-_-1,children:((S=n==null?void 0:n.length)!==null&&S!==void 0?S:0)>=1?n==null?void 0:n.map(B=>typeof B=="string"?{indicatorKey:B,value:B}:{indicatorKey:B.indicatorKey,value:B.title}):[]};T.push(M),T=(A=M.children)!==null&&A!==void 0?A:[]}g.set(R,x),b?o[_-1]&&!h?b.children.splice(b.children.length-1,0,x):b.children.push(x):u.push(x)}b=x})}(f)):n&&(u=n==null?void 0:n.map(f=>{var p;return typeof f=="string"?{indicatorKey:f,value:f}:{indicatorKey:f.indicatorKey,value:(p=f.title)!==null&&p!==void 0?p:f.indicatorKey}})),r&&(t==null?void 0:t.length)){const f={value:s,dimensionKey:e[0],levelSpan:o.length,children:(d=n==null?void 0:n.map(p=>typeof p=="string"?{indicatorKey:p,value:p}:{indicatorKey:p.indicatorKey,value:p.title}))!==null&&d!==void 0?d:[]};a?u.unshift(f):u.push(f)}return u}cacheDeminsionCollectedValues(){for(const t in this.collectValuesBy)this.collectValuesBy[t].type!=="xField"&&this.collectValuesBy[t].type!=="yField"||(this.dataConfig.dimensionSortArray?this.cacheCollectedValues[t]=z9(this.collectedValues[t],this.dataConfig.dimensionSortArray):this.cacheCollectedValues[t]=this.collectedValues[t])}changeTreeNodeValue(t=[],e=[],n,o){var r,s,l;const a=this.indicatorKeys.indexOf(n);let h,d;h=typeof t=="string"?t:t.join(this.stringJoinChar),d=typeof e=="string"?e:e.join(this.stringJoinChar),!((r=this.changedTree[h])===null||r===void 0)&&r[d]?this.changedTree[h][d][a]=o:this.changedTree[h]?(this.changedTree[h][d]=[],this.changedTree[h][d][a]=o):(this.changedTree[h]={},this.changedTree[h][d]=[],this.changedTree[h][d][a]=o);const u=(l=(s=this.tree[h])===null||s===void 0?void 0:s[d])===null||l===void 0?void 0:l[a];(u==null?void 0:u.records.length)===1&&(u.records[0][this.indicatorKeys[a]]=o)}changeRecordFieldValue(t,e,n){let o=!1;for(let r=0;r<this.indicatorKeys.length;r++)this.indicatorKeys[r]===t&&(o=!0);if(!o){if(Array.isArray(this.records))for(let r=0,s=this.records.length;r<s;r++){const l=this.records[r];l[t]===e&&(l[t]=n)}else for(const r in this.records)for(let s=0,l=this.records[r].length;s<l;s++){const a=this.records[r][s];a[t]===e&&(a[t]=n)}this.rowFlatKeys={},this.colFlatKeys={},this.tree={},this.processRecords()}}_rowTreeHasChanged(){this.hasExtensionRowTree||(this.customRowTreeDimensionPaths=this.customTreeToDimensionPathArr(this.customRowTree,"row"))}changeDataConfig(t){this.rows=t.rows,this.columns=t.columns}addRecords(t){for(let e=0,n=t.length;e<n;e++){const o=t[e];this.processRecord(o)}Array.isArray(this.records)&&this.records.push(t)}customTreeToDimensionPathArr(t,e){const n=[],o=this;function r(s,l){var a,h,d;s.virtual||(!((a=l[l.length-1])===null||a===void 0)&&a.childKeys&&s.dimensionKey&&l[l.length-1].childKeys.indexOf(s.dimensionKey)===-1&&s.dimensionKey!==l[l.length-1].dimensionKey&&l[l.length-1].childKeys.push(s.dimensionKey),l.push({dimensionKey:z(s.indicatorKey)?void 0:s.dimensionKey,value:s.value,indicatorKey:s.indicatorKey,virtual:s.virtual})),((h=s.children)===null||h===void 0?void 0:h.length)>0?(o.rowHierarchyType==="tree"&&e==="row"&&(l[l.length-1].childKeys=[],n.push([...l])),(d=s.children)===null||d===void 0||d.forEach(u=>r(u,[...l]))):n.push(l)}return t==null||t.forEach(s=>r(s,[])),n}getFieldMatchColDimensionPaths(t){var e,n;const o=[];for(let r=0;(n=r<((e=this.customColTreeDimensionPaths)===null||e===void 0?void 0:e.length))!==null&&n!==void 0&&n;r++){const s=this.customColTreeDimensionPaths[r];let l=!0;for(let a=0;a<s.length;a++){const h=s[a];if(h.dimensionKey&&t[h.dimensionKey]!==h.value||h.indicatorKey&&t[h.indicatorKey]===void 0){l=!1;break}}l&&o.push(s)}return o}getFieldMatchRowDimensionPaths(t){var e,n;const o=[];for(let r=0;(n=r<((e=this.customRowTreeDimensionPaths)===null||e===void 0?void 0:e.length))!==null&&n!==void 0&&n;r++){const s=this.customRowTreeDimensionPaths[r];let l=!0;for(let a=0;a<s.length;a++){const h=s[a];if(h.dimensionKey&&t[h.dimensionKey]!==h.value||h.indicatorKey&&t[h.indicatorKey]===void 0){l=!1;break}if(h.childKeys&&a===s.length-1&&h.childKeys.length>0&&h.childKeys.find(d=>z(t[d]))){l=!1;break}}l&&(this.indicatorsAsCol||this.rowHierarchyType!=="tree"||s.find(a=>a.indicatorKey)||(l=!1)),l&&o.push(s)}return o}}function z9(i,t){return i.sort((e,n)=>{const o=t.indexOf(e),r=t.indexOf(n);return o<r?-1:o>r?1:0})}let MT=class extends Cg{constructor(t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C;if(oe.mode==="node"?(e=t,t=null):t instanceof HTMLElement||(e=t,t=t.container?t.container:null),super(t,e),this.layoutNodeId={seqId:0},e){e.layout&&Object.assign(e,e.layout),this.internalProps.columns=Ee(e.columns),this.internalProps.rows=Ee(e.rows),this.internalProps.indicators=ho(e.indicators),(n=e.indicators)===null||n===void 0||n.forEach((w,y)=>{typeof w=="object"&&(w!=null&&w.editor)&&(this.internalProps.indicators[y].editor=w.editor)}),this.internalProps.columnTree=!e.indicatorsAsCol||!((o=e.columns)===null||o===void 0)&&o.length||e.columnTree?Ee(e.columnTree):[],this.internalProps.rowTree=e.indicatorsAsCol||!((r=e.rows)===null||r===void 0)&&r.length||e.rowTree?Ee(e.rowTree):[],this.internalProps.records=e.records,this.pagination=e.pagination,this.internalProps.columnResizeType=(s=e.columnResizeType)!==null&&s!==void 0?s:"column",this.internalProps.rowResizeType=(l=e.rowResizeType)!==null&&l!==void 0?l:"row",this.internalProps.dataConfig=Ee(e.dataConfig),this.internalProps.columnWidthConfig=e.columnWidthConfig;const _=this.internalProps.records;if(this.internalProps.recordsIsTwoDimensionalArray=!1,((a=_==null?void 0:_[0])===null||a===void 0?void 0:a.constructor)===Array&&(this.internalProps.recordsIsTwoDimensionalArray=!0),((h=e.customConfig)===null||h===void 0?void 0:h.enableDataAnalysis)===!1){const w=new Pe((d=this.internalProps.columnTree)!==null&&d!==void 0?d:[],this.layoutNodeId),y=new Pe((u=this.internalProps.rowTree)!==null&&u!==void 0?u:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(c=this.options.rowExpandLevel)!==null&&c!==void 0?c:1:void 0);this.internalProps.layoutMap=new lr(this,null,w,y),this.internalProps.recordsIsTwoDimensionalArray===!1&&(this.flatDataToObjects=new pv({rows:this.internalProps.layoutMap.fullRowDimensionKeys,columns:this.internalProps.layoutMap.colDimensionKeys,indicators:this.internalProps.layoutMap.indicatorKeys,indicatorsAsCol:this.internalProps.layoutMap.indicatorsAsCol,indicatorDimensionKey:this.internalProps.layoutMap.indicatorDimensionKey},_))}else{const w=$A(this,e),{rowKeys:y,columnKeys:S,indicatorKeys:A}=w;let{columnDimensionTree:R,rowDimensionTree:x}=w;this.dataset=new Ih(this.internalProps.dataConfig,y,S,A,this.internalProps.indicators,(g=e.indicatorsAsCol)===null||g===void 0||g,e.records,e.rowHierarchyType,this.internalProps.columnTree,this.internalProps.rowTree,!1,!!e.extensionRows,!!e.parseCustomTreeToMatchRecords),e.columnTree||(e.indicatorsAsCol!==!1&&(this.dataset.colHeaderTree=Vi(this.dataset.colHeaderTree,e.indicators)),R=new Pe((f=this.dataset.colHeaderTree)!==null&&f!==void 0?f:[],this.layoutNodeId)),e.rowTree||(e.indicatorsAsCol===!1&&(this.dataset.rowHeaderTree=Vi(this.dataset.rowHeaderTree,e.indicators)),x=new Pe((p=this.dataset.rowHeaderTree)!==null&&p!==void 0?p:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(m=this.options.rowExpandLevel)!==null&&m!==void 0?m:1:void 0)),this.internalProps.layoutMap=new lr(this,this.dataset,R,x)}if(this._changePivotSortStateBySortRules(),((C=(b=e.pivotSortState)===null||b===void 0?void 0:b.length)!==null&&C!==void 0?C:0)>0&&(this.pivotSortState=[],this.pivotSortState=e.pivotSortState),oe.mode!=="node"&&(this.editorManager=new cT(this)),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.stateManager.initCheckedState(_),this.scenegraph.createSceneGraph(),e.title){const w=Bt.getComponent("title");this.internalProps.title=new w(e.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const w=Bt.getComponent("emptyTip");this.internalProps.emptyTip=new w(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}setTimeout(()=>{this.fireListeners(at.INITIALIZED,null)},0)}}static get EVENT_TYPE(){return rr}isListTable(){return!1}isPivotTable(){return!0}isPivotChart(){return!1}get recordsCount(){var t;return(t=this.records)===null||t===void 0?void 0:t.length}_canResizeColumn(t,e){const n=super._canResizeColumn(t,e);if(n){if(this.internalProps.layoutMap.isSeriesNumber(t,e)&&this.internalProps.rowSeriesNumber.disableColumnResize===!0)return!1;if(!this.internalProps.layoutMap.indicatorsAsCol){const o=this.internalProps.layoutMap.getBody(t,this.columnHeaderLevelCount);if(o!=null&&o.disableColumnResize)return!1}}return n}updateOption(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_;const w=this.internalProps;if(super.updateOption(t),this.layoutNodeId={seqId:0},this.internalProps.columns=Ee(t.columns),this.internalProps.rows=Ee(t.rows),this.internalProps.indicators=!((e=t.indicators)===null||e===void 0)&&e.length?ho(t.indicators):[],(n=t.indicators)===null||n===void 0||n.forEach((S,A)=>{typeof S=="object"&&(S!=null&&S.editor)&&(this.internalProps.indicators[A].editor=S.editor)}),this.internalProps.columnTree=!t.indicatorsAsCol||!((o=t.columns)===null||o===void 0)&&o.length||t.columnTree?Ee(t.columnTree):[],this.internalProps.rowTree=t.indicatorsAsCol||!((r=t.rows)===null||r===void 0)&&r.length||t.rowTree?Ee(t.rowTree):[],t.records&&(this.internalProps.records=t.records),this.stateManager.initCheckedState(this.internalProps.records),this.stateManager.updateDrillState(void 0,void 0,!1,!1,-1,-1),this.pagination=t.pagination,w.columnResizeType=(s=t.columnResizeType)!==null&&s!==void 0?s:"column",w.rowResizeType=(l=t.rowResizeType)!==null&&l!==void 0?l:"row",w.dataConfig=Ee(t.dataConfig),this.internalProps.columnWidthConfig=t.columnWidthConfig,(t==null?void 0:t.rowHierarchyType)==="tree"&&this.internalProps.layoutMap.rowHierarchyType==="tree"&&this.internalProps.layoutMap.rowExpandLevel===(t==null?void 0:t.rowExpandLevel)){const S=this.internalProps.layoutMap.rowDimensionTree.tree.children;(a=this.internalProps.rowTree)===null||a===void 0||a.forEach((A,R)=>{const x=S.find(T=>T.dimensionKey===A.dimensionKey&&T.value===A.value);x&&this._syncHierarchyState(x,A)})}const y=this.internalProps.records;if(this.internalProps.recordsIsTwoDimensionalArray=!1,((h=y==null?void 0:y[0])===null||h===void 0?void 0:h.constructor)===Array&&(this.internalProps.recordsIsTwoDimensionalArray=!0),((d=t.customConfig)===null||d===void 0?void 0:d.enableDataAnalysis)===!1){let S,A;t.columnTree&&(S=new Pe((u=this.internalProps.columnTree)!==null&&u!==void 0?u:[],this.layoutNodeId)),t.rowTree&&(A=new Pe((c=this.internalProps.rowTree)!==null&&c!==void 0?c:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(g=this.options.rowExpandLevel)!==null&&g!==void 0?g:1:void 0)),w.layoutMap=new lr(this,null,S,A),this.internalProps.recordsIsTwoDimensionalArray===!1&&(this.flatDataToObjects=new pv({rows:w.layoutMap.fullRowDimensionKeys,columns:w.layoutMap.colDimensionKeys,indicators:w.layoutMap.indicatorKeys,indicatorsAsCol:w.layoutMap.indicatorsAsCol,indicatorDimensionKey:w.layoutMap.indicatorDimensionKey},y))}else{const S=$A(this,t),{rowKeys:A,columnKeys:R,indicatorKeys:x}=S;let{columnDimensionTree:T,rowDimensionTree:M}=S;this.dataset=new Ih(w.dataConfig,A,R,x,this.internalProps.indicators,(f=t.indicatorsAsCol)===null||f===void 0||f,y,t.rowHierarchyType,this.internalProps.columnTree,this.internalProps.rowTree,!1,!!t.extensionRows,!!t.parseCustomTreeToMatchRecords),t.columnTree||(t.indicatorsAsCol!==!1&&(this.dataset.colHeaderTree=Vi(this.dataset.colHeaderTree,t.indicators)),T=new Pe((p=this.dataset.colHeaderTree)!==null&&p!==void 0?p:[],this.layoutNodeId)),t.rowTree||(t.indicatorsAsCol===!1&&(this.dataset.rowHeaderTree=Vi(this.dataset.rowHeaderTree,t.indicators)),M=new Pe((m=this.dataset.rowHeaderTree)!==null&&m!==void 0?m:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(b=this.options.rowExpandLevel)!==null&&b!==void 0?b:1:void 0)),w.layoutMap=new lr(this,this.dataset,T,M)}if(this._changePivotSortStateBySortRules(),((_=(C=t.pivotSortState)===null||C===void 0?void 0:C.length)!==null&&_!==void 0?_:0)>0&&(this.pivotSortState=[],this.pivotSortState=t.pivotSortState),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,w.releaseList&&(w.releaseList.forEach(S=>{var A;return(A=S==null?void 0:S.release)===null||A===void 0?void 0:A.call(S)}),w.releaseList=null),this.scenegraph.clearCells(),this.scenegraph.createSceneGraph(),t.title){const S=Bt.getComponent("title");this.internalProps.title=new S(t.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const S=Bt.getComponent("emptyTip");this.internalProps.emptyTip=new S(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}return new Promise(S=>{setTimeout(S,0)})}updatePagination(t){t?(this.pagination||(this.pagination={currentPage:0,perPageCount:0}),typeof t.currentPage=="number"&&t.currentPage>=0&&(this.pagination.currentPage=t.currentPage),t.perPageCount&&(this.pagination.perPageCount=t.perPageCount||this.pagination.perPageCount),this.scenegraph.clearCells(),this.internalProps.layoutMap.setPagination(this.pagination),this.refreshRowColCount(),this.scenegraph.createSceneGraph(),this.render()):this.pagination&&(this.pagination=void 0,this.scenegraph.clearCells(),this.internalProps.layoutMap.setPagination(void 0),this.refreshRowColCount(),this.scenegraph.createSceneGraph(),this.render())}refreshHeader(){this.setMinMaxLimitWidth(!0),this.refreshRowColCount()}refreshRowColCount(){var t,e,n,o,r,s,l,a,h;const d=this,{layoutMap:u}=d.internalProps;u&&(d.colCount=(t=u.colCount)!==null&&t!==void 0?t:0,d.rowCount=(e=u.rowCount)!==null&&e!==void 0?e:0,this.internalProps.frozenColCount=Math.max(((n=u.rowHeaderLevelCount)!==null&&n!==void 0?n:0)+u.leftRowSeriesNumberColumnCount,(o=this.options.frozenColCount)!==null&&o!==void 0?o:0),d.frozenRowCount=Math.max(u.headerLevelCount,(r=this.options.frozenRowCount)!==null&&r!==void 0?r:0),d.bottomFrozenRowCount!==((s=this.options.bottomFrozenRowCount)!==null&&s!==void 0?s:0)&&(d.bottomFrozenRowCount=(l=this.options.bottomFrozenRowCount)!==null&&l!==void 0?l:0),d.rightFrozenColCount!==((a=this.options.rightFrozenColCount)!==null&&a!==void 0?a:0)&&(d.rightFrozenColCount=(h=this.options.rightFrozenColCount)!==null&&h!==void 0?h:0),this.stateManager.setFrozenCol(this.internalProps.frozenColCount))}_getSortFuncFromHeaderOption(t,e,n){}get rowHierarchyType(){return this.internalProps.layoutMap.rowHierarchyType}_syncHierarchyState(t,e){var n,o;t.value===e.value&&t.dimensionKey===e.dimensionKey&&(e.hierarchyState=(n=e.hierarchyState)!==null&&n!==void 0?n:e!=null&&e.children?t.hierarchyState:void 0,(o=e==null?void 0:e.children)===null||o===void 0||o.forEach((r,s)=>{var l;if(!((l=t==null?void 0:t.children)===null||l===void 0)&&l[s]&&r){const a=t.children.find(h=>h.dimensionKey===r.dimensionKey&&h.value===r.value);a&&this._syncHierarchyState(a,r)}}))}getRecordShowIndexByCell(t,e){}getTableIndexByRecordIndex(t){}getTableIndexByField(t){}getCellAddrByFieldRecord(t,e){}getBodyIndexByRow(t){const{layoutMap:e}=this.internalProps;return e.getBodyIndexByRow(t)}getBodyIndexByCol(t){const{layoutMap:e}=this.internalProps;return e.getBodyIndexByCol(t)}getFieldData(t,e,n){var o,r,s;if(!this.internalProps.layoutMap.isHeader(e,n)){if(this.internalProps.recordsIsTwoDimensionalArray){const l=this.getBodyIndexByRow(n),a=this.getBodyIndexByCol(e);return(o=this.records[l])===null||o===void 0?void 0:o[a]}if(this.dataset){const l=this.internalProps.layoutMap.getCellHeaderPaths(e,n);if(l){let a;const h=(r=l.colHeaderPaths)===null||r===void 0?void 0:r.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(a={position:"col",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),d=(s=l.rowHeaderPaths)===null||s===void 0?void 0:s.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(a={position:"row",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),u=this.dataset.getAggregator(d,h,this.internalProps.layoutMap.getIndicatorKey(e,n),!0,a);if(u.records&&u.records.length>=1)return u.records[0][t]}}else if(this.flatDataToObjects){const l=this.internalProps.layoutMap.getCellHeaderPaths(e,n),a=l.colHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),h=l.rowHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),d=this.flatDataToObjects.getTreeNode(h,a,this.internalProps.layoutMap.getBody(e,n).indicatorKey,!1);if(d!=null&&d.record)return d==null?void 0:d.record[t]}}}getCellValue(t,e,n){var o,r,s,l,a,h,d;if(!n){const u=this.getCustomMergeValue(t,e);if(u)return u}if(this.internalProps.layoutMap.isSeriesNumber(t,e)){if(this.internalProps.layoutMap.isSeriesNumberInHeader(t,e)){const{title:c}=this.internalProps.layoutMap.getSeriesNumberHeader(t,e);return c}const{format:u}=this.internalProps.layoutMap.getSeriesNumberBody(t,e);return typeof u=="function"?u(t,e,this):e-this.columnHeaderLevelCount+1}if(this.internalProps.layoutMap.isHeader(t,e)){const{title:u,fieldFormat:c}=this.internalProps.layoutMap.getHeader(t,e);return typeof c=="function"?c(u,t,e,this):u}if(this.internalProps.recordsIsTwoDimensionalArray){const{fieldFormat:u}=this.internalProps.layoutMap.getBody(t,e),c=this.getBodyIndexByRow(e),g=this.getBodyIndexByCol(t),f=(o=this.records[c])===null||o===void 0?void 0:o[g];return typeof u=="function"?u(f,t,e,this):f}if(this.dataset){const u=this.internalProps.layoutMap.getCellHeaderPaths(t,e);let c;const g=(s=(r=u.colHeaderPaths)===null||r===void 0?void 0:r.filter(b=>!b.virtual))===null||s===void 0?void 0:s.map((b,C)=>{var _;return b.indicatorKey&&(c={position:"col",index:C}),(_=b.indicatorKey)!==null&&_!==void 0?_:b.value}),f=(a=(l=u.rowHeaderPaths)===null||l===void 0?void 0:l.filter(b=>!b.virtual))===null||a===void 0?void 0:a.map((b,C)=>{var _;return b.indicatorKey&&(c={position:"row",index:C}),(_=b.indicatorKey)!==null&&_!==void 0?_:b.value}),p=this.dataset.getAggregator(f,g,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,c),{fieldFormat:m}=this.internalProps.layoutMap.getBody(t,e);return p.formatValue?p.formatValue(t,e,this):typeof m=="function"?m(p==null?void 0:p.value(),t,e,this):(h=p==null?void 0:p.value())!==null&&h!==void 0?h:""}if(this.flatDataToObjects){const u=this.internalProps.layoutMap.getCellHeaderPaths(t,e),c=u.colHeaderPaths.map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value}),g=u.rowHeaderPaths.map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value}),f=this.flatDataToObjects.getTreeNode(g,c,this.internalProps.layoutMap.getBody(t,e).indicatorKey),{fieldFormat:p}=this.internalProps.layoutMap.getBody(t,e);return typeof p=="function"?p(f==null?void 0:f.value,t,e,this):(d=f==null?void 0:f.value)!==null&&d!==void 0?d:""}}getCellOriginValue(t,e){var n,o,r;const s=this;if(s.internalProps.layoutMap.isHeader(t,e)){const{title:l}=s.internalProps.layoutMap.getHeader(t,e);return typeof l=="function"?l():l}if(this.internalProps.recordsIsTwoDimensionalArray){const l=this.getBodyIndexByRow(e),a=this.getBodyIndexByCol(t);return(n=this.records[l])===null||n===void 0?void 0:n[a]}if(this.dataset){let l;const a=this.internalProps.layoutMap.getCellHeaderPaths(t,e),h=(o=a.colHeaderPaths)===null||o===void 0?void 0:o.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(l={position:"col",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),d=(r=a.rowHeaderPaths)===null||r===void 0?void 0:r.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(l={position:"row",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),u=this.dataset.getAggregator(d,h,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,l);return u.value?u.value():void 0}if(this.flatDataToObjects){const l=this.internalProps.layoutMap.getCellHeaderPaths(t,e),a=l.colHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),h=l.rowHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),d=this.flatDataToObjects.getTreeNode(h,a,this.internalProps.layoutMap.getBody(t,e).indicatorKey);return d==null?void 0:d.value}}getCellRawValue(t,e){var n,o,r;const s=this;if(s.internalProps.layoutMap.isHeader(t,e)){const{title:l}=s.internalProps.layoutMap.getHeader(t,e);return typeof l=="function"?l():l}if(this.internalProps.recordsIsTwoDimensionalArray){const l=this.getBodyIndexByRow(e),a=this.getBodyIndexByCol(t);return(n=this.records[l])===null||n===void 0?void 0:n[a]}if(this.dataset){let l;const a=this.internalProps.layoutMap.getCellHeaderPaths(t,e),h=(o=a.colHeaderPaths)===null||o===void 0?void 0:o.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(l={position:"col",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),d=(r=a.rowHeaderPaths)===null||r===void 0?void 0:r.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(l={position:"row",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),u=this.dataset.getAggregator(d,h,this.internalProps.layoutMap.getIndicatorKey(t,e),!1,l);return u.value?u.value():void 0}if(this.flatDataToObjects){const l=this.internalProps.layoutMap.getCellHeaderPaths(t,e),a=l.colHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),h=l.rowHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),d=this.flatDataToObjects.getTreeNode(h,a,this.internalProps.layoutMap.getBody(t,e).indicatorKey,!1);return d==null?void 0:d.value}}getCellOriginRecord(t,e){var n,o,r;if(!this.internalProps.layoutMap.isHeader(t,e)){if(this.internalProps.recordsIsTwoDimensionalArray){const s=this.getBodyIndexByRow(e),l=this.getBodyIndexByCol(t);return(n=this.records[s])===null||n===void 0?void 0:n[l]}if(this.dataset){let s;const l=this.internalProps.layoutMap.getCellHeaderPaths(t,e),a=(o=l.colHeaderPaths)===null||o===void 0?void 0:o.filter(d=>!d.virtual).map((d,u)=>{var c;return d.indicatorKey&&(s={position:"col",index:u}),(c=d.indicatorKey)!==null&&c!==void 0?c:d.value}),h=(r=l.rowHeaderPaths)===null||r===void 0?void 0:r.filter(d=>!d.virtual).map((d,u)=>{var c;return d.indicatorKey&&(s={position:"row",index:u}),(c=d.indicatorKey)!==null&&c!==void 0?c:d.value});return this.dataset.getAggregator(h,a,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,s).records}if(this.flatDataToObjects){const s=this.internalProps.layoutMap.getCellHeaderPaths(t,e),l=s.colHeaderPaths.map(d=>{var u;return(u=d.indicatorKey)!==null&&u!==void 0?u:d.value}),a=s.rowHeaderPaths.map(d=>{var u;return(u=d.indicatorKey)!==null&&u!==void 0?u:d.value}),h=this.flatDataToObjects.getTreeNode(a,l,this.internalProps.layoutMap.getBody(t,e).indicatorKey);return h==null?void 0:h.record}}}getCellRawRecord(t,e){var n,o,r;if(!this.internalProps.layoutMap.isHeader(t,e)){if(this.internalProps.recordsIsTwoDimensionalArray){const s=this.getBodyIndexByRow(e),l=this.getBodyIndexByCol(t);return(n=this.records[s])===null||n===void 0?void 0:n[l]}if(this.dataset){let s;const l=this.internalProps.layoutMap.getCellHeaderPaths(t,e),a=(o=l.colHeaderPaths)===null||o===void 0?void 0:o.filter(d=>!d.virtual).map((d,u)=>{var c;return d.indicatorKey&&(s={position:"col",index:u}),(c=d.indicatorKey)!==null&&c!==void 0?c:d.value}),h=(r=l.rowHeaderPaths)===null||r===void 0?void 0:r.filter(d=>!d.virtual).map((d,u)=>{var c;return d.indicatorKey&&(s={position:"row",index:u}),(c=d.indicatorKey)!==null&&c!==void 0?c:d.value});return this.dataset.getAggregator(h,a,this.internalProps.layoutMap.getIndicatorKey(t,e),!1,s).records}if(this.flatDataToObjects){const s=this.internalProps.layoutMap.getCellHeaderPaths(t,e),l=s.colHeaderPaths.map(d=>{var u;return(u=d.indicatorKey)!==null&&u!==void 0?u:d.value}),a=s.rowHeaderPaths.map(d=>{var u;return(u=d.indicatorKey)!==null&&u!==void 0?u:d.value}),h=this.flatDataToObjects.getTreeNode(a,l,this.internalProps.layoutMap.getBody(t,e).indicatorKey,!1);return h==null?void 0:h.record}}}updateSortRules(t,e,n){this.internalProps.dataConfig?this.internalProps.dataConfig.sortRules=t:this.internalProps.dataConfig={sortRules:t},this.dataset.updateSortRules(t),this._changePivotSortStateBySortRules();const{layoutMap:o}=this.internalProps;o.resetHeaderTree(),this.scenegraph.clearCells(),ft(e)&&ft(n)?(this.isRowHeader(e,n)?(this.setMinMaxLimitWidth(!0),this.internalProps._widthResizedColMap.clear()):this.isCornerHeader(e,n)?o.cornerSetting.titleOnDimension==="column"?(this.setMinMaxLimitWidth(!0),this.internalProps._widthResizedColMap.clear()):o.cornerSetting.titleOnDimension==="row"&&this.internalProps._heightResizedRowMap.clear():this.isColumnHeader(e,n)&&this.internalProps._heightResizedRowMap.clear(),this.refreshRowColCount()):this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.createSceneGraph(!0),this.render()}_changePivotSortStateBySortRules(){var t,e,n,o;this.pivotSortState=[];const r=(e=(t=this.internalProps.dataConfig)===null||t===void 0?void 0:t.sortRules)!==null&&e!==void 0?e:[];for(let s=0;s<r.length;s++){const l=r[s],a=[];if(l.sortByIndicator&&l.sortField===(this.dataset.indicatorsAsCol?this.dataset.rows[this.dataset.rows.length-1]:this.dataset.columns[this.dataset.columns.length-1])){for(let d=0;d<l.query.length;d++)a.push({dimensionKey:this.dataset.indicatorsAsCol?this.dataset.columns[d]:this.dataset.rows[d],value:l.query[d]});a.push({indicatorKey:l.sortByIndicator,value:(o=(n=this.internalProps.layoutMap.getIndicatorInfo(l.sortByIndicator))===null||n===void 0?void 0:n.title)!==null&&o!==void 0?o:l.sortByIndicator})}else a.push({dimensionKey:l.sortField,isPivotCorner:!0,value:l.sortField});const h=l.sortType?l.sortType.toUpperCase():"ASC";this.pivotSortState.push({dimensions:a,order:gi[h]})}}_parseColumnWidthConfig(t){for(let e=0;e<(t==null?void 0:t.length);e++){const n=t[e],o=n.dimensions,r=n.width,s=this.getCellAddressByHeaderPaths(o);s&&!this.internalProps._widthResizedColMap.has(s.col)&&(this._setColWidth(s.col,r),this.internalProps._widthResizedColMap.add(s.col))}}updatePivotSortState(t){this.pivotSortState=t}sort(t,e,n){var o;let r;if(this.isCornerHeader(t,e)){const a=this.getHeaderDefine(t,e);r=[];const h={isPivotCorner:!0,dimensionKey:a.value,value:a.value};r.push(h)}else r=this.isColumnHeader(t,e)?this.getCellHeaderPaths(t,e).colHeaderPaths:this.getCellHeaderPaths(t,e).rowHeaderPaths;const s=r[r.length-1].indicatorKey,l=this.getHeaderDefine(t,e);if(l.sort){if(this.dataset.sortRules){const a={};for(let h=this.dataset.sortRules.length-1;h>=0;h--){const d=this.dataset.sortRules[h];l.dimensionKey&&d.sortField===l.dimensionKey?(a[d.sortField]=d,this.dataset.sortRules.splice(h,1)):s&&d.sortField===(this.dataset.indicatorsAsCol?this.dataset.rows[this.dataset.rows.length-1]:this.dataset.columns[this.dataset.columns.length-1])&&this.dataset.sortRules.splice(h,1)}s?this.dataset.sortRules.push({sortField:this.dataset.indicatorsAsCol?this.dataset.rows[this.dataset.rows.length-1]:this.dataset.columns[this.dataset.columns.length-1],sortType:gi[n],sortByIndicator:s,query:r.reduce((h,d)=>(d.dimensionKey&&h.push(d.value),h),[])}):this.dataset.sortRules.push(Object.assign((o=a[l.dimensionKey])!==null&&o!==void 0?o:{},{sortField:l.dimensionKey,sortType:gi[n]}))}else this.dataset.sortRules=s?[{sortField:this.dataset.indicatorsAsCol?this.dataset.rows[this.dataset.rows.length-1]:this.dataset.columns[this.dataset.columns.length-1],sortType:gi[n],sortByIndicator:s,query:r.reduce((a,h)=>(h.dimensionKey&&a.push(h.value),a),[])}]:[{sortField:l.dimensionKey,sortType:gi[n]}];this.updateSortRules(this.dataset.sortRules,t,e)}}getPivotSortState(t,e){if(!this.pivotSortState)return;const n=this.getCellRange(t,e);for(let o=0;o<this.pivotSortState.length;o++){const r=this.pivotSortState[o],s=r.dimensions,l=this.getCellAddressByHeaderPaths(s),a=r.order;if(l&&Yi(n,l.col,l.row))return a}}_moveHeaderPosition(t,e){const n=this.getCellRange(t.col,t.row),o=this.getCellRange(e.col,e.row),r=this.internalProps.layoutMap.moveHeaderPosition(t,e);if(r){if(r.moveType==="column"){if(this.internalProps.recordsIsTwoDimensionalArray)for(let s=0;s<this.internalProps.records.length;s++){const l=this.internalProps.records[s].splice(r.sourceIndex-this.rowHeaderLevelCount,r.sourceSize);l.unshift(r.targetIndex-this.rowHeaderLevelCount,0),Array.prototype.splice.apply(this.internalProps.records[s],l)}this.colWidthsMap.exchangeOrder(n.start.col,n.end.col-n.start.col+1,o.start.col,o.end.col-o.start.col+1,r.targetIndex),this.setMinMaxLimitWidth()}else if(r.moveType==="row"){if(this.internalProps.recordsIsTwoDimensionalArray){const s=this.internalProps.records.splice(r.sourceIndex-this.columnHeaderLevelCount,r.sourceSize);s.unshift(r.targetIndex-this.columnHeaderLevelCount,0),Array.prototype.splice.apply(this.internalProps.records,s)}r.targetIndex>r.sourceIndex?this.rowHeightsMap.exchangeOrder(r.sourceIndex,r.sourceSize,r.targetIndex+r.sourceSize-r.targetSize,r.targetSize,r.targetIndex):this.rowHeightsMap.exchangeOrder(r.sourceIndex,r.sourceSize,r.targetIndex,r.targetSize,r.targetIndex)}return r}return null}toggleHierarchyState(t,e,n=!0){const o=this.getHierarchyState(t,e);if(o===Vt.expand)this._refreshHierarchyState(t,e,n),this.fireListeners(rr.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:Vt.collapse});else if(o===Vt.collapse){const r=this.internalProps.layoutMap.getHeadNode(t,e);Array.isArray(r.children)&&this._refreshHierarchyState(t,e,n),this.fireListeners(rr.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:Vt.expand,originData:r})}}_refreshHierarchyState(t,e,n=!0,o){let r=!1,s=!1;this.stateManager.updateHoverIcon(t,e,void 0,void 0);const l=this.internalProps.layoutMap.checkHasChart();l&&(this.autoFillWidth&&(r=this.getAllColsWidth()<=this.tableNoFrameWidth),this.autoFillHeight&&(s=this.getAllRowsHeight()<=this.tableNoFrameHeight));const a=this.internalProps.layoutMap.toggleHierarchyState(t,e);o&&o(),this.refreshRowColCount(),this.clearCellStyleCache(),this.scenegraph.updateHierarchyIcon(t,e),this.scenegraph.updateRow(a.removeCellPositions,a.addCellPositions,a.updateCellPositions,n),l&&(this.autoFillWidth&&!r&&(r=this.getAllColsWidth()<=this.tableNoFrameWidth),this.autoFillHeight&&!s&&(s=this.getAllRowsHeight()<=this.tableNoFrameHeight),(this.widthMode==="adaptive"||r||this.heightMode==="adaptive"||s)&&this.scenegraph.updateChartSizeForResizeColWidth(-1))}getHeaderCellAddressByPath(t){return this.internalProps.layoutMap.getPivotCellAdress(t)}getCellAddressByHeaderPaths(t){return this.internalProps.layoutMap.getCellAdressByHeaderPath(t)}getHeaderPathByXY(t){let e;return e=t?this.getCellAt(t.x+this.getFrozenColsWidth()+this.scrollLeft+1,t.y+this.getFrozenRowsHeight()+this.scrollTop+1):this.getCellAt(this.getFrozenColsWidth()+this.scrollLeft+1,this.getFrozenRowsHeight()+this.scrollTop+1),this.internalProps.layoutMap.getCellHeaderPaths(e.col,e.row)}getHierarchyState(t,e){var n;return(n=this._getHeaderLayoutMap(t,e))===null||n===void 0?void 0:n.hierarchyState}getLayoutColumnTree(){return this.internalProps.layoutMap.getLayoutColumnTree()}getLayoutColumnTreeCount(){return this.internalProps.layoutMap.getLayoutColumnTreeCount()}getLayoutRowTree(){return this.internalProps.layoutMap.getLayoutRowTree()}getLayoutRowTreeCount(){return this.internalProps.layoutMap.getLayoutRowTreeCount()}getCellHeaderTreeNodes(t,e){return this.internalProps.layoutMap.getCellHeaderPathsWithTreeNode(t,e)}_hasHierarchyTreeHeader(){return this.internalProps.layoutMap.rowHierarchyType==="tree"}getMenuInfo(t,e,n){const o=this.internalProps.layoutMap.getPivotDimensionInfo(t,e);return{dimensionKey:o[o.length-1].dimensionKey,value:this.getCellValue(t,e),cellLocation:this.getCellLocation(t,e),isPivotCorner:this.isCornerHeader(t,e),event:void 0}}setRecords(t){var e,n,o,r,s;const l={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.options.records=this.internalProps.records=t,this.internalProps.recordsIsTwoDimensionalArray=!1,((e=t==null?void 0:t[0])===null||e===void 0?void 0:e.constructor)===Array&&(this.internalProps.recordsIsTwoDimensionalArray=!0);const a=this.options,h=this.internalProps;if(((n=this.options.customConfig)===null||n===void 0?void 0:n.enableDataAnalysis)===!1)this.internalProps.recordsIsTwoDimensionalArray===!1&&(this.flatDataToObjects=new pv({rows:h.layoutMap.fullRowDimensionKeys,columns:h.layoutMap.colDimensionKeys,indicators:h.layoutMap.indicatorKeys,indicatorsAsCol:h.layoutMap.indicatorsAsCol,indicatorDimensionKey:h.layoutMap.indicatorDimensionKey},t));else{let d,u;this.dataset.setRecords(t),d=a.columnTree?h.layoutMap.columnDimensionTree:new Pe((o=this.dataset.colHeaderTree)!==null&&o!==void 0?o:[],this.layoutNodeId),u=a.rowTree?h.layoutMap.rowDimensionTree:new Pe((r=this.dataset.rowHeaderTree)!==null&&r!==void 0?r:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(s=this.options.rowExpandLevel)!==null&&s!==void 0?s:1:void 0),h.layoutMap=new lr(this,this.dataset,d,u),this.pivotSortState=[],a.pivotSortState&&(this.pivotSortState=a.pivotSortState)}if(this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(l.col,l.row),this.internalProps.title&&!this.internalProps.title.isReleased&&(this._updateSize(),this.internalProps.title.resize(),this.scenegraph.resize()),this.eventManager.updateEventBinder(),this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const d=Bt.getComponent("emptyTip");this.internalProps.emptyTip=new d(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}}startEditCell(t,e,n){var o;if(z(t)&&z(e))this.eventManager.isDraging=!1,this.selectCell(t,e),this.editorManager.startEditCell(t,e,n);else if(!((o=this.stateManager.select)===null||o===void 0)&&o.cellPos){const{col:r,row:s}=this.stateManager.select.cellPos;z(r)&&z(s)&&this.editorManager.startEditCell(r,s,n)}}completeEditCell(){this.editorManager.completeEdit()}getEditor(t,e){var n,o,r;let s;if(this.isCornerHeader(t,e)){const l=this.getHeaderDefine(t,e);s=(n=l==null?void 0:l.headerEditor)!==null&&n!==void 0?n:this.options.headerEditor}else if(this.isHeader(t,e)){const l=this.getHeaderDefine(t,e);s=(o=l==null?void 0:l.headerEditor)!==null&&o!==void 0?o:this.options.headerEditor}else{const l=this.getBodyColumnDefine(t,e);s=(r=l==null?void 0:l.editor)!==null&&r!==void 0?r:this.options.editor}return typeof s=="function"&&(s=s({col:t,row:e,dataValue:this.getCellOriginValue(t,e),value:this.getCellValue(t,e)||"",table:this})),typeof s=="string"?oT(s):s}isHasEditorDefine(t,e){var n;const o=this.getBodyColumnDefine(t,e);let r=(n=o==null?void 0:o.editor)!==null&&n!==void 0?n:this.options.editor;return typeof r=="function"&&(r=r({col:t,row:e,dataValue:this.getCellOriginValue(t,e),value:this.getCellValue(t,e)||"",table:this})),z(r)}changeCellValue(t,e,n,o=!1){if(o&&this.isHasEditorDefine(t,e)||o===!1){let r=n;const s=this.getCellOriginValue(t,e),l=this.getCellRawValue(t,e);typeof l=="number"&&lm(n)&&(r=parseFloat(n)),this._changeCellValueToDataSet(t,e,s,r);const a=this.getCellRange(t,e);for(let h=a.start.col;h<=a.end.col;h++)for(let d=a.start.row;d<=a.end.row;d++)this.scenegraph.updateCellContent(h,d);if(this.widthMode==="adaptive"||this.autoFillWidth&&this.getAllColsWidth()<=this.tableNoFrameWidth)this.internalProps._widthResizedColMap.size===0&&this.scenegraph.recalculateColWidths();else if(!this.internalProps._widthResizedColMap.has(t)){const h=this.getColWidth(t),d=Fr(t,0,this.rowCount-1,this,!1);d!==h&&this.scenegraph.updateColWidth(t,d-h)}if(this.heightMode==="adaptive"||this.autoFillHeight&&this.getAllRowsHeight()<=this.tableNoFrameHeight)this.internalProps._heightResizedRowMap.size===0&&this.scenegraph.recalculateRowHeights();else if(this.heightMode==="autoHeight"&&!this.internalProps._heightResizedRowMap.has(e)){const h=this.getRowHeight(e),d=nn(e,0,this.colCount-1,this);this.scenegraph.updateRowHeight(e,d-h)}this.fireListeners(at.CHANGE_CELL_VALUE,{col:t,row:e,rawValue:l,currentValue:s,changedValue:r}),this.scenegraph.updateNextFrame()}}changeCellValues(t,e,n,o=!1){let r=t,s=e;const l=[],a=[];for(let u=0;u<n.length&&!(e+u>this.rowCount-1);u++){const c=n[u],g=[],f=[];l.push(g),a.push(f);for(let p=0;p<c.length&&!(t+p>this.colCount-1);p++){const m=this.getCellRawValue(t+p,e+u);g.push(m);const b=this.getCellOriginValue(t+p,e+u);f.push(b)}}for(let u=0;u<n.length&&!(e+u>this.rowCount-1);u++){s=e+u;const c=n[u];let g=t;for(let f=0;f<c.length&&!(t+f>this.colCount-1);f++)if(g=t+f,o&&this.isHasEditorDefine(t+f,e+u)||o===!1){const p=c[f];let m=p;const b=a[u][f],C=l[u][f];typeof C=="number"&&lm(p)&&(m=parseFloat(p)),this._changeCellValueToDataSet(t+f,e+u,b,m),this.fireListeners(at.CHANGE_CELL_VALUE,{col:t+f,row:e+u,rawValue:C,currentValue:b,changedValue:this.getCellOriginValue(t+f,e+u)})}r=Math.max(r,g)}const h=this.getCellRange(t,e),d=this.getCellRange(r,s);for(let u=h.start.col;u<=d.end.col;u++)for(let c=h.start.row;c<=d.end.row;c++)this.scenegraph.updateCellContent(u,c);if(this.widthMode==="adaptive"||this.autoFillWidth&&this.getAllColsWidth()<=this.tableNoFrameWidth)this.internalProps._widthResizedColMap.size===0&&this.scenegraph.recalculateColWidths();else for(let u=t;u<=d.end.col;u++)if(!this.internalProps._widthResizedColMap.has(u)){const c=this.getColWidth(u),g=Fr(u,0,this.rowCount-1,this,!1);g!==c&&this.scenegraph.updateColWidth(u,g-c)}if(this.heightMode==="adaptive"||this.autoFillHeight&&this.getAllRowsHeight()<=this.tableNoFrameHeight)this.scenegraph.recalculateRowHeights();else if(this.heightMode==="autoHeight"){const u=[],c=[];for(let g=e;g<=d.end.row;g++)if(this.rowHeightsMap.get(g)){const f=this.getRowHeight(g),p=nn(g,0,this.colCount-1,this);u.push(g),c.push(p-f)}this.scenegraph.updateRowsHeight(u,c)}this.scenegraph.updateNextFrame()}_changeCellValueToDataSet(t,e,n,o){var r,s,l,a,h,d,u,c;if(this.internalProps.recordsIsTwoDimensionalArray){const g=this.getBodyIndexByRow(e),f=this.getBodyIndexByCol(t);this.records[g][f]=o}else if(this.dataset){const g=this.internalProps.layoutMap.getCellHeaderPaths(t,e);if(this.isCornerHeader(t,e))this.internalProps.layoutMap.changeCornerTitle(t,e,o);else if(this.isHeader(t,e))this.internalProps.layoutMap.changeTreeNodeTitle(t,e,o),!this.isCornerHeader(t,e)&&this.dataset.changeRecordFieldValue(!((r=g.colHeaderPaths)===null||r===void 0)&&r.length?(s=g.colHeaderPaths[g.colHeaderPaths.length-1].indicatorKey)!==null&&s!==void 0?s:g.colHeaderPaths[g.colHeaderPaths.length-1].dimensionKey:(l=g.rowHeaderPaths[g.rowHeaderPaths.length-1].indicatorKey)!==null&&l!==void 0?l:g.rowHeaderPaths[g.rowHeaderPaths.length-1].dimensionKey,n,o);else{const f=(a=g.colHeaderPaths)===null||a===void 0?void 0:a.filter(m=>!m.virtual).map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value}),p=(h=g.rowHeaderPaths)===null||h===void 0?void 0:h.filter(m=>!m.virtual).map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value});this.dataset.changeTreeNodeValue(this.internalProps.layoutMap.indicatorsAsCol?p:p.slice(0,-1),this.internalProps.layoutMap.indicatorsAsCol?f.slice(0,-1):f,this.internalProps.layoutMap.getIndicatorKey(t,e),o)}}else if(this.flatDataToObjects){const g=this.internalProps.layoutMap.getCellHeaderPaths(t,e);if(this.isHeader(t,e))this.internalProps.layoutMap.changeTreeNodeTitle(t,e,o),!this.isCornerHeader(t,e)&&this.flatDataToObjects.changeRecordFieldValue(!((d=g.colHeaderPaths)===null||d===void 0)&&d.length?(u=g.colHeaderPaths[g.colHeaderPaths.length-1].indicatorKey)!==null&&u!==void 0?u:g.colHeaderPaths[g.colHeaderPaths.length-1].dimensionKey:(c=g.rowHeaderPaths[g.rowHeaderPaths.length-1].indicatorKey)!==null&&c!==void 0?c:g.rowHeaderPaths[g.rowHeaderPaths.length-1].dimensionKey,n,o);else{const f=g.colHeaderPaths.map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value}),p=g.rowHeaderPaths.map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value});this.flatDataToObjects.changeTreeNodeValue(p,f,this.internalProps.layoutMap.getBody(t,e).indicatorKey,o)}}}_hasCustomRenderOrLayout(){if(this.options.customRender)return!0;const{columnsDefine:t,rowsDefine:e,indicatorsDefine:n}=this.internalProps.layoutMap;for(let o=0;o<t.length;o++){const r=t[o];if(typeof r!="string"&&(r.headerCustomLayout||r.headerCustomRender))return!0}for(let o=0;o<e.length;o++){const r=e[o];if(typeof r!="string"&&(r.headerCustomLayout||r.headerCustomRender))return!0}for(let o=0;o<n.length;o++){const r=n[o];if(typeof r!="string"&&(r.customLayout||r.headerCustomLayout||r.customRender||r.headerCustomRender))return!0}return!1}changeRecordOrder(t,e){}setTreeNodeChildren(t,e,n,o){this.flatDataToObjects?(this.internalProps.layoutMap.getHeadNode(n,o).children=t,this._refreshHierarchyState(n,o,!0,()=>{this.flatDataToObjects.changeDataConfig({rows:this.internalProps.layoutMap.fullRowDimensionKeys,columns:this.internalProps.layoutMap.colDimensionKeys,indicators:this.internalProps.layoutMap.indicatorKeys,indicatorsAsCol:this.internalProps.layoutMap.indicatorsAsCol,indicatorDimensionKey:this.internalProps.layoutMap.indicatorDimensionKey}),this.flatDataToObjects.addRecords(e)})):(this.internalProps.layoutMap.getHeadNode(n,o).children=t,this._refreshHierarchyState(n,o,!0,()=>{this.dataset._rowTreeHasChanged(),this.dataset.changeDataConfig({rows:this.internalProps.layoutMap.fullRowDimensionKeys,columns:this.internalProps.layoutMap.colDimensionKeys}),this.dataset.addRecords(e)}))}updateFilterRules(t){this.internalProps.dataConfig.filterRules=t,this.dataset.updateFilterRules(t),this.renderWithRecreateCells()}getFilteredRecords(){var t;return(t=this.dataset)===null||t===void 0?void 0:t.filterRules}};Mg(),Bg(),Pg(),Hg(),Eg(),Lg(),kg(),Fg(),Ig(),Dg(),Og(),zg(),Il(),Wg();class BT extends MT{}Il();class W9 extends MT{}Mg(),Bg(),Pg(),Hg(),Eg(),Lg(),kg(),Fg(),Ig(),Dg(),Og(),zg(),Il(),Wg();let N9=class extends Cg{constructor(t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w;let y,S;oe.mode==="node"?(e=t,t=null):t instanceof HTMLElement||(e=t,t=t.container?t.container:null),super(t,e),this.layoutNodeId={seqId:0},this._selectedDataItemsInChart=[],this._selectedDimensionInChart=[],this._chartEventMap={},e.layout&&Object.assign(e,e.layout),this.internalProps.columns=Ee(e.columns),this.internalProps.rows=Ee(e.rows),this.internalProps.indicators=ho(e.indicators),this.internalProps.columnTree=!e.indicatorsAsCol||!((n=e.columns)===null||n===void 0)&&n.length||e.columnTree?Ee(e.columnTree):[],this.internalProps.rowTree=e.indicatorsAsCol||!((o=e.rows)===null||o===void 0)&&o.length||e.rowTree?Ee(e.rowTree):[],this.internalProps.records=e.records,this.setCustomStateNameToSpec(),this.internalProps.columnResizeType=(r=e.columnResizeType)!==null&&r!==void 0?r:"column",this.internalProps.rowResizeType=(s=e.rowResizeType)!==null&&s!==void 0?s:"row",this.internalProps.dataConfig={isPivotChart:!0},this._axes=lt(e.axes)?e.axes:[],e.columnTree&&(e.indicatorsAsCol!==!1&&(this.internalProps.columnTree=Vi(this.internalProps.columnTree,e.indicators)),y=new Pe((l=this.internalProps.columnTree)!==null&&l!==void 0?l:[],this.layoutNodeId)),e.rowTree&&(e.indicatorsAsCol===!1&&(this.internalProps.rowTree=Vi(this.internalProps.rowTree,e.indicators)),S=new Pe((a=this.internalProps.rowTree)!==null&&a!==void 0?a:[],this.layoutNodeId));const A=!((h=S==null?void 0:S.dimensionKeys)===null||h===void 0)&&h.count?S.dimensionKeys.valueArr():(u=(d=e.rows)===null||d===void 0?void 0:d.reduce((T,M)=>(typeof M=="string"?T.push(M):T.push(M.dimensionKey),T),[]))!==null&&u!==void 0?u:[],R=!((c=y==null?void 0:y.dimensionKeys)===null||c===void 0)&&c.count?y.dimensionKeys.valueArr():(f=(g=e.columns)===null||g===void 0?void 0:g.reduce((T,M)=>(typeof M=="string"?T.push(M):T.push(M.dimensionKey),T),[]))!==null&&f!==void 0?f:[],x=(m=(p=e.indicators)===null||p===void 0?void 0:p.reduce((T,M)=>(typeof M=="string"?T.push(M):T.push(M.indicatorKey),T),[]))!==null&&m!==void 0?m:[];if(this.internalProps.dataConfig.collectValuesBy=this._generateCollectValuesConfig(R,A),this.internalProps.dataConfig.aggregationRules=this._generateAggregationRules(),this.internalProps.dataConfig.dimensionSortArray=this._getDimensionSortArray(),this.dataset=new Ih(this.internalProps.dataConfig,A,R,x,this.internalProps.indicators,(b=e.indicatorsAsCol)===null||b===void 0||b,e.records,void 0,this.internalProps.columnTree,this.internalProps.rowTree,!0),this.options.indicatorsAsCol&&Lh(this.internalProps.indicators)){const T=M=>{M.forEach(B=>{var P;!((P=B.children)===null||P===void 0)&&P.length?T(B.children):B.children=[{dimensionKey:"axis",value:""}]})};!((C=this.dataset.rowHeaderTree)===null||C===void 0)&&C.length?T(this.dataset.rowHeaderTree):this.dataset.rowHeaderTree=[{dimensionKey:"axis",value:""}]}if(e.columnTree||e.indicatorsAsCol!==!1&&(this.dataset.colHeaderTree=Vi(this.dataset.colHeaderTree,e.indicators)),e.rowTree||e.indicatorsAsCol===!1&&(this.dataset.rowHeaderTree=Vi(this.dataset.rowHeaderTree,e.indicators)),y=new Pe((_=this.dataset.colHeaderTree)!==null&&_!==void 0?_:[],this.layoutNodeId),S=new Pe((w=this.dataset.rowHeaderTree)!==null&&w!==void 0?w:[],this.layoutNodeId),this.internalProps.layoutMap=new lr(this,this.dataset,y,S),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.createSceneGraph(),e.title){const T=Bt.getComponent("title");this.internalProps.title=new T(e.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const T=Bt.getComponent("emptyTip");this.internalProps.emptyTip=new T(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}setTimeout(()=>{this.fireListeners(at.INITIALIZED,null)},0)}static get EVENT_TYPE(){return SA}get pivotChartAxes(){return this._axes}get recordsCount(){var t;return(t=this.records)===null||t===void 0?void 0:t.length}isListTable(){return!1}isPivotTable(){return!0}isPivotChart(){return!0}_canResizeColumn(t,e){const n=super._canResizeColumn(t,e);if(n&&!this.internalProps.layoutMap.indicatorsAsCol){const o=this.internalProps.layoutMap.getBody(t,this.columnHeaderLevelCount);if(o!=null&&o.disableColumnResize)return!1}return n}updateOption(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y;const S=this.internalProps;let A,R;super.updateOption(t),this.layoutNodeId={seqId:0},this.internalProps.columns=Ee(t.columns),this.internalProps.rows=Ee(t.rows),this.internalProps.indicators=!((e=t.indicators)===null||e===void 0)&&e.length?ho(t.indicators):[],this.internalProps.columnTree=!t.indicatorsAsCol||!((n=t.columns)===null||n===void 0)&&n.length||t.columnTree?Ee(t.columnTree):[],this.internalProps.rowTree=t.indicatorsAsCol||!((o=t.rows)===null||o===void 0)&&o.length||t.rowTree?Ee(t.rowTree):[],t.records&&(this.internalProps.records=t.records),this.setCustomStateNameToSpec(),this._selectedDataItemsInChart=[],S.columnResizeType=(r=t.columnResizeType)!==null&&r!==void 0?r:"column",S.rowResizeType=(s=t.rowResizeType)!==null&&s!==void 0?s:"row",S.dataConfig={isPivotChart:!0},this._axes=lt(t.axes)?t.axes:[],t.columnTree&&(t.indicatorsAsCol!==!1&&(this.internalProps.columnTree=Vi(this.internalProps.columnTree,t.indicators)),A=new Pe((l=this.internalProps.columnTree)!==null&&l!==void 0?l:[],this.layoutNodeId)),t.rowTree&&(t.indicatorsAsCol===!1&&(this.internalProps.rowTree=Vi(this.internalProps.rowTree,t.indicators)),R=new Pe((a=this.internalProps.rowTree)!==null&&a!==void 0?a:[],this.layoutNodeId));const x=!((h=R==null?void 0:R.dimensionKeys)===null||h===void 0)&&h.count?R.dimensionKeys.valueArr():(u=(d=t.rows)===null||d===void 0?void 0:d.reduce((B,P)=>(typeof P=="string"?B.push(P):B.push(P.dimensionKey),B),[]))!==null&&u!==void 0?u:[],T=!((c=A==null?void 0:A.dimensionKeys)===null||c===void 0)&&c.count?A.dimensionKeys.valueArr():(f=(g=t.columns)===null||g===void 0?void 0:g.reduce((B,P)=>(typeof P=="string"?B.push(P):B.push(P.dimensionKey),B),[]))!==null&&f!==void 0?f:[],M=(m=(p=t.indicators)===null||p===void 0?void 0:p.reduce((B,P)=>(typeof P=="string"?B.push(P):B.push(P.indicatorKey),B),[]))!==null&&m!==void 0?m:[];if(this.internalProps.dataConfig.collectValuesBy=this._generateCollectValuesConfig(T,x),this.internalProps.dataConfig.aggregationRules=this._generateAggregationRules(),this.internalProps.dataConfig.dimensionSortArray=this._getDimensionSortArray(),this.dataset=new Ih(this.internalProps.dataConfig,x,T,M,this.internalProps.indicators,(b=t.indicatorsAsCol)===null||b===void 0||b,(C=t.records)!==null&&C!==void 0?C:this.internalProps.records,void 0,this.internalProps.columnTree,this.internalProps.rowTree,!0),this.options.indicatorsAsCol&&Lh(this.internalProps.indicators)){const B=P=>{P.forEach(F=>{var H;!((H=F.children)===null||H===void 0)&&H.length?B(F.children):F.children=[{dimensionKey:"axis",value:""}]})};!((_=this.dataset.rowHeaderTree)===null||_===void 0)&&_.length?B(this.dataset.rowHeaderTree):this.dataset.rowHeaderTree=[{dimensionKey:"axis",value:""}]}if(t.columnTree||t.indicatorsAsCol!==!1&&(this.dataset.colHeaderTree=Vi(this.dataset.colHeaderTree,t.indicators)),t.rowTree||t.indicatorsAsCol===!1&&(this.dataset.rowHeaderTree=Vi(this.dataset.rowHeaderTree,t.indicators)),A=new Pe((w=this.dataset.colHeaderTree)!==null&&w!==void 0?w:[],this.layoutNodeId),R=new Pe((y=this.dataset.rowHeaderTree)!==null&&y!==void 0?y:[],this.layoutNodeId),S.layoutMap=new lr(this,this.dataset,A,R),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,S.releaseList&&(S.releaseList.forEach(B=>{var P;return(P=B==null?void 0:B.release)===null||P===void 0?void 0:P.call(B)}),S.releaseList=null),this.scenegraph.clearCells(),this.scenegraph.createSceneGraph(),t.title){const B=Bt.getComponent("title");this.internalProps.title=new B(t.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const B=Bt.getComponent("emptyTip");this.internalProps.emptyTip=new B(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}return new Promise(B=>{setTimeout(B,0)})}updatePagination(){}refreshHeader(){this.setMinMaxLimitWidth(!0),this.refreshRowColCount()}refreshRowColCount(){var t,e,n,o,r,s,l,a;const h=this,{layoutMap:d}=h.internalProps;d&&(h.colCount=(t=d.colCount)!==null&&t!==void 0?t:0,h.rowCount=(e=d.rowCount)!==null&&e!==void 0?e:0,h.internalProps.frozenColCount=(n=d.rowHeaderLevelCount)!==null&&n!==void 0?n:0,h.frozenRowCount=Math.max(d.headerLevelCount,(o=this.options.frozenRowCount)!==null&&o!==void 0?o:0),h.bottomFrozenRowCount!==((r=d==null?void 0:d.bottomFrozenRowCount)!==null&&r!==void 0?r:0)&&(h.bottomFrozenRowCount=(s=d==null?void 0:d.bottomFrozenRowCount)!==null&&s!==void 0?s:0),h.rightFrozenColCount!==((l=d==null?void 0:d.rightFrozenColCount)!==null&&l!==void 0?l:0)&&(h.rightFrozenColCount=(a=d==null?void 0:d.rightFrozenColCount)!==null&&a!==void 0?a:0),this.stateManager.setFrozenCol(this.internalProps.frozenColCount))}_getSortFuncFromHeaderOption(t,e,n){}syncHierarchyState(t,e){var n,o;t.value===e.value&&t.dimensionKey===e.dimensionKey&&(e.hierarchyState=(n=e.hierarchyState)!==null&&n!==void 0?n:e!=null&&e.children?t.hierarchyState:void 0,(o=e==null?void 0:e.children)===null||o===void 0||o.forEach((r,s)=>{var l;!((l=t==null?void 0:t.children)===null||l===void 0)&&l[s]&&r&&this.syncHierarchyState(t.children[s],r)}))}getRecordShowIndexByCell(t,e){}getTableIndexByRecordIndex(t){}getTableIndexByField(t){}getCellAddrByFieldRecord(t,e){}getBodyIndexByRow(t){const{layoutMap:e}=this.internalProps;return e.getBodyIndexByRow(t)}getBodyIndexByCol(t){const{layoutMap:e}=this.internalProps;return e.getBodyIndexByCol(t)}getCellValue(t,e,n){var o,r,s;if(!n){const u=this.getCustomMergeValue(t,e);if(u)return u}if(this.internalProps.layoutMap.isHeader(t,e)){if(this.internalProps.layoutMap.isBottomFrozenRow(t,e)||this.internalProps.layoutMap.isRightFrozenColumn(t,e)){const g=this.internalProps.layoutMap.getIndicatorKeyInChartSpec(t,e);let f;return g==null||g.forEach(p=>{const m=this.internalProps.layoutMap.getIndicatorInfo(p);m&&(f=m)}),(r=(o=f==null?void 0:f.title)!==null&&o!==void 0?o:f==null?void 0:f.indicatorKey)!==null&&r!==void 0?r:""}const{title:u,fieldFormat:c}=this.internalProps.layoutMap.getHeader(t,e);return typeof c=="function"?c(u,t,e,this):u}if(this.dataset){let u;const c=this.internalProps.layoutMap.getCellHeaderPaths(t,e),g=c.colHeaderPaths.map((m,b)=>{var C;return m.indicatorKey&&(u={position:"col",index:b}),(C=m.indicatorKey)!==null&&C!==void 0?C:m.value}),f=c.rowHeaderPaths.map((m,b)=>{var C;return m.indicatorKey&&(u={position:"row",index:b}),(C=m.indicatorKey)!==null&&C!==void 0?C:m.value}),p=this.dataset.getAggregator(f,g,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,u);return p.value?p.value():void 0}const{fieldFormat:l}=this.internalProps.layoutMap.getBody(t,e),a=this.getBodyIndexByRow(e),h=this.getBodyIndexByCol(t),d=(s=this.records[a])===null||s===void 0?void 0:s[h];return typeof l=="function"?l(d,t,e,this):d}getCellOriginValue(t,e){var n,o,r;const s=this;if(s.internalProps.layoutMap.isHeader(t,e)){if(this.internalProps.layoutMap.isBottomFrozenRow(t,e)||this.internalProps.layoutMap.isRightFrozenColumn(t,e)){const d=this.internalProps.layoutMap.getIndicatorKeyInChartSpec(t,e);let u;return d==null||d.forEach(c=>{const g=this.internalProps.layoutMap.getIndicatorInfo(c);g&&(u=g)}),(o=(n=u==null?void 0:u.title)!==null&&n!==void 0?n:u==null?void 0:u.indicatorKey)!==null&&o!==void 0?o:""}const{title:h}=s.internalProps.layoutMap.getHeader(t,e);return typeof h=="function"?h():h}if(this.dataset){let h;const d=this.internalProps.layoutMap.getCellHeaderPaths(t,e),u=d.colHeaderPaths.map((f,p)=>{var m;return f.indicatorKey&&(h={position:"col",index:p}),(m=f.indicatorKey)!==null&&m!==void 0?m:f.value}),c=d.rowHeaderPaths.map((f,p)=>{var m;return f.indicatorKey&&(h={position:"row",index:p}),(m=f.indicatorKey)!==null&&m!==void 0?m:f.value}),g=this.dataset.getAggregator(c,u,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,h);return g.value?g.value():void 0}const l=this.getBodyIndexByRow(e),a=this.getBodyIndexByCol(t);return(r=this.records[l])===null||r===void 0?void 0:r[a]}getCellRawValue(t,e){return this.getCellOriginValue(t,e)}getCellOriginRecord(t,e){if(!this.internalProps.layoutMap.isHeader(t,e)&&this.dataset){let n;const o=this.internalProps.layoutMap.getCellHeaderPaths(t,e),r=o.colHeaderPaths.map((l,a)=>{var h;return l.indicatorKey&&(n={position:"col",index:a}),(h=l.indicatorKey)!==null&&h!==void 0?h:l.value}),s=o.rowHeaderPaths.map((l,a)=>{var h;return l.indicatorKey&&(n={position:"row",index:a}),(h=l.indicatorKey)!==null&&h!==void 0?h:l.value});return this.dataset.getAggregator(s,r,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,n).records}}getCellRawRecord(t,e){return this.getCellOriginRecord(t,e)}getPivotSortState(t,e){if(!this.pivotSortState)return;const n=this.getCellRange(t,e);for(let o=0;o<this.pivotSortState.length;o++){const{col:r,row:s,order:l}=this.pivotSortState[o];if(Yi(n,r,s))return l}}_moveHeaderPosition(t,e){var n,o,r,s;const l=this.internalProps.layoutMap.moveHeaderPosition(t,e);if(l){if(l.moveType==="column"){if(((o=(n=this.options.records)===null||n===void 0?void 0:n[0])===null||o===void 0?void 0:o.constructor)===Array)for(let a=0;a<this.internalProps.records.length;a++){const h=this.internalProps.records[a].splice(l.sourceIndex-this.rowHeaderLevelCount,l.sourceSize);h.unshift(l.targetIndex-this.rowHeaderLevelCount,0),Array.prototype.splice.apply(this.internalProps.records[a],h)}this.colWidthsMap.adjustOrder(l.sourceIndex,l.targetIndex,l.sourceSize),this.setMinMaxLimitWidth()}else if(l.moveType==="row"){if(((s=(r=this.options.records)===null||r===void 0?void 0:r[0])===null||s===void 0?void 0:s.constructor)===Array){const a=this.internalProps.records.splice(l.sourceIndex-this.columnHeaderLevelCount,l.sourceSize);a.unshift(l.targetIndex-this.columnHeaderLevelCount,0),Array.prototype.splice.apply(this.internalProps.records,a)}this.rowHeightsMap.adjustOrder(l.sourceIndex,l.targetIndex,l.sourceSize)}return l}return null}toggleHierarchyState(t,e,n=!0){}getHeaderCellAddressByPath(t){return this.internalProps.layoutMap.getPivotCellAdress(t)}getCellAddressByHeaderPaths(t){return this.internalProps.layoutMap.getCellAdressByHeaderPath(t)}getHeaderPathByXY(t){let e;return e=t?this.getCellAt(t.x+this.getFrozenColsWidth()+this.scrollLeft+1,t.y+this.getFrozenRowsHeight()+this.scrollTop+1):this.getCellAt(this.getFrozenColsWidth()+this.scrollLeft+1,this.getFrozenRowsHeight()+this.scrollTop+1),this.internalProps.layoutMap.getCellHeaderPaths(e.col,e.row)}getHierarchyState(t,e){var n;return(n=this._getHeaderLayoutMap(t,e))===null||n===void 0?void 0:n.hierarchyState}_hasHierarchyTreeHeader(){return this.internalProps.layoutMap.rowHierarchyType==="tree"}getMenuInfo(t,e,n){const o=this.internalProps.layoutMap.getPivotDimensionInfo(t,e);return{dimensionKey:o[o.length-1].dimensionKey,value:this.getCellValue(t,e),cellLocation:this.getCellLocation(t,e),isPivotCorner:this.isCornerHeader(t,e),event:void 0}}_generateCollectValuesConfig(t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_;t=t.filter(S=>S!==Xi),e=e.filter(S=>S!==Xi);const w=this.internalProps.indicators,y={};for(let S=0,A=w==null?void 0:w.length;S<A;S++)if(typeof w[S]!="string"&&w[S].chartSpec){if(((n=w[S].chartSpec)===null||n===void 0?void 0:n.type)==="pie"||((o=w[S].chartSpec)===null||o===void 0?void 0:o.type)==="rose"||((r=w[S].chartSpec)===null||r===void 0?void 0:r.type)==="radar"||((s=w[S].chartSpec)===null||s===void 0?void 0:s.type)==="gauge"||((l=w[S].chartSpec)===null||l===void 0?void 0:l.type)==="wordCloud")continue;const R=w[S],x=R.chartSpec;if(this.options.indicatorsAsCol===!1)if((x==null?void 0:x.stack)!==!1&&((x==null?void 0:x.type)==="bar"||(x==null?void 0:x.type)==="area")&&(x.stack=!0),y[R.indicatorKey]={by:e,range:!0,sumBy:(x==null?void 0:x.stack)&&t.concat(x==null?void 0:x.xField)},x.series)x.series.forEach(T=>{var M,B,P,F,H,E,k,I,L,D,O,N,W,$;const U=typeof T.xField=="string"?T.xField:T.xField[0];y[U]={by:t,type:T.direction!=="horizontal"?"xField":void 0,range:As(T,this._axes,T.direction==="horizontal",!0),sortBy:T.direction!=="horizontal"?(F=(P=(B=(M=T==null?void 0:T.data)===null||M===void 0?void 0:M.fields)===null||B===void 0?void 0:B[U])===null||P===void 0?void 0:P.domain)!==null&&F!==void 0?F:(k=(E=(H=x==null?void 0:x.data)===null||H===void 0?void 0:H.fields)===null||E===void 0?void 0:E[U])===null||k===void 0?void 0:k.domain:void 0};const Y=T.yField;T.stack!==!1&&(T.type==="bar"||T.type==="area")&&(T.stack=!0),y[Y]={by:e,range:As(T,this._axes,T.direction==="horizontal",!1),sumBy:T.stack&&t.concat(T==null?void 0:T.xField),sortBy:T.direction==="horizontal"?(O=(D=(L=(I=T==null?void 0:T.data)===null||I===void 0?void 0:I.fields)===null||L===void 0?void 0:L[Y])===null||D===void 0?void 0:D.domain)!==null&&O!==void 0?O:($=(W=(N=x==null?void 0:x.data)===null||N===void 0?void 0:N.fields)===null||W===void 0?void 0:W[Y])===null||$===void 0?void 0:$.domain:void 0,extendRange:Ac(x.markLine)}});else{const T=typeof x.xField=="string"?x.xField:x.xField[0];y[T]={by:t,type:x.direction!=="horizontal"?"xField":void 0,range:As(x,this._axes,x.direction==="horizontal",!0),sortBy:x.direction!=="horizontal"?(d=(h=(a=x==null?void 0:x.data)===null||a===void 0?void 0:a.fields)===null||h===void 0?void 0:h[T])===null||d===void 0?void 0:d.domain:void 0},(x==null?void 0:x.stack)!==!1&&((x==null?void 0:x.type)==="bar"||(x==null?void 0:x.type)==="area")&&(x.stack=!0);const M=x.yField;y[M]={by:e,range:x.direction!=="horizontal",sumBy:x.stack&&t.concat(x==null?void 0:x.xField),sortBy:x.direction==="horizontal"?(g=(c=(u=x==null?void 0:x.data)===null||u===void 0?void 0:u.fields)===null||c===void 0?void 0:c[M])===null||g===void 0?void 0:g.domain:void 0,extendRange:Ac(x.markLine)}}else{const T=w[S];if((x==null?void 0:x.stack)!==!1&&((x==null?void 0:x.type)==="bar"||(x==null?void 0:x.type)==="area")&&(x.stack=!0),y[T.indicatorKey]={by:t,range:!0,sumBy:(x==null?void 0:x.stack)&&e.concat(x==null?void 0:x.yField)},x.series)x.series.forEach(M=>{var B,P,F,H,E,k,I,L,D,O,N,W,$,U;const Y=typeof M.yField=="string"?M.yField:M.yField[0];y[Y]={by:e,type:M.direction==="horizontal"?"yField":void 0,range:As(M,this._axes,M.direction==="horizontal",!1),sortBy:M.direction==="horizontal"?(H=(F=(P=(B=M==null?void 0:M.data)===null||B===void 0?void 0:B.fields)===null||P===void 0?void 0:P[Y])===null||F===void 0?void 0:F.domain)!==null&&H!==void 0?H:(I=(k=(E=x==null?void 0:x.data)===null||E===void 0?void 0:E.fields)===null||k===void 0?void 0:k[Y])===null||I===void 0?void 0:I.domain:void 0};const j=M.xField;M.stack!==!1&&(M.type==="bar"||M.type==="area")&&(M.stack=!0),y[j]={by:t,range:As(M,this._axes,M.direction==="horizontal",!0),sumBy:M.stack&&e.concat(M==null?void 0:M.yField),sortBy:M.direction!=="horizontal"?(N=(O=(D=(L=M==null?void 0:M.data)===null||L===void 0?void 0:L.fields)===null||D===void 0?void 0:D[j])===null||O===void 0?void 0:O.domain)!==null&&N!==void 0?N:(U=($=(W=x==null?void 0:x.data)===null||W===void 0?void 0:W.fields)===null||$===void 0?void 0:$[j])===null||U===void 0?void 0:U.domain:void 0,extendRange:Ac(x.markLine)}});else{const M=typeof x.yField=="string"?x.yField:x.yField[0];y[M]={by:e,type:x.direction==="horizontal"?"yField":void 0,range:As(x,this._axes,x.direction==="horizontal",!1),sortBy:x.direction==="horizontal"?(m=(p=(f=x==null?void 0:x.data)===null||f===void 0?void 0:f.fields)===null||p===void 0?void 0:p[M])===null||m===void 0?void 0:m.domain:void 0},(x==null?void 0:x.stack)!==!1&&((x==null?void 0:x.type)==="bar"||(x==null?void 0:x.type)==="area")&&(x.stack=!0);const B=x.xField;y[B]={by:t,range:As(x,this._axes,x.direction==="horizontal",!0),sumBy:x.stack&&e.concat(x==null?void 0:x.yField),sortBy:x.direction!=="horizontal"?(_=(C=(b=x==null?void 0:x.data)===null||b===void 0?void 0:b.fields)===null||C===void 0?void 0:C[B])===null||_===void 0?void 0:_.domain:void 0,extendRange:Ac(x.markLine)}}}}return y}_generateAggregationRules(){var t;const e=[];return(t=this.internalProps.indicators)===null||t===void 0||t.forEach(n=>{var o,r;if(typeof n=="string")e.push({indicatorKey:n,field:n,aggregationType:zt.RECORD});else if(!((o=n.chartSpec)===null||o===void 0)&&o.series){const s=[];(r=n.chartSpec)===null||r===void 0||r.series.forEach(l=>{const a=this.options.indicatorsAsCol===!1?l.yField:l.xField;s.indexOf(a)===-1&&s.push(a)}),e.push({indicatorKey:n.indicatorKey,field:s,aggregationType:zt.RECORD})}else{const s=this.options.indicatorsAsCol===!1?n.chartSpec.yField:n.chartSpec.xField;e.push({indicatorKey:n.indicatorKey,field:s??n.indicatorKey,aggregationType:zt.RECORD})}}),e}setCustomStateNameToSpec(){var t;const e=n=>{var o,r,s,l,a,h,d,u,c,g;!((r=(o=n.bar)===null||o===void 0?void 0:o.state)===null||r===void 0)&&r.selected&&(n.bar.state.vtable_selected=n.bar.state.selected,n.bar.state.vtable_selected_reverse=n.bar.state.selected_reverse,delete n.bar.state.selected,delete n.bar.state.selected_reverse),!((l=(s=n.point)===null||s===void 0?void 0:s.state)===null||l===void 0)&&l.selected&&(n.point.state.vtable_selected=n.point.state.selected,n.point.state.vtable_selected_reverse=n.point.state.selected_reverse,delete n.point.state.selected,delete n.point.state.selected_reverse),!((h=(a=n.line)===null||a===void 0?void 0:a.state)===null||h===void 0)&&h.selected&&(n.line.state.vtable_selected=n.line.state.selected,n.line.state.vtable_selected_reverse=n.line.state.selected_reverse,delete n.line.state.selected,delete n.line.state.selected_reverse),!((u=(d=n.area)===null||d===void 0?void 0:d.state)===null||u===void 0)&&u.selected&&(n.area.state.vtable_selected=n.area.state.selected,n.area.state.vtable_selected_reverse=n.area.state.selected_reverse,delete n.area.state.selected,delete n.area.state.selected_reverse),!((g=(c=n.pie)===null||c===void 0?void 0:c.state)===null||g===void 0)&&g.selected&&(n.pie.state.vtable_selected=n.pie.state.selected,n.pie.state.vtable_selected_reverse=n.pie.state.selected_reverse,delete n.pie.state.selected,delete n.pie.state.selected_reverse)};(t=this.internalProps.indicators)===null||t===void 0||t.forEach(n=>{if(n.chartSpec){const o=n.chartSpec;o.series?o.series.forEach(r=>{e(r)}):e(o)}})}updateFilterRules(t){this.internalProps.dataConfig.filterRules=t,this.dataset.updateFilterRules(t),Th(this.scenegraph),PN(this.scenegraph),this.render()}clearChartCacheImage(t,e){ft(t)&&ft(e)?BN(t,e,this.scenegraph):Th(this.scenegraph)}getLegendSelected(){var t;const e=[];return(t=this.internalProps.legends)===null||t===void 0||t.forEach(n=>{const o=n.legendComponent._getSelectedLegends().map(r=>r.label);e.push(...o)}),e}setLegendSelected(t){var e;(e=this.internalProps.legends)===null||e===void 0||e.forEach(n=>{n.legendComponent.setSelected(t)})}getChartDatumPosition(t,e){const{chartInstance:n,bounds:o}=this.getChartInstance(e);if(n){const r=n.convertDatumToPosition(t);return r?{x:Math.round(r.x+o.x1),y:Math.round(r.y+o.y1)}:null}return null}getCellAddressByRecord(t){const e=[],n=[],o={},r=[];this.dataset.dataConfig.aggregationRules.forEach(s=>{if(typeof s.field=="string")o[s.field]=s.indicatorKey,r.push(s.field);else for(let l=0;l<s.field.length;l++)o[s.field[l]]=s.indicatorKey,r.push(s.field[l])});for(const s in t)this.dataset.rows.indexOf(s)>=0&&e.push({dimensionKey:s,value:t[s]}),this.dataset.columns.indexOf(s)>=0&&n.push({dimensionKey:s,value:t[s]}),r.indexOf(s)>=0&&(this.dataset.indicatorsAsCol?n.push({indicatorKey:o[s]}):e.push({indicatorKey:o[s]}));return this.getCellAddressByHeaderPaths({rowHeaderPaths:e,colHeaderPaths:n,cellLocation:"body"})}getChartInstance(t){var e,n,o,r,s;const l=this.getCellAddressByHeaderPaths(t);if(l){const a=this.getCellRelativeRect(l.col,l.row),h=this.scenegraph.getCell(l.col,l.row);let d;const u=(e=h==null?void 0:h.getChildren())===null||e===void 0?void 0:e[0];if(u.attribute.chartInstance){d=u.attribute.chartInstance;const{dataId:c,data:g,axes:f,spec:p}=u.attribute,m=u.getViewBox();if(f==null||f.forEach((b,C)=>{var _,w,y,S;b.type==="linear"?d.updateModelSpecSync({type:"axes",index:C},{min:(w=(_=b.range)===null||_===void 0?void 0:_.min)!==null&&w!==void 0?w:0,max:(S=(y=b.range)===null||y===void 0?void 0:y.max)!==null&&S!==void 0?S:0},!0):b.type==="band"&&d.updateModelSpec({type:"axes",index:C},{domain:b.domain.slice(0)},!0)}),d.updateViewBox({x1:m.x1-u.getRootNode().table.scrollLeft,x2:m.x2-u.getRootNode().table.scrollLeft,y1:m.y1-u.getRootNode().table.scrollTop,y2:m.y2-u.getRootNode().table.scrollTop},!1,!1),typeof c=="string")d.updateDataSync(c,g??[]);else{const b=[];for(const C in c){const _=c[C],w=p.series.find(y=>{var S;return((S=y==null?void 0:y.data)===null||S===void 0?void 0:S.id)===C});b.push({id:C,values:_?(n=g==null?void 0:g.filter(y=>y.hasOwnProperty(_)))!==null&&n!==void 0?n:[]:g??[],fields:(o=w==null?void 0:w.data)===null||o===void 0?void 0:o.fields}),d.updateFullDataSync||d.updateDataSync(C,_?(r=g==null?void 0:g.filter(y=>y.hasOwnProperty(_)))!==null&&r!==void 0?r:[]:g??[])}(s=d.updateFullDataSync)===null||s===void 0||s.call(d,b)}this.renderAsync()}return{chartInstance:d,bounds:a.bounds}}return{}}_getDimensionSortArray(){var t,e;if(!((e=(t=this.options)===null||t===void 0?void 0:t.axes)===null||e===void 0)&&e.length){const n=this.options.indicatorsAsCol?"left":"bottom",o=this.options.axes.find(r=>r.orient===n);if(o&&lt(o.domain))return o.domain}}setRecords(t){var e,n;const o={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.options.records=this.internalProps.records=t;const r=this.options,s=this.internalProps;let l,a;this.dataset.setRecords(t),l=r.columnTree?s.layoutMap.columnDimensionTree:new Pe((e=this.dataset.colHeaderTree)!==null&&e!==void 0?e:[],this.layoutNodeId),a=r.rowTree?s.layoutMap.rowDimensionTree:new Pe((n=this.dataset.rowHeaderTree)!==null&&n!==void 0?n:[],this.layoutNodeId),s.layoutMap=new lr(this,this.dataset,l,a),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(o.col,o.row),this.internalProps.title&&!this.internalProps.title.isReleased&&(this._updateSize(),this.internalProps.title.resize(),this.scenegraph.resize()),this.eventManager.updateEventBinder()}_hasCustomRenderOrLayout(){if(this.options.customRender)return!0;const{columnsDefine:t,rowsDefine:e,indicatorsDefine:n}=this.internalProps.layoutMap;for(let o=0;o<t.length;o++){const r=t[o];if(typeof r!="string"&&(r.headerCustomLayout||r.headerCustomRender))return!0}for(let o=0;o<e.length;o++){const r=e[o];if(typeof r!="string"&&(r.headerCustomLayout||r.headerCustomRender))return!0}for(let o=0;o<n.length;o++){const r=n[o];if(typeof r!="string"&&(r.customLayout||r.headerCustomLayout||r.customRender||r.headerCustomRender))return!0}return!1}changeRecordOrder(t,e){}getLayoutColumnTree(){return this.internalProps.layoutMap.getLayoutColumnTree()}getLayoutColumnTreeCount(){return this.internalProps.layoutMap.getLayoutColumnTreeCount()}getLayoutRowTree(){return this.internalProps.layoutMap.getLayoutRowTree()}getLayoutRowTreeCount(){return this.internalProps.layoutMap.getLayoutRowTreeCount()}getCellHeaderTreeNodes(t,e){return this.internalProps.layoutMap.getCellHeaderPathsWithTreeNode(t,e)}};class V9 extends qp{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=lt(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}}class PT extends cn{constructor(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p;t.direction&&(t.flexDirection=t.direction),!t.justifyContent||t.justifyContent!=="start"&&t.justifyContent!=="end"||(t.justifyContent="flex-"+t.justifyContent),!t.alignItems||t.alignItems!=="start"&&t.alignItems!=="end"||(t.alignItems="flex-"+t.alignItems),!t.alignContent||t.alignContent!=="start"&&t.alignContent!=="end"||(t.alignContent="flex-"+t.alignContent),t.display="flex",t.flexDirection||(t.flexDirection="row"),t.clip=!0,t.fill=(e=t==null?void 0:t.background)===null||e===void 0?void 0:e.fill,t.stroke=(n=t==null?void 0:t.background)===null||n===void 0?void 0:n.stroke,t.lineWidth=(o=t==null?void 0:t.background)===null||o===void 0?void 0:o.lineWidth,t.cornerRadius=(r=t==null?void 0:t.background)===null||r===void 0?void 0:r.cornerRadius;const m=lt(t.boundsPadding),b=[(l=(s=t.marginTop)!==null&&s!==void 0?s:m?t.boundsPadding[0]:t.boundsPadding)!==null&&l!==void 0?l:0,(h=(a=t.marginRight)!==null&&a!==void 0?a:m?t.boundsPadding[1]:t.boundsPadding)!==null&&h!==void 0?h:0,(c=(d=t.marginBottom)!==null&&d!==void 0?d:m?(u=t.boundsPadding[2])!==null&&u!==void 0?u:t.boundsPadding[0]:t.boundsPadding)!==null&&c!==void 0?c:0,(p=(g=t.marginLeft)!==null&&g!==void 0?g:m?(f=t.boundsPadding[3])!==null&&f!==void 0?f:t.boundsPadding[1]:t.boundsPadding)!==null&&p!==void 0?p:0];t.boundsPadding=b,super(t)}}class j9 extends PT{constructor(t){t.flexWrap="nowrap",super(t)}}let $9=class extends Uo{constructor(t){var e,n,o,r,s,l,a,h,d,u,c,g;let f;ce(t.iconName)&&(f=vn()[t.iconName],f&&(t.width=(e=t.width)!==null&&e!==void 0?e:f.width,t.height=(n=t.height)!==null&&n!==void 0?n:f.height,t.svg=f.svg,t.cursor=f.cursor)),t.svg&&(t.image=t.svg);const p=lt(t.boundsPadding),m=[(r=(o=t.marginTop)!==null&&o!==void 0?o:p?t.boundsPadding[0]:t.boundsPadding)!==null&&r!==void 0?r:0,(l=(s=t.marginRight)!==null&&s!==void 0?s:p?t.boundsPadding[1]:t.boundsPadding)!==null&&l!==void 0?l:0,(d=(a=t.marginBottom)!==null&&a!==void 0?a:p?(h=t.boundsPadding[2])!==null&&h!==void 0?h:t.boundsPadding[0]:t.boundsPadding)!==null&&d!==void 0?d:0,(g=(u=t.marginLeft)!==null&&u!==void 0?u:p?(c=t.boundsPadding[3])!==null&&c!==void 0?c:t.boundsPadding[1]:t.boundsPadding)!==null&&g!==void 0?g:0];t.boundsPadding=m,super(t),this.cache=f}},G9=class extends Uo{constructor(t){var e,n,o,r,s,l,a,h,d,u;t.src&&(t.image=t.src),t.shape==="circle"&&(t.cornerRadius=t.width/2);const c=lt(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}};class U9 extends cu{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=lt(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}}class K9 extends Hi{constructor(t){var e,n,o,r,s,l,a,h,d,u,c;t.textBaseline||(t.textBaseline="top");const g=lt(t.boundsPadding),f=[(n=(e=t.marginTop)!==null&&e!==void 0?e:g?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:g?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:g?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:g?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=f,t.fill=(c=t.fill)!==null&&c!==void 0?c:"#000",super(t)}getSize(t){this.AABBBounds.width()}}function Y9(i,t=0){return{percent:i,delta:t}}class X9 extends fu{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=lt(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}}class q9 extends Va{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=lt(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}getSize(t){this.AABBBounds.width()}}class Z9 extends cn{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=lt(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}}const J9=Object.freeze(Object.defineProperty({__proto__:null,Arc:X9,CheckBox:Rr,Circle:V9,Container:PT,Group:Z9,GroupElement:j9,Icon:$9,Image:G9,Line:i0,Radio:Qa,Rect:U9,Tag:q9,Text:K9,percentCalc:Y9},Symbol.toStringTag,{value:"Module"}));function Q9(i){var t,e,n,o,r,s,l,a,h,d,u;const c={seqId:0},g={isPivotChart:!0};let f,p,m,b;i.columnTree&&(i.indicatorsAsCol!==!1&&(m=Vi(i.columnTree,i.indicators)),f=new Pe((t=i.columnTree)!==null&&t!==void 0?t:[],c)),i.rowTree&&(i.indicatorsAsCol===!1&&(b=Vi(i.rowTree,i.indicators)),p=new Pe((e=i.rowTree)!==null&&e!==void 0?e:[],c));const C=!((n=p.dimensionKeys)===null||n===void 0)&&n.count?p.dimensionKeys.valueArr():(r=(o=i.rows)===null||o===void 0?void 0:o.reduce((y,S)=>(typeof S=="string"?y.push(S):y.push(S.dimensionKey),y),[]))!==null&&r!==void 0?r:[],_=!((s=f.dimensionKeys)===null||s===void 0)&&s.count?f.dimensionKeys.valueArr():(a=(l=i.columns)===null||l===void 0?void 0:l.reduce((y,S)=>(typeof S=="string"?y.push(S):y.push(S.dimensionKey),y),[]))!==null&&a!==void 0?a:[],w=(d=(h=i.indicators)===null||h===void 0?void 0:h.reduce((y,S)=>(typeof S=="string"?y.push(S):y.push(S.indicatorKey),y),[]))!==null&&d!==void 0?d:[];return g.collectValuesBy=t7(i,_,C),g.aggregationRules=e7(i),{dataset:new Ih(g,C,_,w,i.indicators,(u=i.indicatorsAsCol)===null||u===void 0||u,i.records,void 0,m||i.columnTree,b||i.rowTree,!0),columnDimensionTree:f,rowDimensionTree:p,layoutNodeId:c}}function t7(i,t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,A,R,x;const T={};for(let M=0,B=(n=i.indicators)===null||n===void 0?void 0:n.length;M<B;M++)if(typeof i.indicators[M]!="string"&&i.indicators[M].chartSpec)if(i.indicatorsAsCol===!1){const P=i.indicators[M];if(T[P.indicatorKey]={by:e,range:!0,sumBy:((o=P.chartSpec)===null||o===void 0?void 0:o.stack)!==!1&&t.concat((r=P.chartSpec)===null||r===void 0?void 0:r.xField)},P.chartSpec.series)P.chartSpec.series.forEach(F=>{var H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht;const gt=typeof F.xField=="string"?F.xField:F.xField[0];T[gt]={by:t,type:F.direction!=="horizontal"?"xField":void 0,range:F.direction==="horizontal",sortBy:F.direction!=="horizontal"?(I=(k=(E=(H=F==null?void 0:F.data)===null||H===void 0?void 0:H.fields)===null||E===void 0?void 0:E[gt])===null||k===void 0?void 0:k.domain)!==null&&I!==void 0?I:(N=(O=(D=(L=P.chartSpec)===null||L===void 0?void 0:L.data)===null||D===void 0?void 0:D.fields)===null||O===void 0?void 0:O[gt])===null||N===void 0?void 0:N.domain:void 0};const Ct=F.yField;T[Ct]={by:e,range:F.direction!=="horizontal",sumBy:F.stack!==!1&&t.concat(F==null?void 0:F.xField),sortBy:F.direction==="horizontal"?(Y=(U=($=(W=F==null?void 0:F.data)===null||W===void 0?void 0:W.fields)===null||$===void 0?void 0:$[Ct])===null||U===void 0?void 0:U.domain)!==null&&Y!==void 0?Y:(ht=(X=(G=(j=P.chartSpec)===null||j===void 0?void 0:j.data)===null||G===void 0?void 0:G.fields)===null||X===void 0?void 0:X[Ct])===null||ht===void 0?void 0:ht.domain:void 0}});else{const F=typeof P.chartSpec.xField=="string"?P.chartSpec.xField:P.chartSpec.xField[0];T[F]={by:t,type:P.chartSpec.direction!=="horizontal"?"xField":void 0,range:P.chartSpec.direction==="horizontal",sortBy:P.chartSpec.direction!=="horizontal"?(h=(a=(l=(s=P.chartSpec)===null||s===void 0?void 0:s.data)===null||l===void 0?void 0:l.fields)===null||a===void 0?void 0:a[F])===null||h===void 0?void 0:h.domain:void 0};const H=P.chartSpec.yField;T[H]={by:e,range:i.indicators[M].chartSpec.direction!=="horizontal",sumBy:P.chartSpec.stack!==!1&&t.concat((d=P.chartSpec)===null||d===void 0?void 0:d.xField),sortBy:P.chartSpec.direction==="horizontal"?(f=(g=(c=(u=P.chartSpec)===null||u===void 0?void 0:u.data)===null||c===void 0?void 0:c.fields)===null||g===void 0?void 0:g[H])===null||f===void 0?void 0:f.domain:void 0}}}else{const P=i.indicators[M];if(T[P.indicatorKey]={by:t,range:!0,sumBy:((p=P.chartSpec)===null||p===void 0?void 0:p.stack)!==!1&&e.concat((m=P.chartSpec)===null||m===void 0?void 0:m.yField)},P.chartSpec.series)P.chartSpec.series.forEach(F=>{var H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht;const gt=typeof F.yField=="string"?F.yField:F.yField[0];T[gt]={by:e,type:F.direction==="horizontal"?"yField":void 0,range:F.direction!=="horizontal",sortBy:F.direction==="horizontal"?(I=(k=(E=(H=F==null?void 0:F.data)===null||H===void 0?void 0:H.fields)===null||E===void 0?void 0:E[gt])===null||k===void 0?void 0:k.domain)!==null&&I!==void 0?I:(N=(O=(D=(L=P.chartSpec)===null||L===void 0?void 0:L.data)===null||D===void 0?void 0:D.fields)===null||O===void 0?void 0:O[gt])===null||N===void 0?void 0:N.domain:void 0};const Ct=F.xField;T[Ct]={by:t,range:F.direction==="horizontal",sumBy:F.stack!==!1&&e.concat(F==null?void 0:F.yField),sortBy:F.direction!=="horizontal"?(Y=(U=($=(W=F==null?void 0:F.data)===null||W===void 0?void 0:W.fields)===null||$===void 0?void 0:$[Ct])===null||U===void 0?void 0:U.domain)!==null&&Y!==void 0?Y:(ht=(X=(G=(j=P.chartSpec)===null||j===void 0?void 0:j.data)===null||G===void 0?void 0:G.fields)===null||X===void 0?void 0:X[Ct])===null||ht===void 0?void 0:ht.domain:void 0}});else{const F=typeof P.chartSpec.yField=="string"?P.chartSpec.yField:P.chartSpec.yField[0];T[F]={by:e,type:P.chartSpec.direction==="horizontal"?"yField":void 0,range:P.chartSpec.direction!=="horizontal",sortBy:P.chartSpec.direction==="horizontal"?(w=(_=(C=(b=P.chartSpec)===null||b===void 0?void 0:b.data)===null||C===void 0?void 0:C.fields)===null||_===void 0?void 0:_[F])===null||w===void 0?void 0:w.domain:void 0};const H=P.chartSpec.xField;T[H]={by:t,range:i.indicators[M].chartSpec.direction==="horizontal",sumBy:P.chartSpec.stack!==!1&&e.concat((y=P.chartSpec)===null||y===void 0?void 0:y.yField),sortBy:P.chartSpec.direction!=="horizontal"?(x=(R=(A=(S=P.chartSpec)===null||S===void 0?void 0:S.data)===null||A===void 0?void 0:A.fields)===null||R===void 0?void 0:R[H])===null||x===void 0?void 0:x.domain:void 0}}}return T}function e7(i){var t;const e=[];return(t=i.indicators)===null||t===void 0||t.forEach(n=>{var o,r;if(typeof n=="string")e.push({indicatorKey:n,field:n,aggregationType:zt.RECORD});else if(!((o=n.chartSpec)===null||o===void 0)&&o.series){const s=[];(r=n.chartSpec)===null||r===void 0||r.series.forEach(l=>{const a=i.indicatorsAsCol===!1?l.yField:l.xField;s.indexOf(a)===-1&&s.push(a)}),e.push({indicatorKey:n.indicatorKey,field:s,aggregationType:zt.RECORD})}else{const s=i.indicatorsAsCol===!1?n.chartSpec.yField:n.chartSpec.xField;e.push({indicatorKey:n.indicatorKey,field:s??n.indicatorKey,aggregationType:zt.RECORD})}}),e}function i7(i,t,e){var n,o;const r=Q9(i);let s=r.columnDimensionTree,l=r.rowDimensionTree,a=!1,h=!1;i.columnTree&&i.indicatorsAsCol&&!s.dimensionKeys.contain(Xi)&&(a=!0),i.rowTree&&(i.indicatorsAsCol||l.dimensionKeys.contain(Xi)||(h=!0));const{dataset:d,layoutNodeId:u}=r,c={options:i,layoutNodeId:u,internalProps:i,isPivotChart:()=>!0,pivotChartAxes:[],_selectedDataItemsInChart:[],_getActiveChartInstance:()=>({updateState:()=>{}})};i.columnTree&&!a||(s=new Pe((n=d.colHeaderTree)!==null&&n!==void 0?n:[],u)),i.rowTree&&!h||(l=new Pe((o=d.rowHeaderTree)!==null&&o!==void 0?o:[],u));const g=new lr(c,d,s,l);for(let f=0;f<g.colCount;f++)for(let p=0;p<g.rowCount;p++){if(g.isHeader(f,p))continue;const m=g.getCellHeaderPaths(f,p),b=m.colHeaderPaths.map(y=>{var S;return(S=y.indicatorKey)!==null&&S!==void 0?S:y.value}),C=m.rowHeaderPaths.map(y=>{var S;return(S=y.indicatorKey)!==null&&S!==void 0?S:y.value}),_=d.getAggregator(g.indicatorsAsCol?C:C.slice(0,-1),g.indicatorsAsCol?b.slice(0,-1):b,g.getIndicatorKey(f,p)),w=n7(_.value?_.value():void 0,t,f,p,g,e);if(w)return w}}function n7(i,t,e,n,o,r){if(lt(i)){for(let s=0;s<i.length;s++)if(r?r(i[s],t):o7(i[s],t))return o.getCellHeaderPaths(e,n)}}function o7(i,t){return JSON.stringify(i)===JSON.stringify(t)}function r7(i){return new Va(i?i.attribute:{})}function s7(i){return new Rr(i?i.attribute:{})}function l7(i){return new Qa(i?i.attribute:{})}class a7{constructor(t,e){var n,o,r,s,l,a;this.willUpdateRow=!1,this.willUpdateCol=!1,this.table=t,this.rowCount=(n=e==null?void 0:e.rowCount)!==null&&n!==void 0?n:void 0,this.colCount=(o=e==null?void 0:e.colCount)!==null&&o!==void 0?o:void 0,this.animationDuration=(r=e==null?void 0:e.animationDuration)!==null&&r!==void 0?r:500,this.animationDelay=(s=e==null?void 0:e.animationDelay)!==null&&s!==void 0?s:1e3,this.animationEasing=(l=e==null?void 0:e.animationEasing)!==null&&l!==void 0?l:"linear",this.replaceScrollAction=(a=e==null?void 0:e.replaceScrollAction)!==null&&a!==void 0&&a,this.reset(),this.init()}init(){this.replaceScrollAction&&(this.table.disableScroll(),this.table.scenegraph.stage.addEventListener("wheel",this.onScrollEnd.bind(this)))}reset(){this.playing=!1,this.row=this.table.frozenRowCount,this.col=this.table.frozenColCount}onScrollEnd(t){this.rowCount?(t.deltaY>0?(this.row+=this.rowCount,this.row=Math.min(this.row,this.table.rowCount-this.table.frozenRowCount)):t.deltaY<0&&(this.row-=this.rowCount,this.row=Math.max(this.row,this.table.frozenRowCount)),this.table.scrollToRow(this.row,{duration:this.animationDuration,easing:this.animationEasing})):this.colCount&&(t.deltaX>0?(this.col+=this.colCount,this.col=Math.min(this.col,this.table.colCount-this.table.frozenColCount)):t.deltaX<0&&(this.col-=this.colCount,this.col=Math.max(this.col,this.table.frozenColCount)),this.table.scrollToCol(this.col,{duration:this.animationDuration,easing:this.animationEasing}))}play(){this.playing=!0,this.rowCount&&!this.willUpdateRow?this.updateRow():this.colCount&&!this.willUpdateCol&&this.updateCol()}pause(){this.playing=!1}updateRow(){if(!this.playing)return;let t=!0;this.table.scenegraph.proxy.screenTopRow!==this.row?(this.row=this.table.frozenRowCount,t=!1):this.row+=this.rowCount,this.table.scrollToRow(this.row,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateRow=!0,setTimeout(()=>{this.willUpdateRow=!1,this.updateRow()},this.animationDuration+this.animationDelay)}updateCol(){if(!this.playing)return;let t=!0;this.table.scenegraph.proxy.screenLeftCol!==this.col?(this.col=this.table.frozenColCount,t=!1):this.col+=this.colCount,this.table.scrollToCol(this.col,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateCol=!0,setTimeout(()=>{this.willUpdateCol=!1,this.updateCol()},this.animationDuration+this.animationDelay)}}class h7{constructor(t,e){this.table=t,this.options=e,this.registerStyle(),this.bindEvent()}registerStyle(){var t,e,n,o,r,s,l,a;this.table.registerCustomCellStyle("col-highlight",{bgColor:(e=(t=this.options)===null||t===void 0?void 0:t.colHighlightBGColor)!==null&&e!==void 0?e:"#82b2f5",color:(o=(n=this.options)===null||n===void 0?void 0:n.colHighlightColor)!==null&&o!==void 0?o:"#FFF"}),this.table.registerCustomCellStyle("row-highlight",{bgColor:(s=(r=this.options)===null||r===void 0?void 0:r.rowHighlightBGColor)!==null&&s!==void 0?s:"#82b2f5",color:(a=(l=this.options)===null||l===void 0?void 0:l.rowHighlightColor)!==null&&a!==void 0?a:"#FFF"})}bindEvent(){this.table.on("selected_cell",t=>{this.updateHighlight()}),this.table.on("selected_clear",()=>{this.clearHighlight()}),this.table.on("mousemove_table",()=>{this.table.stateManager.select.selecting&&this.updateHighlight()})}clearHighlight(){this.colHeaderRange&&this.table.arrangeCustomCellStyle({range:this.colHeaderRange},void 0),this.rowHeaderRange&&this.table.arrangeCustomCellStyle({range:this.rowHeaderRange},void 0),this.colHeaderRange=void 0,this.rowHeaderRange=void 0}updateHighlight(){var t,e,n,o;if(((t=this.options)===null||t===void 0?void 0:t.colHighlight)===!1&&((e=this.options)===null||e===void 0?void 0:e.rowHighlight)===!1)return;const r=this.table.getSelectedCellRanges();if(r.length===0)return void this.clearHighlight();const s=r[0],l=[s.start.row,s.end.row];l.sort((u,c)=>u-c);const a=[s.start.col,s.end.col];let h,d;a.sort((u,c)=>u-c),this.table.isPivotTable()?(h={start:{col:a[0],row:0},end:{col:a[1],row:this.table.columnHeaderLevelCount-1}},d={start:{col:0,row:l[0]},end:{col:this.table.rowHeaderLevelCount-1,row:l[1]}}):this.table.internalProps.transpose?d={start:{col:0,row:l[0]},end:{col:this.table.rowHeaderLevelCount-1,row:l[1]}}:(h={start:{col:a[0],row:0},end:{col:a[1],row:this.table.columnHeaderLevelCount-1}},this.table.internalProps.rowSeriesNumber&&(d={start:{col:0,row:l[0]},end:{col:0,row:l[1]}})),((n=this.options)===null||n===void 0?void 0:n.colHighlight)===!1||HT(this.colHeaderRange,h)||(this.colHeaderRange&&this.table.arrangeCustomCellStyle({range:this.colHeaderRange},void 0),h&&this.table.arrangeCustomCellStyle({range:h},"col-highlight"),this.colHeaderRange=h),((o=this.options)===null||o===void 0?void 0:o.rowHighlight)===!1||HT(this.rowHeaderRange,d)||(this.rowHeaderRange&&this.table.arrangeCustomCellStyle({range:this.rowHeaderRange},void 0),d&&this.table.arrangeCustomCellStyle({range:d},"row-highlight"),this.rowHeaderRange=d)}}function HT(i,t){return i===void 0&&t===void 0||i!==void 0&&t!==void 0&&i.start.col===t.start.col&&i.start.row===t.start.row&&i.end.col===t.end.col&&i.end.row===t.end.row}ix();const d7="1.11.1";function u7(){return vn()}function c7(){rT()}const g7=Object.freeze(Object.defineProperty({__proto__:null,CarouselAnimationPlugin:a7,CustomLayout:J9,DataStatistics:nV,EventTarget:th,HeaderHighlightPlugin:h7,InvertHighlightPlugin:Q6,ListTable:F9,ListTableSimple:I9,PIVOT_CHART_EVENT_TYPE:SA,PIVOT_TABLE_EVENT_TYPE:rr,PivotChart:N9,PivotTable:BT,PivotTableSimple:W9,TABLE_EVENT_TYPE:at,TYPES:jz,VArc:HI,VArea:EI,VCheckBox:s7,VCircle:LI,VGlyph:FI,VGroup:kI,VImage:II,VLine:DI,VPath:OI,VPolygon:zI,VRadio:l7,VRect:WI,VSymbol:NI,VTag:r7,VText:VI,clearGlobal:c7,core:K8,data:Q4,getDataCellPath:i7,getIcons:u7,getTargetCell:Hr,graphicUtil:B1,jsx:$I,onBeforeAttributeUpdateForInvertHighlight:fR,register:J8,registerAxis:Mg,registerChartCell:kg,registerCheckboxCell:Fg,registerEmptyTip:Bg,registerImageCell:Ig,registerLegend:Pg,registerMenu:Hg,registerProgressBarCell:Dg,registerRadioCell:Og,registerSparkLineCell:zg,registerTextCell:Il,registerTitle:Eg,registerTooltip:Lg,registerVideoCell:Wg,renderChart:Vm,restoreMeasureText:hW,setCustomAlphabetCharSet:aW,themes:j4,updateCell:_o,version:d7},Symbol.toStringTag,{value:"Module"})),zr=PB.create({baseURL:"/",validateStatus(i){return i===200},timeout:1e3*15});zr.interceptors.request.use(i=>i,i=>Promise.reject(i)),zr.interceptors.response.use(i=>{var t,e;return+((t=i==null?void 0:i.data)==null?void 0:t.code)==500&&ji.message.error({content:((e=i==null?void 0:i.data)==null?void 0:e.message)||"服务器异常",key:"SERVER_ERROR"}),i},i=>{if(i.message.includes("timeout"))ji.message.error({content:"网络连接超时,请重试!",key:"TIMEOUT"});else{const{status:t}=i.response;t===401?ji.message.error({content:"当前用户信息不正确",key:"REQUEST_ERROR"}):t>=500?ji.message.error({content:"服务器异常",key:"REQUEST_ERROR"}):ji.message.error({content:"请求异常",key:"REQUEST_ERROR"})}return Promise.reject(i)});var ET={},f7={get exports(){return ET},set exports(i){ET=i}};(function(i,t){(function(e,n){i.exports=n(Lo)})(sP,function(e){function n(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var o=n(e),r={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(s,l){return l==="W"?s+"周":s+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(s,l){var a=100*s+l;return a<600?"凌晨":a<900?"早上":a<1100?"上午":a<1300?"中午":a<1800?"下午":"晚上"}};return o.default.locale(r,null,!0),r})})(f7);const xX="",RX="",Ti=(i,t)=>{const e=i.__vccOpts||i;for(const[n,o]of t)e[n]=o;return e};Lo.locale("zh-cn");const p7=v.defineComponent({name:"PivotFilter",props:{data:{type:Object,default:()=>{}},customDimensions:{type:Array,default:()=>[]},dimensions:{type:Array,default:()=>[]},indicators:{type:Array,default:()=>[]}},setup(i,{emit:t,expose:e}){const n=v.ref(!1),o=v.ref(!1),r=v.ref(!1),s=v.ref([]),l=v.ref(""),a=v.ref(),h=v.ref(""),d=v.ref([]),u=v.ref(),c=v.ref("range"),g=v.ref(),f=v.ref({}),p=v.ref(),m=v.ref({}),b=v.inject("getContainer",()=>{}),C=v.inject("scaleValue",{}),_=v.inject("theme","light"),w=v.inject("pageId",""),y=v.inject("context",""),S=v.inject("indicatorUrl",""),A=v.inject("indicatorToken",""),R=v.inject("graphicConfig",{}),x=v.inject("theDateInfo",{}),T=[{label:"小于",value:"LESS"},{label:"小于等于",value:"LESS_EQUAL"},{label:"大于",value:"GREATER"},{label:"大于等于",value:"GREATER_EQUAL"},{label:"等于",value:"EQUAL"},{label:"不等于",value:"NOT_EQUAL"}],M=[{label:"单个日期",value:"date"},{label:"日期范围",value:"range"}],B=j=>{r.value=!1,s.value=j.target.checked?v.unref(d).map(G=>G.value):[]};v.watch(s,j=>{o.value=j.length===v.unref(d).length,r.value=!!j.length&&j.length<v.unref(d).length});const P=async j=>{const{queryColumnList:G=[],edvDataSetId:X="",source:ht,dataSourceId:gt}=v.unref(R);let Ct=G.find(st=>st.name===j||st.label===j);Ct||(Ct=i.customDimensions.find(st=>st.name===j||st.label===j));const Q={},{search:et}=(window==null?void 0:window.location)||{},bt=et.slice(1,et.length).split("&");for(const st of bt)if(st){const _t=st.split("=");_t[0]&&(Q[_t[0]]=_t[1])}const dt=await zr.post(`${v.unref(S)}/diagram/groupvalue`,{source:ht,groupColumn:j,hrpIndexTypeGuid:Ct==null?void 0:Ct.typeGuid,pageId:v.unref(w),pageFlag:!0,edvDataSetId:X,dataSourceId:gt,extParam:Q},{headers:{Authentication:v.unref(A),operateContext:v.unref(y)}}),{success:ot,data:ut=[]}=dt.data;ot&&(d.value=ut.map(st=>({value:st})))},F=v.ref("");async function H(){const{filterData:j,type:G,key:X}=i.data,gt=i.dimensions.concat(i.indicators).find(Ct=>Ct.label===X);gt&&(F.value=gt.genericType),v.unref(F)==="DATE"?u.value="date":u.value="select",G==="dimension"?v.unref(u)==="select"?(await P(X),Array.isArray(j)?s.value=j:s.value=(j==null?void 0:j.value)||[]):v.unref(u)==="date"&&(j==null?void 0:j.length)===2&&(a.value=[Lo(j[0].value),Lo(j[1].value)]):(l.value=(j==null?void 0:j.rule)||"",a.value=(j==null?void 0:j.value)||""),n.value=!0}const E=v.computed(()=>v.unref(x).dateFormat||"YYYY-MM-DD");function k(){var ht;const{key:j,type:G}=i.data;let X={};G==="dimension"?v.unref(u)==="select"?X={rule:"IN",value:v.unref(s)}:v.unref(u)==="date"&&(v.unref(c)==="date"?X={rule:"EQUAL",value:((ht=v.unref(a))==null?void 0:ht.format(v.unref(E)))||""}:v.unref(c)==="range"&&v.unref(a)&&(X=[{rule:"GREATER_EQUAL",value:v.unref(a)[0].format(v.unref(E))},{rule:"LESS_EQUAL",value:v.unref(a)[1].format(v.unref(E))}])):X={rule:v.unref(l),value:v.unref(a)},t("change",{checkKeys:X,key:j,type:G}),n.value=!1}function I(){l.value="",a.value=null}const L=v.computed(()=>v.unref(_)==="darkBlue"?"#b2c3dd":""),D=()=>document.getElementsByClassName("filter-modal")[0]||document.body,O=j=>{var G,X,ht;if(j){const gt=(G=v.unref(g))==null?void 0:G.getBoundingClientRect();if(gt){const Ct=gt.left/(((X=v.unref(C))==null?void 0:X.widthScale)||1)+"px",Q=(gt.top+gt.height)/(((ht=v.unref(C))==null?void 0:ht.heightScale)||1)+"px";setTimeout(()=>{var bt,dt;const et=document.querySelectorAll(".ant-select-dropdown"),vt=Array.from(et).filter(ot=>window.getComputedStyle(ot).display!=="none");if(vt!=null&&vt.length){const ot=document.getElementsByClassName("filter-modal")[0];vt[0].classList.add("filter-select-dropdown"),(bt=ot==null?void 0:ot.style)==null||bt.setProperty("--drop-down-left",Ct),(dt=ot==null?void 0:ot.style)==null||dt.setProperty("--drop-down-top",Q),f.value={visibility:"visible"}}},200)}}else f.value={}},N=j=>{var G,X,ht;if(j){const gt=(G=v.unref(p))==null?void 0:G.getBoundingClientRect();if(gt){const Ct=gt.left/(((X=v.unref(C))==null?void 0:X.widthScale)||1)+"px",Q=(gt.top+gt.height)/(((ht=v.unref(C))==null?void 0:ht.heightScale)||1)+"px";setTimeout(()=>{var bt,dt;const et=document.querySelectorAll(".ecan-range-picker-dropdown"),vt=Array.from(et).filter(ot=>window.getComputedStyle(ot).display!=="none");if(vt!=null&&vt.length){const ot=document.getElementsByClassName("filter-modal")[0];vt[0].classList.add("filter-range-picker-dropdown"),(bt=ot==null?void 0:ot.style)==null||bt.setProperty("--range-picker-dropdown-left",Ct),(dt=ot==null?void 0:ot.style)==null||dt.setProperty("--range-picker-dropdown-top",Q),m.value={visibility:"visible"}}},200)}}else m.value={}},W=v.computed(()=>{let j="270px";return v.unref(u)==="date"&&(j=""),{padding:"10px",height:j,maxHeight:"280px"}}),$=()=>{a.value=null};v.watch(n,j=>{window.modalShow&&window.modalShow(j)});const U=v.computed(()=>{let j="date";return v.unref(E).endsWith("MM")?j="month":v.unref(E).endsWith("YYYY")&&(j="year"),j}),Y=j=>{const{startTime:G,endTime:X,rangeFormat:ht}=v.unref(x);if(G&&X){let gt="day";return ht.endsWith("MM")?gt="month":ht.endsWith("YYYY")&&(gt="year"),j&&gt&&(j<Lo(G).startOf(gt)||j>Lo(X).endOf(gt))}else return!1};return e({showModal:H}),{visible:n,checkAllDimensions:o,dimIndeterminate:r,dimensionCheckKeys:s,ruleValue:l,ruleOptions:T,filterValue:a,searchDimName:h,fontColor:L,valueList:d,filterType:u,dateSelectType:c,bodyStyle:W,dateType:U,dateSelectOptions:M,formatStr:E,theme:_,handleOk:k,onCheckAllDimChange:B,handleClear:I,dropdownStyle:f,popupStyle:m,selectRef:g,rangePickerRef:p,getPopupContainer:D,onChangeSelectType:$,disabledDate:Y,getContainer:b,dropdownVisibleChange:O,openChange:N}}}),m7={class:"wrap-header"},v7={class:"wrap-body"},b7={style:{padding:"20px",display:"none"}},C7={ref:"selectRef",style:{display:"inline-block"}},y7={style:{padding:"10px 20px"}},_7={key:0,class:"ecan-date-picker"},w7={key:1,class:"ecan-range-picker",style:{display:"inline-block"},ref:"rangePickerRef"},S7={key:1},x7={style:{padding:"20px"}},R7={ref:"selectRef",style:{display:"inline-block"}},A7={style:{padding:"10px 20px"}};function T7(i,t,e,n,o,r){var p;const s=v.resolveComponent("a-checkbox"),l=v.resolveComponent("a-input"),a=v.resolveComponent("a-checkbox-group"),h=v.resolveComponent("a-select-option"),d=v.resolveComponent("a-select"),u=v.resolveComponent("a-date-picker"),c=v.resolveComponent("a-range-picker"),g=v.resolveComponent("a-button"),f=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(f,{wrapClassName:i.theme+" filter-modal",visible:i.visible,"onUpdate:visible":t[9]||(t[9]=m=>i.visible=m),title:((p=i.data)==null?void 0:p.fieldName)+"-筛选","ok-text":"确认","cancel-text":"取消",bodyStyle:i.bodyStyle,getContainer:i.getContainer,onOk:i.handleOk},{footer:v.withCtx(()=>[v.createVNode(g,{onClick:t[8]||(t[8]=m=>i.visible=!1)},{default:v.withCtx(()=>t[10]||(t[10]=[v.createTextVNode("取消")])),_:1}),i.data.type==="indicators"?(v.openBlock(),v.createBlock(g,{key:0,onClick:i.handleClear},{default:v.withCtx(()=>t[11]||(t[11]=[v.createTextVNode("清除筛选")])),_:1},8,["onClick"])):v.createCommentVNode("",!0),v.createVNode(g,{type:"primary",onClick:i.handleOk},{default:v.withCtx(()=>t[12]||(t[12]=[v.createTextVNode("确定")])),_:1},8,["onClick"])]),default:v.withCtx(()=>[i.data.type==="dimension"?(v.openBlock(),v.createElementBlock("div",{key:0,class:v.normalizeClass(["dimension-wrap",i.filterType==="select"?"border":""])},[i.filterType==="select"?(v.openBlock(),v.createElementBlock(v.Fragment,{key:0},[v.createElementVNode("div",m7,[v.createVNode(s,{checked:i.checkAllDimensions,"onUpdate:checked":t[0]||(t[0]=m=>i.checkAllDimensions=m),indeterminate:i.dimIndeterminate,disabled:!!i.searchDimName,onChange:i.onCheckAllDimChange},{default:v.withCtx(()=>[v.createElementVNode("span",{style:v.normalizeStyle({color:i.fontColor})},"全选",4)]),_:1},8,["checked","indeterminate","disabled","onChange"]),v.createVNode(l,{value:i.searchDimName,"onUpdate:value":t[1]||(t[1]=m=>i.searchDimName=m),placeholder:"请输入关键字搜索",style:{width:"200px","margin-left":"15px"}},null,8,["value"])]),v.createElementVNode("div",v7,[v.createVNode(a,{value:i.dimensionCheckKeys,"onUpdate:value":t[2]||(t[2]=m=>i.dimensionCheckKeys=m),style:{width:"100%"}},{default:v.withCtx(()=>[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.valueList||[],(m,b)=>v.withDirectives((v.openBlock(),v.createElementBlock("div",{class:"body-item",key:b},[v.createVNode(s,{value:m.value},{default:v.withCtx(()=>[v.createElementVNode("span",{style:v.normalizeStyle({color:i.fontColor})},v.toDisplayString(m.value),5)]),_:2},1032,["value"])])),[[v.vShow,!i.searchDimName||m.value.includes(i.searchDimName)]])),128))]),_:1},8,["value"])])],64)):i.filterType==="date"?(v.openBlock(),v.createElementBlock(v.Fragment,{key:1},[v.createElementVNode("div",b7,[v.createElementVNode("span",{class:"filter-label",style:v.normalizeStyle({color:i.fontColor})},"筛选类型:",4),v.createElementVNode("div",C7,[v.createVNode(d,{value:i.dateSelectType,"onUpdate:value":t[3]||(t[3]=m=>i.dateSelectType=m),style:{width:"200px"},placeholder:"请选择",dropdownClassName:"pivot-table-select-dropdown",getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:i.dropdownVisibleChange,onChange:i.onChangeSelectType},{default:v.withCtx(()=>[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.dateSelectOptions,m=>(v.openBlock(),v.createBlock(h,{key:m.value,value:m.value},{default:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(m.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value","getPopupContainer","dropdownStyle","onDropdownVisibleChange","onChange"])],512)]),v.createElementVNode("div",y7,[v.createElementVNode("span",{class:"filter-label",style:v.normalizeStyle({color:i.fontColor})},"筛选值:",4),i.dateSelectType==="date"?(v.openBlock(),v.createElementBlock("span",_7,[v.createVNode(u,{dropdownClassName:"ecan-date-picker-dropdown",value:i.filterValue,"onUpdate:value":t[4]||(t[4]=m=>i.filterValue=m),picker:i.dateType,format:i.formatStr,getPopupContainer:i.getPopupContainer},null,8,["value","picker","format","getPopupContainer"])])):i.dateSelectType==="range"?(v.openBlock(),v.createElementBlock("div",w7,[v.createVNode(c,{dropdownClassName:"ecan-range-picker-dropdown",value:i.filterValue,"onUpdate:value":t[5]||(t[5]=m=>i.filterValue=m),picker:i.dateType,format:i.formatStr,"disabled-date":i.disabledDate,getPopupContainer:i.getPopupContainer,popupStyle:i.popupStyle,onOpenChange:i.openChange},null,8,["value","picker","format","disabled-date","getPopupContainer","popupStyle","onOpenChange"])],512)):v.createCommentVNode("",!0)])],64)):v.createCommentVNode("",!0)],2)):i.data.type==="indicators"?(v.openBlock(),v.createElementBlock("div",S7,[v.createElementVNode("div",x7,[v.createElementVNode("span",{class:"filter-label",style:v.normalizeStyle({color:i.fontColor})},"筛选规则:",4),v.createElementVNode("div",R7,[v.createVNode(d,{value:i.ruleValue,"onUpdate:value":t[6]||(t[6]=m=>i.ruleValue=m),style:{width:"200px"},placeholder:"请选择",dropdownClassName:"pivot-table-select-dropdown",getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:i.dropdownVisibleChange},{default:v.withCtx(()=>[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.ruleOptions,m=>(v.openBlock(),v.createBlock(h,{key:m.value,value:m.value},{default:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(m.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value","getPopupContainer","dropdownStyle","onDropdownVisibleChange"])],512)]),v.createElementVNode("div",A7,[v.createElementVNode("span",{class:"filter-label",style:v.normalizeStyle({color:i.fontColor})},"筛选值:",4),v.createVNode(l,{value:i.filterValue,"onUpdate:value":t[7]||(t[7]=m=>i.filterValue=m),placeholder:"请输入",style:{width:"200px"}},null,8,["value"])])])):v.createCommentVNode("",!0)]),_:1},8,["wrapClassName","visible","title","bodyStyle","getContainer","onOk"])}const LT=Ti(p7,[["render",T7],["__scopeId","data-v-09adb33c"]]),AX="",M7=v.defineComponent({name:"PivotProperty",props:{},setup(i,{emit:t,expose:e}){const n=v.ref(!1),o=v.ref({unit:"",format:"",floatLength:""}),r=v.ref(),s=v.ref({}),l=v.inject("theme","light"),a=v.inject("scaleValue",{}),h=v.inject("getContainer",()=>{}),d=[{label:"整数",value:"integer"},{label:"小数",value:"float"},{label:"百分比",value:"percent"}];function u(p){o.value=p,n.value=!0}function c(){t("change",v.unref(o)),n.value=!1}const g=()=>document.getElementsByClassName("property-modal")[0]||document.body,f=p=>{var m,b,C;if(p){const _=(m=v.unref(r))==null?void 0:m.getBoundingClientRect();if(_){const w=_.left/(((b=v.unref(a))==null?void 0:b.widthScale)||1)+"px",y=(_.top+_.height)/(((C=v.unref(a))==null?void 0:C.heightScale)||1)+"px";setTimeout(()=>{var R,x;const S=document.querySelectorAll(".ant-select-dropdown"),A=Array.from(S).filter(T=>window.getComputedStyle(T).display!=="none");if(A!=null&&A.length){const T=document.getElementsByClassName("property-modal")[0];A[0].classList.add("property-select-dropdown"),(R=T==null?void 0:T.style)==null||R.setProperty("--drop-down-left",w),(x=T==null?void 0:T.style)==null||x.setProperty("--drop-down-top",y),s.value={visibility:"visible"}}},200)}}else s.value={}};return v.watch(n,p=>{window.modalShow&&window.modalShow(p)}),e({showModal:u}),{theme:l,visible:n,formData:o,handleOk:c,getPopupContainer:g,formatOptions:d,getContainer:h,selectRef:r,dropdownStyle:s,dropdownVisibleChange:f}}}),B7={ref:"selectRef"};function P7(i,t,e,n,o,r){const s=v.resolveComponent("a-input"),l=v.resolveComponent("a-form-item"),a=v.resolveComponent("a-radio-button"),h=v.resolveComponent("a-radio-group"),d=v.resolveComponent("a-select"),u=v.resolveComponent("a-form"),c=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(c,{wrapClassName:i.theme+" property-modal",visible:i.visible,"onUpdate:visible":t[4]||(t[4]=g=>i.visible=g),"ok-text":"确认","cancel-text":"取消",title:i.formData.fieldName+"-度量属性",destroyOnClose:!1,getContainer:i.getContainer,onOk:i.handleOk},{default:v.withCtx(()=>[v.createVNode(u,null,{default:v.withCtx(()=>[v.createVNode(l,{label:"度量单位"},{default:v.withCtx(()=>[v.createVNode(s,{value:i.formData.unit,"onUpdate:value":t[0]||(t[0]=g=>i.formData.unit=g)},null,8,["value"])]),_:1}),i.formData.unit?(v.openBlock(),v.createBlock(l,{key:0,label:"度量单位位置"},{default:v.withCtx(()=>[v.createVNode(h,{value:i.formData.position,"onUpdate:value":t[1]||(t[1]=g=>i.formData.position=g),"button-style":"solid"},{default:v.withCtx(()=>[v.createVNode(a,{value:"left"},{default:v.withCtx(()=>t[5]||(t[5]=[v.createTextVNode("数据左侧")])),_:1}),v.createVNode(a,{value:"right"},{default:v.withCtx(()=>t[6]||(t[6]=[v.createTextVNode("数据右侧")])),_:1})]),_:1},8,["value"])]),_:1})):v.createCommentVNode("",!0),v.createVNode(l,{label:"格式化"},{default:v.withCtx(()=>[v.createElementVNode("div",B7,[v.createVNode(d,{value:i.formData.format,"onUpdate:value":t[2]||(t[2]=g=>i.formData.format=g),options:i.formatOptions,getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:i.dropdownVisibleChange},null,8,["value","options","getPopupContainer","dropdownStyle","onDropdownVisibleChange"])],512)]),_:1}),["float","percent"].includes(i.formData.format)?(v.openBlock(),v.createBlock(l,{key:1,label:"小数位数"},{default:v.withCtx(()=>[v.createVNode(s,{type:"number",value:i.formData.floatLength,"onUpdate:value":t[3]||(t[3]=g=>i.formData.floatLength=g),min:0},null,8,["value"])]),_:1})):v.createCommentVNode("",!0)]),_:1})]),_:1},8,["wrapClassName","visible","title","getContainer","onOk"])}const H7=Ti(M7,[["render",P7]]);function Vn(i,t){E7(i)&&(i="100%");var e=L7(i);return i=t===360?i:Math.min(t,Math.max(0,parseFloat(i))),e&&(i=parseInt(String(i*t),10)/100),Math.abs(i-t)<1e-6?1:(t===360?i=(i<0?i%t+t:i%t)/parseFloat(String(t)):i=i%t/parseFloat(String(t)),i)}function E7(i){return typeof i=="string"&&i.indexOf(".")!==-1&&parseFloat(i)===1}function L7(i){return typeof i=="string"&&i.indexOf("%")!==-1}function k7(i){return i=parseFloat(i),(isNaN(i)||i<0||i>1)&&(i=1),i}function Ng(i){return i<=1?"".concat(Number(i)*100,"%"):i}function mv(i){return i.length===1?"0"+i:String(i)}function F7(i,t,e){return{r:Vn(i,255)*255,g:Vn(t,255)*255,b:Vn(e,255)*255}}function vv(i,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?i+(t-i)*(6*e):e<1/2?t:e<2/3?i+(t-i)*(2/3-e)*6:i}function I7(i,t,e){var n,o,r;if(i=Vn(i,360),t=Vn(t,100),e=Vn(e,100),t===0)o=e,r=e,n=e;else{var s=e<.5?e*(1+t):e+t-e*t,l=2*e-s;n=vv(l,s,i+1/3),o=vv(l,s,i),r=vv(l,s,i-1/3)}return{r:n*255,g:o*255,b:r*255}}function D7(i,t,e){i=Vn(i,255),t=Vn(t,255),e=Vn(e,255);var n=Math.max(i,t,e),o=Math.min(i,t,e),r=0,s=n,l=n-o,a=n===0?0:l/n;if(n===o)r=0;else{switch(n){case i:r=(t-e)/l+(t<e?6:0);break;case t:r=(e-i)/l+2;break;case e:r=(i-t)/l+4;break}r/=6}return{h:r,s:a,v:s}}function O7(i,t,e){i=Vn(i,360)*6,t=Vn(t,100),e=Vn(e,100);var n=Math.floor(i),o=i-n,r=e*(1-t),s=e*(1-o*t),l=e*(1-(1-o)*t),a=n%6,h=[e,s,r,r,l,e][a],d=[l,e,e,s,r,r][a],u=[r,r,l,e,e,s][a];return{r:h*255,g:d*255,b:u*255}}function z7(i,t,e,n){var o=[mv(Math.round(i).toString(16)),mv(Math.round(t).toString(16)),mv(Math.round(e).toString(16))];return n&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function kT(i){return _n(i)/255}function _n(i){return parseInt(i,16)}var FT={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Dh(i){var t={r:0,g:0,b:0},e=1,n=null,o=null,r=null,s=!1,l=!1;return typeof i=="string"&&(i=V7(i)),typeof i=="object"&&(ar(i.r)&&ar(i.g)&&ar(i.b)?(t=F7(i.r,i.g,i.b),s=!0,l=String(i.r).substr(-1)==="%"?"prgb":"rgb"):ar(i.h)&&ar(i.s)&&ar(i.v)?(n=Ng(i.s),o=Ng(i.v),t=O7(i.h,n,o),s=!0,l="hsv"):ar(i.h)&&ar(i.s)&&ar(i.l)&&(n=Ng(i.s),r=Ng(i.l),t=I7(i.h,n,r),s=!0,l="hsl"),Object.prototype.hasOwnProperty.call(i,"a")&&(e=i.a)),e=k7(e),{ok:s,format:i.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:e}}var W7="[-\\+]?\\d+%?",N7="[-\\+]?\\d*\\.\\d+%?",Wr="(?:".concat(N7,")|(?:").concat(W7,")"),bv="[\\s|\\(]+(".concat(Wr,")[,|\\s]+(").concat(Wr,")[,|\\s]+(").concat(Wr,")\\s*\\)?"),Cv="[\\s|\\(]+(".concat(Wr,")[,|\\s]+(").concat(Wr,")[,|\\s]+(").concat(Wr,")[,|\\s]+(").concat(Wr,")\\s*\\)?"),co={CSS_UNIT:new RegExp(Wr),rgb:new RegExp("rgb"+bv),rgba:new RegExp("rgba"+Cv),hsl:new RegExp("hsl"+bv),hsla:new RegExp("hsla"+Cv),hsv:new RegExp("hsv"+bv),hsva:new RegExp("hsva"+Cv),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function V7(i){if(i=i.trim().toLowerCase(),i.length===0)return!1;var t=!1;if(FT[i])i=FT[i],t=!0;else if(i==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var e=co.rgb.exec(i);return e?{r:e[1],g:e[2],b:e[3]}:(e=co.rgba.exec(i),e?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=co.hsl.exec(i),e?{h:e[1],s:e[2],l:e[3]}:(e=co.hsla.exec(i),e?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=co.hsv.exec(i),e?{h:e[1],s:e[2],v:e[3]}:(e=co.hsva.exec(i),e?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=co.hex8.exec(i),e?{r:_n(e[1]),g:_n(e[2]),b:_n(e[3]),a:kT(e[4]),format:t?"name":"hex8"}:(e=co.hex6.exec(i),e?{r:_n(e[1]),g:_n(e[2]),b:_n(e[3]),format:t?"name":"hex"}:(e=co.hex4.exec(i),e?{r:_n(e[1]+e[1]),g:_n(e[2]+e[2]),b:_n(e[3]+e[3]),a:kT(e[4]+e[4]),format:t?"name":"hex8"}:(e=co.hex3.exec(i),e?{r:_n(e[1]+e[1]),g:_n(e[2]+e[2]),b:_n(e[3]+e[3]),format:t?"name":"hex"}:!1)))))))))}function ar(i){return!!co.CSS_UNIT.exec(String(i))}var Vg=2,IT=.16,j7=.05,$7=.05,G7=.15,DT=5,OT=4,U7=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function zT(i){var t=i.r,e=i.g,n=i.b,o=D7(t,e,n);return{h:o.h*360,s:o.s,v:o.v}}function jg(i){var t=i.r,e=i.g,n=i.b;return"#".concat(z7(t,e,n,!1))}function K7(i,t,e){var n=e/100,o={r:(t.r-i.r)*n+i.r,g:(t.g-i.g)*n+i.g,b:(t.b-i.b)*n+i.b};return o}function WT(i,t,e){var n;return Math.round(i.h)>=60&&Math.round(i.h)<=240?n=e?Math.round(i.h)-Vg*t:Math.round(i.h)+Vg*t:n=e?Math.round(i.h)+Vg*t:Math.round(i.h)-Vg*t,n<0?n+=360:n>=360&&(n-=360),n}function NT(i,t,e){if(i.h===0&&i.s===0)return i.s;var n;return e?n=i.s-IT*t:t===OT?n=i.s+IT:n=i.s+j7*t,n>1&&(n=1),e&&t===DT&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2))}function VT(i,t,e){var n;return e?n=i.v+$7*t:n=i.v-G7*t,n>1&&(n=1),Number(n.toFixed(2))}function yv(i){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=[],n=Dh(i),o=DT;o>0;o-=1){var r=zT(n),s=jg(Dh({h:WT(r,o,!0),s:NT(r,o,!0),v:VT(r,o,!0)}));e.push(s)}e.push(jg(n));for(var l=1;l<=OT;l+=1){var a=zT(n),h=jg(Dh({h:WT(a,l),s:NT(a,l),v:VT(a,l)}));e.push(h)}return t.theme==="dark"?U7.map(function(d){var u=d.index,c=d.opacity,g=jg(K7(Dh(t.backgroundColor||"#141414"),Dh(e[u]),c*100));return g}):e}var _v={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},wv={},Sv={};Object.keys(_v).forEach(function(i){wv[i]=yv(_v[i]),wv[i].primary=wv[i][5],Sv[i]=yv(_v[i],{theme:"dark",backgroundColor:"#141414"}),Sv[i].primary=Sv[i][5]});var jT=[],Oh=[],Y7="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function X7(){var i=document.createElement("style");return i.setAttribute("type","text/css"),i}function q7(i,t){if(t=t||{},i===void 0)throw new Error(Y7);var e=t.prepend===!0?"prepend":"append",n=t.container!==void 0?t.container:document.querySelector("head"),o=jT.indexOf(n);o===-1&&(o=jT.push(n)-1,Oh[o]={});var r;return Oh[o]!==void 0&&Oh[o][e]!==void 0?r=Oh[o][e]:(r=Oh[o][e]=X7(),e==="prepend"?n.insertBefore(r,n.childNodes[0]):n.appendChild(r)),i.charCodeAt(0)===65279&&(i=i.substr(1,i.length)),r.styleSheet?r.styleSheet.cssText+=i:r.textContent+=i,r}function $T(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){Z7(i,o,e[o])})}return i}function Z7(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}function J7(i,t){process.env.NODE_ENV!=="production"&&!i&&console!==void 0&&console.error("Warning: ".concat(t))}function Q7(i,t){J7(i,"[@ant-design/icons-vue] ".concat(t))}function GT(i){return typeof i=="object"&&typeof i.name=="string"&&typeof i.theme=="string"&&(typeof i.icon=="object"||typeof i.icon=="function")}function xv(i,t,e){return e?v.h(i.tag,$T({key:t},e,i.attrs),(i.children||[]).map(function(n,o){return xv(n,"".concat(t,"-").concat(i.tag,"-").concat(o))})):v.h(i.tag,$T({key:t},i.attrs),(i.children||[]).map(function(n,o){return xv(n,"".concat(t,"-").concat(i.tag,"-").concat(o))}))}function UT(i){return yv(i)[0]}function KT(i){return i?Array.isArray(i)?i:[i]:[]}var tj=`
309
+ ${h}`:h,referencePosition:{placement:tn.bottom,rect:d},disappearDelay:(r=l.internalProps.tooltip.overflowTextTooltipDisappearDelay)!==null&&r!==void 0?r:0,style:l.theme.tooltipStyle})}s?this._bindToCell(t,e,s):this._unbindFromCell()}_getTooltipInstanceInfo(t,e){const n=this._table,o=this._tooltipInstances;return o&&o["bubble-tooltip"]||o&&(o["bubble-tooltip"]=f9["bubble-tooltip"](n))}isBinded(t){var e;return JSON.stringify(t)===JSON.stringify((e=this._attachInfo)===null||e===void 0?void 0:e.tooltipOptions)}}const Mg=()=>{Bt.registerComponent("axis",WV),Bt.registerFunction("computeAxisComponentWidth",jV),Bt.registerFunction("computeAxisComponentHeight",$V),Bt.registerFunction("getAxisConfigInPivotChart",I8)},Bg=()=>{Bt.registerComponent("emptyTip",UV)},Pg=()=>{Bt.registerFunction("createLegend",i9)},Hg=()=>{Bt.registerComponent("menuHandler",a9)},Eg=()=>{Bt.registerComponent("title",h9)},Lg=()=>{Bt.registerComponent("tooltipHandler",p9)};class m9{constructor(t){this.titleRows=[],this.showedTitleRows=[],this.rowNow=-1,this.skipStartRow=-1,this.skipEndRow=-1,this.table=t,this.table.on("scroll",e=>{e.scrollDirection==="vertical"&&this.updateGroupTitle()}),this.table.on("resize_column",e=>{this.updateGroupTitle()})}updateGroupTitle(){this.table.scrollTop===0?(this.titleRows=[],this.showedTitleRows=[]):this.skipStartRow!==-1&&this.skipEndRow!==-1&&this.skipStartRow!==this.table.scenegraph.proxy.bodyTopRow-1?(this.table.scenegraph.proxy.screenTopRow<=this.skipStartRow||this.table.scenegraph.proxy.screenTopRow>=this.skipEndRow)&&(this.skipStartRow=-1,this.skipEndRow=-1,this.updateGroupTitleInfo()):(this.skipStartRow=-1,this.skipEndRow=-1,this.updateGroupTitleInfo()),this.updateScenegraph()}updateGroupTitleInfo(){this.rowNow=this.table.scenegraph.proxy.screenTopRow+this.titleRows.length;const t=this.table.getRecordIndexByCell(0,this.rowNow),e=this.table.getRecordIndexByCell(0,this.rowNow+1);this.getTitleRowsByRecordIndex(t,e)}getTitleRowsByRecordIndex(t,e){lt(t)||(t=[t]),lt(e)||(e=[e]);for(let l=0;l<t.length;l++){const a=t.slice(0,l+1);this.table.dataSource.getRaw(a)}const n=[],o=e.length===t.length+1;let r=t.slice(0,o?t.length:t.length-1);const s=this.table.dataSource.currentIndexedData;for(let l=this.rowNow-this.table.columnHeaderLevelCount;l>=0;l--){const a=s[l];if(lt(a)&&r.length===a.length){let h=!0;for(let d=0;d<a.length;d++)if(a[d]!==r[d]){h=!1;break}h&&(n.push(l+this.table.columnHeaderLevelCount),r=r.slice(0,r.length-1))}else if(a===t[0]){n.push(l+this.table.columnHeaderLevelCount);break}}this.titleRows=n.reverse()}updateScenegraph(){const{table:t}=this,{shadowGroup:e,shadowGroupFrozen:n}=b9(t);this.showedTitleRows.length=0;let o=0;for(let r=0;r<t.colCount;r++){let s;r<t.frozenColCount?(s=new de({x:t.getColsWidth(0,r-1),y:t.getFrozenRowsHeight()}),n.add(s)):(s=new de({x:t.getColsWidth(t.frozenColCount,r-1),y:t.getFrozenRowsHeight()}),e.add(s)),s.col=r;for(let l=0;l<this.titleRows.length;l++){const a=this.titleRows[l];if(v9(a,this.rowNow,t.scenegraph.proxy.screenTopRow,this.titleRows)){r===0&&o++;continue}r===0&&this.showedTitleRows.push(a);const h=t.scenegraph.getCell(r,a);if(h.role==="cell"){const d=yT(h);d.setAttributes({y:40*l}),s.add(d)}else{const d=_o(r,a,t,!0,!0);d.setAttributes({y:40*l}),s.add(d)}}}o>0&&this.skipStartRow===-1&&this.skipEndRow===-1&&(this.skipStartRow=t.scenegraph.proxy.screenTopRow-1,this.skipEndRow=t.scenegraph.proxy.screenTopRow+1)}}function v9(i,t,e,n){return i===t&&i!==e+n.length-1?!0:i===e+n.indexOf(i)+1&&i<t}function yT(i){const t=i.clone();if(t.role=i.role,t.col=i.col,t.row=i.row,t.mergeStartCol=i.mergeStartCol,t.mergeStartRow=i.mergeStartRow,t.mergeEndCol=i.mergeEndCol,t.mergeEndRow=i.mergeEndRow,t.contentWidth=i.contentWidth,t.contentHeight=i.contentHeight,t.role==="cell"){const e=Fe({x:0,y:0,width:t.attribute.width,height:t.attribute.height});t.add(e)}if(i.type==="group"){const e=t;i.forEachChildren(n=>{const o=yT(n);e.add(o)})}return t}function b9(i){const t=i.scenegraph.colHeaderGroup,e=i.scenegraph.cornerHeaderGroup;if(!t.border){const r=Fe({x:0,y:0,width:0,height:0,cursor:"pointer"});t.add(r),t.border=r,r.attachShadow(r.shadowRoot),r.name="border-rect",r.addEventListener("click",s=>{const l=i.listTreeStickCellPlugin.titleRows,{shadowTarget:a}=s.pickParams,h=Hr(a),{col:d,row:u}=h;_T(u-l.indexOf(u),i)})}if(!e.border){const r=Fe({x:0,y:0,width:0,height:0,cursor:"pointer"});e.add(r),e.border=r,r.attachShadow(r.shadowRoot),r.name="border-rect",r.addEventListener("click",s=>{const l=i.listTreeStickCellPlugin.titleRows,{shadowTarget:a}=s.pickParams,h=Hr(a),{col:d,row:u}=h;_T(u-l.indexOf(u),i)})}const n=t.border.shadowRoot,o=e.border.shadowRoot;return n.removeAllChild(),o.removeAllChild(),{shadowGroup:n,shadowGroupFrozen:o}}function _T(i,t){const e=t.getDrawRange();if(z(i)&&i>=t.frozenRowCount){const n=t.getFrozenRowsHeight(),o=t.getRowsHeight(0,i-1);t.scrollTop=Math.min(o-n,t.getAllRowsHeight()-e.height)-1}t.scenegraph.updateNextFrame()}const C9=()=>{Bt.registerComponent("listTreeStickCellPlugin",m9)},y9={};function _9(){return nh(y9,yg)}function w9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C){var _,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j;const G=_9()[d],X=f._getCellStyle(o,r),ht=Lc("padding",X,o,r,f);if(z(ht)&&(a=ht),!i){const gt=ws(o,r,p,f);b&&(i=f.scenegraph.highPerformanceGetCell(o,r,!0))&&i.role==="cell"&&i.setAttributes({x:e,y:n,width:s,height:l,lineWidth:(w=(_=p==null?void 0:p.group)===null||_===void 0?void 0:_.lineWidth)!==null&&w!==void 0?w:void 0,fill:(S=(y=p==null?void 0:p.group)===null||y===void 0?void 0:y.fill)!==null&&S!==void 0?S:void 0,stroke:(R=(A=p==null?void 0:p.group)===null||A===void 0?void 0:A.stroke)!==null&&R!==void 0?R:void 0,strokeArrayWidth:gt,strokeArrayColor:(T=(x=p==null?void 0:p.group)===null||x===void 0?void 0:x.strokeArrayColor)!==null&&T!==void 0?T:void 0,cursor:(B=(M=p==null?void 0:p.group)===null||M===void 0?void 0:M.cursor)!==null&&B!==void 0?B:void 0,lineDash:(F=(P=p==null?void 0:p.group)===null||P===void 0?void 0:P.lineDash)!==null&&F!==void 0?F:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius}),i&&i.role==="cell"||((i=new de({x:e,y:n,width:s,height:l,lineWidth:(E=(H=p==null?void 0:p.group)===null||H===void 0?void 0:H.lineWidth)!==null&&E!==void 0?E:void 0,fill:(I=(k=p==null?void 0:p.group)===null||k===void 0?void 0:k.fill)!==null&&I!==void 0?I:void 0,stroke:(D=(L=p==null?void 0:p.group)===null||L===void 0?void 0:L.stroke)!==null&&D!==void 0?D:void 0,strokeArrayWidth:gt,strokeArrayColor:(N=(O=p==null?void 0:p.group)===null||O===void 0?void 0:O.strokeArrayColor)!==null&&N!==void 0?N:void 0,cursor:($=(W=p==null?void 0:p.group)===null||W===void 0?void 0:W.cursor)!==null&&$!==void 0?$:void 0,lineDash:(Y=(U=p==null?void 0:p.group)===null||U===void 0?void 0:U.lineDash)!==null&&Y!==void 0?Y:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius})).role="cell",i.col=o,i.row=r,t==null||t.addCellGroup(i))}if(i.AABBBounds.width(),C&&Array.isArray(f.getCellValue(o,r))||!C){const gt=new Rl(m,{stroke:!1,x:a[3],y:a[0],canvas:(j=f.canvas)!==null&&j!==void 0?j:f.scenegraph.stage.window.getContext().canvas,mode:f.options.mode,modeParams:f.options.modeParams,spec:u,ClassType:G,width:s-a[3]-a[1],height:l-a[2]-a[0],chartInstance:c,dataId:g,data:f.getCellValue(o,r)||[],cellPadding:a,dpr:f.internalProps.pixelRatio,axes:f.isPivotChart()?f.internalProps.layoutMap.getChartAxes(o,r):[],tableChartOption:f.options.chartOption});i.appendChild(gt),f.internalProps.layoutMap.setChartInstance(o,r,gt.chartInstance)}return i}function S9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b){var C,_,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U;if(!i){const ht=ws(o,r,f,g);b&&(i=g.scenegraph.highPerformanceGetCell(o,r,!0))&&i.role==="cell"&&i.setAttributes({x:e,y:n,width:l,height:a,lineWidth:(_=(C=f==null?void 0:f.group)===null||C===void 0?void 0:C.lineWidth)!==null&&_!==void 0?_:void 0,fill:(y=(w=f==null?void 0:f.group)===null||w===void 0?void 0:w.fill)!==null&&y!==void 0?y:void 0,stroke:(A=(S=f==null?void 0:f.group)===null||S===void 0?void 0:S.stroke)!==null&&A!==void 0?A:void 0,strokeArrayWidth:ht,strokeArrayColor:(x=(R=f==null?void 0:f.group)===null||R===void 0?void 0:R.strokeArrayColor)!==null&&x!==void 0?x:void 0,cursor:(M=(T=f==null?void 0:f.group)===null||T===void 0?void 0:T.cursor)!==null&&M!==void 0?M:void 0,lineDash:(P=(B=f==null?void 0:f.group)===null||B===void 0?void 0:B.lineDash)!==null&&P!==void 0?P:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius}),i&&i.role==="cell"||((i=new de({x:e,y:n,width:l,height:a,lineWidth:(H=(F=f==null?void 0:f.group)===null||F===void 0?void 0:F.lineWidth)!==null&&H!==void 0?H:void 0,fill:(k=(E=f==null?void 0:f.group)===null||E===void 0?void 0:E.fill)!==null&&k!==void 0?k:void 0,stroke:(L=(I=f==null?void 0:f.group)===null||I===void 0?void 0:I.stroke)!==null&&L!==void 0?L:void 0,strokeArrayWidth:ht,strokeArrayColor:(O=(D=f==null?void 0:f.group)===null||D===void 0?void 0:D.strokeArrayColor)!==null&&O!==void 0?O:void 0,cursor:(W=(N=f==null?void 0:f.group)===null||N===void 0?void 0:N.cursor)!==null&&W!==void 0?W:void 0,lineDash:(U=($=f==null?void 0:f.group)===null||$===void 0?void 0:$.lineDash)!==null&&U!==void 0?U:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius})).role="cell",i.col=o,i.row=r,t==null||t.addCellGroup(i))}let Y;if(c){let ht=o,gt=r;m&&(ht=m.start.col,gt=m.start.row),Y=g.getCellIcons(ht,gt)}let j=0,G=0;if(Array.isArray(Y)&&Y.length!==0){const{leftIconWidth:ht,rightIconWidth:gt,absoluteLeftIconWidth:Ct,absoluteRightIconWidth:Q}=Dc(Y,i,m,g);j=ht+gt,G=ht,i.forEachChildren(et=>{et.role==="icon-left"?et.setAttribute("x",et.attribute.x+h[3]):et.role==="icon-right"?et.setAttribute("x",et.attribute.x+l-gt-h[1]):et.role==="icon-absolute-right"&&et.setAttribute("x",et.attribute.x+l-Q-h[1])}),i.forEachChildren(et=>{u==="middle"?et.setAttribute("y",(a-et.AABBBounds.height())/2):u==="bottom"?et.setAttribute("y",a-et.AABBBounds.height()-h[2]):et.setAttribute("y",h[0])})}const X=x9(o,r,s-j,l,a,h,f,p,g);return X&&i.appendChild(X),X.render(),l-=h[1]+h[3]+j,a-=h[0]+h[2],d==="center"?X.setAttribute("x",h[3]+G+(l-X.AABBBounds.width())/2):d==="right"?X.setAttribute("x",h[3]+G+l-X.AABBBounds.width()):X.setAttribute("x",h[3]+G),u==="middle"?X.setAttribute("y",h[0]+(a-X.AABBBounds.height())/2):u==="bottom"?X.setAttribute("y",h[0]+a-X.AABBBounds.height()):X.setAttribute("y",h[0]),i}function x9(i,t,e,n,o,r,s,l,a){var h,d,u,c;const g=a._getCellStyle(i,t),f=wt("size",g,i,t,a),p=wt("spaceBetweenTextAndIcon",g,i,t,a),m=wt("defaultFill",g,i,t,a),b=wt("defaultStroke",g,i,t,a),C=wt("disableFill",g,i,t,a),_=wt("checkedFill",g,i,t,a),w=wt("checkedStroke",g,i,t,a),y=wt("disableCheckedFill",g,i,t,a),S=wt("disableCheckedStroke",g,i,t,a),A=wt("checkIconImage",g,i,t,a),R=wt("indeterminateIconImage",g,i,t,a),x=a.getCellValue(i,t),T=a.getCellOriginValue(i,t);let M,B,P=(h=x)!==null&&h!==void 0?h:"";ge(x)?(M=x.checked,B=x.disable,P=(d=x.text)!==null&&d!==void 0?d:""):typeof x=="boolean"&&(M=x,P=""),M=a.stateManager.syncCheckedState(i,t,l.field,M);const F=lo(i,t,a),H=a._getCellStyle(i,t),E=(u=H.autoWrapText)!==null&&u!==void 0?u:a.internalProps.autoWrapText,{lineClamp:k}=H,{checked:I,disable:L}=l;if(M==null||typeof M=="function"){const Y=ii(I,{col:i,row:t,table:a,context:null,value:x,dataValue:T});M=a.stateManager.syncCheckedState(i,t,l.field,Y)}const D=ii(L,{col:i,row:t,table:a,context:null,value:x,dataValue:T}),O=e==="auto",N=a.isAutoRowHeight(t),W={text:P.length===1?P[0]:P,maxLineWidth:O?1/0:n-(r[1]+r[3]+F)-f-p,textBaseline:"top",autoWrapText:E,lineClamp:k,wordBreak:"break-word",heightLimit:N?-1:o-Math.floor(r[0]+r[2]),pickable:!1,dx:F,whiteSpace:P.length!==1||E?"normal":"no-wrap"},$={x:0,y:0,text:s.text?Object.assign({},s.text,W):W,icon:{width:Math.floor(f/1.4),height:Math.floor(f/1.4)},box:{width:f,height:f},spaceBetweenTextAndIcon:p,disabled:(c=B??D)!==null&&c!==void 0&&c};M==="indeterminate"?($.checked=void 0,$.indeterminate=!0):($.checked=M,$.indeterminate=void 0),m&&($.box.fill=m),b&&($.box.stroke=b),C&&($.box.disableFill=C),_&&($.box.checkedFill=_),w&&($.box.checkedStroke=w),y&&($.box.disableCheckedFill=y),S&&($.box.disableCheckedStroke=S),A&&($.icon.checkIconImage=A),R&&($.icon.indeterminateIconImage=R);const U=new Rr($);return U.name="checkbox",U}function R9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f){var p,m,b,C,_,w,y,S,A,R,x,T;if(!i){const P=ws(o,r,g,c);(i=new de({x:e,y:n,width:l,height:a,lineWidth:(m=(p=g==null?void 0:g.group)===null||p===void 0?void 0:p.lineWidth)!==null&&m!==void 0?m:void 0,fill:(C=(b=g==null?void 0:g.group)===null||b===void 0?void 0:b.fill)!==null&&C!==void 0?C:void 0,stroke:(w=(_=g==null?void 0:g.group)===null||_===void 0?void 0:_.stroke)!==null&&w!==void 0?w:void 0,strokeArrayWidth:P,strokeArrayColor:(S=(y=g==null?void 0:g.group)===null||y===void 0?void 0:y.strokeArrayColor)!==null&&S!==void 0?S:void 0,cursor:(R=(A=g==null?void 0:g.group)===null||A===void 0?void 0:A.cursor)!==null&&R!==void 0?R:void 0,lineDash:(T=(x=g==null?void 0:g.group)===null||x===void 0?void 0:x.lineDash)!==null&&T!==void 0?T:void 0,lineCap:"butt",clip:!0,cornerRadius:g.group.cornerRadius})).role="cell",i.col=o,i.row=r,t==null||t.addCellGroup(i)}const{width:M,height:B}=A9(o,r,s,l,a,h,g,f,i,c);return l-=h[1]+h[3],a-=h[0]+h[2],i.forEachChildren(P=>{d==="center"?P.setAttribute("x",h[3]+P.attribute.x+(l-M)/2):d==="right"?P.setAttribute("x",h[3]+P.attribute.x+l-M):P.setAttribute("x",h[3]+P.attribute.x),u==="middle"?P.setAttribute("y",h[0]+P.attribute.y+(a-B)/2):u==="bottom"?P.setAttribute("y",h[0]+P.attribute.y+a-B):P.setAttribute("y",h[0]+P.attribute.y)}),i}function A9(i,t,e,n,o,r,s,l,a,h){var d,u;const c=h._getCellStyle(i,t);let g=wt("size",c,i,t,h),f=wt("innerRadius",c,i,t,h),p=wt("outerRadius",c,i,t,h);const m=wt("spaceBetweenTextAndIcon",c,i,t,h),b=wt("spaceBetweenRadio",c,i,t,h),C=wt("defaultFill",c,i,t,h),_=wt("defaultStroke",c,i,t,h),w=wt("disableFill",c,i,t,h),y=wt("checkedFill",c,i,t,h),S=wt("checkedStroke",c,i,t,h),A=wt("disableCheckedFill",c,i,t,h),R=wt("disableCheckedStroke",c,i,t,h);ft(p)?g=2*p:p=Math.round(g/2),(!ft(f)||f<0)&&(f=Math.round(p/7*3));const x=h.getCellValue(i,t),T=h.getCellOriginValue(i,t),M=lo(i,t,h),B=h._getCellStyle(i,t),P=(d=B.autoWrapText)!==null&&d!==void 0?d:h.internalProps.autoWrapText,{lineClamp:F}=B,H=e==="auto",E=h.heightMode==="autoHeight",k={maxLineWidth:H?1/0:n-(r[1]+r[3]+M)-g-m,textBaseline:"top",autoWrapText:P,lineClamp:F,wordBreak:"break-word",heightLimit:E?-1:o-Math.floor(r[0]+r[2]),pickable:!1,dx:M},I={x:0,y:0,text:s.text?Object.assign({},s.text,k):k,circle:{innerRadius:f,outerRadius:p},spaceBetweenTextAndIcon:m};C&&(I.circle.fill=C),_&&(I.circle.stroke=_),w&&(I.circle.disableFill=w),y&&(I.circle.checkedFill=y),S&&(I.circle.checkedStroke=S),A&&(I.circle.disableCheckedFill=A),R&&(I.circle.disableCheckedStroke=R);let L=0,D=0;const O=(u=l.radioDirectionInCell)!==null&&u!==void 0?u:"vertical";if(lt(x))x.forEach((N,W)=>{const $=wT(N,T,W,i,t,l,P,I,h);$&&a.appendChild($),$.id=`radio-${i}-${t}-${W}`,$.render();const U=$.AABBBounds;O==="vertical"?($.setAttribute("y",D),D+=U.height()+(W!==x.length-1?b:0),L=Math.max(L,U.width())):O==="horizontal"&&($.setAttribute("x",L),L+=U.width()+(W!==x.length-1?b:0),D=Math.max(D,U.height()))});else{const N=wT(x,T,void 0,i,t,l,P,I,h);N&&a.appendChild(N),N.id=`radio-${i}-${t}`,N.render();const W=N.AABBBounds;L=W.width(),D=W.height()}return{width:L,height:D}}function wT(i,t,e,n,o,r,s,l,a){const h=T9(i,t,e,n,o,r,a),d=M9(i,t,n,o,r,a),u=ge(i)?i.text:bi(i)?"":i??"",c=xt({},l,{checked:h,disabled:d,text:{text:u.length===1?u[0]:u,whiteSpace:u.length!==1||s?"normal":"no-wrap"},boundsPadding:0}),g=new Qa(c);return g.name="radio",g}function T9(i,t,e,n,o,r,s){var l,a;const h=(l=r.radioCheckType)!==null&&l!==void 0?l:"column";let d,u;return ge(i)?d=i.checked:typeof i=="boolean"&&(d=i),d=s.stateManager.syncRadioState(n,o,r.field,h,e,d),d!=null&&typeof d!="function"||(u=ii(r.checked,{col:n,row:o,table:s,context:null,value:i,dataValue:t}),d=s.stateManager.syncRadioState(n,o,r.field,h,e,u)),(a=d??u)!==null&&a!==void 0&&a}function M9(i,t,e,n,o,r){var s;let l;ge(i)&&(l=i.disable);const a=ii(o.disable,{col:e,row:n,table:r,context:null,value:i,dataValue:t});return(s=l??a)!==null&&s!==void 0&&s}const Dr=new tz,Or=new ds;function B9(i,t,e,n,o,r,s,l,a,h,d,u){var c,g,f,p,m,b,C,_,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L;if(!i){const O=ws(o,r,d,h);u&&(i=h.scenegraph.highPerformanceGetCell(o,r,!0))&&i.role==="cell"&&i.setAttributes({x:e,y:n,width:s,height:l,lineWidth:(g=(c=d==null?void 0:d.group)===null||c===void 0?void 0:c.lineWidth)!==null&&g!==void 0?g:void 0,fill:(p=(f=d==null?void 0:d.group)===null||f===void 0?void 0:f.fill)!==null&&p!==void 0?p:void 0,stroke:(b=(m=d==null?void 0:d.group)===null||m===void 0?void 0:m.stroke)!==null&&b!==void 0?b:void 0,strokeArrayWidth:O,strokeArrayColor:(_=(C=d==null?void 0:d.group)===null||C===void 0?void 0:C.strokeArrayColor)!==null&&_!==void 0?_:void 0,cursor:(y=(w=d==null?void 0:d.group)===null||w===void 0?void 0:w.cursor)!==null&&y!==void 0?y:void 0,lineDash:(A=(S=d==null?void 0:d.group)===null||S===void 0?void 0:S.lineDash)!==null&&A!==void 0?A:void 0,lineCap:"butt",clip:!0,cornerRadius:d.group.cornerRadius}),i&&i.role==="cell"||((i=new de({x:e,y:n,width:s,height:l,lineWidth:(x=(R=d==null?void 0:d.group)===null||R===void 0?void 0:R.lineWidth)!==null&&x!==void 0?x:void 0,fill:(M=(T=d==null?void 0:d.group)===null||T===void 0?void 0:T.fill)!==null&&M!==void 0?M:void 0,stroke:(P=(B=d==null?void 0:d.group)===null||B===void 0?void 0:B.stroke)!==null&&P!==void 0?P:void 0,strokeArrayWidth:O,strokeArrayColor:(H=(F=d==null?void 0:d.group)===null||F===void 0?void 0:F.strokeArrayColor)!==null&&H!==void 0?H:void 0,cursor:(k=(E=d==null?void 0:d.group)===null||E===void 0?void 0:E.cursor)!==null&&k!==void 0?k:void 0,lineDash:(L=(I=d==null?void 0:d.group)===null||I===void 0?void 0:I.lineDash)!==null&&L!==void 0?L:void 0,lineCap:"butt",clip:!0,cornerRadius:d.group.cornerRadius})).role="cell",i.col=o,i.row=r,t==null||t.addCellGroup(i))}const D=P9(o,r,s,l,a,h);return D&&i.appendChild(D),i}function P9(i,t,e,n,o,r){let s,l;const a=r.internalProps.layoutMap.getBody(i,t).sparklineSpec,h=r.getCellValue(i,t);if(!Array.isArray(h))return;const d=o[3],u=o[0];e-=o[1]+o[3];const c=n-=o[0]+o[2];if(typeof a=="function"){const _={col:i,row:t,dataValue:r.getCellOriginValue(i,t)||"",value:r.getCellValue(i,t)||"",rect:r.getCellRangeRelativeRect(r.getCellRange(i,t)),table:r};s=a(_),l=ST(s,d,u,e,n)}else s=a,l=ST(a,d,u,e,n);const g=[],f=[];let p,m;if(typeof s.xField=="object")Dr.domain(s.xField.domain),p=s.xField.field;else if(typeof s.xField=="string"){const _=h.map(w=>w[s.xField]);Dr.domain(_),p=s.xField}else Array.isArray(h)&&(Dr.domain(Array.from({length:h.length},(_,w)=>w)),p=s.xField);if(Dr.range([0,e]),typeof s.yField=="object")Or.domain(s.yField.domain),m=s.yField.field;else if(typeof s.yField=="string"){const _=xT(h,s.yField);Or.domain([Math.min(..._),Math.max(..._)]),m=s.yField}else if(Array.isArray(h)){const _=xT(h);Or.domain([Math.min(..._),Math.max(..._)]),m=s.yField}if(Or.range([0,n]),typeof s.xField=="object"&&Array.isArray(s.xField.domain)){const _=h.map(y=>y[s.xField.field]),w=s.xField.domain;for(let y=0;y<w.length;y++){let S=!1;for(let A=0;A<_.length;A++)if(w[y]===_[A]){const R=h[A];if(!z(R[p])||!z(R[m]))break;g.push({x:0+Dr.scale(R[p]),y:c-Or.scale(R[m]),defined:z(R[m])}),f.push(R),S=!0;break}S||(g.push({x:0+Dr.scale(w[y]),y:0,defined:!1}),f.push({[p]:w[y],[m]:null}))}}else for(let _=0;_<h.length;_++){const w=h[_];g.push({x:0+Dr.scale(p?w[p]:_),y:c-Or.scale(m?w[m]:w),defined:z(m?w[m]:w),rawData:w}),f.push(w)}const b=l.getChildByName("sparkline-line");b&&b.setAttribute("points",g),b.bandwidth=Dr.step(),b.min=Or.range()[0],b.max=Or.range()[1];const C=l.getChildByName("sparkline-symbol-group");if(C){const _=s.pointShowRule==="isolatedPoint";if(s.pointShowRule==="all")for(let w=0;w<g.length;w++){const{x:y,y:S,defined:A}=g[w];if(A){const R=Ea({x:y,y:S});C.appendChild(R)}}else if(_)for(let w=0;w<g.length;w++){const{x:y,y:S,defined:A}=g[w];if(A&&(!g[w-1]||!g[w-1].defined)&&(!g[w+1]||!g[w+1].defined)){const R=Ea({x:y,y:S});C.appendChild(R)}}}return l}function ST(i,t,e,n,o){var r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,A,R,x,T;let M;M=typeof i=="function"?i(null):i;const B=new de({x:t,y:e,width:n,height:o,stroke:!1,fill:!1});if(B.name="sparkline",M.type==="line"){const P=fn({x:0,y:0,curveType:M.smooth?"monotoneX":"linear",stroke:(l=(s=(r=M.line)===null||r===void 0?void 0:r.style)===null||s===void 0?void 0:s.stroke)!==null&&l!==void 0?l:"blue",lineWidth:(d=(h=(a=M.line)===null||a===void 0?void 0:a.style)===null||h===void 0?void 0:h.strokeWidth)!==null&&d!==void 0?d:2});P.name="sparkline-line",B.addChild(P),M.crosshair&&(P.hover=(c=(u=M.crosshair)===null||u===void 0?void 0:u.style)!==null&&c!==void 0?c:{stroke:"#000",interpolate:"linear"});const F=new de({x:0,y:0,width:n,height:o,stroke:!1,fill:!1});F.name="sparkline-symbol-group",F.setTheme({symbol:{stroke:(p=(f=(g=M.point)===null||g===void 0?void 0:g.style)===null||f===void 0?void 0:f.stroke)!==null&&p!==void 0?p:"#000",lineWidth:(C=(b=(m=M.point)===null||m===void 0?void 0:m.style)===null||b===void 0?void 0:b.strokeWidth)!==null&&C!==void 0?C:1,fill:(y=(w=(_=M.point)===null||_===void 0?void 0:_.style)===null||w===void 0?void 0:w.fill)!==null&&y!==void 0?y:"#000",size:2*((R=(A=(S=M.point)===null||S===void 0?void 0:S.style)===null||A===void 0?void 0:A.size)!==null&&R!==void 0?R:3),symbolType:"circle"}}),B.addChild(F),F.hover=(T=(x=M.point)===null||x===void 0?void 0:x.hover)!==null&&T!==void 0&&T}return B}function xT(i,t){const e=[];for(let n=0;n<i.length;n++){const o=i[n];z(t)&&z(o[t])?e.push(o[t]):!z(t)&&z(o)&&e.push(o)}return e}const fv=vn();function H9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m){var b,C,_,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht;const gt=g._getCellStyle(n,o),Ct=Lc("padding",gt,n,o,g);!((b=g.options.customConfig)===null||b===void 0)&&b.imageMargin?h=Qt((C=g.options.customConfig)===null||C===void 0?void 0:C.imageMargin):z(Ct)&&(h=Ct),!((_=f==null?void 0:f.text)===null||_===void 0)&&_.textAlign&&(d=(w=f==null?void 0:f.text)===null||w===void 0?void 0:w.textAlign),!((y=f==null?void 0:f.text)===null||y===void 0)&&y.textBaseline&&(u=(S=f==null?void 0:f.text)===null||S===void 0?void 0:S.textBaseline);const Q=ws(n,o,f,g);let et,vt;if(m&&(et=g.scenegraph.highPerformanceGetCell(n,o,!0),et&&et.role==="cell"&&et.setAttributes({x:t,y:e,width:r,height:s,lineWidth:(R=(A=f==null?void 0:f.group)===null||A===void 0?void 0:A.lineWidth)!==null&&R!==void 0?R:void 0,fill:(T=(x=f==null?void 0:f.group)===null||x===void 0?void 0:x.fill)!==null&&T!==void 0?T:void 0,stroke:(B=(M=f==null?void 0:f.group)===null||M===void 0?void 0:M.stroke)!==null&&B!==void 0?B:void 0,strokeArrayWidth:Q,strokeArrayColor:(F=(P=f==null?void 0:f.group)===null||P===void 0?void 0:P.strokeArrayColor)!==null&&F!==void 0?F:void 0,cursor:(E=(H=f==null?void 0:f.group)===null||H===void 0?void 0:H.cursor)!==null&&E!==void 0?E:void 0,lineDash:(I=(k=f==null?void 0:f.group)===null||k===void 0?void 0:k.lineDash)!==null&&I!==void 0?I:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius})),et&&et.role==="cell"||(et=new de({x:t,y:e,width:r,height:s,lineWidth:(D=(L=f==null?void 0:f.group)===null||L===void 0?void 0:L.lineWidth)!==null&&D!==void 0?D:void 0,fill:(N=(O=f==null?void 0:f.group)===null||O===void 0?void 0:O.fill)!==null&&N!==void 0?N:void 0,stroke:($=(W=f==null?void 0:f.group)===null||W===void 0?void 0:W.stroke)!==null&&$!==void 0?$:void 0,strokeArrayWidth:Q,strokeArrayColor:(Y=(U=f==null?void 0:f.group)===null||U===void 0?void 0:U.strokeArrayColor)!==null&&Y!==void 0?Y:void 0,cursor:(G=(j=f==null?void 0:f.group)===null||j===void 0?void 0:j.cursor)!==null&&G!==void 0?G:void 0,lineDash:(ht=(X=f==null?void 0:f.group)===null||X===void 0?void 0:X.lineDash)!==null&&ht!==void 0?ht:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius}),et.role="cell",et.col=n,et.row=o,i==null||i.addCellGroup(et)),c){let _t=n,ct=o;p&&(_t=p.start.col,ct=p.start.row),vt=g.getCellIcons(_t,ct)}let bt=0,dt=0;if(Array.isArray(vt)&&vt.length!==0){const{leftIconWidth:_t,rightIconWidth:ct,absoluteLeftIconWidth:Wt,absoluteRightIconWidth:Yt}=Dc(vt,et,p,g);bt=_t,dt=ct,et.forEachChildren(yt=>{yt.role==="icon-left"?yt.setAttribute("x",yt.attribute.x+h[3]):yt.role==="icon-right"?yt.setAttribute("x",yt.attribute.x+r-ct-h[1]):yt.role==="icon-absolute-right"&&yt.setAttribute("x",yt.attribute.x+r-Yt-h[1])}),et.forEachChildren(yt=>{u==="middle"?yt.setAttribute("y",(s-yt.AABBBounds.height())/2):u==="bottom"?yt.setAttribute("y",s-yt.AABBBounds.height()-h[2]):yt.setAttribute("y",h[0])}),et._cellLeftIconWidth=bt,et._cellRightIconWidth=dt}const ot=g.getCellValue(n,o),ut=document.createElement("video");ut.addEventListener("loadeddata",()=>{a&&dR(n,o,ut.videoWidth,ut.videoHeight,g.scenegraph,h,et);const{width:_t,height:ct,isMerge:Wt}=wl(et,g);if(l){const{width:_e,height:Oe}=Ec(ut.videoWidth,ut.videoHeight,_t-h[1]-h[3],ct-h[0]-h[2]),He=Bm(0,0,_t,ct,_e,Oe,d,u,h);st.setAttributes({width:_e,height:Oe,x:He.x,y:He.y,dx:0})}else st.setAttributes({x:h[3],y:h[0],width:_t-h[1]-h[3],height:ct-h[2]-h[0],dy:0});Wt&&Pm(et.mergeStartCol,et.mergeEndCol,et.mergeStartRow,et.mergeEndRow,g);const{width:Yt,height:yt}=wl(et,g),mt=Math.floor(Math.min(Yt-h[1]-h[3],yt-h[2]-h[0])/2),ie=0+(Yt>st.attribute.width?st.attribute.x-0+st.attribute.width/2:Yt/2),le=0+(yt>st.attribute.height?st.attribute.y-0+st.attribute.height/2:yt/2),Zt=new ps({x:ie-mt/2,y:le-mt/2,width:mt,height:mt,image:fv.play.svg,cursor:fv.play.cursor});Zt.name="play-icon",et.appendChild(Zt),g.scenegraph.updateNextFrame()}),ut.onerror=()=>{st.image=fv.damage_pic.svg},ut.src=ot,ut.setAttribute("preload","auto");const st=gu({x:h[3],y:h[0],width:r-h[1]-h[3],height:s-h[2]-h[0],image:ut,cursor:"pointer"});return st.name="image",st.keepAspectRatio=l,st.textAlign=d,st.textBaseline=u,et.appendChild(st),et}function E9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C){var _,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht,gt,Ct,Q,et;const vt=i._getCellStyle(r,s),bt=Lc("padding",vt,r,s,i);z(bt)&&(d=bt),!((_=m==null?void 0:m.text)===null||_===void 0)&&_.textAlign&&(u=(w=m==null?void 0:m.text)===null||w===void 0?void 0:w.textAlign),!((y=m==null?void 0:m.text)===null||y===void 0)&&y.textBaseline&&(c=(S=m==null?void 0:m.text)===null||S===void 0?void 0:S.textBaseline);const dt=i.isAutoRowHeight(s),ot=l==="auto",ut=(A=vt.autoWrapText)!==null&&A!==void 0?A:i.internalProps.autoWrapText,st=vt.lineClamp,_t=ws(r,s,m,i);let ct;if(C&&(ct=i.scenegraph.getCell(r,s,!0),ct&&ct.role==="cell"&&ct.setAttributes({x:n,y:o,width:a,height:h,lineWidth:(x=(R=m==null?void 0:m.group)===null||R===void 0?void 0:R.lineWidth)!==null&&x!==void 0?x:void 0,fill:(M=(T=m==null?void 0:m.group)===null||T===void 0?void 0:T.fill)!==null&&M!==void 0?M:void 0,stroke:(P=(B=m==null?void 0:m.group)===null||B===void 0?void 0:B.stroke)!==null&&P!==void 0?P:void 0,strokeArrayWidth:_t??void 0,strokeArrayColor:(H=(F=m==null?void 0:m.group)===null||F===void 0?void 0:F.strokeArrayColor)!==null&&H!==void 0?H:void 0,cursor:(k=(E=m==null?void 0:m.group)===null||E===void 0?void 0:E.cursor)!==null&&k!==void 0?k:void 0,lineDash:(L=(I=m==null?void 0:m.group)===null||I===void 0?void 0:I.lineDash)!==null&&L!==void 0?L:void 0,lineCap:"butt",clip:!0,cornerRadius:m.group.cornerRadius})),ct&&ct.role==="cell"||(ct=new de({x:n,y:o,width:a,height:h,lineWidth:(O=(D=m==null?void 0:m.group)===null||D===void 0?void 0:D.lineWidth)!==null&&O!==void 0?O:void 0,fill:(W=(N=m==null?void 0:m.group)===null||N===void 0?void 0:N.fill)!==null&&W!==void 0?W:void 0,stroke:(U=($=m==null?void 0:m.group)===null||$===void 0?void 0:$.stroke)!==null&&U!==void 0?U:void 0,strokeArrayWidth:_t??void 0,strokeArrayColor:(j=(Y=m==null?void 0:m.group)===null||Y===void 0?void 0:Y.strokeArrayColor)!==null&&j!==void 0?j:void 0,cursor:(X=(G=m==null?void 0:m.group)===null||G===void 0?void 0:G.cursor)!==null&&X!==void 0?X:void 0,lineDash:(gt=(ht=m==null?void 0:m.group)===null||ht===void 0?void 0:ht.lineDash)!==null&&gt!==void 0?gt:void 0,lineCap:"butt",clip:!0,cornerRadius:m.group.cornerRadius}),ct.role="cell",ct.col=r,ct.row=s,e==null||e.addCellGroup(ct)),f&&ct.appendChild(f),p){const Wt=t;let Yt;if(g){let yt=r,mt=s;b&&(yt=b.start.col,mt=b.start.row),Yt=i.getCellIcons(yt,mt)}if(Y6(ct,Yt,Wt,d,ot,dt,ut,typeof st=="number"?st:void 0,ct.attribute.width,ct.attribute.height,u,c,i,m,b),(Ct=m==null?void 0:m._vtable)===null||Ct===void 0?void 0:Ct.marked){const yt=n0({x:ct.attribute.width,y:0,startAngle:Math.PI/2,endAngle:Math.PI,outerRadius:6,fill:"#3073F2",pickable:!1});yt.name="mark",ct.appendChild(yt)}}return f&&ct.setAttributes({width:Math.max(ct.attribute.width,(Q=f.attribute.width)!==null&&Q!==void 0?Q:0),height:Math.max(ct.attribute.height,(et=f.attribute.height)!==null&&et!==void 0?et:0)}),ct}function L9(i,t,e,n,o,r,s,l,a,h){var d,u,c,g,f,p;i.dependField&&(o=(u=(d=a.getCellOriginRecord(r,s))===null||d===void 0?void 0:d[i.dependField])!==null&&u!==void 0?u:o),i.barType=(c=i.barType)!==null&&c!==void 0?c:"default",i.min=(g=ii(i.min,{col:r,row:s,table:a,value:n,dataValue:o,cellHeaderPaths:void 0}))!==null&&g!==void 0?g:0,i.max=(f=ii(i.max,{col:r,row:s,table:a,value:n,dataValue:o,cellHeaderPaths:void 0}))!==null&&f!==void 0?f:i.min+100;let m=0;m=h?a.getRowsHeight(h.start.row,h.end.row):a.getRowHeight(s);let b=e,C=m,_=0;ft(a.theme._contentOffset)&&(_=a.theme._contentOffset);const w=new de({x:-_,y:-_,width:b,height:C});w.name="progress-bar";const{showBar:y,barColor:S,barBgColor:A,barPositiveColor:R,barNegativeColor:x,barAxisColor:T,barRightToLeft:M,showBarMark:B,barMarkPositiveColor:P,barMarkNegativeColor:F,barMarkWidth:H,barMarkPosition:E}=t;let{barHeight:k,barBottom:I,barPadding:L}=t;L.length===1?L=[L[0],L[0],L[0],L[0]]:L.length===2?L=[L[0],L[1],L[0],L[1]]:L.length===3&&(L=[L[0],L[1],L[2],L[1]]),L=L.map((G,X)=>{if(typeof G=="string"&&pc.endsWith(G,"%")){const ht=Number(G.substr(0,G.length-1));return X===0||X===2?m*ht/100:e*ht/100}return Number(G)});const D=Qt(wt("borderLineWidth",t,r,s,a)),O=Math.max(L[0],Math.ceil(D[0]/2)),N=Math.max(L[1],Math.floor(D[1]/2)),W=Math.max(L[2],Math.floor(D[2]/2)),$=Math.max(L[3],Math.ceil(D[3]/2));b-=N+$,C-=W+O,s===a.rowCount-1&&[0,"0"].includes(I)&&(C-=1);const U=O,Y=$,j=b;if(typeof k=="string"&&pc.endsWith(k,"%")?(k=Number(k.substr(0,k.length-1)),k=C*k/100):k=Number(k),typeof I=="string"&&pc.endsWith(I,"%")?(I=Number(I.substr(0,I.length-1)),I=C*I/100):I=Number(I),ii(y,{col:r,row:s,table:a,context:null,value:n,dataValue:o})){let G=`${o}`;pc.endsWith(G,"%")&&(G=G.substr(0,G.length-1));const X=Number(G);if(isNaN(X))return w;if(((p=i.barType)!==null&&p!==void 0?p:"default")==="default"){const ht=X<i.min?0:X>i.max?1:(X-i.min)/(i.max-i.min),gt=b,Ct=U+C-k-I;let Q=Math.min(gt*ht,gt);const et=M?Y+j-Q:Y;r!==a.colCount-1||ht!==1||M||(Q-=1);const vt=ii(A,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:ht});if(vt){const ot=Fe({x:et,y:Ct,width:gt,height:k,fill:vt});w.addChild(ot)}const bt=ii(S,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:ht})||"#20a8d8",dt=Fe({x:et,y:Ct,width:Q,height:k,fill:bt});w.addChild(dt)}else if(i.barType==="negative"){const ht=i.min<0?-i.min:0,gt=i.max>0?i.max:0,Ct=ht/(ht+gt),Q=1-Ct,et=X>0?X/gt:0,vt=X<0?-X/ht:0,bt=b,dt=U+C-k-I,ot=Y,ut=ii(A,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:et});if(ut){const He=Fe({x:ot,y:dt,width:bt,height:k,fill:ut});w.addChild(He)}const st=M?Q*bt:Ct*bt,_t=Math.min(bt*Ct*vt,bt),ct=M?{left:ot+st,top:dt,width:_t,height:k}:{left:ot+st-_t,top:dt,width:_t,height:k},Wt=ii(x,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:vt})||"#20a8d8",Yt=Fe({x:ct.left,y:ct.top,width:ct.width,height:ct.height,fill:Wt});w.addChild(Yt);let yt=Math.min(bt*Q*et,bt);r!==a.colCount-1||et!==1||M||(yt-=1);const mt=M?{left:ot+st-yt,top:dt,width:yt,height:k}:{left:ot+st,top:dt,width:yt,height:k},ie=ii(R,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:et})||"#20a8d8",le=Fe({x:mt.left,y:mt.top,width:mt.width,height:mt.height,fill:ie});w.addChild(le);const Zt=M?ct.left:mt.left,_e=ii(T,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:et}),Oe=fn({x:0,y:0,stroke:_e,lineWidth:1,lineDash:[2,2],points:[{x:Zt,y:0},{x:Zt,y:m}]});if(w.addChild(Oe),B&&(et||vt)){const He=H,Ht=[];let Et;if(et>0)if(Et=ii(P,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:et})||"#20a8d8",E==="right"){const Tt=M?mt.left+H/2:mt.left+mt.width-H/2;Ht.push({x:Tt,y:mt.top}),Ht.push({x:Tt,y:mt.top+mt.height})}else E==="bottom"&&(Ht.push({x:mt.left,y:mt.top+mt.height-H/2}),Ht.push({x:mt.left+mt.width,y:mt.top+mt.height-H/2}));else if(vt>0)if(Et=ii(F,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:vt})||"#20a8d8",E==="right"){const Tt=M?ct.left+ct.width-H/2:ct.left+H/2;Ht.push({x:Tt,y:ct.top}),Ht.push({x:Tt,y:ct.top+ct.height})}else E==="bottom"&&(Ht.push({x:ct.left,y:ct.top+ct.height-H/2}),Ht.push({x:ct.left+ct.width,y:ct.top+ct.height-H/2}));const Rt=fn({x:0,y:0,stroke:Et,lineWidth:He,points:Ht});w.addChild(Rt)}}else if(i.barType==="negative_no_axis"){const ht=i.min<0?-i.min:0,gt=i.max>0?i.max:0,Ct=Math.max(ht,gt),Q=Ct===0?0:Math.abs(X)/Ct,et=b;let vt=Math.min(et*Q,et);r!==a.colCount-1||Q!==1||M||(vt-=1);const bt=U+C-k-I,dt=M?Y+j-vt:Y,ot=ii(A,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:Q});if(ot){const ct=Fe({x:dt,y:bt,width:et,height:k,fill:ot});w.addChild(ct)}const ut={left:dt,top:bt,width:vt,height:k};let st;st=X>=0?ii(R,{col:r,row:s,table:a,context:null,value:n,percentile:Q,dataValue:o})||"#20a8d8":ii(x,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:Q})||"#20a8d8";const _t=Fe({x:ut.left,y:ut.top,width:ut.width,height:ut.height,fill:st});if(w.addChild(_t),B&&X){const ct=H,Wt=[];let Yt;if(Yt=X>=0?ii(P,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:Q})||"#20a8d8":ii(F,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:Q})||"#20a8d8",E==="right"){const mt=M?ut.left+H/2:ut.left+ut.width-H/2;Wt.push({x:mt,y:ut.top}),Wt.push({x:mt,y:ut.top+ut.height})}else E==="bottom"&&(Wt.push({x:ut.left,y:ut.top+ut.height-H/2}),Wt.push({x:ut.left+ut.width,y:ut.top+ut.height-H/2}));const yt=fn({x:0,y:0,stroke:Yt,lineWidth:ct,points:Wt});w.addChild(yt)}}}return w}function k9(i,t,e,n,o,r){var s,l,a,h,d,u,c,g,f;if(e!=null&&e.zero&&(i=Math.min(i,0),t=Math.max(t,0)),e==null?void 0:e.expand){const b=i,C=t;z(e.expand.min)&&(i=b-(C-b)*e.expand.min),z(e.expand.max)&&(t=C+(C-b)*e.expand.max)}let p,m;if(ft(e==null?void 0:e.min)&&(i=e.min),ft(e==null?void 0:e.max)&&(t=e.max),(e==null?void 0:e.type)==="log"?(p=new Ya,p.base((s=e==null?void 0:e.base)!==null&&s!==void 0?s:10)):(e==null?void 0:e.type)==="symlog"?(p=new Xa,p.constant((l=e==null?void 0:e.constant)!==null&&l!==void 0?l:10)):p=new ds,p.domain([i,t],!!(e!=null&&e.nice)),e==null?void 0:e.nice){let b=(u=(h=(a=e.tick)===null||a===void 0?void 0:a.forceTickCount)!==null&&h!==void 0?h:(d=e.tick)===null||d===void 0?void 0:d.tickCount)!==null&&u!==void 0?u:10;ue(b)&&(b=b({axisLength:o,labelStyle:(g=(c=e==null?void 0:e.label)===null||c===void 0?void 0:c.style)!==null&&g!==void 0?g:{fontSize:Eh.LABEL_FONT_SIZE}})),e.niceType==="accurateFirst"&&(b=Math.max(10,b)),Mt(e.min)&&Mt(e.max)?p.nice(b):z(e.min)&&Mt(e.max)?p.niceMax(b):Mt(e.min)&&z(e.max)&&p.niceMin(b)}return delete p._niceType,r||(m=p.ticks(ft(e==null?void 0:e.tickCount)?e==null?void 0:e.tickCount:5,{noDecimals:(f=e==null?void 0:e.tick)===null||f===void 0?void 0:f.noDecimals})),{range:p.domain(),ticks:m}}const kg=()=>{Bt.registerFunction("createChartCellGroup",w9),Bt.registerFunction("getAxisDomainRangeAndLabels",k9)},Fg=()=>{Bt.registerFunction("createCheckboxCellGroup",S9)},Ig=()=>{Bt.registerFunction("createImageCellGroup",Z6)},Dg=()=>{Bt.registerFunction("createProgressBarCell",L9)},Og=()=>{Bt.registerFunction("createRadioCellGroup",R9)},zg=()=>{Bt.registerFunction("createSparkLineCellGroup",B9)},Il=()=>{Bt.registerFunction("createTextCellGroup",E9)},Wg=()=>{Bt.registerFunction("createVideoCellGroup",H9)};Mg(),Bg(),Pg(),Hg(),Eg(),Lg(),C9(),kg(),Fg(),Ig(),Dg(),Og(),zg(),Il(),Wg();class F9 extends fT{}Il();class I9 extends fT{}function D9(i,t,e,n,o,r){const s=r.columnHeaderLevelCount,l=[],a=[];for(let c=0;c<e.length;c++)n.includes(e[c])||a.push(o[c]);for(let c=0;c<n.length;c++)if(!e.includes(n[c])){const g={col:i,row:s+c};l.push(g)}let h=r.getParentCellId(i,t),d=r.getRowHeaderCellAddressByCellId(h);const u=[];for(d&&u.push(d);h;)h=r.getParentCellId(d.col,d.row),h&&(d=r.getRowHeaderCellAddressByCellId(h),u.push(d));return{addCellPositions:l,removeCellPositions:a,updateCellPositions:u}}const RT={startInTotal:0,level:0};class lr{constructor(t,e,n,o){var r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y;this.colIndex=0,this._showHeader=!0,this.columnHeaderObjs=[],this.rowHeaderObjs=[],this._cornerHeaderCellFullPathIds=[],this._columnHeaderCellFullPathIds=[],this._rowHeaderCellFullPathIds=[],this._rowHeaderCellFullPathIds_FULL=[],this._cornerHeaderCellIds=[],this._columnHeaderCellIds=[],this._rowHeaderCellIds=[],this._rowHeaderCellIds_FULL=[],this._columnWidths=[],this.columnPaths=[],this._headerObjects=[],this._headerObjectMap={},this._indicators=[],this.indicatorsAsCol=!0,this.hideIndicatorName=!1,this._showRowHeader=!0,this._showColumnHeader=!0,this._indicatorShowType="column",this.rowHierarchyTextStartAlignment=!1,this.rowDimensionKeys=[],this.colDimensionKeys=[],this.indicatorKeys=[],this.indicatorDimensionKey=Xi,this._rowHeaderExtensionTree={},this._extensionRowDimensionKeys=[],this.fullRowDimensionKeys=[],this.leftRowSeriesNumberColumnCount=0,this.rightRowSeriesNumberColumnCount=0,this._useGetBodyCache=!1,this._getBodyCache=new Map,this._useHeaderPathCache=!1,this._colHeaderPathCache=new Map,this._rowHeaderPathCache=new Map,this.sharedVar=t.layoutNodeId,this._table=t,t.options.rowHierarchyType==="tree"&&(this.extensionRows=t.options.extensionRows),this.dataset=e,this._largeCellRangeCache=[],this._CellHeaderPathMap=new Map,this.rowTree=t.internalProps.rowTree,this.columnTree=t.internalProps.columnTree,this.rowsDefine=(r=t.internalProps.rows)!==null&&r!==void 0?r:[],this.columnsDefine=(s=t.internalProps.columns)!==null&&s!==void 0?s:[],this.indicatorsDefine=(l=t.internalProps.indicators)!==null&&l!==void 0?l:[],this.indicatorTitle=t.options.indicatorTitle,this.indicatorsAsCol=(a=t.options.indicatorsAsCol)===null||a===void 0||a,this.hideIndicatorName=(h=t.options.hideIndicatorName)!==null&&h!==void 0&&h,this.showRowHeader=(d=t.options.showRowHeader)===null||d===void 0||d,this.showColumnHeader=(u=t.options.showColumnHeader)===null||u===void 0||u,this.rowHeaderTitle=t.options.rowHeaderTitle,this.columnHeaderTitle=t.options.columnHeaderTitle,this.rowHierarchyType=(c=t.options.rowHierarchyType)!==null&&c!==void 0?c:"grid",this.rowExpandLevel=(g=t.options.rowExpandLevel)!==null&&g!==void 0?g:1,this.rowHierarchyIndent=(f=t.options.rowHierarchyIndent)!==null&&f!==void 0?f:20,this.rowHierarchyTextStartAlignment=t.options.rowHierarchyTextStartAlignment,this.cornerSetting=Object.assign({titleOnDimension:"column",forceShowHeader:!1},t.options.corner),e&&(this.rowTree=e.rowHeaderTree,this.columnTree=e.colHeaderTree),(p=this.indicatorsDefine)===null||p===void 0||p.forEach(x=>{typeof x=="string"?this.indicatorKeys.push(x):this.indicatorKeys.push(x.indicatorKey)}),this.columnDimensionTree=n,this.rowDimensionTree=o,this.colDimensionKeys=this.columnDimensionTree.dimensionKeysIncludeVirtual.valueArr(),this.rowDimensionKeys=this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr(),this.fullRowDimensionKeys=this.fullRowDimensionKeys.concat(this.rowDimensionKeys),this.resetRowHeaderLevelCount(),this._table.isPivotChart()&&(this.hasTwoIndicatorAxes=this.indicatorsDefine.some(x=>{var T,M;if(x.chartSpec&&x.chartSpec.series&&x.chartSpec.series.length>1){const B=(M=(T=x.chartSpec.axes)!==null&&T!==void 0?T:this._table.pivotChartAxes)!==null&&M!==void 0?M:[];if(!B.length||B.every(P=>P.orient!==(this.indicatorsAsCol?"top":"right")||P.visible!==!1))return!0}return!1})),this.resetColumnHeaderLevelCount(),this._generateColHeaderIds(),this.colIndex=0,this._generateRowHeaderIds(),this._rowHeaderCellFullPathIds_FULL=im(this._rowHeaderCellFullPathIds_FULL),t.options.rowHierarchyType==="tree"&&((m=this.extensionRows)===null||m===void 0?void 0:m.length)>=1&&(this.generateExtensionRowTree(),this.extensionRows.forEach(x=>{const T=[];x.rows.forEach(M=>{typeof M=="string"?T.push(M):T.push(M.dimensionKey)}),this._extensionRowDimensionKeys.push(T),this.fullRowDimensionKeys=this.fullRowDimensionKeys.concat(T)})),this.sharedVar.seqId=Math.max(this.sharedVar.seqId,this._headerObjects.length);let S,A=this.columnDimensionTree.dimensionKeysIncludeVirtual.valueArr();!this.dataset||this._table.isPivotChart()||((C=(b=this.dataset.records)===null||b===void 0?void 0:b.length)!==null&&C!==void 0?C:0)!==0||this.dataset.customColTree||(A=this.columnsDefine.map(x=>typeof x=="string"?x:x.dimensionKey),this.indicatorsAsCol&&A.push(this.indicatorDimensionKey)),A=this.columnHeaderTitle?[""].concat(A):A;let R=[];if(this.rowHierarchyType==="tree"&&((_=this.extensionRows)===null||_===void 0?void 0:_.length)>=1){const x=[];x.push(this.rowDimensionKeys[0]),this._extensionRowDimensionKeys.forEach(T=>{x.push(T[0])}),R=this.extensionRows.reduce((T,M)=>T.concat(M.rows),[]),S=this.rowHeaderTitle?[""].concat(x):x}else S=this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr(),!this.dataset||this._table.isPivotChart()||((y=(w=this.dataset.records)===null||w===void 0?void 0:w.length)!==null&&y!==void 0?y:0)!==0||this.dataset.customRowTree||(S=this.rowsDefine.map(x=>typeof x=="string"?x:x.dimensionKey),this.indicatorsAsCol||S.push(this.indicatorDimensionKey)),S=this.rowHeaderTitle?[""].concat(S):S;this.cornerHeaderObjs=this._addCornerHeaders(A,S,this.columnsDefine.concat(...this.rowsDefine,...R)),this.colIndex=0,this._headerObjectMap=this._headerObjects.reduce((x,T)=>(x[T.id]=T,x),{}),this.indicatorsAsCol&&!this.hideIndicatorName?this._indicatorShowType="column":this.indicatorsAsCol||this.hideIndicatorName?this._indicatorShowType="none":this._indicatorShowType="row",this.generateCellIdsConsiderHideHeader(),this.setPagination(t.options.pagination),this._table.isPivotChart()&&(this._chartItemSpanSize=0,this._chartItemBandSize=0,this._indicators.find(x=>{var T,M,B,P,F,H,E,k;!((T=x==null?void 0:x.style)===null||T===void 0)&&T.padding&&(this._chartPadding=x.style.padding),!((M=x.chartSpec)===null||M===void 0)&&M.barWidth&&typeof x.chartSpec.barWidth=="number"&&(this._chartItemSpanSize=(B=x.chartSpec)===null||B===void 0?void 0:B.barWidth);const I=(F=(P=x.chartSpec)===null||P===void 0?void 0:P.axes)===null||F===void 0?void 0:F.find(L=>L.type==="band");return I!=null&&I.bandSize&&(this._chartItemBandSize=I==null?void 0:I.bandSize,this._chartPaddingInner=(H=lt(I.paddingInner)?I.paddingInner[0]:I.paddingInner)!==null&&H!==void 0?H:0,this._chartPaddingOuter=(E=lt(I.paddingOuter)?I.paddingOuter[0]:I.paddingOuter)!==null&&E!==void 0?E:0),this._chartItemSpanSize>0||((k=x.chartSpec.series)===null||k===void 0||k.find(L=>(L.barWidth&&typeof L.barWidth=="number"&&(this._chartItemSpanSize=L.barWidth),this._chartItemSpanSize>0)),!1)})),this.handleRowSeriesNumber(t.internalProps.rowSeriesNumber),this.setColumnWidths()}handleRowSeriesNumber(t){var e,n;t&&(Array.isArray(t)?this.rowSeriesNumberColumn=t.map(o=>{var r,s;return{id:"",title:o.title,define:o,cellType:(r=o.cellType)!==null&&r!==void 0?r:"text",headerType:(s=o.cellType)!==null&&s!==void 0?s:"text",width:o.width,style:o.style,format:o.format,field:o.field,icon:o.icon}}):this.rowSeriesNumberColumn=[{id:"",title:t.title,define:t,cellType:(e=t.cellType)!==null&&e!==void 0?e:"text",headerType:(n=t.cellType)!==null&&n!==void 0?n:"text",style:t.style,width:t.width,format:t.format,field:"",icon:t.icon,isChildNode:!1}],this.leftRowSeriesNumberColumn=this.rowSeriesNumberColumn.filter(o=>!0),this.rightRowSeriesNumberColumn=this.rowSeriesNumberColumn.filter(o=>!1),this.leftRowSeriesNumberColumnCount=this.leftRowSeriesNumberColumn.length,this.rightRowSeriesNumberColumnCount=this.rightRowSeriesNumberColumn.length)}_generateColHeaderIds(){var t,e,n,o,r,s,l,a;if(((t=this.columnDimensionTree.tree.children)===null||t===void 0?void 0:t.length)>=1){let h=0;if(this.dataset&&!this._table.isPivotChart()&&((n=(e=this.dataset.records)===null||e===void 0?void 0:e.length)!==null&&n!==void 0?n:0)===0&&!this.dataset.customColTree&&!this.dataset.customRowTree&&this.indicatorsAsCol&&this.columnDimensionTree.totalLevel<this.columnHeaderLevelCount){h=this.columnHeaderLevelCount-this.columnDimensionTree.totalLevel;for(let d=0;d<h;d++)this._columnHeaderCellFullPathIds.unshift([])}this._addHeaders(this._columnHeaderCellFullPathIds,h,this.columnDimensionTree.tree.children,[],this.columnHeaderObjs)}if(this.columnHeaderTitle){this.sharedVar.seqId=Math.max(this.sharedVar.seqId,this._headerObjects.length);const h=++this.sharedVar.seqId,d=Array(this.colCount-this.rowHeaderLevelCount-this.rightFrozenColCount).fill(h);this._columnHeaderCellFullPathIds.unshift(d);const u={id:h,title:typeof this.columnHeaderTitle.title=="string"?this.columnHeaderTitle.title:this.columnsDefine.reduce((c,g)=>typeof g=="string"?c:c+(c?`/${g.title}`:`${g.title}`),""),field:void 0,headerType:(r=(o=this.columnHeaderTitle)===null||o===void 0?void 0:o.headerType)!==null&&r!==void 0?r:"text",style:(s=this.columnHeaderTitle)===null||s===void 0?void 0:s.headerStyle,define:{id:h,disableHeaderHover:!!(!((l=this.columnHeaderTitle)===null||l===void 0)&&l.disableHeaderHover),disableHeaderSelect:!!(!((a=this.columnHeaderTitle)===null||a===void 0)&&a.disableHeaderSelect)}};this.columnHeaderObjs.push(u),this._headerObjects[h]=u}}_generateRowHeaderIds(){var t,e,n,o,r,s,l,a,h,d;if(((t=this.rowDimensionTree.tree.children)===null||t===void 0?void 0:t.length)>=1)if(this.rowHierarchyType==="tree")this._addHeadersForTreeMode(this._rowHeaderCellFullPathIds_FULL,0,this.rowDimensionTree.tree.children,[],this.rowDimensionTree.totalLevel,!0,this.rowsDefine,this.rowHeaderObjs);else{let u=0;if(this.dataset&&!this._table.isPivotChart()&&((n=(e=this.dataset.records)===null||e===void 0?void 0:e.length)!==null&&n!==void 0?n:0)===0&&!this.dataset.customColTree&&!this.dataset.customRowTree&&!this.indicatorsAsCol&&this.rowDimensionTree.totalLevel<this.rowHeaderLevelCount){u=this.rowHeaderLevelCount-this.rowDimensionTree.totalLevel;for(let c=0;c<u;c++)this._rowHeaderCellFullPathIds_FULL.unshift([])}this._addHeaders(this._rowHeaderCellFullPathIds_FULL,u,this.rowDimensionTree.tree.children,[],this.rowHeaderObjs)}if(this.rowHeaderTitle){this.sharedVar.seqId=Math.max(this.sharedVar.seqId,this._headerObjects.length);const u=++this.sharedVar.seqId,c=Array((r=(o=this._rowHeaderCellFullPathIds_FULL[0])===null||o===void 0?void 0:o.length)!==null&&r!==void 0?r:this.rowDimensionTree.tree.size).fill(u);this._rowHeaderCellFullPathIds_FULL.unshift(c);const g={id:u,title:typeof this.rowHeaderTitle.title=="string"?this.rowHeaderTitle.title:this.rowsDefine.reduce((f,p)=>typeof p=="string"?f:f+(f?`/${p.title}`:`${p.title}`),""),field:void 0,headerType:(l=(s=this.rowHeaderTitle)===null||s===void 0?void 0:s.headerType)!==null&&l!==void 0?l:"text",style:(a=this.rowHeaderTitle)===null||a===void 0?void 0:a.headerStyle,define:{id:u,disableHeaderHover:!!(!((h=this.rowHeaderTitle)===null||h===void 0)&&h.disableHeaderHover),disableHeaderSelect:!!(!((d=this.rowHeaderTitle)===null||d===void 0)&&d.disableHeaderSelect)}};this.rowHeaderObjs.push(g),this._headerObjects[u]=g}}_addHeaders(t,e,n,o,r){const s=this;t[e]||function(l){const a=t[l]=[];if(s.colIndex===0)return a;const h=t[l-1];for(let d=0;d<(h==null?void 0:h.length);d++)a[d]=h[d]}(e);for(let l=0;l<n.length;l++){const a=n[l];R8(a,t,r,o,e,this)}}_addHeadersForTreeMode(t,e,n,o,r,s,l,a){const h=this;t[e]||function(d){const u=t[d]=[];if(h.colIndex===0)return u;const c=t[d-1];for(let g=0;g<(c==null?void 0:c.length);g++)u[g]=c[g]}(e);for(let d=0;d<n.length;d++){const u=n[d];A8(u,t,a,o,e,r,s,l,this)}}_addCornerHeaders(t,e,n){var o,r;const s=[];if(this.cornerSetting.titleOnDimension==="all")if(this.indicatorsAsCol){let l=-1;t&&t.forEach((a,h)=>{var d,u;a===this.indicatorDimensionKey&&(l=h);const c=++this.sharedVar.seqId,g=n.find(p=>typeof p!="string"&&p.dimensionKey===a),f={id:c,title:a===this.indicatorDimensionKey?this.indicatorTitle:g?g.title:a==="axis"?"":a,field:a,style:this.cornerSetting.headerStyle,headerType:(d=this.cornerSetting.headerType)!==null&&d!==void 0?d:"text",showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,define:{showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,dimensionKey:a,id:c,value:a,headerEditor:this.cornerSetting.headerEditor,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect},dropDownMenu:g==null?void 0:g.cornerDropDownMenu,headerIcon:g==null?void 0:g.cornerHeaderIcon,pivotInfo:{value:(u=g==null?void 0:g.title)!==null&&u!==void 0?u:"",dimensionKey:a,isPivotCorner:!0},description:g==null?void 0:g.cornerDescription};s[c]=f,this._headerObjects[c]=f,this._cornerHeaderCellFullPathIds[h]||(this._cornerHeaderCellFullPathIds[h]=[]);for(let p=0;p<this.rowHeaderLevelCount;p++)this._cornerHeaderCellFullPathIds[h][p]=c}),e&&e.forEach((a,h)=>{var d,u;const c=++this.sharedVar.seqId,g=n.find(p=>typeof p!="string"&&p.dimensionKey===a),f={id:c,title:a===this.indicatorDimensionKey?this.indicatorTitle:g?g.title:a==="axis"?"":a,field:a,style:this.cornerSetting.headerStyle,headerType:(d=this.cornerSetting.headerType)!==null&&d!==void 0?d:"text",showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,define:{showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,dimensionKey:a,id:c,value:a,headerEditor:this.cornerSetting.headerEditor,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect},dropDownMenu:g==null?void 0:g.cornerDropDownMenu,headerIcon:g==null?void 0:g.cornerHeaderIcon,pivotInfo:{value:(u=g==null?void 0:g.title)!==null&&u!==void 0?u:"",dimensionKey:a,isPivotCorner:!0},description:g==null?void 0:g.cornerDescription};s[c]=f,this._headerObjects[c]=f,this._cornerHeaderCellFullPathIds[l]||(this._cornerHeaderCellFullPathIds[l]=[]),this._cornerHeaderCellFullPathIds[l][h]=c})}else{let l=-1;e&&e.forEach((a,h)=>{var d,u;a===this.indicatorDimensionKey&&(l=h);const c=++this.sharedVar.seqId,g=n.find(p=>typeof p!="string"&&p.dimensionKey===a),f={id:c,title:a===this.indicatorDimensionKey?this.indicatorTitle:g?g.title:a==="axis"?"":a,field:a,style:this.cornerSetting.headerStyle,headerType:(d=this.cornerSetting.headerType)!==null&&d!==void 0?d:"text",showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,define:{showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,dimensionKey:a,id:c,value:a,headerEditor:this.cornerSetting.headerEditor,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect},dropDownMenu:g==null?void 0:g.cornerDropDownMenu,headerIcon:g==null?void 0:g.cornerHeaderIcon,pivotInfo:{value:(u=g==null?void 0:g.title)!==null&&u!==void 0?u:"",dimensionKey:a,isPivotCorner:!0},description:g==null?void 0:g.cornerDescription};s[c]=f,this._headerObjects[c]=f;for(let p=0;p<this.columnHeaderLevelCount;p++)this._cornerHeaderCellFullPathIds[p]||(this._cornerHeaderCellFullPathIds[p]=[]),this._cornerHeaderCellFullPathIds[p][h]=c}),t&&t.forEach((a,h)=>{var d,u;const c=++this.sharedVar.seqId,g=n.find(p=>typeof p!="string"&&p.dimensionKey===a),f={id:c,title:a===this.indicatorDimensionKey?this.indicatorTitle:g?g.title:a==="axis"?"":a,field:a,style:this.cornerSetting.headerStyle,headerType:(d=this.cornerSetting.headerType)!==null&&d!==void 0?d:"text",showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,define:{showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,dimensionKey:a,id:c,value:a,headerEditor:this.cornerSetting.headerEditor,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect},dropDownMenu:g==null?void 0:g.cornerDropDownMenu,headerIcon:g==null?void 0:g.cornerHeaderIcon,pivotInfo:{value:(u=g==null?void 0:g.title)!==null&&u!==void 0?u:"",dimensionKey:a,isPivotCorner:!0},description:g==null?void 0:g.cornerDescription};s[c]=f,this._headerObjects[c]=f,this._cornerHeaderCellFullPathIds[h][l]=c})}else if(this.cornerSetting.titleOnDimension==="row"||this.cornerSetting.titleOnDimension==="column"){const l=((o=this.cornerSetting)===null||o===void 0?void 0:o.titleOnDimension)==="row"?e:t;l&&l.forEach((a,h)=>{var d,u;const c=++this.sharedVar.seqId,g=n.find(p=>typeof p!="string"&&p.dimensionKey===a),f={id:c,title:a===this.indicatorDimensionKey?this.indicatorTitle:g?g.title:a==="axis"?"":a,field:a,style:this.cornerSetting.headerStyle,headerType:(d=this.cornerSetting.headerType)!==null&&d!==void 0?d:"text",showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,define:{showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,dimensionKey:a,id:c,value:a,headerCustomRender:this.cornerSetting.customRender,headerCustomLayout:this.cornerSetting.customLayout,headerEditor:this.cornerSetting.headerEditor,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect},dropDownMenu:g==null?void 0:g.cornerDropDownMenu,headerIcon:g==null?void 0:g.cornerHeaderIcon,pivotInfo:{value:(u=g==null?void 0:g.title)!==null&&u!==void 0?u:"",dimensionKey:a,isPivotCorner:!0},description:g==null?void 0:g.cornerDescription};if(s[c]=f,this._headerObjects[c]=f,this.cornerSetting.titleOnDimension==="column"){this._cornerHeaderCellFullPathIds[h]||(this._cornerHeaderCellFullPathIds[h]=[]);for(let p=0;p<this.rowHeaderLevelCount;p++)this._cornerHeaderCellFullPathIds[h][p]=c}else if(this.cornerSetting.titleOnDimension==="row")for(let p=0;p<this.columnHeaderLevelCount;p++)this._cornerHeaderCellFullPathIds[p]||(this._cornerHeaderCellFullPathIds[p]=[]),this._cornerHeaderCellFullPathIds[p][h]=c})}else{const l=++this.sharedVar.seqId,a={id:l,title:"",field:"维度名称",style:this.cornerSetting.headerStyle,headerType:(r=this.cornerSetting.headerType)!==null&&r!==void 0?r:"text",define:{dimensionKey:"维度名称",id:l,headerCustomRender:this.cornerSetting.customRender,headerCustomLayout:this.cornerSetting.customLayout,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect}};s[l]=a,this._headerObjects[l]=a;for(let h=0;h<this.columnHeaderLevelCount;h++)for(let d=0;d<this.rowHeaderLevelCount;d++)this._cornerHeaderCellFullPathIds[h]||(this._cornerHeaderCellFullPathIds[h]=[]),this._cornerHeaderCellFullPathIds[h][d]=l}return s}generateExtensionRowTree(){this.extensionRows.forEach((t,e)=>{const n=this._rowHeaderCellFullPathIds_FULL;this._rowHeaderCellFullPathIds_FULL=[],n.forEach((o,r)=>{const s=o[o.length-1];let l,a;if(this.colIndex=0,typeof t.rowTree=="function"){const d=this.findFullCellIds(o);l=t.rowTree(d.map(u=>({dimensionKey:this._headerObjects[u].field,value:this._headerObjects[u].title})))}else l=Ee(t.rowTree);this._rowHeaderExtensionTree[s]?(this._rowHeaderExtensionTree[s].reset(this._rowHeaderExtensionTree[s].tree.children,!0),a=this._rowHeaderExtensionTree[s]):(a=new Pe(l??[],this.sharedVar,this.rowHierarchyType,void 0),this._rowHeaderExtensionTree[s]=a);const h=[];this._addHeadersForTreeMode(h,0,a.tree.children,[],a.totalLevel,!0,t.rows,this.rowHeaderObjs);for(let d=0;d<h[0].length;d++)this._rowHeaderCellFullPathIds_FULL.push(o.concat(h[0][d]))})})}setColumnWidths(){var t,e,n;const o=new Array(this.colCount).fill(void 0);if(this.leftRowSeriesNumberColumnCount&&(o[0]=this.leftRowSeriesNumberColumn[0]),this.showHeader&&this.showRowHeader)if(this.rowHeaderTitle&&(o[0+this.leftRowSeriesNumberColumnCount]={}),this.rowHierarchyType==="tree"){const r=this.rowDimensionKeys[0];if(r){const s=(t=this.rowsDefine)===null||t===void 0?void 0:t.find(l=>typeof l!="string"&&l.dimensionKey===r);s&&(o[0+(this.rowHeaderTitle?1:0)+this.leftRowSeriesNumberColumnCount]={width:s.width,minWidth:s.minWidth,maxWidth:s.maxWidth})}(e=this._extensionRowDimensionKeys)===null||e===void 0||e.forEach((s,l)=>{var a;const h=s[0];if(h){const d=(a=this.extensionRows[l].rows)===null||a===void 0?void 0:a.find(u=>typeof u!="string"&&u.dimensionKey===h);d&&(o[l+1+(this.rowHeaderTitle?1:0)+this.leftRowSeriesNumberColumnCount]={width:d.width,minWidth:d.minWidth,maxWidth:d.maxWidth})}})}else(this.rowDimensionTree.totalLevel>0?this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr():this.rowsDefine.map(r=>typeof r=="string"?r:r.dimensionKey)).forEach((r,s)=>{var l;const a=(l=this.rowsDefine)===null||l===void 0?void 0:l.find(h=>typeof h!="string"&&h.dimensionKey===r);a&&(o[s+(this.rowHeaderTitle?1:0)+this.leftRowSeriesNumberColumnCount]={width:a.width,minWidth:a.minWidth,maxWidth:a.maxWidth})});if(this.indicatorsAsCol)for(let r=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount;r<this.colCount;r++){const s=this.getBody(r,this.columnHeaderLevelCount);o[r]={width:s==null?void 0:s.width,minWidth:s==null?void 0:s.minWidth,maxWidth:s==null?void 0:s.maxWidth}}else{let r,s,l,a=0;(n=this._indicators)===null||n===void 0||n.forEach((h,d)=>{var u,c;typeof h.width=="number"?a=Math.max(h.width,a):h.width==="auto"&&(l=!0),typeof h.minWidth=="number"&&(s=Math.max(h.minWidth,(u=s)!==null&&u!==void 0?u:0)),typeof h.maxWidth=="number"&&(r=Math.min(h.maxWidth,(c=r)!==null&&c!==void 0?c:Number.MAX_VALUE))}),a=a>0?a:l?"auto":void 0,o.fill({width:a,minWidth:s,maxWidth:r},this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount,this.colCount-this.rightFrozenColCount)}this._columnWidths=o}get columnWidths(){return this._columnWidths}getColumnWidthDefined(t){return this._columnWidths[t]}get showHeader(){return this._showHeader}set showHeader(t){this._showHeader=t}get showColumnHeader(){return this._showColumnHeader}set showColumnHeader(t){this._showColumnHeader=t}get showRowHeader(){return this._showRowHeader}set showRowHeader(t){this._showRowHeader=t}get columnHeaderTitle(){return this._columnHeaderTitle}set columnHeaderTitle(t){this._columnHeaderTitle=t}get rowHeaderTitle(){return this._rowHeaderTitle}set rowHeaderTitle(t){this._rowHeaderTitle=t}getHeaderFieldKey(t,e){}getCellLocation(t,e){return this.isCornerHeader(t,e)?"cornerHeader":this.isColumnHeader(t,e)?"columnHeader":this.isRowHeader(t,e)?"rowHeader":"body"}isHeader(t,e){return t>=this.leftRowSeriesNumberColumnCount&&t<this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount||e>=0&&e<this.columnHeaderLevelCount||t>=this.colCount-this.rightHeaderColCount||e>=this.rowCount-this.bottomHeaderRowCount}isCornerHeader(t,e){return t>=0&&t<this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount&&e>=0&&e<this.columnHeaderLevelCount}isColumnHeader(t,e){return t>=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount&&e>=0&&e<this.columnHeaderLevelCount}isRowHeader(t,e){return t>=this.leftRowSeriesNumberColumnCount&&t<this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount&&e>=this.columnHeaderLevelCount}isFrozen(t,e){return this.isFrozenColumn(t)||this.isRightFrozenColumn(t)||this.isBottomFrozenRow(e)||this.isFrozenRow(e)||this.isSeriesNumberInBody(t,e)||this.isSeriesNumberInHeader(t,e)}isFrozenColumn(t,e){if(z(e)){if(t>=0&&t<this.frozenColCount&&e>=this.frozenRowCount&&e<this.rowCount-this.bottomFrozenRowCount)return!0}else if(this.frozenColCount>0&&t>=0&&t<this.frozenColCount)return!0;return!1}isRightFrozenColumn(t,e){if(z(e)){if(t>=this.colCount-this.rightFrozenColCount&&e>=this.frozenRowCount&&e<this.rowCount-this.bottomFrozenRowCount)return!0}else if(this.rightFrozenColCount>0&&t>=this.colCount-this.rightFrozenColCount)return!0;return!1}isFrozenRow(t,e){if(z(e)){if(e>=0&&e<this.frozenRowCount&&t>=this.frozenColCount&&t<this.colCount-this.rightFrozenColCount)return!0}else if(e=t,this.frozenRowCount>0&&e>=0&&e<this.frozenRowCount)return!0;return!1}isBottomFrozenRow(t,e){if(z(e)){if(e>=this.rowCount-this.bottomFrozenRowCount&&t>=this.frozenColCount&&t<this.colCount-this.rightFrozenColCount)return!0}else if(e=t,this.bottomFrozenRowCount>0&&e>=this.rowCount-this.bottomFrozenRowCount)return!0;return!1}isLeftTopCorner(t,e){return t>=0&&t<this.frozenColCount&&e>=0&&e<this.frozenRowCount}isLeftBottomCorner(t,e){return t>=0&&t<this.frozenColCount&&e>=this.rowCount-this.bottomFrozenRowCount}isRightTopCorner(t,e){return t>=this.colCount-this.rightFrozenColCount&&e>=0&&e<this.frozenRowCount}isRightBottomCorner(t,e){return t>=this.colCount-this.rightFrozenColCount&&e>=this.rowCount-this.bottomFrozenRowCount}getColumnHeaderRange(){return{start:{col:this.rowHeaderLevelCount,row:0},end:{col:this.colCount-1,row:this.columnHeaderLevelCount-1}}}getRowHeaderRange(){return{start:{col:0,row:this.columnHeaderLevelCount},end:{col:this.rowHeaderLevelCount-1,row:this.rowCount-1}}}getCornerHeaderRange(){return{start:{col:0,row:0},end:{col:this.rowHeaderLevelCount-1,row:this.columnHeaderLevelCount-1}}}getBodyRange(){return{start:{col:this.rowHeaderLevelCount,row:this.columnHeaderLevelCount},end:{col:this.colCount-1,row:this.rowCount-1}}}resetCellIds(){}get frozenColCount(){return this._table.internalProps.frozenColCount?this.colCount>this._table.internalProps.frozenColCount?this._table.internalProps.frozenColCount:this.colCount:0}get frozenRowCount(){return this._table.internalProps.frozenRowCount?this.rowCount>=this._table.internalProps.frozenRowCount?this._table.internalProps.frozenRowCount:this.rowCount:0}get headerLevelCount(){return this.columnHeaderLevelCount}resetColumnHeaderLevelCount(){var t,e,n,o,r,s,l,a,h,d,u;if(this.showHeader&&this.showColumnHeader){if(this._table.isPivotChart()&&this.indicatorsAsCol&&!(!((e=(t=this.dataset)===null||t===void 0?void 0:t.colKeys)===null||e===void 0)&&e.length)&&((o=(n=this.columnDimensionTree)===null||n===void 0?void 0:n.tree)===null||o===void 0?void 0:o.level)===0&&!this.hasTwoIndicatorAxes)return void(this.columnHeaderLevelCount=0);let c=this.indicatorsAsCol&&this.hideIndicatorName&&this.colDimensionKeys[this.colDimensionKeys.length-1]===this.indicatorDimensionKey?this.columnDimensionTree.totalLevel-1:this.columnDimensionTree.totalLevel;return c===0&&this.dataset&&!(!((r=this.dataset.customColTree)===null||r===void 0)&&r.length)?this.cornerSetting.titleOnDimension==="row"&&this.cornerSetting.forceShowHeader?c=1:this._table.isPivotChart()||((l=(s=this.dataset.records)===null||s===void 0?void 0:s.length)!==null&&l!==void 0?l:0)!==0||this.cornerSetting.titleOnDimension!=="column"&&this.cornerSetting.titleOnDimension!=="all"||(c=(a=this.columnsDefine.length)!==null&&a!==void 0?a:0):!this.dataset||this._table.isPivotChart()||((d=(h=this.dataset.records)===null||h===void 0?void 0:h.length)!==null&&d!==void 0?d:0)!==0||this.dataset.customColTree||this.cornerSetting.titleOnDimension!=="column"&&this.cornerSetting.titleOnDimension!=="all"||(c=(u=this.columnsDefine.length)!==null&&u!==void 0?u:0,!this.hideIndicatorName&&this.indicatorsAsCol&&c++),this.columnHeaderTitle&&(c+=1),this._table.isPivotChart()&&this.indicatorsAsCol&&!this.hasTwoIndicatorAxes&&Lh(this.indicatorsDefine)&&(c-=1),void(this.columnHeaderLevelCount=c)}this.columnHeaderLevelCount=this.indicatorsAsCol?this.hideIndicatorName?0:1:0}resetRowHeaderLevelCount(){var t,e,n,o,r,s,l,a;if(this.showHeader&&this.showRowHeader){if(this.rowHierarchyType==="tree"){const u=(e=(t=this.extensionRows)===null||t===void 0?void 0:t.length)!==null&&e!==void 0?e:0;return this.rowHeaderTitle?void(this.rowHeaderLevelCount=2+u):void(this.rowHeaderLevelCount=1+u)}const h=this.rowDimensionTree.totalLevel;let d=h;return d===0&&this.dataset&&!(!((n=this.dataset.customRowTree)===null||n===void 0)&&n.length)?this.cornerSetting.titleOnDimension==="column"&&this.cornerSetting.forceShowHeader?d=1:this._table.isPivotChart()||((r=(o=this.dataset.records)===null||o===void 0?void 0:o.length)!==null&&r!==void 0?r:0)!==0||this.cornerSetting.titleOnDimension!=="row"&&this.cornerSetting.titleOnDimension!=="all"||(d=(s=this.rowsDefine.length)!==null&&s!==void 0?s:0):!this.dataset||this._table.isPivotChart()||((a=(l=this.dataset.records)===null||l===void 0?void 0:l.length)!==null&&a!==void 0?a:0)!==0||this.dataset.customRowTree||this.cornerSetting.titleOnDimension!=="row"&&this.cornerSetting.titleOnDimension!=="all"||(d=this.rowsDefine.length,this.hideIndicatorName||this.indicatorsAsCol||d++),!this.indicatorsAsCol&&this.hideIndicatorName&&this.rowDimensionKeys[this.rowDimensionKeys.length-1]===this.indicatorDimensionKey&&(d=h-1),this.rowHeaderTitle&&(d+=1),void(this.rowHeaderLevelCount=d)}this.rowHeaderLevelCount=this.indicatorsAsCol||this.hideIndicatorName?0:1}get columnHeaderLevelCount(){return this._columnHeaderLevelCount}set columnHeaderLevelCount(t){this._columnHeaderLevelCount=t}get rowHeaderLevelCount(){return this._rowHeaderLevelCount}set rowHeaderLevelCount(t){this._rowHeaderLevelCount=t}get colCount(){var t;return(this.columnDimensionTree.totalLevel>0||this._table.isPivotChart()||((t=this.dataset.records)===null||t===void 0?void 0:t.length)>0||this.dataset.records&&!Array.isArray(this.dataset.records)?this.columnDimensionTree.tree.size:0)+this.rowHeaderLevelCount+this.rightHeaderColCount+this.leftRowSeriesNumberColumnCount}get rowCount(){var t,e,n,o;return((this._table.records||this.dataset.records)&&(!Array.isArray(this._table.records)||this._table.records.length>0)&&((t=this._indicators)===null||t===void 0?void 0:t.length)>0&&!(!((e=this._rowHeaderCellIds)===null||e===void 0)&&e.length)?1:(o=(n=this._rowHeaderCellIds)===null||n===void 0?void 0:n.length)!==null&&o!==void 0?o:0)+this.columnHeaderLevelCount+this.bottomHeaderRowCount}get bodyRowSpanCount(){return this.rowDimensionTree.tree.size}get bottomFrozenRowCount(){if(!this._table.isPivotChart())return this._table.internalProps.bottomFrozenRowCount?this.rowCount-this.headerLevelCount>=this._table.internalProps.bottomFrozenRowCount?this._table.internalProps.bottomFrozenRowCount:this.rowCount-this.headerLevelCount:0;if(this.indicatorKeys.length>=1&&Lh(this.indicatorsDefine)){const t=this._table.pivotChartAxes.find(e=>e.orient==="bottom");return(t==null?void 0:t.visible)===!1?0:(this.indicatorsAsCol,1)}return 0}get rightFrozenColCount(){if(!this._table.isPivotChart())return this._table.internalProps.rightFrozenColCount?this.colCount-this.rowHeaderLevelCount>=this._table.internalProps.rightFrozenColCount?this._table.internalProps.rightFrozenColCount:this.colCount-this.rowHeaderLevelCount:0;const t=this._table.pivotChartAxes.find(e=>e.orient==="right");return(t==null?void 0:t.visible)===!1||this.indicatorsAsCol?0:this.hasTwoIndicatorAxes?1:0}get bodyRowCount(){return this.rowCount-this.bottomFrozenRowCount-this.headerLevelCount}get bodyColCount(){return this.colCount-this.rightFrozenColCount-this.rowHeaderLevelCount}get headerObjects(){return this._headerObjects}get columnObjects(){return this._indicators}getCellId(t,e){var n,o,r,s,l;if(e>=0&&t>=0){if(this.isSeriesNumber(t,e))return"";if(this.isCornerHeader(t,e))return(n=this._cornerHeaderCellIds[e])===null||n===void 0?void 0:n[t-this.leftRowSeriesNumberColumnCount];if(this.isColumnHeader(t,e))return(o=this._columnHeaderCellIds[e])===null||o===void 0?void 0:o[t-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount];if(this.isRowHeader(t,e))return(r=this._rowHeaderCellIds[e-this.columnHeaderLevelCount])===null||r===void 0?void 0:r[t-this.leftRowSeriesNumberColumnCount];if(this.isRightFrozenColumn(t,e))return(s=this._rowHeaderCellIds[e-this.columnHeaderLevelCount])===null||s===void 0?void 0:s[this.rowHeaderLevelCount-1];if(this.isBottomFrozenRow(t,e))return(l=this._columnHeaderCellIds[this.columnHeaderLevelCount-1])===null||l===void 0?void 0:l[t-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount]}}getHeader(t,e){var n;if(this.isSeriesNumberInHeader(t,e))return this.getSeriesNumberHeader(t,e);const o=this.getCellId(t,e);return(n=this._headerObjectMap[o])!==null&&n!==void 0?n:{id:void 0,field:"",headerType:"text",define:void 0}}getHeaderField(t,e){var n,o;const r=this.getCellId(t,e);return((n=this._headerObjectMap[r])===null||n===void 0?void 0:n.field)||((o=this.getBody(t,e))===null||o===void 0?void 0:o.field)}getHeaderCellAdressById(t){for(let e=0;e<this._columnHeaderCellIds.length;e++){const n=this._columnHeaderCellIds[e];for(let o=0;o<n.length;o++)if(n[o]===t)return{col:o+this._table.frozenColCount,row:e}}for(let e=0;e<this._rowHeaderCellIds.length;e++){const n=this._rowHeaderCellIds[e];for(let o=0;o<n.length;o++)if(n[o]===t)return{col:o,row:e+this._table.frozenRowCount}}for(let e=0;e<this._cornerHeaderCellIds.length;e++){const n=this._cornerHeaderCellIds[e];for(let o=0;o<n.length;o++)if(n[o]===t)return{col:o,row:e}}}getHeaderCellAddressByField(t){const e=this.headerObjects.find(n=>n&&n.field===t);return e&&this.getHeaderCellAdressById(e.id)}getBody(t,e){var n,o,r,s,l,a,h,d,u,c;const g=this.getBodyWidthCache(t,e);if(g)return g;if(this.isSeriesNumber(t,e)){const b=this.getSeriesNumberBody(t,e);return this.setBodyWidthCache(t,e,b),b}const f=this.getCellHeaderPaths(t,e);if(this.indicatorsAsCol){const b=(o=(n=f.colHeaderPaths)===null||n===void 0?void 0:n.find(_=>_.indicatorKey))===null||o===void 0?void 0:o.indicatorKey,C=z(b)&&(l=(s=(r=this._indicators)===null||r===void 0?void 0:r.find(_=>_.indicatorKey===b))!==null&&s!==void 0?s:this._indicators[0])!==null&&l!==void 0?l:{id:"",field:void 0,indicatorKey:void 0,cellType:"text",define:void 0};return this.setBodyWidthCache(t,e,C),C}const p=(h=(a=f.rowHeaderPaths)===null||a===void 0?void 0:a.find(b=>b.indicatorKey))===null||h===void 0?void 0:h.indicatorKey,m=z(p)&&(c=(u=(d=this._indicators)===null||d===void 0?void 0:d.find(b=>b.indicatorKey===p))!==null&&u!==void 0?u:this._indicators[0])!==null&&c!==void 0?c:{id:"",field:void 0,indicatorKey:void 0,cellType:"text",define:void 0};return this.setBodyWidthCache(t,e,m),m}getCellRange(t,e){var n,o;const r={start:{col:t,row:e},end:{col:t,row:e}};if(!this.isHeader(t,e)||t===-1||e===-1||this.isRightFrozenColumn(t,e)||this.isBottomFrozenRow(t,e))return r;if(this._table.isPivotChart()){if(this.isLeftBottomCorner(t,e))return{start:{col:0,row:this.rowCount-this.bottomFrozenRowCount},end:{col:this.frozenColCount-1,row:this.rowCount-1}};if(this.isRightTopCorner(t,e))return{start:{col:this.colCount-this.rightFrozenColCount,row:0},end:{col:this.colCount-1,row:this.frozenRowCount-1}};if(this.isRightBottomCorner(t,e))return{start:{col:this.colCount-this.rightFrozenColCount,row:this.rowCount-this.bottomFrozenRowCount},end:{col:this.colCount-1,row:this.rowCount-1}}}for(let s=0;s<this._largeCellRangeCache.length;s++){const l=this._largeCellRangeCache[s];if(t>=l.start.col&&t<=l.end.col&&e>=l.start.row&&e<=l.end.row)return l}if(this.isHeader(t,e)&&t!==-1&&e!==-1){const s=this.getCellId(t,e);for(let l=t-1;l>=0&&s===this.getCellId(l,e);l--)r.start.col=l;for(let l=t+1;l<((n=this.colCount)!==null&&n!==void 0?n:0)&&s===this.getCellId(l,e);l++)r.end.col=l;for(let l=e-1;l>=0&&s===this.getCellId(t,l);l--)r.start.row=l;for(let l=e+1;l<((o=this.rowCount)!==null&&o!==void 0?o:0)&&!(s!==this.getCellId(t,l)||this.isSeriesNumberInHeader(t,e)&&l>=this.columnHeaderLevelCount);l++)r.end.row=l}return(r.end.col-r.start.col>100||r.end.row-r.start.row>100)&&this._largeCellRangeCache.push(r),r}isCellRangeEqual(t,e,n,o){const r=this.getCellRange(t,e),s=this.getCellRange(n,o);return r.start.col===s.start.col&&r.end.col===s.end.col&&r.start.row===s.start.row&&r.end.row===s.end.row}getBodyIndexByRow(t){return t<this.columnHeaderLevelCount||t>=this.rowCount-this.bottomHeaderRowCount?-1:t-this.columnHeaderLevelCount}get bottomHeaderRowCount(){return this._table.isPivotChart()?this.bottomFrozenRowCount:0}get rightHeaderColCount(){return this._table.isPivotChart()?this.rightFrozenColCount:0}getBodyIndexByCol(t){return t<this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount||t>=this.colCount-this.rightHeaderColCount?-1:t-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount}getRecordStartRowByRecordIndex(t){return this.columnHeaderLevelCount+t}getRecordShowIndexByCell(t,e){}getCellHeaderPathsWithTreeNode(t,e){for(let l=0;l<this._largeCellRangeCache.length;l++){const a=this._largeCellRangeCache[l];if(t>=a.start.col&&t<=a.end.col&&e>=a.start.row&&e<=a.end.row)break}let n=this.getColHeaderPathCache(t,e),o=this.getRowHeaderPathCache(t,e);const r=this.getBodyIndexByCol(t),s=this.getBodyIndexByRow(e)+this.currentPageStartIndex;if(!n&&e>=0&&r>=0&&(n=this.columnDimensionTree.getTreePath(r,this.showHeader&&this.showColumnHeader?e-(this.columnHeaderTitle?1:0):this.columnDimensionTree.totalLevel),this.setColHeaderPathCache(t,e,n)),!o&&t>=0&&s>=0){if(o=[],this.rowHierarchyType==="tree"){const l=this._rowHeaderCellFullPathIds[s];let a=this.rowDimensionTree,h=0;for(;a;){const d=[];let u=l[h];for(d.push(u);;){const g=this._headerObjectMap[u];if(!(g!=null&&g.parentCellId))break;d.unshift(g.parentCellId),u=g.parentCellId}const c=a.getTreePathByCellIds(d);o.push(...c),a=this._rowHeaderExtensionTree[l[h]],h++}}else o=this.rowDimensionTree.getTreePath(s,this.showHeader&&this.showRowHeader?t-(this.rowHeaderTitle?1:0)-this.leftRowSeriesNumberColumnCount:this.rowDimensionTree.totalLevel);this.setRowHeaderPathCache(t,e,o)}return{colHeaderPaths:n,rowHeaderPaths:o,cellLocation:this.getCellLocation(t,e)}}getCellHeaderPaths(t,e){var n,o;const r=this.getCellHeaderPathsWithTreeNode(t,e),s={colHeaderPaths:[],rowHeaderPaths:[],cellLocation:r.cellLocation};return(n=r.colHeaderPaths)===null||n===void 0||n.forEach(l=>{var a,h,d;const u={};u.dimensionKey=l.dimensionKey,u.indicatorKey=l.indicatorKey,u.value=(d=(a=l.value)!==null&&a!==void 0?a:(h=this.getIndicatorInfoByIndicatorKey(l.indicatorKey))===null||h===void 0?void 0:h.title)!==null&&d!==void 0?d:"",u.virtual=l.virtual,s.colHeaderPaths.push(u)}),(o=r.rowHeaderPaths)===null||o===void 0||o.forEach(l=>{var a,h,d;if(l.dimensionKey!=="axis"){const u={};u.dimensionKey=l.dimensionKey,u.indicatorKey=l.indicatorKey,u.value=(d=(a=l.value)!==null&&a!==void 0?a:(h=this.getIndicatorInfoByIndicatorKey(l.indicatorKey))===null||h===void 0?void 0:h.title)!==null&&d!==void 0?d:"",u.virtual=l.virtual,s.rowHeaderPaths.push(u)}}),s}getIndicatorInfoByIndicatorKey(t){var e;return(e=this.indicatorsDefine)===null||e===void 0?void 0:e.find(n=>typeof n!="string"&&!!t&&n.indicatorKey===t)}findFullCellIds(t){const e=[];for(let n=0;n<t.length;n++){let o=t[n];for(e.push(o);;){const r=this._headerObjectMap[o];if(!(r!=null&&r.parentCellId))break;e.unshift(r.parentCellId),o=r.parentCellId}}return e}getHeaderDimension(t,e){var n,o,r;if(this.isHeader(t,e)){const s=this.getHeader(t,e);return(o=(n=this.rowsDefine)===null||n===void 0?void 0:n.find(l=>typeof l!="string"&&l.dimensionKey===s.field))!==null&&o!==void 0?o:(r=this.columnsDefine)===null||r===void 0?void 0:r.find(l=>typeof l!="string"&&l.dimensionKey===s.field)}}isColumnIndicatorHeader(t,e){return this._indicatorShowType==="column"&&e===this.columnHeaderLevelCount-1&&t>=this.rowHeaderLevelCount}isRowIndicatorHeader(t,e){return this._indicatorShowType==="row"&&t===this.rowHeaderLevelCount-1&&e>=this.columnHeaderLevelCount}isIndicatorHeader(t,e){return this.isColumnIndicatorHeader(t,e)||this.isRowIndicatorHeader(t,e)}toggleHierarchyState(t,e){var n,o,r,s,l,a;this.colIndex=0;const h=this._rowHeaderCellFullPathIds_FULL.slice(0),d=h.map((g,f)=>({col:t,row:f+this.columnHeaderLevelCount})),u=this.getHeader(t,e);if(u.define.hierarchyState=u.define.hierarchyState===Vt.collapse?Vt.expand:Vt.collapse,this.rowDimensionTree.reset(this.rowDimensionTree.tree.children,!0),this._rowHeaderCellFullPathIds_FULL=[],this.rowDimensionKeys=this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr(),this.fullRowDimensionKeys=[],this.fullRowDimensionKeys=this.fullRowDimensionKeys.concat(this.rowDimensionKeys),this._addHeadersForTreeMode(this._rowHeaderCellFullPathIds_FULL,0,this.rowDimensionTree.tree.children,[],this.rowDimensionTree.totalLevel,!0,this.rowsDefine,this.rowHeaderObjs),this.rowHeaderTitle){const g=++this.sharedVar.seqId,f=Array(this.rowCount-this.columnHeaderLevelCount).fill(g);this._rowHeaderCellFullPathIds_FULL.unshift(f);const p={id:g,title:typeof this.rowHeaderTitle.title=="string"?this.rowHeaderTitle.title:this.rowsDefine.reduce((m,b)=>typeof b=="string"?m:m+(m?`/${b.title}`:`${b.title}`),""),field:void 0,headerType:(o=(n=this.rowHeaderTitle)===null||n===void 0?void 0:n.headerType)!==null&&o!==void 0?o:"text",style:(r=this.rowHeaderTitle)===null||r===void 0?void 0:r.headerStyle,define:{field:"",headerType:"text",cellType:"text",disableHeaderHover:!!(!((s=this.rowHeaderTitle)===null||s===void 0)&&s.disableHeaderHover),disableHeaderSelect:!!(!((l=this.rowHeaderTitle)===null||l===void 0)&&l.disableHeaderSelect)}};this.rowHeaderObjs.push(p),this._headerObjects[g]=p}this._rowHeaderCellFullPathIds_FULL=im(this._rowHeaderCellFullPathIds_FULL),this.rowHierarchyType==="tree"&&((a=this.extensionRows)===null||a===void 0?void 0:a.length)>=1&&this.generateExtensionRowTree(),this.colIndex=0,this._headerObjectMap=this._headerObjects.reduce((g,f)=>(g[f.id]=f,g),{}),this._CellHeaderPathMap=new Map,this._largeCellRangeCache.length=0;const c=D9(t,e,h.map(g=>g[t-this.leftRowSeriesNumberColumnCount]),this._rowHeaderCellFullPathIds_FULL.map(g=>g[t-this.leftRowSeriesNumberColumnCount]),d,this);return this.generateCellIdsConsiderHideHeader(),this.setPagination(this.pagination),c}isHeaderForColWidth(t,e){return this.isHeader(t,e)}getHeaderForColWidth(t,e){return this.getHeader(t,e)}getPivotCellAdress(t){var e;if(!Array.isArray(t))return;let n,o,r=this.rowTree,s=this.columnTree;for(let h=0;h<t.length;h++){const d=t[h];if((d.isPivotCorner||!z(d.value))&&h===t.length-1){if(((e=this==null?void 0:this.cornerSetting)===null||e===void 0?void 0:e.titleOnDimension)==="row"){let g=0;return this.rowHierarchyType==="grid"&&(g=this.rowDimensionKeys.indexOf(d.dimensionKey)),g===-1?void 0:{col:(this.rowHeaderTitle?g+1:g)+this.leftRowSeriesNumberColumnCount,row:0}}const c=this.colDimensionKeys.indexOf(d.dimensionKey);return c===-1?void 0:{col:0+this.leftRowSeriesNumberColumnCount,row:this.columnHeaderTitle?c+1:c}}let u=!1;for(let c=0;c<s.length;c++){const g=s[c];if((z(d.dimensionKey)&&g.dimensionKey===d.dimensionKey||z(d.indicatorKey)&&g.indicatorKey===d.indicatorKey)&&g.value===d.value){s=g.children,o=g,u=!0;break}}if(!u)for(let c=0;c<r.length;c++){const g=r[c];if((z(d.dimensionKey)&&g.dimensionKey===d.dimensionKey||z(d.indicatorKey)&&g.indicatorKey===d.indicatorKey)&&g.value===d.value){r=g.children,n=g;break}}}let l=0,a=0;if(n){a=this.columnHeaderLevelCount;const{startInTotal:h,level:d}=n;return a+=h,l=this.rowHierarchyType==="grid"?(this.rowHeaderTitle?d+1:d)+this.leftRowSeriesNumberColumnCount:0+this.leftRowSeriesNumberColumnCount,{col:l,row:a}}if(o){l=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount;const{startInTotal:h,level:d}=o;return l+=h,a=this.columnHeaderTitle?d+1:d,{col:l,row:a}}}getPivotDimensionInfo(t,e){var n;const{colHeaderPaths:o,rowHeaderPaths:r}=this.getCellHeaderPaths(t,e),s=[];return o.length?o.forEach((l,a)=>{s.push({dimensionKey:l.dimensionKey,value:l.value,isPivotCorner:!1,indicatorKey:l.indicatorKey})}):r.length?r.forEach((l,a)=>{s.push({dimensionKey:l.dimensionKey,value:l.value,isPivotCorner:!1,indicatorKey:l.indicatorKey})}):this.isCornerHeader(t,e)&&(((n=this==null?void 0:this.cornerSetting)===null||n===void 0?void 0:n.titleOnDimension)==="row"?s.push({dimensionKey:this.rowDimensionKeys[(this.rowHeaderTitle?t-1:t)-this.leftRowSeriesNumberColumnCount],isPivotCorner:!0}):s.push({dimensionKey:this.colDimensionKeys[this.columnHeaderTitle?e-1:e],isPivotCorner:!0})),s}getIndicatorKey(t,e){var n;return(n=this.getBody(t,e))===null||n===void 0?void 0:n.indicatorKey}getParentCellId(t,e){if(e!==0)return this.isColumnHeader(t,e)?this.getCellId(t,e-1):this.isRowHeader(t,e)?this.getCellId(t-1,e):void 0}getRowHeaderCellAddressByCellId(t){let e,n;if(this._rowHeaderCellIds.find((o,r)=>!!o.find((s,l)=>s===t&&(e=l,!0))&&(n=r,!0)),z(e)&&z(n))return{col:e,row:n+this.columnHeaderLevelCount}}canMoveHeaderPosition(t,e){if(this.isSeriesNumberInHeader(e.col,e.row)||this.isSeriesNumberInHeader(t.col,t.row)||this.isCornerHeader(e.col,e.row)||t.col<0||t.row<0||e.col<0||e.row<0)return!1;this.isSeriesNumberInBody(e.col,e.row)&&this.isSeriesNumberInBody(t.col,t.row)&&(t.col=t.col+this.leftRowSeriesNumberColumnCount+this.rowHeaderLevelCount-1,e.col=e.col+this.leftRowSeriesNumberColumnCount+this.rowHeaderLevelCount-1);const n=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row))return this.getParentCellId(t.col,n.start.row)===this.getParentCellId(e.col,n.start.row);if(this.isRowHeader(t.col,t.row)){if(this.rowHierarchyType!=="tree")return this.getParentCellId(n.start.col,t.row)===this.getParentCellId(n.start.col,e.row);{const o=Ee(this.getCellHeaderPathsWithTreeNode(t.col,t.row).rowHeaderPaths),r=Ee(this.getCellHeaderPathsWithTreeNode(e.col,e.row).rowHeaderPaths);if(o.pop(),r.pop(),o.length<=r.length){if(o.length===r.length)return!o.find((s,l)=>s.dimensionKey!==r[l].dimensionKey||s.value!==r[l].value);if(o.length>0){for(let s=0;s<o.length;s++)if(o[s].startInTotal!==r[s].startInTotal)return!1}return!0}}}return!1}moveHeaderPosition(t,e){if(this.canMoveHeaderPosition(t,e)&&!this.isCellRangeEqual(t.col,t.row,e.col,e.row)){const n=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row)){const o=n.end.col-n.start.col+1;let r;const s=this.getCellRange(e.col,n.start.row);if(r=e.col>=t.col?s.end.col-o+1:s.start.col,r===n.start.col)return null;for(let a=0;a<this._columnHeaderCellFullPathIds.length;a++){const h=this._columnHeaderCellFullPathIds[a].splice(n.start.col-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount,o);h.unshift(r-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount,0),Array.prototype.splice.apply(this._columnHeaderCellFullPathIds[a],h)}const l=this._columnWidths.splice(n.start.col-this.leftRowSeriesNumberColumnCount,o);return l.unshift(r-this.leftRowSeriesNumberColumnCount,0),Array.prototype.splice.apply(this._columnWidths,l),this.columnDimensionTree.movePosition(this.getCellHeaderPathsWithTreeNode(t.col,t.row).colHeaderPaths.length-1,n.start.col-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount,s.start.col-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount),this.columnDimensionTree.reset(this.columnDimensionTree.tree.children,!0),this._CellHeaderPathMap=new Map,this._largeCellRangeCache.length=0,{sourceIndex:n.start.col,targetIndex:r,sourceSize:o,targetSize:s.end.col-s.start.col+1,moveType:"column"}}if(this.isRowHeader(t.col,t.row)){let o;const r=this.getCellHeaderPathsWithTreeNode(t.col,t.row).rowHeaderPaths,s=this.getCellHeaderPathsWithTreeNode(e.col,e.row).rowHeaderPaths,l=r[r.length-1],a=s[r.length-1],h=l.size;if(o=e.row>=t.row?a.startInTotal+a.size-h:a.startInTotal,o===n.start.row-this.columnHeaderLevelCount)return null;const d=this._rowHeaderCellIds.splice(n.start.row-this.columnHeaderLevelCount,h);d.unshift(o-this.currentPageStartIndex,0),Array.prototype.splice.apply(this._rowHeaderCellIds,d);const u=this._rowHeaderCellFullPathIds.splice(n.start.row-this.columnHeaderLevelCount,h);u.unshift(o-this.currentPageStartIndex,0),Array.prototype.splice.apply(this._rowHeaderCellFullPathIds,u);const c=this._rowHeaderCellIds_FULL.splice(n.start.row-this.columnHeaderLevelCount+this.currentPageStartIndex,h);c.unshift(o,0),Array.prototype.splice.apply(this._rowHeaderCellIds_FULL,c);const g=this._rowHeaderCellFullPathIds_FULL.splice(n.start.row-this.columnHeaderLevelCount+this.currentPageStartIndex,h);return g.unshift(o,0),Array.prototype.splice.apply(this._rowHeaderCellFullPathIds_FULL,g),this.rowDimensionTree.movePosition(r.length-1,n.start.row-this.columnHeaderLevelCount,o+(e.row>t.row?l.size-1:0)),this.rowDimensionTree.reset(this.rowDimensionTree.tree.children,!0),this._CellHeaderPathMap=new Map,this._largeCellRangeCache.length=0,{sourceIndex:n.start.row,targetIndex:o+this.columnHeaderLevelCount,sourceSize:h,targetSize:a.size,moveType:"row"}}}return null}getCellAdressByHeaderPath(t){var e,n,o,r,s,l;let a,h,d=!1,u=!1;if(Array.isArray(t)){if(t.length>this.rowDimensionKeys.length+this.colDimensionKeys.length)return;a=t.filter(y=>this.colDimensionKeys.indexOf(y.dimensionKey)>=0||this.colDimensionKeys.indexOf(this.indicatorDimensionKey)>=0&&y.indicatorKey),h=t.filter(y=>this.rowDimensionKeys.indexOf(y.dimensionKey)>=0||this.rowDimensionKeys.indexOf(this.indicatorDimensionKey)>=0&&y.indicatorKey)}else a=t.colHeaderPaths,h=t.rowHeaderPaths,(t==null?void 0:t.cellLocation)==="body"&&this._table.isPivotTable()&&(u=!0);if(!Array.isArray(a)&&!Array.isArray(h))return;if(a==null||a.sort((y,S)=>{var A,R;return this.colDimensionKeys.indexOf((A=y.dimensionKey)!==null&&A!==void 0?A:this.indicatorDimensionKey)-this.colDimensionKeys.indexOf((R=S.dimensionKey)!==null&&R!==void 0?R:this.indicatorDimensionKey)}),h==null||h.sort((y,S)=>{var A,R;return this.fullRowDimensionKeys.indexOf((A=y.dimensionKey)!==null&&A!==void 0?A:this.indicatorDimensionKey)-this.fullRowDimensionKeys.indexOf((R=S.dimensionKey)!==null&&R!==void 0?R:this.indicatorDimensionKey)}),a==null||a.forEach(y=>{y.isPivotCorner&&(d=!0)}),h==null||h.forEach(y=>{y.isPivotCorner&&(d=!0)}),d){if(this.cornerSetting.titleOnDimension==="all"&&this.indicatorsAsCol&&a.length===0){for(let y=0;y<this.rowDimensionKeys.length;y++)if(((e=h[0])===null||e===void 0?void 0:e.dimensionKey)===this.rowDimensionKeys[y])return{col:y+this.leftRowSeriesNumberColumnCount,row:this.columnHeaderLevelCount-1}}else if(this.cornerSetting.titleOnDimension!=="all"||this.indicatorsAsCol||h.length!==0){if(this.cornerSetting.titleOnDimension==="row"||this.cornerSetting.titleOnDimension==="all"&&!this.indicatorsAsCol){for(let y=0;y<this.rowDimensionKeys.length;y++)if(((o=h[0])===null||o===void 0?void 0:o.dimensionKey)===this.rowDimensionKeys[y])return{col:y+this.leftRowSeriesNumberColumnCount,row:0}}else for(let y=0;y<this.colDimensionKeys.length;y++)if(((r=a[0])===null||r===void 0?void 0:r.dimensionKey)===this.colDimensionKeys[y])return{col:0,row:y}}else for(let y=0;y<this.colDimensionKeys.length;y++)if(((n=a[0])===null||n===void 0?void 0:n.dimensionKey)===this.colDimensionKeys[y])return{col:this.rowHeaderLevelCount-1,row:y}}let c,g,f,p,m=!1;(a==null?void 0:a.length)>=1&&(h==null?void 0:h.length)>=1&&(m=!0);let b,C,_=this.rowTree,w=this.columnTree;if(a)for(let y=0;y<a.length;y++){const S=a[y];for(let A=0;A<w.length;A++){const R=w[A];if(!z(S.indicatorKey)&&R.dimensionKey===S.dimensionKey&&R.value===S.value||z(S.indicatorKey)&&R.indicatorKey===S.indicatorKey){w=R.children,m&&!w?C=R:m||(C=R);break}}}if((h==null?void 0:h.length)>=1)if(this.rowHierarchyType==="tree"){const y=h[h.length-1],S=this.headerObjects.filter(R=>((R==null?void 0:R.field)===y.dimensionKey||(R==null?void 0:R.field)===y.indicatorKey)&&(R==null?void 0:R.title)===y.value).map(R=>R.id),A=this._rowHeaderCellIds.filter(R=>S.indexOf(R[R.length-1])>=0).find(R=>{const x=this.findFullCellIds(R);return x.length===h.length&&x.every(T=>{const M=this._headerObjectMap[T];return h.find(B=>B.dimensionKey===M.field&&B.value===M.title)})});g=this._rowHeaderCellIds.indexOf(A)+this.columnHeaderLevelCount}else for(let y=0;y<h.length;y++){const S=h[y];for(let A=0;A<_.length;A++){const R=_[A];if(!z(S.indicatorKey)&&R.dimensionKey===S.dimensionKey&&R.value===S.value||z(S.indicatorKey)&&R.indicatorKey===S.indicatorKey&&(!z(S.value)||R.value===S.value)){_=R.children,(!m||_&&!_.some(x=>x.dimensionKey==="axis"))&&m||(b=R);break}}}if(u||!m||(b||z(g))&&C){if(b||u){g=this.columnHeaderLevelCount;const{startInTotal:y,level:S}=(s=b)!==null&&s!==void 0?s:RT;g+=y??0,f=this.rowHierarchyType==="grid"?(this.rowHeaderTitle?S+1:S)+this.leftRowSeriesNumberColumnCount:0}if(C||u){c=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount;const{startInTotal:y,level:S}=(l=C)!==null&&l!==void 0?l:RT;c+=y??0,p=this.columnHeaderTitle?S+1:S}return z(c)||z(g)?{col:c??f,row:g??p}:void 0}}setChartInstance(t,e,n){var o,r,s,l;const a=this.getCellHeaderPaths(t,e);let h;if(this.indicatorsAsCol){const d=(o=a.colHeaderPaths.find(u=>u.indicatorKey))===null||o===void 0?void 0:o.indicatorKey;h=(r=this._indicators)===null||r===void 0?void 0:r.find(u=>u.indicatorKey===d)}else{const d=(s=a.rowHeaderPaths.find(u=>u.indicatorKey))===null||s===void 0?void 0:s.indicatorKey;h=(l=this._indicators)===null||l===void 0?void 0:l.find(u=>u.indicatorKey===d)}typeof(h==null?void 0:h.chartSpec)!="function"&&h&&(h.chartInstance=n)}getChartInstance(t,e){var n,o,r,s;const l=this.getCellHeaderPaths(t,e);let a;if(this.indicatorsAsCol){const h=(n=l.colHeaderPaths.find(d=>d.indicatorKey))===null||n===void 0?void 0:n.indicatorKey;a=(o=this._indicators)===null||o===void 0?void 0:o.find(d=>d.indicatorKey===h)}else{const h=(r=l.rowHeaderPaths.find(d=>d.indicatorKey))===null||r===void 0?void 0:r.indicatorKey;a=(s=this._indicators)===null||s===void 0?void 0:s.find(d=>d.indicatorKey===h)}return a==null?void 0:a.chartInstance}checkHasChart(){return uT(this)}getDimension(t,e){var n,o;return e==="column"?(n=this.columnsDefine)===null||n===void 0?void 0:n.find(r=>typeof r!="string"&&r.dimensionKey===t):e==="row"?(o=this.rowsDefine)===null||o===void 0?void 0:o.find(r=>typeof r!="string"&&r.dimensionKey===t):void 0}getAxisConfigInPivotChart(t,e){if((this.isFrozenColumn(t,e)||this.isRightFrozenColumn(t,e))&&Hl(t,e,"row",this)||(this.isFrozenRow(t,e)||this.isBottomFrozenRow(t,e))&&Hl(t,e,"col",this))return Bt.getFunction("getAxisConfigInPivotChart")(t,e,this)}isEmpty(t,e){return!!this._table.isPivotChart()&&(!!this.isLeftBottomCorner(t,e)||!!this.isRightBottomCorner(t,e)||!!this.isRightTopCorner(t,e))}isAxisCell(t,e){return this._table.isPivotChart()?!!(this.indicatorKeys.length>=1&&Lh(this.indicatorsDefine)&&(this.isBottomFrozenRow(t,e)&&Hl(t,e,"col",this)||this.isRightFrozenColumn(t,e)&&Hl(t,e,"row",this)||this.isRowHeader(t,e)&&t===this.rowHeaderLevelCount-1&&Hl(t,e,"row",this)||this.hasTwoIndicatorAxes&&this.indicatorsAsCol&&e===this.columnHeaderLevelCount-1&&Hl(t,e,"col",this))):!1}getChartAxes(t,e){if(pV(t,e,this)||this.isAxisCell(t,e))return vV(t,e,this)}getRawChartSpec(t,e){return cV(t,e,this)}getChartSpec(t,e){return mV(t,e,this)}isShareChartSpec(t,e){return gV(t,e,this)}getChartDataId(t,e){return dT(t,e,this)}isNoChartDataRenderNothing(t,e){return fV(t,e,this)}setPagination(t){var e,n,o,r,s,l,a;if(this.clearCellRangeMap(),this._table.internalProps.useOneRowHeightFillAll=!1,this.pagination=t,this.rowHierarchyType==="grid"&&z((e=this.pagination)===null||e===void 0?void 0:e.perPageCount)&&z((n=this.pagination)===null||n===void 0?void 0:n.currentPage)){this.indicatorsAsCol===!1&&(this.pagination.perPageCount=Math.ceil(this.pagination.perPageCount/this.indicatorKeys.length)*this.indicatorKeys.length);const{perPageCount:h,currentPage:d}=this.pagination;this.currentPageStartIndex=h*(d||0),this.currentPageEndIndex=this.currentPageStartIndex+h,this._rowHeaderCellIds=(o=this._rowHeaderCellIds_FULL)===null||o===void 0?void 0:o.slice(this.currentPageStartIndex,this.currentPageEndIndex),this._rowHeaderCellFullPathIds=(r=this._rowHeaderCellFullPathIds_FULL)===null||r===void 0?void 0:r.slice(this.currentPageStartIndex,this.currentPageEndIndex)}else this.currentPageStartIndex=0,this.currentPageEndIndex=this._rowHeaderCellIds_FULL.length,this._rowHeaderCellIds=(s=this._rowHeaderCellIds_FULL)===null||s===void 0?void 0:s.slice(this.currentPageStartIndex,this.currentPageEndIndex),this._rowHeaderCellFullPathIds=(l=this._rowHeaderCellFullPathIds_FULL)===null||l===void 0?void 0:l.slice(this.currentPageStartIndex,this.currentPageEndIndex);this.pagination&&(this.pagination.totalCount=(a=this._rowHeaderCellIds_FULL)===null||a===void 0?void 0:a.length)}release(){var t;const e=this._table._getActiveChartInstance();e==null||e.release(),(t=this._indicators)===null||t===void 0||t.forEach(n=>{var o;(o=n.chartInstance)===null||o===void 0||o.release()})}getHeadNode(t,e){var n,o,r;let s;const l=this.getCellHeaderPaths(t,e);return l.rowHeaderPaths&&((o=(n=l.rowHeaderPaths)===null||n===void 0?void 0:n.length)!==null&&o!==void 0?o:0)>0?s=(r=l.rowHeaderPaths)===null||r===void 0?void 0:r.slice(0,l.rowHeaderPaths.length):l.colHeaderPaths&&l.colHeaderPaths.length>0&&(s=l.colHeaderPaths.slice(0,l.colHeaderPaths.length)),this.getHeadNodeByRowOrColDimensions(s,t,e)}getHeadNodeByRowOrColDimensions(t,e,n){var o;if(!Array.isArray(t))return;let r,s,l=this.rowTree,a=this.columnTree;if(z(n)&&z(e)&&this.rowHierarchyType==="tree"&&this.extensionRows&&e>=1+this.leftRowSeriesNumberColumnCount){const h=this.getCellId(e-1,n);l=this._rowHeaderExtensionTree[h].tree.children}for(let h=0;h<t.length;h++){const d=t[h];if((d.isPivotCorner||!z(d.value))&&h===t.length-1)return;let u=!1;for(let c=0;c<a.length;c++){const g=a[c];if(z(d.dimensionKey)&&g.dimensionKey===d.dimensionKey&&g.value===d.value||z(d.indicatorKey)&&g.indicatorKey===d.indicatorKey&&(g.value===d.value||!z(d.value)||!z(g.value))){a=g.children,s=g,u=!0;break}}if(!u)for(let c=0;(o=c<(l==null?void 0:l.length))!==null&&o!==void 0&&o;c++){const g=l[c];if(z(d.dimensionKey)&&g.dimensionKey===d.dimensionKey&&g.value===d.value||z(d.indicatorKey)&&g.indicatorKey===d.indicatorKey&&(g.value===d.value||!z(d.value)||!z(g.value))){l=g.children,r=g;break}}}return r||s||void 0}clearCellRangeMap(){this._largeCellRangeCache.length=0,this._CellHeaderPathMap=new Map}getDimensionKeyInChartSpec(t,e){var n,o,r,s,l,a;let h;if(this.indicatorsAsCol===!1)for(let d=0;d<this.indicatorsDefine.length;d++){const u=this.indicatorsDefine[d].chartSpec;if(u&&(h=(n=u.xField)!==null&&n!==void 0?n:(r=(o=u==null?void 0:u.series)===null||o===void 0?void 0:o[0])===null||r===void 0?void 0:r.xField,h))return h}else for(let d=0;d<this.indicatorsDefine.length;d++){const u=this.indicatorsDefine[d].chartSpec;if(u&&(h=(s=u.yField)!==null&&s!==void 0?s:(a=(l=u==null?void 0:u.series)===null||l===void 0?void 0:l[0])===null||a===void 0?void 0:a.yField,h))return h}return null}_generateChartState(){return{vtable_selected:{filter:t=>{var e;return this._table._selectedDataItemsInChart.length>=1?!!this._table._selectedDataItemsInChart.find(n=>{for(const o in n)if(typeof n[o]!="object"&&n[o]!==t[o])return!1;return!0}):!((e=this._table._selectedDimensionInChart)===null||e===void 0)&&e.length?!!this._table._selectedDimensionInChart.every(n=>typeof n.value=="object"||t[n.key]===n.value):!1}},vtable_selected_reverse:{filter:t=>{var e;return this._table._selectedDataItemsInChart.length>=1?!this._table._selectedDataItemsInChart.find(n=>{for(const o in n)if(typeof n[o]!="object"&&n[o]!==t[o])return!1;return!0}):!((e=this._table._selectedDimensionInChart)===null||e===void 0)&&e.length?!this._table._selectedDimensionInChart.every(n=>typeof n.value=="object"||t[n.key]===n.value):!1}}}}updateDataStateToChartInstance(t){var e;if(((e=t==null?void 0:t.getSpec().select)===null||e===void 0?void 0:e.enable)!==!1){t||(t=this._table._getActiveChartInstance());const n=this._generateChartState();this._indicators.forEach(o=>{var r;const s=o.chartInstance;((r=o.chartSpec.select)===null||r===void 0?void 0:r.enable)!==!1&&s.updateState(n)}),t==null||t.updateState(n)}}updateDataStateToActiveChartInstance(t){var e;if(((e=t==null?void 0:t.getSpec().select)===null||e===void 0?void 0:e.enable)!==!1){t||(t=this._table._getActiveChartInstance());const n=this._generateChartState();t==null||t.updateState(n)}}getIndicatorKeyInChartSpec(t,e){const n=this.getRawChartSpec(t,e),o=[];if(n){if(n.series||n.xField||n.yField)return this.indicatorsAsCol===!1?n.series?n.series.forEach(r=>{const s=r.yField;o.push(s)}):o.push(n.yField):n.series?n.series.forEach(r=>{const s=r.xField;o.push(s)}):o.push(n.xField),o;if(n.valueField&&o.push(n.valueField),o.length>=1)return o}return null}getOptimunHeightForChart(t){var e,n,o,r,s;const l=this.getCellHeaderPaths(this.rowHeaderLevelCount,t).rowHeaderPaths;let a,h;for(const u in this.dataset.collectValuesBy)if(this.dataset.collectValuesBy[u].type==="yField"&&!this.dataset.collectValuesBy[u].range){a=(e=this.dataset.collectedValues[u])===null||e===void 0?void 0:e[l.map(c=>c.value).join(this.dataset.stringJoinChar)];break}if(this._chartItemBandSize)h=AT((n=a==null?void 0:a.length)!==null&&n!==void 0?n:0,this._chartItemBandSize,this._chartPaddingInner,this._chartPaddingOuter);else{const u=this._chartItemSpanSize||25;h=((o=a==null?void 0:a.length)!==null&&o!==void 0?o:0)*(u+u/3)}const d=Qt((s=(r=this._chartPadding)!==null&&r!==void 0?r:this._table.theme.bodyStyle.padding)!==null&&s!==void 0?s:0);return h+d[0]+d[2]}getOptimunWidthForChart(t){var e,n,o,r,s;const l=this.getCellHeaderPaths(t,this.columnHeaderLevelCount).colHeaderPaths;let a,h;for(const u in this.dataset.collectValuesBy)if(this.dataset.collectValuesBy[u].type==="xField"&&!this.dataset.collectValuesBy[u].range){a=(e=this.dataset.collectedValues[u])===null||e===void 0?void 0:e[l.map(c=>c.value).join(this.dataset.stringJoinChar)];break}if(this._chartItemBandSize)h=AT((n=a==null?void 0:a.length)!==null&&n!==void 0?n:0,this._chartItemBandSize,this._chartPaddingInner,this._chartPaddingOuter);else{const u=this._chartItemSpanSize||25;h=((o=a==null?void 0:a.length)!==null&&o!==void 0?o:0)*(u+u/3)}const d=Qt((s=(r=this._chartPadding)!==null&&r!==void 0?r:this._table.theme.bodyStyle.padding)!==null&&s!==void 0?s:0);return h+d[1]+d[3]}get leftAxesCount(){if(!this._table.isPivotChart())return 0;const t=this._table.pivotChartAxes.find(e=>e.orient==="left");return(t==null?void 0:t.visible)===!1?0:(this.indicatorsAsCol,1)}get topAxesCount(){if(!this._table.isPivotChart())return 0;const t=this._table.pivotChartAxes.find(e=>e.orient==="top");return(t==null?void 0:t.visible)===!1?0:this.indicatorsAsCol&&this.hasTwoIndicatorAxes?1:0}get rightAxesCount(){return this.rightFrozenColCount}get bottomAxesCount(){return this.bottomFrozenRowCount}getColKeysPath(t,e){const n=this.getCellHeaderPaths(t,e),o=[];return n.colHeaderPaths.length&&n.colHeaderPaths.forEach(r=>{r.dimensionKey&&o.push(r.value)}),o==null?void 0:o.join(this.dataset.stringJoinChar)}getRowKeysPath(t,e){const n=this.getCellHeaderPaths(t,e),o=[];return n.rowHeaderPaths.length&&n.rowHeaderPaths.forEach(r=>{r.dimensionKey&&o.push(r.value)}),o==null?void 0:o.join(this.dataset.stringJoinChar)}getIndicatorInfo(t,e=""){var n;return(n=this.indicatorsDefine)===null||n===void 0?void 0:n.find(o=>typeof o!="string"&&(t?o.indicatorKey===t:!!e&&o.title===e))}getLayoutColumnTree(){const t=[],e=this.columnDimensionTree.tree.children;return ov(t,e),t}getLayoutRowTree(){const t=[],e=this.rowDimensionTree.tree.children;return ov(t,e),t}getLayoutColumnTreeCount(){const t=this.columnDimensionTree.tree.children;return bg(t,this.rowHierarchyType==="tree")}getLayoutRowTreeCount(){var t;const e=this.rowDimensionTree.tree.children;let n=bg(e,this.rowHierarchyType==="tree");return(t=this.extensionRows)===null||t===void 0||t.forEach(o=>{if(typeof o.rowTree!="function"){const r=bg(o.rowTree,!0);n*=r}}),n}resetHeaderTree(){var t,e,n;this.colIndex=0,this._rowHeaderCellFullPathIds_FULL=[],this._columnHeaderCellFullPathIds=[],this._columnHeaderCellIds=[];const o=this.dataset;this.rowTree=o.rowHeaderTree,this.columnTree=o.colHeaderTree;const r=this.rowDimensionTree.tree.children;(t=this.rowTree)===null||t===void 0||t.forEach((s,l)=>{const a=r.find(h=>h.dimensionKey===s.dimensionKey&&h.value===s.value);a&&this._table._syncHierarchyState(a,s)}),this.columnDimensionTree=new Pe((e=this.columnTree)!==null&&e!==void 0?e:[],this.sharedVar),this.rowDimensionTree=new Pe((n=this.rowTree)!==null&&n!==void 0?n:[],this.sharedVar,this.rowHierarchyType,this.rowHierarchyType==="tree"?this.rowExpandLevel:void 0),this.resetColumnHeaderLevelCount(),this._generateColHeaderIds(),this.colIndex=0,this._generateRowHeaderIds(),this._rowHeaderCellFullPathIds_FULL=im(this._rowHeaderCellFullPathIds_FULL),this._headerObjectMap=this._headerObjects.reduce((s,l)=>(s[l.id]=l,s),{}),this._CellHeaderPathMap=new Map,this._largeCellRangeCache.length=0,this.generateCellIdsConsiderHideHeader(),this.setPagination(this.pagination)}isSeriesNumberInHeader(t,e){return this.leftRowSeriesNumberColumnCount>0&&t>=0&&e>=0&&t<this.leftRowSeriesNumberColumnCount&&e<this.headerLevelCount||this.rightRowSeriesNumberColumnCount>0&&e>=0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e<this.headerLevelCount}isSeriesNumberInBody(t,e){return this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount&&e>=this.headerLevelCount||this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e>=this.headerLevelCount}isSeriesNumber(t,e){return!!(z(t)&&z(e)&&(this.leftRowSeriesNumberColumnCount>0&&t>=0&&e>=0&&t<this.leftRowSeriesNumberColumnCount||this.rightRowSeriesNumberColumnCount>0&&e>=0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount))}getSeriesNumberHeader(t,e){return this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount&&e<this.headerLevelCount?Object.assign({},this.leftRowSeriesNumberColumn[t],{style:this._table.internalProps.rowSeriesNumber.headerStyle}):this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e<this.headerLevelCount&&e<this.headerLevelCount?this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)]:void 0}getSeriesNumberBody(t,e){return this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount&&e>=this.headerLevelCount?this.leftRowSeriesNumberColumn[t]:this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e>=this.headerLevelCount?this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)]:void 0}changeTreeNodeTitle(t,e,n){this.getHeadNode(t,e).value=n;const o=this.getCellId(t,e);this._headerObjectMap[o].title=n}changeCornerTitle(t,e,n){if(this.isCornerHeader(t,e)){const o=this.getCellId(t,e);this._headerObjectMap[o].title=n}}generateCellIdsConsiderHideHeader(){if(this._columnHeaderCellIds=this._columnHeaderCellFullPathIds.slice(),!this.showColumnHeader)if(this.indicatorsAsCol&&!this.hideIndicatorName){const t=this.colDimensionKeys.indexOf(Xi),e=this._columnHeaderCellIds.splice(t,1);this._columnHeaderCellIds.splice(0,this._columnHeaderCellIds.length),this._columnHeaderCellIds.push(e[0])}else this._columnHeaderCellIds.splice(0,this._columnHeaderCellIds.length);if(this._rowHeaderCellIds_FULL=this._rowHeaderCellFullPathIds_FULL.slice(),!this.showRowHeader)if(this.indicatorsAsCol||this.hideIndicatorName)this._rowHeaderCellIds_FULL.forEach((t,e)=>{const n=t.slice();n.splice(0,n.length),this._rowHeaderCellIds_FULL[e]=n});else{const t=this.rowDimensionKeys.indexOf(Xi);this._rowHeaderCellIds_FULL.forEach((e,n)=>{const o=e.slice(),r=o.splice(t,1);o.splice(0,o.length),o.push(r[0]),this._rowHeaderCellIds_FULL[n]=o})}if(this._rowHeaderCellIds=this._rowHeaderCellIds_FULL.slice(),this._cornerHeaderCellIds=this._cornerHeaderCellFullPathIds.slice(),this.rowHeaderLevelCount===0||this.columnHeaderLevelCount===0)this._cornerHeaderCellIds=[];else if(this.cornerSetting.titleOnDimension!=="row"||this.showRowHeader){if(this.cornerSetting.titleOnDimension==="column"&&!this.showColumnHeader)if(this.indicatorsAsCol&&!this.hideIndicatorName){const t=this.colDimensionKeys.indexOf(Xi),e=this._cornerHeaderCellIds.splice(t,1);this._cornerHeaderCellIds.splice(0,this._cornerHeaderCellIds.length),this._cornerHeaderCellIds.push(e[0])}else this._cornerHeaderCellIds.splice(0,this._cornerHeaderCellIds.length)}else if(this.indicatorsAsCol||this.hideIndicatorName)this._cornerHeaderCellIds.forEach((t,e)=>{const n=t.slice();n.splice(0,n.length),this._cornerHeaderCellIds[e]=n});else{const t=this.rowDimensionKeys.indexOf(Xi);this._cornerHeaderCellIds.forEach((e,n)=>{const o=e.slice(),r=o.splice(t,1);o.splice(0,o.length),o.push(r[0]),this._cornerHeaderCellIds[n]=o})}}enableUseGetBodyCache(){this._useGetBodyCache=!0,this._getBodyCache.clear()}disableUseGetBodyCache(){this._useGetBodyCache=!1,this._getBodyCache.clear()}enableUseHeaderPathCache(){this._useHeaderPathCache=!0,this._colHeaderPathCache.clear(),this._rowHeaderPathCache.clear()}disableUseHeaderPathCache(){this._useHeaderPathCache=!1,this._colHeaderPathCache.clear(),this._rowHeaderPathCache.clear()}getBodyWidthCache(t,e){if(this._useGetBodyCache&&!this.isHeader(t,e)&&!this.isSeriesNumber(t,e))return this.indicatorsAsCol&&this._getBodyCache.has(t)?this._getBodyCache.get(t):!this.indicatorsAsCol&&this._getBodyCache.has(e)?this._getBodyCache.get(e):void 0}setBodyWidthCache(t,e,n){!this._useGetBodyCache||this.isHeader(t,e)||this.isSeriesNumber(t,e)||(this.indicatorsAsCol?this._getBodyCache.set(t,n):this._getBodyCache.set(e,n))}getColHeaderPathCache(t,e){if(this._useHeaderPathCache&&!this.isHeader(t,e)&&!this.isSeriesNumber(t,e)&&this._colHeaderPathCache.has(t))return this._colHeaderPathCache.get(t)}setColHeaderPathCache(t,e,n){!this._useHeaderPathCache||this.isHeader(t,e)||this.isSeriesNumber(t,e)||this._colHeaderPathCache.set(t,n)}getRowHeaderPathCache(t,e){if(this._useHeaderPathCache&&!this.isHeader(t,e)&&!this.isSeriesNumber(t,e)&&this._rowHeaderPathCache.has(e))return this._rowHeaderPathCache.get(e)}setRowHeaderPathCache(t,e,n){!this._useHeaderPathCache||this.isHeader(t,e)||this.isSeriesNumber(t,e)||this._rowHeaderPathCache.set(e,n)}}function AT(i,t,e,n){e===1&&(e=0);const o=O9(i,e,n),r=t/(1-e);return Math.ceil(o*r)}function O9(i,t,e){let n;return n=i===1?i+2*e:i-t+2*e,i?n>0?n:1:0}class pv{constructor(t,e){this.tree={},this.beforeChangedTree={},this.colFlatKeys={},this.rowFlatKeys={},this.stringJoinChar=String.fromCharCode(0),this.rowsIsTotal=[],this.colsIsTotal=[],this.dataConfig=t,e&&(this.records=e,typeof window<"u"&&window.performance.now(),this.setRecords(e),typeof window<"u"&&window.performance.now())}changeDataConfig(t){this.dataConfig=t}setRecords(t){this.processRecords()}processRecords(){for(let t=0,e=this.records.length;t<e;t++){const n=this.records[t];this.processRecord(n)}}processRecord(t){var e;const n=[],o=[];for(let r=0,s=this.dataConfig.rows.length;r<s;r++){const l=this.dataConfig.rows[r];t[l]!==void 0&&l!==this.dataConfig.indicatorDimensionKey&&o.push(t[l])}for(let r=0,s=this.dataConfig.columns.length;r<s;r++){const l=this.dataConfig.columns[r];t[l]!==void 0&&l!==this.dataConfig.indicatorDimensionKey&&n.push(t[l])}(e=this.dataConfig.indicators)===null||e===void 0||e.forEach(r=>{const s=t[r];s!==void 0&&(this.dataConfig.indicatorsAsCol?n.push(r):o.push(r));const l=o.join(this.stringJoinChar),a=n.join(this.stringJoinChar);o.length!==0&&(this.rowFlatKeys[l]||(this.rowFlatKeys[l]=1)),n.length!==0&&(this.colFlatKeys[a]||(this.colFlatKeys[a]=1)),n.length===0&&o.length===0||(this.tree[l]||(this.tree[l]={}),s!==void 0&&(this.tree[l][a]={value:s,record:t},this.dataConfig.indicatorsAsCol?n.pop():o.pop()))})}getTreeNode(t=[],e=[],n,o=!0){var r,s,l,a;let h,d;if(typeof t=="string")h=t;else{let u=!1;t.map((c,g)=>{c===n&&(t.splice(g,1),u=!0)}),u&&t.push(n),h=t.join(this.stringJoinChar)}if(typeof e=="string")d=e;else{let u=!1;e.map((c,g)=>{c===n&&(e.splice(g,1),u=!0)}),u&&e.push(n),d=e.join(this.stringJoinChar)}return o?(l=(s=(r=this.tree)===null||r===void 0?void 0:r[h])===null||s===void 0?void 0:s[d])!==null&&l!==void 0?l:void 0:z((a=this.beforeChangedTree[h])===null||a===void 0?void 0:a[d])?{value:this.beforeChangedTree[h][d].value,record:this.beforeChangedTree[h][d].record}:void 0}changeTreeNodeValue(t=[],e=[],n,o){var r,s,l,a,h,d,u;let c,g;if(typeof t=="string")c=t;else{let m=!1;t.map((b,C)=>{b===n&&(t.splice(C,1),m=!0)}),m&&t.push(n),c=t.join(this.stringJoinChar)}if(typeof e=="string")g=e;else{let m=!1;e.map((b,C)=>{b===n&&(e.splice(C,1),m=!0)}),m&&e.push(n),g=e.join(this.stringJoinChar)}const f=(s=(r=this.tree[c])===null||r===void 0?void 0:r[g])===null||s===void 0?void 0:s.value,p=Object.assign({},(a=(l=this.tree[c])===null||l===void 0?void 0:l[g])===null||a===void 0?void 0:a.record);!((d=(h=this.tree[c])===null||h===void 0?void 0:h[g])===null||d===void 0)&&d.record?(this.tree[c][g].record[n]=o,this.tree[c][g].value=o):(this.tree[c]||(this.tree[c]={}),this.tree[c][g]={record:this._buildRecord(t,e,n,o),value:o}),!((u=this.beforeChangedTree[c])===null||u===void 0)&&u[g]||(this.beforeChangedTree[c]={},this.beforeChangedTree[c][g]={record:void 0,value:void 0},this.beforeChangedTree[c][g].record=p,this.beforeChangedTree[c][g].value=f)}_buildRecord(t=[],e=[],n,o){const r={},s=this.dataConfig.rows,l=this.dataConfig.columns;return s.forEach((a,h)=>{a!==this.dataConfig.indicatorDimensionKey&&(r[a]=t[h])}),l.forEach((a,h)=>{a!==this.dataConfig.indicatorDimensionKey&&(r[a]=e[h])}),r[n]=o,this.records.push(r),r}addRecords(t){for(let e=0,n=t.length;e<n;e++){const o=t[e];this.processRecord(o)}this.records.push(t)}changeRecordFieldValue(t,e,n){let o=!1;for(let r=0;r<this.dataConfig.indicators.length;r++)this.dataConfig.indicators[r]===t&&(o=!0);if(!o){for(let r=0,s=this.records.length;r<s;r++){const l=this.records[r];l[t]===e&&(l[t]=n)}this.rowFlatKeys={},this.colFlatKeys={},this.tree={},this.processRecords()}}}function TT(i,t){let e="";for(let n=0;n<i.length;n++)e+=i[n],n!==i.length-1&&(e+=t);return e}class Ih{constructor(t,e,n,o,r,s,l,a,h,d,u,c,g){var f,p,m,b,C,_,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht,gt,Ct,Q,et,vt;this.tree={},this.changedTree={},this.colFlatKeys={},this.rowFlatKeys={},this.colKeys=[],this.rowKeys=[],this.colKeys_normal=[],this.rowKeys_normal=[],this.rowOrder="key_a_to_z",this.colOrder="key_a_to_z",this.sorted=!1,this.indicatorStatistics=[],this.aggregators={},this.stringJoinChar=String.fromCharCode(0),this.rowsIsTotal=[],this.colsIsTotal=[],this.collectedValues={},this.cacheCollectedValues={},this.totalRecordsTree={},this.registerAggregators(),this.dataConfig=t,this.filterRules=(f=this.dataConfig)===null||f===void 0?void 0:f.filterRules,this.rowHierarchyType=a??"grid",this.sortRules=(p=this.dataConfig)===null||p===void 0?void 0:p.sortRules,this.aggregationRules=(m=this.dataConfig)===null||m===void 0?void 0:m.aggregationRules,this.derivedFieldRules=(b=this.dataConfig)===null||b===void 0?void 0:b.derivedFieldRules,this.mappingRules=(C=this.dataConfig)===null||C===void 0?void 0:C.mappingRules,this.calculatedFieldRules=(_=this.dataConfig)===null||_===void 0?void 0:_.calculatedFieldRules,this.calculatedFiledKeys=(y=(w=this.calculatedFieldRules)===null||w===void 0?void 0:w.map(bt=>bt.key))!==null&&y!==void 0?y:[],this.calculatedFieldDependIndicatorKeys=(A=(S=this.calculatedFieldRules)===null||S===void 0?void 0:S.reduce((bt,dt)=>{for(let ot=0;ot<dt.dependIndicatorKeys.length;ot++)bt.indexOf(dt.dependIndicatorKeys[ot])===-1&&bt.push(dt.dependIndicatorKeys[ot]);return bt},[]))!==null&&A!==void 0?A:[],this.totals=(R=this.dataConfig)===null||R===void 0?void 0:R.totals,this.rows=e,this.columns=n,this.indicatorKeys=o,this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys=[...o];for(let bt=0;bt<this.calculatedFieldDependIndicatorKeys.length;bt++)this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys.indexOf(this.calculatedFieldDependIndicatorKeys[bt])===-1&&this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys.push(this.calculatedFieldDependIndicatorKeys[bt]);if(this.indicatorsAsCol=s,this.indicators=r,this.customColTree=h,this.customRowTree=d,this.hasExtensionRowTree=c,this.parseCustomTreeToMatchRecords=g,this.parseCustomTreeToMatchRecords&&(this.customColTreeDimensionPaths=this.customTreeToDimensionPathArr(this.customColTree,"col"),this.hasExtensionRowTree||(this.customRowTreeDimensionPaths=this.customTreeToDimensionPathArr(this.customRowTree,"row"))),this.colGrandTotalLabel=(M=(T=(x=this.totals)===null||x===void 0?void 0:x.column)===null||T===void 0?void 0:T.grandTotalLabel)!==null&&M!==void 0?M:"总计",this.colSubTotalLabel=(F=(P=(B=this.totals)===null||B===void 0?void 0:B.column)===null||P===void 0?void 0:P.subTotalLabel)!==null&&F!==void 0?F:"小计",this.rowGrandTotalLabel=(k=(E=(H=this.totals)===null||H===void 0?void 0:H.row)===null||E===void 0?void 0:E.grandTotalLabel)!==null&&k!==void 0?k:"总计",this.rowSubTotalLabel=(D=(L=(I=this.totals)===null||I===void 0?void 0:I.row)===null||L===void 0?void 0:L.subTotalLabel)!==null&&D!==void 0?D:"小计",this.collectValuesBy=(O=this.dataConfig)===null||O===void 0?void 0:O.collectValuesBy,this.needSplitPositiveAndNegative=u!=null&&u,this.rowsIsTotal=new Array((W=(N=this.rows)===null||N===void 0?void 0:N.length)!==null&&W!==void 0?W:0).fill(!1),this.colsIsTotal=new Array((U=($=this.columns)===null||$===void 0?void 0:$.length)!==null&&U!==void 0?U:0).fill(!1),((Y=this.totals)===null||Y===void 0?void 0:Y.row)&&this.totals.row.showSubTotals!==!1&&this.totals.row.subTotalsDimensions)for(let bt=0,dt=(ht=(X=(G=(j=this.totals)===null||j===void 0?void 0:j.row)===null||G===void 0?void 0:G.subTotalsDimensions)===null||X===void 0?void 0:X.length)!==null&&ht!==void 0?ht:0;bt<dt;bt++){const ot=this.totals.row.subTotalsDimensions[bt],ut=this.rows.indexOf(ot);this.rowsIsTotal[ut]=!0}if(!((gt=this.totals)===null||gt===void 0)&&gt.column&&this.totals.column.showSubTotals!==!1&&this.totals.column.subTotalsDimensions)for(let bt=0,dt=(vt=(et=(Q=(Ct=this.totals)===null||Ct===void 0?void 0:Ct.column)===null||Q===void 0?void 0:Q.subTotalsDimensions)===null||et===void 0?void 0:et.length)!==null&&vt!==void 0?vt:0;bt<dt;bt++){const ot=this.totals.column.subTotalsDimensions[bt],ut=this.columns.indexOf(ot);this.colsIsTotal[ut]=!0}this.setRecords(l)}setRecords(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w;this.records=t,this.collectedValues={},this.cacheCollectedValues={},this.totalRecordsTree={},this.tree={},this.colFlatKeys={},this.rowFlatKeys={},this.colKeys=[],this.rowKeys=[],this.rowsHasValue=[],this.columnsHasValue=[],t&&(this.records=t,typeof window<"u"&&window.performance.now(),this.processRecords(),this.processCollectedValuesWithSumBy(),this.generateCollectedValuesSortRule(),this.processCollectedValuesWithSortBy(),typeof window<"u"&&window.performance.now(),typeof window<"u"&&window.performance.now(),this.totalStatistics(),typeof window<"u"&&window.performance.now(),this.rowKeys_normal=this.rowKeys.slice(),this.colKeys_normal=this.colKeys.slice(),typeof window<"u"&&window.performance.now(),this.sortKeys(),typeof window<"u"&&window.performance.now(),typeof window<"u"&&window.performance.now(),this.customRowTree?this.rowHeaderTree=this.customRowTree:this.rowHierarchyType==="tree"?this.rowHeaderTree=this.ArrToTree1(this.rowKeys,this.rows.filter((y,S)=>this.rowsHasValue[S]),this.indicatorsAsCol?void 0:this.indicators,((n=(e=this.totals)===null||e===void 0?void 0:e.row)===null||n===void 0?void 0:n.showGrandTotals)||!this.indicatorsAsCol&&this.columns.length===0||this.indicatorsAsCol&&this.rows.length===0,this.rowGrandTotalLabel):this.rowHeaderTree=this.ArrToTree(this.rowKeys,this.rows.filter((y,S)=>this.rowsHasValue[S]),this.indicatorsAsCol?void 0:this.indicators,this.rowsIsTotal,((r=(o=this.totals)===null||o===void 0?void 0:o.row)===null||r===void 0?void 0:r.showGrandTotals)||this.indicatorsAsCol&&this.rows.length===0,this.rowGrandTotalLabel,this.rowSubTotalLabel,(a=(l=(s=this.totals)===null||s===void 0?void 0:s.row)===null||l===void 0?void 0:l.showGrandTotalsOnTop)!==null&&a!==void 0&&a,(u=(d=(h=this.totals)===null||h===void 0?void 0:h.row)===null||d===void 0?void 0:d.showSubTotalsOnTop)!==null&&u!==void 0&&u),this.customColTree?this.colHeaderTree=this.customColTree:this.colHeaderTree=this.ArrToTree(this.colKeys,this.columns.filter((y,S)=>this.columnsHasValue[S]),this.indicatorsAsCol?this.indicators:void 0,this.colsIsTotal,((g=(c=this.totals)===null||c===void 0?void 0:c.column)===null||g===void 0?void 0:g.showGrandTotals)||!this.indicatorsAsCol&&this.columns.length===0,this.colGrandTotalLabel,this.colSubTotalLabel,(m=(p=(f=this.totals)===null||f===void 0?void 0:f.column)===null||p===void 0?void 0:p.showGrandTotalsOnLeft)!==null&&m!==void 0&&m,(_=(C=(b=this.totals)===null||b===void 0?void 0:b.column)===null||C===void 0?void 0:C.showSubTotalsOnLeft)!==null&&_!==void 0&&_),typeof window<"u"&&window.performance.now(),!((w=this.dataConfig)===null||w===void 0)&&w.isPivotChart&&this.cacheDeminsionCollectedValues())}registerAggregator(t,e){this.aggregators[t]=e}registerAggregators(){this.registerAggregator(zt.RECORD,Px),this.registerAggregator(zt.SUM,Ex),this.registerAggregator(zt.COUNT,Lx),this.registerAggregator(zt.MAX,Fx),this.registerAggregator(zt.MIN,Ix),this.registerAggregator(zt.AVG,kx),this.registerAggregator(zt.NONE,Hx),this.registerAggregator(zt.RECALCULATE,K4)}processCollectedValuesWithSumBy(){var t,e,n,o,r,s;for(const l in this.collectedValues)if(!((e=(t=this.collectValuesBy)===null||t===void 0?void 0:t[l])===null||e===void 0)&&e.sumBy)for(const a in this.collectedValues[l]){let h;((n=this.collectValuesBy[l])===null||n===void 0?void 0:n.extendRange)==="sum"?(h=Object.values(this.collectedValues[l][a]).reduce((g,f)=>g+f.value(),0),h+=Math.round(h/20)):(h=Object.values(this.collectedValues[l][a]).reduce((g,f)=>f.value()>g?f.value():g,Number.MIN_SAFE_INTEGER),((o=this.collectValuesBy[l])===null||o===void 0?void 0:o.extendRange)==="max"?h+=Math.round(h/20):typeof((r=this.collectValuesBy[l])===null||r===void 0?void 0:r.extendRange)=="number"&&(h=Math.max(h,(s=this.collectValuesBy[l])===null||s===void 0?void 0:s.extendRange)));const d=Object.values(this.collectedValues[l][a]).reduce((g,f)=>f.value()<g?f.value():g,Number.MAX_SAFE_INTEGER);let u,c;this.needSplitPositiveAndNegative&&(u=Object.values(this.collectedValues[l][a]).reduce((g,f)=>f.positiveValue()>g?f.positiveValue():g,Number.MIN_SAFE_INTEGER),c=Object.values(this.collectedValues[l][a]).reduce((g,f)=>f.negativeValue()<g?f.negativeValue():g,Number.MAX_SAFE_INTEGER)),this.collectedValues[l][a]={},this.collectedValues[l][a].max=h,this.collectedValues[l][a].min=d,this.needSplitPositiveAndNegative&&(this.collectedValues[l][a].positiveMax=u,this.collectedValues[l][a].negativeMin=c)}}processCollectedValuesWithSortBy(){var t,e;const n=this;for(const o in this.collectedValues)if(!((e=(t=this.collectValuesBy)===null||t===void 0?void 0:t[o])===null||e===void 0)&&e.sortBy)for(const r in this.collectedValues[o])this.collectedValues[o][r]=this.collectedValues[o][r].sort((s,l)=>{var a,h,d,u;return((h=(a=n.collectValuesBy[o].sortBy)===null||a===void 0?void 0:a.indexOf(s))!==null&&h!==void 0?h:-1)-((u=(d=n.collectValuesBy[o].sortBy)===null||d===void 0?void 0:d.indexOf(l))!==null&&u!==void 0?u:-1)})}generateCollectedValuesSortRule(){for(const t in this.collectedValues)if(this.collectValuesBy&&this.collectValuesBy[t]&&!this.collectValuesBy[t].sortBy){let e=[];for(const n in this.collectedValues[t])Array.isArray(this.collectedValues[t][n])&&(e.push(...this.collectedValues[t][n]),e=Array.from(new Set(e)));e.length>0&&(this.collectValuesBy[t].sortBy=e)}}processRecords(){var t,e;let n=!1;if(((e=(t=this.filterRules)===null||t===void 0?void 0:t.length)!==null&&e!==void 0?e:0)>=1&&(n=!0),Array.isArray(this.records)){this.filteredRecords||(this.filteredRecords=[]);for(let o=0,r=this.records.length;o<r;o++){const s=this.records[o];n&&!this.filterRecord(s)||(this.filteredRecords.push(s),this.processRecord(s))}}else{this.filteredRecords||(this.filteredRecords={});for(const o in this.records)for(let r=0,s=this.records[o].length;r<s;r++){const l=this.records[o][r];n&&!this.filterRecord(l)||(this.filteredRecords[o]||(this.filteredRecords[o]=[]),this.filteredRecords[o].push(l),this.processRecord(l,o))}}this.rowFlatKeys={},this.colFlatKeys={}}filterRecord(t){var e,n;let o=!0;if(this.filterRules)for(let r=0;r<this.filterRules.length;r++){const s=this.filterRules[r];if(s.filterKey){const l=t[s.filterKey];if(((e=s.filteredValues)===null||e===void 0?void 0:e.indexOf(l))===-1){o=!1;break}}else if(!(!((n=s.filterFunc)===null||n===void 0)&&n.call(s,t))){o=!1;break}}return o}processRecord(t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht,gt,Ct,Q,et,vt,bt,dt,ot,ut,st,_t,ct,Wt,Yt,yt,mt,ie,le,Zt,_e,Oe;(n=this.derivedFieldRules)===null||n===void 0||n.forEach((Rt,Tt)=>{Rt.fieldName&&Rt.derivedFunc&&(t[Rt.fieldName]=Rt.derivedFunc(t))});for(const Rt in this.collectValuesBy)if(z(t[Rt])){this.collectedValues[Rt]||(this.collectedValues[Rt]={});const Tt=this.collectValuesBy[Rt].by.map(Nt=>t[Nt]).join(this.stringJoinChar);if(this.collectedValues[Rt][Tt]||(this.collectValuesBy[Rt].sumBy?this.collectedValues[Rt][Tt]={}:this.collectValuesBy[Rt].range?this.collectedValues[Rt][Tt]={min:Number.MAX_SAFE_INTEGER,max:Number.MIN_SAFE_INTEGER}:this.collectedValues[Rt][Tt]=[]),this.collectValuesBy[Rt].sumBy){const Nt=this.collectValuesBy[Rt].sumBy.map(te=>t[te]).join(this.stringJoinChar);this.collectedValues[Rt][Tt][Nt]||(this.collectedValues[Rt][Tt][Nt]=new this.aggregators[zt.SUM]({key:Rt,dimension:Rt,isRecord:void 0,needSplitPositiveAndNegative:this.needSplitPositiveAndNegative})),this.collectedValues[Rt][Tt][Nt].push(t)}else if(this.collectValuesBy[Rt].range){const Nt=this.collectedValues[Rt][Tt],te=Math.max(t[Rt],Nt.max),ae=Math.min(t[Rt],Nt.min);isNaN(te)||(Nt.max=te,Nt.min=ae)}else{const Nt=this.collectedValues[Rt][Tt];Nt.indexOf(t[Rt])===-1&&Nt.push(t[Rt])}}let He=!1;const Ht=[],Et=[];if(!this.parseCustomTreeToMatchRecords||!((o=this.dataConfig)===null||o===void 0)&&o.isPivotChart||!(!((r=this.customRowTree)===null||r===void 0)&&r.length)||e||this.hasExtensionRowTree){const Rt=[];Et.push({rowKey:Rt,indicatorKey:e});for(let Tt=0,Nt=this.rows.length;Tt<Nt;Tt++){const te=this.rows[Tt];if(te in t)this.rowsHasValue[Tt]=!0,Rt.push(t[te]);else if(te!==Xi){if(!((a=(l=(s=this.dataConfig)===null||s===void 0?void 0:s.totals)===null||l===void 0?void 0:l.row)===null||a===void 0)&&a.showGrandTotals&&Tt===0&&!this.rows.find(ae=>ae in t)){Rt.push(this.rowGrandTotalLabel),He=!0;break}if(!((u=(d=(h=this.dataConfig)===null||h===void 0?void 0:h.totals)===null||d===void 0?void 0:d.row)===null||u===void 0)&&u.subTotalsDimensions&&((f=(g=(c=this.dataConfig)===null||c===void 0?void 0:c.totals)===null||g===void 0?void 0:g.row)===null||f===void 0?void 0:f.subTotalsDimensions.indexOf(this.rows[Tt-1]))>=0){this.rowHierarchyType==="grid"&&Rt.push(this.rowSubTotalLabel),He=!0;break}}}}else{const Rt=this.getFieldMatchRowDimensionPaths(t);if(Rt.length>0)for(let Tt=0,Nt=Rt.length;Tt<Nt;Tt++){const te=Rt[Tt],ae=[];let Jt;for(let J=0,be=te.length;J<be;J++)z(te[J].indicatorKey)?Jt=te[J].indicatorKey:ae.push(te[J].value);Et.push({rowKey:ae,indicatorKey:Jt})}}if(!this.parseCustomTreeToMatchRecords||!((p=this.dataConfig)===null||p===void 0)&&p.isPivotChart||!(!((m=this.customColTree)===null||m===void 0)&&m.length)||e||this.hasExtensionRowTree){const Rt=[];Ht.push({colKey:Rt,indicatorKey:e});for(let Tt=0,Nt=this.columns.length;Tt<Nt;Tt++){const te=this.columns[Tt];if(te in t)this.columnsHasValue[Tt]=!0,Rt.push(t[te]);else if(te!==Xi){if(!((_=(C=(b=this.dataConfig)===null||b===void 0?void 0:b.totals)===null||C===void 0?void 0:C.column)===null||_===void 0)&&_.showGrandTotals&&Tt===0&&!this.columns.find(ae=>ae in t)){Rt.push(this.colGrandTotalLabel),He=!0;break}if(!((S=(y=(w=this.dataConfig)===null||w===void 0?void 0:w.totals)===null||y===void 0?void 0:y.column)===null||S===void 0)&&S.subTotalsDimensions&&((x=(R=(A=this.dataConfig)===null||A===void 0?void 0:A.totals)===null||R===void 0?void 0:R.column)===null||x===void 0?void 0:x.subTotalsDimensions.indexOf(this.columns[Tt-1]))>=0){Rt.push(this.colSubTotalLabel),He=!0;break}}}}else{const Rt=this.getFieldMatchColDimensionPaths(t);if(Rt.length>0)for(let Tt=0,Nt=Rt.length;Tt<Nt;Tt++){const te=Rt[Tt],ae=[];let Jt;for(let J=0,be=te.length;J<be;J++)z(te[J].indicatorKey)?Jt=te[J].indicatorKey:ae.push(te[J].value);Ht.push({colKey:ae,indicatorKey:Jt})}}for(let Rt=0;Rt<Et.length;Rt++){const Tt=Et[Rt].rowKey;let Nt;this.indicatorsAsCol||(Nt=Et[Rt].indicatorKey);for(let te=0;te<Ht.length;te++){const ae=Ht[te].colKey;this.indicatorsAsCol&&(Nt=Ht[te].indicatorKey);const Jt=Tt.join(this.stringJoinChar),J=ae.join(this.stringJoinChar);if(He){this.totalRecordsTree[Jt]||(this.totalRecordsTree[Jt]={}),this.totalRecordsTree[Jt][J]||(this.totalRecordsTree[Jt][J]=[]);const Lt=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let Ot=0;Ot<Lt.length;Ot++)if(this.calculatedFiledKeys.indexOf(Lt[Ot])>=0){const Se=(T=this.calculatedFieldRules)===null||T===void 0?void 0:T.find(qe=>qe.key===Lt[Ot]);!((B=(M=this.totalRecordsTree[Jt])===null||M===void 0?void 0:M[J])===null||B===void 0)&&B[Ot]||(this.totalRecordsTree[Jt][J][Ot]=new this.aggregators[zt.RECALCULATE]({key:Lt[Ot],dimension:Lt[Ot],isRecord:!0,formatFun:(F=(P=this.indicators)===null||P===void 0?void 0:P.find(qe=>typeof qe!="string"&&qe.indicatorKey===Lt[Ot]))===null||F===void 0?void 0:F.format,calculateFun:Se==null?void 0:Se.calculateFun,dependAggregators:this.totalRecordsTree[Jt][J],dependIndicatorKeys:Se==null?void 0:Se.dependIndicatorKeys})),Lt[Ot]in t&&((E=(H=this.totalRecordsTree[Jt])===null||H===void 0?void 0:H[J])===null||E===void 0||E[Ot].push(t))}else{const Se=this.getAggregatorRule(Lt[Ot]);!((I=(k=this.totalRecordsTree[Jt])===null||k===void 0?void 0:k[J])===null||I===void 0)&&I[Ot]||(this.totalRecordsTree[Jt][J][Ot]=new this.aggregators[(L=Se==null?void 0:Se.aggregationType)!==null&&L!==void 0?L:zt.SUM]({key:Lt[Ot],dimension:(D=Se==null?void 0:Se.field)!==null&&D!==void 0?D:Lt[Ot],formatFun:(O=Se==null?void 0:Se.formatFun)!==null&&O!==void 0?O:(W=(N=this.indicators)===null||N===void 0?void 0:N.find(qe=>typeof qe!="string"&&qe.indicatorKey===Lt[Ot]))===null||W===void 0?void 0:W.format})),Lt[Ot]in t&&((U=($=this.totalRecordsTree[Jt])===null||$===void 0?void 0:$[J])===null||U===void 0||U[Ot].push(t))}return}Tt.length!==0&&(this.rowFlatKeys[Jt]||(this.rowKeys.push(Tt),this.rowFlatKeys[Jt]=1)),ae.length!==0&&(this.colFlatKeys[J]||(this.colKeys.push(ae),this.colFlatKeys[J]=1)),this.tree[Jt]||(this.tree[Jt]={}),!((Y=this.tree[Jt])===null||Y===void 0)&&Y[J]||(this.tree[Jt][J]=[]);const be=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let Lt=0;Lt<be.length;Lt++)if(this.calculatedFiledKeys.indexOf(be[Lt])>=0){const Ot=(j=this.calculatedFieldRules)===null||j===void 0?void 0:j.find(Se=>Se.key===be[Lt]);!((X=(G=this.tree[Jt])===null||G===void 0?void 0:G[J])===null||X===void 0)&&X[Lt]||(this.tree[Jt][J][Lt]=new this.aggregators[zt.RECALCULATE]({key:be[Lt],dimension:be[Lt],isRecord:!0,formatFun:(gt=(ht=this.indicators)===null||ht===void 0?void 0:ht.find(Se=>typeof Se!="string"&&Se.indicatorKey===be[Lt]))===null||gt===void 0?void 0:gt.format,calculateFun:Ot==null?void 0:Ot.calculateFun,dependAggregators:this.tree[Jt][J],dependIndicatorKeys:Ot==null?void 0:Ot.dependIndicatorKeys})),(Q=(Ct=this.tree[Jt])===null||Ct===void 0?void 0:Ct[J])===null||Q===void 0||Q[Lt].push(t)}else{const Ot=this.getAggregatorRule(be[Lt]);let Se=!1;Nt?e===Nt?be[Lt]===Nt&&(Se=!0):be[Lt]===Nt&&be[Lt]in t&&(Se=!0):Ot!=null&&Ot.field?typeof(Ot==null?void 0:Ot.field)=="string"?(Ot==null?void 0:Ot.field)in t&&(Se=!0):Ot!=null&&Ot.field.find(qe=>qe in t)&&(Se=!0):be[Lt]in t&&(Se=!0),!(!((vt=(et=this.tree[Jt])===null||et===void 0?void 0:et[J])===null||vt===void 0)&&vt[Lt])&&Se&&(this.tree[Jt][J][Lt]=new this.aggregators[(bt=Ot==null?void 0:Ot.aggregationType)!==null&&bt!==void 0?bt:zt.SUM]({key:be[Lt],dimension:(dt=Ot==null?void 0:Ot.field)!==null&&dt!==void 0?dt:be[Lt],formatFun:(ot=Ot==null?void 0:Ot.formatFun)!==null&&ot!==void 0?ot:(st=(ut=this.indicators)===null||ut===void 0?void 0:ut.find(qe=>typeof qe!="string"&&qe.indicatorKey===be[Lt]))===null||st===void 0?void 0:st.format})),Se&&((ct=(_t=this.tree[Jt])===null||_t===void 0?void 0:_t[J])===null||ct===void 0||ct[Lt].push(t))}if(this.mappingRules)for(let Lt=0;Lt<this.indicatorKeys.length;Lt++){if(!this.indicatorStatistics[Lt]){const Ot=this.getAggregatorRule(this.indicatorKeys[Lt]);this.indicatorStatistics[Lt]={max:new this.aggregators[zt.MAX]({key:this.indicatorKeys[Lt],dimension:this.indicatorKeys[Lt]}),min:new this.aggregators[zt.MIN]({key:this.indicatorKeys[Lt],dimension:this.indicatorKeys[Lt]}),total:new this.aggregators[(Wt=Ot==null?void 0:Ot.aggregationType)!==null&&Wt!==void 0?Wt:zt.SUM]({key:this.indicatorKeys[Lt],dimension:(Yt=Ot==null?void 0:Ot.field)!==null&&Yt!==void 0?Yt:this.indicatorKeys[Lt],formatFun:(yt=Ot==null?void 0:Ot.formatFun)!==null&&yt!==void 0?yt:(ie=(mt=this.indicators)===null||mt===void 0?void 0:mt.find(Se=>typeof Se!="string"&&Se.indicatorKey===this.indicatorKeys[Lt]))===null||ie===void 0?void 0:ie.format})}}this.indicatorStatistics[Lt].max.push((Zt=(le=this.tree[Jt])===null||le===void 0?void 0:le[J])===null||Zt===void 0?void 0:Zt[Lt].value()),this.indicatorStatistics[Lt].min.push((Oe=(_e=this.tree[Jt])===null||_e===void 0?void 0:_e[J])===null||Oe===void 0?void 0:Oe[Lt].value()),this.indicatorStatistics[Lt].total.push(t)}}}}updateSortRules(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_;this.sorted=!1,this.sortRules=t,this.sortKeys(),this.customRowTree||(this.rowHierarchyType==="tree"?this.rowHeaderTree=this.ArrToTree1(this.rowKeys,this.rows.filter((w,y)=>this.rowsHasValue[y]),this.indicatorsAsCol?void 0:this.indicators,((n=(e=this.totals)===null||e===void 0?void 0:e.row)===null||n===void 0?void 0:n.showGrandTotals)||!this.indicatorsAsCol&&this.columns.length===0||this.indicatorsAsCol&&this.rows.length===0,this.rowGrandTotalLabel):this.rowHeaderTree=this.ArrToTree(this.rowKeys,this.rows.filter((w,y)=>this.rowsHasValue[y]),this.indicatorsAsCol?void 0:this.indicators,this.rowsIsTotal,((r=(o=this.totals)===null||o===void 0?void 0:o.row)===null||r===void 0?void 0:r.showGrandTotals)||this.indicatorsAsCol&&this.rows.length===0,this.rowGrandTotalLabel,this.rowSubTotalLabel,(a=(l=(s=this.totals)===null||s===void 0?void 0:s.row)===null||l===void 0?void 0:l.showGrandTotalsOnTop)!==null&&a!==void 0&&a,(u=(d=(h=this.totals)===null||h===void 0?void 0:h.row)===null||d===void 0?void 0:d.showSubTotalsOnTop)!==null&&u!==void 0&&u)),this.customColTree||(this.colHeaderTree=this.ArrToTree(this.colKeys,this.columns.filter((w,y)=>this.columnsHasValue[y]),this.indicatorsAsCol?this.indicators:void 0,this.colsIsTotal,((g=(c=this.totals)===null||c===void 0?void 0:c.column)===null||g===void 0?void 0:g.showGrandTotals)||!this.indicatorsAsCol&&this.columns.length===0,this.colGrandTotalLabel,this.colSubTotalLabel,(m=(p=(f=this.totals)===null||f===void 0?void 0:f.column)===null||p===void 0?void 0:p.showGrandTotalsOnLeft)!==null&&m!==void 0&&m,(_=(C=(b=this.totals)===null||b===void 0?void 0:b.column)===null||C===void 0?void 0:C.showSubTotalsOnLeft)!==null&&_!==void 0&&_))}updateFilterRules(t,e=!1){var n,o;if(this.filterRules=t,this.filteredRecords=void 0,e)this.tree={};else for(const r in this.tree)for(const s in this.tree[r])for(let l=0;l<this.tree[r][s].length;l++)(n=this.tree[r][s][l])===null||n===void 0||n.reset();this.collectedValues={},this.processRecords(),this.processCollectedValuesWithSumBy(),this.processCollectedValuesWithSortBy(),this.totalStatistics(),!((o=this.dataConfig)===null||o===void 0)&&o.isPivotChart&&this.cacheDeminsionCollectedValues()}getAggregatorRule(t){var e;return(e=this.aggregationRules)===null||e===void 0?void 0:e.find((n,o)=>t===n.indicatorKey)}getAggregator(t=[],e=[],n,o=!0,r){var s,l,a,h;const d=this.indicatorKeys.indexOf(n);let u,c;typeof t=="string"?u=t:(r&&r.position!=="row"||t.map((f,p)=>{f!==n||z(r==null?void 0:r.index)&&p!==r.index||t.splice(p,1)}),u=TT(t,this.stringJoinChar)),typeof e=="string"?c=e:(r&&r.position!=="col"||e.map((f,p)=>{f!==n||z(r==null?void 0:r.index)&&p!==r.index||e.splice(p,1)}),c=TT(e,this.stringJoinChar));const g=(l=(s=this.tree[u])===null||s===void 0?void 0:s[c])===null||l===void 0?void 0:l[d];if(o&&z((h=(a=this.changedTree[u])===null||a===void 0?void 0:a[c])===null||h===void 0?void 0:h[d])){const f=this.changedTree[u][c][d];return g?{value:()=>f,formatValue:g.formatValue,formatFun:g.formatFun,records:g.records,className:"",recalculate(){},push(){},deleteRecord(){},updateRecord(){},clearCacheValue(){},reset(){}}:{value:()=>f,className:"",push(){},deleteRecord(){},updateRecord(){},recalculate(){},formatValue:()=>f,clearCacheValue(){},reset(){}}}return g||{className:"",push(){},deleteRecord(){},updateRecord(){},recalculate(){},value:()=>null,clearCacheValue(){},reset(){}}}sortKeys(){if(this.colKeys=this.colKeys_normal.slice(),this.rowKeys=this.rowKeys_normal.slice(),!this.sorted){this.sorted=!0,this.rowKeys.sort(this.arrSort(this.rows,!0));const t=this.arrSort(this.columns,!1);this.colKeys.sort(t)}}arrSort(t,e){let n;const o=this,r=function(s){const l=[];for(let a=0,h=t.length;a<h;a++)if(n=t[a],o.sortRules)for(let d=0,u=o.sortRules.length;d<u;d++)o.sortRules[d].sortField===n&&l.push({field:n,fieldIndex:a,sortRule:o.sortRules[d],func:o.getSort(o.sortRules[d],e)});return l}.call(this);return function(s,l){var a,h,d,u;let c,g;for(let f=0;f<r.length;f++){if(g=r[f],(a=g.sortRule)===null||a===void 0?void 0:a.sortByIndicator){let p=s,m=l;g.fieldIndex<t.length-1&&(p=s.slice(0,g.fieldIndex+1),o.rowHierarchyType==="grid"&&e?p.push(o.rowSubTotalLabel):e||p.push(o.colSubTotalLabel),m=l.slice(0,g.fieldIndex+1),o.rowHierarchyType==="grid"&&e?m.push(o.rowSubTotalLabel):e||m.push(o.colSubTotalLabel)),c=g.func(p,m,(h=g.sortRule)===null||h===void 0?void 0:h.sortType)}else c=(d=g.func)===null||d===void 0?void 0:d.call(g,s[g.fieldIndex],l[g.fieldIndex],(u=g.sortRule)===null||u===void 0?void 0:u.sortType);if(c!==0)return c}return 0}}getSort(t,e){const n=this;return t.sortByIndicator?(o,r,s)=>{const l=function(a,h){return n.rowHierarchyType==="grid"&&a.length<n.rows.length&&a[a.length-1]!==n.rowSubTotalLabel&&a[a.length-1]!==n.rowGrandTotalLabel&&a.push(n.rowSubTotalLabel),h.length<n.columns.length&&h[h.length-1]!==n.colSubTotalLabel&&h[h.length-1]!==n.colGrandTotalLabel&&h.push(n.colSubTotalLabel),n.getAggregator(a,h,t.sortByIndicator).value()};return e?bc(l(o,t.query),l(r,t.query),s):bc(l(t.query,o),l(t.query,r),s)}:t.sortBy?X4(t.sortBy):t.sortFunc?t.sortFunc:t.sortType?Y4:bc}totalStatistics(){var t,e,n,o,r,s,l,a,h,d,u,c,g,f;const p=this,m=(b,C)=>{var _,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht,gt,Ct,Q,et,vt,bt,dt,ot,ut,st,_t,ct,Wt,Yt,yt,mt,ie,le,Zt,_e,Oe,He;if(!((w=(_=this.totalRecordsTree)===null||_===void 0?void 0:_[b])===null||w===void 0)&&w[C])return this.tree[b]||(this.tree[b]={}),void(this.tree[b][C]=(S=(y=this.totalRecordsTree)===null||y===void 0?void 0:y[b])===null||S===void 0?void 0:S[C]);const Ht=C.split(this.stringJoinChar);if(!((R=(A=p.totals)===null||A===void 0?void 0:A.column)===null||R===void 0)&&R.subTotalsDimensions&&((M=(T=(x=p.totals)===null||x===void 0?void 0:x.column)===null||T===void 0?void 0:T.subTotalsDimensions)===null||M===void 0?void 0:M.length)>0&&p.totals.column.showSubTotals!==!1)for(let Et=0,Rt=(F=(P=(B=p.totals)===null||B===void 0?void 0:B.column)===null||P===void 0?void 0:P.subTotalsDimensions)===null||F===void 0?void 0:F.length;Et<Rt;Et++){const Tt=p.totals.column.subTotalsDimensions[Et],Nt=p.columns.indexOf(Tt);if(Nt>=0){const te=Ht.slice(0,Nt+1);te.push(p.colSubTotalLabel);const ae=te.join(this.stringJoinChar);if(!((E=(H=this.totalRecordsTree)===null||H===void 0?void 0:H[b])===null||E===void 0)&&E[ae])return void(this.tree[b][ae]=(I=(k=this.totalRecordsTree)===null||k===void 0?void 0:k[b])===null||I===void 0?void 0:I[ae]);this.tree[b][ae]||(this.tree[b][ae]=[]);const Jt=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let J=0;J<Jt.length;J++)if(this.calculatedFiledKeys.indexOf(Jt[J])>=0){const be=(L=this.calculatedFieldRules)===null||L===void 0?void 0:L.find(Lt=>Lt.key===Jt[J]);!((O=(D=this.tree[b])===null||D===void 0?void 0:D[ae])===null||O===void 0)&&O[J]||(this.tree[b][ae][J]=new this.aggregators[zt.RECALCULATE]({key:Jt[J],dimension:Jt[J],isRecord:!0,formatFun:(W=(N=this.indicators)===null||N===void 0?void 0:N.find(Lt=>typeof Lt!="string"&&Lt.indicatorKey===Jt[J]))===null||W===void 0?void 0:W.format,calculateFun:be==null?void 0:be.calculateFun,dependAggregators:this.tree[b][ae],dependIndicatorKeys:be==null?void 0:be.dependIndicatorKeys})),ae!==C&&this.tree[b][ae][J].push((U=($=p.tree[b])===null||$===void 0?void 0:$[C])===null||U===void 0?void 0:U[J])}else{if(!this.tree[b][ae][J]){const be=this.getAggregatorRule(Jt[J]);this.tree[b][ae][J]=new this.aggregators[(Y=be==null?void 0:be.aggregationType)!==null&&Y!==void 0?Y:zt.SUM]({key:Jt[J],dimension:(j=be==null?void 0:be.field)!==null&&j!==void 0?j:Jt[J],formatFun:(G=be==null?void 0:be.formatFun)!==null&&G!==void 0?G:(ht=(X=this.indicators)===null||X===void 0?void 0:X.find(Lt=>typeof Lt!="string"&&Lt.indicatorKey===Jt[J]))===null||ht===void 0?void 0:ht.format})}ae!==C&&this.tree[b][ae][J].push((Ct=(gt=p.tree[b])===null||gt===void 0?void 0:gt[C])===null||Ct===void 0?void 0:Ct[J])}}}if(!((et=(Q=p.totals)===null||Q===void 0?void 0:Q.column)===null||et===void 0)&&et.showGrandTotals||this.rows.length===0){const Et=p.colGrandTotalLabel;if(!((bt=(vt=this.totalRecordsTree)===null||vt===void 0?void 0:vt[b])===null||bt===void 0)&&bt[Et])return void(this.tree[b][Et]=(ot=(dt=this.totalRecordsTree)===null||dt===void 0?void 0:dt[b])===null||ot===void 0?void 0:ot[Et]);this.tree[b][Et]||(this.tree[b][Et]=[]);const Rt=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let Tt=0;Tt<Rt.length;Tt++)if(this.calculatedFiledKeys.indexOf(Rt[Tt])>=0){const Nt=(ut=this.calculatedFieldRules)===null||ut===void 0?void 0:ut.find(te=>te.key===Rt[Tt]);!((_t=(st=this.tree[b])===null||st===void 0?void 0:st[Et])===null||_t===void 0)&&_t[Tt]||(this.tree[b][Et][Tt]=new this.aggregators[zt.RECALCULATE]({key:Rt[Tt],dimension:Rt[Tt],isRecord:!0,formatFun:(Wt=(ct=this.indicators)===null||ct===void 0?void 0:ct.find(te=>typeof te!="string"&&te.indicatorKey===Rt[Tt]))===null||Wt===void 0?void 0:Wt.format,calculateFun:Nt==null?void 0:Nt.calculateFun,dependAggregators:this.tree[b][Et],dependIndicatorKeys:Nt==null?void 0:Nt.dependIndicatorKeys})),Et!==C&&this.tree[b][Et][Tt].push((yt=(Yt=p.tree[b])===null||Yt===void 0?void 0:Yt[C])===null||yt===void 0?void 0:yt[Tt])}else{if(!this.tree[b][Et][Tt]){const Nt=this.getAggregatorRule(Rt[Tt]);this.tree[b][Et][Tt]=new this.aggregators[(mt=Nt==null?void 0:Nt.aggregationType)!==null&&mt!==void 0?mt:zt.SUM]({key:Rt[Tt],dimension:(ie=Nt==null?void 0:Nt.field)!==null&&ie!==void 0?ie:Rt[Tt],formatFun:(le=Nt==null?void 0:Nt.formatFun)!==null&&le!==void 0?le:(_e=(Zt=this.indicators)===null||Zt===void 0?void 0:Zt.find(te=>typeof te!="string"&&te.indicatorKey===Rt[Tt]))===null||_e===void 0?void 0:_e.format})}Et!==C&&this.tree[b][Et][Tt].push((He=(Oe=p.tree[b])===null||Oe===void 0?void 0:Oe[C])===null||He===void 0?void 0:He[Tt])}}};if(!((e=(t=p==null?void 0:p.totals)===null||t===void 0?void 0:t.column)===null||e===void 0)&&e.subTotalsDimensions&&((r=(o=(n=p==null?void 0:p.totals)===null||n===void 0?void 0:n.column)===null||o===void 0?void 0:o.subTotalsDimensions)===null||r===void 0?void 0:r.length)>=1||!((l=(s=p==null?void 0:p.totals)===null||s===void 0?void 0:s.row)===null||l===void 0)&&l.subTotalsDimensions&&((d=(h=(a=p==null?void 0:p.totals)===null||a===void 0?void 0:a.row)===null||h===void 0?void 0:h.subTotalsDimensions)===null||d===void 0?void 0:d.length)>=1||!((c=(u=p==null?void 0:p.totals)===null||u===void 0?void 0:u.column)===null||c===void 0)&&c.showGrandTotals||!((f=(g=p==null?void 0:p.totals)===null||g===void 0?void 0:g.row)===null||f===void 0)&&f.showGrandTotals){const b=[];Object.keys(p.tree).forEach(C=>{const _=C.split(this.stringJoinChar);Object.keys(p.tree[C]).forEach(w=>{var y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht,gt,Ct,Q,et;if(!((S=(y=p.totals)===null||y===void 0?void 0:y.row)===null||S===void 0)&&S.subTotalsDimensions&&((x=(R=(A=p.totals)===null||A===void 0?void 0:A.row)===null||R===void 0?void 0:R.subTotalsDimensions)===null||x===void 0?void 0:x.length)>0&&p.totals.row.showSubTotals!==!1)for(let vt=0,bt=(B=(M=(T=p.totals)===null||T===void 0?void 0:T.row)===null||M===void 0?void 0:M.subTotalsDimensions)===null||B===void 0?void 0:B.length;vt<bt;vt++){const dt=p.totals.row.subTotalsDimensions[vt],ot=p.rows.indexOf(dt);if(ot>=0&&ot<p.rows.length-1){const ut=_.slice(0,ot+1);this.rowHierarchyType==="grid"&&ut.push(p.rowSubTotalLabel);const st=ut.join(this.stringJoinChar);this.tree[st]||(this.tree[st]={},b.push(st)),this.tree[st][w]||(this.tree[st][w]=[]);const _t=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let ct=0;ct<_t.length;ct++){if(!this.tree[st][w][ct])if(this.calculatedFiledKeys.indexOf(_t[ct])>=0){const Wt=(P=this.calculatedFieldRules)===null||P===void 0?void 0:P.find(Yt=>Yt.key===_t[ct]);this.tree[st][w][ct]=new this.aggregators[zt.RECALCULATE]({key:_t[ct],dimension:_t[ct],isRecord:!0,formatFun:(H=(F=this.indicators)===null||F===void 0?void 0:F.find(Yt=>typeof Yt!="string"&&Yt.indicatorKey===_t[ct]))===null||H===void 0?void 0:H.format,calculateFun:Wt==null?void 0:Wt.calculateFun,dependAggregators:this.tree[st][w],dependIndicatorKeys:Wt==null?void 0:Wt.dependIndicatorKeys})}else{const Wt=this.getAggregatorRule(_t[ct]);this.tree[st][w][ct]=new this.aggregators[(E=Wt==null?void 0:Wt.aggregationType)!==null&&E!==void 0?E:zt.SUM]({key:_t[ct],dimension:(k=Wt==null?void 0:Wt.field)!==null&&k!==void 0?k:_t[ct],formatFun:(I=Wt==null?void 0:Wt.formatFun)!==null&&I!==void 0?I:(D=(L=this.indicators)===null||L===void 0?void 0:L.find(Yt=>typeof Yt!="string"&&Yt.indicatorKey===_t[ct]))===null||D===void 0?void 0:D.format})}st!==C&&this.tree[st][w][ct].push((N=(O=p.tree[C])===null||O===void 0?void 0:O[w])===null||N===void 0?void 0:N[ct])}}}if(!(($=(W=p.totals)===null||W===void 0?void 0:W.row)===null||$===void 0)&&$.showGrandTotals||this.columns.length===0){const vt=p.rowGrandTotalLabel;this.tree[vt]||(this.tree[vt]={},b.push(vt)),this.tree[vt][w]||(this.tree[vt][w]=[]);const bt=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let dt=0;dt<bt.length;dt++){if(!this.tree[vt][w][dt])if(this.calculatedFiledKeys.indexOf(bt[dt])>=0){const ot=(U=this.calculatedFieldRules)===null||U===void 0?void 0:U.find(ut=>ut.key===bt[dt]);this.tree[vt][w][dt]=new this.aggregators[zt.RECALCULATE]({key:bt[dt],dimension:bt[dt],isRecord:!0,formatFun:(j=(Y=this.indicators)===null||Y===void 0?void 0:Y.find(ut=>typeof ut!="string"&&ut.indicatorKey===bt[dt]))===null||j===void 0?void 0:j.format,calculateFun:ot==null?void 0:ot.calculateFun,dependAggregators:this.tree[vt][w],dependIndicatorKeys:ot==null?void 0:ot.dependIndicatorKeys})}else{const ot=this.getAggregatorRule(bt[dt]);this.tree[vt][w][dt]=new this.aggregators[(G=ot==null?void 0:ot.aggregationType)!==null&&G!==void 0?G:zt.SUM]({key:bt[dt],dimension:(X=ot==null?void 0:ot.field)!==null&&X!==void 0?X:bt[dt],formatFun:(ht=ot==null?void 0:ot.formatFun)!==null&&ht!==void 0?ht:(Ct=(gt=this.indicators)===null||gt===void 0?void 0:gt.find(ut=>typeof ut!="string"&&ut.indicatorKey===bt[dt]))===null||Ct===void 0?void 0:Ct.format})}vt!==C&&this.tree[vt][w][dt].push((et=(Q=p.tree[C])===null||Q===void 0?void 0:Q[w])===null||et===void 0?void 0:et[dt])}}m(C,w)})}),b.forEach(C=>{Object.keys(p.tree[C]).forEach(_=>{m(C,_)})})}for(const b in p.totalRecordsTree)for(const C in p.totalRecordsTree[b])m(b,C)}ArrToTree1(t,e,n,o,r){const s=[],l=this.stringJoinChar,a=new Map;function h(d){const u=[];let c;d.forEach((g,f)=>{var p;u.push(g);const m=u.join(l);let b=a.get(m);b||(b={value:g,dimensionKey:e[f],children:f===d.length-1&&((p=n==null?void 0:n.length)!==null&&p!==void 0?p:0)>=1?n==null?void 0:n.map(C=>typeof C=="string"?{indicatorKey:C,value:C}:{indicatorKey:C.indicatorKey,value:C.title}):[]},a.set(m,b),c?c.children.push(b):s.push(b)),c=b})}return t.forEach(d=>h(d)),o&&h([r]),s}ArrToTree(t,e,n,o,r,s,l,a,h){var d;let u=[];const c=this.stringJoinChar,g=new Map;if(t!=null&&t.length?t.forEach(f=>function(p){const m=[];let b;p.forEach((C,_)=>{var w,y,S,A;m.push(C);const R=m.join(c);let x=g.get(R);if(!x){if(x={value:C,dimensionKey:e[_],children:_===p.length-1&&((w=n==null?void 0:n.length)!==null&&w!==void 0?w:0)>=1?n==null?void 0:n.map(T=>typeof T=="string"?{indicatorKey:T,value:T}:{indicatorKey:T.indicatorKey,value:T.title}):[]},o[_]){let T=(y=x.children)!==null&&y!==void 0?y:[];const M={value:l,dimensionKey:e[_+1],levelSpan:o.length-_-1,children:((S=n==null?void 0:n.length)!==null&&S!==void 0?S:0)>=1?n==null?void 0:n.map(B=>typeof B=="string"?{indicatorKey:B,value:B}:{indicatorKey:B.indicatorKey,value:B.title}):[]};T.push(M),T=(A=M.children)!==null&&A!==void 0?A:[]}g.set(R,x),b?o[_-1]&&!h?b.children.splice(b.children.length-1,0,x):b.children.push(x):u.push(x)}b=x})}(f)):n&&(u=n==null?void 0:n.map(f=>{var p;return typeof f=="string"?{indicatorKey:f,value:f}:{indicatorKey:f.indicatorKey,value:(p=f.title)!==null&&p!==void 0?p:f.indicatorKey}})),r&&(t==null?void 0:t.length)){const f={value:s,dimensionKey:e[0],levelSpan:o.length,children:(d=n==null?void 0:n.map(p=>typeof p=="string"?{indicatorKey:p,value:p}:{indicatorKey:p.indicatorKey,value:p.title}))!==null&&d!==void 0?d:[]};a?u.unshift(f):u.push(f)}return u}cacheDeminsionCollectedValues(){for(const t in this.collectValuesBy)this.collectValuesBy[t].type!=="xField"&&this.collectValuesBy[t].type!=="yField"||(this.dataConfig.dimensionSortArray?this.cacheCollectedValues[t]=z9(this.collectedValues[t],this.dataConfig.dimensionSortArray):this.cacheCollectedValues[t]=this.collectedValues[t])}changeTreeNodeValue(t=[],e=[],n,o){var r,s,l;const a=this.indicatorKeys.indexOf(n);let h,d;h=typeof t=="string"?t:t.join(this.stringJoinChar),d=typeof e=="string"?e:e.join(this.stringJoinChar),!((r=this.changedTree[h])===null||r===void 0)&&r[d]?this.changedTree[h][d][a]=o:this.changedTree[h]?(this.changedTree[h][d]=[],this.changedTree[h][d][a]=o):(this.changedTree[h]={},this.changedTree[h][d]=[],this.changedTree[h][d][a]=o);const u=(l=(s=this.tree[h])===null||s===void 0?void 0:s[d])===null||l===void 0?void 0:l[a];(u==null?void 0:u.records.length)===1&&(u.records[0][this.indicatorKeys[a]]=o)}changeRecordFieldValue(t,e,n){let o=!1;for(let r=0;r<this.indicatorKeys.length;r++)this.indicatorKeys[r]===t&&(o=!0);if(!o){if(Array.isArray(this.records))for(let r=0,s=this.records.length;r<s;r++){const l=this.records[r];l[t]===e&&(l[t]=n)}else for(const r in this.records)for(let s=0,l=this.records[r].length;s<l;s++){const a=this.records[r][s];a[t]===e&&(a[t]=n)}this.rowFlatKeys={},this.colFlatKeys={},this.tree={},this.processRecords()}}_rowTreeHasChanged(){this.hasExtensionRowTree||(this.customRowTreeDimensionPaths=this.customTreeToDimensionPathArr(this.customRowTree,"row"))}changeDataConfig(t){this.rows=t.rows,this.columns=t.columns}addRecords(t){for(let e=0,n=t.length;e<n;e++){const o=t[e];this.processRecord(o)}Array.isArray(this.records)&&this.records.push(t)}customTreeToDimensionPathArr(t,e){const n=[],o=this;function r(s,l){var a,h,d;s.virtual||(!((a=l[l.length-1])===null||a===void 0)&&a.childKeys&&s.dimensionKey&&l[l.length-1].childKeys.indexOf(s.dimensionKey)===-1&&s.dimensionKey!==l[l.length-1].dimensionKey&&l[l.length-1].childKeys.push(s.dimensionKey),l.push({dimensionKey:z(s.indicatorKey)?void 0:s.dimensionKey,value:s.value,indicatorKey:s.indicatorKey,virtual:s.virtual})),((h=s.children)===null||h===void 0?void 0:h.length)>0?(o.rowHierarchyType==="tree"&&e==="row"&&(l[l.length-1].childKeys=[],n.push([...l])),(d=s.children)===null||d===void 0||d.forEach(u=>r(u,[...l]))):n.push(l)}return t==null||t.forEach(s=>r(s,[])),n}getFieldMatchColDimensionPaths(t){var e,n;const o=[];for(let r=0;(n=r<((e=this.customColTreeDimensionPaths)===null||e===void 0?void 0:e.length))!==null&&n!==void 0&&n;r++){const s=this.customColTreeDimensionPaths[r];let l=!0;for(let a=0;a<s.length;a++){const h=s[a];if(h.dimensionKey&&t[h.dimensionKey]!==h.value||h.indicatorKey&&t[h.indicatorKey]===void 0){l=!1;break}}l&&o.push(s)}return o}getFieldMatchRowDimensionPaths(t){var e,n;const o=[];for(let r=0;(n=r<((e=this.customRowTreeDimensionPaths)===null||e===void 0?void 0:e.length))!==null&&n!==void 0&&n;r++){const s=this.customRowTreeDimensionPaths[r];let l=!0;for(let a=0;a<s.length;a++){const h=s[a];if(h.dimensionKey&&t[h.dimensionKey]!==h.value||h.indicatorKey&&t[h.indicatorKey]===void 0){l=!1;break}if(h.childKeys&&a===s.length-1&&h.childKeys.length>0&&h.childKeys.find(d=>z(t[d]))){l=!1;break}}l&&(this.indicatorsAsCol||this.rowHierarchyType!=="tree"||s.find(a=>a.indicatorKey)||(l=!1)),l&&o.push(s)}return o}}function z9(i,t){return i.sort((e,n)=>{const o=t.indexOf(e),r=t.indexOf(n);return o<r?-1:o>r?1:0})}let MT=class extends Cg{constructor(t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C;if(oe.mode==="node"?(e=t,t=null):t instanceof HTMLElement||(e=t,t=t.container?t.container:null),super(t,e),this.layoutNodeId={seqId:0},e){e.layout&&Object.assign(e,e.layout),this.internalProps.columns=Ee(e.columns),this.internalProps.rows=Ee(e.rows),this.internalProps.indicators=ho(e.indicators),(n=e.indicators)===null||n===void 0||n.forEach((w,y)=>{typeof w=="object"&&(w!=null&&w.editor)&&(this.internalProps.indicators[y].editor=w.editor)}),this.internalProps.columnTree=!e.indicatorsAsCol||!((o=e.columns)===null||o===void 0)&&o.length||e.columnTree?Ee(e.columnTree):[],this.internalProps.rowTree=e.indicatorsAsCol||!((r=e.rows)===null||r===void 0)&&r.length||e.rowTree?Ee(e.rowTree):[],this.internalProps.records=e.records,this.pagination=e.pagination,this.internalProps.columnResizeType=(s=e.columnResizeType)!==null&&s!==void 0?s:"column",this.internalProps.rowResizeType=(l=e.rowResizeType)!==null&&l!==void 0?l:"row",this.internalProps.dataConfig=Ee(e.dataConfig),this.internalProps.columnWidthConfig=e.columnWidthConfig;const _=this.internalProps.records;if(this.internalProps.recordsIsTwoDimensionalArray=!1,((a=_==null?void 0:_[0])===null||a===void 0?void 0:a.constructor)===Array&&(this.internalProps.recordsIsTwoDimensionalArray=!0),((h=e.customConfig)===null||h===void 0?void 0:h.enableDataAnalysis)===!1){const w=new Pe((d=this.internalProps.columnTree)!==null&&d!==void 0?d:[],this.layoutNodeId),y=new Pe((u=this.internalProps.rowTree)!==null&&u!==void 0?u:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(c=this.options.rowExpandLevel)!==null&&c!==void 0?c:1:void 0);this.internalProps.layoutMap=new lr(this,null,w,y),this.internalProps.recordsIsTwoDimensionalArray===!1&&(this.flatDataToObjects=new pv({rows:this.internalProps.layoutMap.fullRowDimensionKeys,columns:this.internalProps.layoutMap.colDimensionKeys,indicators:this.internalProps.layoutMap.indicatorKeys,indicatorsAsCol:this.internalProps.layoutMap.indicatorsAsCol,indicatorDimensionKey:this.internalProps.layoutMap.indicatorDimensionKey},_))}else{const w=$A(this,e),{rowKeys:y,columnKeys:S,indicatorKeys:A}=w;let{columnDimensionTree:R,rowDimensionTree:x}=w;this.dataset=new Ih(this.internalProps.dataConfig,y,S,A,this.internalProps.indicators,(g=e.indicatorsAsCol)===null||g===void 0||g,e.records,e.rowHierarchyType,this.internalProps.columnTree,this.internalProps.rowTree,!1,!!e.extensionRows,!!e.parseCustomTreeToMatchRecords),e.columnTree||(e.indicatorsAsCol!==!1&&(this.dataset.colHeaderTree=Vi(this.dataset.colHeaderTree,e.indicators)),R=new Pe((f=this.dataset.colHeaderTree)!==null&&f!==void 0?f:[],this.layoutNodeId)),e.rowTree||(e.indicatorsAsCol===!1&&(this.dataset.rowHeaderTree=Vi(this.dataset.rowHeaderTree,e.indicators)),x=new Pe((p=this.dataset.rowHeaderTree)!==null&&p!==void 0?p:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(m=this.options.rowExpandLevel)!==null&&m!==void 0?m:1:void 0)),this.internalProps.layoutMap=new lr(this,this.dataset,R,x)}if(this._changePivotSortStateBySortRules(),((C=(b=e.pivotSortState)===null||b===void 0?void 0:b.length)!==null&&C!==void 0?C:0)>0&&(this.pivotSortState=[],this.pivotSortState=e.pivotSortState),oe.mode!=="node"&&(this.editorManager=new cT(this)),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.stateManager.initCheckedState(_),this.scenegraph.createSceneGraph(),e.title){const w=Bt.getComponent("title");this.internalProps.title=new w(e.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const w=Bt.getComponent("emptyTip");this.internalProps.emptyTip=new w(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}setTimeout(()=>{this.fireListeners(at.INITIALIZED,null)},0)}}static get EVENT_TYPE(){return rr}isListTable(){return!1}isPivotTable(){return!0}isPivotChart(){return!1}get recordsCount(){var t;return(t=this.records)===null||t===void 0?void 0:t.length}_canResizeColumn(t,e){const n=super._canResizeColumn(t,e);if(n){if(this.internalProps.layoutMap.isSeriesNumber(t,e)&&this.internalProps.rowSeriesNumber.disableColumnResize===!0)return!1;if(!this.internalProps.layoutMap.indicatorsAsCol){const o=this.internalProps.layoutMap.getBody(t,this.columnHeaderLevelCount);if(o!=null&&o.disableColumnResize)return!1}}return n}updateOption(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_;const w=this.internalProps;if(super.updateOption(t),this.layoutNodeId={seqId:0},this.internalProps.columns=Ee(t.columns),this.internalProps.rows=Ee(t.rows),this.internalProps.indicators=!((e=t.indicators)===null||e===void 0)&&e.length?ho(t.indicators):[],(n=t.indicators)===null||n===void 0||n.forEach((S,A)=>{typeof S=="object"&&(S!=null&&S.editor)&&(this.internalProps.indicators[A].editor=S.editor)}),this.internalProps.columnTree=!t.indicatorsAsCol||!((o=t.columns)===null||o===void 0)&&o.length||t.columnTree?Ee(t.columnTree):[],this.internalProps.rowTree=t.indicatorsAsCol||!((r=t.rows)===null||r===void 0)&&r.length||t.rowTree?Ee(t.rowTree):[],t.records&&(this.internalProps.records=t.records),this.stateManager.initCheckedState(this.internalProps.records),this.stateManager.updateDrillState(void 0,void 0,!1,!1,-1,-1),this.pagination=t.pagination,w.columnResizeType=(s=t.columnResizeType)!==null&&s!==void 0?s:"column",w.rowResizeType=(l=t.rowResizeType)!==null&&l!==void 0?l:"row",w.dataConfig=Ee(t.dataConfig),this.internalProps.columnWidthConfig=t.columnWidthConfig,(t==null?void 0:t.rowHierarchyType)==="tree"&&this.internalProps.layoutMap.rowHierarchyType==="tree"&&this.internalProps.layoutMap.rowExpandLevel===(t==null?void 0:t.rowExpandLevel)){const S=this.internalProps.layoutMap.rowDimensionTree.tree.children;(a=this.internalProps.rowTree)===null||a===void 0||a.forEach((A,R)=>{const x=S.find(T=>T.dimensionKey===A.dimensionKey&&T.value===A.value);x&&this._syncHierarchyState(x,A)})}const y=this.internalProps.records;if(this.internalProps.recordsIsTwoDimensionalArray=!1,((h=y==null?void 0:y[0])===null||h===void 0?void 0:h.constructor)===Array&&(this.internalProps.recordsIsTwoDimensionalArray=!0),((d=t.customConfig)===null||d===void 0?void 0:d.enableDataAnalysis)===!1){let S,A;t.columnTree&&(S=new Pe((u=this.internalProps.columnTree)!==null&&u!==void 0?u:[],this.layoutNodeId)),t.rowTree&&(A=new Pe((c=this.internalProps.rowTree)!==null&&c!==void 0?c:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(g=this.options.rowExpandLevel)!==null&&g!==void 0?g:1:void 0)),w.layoutMap=new lr(this,null,S,A),this.internalProps.recordsIsTwoDimensionalArray===!1&&(this.flatDataToObjects=new pv({rows:w.layoutMap.fullRowDimensionKeys,columns:w.layoutMap.colDimensionKeys,indicators:w.layoutMap.indicatorKeys,indicatorsAsCol:w.layoutMap.indicatorsAsCol,indicatorDimensionKey:w.layoutMap.indicatorDimensionKey},y))}else{const S=$A(this,t),{rowKeys:A,columnKeys:R,indicatorKeys:x}=S;let{columnDimensionTree:T,rowDimensionTree:M}=S;this.dataset=new Ih(w.dataConfig,A,R,x,this.internalProps.indicators,(f=t.indicatorsAsCol)===null||f===void 0||f,y,t.rowHierarchyType,this.internalProps.columnTree,this.internalProps.rowTree,!1,!!t.extensionRows,!!t.parseCustomTreeToMatchRecords),t.columnTree||(t.indicatorsAsCol!==!1&&(this.dataset.colHeaderTree=Vi(this.dataset.colHeaderTree,t.indicators)),T=new Pe((p=this.dataset.colHeaderTree)!==null&&p!==void 0?p:[],this.layoutNodeId)),t.rowTree||(t.indicatorsAsCol===!1&&(this.dataset.rowHeaderTree=Vi(this.dataset.rowHeaderTree,t.indicators)),M=new Pe((m=this.dataset.rowHeaderTree)!==null&&m!==void 0?m:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(b=this.options.rowExpandLevel)!==null&&b!==void 0?b:1:void 0)),w.layoutMap=new lr(this,this.dataset,T,M)}if(this._changePivotSortStateBySortRules(),((_=(C=t.pivotSortState)===null||C===void 0?void 0:C.length)!==null&&_!==void 0?_:0)>0&&(this.pivotSortState=[],this.pivotSortState=t.pivotSortState),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,w.releaseList&&(w.releaseList.forEach(S=>{var A;return(A=S==null?void 0:S.release)===null||A===void 0?void 0:A.call(S)}),w.releaseList=null),this.scenegraph.clearCells(),this.scenegraph.createSceneGraph(),t.title){const S=Bt.getComponent("title");this.internalProps.title=new S(t.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const S=Bt.getComponent("emptyTip");this.internalProps.emptyTip=new S(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}return new Promise(S=>{setTimeout(S,0)})}updatePagination(t){t?(this.pagination||(this.pagination={currentPage:0,perPageCount:0}),typeof t.currentPage=="number"&&t.currentPage>=0&&(this.pagination.currentPage=t.currentPage),t.perPageCount&&(this.pagination.perPageCount=t.perPageCount||this.pagination.perPageCount),this.scenegraph.clearCells(),this.internalProps.layoutMap.setPagination(this.pagination),this.refreshRowColCount(),this.scenegraph.createSceneGraph(),this.render()):this.pagination&&(this.pagination=void 0,this.scenegraph.clearCells(),this.internalProps.layoutMap.setPagination(void 0),this.refreshRowColCount(),this.scenegraph.createSceneGraph(),this.render())}refreshHeader(){this.setMinMaxLimitWidth(!0),this.refreshRowColCount()}refreshRowColCount(){var t,e,n,o,r,s,l,a,h;const d=this,{layoutMap:u}=d.internalProps;u&&(d.colCount=(t=u.colCount)!==null&&t!==void 0?t:0,d.rowCount=(e=u.rowCount)!==null&&e!==void 0?e:0,this.internalProps.frozenColCount=Math.max(((n=u.rowHeaderLevelCount)!==null&&n!==void 0?n:0)+u.leftRowSeriesNumberColumnCount,(o=this.options.frozenColCount)!==null&&o!==void 0?o:0),d.frozenRowCount=Math.max(u.headerLevelCount,(r=this.options.frozenRowCount)!==null&&r!==void 0?r:0),d.bottomFrozenRowCount!==((s=this.options.bottomFrozenRowCount)!==null&&s!==void 0?s:0)&&(d.bottomFrozenRowCount=(l=this.options.bottomFrozenRowCount)!==null&&l!==void 0?l:0),d.rightFrozenColCount!==((a=this.options.rightFrozenColCount)!==null&&a!==void 0?a:0)&&(d.rightFrozenColCount=(h=this.options.rightFrozenColCount)!==null&&h!==void 0?h:0),this.stateManager.setFrozenCol(this.internalProps.frozenColCount))}_getSortFuncFromHeaderOption(t,e,n){}get rowHierarchyType(){return this.internalProps.layoutMap.rowHierarchyType}_syncHierarchyState(t,e){var n,o;t.value===e.value&&t.dimensionKey===e.dimensionKey&&(e.hierarchyState=(n=e.hierarchyState)!==null&&n!==void 0?n:e!=null&&e.children?t.hierarchyState:void 0,(o=e==null?void 0:e.children)===null||o===void 0||o.forEach((r,s)=>{var l;if(!((l=t==null?void 0:t.children)===null||l===void 0)&&l[s]&&r){const a=t.children.find(h=>h.dimensionKey===r.dimensionKey&&h.value===r.value);a&&this._syncHierarchyState(a,r)}}))}getRecordShowIndexByCell(t,e){}getTableIndexByRecordIndex(t){}getTableIndexByField(t){}getCellAddrByFieldRecord(t,e){}getBodyIndexByRow(t){const{layoutMap:e}=this.internalProps;return e.getBodyIndexByRow(t)}getBodyIndexByCol(t){const{layoutMap:e}=this.internalProps;return e.getBodyIndexByCol(t)}getFieldData(t,e,n){var o,r,s;if(!this.internalProps.layoutMap.isHeader(e,n)){if(this.internalProps.recordsIsTwoDimensionalArray){const l=this.getBodyIndexByRow(n),a=this.getBodyIndexByCol(e);return(o=this.records[l])===null||o===void 0?void 0:o[a]}if(this.dataset){const l=this.internalProps.layoutMap.getCellHeaderPaths(e,n);if(l){let a;const h=(r=l.colHeaderPaths)===null||r===void 0?void 0:r.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(a={position:"col",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),d=(s=l.rowHeaderPaths)===null||s===void 0?void 0:s.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(a={position:"row",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),u=this.dataset.getAggregator(d,h,this.internalProps.layoutMap.getIndicatorKey(e,n),!0,a);if(u.records&&u.records.length>=1)return u.records[0][t]}}else if(this.flatDataToObjects){const l=this.internalProps.layoutMap.getCellHeaderPaths(e,n),a=l.colHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),h=l.rowHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),d=this.flatDataToObjects.getTreeNode(h,a,this.internalProps.layoutMap.getBody(e,n).indicatorKey,!1);if(d!=null&&d.record)return d==null?void 0:d.record[t]}}}getCellValue(t,e,n){var o,r,s,l,a,h,d;if(!n){const u=this.getCustomMergeValue(t,e);if(u)return u}if(this.internalProps.layoutMap.isSeriesNumber(t,e)){if(this.internalProps.layoutMap.isSeriesNumberInHeader(t,e)){const{title:c}=this.internalProps.layoutMap.getSeriesNumberHeader(t,e);return c}const{format:u}=this.internalProps.layoutMap.getSeriesNumberBody(t,e);return typeof u=="function"?u(t,e,this):e-this.columnHeaderLevelCount+1}if(this.internalProps.layoutMap.isHeader(t,e)){const{title:u,fieldFormat:c}=this.internalProps.layoutMap.getHeader(t,e);return typeof c=="function"?c(u,t,e,this):u}if(this.internalProps.recordsIsTwoDimensionalArray){const{fieldFormat:u}=this.internalProps.layoutMap.getBody(t,e),c=this.getBodyIndexByRow(e),g=this.getBodyIndexByCol(t),f=(o=this.records[c])===null||o===void 0?void 0:o[g];return typeof u=="function"?u(f,t,e,this):f}if(this.dataset){const u=this.internalProps.layoutMap.getCellHeaderPaths(t,e);let c;const g=(s=(r=u.colHeaderPaths)===null||r===void 0?void 0:r.filter(b=>!b.virtual))===null||s===void 0?void 0:s.map((b,C)=>{var _;return b.indicatorKey&&(c={position:"col",index:C}),(_=b.indicatorKey)!==null&&_!==void 0?_:b.value}),f=(a=(l=u.rowHeaderPaths)===null||l===void 0?void 0:l.filter(b=>!b.virtual))===null||a===void 0?void 0:a.map((b,C)=>{var _;return b.indicatorKey&&(c={position:"row",index:C}),(_=b.indicatorKey)!==null&&_!==void 0?_:b.value}),p=this.dataset.getAggregator(f,g,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,c),{fieldFormat:m}=this.internalProps.layoutMap.getBody(t,e);return p.formatValue?p.formatValue(t,e,this):typeof m=="function"?m(p==null?void 0:p.value(),t,e,this):(h=p==null?void 0:p.value())!==null&&h!==void 0?h:""}if(this.flatDataToObjects){const u=this.internalProps.layoutMap.getCellHeaderPaths(t,e),c=u.colHeaderPaths.map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value}),g=u.rowHeaderPaths.map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value}),f=this.flatDataToObjects.getTreeNode(g,c,this.internalProps.layoutMap.getBody(t,e).indicatorKey),{fieldFormat:p}=this.internalProps.layoutMap.getBody(t,e);return typeof p=="function"?p(f==null?void 0:f.value,t,e,this):(d=f==null?void 0:f.value)!==null&&d!==void 0?d:""}}getCellOriginValue(t,e){var n,o,r;const s=this;if(s.internalProps.layoutMap.isHeader(t,e)){const{title:l}=s.internalProps.layoutMap.getHeader(t,e);return typeof l=="function"?l():l}if(this.internalProps.recordsIsTwoDimensionalArray){const l=this.getBodyIndexByRow(e),a=this.getBodyIndexByCol(t);return(n=this.records[l])===null||n===void 0?void 0:n[a]}if(this.dataset){let l;const a=this.internalProps.layoutMap.getCellHeaderPaths(t,e),h=(o=a.colHeaderPaths)===null||o===void 0?void 0:o.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(l={position:"col",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),d=(r=a.rowHeaderPaths)===null||r===void 0?void 0:r.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(l={position:"row",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),u=this.dataset.getAggregator(d,h,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,l);return u.value?u.value():void 0}if(this.flatDataToObjects){const l=this.internalProps.layoutMap.getCellHeaderPaths(t,e),a=l.colHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),h=l.rowHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),d=this.flatDataToObjects.getTreeNode(h,a,this.internalProps.layoutMap.getBody(t,e).indicatorKey);return d==null?void 0:d.value}}getCellRawValue(t,e){var n,o,r;const s=this;if(s.internalProps.layoutMap.isHeader(t,e)){const{title:l}=s.internalProps.layoutMap.getHeader(t,e);return typeof l=="function"?l():l}if(this.internalProps.recordsIsTwoDimensionalArray){const l=this.getBodyIndexByRow(e),a=this.getBodyIndexByCol(t);return(n=this.records[l])===null||n===void 0?void 0:n[a]}if(this.dataset){let l;const a=this.internalProps.layoutMap.getCellHeaderPaths(t,e),h=(o=a.colHeaderPaths)===null||o===void 0?void 0:o.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(l={position:"col",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),d=(r=a.rowHeaderPaths)===null||r===void 0?void 0:r.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(l={position:"row",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),u=this.dataset.getAggregator(d,h,this.internalProps.layoutMap.getIndicatorKey(t,e),!1,l);return u.value?u.value():void 0}if(this.flatDataToObjects){const l=this.internalProps.layoutMap.getCellHeaderPaths(t,e),a=l.colHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),h=l.rowHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),d=this.flatDataToObjects.getTreeNode(h,a,this.internalProps.layoutMap.getBody(t,e).indicatorKey,!1);return d==null?void 0:d.value}}getCellOriginRecord(t,e){var n,o,r;if(!this.internalProps.layoutMap.isHeader(t,e)){if(this.internalProps.recordsIsTwoDimensionalArray){const s=this.getBodyIndexByRow(e),l=this.getBodyIndexByCol(t);return(n=this.records[s])===null||n===void 0?void 0:n[l]}if(this.dataset){let s;const l=this.internalProps.layoutMap.getCellHeaderPaths(t,e),a=(o=l.colHeaderPaths)===null||o===void 0?void 0:o.filter(d=>!d.virtual).map((d,u)=>{var c;return d.indicatorKey&&(s={position:"col",index:u}),(c=d.indicatorKey)!==null&&c!==void 0?c:d.value}),h=(r=l.rowHeaderPaths)===null||r===void 0?void 0:r.filter(d=>!d.virtual).map((d,u)=>{var c;return d.indicatorKey&&(s={position:"row",index:u}),(c=d.indicatorKey)!==null&&c!==void 0?c:d.value});return this.dataset.getAggregator(h,a,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,s).records}if(this.flatDataToObjects){const s=this.internalProps.layoutMap.getCellHeaderPaths(t,e),l=s.colHeaderPaths.map(d=>{var u;return(u=d.indicatorKey)!==null&&u!==void 0?u:d.value}),a=s.rowHeaderPaths.map(d=>{var u;return(u=d.indicatorKey)!==null&&u!==void 0?u:d.value}),h=this.flatDataToObjects.getTreeNode(a,l,this.internalProps.layoutMap.getBody(t,e).indicatorKey);return h==null?void 0:h.record}}}getCellRawRecord(t,e){var n,o,r;if(!this.internalProps.layoutMap.isHeader(t,e)){if(this.internalProps.recordsIsTwoDimensionalArray){const s=this.getBodyIndexByRow(e),l=this.getBodyIndexByCol(t);return(n=this.records[s])===null||n===void 0?void 0:n[l]}if(this.dataset){let s;const l=this.internalProps.layoutMap.getCellHeaderPaths(t,e),a=(o=l.colHeaderPaths)===null||o===void 0?void 0:o.filter(d=>!d.virtual).map((d,u)=>{var c;return d.indicatorKey&&(s={position:"col",index:u}),(c=d.indicatorKey)!==null&&c!==void 0?c:d.value}),h=(r=l.rowHeaderPaths)===null||r===void 0?void 0:r.filter(d=>!d.virtual).map((d,u)=>{var c;return d.indicatorKey&&(s={position:"row",index:u}),(c=d.indicatorKey)!==null&&c!==void 0?c:d.value});return this.dataset.getAggregator(h,a,this.internalProps.layoutMap.getIndicatorKey(t,e),!1,s).records}if(this.flatDataToObjects){const s=this.internalProps.layoutMap.getCellHeaderPaths(t,e),l=s.colHeaderPaths.map(d=>{var u;return(u=d.indicatorKey)!==null&&u!==void 0?u:d.value}),a=s.rowHeaderPaths.map(d=>{var u;return(u=d.indicatorKey)!==null&&u!==void 0?u:d.value}),h=this.flatDataToObjects.getTreeNode(a,l,this.internalProps.layoutMap.getBody(t,e).indicatorKey,!1);return h==null?void 0:h.record}}}updateSortRules(t,e,n){this.internalProps.dataConfig?this.internalProps.dataConfig.sortRules=t:this.internalProps.dataConfig={sortRules:t},this.dataset.updateSortRules(t),this._changePivotSortStateBySortRules();const{layoutMap:o}=this.internalProps;o.resetHeaderTree(),this.scenegraph.clearCells(),ft(e)&&ft(n)?(this.isRowHeader(e,n)?(this.setMinMaxLimitWidth(!0),this.internalProps._widthResizedColMap.clear()):this.isCornerHeader(e,n)?o.cornerSetting.titleOnDimension==="column"?(this.setMinMaxLimitWidth(!0),this.internalProps._widthResizedColMap.clear()):o.cornerSetting.titleOnDimension==="row"&&this.internalProps._heightResizedRowMap.clear():this.isColumnHeader(e,n)&&this.internalProps._heightResizedRowMap.clear(),this.refreshRowColCount()):this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.createSceneGraph(!0),this.render()}_changePivotSortStateBySortRules(){var t,e,n,o;this.pivotSortState=[];const r=(e=(t=this.internalProps.dataConfig)===null||t===void 0?void 0:t.sortRules)!==null&&e!==void 0?e:[];for(let s=0;s<r.length;s++){const l=r[s],a=[];if(l.sortByIndicator&&l.sortField===(this.dataset.indicatorsAsCol?this.dataset.rows[this.dataset.rows.length-1]:this.dataset.columns[this.dataset.columns.length-1])){for(let d=0;d<l.query.length;d++)a.push({dimensionKey:this.dataset.indicatorsAsCol?this.dataset.columns[d]:this.dataset.rows[d],value:l.query[d]});a.push({indicatorKey:l.sortByIndicator,value:(o=(n=this.internalProps.layoutMap.getIndicatorInfo(l.sortByIndicator))===null||n===void 0?void 0:n.title)!==null&&o!==void 0?o:l.sortByIndicator})}else a.push({dimensionKey:l.sortField,isPivotCorner:!0,value:l.sortField});const h=l.sortType?l.sortType.toUpperCase():"ASC";this.pivotSortState.push({dimensions:a,order:gi[h]})}}_parseColumnWidthConfig(t){for(let e=0;e<(t==null?void 0:t.length);e++){const n=t[e],o=n.dimensions,r=n.width,s=this.getCellAddressByHeaderPaths(o);s&&!this.internalProps._widthResizedColMap.has(s.col)&&(this._setColWidth(s.col,r),this.internalProps._widthResizedColMap.add(s.col))}}updatePivotSortState(t){this.pivotSortState=t}sort(t,e,n){var o;let r;if(this.isCornerHeader(t,e)){const a=this.getHeaderDefine(t,e);r=[];const h={isPivotCorner:!0,dimensionKey:a.value,value:a.value};r.push(h)}else r=this.isColumnHeader(t,e)?this.getCellHeaderPaths(t,e).colHeaderPaths:this.getCellHeaderPaths(t,e).rowHeaderPaths;const s=r[r.length-1].indicatorKey,l=this.getHeaderDefine(t,e);if(l.sort){if(this.dataset.sortRules){const a={};for(let h=this.dataset.sortRules.length-1;h>=0;h--){const d=this.dataset.sortRules[h];l.dimensionKey&&d.sortField===l.dimensionKey?(a[d.sortField]=d,this.dataset.sortRules.splice(h,1)):s&&d.sortField===(this.dataset.indicatorsAsCol?this.dataset.rows[this.dataset.rows.length-1]:this.dataset.columns[this.dataset.columns.length-1])&&this.dataset.sortRules.splice(h,1)}s?this.dataset.sortRules.push({sortField:this.dataset.indicatorsAsCol?this.dataset.rows[this.dataset.rows.length-1]:this.dataset.columns[this.dataset.columns.length-1],sortType:gi[n],sortByIndicator:s,query:r.reduce((h,d)=>(d.dimensionKey&&h.push(d.value),h),[])}):this.dataset.sortRules.push(Object.assign((o=a[l.dimensionKey])!==null&&o!==void 0?o:{},{sortField:l.dimensionKey,sortType:gi[n]}))}else this.dataset.sortRules=s?[{sortField:this.dataset.indicatorsAsCol?this.dataset.rows[this.dataset.rows.length-1]:this.dataset.columns[this.dataset.columns.length-1],sortType:gi[n],sortByIndicator:s,query:r.reduce((a,h)=>(h.dimensionKey&&a.push(h.value),a),[])}]:[{sortField:l.dimensionKey,sortType:gi[n]}];this.updateSortRules(this.dataset.sortRules,t,e)}}getPivotSortState(t,e){if(!this.pivotSortState)return;const n=this.getCellRange(t,e);for(let o=0;o<this.pivotSortState.length;o++){const r=this.pivotSortState[o],s=r.dimensions,l=this.getCellAddressByHeaderPaths(s),a=r.order;if(l&&Yi(n,l.col,l.row))return a}}_moveHeaderPosition(t,e){const n=this.getCellRange(t.col,t.row),o=this.getCellRange(e.col,e.row),r=this.internalProps.layoutMap.moveHeaderPosition(t,e);if(r){if(r.moveType==="column"){if(this.internalProps.recordsIsTwoDimensionalArray)for(let s=0;s<this.internalProps.records.length;s++){const l=this.internalProps.records[s].splice(r.sourceIndex-this.rowHeaderLevelCount,r.sourceSize);l.unshift(r.targetIndex-this.rowHeaderLevelCount,0),Array.prototype.splice.apply(this.internalProps.records[s],l)}this.colWidthsMap.exchangeOrder(n.start.col,n.end.col-n.start.col+1,o.start.col,o.end.col-o.start.col+1,r.targetIndex),this.setMinMaxLimitWidth()}else if(r.moveType==="row"){if(this.internalProps.recordsIsTwoDimensionalArray){const s=this.internalProps.records.splice(r.sourceIndex-this.columnHeaderLevelCount,r.sourceSize);s.unshift(r.targetIndex-this.columnHeaderLevelCount,0),Array.prototype.splice.apply(this.internalProps.records,s)}r.targetIndex>r.sourceIndex?this.rowHeightsMap.exchangeOrder(r.sourceIndex,r.sourceSize,r.targetIndex+r.sourceSize-r.targetSize,r.targetSize,r.targetIndex):this.rowHeightsMap.exchangeOrder(r.sourceIndex,r.sourceSize,r.targetIndex,r.targetSize,r.targetIndex)}return r}return null}toggleHierarchyState(t,e,n=!0){const o=this.getHierarchyState(t,e);if(o===Vt.expand)this._refreshHierarchyState(t,e,n),this.fireListeners(rr.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:Vt.collapse});else if(o===Vt.collapse){const r=this.internalProps.layoutMap.getHeadNode(t,e);Array.isArray(r.children)&&this._refreshHierarchyState(t,e,n),this.fireListeners(rr.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:Vt.expand,originData:r})}}_refreshHierarchyState(t,e,n=!0,o){let r=!1,s=!1;this.stateManager.updateHoverIcon(t,e,void 0,void 0);const l=this.internalProps.layoutMap.checkHasChart();l&&(this.autoFillWidth&&(r=this.getAllColsWidth()<=this.tableNoFrameWidth),this.autoFillHeight&&(s=this.getAllRowsHeight()<=this.tableNoFrameHeight));const a=this.internalProps.layoutMap.toggleHierarchyState(t,e);o&&o(),this.refreshRowColCount(),this.clearCellStyleCache(),this.scenegraph.updateHierarchyIcon(t,e),this.scenegraph.updateRow(a.removeCellPositions,a.addCellPositions,a.updateCellPositions,n),l&&(this.autoFillWidth&&!r&&(r=this.getAllColsWidth()<=this.tableNoFrameWidth),this.autoFillHeight&&!s&&(s=this.getAllRowsHeight()<=this.tableNoFrameHeight),(this.widthMode==="adaptive"||r||this.heightMode==="adaptive"||s)&&this.scenegraph.updateChartSizeForResizeColWidth(-1))}getHeaderCellAddressByPath(t){return this.internalProps.layoutMap.getPivotCellAdress(t)}getCellAddressByHeaderPaths(t){return this.internalProps.layoutMap.getCellAdressByHeaderPath(t)}getHeaderPathByXY(t){let e;return e=t?this.getCellAt(t.x+this.getFrozenColsWidth()+this.scrollLeft+1,t.y+this.getFrozenRowsHeight()+this.scrollTop+1):this.getCellAt(this.getFrozenColsWidth()+this.scrollLeft+1,this.getFrozenRowsHeight()+this.scrollTop+1),this.internalProps.layoutMap.getCellHeaderPaths(e.col,e.row)}getHierarchyState(t,e){var n;return(n=this._getHeaderLayoutMap(t,e))===null||n===void 0?void 0:n.hierarchyState}getLayoutColumnTree(){return this.internalProps.layoutMap.getLayoutColumnTree()}getLayoutColumnTreeCount(){return this.internalProps.layoutMap.getLayoutColumnTreeCount()}getLayoutRowTree(){return this.internalProps.layoutMap.getLayoutRowTree()}getLayoutRowTreeCount(){return this.internalProps.layoutMap.getLayoutRowTreeCount()}getCellHeaderTreeNodes(t,e){return this.internalProps.layoutMap.getCellHeaderPathsWithTreeNode(t,e)}_hasHierarchyTreeHeader(){return this.internalProps.layoutMap.rowHierarchyType==="tree"}getMenuInfo(t,e,n){const o=this.internalProps.layoutMap.getPivotDimensionInfo(t,e);return{dimensionKey:o[o.length-1].dimensionKey,value:this.getCellValue(t,e),cellLocation:this.getCellLocation(t,e),isPivotCorner:this.isCornerHeader(t,e),event:void 0}}setRecords(t){var e,n,o,r,s;const l={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.options.records=this.internalProps.records=t,this.internalProps.recordsIsTwoDimensionalArray=!1,((e=t==null?void 0:t[0])===null||e===void 0?void 0:e.constructor)===Array&&(this.internalProps.recordsIsTwoDimensionalArray=!0);const a=this.options,h=this.internalProps;if(((n=this.options.customConfig)===null||n===void 0?void 0:n.enableDataAnalysis)===!1)this.internalProps.recordsIsTwoDimensionalArray===!1&&(this.flatDataToObjects=new pv({rows:h.layoutMap.fullRowDimensionKeys,columns:h.layoutMap.colDimensionKeys,indicators:h.layoutMap.indicatorKeys,indicatorsAsCol:h.layoutMap.indicatorsAsCol,indicatorDimensionKey:h.layoutMap.indicatorDimensionKey},t));else{let d,u;this.dataset.setRecords(t),d=a.columnTree?h.layoutMap.columnDimensionTree:new Pe((o=this.dataset.colHeaderTree)!==null&&o!==void 0?o:[],this.layoutNodeId),u=a.rowTree?h.layoutMap.rowDimensionTree:new Pe((r=this.dataset.rowHeaderTree)!==null&&r!==void 0?r:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(s=this.options.rowExpandLevel)!==null&&s!==void 0?s:1:void 0),h.layoutMap=new lr(this,this.dataset,d,u),this.pivotSortState=[],a.pivotSortState&&(this.pivotSortState=a.pivotSortState)}if(this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(l.col,l.row),this.internalProps.title&&!this.internalProps.title.isReleased&&(this._updateSize(),this.internalProps.title.resize(),this.scenegraph.resize()),this.eventManager.updateEventBinder(),this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const d=Bt.getComponent("emptyTip");this.internalProps.emptyTip=new d(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}}startEditCell(t,e,n){var o;if(z(t)&&z(e))this.eventManager.isDraging=!1,this.selectCell(t,e),this.editorManager.startEditCell(t,e,n);else if(!((o=this.stateManager.select)===null||o===void 0)&&o.cellPos){const{col:r,row:s}=this.stateManager.select.cellPos;z(r)&&z(s)&&this.editorManager.startEditCell(r,s,n)}}completeEditCell(){this.editorManager.completeEdit()}getEditor(t,e){var n,o,r;let s;if(this.isCornerHeader(t,e)){const l=this.getHeaderDefine(t,e);s=(n=l==null?void 0:l.headerEditor)!==null&&n!==void 0?n:this.options.headerEditor}else if(this.isHeader(t,e)){const l=this.getHeaderDefine(t,e);s=(o=l==null?void 0:l.headerEditor)!==null&&o!==void 0?o:this.options.headerEditor}else{const l=this.getBodyColumnDefine(t,e);s=(r=l==null?void 0:l.editor)!==null&&r!==void 0?r:this.options.editor}return typeof s=="function"&&(s=s({col:t,row:e,dataValue:this.getCellOriginValue(t,e),value:this.getCellValue(t,e)||"",table:this})),typeof s=="string"?oT(s):s}isHasEditorDefine(t,e){var n;const o=this.getBodyColumnDefine(t,e);let r=(n=o==null?void 0:o.editor)!==null&&n!==void 0?n:this.options.editor;return typeof r=="function"&&(r=r({col:t,row:e,dataValue:this.getCellOriginValue(t,e),value:this.getCellValue(t,e)||"",table:this})),z(r)}changeCellValue(t,e,n,o=!1){if(o&&this.isHasEditorDefine(t,e)||o===!1){let r=n;const s=this.getCellOriginValue(t,e),l=this.getCellRawValue(t,e);typeof l=="number"&&lm(n)&&(r=parseFloat(n)),this._changeCellValueToDataSet(t,e,s,r);const a=this.getCellRange(t,e);for(let h=a.start.col;h<=a.end.col;h++)for(let d=a.start.row;d<=a.end.row;d++)this.scenegraph.updateCellContent(h,d);if(this.widthMode==="adaptive"||this.autoFillWidth&&this.getAllColsWidth()<=this.tableNoFrameWidth)this.internalProps._widthResizedColMap.size===0&&this.scenegraph.recalculateColWidths();else if(!this.internalProps._widthResizedColMap.has(t)){const h=this.getColWidth(t),d=Fr(t,0,this.rowCount-1,this,!1);d!==h&&this.scenegraph.updateColWidth(t,d-h)}if(this.heightMode==="adaptive"||this.autoFillHeight&&this.getAllRowsHeight()<=this.tableNoFrameHeight)this.internalProps._heightResizedRowMap.size===0&&this.scenegraph.recalculateRowHeights();else if(this.heightMode==="autoHeight"&&!this.internalProps._heightResizedRowMap.has(e)){const h=this.getRowHeight(e),d=nn(e,0,this.colCount-1,this);this.scenegraph.updateRowHeight(e,d-h)}this.fireListeners(at.CHANGE_CELL_VALUE,{col:t,row:e,rawValue:l,currentValue:s,changedValue:r}),this.scenegraph.updateNextFrame()}}changeCellValues(t,e,n,o=!1){let r=t,s=e;const l=[],a=[];for(let u=0;u<n.length&&!(e+u>this.rowCount-1);u++){const c=n[u],g=[],f=[];l.push(g),a.push(f);for(let p=0;p<c.length&&!(t+p>this.colCount-1);p++){const m=this.getCellRawValue(t+p,e+u);g.push(m);const b=this.getCellOriginValue(t+p,e+u);f.push(b)}}for(let u=0;u<n.length&&!(e+u>this.rowCount-1);u++){s=e+u;const c=n[u];let g=t;for(let f=0;f<c.length&&!(t+f>this.colCount-1);f++)if(g=t+f,o&&this.isHasEditorDefine(t+f,e+u)||o===!1){const p=c[f];let m=p;const b=a[u][f],C=l[u][f];typeof C=="number"&&lm(p)&&(m=parseFloat(p)),this._changeCellValueToDataSet(t+f,e+u,b,m),this.fireListeners(at.CHANGE_CELL_VALUE,{col:t+f,row:e+u,rawValue:C,currentValue:b,changedValue:this.getCellOriginValue(t+f,e+u)})}r=Math.max(r,g)}const h=this.getCellRange(t,e),d=this.getCellRange(r,s);for(let u=h.start.col;u<=d.end.col;u++)for(let c=h.start.row;c<=d.end.row;c++)this.scenegraph.updateCellContent(u,c);if(this.widthMode==="adaptive"||this.autoFillWidth&&this.getAllColsWidth()<=this.tableNoFrameWidth)this.internalProps._widthResizedColMap.size===0&&this.scenegraph.recalculateColWidths();else for(let u=t;u<=d.end.col;u++)if(!this.internalProps._widthResizedColMap.has(u)){const c=this.getColWidth(u),g=Fr(u,0,this.rowCount-1,this,!1);g!==c&&this.scenegraph.updateColWidth(u,g-c)}if(this.heightMode==="adaptive"||this.autoFillHeight&&this.getAllRowsHeight()<=this.tableNoFrameHeight)this.scenegraph.recalculateRowHeights();else if(this.heightMode==="autoHeight"){const u=[],c=[];for(let g=e;g<=d.end.row;g++)if(this.rowHeightsMap.get(g)){const f=this.getRowHeight(g),p=nn(g,0,this.colCount-1,this);u.push(g),c.push(p-f)}this.scenegraph.updateRowsHeight(u,c)}this.scenegraph.updateNextFrame()}_changeCellValueToDataSet(t,e,n,o){var r,s,l,a,h,d,u,c;if(this.internalProps.recordsIsTwoDimensionalArray){const g=this.getBodyIndexByRow(e),f=this.getBodyIndexByCol(t);this.records[g][f]=o}else if(this.dataset){const g=this.internalProps.layoutMap.getCellHeaderPaths(t,e);if(this.isCornerHeader(t,e))this.internalProps.layoutMap.changeCornerTitle(t,e,o);else if(this.isHeader(t,e))this.internalProps.layoutMap.changeTreeNodeTitle(t,e,o),!this.isCornerHeader(t,e)&&this.dataset.changeRecordFieldValue(!((r=g.colHeaderPaths)===null||r===void 0)&&r.length?(s=g.colHeaderPaths[g.colHeaderPaths.length-1].indicatorKey)!==null&&s!==void 0?s:g.colHeaderPaths[g.colHeaderPaths.length-1].dimensionKey:(l=g.rowHeaderPaths[g.rowHeaderPaths.length-1].indicatorKey)!==null&&l!==void 0?l:g.rowHeaderPaths[g.rowHeaderPaths.length-1].dimensionKey,n,o);else{const f=(a=g.colHeaderPaths)===null||a===void 0?void 0:a.filter(m=>!m.virtual).map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value}),p=(h=g.rowHeaderPaths)===null||h===void 0?void 0:h.filter(m=>!m.virtual).map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value});this.dataset.changeTreeNodeValue(this.internalProps.layoutMap.indicatorsAsCol?p:p.slice(0,-1),this.internalProps.layoutMap.indicatorsAsCol?f.slice(0,-1):f,this.internalProps.layoutMap.getIndicatorKey(t,e),o)}}else if(this.flatDataToObjects){const g=this.internalProps.layoutMap.getCellHeaderPaths(t,e);if(this.isHeader(t,e))this.internalProps.layoutMap.changeTreeNodeTitle(t,e,o),!this.isCornerHeader(t,e)&&this.flatDataToObjects.changeRecordFieldValue(!((d=g.colHeaderPaths)===null||d===void 0)&&d.length?(u=g.colHeaderPaths[g.colHeaderPaths.length-1].indicatorKey)!==null&&u!==void 0?u:g.colHeaderPaths[g.colHeaderPaths.length-1].dimensionKey:(c=g.rowHeaderPaths[g.rowHeaderPaths.length-1].indicatorKey)!==null&&c!==void 0?c:g.rowHeaderPaths[g.rowHeaderPaths.length-1].dimensionKey,n,o);else{const f=g.colHeaderPaths.map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value}),p=g.rowHeaderPaths.map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value});this.flatDataToObjects.changeTreeNodeValue(p,f,this.internalProps.layoutMap.getBody(t,e).indicatorKey,o)}}}_hasCustomRenderOrLayout(){if(this.options.customRender)return!0;const{columnsDefine:t,rowsDefine:e,indicatorsDefine:n}=this.internalProps.layoutMap;for(let o=0;o<t.length;o++){const r=t[o];if(typeof r!="string"&&(r.headerCustomLayout||r.headerCustomRender))return!0}for(let o=0;o<e.length;o++){const r=e[o];if(typeof r!="string"&&(r.headerCustomLayout||r.headerCustomRender))return!0}for(let o=0;o<n.length;o++){const r=n[o];if(typeof r!="string"&&(r.customLayout||r.headerCustomLayout||r.customRender||r.headerCustomRender))return!0}return!1}changeRecordOrder(t,e){}setTreeNodeChildren(t,e,n,o){this.flatDataToObjects?(this.internalProps.layoutMap.getHeadNode(n,o).children=t,this._refreshHierarchyState(n,o,!0,()=>{this.flatDataToObjects.changeDataConfig({rows:this.internalProps.layoutMap.fullRowDimensionKeys,columns:this.internalProps.layoutMap.colDimensionKeys,indicators:this.internalProps.layoutMap.indicatorKeys,indicatorsAsCol:this.internalProps.layoutMap.indicatorsAsCol,indicatorDimensionKey:this.internalProps.layoutMap.indicatorDimensionKey}),this.flatDataToObjects.addRecords(e)})):(this.internalProps.layoutMap.getHeadNode(n,o).children=t,this._refreshHierarchyState(n,o,!0,()=>{this.dataset._rowTreeHasChanged(),this.dataset.changeDataConfig({rows:this.internalProps.layoutMap.fullRowDimensionKeys,columns:this.internalProps.layoutMap.colDimensionKeys}),this.dataset.addRecords(e)}))}updateFilterRules(t){this.internalProps.dataConfig.filterRules=t,this.dataset.updateFilterRules(t),this.renderWithRecreateCells()}getFilteredRecords(){var t;return(t=this.dataset)===null||t===void 0?void 0:t.filterRules}};Mg(),Bg(),Pg(),Hg(),Eg(),Lg(),kg(),Fg(),Ig(),Dg(),Og(),zg(),Il(),Wg();class BT extends MT{}Il();class W9 extends MT{}Mg(),Bg(),Pg(),Hg(),Eg(),Lg(),kg(),Fg(),Ig(),Dg(),Og(),zg(),Il(),Wg();let N9=class extends Cg{constructor(t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w;let y,S;oe.mode==="node"?(e=t,t=null):t instanceof HTMLElement||(e=t,t=t.container?t.container:null),super(t,e),this.layoutNodeId={seqId:0},this._selectedDataItemsInChart=[],this._selectedDimensionInChart=[],this._chartEventMap={},e.layout&&Object.assign(e,e.layout),this.internalProps.columns=Ee(e.columns),this.internalProps.rows=Ee(e.rows),this.internalProps.indicators=ho(e.indicators),this.internalProps.columnTree=!e.indicatorsAsCol||!((n=e.columns)===null||n===void 0)&&n.length||e.columnTree?Ee(e.columnTree):[],this.internalProps.rowTree=e.indicatorsAsCol||!((o=e.rows)===null||o===void 0)&&o.length||e.rowTree?Ee(e.rowTree):[],this.internalProps.records=e.records,this.setCustomStateNameToSpec(),this.internalProps.columnResizeType=(r=e.columnResizeType)!==null&&r!==void 0?r:"column",this.internalProps.rowResizeType=(s=e.rowResizeType)!==null&&s!==void 0?s:"row",this.internalProps.dataConfig={isPivotChart:!0},this._axes=lt(e.axes)?e.axes:[],e.columnTree&&(e.indicatorsAsCol!==!1&&(this.internalProps.columnTree=Vi(this.internalProps.columnTree,e.indicators)),y=new Pe((l=this.internalProps.columnTree)!==null&&l!==void 0?l:[],this.layoutNodeId)),e.rowTree&&(e.indicatorsAsCol===!1&&(this.internalProps.rowTree=Vi(this.internalProps.rowTree,e.indicators)),S=new Pe((a=this.internalProps.rowTree)!==null&&a!==void 0?a:[],this.layoutNodeId));const A=!((h=S==null?void 0:S.dimensionKeys)===null||h===void 0)&&h.count?S.dimensionKeys.valueArr():(u=(d=e.rows)===null||d===void 0?void 0:d.reduce((T,M)=>(typeof M=="string"?T.push(M):T.push(M.dimensionKey),T),[]))!==null&&u!==void 0?u:[],R=!((c=y==null?void 0:y.dimensionKeys)===null||c===void 0)&&c.count?y.dimensionKeys.valueArr():(f=(g=e.columns)===null||g===void 0?void 0:g.reduce((T,M)=>(typeof M=="string"?T.push(M):T.push(M.dimensionKey),T),[]))!==null&&f!==void 0?f:[],x=(m=(p=e.indicators)===null||p===void 0?void 0:p.reduce((T,M)=>(typeof M=="string"?T.push(M):T.push(M.indicatorKey),T),[]))!==null&&m!==void 0?m:[];if(this.internalProps.dataConfig.collectValuesBy=this._generateCollectValuesConfig(R,A),this.internalProps.dataConfig.aggregationRules=this._generateAggregationRules(),this.internalProps.dataConfig.dimensionSortArray=this._getDimensionSortArray(),this.dataset=new Ih(this.internalProps.dataConfig,A,R,x,this.internalProps.indicators,(b=e.indicatorsAsCol)===null||b===void 0||b,e.records,void 0,this.internalProps.columnTree,this.internalProps.rowTree,!0),this.options.indicatorsAsCol&&Lh(this.internalProps.indicators)){const T=M=>{M.forEach(B=>{var P;!((P=B.children)===null||P===void 0)&&P.length?T(B.children):B.children=[{dimensionKey:"axis",value:""}]})};!((C=this.dataset.rowHeaderTree)===null||C===void 0)&&C.length?T(this.dataset.rowHeaderTree):this.dataset.rowHeaderTree=[{dimensionKey:"axis",value:""}]}if(e.columnTree||e.indicatorsAsCol!==!1&&(this.dataset.colHeaderTree=Vi(this.dataset.colHeaderTree,e.indicators)),e.rowTree||e.indicatorsAsCol===!1&&(this.dataset.rowHeaderTree=Vi(this.dataset.rowHeaderTree,e.indicators)),y=new Pe((_=this.dataset.colHeaderTree)!==null&&_!==void 0?_:[],this.layoutNodeId),S=new Pe((w=this.dataset.rowHeaderTree)!==null&&w!==void 0?w:[],this.layoutNodeId),this.internalProps.layoutMap=new lr(this,this.dataset,y,S),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.createSceneGraph(),e.title){const T=Bt.getComponent("title");this.internalProps.title=new T(e.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const T=Bt.getComponent("emptyTip");this.internalProps.emptyTip=new T(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}setTimeout(()=>{this.fireListeners(at.INITIALIZED,null)},0)}static get EVENT_TYPE(){return SA}get pivotChartAxes(){return this._axes}get recordsCount(){var t;return(t=this.records)===null||t===void 0?void 0:t.length}isListTable(){return!1}isPivotTable(){return!0}isPivotChart(){return!0}_canResizeColumn(t,e){const n=super._canResizeColumn(t,e);if(n&&!this.internalProps.layoutMap.indicatorsAsCol){const o=this.internalProps.layoutMap.getBody(t,this.columnHeaderLevelCount);if(o!=null&&o.disableColumnResize)return!1}return n}updateOption(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y;const S=this.internalProps;let A,R;super.updateOption(t),this.layoutNodeId={seqId:0},this.internalProps.columns=Ee(t.columns),this.internalProps.rows=Ee(t.rows),this.internalProps.indicators=!((e=t.indicators)===null||e===void 0)&&e.length?ho(t.indicators):[],this.internalProps.columnTree=!t.indicatorsAsCol||!((n=t.columns)===null||n===void 0)&&n.length||t.columnTree?Ee(t.columnTree):[],this.internalProps.rowTree=t.indicatorsAsCol||!((o=t.rows)===null||o===void 0)&&o.length||t.rowTree?Ee(t.rowTree):[],t.records&&(this.internalProps.records=t.records),this.setCustomStateNameToSpec(),this._selectedDataItemsInChart=[],S.columnResizeType=(r=t.columnResizeType)!==null&&r!==void 0?r:"column",S.rowResizeType=(s=t.rowResizeType)!==null&&s!==void 0?s:"row",S.dataConfig={isPivotChart:!0},this._axes=lt(t.axes)?t.axes:[],t.columnTree&&(t.indicatorsAsCol!==!1&&(this.internalProps.columnTree=Vi(this.internalProps.columnTree,t.indicators)),A=new Pe((l=this.internalProps.columnTree)!==null&&l!==void 0?l:[],this.layoutNodeId)),t.rowTree&&(t.indicatorsAsCol===!1&&(this.internalProps.rowTree=Vi(this.internalProps.rowTree,t.indicators)),R=new Pe((a=this.internalProps.rowTree)!==null&&a!==void 0?a:[],this.layoutNodeId));const x=!((h=R==null?void 0:R.dimensionKeys)===null||h===void 0)&&h.count?R.dimensionKeys.valueArr():(u=(d=t.rows)===null||d===void 0?void 0:d.reduce((B,P)=>(typeof P=="string"?B.push(P):B.push(P.dimensionKey),B),[]))!==null&&u!==void 0?u:[],T=!((c=A==null?void 0:A.dimensionKeys)===null||c===void 0)&&c.count?A.dimensionKeys.valueArr():(f=(g=t.columns)===null||g===void 0?void 0:g.reduce((B,P)=>(typeof P=="string"?B.push(P):B.push(P.dimensionKey),B),[]))!==null&&f!==void 0?f:[],M=(m=(p=t.indicators)===null||p===void 0?void 0:p.reduce((B,P)=>(typeof P=="string"?B.push(P):B.push(P.indicatorKey),B),[]))!==null&&m!==void 0?m:[];if(this.internalProps.dataConfig.collectValuesBy=this._generateCollectValuesConfig(T,x),this.internalProps.dataConfig.aggregationRules=this._generateAggregationRules(),this.internalProps.dataConfig.dimensionSortArray=this._getDimensionSortArray(),this.dataset=new Ih(this.internalProps.dataConfig,x,T,M,this.internalProps.indicators,(b=t.indicatorsAsCol)===null||b===void 0||b,(C=t.records)!==null&&C!==void 0?C:this.internalProps.records,void 0,this.internalProps.columnTree,this.internalProps.rowTree,!0),this.options.indicatorsAsCol&&Lh(this.internalProps.indicators)){const B=P=>{P.forEach(F=>{var H;!((H=F.children)===null||H===void 0)&&H.length?B(F.children):F.children=[{dimensionKey:"axis",value:""}]})};!((_=this.dataset.rowHeaderTree)===null||_===void 0)&&_.length?B(this.dataset.rowHeaderTree):this.dataset.rowHeaderTree=[{dimensionKey:"axis",value:""}]}if(t.columnTree||t.indicatorsAsCol!==!1&&(this.dataset.colHeaderTree=Vi(this.dataset.colHeaderTree,t.indicators)),t.rowTree||t.indicatorsAsCol===!1&&(this.dataset.rowHeaderTree=Vi(this.dataset.rowHeaderTree,t.indicators)),A=new Pe((w=this.dataset.colHeaderTree)!==null&&w!==void 0?w:[],this.layoutNodeId),R=new Pe((y=this.dataset.rowHeaderTree)!==null&&y!==void 0?y:[],this.layoutNodeId),S.layoutMap=new lr(this,this.dataset,A,R),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,S.releaseList&&(S.releaseList.forEach(B=>{var P;return(P=B==null?void 0:B.release)===null||P===void 0?void 0:P.call(B)}),S.releaseList=null),this.scenegraph.clearCells(),this.scenegraph.createSceneGraph(),t.title){const B=Bt.getComponent("title");this.internalProps.title=new B(t.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const B=Bt.getComponent("emptyTip");this.internalProps.emptyTip=new B(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}return new Promise(B=>{setTimeout(B,0)})}updatePagination(){}refreshHeader(){this.setMinMaxLimitWidth(!0),this.refreshRowColCount()}refreshRowColCount(){var t,e,n,o,r,s,l,a;const h=this,{layoutMap:d}=h.internalProps;d&&(h.colCount=(t=d.colCount)!==null&&t!==void 0?t:0,h.rowCount=(e=d.rowCount)!==null&&e!==void 0?e:0,h.internalProps.frozenColCount=(n=d.rowHeaderLevelCount)!==null&&n!==void 0?n:0,h.frozenRowCount=Math.max(d.headerLevelCount,(o=this.options.frozenRowCount)!==null&&o!==void 0?o:0),h.bottomFrozenRowCount!==((r=d==null?void 0:d.bottomFrozenRowCount)!==null&&r!==void 0?r:0)&&(h.bottomFrozenRowCount=(s=d==null?void 0:d.bottomFrozenRowCount)!==null&&s!==void 0?s:0),h.rightFrozenColCount!==((l=d==null?void 0:d.rightFrozenColCount)!==null&&l!==void 0?l:0)&&(h.rightFrozenColCount=(a=d==null?void 0:d.rightFrozenColCount)!==null&&a!==void 0?a:0),this.stateManager.setFrozenCol(this.internalProps.frozenColCount))}_getSortFuncFromHeaderOption(t,e,n){}syncHierarchyState(t,e){var n,o;t.value===e.value&&t.dimensionKey===e.dimensionKey&&(e.hierarchyState=(n=e.hierarchyState)!==null&&n!==void 0?n:e!=null&&e.children?t.hierarchyState:void 0,(o=e==null?void 0:e.children)===null||o===void 0||o.forEach((r,s)=>{var l;!((l=t==null?void 0:t.children)===null||l===void 0)&&l[s]&&r&&this.syncHierarchyState(t.children[s],r)}))}getRecordShowIndexByCell(t,e){}getTableIndexByRecordIndex(t){}getTableIndexByField(t){}getCellAddrByFieldRecord(t,e){}getBodyIndexByRow(t){const{layoutMap:e}=this.internalProps;return e.getBodyIndexByRow(t)}getBodyIndexByCol(t){const{layoutMap:e}=this.internalProps;return e.getBodyIndexByCol(t)}getCellValue(t,e,n){var o,r,s;if(!n){const u=this.getCustomMergeValue(t,e);if(u)return u}if(this.internalProps.layoutMap.isHeader(t,e)){if(this.internalProps.layoutMap.isBottomFrozenRow(t,e)||this.internalProps.layoutMap.isRightFrozenColumn(t,e)){const g=this.internalProps.layoutMap.getIndicatorKeyInChartSpec(t,e);let f;return g==null||g.forEach(p=>{const m=this.internalProps.layoutMap.getIndicatorInfo(p);m&&(f=m)}),(r=(o=f==null?void 0:f.title)!==null&&o!==void 0?o:f==null?void 0:f.indicatorKey)!==null&&r!==void 0?r:""}const{title:u,fieldFormat:c}=this.internalProps.layoutMap.getHeader(t,e);return typeof c=="function"?c(u,t,e,this):u}if(this.dataset){let u;const c=this.internalProps.layoutMap.getCellHeaderPaths(t,e),g=c.colHeaderPaths.map((m,b)=>{var C;return m.indicatorKey&&(u={position:"col",index:b}),(C=m.indicatorKey)!==null&&C!==void 0?C:m.value}),f=c.rowHeaderPaths.map((m,b)=>{var C;return m.indicatorKey&&(u={position:"row",index:b}),(C=m.indicatorKey)!==null&&C!==void 0?C:m.value}),p=this.dataset.getAggregator(f,g,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,u);return p.value?p.value():void 0}const{fieldFormat:l}=this.internalProps.layoutMap.getBody(t,e),a=this.getBodyIndexByRow(e),h=this.getBodyIndexByCol(t),d=(s=this.records[a])===null||s===void 0?void 0:s[h];return typeof l=="function"?l(d,t,e,this):d}getCellOriginValue(t,e){var n,o,r;const s=this;if(s.internalProps.layoutMap.isHeader(t,e)){if(this.internalProps.layoutMap.isBottomFrozenRow(t,e)||this.internalProps.layoutMap.isRightFrozenColumn(t,e)){const d=this.internalProps.layoutMap.getIndicatorKeyInChartSpec(t,e);let u;return d==null||d.forEach(c=>{const g=this.internalProps.layoutMap.getIndicatorInfo(c);g&&(u=g)}),(o=(n=u==null?void 0:u.title)!==null&&n!==void 0?n:u==null?void 0:u.indicatorKey)!==null&&o!==void 0?o:""}const{title:h}=s.internalProps.layoutMap.getHeader(t,e);return typeof h=="function"?h():h}if(this.dataset){let h;const d=this.internalProps.layoutMap.getCellHeaderPaths(t,e),u=d.colHeaderPaths.map((f,p)=>{var m;return f.indicatorKey&&(h={position:"col",index:p}),(m=f.indicatorKey)!==null&&m!==void 0?m:f.value}),c=d.rowHeaderPaths.map((f,p)=>{var m;return f.indicatorKey&&(h={position:"row",index:p}),(m=f.indicatorKey)!==null&&m!==void 0?m:f.value}),g=this.dataset.getAggregator(c,u,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,h);return g.value?g.value():void 0}const l=this.getBodyIndexByRow(e),a=this.getBodyIndexByCol(t);return(r=this.records[l])===null||r===void 0?void 0:r[a]}getCellRawValue(t,e){return this.getCellOriginValue(t,e)}getCellOriginRecord(t,e){if(!this.internalProps.layoutMap.isHeader(t,e)&&this.dataset){let n;const o=this.internalProps.layoutMap.getCellHeaderPaths(t,e),r=o.colHeaderPaths.map((l,a)=>{var h;return l.indicatorKey&&(n={position:"col",index:a}),(h=l.indicatorKey)!==null&&h!==void 0?h:l.value}),s=o.rowHeaderPaths.map((l,a)=>{var h;return l.indicatorKey&&(n={position:"row",index:a}),(h=l.indicatorKey)!==null&&h!==void 0?h:l.value});return this.dataset.getAggregator(s,r,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,n).records}}getCellRawRecord(t,e){return this.getCellOriginRecord(t,e)}getPivotSortState(t,e){if(!this.pivotSortState)return;const n=this.getCellRange(t,e);for(let o=0;o<this.pivotSortState.length;o++){const{col:r,row:s,order:l}=this.pivotSortState[o];if(Yi(n,r,s))return l}}_moveHeaderPosition(t,e){var n,o,r,s;const l=this.internalProps.layoutMap.moveHeaderPosition(t,e);if(l){if(l.moveType==="column"){if(((o=(n=this.options.records)===null||n===void 0?void 0:n[0])===null||o===void 0?void 0:o.constructor)===Array)for(let a=0;a<this.internalProps.records.length;a++){const h=this.internalProps.records[a].splice(l.sourceIndex-this.rowHeaderLevelCount,l.sourceSize);h.unshift(l.targetIndex-this.rowHeaderLevelCount,0),Array.prototype.splice.apply(this.internalProps.records[a],h)}this.colWidthsMap.adjustOrder(l.sourceIndex,l.targetIndex,l.sourceSize),this.setMinMaxLimitWidth()}else if(l.moveType==="row"){if(((s=(r=this.options.records)===null||r===void 0?void 0:r[0])===null||s===void 0?void 0:s.constructor)===Array){const a=this.internalProps.records.splice(l.sourceIndex-this.columnHeaderLevelCount,l.sourceSize);a.unshift(l.targetIndex-this.columnHeaderLevelCount,0),Array.prototype.splice.apply(this.internalProps.records,a)}this.rowHeightsMap.adjustOrder(l.sourceIndex,l.targetIndex,l.sourceSize)}return l}return null}toggleHierarchyState(t,e,n=!0){}getHeaderCellAddressByPath(t){return this.internalProps.layoutMap.getPivotCellAdress(t)}getCellAddressByHeaderPaths(t){return this.internalProps.layoutMap.getCellAdressByHeaderPath(t)}getHeaderPathByXY(t){let e;return e=t?this.getCellAt(t.x+this.getFrozenColsWidth()+this.scrollLeft+1,t.y+this.getFrozenRowsHeight()+this.scrollTop+1):this.getCellAt(this.getFrozenColsWidth()+this.scrollLeft+1,this.getFrozenRowsHeight()+this.scrollTop+1),this.internalProps.layoutMap.getCellHeaderPaths(e.col,e.row)}getHierarchyState(t,e){var n;return(n=this._getHeaderLayoutMap(t,e))===null||n===void 0?void 0:n.hierarchyState}_hasHierarchyTreeHeader(){return this.internalProps.layoutMap.rowHierarchyType==="tree"}getMenuInfo(t,e,n){const o=this.internalProps.layoutMap.getPivotDimensionInfo(t,e);return{dimensionKey:o[o.length-1].dimensionKey,value:this.getCellValue(t,e),cellLocation:this.getCellLocation(t,e),isPivotCorner:this.isCornerHeader(t,e),event:void 0}}_generateCollectValuesConfig(t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_;t=t.filter(S=>S!==Xi),e=e.filter(S=>S!==Xi);const w=this.internalProps.indicators,y={};for(let S=0,A=w==null?void 0:w.length;S<A;S++)if(typeof w[S]!="string"&&w[S].chartSpec){if(((n=w[S].chartSpec)===null||n===void 0?void 0:n.type)==="pie"||((o=w[S].chartSpec)===null||o===void 0?void 0:o.type)==="rose"||((r=w[S].chartSpec)===null||r===void 0?void 0:r.type)==="radar"||((s=w[S].chartSpec)===null||s===void 0?void 0:s.type)==="gauge"||((l=w[S].chartSpec)===null||l===void 0?void 0:l.type)==="wordCloud")continue;const R=w[S],x=R.chartSpec;if(this.options.indicatorsAsCol===!1)if((x==null?void 0:x.stack)!==!1&&((x==null?void 0:x.type)==="bar"||(x==null?void 0:x.type)==="area")&&(x.stack=!0),y[R.indicatorKey]={by:e,range:!0,sumBy:(x==null?void 0:x.stack)&&t.concat(x==null?void 0:x.xField)},x.series)x.series.forEach(T=>{var M,B,P,F,H,E,k,I,L,D,O,N,W,$;const U=typeof T.xField=="string"?T.xField:T.xField[0];y[U]={by:t,type:T.direction!=="horizontal"?"xField":void 0,range:As(T,this._axes,T.direction==="horizontal",!0),sortBy:T.direction!=="horizontal"?(F=(P=(B=(M=T==null?void 0:T.data)===null||M===void 0?void 0:M.fields)===null||B===void 0?void 0:B[U])===null||P===void 0?void 0:P.domain)!==null&&F!==void 0?F:(k=(E=(H=x==null?void 0:x.data)===null||H===void 0?void 0:H.fields)===null||E===void 0?void 0:E[U])===null||k===void 0?void 0:k.domain:void 0};const Y=T.yField;T.stack!==!1&&(T.type==="bar"||T.type==="area")&&(T.stack=!0),y[Y]={by:e,range:As(T,this._axes,T.direction==="horizontal",!1),sumBy:T.stack&&t.concat(T==null?void 0:T.xField),sortBy:T.direction==="horizontal"?(O=(D=(L=(I=T==null?void 0:T.data)===null||I===void 0?void 0:I.fields)===null||L===void 0?void 0:L[Y])===null||D===void 0?void 0:D.domain)!==null&&O!==void 0?O:($=(W=(N=x==null?void 0:x.data)===null||N===void 0?void 0:N.fields)===null||W===void 0?void 0:W[Y])===null||$===void 0?void 0:$.domain:void 0,extendRange:Ac(x.markLine)}});else{const T=typeof x.xField=="string"?x.xField:x.xField[0];y[T]={by:t,type:x.direction!=="horizontal"?"xField":void 0,range:As(x,this._axes,x.direction==="horizontal",!0),sortBy:x.direction!=="horizontal"?(d=(h=(a=x==null?void 0:x.data)===null||a===void 0?void 0:a.fields)===null||h===void 0?void 0:h[T])===null||d===void 0?void 0:d.domain:void 0},(x==null?void 0:x.stack)!==!1&&((x==null?void 0:x.type)==="bar"||(x==null?void 0:x.type)==="area")&&(x.stack=!0);const M=x.yField;y[M]={by:e,range:x.direction!=="horizontal",sumBy:x.stack&&t.concat(x==null?void 0:x.xField),sortBy:x.direction==="horizontal"?(g=(c=(u=x==null?void 0:x.data)===null||u===void 0?void 0:u.fields)===null||c===void 0?void 0:c[M])===null||g===void 0?void 0:g.domain:void 0,extendRange:Ac(x.markLine)}}else{const T=w[S];if((x==null?void 0:x.stack)!==!1&&((x==null?void 0:x.type)==="bar"||(x==null?void 0:x.type)==="area")&&(x.stack=!0),y[T.indicatorKey]={by:t,range:!0,sumBy:(x==null?void 0:x.stack)&&e.concat(x==null?void 0:x.yField)},x.series)x.series.forEach(M=>{var B,P,F,H,E,k,I,L,D,O,N,W,$,U;const Y=typeof M.yField=="string"?M.yField:M.yField[0];y[Y]={by:e,type:M.direction==="horizontal"?"yField":void 0,range:As(M,this._axes,M.direction==="horizontal",!1),sortBy:M.direction==="horizontal"?(H=(F=(P=(B=M==null?void 0:M.data)===null||B===void 0?void 0:B.fields)===null||P===void 0?void 0:P[Y])===null||F===void 0?void 0:F.domain)!==null&&H!==void 0?H:(I=(k=(E=x==null?void 0:x.data)===null||E===void 0?void 0:E.fields)===null||k===void 0?void 0:k[Y])===null||I===void 0?void 0:I.domain:void 0};const j=M.xField;M.stack!==!1&&(M.type==="bar"||M.type==="area")&&(M.stack=!0),y[j]={by:t,range:As(M,this._axes,M.direction==="horizontal",!0),sumBy:M.stack&&e.concat(M==null?void 0:M.yField),sortBy:M.direction!=="horizontal"?(N=(O=(D=(L=M==null?void 0:M.data)===null||L===void 0?void 0:L.fields)===null||D===void 0?void 0:D[j])===null||O===void 0?void 0:O.domain)!==null&&N!==void 0?N:(U=($=(W=x==null?void 0:x.data)===null||W===void 0?void 0:W.fields)===null||$===void 0?void 0:$[j])===null||U===void 0?void 0:U.domain:void 0,extendRange:Ac(x.markLine)}});else{const M=typeof x.yField=="string"?x.yField:x.yField[0];y[M]={by:e,type:x.direction==="horizontal"?"yField":void 0,range:As(x,this._axes,x.direction==="horizontal",!1),sortBy:x.direction==="horizontal"?(m=(p=(f=x==null?void 0:x.data)===null||f===void 0?void 0:f.fields)===null||p===void 0?void 0:p[M])===null||m===void 0?void 0:m.domain:void 0},(x==null?void 0:x.stack)!==!1&&((x==null?void 0:x.type)==="bar"||(x==null?void 0:x.type)==="area")&&(x.stack=!0);const B=x.xField;y[B]={by:t,range:As(x,this._axes,x.direction==="horizontal",!0),sumBy:x.stack&&e.concat(x==null?void 0:x.yField),sortBy:x.direction!=="horizontal"?(_=(C=(b=x==null?void 0:x.data)===null||b===void 0?void 0:b.fields)===null||C===void 0?void 0:C[B])===null||_===void 0?void 0:_.domain:void 0,extendRange:Ac(x.markLine)}}}}return y}_generateAggregationRules(){var t;const e=[];return(t=this.internalProps.indicators)===null||t===void 0||t.forEach(n=>{var o,r;if(typeof n=="string")e.push({indicatorKey:n,field:n,aggregationType:zt.RECORD});else if(!((o=n.chartSpec)===null||o===void 0)&&o.series){const s=[];(r=n.chartSpec)===null||r===void 0||r.series.forEach(l=>{const a=this.options.indicatorsAsCol===!1?l.yField:l.xField;s.indexOf(a)===-1&&s.push(a)}),e.push({indicatorKey:n.indicatorKey,field:s,aggregationType:zt.RECORD})}else{const s=this.options.indicatorsAsCol===!1?n.chartSpec.yField:n.chartSpec.xField;e.push({indicatorKey:n.indicatorKey,field:s??n.indicatorKey,aggregationType:zt.RECORD})}}),e}setCustomStateNameToSpec(){var t;const e=n=>{var o,r,s,l,a,h,d,u,c,g;!((r=(o=n.bar)===null||o===void 0?void 0:o.state)===null||r===void 0)&&r.selected&&(n.bar.state.vtable_selected=n.bar.state.selected,n.bar.state.vtable_selected_reverse=n.bar.state.selected_reverse,delete n.bar.state.selected,delete n.bar.state.selected_reverse),!((l=(s=n.point)===null||s===void 0?void 0:s.state)===null||l===void 0)&&l.selected&&(n.point.state.vtable_selected=n.point.state.selected,n.point.state.vtable_selected_reverse=n.point.state.selected_reverse,delete n.point.state.selected,delete n.point.state.selected_reverse),!((h=(a=n.line)===null||a===void 0?void 0:a.state)===null||h===void 0)&&h.selected&&(n.line.state.vtable_selected=n.line.state.selected,n.line.state.vtable_selected_reverse=n.line.state.selected_reverse,delete n.line.state.selected,delete n.line.state.selected_reverse),!((u=(d=n.area)===null||d===void 0?void 0:d.state)===null||u===void 0)&&u.selected&&(n.area.state.vtable_selected=n.area.state.selected,n.area.state.vtable_selected_reverse=n.area.state.selected_reverse,delete n.area.state.selected,delete n.area.state.selected_reverse),!((g=(c=n.pie)===null||c===void 0?void 0:c.state)===null||g===void 0)&&g.selected&&(n.pie.state.vtable_selected=n.pie.state.selected,n.pie.state.vtable_selected_reverse=n.pie.state.selected_reverse,delete n.pie.state.selected,delete n.pie.state.selected_reverse)};(t=this.internalProps.indicators)===null||t===void 0||t.forEach(n=>{if(n.chartSpec){const o=n.chartSpec;o.series?o.series.forEach(r=>{e(r)}):e(o)}})}updateFilterRules(t){this.internalProps.dataConfig.filterRules=t,this.dataset.updateFilterRules(t),Th(this.scenegraph),PN(this.scenegraph),this.render()}clearChartCacheImage(t,e){ft(t)&&ft(e)?BN(t,e,this.scenegraph):Th(this.scenegraph)}getLegendSelected(){var t;const e=[];return(t=this.internalProps.legends)===null||t===void 0||t.forEach(n=>{const o=n.legendComponent._getSelectedLegends().map(r=>r.label);e.push(...o)}),e}setLegendSelected(t){var e;(e=this.internalProps.legends)===null||e===void 0||e.forEach(n=>{n.legendComponent.setSelected(t)})}getChartDatumPosition(t,e){const{chartInstance:n,bounds:o}=this.getChartInstance(e);if(n){const r=n.convertDatumToPosition(t);return r?{x:Math.round(r.x+o.x1),y:Math.round(r.y+o.y1)}:null}return null}getCellAddressByRecord(t){const e=[],n=[],o={},r=[];this.dataset.dataConfig.aggregationRules.forEach(s=>{if(typeof s.field=="string")o[s.field]=s.indicatorKey,r.push(s.field);else for(let l=0;l<s.field.length;l++)o[s.field[l]]=s.indicatorKey,r.push(s.field[l])});for(const s in t)this.dataset.rows.indexOf(s)>=0&&e.push({dimensionKey:s,value:t[s]}),this.dataset.columns.indexOf(s)>=0&&n.push({dimensionKey:s,value:t[s]}),r.indexOf(s)>=0&&(this.dataset.indicatorsAsCol?n.push({indicatorKey:o[s]}):e.push({indicatorKey:o[s]}));return this.getCellAddressByHeaderPaths({rowHeaderPaths:e,colHeaderPaths:n,cellLocation:"body"})}getChartInstance(t){var e,n,o,r,s;const l=this.getCellAddressByHeaderPaths(t);if(l){const a=this.getCellRelativeRect(l.col,l.row),h=this.scenegraph.getCell(l.col,l.row);let d;const u=(e=h==null?void 0:h.getChildren())===null||e===void 0?void 0:e[0];if(u.attribute.chartInstance){d=u.attribute.chartInstance;const{dataId:c,data:g,axes:f,spec:p}=u.attribute,m=u.getViewBox();if(f==null||f.forEach((b,C)=>{var _,w,y,S;b.type==="linear"?d.updateModelSpecSync({type:"axes",index:C},{min:(w=(_=b.range)===null||_===void 0?void 0:_.min)!==null&&w!==void 0?w:0,max:(S=(y=b.range)===null||y===void 0?void 0:y.max)!==null&&S!==void 0?S:0},!0):b.type==="band"&&d.updateModelSpec({type:"axes",index:C},{domain:b.domain.slice(0)},!0)}),d.updateViewBox({x1:m.x1-u.getRootNode().table.scrollLeft,x2:m.x2-u.getRootNode().table.scrollLeft,y1:m.y1-u.getRootNode().table.scrollTop,y2:m.y2-u.getRootNode().table.scrollTop},!1,!1),typeof c=="string")d.updateDataSync(c,g??[]);else{const b=[];for(const C in c){const _=c[C],w=p.series.find(y=>{var S;return((S=y==null?void 0:y.data)===null||S===void 0?void 0:S.id)===C});b.push({id:C,values:_?(n=g==null?void 0:g.filter(y=>y.hasOwnProperty(_)))!==null&&n!==void 0?n:[]:g??[],fields:(o=w==null?void 0:w.data)===null||o===void 0?void 0:o.fields}),d.updateFullDataSync||d.updateDataSync(C,_?(r=g==null?void 0:g.filter(y=>y.hasOwnProperty(_)))!==null&&r!==void 0?r:[]:g??[])}(s=d.updateFullDataSync)===null||s===void 0||s.call(d,b)}this.renderAsync()}return{chartInstance:d,bounds:a.bounds}}return{}}_getDimensionSortArray(){var t,e;if(!((e=(t=this.options)===null||t===void 0?void 0:t.axes)===null||e===void 0)&&e.length){const n=this.options.indicatorsAsCol?"left":"bottom",o=this.options.axes.find(r=>r.orient===n);if(o&&lt(o.domain))return o.domain}}setRecords(t){var e,n;const o={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.options.records=this.internalProps.records=t;const r=this.options,s=this.internalProps;let l,a;this.dataset.setRecords(t),l=r.columnTree?s.layoutMap.columnDimensionTree:new Pe((e=this.dataset.colHeaderTree)!==null&&e!==void 0?e:[],this.layoutNodeId),a=r.rowTree?s.layoutMap.rowDimensionTree:new Pe((n=this.dataset.rowHeaderTree)!==null&&n!==void 0?n:[],this.layoutNodeId),s.layoutMap=new lr(this,this.dataset,l,a),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(o.col,o.row),this.internalProps.title&&!this.internalProps.title.isReleased&&(this._updateSize(),this.internalProps.title.resize(),this.scenegraph.resize()),this.eventManager.updateEventBinder()}_hasCustomRenderOrLayout(){if(this.options.customRender)return!0;const{columnsDefine:t,rowsDefine:e,indicatorsDefine:n}=this.internalProps.layoutMap;for(let o=0;o<t.length;o++){const r=t[o];if(typeof r!="string"&&(r.headerCustomLayout||r.headerCustomRender))return!0}for(let o=0;o<e.length;o++){const r=e[o];if(typeof r!="string"&&(r.headerCustomLayout||r.headerCustomRender))return!0}for(let o=0;o<n.length;o++){const r=n[o];if(typeof r!="string"&&(r.customLayout||r.headerCustomLayout||r.customRender||r.headerCustomRender))return!0}return!1}changeRecordOrder(t,e){}getLayoutColumnTree(){return this.internalProps.layoutMap.getLayoutColumnTree()}getLayoutColumnTreeCount(){return this.internalProps.layoutMap.getLayoutColumnTreeCount()}getLayoutRowTree(){return this.internalProps.layoutMap.getLayoutRowTree()}getLayoutRowTreeCount(){return this.internalProps.layoutMap.getLayoutRowTreeCount()}getCellHeaderTreeNodes(t,e){return this.internalProps.layoutMap.getCellHeaderPathsWithTreeNode(t,e)}};class V9 extends qp{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=lt(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}}class PT extends cn{constructor(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p;t.direction&&(t.flexDirection=t.direction),!t.justifyContent||t.justifyContent!=="start"&&t.justifyContent!=="end"||(t.justifyContent="flex-"+t.justifyContent),!t.alignItems||t.alignItems!=="start"&&t.alignItems!=="end"||(t.alignItems="flex-"+t.alignItems),!t.alignContent||t.alignContent!=="start"&&t.alignContent!=="end"||(t.alignContent="flex-"+t.alignContent),t.display="flex",t.flexDirection||(t.flexDirection="row"),t.clip=!0,t.fill=(e=t==null?void 0:t.background)===null||e===void 0?void 0:e.fill,t.stroke=(n=t==null?void 0:t.background)===null||n===void 0?void 0:n.stroke,t.lineWidth=(o=t==null?void 0:t.background)===null||o===void 0?void 0:o.lineWidth,t.cornerRadius=(r=t==null?void 0:t.background)===null||r===void 0?void 0:r.cornerRadius;const m=lt(t.boundsPadding),b=[(l=(s=t.marginTop)!==null&&s!==void 0?s:m?t.boundsPadding[0]:t.boundsPadding)!==null&&l!==void 0?l:0,(h=(a=t.marginRight)!==null&&a!==void 0?a:m?t.boundsPadding[1]:t.boundsPadding)!==null&&h!==void 0?h:0,(c=(d=t.marginBottom)!==null&&d!==void 0?d:m?(u=t.boundsPadding[2])!==null&&u!==void 0?u:t.boundsPadding[0]:t.boundsPadding)!==null&&c!==void 0?c:0,(p=(g=t.marginLeft)!==null&&g!==void 0?g:m?(f=t.boundsPadding[3])!==null&&f!==void 0?f:t.boundsPadding[1]:t.boundsPadding)!==null&&p!==void 0?p:0];t.boundsPadding=b,super(t)}}class j9 extends PT{constructor(t){t.flexWrap="nowrap",super(t)}}let $9=class extends Uo{constructor(t){var e,n,o,r,s,l,a,h,d,u,c,g;let f;ce(t.iconName)&&(f=vn()[t.iconName],f&&(t.width=(e=t.width)!==null&&e!==void 0?e:f.width,t.height=(n=t.height)!==null&&n!==void 0?n:f.height,t.svg=f.svg,t.cursor=f.cursor)),t.svg&&(t.image=t.svg);const p=lt(t.boundsPadding),m=[(r=(o=t.marginTop)!==null&&o!==void 0?o:p?t.boundsPadding[0]:t.boundsPadding)!==null&&r!==void 0?r:0,(l=(s=t.marginRight)!==null&&s!==void 0?s:p?t.boundsPadding[1]:t.boundsPadding)!==null&&l!==void 0?l:0,(d=(a=t.marginBottom)!==null&&a!==void 0?a:p?(h=t.boundsPadding[2])!==null&&h!==void 0?h:t.boundsPadding[0]:t.boundsPadding)!==null&&d!==void 0?d:0,(g=(u=t.marginLeft)!==null&&u!==void 0?u:p?(c=t.boundsPadding[3])!==null&&c!==void 0?c:t.boundsPadding[1]:t.boundsPadding)!==null&&g!==void 0?g:0];t.boundsPadding=m,super(t),this.cache=f}},G9=class extends Uo{constructor(t){var e,n,o,r,s,l,a,h,d,u;t.src&&(t.image=t.src),t.shape==="circle"&&(t.cornerRadius=t.width/2);const c=lt(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}};class U9 extends cu{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=lt(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}}class K9 extends Hi{constructor(t){var e,n,o,r,s,l,a,h,d,u,c;t.textBaseline||(t.textBaseline="top");const g=lt(t.boundsPadding),f=[(n=(e=t.marginTop)!==null&&e!==void 0?e:g?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:g?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:g?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:g?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=f,t.fill=(c=t.fill)!==null&&c!==void 0?c:"#000",super(t)}getSize(t){this.AABBBounds.width()}}function Y9(i,t=0){return{percent:i,delta:t}}class X9 extends fu{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=lt(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}}class q9 extends Va{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=lt(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}getSize(t){this.AABBBounds.width()}}class Z9 extends cn{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=lt(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}}const J9=Object.freeze(Object.defineProperty({__proto__:null,Arc:X9,CheckBox:Rr,Circle:V9,Container:PT,Group:Z9,GroupElement:j9,Icon:$9,Image:G9,Line:i0,Radio:Qa,Rect:U9,Tag:q9,Text:K9,percentCalc:Y9},Symbol.toStringTag,{value:"Module"}));function Q9(i){var t,e,n,o,r,s,l,a,h,d,u;const c={seqId:0},g={isPivotChart:!0};let f,p,m,b;i.columnTree&&(i.indicatorsAsCol!==!1&&(m=Vi(i.columnTree,i.indicators)),f=new Pe((t=i.columnTree)!==null&&t!==void 0?t:[],c)),i.rowTree&&(i.indicatorsAsCol===!1&&(b=Vi(i.rowTree,i.indicators)),p=new Pe((e=i.rowTree)!==null&&e!==void 0?e:[],c));const C=!((n=p.dimensionKeys)===null||n===void 0)&&n.count?p.dimensionKeys.valueArr():(r=(o=i.rows)===null||o===void 0?void 0:o.reduce((y,S)=>(typeof S=="string"?y.push(S):y.push(S.dimensionKey),y),[]))!==null&&r!==void 0?r:[],_=!((s=f.dimensionKeys)===null||s===void 0)&&s.count?f.dimensionKeys.valueArr():(a=(l=i.columns)===null||l===void 0?void 0:l.reduce((y,S)=>(typeof S=="string"?y.push(S):y.push(S.dimensionKey),y),[]))!==null&&a!==void 0?a:[],w=(d=(h=i.indicators)===null||h===void 0?void 0:h.reduce((y,S)=>(typeof S=="string"?y.push(S):y.push(S.indicatorKey),y),[]))!==null&&d!==void 0?d:[];return g.collectValuesBy=t7(i,_,C),g.aggregationRules=e7(i),{dataset:new Ih(g,C,_,w,i.indicators,(u=i.indicatorsAsCol)===null||u===void 0||u,i.records,void 0,m||i.columnTree,b||i.rowTree,!0),columnDimensionTree:f,rowDimensionTree:p,layoutNodeId:c}}function t7(i,t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,A,R,x;const T={};for(let M=0,B=(n=i.indicators)===null||n===void 0?void 0:n.length;M<B;M++)if(typeof i.indicators[M]!="string"&&i.indicators[M].chartSpec)if(i.indicatorsAsCol===!1){const P=i.indicators[M];if(T[P.indicatorKey]={by:e,range:!0,sumBy:((o=P.chartSpec)===null||o===void 0?void 0:o.stack)!==!1&&t.concat((r=P.chartSpec)===null||r===void 0?void 0:r.xField)},P.chartSpec.series)P.chartSpec.series.forEach(F=>{var H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht;const gt=typeof F.xField=="string"?F.xField:F.xField[0];T[gt]={by:t,type:F.direction!=="horizontal"?"xField":void 0,range:F.direction==="horizontal",sortBy:F.direction!=="horizontal"?(I=(k=(E=(H=F==null?void 0:F.data)===null||H===void 0?void 0:H.fields)===null||E===void 0?void 0:E[gt])===null||k===void 0?void 0:k.domain)!==null&&I!==void 0?I:(N=(O=(D=(L=P.chartSpec)===null||L===void 0?void 0:L.data)===null||D===void 0?void 0:D.fields)===null||O===void 0?void 0:O[gt])===null||N===void 0?void 0:N.domain:void 0};const Ct=F.yField;T[Ct]={by:e,range:F.direction!=="horizontal",sumBy:F.stack!==!1&&t.concat(F==null?void 0:F.xField),sortBy:F.direction==="horizontal"?(Y=(U=($=(W=F==null?void 0:F.data)===null||W===void 0?void 0:W.fields)===null||$===void 0?void 0:$[Ct])===null||U===void 0?void 0:U.domain)!==null&&Y!==void 0?Y:(ht=(X=(G=(j=P.chartSpec)===null||j===void 0?void 0:j.data)===null||G===void 0?void 0:G.fields)===null||X===void 0?void 0:X[Ct])===null||ht===void 0?void 0:ht.domain:void 0}});else{const F=typeof P.chartSpec.xField=="string"?P.chartSpec.xField:P.chartSpec.xField[0];T[F]={by:t,type:P.chartSpec.direction!=="horizontal"?"xField":void 0,range:P.chartSpec.direction==="horizontal",sortBy:P.chartSpec.direction!=="horizontal"?(h=(a=(l=(s=P.chartSpec)===null||s===void 0?void 0:s.data)===null||l===void 0?void 0:l.fields)===null||a===void 0?void 0:a[F])===null||h===void 0?void 0:h.domain:void 0};const H=P.chartSpec.yField;T[H]={by:e,range:i.indicators[M].chartSpec.direction!=="horizontal",sumBy:P.chartSpec.stack!==!1&&t.concat((d=P.chartSpec)===null||d===void 0?void 0:d.xField),sortBy:P.chartSpec.direction==="horizontal"?(f=(g=(c=(u=P.chartSpec)===null||u===void 0?void 0:u.data)===null||c===void 0?void 0:c.fields)===null||g===void 0?void 0:g[H])===null||f===void 0?void 0:f.domain:void 0}}}else{const P=i.indicators[M];if(T[P.indicatorKey]={by:t,range:!0,sumBy:((p=P.chartSpec)===null||p===void 0?void 0:p.stack)!==!1&&e.concat((m=P.chartSpec)===null||m===void 0?void 0:m.yField)},P.chartSpec.series)P.chartSpec.series.forEach(F=>{var H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht;const gt=typeof F.yField=="string"?F.yField:F.yField[0];T[gt]={by:e,type:F.direction==="horizontal"?"yField":void 0,range:F.direction!=="horizontal",sortBy:F.direction==="horizontal"?(I=(k=(E=(H=F==null?void 0:F.data)===null||H===void 0?void 0:H.fields)===null||E===void 0?void 0:E[gt])===null||k===void 0?void 0:k.domain)!==null&&I!==void 0?I:(N=(O=(D=(L=P.chartSpec)===null||L===void 0?void 0:L.data)===null||D===void 0?void 0:D.fields)===null||O===void 0?void 0:O[gt])===null||N===void 0?void 0:N.domain:void 0};const Ct=F.xField;T[Ct]={by:t,range:F.direction==="horizontal",sumBy:F.stack!==!1&&e.concat(F==null?void 0:F.yField),sortBy:F.direction!=="horizontal"?(Y=(U=($=(W=F==null?void 0:F.data)===null||W===void 0?void 0:W.fields)===null||$===void 0?void 0:$[Ct])===null||U===void 0?void 0:U.domain)!==null&&Y!==void 0?Y:(ht=(X=(G=(j=P.chartSpec)===null||j===void 0?void 0:j.data)===null||G===void 0?void 0:G.fields)===null||X===void 0?void 0:X[Ct])===null||ht===void 0?void 0:ht.domain:void 0}});else{const F=typeof P.chartSpec.yField=="string"?P.chartSpec.yField:P.chartSpec.yField[0];T[F]={by:e,type:P.chartSpec.direction==="horizontal"?"yField":void 0,range:P.chartSpec.direction!=="horizontal",sortBy:P.chartSpec.direction==="horizontal"?(w=(_=(C=(b=P.chartSpec)===null||b===void 0?void 0:b.data)===null||C===void 0?void 0:C.fields)===null||_===void 0?void 0:_[F])===null||w===void 0?void 0:w.domain:void 0};const H=P.chartSpec.xField;T[H]={by:t,range:i.indicators[M].chartSpec.direction==="horizontal",sumBy:P.chartSpec.stack!==!1&&e.concat((y=P.chartSpec)===null||y===void 0?void 0:y.yField),sortBy:P.chartSpec.direction!=="horizontal"?(x=(R=(A=(S=P.chartSpec)===null||S===void 0?void 0:S.data)===null||A===void 0?void 0:A.fields)===null||R===void 0?void 0:R[H])===null||x===void 0?void 0:x.domain:void 0}}}return T}function e7(i){var t;const e=[];return(t=i.indicators)===null||t===void 0||t.forEach(n=>{var o,r;if(typeof n=="string")e.push({indicatorKey:n,field:n,aggregationType:zt.RECORD});else if(!((o=n.chartSpec)===null||o===void 0)&&o.series){const s=[];(r=n.chartSpec)===null||r===void 0||r.series.forEach(l=>{const a=i.indicatorsAsCol===!1?l.yField:l.xField;s.indexOf(a)===-1&&s.push(a)}),e.push({indicatorKey:n.indicatorKey,field:s,aggregationType:zt.RECORD})}else{const s=i.indicatorsAsCol===!1?n.chartSpec.yField:n.chartSpec.xField;e.push({indicatorKey:n.indicatorKey,field:s??n.indicatorKey,aggregationType:zt.RECORD})}}),e}function i7(i,t,e){var n,o;const r=Q9(i);let s=r.columnDimensionTree,l=r.rowDimensionTree,a=!1,h=!1;i.columnTree&&i.indicatorsAsCol&&!s.dimensionKeys.contain(Xi)&&(a=!0),i.rowTree&&(i.indicatorsAsCol||l.dimensionKeys.contain(Xi)||(h=!0));const{dataset:d,layoutNodeId:u}=r,c={options:i,layoutNodeId:u,internalProps:i,isPivotChart:()=>!0,pivotChartAxes:[],_selectedDataItemsInChart:[],_getActiveChartInstance:()=>({updateState:()=>{}})};i.columnTree&&!a||(s=new Pe((n=d.colHeaderTree)!==null&&n!==void 0?n:[],u)),i.rowTree&&!h||(l=new Pe((o=d.rowHeaderTree)!==null&&o!==void 0?o:[],u));const g=new lr(c,d,s,l);for(let f=0;f<g.colCount;f++)for(let p=0;p<g.rowCount;p++){if(g.isHeader(f,p))continue;const m=g.getCellHeaderPaths(f,p),b=m.colHeaderPaths.map(y=>{var S;return(S=y.indicatorKey)!==null&&S!==void 0?S:y.value}),C=m.rowHeaderPaths.map(y=>{var S;return(S=y.indicatorKey)!==null&&S!==void 0?S:y.value}),_=d.getAggregator(g.indicatorsAsCol?C:C.slice(0,-1),g.indicatorsAsCol?b.slice(0,-1):b,g.getIndicatorKey(f,p)),w=n7(_.value?_.value():void 0,t,f,p,g,e);if(w)return w}}function n7(i,t,e,n,o,r){if(lt(i)){for(let s=0;s<i.length;s++)if(r?r(i[s],t):o7(i[s],t))return o.getCellHeaderPaths(e,n)}}function o7(i,t){return JSON.stringify(i)===JSON.stringify(t)}function r7(i){return new Va(i?i.attribute:{})}function s7(i){return new Rr(i?i.attribute:{})}function l7(i){return new Qa(i?i.attribute:{})}class a7{constructor(t,e){var n,o,r,s,l,a;this.willUpdateRow=!1,this.willUpdateCol=!1,this.table=t,this.rowCount=(n=e==null?void 0:e.rowCount)!==null&&n!==void 0?n:void 0,this.colCount=(o=e==null?void 0:e.colCount)!==null&&o!==void 0?o:void 0,this.animationDuration=(r=e==null?void 0:e.animationDuration)!==null&&r!==void 0?r:500,this.animationDelay=(s=e==null?void 0:e.animationDelay)!==null&&s!==void 0?s:1e3,this.animationEasing=(l=e==null?void 0:e.animationEasing)!==null&&l!==void 0?l:"linear",this.replaceScrollAction=(a=e==null?void 0:e.replaceScrollAction)!==null&&a!==void 0&&a,this.reset(),this.init()}init(){this.replaceScrollAction&&(this.table.disableScroll(),this.table.scenegraph.stage.addEventListener("wheel",this.onScrollEnd.bind(this)))}reset(){this.playing=!1,this.row=this.table.frozenRowCount,this.col=this.table.frozenColCount}onScrollEnd(t){this.rowCount?(t.deltaY>0?(this.row+=this.rowCount,this.row=Math.min(this.row,this.table.rowCount-this.table.frozenRowCount)):t.deltaY<0&&(this.row-=this.rowCount,this.row=Math.max(this.row,this.table.frozenRowCount)),this.table.scrollToRow(this.row,{duration:this.animationDuration,easing:this.animationEasing})):this.colCount&&(t.deltaX>0?(this.col+=this.colCount,this.col=Math.min(this.col,this.table.colCount-this.table.frozenColCount)):t.deltaX<0&&(this.col-=this.colCount,this.col=Math.max(this.col,this.table.frozenColCount)),this.table.scrollToCol(this.col,{duration:this.animationDuration,easing:this.animationEasing}))}play(){this.playing=!0,this.rowCount&&!this.willUpdateRow?this.updateRow():this.colCount&&!this.willUpdateCol&&this.updateCol()}pause(){this.playing=!1}updateRow(){if(!this.playing)return;let t=!0;this.table.scenegraph.proxy.screenTopRow!==this.row?(this.row=this.table.frozenRowCount,t=!1):this.row+=this.rowCount,this.table.scrollToRow(this.row,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateRow=!0,setTimeout(()=>{this.willUpdateRow=!1,this.updateRow()},this.animationDuration+this.animationDelay)}updateCol(){if(!this.playing)return;let t=!0;this.table.scenegraph.proxy.screenLeftCol!==this.col?(this.col=this.table.frozenColCount,t=!1):this.col+=this.colCount,this.table.scrollToCol(this.col,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateCol=!0,setTimeout(()=>{this.willUpdateCol=!1,this.updateCol()},this.animationDuration+this.animationDelay)}}class h7{constructor(t,e){this.table=t,this.options=e,this.registerStyle(),this.bindEvent()}registerStyle(){var t,e,n,o,r,s,l,a;this.table.registerCustomCellStyle("col-highlight",{bgColor:(e=(t=this.options)===null||t===void 0?void 0:t.colHighlightBGColor)!==null&&e!==void 0?e:"#82b2f5",color:(o=(n=this.options)===null||n===void 0?void 0:n.colHighlightColor)!==null&&o!==void 0?o:"#FFF"}),this.table.registerCustomCellStyle("row-highlight",{bgColor:(s=(r=this.options)===null||r===void 0?void 0:r.rowHighlightBGColor)!==null&&s!==void 0?s:"#82b2f5",color:(a=(l=this.options)===null||l===void 0?void 0:l.rowHighlightColor)!==null&&a!==void 0?a:"#FFF"})}bindEvent(){this.table.on("selected_cell",t=>{this.updateHighlight()}),this.table.on("selected_clear",()=>{this.clearHighlight()}),this.table.on("mousemove_table",()=>{this.table.stateManager.select.selecting&&this.updateHighlight()})}clearHighlight(){this.colHeaderRange&&this.table.arrangeCustomCellStyle({range:this.colHeaderRange},void 0),this.rowHeaderRange&&this.table.arrangeCustomCellStyle({range:this.rowHeaderRange},void 0),this.colHeaderRange=void 0,this.rowHeaderRange=void 0}updateHighlight(){var t,e,n,o;if(((t=this.options)===null||t===void 0?void 0:t.colHighlight)===!1&&((e=this.options)===null||e===void 0?void 0:e.rowHighlight)===!1)return;const r=this.table.getSelectedCellRanges();if(r.length===0)return void this.clearHighlight();const s=r[0],l=[s.start.row,s.end.row];l.sort((u,c)=>u-c);const a=[s.start.col,s.end.col];let h,d;a.sort((u,c)=>u-c),this.table.isPivotTable()?(h={start:{col:a[0],row:0},end:{col:a[1],row:this.table.columnHeaderLevelCount-1}},d={start:{col:0,row:l[0]},end:{col:this.table.rowHeaderLevelCount-1,row:l[1]}}):this.table.internalProps.transpose?d={start:{col:0,row:l[0]},end:{col:this.table.rowHeaderLevelCount-1,row:l[1]}}:(h={start:{col:a[0],row:0},end:{col:a[1],row:this.table.columnHeaderLevelCount-1}},this.table.internalProps.rowSeriesNumber&&(d={start:{col:0,row:l[0]},end:{col:0,row:l[1]}})),((n=this.options)===null||n===void 0?void 0:n.colHighlight)===!1||HT(this.colHeaderRange,h)||(this.colHeaderRange&&this.table.arrangeCustomCellStyle({range:this.colHeaderRange},void 0),h&&this.table.arrangeCustomCellStyle({range:h},"col-highlight"),this.colHeaderRange=h),((o=this.options)===null||o===void 0?void 0:o.rowHighlight)===!1||HT(this.rowHeaderRange,d)||(this.rowHeaderRange&&this.table.arrangeCustomCellStyle({range:this.rowHeaderRange},void 0),d&&this.table.arrangeCustomCellStyle({range:d},"row-highlight"),this.rowHeaderRange=d)}}function HT(i,t){return i===void 0&&t===void 0||i!==void 0&&t!==void 0&&i.start.col===t.start.col&&i.start.row===t.start.row&&i.end.col===t.end.col&&i.end.row===t.end.row}ix();const d7="1.11.1";function u7(){return vn()}function c7(){rT()}const g7=Object.freeze(Object.defineProperty({__proto__:null,CarouselAnimationPlugin:a7,CustomLayout:J9,DataStatistics:nV,EventTarget:th,HeaderHighlightPlugin:h7,InvertHighlightPlugin:Q6,ListTable:F9,ListTableSimple:I9,PIVOT_CHART_EVENT_TYPE:SA,PIVOT_TABLE_EVENT_TYPE:rr,PivotChart:N9,PivotTable:BT,PivotTableSimple:W9,TABLE_EVENT_TYPE:at,TYPES:jz,VArc:HI,VArea:EI,VCheckBox:s7,VCircle:LI,VGlyph:FI,VGroup:kI,VImage:II,VLine:DI,VPath:OI,VPolygon:zI,VRadio:l7,VRect:WI,VSymbol:NI,VTag:r7,VText:VI,clearGlobal:c7,core:K8,data:Q4,getDataCellPath:i7,getIcons:u7,getTargetCell:Hr,graphicUtil:B1,jsx:$I,onBeforeAttributeUpdateForInvertHighlight:fR,register:J8,registerAxis:Mg,registerChartCell:kg,registerCheckboxCell:Fg,registerEmptyTip:Bg,registerImageCell:Ig,registerLegend:Pg,registerMenu:Hg,registerProgressBarCell:Dg,registerRadioCell:Og,registerSparkLineCell:zg,registerTextCell:Il,registerTitle:Eg,registerTooltip:Lg,registerVideoCell:Wg,renderChart:Vm,restoreMeasureText:hW,setCustomAlphabetCharSet:aW,themes:j4,updateCell:_o,version:d7},Symbol.toStringTag,{value:"Module"})),zr=PB.create({baseURL:"/",validateStatus(i){return i===200},timeout:1e3*15});zr.interceptors.request.use(i=>i,i=>Promise.reject(i)),zr.interceptors.response.use(i=>{var t,e;return+((t=i==null?void 0:i.data)==null?void 0:t.code)==500&&ji.message.error({content:((e=i==null?void 0:i.data)==null?void 0:e.message)||"服务器异常",key:"SERVER_ERROR"}),i},i=>{if(i.message.includes("timeout"))ji.message.error({content:"网络连接超时,请重试!",key:"TIMEOUT"});else{const{status:t}=i.response;t===401?ji.message.error({content:"当前用户信息不正确",key:"REQUEST_ERROR"}):t>=500?ji.message.error({content:"服务器异常",key:"REQUEST_ERROR"}):ji.message.error({content:"请求异常",key:"REQUEST_ERROR"})}return Promise.reject(i)});var ET={},f7={get exports(){return ET},set exports(i){ET=i}};(function(i,t){(function(e,n){i.exports=n(Lo)})(sP,function(e){function n(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var o=n(e),r={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(s,l){return l==="W"?s+"周":s+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(s,l){var a=100*s+l;return a<600?"凌晨":a<900?"早上":a<1100?"上午":a<1300?"中午":a<1800?"下午":"晚上"}};return o.default.locale(r,null,!0),r})})(f7);const xX="",RX="",Ti=(i,t)=>{const e=i.__vccOpts||i;for(const[n,o]of t)e[n]=o;return e};Lo.locale("zh-cn");const p7=v.defineComponent({name:"PivotFilter",props:{data:{type:Object,default:()=>{}},customDimensions:{type:Array,default:()=>[]},dimensions:{type:Array,default:()=>[]},indicators:{type:Array,default:()=>[]}},setup(i,{emit:t,expose:e}){const n=v.ref(!1),o=v.ref(!1),r=v.ref(!1),s=v.ref([]),l=v.ref(""),a=v.ref(),h=v.ref(""),d=v.ref([]),u=v.ref(),c=v.ref("range"),g=v.ref(),f=v.ref({}),p=v.ref(),m=v.ref({}),b=v.inject("getContainer",()=>{}),C=v.inject("scaleValue",{}),_=v.inject("theme","light"),w=v.inject("pageId",""),y=v.inject("context",""),S=v.inject("indicatorUrl",""),A=v.inject("indicatorToken",""),R=v.inject("graphicConfig",{}),x=v.inject("theDateInfo",{}),T=[{label:"小于",value:"LESS"},{label:"小于等于",value:"LESS_EQUAL"},{label:"大于",value:"GREATER"},{label:"大于等于",value:"GREATER_EQUAL"},{label:"等于",value:"EQUAL"},{label:"不等于",value:"NOT_EQUAL"}],M=[{label:"单个日期",value:"date"},{label:"日期范围",value:"range"}],B=j=>{r.value=!1,s.value=j.target.checked?v.unref(d).map(G=>G.value):[]};v.watch(s,j=>{o.value=j.length===v.unref(d).length,r.value=!!j.length&&j.length<v.unref(d).length});const P=async j=>{const{queryColumnList:G=[],edvDataSetId:X="",source:ht,dataSourceId:gt}=v.unref(R);let Ct=G.find(st=>st.name===j||st.label===j);Ct||(Ct=i.customDimensions.find(st=>st.name===j||st.label===j));const Q={},{search:et}=(window==null?void 0:window.location)||{},bt=et.slice(1,et.length).split("&");for(const st of bt)if(st){const _t=st.split("=");_t[0]&&(Q[_t[0]]=_t[1])}const dt=await zr.post(`${v.unref(S)}/diagram/groupvalue`,{source:ht,groupColumn:j,hrpIndexTypeGuid:Ct==null?void 0:Ct.typeGuid,pageId:v.unref(w),pageFlag:!0,edvDataSetId:X,dataSourceId:gt,extParam:Q},{headers:{Authentication:v.unref(A),operateContext:v.unref(y)}}),{success:ot,data:ut=[]}=dt.data;ot&&(d.value=ut.map(st=>({value:st})))},F=v.ref("");async function H(){const{filterData:j,type:G,key:X}=i.data,gt=i.dimensions.concat(i.indicators).find(Ct=>Ct.label===X);gt&&(F.value=gt.genericType),v.unref(F)==="DATE"?u.value="date":u.value="select",G==="dimension"?v.unref(u)==="select"?(await P(X),Array.isArray(j)?s.value=j:s.value=(j==null?void 0:j.value)||[]):v.unref(u)==="date"&&(j==null?void 0:j.length)===2&&(a.value=[Lo(j[0].value),Lo(j[1].value)]):(l.value=(j==null?void 0:j.rule)||"",a.value=(j==null?void 0:j.value)||""),n.value=!0}const E=v.computed(()=>v.unref(x).dateFormat||"YYYY-MM-DD");function k(){var ht;const{key:j,type:G}=i.data;let X={};G==="dimension"?v.unref(u)==="select"?X={rule:"IN",value:v.unref(s)}:v.unref(u)==="date"&&(v.unref(c)==="date"?X={rule:"EQUAL",value:((ht=v.unref(a))==null?void 0:ht.format(v.unref(E)))||""}:v.unref(c)==="range"&&v.unref(a)&&(X=[{rule:"GREATER_EQUAL",value:v.unref(a)[0].format(v.unref(E))},{rule:"LESS_EQUAL",value:v.unref(a)[1].format(v.unref(E))}])):X={rule:v.unref(l),value:v.unref(a)},t("change",{checkKeys:X,key:j,type:G}),n.value=!1}function I(){l.value="",a.value=null}const L=v.computed(()=>v.unref(_)==="darkBlue"?"#b2c3dd":""),D=()=>document.getElementsByClassName("filter-modal")[0]||document.body,O=j=>{var G,X,ht;if(j){const gt=(G=v.unref(g))==null?void 0:G.getBoundingClientRect();if(gt){const Ct=gt.left/(((X=v.unref(C))==null?void 0:X.widthScale)||1)+"px",Q=(gt.top+gt.height)/(((ht=v.unref(C))==null?void 0:ht.heightScale)||1)+"px";setTimeout(()=>{var bt,dt;const et=document.querySelectorAll(".ant-select-dropdown"),vt=Array.from(et).filter(ot=>window.getComputedStyle(ot).display!=="none");if(vt!=null&&vt.length){const ot=document.getElementsByClassName("filter-modal")[0];vt[0].classList.add("filter-select-dropdown"),(bt=ot==null?void 0:ot.style)==null||bt.setProperty("--drop-down-left",Ct),(dt=ot==null?void 0:ot.style)==null||dt.setProperty("--drop-down-top",Q),f.value={visibility:"visible"}}},200)}}else f.value={}},N=j=>{var G,X,ht;if(j){const gt=(G=v.unref(p))==null?void 0:G.getBoundingClientRect();if(gt){const Ct=gt.left/(((X=v.unref(C))==null?void 0:X.widthScale)||1)+"px",Q=(gt.top+gt.height)/(((ht=v.unref(C))==null?void 0:ht.heightScale)||1)+"px";setTimeout(()=>{var bt,dt;const et=document.querySelectorAll(".pivot-table-range-date-dropdown"),vt=Array.from(et).filter(ot=>window.getComputedStyle(ot).display!=="none");if(vt!=null&&vt.length){const ot=document.getElementsByClassName("filter-modal")[0];vt[0].classList.add("filter-range-picker-dropdown"),(bt=ot==null?void 0:ot.style)==null||bt.setProperty("--range-picker-dropdown-left",Ct),(dt=ot==null?void 0:ot.style)==null||dt.setProperty("--range-picker-dropdown-top",Q),m.value={visibility:"visible"}}},200)}}else m.value={}},W=v.computed(()=>{let j="270px";return v.unref(u)==="date"&&(j=""),{padding:"10px",height:j,maxHeight:"280px"}}),$=()=>{a.value=null};v.watch(n,j=>{window.modalShow&&window.modalShow(j)});const U=v.computed(()=>{let j="date";return v.unref(E).endsWith("MM")?j="month":v.unref(E).endsWith("YYYY")&&(j="year"),j}),Y=j=>{const{startTime:G,endTime:X,rangeFormat:ht}=v.unref(x);if(G&&X){let gt="day";return ht.endsWith("MM")?gt="month":ht.endsWith("YYYY")&&(gt="year"),j&&gt&&(j<Lo(G).startOf(gt)||j>Lo(X).endOf(gt))}else return!1};return e({showModal:H}),{visible:n,checkAllDimensions:o,dimIndeterminate:r,dimensionCheckKeys:s,ruleValue:l,ruleOptions:T,filterValue:a,searchDimName:h,fontColor:L,valueList:d,filterType:u,dateSelectType:c,bodyStyle:W,dateType:U,dateSelectOptions:M,formatStr:E,theme:_,handleOk:k,onCheckAllDimChange:B,handleClear:I,dropdownStyle:f,popupStyle:m,selectRef:g,rangePickerRef:p,getPopupContainer:D,onChangeSelectType:$,disabledDate:Y,getContainer:b,dropdownVisibleChange:O,openChange:N}}}),m7={class:"wrap-header"},v7={class:"wrap-body"},b7={style:{padding:"20px",display:"none"}},C7={ref:"selectRef",style:{display:"inline-block"}},y7={style:{padding:"10px 20px"}},_7={key:0,class:"ecan-date-picker"},w7={key:1,class:"ecan-range-picker",style:{display:"inline-block"},ref:"rangePickerRef"},S7={key:1},x7={style:{padding:"20px"}},R7={ref:"selectRef",style:{display:"inline-block"}},A7={style:{padding:"10px 20px"}};function T7(i,t,e,n,o,r){var p;const s=v.resolveComponent("a-checkbox"),l=v.resolveComponent("a-input"),a=v.resolveComponent("a-checkbox-group"),h=v.resolveComponent("a-select-option"),d=v.resolveComponent("a-select"),u=v.resolveComponent("a-date-picker"),c=v.resolveComponent("a-range-picker"),g=v.resolveComponent("a-button"),f=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(f,{wrapClassName:i.theme+" filter-modal",visible:i.visible,"onUpdate:visible":t[9]||(t[9]=m=>i.visible=m),title:((p=i.data)==null?void 0:p.fieldName)+"-筛选","ok-text":"确认","cancel-text":"取消",bodyStyle:i.bodyStyle,getContainer:i.getContainer,onOk:i.handleOk},{footer:v.withCtx(()=>[v.createVNode(g,{onClick:t[8]||(t[8]=m=>i.visible=!1)},{default:v.withCtx(()=>t[10]||(t[10]=[v.createTextVNode("取消")])),_:1}),i.data.type==="indicators"?(v.openBlock(),v.createBlock(g,{key:0,onClick:i.handleClear},{default:v.withCtx(()=>t[11]||(t[11]=[v.createTextVNode("清除筛选")])),_:1},8,["onClick"])):v.createCommentVNode("",!0),v.createVNode(g,{type:"primary",onClick:i.handleOk},{default:v.withCtx(()=>t[12]||(t[12]=[v.createTextVNode("确定")])),_:1},8,["onClick"])]),default:v.withCtx(()=>[i.data.type==="dimension"?(v.openBlock(),v.createElementBlock("div",{key:0,class:v.normalizeClass(["dimension-wrap",i.filterType==="select"?"border":""])},[i.filterType==="select"?(v.openBlock(),v.createElementBlock(v.Fragment,{key:0},[v.createElementVNode("div",m7,[v.createVNode(s,{checked:i.checkAllDimensions,"onUpdate:checked":t[0]||(t[0]=m=>i.checkAllDimensions=m),indeterminate:i.dimIndeterminate,disabled:!!i.searchDimName,onChange:i.onCheckAllDimChange},{default:v.withCtx(()=>[v.createElementVNode("span",{style:v.normalizeStyle({color:i.fontColor})},"全选",4)]),_:1},8,["checked","indeterminate","disabled","onChange"]),v.createVNode(l,{value:i.searchDimName,"onUpdate:value":t[1]||(t[1]=m=>i.searchDimName=m),placeholder:"请输入关键字搜索",style:{width:"200px","margin-left":"15px"}},null,8,["value"])]),v.createElementVNode("div",v7,[v.createVNode(a,{value:i.dimensionCheckKeys,"onUpdate:value":t[2]||(t[2]=m=>i.dimensionCheckKeys=m),style:{width:"100%"}},{default:v.withCtx(()=>[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.valueList||[],(m,b)=>v.withDirectives((v.openBlock(),v.createElementBlock("div",{class:"body-item",key:b},[v.createVNode(s,{value:m.value},{default:v.withCtx(()=>[v.createElementVNode("span",{style:v.normalizeStyle({color:i.fontColor})},v.toDisplayString(m.value),5)]),_:2},1032,["value"])])),[[v.vShow,!i.searchDimName||m.value.includes(i.searchDimName)]])),128))]),_:1},8,["value"])])],64)):i.filterType==="date"?(v.openBlock(),v.createElementBlock(v.Fragment,{key:1},[v.createElementVNode("div",b7,[v.createElementVNode("span",{class:"filter-label",style:v.normalizeStyle({color:i.fontColor})},"筛选类型:",4),v.createElementVNode("div",C7,[v.createVNode(d,{value:i.dateSelectType,"onUpdate:value":t[3]||(t[3]=m=>i.dateSelectType=m),style:{width:"200px"},placeholder:"请选择",dropdownClassName:"pivot-table-select-dropdown",getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:i.dropdownVisibleChange,onChange:i.onChangeSelectType},{default:v.withCtx(()=>[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.dateSelectOptions,m=>(v.openBlock(),v.createBlock(h,{key:m.value,value:m.value},{default:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(m.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value","getPopupContainer","dropdownStyle","onDropdownVisibleChange","onChange"])],512)]),v.createElementVNode("div",y7,[v.createElementVNode("span",{class:"filter-label",style:v.normalizeStyle({color:i.fontColor})},"筛选值:",4),i.dateSelectType==="date"?(v.openBlock(),v.createElementBlock("span",_7,[v.createVNode(u,{dropdownClassName:"ecan-date-picker-dropdown",value:i.filterValue,"onUpdate:value":t[4]||(t[4]=m=>i.filterValue=m),picker:i.dateType,format:i.formatStr,getPopupContainer:i.getPopupContainer},null,8,["value","picker","format","getPopupContainer"])])):i.dateSelectType==="range"?(v.openBlock(),v.createElementBlock("div",w7,[v.createVNode(c,{dropdownClassName:"ecan-range-picker-dropdown pivot-table-range-date-dropdown",value:i.filterValue,"onUpdate:value":t[5]||(t[5]=m=>i.filterValue=m),picker:i.dateType,format:i.formatStr,"disabled-date":i.disabledDate,getPopupContainer:i.getPopupContainer,popupStyle:i.popupStyle,onOpenChange:i.openChange},null,8,["value","picker","format","disabled-date","getPopupContainer","popupStyle","onOpenChange"])],512)):v.createCommentVNode("",!0)])],64)):v.createCommentVNode("",!0)],2)):i.data.type==="indicators"?(v.openBlock(),v.createElementBlock("div",S7,[v.createElementVNode("div",x7,[v.createElementVNode("span",{class:"filter-label",style:v.normalizeStyle({color:i.fontColor})},"筛选规则:",4),v.createElementVNode("div",R7,[v.createVNode(d,{value:i.ruleValue,"onUpdate:value":t[6]||(t[6]=m=>i.ruleValue=m),style:{width:"200px"},placeholder:"请选择",dropdownClassName:"pivot-table-select-dropdown",getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:i.dropdownVisibleChange},{default:v.withCtx(()=>[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.ruleOptions,m=>(v.openBlock(),v.createBlock(h,{key:m.value,value:m.value},{default:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(m.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value","getPopupContainer","dropdownStyle","onDropdownVisibleChange"])],512)]),v.createElementVNode("div",A7,[v.createElementVNode("span",{class:"filter-label",style:v.normalizeStyle({color:i.fontColor})},"筛选值:",4),v.createVNode(l,{value:i.filterValue,"onUpdate:value":t[7]||(t[7]=m=>i.filterValue=m),placeholder:"请输入",style:{width:"200px"}},null,8,["value"])])])):v.createCommentVNode("",!0)]),_:1},8,["wrapClassName","visible","title","bodyStyle","getContainer","onOk"])}const LT=Ti(p7,[["render",T7],["__scopeId","data-v-947f155b"]]),AX="",M7=v.defineComponent({name:"PivotProperty",props:{},setup(i,{emit:t,expose:e}){const n=v.ref(!1),o=v.ref({unit:"",format:"",floatLength:""}),r=v.ref(),s=v.ref({}),l=v.inject("theme","light"),a=v.inject("scaleValue",{}),h=v.inject("getContainer",()=>{}),d=[{label:"整数",value:"integer"},{label:"小数",value:"float"},{label:"百分比",value:"percent"}];function u(p){o.value=p,n.value=!0}function c(){t("change",v.unref(o)),n.value=!1}const g=()=>document.getElementsByClassName("property-modal")[0]||document.body,f=p=>{var m,b,C;if(p){const _=(m=v.unref(r))==null?void 0:m.getBoundingClientRect();if(_){const w=_.left/(((b=v.unref(a))==null?void 0:b.widthScale)||1)+"px",y=(_.top+_.height)/(((C=v.unref(a))==null?void 0:C.heightScale)||1)+"px";setTimeout(()=>{var R,x;const S=document.querySelectorAll(".ant-select-dropdown"),A=Array.from(S).filter(T=>window.getComputedStyle(T).display!=="none");if(A!=null&&A.length){const T=document.getElementsByClassName("property-modal")[0];A[0].classList.add("property-select-dropdown"),(R=T==null?void 0:T.style)==null||R.setProperty("--drop-down-left",w),(x=T==null?void 0:T.style)==null||x.setProperty("--drop-down-top",y),s.value={visibility:"visible"}}},200)}}else s.value={}};return v.watch(n,p=>{window.modalShow&&window.modalShow(p)}),e({showModal:u}),{theme:l,visible:n,formData:o,handleOk:c,getPopupContainer:g,formatOptions:d,getContainer:h,selectRef:r,dropdownStyle:s,dropdownVisibleChange:f}}}),B7={ref:"selectRef"};function P7(i,t,e,n,o,r){const s=v.resolveComponent("a-input"),l=v.resolveComponent("a-form-item"),a=v.resolveComponent("a-radio-button"),h=v.resolveComponent("a-radio-group"),d=v.resolveComponent("a-select"),u=v.resolveComponent("a-form"),c=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(c,{wrapClassName:i.theme+" property-modal",visible:i.visible,"onUpdate:visible":t[4]||(t[4]=g=>i.visible=g),"ok-text":"确认","cancel-text":"取消",title:i.formData.fieldName+"-度量属性",destroyOnClose:!1,getContainer:i.getContainer,onOk:i.handleOk},{default:v.withCtx(()=>[v.createVNode(u,null,{default:v.withCtx(()=>[v.createVNode(l,{label:"度量单位"},{default:v.withCtx(()=>[v.createVNode(s,{value:i.formData.unit,"onUpdate:value":t[0]||(t[0]=g=>i.formData.unit=g)},null,8,["value"])]),_:1}),i.formData.unit?(v.openBlock(),v.createBlock(l,{key:0,label:"度量单位位置"},{default:v.withCtx(()=>[v.createVNode(h,{value:i.formData.position,"onUpdate:value":t[1]||(t[1]=g=>i.formData.position=g),"button-style":"solid"},{default:v.withCtx(()=>[v.createVNode(a,{value:"left"},{default:v.withCtx(()=>t[5]||(t[5]=[v.createTextVNode("数据左侧")])),_:1}),v.createVNode(a,{value:"right"},{default:v.withCtx(()=>t[6]||(t[6]=[v.createTextVNode("数据右侧")])),_:1})]),_:1},8,["value"])]),_:1})):v.createCommentVNode("",!0),v.createVNode(l,{label:"格式化"},{default:v.withCtx(()=>[v.createElementVNode("div",B7,[v.createVNode(d,{value:i.formData.format,"onUpdate:value":t[2]||(t[2]=g=>i.formData.format=g),options:i.formatOptions,getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:i.dropdownVisibleChange},null,8,["value","options","getPopupContainer","dropdownStyle","onDropdownVisibleChange"])],512)]),_:1}),["float","percent"].includes(i.formData.format)?(v.openBlock(),v.createBlock(l,{key:1,label:"小数位数"},{default:v.withCtx(()=>[v.createVNode(s,{type:"number",value:i.formData.floatLength,"onUpdate:value":t[3]||(t[3]=g=>i.formData.floatLength=g),min:0},null,8,["value"])]),_:1})):v.createCommentVNode("",!0)]),_:1})]),_:1},8,["wrapClassName","visible","title","getContainer","onOk"])}const H7=Ti(M7,[["render",P7]]);function Vn(i,t){E7(i)&&(i="100%");var e=L7(i);return i=t===360?i:Math.min(t,Math.max(0,parseFloat(i))),e&&(i=parseInt(String(i*t),10)/100),Math.abs(i-t)<1e-6?1:(t===360?i=(i<0?i%t+t:i%t)/parseFloat(String(t)):i=i%t/parseFloat(String(t)),i)}function E7(i){return typeof i=="string"&&i.indexOf(".")!==-1&&parseFloat(i)===1}function L7(i){return typeof i=="string"&&i.indexOf("%")!==-1}function k7(i){return i=parseFloat(i),(isNaN(i)||i<0||i>1)&&(i=1),i}function Ng(i){return i<=1?"".concat(Number(i)*100,"%"):i}function mv(i){return i.length===1?"0"+i:String(i)}function F7(i,t,e){return{r:Vn(i,255)*255,g:Vn(t,255)*255,b:Vn(e,255)*255}}function vv(i,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?i+(t-i)*(6*e):e<1/2?t:e<2/3?i+(t-i)*(2/3-e)*6:i}function I7(i,t,e){var n,o,r;if(i=Vn(i,360),t=Vn(t,100),e=Vn(e,100),t===0)o=e,r=e,n=e;else{var s=e<.5?e*(1+t):e+t-e*t,l=2*e-s;n=vv(l,s,i+1/3),o=vv(l,s,i),r=vv(l,s,i-1/3)}return{r:n*255,g:o*255,b:r*255}}function D7(i,t,e){i=Vn(i,255),t=Vn(t,255),e=Vn(e,255);var n=Math.max(i,t,e),o=Math.min(i,t,e),r=0,s=n,l=n-o,a=n===0?0:l/n;if(n===o)r=0;else{switch(n){case i:r=(t-e)/l+(t<e?6:0);break;case t:r=(e-i)/l+2;break;case e:r=(i-t)/l+4;break}r/=6}return{h:r,s:a,v:s}}function O7(i,t,e){i=Vn(i,360)*6,t=Vn(t,100),e=Vn(e,100);var n=Math.floor(i),o=i-n,r=e*(1-t),s=e*(1-o*t),l=e*(1-(1-o)*t),a=n%6,h=[e,s,r,r,l,e][a],d=[l,e,e,s,r,r][a],u=[r,r,l,e,e,s][a];return{r:h*255,g:d*255,b:u*255}}function z7(i,t,e,n){var o=[mv(Math.round(i).toString(16)),mv(Math.round(t).toString(16)),mv(Math.round(e).toString(16))];return n&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function kT(i){return _n(i)/255}function _n(i){return parseInt(i,16)}var FT={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Dh(i){var t={r:0,g:0,b:0},e=1,n=null,o=null,r=null,s=!1,l=!1;return typeof i=="string"&&(i=V7(i)),typeof i=="object"&&(ar(i.r)&&ar(i.g)&&ar(i.b)?(t=F7(i.r,i.g,i.b),s=!0,l=String(i.r).substr(-1)==="%"?"prgb":"rgb"):ar(i.h)&&ar(i.s)&&ar(i.v)?(n=Ng(i.s),o=Ng(i.v),t=O7(i.h,n,o),s=!0,l="hsv"):ar(i.h)&&ar(i.s)&&ar(i.l)&&(n=Ng(i.s),r=Ng(i.l),t=I7(i.h,n,r),s=!0,l="hsl"),Object.prototype.hasOwnProperty.call(i,"a")&&(e=i.a)),e=k7(e),{ok:s,format:i.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:e}}var W7="[-\\+]?\\d+%?",N7="[-\\+]?\\d*\\.\\d+%?",Wr="(?:".concat(N7,")|(?:").concat(W7,")"),bv="[\\s|\\(]+(".concat(Wr,")[,|\\s]+(").concat(Wr,")[,|\\s]+(").concat(Wr,")\\s*\\)?"),Cv="[\\s|\\(]+(".concat(Wr,")[,|\\s]+(").concat(Wr,")[,|\\s]+(").concat(Wr,")[,|\\s]+(").concat(Wr,")\\s*\\)?"),co={CSS_UNIT:new RegExp(Wr),rgb:new RegExp("rgb"+bv),rgba:new RegExp("rgba"+Cv),hsl:new RegExp("hsl"+bv),hsla:new RegExp("hsla"+Cv),hsv:new RegExp("hsv"+bv),hsva:new RegExp("hsva"+Cv),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function V7(i){if(i=i.trim().toLowerCase(),i.length===0)return!1;var t=!1;if(FT[i])i=FT[i],t=!0;else if(i==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var e=co.rgb.exec(i);return e?{r:e[1],g:e[2],b:e[3]}:(e=co.rgba.exec(i),e?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=co.hsl.exec(i),e?{h:e[1],s:e[2],l:e[3]}:(e=co.hsla.exec(i),e?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=co.hsv.exec(i),e?{h:e[1],s:e[2],v:e[3]}:(e=co.hsva.exec(i),e?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=co.hex8.exec(i),e?{r:_n(e[1]),g:_n(e[2]),b:_n(e[3]),a:kT(e[4]),format:t?"name":"hex8"}:(e=co.hex6.exec(i),e?{r:_n(e[1]),g:_n(e[2]),b:_n(e[3]),format:t?"name":"hex"}:(e=co.hex4.exec(i),e?{r:_n(e[1]+e[1]),g:_n(e[2]+e[2]),b:_n(e[3]+e[3]),a:kT(e[4]+e[4]),format:t?"name":"hex8"}:(e=co.hex3.exec(i),e?{r:_n(e[1]+e[1]),g:_n(e[2]+e[2]),b:_n(e[3]+e[3]),format:t?"name":"hex"}:!1)))))))))}function ar(i){return!!co.CSS_UNIT.exec(String(i))}var Vg=2,IT=.16,j7=.05,$7=.05,G7=.15,DT=5,OT=4,U7=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function zT(i){var t=i.r,e=i.g,n=i.b,o=D7(t,e,n);return{h:o.h*360,s:o.s,v:o.v}}function jg(i){var t=i.r,e=i.g,n=i.b;return"#".concat(z7(t,e,n,!1))}function K7(i,t,e){var n=e/100,o={r:(t.r-i.r)*n+i.r,g:(t.g-i.g)*n+i.g,b:(t.b-i.b)*n+i.b};return o}function WT(i,t,e){var n;return Math.round(i.h)>=60&&Math.round(i.h)<=240?n=e?Math.round(i.h)-Vg*t:Math.round(i.h)+Vg*t:n=e?Math.round(i.h)+Vg*t:Math.round(i.h)-Vg*t,n<0?n+=360:n>=360&&(n-=360),n}function NT(i,t,e){if(i.h===0&&i.s===0)return i.s;var n;return e?n=i.s-IT*t:t===OT?n=i.s+IT:n=i.s+j7*t,n>1&&(n=1),e&&t===DT&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2))}function VT(i,t,e){var n;return e?n=i.v+$7*t:n=i.v-G7*t,n>1&&(n=1),Number(n.toFixed(2))}function yv(i){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=[],n=Dh(i),o=DT;o>0;o-=1){var r=zT(n),s=jg(Dh({h:WT(r,o,!0),s:NT(r,o,!0),v:VT(r,o,!0)}));e.push(s)}e.push(jg(n));for(var l=1;l<=OT;l+=1){var a=zT(n),h=jg(Dh({h:WT(a,l),s:NT(a,l),v:VT(a,l)}));e.push(h)}return t.theme==="dark"?U7.map(function(d){var u=d.index,c=d.opacity,g=jg(K7(Dh(t.backgroundColor||"#141414"),Dh(e[u]),c*100));return g}):e}var _v={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},wv={},Sv={};Object.keys(_v).forEach(function(i){wv[i]=yv(_v[i]),wv[i].primary=wv[i][5],Sv[i]=yv(_v[i],{theme:"dark",backgroundColor:"#141414"}),Sv[i].primary=Sv[i][5]});var jT=[],Oh=[],Y7="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function X7(){var i=document.createElement("style");return i.setAttribute("type","text/css"),i}function q7(i,t){if(t=t||{},i===void 0)throw new Error(Y7);var e=t.prepend===!0?"prepend":"append",n=t.container!==void 0?t.container:document.querySelector("head"),o=jT.indexOf(n);o===-1&&(o=jT.push(n)-1,Oh[o]={});var r;return Oh[o]!==void 0&&Oh[o][e]!==void 0?r=Oh[o][e]:(r=Oh[o][e]=X7(),e==="prepend"?n.insertBefore(r,n.childNodes[0]):n.appendChild(r)),i.charCodeAt(0)===65279&&(i=i.substr(1,i.length)),r.styleSheet?r.styleSheet.cssText+=i:r.textContent+=i,r}function $T(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){Z7(i,o,e[o])})}return i}function Z7(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}function J7(i,t){process.env.NODE_ENV!=="production"&&!i&&console!==void 0&&console.error("Warning: ".concat(t))}function Q7(i,t){J7(i,"[@ant-design/icons-vue] ".concat(t))}function GT(i){return typeof i=="object"&&typeof i.name=="string"&&typeof i.theme=="string"&&(typeof i.icon=="object"||typeof i.icon=="function")}function xv(i,t,e){return e?v.h(i.tag,$T({key:t},e,i.attrs),(i.children||[]).map(function(n,o){return xv(n,"".concat(t,"-").concat(i.tag,"-").concat(o))})):v.h(i.tag,$T({key:t},i.attrs),(i.children||[]).map(function(n,o){return xv(n,"".concat(t,"-").concat(i.tag,"-").concat(o))}))}function UT(i){return yv(i)[0]}function KT(i){return i?Array.isArray(i)?i:[i]:[]}var tj=`
310
310
  .anticon {
311
311
  display: inline-block;
312
312
  color: inherit;
@@ -364,11 +364,11 @@
364
364
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dj(i,t){if(i){if(typeof i=="string")return XT(i,t);var e=Object.prototype.toString.call(i).slice(8,-1);if(e==="Object"&&i.constructor&&(e=i.constructor.name),e==="Map"||e==="Set")return Array.from(i);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return XT(i,t)}}function XT(i,t){(t==null||t>i.length)&&(t=i.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=i[e];return n}function uj(i,t){var e=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(e!=null){var n=[],o=!0,r=!1,s,l;try{for(e=e.call(i);!(o=(s=e.next()).done)&&(n.push(s.value),!(t&&n.length===t));o=!0);}catch(a){r=!0,l=a}finally{try{!o&&e.return!=null&&e.return()}finally{if(r)throw l}}return n}}function cj(i){if(Array.isArray(i))return i}function qT(i){var t=KT(i),e=aj(t,2),n=e[0],o=e[1];return Rv.setTwoToneColors({primaryColor:n,secondaryColor:o})}function gj(){var i=Rv.getTwoToneColors();return i.calculated?[i.primaryColor,i.secondaryColor]:i.primaryColor}var fj=["class","icon","spin","rotate","tabindex","twoToneColor","onClick"];function pj(i,t){return Cj(i)||bj(i,t)||vj(i,t)||mj()}function mj(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
365
365
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vj(i,t){if(i){if(typeof i=="string")return ZT(i,t);var e=Object.prototype.toString.call(i).slice(8,-1);if(e==="Object"&&i.constructor&&(e=i.constructor.name),e==="Map"||e==="Set")return Array.from(i);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return ZT(i,t)}}function ZT(i,t){(t==null||t>i.length)&&(t=i.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=i[e];return n}function bj(i,t){var e=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(e!=null){var n=[],o=!0,r=!1,s,l;try{for(e=e.call(i);!(o=(s=e.next()).done)&&(n.push(s.value),!(t&&n.length===t));o=!0);}catch(a){r=!0,l=a}finally{try{!o&&e.return!=null&&e.return()}finally{if(r)throw l}}return n}}function Cj(i){if(Array.isArray(i))return i}function JT(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){Av(i,o,e[o])})}return i}function Av(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}function yj(i,t){if(i==null)return{};var e=_j(i,t),n,o;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);for(o=0;o<r.length;o++)n=r[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(i,n)&&(e[n]=i[n])}return e}function _j(i,t){if(i==null)return{};var e={},n=Object.keys(i),o,r;for(r=0;r<n.length;r++)o=n[r],!(t.indexOf(o)>=0)&&(e[o]=i[o]);return e}qT("#1890ff");var Ol=function(t,e){var n,o=JT({},t,e.attrs),r=o.class,s=o.icon,l=o.spin,a=o.rotate,h=o.tabindex,d=o.twoToneColor,u=o.onClick,c=yj(o,fj),g=(n={anticon:!0},Av(n,"anticon-".concat(s.name),!!s.name),Av(n,r,r),n),f=l===""||l||s.name==="loading"?"anticon-spin":"",p=h;p===void 0&&u&&(p=-1,c.tabindex=p);var m=a?{msTransform:"rotate(".concat(a,"deg)"),transform:"rotate(".concat(a,"deg)")}:void 0,b=KT(d),C=pj(b,2),_=C[0],w=C[1];return v.createVNode("span",JT({role:"img","aria-label":s.name},c,{onClick:u,class:g}),[v.createVNode(Rv,{class:f,icon:s,primaryColor:_,secondaryColor:w,style:m},null)])};Ol.props={spin:Boolean,rotate:Number,icon:Object,twoToneColor:String},Ol.displayName="AntdIcon",Ol.inheritAttrs=!1,Ol.getTwoToneColor=gj,Ol.setTwoToneColor=qT;const fi=Ol;var wj={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M855 160.1l-189.2 23.5c-6.6.8-9.3 8.8-4.7 13.5l54.7 54.7-153.5 153.5a8.03 8.03 0 000 11.3l45.1 45.1c3.1 3.1 8.2 3.1 11.3 0l153.6-153.6 54.7 54.7a7.94 7.94 0 0013.5-4.7L863.9 169a7.9 7.9 0 00-8.9-8.9zM416.6 562.3a8.03 8.03 0 00-11.3 0L251.8 715.9l-54.7-54.7a7.94 7.94 0 00-13.5 4.7L160.1 855c-.6 5.2 3.7 9.5 8.9 8.9l189.2-23.5c6.6-.8 9.3-8.8 4.7-13.5l-54.7-54.7 153.6-153.6c3.1-3.1 3.1-8.2 0-11.3l-45.2-45z"}}]},name:"arrows-alt",theme:"outlined"};const Sj=wj;function QT(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){xj(i,o,e[o])})}return i}function xj(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Tv=function(t,e){var n=QT({},t,e.attrs);return v.createVNode(fi,QT({},n,{icon:Sj}),null)};Tv.displayName="ArrowsAltOutlined",Tv.inheritAttrs=!1;const Rj=Tv;var Aj={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"border",theme:"outlined"};const Tj=Aj;function tM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){Mj(i,o,e[o])})}return i}function Mj(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Mv=function(t,e){var n=tM({},t,e.attrs);return v.createVNode(fi,tM({},n,{icon:Tj}),null)};Mv.displayName="BorderOutlined",Mv.inheritAttrs=!1;const Bj=Mv;var Pj={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"outlined"};const Hj=Pj;function eM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){Ej(i,o,e[o])})}return i}function Ej(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Bv=function(t,e){var n=eM({},t,e.attrs);return v.createVNode(fi,eM({},n,{icon:Hj}),null)};Bv.displayName="CaretDownOutlined",Bv.inheritAttrs=!1;const Lj=Bv;var kj={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M715.8 493.5L335 165.1c-14.2-12.2-35-1.2-35 18.5v656.8c0 19.7 20.8 30.7 35 18.5l380.8-328.4c10.9-9.4 10.9-27.6 0-37z"}}]},name:"caret-right",theme:"outlined"};const Fj=kj;function iM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){Ij(i,o,e[o])})}return i}function Ij(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Pv=function(t,e){var n=iM({},t,e.attrs);return v.createVNode(fi,iM({},n,{icon:Fj}),null)};Pv.displayName="CaretRightOutlined",Pv.inheritAttrs=!1;const Dj=Pv;var Oj={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6a25.95 25.95 0 0025.6 30.4h723c1.5 0 3-.1 4.4-.4a25.88 25.88 0 0021.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"}}]},name:"clear",theme:"outlined"};const zj=Oj;function nM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){Wj(i,o,e[o])})}return i}function Wj(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Hv=function(t,e){var n=nM({},t,e.attrs);return v.createVNode(fi,nM({},n,{icon:zj}),null)};Hv.displayName="ClearOutlined",Hv.inheritAttrs=!1;const Nj=Hv;var Vj={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"};const jj=Vj;function oM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){$j(i,o,e[o])})}return i}function $j(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Ev=function(t,e){var n=oM({},t,e.attrs);return v.createVNode(fi,oM({},n,{icon:jj}),null)};Ev.displayName="CloseOutlined",Ev.inheritAttrs=!1;const Gj=Ev;var Uj={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"};const Kj=Uj;function rM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){Yj(i,o,e[o])})}return i}function Yj(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Lv=function(t,e){var n=rM({},t,e.attrs);return v.createVNode(fi,rM({},n,{icon:Kj}),null)};Lv.displayName="DatabaseOutlined",Lv.inheritAttrs=!1;const Xj=Lv;var qj={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"};const Zj=qj;function sM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){Jj(i,o,e[o])})}return i}function Jj(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var kv=function(t,e){var n=sM({},t,e.attrs);return v.createVNode(fi,sM({},n,{icon:Zj}),null)};kv.displayName="DeleteOutlined",kv.inheritAttrs=!1;const lM=kv;var Qj={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z"}}]},name:"filter",theme:"outlined"};const t$=Qj;function aM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){e$(i,o,e[o])})}return i}function e$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Fv=function(t,e){var n=aM({},t,e.attrs);return v.createVNode(fi,aM({},n,{icon:t$}),null)};Fv.displayName="FilterOutlined",Fv.inheritAttrs=!1;const hM=Fv;var i$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M904 512h-56c-4.4 0-8 3.6-8 8v320H184V184h320c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V520c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M355.9 534.9L354 653.8c-.1 8.9 7.1 16.2 16 16.2h.4l118-2.9c2-.1 4-.9 5.4-2.3l415.9-415c3.1-3.1 3.1-8.2 0-11.3L785.4 114.3c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-415.8 415a8.3 8.3 0 00-2.3 5.6zm63.5 23.6L779.7 199l45.2 45.1-360.5 359.7-45.7 1.1.7-46.4z"}}]},name:"form",theme:"outlined"};const n$=i$;function dM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){o$(i,o,e[o])})}return i}function o$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Iv=function(t,e){var n=dM({},t,e.attrs);return v.createVNode(fi,dM({},n,{icon:n$}),null)};Iv.displayName="FormOutlined",Iv.inheritAttrs=!1;const uM=Iv;var r$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M878.7 336H145.3c-18.4 0-33.3 14.3-33.3 32v464c0 17.7 14.9 32 33.3 32h733.3c18.4 0 33.3-14.3 33.3-32V368c.1-17.7-14.8-32-33.2-32zM360 792H184V632h176v160zm0-224H184V408h176v160zm240 224H424V632h176v160zm0-224H424V408h176v160zm240 224H664V632h176v160zm0-224H664V408h176v160zm64-408H120c-4.4 0-8 3.6-8 8v80c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-80c0-4.4-3.6-8-8-8z"}}]},name:"insert-row-above",theme:"outlined"};const s$=r$;function cM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){l$(i,o,e[o])})}return i}function l$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Dv=function(t,e){var n=cM({},t,e.attrs);return v.createVNode(fi,cM({},n,{icon:s$}),null)};Dv.displayName="InsertRowAboveOutlined",Dv.inheritAttrs=!1;const a$=Dv;var h$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M248 112h-80c-4.4 0-8 3.6-8 8v784c0 4.4 3.6 8 8 8h80c4.4 0 8-3.6 8-8V120c0-4.4-3.6-8-8-8zm584 0H368c-17.7 0-32 14.9-32 33.3v733.3c0 18.4 14.3 33.3 32 33.3h464c17.7 0 32-14.9 32-33.3V145.3c0-18.4-14.3-33.3-32-33.3zM568 840H408V664h160v176zm0-240H408V424h160v176zm0-240H408V184h160v176zm224 480H632V664h160v176zm0-240H632V424h160v176zm0-240H632V184h160v176z"}}]},name:"insert-row-left",theme:"outlined"};const d$=h$;function gM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){u$(i,o,e[o])})}return i}function u$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Ov=function(t,e){var n=gM({},t,e.attrs);return v.createVNode(fi,gM({},n,{icon:d$}),null)};Ov.displayName="InsertRowLeftOutlined",Ov.inheritAttrs=!1;const c$=Ov;var g$={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"};const f$=g$;function fM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){p$(i,o,e[o])})}return i}function p$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var zv=function(t,e){var n=fM({},t,e.attrs);return v.createVNode(fi,fM({},n,{icon:f$}),null)};zv.displayName="LoadingOutlined",zv.inheritAttrs=!1;const m$=zv;var v$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"minus-circle",theme:"outlined"};const b$=v$;function pM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){C$(i,o,e[o])})}return i}function C$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Wv=function(t,e){var n=pM({},t,e.attrs);return v.createVNode(fi,pM({},n,{icon:b$}),null)};Wv.displayName="MinusCircleOutlined",Wv.inheritAttrs=!1;const mM=Wv;var y$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"};const _$=y$;function vM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){w$(i,o,e[o])})}return i}function w$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Nv=function(t,e){var n=vM({},t,e.attrs);return v.createVNode(fi,vM({},n,{icon:_$}),null)};Nv.displayName="MinusSquareOutlined",Nv.inheritAttrs=!1;const S$=Nv;var x$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"plus-circle",theme:"outlined"};const R$=x$;function bM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){A$(i,o,e[o])})}return i}function A$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Vv=function(t,e){var n=bM({},t,e.attrs);return v.createVNode(fi,bM({},n,{icon:R$}),null)};Vv.displayName="PlusCircleOutlined",Vv.inheritAttrs=!1;const CM=Vv;var T$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"};const M$=T$;function yM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){B$(i,o,e[o])})}return i}function B$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var jv=function(t,e){var n=yM({},t,e.attrs);return v.createVNode(fi,yM({},n,{icon:M$}),null)};jv.displayName="SettingOutlined",jv.inheritAttrs=!1;const P$=jv;var H$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M881.7 187.4l-45.1-45.1a8.03 8.03 0 00-11.3 0L667.8 299.9l-54.7-54.7a7.94 7.94 0 00-13.5 4.7L576.1 439c-.6 5.2 3.7 9.5 8.9 8.9l189.2-23.5c6.6-.8 9.3-8.8 4.7-13.5l-54.7-54.7 157.6-157.6c3-3 3-8.1-.1-11.2zM439 576.1l-189.2 23.5c-6.6.8-9.3 8.9-4.7 13.5l54.7 54.7-157.5 157.5a8.03 8.03 0 000 11.3l45.1 45.1c3.1 3.1 8.2 3.1 11.3 0l157.6-157.6 54.7 54.7a7.94 7.94 0 0013.5-4.7L447.9 585a7.9 7.9 0 00-8.9-8.9z"}}]},name:"shrink",theme:"outlined"};const E$=H$;function _M(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){L$(i,o,e[o])})}return i}function L$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var $v=function(t,e){var n=_M({},t,e.attrs);return v.createVNode(fi,_M({},n,{icon:E$}),null)};$v.displayName="ShrinkOutlined",$v.inheritAttrs=!1;const k$=$v;var F$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M320 224h-66v-56c0-4.4-3.6-8-8-8h-52c-4.4 0-8 3.6-8 8v56h-66c-4.4 0-8 3.6-8 8v560c0 4.4 3.6 8 8 8h66v56c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8v-56h66c4.4 0 8-3.6 8-8V232c0-4.4-3.6-8-8-8zm-60 508h-80V292h80v440zm644-436h-66v-96c0-4.4-3.6-8-8-8h-52c-4.4 0-8 3.6-8 8v96h-66c-4.4 0-8 3.6-8 8v416c0 4.4 3.6 8 8 8h66v96c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8v-96h66c4.4 0 8-3.6 8-8V304c0-4.4-3.6-8-8-8zm-60 364h-80V364h80v296zM612 404h-66V232c0-4.4-3.6-8-8-8h-52c-4.4 0-8 3.6-8 8v172h-66c-4.4 0-8 3.6-8 8v200c0 4.4 3.6 8 8 8h66v172c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8V620h66c4.4 0 8-3.6 8-8V412c0-4.4-3.6-8-8-8zm-60 145a3 3 0 01-3 3h-74a3 3 0 01-3-3v-74a3 3 0 013-3h74a3 3 0 013 3v74z"}}]},name:"sliders",theme:"outlined"};const I$=F$;function wM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){D$(i,o,e[o])})}return i}function D$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Gv=function(t,e){var n=wM({},t,e.attrs);return v.createVNode(fi,wM({},n,{icon:I$}),null)};Gv.displayName="SlidersOutlined",Gv.inheritAttrs=!1;const O$=Gv;var z$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M752 240H144c-17.7 0-32 14.3-32 32v608c0 17.7 14.3 32 32 32h608c17.7 0 32-14.3 32-32V272c0-17.7-14.3-32-32-32zm-40 600H184V312h528v528zm168-728H264c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h576v576c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V144c0-17.7-14.3-32-32-32zM300 550h296v64H300z"}}]},name:"switcher",theme:"outlined"};const W$=z$;function SM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){N$(i,o,e[o])})}return i}function N$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Uv=function(t,e){var n=SM({},t,e.attrs);return v.createVNode(fi,SM({},n,{icon:W$}),null)};Uv.displayName="SwitcherOutlined",Uv.inheritAttrs=!1;const V$=Uv,TX="",j$=v.defineComponent({name:"ConditionalItemConfig",components:{PlusCircleOutlined:CM,FormOutlined:uM,MinusCircleOutlined:mM},props:{config:{type:Array,default(){return[]}}},setup(i,{emit:t}){const e=v.ref("add"),n=v.ref(!1),o=v.ref(-1),r=v.inject("getContainer",()=>{}),s=v.inject("theme","light");v.watch(o,()=>{t("change",v.unref(o))});const l=v.ref("");function a(){e.value="add",l.value="",n.value=!0}function h(){if(v.unref(o)===-1){ji.message.info("请选择要修改的条件项");return}e.value="edit",l.value=i.config[v.unref(o)].name,n.value=!0}function d(){if(v.unref(o)===-1){ji.message.info("请选择要删除的条件项");return}i.config.splice(v.unref(o),1),o.value=-1}function u(){v.unref(e)==="add"?i.config.push({name:v.unref(l),conditions:[]}):i.config[v.unref(o)].name=v.unref(l),n.value=!1}const c=v.computed(()=>v.unref(s)==="darkBlue"?"#b2c3dd":"");return v.watch(n,g=>{g&&window.modalShow&&window.modalShow(g)}),{theme:s,modalType:e,visible:n,selectedIndex:o,addItem:a,name:l,handleOk:u,editItem:h,deleteItem:d,fontColor:c,getContainer:r}}}),$$={class:"content"},G$={style:{display:"flex","align-items":"center"}},U$={class:"list"},K$=["onClick"];function Y$(i,t,e,n,o,r){const s=v.resolveComponent("plus-circle-outlined"),l=v.resolveComponent("a-button"),a=v.resolveComponent("form-outlined"),h=v.resolveComponent("minus-circle-outlined"),d=v.resolveComponent("a-input"),u=v.resolveComponent("a-form-item"),c=v.resolveComponent("a-form"),g=v.resolveComponent("a-modal");return v.openBlock(),v.createElementBlock(v.Fragment,null,[v.createElementVNode("div",$$,[v.createElementVNode("div",G$,[v.createElementVNode("div",{style:v.normalizeStyle({color:i.fontColor})},"条件项配置",4),v.createElementVNode("div",null,[v.createVNode(l,{class:"condition-button",onClick:i.addItem},{default:v.withCtx(()=>[v.createVNode(s,{class:"add-icon"})]),_:1},8,["onClick"]),v.createVNode(l,{class:"condition-button",onClick:i.editItem},{default:v.withCtx(()=>[v.createVNode(a,{class:"edit-icon"})]),_:1},8,["onClick"]),v.createVNode(l,{class:"condition-button",onClick:i.deleteItem},{default:v.withCtx(()=>[v.createVNode(h,{class:"delete-icon"})]),_:1},8,["onClick"])])]),v.createElementVNode("div",U$,[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.config,(f,p)=>(v.openBlock(),v.createElementBlock("div",{class:v.normalizeClass(["list-item",i.selectedIndex===p?"active":""]),key:p,onClick:m=>i.selectedIndex=p,style:v.normalizeStyle({color:i.fontColor})},v.toDisplayString(f.name),15,K$))),128))])]),v.createVNode(g,{wrapClassName:i.theme,visible:i.visible,"onUpdate:visible":t[1]||(t[1]=f=>i.visible=f),title:i.modalType==="add"?"添加条件项":"修改条件项","ok-text":"确认","cancel-text":"取消",destroyOnClose:!1,getContainer:i.getContainer,onOk:i.handleOk},{default:v.withCtx(()=>[v.createVNode(c,{name:"conditionItem"},{default:v.withCtx(()=>[v.createVNode(u,{label:"条件项名称"},{default:v.withCtx(()=>[v.createVNode(d,{value:i.name,"onUpdate:value":t[0]||(t[0]=f=>i.name=f)},null,8,["value"])]),_:1})]),_:1})]),_:1},8,["wrapClassName","visible","title","getContainer","onOk"])],64)}const X$=Ti(j$,[["render",Y$],["__scopeId","data-v-1b06e44c"]]),MX="",BX="",q$=v.defineComponent({name:"ConditionalConfig",components:{PlusCircleOutlined:CM,FormOutlined:uM,MinusCircleOutlined:mM},props:{config:{type:Array,default(){return[]}},isSelected:{type:Boolean}},setup(i){const t=v.ref("add"),e=v.ref(!1),n=v.ref(-1),o=v.ref({}),r=v.ref(!1),s=v.ref(),l=v.ref(),a=v.ref(),h=v.ref({}),d=v.inject("theme","light"),u=v.inject("getContainer",()=>{}),c=v.inject("scaleValue",{}),g=v.computed(()=>R=>{const x=`当前值 ${R.operation} ${R.value}`;return R.join?`${R.join} ${x}`:x});v.watch(()=>i.config,()=>{n.value=-1});const f=[{label:"与",value:"and"},{label:"或",value:"or"}],p=[{label:"大于",value:">"},{label:"大于等于",value:">="},{label:"小于",value:"<"},{label:"小于等于",value:"<="},{label:"等于",value:"=="},{label:"不等于",value:"!="}],m={operation:[{required:!0,message:"操作符不能为空"}],value:[{required:!0,message:"值不能为空"}]};function b(){t.value="add",r.value=i.config.length>0,v.unref(r)?o.value={join:"and",operation:"",value:""}:o.value={operation:"",value:""},e.value=!0}function C(){if(v.unref(n)===-1){ji.message.info("请选择要修改的条件配置");return}t.value="edit",r.value=v.unref(n)!==0,o.value=i.config[v.unref(n)],e.value=!0}function _(){if(v.unref(n)===-1){ji.message.info("请选择要删除的条件配置");return}i.config.splice(v.unref(n),1),n.value=-1}function w(){v.unref(s).validateFields().then(()=>{v.unref(t)==="add"?i.config.push(v.unref(o)):i.config[v.unref(n)]=v.unref(o),e.value=!1}).catch(()=>{})}const y=v.computed(()=>i.theme==="darkBlue"?"#b2c3dd":""),S=()=>document.getElementsByClassName("update-config-modal")[0]||document.body,A=(R,x="")=>{var T,M,B,P;if(R){let F=(T=v.unref(l))==null?void 0:T.getBoundingClientRect();if(x==="join"&&(F=(M=v.unref(a))==null?void 0:M.getBoundingClientRect()),F){const H=F.left/(((B=v.unref(c))==null?void 0:B.widthScale)||1)+"px",E=(F.top+F.height)/(((P=v.unref(c))==null?void 0:P.heightScale)||1)+"px";setTimeout(()=>{var L,D;const k=document.querySelectorAll(".ant-select-dropdown"),I=Array.from(k).filter(O=>window.getComputedStyle(O).display!=="none");if(I!=null&&I.length){let O="update-config-select-dropdown";x==="join"&&(O="update-config-join-select-dropdown");const N=document.getElementsByClassName("update-config-modal")[0];I[0].classList.remove("update-config-select-dropdown"),I[0].classList.remove("update-config-join-select-dropdown"),I[0].classList.add(O),(L=N==null?void 0:N.style)==null||L.setProperty(`--${x?x+"-":""}drop-down-left`,H),(D=N==null?void 0:N.style)==null||D.setProperty(`--${x?x+"-":""}drop-down-top`,E),h.value={visibility:"visible"}}},200)}}else h.value={}};return v.watch(e,R=>{R&&window.modalShow&&window.modalShow(R)}),{theme:d,modalType:t,visible:e,selectedIndex:n,addItem:b,handleOk:w,editItem:C,deleteItem:_,operateOptions:p,formData:o,joinOptions:f,isShowJoin:r,formRules:m,formRef:s,conditionTitle:g,fontColor:y,dropdownStyle:h,selectRef:l,joinSelectRef:a,getPopupContainer:S,getContainer:u,dropdownVisibleChange:A}}}),Z$={class:"content"},J$={style:{display:"flex","align-items":"center"}},Q$={class:"list"},tG=["onClick"],eG={ref:"joinSelectRef"},iG={ref:"selectRef"};function nG(i,t,e,n,o,r){const s=v.resolveComponent("plus-circle-outlined"),l=v.resolveComponent("a-button"),a=v.resolveComponent("form-outlined"),h=v.resolveComponent("minus-circle-outlined"),d=v.resolveComponent("a-select"),u=v.resolveComponent("a-form-item"),c=v.resolveComponent("a-input"),g=v.resolveComponent("a-form"),f=v.resolveComponent("a-modal");return v.openBlock(),v.createElementBlock(v.Fragment,null,[v.createElementVNode("div",Z$,[v.createElementVNode("div",J$,[v.createElementVNode("div",{style:v.normalizeStyle({color:i.fontColor})},"条件配置",4),v.createElementVNode("div",null,[v.createVNode(l,{class:"condition-button",onClick:i.addItem,disabled:!i.isSelected},{default:v.withCtx(()=>[v.createVNode(s,{class:"add-icon"})]),_:1},8,["onClick","disabled"]),v.createVNode(l,{class:"condition-button",onClick:i.editItem,disabled:!i.isSelected},{default:v.withCtx(()=>[v.createVNode(a,{class:"edit-icon"})]),_:1},8,["onClick","disabled"]),v.createVNode(l,{class:"condition-button",onClick:i.deleteItem,disabled:!i.isSelected},{default:v.withCtx(()=>[v.createVNode(h,{class:"delete-icon"})]),_:1},8,["onClick","disabled"])])]),v.createElementVNode("div",Q$,[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.config,(p,m)=>(v.openBlock(),v.createElementBlock("div",{class:v.normalizeClass(["list-item",i.selectedIndex===m?"active":""]),key:m,onClick:b=>i.selectedIndex=m,style:v.normalizeStyle({color:i.fontColor})},v.toDisplayString(i.conditionTitle(p)),15,tG))),128))])]),v.createVNode(f,{wrapClassName:i.theme+" update-config-modal",visible:i.visible,"onUpdate:visible":t[4]||(t[4]=p=>i.visible=p),title:i.modalType==="add"?"添加条件配置":"修改条件配置","ok-text":"确认","cancel-text":"取消",destroyOnClose:!1,getContainer:i.getContainer,onOk:i.handleOk},{default:v.withCtx(()=>[v.createVNode(g,{model:i.formData,rules:i.formRules,ref:"formRef"},{default:v.withCtx(()=>[i.isShowJoin?(v.openBlock(),v.createBlock(u,{key:0,label:"与上一条件关系",name:"join",required:!0},{default:v.withCtx(()=>[v.createElementVNode("div",eG,[v.createVNode(d,{options:i.joinOptions,value:i.formData.join,"onUpdate:value":t[0]||(t[0]=p=>i.formData.join=p),dropdownClassName:"pivot-table-select-dropdown",getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:t[1]||(t[1]=p=>i.dropdownVisibleChange(p,"join"))},null,8,["options","value","getPopupContainer","dropdownStyle"])],512)]),_:1})):v.createCommentVNode("",!0),v.createVNode(u,{label:"操作符",name:"operation",required:!0},{default:v.withCtx(()=>[v.createElementVNode("div",iG,[v.createVNode(d,{options:i.operateOptions,value:i.formData.operation,"onUpdate:value":t[2]||(t[2]=p=>i.formData.operation=p),dropdownClassName:"pivot-table-select-dropdown",getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:i.dropdownVisibleChange},null,8,["options","value","getPopupContainer","dropdownStyle","onDropdownVisibleChange"])],512)]),_:1}),v.createVNode(u,{label:"值",name:"value",required:!0},{default:v.withCtx(()=>[v.createVNode(c,{type:"number",value:i.formData.value,"onUpdate:value":t[3]||(t[3]=p=>i.formData.value=p),style:{width:"100%"}},null,8,["value"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["wrapClassName","visible","title","getContainer","onOk"])],64)}const oG=Ti(q$,[["render",nG],["__scopeId","data-v-580c2bff"]]);var rn="top",jn="bottom",$n="right",sn="left",Kv="auto",Wh=[rn,jn,$n,sn],zl="start",Nh="end",rG="clippingParents",xM="viewport",Vh="popper",sG="reference",RM=Wh.reduce(function(i,t){return i.concat([t+"-"+zl,t+"-"+Nh])},[]),AM=[].concat(Wh,[Kv]).reduce(function(i,t){return i.concat([t,t+"-"+zl,t+"-"+Nh])},[]),lG="beforeRead",aG="read",hG="afterRead",dG="beforeMain",uG="main",cG="afterMain",gG="beforeWrite",fG="write",pG="afterWrite",mG=[lG,aG,hG,dG,uG,cG,gG,fG,pG];function Ao(i){return i?(i.nodeName||"").toLowerCase():null}function wn(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var t=i.ownerDocument;return t&&t.defaultView||window}return i}function Bs(i){var t=wn(i).Element;return i instanceof t||i instanceof Element}function Gn(i){var t=wn(i).HTMLElement;return i instanceof t||i instanceof HTMLElement}function Yv(i){if(typeof ShadowRoot>"u")return!1;var t=wn(i).ShadowRoot;return i instanceof t||i instanceof ShadowRoot}function vG(i){var t=i.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},o=t.attributes[e]||{},r=t.elements[e];!Gn(r)||!Ao(r)||(Object.assign(r.style,n),Object.keys(o).forEach(function(s){var l=o[s];l===!1?r.removeAttribute(s):r.setAttribute(s,l===!0?"":l)}))})}function bG(i){var t=i.state,e={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,e.popper),t.styles=e,t.elements.arrow&&Object.assign(t.elements.arrow.style,e.arrow),function(){Object.keys(t.elements).forEach(function(n){var o=t.elements[n],r=t.attributes[n]||{},s=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:e[n]),l=s.reduce(function(a,h){return a[h]="",a},{});!Gn(o)||!Ao(o)||(Object.assign(o.style,l),Object.keys(r).forEach(function(a){o.removeAttribute(a)}))})}}const CG={name:"applyStyles",enabled:!0,phase:"write",fn:vG,effect:bG,requires:["computeStyles"]};function To(i){return i.split("-")[0]}var Ps=Math.max,Gg=Math.min,Wl=Math.round;function Xv(){var i=navigator.userAgentData;return i!=null&&i.brands&&Array.isArray(i.brands)?i.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function TM(){return!/^((?!chrome|android).)*safari/i.test(Xv())}function Nl(i,t,e){t===void 0&&(t=!1),e===void 0&&(e=!1);var n=i.getBoundingClientRect(),o=1,r=1;t&&Gn(i)&&(o=i.offsetWidth>0&&Wl(n.width)/i.offsetWidth||1,r=i.offsetHeight>0&&Wl(n.height)/i.offsetHeight||1);var s=Bs(i)?wn(i):window,l=s.visualViewport,a=!TM()&&e,h=(n.left+(a&&l?l.offsetLeft:0))/o,d=(n.top+(a&&l?l.offsetTop:0))/r,u=n.width/o,c=n.height/r;return{width:u,height:c,top:d,right:h+u,bottom:d+c,left:h,x:h,y:d}}function qv(i){var t=Nl(i),e=i.offsetWidth,n=i.offsetHeight;return Math.abs(t.width-e)<=1&&(e=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:i.offsetLeft,y:i.offsetTop,width:e,height:n}}function MM(i,t){var e=t.getRootNode&&t.getRootNode();if(i.contains(t))return!0;if(e&&Yv(e)){var n=t;do{if(n&&i.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function hr(i){return wn(i).getComputedStyle(i)}function yG(i){return["table","td","th"].indexOf(Ao(i))>=0}function Nr(i){return((Bs(i)?i.ownerDocument:i.document)||window.document).documentElement}function Ug(i){return Ao(i)==="html"?i:i.assignedSlot||i.parentNode||(Yv(i)?i.host:null)||Nr(i)}function BM(i){return!Gn(i)||hr(i).position==="fixed"?null:i.offsetParent}function _G(i){var t=/firefox/i.test(Xv()),e=/Trident/i.test(Xv());if(e&&Gn(i)){var n=hr(i);if(n.position==="fixed")return null}var o=Ug(i);for(Yv(o)&&(o=o.host);Gn(o)&&["html","body"].indexOf(Ao(o))<0;){var r=hr(o);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return o;o=o.parentNode}return null}function jh(i){for(var t=wn(i),e=BM(i);e&&yG(e)&&hr(e).position==="static";)e=BM(e);return e&&(Ao(e)==="html"||Ao(e)==="body"&&hr(e).position==="static")?t:e||_G(i)||t}function Zv(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function $h(i,t,e){return Ps(i,Gg(t,e))}function wG(i,t,e){var n=$h(i,t,e);return n>e?e:n}function PM(){return{top:0,right:0,bottom:0,left:0}}function HM(i){return Object.assign({},PM(),i)}function EM(i,t){return t.reduce(function(e,n){return e[n]=i,e},{})}var SG=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,HM(typeof t!="number"?t:EM(t,Wh))};function xG(i){var t,e=i.state,n=i.name,o=i.options,r=e.elements.arrow,s=e.modifiersData.popperOffsets,l=To(e.placement),a=Zv(l),h=[sn,$n].indexOf(l)>=0,d=h?"height":"width";if(!(!r||!s)){var u=SG(o.padding,e),c=qv(r),g=a==="y"?rn:sn,f=a==="y"?jn:$n,p=e.rects.reference[d]+e.rects.reference[a]-s[a]-e.rects.popper[d],m=s[a]-e.rects.reference[a],b=jh(r),C=b?a==="y"?b.clientHeight||0:b.clientWidth||0:0,_=p/2-m/2,w=u[g],y=C-c[d]-u[f],S=C/2-c[d]/2+_,A=$h(w,S,y),R=a;e.modifiersData[n]=(t={},t[R]=A,t.centerOffset=A-S,t)}}function RG(i){var t=i.state,e=i.options,n=e.element,o=n===void 0?"[data-popper-arrow]":n;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||MM(t.elements.popper,o)&&(t.elements.arrow=o))}const AG={name:"arrow",enabled:!0,phase:"main",fn:xG,effect:RG,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Vl(i){return i.split("-")[1]}var TG={top:"auto",right:"auto",bottom:"auto",left:"auto"};function MG(i,t){var e=i.x,n=i.y,o=t.devicePixelRatio||1;return{x:Wl(e*o)/o||0,y:Wl(n*o)/o||0}}function LM(i){var t,e=i.popper,n=i.popperRect,o=i.placement,r=i.variation,s=i.offsets,l=i.position,a=i.gpuAcceleration,h=i.adaptive,d=i.roundOffsets,u=i.isFixed,c=s.x,g=c===void 0?0:c,f=s.y,p=f===void 0?0:f,m=typeof d=="function"?d({x:g,y:p}):{x:g,y:p};g=m.x,p=m.y;var b=s.hasOwnProperty("x"),C=s.hasOwnProperty("y"),_=sn,w=rn,y=window;if(h){var S=jh(e),A="clientHeight",R="clientWidth";if(S===wn(e)&&(S=Nr(e),hr(S).position!=="static"&&l==="absolute"&&(A="scrollHeight",R="scrollWidth")),S=S,o===rn||(o===sn||o===$n)&&r===Nh){w=jn;var x=u&&S===y&&y.visualViewport?y.visualViewport.height:S[A];p-=x-n.height,p*=a?1:-1}if(o===sn||(o===rn||o===jn)&&r===Nh){_=$n;var T=u&&S===y&&y.visualViewport?y.visualViewport.width:S[R];g-=T-n.width,g*=a?1:-1}}var M=Object.assign({position:l},h&&TG),B=d===!0?MG({x:g,y:p},wn(e)):{x:g,y:p};if(g=B.x,p=B.y,a){var P;return Object.assign({},M,(P={},P[w]=C?"0":"",P[_]=b?"0":"",P.transform=(y.devicePixelRatio||1)<=1?"translate("+g+"px, "+p+"px)":"translate3d("+g+"px, "+p+"px, 0)",P))}return Object.assign({},M,(t={},t[w]=C?p+"px":"",t[_]=b?g+"px":"",t.transform="",t))}function BG(i){var t=i.state,e=i.options,n=e.gpuAcceleration,o=n===void 0?!0:n,r=e.adaptive,s=r===void 0?!0:r,l=e.roundOffsets,a=l===void 0?!0:l,h={placement:To(t.placement),variation:Vl(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,LM(Object.assign({},h,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:a})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,LM(Object.assign({},h,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const PG={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:BG,data:{}};var Kg={passive:!0};function HG(i){var t=i.state,e=i.instance,n=i.options,o=n.scroll,r=o===void 0?!0:o,s=n.resize,l=s===void 0?!0:s,a=wn(t.elements.popper),h=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&h.forEach(function(d){d.addEventListener("scroll",e.update,Kg)}),l&&a.addEventListener("resize",e.update,Kg),function(){r&&h.forEach(function(d){d.removeEventListener("scroll",e.update,Kg)}),l&&a.removeEventListener("resize",e.update,Kg)}}const EG={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:HG,data:{}};var LG={left:"right",right:"left",bottom:"top",top:"bottom"};function Yg(i){return i.replace(/left|right|bottom|top/g,function(t){return LG[t]})}var kG={start:"end",end:"start"};function kM(i){return i.replace(/start|end/g,function(t){return kG[t]})}function Jv(i){var t=wn(i),e=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:e,scrollTop:n}}function Qv(i){return Nl(Nr(i)).left+Jv(i).scrollLeft}function FG(i,t){var e=wn(i),n=Nr(i),o=e.visualViewport,r=n.clientWidth,s=n.clientHeight,l=0,a=0;if(o){r=o.width,s=o.height;var h=TM();(h||!h&&t==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}return{width:r,height:s,x:l+Qv(i),y:a}}function IG(i){var t,e=Nr(i),n=Jv(i),o=(t=i.ownerDocument)==null?void 0:t.body,r=Ps(e.scrollWidth,e.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=Ps(e.scrollHeight,e.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-n.scrollLeft+Qv(i),a=-n.scrollTop;return hr(o||e).direction==="rtl"&&(l+=Ps(e.clientWidth,o?o.clientWidth:0)-r),{width:r,height:s,x:l,y:a}}function tb(i){var t=hr(i),e=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(e+o+n)}function FM(i){return["html","body","#document"].indexOf(Ao(i))>=0?i.ownerDocument.body:Gn(i)&&tb(i)?i:FM(Ug(i))}function Gh(i,t){var e;t===void 0&&(t=[]);var n=FM(i),o=n===((e=i.ownerDocument)==null?void 0:e.body),r=wn(n),s=o?[r].concat(r.visualViewport||[],tb(n)?n:[]):n,l=t.concat(s);return o?l:l.concat(Gh(Ug(s)))}function eb(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function DG(i,t){var e=Nl(i,!1,t==="fixed");return e.top=e.top+i.clientTop,e.left=e.left+i.clientLeft,e.bottom=e.top+i.clientHeight,e.right=e.left+i.clientWidth,e.width=i.clientWidth,e.height=i.clientHeight,e.x=e.left,e.y=e.top,e}function IM(i,t,e){return t===xM?eb(FG(i,e)):Bs(t)?DG(t,e):eb(IG(Nr(i)))}function OG(i){var t=Gh(Ug(i)),e=["absolute","fixed"].indexOf(hr(i).position)>=0,n=e&&Gn(i)?jh(i):i;return Bs(n)?t.filter(function(o){return Bs(o)&&MM(o,n)&&Ao(o)!=="body"}):[]}function zG(i,t,e,n){var o=t==="clippingParents"?OG(i):[].concat(t),r=[].concat(o,[e]),s=r[0],l=r.reduce(function(a,h){var d=IM(i,h,n);return a.top=Ps(d.top,a.top),a.right=Gg(d.right,a.right),a.bottom=Gg(d.bottom,a.bottom),a.left=Ps(d.left,a.left),a},IM(i,s,n));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function DM(i){var t=i.reference,e=i.element,n=i.placement,o=n?To(n):null,r=n?Vl(n):null,s=t.x+t.width/2-e.width/2,l=t.y+t.height/2-e.height/2,a;switch(o){case rn:a={x:s,y:t.y-e.height};break;case jn:a={x:s,y:t.y+t.height};break;case $n:a={x:t.x+t.width,y:l};break;case sn:a={x:t.x-e.width,y:l};break;default:a={x:t.x,y:t.y}}var h=o?Zv(o):null;if(h!=null){var d=h==="y"?"height":"width";switch(r){case zl:a[h]=a[h]-(t[d]/2-e[d]/2);break;case Nh:a[h]=a[h]+(t[d]/2-e[d]/2);break}}return a}function Uh(i,t){t===void 0&&(t={});var e=t,n=e.placement,o=n===void 0?i.placement:n,r=e.strategy,s=r===void 0?i.strategy:r,l=e.boundary,a=l===void 0?rG:l,h=e.rootBoundary,d=h===void 0?xM:h,u=e.elementContext,c=u===void 0?Vh:u,g=e.altBoundary,f=g===void 0?!1:g,p=e.padding,m=p===void 0?0:p,b=HM(typeof m!="number"?m:EM(m,Wh)),C=c===Vh?sG:Vh,_=i.rects.popper,w=i.elements[f?C:c],y=zG(Bs(w)?w:w.contextElement||Nr(i.elements.popper),a,d,s),S=Nl(i.elements.reference),A=DM({reference:S,element:_,strategy:"absolute",placement:o}),R=eb(Object.assign({},_,A)),x=c===Vh?R:S,T={top:y.top-x.top+b.top,bottom:x.bottom-y.bottom+b.bottom,left:y.left-x.left+b.left,right:x.right-y.right+b.right},M=i.modifiersData.offset;if(c===Vh&&M){var B=M[o];Object.keys(T).forEach(function(P){var F=[$n,jn].indexOf(P)>=0?1:-1,H=[rn,jn].indexOf(P)>=0?"y":"x";T[P]+=B[H]*F})}return T}function WG(i,t){t===void 0&&(t={});var e=t,n=e.placement,o=e.boundary,r=e.rootBoundary,s=e.padding,l=e.flipVariations,a=e.allowedAutoPlacements,h=a===void 0?AM:a,d=Vl(n),u=d?l?RM:RM.filter(function(f){return Vl(f)===d}):Wh,c=u.filter(function(f){return h.indexOf(f)>=0});c.length===0&&(c=u);var g=c.reduce(function(f,p){return f[p]=Uh(i,{placement:p,boundary:o,rootBoundary:r,padding:s})[To(p)],f},{});return Object.keys(g).sort(function(f,p){return g[f]-g[p]})}function NG(i){if(To(i)===Kv)return[];var t=Yg(i);return[kM(i),t,kM(t)]}function VG(i){var t=i.state,e=i.options,n=i.name;if(!t.modifiersData[n]._skip){for(var o=e.mainAxis,r=o===void 0?!0:o,s=e.altAxis,l=s===void 0?!0:s,a=e.fallbackPlacements,h=e.padding,d=e.boundary,u=e.rootBoundary,c=e.altBoundary,g=e.flipVariations,f=g===void 0?!0:g,p=e.allowedAutoPlacements,m=t.options.placement,b=To(m),C=b===m,_=a||(C||!f?[Yg(m)]:NG(m)),w=[m].concat(_).reduce(function($,U){return $.concat(To(U)===Kv?WG(t,{placement:U,boundary:d,rootBoundary:u,padding:h,flipVariations:f,allowedAutoPlacements:p}):U)},[]),y=t.rects.reference,S=t.rects.popper,A=new Map,R=!0,x=w[0],T=0;T<w.length;T++){var M=w[T],B=To(M),P=Vl(M)===zl,F=[rn,jn].indexOf(B)>=0,H=F?"width":"height",E=Uh(t,{placement:M,boundary:d,rootBoundary:u,altBoundary:c,padding:h}),k=F?P?$n:sn:P?jn:rn;y[H]>S[H]&&(k=Yg(k));var I=Yg(k),L=[];if(r&&L.push(E[B]<=0),l&&L.push(E[k]<=0,E[I]<=0),L.every(function($){return $})){x=M,R=!1;break}A.set(M,L)}if(R)for(var D=f?3:1,O=function(U){var Y=w.find(function(j){var G=A.get(j);if(G)return G.slice(0,U).every(function(X){return X})});if(Y)return x=Y,"break"},N=D;N>0;N--){var W=O(N);if(W==="break")break}t.placement!==x&&(t.modifiersData[n]._skip=!0,t.placement=x,t.reset=!0)}}const jG={name:"flip",enabled:!0,phase:"main",fn:VG,requiresIfExists:["offset"],data:{_skip:!1}};function OM(i,t,e){return e===void 0&&(e={x:0,y:0}),{top:i.top-t.height-e.y,right:i.right-t.width+e.x,bottom:i.bottom-t.height+e.y,left:i.left-t.width-e.x}}function zM(i){return[rn,$n,jn,sn].some(function(t){return i[t]>=0})}function $G(i){var t=i.state,e=i.name,n=t.rects.reference,o=t.rects.popper,r=t.modifiersData.preventOverflow,s=Uh(t,{elementContext:"reference"}),l=Uh(t,{altBoundary:!0}),a=OM(s,n),h=OM(l,o,r),d=zM(a),u=zM(h);t.modifiersData[e]={referenceClippingOffsets:a,popperEscapeOffsets:h,isReferenceHidden:d,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}const GG={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:$G};function UG(i,t,e){var n=To(i),o=[sn,rn].indexOf(n)>=0?-1:1,r=typeof e=="function"?e(Object.assign({},t,{placement:i})):e,s=r[0],l=r[1];return s=s||0,l=(l||0)*o,[sn,$n].indexOf(n)>=0?{x:l,y:s}:{x:s,y:l}}function KG(i){var t=i.state,e=i.options,n=i.name,o=e.offset,r=o===void 0?[0,0]:o,s=AM.reduce(function(d,u){return d[u]=UG(u,t.rects,r),d},{}),l=s[t.placement],a=l.x,h=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=a,t.modifiersData.popperOffsets.y+=h),t.modifiersData[n]=s}const YG={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:KG};function XG(i){var t=i.state,e=i.name;t.modifiersData[e]=DM({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const qG={name:"popperOffsets",enabled:!0,phase:"read",fn:XG,data:{}};function ZG(i){return i==="x"?"y":"x"}function JG(i){var t=i.state,e=i.options,n=i.name,o=e.mainAxis,r=o===void 0?!0:o,s=e.altAxis,l=s===void 0?!1:s,a=e.boundary,h=e.rootBoundary,d=e.altBoundary,u=e.padding,c=e.tether,g=c===void 0?!0:c,f=e.tetherOffset,p=f===void 0?0:f,m=Uh(t,{boundary:a,rootBoundary:h,padding:u,altBoundary:d}),b=To(t.placement),C=Vl(t.placement),_=!C,w=Zv(b),y=ZG(w),S=t.modifiersData.popperOffsets,A=t.rects.reference,R=t.rects.popper,x=typeof p=="function"?p(Object.assign({},t.rects,{placement:t.placement})):p,T=typeof x=="number"?{mainAxis:x,altAxis:x}:Object.assign({mainAxis:0,altAxis:0},x),M=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,B={x:0,y:0};if(S){if(r){var P,F=w==="y"?rn:sn,H=w==="y"?jn:$n,E=w==="y"?"height":"width",k=S[w],I=k+m[F],L=k-m[H],D=g?-R[E]/2:0,O=C===zl?A[E]:R[E],N=C===zl?-R[E]:-A[E],W=t.elements.arrow,$=g&&W?qv(W):{width:0,height:0},U=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:PM(),Y=U[F],j=U[H],G=$h(0,A[E],$[E]),X=_?A[E]/2-D-G-Y-T.mainAxis:O-G-Y-T.mainAxis,ht=_?-A[E]/2+D+G+j+T.mainAxis:N+G+j+T.mainAxis,gt=t.elements.arrow&&jh(t.elements.arrow),Ct=gt?w==="y"?gt.clientTop||0:gt.clientLeft||0:0,Q=(P=M==null?void 0:M[w])!=null?P:0,et=k+X-Q-Ct,vt=k+ht-Q,bt=$h(g?Gg(I,et):I,k,g?Ps(L,vt):L);S[w]=bt,B[w]=bt-k}if(l){var dt,ot=w==="x"?rn:sn,ut=w==="x"?jn:$n,st=S[y],_t=y==="y"?"height":"width",ct=st+m[ot],Wt=st-m[ut],Yt=[rn,sn].indexOf(b)!==-1,yt=(dt=M==null?void 0:M[y])!=null?dt:0,mt=Yt?ct:st-A[_t]-R[_t]-yt+T.altAxis,ie=Yt?st+A[_t]+R[_t]-yt-T.altAxis:Wt,le=g&&Yt?wG(mt,st,ie):$h(g?mt:ct,st,g?ie:Wt);S[y]=le,B[y]=le-st}t.modifiersData[n]=B}}const QG={name:"preventOverflow",enabled:!0,phase:"main",fn:JG,requiresIfExists:["offset"]};function tU(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function eU(i){return i===wn(i)||!Gn(i)?Jv(i):tU(i)}function iU(i){var t=i.getBoundingClientRect(),e=Wl(t.width)/i.offsetWidth||1,n=Wl(t.height)/i.offsetHeight||1;return e!==1||n!==1}function nU(i,t,e){e===void 0&&(e=!1);var n=Gn(t),o=Gn(t)&&iU(t),r=Nr(t),s=Nl(i,o,e),l={scrollLeft:0,scrollTop:0},a={x:0,y:0};return(n||!n&&!e)&&((Ao(t)!=="body"||tb(r))&&(l=eU(t)),Gn(t)?(a=Nl(t,!0),a.x+=t.clientLeft,a.y+=t.clientTop):r&&(a.x=Qv(r))),{x:s.left+l.scrollLeft-a.x,y:s.top+l.scrollTop-a.y,width:s.width,height:s.height}}function oU(i){var t=new Map,e=new Set,n=[];i.forEach(function(r){t.set(r.name,r)});function o(r){e.add(r.name);var s=[].concat(r.requires||[],r.requiresIfExists||[]);s.forEach(function(l){if(!e.has(l)){var a=t.get(l);a&&o(a)}}),n.push(r)}return i.forEach(function(r){e.has(r.name)||o(r)}),n}function rU(i){var t=oU(i);return mG.reduce(function(e,n){return e.concat(t.filter(function(o){return o.phase===n}))},[])}function sU(i){var t;return function(){return t||(t=new Promise(function(e){Promise.resolve().then(function(){t=void 0,e(i())})})),t}}function lU(i){var t=i.reduce(function(e,n){var o=e[n.name];return e[n.name]=o?Object.assign({},o,n,{options:Object.assign({},o.options,n.options),data:Object.assign({},o.data,n.data)}):n,e},{});return Object.keys(t).map(function(e){return t[e]})}var WM={placement:"bottom",modifiers:[],strategy:"absolute"};function NM(){for(var i=arguments.length,t=new Array(i),e=0;e<i;e++)t[e]=arguments[e];return!t.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function aU(i){i===void 0&&(i={});var t=i,e=t.defaultModifiers,n=e===void 0?[]:e,o=t.defaultOptions,r=o===void 0?WM:o;return function(l,a,h){h===void 0&&(h=r);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},WM,r),modifiersData:{},elements:{reference:l,popper:a},attributes:{},styles:{}},u=[],c=!1,g={state:d,setOptions:function(b){var C=typeof b=="function"?b(d.options):b;p(),d.options=Object.assign({},r,d.options,C),d.scrollParents={reference:Bs(l)?Gh(l):l.contextElement?Gh(l.contextElement):[],popper:Gh(a)};var _=rU(lU([].concat(n,d.options.modifiers)));return d.orderedModifiers=_.filter(function(w){return w.enabled}),f(),g.update()},forceUpdate:function(){if(!c){var b=d.elements,C=b.reference,_=b.popper;if(NM(C,_)){d.rects={reference:nU(C,jh(_),d.options.strategy==="fixed"),popper:qv(_)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(T){return d.modifiersData[T.name]=Object.assign({},T.data)});for(var w=0;w<d.orderedModifiers.length;w++){if(d.reset===!0){d.reset=!1,w=-1;continue}var y=d.orderedModifiers[w],S=y.fn,A=y.options,R=A===void 0?{}:A,x=y.name;typeof S=="function"&&(d=S({state:d,options:R,name:x,instance:g})||d)}}}},update:sU(function(){return new Promise(function(m){g.forceUpdate(),m(d)})}),destroy:function(){p(),c=!0}};if(!NM(l,a))return g;g.setOptions(h).then(function(m){!c&&h.onFirstUpdate&&h.onFirstUpdate(m)});function f(){d.orderedModifiers.forEach(function(m){var b=m.name,C=m.options,_=C===void 0?{}:C,w=m.effect;if(typeof w=="function"){var y=w({state:d,name:b,instance:g,options:_}),S=function(){};u.push(y||S)}})}function p(){u.forEach(function(m){return m()}),u=[]}return g}}var hU=[EG,qG,PG,CG,YG,jG,QG,AG,GG],dU=aU({defaultModifiers:hU});function ib(i,t){(t==null||t>i.length)&&(t=i.length);for(var e=0,n=Array(t);e<t;e++)n[e]=i[e];return n}function VM(i,t){if(i){if(typeof i=="string")return ib(i,t);var e={}.toString.call(i).slice(8,-1);return e==="Object"&&i.constructor&&(e=i.constructor.name),e==="Map"||e==="Set"?Array.from(i):e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?ib(i,t):void 0}}function uU(i){return function(t){if(Array.isArray(t))return ib(t)}(i)||function(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}(i)||VM(i)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
366
366
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function jl(i){return jl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jl(i)}function jM(i,t,e,n,o,r,s){try{var l=i[r](s),a=l.value}catch(h){return void e(h)}l.done?t(a):Promise.resolve(a).then(n,o)}function $M(i){return function(){var t=this,e=arguments;return new Promise(function(n,o){var r=i.apply(t,e);function s(a){jM(r,n,o,s,l,"next",a)}function l(a){jM(r,n,o,s,l,"throw",a)}s(void 0)})}}var GM={exports:{}},UM={exports:{}};(function(i){function t(e){return i.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},i.exports.__esModule=!0,i.exports.default=i.exports,t(e)}i.exports=t,i.exports.__esModule=!0,i.exports.default=i.exports})(UM),function(i){var t=UM.exports.default;function e(){i.exports=e=function(){return o},i.exports.__esModule=!0,i.exports.default=i.exports;var n,o={},r=Object.prototype,s=r.hasOwnProperty,l=Object.defineProperty||function(L,D,O){L[D]=O.value},a=typeof Symbol=="function"?Symbol:{},h=a.iterator||"@@iterator",d=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(L,D,O){return Object.defineProperty(L,D,{value:O,enumerable:!0,configurable:!0,writable:!0}),L[D]}try{c({},"")}catch{c=function(D,O,N){return D[O]=N}}function g(L,D,O,N){var W=D&&D.prototype instanceof w?D:w,$=Object.create(W.prototype),U=new k(N||[]);return l($,"_invoke",{value:P(L,O,U)}),$}function f(L,D,O){try{return{type:"normal",arg:L.call(D,O)}}catch(N){return{type:"throw",arg:N}}}o.wrap=g;var p="suspendedStart",m="suspendedYield",b="executing",C="completed",_={};function w(){}function y(){}function S(){}var A={};c(A,h,function(){return this});var R=Object.getPrototypeOf,x=R&&R(R(I([])));x&&x!==r&&s.call(x,h)&&(A=x);var T=S.prototype=w.prototype=Object.create(A);function M(L){["next","throw","return"].forEach(function(D){c(L,D,function(O){return this._invoke(D,O)})})}function B(L,D){function O(W,$,U,Y){var j=f(L[W],L,$);if(j.type!=="throw"){var G=j.arg,X=G.value;return X&&t(X)=="object"&&s.call(X,"__await")?D.resolve(X.__await).then(function(ht){O("next",ht,U,Y)},function(ht){O("throw",ht,U,Y)}):D.resolve(X).then(function(ht){G.value=ht,U(G)},function(ht){return O("throw",ht,U,Y)})}Y(j.arg)}var N;l(this,"_invoke",{value:function(W,$){function U(){return new D(function(Y,j){O(W,$,Y,j)})}return N=N?N.then(U,U):U()}})}function P(L,D,O){var N=p;return function(W,$){if(N===b)throw Error("Generator is already running");if(N===C){if(W==="throw")throw $;return{value:n,done:!0}}for(O.method=W,O.arg=$;;){var U=O.delegate;if(U){var Y=F(U,O);if(Y){if(Y===_)continue;return Y}}if(O.method==="next")O.sent=O._sent=O.arg;else if(O.method==="throw"){if(N===p)throw N=C,O.arg;O.dispatchException(O.arg)}else O.method==="return"&&O.abrupt("return",O.arg);N=b;var j=f(L,D,O);if(j.type==="normal"){if(N=O.done?C:m,j.arg===_)continue;return{value:j.arg,done:O.done}}j.type==="throw"&&(N=C,O.method="throw",O.arg=j.arg)}}}function F(L,D){var O=D.method,N=L.iterator[O];if(N===n)return D.delegate=null,O==="throw"&&L.iterator.return&&(D.method="return",D.arg=n,F(L,D),D.method==="throw")||O!=="return"&&(D.method="throw",D.arg=new TypeError("The iterator does not provide a '"+O+"' method")),_;var W=f(N,L.iterator,D.arg);if(W.type==="throw")return D.method="throw",D.arg=W.arg,D.delegate=null,_;var $=W.arg;return $?$.done?(D[L.resultName]=$.value,D.next=L.nextLoc,D.method!=="return"&&(D.method="next",D.arg=n),D.delegate=null,_):$:(D.method="throw",D.arg=new TypeError("iterator result is not an object"),D.delegate=null,_)}function H(L){var D={tryLoc:L[0]};1 in L&&(D.catchLoc=L[1]),2 in L&&(D.finallyLoc=L[2],D.afterLoc=L[3]),this.tryEntries.push(D)}function E(L){var D=L.completion||{};D.type="normal",delete D.arg,L.completion=D}function k(L){this.tryEntries=[{tryLoc:"root"}],L.forEach(H,this),this.reset(!0)}function I(L){if(L||L===""){var D=L[h];if(D)return D.call(L);if(typeof L.next=="function")return L;if(!isNaN(L.length)){var O=-1,N=function W(){for(;++O<L.length;)if(s.call(L,O))return W.value=L[O],W.done=!1,W;return W.value=n,W.done=!0,W};return N.next=N}}throw new TypeError(t(L)+" is not iterable")}return y.prototype=S,l(T,"constructor",{value:S,configurable:!0}),l(S,"constructor",{value:y,configurable:!0}),y.displayName=c(S,u,"GeneratorFunction"),o.isGeneratorFunction=function(L){var D=typeof L=="function"&&L.constructor;return!!D&&(D===y||(D.displayName||D.name)==="GeneratorFunction")},o.mark=function(L){return Object.setPrototypeOf?Object.setPrototypeOf(L,S):(L.__proto__=S,c(L,u,"GeneratorFunction")),L.prototype=Object.create(T),L},o.awrap=function(L){return{__await:L}},M(B.prototype),c(B.prototype,d,function(){return this}),o.AsyncIterator=B,o.async=function(L,D,O,N,W){W===void 0&&(W=Promise);var $=new B(g(L,D,O,N),W);return o.isGeneratorFunction(D)?$:$.next().then(function(U){return U.done?U.value:$.next()})},M(T),c(T,u,"Generator"),c(T,h,function(){return this}),c(T,"toString",function(){return"[object Generator]"}),o.keys=function(L){var D=Object(L),O=[];for(var N in D)O.push(N);return O.reverse(),function W(){for(;O.length;){var $=O.pop();if($ in D)return W.value=$,W.done=!1,W}return W.done=!0,W}},o.values=I,k.prototype={constructor:k,reset:function(L){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(E),!L)for(var D in this)D.charAt(0)==="t"&&s.call(this,D)&&!isNaN(+D.slice(1))&&(this[D]=n)},stop:function(){this.done=!0;var L=this.tryEntries[0].completion;if(L.type==="throw")throw L.arg;return this.rval},dispatchException:function(L){if(this.done)throw L;var D=this;function O(j,G){return $.type="throw",$.arg=L,D.next=j,G&&(D.method="next",D.arg=n),!!G}for(var N=this.tryEntries.length-1;N>=0;--N){var W=this.tryEntries[N],$=W.completion;if(W.tryLoc==="root")return O("end");if(W.tryLoc<=this.prev){var U=s.call(W,"catchLoc"),Y=s.call(W,"finallyLoc");if(U&&Y){if(this.prev<W.catchLoc)return O(W.catchLoc,!0);if(this.prev<W.finallyLoc)return O(W.finallyLoc)}else if(U){if(this.prev<W.catchLoc)return O(W.catchLoc,!0)}else{if(!Y)throw Error("try statement without catch or finally");if(this.prev<W.finallyLoc)return O(W.finallyLoc)}}}},abrupt:function(L,D){for(var O=this.tryEntries.length-1;O>=0;--O){var N=this.tryEntries[O];if(N.tryLoc<=this.prev&&s.call(N,"finallyLoc")&&this.prev<N.finallyLoc){var W=N;break}}W&&(L==="break"||L==="continue")&&W.tryLoc<=D&&D<=W.finallyLoc&&(W=null);var $=W?W.completion:{};return $.type=L,$.arg=D,W?(this.method="next",this.next=W.finallyLoc,_):this.complete($)},complete:function(L,D){if(L.type==="throw")throw L.arg;return L.type==="break"||L.type==="continue"?this.next=L.arg:L.type==="return"?(this.rval=this.arg=L.arg,this.method="return",this.next="end"):L.type==="normal"&&D&&(this.next=D),_},finish:function(L){for(var D=this.tryEntries.length-1;D>=0;--D){var O=this.tryEntries[D];if(O.finallyLoc===L)return this.complete(O.completion,O.afterLoc),E(O),_}},catch:function(L){for(var D=this.tryEntries.length-1;D>=0;--D){var O=this.tryEntries[D];if(O.tryLoc===L){var N=O.completion;if(N.type==="throw"){var W=N.arg;E(O)}return W}}throw Error("illegal catch attempt")},delegateYield:function(L,D,O){return this.delegate={iterator:I(L),resultName:D,nextLoc:O},this.method==="next"&&(this.arg=n),_}},o}i.exports=e,i.exports.__esModule=!0,i.exports.default=i.exports}(GM);var Xg=GM.exports(),qg=Xg;try{regeneratorRuntime=Xg}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Xg:Function("r","regeneratorRuntime = r")(Xg)}function $l(i,t){return function(e){if(Array.isArray(e))return e}(i)||function(e,n){var o=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(o!=null){var r,s,l,a,h=[],d=!0,u=!1;try{if(l=(o=o.call(e)).next,n===0){if(Object(o)!==o)return;d=!1}else for(;!(d=(r=l.call(o)).done)&&(h.push(r.value),h.length!==n);d=!0);}catch(c){u=!0,s=c}finally{try{if(!d&&o.return!=null&&(a=o.return(),Object(a)!==a))return}finally{if(u)throw s}}return h}}(i,t)||VM(i,t)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
367
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function cU(i){var t=function(e,n){if(jl(e)!="object"||!e)return e;var o=e[Symbol.toPrimitive];if(o!==void 0){var r=o.call(e,n||"default");if(jl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}(i,"string");return jl(t)=="symbol"?t:t+""}function nb(i,t,e){return(t=cU(t))in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Zg=v.defineComponent({name:"Saturation",props:{size:{type:Number,default:160},hue:{type:Number,default:0},saturation:{type:Number,default:0},value:{type:Number,default:0}},emits:["change"],setup:function(i,t){var e=t.emit,n=v.computed(function(){return{width:"".concat(i.size,"px"),height:"".concat(i.size,"px"),background:"hsl(".concat(i.hue,", 100%, 50%)")}});return{saturationStyle:n,sliderStyle:v.computed(function(){return{top:"".concat((100-i.value)/100*i.size-5,"px"),left:"".concat(i.saturation*i.size/100-5,"px"),width:"".concat(10,"px"),height:"".concat(10,"px")}}),onSelect:function(o){var r=o.target.getBoundingClientRect(),s=r.left,l=r.top,a=function(d){var u=d.clientX,c=d.clientY,g=u-s,f=c-l;g<0&&(g=0),f<0&&(f=0),g>i.size&&(g=i.size),f>i.size&&(f=i.size);var p=g/i.size*100,m=100-f/i.size*100;e("change",p,m)},h=function(){document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",h)};a(o),document.addEventListener("mousemove",a),document.addEventListener("mouseup",h)}}}});function Mo(i,t){t===void 0&&(t={});var e=t.insertAt;if(i&&typeof document<"u"){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",e==="top"&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=i:o.appendChild(document.createTextNode(i))}}Mo(".saturation[data-v-24517fec]{position:relative}.saturation-black[data-v-24517fec],.saturation-white[data-v-24517fec]{cursor:pointer;height:100%;left:0;position:absolute;top:0;width:100%}.saturation-white[data-v-24517fec]{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.saturation-black[data-v-24517fec]{background:linear-gradient(0deg,#000,transparent)}.slider[data-v-24517fec]{border:1px solid #fff;border-radius:50%;box-shadow:0 0 1px 1px rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;top:0;z-index:1}"),Zg.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",{class:"saturation",style:v.normalizeStyle(i.saturationStyle),onMousedown:t[0]||(t[0]=v.withModifiers(function(){return i.onSelect&&i.onSelect.apply(i,arguments)},["prevent","stop"]))},[t[1]||(t[1]=v.createElementVNode("div",{class:"saturation-white"},null,-1)),t[2]||(t[2]=v.createElementVNode("div",{class:"saturation-black"},null,-1)),v.createElementVNode("div",{class:"slider",style:v.normalizeStyle(i.sliderStyle)},null,4)],36)},Zg.__scopeId="data-v-24517fec",Zg.__file="src/picker/Saturation.vue";var Jg=v.defineComponent({name:"Hue",props:{width:{type:Number,default:15},height:{type:Number,default:160},hue:{type:Number,default:0}},emits:["change"],setup:function(i,t){var e=t.emit,n=v.computed(function(){return{top:"".concat((1-i.hue/360)*i.height-2,"px"),height:"".concat(4,"px")}}),o=v.ref();return v.onMounted(function(){(function(){o.value.width=i.width,o.value.height=i.height;var r=o.value.getContext("2d"),s=r.createLinearGradient(0,0,0,i.height);s.addColorStop(0,"#FF0000"),s.addColorStop(.17,"#FF00FF"),s.addColorStop(.34,"#0000FF"),s.addColorStop(.51,"#00FFFF"),s.addColorStop(.68,"#00FF00"),s.addColorStop(.17*5,"#FFFF00"),s.addColorStop(1,"#FF0000"),r.fillStyle=s,r.fillRect(0,0,i.width,i.height)})()}),{canvas:o,sliderStyle:n,onSelect:function(r){var s=r.target.getBoundingClientRect().top,l=function(h){var d=h.clientY-s;d<0&&(d=0),d>i.height&&(d=i.height);var u=-100*d/i.height+100;e("change",360*u/100)},a=function(){document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",a)};l(r),document.addEventListener("mousemove",l),document.addEventListener("mouseup",a)}}}}),gU={ref:"canvas"};Mo(".hue[data-v-78b9f4f0]{position:relative}.slider[data-v-78b9f4f0]{background:#fff;box-shadow:0 0 1px 0 rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;width:100%;z-index:1}"),Jg.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",{class:"hue",onMousedown:t[0]||(t[0]=v.withModifiers(function(){return i.onSelect&&i.onSelect.apply(i,arguments)},["prevent","stop"]))},[v.createElementVNode("canvas",gU,null,512),v.createElementVNode("div",{class:"slider",style:v.normalizeStyle(i.sliderStyle)},null,4)],32)},Jg.__scopeId="data-v-78b9f4f0",Jg.__file="src/picker/Hue.vue";var Qg=v.defineComponent({name:"Alpha",props:{width:{type:Number,default:15},height:{type:Number,default:160},color:{type:String,default:"#000000"},alpha:{type:Number,default:1}},setup:function(i,t){var e=t.emit,n=v.computed(function(){return{top:"".concat(i.alpha*i.height-2,"px"),height:"".concat(4,"px")}}),o=v.ref(),r=function(){var s=o.value.getContext("2d");o.value.width=i.width,o.value.height=i.height;var l=function(h){var d=document.createElement("canvas"),u=d.getContext("2d"),c=2*h;return d.width=c,d.height=c,u.fillStyle="#ffffff",u.fillRect(0,0,c,c),u.fillStyle="#ccd5db",u.fillRect(0,0,h,h),u.fillRect(h,h,h,h),d}(5);s.fillStyle=s.createPattern(l,"repeat"),s.fillRect(0,0,i.width,i.height);var a=s.createLinearGradient(0,0,0,i.height);a.addColorStop(.01,"rgba(255,255,255,0)"),a.addColorStop(.99,i.color),s.fillStyle=a,s.fillRect(0,0,i.width,i.height)};return v.watch(function(){return i.color},function(){r()}),v.onMounted(function(){r()}),{canvas:o,sliderStyle:n,onSelect:function(s){var l=s.target.getBoundingClientRect().top,a=function(d){var u=d.clientY-l;u<0&&(u=0),u>i.height&&(u=i.height);var c=parseFloat((u/i.height).toFixed(2));e("change",c)},h=function(){document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",h)};a(s),document.addEventListener("mousemove",a),document.addEventListener("mouseup",h)}}}}),fU={ref:"canvas"};Mo(".alpha[data-v-24dc9656]{position:relative}.slider[data-v-24dc9656]{background:#fff;box-shadow:0 0 1px 0 rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;width:100%;z-index:1}"),Qg.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",{class:"alpha",onMousedown:t[0]||(t[0]=v.withModifiers(function(){return i.onSelect&&i.onSelect.apply(i,arguments)},["prevent","stop"]))},[v.createElementVNode("canvas",fU,null,512),v.createElementVNode("div",{class:"slider",style:v.normalizeStyle(i.sliderStyle)},null,4)],32)},Qg.__scopeId="data-v-24dc9656",Qg.__file="src/picker/Alpha.vue";var KM={rgb:"RGBA",hex:"HEX",hsl:"HSLA",hsv:"HSVA"},YM={rgb:"RGB",hex:"HEX",hsl:"HSL",hsv:"HSV"},pU={RGB:"rgb",RGBA:"rgb",HEX:"hex",HSL:"hsl",HSLA:"hsl",HSV:"hsv",HSVA:"hsv"};function XM(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),e.push.apply(e,n)}return e}function ob(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?XM(Object(e),!0).forEach(function(n){nb(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):XM(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}var Hs=null,qM=function(i,t,e){var n=v.ref({}),o=e||{},r=o.placement,s=o.defaultStyle,l={strategy:o.strategy||"absolute",placement:r||"auto",onFirstUpdate:function(){Hs.update()},modifiers:[{name:"offset",options:{offset:[0,5]}},{name:"computeStyles",options:{gpuAcceleration:!1,adaptive:!0}},{name:"flip",options:{allowedAutoPlacements:["top","bottom"]}},{name:"applyStyles",enabled:!1},{name:"updateState",enabled:!0,phase:"write",requires:["computeStyles"],fn:function(a){var h=a.state,d=h.styles,u=h.placement,c=d.popper;n.value=ob(ob(ob({},c),s),{},{transformOrigin:u==="top"?"center bottom":"center top"})}}]};return v.watch(function(){return[v.unref(i),v.unref(t)]},function(a,h){var d,u=$l(a,2),c=u[0],g=u[1],f=$l(h,2),p=f[0],m=f[1];if(c&&g&&(p!==c||m!==p)){(d=Hs)===null||d===void 0||d.destroy();var b=c.$el||c,C=g.$el||g;v.nextTick(function(){Hs=dU(b,C,l)})}}),v.onBeforeUnmount(function(){var a;Hs&&((a=Hs)===null||a===void 0||a.destroy(),Hs=null)}),{instance:Hs,style:n}},tf=v.defineComponent({props:{value:{type:String,default:"RGBA"},showAlpha:{type:Boolean},options:{type:[Boolean,Array]}},emits:["change"],setup:function(i,t){var e=t.emit,n=v.ref(null),o=v.ref(null),r=v.ref(!1),s=qM(n,o,{strategy:"fixed",defaultStyle:{zIndex:2}}).style,l=v.computed(function(){return Array.isArray(i.options)&&i.options.length>1}),a=v.computed(function(){var d=i.options,u=i.showAlpha,c=i.value;return Array.isArray(d)?u?d.map(function(g){return KM[g]}).filter(function(g){return!g.includes(c)}):d.map(function(g){return YM[g]}).filter(function(g){return!g.includes(c)}):[]}),h=function(d){var u,c,g=d.target;!((u=v.unref(n))!==null&&u!==void 0&&u.isEqualNode(g))&&(!((c=v.unref(n))===null||c===void 0)&&c.contains(g))||(r.value=!1)};return v.onMounted(function(){document.addEventListener("mouseup",h,!1)}),v.onUnmounted(function(){document.removeEventListener("mouseup",h,!1)}),{targetRef:n,selectorRef:o,selectorStyle:s,isShowSelector:r,isNeedSelect:l,formatOptions:a,onShow:function(){l.value&&(r.value=!0)},onFormatChange:function(d){e("change",pU[d])}}}}),mU={class:"format"},vU={key:0,class:"arrow"},bU=["onClick"];Mo(".format[data-v-5f6e8f5e]{position:relative}.label[data-v-5f6e8f5e]{align-items:center;background:#e7e8e9;color:#999;display:flex;float:left;font-weight:500;height:30px;justify-content:center;position:relative;width:60px}[pick-colors-theme=dark] .label[data-v-5f6e8f5e]{background:#252930;color:#999}.arrow[data-v-5f6e8f5e]{height:6px;margin-bottom:4px;margin-left:5px;transform:rotate(135deg);width:6px}.arrow[data-v-5f6e8f5e],[pick-colors-theme=dark] .arrow[data-v-5f6e8f5e]{border-right:1px solid #999;border-top:1px solid #999}.selector[data-v-5f6e8f5e]{align-items:center;background:#f7f8f9;border-radius:5px;box-shadow:0 0 16px 0 rgba(0,0,0,.16);cursor:pointer;display:flex;flex-direction:column;font-weight:400;justify-content:center;padding:4px}[pick-colors-theme=dark] .selector[data-v-5f6e8f5e]{background:#252930;color:#999}.selector-item[data-v-5f6e8f5e]{align-items:center;display:flex;height:30px;justify-content:center;width:60px}.selector-item[data-v-5f6e8f5e]:hover{background:#e1f2fe}[pick-colors-theme=dark] .selector-item[data-v-5f6e8f5e]{color:#fff}[pick-colors-theme=dark] .selector-item[data-v-5f6e8f5e]:hover{background:#0087fa}.active-selector-item[data-v-5f6e8f5e]{background:#e1f2fe}[pick-colors-theme=dark] .active-selector-item[data-v-5f6e8f5e]{background:#0087fa}.v-enter-active[data-v-5f6e8f5e],.v-leave-active[data-v-5f6e8f5e]{opacity:1;transform:scaleY(1);transform-origin:center top;transition:opacity .2s ease-in-out,transform .2s ease-in-out}.v-enter-from[data-v-5f6e8f5e],.v-leave-to[data-v-5f6e8f5e]{opacity:0;transform:scaleY(0)}"),tf.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",mU,[v.createElementVNode("div",{class:"label",ref:"targetRef",onClick:t[0]||(t[0]=function(){return i.onShow&&i.onShow.apply(i,arguments)})},[v.createElementVNode("span",null,v.toDisplayString(i.value),1),i.isNeedSelect?(v.openBlock(),v.createElementBlock("div",vU)):v.createCommentVNode("v-if",!0)],512),v.createVNode(v.Transition,null,{default:v.withCtx(function(){return[i.isShowSelector?(v.openBlock(),v.createElementBlock("div",{key:0,class:"selector",ref:"selectorRef",style:v.normalizeStyle(i.selectorStyle)},[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.formatOptions,function(s){return v.openBlock(),v.createElementBlock("div",{class:"selector-item",key:s,onClick:function(l){return i.onFormatChange(s)}},v.toDisplayString(s),9,bU)}),128))],4)):v.createCommentVNode("v-if",!0)]}),_:1})])},tf.__scopeId="data-v-5f6e8f5e",tf.__file="src/picker/input-value/FormatValue.vue";var ef=v.defineComponent({name:"Input",components:{FormatValue:tf},props:{format:{type:String,default:"RGBA"},value:{type:String,default:""},width:{type:Number},showAlpha:{type:Boolean},formatOptions:{type:[Boolean,Array]}},emits:["change","focus","blur","enter","formatChange"],setup:function(i,t){var e=t.emit;return{onInput:function(n){var o;e("change",(o=n.target)===null||o===void 0?void 0:o.value)},valueStyle:v.computed(function(){return{minWidth:"".concat(i.width,"px"),maxWidth:"".concat(i.width,"px"),width:"".concat(i.width,"px")}}),onFocus:function(){e("focus")},onBlur:function(){e("blur")},onEnter:function(){e("enter")},onFormatChange:function(n){e("formatChange",n)}}}}),CU={class:"input"},yU=[".value"];function ZM(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),e.push.apply(e,n)}return e}function Un(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?ZM(Object(e),!0).forEach(function(n){nb(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):ZM(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}Mo(".input[data-v-2c454c00]{display:flex;font-size:12px}.value[data-v-2c454c00]{background:#eceef0;border:1px solid #eceef0;box-sizing:border-box;color:#666;flex:1;height:30px;text-align:center}[pick-colors-theme=dark] .value[data-v-2c454c00]{background:#2e333a;border:1px solid #2e333a;color:#fff}.value[data-v-2c454c00]:focus{border:1px solid #1890ff;outline:none}"),ef.render=function(i,t,e,n,o,r){var s=v.resolveComponent("FormatValue");return v.openBlock(),v.createElementBlock("div",CU,[v.createVNode(s,{value:i.format,showAlpha:i.showAlpha,options:i.formatOptions,onChange:i.onFormatChange},null,8,["value","showAlpha","options","onChange"]),v.createElementVNode("input",{class:"value",style:v.normalizeStyle(i.valueStyle),".value":i.value,onFocus:t[0]||(t[0]=function(){return i.onFocus&&i.onFocus.apply(i,arguments)}),onInput:t[1]||(t[1]=function(){return i.onInput&&i.onInput.apply(i,arguments)}),onBlur:t[2]||(t[2]=function(){return i.onBlur&&i.onBlur.apply(i,arguments)}),onKeydown:t[3]||(t[3]=v.withKeys(function(){return i.onEnter&&i.onEnter.apply(i,arguments)},["enter"]))},null,44,yU)])},ef.__scopeId="data-v-2c454c00",ef.__file="src/picker/input-value/InputValue.vue";var JM=function(i,t,e){return[i,t*e/((i=(2-t)*e)<1?i:2-i)||0,i/2]},QM={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},nf=function(i){i=Math.min(Math.round(i),255);var t=Math.floor(i/16),e=i%16;return"".concat(QM[t]||t).concat(QM[e]||e)},tB=function(i){var t=i.r,e=i.g,n=i.b;return isNaN(t)||isNaN(e)||isNaN(n)?"":"#".concat(nf(t)).concat(nf(e)).concat(nf(n))},Gl=function(i,t){var e;typeof(e=i)=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1&&(i="100%");var n=function(o){return typeof o=="string"&&o.indexOf("%")!==-1}(i);return i=Math.min(t,Math.max(0,parseFloat("".concat(i)))),n&&(i=parseInt("".concat(i*t),10)/100),Math.abs(i-t)<1e-6?1:i%t/parseFloat(t)},Kh=function(i,t,e){i=6*Gl(i,360),t=Gl(t,100),e=Gl(e,100);var n=Math.floor(i),o=i-n,r=e*(1-t),s=e*(1-o*t),l=e*(1-(1-o)*t),a=n%6,h=[e,s,r,r,l,e][a],d=[l,e,e,s,r,r][a],u=[r,r,l,e,e,s][a];return{r:Math.round(255*h),g:Math.round(255*d),b:Math.round(255*u)}},eB=function(i,t,e){var n,o,r=i.h,s=i.s,l=i.v,a=i.a;if(e)switch(a=(o=(n=a).toString().match(/\.(\d{1,2})(\d*)/))&&o[2].length>0?parseFloat(n.toFixed(2)):n,t){case"hsl":var h=JM(r,s/100,l/100);return"hsla(".concat(r.toFixed(0),", ").concat(Math.round(100*h[1]),"%, ").concat(Math.round(100*h[2]),"%, ").concat(a,")");case"hsv":return"hsva(".concat(r.toFixed(0),", ").concat(Math.round(s),"%, ").concat(Math.round(l),"%, ").concat(a,")");case"rgb":var d=Kh(r,s,l),u=d.r,c=d.g,g=d.b;return"rgba(".concat(u,", ").concat(c,", ").concat(g,", ").concat(a,")");default:return"".concat(tB(Kh(r,s,l))).concat(nf(255*a))}else switch(t){case"hsl":var f=JM(r,s/100,l/100);return"hsl(".concat(r.toFixed(0),", ").concat(Math.round(100*f[1]),"%, ").concat(Math.round(100*f[2]),"%)");case"hsv":return"hsv(".concat(r.toFixed(0),", ").concat(Math.round(s),"%, ").concat(Math.round(l),"%)");case"rgb":var p=Kh(r,s,l),m=p.r,b=p.g,C=p.b;return"rgb(".concat(m,", ").concat(b,", ").concat(C,")");default:return tB(Kh(r,s,l))}},of=function(i){var t=i.r,e=i.g,n=i.b;t=Gl(t,255),e=Gl(e,255),n=Gl(n,255);var o,r=Math.max(t,e,n),s=Math.min(t,e,n),l=r,a=r-s,h=r===0?0:a/r;if(r===s)o=0;else{switch(r){case t:o=(e-n)/a+(e<n?6:0);break;case e:o=(n-t)/a+2;break;case n:o=(t-e)/a+4}o/=6}return{h:360*o,s:100*h,v:100*l}},iB=function(i){var t=i.h,e=i.s,n=i.l;n/=100;var o=e/=100,r=Math.max(n,.01);return e*=(n*=2)<=1?n:2-n,o*=r<=1?r:2-r,{h:+t,s:100*(n===0?2*o/(r+o):2*e/(n+e)),v:100*((n+e)/2)}},nB=function(i){var t=[];if(i.match(/^#([0-9a-fA-f]{3,4})$/g))for(var e=1;e<i.length;e++)t.push(parseInt("0x"+i[e].repeat(2)));else if(i.match(/^#([0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/g))for(var n=1;n<i.length;n+=2)t.push(parseInt("0x"+i.slice(n,n+2)));return{r:t[0],g:t[1],b:t[2],a:t[3]}},rb=function(i,t,e){if(typeof i=="string"&&i!==""){var n=rf(i,sf(i),e),o=lB(n);return o==null?"":eB(o,t,e)}return""},oB=function(i){var t=$l(i.match(/(\d(\.\d+)?)+/g),4);return{r:t[0],g:t[1],b:t[2],a:t[3]}},rB=function(i){var t=$l(i.match(/(\d(\.\d+)?)+/g),4),e=t[0],n=t[1],o=t[2],r=t[3];return{h:e,s:parseFloat(n),l:parseFloat(o),a:r}},sB=function(i){var t=$l(i.match(/(\d(\.\d+)?)+/g),4),e=t[0],n=t[1],o=t[2],r=t[3];return{h:parseFloat(e),s:parseFloat(n),v:parseFloat(o),a:parseFloat(r)}},rf=function(i,t){if(!(arguments.length>2&&arguments[2]!==void 0)||arguments[2])switch(t){case"rgb":var e=oB(i),n=e.r,o=e.g,r=e.b,s=e.a;return Un(Un({},of({r:n,g:o,b:r})),{},{a:+s});case"hsv":var l=sB(i);return{h:l.h,s:l.s,v:l.v,a:l.a};case"hsl":var a=rB(i),h=a.h,d=a.s,u=a.l,c=a.a;return Un(Un({},iB({h,s:d,l:u})),{},{a:+c});default:var g=nB(i),f=g.r,p=g.g,m=g.b,b=g.a;return Un(Un({},of({r:f,g:p,b:m})),{},{a:b/255})}else switch(t){case"rgb":return Un(Un({},of(oB(i))),{},{a:1});case"hsv":var C=sB(i);return{h:C.h,s:C.s,v:C.v,a:1};case"hsl":return Un(Un({},iB(rB(i))),{},{a:1});default:return Un(Un({},of(nB(i))),{},{a:1})}},sf=function(i){return i.match(/^#/)?"hex":i.match(/^rgb/)?"rgb":i.match(/^hsl/)?"hsl":i.match(/^hsv/)?"hsv":"hex"},lB=function(i){var t=i.h,e=i.s,n=i.v,o=i.a;return isNaN(t)&&isNaN(e)&&isNaN(n)?null:(isNaN(t)&&(t=0),isNaN(e)&&(e=0),isNaN(n)&&(n=0),isNaN(o)&&(o=1),{h:t,s:e,v:n,a:o})},Yh=v.defineComponent({name:"ColorItem",props:{size:{type:[Number,String],default:20},width:{type:[Number,String]},height:{type:[Number,String]},value:{type:String,default:""},border:{type:Boolean,default:!0},borderRadius:{type:Number,default:5},selected:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1}},emits:["select"],setup:function(i){var t=v.ref(),e=v.inject("theme",{theme:"light"}).theme,n=v.computed(function(){return parseFloat((i.width||i.size)+"")}),o=v.computed(function(){return parseFloat((i.height||i.size)+"")}),r=v.computed(function(){return{width:"".concat(v.unref(n),"px"),height:"".concat(v.unref(o),"px"),border:i.border?"1px solid ".concat(v.unref(e)==="dark"?"#434345":"#d9d9d9"):"",borderRadius:"".concat(i.borderRadius,"px"),boxShadow:i.selected?"0 0 3px 2px ".concat(v.unref(e)==="dark"?"#2681ff":"#1890ff"):""}}),s=function(){var l=t.value.getContext("2d");t.value.width=v.unref(n),t.value.height=v.unref(o);var a=function(h){var d=document.createElement("canvas"),u=d.getContext("2d"),c=2*h;return d.width=c,d.height=c,u.fillStyle="#ffffff",u.fillRect(0,0,c,c),u.fillStyle="#ccd5db",u.fillRect(0,0,h,h),u.fillRect(h,h,h,h),d}(5);l.fillStyle=l.createPattern(a,"repeat"),l.fillRect(0,0,v.unref(n),v.unref(o)),l.fillStyle=i.value,l.fillRect(0,0,v.unref(n),v.unref(o))};return v.watch(function(){return i.value},function(){s()}),v.onMounted(function(){s()}),{canvas:t,colorItemStyle:r}}}),_U=["draggable"];Mo(".color-item[data-v-02da71fd]{display:inline-block;vertical-align:top}"),Yh.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("canvas",{class:"color-item",style:v.normalizeStyle(i.colorItemStyle),ref:"canvas",draggable:i.draggable},null,12,_U)},Yh.__scopeId="data-v-02da71fd",Yh.__file="src/color-item/ColorItem.vue";var lf=v.defineComponent({name:"Colors",components:{ColorItem:Yh},props:{colors:{type:Array,default:function(){return[]}},selectedIndex:{type:Number,default:-1}},emits:["change"],setup:function(i,t){var e=t.emit;return{onSelectColor:function(n,o){e("change",n,o)},useColors:v.computed(function(){return i.colors.map(function(n){return rb(n,"hex",!0)})})}}}),wU={class:"colors"};function aB(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),e.push.apply(e,n)}return e}function Bo(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?aB(Object(e),!0).forEach(function(n){nb(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):aB(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}Mo(".colors[data-v-0f8b52a8]{align-items:center;display:flex;flex-wrap:wrap;margin-top:5px}.color-item[data-v-0f8b52a8]{margin:5px}"),lf.render=function(i,t,e,n,o,r){var s=v.resolveComponent("color-item");return v.openBlock(),v.createElementBlock("div",wU,[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.useColors,function(l,a){return v.openBlock(),v.createBlock(s,{key:a,class:"color-item",size:16,value:l,border:!1,"border-radius":3,selected:i.selectedIndex===a,onClick:v.withModifiers(function(h){return i.onSelectColor(l,+a)},["stop","prevent"])},null,8,["value","selected","onClick"])}),128))])},lf.__scopeId="data-v-0f8b52a8",lf.__file="src/picker/Colors.vue";var af=v.defineComponent({name:"Picker",components:{Colors:lf,Saturation:Zg,Hue:Jg,Alpha:Qg,InputValue:ef},props:{format:{type:String,default:"hex"},showAlpha:{type:Boolean,default:!1},value:{type:String,default:""},colors:{type:Array,default:function(){return[]}},style:{type:Object,default:function(){return{}}},formatOptions:{type:[Boolean,Array]}},emits:["change","formatChange"],setup:function(i,t){var e=t.emit,n=v.computed(function(){return Bo(Bo({},i.style),{},{width:i.showAlpha?"230px":"205px"})}),o=v.ref(),r=v.ref(),s=v.ref(),l=function(){var p,m=(p=i.value)===null||p===void 0?void 0:p.trim();if(m!=null&&m!==""){var b=sf(m);return lB(rf(m,b,i.showAlpha))}return null};v.watch(function(){return i.value},function(){i.value!==v.unref(s)&&(o.value=l())},{immediate:!0}),v.watch(function(){return[v.unref(o),i.format]},function(p){var m=$l(p,2),b=m[0],C=m[1],_="";b!=null?(_=eB(Bo({},b),i.format,i.showAlpha),r.value=Bo({},b)):r.value=null,s.value=_;var w=l();JSON.stringify(b)!==JSON.stringify(w)&&JSON.stringify(b)!==JSON.stringify(C)&&e("change",_)},{immediate:!0});var a=v.computed(function(){var p;return((p=v.unref(o))===null||p===void 0?void 0:p.h)||0}),h=v.computed(function(){var p;return((p=v.unref(o))===null||p===void 0?void 0:p.s)||0}),d=v.computed(function(){var p;return((p=v.unref(o))===null||p===void 0?void 0:p.v)||0}),u=v.computed(function(){var p,m;return((p=v.unref(o))===null||p===void 0?void 0:p.a)!=null?(m=v.unref(o))===null||m===void 0?void 0:m.a:1}),c=v.computed(function(){return Kh(v.unref(a),v.unref(h),v.unref(d))}),g=v.computed(function(){return"rgb(".concat(v.unref(c).r,", ").concat(v.unref(c).g,", ").concat(v.unref(c).b,")")}),f=v.ref(-1);return{h:a,s:h,v:d,a:u,rgbStr:g,onSelectSaturation:function(p,m){f.value=-1,v.unref(o)==null?o.value={h:v.unref(a),s:p,v:m,a:v.unref(u)}:o.value=Bo(Bo({},v.unref(o)),{},{s:p,v:m})},onSelectHue:function(p){f.value=-1,v.unref(o)==null&&(o.value={h:p,s:v.unref(h),v:v.unref(d),a:v.unref(u)}),o.value=Bo(Bo({},v.unref(o)),{},{h:p})},onSelectAlpha:function(p){f.value=-1,v.unref(o)==null?o.value={h:v.unref(a),s:v.unref(h),v:v.unref(d),a:p}:o.value=Bo(Bo({},v.unref(o)),{},{a:p})},handleInputFormat:function(p){return i.showAlpha?KM[p]:YM[p]},colorValue:s,pickerStyle:n,onInputChange:function(p){f.value=-1,s.value=p},handleChange:function(){var p,m=(p=v.unref(s))===null||p===void 0?void 0:p.trim();if(m!==""){var b=i.showAlpha,C=sf(m),_=rf(m,C,b),w=function(y){var S=y.h,A=y.s,R=y.v,x=y.a;return!(isNaN(S)||isNaN(A)||isNaN(R)||isNaN(x))}(_);w?o.value=_:v.unref(r)!=null?o.value=v.unref(r):s.value=""}else o.value=null},selectColorIndex:f,onSelectColor:function(p,m){if(f.value=m,(p=p.trim())==="")o.value=null;else{var b=sf(p);b?function(C,_,w){if(C.length!==0){var y=rf(C,_,w),S=y.h,A=y.s,R=y.v;if(!(isNaN(S)||isNaN(A)||isNaN(R))){var x=1,T=y.a;isNaN(T)||(x=T),o.value={h:S,s:A,v:R,a:x}}}}(p,b,!0):o.value=null}},onFormatChange:function(p){e("formatChange",p)}}}}),SU={class:"picker-inner"},xU={class:"picker-header"};Mo(".picker[data-v-6ceadec6]{background:#f7f8f9;border-radius:4px;box-shadow:0 0 16px 0 rgba(0,0,0,.16)}.picker-inner[data-v-6ceadec6]{padding:10px}[pick-colors-theme=dark] .picker-inner[data-v-6ceadec6]{background:#1d2024;box-shadow:0 0 16px 0 rgba(0,0,0,.16)}.picker-header[data-v-6ceadec6]{display:flex;margin-bottom:5px}.alpha[data-v-6ceadec6],.hue[data-v-6ceadec6]{margin-left:10px}.colors[data-v-6ceadec6]{margin-top:5px}"),af.render=function(i,t,e,n,o,r){var s=v.resolveComponent("saturation"),l=v.resolveComponent("hue"),a=v.resolveComponent("alpha"),h=v.resolveComponent("input-value"),d=v.resolveComponent("Colors");return v.openBlock(),v.createElementBlock("div",{class:"picker",style:v.normalizeStyle(i.pickerStyle)},[v.createElementVNode("div",SU,[v.createElementVNode("div",xU,[v.createVNode(s,{class:"saturation",hue:i.h,saturation:i.s,value:i.v,onChange:i.onSelectSaturation},null,8,["hue","saturation","value","onChange"]),v.createVNode(l,{class:"hue",hue:i.h,onChange:i.onSelectHue},null,8,["hue","onChange"]),i.showAlpha?(v.openBlock(),v.createBlock(a,{key:0,class:"alpha",alpha:i.a,color:i.rgbStr,onChange:i.onSelectAlpha},null,8,["alpha","color","onChange"])):v.createCommentVNode("v-if",!0)]),v.createVNode(h,{format:i.handleInputFormat(i.format),value:i.colorValue,showAlpha:i.showAlpha,width:i.showAlpha?150:125,formatOptions:i.formatOptions,onChange:i.onInputChange,onBlur:i.handleChange,onEnter:i.handleChange,onFormatChange:i.onFormatChange},null,8,["format","value","showAlpha","width","formatOptions","onChange","onBlur","onEnter","onFormatChange"]),i.colors.length>0?(v.openBlock(),v.createBlock(d,{key:0,class:"colors",colors:i.colors,"selected-index":i.selectColorIndex,onChange:i.onSelectColor},null,8,["colors","selected-index","onChange"])):v.createCommentVNode("v-if",!0)])],4)},af.__scopeId="data-v-6ceadec6",af.__file="src/picker/Picker.vue";var hf=v.defineComponent({name:"AddColorItem",props:{size:{type:Number,default:20},selected:{type:Boolean,default:!1}},setup:function(i){var t=v.inject("theme",{theme:"light"}).theme;return{addColorItemStyle:v.computed(function(){return{width:"".concat(i.size,"px"),height:"".concat(i.size,"px"),lineHeight:"".concat(i.size,"px"),boxShadow:i.selected?"0 0 3px 2px ".concat(v.unref(t)==="dark"?"#2681ff":"#1890ff"):""}})}}});Mo(".add-color-item[data-v-ceb1719c]{background:#fff;border:1px solid #d9d9d9;border-radius:5px;vertical-align:top}.container[data-v-ceb1719c]{pointer-events:none;transform:scale(.9);transform-origin:center}[pick-colors-theme=dark] .add-color-item[data-v-ceb1719c]{background:#141414;border:1px solid #434343}path[data-v-ceb1719c]{fill:#000}[pick-colors-theme=dark] path[data-v-ceb1719c]{fill:#fff}"),hf.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("svg",{class:"add-color-item",style:v.normalizeStyle(i.addColorItemStyle),viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},t[0]||(t[0]=[v.createElementVNode("g",{class:"container"},[v.createElementVNode("path",{d:"M544 464V160h-80v304H160v80h304v304h80V544h304v-80z"})],-1)]),4)},hf.__scopeId="data-v-ceb1719c",hf.__file="src/add-color-item/AddColorItem.vue";var df=v.defineComponent({name:"ColorPicker",components:{ColorItem:Yh,Picker:af,AddColorItem:hf},props:{value:{type:[String,Array]},theme:{type:String,default:"light"},size:{type:[Number,String],default:20},width:{type:[Number,String]},height:{type:[Number,String]},format:{type:String},showPicker:{type:Boolean,default:void 0},showAlpha:{type:Boolean,default:!1},addColor:{type:Boolean,default:!1},deleteColor:{type:Boolean,default:!0},max:{type:Number,default:13},popupContainer:{type:[String,Object,Boolean],default:"body"},zIndex:{type:Number,default:1e3},colors:{type:Array,default:function(){return["#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","#ff4500","#ff7d4d","#00babd","#1f93ff","#fa64c3"]}},position:{type:String},placement:{type:String},formatOptions:{type:[Boolean,Array],default:!1}},emits:["change","update:value","update:showPicker","overflowMax","closePicker","formatChange"],setup:function(i,t){var e=t.emit,n=v.ref([]),o=v.computed(function(){return v.unref(n).map(function(x){return rb(x,"hex",i.showAlpha)})}),r=v.ref("hex");v.watch(function(){return i.format},function(){r.value=i.format},{immediate:!0}),v.watch(function(){return i.value},function(){var x=i.value||"",T=Array.isArray(x)?x:[x];n.value=T.map(function(M){return rb(M,v.unref(r),i.showAlpha)})},{immediate:!0});var s=v.ref(void 0),l=v.computed(function(){return v.unref(n)[v.unref(s)]}),a=v.ref(!1);v.watch(function(){return i.showPicker},function(){a.value=i.showPicker},{immediate:!0});var h,d,u=v.ref(null),c=v.ref(null),g=qM(u,c,{defaultStyle:{zIndex:i.zIndex},strategy:i.position,placement:i.placement}).style,f=function(){v.unref(u)==null&&(u.value=v.unref(R)[0]),v.unref(s)==null&&(s.value=0),i.showPicker===void 0?a.value=!0:e("update:showPicker",!0)},p=function(){s.value=void 0,i.showPicker===void 0?a.value=!1:e("update:showPicker",!1),e("closePicker",v.toRaw(Array.isArray(i.value)||i.addColor?v.unref(n):v.unref(n)[0]))},m=v.ref(),b=function(){var x=$M(qg.mark(function T(M){var B,P,F,H;return qg.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(P=M.target,(F=(B=P.dataset)===null||B===void 0?void 0:B.index)!=null&&F!==""){E.next=4;break}return E.abrupt("return");case 4:if(H=+F,v.unref(s)!==H){E.next=7;break}return E.abrupt("return");case 7:v.unref(s)!=null&&v.unref(s)!==H?(p(),h&&clearTimeout(h),h=setTimeout(function(){f(),clearTimeout(h)},100)):f(),s.value=H,u.value=P;case 10:case"end":return E.stop()}},T)}));return function(T){return x.apply(this,arguments)}}(),C=function(){var x=$M(qg.mark(function T(M){var B,P,F,H,E;return qg.wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(H=M.target,!(!((B=v.unref(m))!==null&&B!==void 0&&B.isEqualNode(H))&&(!((P=v.unref(m))===null||P===void 0)&&P.contains(H)))){k.next=4;break}return k.abrupt("return");case 4:if(E=(F=v.unref(c))===null||F===void 0?void 0:F.$el,!(E!=null&&E.contains(H))){k.next=8;break}return k.abrupt("return");case 8:d&&clearTimeout(d),d=setTimeout(function(){v.unref(a)&&p()},0);case 10:case"end":return k.stop()}},T)}));return function(T){return x.apply(this,arguments)}}();v.watch(a,function(){v.unref(a)&&(f(),clearTimeout(d))});var _,w=v.ref(i.max>v.unref(n).length),y=v.computed(function(){return typeof i.popupContainer=="string"||jl(i.popupContainer)==="object"&&i.popupContainer!=null?i.popupContainer:"body"}),S=v.computed(function(){return typeof i.popupContainer=="boolean"&&i.popupContainer===!1}),A=v.computed(function(){return i.theme});v.watch(function(){return[i.theme,v.unref(c)]},function(){v.nextTick(function(){var x,T;(x=v.unref(m))===null||x===void 0||x.setAttribute("pick-colors-theme",v.unref(A)),(T=v.unref(c))===null||T===void 0||(T=T.$el)===null||T===void 0||T.setAttribute("pick-colors-theme",v.unref(A))})},{immediate:!0}),v.provide("theme",{theme:A});var R=v.ref([]);return v.onMounted(function(){document.addEventListener("mouseup",C,!1),i.showPicker&&f()}),v.onUnmounted(function(){document.removeEventListener("mouseup",C,!1),h&&(clearTimeout(h),h=null),d&&(clearTimeout(d),d=null)}),{valueList:n,colorItemSelected:function(x){return(i.addColor?v.unref(n).length>0:v.unref(n).length>1)&&v.unref(s)===x},selectedColor:l,selectedIndex:s,isShowPicker:a,addColorItemShow:w,onPickerChange:function(x){var T=v.unref(s),M=v.unref(n).slice(),B=v.unref(n).length;if(T!=null){T>=0?M[T]=x:(s.value=B,M.push(x));var P="";P=Array.isArray(i.value)||i.addColor?M:x,n.value=Array.isArray(P)?P:[P],e("update:value",P),e("change",P,x,T),i.addColor&&B>=i.max&&(w.value=!1,e("overflowMax"))}},colorPicker:m,onColorClick:b,pickerRef:c,onColorItemDragStart:function(x){x.dataTransfer.effectAllowed="move";var T=x.target;_=+T.dataset.index},onColorItemDragOver:function(x){},onColorItemDrop:function(x){var T=+x.target.dataset.index,M=uU(v.unref(n)),B=M[_];M.splice(_,1);var P=M.slice(0,T),F=M.splice(T),H=P.concat([B]).concat(F);e("update:value",H),e("change",H,H[_],_)},colorItemsRef:R,pickerStyle:g,values:o,teleportDisabled:S,toPopupContainer:y,formatValue:r,onFormatChange:function(x){r.value=x,e("formatChange",x)}}}});Mo(".color-picker[data-v-3c43ade8]{display:inline-block}.color-item[data-v-3c43ade8]{margin:5px}.add-color-item[data-v-3c43ade8]{display:inline-block;margin:5px}.picker[data-v-3c43ade8]{overflow:hidden}.v-enter-active[data-v-3c43ade8],.v-leave-active[data-v-3c43ade8]{opacity:1;transform:scaleY(1);transform-origin:center top;transition:opacity .2s ease-in-out,transform .2s ease-in-out}.v-enter-from[data-v-3c43ade8],.v-leave-to[data-v-3c43ade8]{opacity:0;transform:scaleY(0)}"),df.render=function(i,t,e,n,o,r){var s=v.resolveComponent("color-item"),l=v.resolveComponent("add-color-item"),a=v.resolveComponent("picker");return v.openBlock(),v.createElementBlock("div",{class:"color-picker",ref:"colorPicker",onDragstart:t[0]||(t[0]=v.withModifiers(function(){return i.onColorItemDragStart&&i.onColorItemDragStart.apply(i,arguments)},["stop"])),onDragover:t[1]||(t[1]=v.withModifiers(function(){return i.onColorItemDragOver&&i.onColorItemDragOver.apply(i,arguments)},["prevent","stop"])),onDrop:t[2]||(t[2]=v.withModifiers(function(){return i.onColorItemDrop&&i.onColorItemDrop.apply(i,arguments)},["prevent","stop"])),onClick:t[3]||(t[3]=v.withModifiers(function(){return i.onColorClick&&i.onColorClick.apply(i,arguments)},["stop"]))},[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.values,function(h,d){return v.openBlock(),v.createBlock(s,{class:"color-item",key:d,ref_for:!0,ref:function(u){return i.colorItemsRef[d]=u},size:i.size,width:i.width,height:i.height,value:h,selected:i.colorItemSelected(d),"data-index":d,draggable:i.valueList.length>1,format:i.formatValue},null,8,["size","width","height","value","selected","data-index","draggable","format"])}),128)),i.addColor&&i.addColorItemShow?(v.openBlock(),v.createBlock(l,{key:0,class:"add-color-item",ref:"addColorItem",selected:i.colorItemSelected(-1),"data-index":-1},null,8,["selected"])):v.createCommentVNode("v-if",!0),(v.openBlock(),v.createBlock(v.Teleport,{to:i.toPopupContainer,disabled:i.teleportDisabled},[v.createVNode(v.Transition,null,{default:v.withCtx(function(){return[i.isShowPicker?(v.openBlock(),v.createBlock(a,{key:0,class:"picker",style:v.normalizeStyle(i.pickerStyle),ref:"pickerRef",value:i.selectedColor,format:i.formatValue,"show-alpha":i.showAlpha,colors:i.colors,formatOptions:i.formatOptions,onChange:i.onPickerChange,onFormatChange:i.onFormatChange},null,8,["style","value","format","show-alpha","colors","formatOptions","onChange","onFormatChange"])):v.createCommentVNode("v-if",!0)]}),_:1})],8,["to","disabled"]))],544)},df.__scopeId="data-v-3c43ade8",df.__file="src/ColorPicker.vue";const PX="",RU=v.defineComponent({name:"ColorPick",components:{PickColors:df},props:{value:{type:String,default:""}},setup(i,{emit:t}){const e=v.ref(i.value);v.watch(()=>i.value,o=>{e.value=o},{immediate:!0});function n(){t("changeProp",v.unref(e))}return{myValue:e,onChange:n}}}),AU={class:"color-pick"};function TU(i,t,e,n,o,r){const s=v.resolveComponent("a-input"),l=v.resolveComponent("pick-colors");return v.openBlock(),v.createElementBlock("div",AU,[v.createVNode(s,{class:"input",size:"small",value:i.myValue,"onUpdate:value":t[0]||(t[0]=a=>i.myValue=a),onChange:i.onChange},null,8,["value","onChange"]),v.createVNode(l,{value:i.myValue,"onUpdate:value":t[1]||(t[1]=a=>i.myValue=a),onChange:i.onChange},null,8,["value","onChange"])])}const MU=Ti(RU,[["render",TU],["__scopeId","data-v-99378939"]]),BU=v.defineComponent({name:"Radio",props:{value:{type:String,default:""},options:{type:Array,default(){return[]}}},setup(i,{emit:t}){function e(n){t("changeProp",n.target.value)}return{onChange:e}}});function PU(i,t,e,n,o,r){const s=v.resolveComponent("a-radio-group");return v.openBlock(),v.createBlock(s,{value:i.value,size:"small",onChange:i.onChange,options:i.options,optionType:"button"},null,8,["value","onChange","options"])}const HU=Ti(BU,[["render",PU]]),HX="",EU=v.defineComponent({name:"PropertyConfig",components:{ColorPick:MU,Radio:HU},props:{config:{type:Object,default(){return{}}},selectedIndex:{type:Boolean}},setup(i){const t=v.inject("theme","light"),e=[{label:"字体颜色",key:"color",component:"color-pick"},{label:"对齐方式",key:"align",component:"radio",props:{options:[{label:"左",value:"left"},{label:"中",value:"center"},{label:"右",value:"right"}]}},{label:"图标",key:"icon",component:"radio",props:{options:[{label:"上涨",value:"increase"},{label:"下跌",value:"decline"}]}},{label:"图标颜色",key:"iconColor",component:"color-pick"}],n=v.ref([]);v.watch(()=>i.selectedIndex,()=>{if(i.selectedIndex>-1){const l=Object.keys(i.config);n.value=l}});function o(l,a){i.config[l]=a}function r(l,a){if(l.target.checked)i.config[a]="",v.unref(n).push(a);else{delete i.config[a];const h=v.unref(n).indexOf(a);v.unref(n).splice(h,1)}}const s=v.computed(()=>v.unref(t)==="darkBlue"?"#b2c3dd":"");return{formConfig:e,handleSelect:r,selectedProperty:n,onChange:o,fontColor:s}}}),LU={class:"content"},kU={class:"list"};function FU(i,t,e,n,o,r){const s=v.resolveComponent("a-checkbox");return v.openBlock(),v.createElementBlock("div",LU,[v.createElementVNode("div",{style:v.normalizeStyle({color:i.fontColor,height:"32px",lineHeight:"32px"})},"属性配置",4),v.createElementVNode("div",kU,[i.selectedIndex>-1?(v.openBlock(!0),v.createElementBlock(v.Fragment,{key:0},v.renderList(i.formConfig,({label:l,component:a,props:h,key:d},u)=>(v.openBlock(),v.createElementBlock("div",{class:"list-item",style:{display:"flex"},key:u},[v.createVNode(s,{checked:i.selectedProperty.includes(d),onChange:c=>i.handleSelect(c,d)},null,8,["checked","onChange"]),v.createElementVNode("span",{style:v.normalizeStyle({padding:"0 8px",color:i.fontColor})},v.toDisplayString(l),5),i.selectedProperty.includes(d)?(v.openBlock(),v.createBlock(v.resolveDynamicComponent(a),v.mergeProps({key:0,value:i.config[d],ref_for:!0},h,{onChangeProp:c=>i.onChange(d,c)}),null,16,["value","onChangeProp"])):v.createCommentVNode("",!0)]))),128)):v.createCommentVNode("",!0)])])}const IU=Ti(EU,[["render",FU],["__scopeId","data-v-b2df2e2d"]]),DU=v.defineComponent({name:"ConditionalProperty",props:{},components:{ConditionalItemConfig:X$,ConditionalConfig:oG,PropertyConfig:IU},setup(i,{emit:t,expose:e}){const n=v.ref(!1),o=v.ref([]),r=v.ref(-1),s=v.inject("theme","light"),l=v.inject("getContainer",()=>{});let a="";const h=v.computed(()=>v.unref(r)>-1?v.unref(o)[v.unref(r)]:{});function d(f,p=[]){a=f,o.value=p,n.value=!0}function u(f){r.value=f}function c(){t("change",a,v.unref(o)),r.value=-1,n.value=!1}function g(){r.value=-1,o.value=[]}return v.watch(n,f=>{window.modalShow&&window.modalShow(f)}),e({showModal:d}),{theme:s,visible:n,config:o,changeSelectedItem:u,selectedConfig:h,selectedIndex:r,handleOk:c,handleClear:g,getContainer:l}}}),OU={style:{display:"flex"}};function zU(i,t,e,n,o,r){const s=v.resolveComponent("conditional-item-config"),l=v.resolveComponent("conditional-config"),a=v.resolveComponent("property-config"),h=v.resolveComponent("a-button"),d=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(d,{wrapClassName:i.theme,title:"条件属性",visible:i.visible,"onUpdate:visible":t[1]||(t[1]=u=>i.visible=u),"ok-text":"确认","cancel-text":"取消",style:{width:"950px",top:"60px",height:"700px"},maskClosable:!1,destroyOnClose:!0,getContainer:i.getContainer,onOk:i.handleOk},{footer:v.withCtx(()=>[v.createVNode(h,{onClick:t[0]||(t[0]=u=>i.visible=!1)},{default:v.withCtx(()=>t[2]||(t[2]=[v.createTextVNode("取消")])),_:1}),v.createVNode(h,{onClick:i.handleClear},{default:v.withCtx(()=>t[3]||(t[3]=[v.createTextVNode("清除筛选")])),_:1},8,["onClick"]),v.createVNode(h,{type:"primary",onClick:i.handleOk},{default:v.withCtx(()=>t[4]||(t[4]=[v.createTextVNode("确定")])),_:1},8,["onClick"])]),default:v.withCtx(()=>[v.createElementVNode("div",OU,[v.createVNode(s,{config:i.config,onChange:i.changeSelectedItem},null,8,["config","onChange"]),v.createVNode(l,{config:i.selectedConfig.conditions,isSelected:i.selectedIndex>-1},null,8,["config","isSelected"]),v.createVNode(a,{config:i.selectedConfig,selectedIndex:i.selectedIndex},null,8,["config","selectedIndex"])])]),_:1},8,["wrapClassName","visible","getContainer","onOk"])}const WU=Ti(DU,[["render",zU]]),EX="",NU=v.defineComponent({name:"PivotChart",props:{data:{type:Object,default(){return{dimensionData:{},xLabel:"",yLabel:""}}}},components:{FilterOutlined:hM,MinusSquareOutlined:S$,PivotFilter:LT},setup(i,{expose:t}){const e=v.inject("theme","light"),n=v.ref();let o;const r=v.ref([]),s=v.computed(()=>{var H;return(H=v.unref(r)[v.unref(r).length-1])==null?void 0:H.key}),l=v.ref([]),a=v.ref(!1),h=v.ref(),d=v.ref({});let u={};const c=v.reactive({position:"absolute",top:"0",left:"0"});let g="",f;function p(){l.value=[],r.value=[],u={};const{dimensionData:H,xLabel:E}=i.data,k=H[E].map(I=>I.value);b(E,k),v.unref(r).push({key:E,drillValue:"",xAxisData:k}),C()}let m=[];v.onMounted(()=>{o=LB.init(n.value),w()});function b(H,E){const{yLabel:k,records:I}=i.data;let L=[];E.forEach(()=>{L.push(0)}),I.forEach(D=>{if(D[k]!==void 0){const O=E.indexOf(D[H]);if(O>-1){let N=!0;v.unref(r).forEach($=>{$.drillValue&&D[$.key]!==$.drillValue&&(N=!1)});const W=Number(D[k]);N&&!isNaN(W)&&(L[O]+=Number(W))}}}),L=L.map(D=>D.toFixed(2)),f={tooltip:{},xAxis:{data:E},yAxis:{},series:[{name:k,type:"bar",label:{show:!0,position:"top"},data:L}]},m=L,o.setOption(f)}function C(){const H=Object.keys(i.data.dimensionData),E=v.unref(r).map(I=>I.key),k=[];H.forEach(I=>{E.includes(I)||k.push(I)}),l.value=k}function _(){g="",a.value=!1}function w(){o.on("contextmenu",function(H){const{event:{event:E},name:k}=H;g=k,E.preventDefault(),c.left=E.offsetX+90+"px",c.top=E.offsetY+80+"px",a.value=!0}),document.addEventListener("click",_)}function y(H){const E=[],{records:k}=i.data;for(const I of k){let L=!0;for(const D of v.unref(r))D.drillValue&&I[D.key]!==D.drillValue&&(L=!1);L&&!E.includes(I[H])&&E.push(I[H])}return E}function S(H){v.unref(r)[v.unref(r).length-1].drillValue=g;const E=y(H);b(H,E),v.unref(r).push({key:H,drillValue:"",xAxisData:E}),C()}function A(H,E){v.unref(r).splice(H+1,v.unref(r).length-H-1),v.unref(r)[H].drillValue="";const k=y(E);b(E,k),B(),C()}function R(H,E){const k=f.series[0].data,I=f.xAxis.data,L=k.map((O,N)=>({value:O,label:I[N]}));let D;E==="asc"?H==="dimension"?D=L.sort((O,N)=>O.label.localeCompare(N.label)):D=L.sort((O,N)=>O.value-N.value):E==="desc"&&(H==="dimension"?D=L.sort((O,N)=>N.label.localeCompare(O.label)):D=L.sort((O,N)=>N.value-O.value)),f.series[0].data=D.map(O=>O.value),f.xAxis.data=D.map(O=>O.label),o.setOption(f)}function x(H){if(H==="dimension"){const E=y(v.unref(s));b(v.unref(s),E),B()}else u={},B()}function T(H){if(H==="dimension"){const E=v.unref(r)[v.unref(r).length-1].xAxisData.map(k=>({value:k}));d.value={fieldName:v.unref(s),key:v.unref(s),type:H,filterData:f.xAxis.data,valueList:E}}else H==="indicators"&&(d.value={fieldName:i.data.yLabel,key:i.data.yLabel,type:"indicators",filterData:u});v.nextTick(()=>{v.unref(h).showModal()})}function M({checkKeys:H,type:E}){E==="dimension"?b(v.unref(s),H):E==="indicators"&&(u=H,B())}function B(){const H=v.unref(r)[v.unref(r).length-1].xAxisData;let E=m.map((k,I)=>({value:k,label:H[I]}));E=E.filter(k=>P(k.value)),f.series[0].data=E.map(k=>k.value),f.xAxis.data=E.map(k=>k.label),o.setOption(f)}function P(H){let E=!1,{rule:k,value:I}=u;switch(I=Number(I),k){case"LESS":E=H<I;break;case"GREATER":E=H>I;break;case"EQUAL":E=H===I;break;case"NOT_EQUAL":E=H!==I;break;default:E=!0;break}return E}v.onBeforeUnmount(()=>{document.removeEventListener("click",_)}),t({init:p});const F=v.computed(()=>v.unref(e)==="darkBlue"?"#b2c3dd":"");return{echartRef:n,dropdownList:l,isShowMenu:a,curXLabel:s,menuStyle:c,drillDimension:S,dimensionMap:r,deleteDimension:A,handleSort:R,handleClear:x,handleFilter:T,pivotFilterRef:h,filterData:d,onFilterChange:M,fontColor:F}}}),VU={style:{display:"flex",height:"400px"}},jU={style:{flex:"0 0 200px"}},$U={style:{flex:"0 0 650px",height:"100%"}},GU={key:0,style:{display:"flex","align-items":"center"}},UU={key:0,class:"dimension-item"},KU={key:1,style:{height:"30px"}},YU={style:{width:"100%",height:"100%"},ref:"echartRef"},XU=["onClick"];function qU(i,t,e,n,o,r){const s=v.resolveComponent("filter-outlined"),l=v.resolveComponent("a-menu-item"),a=v.resolveComponent("a-menu"),h=v.resolveComponent("a-dropdown"),d=v.resolveComponent("minus-square-outlined"),u=v.resolveComponent("pivot-filter");return v.openBlock(),v.createElementBlock(v.Fragment,null,[v.createElementVNode("div",VU,[v.createElementVNode("div",jU,[v.createElementVNode("div",{style:v.normalizeStyle({color:i.fontColor})},[v.createTextVNode(" 横轴:"+v.toDisplayString(i.curXLabel)+" ",1),v.createVNode(h,null,{overlay:v.withCtx(()=>[v.createVNode(a,null,{default:v.withCtx(()=>[v.createVNode(l,{key:"asc",onClick:t[0]||(t[0]=c=>i.handleSort("dimension","asc"))},{default:v.withCtx(()=>t[8]||(t[8]=[v.createTextVNode("升序")])),_:1}),v.createVNode(l,{key:"desc",onClick:t[1]||(t[1]=c=>i.handleSort("dimension","desc"))},{default:v.withCtx(()=>t[9]||(t[9]=[v.createTextVNode("降序")])),_:1}),v.createVNode(l,{key:"filter",onClick:t[2]||(t[2]=c=>i.handleFilter("dimension"))},{default:v.withCtx(()=>t[10]||(t[10]=[v.createTextVNode("筛选")])),_:1}),v.createVNode(l,{key:"clear",onClick:t[3]||(t[3]=c=>i.handleClear("dimension"))},{default:v.withCtx(()=>t[11]||(t[11]=[v.createTextVNode("清除")])),_:1})]),_:1})]),default:v.withCtx(()=>[v.createVNode(s,{class:"filter-icon",style:v.normalizeStyle({color:i.fontColor})},null,8,["style"])]),_:1})],4),v.createElementVNode("div",{style:v.normalizeStyle({color:i.fontColor})},[v.createTextVNode(" 纵轴:"+v.toDisplayString(i.data.yLabel)+" ",1),v.createVNode(h,null,{overlay:v.withCtx(()=>[v.createVNode(a,null,{default:v.withCtx(()=>[v.createVNode(l,{key:"asc",onClick:t[4]||(t[4]=c=>i.handleSort("indicators","asc"))},{default:v.withCtx(()=>t[12]||(t[12]=[v.createTextVNode("升序")])),_:1}),v.createVNode(l,{key:"desc",onClick:t[5]||(t[5]=c=>i.handleSort("indicators","desc"))},{default:v.withCtx(()=>t[13]||(t[13]=[v.createTextVNode("降序")])),_:1}),v.createVNode(l,{key:"filter",onClick:t[6]||(t[6]=c=>i.handleFilter("indicators"))},{default:v.withCtx(()=>t[14]||(t[14]=[v.createTextVNode("筛选")])),_:1}),v.createVNode(l,{key:"clear",onClick:t[7]||(t[7]=c=>i.handleClear("indicators"))},{default:v.withCtx(()=>t[15]||(t[15]=[v.createTextVNode("清除")])),_:1})]),_:1})]),default:v.withCtx(()=>[v.createVNode(s,{class:"filter-icon",style:v.normalizeStyle({color:i.fontColor})},null,8,["style"])]),_:1})],4)]),v.createElementVNode("div",$U,[i.dimensionMap.length>1?(v.openBlock(),v.createElementBlock("div",GU,[v.createElementVNode("span",{style:v.normalizeStyle({color:i.fontColor})},"钻取维度:",4),(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.dimensionMap,(c,g)=>(v.openBlock(),v.createElementBlock(v.Fragment,{key:g},[c.drillValue?(v.openBlock(),v.createElementBlock("div",UU,[v.createVNode(d,{class:"dimension-icon",onClick:f=>i.deleteDimension(g,c.key)},null,8,["onClick"]),v.createTextVNode(v.toDisplayString(c.key)+"("+v.toDisplayString(c.drillValue)+") ",1)])):v.createCommentVNode("",!0)],64))),128))])):(v.openBlock(),v.createElementBlock("div",KU)),v.createElementVNode("div",YU,null,512)]),v.withDirectives(v.createElementVNode("div",{style:v.normalizeStyle(i.menuStyle),class:"dropdown-menu"},[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.dropdownList,c=>(v.openBlock(),v.createElementBlock("div",{class:"item",key:c,onClick:g=>i.drillDimension(c)},"下钻"+v.toDisplayString(c),9,XU))),128))],4),[[v.vShow,i.isShowMenu]])]),v.createVNode(u,{ref:"pivotFilterRef",data:i.filterData,onChange:i.onFilterChange},null,8,["data","onChange"])],64)}const ZU=Ti(NU,[["render",qU],["__scopeId","data-v-f29855b0"]]),JU=v.defineComponent({components:{PivotChart:ZU},name:"ChartModal",props:{},setup(i,{expose:t}){const e=v.inject("theme","light"),n=v.inject("getContainer",()=>{}),o=v.ref(!1),r=v.ref({}),s=v.ref();function l(a){r.value=a,o.value=!0,v.nextTick(()=>{s.value.init()})}return v.watch(o,a=>{window.modalShow&&window.modalShow(a)}),t({showModal:l}),{theme:e,visible:o,chartOptions:r,chartRef:s,getContainer:n}}});function QU(i,t,e,n,o,r){const s=v.resolveComponent("pivot-chart"),l=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(l,{wrapClassName:i.theme,visible:i.visible,"onUpdate:visible":t[0]||(t[0]=a=>i.visible=a),title:"图形",style:{width:"900px"},destroyOnClose:!0,footer:null,getContainer:i.getContainer},{default:v.withCtx(()=>[v.createVNode(s,{data:i.chartOptions,ref:"chartRef"},null,8,["data"])]),_:1},8,["wrapClassName","visible","getContainer"])}const tK=Ti(JU,[["render",QU]]),LX="",eK=v.defineComponent({name:"PivotAggregate",props:{},setup(i,{emit:t,expose:e}){const n=v.inject("getContainer",()=>{}),o=v.inject("scaleValue",{}),r=v.inject("theme","light"),s=v.inject("dimensionFieldList",[]),l=v.ref(!1),a=v.ref([]),h=v.ref(""),d=v.ref(""),u=v.ref(),c=[{label:"合计",value:"SUM"},{label:"平均值",value:"AVG"},{label:"计数",value:"COUNT"},{label:"最大值",value:"MAX"},{label:"最小值",value:"MIN"},{label:"方差",value:"VAR"},{label:"标准差",value:"STDEV"}];function g(){t("confirm",v.unref(a),h.value),l.value=!1}function f(C,_){a.value=Ye.cloneDeep(C),h.value=_,l.value=!0;const w=v.unref(s).find(y=>y.label===_);d.value=(w==null?void 0:w.title)||_}const p=v.ref({}),m=()=>document.getElementsByClassName("aggregate-modal")[0]||document.body,b=C=>{var _,w,y;if(C){const S=(_=v.unref(u))==null?void 0:_.getBoundingClientRect();if(S){const A=S.left/(((w=v.unref(o))==null?void 0:w.widthScale)||1)+"px",R=(S.top+S.height)/(((y=v.unref(o))==null?void 0:y.heightScale)||1)+"px";setTimeout(()=>{var M,B;const x=document.querySelectorAll(".ant-select-dropdown"),T=Array.from(x).filter(P=>window.getComputedStyle(P).display!=="none");if(T!=null&&T.length){const P=document.getElementsByClassName("aggregate-modal")[0];T[0].classList.add("aggregate-select-dropdown"),(M=P==null?void 0:P.style)==null||M.setProperty("--drop-down-left",A),(B=P==null?void 0:P.style)==null||B.setProperty("--drop-down-top",R),p.value={visibility:"visible"}}},200)}}else p.value={}};return v.watch(l,C=>{window.modalShow&&window.modalShow(C)}),e({showModal:f}),{theme:r,visible:l,aggregationType:a,options:c,dimensionKey:h,titleText:d,dropdownStyle:p,selectRef:u,handleOk:g,getPopupContainer:m,getContainer:n,dropdownVisibleChange:b}}}),iK={ref:"selectRef"};function nK(i,t,e,n,o,r){const s=v.resolveComponent("a-select"),l=v.resolveComponent("a-form-item"),a=v.resolveComponent("a-form"),h=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(h,{wrapClassName:i.theme+" aggregate-modal",visible:i.visible,"onUpdate:visible":t[1]||(t[1]=d=>i.visible=d),"ok-text":"确认","cancel-text":"取消",title:i.titleText+"-聚合",destroyOnClose:!1,maskClosable:!1,getContainer:i.getContainer,onOk:i.handleOk,onCancel:t[2]||(t[2]=d=>i.visible=!1)},{default:v.withCtx(()=>[v.createVNode(a,null,{default:v.withCtx(()=>[v.createVNode(l,{label:"聚合方式"},{default:v.withCtx(()=>[v.createElementVNode("div",iK,[v.createVNode(s,{value:i.aggregationType,"onUpdate:value":t[0]||(t[0]=d=>i.aggregationType=d),allowClear:"",mode:"multiple",dropdownClassName:"pivot-table-select-dropdown",options:i.options,getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:i.dropdownVisibleChange},null,8,["value","options","getPopupContainer","dropdownStyle","onDropdownVisibleChange"])],512)]),_:1})]),_:1})]),_:1},8,["wrapClassName","visible","title","getContainer","onOk"])}const oK=Ti(eK,[["render",nK]]),rK=v.defineComponent({name:"PivotTop",props:{},setup(i,{emit:t,expose:e}){const n=v.inject("theme","light"),o=v.inject("getContainer",()=>{}),r=v.ref(!1),s=v.ref(""),l=v.ref("");function a(){t("confirm",{value:v.unref(s),key:v.unref(l)}),r.value=!1}function h(d){const{value:u,key:c}=d;s.value=u,r.value=!0,l.value=c}return v.watch(r,d=>{window.modalShow&&window.modalShow(d)}),e({showModal:h}),{theme:n,visible:r,topNum:s,handleOk:a,getContainer:o}}});function sK(i,t,e,n,o,r){const s=v.resolveComponent("a-input"),l=v.resolveComponent("a-form-item"),a=v.resolveComponent("a-form"),h=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(h,{wrapClassName:i.theme,visible:i.visible,"onUpdate:visible":t[1]||(t[1]=d=>i.visible=d),"ok-text":"确认","cancel-text":"取消",title:"维度取Top",destroyOnClose:!0,getContainer:i.getContainer,onOk:i.handleOk},{default:v.withCtx(()=>[v.createVNode(a,null,{default:v.withCtx(()=>[v.createVNode(l,{label:"维度取Top"},{default:v.withCtx(()=>[v.createVNode(s,{value:i.topNum,"onUpdate:value":t[0]||(t[0]=d=>i.topNum=d),type:"number",style:{width:"100%"}},null,8,["value"])]),_:1})]),_:1})]),_:1},8,["wrapClassName","visible","getContainer","onOk"])}const lK=Ti(rK,[["render",sK]]);let Es=(i=21)=>{let t="",e=crypto.getRandomValues(new Uint8Array(i));for(;i--;){let n=e[i]&63;n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n<63?t+="_":t+="-"}return t};const kX="";Lo.locale("zh-cn");const aK=v.defineComponent({name:"PivotDetail",components:{ATable:ji.Table},props:{},setup(i,{emit:t,expose:e}){const n=v.inject("getContainer",()=>{}),o=v.inject("theme","light"),r=v.inject("pageId",""),s=v.inject("context",""),l=v.inject("indicatorUrl",""),a=v.inject("indicatorToken",""),h=v.inject("theDateInfo",{}),d=v.ref(!1),u=v.ref(!1),c=v.ref([]),g=v.ref([]),f=v.ref({current:1,pageSize:10,total:0,showSizeChanger:!1,showQuickJumper:!1,showTotal:b=>`共 ${b} 条数据`});async function p(b){var x;u.value=!0,d.value=!0;const{args:C={},dimension:_,indicator:w,splitSymbol:y}=b,{originData:S=[],cellHeaderPaths:{colHeaderPaths:A=[],rowHeaderPaths:R=[]}}=C;if(S!=null&&S.length){const T=S[0],M=A!=null&&A.length?A[A.length-1]:"",B=A.filter(O=>O.dimensionKey).concat(R.filter(O=>O.dimensionKey)).map(O=>O.dimensionKey);if(!(M!=null&&M.indicatorKey)||!B.length)return;const P=w.find(O=>O.label===M.indicatorKey),F={};for(const O of _)if(B.includes(O.label)){const W=(T[O.label]||"").split(y)||[];F[O.typeGuid]=W!=null&&W.length?W[W.length-1]:""}const{startTime:H,endTime:E,rangeFormat:k}=v.unref(h);H&&E&&(F.startTime=Lo(H).format(k),F.endTime=Lo(E).format(k));const I=await zr.post(`${v.unref(l)}/diagram/obtainDataSetData`,{pageId:v.unref(r),indexCode:(P==null?void 0:P.indexCode)||"",param:F},{headers:{Authentication:v.unref(a),operateContext:v.unref(s)}}),{columns:L=[],data:D=[]}=((x=I==null?void 0:I.data)==null?void 0:x.data)||{};c.value=L.filter(O=>O).map(O=>({title:O,dataIndex:O})),g.value=D.map(O=>({...O,uid:Es(6)}))}u.value=!1}v.watch(d,b=>{window.modalShow&&window.modalShow(b)});const m=b=>{v.unref(f).current=b.current};return e({showModal:p}),{theme:o,visible:d,loading:u,pagination:f,columns:c,dataSource:g,handleTableChange:m,getContainer:n}}}),hK={key:0,class:"spin-container"};function dK(i,t,e,n,o,r){const s=v.resolveComponent("a-spin"),l=v.resolveComponent("a-table"),a=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(a,{wrapClassName:i.theme,visible:i.visible,"onUpdate:visible":t[0]||(t[0]=h=>i.visible=h),width:"40%",title:"指标明细",destroyOnClose:!0,footer:null,bodyStyle:{maxHeight:"50vh",overflow:"auto"},getContainer:i.getContainer},{default:v.withCtx(()=>[i.loading?(v.openBlock(),v.createElementBlock("div",hK,[v.createVNode(s,{size:"large"})])):v.createCommentVNode("",!0),i.loading?v.createCommentVNode("",!0):(v.openBlock(),v.createBlock(l,{key:1,"row-key":h=>h.uid,columns:i.columns,"data-source":i.dataSource,pagination:i.pagination,onChange:i.handleTableChange},null,8,["row-key","columns","data-source","pagination","onChange"]))]),_:1},8,["wrapClassName","visible","getContainer"])}const uK=Ti(aK,[["render",dK],["__scopeId","data-v-32537b22"]]),cK=(i,t)=>{i.register.icon("dropdownIcon",{type:"svg",svg:`<svg width="${t.downSize}" height="${t.downSize}" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><rect x="2" y="1" width="20" height="20" rx="10" fill="white"/><rect x="2.5" y="1.5" width="19" height="19" rx="9.5" stroke="#959DA5"/></g><path d="M14.9492 9.39531C15.0086 9.31911 15.0165 9.21887 14.9698 9.1356C14.923 9.05234 14.8294 9 14.7273 9L9.27273 9C9.17057 9 9.07697 9.05234 9.03023 9.1356C8.98348 9.21887 8.99142 9.31911 9.0508 9.39531L11.7781 12.8953C11.8293 12.961 11.9119 13 12 13C12.0881 13 12.1707 12.961 12.2219 12.8953L14.9492 9.39531Z" fill="#4F5965"/></svg>`,width:t.downSize,height:t.downSize,funcType:i.TYPES.IconFuncTypeEnum.dropDown,positionType:i.TYPES.IconPosition.absoluteRight,name:"dropdownIcon",marginRight:0,hover:{width:t.downSize,height:t.downSize,bgColor:"rgba(101, 117, 168, 0.1)",image:`<svg width="${t.downSize}" height="${t.downSize}" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><rect x="2" y="1" width="20" height="20" rx="10" fill="#1E54C9"/><rect x="2.5" y="1.5" width="19" height="19" rx="9.5" stroke="#141414" stroke-opacity="0.2"/></g><path d="M14.9492 9.39531C15.0086 9.31911 15.0165 9.21887 14.9698 9.1356C14.923 9.05234 14.8294 9 14.7273 9L9.27273 9C9.17057 9 9.07697 9.05234 9.03023 9.1356C8.98348 9.21887 8.99142 9.31911 9.0508 9.39531L11.7781 12.8953C11.8293 12.961 11.9119 13 12 13C12.0881 13 12.1707 12.961 12.2219 12.8953L14.9492 9.39531Z" fill="white"/></svg>`},cursor:"pointer",visibleTime:"mouseenter_cell"}),i.register.icon("sortDown",{name:"sortDown",type:"svg",positionType:i.TYPES.IconPosition.contentRight,width:t.iconSize,visibleTime:"always",height:t.iconSize,svg:`<svg t="1736221132194" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1418" width="60" height="60"><path d="M512 85.333333l256 341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1419"></path><path d="M512 938.666667l256-341.333334H256z" fill="${t.sortActiveColor}" p-id="1420"></path></svg>`,marginLeft:5,hover:{width:t.hoverSize,height:t.hoverSize,bgColor:"#DEE4ED80"},cursor:"pointer",tooltip:{title:"取消排序",placement:"top"}}),i.register.icon("sortUp",{name:"sortUp",type:"svg",positionType:i.TYPES.IconPosition.contentRight,width:t.iconSize,visibleTime:"always",height:t.iconSize,svg:`<svg t="1736221132194" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1418" width="60" height="60"><path d="M512 85.333333l256 341.333334H256z" fill="${t.sortActiveColor}" p-id="1419"></path><path d="M512 938.666667l256-341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1420"></path></svg>`,marginLeft:5,hover:{width:t.hoverSize,height:t.hoverSize,bgColor:"#DEE4ED80"},cursor:"pointer",tooltip:{title:"点击降序",placement:"top"}}),i.register.icon("sortNormal",{name:"sortNormal",type:"svg",positionType:i.TYPES.IconPosition.contentRight,width:t.iconSize,visibleTime:"always",height:t.iconSize,svg:`<svg t="1736221132194" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1418" width="60" height="60"><path d="M512 85.333333l256 341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1419"></path><path d="M512 938.666667l256-341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1420"></path></svg>`,marginLeft:5,hover:{width:t.hoverSize,height:t.hoverSize,bgColor:"#DEE4ED80"},cursor:"pointer",tooltip:{title:"点击升序",placement:"top"}})},gK=v.defineComponent({props:{node:{type:[Object,String],required:!0}},render(){return this.node}}),fK={mounted(i){i.focus()}},pK=v.defineComponent({name:"PivotConfig",directives:{focus:fK},props:{fullMode:{type:Boolean,default:!1}},components:{VNodeRender:gK,draggable:Bb,DeleteOutlined:lM},setup(i,{emit:t,expose:e}){const n=v.inject("theme","light"),o=v.inject("getContainer",()=>{}),r=v.ref(!1),s=v.ref(),l=v.ref([]),a=v.ref([{title:"行维度",icon:v.createVNode(c$),fields:[]},{title:"列维度",icon:v.createVNode(a$),fields:[]},{title:"指标",icon:v.createVNode(O$),fields:[]}]),h=(A=[],R=[])=>{for(const x of v.unref(a))x.fields=[];for(const x of A)x.positionType==="rows"?v.unref(a)[0].fields.push(Ye.cloneDeep(x)):x.positionType==="columns"&&v.unref(a)[1].fields.push(Ye.cloneDeep(x));v.unref(a)[2].fields=Ye.cloneDeep(R),r.value=!0},d=v.computed(()=>[...v.unref(a)[0].fields.map(A=>({...A,label:A.showTitle,positionType:"rows"})),...v.unref(a)[1].fields.map(A=>({...A,label:A.showTitle,positionType:"columns"}))]),u=v.computed(()=>v.unref(a)[2].fields),c=()=>{l.value=[],t("confirm",v.unref(d),v.unref(u)),r.value=!1},g=(A,R)=>{const x=R[A.oldIndex],{scope:T}=x;["IDX","BUILT_IN_IDX"].includes(T)?l.value=[0,1]:["DIM","BUILT_IN_DIM"].includes(T)&&(l.value=[2])},f=()=>{l.value=[]},p=()=>{a.value=Ye.cloneDeep(v.unref(a))},m=(A,R)=>{v.unref(a)[A].fields.splice(R,1)},b=v.ref(),C=v.ref(),_=v.ref(""),w=(A,R)=>{i.fullMode&&(b.value=`${A}_${R}`,C.value=Ye.cloneDeep(v.unref(a)[A].fields[R]))},y=()=>{if(v.unref(_)){const A=v.unref(b).split("_");ji.message.error(v.unref(_)),v.unref(a)[A[0]].fields[A[1]].showTitle=v.unref(C).showTitle,_.value=""}b.value=""},S=A=>{const R=A.target.value,x=v.unref(d).concat(v.unref(u));R?x.find(M=>M.name!==v.unref(C).name&&M.showTitle===R)&&(_.value="名称不能重复"):_.value="不能为空"};return v.watch(r,A=>{window.modalShow&&window.modalShow(A)}),e({showModal:h}),{theme:n,visible:r,fieldAreas:a,indSourceRef:s,maskList:l,currentEditItem:b,handleOk:c,onDragAreaStart:g,onDragEnd:f,handleDeleteField:m,handleEdit:w,onConfirmLabel:y,onDragAdd:p,onChangeLabel:S,getContainer:o}}}),FX="",mK={class:"config-wrap"},vK={class:"area-content"},bK={class:"area-title"},CK={class:"field-item"},yK=["onClick"];function _K(i,t,e,n,o,r){const s=v.resolveComponent("v-node-render"),l=v.resolveComponent("a-input"),a=v.resolveComponent("delete-outlined"),h=v.resolveComponent("draggable"),d=v.resolveComponent("a-button"),u=v.resolveComponent("a-modal"),c=v.resolveDirective("focus");return v.openBlock(),v.createBlock(u,{wrapClassName:`${i.theme}`,title:"设置",visible:i.visible,"onUpdate:visible":t[1]||(t[1]=g=>i.visible=g),"ok-text":"确认","cancel-text":"取消",maskClosable:!1,destroyOnClose:!1,style:{width:"500px"},bodyStyle:{padding:0},getContainer:i.getContainer,onOk:i.handleOk},{footer:v.withCtx(()=>[v.createVNode(d,{onClick:t[0]||(t[0]=g=>i.visible=!1)},{default:v.withCtx(()=>t[2]||(t[2]=[v.createTextVNode("取消")])),_:1}),v.createVNode(d,{type:"primary",onClick:i.handleOk},{default:v.withCtx(()=>t[3]||(t[3]=[v.createTextVNode("确定")])),_:1},8,["onClick"])]),default:v.withCtx(()=>[v.createElementVNode("div",mK,[v.createElementVNode("div",vK,[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.fieldAreas,(g,f)=>(v.openBlock(),v.createElementBlock("div",{class:"area-item",key:f},[v.createElementVNode("div",bK,[v.createVNode(s,{class:"area-icon",node:g.icon},null,8,["node"]),v.createTextVNode(" "+v.toDisplayString(g.title),1)]),v.createVNode(h,{class:"area-list",list:g.fields,"item-key":"index",group:{name:"diGroup"},disabled:i.maskList.includes(f),onStart:p=>i.onDragAreaStart(p,g.fields),onEnd:i.onDragEnd,onAdd:i.onDragAdd},{item:v.withCtx(({index:p,element:m})=>[v.createElementVNode("div",CK,[i.currentEditItem===`${f}_${p}`?v.withDirectives((v.openBlock(),v.createBlock(l,{key:0,size:"small",value:m.showTitle,"onUpdate:value":b=>m.showTitle=b,onPressEnter:i.onConfirmLabel,onBlur:i.onConfirmLabel,onChange:i.onChangeLabel},null,8,["value","onUpdate:value","onPressEnter","onBlur","onChange"])),[[c]]):(v.openBlock(),v.createElementBlock("div",{key:1,style:{width:"100%"},onClick:b=>i.handleEdit(f,p)},v.toDisplayString(m.showTitle),9,yK)),i.fullMode?(v.openBlock(),v.createBlock(a,{key:2,style:{color:"red","padding-left":"8px"},onClick:b=>i.handleDeleteField(f,p)},null,8,["onClick"])):v.createCommentVNode("",!0)])]),_:2},1032,["list","disabled","onStart","onEnd","onAdd"])]))),128))])])]),_:1},8,["wrapClassName","visible","getContainer","onOk"])}const wK=Ti(pK,[["render",_K],["__scopeId","data-v-b39c2a7b"]]),SK=v.defineComponent({name:"IndSourceList",components:{CaretRightOutlined:Dj,CaretDownOutlined:Lj,LoadingOutlined:m$,Draggable:Bb},props:{data:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},isSub:{type:Boolean,default:!1},hasChildren:{type:Boolean,default:!1}},setup(i,{emit:t,expose:e}){const n=v.inject("indicatorUrl",""),o=v.inject("indicatorToken",""),r=v.inject("pageId",""),s=v.inject("setItemDisabled",S=>!1),l=v.ref([]),a=v.ref(),h=v.reactive({pageSize:20,currentPage:1,totalResult:0}),d=v.ref(!1),u=v.ref(""),c=v.ref(!1);v.watch(()=>i.data,S=>{i.isSub&&(S==null||S.forEach(A=>{var R;A!=null&&A.isLeaf||(R=A.dataViewColumns)==null||R.forEach(x=>{x.show=!0,x.edit=!1,x.title&&(x.label=x.title)})}),l.value=S)},{deep:!0,immediate:!0});const g=()=>{var S;i.isSub||(S=v.unref(a))==null||S.removeEventListener("scroll",_)},f=async S=>{var R;if(v.unref(d))return;d.value=!0;const A={source:i.config.source||"INDICATOR_LIB",pageId:v.unref(r),dataSourceId:i.config.dataSourceId||"",indexName:u.value};S?(S.loading=!0,A.indexTypeGuid=S.indexTypeGuid,A.isLeaf=S.isLeaf):h&&(A.queryRequest={pageSize:h.pageSize,pageNum:h.currentPage});try{const x=await zr.post(`${v.unref(n)}/diagram/sourceList`,A,{headers:{Authentication:o,operateContext:"ygt"}}),{success:T,data:M={}}=x.data;if(T){const{rows:B=[],total:P=0}=M;B==null||B.forEach(F=>{var H;(S==null?void 0:S.isLeaf)==="1"?(H=F.dataViewColumns)==null||H.forEach(E=>{E.show=!0,E.edit=!1,E.title&&(E.label=E.title)}):F.show=!1}),S?(S.children=B,S.show=!0,B!=null&&B.length||(S.noData=!0)):(l.value=v.unref(l).concat(B),h.totalResult=+P,((R=v.unref(l))==null?void 0:R.length)>=P&&g())}S&&(S.loading=!1),d.value=!1}catch{S&&(S.loading=!1),d.value=!1}},p=async S=>{const A=l.value[S],{children:R=[]}=A;R!=null&&R.length?A.show=!A.show:!A.noData&&A.isLeaf?f(A):A.noData&&(A.show=!A.show)},m=(S,A)=>{t("onDragStart",S,A)},b=()=>{t("onDragEnd")},C=S=>{S.show=!S.show},_=S=>{S.target.scrollTop+S.target.clientHeight+20>=S.target.scrollHeight&&(h.currentPage++,f())},w=async()=>{await f(),v.nextTick(async()=>{v.unref(a).scrollHeight===v.unref(a).clientHeight&&h.totalResult>v.unref(l).length&&(h.currentPage++,w())})},y=async S=>{var A;g(),c.value=!0,h.currentPage=1,h.totalResult=0,l.value=[],u.value=S,await w(),c.value=!1,(A=v.unref(a))==null||A.addEventListener("scroll",_)};return v.onMounted(async()=>{var S;i.isSub||(w(),(S=v.unref(a))==null||S.addEventListener("scroll",_))}),v.onUnmounted(()=>{g()}),e({handleSearch:y}),{columnRef:a,sourceList:l,searchLoading:c,onToggleGroup:p,onToggleSource:C,setItemDisabled:s,onDragStart:m,onDragEnd:b,mapDataSetScope:V2,mapScope:N2,getLoadType:j2,getUseType:$2,getSourceType:G2}}}),IX="",xK={key:0,class:"no-data"},RK={class:"column-item"},AK=["onClick"],TK={key:3,class:"item-name"},MK={class:"column-item"},BK={key:0},PK={key:1},HK={key:2},EK={key:3},LK=["onClick"],kK={class:"item-name"},FK={class:"column-child-item"},IK={class:"field"},DK={class:"column-child-item-name"};function OK(i,t,e,n,o,r){const s=v.resolveComponent("loading-outlined"),l=v.resolveComponent("caret-down-outlined"),a=v.resolveComponent("caret-right-outlined"),h=v.resolveComponent("ind-source-list",!0),d=v.resolveComponent("a-tooltip"),u=v.resolveComponent("draggable"),c=v.resolveComponent("a-spin");return v.openBlock(),v.createElementBlock("div",{class:v.normalizeClass(["columns",i.isSub?"sub-columns":""]),ref:"columnRef"},[v.createVNode(c,{spinning:i.searchLoading,tip:"数据源加载中..."},{default:v.withCtx(()=>{var g;return[!((g=i.sourceList)!=null&&g.length)&&!i.searchLoading?(v.openBlock(),v.createElementBlock("div",xK,"暂无数据")):i.hasChildren?(v.openBlock(!0),v.createElementBlock(v.Fragment,{key:1},v.renderList(i.sourceList,(f,p)=>(v.openBlock(),v.createElementBlock(v.Fragment,{key:f.indexTypeGuid||f.id},[v.createElementVNode("div",RK,[v.createElementVNode("span",{class:"item-group",onClick:m=>i.onToggleGroup(p)},[f.loading?(v.openBlock(),v.createBlock(s,{key:0})):f.show?(v.openBlock(),v.createBlock(l,{key:1})):(v.openBlock(),v.createBlock(a,{key:2})),f.isLeaf?(v.openBlock(),v.createElementBlock("span",TK,v.toDisplayString(f.indexTypeCode+"."+f.indexTypeName),1)):v.createCommentVNode("",!0)],8,AK)]),f.show?(v.openBlock(),v.createBlock(h,{key:0,data:f.children,isSub:!0,hasChildren:f.isLeaf==="0",config:i.config,onOnDragStart:i.onDragStart,onOnDragEnd:i.onDragEnd},null,8,["data","hasChildren","config","onOnDragStart","onOnDragEnd"])):v.createCommentVNode("",!0)],64))),128)):(v.openBlock(!0),v.createElementBlock(v.Fragment,{key:2},v.renderList(i.sourceList,f=>(v.openBlock(),v.createElementBlock("div",{key:f.id,class:v.normalizeClass(i.setItemDisabled(f.dataViewColumns)?"column-disabled":"")},[v.createElementVNode("div",MK,[v.createVNode(d,null,{title:v.withCtx(()=>[v.createElementVNode("div",null,"加载类型:"+v.toDisplayString(i.getLoadType(f.loadType)),1),f.useType?(v.openBlock(),v.createElementBlock("div",BK,"数据使用系统:"+v.toDisplayString(i.getUseType(f.useType)),1)):v.createCommentVNode("",!0),f.systemSource?(v.openBlock(),v.createElementBlock("div",PK,"制度出处:"+v.toDisplayString(f.systemSource),1)):v.createCommentVNode("",!0),f.dataTo?(v.openBlock(),v.createElementBlock("div",HK,"数据来源:"+v.toDisplayString(i.getSourceType(f.dataTo)),1)):v.createCommentVNode("",!0),f.meaning?(v.openBlock(),v.createElementBlock("div",EK,"指标含义:"+v.toDisplayString(f.meaning),1)):v.createCommentVNode("",!0)]),default:v.withCtx(()=>[v.createElementVNode("span",{class:"item-group",onClick:p=>i.onToggleSource(f)},[f.show?(v.openBlock(),v.createBlock(l,{key:0})):(v.openBlock(),v.createBlock(a,{key:1})),v.createElementVNode("span",kK,v.toDisplayString((f.indexCode?f.indexCode:"")+" "+f.name),1)],8,LK)]),_:2},1024)]),f.show?(v.openBlock(),v.createBlock(u,{key:0,modelValue:f.dataViewColumns,"onUpdate:modelValue":p=>f.dataViewColumns=p,group:{name:"diGroup",pull:"clone",put:!1},"item-key":"id",sort:!1,disabled:i.setItemDisabled(f.dataViewColumns),filter:".not-allow",onStart:p=>i.onDragStart(p,f),onEnd:i.onDragEnd},{item:v.withCtx(({element:p})=>[v.createElementVNode("div",FK,[v.createElementVNode("span",IK,"【"+v.toDisplayString(p.scope==="FIELD"?i.mapDataSetScope(p.genericType):i.mapScope(p.scope))+"】",1),v.createElementVNode("span",DK,v.toDisplayString(p.label),1)])]),_:2},1032,["modelValue","onUpdate:modelValue","disabled","onStart","onEnd"])):v.createCommentVNode("",!0)],2))),128))]}),_:1},8,["spinning"])],2)}const zK=Ti(SK,[["render",OK],["__scopeId","data-v-aabcdc1c"]]),WK=v.defineComponent({name:"DragArea",props:{style:{type:Object,default:()=>({})},maskList:{type:Array,default:()=>[]}},setup(i,{emit:t}){return{onDragOver:s=>{s.preventDefault(),s.target.classList.add("highlight")},onDragLeave:s=>{s.preventDefault(),s.target.classList.remove("highlight")},onDragEnd:s=>{s.preventDefault(),s.target.classList.remove("highlight")},onDrop:s=>{s.preventDefault(),s.target.classList.remove("highlight");const l=Array.from(s.target.classList);l.includes("rows")?t("add","rows"):l.includes("columns")?t("add","columns"):l.includes("indicators")?t("add","indicators"):l.includes("filters")&&t("add","filters")}}}}),DX="";function NK(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",{class:"drag-area",style:v.normalizeStyle(i.style.main)},[i.maskList.includes(2)?(v.openBlock(),v.createElementBlock("div",{key:0,class:"area-wrap filters",onDragover:t[0]||(t[0]=(...s)=>i.onDragOver&&i.onDragOver(...s)),onDragleave:t[1]||(t[1]=(...s)=>i.onDragLeave&&i.onDragLeave(...s)),onDragend:t[2]||(t[2]=(...s)=>i.onDragEnd&&i.onDragEnd(...s)),onDrop:t[3]||(t[3]=(...s)=>i.onDrop&&i.onDrop(...s)),style:v.normalizeStyle(i.style.filters)},null,36)):v.createCommentVNode("",!0),i.maskList.includes(0)?v.createCommentVNode("",!0):(v.openBlock(),v.createElementBlock("div",{key:1,class:"area-wrap rows",onDragover:t[4]||(t[4]=(...s)=>i.onDragOver&&i.onDragOver(...s)),onDragleave:t[5]||(t[5]=(...s)=>i.onDragLeave&&i.onDragLeave(...s)),onDragend:t[6]||(t[6]=(...s)=>i.onDragEnd&&i.onDragEnd(...s)),onDrop:t[7]||(t[7]=(...s)=>i.onDrop&&i.onDrop(...s)),style:v.normalizeStyle(i.style.rows)},null,36)),i.maskList.includes(1)?v.createCommentVNode("",!0):(v.openBlock(),v.createElementBlock("div",{key:2,class:"area-wrap columns",onDragover:t[8]||(t[8]=(...s)=>i.onDragOver&&i.onDragOver(...s)),onDragleave:t[9]||(t[9]=(...s)=>i.onDragLeave&&i.onDragLeave(...s)),onDragend:t[10]||(t[10]=(...s)=>i.onDragEnd&&i.onDragEnd(...s)),onDrop:t[11]||(t[11]=(...s)=>i.onDrop&&i.onDrop(...s)),style:v.normalizeStyle(i.style.columns)},null,36)),i.maskList.includes(2)?v.createCommentVNode("",!0):(v.openBlock(),v.createElementBlock("div",{key:3,class:"area-wrap indicators",onDragover:t[12]||(t[12]=(...s)=>i.onDragOver&&i.onDragOver(...s)),onDragleave:t[13]||(t[13]=(...s)=>i.onDragLeave&&i.onDragLeave(...s)),onDragend:t[14]||(t[14]=(...s)=>i.onDragEnd&&i.onDragEnd(...s)),onDrop:t[15]||(t[15]=(...s)=>i.onDrop&&i.onDrop(...s)),style:v.normalizeStyle(i.style.indicators)},null,36))],4)}const VK=Ti(WK,[["render",NK],["__scopeId","data-v-01e4c58d"]]),jK=(i={})=>{const{pageId:t="",indicatorUrl:e="",indicatorToken:n="",context:o="",graphicConfig:r}=i;return async(l={},a,h)=>{var f;const d=BC(i,l),{url:u,...c}=d||{};let g=t;if(!g){const{pathname:p}=window==null?void 0:window.location;if(p){const m=p.split("/");m!=null&&m.length&&(g=m[m.length-1])}}if(u&&c){a&&a("tableChange",{type:"11",data:c}),h&&h(c);try{return await zr({url:`${e}${u}`,method:"post",headers:{Authentication:n,operateContext:o},data:{...c,dataSourceId:(r==null?void 0:r.dataSourceId)||"",pageId:g},signal:((f=window.controller)==null?void 0:f.signal)||""})}catch(p){console.error(p)}}}},$K=(i={})=>{const{indicatorUrl:t=""}=i;return async(n,o)=>{var d;const r={},{search:s}=window==null?void 0:window.location;if(s){const u=s.slice(1,s.length).split("&");for(const c of u){const g=c.split("=");r[g[0]]=g[1]}}const{keyName:l,...a}=o,h={keyName:l};n==="save"&&(h.searchMap=a);try{return await zr({url:`${t}/userSearch/${n}`,method:"post",headers:{Authentication:r.token||null},data:h,signal:((d=window.controller)==null?void 0:d.signal)||""})}catch(u){console.error(u)}}},GK=(i={})=>{const{pageId:t="",indicatorUrl:e="",indicatorToken:n="",context:o="",graphicConfig:r={}}=i;return async(l={})=>{var h,d;const a=BC(i,l);try{const u=await zr({url:`${e}/diagram/obtainDrillAbleDimensionOptions`,method:"post",headers:{Authentication:n,operateContext:o},data:{source:(r==null?void 0:r.source)||"INDICATOR_LIB",pageId:t,indicatorList:(a==null?void 0:a.indicatorList)||[],classifications:(a==null?void 0:a.queryColumns)||[],dataSourceId:(r==null?void 0:r.dataSourceId)||""},signal:((h=window.controller)==null?void 0:h.signal)||""});return((d=u==null?void 0:u.data)==null?void 0:d.data)||[]}catch(u){console.error(u)}}},UK={id:{type:String,default:""},name:{type:String,default:""},keyName:{type:String,default:""},type:{type:String,default:""},width:{type:String,default:""},height:{type:String,default:""},position:{type:String,default:""},top:{type:String,default:""},left:{type:String,default:""},zIndex:{type:Number,default:1},events:{type:Array,default:()=>[]},dataType:{type:String,default:"indicator"},graphicConfig:{type:Object,default:()=>({})},data:{type:Array,default:()=>[]},scale:{type:Number,default:1},dimensionList:{type:Array,default:()=>[]},indicatorList:{type:Array,default:()=>[]},pageMode:{type:String,default:""},styleConfig:{type:Object,default:()=>({})},theme:{type:String,default:"light"},fullMode:{type:Boolean,default:!1},pageId:{type:String,default:""},indicatorUrl:{type:String,default:""},indicatorToken:{type:String,default:""},context:{type:String,default:""},enlargeContainer:{type:String,default:"body"},globalModel:{type:Object,default:()=>new Map},isIframeMode:{type:Boolean,default:!1},showLeftTree:{type:Boolean,default:!0},allowDrill:{type:Boolean,default:!1},showFullScreen:{type:Boolean,default:!0},showClear:{type:Boolean,default:!0},relateKeyName:{type:String,default:""},usedDimensionFields:{type:Array,default:[]},allDimensions:{type:Array,default:[]},pageConfig:{type:Object,default:()=>({})},scaleValue:{type:Object,default:()=>({widthScale:1,heightScale:1})},defaultConfig:{type:Object,defalut:()=>({})},modalContainer:{type:String,default:"#ProviderConfig > #container"},isAllowSaveConfig:{type:Boolean,default:!0}},sb={LAST_DATA:"上期值",SAME_DATA:"同期值",DIFF_DATA:"增减额",MOM_DATA:"环比(%)",YOY_DATA:"同比(%)"},hB=[{text:"排序",children:[{text:"升序",menuKey:"asc"},{text:"降序",menuKey:"desc"},{text:"默认",menuKey:"default-sort"}],menuKey:"sort"},{text:"度量属性",menuKey:"property"},{text:"条件属性",menuKey:"conditionalProperty"},{text:"图形",menuKey:"graph"},{text:"筛选",menuKey:"filter"}],Ls=["合计","平均值","计数","最大值","最小值","方差","标准差"],KK=i=>v.defineAsyncComponent({loader:i,delay:200}),OX="",zX="",YK=v.defineComponent({name:"PivotTable",components:{PivotFilter:LT,PivotProperty:H7,ConditionalProperty:WU,ChartModal:tK,PivotAggregate:oK,PivotTop:lK,PivotConfig:wK,IndSourceList:zK,DragArea:VK,PivotDetail:uK,DrillModal:KK(()=>Promise.resolve().then(()=>lY)),SettingOutlined:P$,DatabaseOutlined:Xj,ArrowsAltOutlined:Rj,ShrinkOutlined:k$,FilterOutlined:hM,DeleteOutlined:lM,ClearOutlined:Nj},props:{...UK},setup(i,{expose:t,emit:e}){let n=null;const o=v.ref(!1),r=v.ref(""),s=v.ref({}),l=v.ref(),a=v.ref({}),h=v.ref({}),d=v.ref({}),u=v.ref(),c=v.ref({}),g=v.ref(),f=v.ref(),p=v.ref(),m=v.ref(),b=v.ref(),C=v.ref(),_=v.ref(),w=v.ref(),y=v.ref(),S=v.ref(),A=v.ref({}),R=v.ref(!1),x=v.ref({}),T=v.ref({}),M=v.ref({}),B=v.ref(),P=v.ref({}),F=v.ref("200px"),H=v.ref("200px"),E=v.ref(300),k=v.ref({}),I=v.ref(),L=v.ref(i.showLeftTree),D=v.ref(!1),O=v.ref({}),N=v.ref(0),W=v.ref(0),$=v.ref(),U=v.ref(!1),Y=v.ref(),j=v.ref(25),G=v.ref(!0),X=v.ref({dateFormat:"YYYY-MM-DD"}),ht=v.ref(14),gt=40,Ct=6,Q=10,et=15,vt=20,bt=24,dt=v.ref([]);let ot=`|${Es(6)}|`;v.provide("splitSymbol",ot),v.provide("indicatorUrl",i.indicatorUrl),v.provide("indicatorToken",i.indicatorToken),v.provide("theme",i.theme),v.provide("pageId",i.pageId),v.provide("context",i.context),v.provide("graphicConfig",i.graphicConfig),v.provide("theDateInfo",X),v.provide("scaleValue",i.scaleValue),v.provide("getContainer",()=>document.querySelector(i.modalContainer)||document.body);const ut=v.ref({}),st=()=>{const V={borderColor:v.unref(mt).borderColor};ut.value=V},_t=v.computed(()=>{let V="#ECF1F5";switch(i.theme){case"default":V="#EAF0F9";break;case"dark":V="#FFFFFF";break}return{borderColor:"#E3E3E3",headerBgColor:V,headerColor:"#252525",bodyBgColor:"#FFFFFF",bodyColor:"#252525",indicatorsHeaderBgColor:V,indicatorsHeaderColor:"#252525",indicatorsBodyBgColor:"#FFFFFF",indicatorsBodyColor:"#252525",aggregateBgColor:V,aggregateColor:"#252525",sortNotActiveColor:"#CCCCCC",sortActiveColor:"#416EFF",dropDownMenuBgColor:"#FFFFFF",dropDownMenuColor:"#141414",dropDownMenuHightLightColor:"#2E68CF"}}),ct=v.ref(1),Wt=v.ref();new ResizeObserver(V=>{for(const K of V){const{width:q}=K.contentRect;Wt.value=q,ct.value++,v.nextTick(()=>{vB()})}}).observe(document.body);const yt=v.computed(()=>{const{width:V}=i;return V.includes("%")&&ct.value?i.isIframeMode?Wt.value:document.querySelector(`#pivotWrap_${i.id}`).clientWidth:parseFloat(V)}),mt=v.computed(()=>{var rt;const V={},{styleConfig:K}=i;let q={};(rt=Object.keys(K))!=null&&rt.length?q=K:q=v.unref(_t);for(const Z in q)V[Z]=q[Z]||"transparent";return V}),ie=v.ref({}),le=()=>{const V=Xl();V&&(v.unref(ie).width=V.width+2+"px"),v.unref(ie).backgroundColor=PC(v.unref(mt).headerBgColor,2)};v.watch(()=>i.theme,()=>{n&&(n==null||n.updateOption(J))});const Zt=()=>{const{widthScale:V,heightScale:K}=i.scaleValue||{};if(V&&K){const q=+(1/V).toFixed(5),rt=+(1/K).toFixed(5),Z=+(parseFloat(i.width)*V).toFixed(2),tt=+(parseFloat(i.height)*K).toFixed(2);j.value=25*V,A.value={transform:`scale(${q}, ${rt})`,width:Z+"px",height:tt+"px",left:-(Z-parseFloat(i.width))/2+"px",top:-(tt-parseFloat(i.height))/2+"px",paddingLeft:v.unref(j)+"px"},ht.value=16*V,J.defaultRowHeight=gt*K,J.theme.scrollStyle.width=Ct*V,J.theme.scrollStyle.scrollSliderCornerRadius=Q*V,J.theme.tooltipStyle.fontSize=ht.value,cK(g7,{sortNotActiveColor:v.unref(mt).sortNotActiveColor,sortActiveColor:v.unref(mt).sortActiveColor,iconSize:et*V,hoverSize:vt*V,downSize:bt*V}),v.nextTick(()=>{var it,pt,Pt,Kt,It,kt,Ft,Ie,ci,Po,Ho,xn;(pt=(it=v.unref(S))==null?void 0:it.style)==null||pt.setProperty("--box-tooltip-fontsize",ht.value+"px"),(Kt=(Pt=v.unref(S))==null?void 0:Pt.style)==null||Kt.setProperty("--box-item-size",j.value+"px"),(kt=(It=v.unref(_))==null?void 0:It.style)==null||kt.setProperty("--menu-item-height",32*K+"px"),(Ie=(Ft=v.unref(_))==null?void 0:Ft.style)==null||Ie.setProperty("--menu-item-padding",`0px ${12*V}px`),(Po=(ci=v.unref(_))==null?void 0:ci.style)==null||Po.setProperty("--menu-item-font-size",12*V+"px"),(xn=(Ho=v.unref(_))==null?void 0:Ho.style)==null||xn.setProperty("--menu-item-line-height",30*K+"px"),n&&n.updateOption(J)})}};v.watch(()=>[i.scaleValue,i.width,i.height],()=>{Zt()},{deep:!0});const _e=v.computed(()=>{var V,K,q;return i.fullMode&&!((V=J.rows)!=null&&V.length)&&!((K=J.columns)!=null&&K.length)&&!((q=J.indicators)!=null&&q.length)}),Oe=v.computed(()=>{var V;return{width:(V=i.width)!=null&&V.includes("%")?"calc(100%)":parseFloat(i.width)-v.unref(E)+"px",height:"100%",backgroundColor:i.theme==="darkBlue"?"#081653":"#F1F1F1",color:i.theme==="darkBlue"?"#b2c3dd":""}}),He=v.computed(()=>{const V={fontSize:ht.value+"px"};return v.unref(L)&&(i.theme==="darkBlue"?V.color="#00CCFF":V.color="#416EFF"),V}),Ht=v.ref([]),Et=v.ref([]);v.provide("dimensionFieldList",Ht),v.provide("indicatorFieldList",Et);const Rt="-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol",Tt=v.computed(()=>v.unref(Ht).filter(V=>V.isInnerFilter).concat(v.unref(Et).filter(V=>V.isInnerFilter)).sort((V,K)=>V.timeStamp-K.timeStamp));v.watchEffect(()=>{var rt,Z,tt,it,pt,Pt,Kt,It,kt,Ft;const{dropDownMenuBgColor:V,dropDownMenuColor:K,dropDownMenuHightLightColor:q}=mt.value;V&&((Z=(rt=v.unref(_))==null?void 0:rt.style)==null||Z.setProperty("--menu-bg-color",V)),K&&((it=(tt=v.unref(_))==null?void 0:tt.style)==null||it.setProperty("--menu-color",K)),q&&((Pt=(pt=v.unref(_))==null?void 0:pt.style)==null||Pt.setProperty("--menu-hight-light-color",q)),F.value&&((It=(Kt=v.unref(_))==null?void 0:Kt.style)==null||It.setProperty("--sub-menu-left",F.value)),H.value&&((Ft=(kt=v.unref(_))==null?void 0:kt.style)==null||Ft.setProperty("--sub-menu-top",H.value))});const Nt=v.ref([]),te=v.ref({}),ae=v.ref({}),Jt=v.reactive({cellInnerBorder:!1,underlayBackgroundColor:"transparent",headerStyle:{bgColor(V){return v.unref(Nt).includes(V.dataValue)?v.unref(mt).indicatorsHeaderBgColor:v.unref(mt).headerBgColor},color(V){return v.unref(Nt).includes(V.dataValue)?v.unref(mt).indicatorsHeaderColor:v.unref(mt).headerColor},borderColor:v.unref(mt).borderColor,fontWeight:"600",fontFamily(){if(i.isIframeMode)return Rt},fontSize(){return v.unref(ht)}},cornerHeaderStyle:{bgColor(){return v.unref(mt).headerBgColor},color:v.unref(mt).headerColor,borderColor:v.unref(mt).borderColor,fontWeight:"600",fontFamily(){if(i.isIframeMode)return Rt},fontSize(){return v.unref(ht)}},bodyStyle:{borderColor:v.unref(mt).borderColor,color(V){var rt,Z;const K=V.cellHeaderPaths.rowHeaderPaths,q=V.cellHeaderPaths.colHeaderPaths;return Ls.includes((rt=K==null?void 0:K[K.length-1])==null?void 0:rt.value)?v.unref(mt).aggregateColor:v.unref(Nt).includes((Z=q==null?void 0:q[q.length-1])==null?void 0:Z.value)?v.unref(mt).indicatorsBodyColor:v.unref(mt).bodyColor},bgColor(V){var rt,Z;const K=V.cellHeaderPaths.rowHeaderPaths,q=V.cellHeaderPaths.colHeaderPaths;return Ls.includes((rt=K==null?void 0:K[K.length-1])==null?void 0:rt.value)?v.unref(mt).aggregateBgColor:v.unref(Nt).includes((Z=q==null?void 0:q[q.length-1])==null?void 0:Z.value)?v.unref(mt).indicatorsBodyBgColor:v.unref(mt).bodyBgColor},fontFamily(){if(i.isIframeMode)return Rt},fontSize(){return v.unref(ht)}},rowHeaderStyle:{borderColor:v.unref(mt).borderColor,bgColor(V){return Ls.includes(V.dataValue)?v.unref(mt).aggregateBgColor:v.unref(mt).bodyBgColor},color(V){return Ls.includes(V.dataValue)?v.unref(mt).aggregateColor:v.unref(mt).bodyColor},fontFamily(){if(i.isIframeMode)return Rt},fontSize(){return v.unref(ht)}},frameStyle:{borderLineWidth:1,borderColor:v.unref(mt).borderColor},scrollStyle:{width:Ct,scrollSliderCornerRadius:Q},tooltipStyle:{fontSize:v.unref(ht)}}),J=v.reactive({records:[],columnHeaderTitle:!0,excelOptions:{fillHandle:!0},rows:[],columns:[],indicators:[],corner:{titleOnDimension:"row"},dataConfig:{sortRules:[],filterRules:[]},widthMode:"standard",heightMode:"standard",defaultRowHeight:gt,defaultColWidth:360,menu:{renderMode:"html",dropDownMenuHighlight:[]},theme:Jt}),be=v.computed(()=>{let V=0;return v.unref(L)&&i.fullMode&&(V=v.unref(E)),V}),Lt=v.computed(()=>{let V=0;return v.unref(D)&&(V=20),V}),Ot=5,Se=v.ref({});v.watch(R,V=>{if(V){const K={};v.nextTick(()=>{var Z,tt;const q=Xl();let rt=0;(Z=v.unref(Tt))!=null&&Z.length&&(rt=(tt=v.unref($))==null?void 0:tt.clientHeight),q&&(K.width=q.width+"px",K.height=q.height+"px",K.top=q.top+rt+v.unref(Lt)+"px",K.left=q.left+v.unref(be)+v.unref(Lt)+v.unref(j)+"px"),Se.value=K})}});const qe=v.ref([]),Kn=v.ref([]),Vr=v.ref({}),Sn=v.ref({}),ks=v.ref([]),Ul=v.ref([]),Kl=v.ref([]),Yl=v.ref([]),aY=v.computed(()=>{const V=[];for(const tt of v.unref(qe)){const{data:it,indicatorKey:pt="",calculateType:Pt=""}=tt||{};V.push({label:it.indicatorKey,columnName:it.indicatorKey,location:"LEFT",show:!0,calcType:"BUILT_IN",builtInFormula:Pt,builtInValueSource:pt})}const K=[],q={};v.unref(Kn).forEach(tt=>{q[tt.key]||(q[tt.key]=[]),q[tt.key].push(tt)});for(const tt in q){const it=q[tt]||[];it.forEach((pt,Pt)=>{var Ie;const Kt=v.unref(Ht).find(ci=>ci.label===pt.key),It=v.unref(Et).find(ci=>ci.label===pt.key),kt=Kt||It,Ft={};Pt<it.length-1&&(Ft.join="&&"),(kt==null?void 0:kt.genericType)==="DATE"&&(Ft.dateFormat=((Ie=v.unref(X))==null?void 0:Ie.dateFormat)||"YYYY-MM-DD",Pt===0?Ft.prop="startTime":Pt===1&&(Ft.prop="endTime")),kt&&K.push({fieldName:kt.name,fieldType:kt.genericType,fieldValue:Array.isArray(pt.value)?pt.value.join(","):pt.value,hrpIndexCode:kt.indexCode,hrpIndexCodeNum:kt.indexCodeNum,id:kt.id,label:kt.label,rule:pt.rule,targetSource:"",typeGuid:pt.typeGuid||"",type:pt.type,...Ft})})}const rt=[];if(Object.keys(v.unref(Vr)))for(const tt in v.unref(Vr))v.unref(Vr)[tt]&&rt.push({key:tt,num:v.unref(Vr)[tt],rule:"TOP"});const Z=[];if(Object.keys(v.unref(Sn)))for(const tt in v.unref(Sn)){const{order:it,type:pt,columnData:Pt,columnHeader:Kt}=v.unref(Sn)[tt];if(it.toLowerCase()==="default-sort")continue;const It={label:tt,order:it.toUpperCase(),type:"COMBINATION",fieldType:pt};pt==="indicators"&&(It.columnHeader=Kt,It.columnData=Pt,It.type="NORMAL"),Z.push(It)}return{calc:V,filter:K,truncations:rt,sorts:Z,aggregateMethod:v.unref(P)||{}}}),hY=GK(i),dY=jK(i),ab=$K(i),hb=v.ref({}),dr=async()=>{var Pt,Kt,It,kt;const{dimensionList:V,graphicConfig:K={}}=i,{queryColumnList:q=[]}=K,{rows:rt=[],columns:Z=[]}=J,tt=(Pt=v.unref(Kl))!=null&&Pt.length?v.unref(Kl):[],it=(Kt=v.unref(Yl))!=null&&Kt.length?v.unref(Yl):[];if(!(tt!=null&&tt.length))for(const Ft of rt)tt.push(Ft.dimensionKey);if(!(it!=null&&it.length))for(const Ft of Z)it.push(Ft.dimensionKey);tt!=null&&tt.length||tt.push(...V.filter(Ft=>Ft.position==="rows").map(Ft=>Ft.key)),it!=null&&it.length||it.push(...V.filter(Ft=>Ft.position==="columns").map(Ft=>Ft.key));const pt=[];for(const Ft in v.unref(a))pt.push({type:"dimension",key:Ft,rule:v.unref(a)[Ft]});for(const Ft in v.unref(h))pt.push({type:"indicators",key:Ft,rule:v.unref(h)[Ft]});if(pt!=null&&pt.length&&db(pt,{isHandle:!1}),q!=null&&q.length)for(const Ft of q)!tt.includes(Ft.name)&&!it.includes(Ft.name)&&tt.push(Ft.name);hb.value={...v.unref(aY),rowDimensionKeys:tt,colDimensionKeys:it,dimensions:(It=v.unref(ks))!=null&&It.length?v.unref(ks):v.unref(Ht),indicators:(kt=v.unref(Ul))!=null&&kt.length?v.unref(Ul):v.unref(Et)};try{const Ft=await dY({pivotTableCal:v.unref(hb)},e,Ie=>{var ci;if(v.unref(G)){const{sqlConditions:Po=[],queryColumns:Ho=[]}=Ie,xn=uB(Po),pi=Ho.find(Ne=>Ne.typeGuid==="the_date");if(pi&&(X.value={dateFormat:pi.dateFormat||"YYYY-MM-DD"}),xn!=null&&xn.length)for(const Ne of xn)["startTime","endTime"].includes(Ne.prop)&&(v.unref(X)[Ne.prop]=Ne.fieldValue||"",(ci=v.unref(X))!=null&&ci.rangeFormat||(v.unref(X).rangeFormat=Ne.dateFormat||"YYYY-MM-DD"));G.value=!1}});mB(Ft)}catch(Ft){console.error(Ft)}};function uB(V){const K=[];for(const q of V)q.sqlConditions?K.push(...uB(q.sqlConditions)):q.fieldName==="the_date"&&K.push(q);return K}const uY=V=>{v.unref(qe).find(K=>K.data.indicatorKey===V.data.indicatorKey)||qe.value.push(V),dr()},cY=V=>{const K=v.unref(qe).findIndex(q=>q.data.indicatorKey===V);K!==-1&&qe.value.splice(K,1),dr()},db=(V,{isHandle:K=!0}={})=>{let q=[];Array.isArray(V)?q=V:q=[V];for(const rt of q){const{key:Z="",rule:tt,type:it=""}=rt||{};let pt=Ye.cloneDeep(tt);Array.isArray(tt)||(pt=[tt]);const Pt=v.unref(Ht).find(kt=>kt.label===Z),Kt=v.unref(Et).find(kt=>kt.label===Z),It=Pt||Kt;if(It){if((It==null?void 0:It.genericType)==="DATE"&&(pt==null?void 0:pt.length)===1){const kt=pt[0].value;pt[0].rule="GREATER_EQUAL",pt[1]={rule:"LESS_EQUAL",value:kt}}for(let kt=v.unref(Kn).length-1;kt>=0;kt--){const Ft=v.unref(Kn)[kt];Ft.key===Z&&Ft.type===it&&v.unref(Kn).splice(kt,1)}for(const kt of pt){const{rule:Ft,value:Ie}=kt;Z&&Ft&&Ie&&Kn.value.push({key:Z,rule:Ft,value:Ie,type:it,typeGuid:It.typeGuid})}}}K&&dr()},gY=()=>{Vr.value=v.unref(x)||{},dr()},cB=V=>{const{key:K,order:q,type:rt,columnData:Z=[]}=V;if(rt==="indicators"){let tt="";for(const it in v.unref(Sn))v.unref(Sn)[it].type==="indicators"&&(tt=it);tt&&delete v.unref(Sn)[tt]}v.unref(Sn)[K]={order:q,type:rt,columnData:Z},dr()},Xh=()=>{const V=v.unref(Ht),K=v.unref(Et),q=V.filter(Z=>Z.positionType==="rows").map(Z=>Z.name),rt=V.filter(Z=>Z.positionType==="columns").map(Z=>Z.name);ks.value=Ye.cloneDeep(V),Ul.value=Ye.cloneDeep(K),Kl.value=Ye.cloneDeep(q),Yl.value=Ye.cloneDeep(rt),dr()};function fY(V,K=!0,q=-1){if(q>-1)J.indicators.splice(q,0,...V);else for(const rt of V)J.indicators.push(rt);K&&n.updateOption(J)}function pY({label:V,calcType:K}){const q=[],rt=v.unref(ae)[V]||[];for(const Z in sb)rt.indexOf(Z)===-1&&q.push({text:sb[Z],menuKey:Z});return K==="FORMULA"||!(q!=null&&q.length)?hB:[{text:"计算",menuKey:"calculate",children:q},...hB]}function uf(V){var q;let K=[];if(V!=="rows"&&(K=[{text:"钻取",menuKey:"drill"},{text:"升序",menuKey:"asc"},{text:"降序",menuKey:"desc"},{text:"筛选",menuKey:"filter"},{text:"聚合",menuKey:"aggregate"},{text:"取top",menuKey:"top"},{text:"删除",menuKey:"delete"}]),i.fullMode||i.allowDrill)if(v.unref(dt)&&Array.isArray(v.unref(dt)))if((q=v.unref(dt))!=null&&q.length){const rt=v.unref(dt).map(Z=>({text:Z.title||Z.label,menuKey:V==="rows"?`${ot}${Z.label}`:Z.label}));V==="rows"?K=rt:K[0].children=rt}else K.splice(0,1);else K.splice(0,1);else K.splice(0,1),K.splice(-1,1);return K}function mY(V,K){R.value=!0,v.unref(P)[K]=V||[],dr(),ln({type:"9",data:{key:K,types:V}})}function vY(V,K=!0){var q;for(const rt of V){const{key:Z,name:tt,type:it,dimensionKey:pt,width:Pt}=rt;let Kt;if(pt)Kt=rt;else{const It={dimensionKey:Z,title:tt,width:Pt?`${Pt}%`:"auto",type:it};it==="columns"?It.headerStyle={textStick:!0}:it==="rows"&&(It.cornerHeaderIcon="sortNormal"),Kt=It}if(Kt&&(Kt.headerStyle={textStick:!0},Kt.headerFormat||(Kt.headerFormat=It=>{if(it==="rows"){const kt=It==null?void 0:It.split(ot);return kt!=null&&kt.length?kt[kt.length-1]:It}else return It}),J[it].push(Kt)),(q=J[it])!=null&&q.length)for(const It of J[it])It.cornerDropDownMenu=uf(),it==="rows"&&(It.dropDownMenu=uf("rows"));J.dataConfig.sortRules.push({sortField:Z,sortType:v.unref(r)})}K&&n.updateOption(J),v.nextTick(()=>{fB()})}function gB(V){const K={},{records:q}=J;for(const rt of q)for(const Z of V)An(K,Z)?K[Z].find(tt=>tt.value===rt[Z])||K[Z].push(ub({value:rt[Z]})):K[Z]=ub([{value:rt[Z]}]);return K}function ub(V){const K=Ye.cloneDeep(V);if(typeof V=="object")if(Array.isArray(K))for(const rt of K)q(rt);else q(K);function q(rt){for(const Z in rt)if(typeof rt[Z]=="string"){const tt=rt[Z].split(ot);tt!=null&&tt.length&&(rt[Z]=tt[tt.length-1])}}return K}function fB(){const{dataset:{columns:V,rows:K}}=n,q=K.concat(V);s.value=gB(q)}const pB=v.computed(()=>{var V;return(V=v.unref(Ht))!=null&&V.length?v.unref(Ht).map(K=>K.label).concat(i.usedDimensionFields):i.usedDimensionFields});async function mB(V){var Ie,ci,Po,Ho,xn,pi,Ne,ur;const K=await hY({pivotTableCal:v.unref(hb)});dt.value=K.filter(jt=>!v.unref(pB).includes(jt.label));let q=V;V?Y.value=Ye.cloneDeep(V):q=Ye.cloneDeep(v.unref(Y)),R.value=!0;const{data:rt={}}=(q==null?void 0:q.data)||{},{rows:Z=[]}=rt,tt=[],it=[];for(const jt of v.unref(Ht)){if(!jt.show)continue;const se=J[jt.positionType].find(Ze=>Ze.dimensionKey===jt.label);se?it.push({...se,title:jt.showTitle}):it.push({key:jt.label,name:jt.showTitle,type:jt.positionType,width:jt.width})}for(let jt=0;jt<v.unref(Et).length;jt++){const se=v.unref(Et)[jt];if(!se.show)continue;const Ze=pY(se),Ge=J.indicators.find(Fi=>Fi.indicatorKey===se.label);let ze={};Ge?ze={...Ge,dropDownMenu:Ze,title:se.showTitle}:ze={indicatorKey:se.label,title:se.showTitle,width:se!=null&&se.width?`${se.width}%`:"auto",showSort:!1,headerStyle:{fontWeight:"normal"},dropDownMenu:Ze},ze&&(ze.style={padding:[16,28,16,28],textAlign:"right"},ze.format||(ze.format=(Fi,Rn,qh,Zh)=>{const mb=Zh.getRecordByCell(Rn,qh)||[];return mb[0]&&isNaN(+mb[0][se.label])?mb[0][se.label]:Fi||"-"}),tt.push(ze))}const pt=it.filter(jt=>jt.type==="rows");if(((Ie=J==null?void 0:J.rows)==null?void 0:Ie.length)!==pt.length&&typeof((ci=v.unref(B))==null?void 0:ci.col)=="number"&&(v.unref(B).col+=pt.length-(((Po=J==null?void 0:J.rows)==null?void 0:Po.length)||0)),J.indicators=[],J.rows=[],J.columns=[],(Ho=v.unref(qe))!=null&&Ho.length)for(const jt of v.unref(qe))isNaN(+jt.position)||tt.splice(+jt.position,0,{...jt.data,calculateType:jt.calculateType});const{sortType:Pt,col:Kt,row:It}=v.unref(B)||{};for(const jt of tt)jt&&(jt.headerIcon=se=>{const{col:Ze,row:Ge}=se;if(Kt===Ze&&It===Ge){let ze="sortNormal";return Pt==="ASC"?ze="sortUp":Pt==="DESC"&&(ze="sortDown"),ze}else return"sortNormal"});fY(tt,!1),vY(it,!1);const kt=[],Ft=it.filter(jt=>jt.type==="rows").map(jt=>jt.key||jt.dimensionKey);for(const jt of Z)for(const se in jt)if(!Ls.includes(jt[se])){const Ze=Ft.indexOf(se);if(Ze!==-1){const Ge=[];for(let ze=0;ze<=Ze;ze++){const Fi=String(jt[Ft[ze]]);if(Fi.includes(ot)){const Rn=Fi.split(ot);Rn!=null&&Rn.length&&Ge.push(Rn[Rn.length-1])}else Ge.push(Fi)}Ge!=null&&Ge.length&&(jt[se]=Ge.join(ot))}}for(const jt of it){const se=(jt==null?void 0:jt.key)||(jt==null?void 0:jt.dimensionKey);if(jt.type==="columns"&&!v.unref(M)[se])v.unref(M)[se]=cb("",se,Z);else if(jt.type==="rows")if(v.unref(T)[se]){const{type:Ze}=v.unref(T)[se]||{};kt.push(cb(Ze,se,Z))}else if(!v.unref(B)||v.unref(B).sortField===se||!n)kt.push(cb("",se,Z));else{const Ze=J.dataConfig.sortRules.find(Ge=>Ge.sortField===se);Ze&&kt.push(Ze)}}if(v.unref(B)&&kt.push(v.unref(B)),(xn=Object.keys(v.unref(M)))!=null&&xn.length)for(const jt in v.unref(M))kt.push(v.unref(M)[jt]);if(J.records=Z,J.dataConfig.sortRules=kt,Z!=null&&Z.length&&(v.unref(O).records=[]),(pi=J.columns)!=null&&pi.length?J.columnHeaderTitle=!0:(Ne=J.indicators)!=null&&Ne.length?J.columnHeaderTitle=!1:(ur=J.rows)!=null&&ur.length&&(J.columnHeaderTitle=!0),n)n.updateOption(J),v.nextTick(()=>{bB()}),R.value=!1;else{const jt=document.getElementById(`pivotTableContainer_${i.id}`);n=new BT(jt,J),v.nextTick(()=>{bB(),o.value=!0,R.value=!1,i.isIframeMode&&(v.unref(N)&&n.setScrollTop(v.unref(N)),v.unref(W)&&n.setScrollLeft(v.unref(W)))}),MY()}v.nextTick(()=>{const{indexFormatConfig:jt}=(i==null?void 0:i.defaultConfig)||{};if(jt){const se=[];for(const Ze in jt)jt[Ze]&&se.push(jt[Ze]);SB(se)}})}const jr=v.ref({});function vB(){Xl()&&(v.unref(D)?(v.unref(jr).top=v.unref(Lt)+"px",v.unref(jr).left="0"):(v.unref(jr).top="0",v.unref(jr).left="0"))}function bB(){var V;if(n&&!((V=J.records)!=null&&V.length)){const{dataset:{rows:K}}=n,q={};for(const rt of K)q[rt]="";v.unref(O).dataConfig={...J.dataConfig,filterRules:[]},v.unref(O).records=[q],n.updateOption({...J,...v.unref(O)})}}function bY(V,K){R.value=!0,db({type:"indicators",key:V,rule:K}),ln({type:"3",data:{type:"indicators",key:V,rule:K}})}function CY(V,K){R.value=!0,db({type:"dimension",key:V,rule:K}),ln({type:"3",data:{type:"dimension",key:V,rule:K}})}function yY(V,K){var tt;let q=!1;const rt=J[K].findIndex(it=>it.dimensionKey===V),Z=J.dataConfig.sortRules.findIndex(it=>it.sortField===V);if(rt!==-1){if(J[K].splice(rt,1),i.fullMode||i.allowDrill){const it=v.unref(Ht).findIndex(pt=>pt.label===V);it!==-1&&(v.unref(Ht)[it].isInnerFilter?(v.unref(Ht)[it].show=!1,q=!0):v.unref(Ht).splice(it,1))}else for(const it of J[K])it.cornerDropDownMenu=uf(),K==="rows"&&(it.dropDownMenu=uf("rows"));(tt=v.unref(B))!=null&&tt.col&&(v.unref(B).col-=1),R.value=!0,Xh(),ln({type:"7"})}Z!==-1&&(J.dataConfig.sortRules[Z].sortType=r),n.updateOption(J),v.nextTick(()=>{if(fB(),!q){delete a.value[V];const it=v.unref(Kn).findIndex(pt=>pt.key===V);it!==-1&&v.unref(Kn).splice(it,1)}})}function _Y(V){const{indicators:K}=J,q=K.findIndex(rt=>rt.indicatorKey===V);if(q!==-1){const rt=K[q];if(K.splice(q,1),rt.calculateType){const Z=rt.indicatorKey.split("@"+rt.calculateType)[0],tt=v.unref(ae)[Z].indexOf(rt.calculateType);tt!==-1&&v.unref(ae)[Z].splice(tt,1);const it=v.unref(Nt).indexOf(rt.title);it!==-1&&v.unref(Nt).splice(it,1),delete v.unref(te)[rt.title]}cY(rt.indicatorKey),ln({type:"2",data:rt.indicatorKey})}}function cb(V,K,q){let rt=[];const Z=new Set;for(const tt of q){const it=tt[K];it&&!Ls.includes(it)&&Z.add(it)}return rt=Array.from(Z),V==="asc"?rt=rt.sort((tt,it)=>tt.localeCompare(it)):V==="desc"&&(rt=rt.sort((tt,it)=>it.localeCompare(tt))),{sortField:K,sortBy:[...rt,...Ls]}}function CB(V,K,q,rt){R.value=!0;let{menu:{dropDownMenuHighlight:Z},rows:tt}=J;rt=rt+1,Z=Z.filter(pt=>!(pt.type==="dimension"&&pt.field===K)||pt.type==="indicator"),Z.push({col:q,row:rt-1,field:K,type:"dimension",menuKey:V}),J.menu.dropDownMenuHighlight=Z;const it=tt.find(pt=>pt.dimensionKey===K);if(it){let pt="sortNormal";V==="asc"?pt="sortUp":V==="desc"&&(pt="sortDown"),it.cornerHeaderIcon=pt}n.updateOption(J),V==="default-sort"?delete v.unref(T)[K]:v.unref(T)[K]={type:V},cB({key:K,order:V,type:"dimension"}),ln({type:"4",data:{key:K,order:V,type:"dimension"}})}function yB(V,K,q,rt,Z){var Ft;R.value=!0;const{menu:tt}=J;let it=tt.dropDownMenuHighlight,pt="";(Ft=J.rows)!=null&&Ft.length&&(pt=J.rows[J.rows.length-1].dimensionKey);const Pt=q.filter((Ie,ci)=>ci<q.length-1),Kt=Pt.map(Ie=>({columnName:Ie.dimensionKey})),It=Pt.map(Ie=>Ie.value),kt=it.findIndex(Ie=>Ie.field===pt&&Ie.type==="dimension");kt!==-1&&it.splice(kt,1),it=it.filter(Ie=>Ie.type==="dimension"),it.push({col:rt,row:Z,field:K,type:"indicator",menuKey:V}),J.menu.dropDownMenuHighlight=it,n.updateOption(J),V==="default-sort"?B.value=null:B.value={sortField:pt,sortByIndicator:K,sortType:V.toUpperCase(),query:It,col:rt,row:Z},cB({key:K,order:V,type:"indicators",columnData:It,columnHeader:Kt}),ln({type:"4",data:{key:K,order:V,type:"indicators"}})}function _B({dimensionKey:V,value:K=""}){const q={};v.unref(a)[V]&&(q.filterData=v.unref(a)[V]);const rt=v.unref(Ht).find(Z=>Z.label===V);d.value={fieldName:K||(rt==null?void 0:rt.title)||V,key:V,type:"dimension",...q},v.nextTick(()=>{v.unref(u).showModal(),ln({type:"5",data:V})})}function wY(V,K){d.value={fieldName:K,key:V,type:"indicators",filterData:v.unref(h)[V]},v.nextTick(()=>{v.unref(u).showModal()})}function SY({indicatorKey:V,menuKey:K}){R.value=!0;let q=J.indicators.length-1;const rt=`${V}@${K}`,Z=`${V}(${sb[K]}) fx`;v.unref(Nt).push(Z),v.unref(te)[Z]=rt,J.indicators.forEach((tt,it)=>{tt.indicatorKey===V&&(q=it+1)}),v.unref(ae)[V]||(v.unref(ae)[V]=[]),v.unref(ae)[V].push(K),uY({data:{indicatorKey:rt,title:Z,width:"auto",showSort:!1,headerStyle:{fontWeight:"normal"},headerIcon:"sortNormal",dropDownMenu:[{text:"排序",children:[{text:"升序",menuKey:"asc"},{text:"降序",menuKey:"desc"},{text:"默认",menuKey:"default-sort"}],menuKey:"sort"},{text:"度量属性",menuKey:"property"},{text:"条件属性",menuKey:"conditionalProperty"},{text:"删除",menuKey:"delete"}],style:{padding:[16,28,16,28],textAlign:"right"},format:(tt,it,pt,Pt)=>{const Kt=Pt.getRecordByCell(it,pt)||[];return Kt[0]&&isNaN(+Kt[0][rt])?Kt[0][rt]:tt}},position:q,indicatorKey:V,calculateType:K}),ln({type:"1",data:{indicatorKey:V,calculateType:K}})}function xY(){const V=J.rows[0]?J.rows[0].cornerDropDownMenu:[],K=J.columns[0]?J.columns[0].cornerDropDownMenu:[],q=J.rows.map(it=>({...it,cornerDropDownMenu:K})),rt=J.columns.map(it=>({...it,cornerDropDownMenu:V}));J.columns=q,J.rows=rt;const{type:Z,len:tt}=J.aggregate||{};Z&&(J.records.splice(-tt),J.aggregate={type:Z,len:0}),J.menu.dropDownMenuHighlight=[],a.value={},h.value={},c.value={},J.dataConfig.filterRules=[],n.updateOption(J)}function RY({indicatorKey:V,fieldName:K}){const q=cf(V);if(q>-1){const rt=J.indicators[q].formatConfig||{};v.unref(g).showModal({...rt,indicatorKey:V,fieldName:K})}}function AY(V){const K=cf(V);if(K>-1){const q=J.indicators[K].conditionalConfig||[];v.unref(f).showModal(V,q)}}function cf(V){return J.indicators.findIndex(K=>K.indicatorKey===V)}function TY(V){const K=v.unref(Ht)[0],q=v.unref(Ht).map(tt=>tt.label),rt=gB(q),Z={xLabel:K.label,yLabel:V,dimensionData:rt,records:ub(J.records)};v.unref(C).showModal(Z)}function MY(){n.on("scroll",V=>{const{scrollDirection:K}=V;K==="vertical"?N.value=n.getScrollTop():K==="horizontal"&&(W.value=n.getScrollLeft())}),n.on("dblclick_cell",V=>{const{cellLocation:K="",field:q=""}=V;K==="body"&&!q.includes("LAST_DATA")&&!q.includes("SAME_DATA")&&!q.includes("DIFF_DATA")&&!q.includes("MOM_DATA")&&!q.includes("YOY_DATA")&&v.unref(w).showModal({args:V,splitSymbol:ot,dimension:v.unref(Ht),indicator:v.unref(Et)})}),n.on("after_render",()=>{st(),vB(),le(),v.nextTick(()=>{o.value=!0})}),n.on("icon_click",V=>{const{name:K,col:q,row:rt}=V;if(["sortNormal","sortUp","sortDown"].includes(K)){const{rows:Z,indicators:tt}=J,it=n.getCellValue(q,rt);let pt=v.unref(Ht).find(Ft=>Ft.showTitle===it);pt||(pt=v.unref(Et).find(Ft=>Ft.showTitle===it));let Pt=pt==null?void 0:pt.label;if(v.unref(Nt).includes(it)&&(Pt=v.unref(te)[it]),!Pt)return;const Kt=Z.find(Ft=>Ft.dimensionKey===Pt),It=tt.find(Ft=>Ft.indicatorKey===Pt);let kt="default-sort";if(K==="sortUp"?kt="desc":K==="sortDown"?kt="default-sort":(!K||K==="sortNormal")&&(kt="asc"),It){const Ft=n.getCellHeaderPaths(q,rt);yB(kt,Pt,(Ft==null?void 0:Ft.colHeaderPaths)||[],q,rt)}else Kt&&CB(kt,Pt,q,rt)}}),n.on("show_menu",()=>{const V=document.querySelector(`#pivotTableContainer_${i.id} .vtable__menu-element`);if(V){V.classList.add("first");const K=parseFloat(V.style.left)+V.clientWidth+3;F.value=K+"px",H.value=parseFloat(V.style.top)+"px"}}),n.on("dropdown_menu_click",V=>{const{field:K,col:q,row:rt}=V,{dimensionKey:Z,indicatorKey:tt,value:it}=K[K.length-1];let pt=V.menuKey,Pt=!1;pt.includes(ot)&&(Pt=!0,pt=pt.replace(ot,"")),l.value=V;const Kt=v.unref(dt).find(It=>It.label===pt);if(Kt){const It=v.unref(Ht).findIndex(kt=>kt.label===Z);if(It!==-1){const kt={...Kt,show:!0,positionType:"rows",showTitle:Kt.title||Kt.label};Pt?v.unref(y).showModal({drillDimension:kt,drillFieldData:K,usedDimensionFields:v.unref(pB),tableProps:i,splitSymbol:ot}):(Ht.value.splice(It+1,0,kt),R.value=!0,Xh()),ln({type:"8"})}}switch(pt){case"drill":alert("无维度可钻取");break;case"delete":Z?yY(Z,"rows"):tt&&_Y(tt);break;case"asc":case"desc":case"default-sort":Z?CB(pt,Z,q,rt):tt&&yB(pt,tt,K,q,rt);break;case"filter":Z?_B({dimensionKey:Z}):tt&&wY(tt,it);break;case"LAST_DATA":case"SAME_DATA":case"DIFF_DATA":case"MOM_DATA":case"YOY_DATA":case"zb":SY({indicatorKey:tt,menuKey:pt});break;case"trans":xY();break;case"property":RY({indicatorKey:tt,fieldName:it});break;case"conditionalProperty":AY(tt);break;case"aggregate":v.unref(p).showModal(v.unref(P)[Z]||[],Z);break;case"top":BY(Z);break;case"graph":TY(tt);break}})}function BY(V){v.unref(m).showModal({value:v.unref(x)[V]||"",key:V})}function PY(){v.unref(b).showModal(v.unref(Ht),v.unref(Et))}async function HY(){R.value=!0,await ab("save",{keyName:i.relateKeyName||i.keyName,data:{}}),r.value="",s.value={},a.value={},h.value={},d.value={},c.value={},x.value={},T.value={},M.value={},B.value={},P.value={},F.value="200px",H.value="200px",k.value={},L.value=i.showLeftTree,D.value=!1,O.value={},ut.value={},Ht.value=[],Et.value=[],Nt.value=[],te.value={},ae.value={},Se.value={},qe.value=[],Kn.value=[],Vr.value={},Sn.value={},ks.value=[],Ul.value=[],Kl.value=[],Yl.value=[],Y.value={},jr.value={},N.value=0,W.value=0,J.records=[],J.rows=[],J.columns=[],J.indicators=[],J.dataConfig={sortRules:[],filterRules:[]},J.defaultRowHeight=gt,J.menu.dropDownMenuHighlight=[],TB(),Zt(),dr()}function EY(V=[],K=[]){var tt;const q=V.concat(K).map(it=>it.name),rt=v.unref(Ht).filter(it=>it.isInnerFilter&&!q.includes(it.name)).map(it=>({...it,show:!1})),Z=v.unref(Et).filter(it=>it.isInnerFilter&&!q.includes(it.name)).map(it=>({...it,show:!1}));Ht.value=[...V,...rt],Et.value=[...K,...Z];for(const it in v.unref(Sn))if(((tt=v.unref(Sn)[it])==null?void 0:tt.type)==="indicators"){delete v.unref(Sn)[it];break}i.fullMode||i.allowDrill?(T.value={},B.value={},M.value={},R.value=!0,Xh(),ln({type:"10",data:{dimensions:v.unref(Ht),indicators:v.unref(Et)}})):mB()}function LY(V){if(!v.unref(I))return;const{name:K,scope:q}=v.unref(I),rt=v.unref(Ht).find(Pt=>Pt.name===K),Z=v.unref(Ht).findIndex(Pt=>Pt.name===K),tt=v.unref(Et).find(Pt=>Pt.name===K),it=v.unref(Et).findIndex(Pt=>Pt.name===K),pt={timeStamp:new Date().getTime()};if(["rows","columns"].includes(V))if(rt)if(rt.show){ji.message.error({content:"该维度已存在,请勿重复添加",key:"repeatFlag"});return}else rt.positionType=V,rt.show=!0,v.unref(Ht).push(rt),v.unref(Ht).splice(Z,1);else v.unref(Ht).push({...Ye.cloneDeep(v.unref(I)),...pt,positionType:V,showTitle:v.unref(I).label});else if(V==="indicators")if(tt)if(tt.show){ji.message.error({content:"该指标已存在,请勿重复添加",key:"repeatFlag"});return}else tt.show=!0,v.unref(Et).push(tt),v.unref(Et).splice(it,1);else v.unref(Et).push({...Ye.cloneDeep(v.unref(I)),...pt,showTitle:v.unref(I).label});else if(V==="filters"){if(["IDX","BUILT_IN_IDX"].includes(q))if(v.unref(Tt).find(Pt=>Pt.name===K)){ji.message.error({content:"该指标已存在,请勿重复添加",key:"repeatFlag"});return}else tt?(tt.isInnerFilter=!0,tt.timeStamp=new Date().getTime()):v.unref(Et).push({...Ye.cloneDeep(v.unref(I)),showTitle:v.unref(I).label,show:!1,isInnerFilter:!0,...pt});else if(["DIM","BUILT_IN_DIM"].includes(q))if(v.unref(Tt).find(Pt=>Pt.name===K)){ji.message.error({content:"该维度已存在,请勿重复添加",key:"repeatFlag"});return}else rt?(rt.isInnerFilter=!0,rt.timeStamp=new Date().getTime()):v.unref(Ht).push({...Ye.cloneDeep(v.unref(I)),positionType:"filters",showTitle:v.unref(I).label,show:!1,isInnerFilter:!0,...pt})}R.value=!0,I.value=null,Xh(),ln({type:"10",data:{dimensions:v.unref(Ht),indicators:v.unref(Et)}})}const kY=(V=[])=>{let K=!1;for(const q of v.unref(Ht))if(!V.find(Z=>Z.typeGuid===q.typeGuid)){K=!0;break}return K};v.provide("setItemDisabled",kY);const wB=()=>{},FY=({checkKeys:V,key:K,type:q})=>{q==="dimension"?(a.value[K]=V,c.value={},CY(K,V)):q==="indicators"&&(h.value[K]=V,bY(K,V))};function SB(V){let K=V;Array.isArray(K)||(K=[V]);for(const q of K){const{indicatorKey:rt,unit:Z="",format:tt,floatLength:it,position:pt}=q,Pt=cf(rt);if(Pt>-1){const Kt=J.indicators[Pt];Kt.formatConfig=q,Kt.format=(It,kt,Ft,Ie)=>{const ci=Ie.getRecordByCell(kt,Ft)||[];return ci[0]&&isNaN(+ci[0][Kt.indicatorKey])?ci[0][Kt.indicatorKey]:(tt==="integer"?It=Math.round(Number(It)):tt==="float"&&!isNaN(it)?It=Number(It).toFixed(it):tt==="percent"&&(it?It=(Number(It)*100).toFixed(it)+"%":It=Number(It)*100+"%"),pt==="right"?It+Z:Z+It)}}}n.updateOption(J)}function IY(V,K=[]){const q=cf(V);if(q>-1){const rt=J.indicators[q];rt.conditionalConfig=K;const Z=[];K.forEach(tt=>{let it="";tt.conditions.forEach((pt,Pt)=>{Pt>0&&(it+=pt.join==="and"?" && ":" || "),it+=`value${pt.operation}${pt.value}`}),Z.push(it)}),rt.style.color=({dataValue:tt})=>{let it="#333";return K.forEach((pt,Pt)=>{pt.color&&(it=gb(Z[Pt],tt)?pt.color:it)}),it},rt.style.textAlign=({dataValue:tt})=>{let it="left";return K.forEach((pt,Pt)=>{pt.align&&(it=gb(Z[Pt],tt)?pt.align:it)}),it},rt.customRender=({rect:tt,dataValue:it})=>{let pt=[];return K.forEach((Pt,Kt)=>{if(Pt.icon&&gb(Z[Kt],it)){const kt=W2(Pt.icon,Pt.iconColor);pt=[{type:"icon",x:Pt.align!=="right"?15:tt.width-25,y:tt.height/2-7,svg:kt,height:14,width:14}]}}),{elements:pt,renderDefault:!0}},n.updateOption(J)}}function gb(V,K){V=V||"true";const q=`function (value){
367
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function cU(i){var t=function(e,n){if(jl(e)!="object"||!e)return e;var o=e[Symbol.toPrimitive];if(o!==void 0){var r=o.call(e,n||"default");if(jl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}(i,"string");return jl(t)=="symbol"?t:t+""}function nb(i,t,e){return(t=cU(t))in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Zg=v.defineComponent({name:"Saturation",props:{size:{type:Number,default:160},hue:{type:Number,default:0},saturation:{type:Number,default:0},value:{type:Number,default:0}},emits:["change"],setup:function(i,t){var e=t.emit,n=v.computed(function(){return{width:"".concat(i.size,"px"),height:"".concat(i.size,"px"),background:"hsl(".concat(i.hue,", 100%, 50%)")}});return{saturationStyle:n,sliderStyle:v.computed(function(){return{top:"".concat((100-i.value)/100*i.size-5,"px"),left:"".concat(i.saturation*i.size/100-5,"px"),width:"".concat(10,"px"),height:"".concat(10,"px")}}),onSelect:function(o){var r=o.target.getBoundingClientRect(),s=r.left,l=r.top,a=function(d){var u=d.clientX,c=d.clientY,g=u-s,f=c-l;g<0&&(g=0),f<0&&(f=0),g>i.size&&(g=i.size),f>i.size&&(f=i.size);var p=g/i.size*100,m=100-f/i.size*100;e("change",p,m)},h=function(){document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",h)};a(o),document.addEventListener("mousemove",a),document.addEventListener("mouseup",h)}}}});function Mo(i,t){t===void 0&&(t={});var e=t.insertAt;if(i&&typeof document<"u"){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",e==="top"&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=i:o.appendChild(document.createTextNode(i))}}Mo(".saturation[data-v-24517fec]{position:relative}.saturation-black[data-v-24517fec],.saturation-white[data-v-24517fec]{cursor:pointer;height:100%;left:0;position:absolute;top:0;width:100%}.saturation-white[data-v-24517fec]{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.saturation-black[data-v-24517fec]{background:linear-gradient(0deg,#000,transparent)}.slider[data-v-24517fec]{border:1px solid #fff;border-radius:50%;box-shadow:0 0 1px 1px rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;top:0;z-index:1}"),Zg.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",{class:"saturation",style:v.normalizeStyle(i.saturationStyle),onMousedown:t[0]||(t[0]=v.withModifiers(function(){return i.onSelect&&i.onSelect.apply(i,arguments)},["prevent","stop"]))},[t[1]||(t[1]=v.createElementVNode("div",{class:"saturation-white"},null,-1)),t[2]||(t[2]=v.createElementVNode("div",{class:"saturation-black"},null,-1)),v.createElementVNode("div",{class:"slider",style:v.normalizeStyle(i.sliderStyle)},null,4)],36)},Zg.__scopeId="data-v-24517fec",Zg.__file="src/picker/Saturation.vue";var Jg=v.defineComponent({name:"Hue",props:{width:{type:Number,default:15},height:{type:Number,default:160},hue:{type:Number,default:0}},emits:["change"],setup:function(i,t){var e=t.emit,n=v.computed(function(){return{top:"".concat((1-i.hue/360)*i.height-2,"px"),height:"".concat(4,"px")}}),o=v.ref();return v.onMounted(function(){(function(){o.value.width=i.width,o.value.height=i.height;var r=o.value.getContext("2d"),s=r.createLinearGradient(0,0,0,i.height);s.addColorStop(0,"#FF0000"),s.addColorStop(.17,"#FF00FF"),s.addColorStop(.34,"#0000FF"),s.addColorStop(.51,"#00FFFF"),s.addColorStop(.68,"#00FF00"),s.addColorStop(.17*5,"#FFFF00"),s.addColorStop(1,"#FF0000"),r.fillStyle=s,r.fillRect(0,0,i.width,i.height)})()}),{canvas:o,sliderStyle:n,onSelect:function(r){var s=r.target.getBoundingClientRect().top,l=function(h){var d=h.clientY-s;d<0&&(d=0),d>i.height&&(d=i.height);var u=-100*d/i.height+100;e("change",360*u/100)},a=function(){document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",a)};l(r),document.addEventListener("mousemove",l),document.addEventListener("mouseup",a)}}}}),gU={ref:"canvas"};Mo(".hue[data-v-78b9f4f0]{position:relative}.slider[data-v-78b9f4f0]{background:#fff;box-shadow:0 0 1px 0 rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;width:100%;z-index:1}"),Jg.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",{class:"hue",onMousedown:t[0]||(t[0]=v.withModifiers(function(){return i.onSelect&&i.onSelect.apply(i,arguments)},["prevent","stop"]))},[v.createElementVNode("canvas",gU,null,512),v.createElementVNode("div",{class:"slider",style:v.normalizeStyle(i.sliderStyle)},null,4)],32)},Jg.__scopeId="data-v-78b9f4f0",Jg.__file="src/picker/Hue.vue";var Qg=v.defineComponent({name:"Alpha",props:{width:{type:Number,default:15},height:{type:Number,default:160},color:{type:String,default:"#000000"},alpha:{type:Number,default:1}},setup:function(i,t){var e=t.emit,n=v.computed(function(){return{top:"".concat(i.alpha*i.height-2,"px"),height:"".concat(4,"px")}}),o=v.ref(),r=function(){var s=o.value.getContext("2d");o.value.width=i.width,o.value.height=i.height;var l=function(h){var d=document.createElement("canvas"),u=d.getContext("2d"),c=2*h;return d.width=c,d.height=c,u.fillStyle="#ffffff",u.fillRect(0,0,c,c),u.fillStyle="#ccd5db",u.fillRect(0,0,h,h),u.fillRect(h,h,h,h),d}(5);s.fillStyle=s.createPattern(l,"repeat"),s.fillRect(0,0,i.width,i.height);var a=s.createLinearGradient(0,0,0,i.height);a.addColorStop(.01,"rgba(255,255,255,0)"),a.addColorStop(.99,i.color),s.fillStyle=a,s.fillRect(0,0,i.width,i.height)};return v.watch(function(){return i.color},function(){r()}),v.onMounted(function(){r()}),{canvas:o,sliderStyle:n,onSelect:function(s){var l=s.target.getBoundingClientRect().top,a=function(d){var u=d.clientY-l;u<0&&(u=0),u>i.height&&(u=i.height);var c=parseFloat((u/i.height).toFixed(2));e("change",c)},h=function(){document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",h)};a(s),document.addEventListener("mousemove",a),document.addEventListener("mouseup",h)}}}}),fU={ref:"canvas"};Mo(".alpha[data-v-24dc9656]{position:relative}.slider[data-v-24dc9656]{background:#fff;box-shadow:0 0 1px 0 rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;width:100%;z-index:1}"),Qg.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",{class:"alpha",onMousedown:t[0]||(t[0]=v.withModifiers(function(){return i.onSelect&&i.onSelect.apply(i,arguments)},["prevent","stop"]))},[v.createElementVNode("canvas",fU,null,512),v.createElementVNode("div",{class:"slider",style:v.normalizeStyle(i.sliderStyle)},null,4)],32)},Qg.__scopeId="data-v-24dc9656",Qg.__file="src/picker/Alpha.vue";var KM={rgb:"RGBA",hex:"HEX",hsl:"HSLA",hsv:"HSVA"},YM={rgb:"RGB",hex:"HEX",hsl:"HSL",hsv:"HSV"},pU={RGB:"rgb",RGBA:"rgb",HEX:"hex",HSL:"hsl",HSLA:"hsl",HSV:"hsv",HSVA:"hsv"};function XM(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),e.push.apply(e,n)}return e}function ob(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?XM(Object(e),!0).forEach(function(n){nb(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):XM(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}var Hs=null,qM=function(i,t,e){var n=v.ref({}),o=e||{},r=o.placement,s=o.defaultStyle,l={strategy:o.strategy||"absolute",placement:r||"auto",onFirstUpdate:function(){Hs.update()},modifiers:[{name:"offset",options:{offset:[0,5]}},{name:"computeStyles",options:{gpuAcceleration:!1,adaptive:!0}},{name:"flip",options:{allowedAutoPlacements:["top","bottom"]}},{name:"applyStyles",enabled:!1},{name:"updateState",enabled:!0,phase:"write",requires:["computeStyles"],fn:function(a){var h=a.state,d=h.styles,u=h.placement,c=d.popper;n.value=ob(ob(ob({},c),s),{},{transformOrigin:u==="top"?"center bottom":"center top"})}}]};return v.watch(function(){return[v.unref(i),v.unref(t)]},function(a,h){var d,u=$l(a,2),c=u[0],g=u[1],f=$l(h,2),p=f[0],m=f[1];if(c&&g&&(p!==c||m!==p)){(d=Hs)===null||d===void 0||d.destroy();var b=c.$el||c,C=g.$el||g;v.nextTick(function(){Hs=dU(b,C,l)})}}),v.onBeforeUnmount(function(){var a;Hs&&((a=Hs)===null||a===void 0||a.destroy(),Hs=null)}),{instance:Hs,style:n}},tf=v.defineComponent({props:{value:{type:String,default:"RGBA"},showAlpha:{type:Boolean},options:{type:[Boolean,Array]}},emits:["change"],setup:function(i,t){var e=t.emit,n=v.ref(null),o=v.ref(null),r=v.ref(!1),s=qM(n,o,{strategy:"fixed",defaultStyle:{zIndex:2}}).style,l=v.computed(function(){return Array.isArray(i.options)&&i.options.length>1}),a=v.computed(function(){var d=i.options,u=i.showAlpha,c=i.value;return Array.isArray(d)?u?d.map(function(g){return KM[g]}).filter(function(g){return!g.includes(c)}):d.map(function(g){return YM[g]}).filter(function(g){return!g.includes(c)}):[]}),h=function(d){var u,c,g=d.target;!((u=v.unref(n))!==null&&u!==void 0&&u.isEqualNode(g))&&(!((c=v.unref(n))===null||c===void 0)&&c.contains(g))||(r.value=!1)};return v.onMounted(function(){document.addEventListener("mouseup",h,!1)}),v.onUnmounted(function(){document.removeEventListener("mouseup",h,!1)}),{targetRef:n,selectorRef:o,selectorStyle:s,isShowSelector:r,isNeedSelect:l,formatOptions:a,onShow:function(){l.value&&(r.value=!0)},onFormatChange:function(d){e("change",pU[d])}}}}),mU={class:"format"},vU={key:0,class:"arrow"},bU=["onClick"];Mo(".format[data-v-5f6e8f5e]{position:relative}.label[data-v-5f6e8f5e]{align-items:center;background:#e7e8e9;color:#999;display:flex;float:left;font-weight:500;height:30px;justify-content:center;position:relative;width:60px}[pick-colors-theme=dark] .label[data-v-5f6e8f5e]{background:#252930;color:#999}.arrow[data-v-5f6e8f5e]{height:6px;margin-bottom:4px;margin-left:5px;transform:rotate(135deg);width:6px}.arrow[data-v-5f6e8f5e],[pick-colors-theme=dark] .arrow[data-v-5f6e8f5e]{border-right:1px solid #999;border-top:1px solid #999}.selector[data-v-5f6e8f5e]{align-items:center;background:#f7f8f9;border-radius:5px;box-shadow:0 0 16px 0 rgba(0,0,0,.16);cursor:pointer;display:flex;flex-direction:column;font-weight:400;justify-content:center;padding:4px}[pick-colors-theme=dark] .selector[data-v-5f6e8f5e]{background:#252930;color:#999}.selector-item[data-v-5f6e8f5e]{align-items:center;display:flex;height:30px;justify-content:center;width:60px}.selector-item[data-v-5f6e8f5e]:hover{background:#e1f2fe}[pick-colors-theme=dark] .selector-item[data-v-5f6e8f5e]{color:#fff}[pick-colors-theme=dark] .selector-item[data-v-5f6e8f5e]:hover{background:#0087fa}.active-selector-item[data-v-5f6e8f5e]{background:#e1f2fe}[pick-colors-theme=dark] .active-selector-item[data-v-5f6e8f5e]{background:#0087fa}.v-enter-active[data-v-5f6e8f5e],.v-leave-active[data-v-5f6e8f5e]{opacity:1;transform:scaleY(1);transform-origin:center top;transition:opacity .2s ease-in-out,transform .2s ease-in-out}.v-enter-from[data-v-5f6e8f5e],.v-leave-to[data-v-5f6e8f5e]{opacity:0;transform:scaleY(0)}"),tf.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",mU,[v.createElementVNode("div",{class:"label",ref:"targetRef",onClick:t[0]||(t[0]=function(){return i.onShow&&i.onShow.apply(i,arguments)})},[v.createElementVNode("span",null,v.toDisplayString(i.value),1),i.isNeedSelect?(v.openBlock(),v.createElementBlock("div",vU)):v.createCommentVNode("v-if",!0)],512),v.createVNode(v.Transition,null,{default:v.withCtx(function(){return[i.isShowSelector?(v.openBlock(),v.createElementBlock("div",{key:0,class:"selector",ref:"selectorRef",style:v.normalizeStyle(i.selectorStyle)},[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.formatOptions,function(s){return v.openBlock(),v.createElementBlock("div",{class:"selector-item",key:s,onClick:function(l){return i.onFormatChange(s)}},v.toDisplayString(s),9,bU)}),128))],4)):v.createCommentVNode("v-if",!0)]}),_:1})])},tf.__scopeId="data-v-5f6e8f5e",tf.__file="src/picker/input-value/FormatValue.vue";var ef=v.defineComponent({name:"Input",components:{FormatValue:tf},props:{format:{type:String,default:"RGBA"},value:{type:String,default:""},width:{type:Number},showAlpha:{type:Boolean},formatOptions:{type:[Boolean,Array]}},emits:["change","focus","blur","enter","formatChange"],setup:function(i,t){var e=t.emit;return{onInput:function(n){var o;e("change",(o=n.target)===null||o===void 0?void 0:o.value)},valueStyle:v.computed(function(){return{minWidth:"".concat(i.width,"px"),maxWidth:"".concat(i.width,"px"),width:"".concat(i.width,"px")}}),onFocus:function(){e("focus")},onBlur:function(){e("blur")},onEnter:function(){e("enter")},onFormatChange:function(n){e("formatChange",n)}}}}),CU={class:"input"},yU=[".value"];function ZM(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),e.push.apply(e,n)}return e}function Un(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?ZM(Object(e),!0).forEach(function(n){nb(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):ZM(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}Mo(".input[data-v-2c454c00]{display:flex;font-size:12px}.value[data-v-2c454c00]{background:#eceef0;border:1px solid #eceef0;box-sizing:border-box;color:#666;flex:1;height:30px;text-align:center}[pick-colors-theme=dark] .value[data-v-2c454c00]{background:#2e333a;border:1px solid #2e333a;color:#fff}.value[data-v-2c454c00]:focus{border:1px solid #1890ff;outline:none}"),ef.render=function(i,t,e,n,o,r){var s=v.resolveComponent("FormatValue");return v.openBlock(),v.createElementBlock("div",CU,[v.createVNode(s,{value:i.format,showAlpha:i.showAlpha,options:i.formatOptions,onChange:i.onFormatChange},null,8,["value","showAlpha","options","onChange"]),v.createElementVNode("input",{class:"value",style:v.normalizeStyle(i.valueStyle),".value":i.value,onFocus:t[0]||(t[0]=function(){return i.onFocus&&i.onFocus.apply(i,arguments)}),onInput:t[1]||(t[1]=function(){return i.onInput&&i.onInput.apply(i,arguments)}),onBlur:t[2]||(t[2]=function(){return i.onBlur&&i.onBlur.apply(i,arguments)}),onKeydown:t[3]||(t[3]=v.withKeys(function(){return i.onEnter&&i.onEnter.apply(i,arguments)},["enter"]))},null,44,yU)])},ef.__scopeId="data-v-2c454c00",ef.__file="src/picker/input-value/InputValue.vue";var JM=function(i,t,e){return[i,t*e/((i=(2-t)*e)<1?i:2-i)||0,i/2]},QM={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},nf=function(i){i=Math.min(Math.round(i),255);var t=Math.floor(i/16),e=i%16;return"".concat(QM[t]||t).concat(QM[e]||e)},tB=function(i){var t=i.r,e=i.g,n=i.b;return isNaN(t)||isNaN(e)||isNaN(n)?"":"#".concat(nf(t)).concat(nf(e)).concat(nf(n))},Gl=function(i,t){var e;typeof(e=i)=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1&&(i="100%");var n=function(o){return typeof o=="string"&&o.indexOf("%")!==-1}(i);return i=Math.min(t,Math.max(0,parseFloat("".concat(i)))),n&&(i=parseInt("".concat(i*t),10)/100),Math.abs(i-t)<1e-6?1:i%t/parseFloat(t)},Kh=function(i,t,e){i=6*Gl(i,360),t=Gl(t,100),e=Gl(e,100);var n=Math.floor(i),o=i-n,r=e*(1-t),s=e*(1-o*t),l=e*(1-(1-o)*t),a=n%6,h=[e,s,r,r,l,e][a],d=[l,e,e,s,r,r][a],u=[r,r,l,e,e,s][a];return{r:Math.round(255*h),g:Math.round(255*d),b:Math.round(255*u)}},eB=function(i,t,e){var n,o,r=i.h,s=i.s,l=i.v,a=i.a;if(e)switch(a=(o=(n=a).toString().match(/\.(\d{1,2})(\d*)/))&&o[2].length>0?parseFloat(n.toFixed(2)):n,t){case"hsl":var h=JM(r,s/100,l/100);return"hsla(".concat(r.toFixed(0),", ").concat(Math.round(100*h[1]),"%, ").concat(Math.round(100*h[2]),"%, ").concat(a,")");case"hsv":return"hsva(".concat(r.toFixed(0),", ").concat(Math.round(s),"%, ").concat(Math.round(l),"%, ").concat(a,")");case"rgb":var d=Kh(r,s,l),u=d.r,c=d.g,g=d.b;return"rgba(".concat(u,", ").concat(c,", ").concat(g,", ").concat(a,")");default:return"".concat(tB(Kh(r,s,l))).concat(nf(255*a))}else switch(t){case"hsl":var f=JM(r,s/100,l/100);return"hsl(".concat(r.toFixed(0),", ").concat(Math.round(100*f[1]),"%, ").concat(Math.round(100*f[2]),"%)");case"hsv":return"hsv(".concat(r.toFixed(0),", ").concat(Math.round(s),"%, ").concat(Math.round(l),"%)");case"rgb":var p=Kh(r,s,l),m=p.r,b=p.g,C=p.b;return"rgb(".concat(m,", ").concat(b,", ").concat(C,")");default:return tB(Kh(r,s,l))}},of=function(i){var t=i.r,e=i.g,n=i.b;t=Gl(t,255),e=Gl(e,255),n=Gl(n,255);var o,r=Math.max(t,e,n),s=Math.min(t,e,n),l=r,a=r-s,h=r===0?0:a/r;if(r===s)o=0;else{switch(r){case t:o=(e-n)/a+(e<n?6:0);break;case e:o=(n-t)/a+2;break;case n:o=(t-e)/a+4}o/=6}return{h:360*o,s:100*h,v:100*l}},iB=function(i){var t=i.h,e=i.s,n=i.l;n/=100;var o=e/=100,r=Math.max(n,.01);return e*=(n*=2)<=1?n:2-n,o*=r<=1?r:2-r,{h:+t,s:100*(n===0?2*o/(r+o):2*e/(n+e)),v:100*((n+e)/2)}},nB=function(i){var t=[];if(i.match(/^#([0-9a-fA-f]{3,4})$/g))for(var e=1;e<i.length;e++)t.push(parseInt("0x"+i[e].repeat(2)));else if(i.match(/^#([0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/g))for(var n=1;n<i.length;n+=2)t.push(parseInt("0x"+i.slice(n,n+2)));return{r:t[0],g:t[1],b:t[2],a:t[3]}},rb=function(i,t,e){if(typeof i=="string"&&i!==""){var n=rf(i,sf(i),e),o=lB(n);return o==null?"":eB(o,t,e)}return""},oB=function(i){var t=$l(i.match(/(\d(\.\d+)?)+/g),4);return{r:t[0],g:t[1],b:t[2],a:t[3]}},rB=function(i){var t=$l(i.match(/(\d(\.\d+)?)+/g),4),e=t[0],n=t[1],o=t[2],r=t[3];return{h:e,s:parseFloat(n),l:parseFloat(o),a:r}},sB=function(i){var t=$l(i.match(/(\d(\.\d+)?)+/g),4),e=t[0],n=t[1],o=t[2],r=t[3];return{h:parseFloat(e),s:parseFloat(n),v:parseFloat(o),a:parseFloat(r)}},rf=function(i,t){if(!(arguments.length>2&&arguments[2]!==void 0)||arguments[2])switch(t){case"rgb":var e=oB(i),n=e.r,o=e.g,r=e.b,s=e.a;return Un(Un({},of({r:n,g:o,b:r})),{},{a:+s});case"hsv":var l=sB(i);return{h:l.h,s:l.s,v:l.v,a:l.a};case"hsl":var a=rB(i),h=a.h,d=a.s,u=a.l,c=a.a;return Un(Un({},iB({h,s:d,l:u})),{},{a:+c});default:var g=nB(i),f=g.r,p=g.g,m=g.b,b=g.a;return Un(Un({},of({r:f,g:p,b:m})),{},{a:b/255})}else switch(t){case"rgb":return Un(Un({},of(oB(i))),{},{a:1});case"hsv":var C=sB(i);return{h:C.h,s:C.s,v:C.v,a:1};case"hsl":return Un(Un({},iB(rB(i))),{},{a:1});default:return Un(Un({},of(nB(i))),{},{a:1})}},sf=function(i){return i.match(/^#/)?"hex":i.match(/^rgb/)?"rgb":i.match(/^hsl/)?"hsl":i.match(/^hsv/)?"hsv":"hex"},lB=function(i){var t=i.h,e=i.s,n=i.v,o=i.a;return isNaN(t)&&isNaN(e)&&isNaN(n)?null:(isNaN(t)&&(t=0),isNaN(e)&&(e=0),isNaN(n)&&(n=0),isNaN(o)&&(o=1),{h:t,s:e,v:n,a:o})},Yh=v.defineComponent({name:"ColorItem",props:{size:{type:[Number,String],default:20},width:{type:[Number,String]},height:{type:[Number,String]},value:{type:String,default:""},border:{type:Boolean,default:!0},borderRadius:{type:Number,default:5},selected:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1}},emits:["select"],setup:function(i){var t=v.ref(),e=v.inject("theme",{theme:"light"}).theme,n=v.computed(function(){return parseFloat((i.width||i.size)+"")}),o=v.computed(function(){return parseFloat((i.height||i.size)+"")}),r=v.computed(function(){return{width:"".concat(v.unref(n),"px"),height:"".concat(v.unref(o),"px"),border:i.border?"1px solid ".concat(v.unref(e)==="dark"?"#434345":"#d9d9d9"):"",borderRadius:"".concat(i.borderRadius,"px"),boxShadow:i.selected?"0 0 3px 2px ".concat(v.unref(e)==="dark"?"#2681ff":"#1890ff"):""}}),s=function(){var l=t.value.getContext("2d");t.value.width=v.unref(n),t.value.height=v.unref(o);var a=function(h){var d=document.createElement("canvas"),u=d.getContext("2d"),c=2*h;return d.width=c,d.height=c,u.fillStyle="#ffffff",u.fillRect(0,0,c,c),u.fillStyle="#ccd5db",u.fillRect(0,0,h,h),u.fillRect(h,h,h,h),d}(5);l.fillStyle=l.createPattern(a,"repeat"),l.fillRect(0,0,v.unref(n),v.unref(o)),l.fillStyle=i.value,l.fillRect(0,0,v.unref(n),v.unref(o))};return v.watch(function(){return i.value},function(){s()}),v.onMounted(function(){s()}),{canvas:t,colorItemStyle:r}}}),_U=["draggable"];Mo(".color-item[data-v-02da71fd]{display:inline-block;vertical-align:top}"),Yh.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("canvas",{class:"color-item",style:v.normalizeStyle(i.colorItemStyle),ref:"canvas",draggable:i.draggable},null,12,_U)},Yh.__scopeId="data-v-02da71fd",Yh.__file="src/color-item/ColorItem.vue";var lf=v.defineComponent({name:"Colors",components:{ColorItem:Yh},props:{colors:{type:Array,default:function(){return[]}},selectedIndex:{type:Number,default:-1}},emits:["change"],setup:function(i,t){var e=t.emit;return{onSelectColor:function(n,o){e("change",n,o)},useColors:v.computed(function(){return i.colors.map(function(n){return rb(n,"hex",!0)})})}}}),wU={class:"colors"};function aB(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),e.push.apply(e,n)}return e}function Bo(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?aB(Object(e),!0).forEach(function(n){nb(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):aB(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}Mo(".colors[data-v-0f8b52a8]{align-items:center;display:flex;flex-wrap:wrap;margin-top:5px}.color-item[data-v-0f8b52a8]{margin:5px}"),lf.render=function(i,t,e,n,o,r){var s=v.resolveComponent("color-item");return v.openBlock(),v.createElementBlock("div",wU,[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.useColors,function(l,a){return v.openBlock(),v.createBlock(s,{key:a,class:"color-item",size:16,value:l,border:!1,"border-radius":3,selected:i.selectedIndex===a,onClick:v.withModifiers(function(h){return i.onSelectColor(l,+a)},["stop","prevent"])},null,8,["value","selected","onClick"])}),128))])},lf.__scopeId="data-v-0f8b52a8",lf.__file="src/picker/Colors.vue";var af=v.defineComponent({name:"Picker",components:{Colors:lf,Saturation:Zg,Hue:Jg,Alpha:Qg,InputValue:ef},props:{format:{type:String,default:"hex"},showAlpha:{type:Boolean,default:!1},value:{type:String,default:""},colors:{type:Array,default:function(){return[]}},style:{type:Object,default:function(){return{}}},formatOptions:{type:[Boolean,Array]}},emits:["change","formatChange"],setup:function(i,t){var e=t.emit,n=v.computed(function(){return Bo(Bo({},i.style),{},{width:i.showAlpha?"230px":"205px"})}),o=v.ref(),r=v.ref(),s=v.ref(),l=function(){var p,m=(p=i.value)===null||p===void 0?void 0:p.trim();if(m!=null&&m!==""){var b=sf(m);return lB(rf(m,b,i.showAlpha))}return null};v.watch(function(){return i.value},function(){i.value!==v.unref(s)&&(o.value=l())},{immediate:!0}),v.watch(function(){return[v.unref(o),i.format]},function(p){var m=$l(p,2),b=m[0],C=m[1],_="";b!=null?(_=eB(Bo({},b),i.format,i.showAlpha),r.value=Bo({},b)):r.value=null,s.value=_;var w=l();JSON.stringify(b)!==JSON.stringify(w)&&JSON.stringify(b)!==JSON.stringify(C)&&e("change",_)},{immediate:!0});var a=v.computed(function(){var p;return((p=v.unref(o))===null||p===void 0?void 0:p.h)||0}),h=v.computed(function(){var p;return((p=v.unref(o))===null||p===void 0?void 0:p.s)||0}),d=v.computed(function(){var p;return((p=v.unref(o))===null||p===void 0?void 0:p.v)||0}),u=v.computed(function(){var p,m;return((p=v.unref(o))===null||p===void 0?void 0:p.a)!=null?(m=v.unref(o))===null||m===void 0?void 0:m.a:1}),c=v.computed(function(){return Kh(v.unref(a),v.unref(h),v.unref(d))}),g=v.computed(function(){return"rgb(".concat(v.unref(c).r,", ").concat(v.unref(c).g,", ").concat(v.unref(c).b,")")}),f=v.ref(-1);return{h:a,s:h,v:d,a:u,rgbStr:g,onSelectSaturation:function(p,m){f.value=-1,v.unref(o)==null?o.value={h:v.unref(a),s:p,v:m,a:v.unref(u)}:o.value=Bo(Bo({},v.unref(o)),{},{s:p,v:m})},onSelectHue:function(p){f.value=-1,v.unref(o)==null&&(o.value={h:p,s:v.unref(h),v:v.unref(d),a:v.unref(u)}),o.value=Bo(Bo({},v.unref(o)),{},{h:p})},onSelectAlpha:function(p){f.value=-1,v.unref(o)==null?o.value={h:v.unref(a),s:v.unref(h),v:v.unref(d),a:p}:o.value=Bo(Bo({},v.unref(o)),{},{a:p})},handleInputFormat:function(p){return i.showAlpha?KM[p]:YM[p]},colorValue:s,pickerStyle:n,onInputChange:function(p){f.value=-1,s.value=p},handleChange:function(){var p,m=(p=v.unref(s))===null||p===void 0?void 0:p.trim();if(m!==""){var b=i.showAlpha,C=sf(m),_=rf(m,C,b),w=function(y){var S=y.h,A=y.s,R=y.v,x=y.a;return!(isNaN(S)||isNaN(A)||isNaN(R)||isNaN(x))}(_);w?o.value=_:v.unref(r)!=null?o.value=v.unref(r):s.value=""}else o.value=null},selectColorIndex:f,onSelectColor:function(p,m){if(f.value=m,(p=p.trim())==="")o.value=null;else{var b=sf(p);b?function(C,_,w){if(C.length!==0){var y=rf(C,_,w),S=y.h,A=y.s,R=y.v;if(!(isNaN(S)||isNaN(A)||isNaN(R))){var x=1,T=y.a;isNaN(T)||(x=T),o.value={h:S,s:A,v:R,a:x}}}}(p,b,!0):o.value=null}},onFormatChange:function(p){e("formatChange",p)}}}}),SU={class:"picker-inner"},xU={class:"picker-header"};Mo(".picker[data-v-6ceadec6]{background:#f7f8f9;border-radius:4px;box-shadow:0 0 16px 0 rgba(0,0,0,.16)}.picker-inner[data-v-6ceadec6]{padding:10px}[pick-colors-theme=dark] .picker-inner[data-v-6ceadec6]{background:#1d2024;box-shadow:0 0 16px 0 rgba(0,0,0,.16)}.picker-header[data-v-6ceadec6]{display:flex;margin-bottom:5px}.alpha[data-v-6ceadec6],.hue[data-v-6ceadec6]{margin-left:10px}.colors[data-v-6ceadec6]{margin-top:5px}"),af.render=function(i,t,e,n,o,r){var s=v.resolveComponent("saturation"),l=v.resolveComponent("hue"),a=v.resolveComponent("alpha"),h=v.resolveComponent("input-value"),d=v.resolveComponent("Colors");return v.openBlock(),v.createElementBlock("div",{class:"picker",style:v.normalizeStyle(i.pickerStyle)},[v.createElementVNode("div",SU,[v.createElementVNode("div",xU,[v.createVNode(s,{class:"saturation",hue:i.h,saturation:i.s,value:i.v,onChange:i.onSelectSaturation},null,8,["hue","saturation","value","onChange"]),v.createVNode(l,{class:"hue",hue:i.h,onChange:i.onSelectHue},null,8,["hue","onChange"]),i.showAlpha?(v.openBlock(),v.createBlock(a,{key:0,class:"alpha",alpha:i.a,color:i.rgbStr,onChange:i.onSelectAlpha},null,8,["alpha","color","onChange"])):v.createCommentVNode("v-if",!0)]),v.createVNode(h,{format:i.handleInputFormat(i.format),value:i.colorValue,showAlpha:i.showAlpha,width:i.showAlpha?150:125,formatOptions:i.formatOptions,onChange:i.onInputChange,onBlur:i.handleChange,onEnter:i.handleChange,onFormatChange:i.onFormatChange},null,8,["format","value","showAlpha","width","formatOptions","onChange","onBlur","onEnter","onFormatChange"]),i.colors.length>0?(v.openBlock(),v.createBlock(d,{key:0,class:"colors",colors:i.colors,"selected-index":i.selectColorIndex,onChange:i.onSelectColor},null,8,["colors","selected-index","onChange"])):v.createCommentVNode("v-if",!0)])],4)},af.__scopeId="data-v-6ceadec6",af.__file="src/picker/Picker.vue";var hf=v.defineComponent({name:"AddColorItem",props:{size:{type:Number,default:20},selected:{type:Boolean,default:!1}},setup:function(i){var t=v.inject("theme",{theme:"light"}).theme;return{addColorItemStyle:v.computed(function(){return{width:"".concat(i.size,"px"),height:"".concat(i.size,"px"),lineHeight:"".concat(i.size,"px"),boxShadow:i.selected?"0 0 3px 2px ".concat(v.unref(t)==="dark"?"#2681ff":"#1890ff"):""}})}}});Mo(".add-color-item[data-v-ceb1719c]{background:#fff;border:1px solid #d9d9d9;border-radius:5px;vertical-align:top}.container[data-v-ceb1719c]{pointer-events:none;transform:scale(.9);transform-origin:center}[pick-colors-theme=dark] .add-color-item[data-v-ceb1719c]{background:#141414;border:1px solid #434343}path[data-v-ceb1719c]{fill:#000}[pick-colors-theme=dark] path[data-v-ceb1719c]{fill:#fff}"),hf.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("svg",{class:"add-color-item",style:v.normalizeStyle(i.addColorItemStyle),viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},t[0]||(t[0]=[v.createElementVNode("g",{class:"container"},[v.createElementVNode("path",{d:"M544 464V160h-80v304H160v80h304v304h80V544h304v-80z"})],-1)]),4)},hf.__scopeId="data-v-ceb1719c",hf.__file="src/add-color-item/AddColorItem.vue";var df=v.defineComponent({name:"ColorPicker",components:{ColorItem:Yh,Picker:af,AddColorItem:hf},props:{value:{type:[String,Array]},theme:{type:String,default:"light"},size:{type:[Number,String],default:20},width:{type:[Number,String]},height:{type:[Number,String]},format:{type:String},showPicker:{type:Boolean,default:void 0},showAlpha:{type:Boolean,default:!1},addColor:{type:Boolean,default:!1},deleteColor:{type:Boolean,default:!0},max:{type:Number,default:13},popupContainer:{type:[String,Object,Boolean],default:"body"},zIndex:{type:Number,default:1e3},colors:{type:Array,default:function(){return["#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","#ff4500","#ff7d4d","#00babd","#1f93ff","#fa64c3"]}},position:{type:String},placement:{type:String},formatOptions:{type:[Boolean,Array],default:!1}},emits:["change","update:value","update:showPicker","overflowMax","closePicker","formatChange"],setup:function(i,t){var e=t.emit,n=v.ref([]),o=v.computed(function(){return v.unref(n).map(function(x){return rb(x,"hex",i.showAlpha)})}),r=v.ref("hex");v.watch(function(){return i.format},function(){r.value=i.format},{immediate:!0}),v.watch(function(){return i.value},function(){var x=i.value||"",T=Array.isArray(x)?x:[x];n.value=T.map(function(M){return rb(M,v.unref(r),i.showAlpha)})},{immediate:!0});var s=v.ref(void 0),l=v.computed(function(){return v.unref(n)[v.unref(s)]}),a=v.ref(!1);v.watch(function(){return i.showPicker},function(){a.value=i.showPicker},{immediate:!0});var h,d,u=v.ref(null),c=v.ref(null),g=qM(u,c,{defaultStyle:{zIndex:i.zIndex},strategy:i.position,placement:i.placement}).style,f=function(){v.unref(u)==null&&(u.value=v.unref(R)[0]),v.unref(s)==null&&(s.value=0),i.showPicker===void 0?a.value=!0:e("update:showPicker",!0)},p=function(){s.value=void 0,i.showPicker===void 0?a.value=!1:e("update:showPicker",!1),e("closePicker",v.toRaw(Array.isArray(i.value)||i.addColor?v.unref(n):v.unref(n)[0]))},m=v.ref(),b=function(){var x=$M(qg.mark(function T(M){var B,P,F,H;return qg.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(P=M.target,(F=(B=P.dataset)===null||B===void 0?void 0:B.index)!=null&&F!==""){E.next=4;break}return E.abrupt("return");case 4:if(H=+F,v.unref(s)!==H){E.next=7;break}return E.abrupt("return");case 7:v.unref(s)!=null&&v.unref(s)!==H?(p(),h&&clearTimeout(h),h=setTimeout(function(){f(),clearTimeout(h)},100)):f(),s.value=H,u.value=P;case 10:case"end":return E.stop()}},T)}));return function(T){return x.apply(this,arguments)}}(),C=function(){var x=$M(qg.mark(function T(M){var B,P,F,H,E;return qg.wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(H=M.target,!(!((B=v.unref(m))!==null&&B!==void 0&&B.isEqualNode(H))&&(!((P=v.unref(m))===null||P===void 0)&&P.contains(H)))){k.next=4;break}return k.abrupt("return");case 4:if(E=(F=v.unref(c))===null||F===void 0?void 0:F.$el,!(E!=null&&E.contains(H))){k.next=8;break}return k.abrupt("return");case 8:d&&clearTimeout(d),d=setTimeout(function(){v.unref(a)&&p()},0);case 10:case"end":return k.stop()}},T)}));return function(T){return x.apply(this,arguments)}}();v.watch(a,function(){v.unref(a)&&(f(),clearTimeout(d))});var _,w=v.ref(i.max>v.unref(n).length),y=v.computed(function(){return typeof i.popupContainer=="string"||jl(i.popupContainer)==="object"&&i.popupContainer!=null?i.popupContainer:"body"}),S=v.computed(function(){return typeof i.popupContainer=="boolean"&&i.popupContainer===!1}),A=v.computed(function(){return i.theme});v.watch(function(){return[i.theme,v.unref(c)]},function(){v.nextTick(function(){var x,T;(x=v.unref(m))===null||x===void 0||x.setAttribute("pick-colors-theme",v.unref(A)),(T=v.unref(c))===null||T===void 0||(T=T.$el)===null||T===void 0||T.setAttribute("pick-colors-theme",v.unref(A))})},{immediate:!0}),v.provide("theme",{theme:A});var R=v.ref([]);return v.onMounted(function(){document.addEventListener("mouseup",C,!1),i.showPicker&&f()}),v.onUnmounted(function(){document.removeEventListener("mouseup",C,!1),h&&(clearTimeout(h),h=null),d&&(clearTimeout(d),d=null)}),{valueList:n,colorItemSelected:function(x){return(i.addColor?v.unref(n).length>0:v.unref(n).length>1)&&v.unref(s)===x},selectedColor:l,selectedIndex:s,isShowPicker:a,addColorItemShow:w,onPickerChange:function(x){var T=v.unref(s),M=v.unref(n).slice(),B=v.unref(n).length;if(T!=null){T>=0?M[T]=x:(s.value=B,M.push(x));var P="";P=Array.isArray(i.value)||i.addColor?M:x,n.value=Array.isArray(P)?P:[P],e("update:value",P),e("change",P,x,T),i.addColor&&B>=i.max&&(w.value=!1,e("overflowMax"))}},colorPicker:m,onColorClick:b,pickerRef:c,onColorItemDragStart:function(x){x.dataTransfer.effectAllowed="move";var T=x.target;_=+T.dataset.index},onColorItemDragOver:function(x){},onColorItemDrop:function(x){var T=+x.target.dataset.index,M=uU(v.unref(n)),B=M[_];M.splice(_,1);var P=M.slice(0,T),F=M.splice(T),H=P.concat([B]).concat(F);e("update:value",H),e("change",H,H[_],_)},colorItemsRef:R,pickerStyle:g,values:o,teleportDisabled:S,toPopupContainer:y,formatValue:r,onFormatChange:function(x){r.value=x,e("formatChange",x)}}}});Mo(".color-picker[data-v-3c43ade8]{display:inline-block}.color-item[data-v-3c43ade8]{margin:5px}.add-color-item[data-v-3c43ade8]{display:inline-block;margin:5px}.picker[data-v-3c43ade8]{overflow:hidden}.v-enter-active[data-v-3c43ade8],.v-leave-active[data-v-3c43ade8]{opacity:1;transform:scaleY(1);transform-origin:center top;transition:opacity .2s ease-in-out,transform .2s ease-in-out}.v-enter-from[data-v-3c43ade8],.v-leave-to[data-v-3c43ade8]{opacity:0;transform:scaleY(0)}"),df.render=function(i,t,e,n,o,r){var s=v.resolveComponent("color-item"),l=v.resolveComponent("add-color-item"),a=v.resolveComponent("picker");return v.openBlock(),v.createElementBlock("div",{class:"color-picker",ref:"colorPicker",onDragstart:t[0]||(t[0]=v.withModifiers(function(){return i.onColorItemDragStart&&i.onColorItemDragStart.apply(i,arguments)},["stop"])),onDragover:t[1]||(t[1]=v.withModifiers(function(){return i.onColorItemDragOver&&i.onColorItemDragOver.apply(i,arguments)},["prevent","stop"])),onDrop:t[2]||(t[2]=v.withModifiers(function(){return i.onColorItemDrop&&i.onColorItemDrop.apply(i,arguments)},["prevent","stop"])),onClick:t[3]||(t[3]=v.withModifiers(function(){return i.onColorClick&&i.onColorClick.apply(i,arguments)},["stop"]))},[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.values,function(h,d){return v.openBlock(),v.createBlock(s,{class:"color-item",key:d,ref_for:!0,ref:function(u){return i.colorItemsRef[d]=u},size:i.size,width:i.width,height:i.height,value:h,selected:i.colorItemSelected(d),"data-index":d,draggable:i.valueList.length>1,format:i.formatValue},null,8,["size","width","height","value","selected","data-index","draggable","format"])}),128)),i.addColor&&i.addColorItemShow?(v.openBlock(),v.createBlock(l,{key:0,class:"add-color-item",ref:"addColorItem",selected:i.colorItemSelected(-1),"data-index":-1},null,8,["selected"])):v.createCommentVNode("v-if",!0),(v.openBlock(),v.createBlock(v.Teleport,{to:i.toPopupContainer,disabled:i.teleportDisabled},[v.createVNode(v.Transition,null,{default:v.withCtx(function(){return[i.isShowPicker?(v.openBlock(),v.createBlock(a,{key:0,class:"picker",style:v.normalizeStyle(i.pickerStyle),ref:"pickerRef",value:i.selectedColor,format:i.formatValue,"show-alpha":i.showAlpha,colors:i.colors,formatOptions:i.formatOptions,onChange:i.onPickerChange,onFormatChange:i.onFormatChange},null,8,["style","value","format","show-alpha","colors","formatOptions","onChange","onFormatChange"])):v.createCommentVNode("v-if",!0)]}),_:1})],8,["to","disabled"]))],544)},df.__scopeId="data-v-3c43ade8",df.__file="src/ColorPicker.vue";const PX="",RU=v.defineComponent({name:"ColorPick",components:{PickColors:df},props:{value:{type:String,default:""}},setup(i,{emit:t}){const e=v.ref(i.value);v.watch(()=>i.value,o=>{e.value=o},{immediate:!0});function n(){t("changeProp",v.unref(e))}return{myValue:e,onChange:n}}}),AU={class:"color-pick"};function TU(i,t,e,n,o,r){const s=v.resolveComponent("a-input"),l=v.resolveComponent("pick-colors");return v.openBlock(),v.createElementBlock("div",AU,[v.createVNode(s,{class:"input",size:"small",value:i.myValue,"onUpdate:value":t[0]||(t[0]=a=>i.myValue=a),onChange:i.onChange},null,8,["value","onChange"]),v.createVNode(l,{value:i.myValue,"onUpdate:value":t[1]||(t[1]=a=>i.myValue=a),onChange:i.onChange},null,8,["value","onChange"])])}const MU=Ti(RU,[["render",TU],["__scopeId","data-v-99378939"]]),BU=v.defineComponent({name:"Radio",props:{value:{type:String,default:""},options:{type:Array,default(){return[]}}},setup(i,{emit:t}){function e(n){t("changeProp",n.target.value)}return{onChange:e}}});function PU(i,t,e,n,o,r){const s=v.resolveComponent("a-radio-group");return v.openBlock(),v.createBlock(s,{value:i.value,size:"small",onChange:i.onChange,options:i.options,optionType:"button"},null,8,["value","onChange","options"])}const HU=Ti(BU,[["render",PU]]),HX="",EU=v.defineComponent({name:"PropertyConfig",components:{ColorPick:MU,Radio:HU},props:{config:{type:Object,default(){return{}}},selectedIndex:{type:Boolean}},setup(i){const t=v.inject("theme","light"),e=[{label:"字体颜色",key:"color",component:"color-pick"},{label:"对齐方式",key:"align",component:"radio",props:{options:[{label:"左",value:"left"},{label:"中",value:"center"},{label:"右",value:"right"}]}},{label:"图标",key:"icon",component:"radio",props:{options:[{label:"上涨",value:"increase"},{label:"下跌",value:"decline"}]}},{label:"图标颜色",key:"iconColor",component:"color-pick"}],n=v.ref([]);v.watch(()=>i.selectedIndex,()=>{if(i.selectedIndex>-1){const l=Object.keys(i.config);n.value=l}});function o(l,a){i.config[l]=a}function r(l,a){if(l.target.checked)i.config[a]="",v.unref(n).push(a);else{delete i.config[a];const h=v.unref(n).indexOf(a);v.unref(n).splice(h,1)}}const s=v.computed(()=>v.unref(t)==="darkBlue"?"#b2c3dd":"");return{formConfig:e,handleSelect:r,selectedProperty:n,onChange:o,fontColor:s}}}),LU={class:"content"},kU={class:"list"};function FU(i,t,e,n,o,r){const s=v.resolveComponent("a-checkbox");return v.openBlock(),v.createElementBlock("div",LU,[v.createElementVNode("div",{style:v.normalizeStyle({color:i.fontColor,height:"32px",lineHeight:"32px"})},"属性配置",4),v.createElementVNode("div",kU,[i.selectedIndex>-1?(v.openBlock(!0),v.createElementBlock(v.Fragment,{key:0},v.renderList(i.formConfig,({label:l,component:a,props:h,key:d},u)=>(v.openBlock(),v.createElementBlock("div",{class:"list-item",style:{display:"flex"},key:u},[v.createVNode(s,{checked:i.selectedProperty.includes(d),onChange:c=>i.handleSelect(c,d)},null,8,["checked","onChange"]),v.createElementVNode("span",{style:v.normalizeStyle({padding:"0 8px",color:i.fontColor})},v.toDisplayString(l),5),i.selectedProperty.includes(d)?(v.openBlock(),v.createBlock(v.resolveDynamicComponent(a),v.mergeProps({key:0,value:i.config[d],ref_for:!0},h,{onChangeProp:c=>i.onChange(d,c)}),null,16,["value","onChangeProp"])):v.createCommentVNode("",!0)]))),128)):v.createCommentVNode("",!0)])])}const IU=Ti(EU,[["render",FU],["__scopeId","data-v-b2df2e2d"]]),DU=v.defineComponent({name:"ConditionalProperty",props:{},components:{ConditionalItemConfig:X$,ConditionalConfig:oG,PropertyConfig:IU},setup(i,{emit:t,expose:e}){const n=v.ref(!1),o=v.ref([]),r=v.ref(-1),s=v.inject("theme","light"),l=v.inject("getContainer",()=>{});let a="";const h=v.computed(()=>v.unref(r)>-1?v.unref(o)[v.unref(r)]:{});function d(f,p=[]){a=f,o.value=p,n.value=!0}function u(f){r.value=f}function c(){t("change",a,v.unref(o)),r.value=-1,n.value=!1}function g(){r.value=-1,o.value=[]}return v.watch(n,f=>{window.modalShow&&window.modalShow(f)}),e({showModal:d}),{theme:s,visible:n,config:o,changeSelectedItem:u,selectedConfig:h,selectedIndex:r,handleOk:c,handleClear:g,getContainer:l}}}),OU={style:{display:"flex"}};function zU(i,t,e,n,o,r){const s=v.resolveComponent("conditional-item-config"),l=v.resolveComponent("conditional-config"),a=v.resolveComponent("property-config"),h=v.resolveComponent("a-button"),d=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(d,{wrapClassName:i.theme,title:"条件属性",visible:i.visible,"onUpdate:visible":t[1]||(t[1]=u=>i.visible=u),"ok-text":"确认","cancel-text":"取消",style:{width:"950px",top:"60px",height:"700px"},maskClosable:!1,destroyOnClose:!0,getContainer:i.getContainer,onOk:i.handleOk},{footer:v.withCtx(()=>[v.createVNode(h,{onClick:t[0]||(t[0]=u=>i.visible=!1)},{default:v.withCtx(()=>t[2]||(t[2]=[v.createTextVNode("取消")])),_:1}),v.createVNode(h,{onClick:i.handleClear},{default:v.withCtx(()=>t[3]||(t[3]=[v.createTextVNode("清除筛选")])),_:1},8,["onClick"]),v.createVNode(h,{type:"primary",onClick:i.handleOk},{default:v.withCtx(()=>t[4]||(t[4]=[v.createTextVNode("确定")])),_:1},8,["onClick"])]),default:v.withCtx(()=>[v.createElementVNode("div",OU,[v.createVNode(s,{config:i.config,onChange:i.changeSelectedItem},null,8,["config","onChange"]),v.createVNode(l,{config:i.selectedConfig.conditions,isSelected:i.selectedIndex>-1},null,8,["config","isSelected"]),v.createVNode(a,{config:i.selectedConfig,selectedIndex:i.selectedIndex},null,8,["config","selectedIndex"])])]),_:1},8,["wrapClassName","visible","getContainer","onOk"])}const WU=Ti(DU,[["render",zU]]),EX="",NU=v.defineComponent({name:"PivotChart",props:{data:{type:Object,default(){return{dimensionData:{},xLabel:"",yLabel:""}}}},components:{FilterOutlined:hM,MinusSquareOutlined:S$,PivotFilter:LT},setup(i,{expose:t}){const e=v.inject("theme","light"),n=v.ref();let o;const r=v.ref([]),s=v.computed(()=>{var H;return(H=v.unref(r)[v.unref(r).length-1])==null?void 0:H.key}),l=v.ref([]),a=v.ref(!1),h=v.ref(),d=v.ref({});let u={};const c=v.reactive({position:"absolute",top:"0",left:"0"});let g="",f;function p(){l.value=[],r.value=[],u={};const{dimensionData:H,xLabel:E}=i.data,k=H[E].map(I=>I.value);b(E,k),v.unref(r).push({key:E,drillValue:"",xAxisData:k}),C()}let m=[];v.onMounted(()=>{o=LB.init(n.value),w()});function b(H,E){const{yLabel:k,records:I}=i.data;let L=[];E.forEach(()=>{L.push(0)}),I.forEach(D=>{if(D[k]!==void 0){const O=E.indexOf(D[H]);if(O>-1){let N=!0;v.unref(r).forEach($=>{$.drillValue&&D[$.key]!==$.drillValue&&(N=!1)});const W=Number(D[k]);N&&!isNaN(W)&&(L[O]+=Number(W))}}}),L=L.map(D=>D.toFixed(2)),f={tooltip:{},xAxis:{data:E},yAxis:{},series:[{name:k,type:"bar",label:{show:!0,position:"top"},data:L}]},m=L,o.setOption(f)}function C(){const H=Object.keys(i.data.dimensionData),E=v.unref(r).map(I=>I.key),k=[];H.forEach(I=>{E.includes(I)||k.push(I)}),l.value=k}function _(){g="",a.value=!1}function w(){o.on("contextmenu",function(H){const{event:{event:E},name:k}=H;g=k,E.preventDefault(),c.left=E.offsetX+90+"px",c.top=E.offsetY+80+"px",a.value=!0}),document.addEventListener("click",_)}function y(H){const E=[],{records:k}=i.data;for(const I of k){let L=!0;for(const D of v.unref(r))D.drillValue&&I[D.key]!==D.drillValue&&(L=!1);L&&!E.includes(I[H])&&E.push(I[H])}return E}function S(H){v.unref(r)[v.unref(r).length-1].drillValue=g;const E=y(H);b(H,E),v.unref(r).push({key:H,drillValue:"",xAxisData:E}),C()}function A(H,E){v.unref(r).splice(H+1,v.unref(r).length-H-1),v.unref(r)[H].drillValue="";const k=y(E);b(E,k),B(),C()}function R(H,E){const k=f.series[0].data,I=f.xAxis.data,L=k.map((O,N)=>({value:O,label:I[N]}));let D;E==="asc"?H==="dimension"?D=L.sort((O,N)=>O.label.localeCompare(N.label)):D=L.sort((O,N)=>O.value-N.value):E==="desc"&&(H==="dimension"?D=L.sort((O,N)=>N.label.localeCompare(O.label)):D=L.sort((O,N)=>N.value-O.value)),f.series[0].data=D.map(O=>O.value),f.xAxis.data=D.map(O=>O.label),o.setOption(f)}function x(H){if(H==="dimension"){const E=y(v.unref(s));b(v.unref(s),E),B()}else u={},B()}function T(H){if(H==="dimension"){const E=v.unref(r)[v.unref(r).length-1].xAxisData.map(k=>({value:k}));d.value={fieldName:v.unref(s),key:v.unref(s),type:H,filterData:f.xAxis.data,valueList:E}}else H==="indicators"&&(d.value={fieldName:i.data.yLabel,key:i.data.yLabel,type:"indicators",filterData:u});v.nextTick(()=>{v.unref(h).showModal()})}function M({checkKeys:H,type:E}){E==="dimension"?b(v.unref(s),H):E==="indicators"&&(u=H,B())}function B(){const H=v.unref(r)[v.unref(r).length-1].xAxisData;let E=m.map((k,I)=>({value:k,label:H[I]}));E=E.filter(k=>P(k.value)),f.series[0].data=E.map(k=>k.value),f.xAxis.data=E.map(k=>k.label),o.setOption(f)}function P(H){let E=!1,{rule:k,value:I}=u;switch(I=Number(I),k){case"LESS":E=H<I;break;case"GREATER":E=H>I;break;case"EQUAL":E=H===I;break;case"NOT_EQUAL":E=H!==I;break;default:E=!0;break}return E}v.onBeforeUnmount(()=>{document.removeEventListener("click",_)}),t({init:p});const F=v.computed(()=>v.unref(e)==="darkBlue"?"#b2c3dd":"");return{echartRef:n,dropdownList:l,isShowMenu:a,curXLabel:s,menuStyle:c,drillDimension:S,dimensionMap:r,deleteDimension:A,handleSort:R,handleClear:x,handleFilter:T,pivotFilterRef:h,filterData:d,onFilterChange:M,fontColor:F}}}),VU={style:{display:"flex",height:"400px"}},jU={style:{flex:"0 0 200px"}},$U={style:{flex:"0 0 650px",height:"100%"}},GU={key:0,style:{display:"flex","align-items":"center"}},UU={key:0,class:"dimension-item"},KU={key:1,style:{height:"30px"}},YU={style:{width:"100%",height:"100%"},ref:"echartRef"},XU=["onClick"];function qU(i,t,e,n,o,r){const s=v.resolveComponent("filter-outlined"),l=v.resolveComponent("a-menu-item"),a=v.resolveComponent("a-menu"),h=v.resolveComponent("a-dropdown"),d=v.resolveComponent("minus-square-outlined"),u=v.resolveComponent("pivot-filter");return v.openBlock(),v.createElementBlock(v.Fragment,null,[v.createElementVNode("div",VU,[v.createElementVNode("div",jU,[v.createElementVNode("div",{style:v.normalizeStyle({color:i.fontColor})},[v.createTextVNode(" 横轴:"+v.toDisplayString(i.curXLabel)+" ",1),v.createVNode(h,null,{overlay:v.withCtx(()=>[v.createVNode(a,null,{default:v.withCtx(()=>[v.createVNode(l,{key:"asc",onClick:t[0]||(t[0]=c=>i.handleSort("dimension","asc"))},{default:v.withCtx(()=>t[8]||(t[8]=[v.createTextVNode("升序")])),_:1}),v.createVNode(l,{key:"desc",onClick:t[1]||(t[1]=c=>i.handleSort("dimension","desc"))},{default:v.withCtx(()=>t[9]||(t[9]=[v.createTextVNode("降序")])),_:1}),v.createVNode(l,{key:"filter",onClick:t[2]||(t[2]=c=>i.handleFilter("dimension"))},{default:v.withCtx(()=>t[10]||(t[10]=[v.createTextVNode("筛选")])),_:1}),v.createVNode(l,{key:"clear",onClick:t[3]||(t[3]=c=>i.handleClear("dimension"))},{default:v.withCtx(()=>t[11]||(t[11]=[v.createTextVNode("清除")])),_:1})]),_:1})]),default:v.withCtx(()=>[v.createVNode(s,{class:"filter-icon",style:v.normalizeStyle({color:i.fontColor})},null,8,["style"])]),_:1})],4),v.createElementVNode("div",{style:v.normalizeStyle({color:i.fontColor})},[v.createTextVNode(" 纵轴:"+v.toDisplayString(i.data.yLabel)+" ",1),v.createVNode(h,null,{overlay:v.withCtx(()=>[v.createVNode(a,null,{default:v.withCtx(()=>[v.createVNode(l,{key:"asc",onClick:t[4]||(t[4]=c=>i.handleSort("indicators","asc"))},{default:v.withCtx(()=>t[12]||(t[12]=[v.createTextVNode("升序")])),_:1}),v.createVNode(l,{key:"desc",onClick:t[5]||(t[5]=c=>i.handleSort("indicators","desc"))},{default:v.withCtx(()=>t[13]||(t[13]=[v.createTextVNode("降序")])),_:1}),v.createVNode(l,{key:"filter",onClick:t[6]||(t[6]=c=>i.handleFilter("indicators"))},{default:v.withCtx(()=>t[14]||(t[14]=[v.createTextVNode("筛选")])),_:1}),v.createVNode(l,{key:"clear",onClick:t[7]||(t[7]=c=>i.handleClear("indicators"))},{default:v.withCtx(()=>t[15]||(t[15]=[v.createTextVNode("清除")])),_:1})]),_:1})]),default:v.withCtx(()=>[v.createVNode(s,{class:"filter-icon",style:v.normalizeStyle({color:i.fontColor})},null,8,["style"])]),_:1})],4)]),v.createElementVNode("div",$U,[i.dimensionMap.length>1?(v.openBlock(),v.createElementBlock("div",GU,[v.createElementVNode("span",{style:v.normalizeStyle({color:i.fontColor})},"钻取维度:",4),(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.dimensionMap,(c,g)=>(v.openBlock(),v.createElementBlock(v.Fragment,{key:g},[c.drillValue?(v.openBlock(),v.createElementBlock("div",UU,[v.createVNode(d,{class:"dimension-icon",onClick:f=>i.deleteDimension(g,c.key)},null,8,["onClick"]),v.createTextVNode(v.toDisplayString(c.key)+"("+v.toDisplayString(c.drillValue)+") ",1)])):v.createCommentVNode("",!0)],64))),128))])):(v.openBlock(),v.createElementBlock("div",KU)),v.createElementVNode("div",YU,null,512)]),v.withDirectives(v.createElementVNode("div",{style:v.normalizeStyle(i.menuStyle),class:"dropdown-menu"},[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.dropdownList,c=>(v.openBlock(),v.createElementBlock("div",{class:"item",key:c,onClick:g=>i.drillDimension(c)},"下钻"+v.toDisplayString(c),9,XU))),128))],4),[[v.vShow,i.isShowMenu]])]),v.createVNode(u,{ref:"pivotFilterRef",data:i.filterData,onChange:i.onFilterChange},null,8,["data","onChange"])],64)}const ZU=Ti(NU,[["render",qU],["__scopeId","data-v-f29855b0"]]),JU=v.defineComponent({components:{PivotChart:ZU},name:"ChartModal",props:{},setup(i,{expose:t}){const e=v.inject("theme","light"),n=v.inject("getContainer",()=>{}),o=v.ref(!1),r=v.ref({}),s=v.ref();function l(a){r.value=a,o.value=!0,v.nextTick(()=>{s.value.init()})}return v.watch(o,a=>{window.modalShow&&window.modalShow(a)}),t({showModal:l}),{theme:e,visible:o,chartOptions:r,chartRef:s,getContainer:n}}});function QU(i,t,e,n,o,r){const s=v.resolveComponent("pivot-chart"),l=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(l,{wrapClassName:i.theme,visible:i.visible,"onUpdate:visible":t[0]||(t[0]=a=>i.visible=a),title:"图形",style:{width:"900px"},destroyOnClose:!0,footer:null,getContainer:i.getContainer},{default:v.withCtx(()=>[v.createVNode(s,{data:i.chartOptions,ref:"chartRef"},null,8,["data"])]),_:1},8,["wrapClassName","visible","getContainer"])}const tK=Ti(JU,[["render",QU]]),LX="",eK=v.defineComponent({name:"PivotAggregate",props:{},setup(i,{emit:t,expose:e}){const n=v.inject("getContainer",()=>{}),o=v.inject("scaleValue",{}),r=v.inject("theme","light"),s=v.inject("dimensionFieldList",[]),l=v.ref(!1),a=v.ref([]),h=v.ref(""),d=v.ref(""),u=v.ref(),c=[{label:"合计",value:"SUM"},{label:"平均值",value:"AVG"},{label:"计数",value:"COUNT"},{label:"最大值",value:"MAX"},{label:"最小值",value:"MIN"},{label:"方差",value:"VAR"},{label:"标准差",value:"STDEV"}];function g(){t("confirm",v.unref(a),h.value),l.value=!1}function f(C,_){a.value=Ye.cloneDeep(C),h.value=_,l.value=!0;const w=v.unref(s).find(y=>y.label===_);d.value=(w==null?void 0:w.title)||_}const p=v.ref({}),m=()=>document.getElementsByClassName("aggregate-modal")[0]||document.body,b=C=>{var _,w,y;if(C){const S=(_=v.unref(u))==null?void 0:_.getBoundingClientRect();if(S){const A=S.left/(((w=v.unref(o))==null?void 0:w.widthScale)||1)+"px",R=(S.top+S.height)/(((y=v.unref(o))==null?void 0:y.heightScale)||1)+"px";setTimeout(()=>{var M,B;const x=document.querySelectorAll(".ant-select-dropdown"),T=Array.from(x).filter(P=>window.getComputedStyle(P).display!=="none");if(T!=null&&T.length){const P=document.getElementsByClassName("aggregate-modal")[0];T[0].classList.add("aggregate-select-dropdown"),(M=P==null?void 0:P.style)==null||M.setProperty("--drop-down-left",A),(B=P==null?void 0:P.style)==null||B.setProperty("--drop-down-top",R),p.value={visibility:"visible"}}},200)}}else p.value={}};return v.watch(l,C=>{window.modalShow&&window.modalShow(C)}),e({showModal:f}),{theme:r,visible:l,aggregationType:a,options:c,dimensionKey:h,titleText:d,dropdownStyle:p,selectRef:u,handleOk:g,getPopupContainer:m,getContainer:n,dropdownVisibleChange:b}}}),iK={ref:"selectRef"};function nK(i,t,e,n,o,r){const s=v.resolveComponent("a-select"),l=v.resolveComponent("a-form-item"),a=v.resolveComponent("a-form"),h=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(h,{wrapClassName:i.theme+" aggregate-modal",visible:i.visible,"onUpdate:visible":t[1]||(t[1]=d=>i.visible=d),"ok-text":"确认","cancel-text":"取消",title:i.titleText+"-聚合",destroyOnClose:!1,maskClosable:!1,getContainer:i.getContainer,onOk:i.handleOk,onCancel:t[2]||(t[2]=d=>i.visible=!1)},{default:v.withCtx(()=>[v.createVNode(a,null,{default:v.withCtx(()=>[v.createVNode(l,{label:"聚合方式"},{default:v.withCtx(()=>[v.createElementVNode("div",iK,[v.createVNode(s,{value:i.aggregationType,"onUpdate:value":t[0]||(t[0]=d=>i.aggregationType=d),allowClear:"",mode:"multiple",dropdownClassName:"pivot-table-select-dropdown",options:i.options,getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:i.dropdownVisibleChange},null,8,["value","options","getPopupContainer","dropdownStyle","onDropdownVisibleChange"])],512)]),_:1})]),_:1})]),_:1},8,["wrapClassName","visible","title","getContainer","onOk"])}const oK=Ti(eK,[["render",nK]]),rK=v.defineComponent({name:"PivotTop",props:{},setup(i,{emit:t,expose:e}){const n=v.inject("theme","light"),o=v.inject("getContainer",()=>{}),r=v.ref(!1),s=v.ref(""),l=v.ref("");function a(){t("confirm",{value:v.unref(s),key:v.unref(l)}),r.value=!1}function h(d){const{value:u,key:c}=d;s.value=u,r.value=!0,l.value=c}return v.watch(r,d=>{window.modalShow&&window.modalShow(d)}),e({showModal:h}),{theme:n,visible:r,topNum:s,handleOk:a,getContainer:o}}});function sK(i,t,e,n,o,r){const s=v.resolveComponent("a-input"),l=v.resolveComponent("a-form-item"),a=v.resolveComponent("a-form"),h=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(h,{wrapClassName:i.theme,visible:i.visible,"onUpdate:visible":t[1]||(t[1]=d=>i.visible=d),"ok-text":"确认","cancel-text":"取消",title:"维度取Top",destroyOnClose:!0,getContainer:i.getContainer,onOk:i.handleOk},{default:v.withCtx(()=>[v.createVNode(a,null,{default:v.withCtx(()=>[v.createVNode(l,{label:"维度取Top"},{default:v.withCtx(()=>[v.createVNode(s,{value:i.topNum,"onUpdate:value":t[0]||(t[0]=d=>i.topNum=d),type:"number",style:{width:"100%"}},null,8,["value"])]),_:1})]),_:1})]),_:1},8,["wrapClassName","visible","getContainer","onOk"])}const lK=Ti(rK,[["render",sK]]);let Es=(i=21)=>{let t="",e=crypto.getRandomValues(new Uint8Array(i));for(;i--;){let n=e[i]&63;n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n<63?t+="_":t+="-"}return t};const kX="";Lo.locale("zh-cn");const aK=v.defineComponent({name:"PivotDetail",components:{ATable:ji.Table},props:{},setup(i,{emit:t,expose:e}){const n=v.inject("getContainer",()=>{}),o=v.inject("theme","light"),r=v.inject("pageId",""),s=v.inject("context",""),l=v.inject("indicatorUrl",""),a=v.inject("indicatorToken",""),h=v.inject("theDateInfo",{}),d=v.ref(!1),u=v.ref(!1),c=v.ref([]),g=v.ref([]),f=v.ref({current:1,pageSize:10,total:0,showSizeChanger:!1,showQuickJumper:!1,showTotal:b=>`共 ${b} 条数据`});async function p(b){var x;u.value=!0,d.value=!0;const{args:C={},dimension:_,indicator:w,splitSymbol:y}=b,{originData:S=[],cellHeaderPaths:{colHeaderPaths:A=[],rowHeaderPaths:R=[]}}=C;if(S!=null&&S.length){const T=S[0],M=A!=null&&A.length?A[A.length-1]:"",B=A.filter(O=>O.dimensionKey).concat(R.filter(O=>O.dimensionKey)).map(O=>O.dimensionKey);if(!(M!=null&&M.indicatorKey)||!B.length)return;const P=w.find(O=>O.label===M.indicatorKey),F={};for(const O of _)if(B.includes(O.label)){const W=(T[O.label]||"").split(y)||[];F[O.typeGuid]=W!=null&&W.length?W[W.length-1]:""}const{startTime:H,endTime:E,rangeFormat:k}=v.unref(h);H&&E&&(F.startTime=Lo(H).format(k),F.endTime=Lo(E).format(k));const I=await zr.post(`${v.unref(l)}/diagram/obtainDataSetData`,{pageId:v.unref(r),indexCode:(P==null?void 0:P.indexCode)||"",param:F},{headers:{Authentication:v.unref(a),operateContext:v.unref(s)}}),{columns:L=[],data:D=[]}=((x=I==null?void 0:I.data)==null?void 0:x.data)||{};c.value=L.filter(O=>O).map(O=>({title:O,dataIndex:O})),g.value=D.map(O=>({...O,uid:Es(6)}))}u.value=!1}v.watch(d,b=>{window.modalShow&&window.modalShow(b)});const m=b=>{v.unref(f).current=b.current};return e({showModal:p}),{theme:o,visible:d,loading:u,pagination:f,columns:c,dataSource:g,handleTableChange:m,getContainer:n}}}),hK={key:0,class:"spin-container"};function dK(i,t,e,n,o,r){const s=v.resolveComponent("a-spin"),l=v.resolveComponent("a-table"),a=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(a,{wrapClassName:i.theme,visible:i.visible,"onUpdate:visible":t[0]||(t[0]=h=>i.visible=h),width:"40%",title:"指标明细",destroyOnClose:!0,footer:null,bodyStyle:{maxHeight:"50vh",overflow:"auto"},getContainer:i.getContainer},{default:v.withCtx(()=>[i.loading?(v.openBlock(),v.createElementBlock("div",hK,[v.createVNode(s,{size:"large"})])):v.createCommentVNode("",!0),i.loading?v.createCommentVNode("",!0):(v.openBlock(),v.createBlock(l,{key:1,"row-key":h=>h.uid,columns:i.columns,"data-source":i.dataSource,pagination:i.pagination,onChange:i.handleTableChange},null,8,["row-key","columns","data-source","pagination","onChange"]))]),_:1},8,["wrapClassName","visible","getContainer"])}const uK=Ti(aK,[["render",dK],["__scopeId","data-v-32537b22"]]),cK=(i,t)=>{i.register.icon("dropdownIcon",{type:"svg",svg:`<svg width="${t.downSize}" height="${t.downSize}" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><rect x="2" y="1" width="20" height="20" rx="10" fill="white"/><rect x="2.5" y="1.5" width="19" height="19" rx="9.5" stroke="#959DA5"/></g><path d="M14.9492 9.39531C15.0086 9.31911 15.0165 9.21887 14.9698 9.1356C14.923 9.05234 14.8294 9 14.7273 9L9.27273 9C9.17057 9 9.07697 9.05234 9.03023 9.1356C8.98348 9.21887 8.99142 9.31911 9.0508 9.39531L11.7781 12.8953C11.8293 12.961 11.9119 13 12 13C12.0881 13 12.1707 12.961 12.2219 12.8953L14.9492 9.39531Z" fill="#4F5965"/></svg>`,width:t.downSize,height:t.downSize,funcType:i.TYPES.IconFuncTypeEnum.dropDown,positionType:i.TYPES.IconPosition.absoluteRight,name:"dropdownIcon",marginRight:0,hover:{width:t.downSize,height:t.downSize,bgColor:"rgba(101, 117, 168, 0.1)",image:`<svg width="${t.downSize}" height="${t.downSize}" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><rect x="2" y="1" width="20" height="20" rx="10" fill="#1E54C9"/><rect x="2.5" y="1.5" width="19" height="19" rx="9.5" stroke="#141414" stroke-opacity="0.2"/></g><path d="M14.9492 9.39531C15.0086 9.31911 15.0165 9.21887 14.9698 9.1356C14.923 9.05234 14.8294 9 14.7273 9L9.27273 9C9.17057 9 9.07697 9.05234 9.03023 9.1356C8.98348 9.21887 8.99142 9.31911 9.0508 9.39531L11.7781 12.8953C11.8293 12.961 11.9119 13 12 13C12.0881 13 12.1707 12.961 12.2219 12.8953L14.9492 9.39531Z" fill="white"/></svg>`},cursor:"pointer",visibleTime:"mouseenter_cell"}),i.register.icon("sortDown",{name:"sortDown",type:"svg",positionType:i.TYPES.IconPosition.contentRight,width:t.iconSize,visibleTime:"always",height:t.iconSize,svg:`<svg t="1736221132194" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1418" width="60" height="60"><path d="M512 85.333333l256 341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1419"></path><path d="M512 938.666667l256-341.333334H256z" fill="${t.sortActiveColor}" p-id="1420"></path></svg>`,marginLeft:5,hover:{width:t.hoverSize,height:t.hoverSize,bgColor:"#DEE4ED80"},cursor:"pointer",tooltip:{title:"取消排序",placement:"top"}}),i.register.icon("sortUp",{name:"sortUp",type:"svg",positionType:i.TYPES.IconPosition.contentRight,width:t.iconSize,visibleTime:"always",height:t.iconSize,svg:`<svg t="1736221132194" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1418" width="60" height="60"><path d="M512 85.333333l256 341.333334H256z" fill="${t.sortActiveColor}" p-id="1419"></path><path d="M512 938.666667l256-341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1420"></path></svg>`,marginLeft:5,hover:{width:t.hoverSize,height:t.hoverSize,bgColor:"#DEE4ED80"},cursor:"pointer",tooltip:{title:"点击降序",placement:"top"}}),i.register.icon("sortNormal",{name:"sortNormal",type:"svg",positionType:i.TYPES.IconPosition.contentRight,width:t.iconSize,visibleTime:"always",height:t.iconSize,svg:`<svg t="1736221132194" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1418" width="60" height="60"><path d="M512 85.333333l256 341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1419"></path><path d="M512 938.666667l256-341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1420"></path></svg>`,marginLeft:5,hover:{width:t.hoverSize,height:t.hoverSize,bgColor:"#DEE4ED80"},cursor:"pointer",tooltip:{title:"点击升序",placement:"top"}})},gK=v.defineComponent({props:{node:{type:[Object,String],required:!0}},render(){return this.node}}),fK={mounted(i){i.focus()}},pK=v.defineComponent({name:"PivotConfig",directives:{focus:fK},props:{fullMode:{type:Boolean,default:!1}},components:{VNodeRender:gK,draggable:Bb,DeleteOutlined:lM},setup(i,{emit:t,expose:e}){const n=v.inject("theme","light"),o=v.inject("getContainer",()=>{}),r=v.ref(!1),s=v.ref(),l=v.ref([]),a=v.ref([{title:"行维度",icon:v.createVNode(c$),fields:[]},{title:"列维度",icon:v.createVNode(a$),fields:[]},{title:"指标",icon:v.createVNode(O$),fields:[]}]),h=(A=[],R=[])=>{for(const x of v.unref(a))x.fields=[];for(const x of A)x.positionType==="rows"?v.unref(a)[0].fields.push(Ye.cloneDeep(x)):x.positionType==="columns"&&v.unref(a)[1].fields.push(Ye.cloneDeep(x));v.unref(a)[2].fields=Ye.cloneDeep(R),r.value=!0},d=v.computed(()=>[...v.unref(a)[0].fields.map(A=>({...A,label:A.showTitle,positionType:"rows"})),...v.unref(a)[1].fields.map(A=>({...A,label:A.showTitle,positionType:"columns"}))]),u=v.computed(()=>v.unref(a)[2].fields),c=()=>{l.value=[],t("confirm",v.unref(d),v.unref(u)),r.value=!1},g=(A,R)=>{const x=R[A.oldIndex],{scope:T}=x;["IDX","BUILT_IN_IDX"].includes(T)?l.value=[0,1]:["DIM","BUILT_IN_DIM"].includes(T)&&(l.value=[2])},f=()=>{l.value=[]},p=()=>{a.value=Ye.cloneDeep(v.unref(a))},m=(A,R)=>{v.unref(a)[A].fields.splice(R,1)},b=v.ref(),C=v.ref(),_=v.ref(""),w=(A,R)=>{i.fullMode&&(b.value=`${A}_${R}`,C.value=Ye.cloneDeep(v.unref(a)[A].fields[R]))},y=()=>{if(v.unref(_)){const A=v.unref(b).split("_");ji.message.error(v.unref(_)),v.unref(a)[A[0]].fields[A[1]].showTitle=v.unref(C).showTitle,_.value=""}b.value=""},S=A=>{const R=A.target.value,x=v.unref(d).concat(v.unref(u));R?x.find(M=>M.name!==v.unref(C).name&&M.showTitle===R)&&(_.value="名称不能重复"):_.value="不能为空"};return v.watch(r,A=>{window.modalShow&&window.modalShow(A)}),e({showModal:h}),{theme:n,visible:r,fieldAreas:a,indSourceRef:s,maskList:l,currentEditItem:b,handleOk:c,onDragAreaStart:g,onDragEnd:f,handleDeleteField:m,handleEdit:w,onConfirmLabel:y,onDragAdd:p,onChangeLabel:S,getContainer:o}}}),FX="",mK={class:"config-wrap"},vK={class:"area-content"},bK={class:"area-title"},CK={class:"field-item"},yK=["onClick"];function _K(i,t,e,n,o,r){const s=v.resolveComponent("v-node-render"),l=v.resolveComponent("a-input"),a=v.resolveComponent("delete-outlined"),h=v.resolveComponent("draggable"),d=v.resolveComponent("a-button"),u=v.resolveComponent("a-modal"),c=v.resolveDirective("focus");return v.openBlock(),v.createBlock(u,{wrapClassName:`${i.theme}`,title:"设置",visible:i.visible,"onUpdate:visible":t[1]||(t[1]=g=>i.visible=g),"ok-text":"确认","cancel-text":"取消",maskClosable:!1,destroyOnClose:!1,style:{width:"500px"},bodyStyle:{padding:0},getContainer:i.getContainer,onOk:i.handleOk},{footer:v.withCtx(()=>[v.createVNode(d,{onClick:t[0]||(t[0]=g=>i.visible=!1)},{default:v.withCtx(()=>t[2]||(t[2]=[v.createTextVNode("取消")])),_:1}),v.createVNode(d,{type:"primary",onClick:i.handleOk},{default:v.withCtx(()=>t[3]||(t[3]=[v.createTextVNode("确定")])),_:1},8,["onClick"])]),default:v.withCtx(()=>[v.createElementVNode("div",mK,[v.createElementVNode("div",vK,[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.fieldAreas,(g,f)=>(v.openBlock(),v.createElementBlock("div",{class:"area-item",key:f},[v.createElementVNode("div",bK,[v.createVNode(s,{class:"area-icon",node:g.icon},null,8,["node"]),v.createTextVNode(" "+v.toDisplayString(g.title),1)]),v.createVNode(h,{class:"area-list",list:g.fields,"item-key":"index",group:{name:"diGroup"},disabled:i.maskList.includes(f),onStart:p=>i.onDragAreaStart(p,g.fields),onEnd:i.onDragEnd,onAdd:i.onDragAdd},{item:v.withCtx(({index:p,element:m})=>[v.createElementVNode("div",CK,[i.currentEditItem===`${f}_${p}`?v.withDirectives((v.openBlock(),v.createBlock(l,{key:0,size:"small",value:m.showTitle,"onUpdate:value":b=>m.showTitle=b,onPressEnter:i.onConfirmLabel,onBlur:i.onConfirmLabel,onChange:i.onChangeLabel},null,8,["value","onUpdate:value","onPressEnter","onBlur","onChange"])),[[c]]):(v.openBlock(),v.createElementBlock("div",{key:1,style:{width:"100%"},onClick:b=>i.handleEdit(f,p)},v.toDisplayString(m.showTitle),9,yK)),i.fullMode?(v.openBlock(),v.createBlock(a,{key:2,style:{color:"red","padding-left":"8px"},onClick:b=>i.handleDeleteField(f,p)},null,8,["onClick"])):v.createCommentVNode("",!0)])]),_:2},1032,["list","disabled","onStart","onEnd","onAdd"])]))),128))])])]),_:1},8,["wrapClassName","visible","getContainer","onOk"])}const wK=Ti(pK,[["render",_K],["__scopeId","data-v-b39c2a7b"]]),SK=v.defineComponent({name:"IndSourceList",components:{CaretRightOutlined:Dj,CaretDownOutlined:Lj,LoadingOutlined:m$,Draggable:Bb},props:{data:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},isSub:{type:Boolean,default:!1},hasChildren:{type:Boolean,default:!1}},setup(i,{emit:t,expose:e}){const n=v.inject("indicatorUrl",""),o=v.inject("indicatorToken",""),r=v.inject("pageId",""),s=v.inject("setItemDisabled",S=>!1),l=v.ref([]),a=v.ref(),h=v.reactive({pageSize:20,currentPage:1,totalResult:0}),d=v.ref(!1),u=v.ref(""),c=v.ref(!1);v.watch(()=>i.data,S=>{i.isSub&&(S==null||S.forEach(A=>{var R;A!=null&&A.isLeaf||(R=A.dataViewColumns)==null||R.forEach(x=>{x.show=!0,x.edit=!1,x.title&&(x.label=x.title)})}),l.value=S)},{deep:!0,immediate:!0});const g=()=>{var S;i.isSub||(S=v.unref(a))==null||S.removeEventListener("scroll",_)},f=async S=>{var R;if(v.unref(d))return;d.value=!0;const A={source:i.config.source||"INDICATOR_LIB",pageId:v.unref(r),dataSourceId:i.config.dataSourceId||"",indexName:u.value};S?(S.loading=!0,A.indexTypeGuid=S.indexTypeGuid,A.isLeaf=S.isLeaf):h&&(A.queryRequest={pageSize:h.pageSize,pageNum:h.currentPage});try{const x=await zr.post(`${v.unref(n)}/diagram/sourceList`,A,{headers:{Authentication:o,operateContext:"ygt"}}),{success:T,data:M={}}=x.data;if(T){const{rows:B=[],total:P=0}=M;B==null||B.forEach(F=>{var H;(S==null?void 0:S.isLeaf)==="1"?(H=F.dataViewColumns)==null||H.forEach(E=>{E.show=!0,E.edit=!1,E.title&&(E.label=E.title)}):F.show=!1}),S?(S.children=B,S.show=!0,B!=null&&B.length||(S.noData=!0)):(l.value=v.unref(l).concat(B),h.totalResult=+P,((R=v.unref(l))==null?void 0:R.length)>=P&&g())}S&&(S.loading=!1),d.value=!1}catch{S&&(S.loading=!1),d.value=!1}},p=async S=>{const A=l.value[S],{children:R=[]}=A;R!=null&&R.length?A.show=!A.show:!A.noData&&A.isLeaf?f(A):A.noData&&(A.show=!A.show)},m=(S,A)=>{t("onDragStart",S,A)},b=()=>{t("onDragEnd")},C=S=>{S.show=!S.show},_=S=>{S.target.scrollTop+S.target.clientHeight+20>=S.target.scrollHeight&&(h.currentPage++,f())},w=async()=>{await f(),v.nextTick(async()=>{v.unref(a).scrollHeight===v.unref(a).clientHeight&&h.totalResult>v.unref(l).length&&(h.currentPage++,w())})},y=async S=>{var A;g(),c.value=!0,h.currentPage=1,h.totalResult=0,l.value=[],u.value=S,await w(),c.value=!1,(A=v.unref(a))==null||A.addEventListener("scroll",_)};return v.onMounted(async()=>{var S;i.isSub||(w(),(S=v.unref(a))==null||S.addEventListener("scroll",_))}),v.onUnmounted(()=>{g()}),e({handleSearch:y}),{columnRef:a,sourceList:l,searchLoading:c,onToggleGroup:p,onToggleSource:C,setItemDisabled:s,onDragStart:m,onDragEnd:b,mapDataSetScope:V2,mapScope:N2,getLoadType:j2,getUseType:$2,getSourceType:G2}}}),IX="",xK={key:0,class:"no-data"},RK={class:"column-item"},AK=["onClick"],TK={key:3,class:"item-name"},MK={class:"column-item"},BK={key:0},PK={key:1},HK={key:2},EK={key:3},LK=["onClick"],kK={class:"item-name"},FK={class:"column-child-item"},IK={class:"field"},DK={class:"column-child-item-name"};function OK(i,t,e,n,o,r){const s=v.resolveComponent("loading-outlined"),l=v.resolveComponent("caret-down-outlined"),a=v.resolveComponent("caret-right-outlined"),h=v.resolveComponent("ind-source-list",!0),d=v.resolveComponent("a-tooltip"),u=v.resolveComponent("draggable"),c=v.resolveComponent("a-spin");return v.openBlock(),v.createElementBlock("div",{class:v.normalizeClass(["columns",i.isSub?"sub-columns":""]),ref:"columnRef"},[v.createVNode(c,{spinning:i.searchLoading,tip:"数据源加载中..."},{default:v.withCtx(()=>{var g;return[!((g=i.sourceList)!=null&&g.length)&&!i.searchLoading?(v.openBlock(),v.createElementBlock("div",xK,"暂无数据")):i.hasChildren?(v.openBlock(!0),v.createElementBlock(v.Fragment,{key:1},v.renderList(i.sourceList,(f,p)=>(v.openBlock(),v.createElementBlock(v.Fragment,{key:f.indexTypeGuid||f.id},[v.createElementVNode("div",RK,[v.createElementVNode("span",{class:"item-group",onClick:m=>i.onToggleGroup(p)},[f.loading?(v.openBlock(),v.createBlock(s,{key:0})):f.show?(v.openBlock(),v.createBlock(l,{key:1})):(v.openBlock(),v.createBlock(a,{key:2})),f.isLeaf?(v.openBlock(),v.createElementBlock("span",TK,v.toDisplayString(f.indexTypeCode+"."+f.indexTypeName),1)):v.createCommentVNode("",!0)],8,AK)]),f.show?(v.openBlock(),v.createBlock(h,{key:0,data:f.children,isSub:!0,hasChildren:f.isLeaf==="0",config:i.config,onOnDragStart:i.onDragStart,onOnDragEnd:i.onDragEnd},null,8,["data","hasChildren","config","onOnDragStart","onOnDragEnd"])):v.createCommentVNode("",!0)],64))),128)):(v.openBlock(!0),v.createElementBlock(v.Fragment,{key:2},v.renderList(i.sourceList,f=>(v.openBlock(),v.createElementBlock("div",{key:f.id,class:v.normalizeClass(i.setItemDisabled(f.dataViewColumns)?"column-disabled":"")},[v.createElementVNode("div",MK,[v.createVNode(d,null,{title:v.withCtx(()=>[v.createElementVNode("div",null,"加载类型:"+v.toDisplayString(i.getLoadType(f.loadType)),1),f.useType?(v.openBlock(),v.createElementBlock("div",BK,"数据使用系统:"+v.toDisplayString(i.getUseType(f.useType)),1)):v.createCommentVNode("",!0),f.systemSource?(v.openBlock(),v.createElementBlock("div",PK,"制度出处:"+v.toDisplayString(f.systemSource),1)):v.createCommentVNode("",!0),f.dataTo?(v.openBlock(),v.createElementBlock("div",HK,"数据来源:"+v.toDisplayString(i.getSourceType(f.dataTo)),1)):v.createCommentVNode("",!0),f.meaning?(v.openBlock(),v.createElementBlock("div",EK,"指标含义:"+v.toDisplayString(f.meaning),1)):v.createCommentVNode("",!0)]),default:v.withCtx(()=>[v.createElementVNode("span",{class:"item-group",onClick:p=>i.onToggleSource(f)},[f.show?(v.openBlock(),v.createBlock(l,{key:0})):(v.openBlock(),v.createBlock(a,{key:1})),v.createElementVNode("span",kK,v.toDisplayString((f.indexCode?f.indexCode:"")+" "+f.name),1)],8,LK)]),_:2},1024)]),f.show?(v.openBlock(),v.createBlock(u,{key:0,modelValue:f.dataViewColumns,"onUpdate:modelValue":p=>f.dataViewColumns=p,group:{name:"diGroup",pull:"clone",put:!1},"item-key":"id",sort:!1,disabled:i.setItemDisabled(f.dataViewColumns),filter:".not-allow",onStart:p=>i.onDragStart(p,f),onEnd:i.onDragEnd},{item:v.withCtx(({element:p})=>[v.createElementVNode("div",FK,[v.createElementVNode("span",IK,"【"+v.toDisplayString(p.scope==="FIELD"?i.mapDataSetScope(p.genericType):i.mapScope(p.scope))+"】",1),v.createElementVNode("span",DK,v.toDisplayString(p.label),1)])]),_:2},1032,["modelValue","onUpdate:modelValue","disabled","onStart","onEnd"])):v.createCommentVNode("",!0)],2))),128))]}),_:1},8,["spinning"])],2)}const zK=Ti(SK,[["render",OK],["__scopeId","data-v-aabcdc1c"]]),WK=v.defineComponent({name:"DragArea",props:{style:{type:Object,default:()=>({})},maskList:{type:Array,default:()=>[]}},setup(i,{emit:t}){return{onDragOver:s=>{s.preventDefault(),s.target.classList.add("highlight")},onDragLeave:s=>{s.preventDefault(),s.target.classList.remove("highlight")},onDragEnd:s=>{s.preventDefault(),s.target.classList.remove("highlight")},onDrop:s=>{s.preventDefault(),s.target.classList.remove("highlight");const l=Array.from(s.target.classList);l.includes("rows")?t("add","rows"):l.includes("columns")?t("add","columns"):l.includes("indicators")?t("add","indicators"):l.includes("filters")&&t("add","filters")}}}}),DX="";function NK(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",{class:"drag-area",style:v.normalizeStyle(i.style.main)},[i.maskList.includes(2)?(v.openBlock(),v.createElementBlock("div",{key:0,class:"area-wrap filters",onDragover:t[0]||(t[0]=(...s)=>i.onDragOver&&i.onDragOver(...s)),onDragleave:t[1]||(t[1]=(...s)=>i.onDragLeave&&i.onDragLeave(...s)),onDragend:t[2]||(t[2]=(...s)=>i.onDragEnd&&i.onDragEnd(...s)),onDrop:t[3]||(t[3]=(...s)=>i.onDrop&&i.onDrop(...s)),style:v.normalizeStyle(i.style.filters)},null,36)):v.createCommentVNode("",!0),i.maskList.includes(0)?v.createCommentVNode("",!0):(v.openBlock(),v.createElementBlock("div",{key:1,class:"area-wrap rows",onDragover:t[4]||(t[4]=(...s)=>i.onDragOver&&i.onDragOver(...s)),onDragleave:t[5]||(t[5]=(...s)=>i.onDragLeave&&i.onDragLeave(...s)),onDragend:t[6]||(t[6]=(...s)=>i.onDragEnd&&i.onDragEnd(...s)),onDrop:t[7]||(t[7]=(...s)=>i.onDrop&&i.onDrop(...s)),style:v.normalizeStyle(i.style.rows)},null,36)),i.maskList.includes(1)?v.createCommentVNode("",!0):(v.openBlock(),v.createElementBlock("div",{key:2,class:"area-wrap columns",onDragover:t[8]||(t[8]=(...s)=>i.onDragOver&&i.onDragOver(...s)),onDragleave:t[9]||(t[9]=(...s)=>i.onDragLeave&&i.onDragLeave(...s)),onDragend:t[10]||(t[10]=(...s)=>i.onDragEnd&&i.onDragEnd(...s)),onDrop:t[11]||(t[11]=(...s)=>i.onDrop&&i.onDrop(...s)),style:v.normalizeStyle(i.style.columns)},null,36)),i.maskList.includes(2)?v.createCommentVNode("",!0):(v.openBlock(),v.createElementBlock("div",{key:3,class:"area-wrap indicators",onDragover:t[12]||(t[12]=(...s)=>i.onDragOver&&i.onDragOver(...s)),onDragleave:t[13]||(t[13]=(...s)=>i.onDragLeave&&i.onDragLeave(...s)),onDragend:t[14]||(t[14]=(...s)=>i.onDragEnd&&i.onDragEnd(...s)),onDrop:t[15]||(t[15]=(...s)=>i.onDrop&&i.onDrop(...s)),style:v.normalizeStyle(i.style.indicators)},null,36))],4)}const VK=Ti(WK,[["render",NK],["__scopeId","data-v-01e4c58d"]]),jK=(i={})=>{const{pageId:t="",indicatorUrl:e="",indicatorToken:n="",context:o="",graphicConfig:r}=i;return async(l={},a,h)=>{var f;const d=BC(i,l),{url:u,...c}=d||{};let g=t;if(!g){const{pathname:p}=window==null?void 0:window.location;if(p){const m=p.split("/");m!=null&&m.length&&(g=m[m.length-1])}}if(u&&c){a&&a("tableChange",{type:"11",data:c}),h&&h(c);try{return await zr({url:`${e}${u}`,method:"post",headers:{Authentication:n,operateContext:o},data:{...c,dataSourceId:(r==null?void 0:r.dataSourceId)||"",pageId:g},signal:((f=window.controller)==null?void 0:f.signal)||""})}catch(p){console.error(p)}}}},$K=(i={})=>{const{indicatorUrl:t=""}=i;return async(n,o)=>{var d;const r={},{search:s}=window==null?void 0:window.location;if(s){const u=s.slice(1,s.length).split("&");for(const c of u){const g=c.split("=");r[g[0]]=g[1]}}const{keyName:l,...a}=o,h={keyName:l};n==="save"&&(h.searchMap=a);try{return await zr({url:`${t}/userSearch/${n}`,method:"post",headers:{Authentication:r.token||null},data:h,signal:((d=window.controller)==null?void 0:d.signal)||""})}catch(u){console.error(u)}}},GK=(i={})=>{const{pageId:t="",indicatorUrl:e="",indicatorToken:n="",context:o="",graphicConfig:r={}}=i;return async(l={})=>{var h,d;const a=BC(i,l);try{const u=await zr({url:`${e}/diagram/obtainDrillAbleDimensionOptions`,method:"post",headers:{Authentication:n,operateContext:o},data:{source:(r==null?void 0:r.source)||"INDICATOR_LIB",pageId:t,indicatorList:(a==null?void 0:a.indicatorList)||[],classifications:(a==null?void 0:a.queryColumns)||[],dataSourceId:(r==null?void 0:r.dataSourceId)||""},signal:((h=window.controller)==null?void 0:h.signal)||""});return((d=u==null?void 0:u.data)==null?void 0:d.data)||[]}catch(u){console.error(u)}}},UK={id:{type:String,default:""},name:{type:String,default:""},keyName:{type:String,default:""},type:{type:String,default:""},width:{type:String,default:""},height:{type:String,default:""},position:{type:String,default:""},top:{type:String,default:""},left:{type:String,default:""},zIndex:{type:Number,default:1},events:{type:Array,default:()=>[]},dataType:{type:String,default:"indicator"},graphicConfig:{type:Object,default:()=>({})},data:{type:Array,default:()=>[]},scale:{type:Number,default:1},dimensionList:{type:Array,default:()=>[]},indicatorList:{type:Array,default:()=>[]},pageMode:{type:String,default:""},styleConfig:{type:Object,default:()=>({})},theme:{type:String,default:"light"},fullMode:{type:Boolean,default:!1},pageId:{type:String,default:""},indicatorUrl:{type:String,default:""},indicatorToken:{type:String,default:""},context:{type:String,default:""},enlargeContainer:{type:String,default:"body"},globalModel:{type:Object,default:()=>new Map},isIframeMode:{type:Boolean,default:!1},showLeftTree:{type:Boolean,default:!0},allowDrill:{type:Boolean,default:!1},showFullScreen:{type:Boolean,default:!0},showClear:{type:Boolean,default:!0},relateKeyName:{type:String,default:""},usedDimensionFields:{type:Array,default:[]},allDimensions:{type:Array,default:[]},pageConfig:{type:Object,default:()=>({})},scaleValue:{type:Object,default:()=>({widthScale:1,heightScale:1})},defaultConfig:{type:Object,defalut:()=>({})},modalContainer:{type:String,default:"#ProviderConfig > #container"},isAllowSaveConfig:{type:Boolean,default:!0},defaultFontSize:{type:Number,default:16}},sb={LAST_DATA:"上期值",SAME_DATA:"同期值",DIFF_DATA:"增减额",MOM_DATA:"环比(%)",YOY_DATA:"同比(%)"},hB=[{text:"排序",children:[{text:"升序",menuKey:"asc"},{text:"降序",menuKey:"desc"},{text:"默认",menuKey:"default-sort"}],menuKey:"sort"},{text:"度量属性",menuKey:"property"},{text:"条件属性",menuKey:"conditionalProperty"},{text:"图形",menuKey:"graph"},{text:"筛选",menuKey:"filter"}],Ls=["合计","平均值","计数","最大值","最小值","方差","标准差"],KK=i=>v.defineAsyncComponent({loader:i,delay:200}),OX="",zX="",YK=v.defineComponent({name:"PivotTable",components:{PivotFilter:LT,PivotProperty:H7,ConditionalProperty:WU,ChartModal:tK,PivotAggregate:oK,PivotTop:lK,PivotConfig:wK,IndSourceList:zK,DragArea:VK,PivotDetail:uK,DrillModal:KK(()=>Promise.resolve().then(()=>lY)),SettingOutlined:P$,DatabaseOutlined:Xj,ArrowsAltOutlined:Rj,ShrinkOutlined:k$,FilterOutlined:hM,DeleteOutlined:lM,ClearOutlined:Nj},props:{...UK},setup(i,{expose:t,emit:e}){let n=null;const o=v.ref(!1),r=v.ref(""),s=v.ref({}),l=v.ref(),a=v.ref({}),h=v.ref({}),d=v.ref({}),u=v.ref(),c=v.ref({}),g=v.ref(),f=v.ref(),p=v.ref(),m=v.ref(),b=v.ref(),C=v.ref(),_=v.ref(),w=v.ref(),y=v.ref(),S=v.ref(),A=v.ref({}),R=v.ref(!1),x=v.ref({}),T=v.ref({}),M=v.ref({}),B=v.ref(),P=v.ref({}),F=v.ref("200px"),H=v.ref("200px"),E=v.ref(300),k=v.ref({}),I=v.ref(),L=v.ref(i.showLeftTree),D=v.ref(!1),O=v.ref({}),N=v.ref(0),W=v.ref(0),$=v.ref(),U=v.ref(!1),Y=v.ref(),j=v.ref(25),G=v.ref(!0),X=v.ref({dateFormat:"YYYY-MM-DD"}),ht=v.ref(16),gt=40,Ct=6,Q=10,et=15,vt=20,bt=24,dt=v.ref([]);let ot=`|${Es(6)}|`;v.provide("splitSymbol",ot),v.provide("indicatorUrl",i.indicatorUrl),v.provide("indicatorToken",i.indicatorToken),v.provide("theme",i.theme),v.provide("pageId",i.pageId),v.provide("context",i.context),v.provide("graphicConfig",i.graphicConfig),v.provide("theDateInfo",X),v.provide("scaleValue",i.scaleValue),v.provide("getContainer",()=>document.querySelector(i.modalContainer)||document.body);const ut=v.ref({}),st=()=>{const V={borderColor:v.unref(mt).borderColor};ut.value=V},_t=v.computed(()=>{let V="#ECF1F5";switch(i.theme){case"default":V="#EAF0F9";break;case"dark":V="#FFFFFF";break}return{borderColor:"#E3E3E3",headerBgColor:V,headerColor:"#252525",bodyBgColor:"#FFFFFF",bodyColor:"#252525",indicatorsHeaderBgColor:V,indicatorsHeaderColor:"#252525",indicatorsBodyBgColor:"#FFFFFF",indicatorsBodyColor:"#252525",aggregateBgColor:V,aggregateColor:"#252525",sortNotActiveColor:"#CCCCCC",sortActiveColor:"#416EFF",dropDownMenuBgColor:"#FFFFFF",dropDownMenuColor:"#141414",dropDownMenuHightLightColor:"#2E68CF"}}),ct=v.ref(1),Wt=v.ref();new ResizeObserver(V=>{for(const K of V){const{width:q}=K.contentRect;Wt.value=q,ct.value++,v.nextTick(()=>{vB()})}}).observe(document.body);const yt=v.computed(()=>{const{width:V}=i;return V.includes("%")&&ct.value?i.isIframeMode?Wt.value:document.querySelector(`#pivotWrap_${i.id}`).clientWidth:parseFloat(V)}),mt=v.computed(()=>{var rt;const V={},{styleConfig:K}=i;let q={};(rt=Object.keys(K))!=null&&rt.length?q=K:q=v.unref(_t);for(const Z in q)V[Z]=q[Z]||"transparent";return V}),ie=v.ref({}),le=()=>{const V=Xl();V&&(v.unref(ie).width=V.width+2+"px"),v.unref(ie).backgroundColor=PC(v.unref(mt).headerBgColor,2)};v.watch(()=>i.theme,()=>{n&&(n==null||n.updateOption(J))});const Zt=()=>{const{widthScale:V,heightScale:K}=i.scaleValue||{};if(V&&K){const q=+(1/V).toFixed(5),rt=+(1/K).toFixed(5),Z=+(parseFloat(i.width)*V).toFixed(2),tt=+(parseFloat(i.height)*K).toFixed(2);j.value=25*V,A.value={transform:`scale(${q}, ${rt})`,width:Z+"px",height:tt+"px",left:-(Z-parseFloat(i.width))/2+"px",top:-(tt-parseFloat(i.height))/2+"px",paddingLeft:v.unref(j)+"px"},ht.value=i.defaultFontSize*V,J.defaultRowHeight=gt*K,J.theme.scrollStyle.width=Ct*V,J.theme.scrollStyle.scrollSliderCornerRadius=Q*V,J.theme.tooltipStyle.fontSize=ht.value,cK(g7,{sortNotActiveColor:v.unref(mt).sortNotActiveColor,sortActiveColor:v.unref(mt).sortActiveColor,iconSize:et*V,hoverSize:vt*V,downSize:bt*V}),v.nextTick(()=>{var it,pt,Pt,Kt,It,kt,Ft,Ie,ci,Po,Ho,xn;(pt=(it=v.unref(S))==null?void 0:it.style)==null||pt.setProperty("--box-tooltip-fontsize",ht.value+"px"),(Kt=(Pt=v.unref(S))==null?void 0:Pt.style)==null||Kt.setProperty("--box-item-size",j.value+"px"),(kt=(It=v.unref(_))==null?void 0:It.style)==null||kt.setProperty("--menu-item-height",32*K+"px"),(Ie=(Ft=v.unref(_))==null?void 0:Ft.style)==null||Ie.setProperty("--menu-item-padding",`0px ${12*V}px`),(Po=(ci=v.unref(_))==null?void 0:ci.style)==null||Po.setProperty("--menu-item-font-size",12*V+"px"),(xn=(Ho=v.unref(_))==null?void 0:Ho.style)==null||xn.setProperty("--menu-item-line-height",30*K+"px"),n&&n.updateOption(J)})}};v.watch(()=>[i.scaleValue,i.width,i.height],()=>{Zt()},{deep:!0});const _e=v.computed(()=>{var V,K,q;return i.fullMode&&!((V=J.rows)!=null&&V.length)&&!((K=J.columns)!=null&&K.length)&&!((q=J.indicators)!=null&&q.length)}),Oe=v.computed(()=>{var V;return{width:(V=i.width)!=null&&V.includes("%")?"calc(100%)":parseFloat(i.width)-v.unref(E)+"px",height:"100%",backgroundColor:i.theme==="darkBlue"?"#081653":"#F1F1F1",color:i.theme==="darkBlue"?"#b2c3dd":""}}),He=v.computed(()=>{const V={fontSize:ht.value+"px"};return v.unref(L)&&(i.theme==="darkBlue"?V.color="#00CCFF":V.color="#416EFF"),V}),Ht=v.ref([]),Et=v.ref([]);v.provide("dimensionFieldList",Ht),v.provide("indicatorFieldList",Et);const Rt="-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol",Tt=v.computed(()=>v.unref(Ht).filter(V=>V.isInnerFilter).concat(v.unref(Et).filter(V=>V.isInnerFilter)).sort((V,K)=>V.timeStamp-K.timeStamp));v.watchEffect(()=>{var rt,Z,tt,it,pt,Pt,Kt,It,kt,Ft;const{dropDownMenuBgColor:V,dropDownMenuColor:K,dropDownMenuHightLightColor:q}=mt.value;V&&((Z=(rt=v.unref(_))==null?void 0:rt.style)==null||Z.setProperty("--menu-bg-color",V)),K&&((it=(tt=v.unref(_))==null?void 0:tt.style)==null||it.setProperty("--menu-color",K)),q&&((Pt=(pt=v.unref(_))==null?void 0:pt.style)==null||Pt.setProperty("--menu-hight-light-color",q)),F.value&&((It=(Kt=v.unref(_))==null?void 0:Kt.style)==null||It.setProperty("--sub-menu-left",F.value)),H.value&&((Ft=(kt=v.unref(_))==null?void 0:kt.style)==null||Ft.setProperty("--sub-menu-top",H.value))});const Nt=v.ref([]),te=v.ref({}),ae=v.ref({}),Jt=v.reactive({cellInnerBorder:!1,underlayBackgroundColor:"transparent",headerStyle:{bgColor(V){return v.unref(Nt).includes(V.dataValue)?v.unref(mt).indicatorsHeaderBgColor:v.unref(mt).headerBgColor},color(V){return v.unref(Nt).includes(V.dataValue)?v.unref(mt).indicatorsHeaderColor:v.unref(mt).headerColor},borderColor:v.unref(mt).borderColor,fontWeight:"600",fontFamily(){if(i.isIframeMode)return Rt},fontSize(){return v.unref(ht)}},cornerHeaderStyle:{bgColor(){return v.unref(mt).headerBgColor},color:v.unref(mt).headerColor,borderColor:v.unref(mt).borderColor,fontWeight:"600",fontFamily(){if(i.isIframeMode)return Rt},fontSize(){return v.unref(ht)}},bodyStyle:{borderColor:v.unref(mt).borderColor,color(V){var rt,Z;const K=V.cellHeaderPaths.rowHeaderPaths,q=V.cellHeaderPaths.colHeaderPaths;return Ls.includes((rt=K==null?void 0:K[K.length-1])==null?void 0:rt.value)?v.unref(mt).aggregateColor:v.unref(Nt).includes((Z=q==null?void 0:q[q.length-1])==null?void 0:Z.value)?v.unref(mt).indicatorsBodyColor:v.unref(mt).bodyColor},bgColor(V){var rt,Z;const K=V.cellHeaderPaths.rowHeaderPaths,q=V.cellHeaderPaths.colHeaderPaths;return Ls.includes((rt=K==null?void 0:K[K.length-1])==null?void 0:rt.value)?v.unref(mt).aggregateBgColor:v.unref(Nt).includes((Z=q==null?void 0:q[q.length-1])==null?void 0:Z.value)?v.unref(mt).indicatorsBodyBgColor:v.unref(mt).bodyBgColor},fontFamily(){if(i.isIframeMode)return Rt},fontSize(){return v.unref(ht)}},rowHeaderStyle:{borderColor:v.unref(mt).borderColor,bgColor(V){return Ls.includes(V.dataValue)?v.unref(mt).aggregateBgColor:v.unref(mt).bodyBgColor},color(V){return Ls.includes(V.dataValue)?v.unref(mt).aggregateColor:v.unref(mt).bodyColor},fontFamily(){if(i.isIframeMode)return Rt},fontSize(){return v.unref(ht)}},frameStyle:{borderLineWidth:1,borderColor:v.unref(mt).borderColor},scrollStyle:{width:Ct,scrollSliderCornerRadius:Q},tooltipStyle:{fontSize:v.unref(ht)}}),J=v.reactive({records:[],columnHeaderTitle:!0,excelOptions:{fillHandle:!0},rows:[],columns:[],indicators:[],corner:{titleOnDimension:"row"},dataConfig:{sortRules:[],filterRules:[]},widthMode:"standard",heightMode:"standard",defaultRowHeight:gt,defaultColWidth:360,menu:{renderMode:"html",dropDownMenuHighlight:[]},theme:Jt}),be=v.computed(()=>{let V=0;return v.unref(L)&&i.fullMode&&(V=v.unref(E)),V}),Lt=v.computed(()=>{let V=0;return v.unref(D)&&(V=20),V}),Ot=5,Se=v.ref({});v.watch(R,V=>{if(V){const K={};v.nextTick(()=>{var Z,tt;const q=Xl();let rt=0;(Z=v.unref(Tt))!=null&&Z.length&&(rt=(tt=v.unref($))==null?void 0:tt.clientHeight),q&&(K.width=q.width+"px",K.height=q.height+"px",K.top=q.top+rt+v.unref(Lt)+"px",K.left=q.left+v.unref(be)+v.unref(Lt)+v.unref(j)+"px"),Se.value=K})}});const qe=v.ref([]),Kn=v.ref([]),Vr=v.ref({}),Sn=v.ref({}),ks=v.ref([]),Ul=v.ref([]),Kl=v.ref([]),Yl=v.ref([]),aY=v.computed(()=>{const V=[];for(const tt of v.unref(qe)){const{data:it,indicatorKey:pt="",calculateType:Pt=""}=tt||{};V.push({label:it.indicatorKey,columnName:it.indicatorKey,location:"LEFT",show:!0,calcType:"BUILT_IN",builtInFormula:Pt,builtInValueSource:pt})}const K=[],q={};v.unref(Kn).forEach(tt=>{q[tt.key]||(q[tt.key]=[]),q[tt.key].push(tt)});for(const tt in q){const it=q[tt]||[];it.forEach((pt,Pt)=>{var Ie;const Kt=v.unref(Ht).find(ci=>ci.label===pt.key),It=v.unref(Et).find(ci=>ci.label===pt.key),kt=Kt||It,Ft={};Pt<it.length-1&&(Ft.join="&&"),(kt==null?void 0:kt.genericType)==="DATE"&&(Ft.dateFormat=((Ie=v.unref(X))==null?void 0:Ie.dateFormat)||"YYYY-MM-DD",Pt===0?Ft.prop="startTime":Pt===1&&(Ft.prop="endTime")),kt&&K.push({fieldName:kt.name,fieldType:kt.genericType,fieldValue:Array.isArray(pt.value)?pt.value.join(","):pt.value,hrpIndexCode:kt.indexCode,hrpIndexCodeNum:kt.indexCodeNum,id:kt.id,label:kt.label,rule:pt.rule,targetSource:"",typeGuid:pt.typeGuid||"",type:pt.type,...Ft})})}const rt=[];if(Object.keys(v.unref(Vr)))for(const tt in v.unref(Vr))v.unref(Vr)[tt]&&rt.push({key:tt,num:v.unref(Vr)[tt],rule:"TOP"});const Z=[];if(Object.keys(v.unref(Sn)))for(const tt in v.unref(Sn)){const{order:it,type:pt,columnData:Pt,columnHeader:Kt}=v.unref(Sn)[tt];if(it.toLowerCase()==="default-sort")continue;const It={label:tt,order:it.toUpperCase(),type:"COMBINATION",fieldType:pt};pt==="indicators"&&(It.columnHeader=Kt,It.columnData=Pt,It.type="NORMAL"),Z.push(It)}return{calc:V,filter:K,truncations:rt,sorts:Z,aggregateMethod:v.unref(P)||{}}}),hY=GK(i),dY=jK(i),ab=$K(i),hb=v.ref({}),dr=async()=>{var Pt,Kt,It,kt;const{dimensionList:V,graphicConfig:K={}}=i,{queryColumnList:q=[]}=K,{rows:rt=[],columns:Z=[]}=J,tt=(Pt=v.unref(Kl))!=null&&Pt.length?v.unref(Kl):[],it=(Kt=v.unref(Yl))!=null&&Kt.length?v.unref(Yl):[];if(!(tt!=null&&tt.length))for(const Ft of rt)tt.push(Ft.dimensionKey);if(!(it!=null&&it.length))for(const Ft of Z)it.push(Ft.dimensionKey);tt!=null&&tt.length||tt.push(...V.filter(Ft=>Ft.position==="rows").map(Ft=>Ft.key)),it!=null&&it.length||it.push(...V.filter(Ft=>Ft.position==="columns").map(Ft=>Ft.key));const pt=[];for(const Ft in v.unref(a))pt.push({type:"dimension",key:Ft,rule:v.unref(a)[Ft]});for(const Ft in v.unref(h))pt.push({type:"indicators",key:Ft,rule:v.unref(h)[Ft]});if(pt!=null&&pt.length&&db(pt,{isHandle:!1}),q!=null&&q.length)for(const Ft of q)!tt.includes(Ft.name)&&!it.includes(Ft.name)&&tt.push(Ft.name);hb.value={...v.unref(aY),rowDimensionKeys:tt,colDimensionKeys:it,dimensions:(It=v.unref(ks))!=null&&It.length?v.unref(ks):v.unref(Ht),indicators:(kt=v.unref(Ul))!=null&&kt.length?v.unref(Ul):v.unref(Et)};try{const Ft=await dY({pivotTableCal:v.unref(hb)},e,Ie=>{var ci;if(v.unref(G)){const{sqlConditions:Po=[],queryColumns:Ho=[]}=Ie,xn=uB(Po),pi=Ho.find(Ne=>Ne.typeGuid==="the_date");if(pi&&(X.value={dateFormat:pi.dateFormat||"YYYY-MM-DD"}),xn!=null&&xn.length)for(const Ne of xn)["startTime","endTime"].includes(Ne.prop)&&(v.unref(X)[Ne.prop]=Ne.fieldValue||"",(ci=v.unref(X))!=null&&ci.rangeFormat||(v.unref(X).rangeFormat=Ne.dateFormat||"YYYY-MM-DD"));G.value=!1}});mB(Ft)}catch(Ft){console.error(Ft)}};function uB(V){const K=[];for(const q of V)q.sqlConditions?K.push(...uB(q.sqlConditions)):q.fieldName==="the_date"&&K.push(q);return K}const uY=V=>{v.unref(qe).find(K=>K.data.indicatorKey===V.data.indicatorKey)||qe.value.push(V),dr()},cY=V=>{const K=v.unref(qe).findIndex(q=>q.data.indicatorKey===V);K!==-1&&qe.value.splice(K,1),dr()},db=(V,{isHandle:K=!0}={})=>{let q=[];Array.isArray(V)?q=V:q=[V];for(const rt of q){const{key:Z="",rule:tt,type:it=""}=rt||{};let pt=Ye.cloneDeep(tt);Array.isArray(tt)||(pt=[tt]);const Pt=v.unref(Ht).find(kt=>kt.label===Z),Kt=v.unref(Et).find(kt=>kt.label===Z),It=Pt||Kt;if(It){if((It==null?void 0:It.genericType)==="DATE"&&(pt==null?void 0:pt.length)===1){const kt=pt[0].value;pt[0].rule="GREATER_EQUAL",pt[1]={rule:"LESS_EQUAL",value:kt}}for(let kt=v.unref(Kn).length-1;kt>=0;kt--){const Ft=v.unref(Kn)[kt];Ft.key===Z&&Ft.type===it&&v.unref(Kn).splice(kt,1)}for(const kt of pt){const{rule:Ft,value:Ie}=kt;Z&&Ft&&Ie&&Kn.value.push({key:Z,rule:Ft,value:Ie,type:it,typeGuid:It.typeGuid})}}}K&&dr()},gY=()=>{Vr.value=v.unref(x)||{},dr()},cB=V=>{const{key:K,order:q,type:rt,columnData:Z=[]}=V;if(rt==="indicators"){let tt="";for(const it in v.unref(Sn))v.unref(Sn)[it].type==="indicators"&&(tt=it);tt&&delete v.unref(Sn)[tt]}v.unref(Sn)[K]={order:q,type:rt,columnData:Z},dr()},Xh=()=>{const V=v.unref(Ht),K=v.unref(Et),q=V.filter(Z=>Z.positionType==="rows").map(Z=>Z.name),rt=V.filter(Z=>Z.positionType==="columns").map(Z=>Z.name);ks.value=Ye.cloneDeep(V),Ul.value=Ye.cloneDeep(K),Kl.value=Ye.cloneDeep(q),Yl.value=Ye.cloneDeep(rt),dr()};function fY(V,K=!0,q=-1){if(q>-1)J.indicators.splice(q,0,...V);else for(const rt of V)J.indicators.push(rt);K&&n.updateOption(J)}function pY({label:V,calcType:K}){const q=[],rt=v.unref(ae)[V]||[];for(const Z in sb)rt.indexOf(Z)===-1&&q.push({text:sb[Z],menuKey:Z});return K==="FORMULA"||!(q!=null&&q.length)?hB:[{text:"计算",menuKey:"calculate",children:q},...hB]}function uf(V){var q;let K=[];if(V!=="rows"&&(K=[{text:"钻取",menuKey:"drill"},{text:"升序",menuKey:"asc"},{text:"降序",menuKey:"desc"},{text:"筛选",menuKey:"filter"},{text:"聚合",menuKey:"aggregate"},{text:"取top",menuKey:"top"},{text:"删除",menuKey:"delete"}]),i.fullMode||i.allowDrill)if(v.unref(dt)&&Array.isArray(v.unref(dt)))if((q=v.unref(dt))!=null&&q.length){const rt=v.unref(dt).map(Z=>({text:Z.title||Z.label,menuKey:V==="rows"?`${ot}${Z.label}`:Z.label}));V==="rows"?K=rt:K[0].children=rt}else K.splice(0,1);else K.splice(0,1);else K.splice(0,1),K.splice(-1,1);return K}function mY(V,K){R.value=!0,v.unref(P)[K]=V||[],dr(),ln({type:"9",data:{key:K,types:V}})}function vY(V,K=!0){var q;for(const rt of V){const{key:Z,name:tt,type:it,dimensionKey:pt,width:Pt}=rt;let Kt;if(pt)Kt=rt;else{const It={dimensionKey:Z,title:tt,width:Pt?`${Pt}%`:"auto",type:it};it==="columns"?It.headerStyle={textStick:!0}:it==="rows"&&(It.cornerHeaderIcon="sortNormal"),Kt=It}if(Kt&&(Kt.headerStyle={textStick:!0},Kt.headerFormat||(Kt.headerFormat=It=>{if(it==="rows"){const kt=It==null?void 0:It.split(ot);return kt!=null&&kt.length?kt[kt.length-1]:It}else return It}),J[it].push(Kt)),(q=J[it])!=null&&q.length)for(const It of J[it])It.cornerDropDownMenu=uf(),it==="rows"&&(It.dropDownMenu=uf("rows"));J.dataConfig.sortRules.push({sortField:Z,sortType:v.unref(r)})}K&&n.updateOption(J),v.nextTick(()=>{fB()})}function gB(V){const K={},{records:q}=J;for(const rt of q)for(const Z of V)An(K,Z)?K[Z].find(tt=>tt.value===rt[Z])||K[Z].push(ub({value:rt[Z]})):K[Z]=ub([{value:rt[Z]}]);return K}function ub(V){const K=Ye.cloneDeep(V);if(typeof V=="object")if(Array.isArray(K))for(const rt of K)q(rt);else q(K);function q(rt){for(const Z in rt)if(typeof rt[Z]=="string"){const tt=rt[Z].split(ot);tt!=null&&tt.length&&(rt[Z]=tt[tt.length-1])}}return K}function fB(){const{dataset:{columns:V,rows:K}}=n,q=K.concat(V);s.value=gB(q)}const pB=v.computed(()=>{var V;return(V=v.unref(Ht))!=null&&V.length?v.unref(Ht).map(K=>K.label).concat(i.usedDimensionFields):i.usedDimensionFields});async function mB(V){var Ie,ci,Po,Ho,xn,pi,Ne,ur;const K=await hY({pivotTableCal:v.unref(hb)});dt.value=K.filter(jt=>!v.unref(pB).includes(jt.label));let q=V;V?Y.value=Ye.cloneDeep(V):q=Ye.cloneDeep(v.unref(Y)),R.value=!0;const{data:rt={}}=(q==null?void 0:q.data)||{},{rows:Z=[]}=rt,tt=[],it=[];for(const jt of v.unref(Ht)){if(!jt.show)continue;const se=J[jt.positionType].find(Ze=>Ze.dimensionKey===jt.label);se?it.push({...se,title:jt.showTitle}):it.push({key:jt.label,name:jt.showTitle,type:jt.positionType,width:jt.width})}for(let jt=0;jt<v.unref(Et).length;jt++){const se=v.unref(Et)[jt];if(!se.show)continue;const Ze=pY(se),Ge=J.indicators.find(Fi=>Fi.indicatorKey===se.label);let ze={};Ge?ze={...Ge,dropDownMenu:Ze,title:se.showTitle}:ze={indicatorKey:se.label,title:se.showTitle,width:se!=null&&se.width?`${se.width}%`:"auto",showSort:!1,headerStyle:{fontWeight:"normal"},dropDownMenu:Ze},ze&&(ze.style={padding:[16,28,16,28],textAlign:"right"},ze.format||(ze.format=(Fi,Rn,qh,Zh)=>{const mb=Zh.getRecordByCell(Rn,qh)||[];return mb[0]&&isNaN(+mb[0][se.label])?mb[0][se.label]:Fi||"-"}),tt.push(ze))}const pt=it.filter(jt=>jt.type==="rows");if(((Ie=J==null?void 0:J.rows)==null?void 0:Ie.length)!==pt.length&&typeof((ci=v.unref(B))==null?void 0:ci.col)=="number"&&(v.unref(B).col+=pt.length-(((Po=J==null?void 0:J.rows)==null?void 0:Po.length)||0)),J.indicators=[],J.rows=[],J.columns=[],(Ho=v.unref(qe))!=null&&Ho.length)for(const jt of v.unref(qe))isNaN(+jt.position)||tt.splice(+jt.position,0,{...jt.data,calculateType:jt.calculateType});const{sortType:Pt,col:Kt,row:It}=v.unref(B)||{};for(const jt of tt)jt&&(jt.headerIcon=se=>{const{col:Ze,row:Ge}=se;if(Kt===Ze&&It===Ge){let ze="sortNormal";return Pt==="ASC"?ze="sortUp":Pt==="DESC"&&(ze="sortDown"),ze}else return"sortNormal"});fY(tt,!1),vY(it,!1);const kt=[],Ft=it.filter(jt=>jt.type==="rows").map(jt=>jt.key||jt.dimensionKey);for(const jt of Z)for(const se in jt)if(!Ls.includes(jt[se])){const Ze=Ft.indexOf(se);if(Ze!==-1){const Ge=[];for(let ze=0;ze<=Ze;ze++){const Fi=String(jt[Ft[ze]]);if(Fi.includes(ot)){const Rn=Fi.split(ot);Rn!=null&&Rn.length&&Ge.push(Rn[Rn.length-1])}else Ge.push(Fi)}Ge!=null&&Ge.length&&(jt[se]=Ge.join(ot))}}for(const jt of it){const se=(jt==null?void 0:jt.key)||(jt==null?void 0:jt.dimensionKey);if(jt.type==="columns"&&!v.unref(M)[se])v.unref(M)[se]=cb("",se,Z);else if(jt.type==="rows")if(v.unref(T)[se]){const{type:Ze}=v.unref(T)[se]||{};kt.push(cb(Ze,se,Z))}else if(!v.unref(B)||v.unref(B).sortField===se||!n)kt.push(cb("",se,Z));else{const Ze=J.dataConfig.sortRules.find(Ge=>Ge.sortField===se);Ze&&kt.push(Ze)}}if(v.unref(B)&&kt.push(v.unref(B)),(xn=Object.keys(v.unref(M)))!=null&&xn.length)for(const jt in v.unref(M))kt.push(v.unref(M)[jt]);if(J.records=Z,J.dataConfig.sortRules=kt,Z!=null&&Z.length&&(v.unref(O).records=[]),(pi=J.columns)!=null&&pi.length?J.columnHeaderTitle=!0:(Ne=J.indicators)!=null&&Ne.length?J.columnHeaderTitle=!1:(ur=J.rows)!=null&&ur.length&&(J.columnHeaderTitle=!0),n)n.updateOption(J),v.nextTick(()=>{bB()}),R.value=!1;else{const jt=document.getElementById(`pivotTableContainer_${i.id}`);n=new BT(jt,J),v.nextTick(()=>{bB(),o.value=!0,R.value=!1,i.isIframeMode&&(v.unref(N)&&n.setScrollTop(v.unref(N)),v.unref(W)&&n.setScrollLeft(v.unref(W)))}),MY()}v.nextTick(()=>{const{indexFormatConfig:jt}=(i==null?void 0:i.defaultConfig)||{};if(jt){const se=[];for(const Ze in jt)jt[Ze]&&se.push(jt[Ze]);SB(se)}})}const jr=v.ref({});function vB(){Xl()&&(v.unref(D)?(v.unref(jr).top=v.unref(Lt)+"px",v.unref(jr).left="0"):(v.unref(jr).top="0",v.unref(jr).left="0"))}function bB(){var V;if(n&&!((V=J.records)!=null&&V.length)){const{dataset:{rows:K}}=n,q={};for(const rt of K)q[rt]="";v.unref(O).dataConfig={...J.dataConfig,filterRules:[]},v.unref(O).records=[q],n.updateOption({...J,...v.unref(O)})}}function bY(V,K){R.value=!0,db({type:"indicators",key:V,rule:K}),ln({type:"3",data:{type:"indicators",key:V,rule:K}})}function CY(V,K){R.value=!0,db({type:"dimension",key:V,rule:K}),ln({type:"3",data:{type:"dimension",key:V,rule:K}})}function yY(V,K){var tt;let q=!1;const rt=J[K].findIndex(it=>it.dimensionKey===V),Z=J.dataConfig.sortRules.findIndex(it=>it.sortField===V);if(rt!==-1){if(J[K].splice(rt,1),i.fullMode||i.allowDrill){const it=v.unref(Ht).findIndex(pt=>pt.label===V);it!==-1&&(v.unref(Ht)[it].isInnerFilter?(v.unref(Ht)[it].show=!1,q=!0):v.unref(Ht).splice(it,1))}else for(const it of J[K])it.cornerDropDownMenu=uf(),K==="rows"&&(it.dropDownMenu=uf("rows"));(tt=v.unref(B))!=null&&tt.col&&(v.unref(B).col-=1),R.value=!0,Xh(),ln({type:"7"})}Z!==-1&&(J.dataConfig.sortRules[Z].sortType=r),n.updateOption(J),v.nextTick(()=>{if(fB(),!q){delete a.value[V];const it=v.unref(Kn).findIndex(pt=>pt.key===V);it!==-1&&v.unref(Kn).splice(it,1)}})}function _Y(V){const{indicators:K}=J,q=K.findIndex(rt=>rt.indicatorKey===V);if(q!==-1){const rt=K[q];if(K.splice(q,1),rt.calculateType){const Z=rt.indicatorKey.split("@"+rt.calculateType)[0],tt=v.unref(ae)[Z].indexOf(rt.calculateType);tt!==-1&&v.unref(ae)[Z].splice(tt,1);const it=v.unref(Nt).indexOf(rt.title);it!==-1&&v.unref(Nt).splice(it,1),delete v.unref(te)[rt.title]}cY(rt.indicatorKey),ln({type:"2",data:rt.indicatorKey})}}function cb(V,K,q){let rt=[];const Z=new Set;for(const tt of q){const it=tt[K];it&&!Ls.includes(it)&&Z.add(it)}return rt=Array.from(Z),V==="asc"?rt=rt.sort((tt,it)=>tt.localeCompare(it)):V==="desc"&&(rt=rt.sort((tt,it)=>it.localeCompare(tt))),{sortField:K,sortBy:[...rt,...Ls]}}function CB(V,K,q,rt){R.value=!0;let{menu:{dropDownMenuHighlight:Z},rows:tt}=J;rt=rt+1,Z=Z.filter(pt=>!(pt.type==="dimension"&&pt.field===K)||pt.type==="indicator"),Z.push({col:q,row:rt-1,field:K,type:"dimension",menuKey:V}),J.menu.dropDownMenuHighlight=Z;const it=tt.find(pt=>pt.dimensionKey===K);if(it){let pt="sortNormal";V==="asc"?pt="sortUp":V==="desc"&&(pt="sortDown"),it.cornerHeaderIcon=pt}n.updateOption(J),V==="default-sort"?delete v.unref(T)[K]:v.unref(T)[K]={type:V},cB({key:K,order:V,type:"dimension"}),ln({type:"4",data:{key:K,order:V,type:"dimension"}})}function yB(V,K,q,rt,Z){var Ft;R.value=!0;const{menu:tt}=J;let it=tt.dropDownMenuHighlight,pt="";(Ft=J.rows)!=null&&Ft.length&&(pt=J.rows[J.rows.length-1].dimensionKey);const Pt=q.filter((Ie,ci)=>ci<q.length-1),Kt=Pt.map(Ie=>({columnName:Ie.dimensionKey})),It=Pt.map(Ie=>Ie.value),kt=it.findIndex(Ie=>Ie.field===pt&&Ie.type==="dimension");kt!==-1&&it.splice(kt,1),it=it.filter(Ie=>Ie.type==="dimension"),it.push({col:rt,row:Z,field:K,type:"indicator",menuKey:V}),J.menu.dropDownMenuHighlight=it,n.updateOption(J),V==="default-sort"?B.value=null:B.value={sortField:pt,sortByIndicator:K,sortType:V.toUpperCase(),query:It,col:rt,row:Z},cB({key:K,order:V,type:"indicators",columnData:It,columnHeader:Kt}),ln({type:"4",data:{key:K,order:V,type:"indicators"}})}function _B({dimensionKey:V,value:K=""}){const q={};v.unref(a)[V]&&(q.filterData=v.unref(a)[V]);const rt=v.unref(Ht).find(Z=>Z.label===V);d.value={fieldName:K||(rt==null?void 0:rt.title)||V,key:V,type:"dimension",...q},v.nextTick(()=>{v.unref(u).showModal(),ln({type:"5",data:V})})}function wY(V,K){d.value={fieldName:K,key:V,type:"indicators",filterData:v.unref(h)[V]},v.nextTick(()=>{v.unref(u).showModal()})}function SY({indicatorKey:V,menuKey:K}){R.value=!0;let q=J.indicators.length-1;const rt=`${V}@${K}`,Z=`${V}(${sb[K]}) fx`;v.unref(Nt).push(Z),v.unref(te)[Z]=rt,J.indicators.forEach((tt,it)=>{tt.indicatorKey===V&&(q=it+1)}),v.unref(ae)[V]||(v.unref(ae)[V]=[]),v.unref(ae)[V].push(K),uY({data:{indicatorKey:rt,title:Z,width:"auto",showSort:!1,headerStyle:{fontWeight:"normal"},headerIcon:"sortNormal",dropDownMenu:[{text:"排序",children:[{text:"升序",menuKey:"asc"},{text:"降序",menuKey:"desc"},{text:"默认",menuKey:"default-sort"}],menuKey:"sort"},{text:"度量属性",menuKey:"property"},{text:"条件属性",menuKey:"conditionalProperty"},{text:"删除",menuKey:"delete"}],style:{padding:[16,28,16,28],textAlign:"right"},format:(tt,it,pt,Pt)=>{const Kt=Pt.getRecordByCell(it,pt)||[];return Kt[0]&&isNaN(+Kt[0][rt])?Kt[0][rt]:tt}},position:q,indicatorKey:V,calculateType:K}),ln({type:"1",data:{indicatorKey:V,calculateType:K}})}function xY(){const V=J.rows[0]?J.rows[0].cornerDropDownMenu:[],K=J.columns[0]?J.columns[0].cornerDropDownMenu:[],q=J.rows.map(it=>({...it,cornerDropDownMenu:K})),rt=J.columns.map(it=>({...it,cornerDropDownMenu:V}));J.columns=q,J.rows=rt;const{type:Z,len:tt}=J.aggregate||{};Z&&(J.records.splice(-tt),J.aggregate={type:Z,len:0}),J.menu.dropDownMenuHighlight=[],a.value={},h.value={},c.value={},J.dataConfig.filterRules=[],n.updateOption(J)}function RY({indicatorKey:V,fieldName:K}){const q=cf(V);if(q>-1){const rt=J.indicators[q].formatConfig||{};v.unref(g).showModal({...rt,indicatorKey:V,fieldName:K})}}function AY(V){const K=cf(V);if(K>-1){const q=J.indicators[K].conditionalConfig||[];v.unref(f).showModal(V,q)}}function cf(V){return J.indicators.findIndex(K=>K.indicatorKey===V)}function TY(V){const K=v.unref(Ht)[0],q=v.unref(Ht).map(tt=>tt.label),rt=gB(q),Z={xLabel:K.label,yLabel:V,dimensionData:rt,records:ub(J.records)};v.unref(C).showModal(Z)}function MY(){n.on("scroll",V=>{const{scrollDirection:K}=V;K==="vertical"?N.value=n.getScrollTop():K==="horizontal"&&(W.value=n.getScrollLeft())}),n.on("dblclick_cell",V=>{const{cellLocation:K="",field:q=""}=V;K==="body"&&!q.includes("LAST_DATA")&&!q.includes("SAME_DATA")&&!q.includes("DIFF_DATA")&&!q.includes("MOM_DATA")&&!q.includes("YOY_DATA")&&v.unref(w).showModal({args:V,splitSymbol:ot,dimension:v.unref(Ht),indicator:v.unref(Et)})}),n.on("after_render",()=>{st(),vB(),le(),v.nextTick(()=>{o.value=!0})}),n.on("icon_click",V=>{const{name:K,col:q,row:rt}=V;if(["sortNormal","sortUp","sortDown"].includes(K)){const{rows:Z,indicators:tt}=J,it=n.getCellValue(q,rt);let pt=v.unref(Ht).find(Ft=>Ft.showTitle===it);pt||(pt=v.unref(Et).find(Ft=>Ft.showTitle===it));let Pt=pt==null?void 0:pt.label;if(v.unref(Nt).includes(it)&&(Pt=v.unref(te)[it]),!Pt)return;const Kt=Z.find(Ft=>Ft.dimensionKey===Pt),It=tt.find(Ft=>Ft.indicatorKey===Pt);let kt="default-sort";if(K==="sortUp"?kt="desc":K==="sortDown"?kt="default-sort":(!K||K==="sortNormal")&&(kt="asc"),It){const Ft=n.getCellHeaderPaths(q,rt);yB(kt,Pt,(Ft==null?void 0:Ft.colHeaderPaths)||[],q,rt)}else Kt&&CB(kt,Pt,q,rt)}}),n.on("show_menu",()=>{const V=document.querySelector(`#pivotTableContainer_${i.id} .vtable__menu-element`);if(V){V.classList.add("first");const K=parseFloat(V.style.left)+V.clientWidth+3;F.value=K+"px",H.value=parseFloat(V.style.top)+"px"}}),n.on("dropdown_menu_click",V=>{const{field:K,col:q,row:rt}=V,{dimensionKey:Z,indicatorKey:tt,value:it}=K[K.length-1];let pt=V.menuKey,Pt=!1;pt.includes(ot)&&(Pt=!0,pt=pt.replace(ot,"")),l.value=V;const Kt=v.unref(dt).find(It=>It.label===pt);if(Kt){const It=v.unref(Ht).findIndex(kt=>kt.label===Z);if(It!==-1){const kt={...Kt,show:!0,positionType:"rows",showTitle:Kt.title||Kt.label};Pt?v.unref(y).showModal({drillDimension:kt,drillFieldData:K,usedDimensionFields:v.unref(pB),tableProps:i,splitSymbol:ot}):(Ht.value.splice(It+1,0,kt),R.value=!0,Xh()),ln({type:"8"})}}switch(pt){case"drill":alert("无维度可钻取");break;case"delete":Z?yY(Z,"rows"):tt&&_Y(tt);break;case"asc":case"desc":case"default-sort":Z?CB(pt,Z,q,rt):tt&&yB(pt,tt,K,q,rt);break;case"filter":Z?_B({dimensionKey:Z}):tt&&wY(tt,it);break;case"LAST_DATA":case"SAME_DATA":case"DIFF_DATA":case"MOM_DATA":case"YOY_DATA":case"zb":SY({indicatorKey:tt,menuKey:pt});break;case"trans":xY();break;case"property":RY({indicatorKey:tt,fieldName:it});break;case"conditionalProperty":AY(tt);break;case"aggregate":v.unref(p).showModal(v.unref(P)[Z]||[],Z);break;case"top":BY(Z);break;case"graph":TY(tt);break}})}function BY(V){v.unref(m).showModal({value:v.unref(x)[V]||"",key:V})}function PY(){v.unref(b).showModal(v.unref(Ht),v.unref(Et))}async function HY(){R.value=!0,await ab("save",{keyName:i.relateKeyName||i.keyName,data:{}}),r.value="",s.value={},a.value={},h.value={},d.value={},c.value={},x.value={},T.value={},M.value={},B.value={},P.value={},F.value="200px",H.value="200px",k.value={},L.value=i.showLeftTree,D.value=!1,O.value={},ut.value={},Ht.value=[],Et.value=[],Nt.value=[],te.value={},ae.value={},Se.value={},qe.value=[],Kn.value=[],Vr.value={},Sn.value={},ks.value=[],Ul.value=[],Kl.value=[],Yl.value=[],Y.value={},jr.value={},N.value=0,W.value=0,J.records=[],J.rows=[],J.columns=[],J.indicators=[],J.dataConfig={sortRules:[],filterRules:[]},J.defaultRowHeight=gt,J.menu.dropDownMenuHighlight=[],TB(),Zt(),dr()}function EY(V=[],K=[]){var tt;const q=V.concat(K).map(it=>it.name),rt=v.unref(Ht).filter(it=>it.isInnerFilter&&!q.includes(it.name)).map(it=>({...it,show:!1})),Z=v.unref(Et).filter(it=>it.isInnerFilter&&!q.includes(it.name)).map(it=>({...it,show:!1}));Ht.value=[...V,...rt],Et.value=[...K,...Z];for(const it in v.unref(Sn))if(((tt=v.unref(Sn)[it])==null?void 0:tt.type)==="indicators"){delete v.unref(Sn)[it];break}i.fullMode||i.allowDrill?(T.value={},B.value={},M.value={},R.value=!0,Xh(),ln({type:"10",data:{dimensions:v.unref(Ht),indicators:v.unref(Et)}})):mB()}function LY(V){if(!v.unref(I))return;const{name:K,scope:q}=v.unref(I),rt=v.unref(Ht).find(Pt=>Pt.name===K),Z=v.unref(Ht).findIndex(Pt=>Pt.name===K),tt=v.unref(Et).find(Pt=>Pt.name===K),it=v.unref(Et).findIndex(Pt=>Pt.name===K),pt={timeStamp:new Date().getTime()};if(["rows","columns"].includes(V))if(rt)if(rt.show){ji.message.error({content:"该维度已存在,请勿重复添加",key:"repeatFlag"});return}else rt.positionType=V,rt.show=!0,v.unref(Ht).push(rt),v.unref(Ht).splice(Z,1);else v.unref(Ht).push({...Ye.cloneDeep(v.unref(I)),...pt,positionType:V,showTitle:v.unref(I).label});else if(V==="indicators")if(tt)if(tt.show){ji.message.error({content:"该指标已存在,请勿重复添加",key:"repeatFlag"});return}else tt.show=!0,v.unref(Et).push(tt),v.unref(Et).splice(it,1);else v.unref(Et).push({...Ye.cloneDeep(v.unref(I)),...pt,showTitle:v.unref(I).label});else if(V==="filters"){if(["IDX","BUILT_IN_IDX"].includes(q))if(v.unref(Tt).find(Pt=>Pt.name===K)){ji.message.error({content:"该指标已存在,请勿重复添加",key:"repeatFlag"});return}else tt?(tt.isInnerFilter=!0,tt.timeStamp=new Date().getTime()):v.unref(Et).push({...Ye.cloneDeep(v.unref(I)),showTitle:v.unref(I).label,show:!1,isInnerFilter:!0,...pt});else if(["DIM","BUILT_IN_DIM"].includes(q))if(v.unref(Tt).find(Pt=>Pt.name===K)){ji.message.error({content:"该维度已存在,请勿重复添加",key:"repeatFlag"});return}else rt?(rt.isInnerFilter=!0,rt.timeStamp=new Date().getTime()):v.unref(Ht).push({...Ye.cloneDeep(v.unref(I)),positionType:"filters",showTitle:v.unref(I).label,show:!1,isInnerFilter:!0,...pt})}R.value=!0,I.value=null,Xh(),ln({type:"10",data:{dimensions:v.unref(Ht),indicators:v.unref(Et)}})}const kY=(V=[])=>{let K=!1;for(const q of v.unref(Ht))if(!V.find(Z=>Z.typeGuid===q.typeGuid)){K=!0;break}return K};v.provide("setItemDisabled",kY);const wB=()=>{},FY=({checkKeys:V,key:K,type:q})=>{q==="dimension"?(a.value[K]=V,c.value={},CY(K,V)):q==="indicators"&&(h.value[K]=V,bY(K,V))};function SB(V){let K=V;Array.isArray(K)||(K=[V]);for(const q of K){const{indicatorKey:rt,unit:Z="",format:tt,floatLength:it,position:pt}=q,Pt=cf(rt);if(Pt>-1){const Kt=J.indicators[Pt];Kt.formatConfig=q,Kt.format=(It,kt,Ft,Ie)=>{const ci=Ie.getRecordByCell(kt,Ft)||[];return ci[0]&&isNaN(+ci[0][Kt.indicatorKey])?ci[0][Kt.indicatorKey]:(tt==="integer"?It=Math.round(Number(It)):tt==="float"&&!isNaN(it)?It=Number(It).toFixed(it):tt==="percent"&&(it?It=(Number(It)*100).toFixed(it)+"%":It=Number(It)*100+"%"),pt==="right"?It+Z:Z+It)}}}n.updateOption(J)}function IY(V,K=[]){const q=cf(V);if(q>-1){const rt=J.indicators[q];rt.conditionalConfig=K;const Z=[];K.forEach(tt=>{let it="";tt.conditions.forEach((pt,Pt)=>{Pt>0&&(it+=pt.join==="and"?" && ":" || "),it+=`value${pt.operation}${pt.value}`}),Z.push(it)}),rt.style.color=({dataValue:tt})=>{let it="#333";return K.forEach((pt,Pt)=>{pt.color&&(it=gb(Z[Pt],tt)?pt.color:it)}),it},rt.style.textAlign=({dataValue:tt})=>{let it="left";return K.forEach((pt,Pt)=>{pt.align&&(it=gb(Z[Pt],tt)?pt.align:it)}),it},rt.customRender=({rect:tt,dataValue:it})=>{let pt=[];return K.forEach((Pt,Kt)=>{if(Pt.icon&&gb(Z[Kt],it)){const kt=W2(Pt.icon,Pt.iconColor);pt=[{type:"icon",x:Pt.align!=="right"?15:tt.width-25,y:tt.height/2-7,svg:kt,height:14,width:14}]}}),{elements:pt,renderDefault:!0}},n.updateOption(J)}}function gb(V,K){V=V||"true";const q=`function (value){
368
368
  if(${V}){
369
369
  return true
370
370
  }else{
371
371
  return false
372
372
  }
373
- }`;return Function(`"use strict";return (${q})`)().call(this,K)}function DY(V){R.value=!0;const{value:K,key:q}=V;v.unref(x)[q]=K,gY(),ln({type:"6",data:{key:q,value:K}})}function Xl(){return n==null?void 0:n.getDrawRange()}const gf=v.ref([]),xB=v.ref(""),RB=v.ref(),OY=(V,K)=>{var Ie,ci,Po,Ho,xn;const q=K.dataViewColumns[V.oldIndex]||{},{scope:rt}=q;let Z=!1,tt=!1;["IDX","BUILT_IN_IDX"].includes(rt)?Z=!0:["DIM","BUILT_IN_DIM"].includes(rt)&&(tt=!0);const it=Xl(),{rows:pt,columns:Pt,indicators:Kt,records:It}=J,{top:kt,left:Ft}=it;if(v.unref(_e)){let pi=i.height;i.isIframeMode&&(pi=document.body.clientHeight+"px");let Ne=v.unref(Oe).width;Ne.includes("calc")&&(Ne=v.unref(yt)-v.unref(E)+"px"),k.value.main={width:Ne,height:pi,top:kt+v.unref(Lt)+"px",left:Ft+v.unref(be)+v.unref(Lt)+v.unref(j)+"px"},k.value.rows={width:parseFloat(Ne)/2-Ot*2+"px",height:parseFloat(pi)-Ot*2+"px",top:0,left:0},k.value.columns={width:parseFloat(Ne)/2-Ot*2+"px",height:parseFloat(pi)/3-Ot*2+"px",top:0,left:parseFloat(Ne)/2+"px"},k.value.indicators={width:parseFloat(Ne)/2-Ot*2+"px",height:parseFloat(pi)*2/3-Ot*2+"px",top:parseFloat(pi)/3+"px",left:parseFloat(Ne)/2+"px"}}else{let pi=50;(Ie=v.unref(Tt))!=null&&Ie.length?pi=v.unref($).clientHeight:tt&&(U.value=!0,v.unref(ie).height=pi+"px");let Ne=0,ur=1;const jt=n.getRowHeight(0),se={columnHeaderTitle:!0};if(Pt!=null&&Pt.length?ur+=Pt.length:se.columns=[{dimensionKey:Es(6),title:"",width:"100px",type:"columns"}],pt!=null&&pt.length?pt.forEach((Ze,Ge)=>{Ne+=n.getColWidth(Ge)}):(Ne=100,se.rows=[{dimensionKey:Es(6),title:"",width:"100px",type:"rows"}]),Kt!=null&&Kt.length||(se.indicators=[{indicatorKey:Es(6),title:"",width:"20%",format:()=>""}]),(ci=Object.keys(se))!=null&&ci.length){const{rows:Ze=[],columns:Ge=[]}=se;let ze=[];It!=null&&It.length?ze=Ye.cloneDeep(It):(Ho=(Po=v.unref(O))==null?void 0:Po.records)!=null&&Ho.length&&(ze=Ye.cloneDeep((xn=v.unref(O))==null?void 0:xn.records));let Fi=Pt.map(Rn=>Rn.dimensionKey);if(!(Fi!=null&&Fi.length)&&(Ge!=null&&Ge.length)&&(Fi=[Ge[0].dimensionKey]),ze!=null&&ze.length)for(const Rn of ze){for(const Zh of Ze)Rn[Zh.dimensionKey]="";let qh=!1;for(const Zh in Rn)if(Fi.includes(Zh)){qh=!0;break}tt?qh||(ur=2,Rn[Fi[0]]=""):Z&&(qh||(ur=1))}n.updateOption({...J,...se,records:ze})}v.nextTick(()=>{var Fi;const Ze=Xl(),Ge=Ze.width,ze=Ze.height;k.value.main={width:Ge+"px",height:ze+pi+"px",top:kt+v.unref(Lt)+"px",left:Ft+v.unref(be)+v.unref(Lt)+v.unref(j)+"px"},k.value.rows={width:Ne-Ot*2+"px",height:ze-Ot*2+"px",top:pi+"px",left:0},k.value.columns={width:Ge-Ne-Ot*2+"px",height:ur*jt-Ot*2+"px",top:pi+"px",left:Ne+"px"},k.value.indicators={width:Ge-Ne-Ot*2+"px",height:ze-ur*jt-Ot*2+"px",top:ur*jt+((Fi=v.unref(Tt))!=null&&Fi.length?pi:0)+"px",left:Ne+"px"},k.value.filters={width:Ge-Ot*2+"px",height:pi-Ot*2+"px",top:0,left:0}})}I.value=q,Z?gf.value=[0,1]:tt&&(gf.value=[2])},zY=()=>{var V;(V=v.unref(O).records)!=null&&V.length?n.updateOption({...J,records:v.unref(O).records}):n.updateOption(J),U.value=!1,v.unref(ie).height="",gf.value=[]},WY=()=>{var V;(V=v.unref(RB))==null||V.handleSearch(v.unref(xB))},AB=v.computed(()=>({defaultSortRule:r.value,dimensionData:s.value,currentClickCell:l.value,dimFilterData:a.value,indFilterData:h.value,filterData:d.value,indFilterConfig:c.value,topNumData:x.value,sortData:T.value,colSortData:M.value,indSortData:B.value,aggregateMap:P.value,subMenuLeft:F.value,subMenuTop:H.value,dragAreaStyle:k.value,showTreeData:L.value,largeVisible:D.value,temporaryData:O.value,splitSymbol:ot,sourceListStyle:ut.value,dimensionFieldList:Ht.value,indicatorFieldList:Et.value,computedIndKeys:Nt.value,computedIndMap:te.value,computedIndFieldMap:ae.value,option:J,loadingRect:Se.value,calculateList:qe.value,filterList:Kn.value,topNumMap:Vr.value,sortMap:Sn.value,customDimensions:ks.value,customIndicators:Ul.value,customRowKeys:Kl.value,customColKeys:Yl.value,cacheResData:Y.value,toolBoxStyle:jr.value,scrollTop:N.value,scrollLeft:W.value}));let fb=null;v.watch(AB,V=>{i.isIframeMode&&window.cacheTableData&&window.cacheTableData(V)},{deep:!0});function ln({type:V,data:K}){e("tableChange",{type:V,data:K}),!(!i.isAllowSaveConfig||["5"].includes(V))&&(fb&&clearTimeout(fb),fb=setTimeout(()=>{ab("save",{keyName:i.relateKeyName||i.keyName,data:v.unref(AB)})},500))}const pb=V=>{r.value=V.defaultSortRule,s.value=V.dimensionData,l.value=V.currentClickCell,a.value=V.dimFilterData,h.value=V.indFilterData,d.value=V.filterData,c.value=V.indFilterConfig,x.value=V.topNumData,T.value=V.sortData,M.value=V.colSortData,B.value=V.indSortData,P.value=V.aggregateMap,F.value=V.subMenuLeft,H.value=V.subMenuTop,k.value=V.dragAreaStyle,L.value=V.showTreeData,D.value=V.largeVisible,O.value=V.temporaryData,ot=V.splitSymbol,ut.value=V.sourceListStyle,Ht.value=V.dimensionFieldList,Et.value=V.indicatorFieldList,Nt.value=V.computedIndKeys,te.value=V.computedIndMap,ae.value=V.computedIndFieldMap,Se.value=V.loadingRect,qe.value=V.calculateList,Kn.value=V.filterList,Vr.value=V.topNumMap,Sn.value=V.sortMap,ks.value=V.customDimensions,Ul.value=V.customIndicators,Kl.value=V.customRowKeys,Yl.value=V.customColKeys,Y.value=V.cacheResData,jr.value=V.toolBoxStyle,N.value=V.scrollTop,W.value=V.scrollLeft,Object.assign(J,V.option),J.theme=Jt};async function NY(V){var K,q,rt;if(R.value=!0,V)pb(V);else if(i.isAllowSaveConfig){const Z=await ab("get",{keyName:i.relateKeyName||i.keyName}),tt=((q=(K=Z==null?void 0:Z.data)==null?void 0:K.data)==null?void 0:q.searchMap)||{};tt!=null&&tt.data&&!Array.isArray(tt.data)&&((rt=Object.keys(tt.data))!=null&&rt.length)&&pb(tt.data)}dr()}function VY(){return{dimensions:v.unref(Ht),indicators:v.unref(Et)}}const jY=V=>{const{scope:K,name:q,label:rt}=V;let Z=[];["IDX","BUILT_IN_IDX"].includes(K)?Z=v.unref(Et):["DIM","BUILT_IN_DIM"].includes(K)&&(Z=v.unref(Ht));const tt=Z.findIndex(it=>it.name===q);if(tt!==-1){delete v.unref(a)[Z[tt].label];const it=v.unref(Kn).findIndex(pt=>pt.key===rt);it!==-1&&v.unref(Kn).splice(it,1),Z[tt].show?Z[tt].isInnerFilter=!1:Z.splice(tt,1)}R.value=!0,Xh(),ln({type:"10",data:{dimensions:v.unref(Ht),indicators:v.unref(Et)}})},$Y=V=>{const{scope:K,label:q,showTitle:rt}=V,Z=Y2(K);Z==="indicator"||Z==="dimension"&&_B({dimensionKey:q,value:rt})};t({option:J,refreshData:NY,reRenderTable:pb,click:wB,getDrawRange:Xl,getSaveData:VY}),v.watch(()=>[i.graphicConfig,i.dimensionList,i.indicatorList],()=>{TB()},{immediate:!0,deep:!0});function TB(){const{queryColumnList:V=[],indicators:K=[]}=i.graphicConfig,q=Ye.cloneDeep(V),rt=Ye.cloneDeep(K);for(const Z of q){const tt=i.dimensionList.find(it=>it.key===Z.name);Z.positionType=(tt==null?void 0:tt.position)||"rows",Z.width=tt==null?void 0:tt.width,Z.showTitle=Z.title||Z.label}for(const Z of rt){const tt=i.indicatorList.find(it=>it.key===Z.name);Z.width=tt==null?void 0:tt.width,Z.showTitle=Z.label}Ht.value=q,Et.value=rt}const GY=()=>{o.value=!1,L.value=!L.value},UY=()=>{o.value=!1,D.value=!D.value,window.enScale&&window.enScale(v.unref(D))},KY=V=>{const K=v.unref(Ht).find(tt=>tt.label===V),q=v.unref(Et).find(tt=>tt.label===V),rt=K||q,Z=v.unref(a)[V];return Z?rt.genericType==="DATE"?Array.isArray(Z)?`${Z[0].value}~${Z[1].value}`:Z.value:Z.value&&Array.isArray(Z.value)?Z.value.join("、"):"":""},YY=V=>V.parentNode;return v.onMounted(()=>{Zt()}),{showDefaultTableArea:_e,maskList:gf,styleData:mt,subMenuLeft:F,subMenuTop:H,pivotWrapRef:S,pivotTableRef:_,pivotFilterRef:u,pivotPropertyRef:g,conditionalPropertyRef:f,chartModalRef:C,pivotTopRef:m,pivotConfigRef:b,drillModalRef:y,pivotAggregateRef:p,filterData:d,loadingRect:Se,loading:R,isTableInit:o,toolBoxStyle:jr,indSourceRef:RB,searchText:xB,dragAreaStyle:k,offsetWidth:be,showTreeData:L,dataIconStyle:He,largeVisible:D,sourceListStyle:ut,defaultTableStyle:Oe,innerFilterStyle:ie,innerFilterFieldList:Tt,innerFilterRef:$,showFilterWrap:U,customDimensions:ks,indicatorFieldList:Et,dimensionFieldList:Ht,pivotWrapStyle:A,fontSize:ht,click:wB,onFilterChange:FY,pivotDetailRef:w,handleFormat:SB,handleCondition:IY,handleAggregate:mY,handleGetTop:DY,handleConfig:PY,handleClearFilter:HY,handleGetConfig:EY,onDragStart:OY,onDragEnd:zY,onSearch:WY,handleAddField:LY,toggleShowData:GY,handleEnScale:UY,adjustHSL:PC,handleDelFilterTag:jY,handleInnerFilter:$Y,getFilterValue:KY,getPopupContainer:YY}}}),XK={key:0,class:"design-template"},qK=["id"],ZK=["onClick"],JK=["title"],QK=["id"],tY={class:"box-tooltip"},eY={class:"box-tooltip"};function iY(i,t,e,n,o,r){var M,B;const s=v.resolveComponent("a-input-search"),l=v.resolveComponent("ind-source-list"),a=v.resolveComponent("filter-outlined"),h=v.resolveComponent("delete-outlined"),d=v.resolveComponent("a-tooltip"),u=v.resolveComponent("a-spin"),c=v.resolveComponent("database-outlined"),g=v.resolveComponent("shrink-outlined"),f=v.resolveComponent("arrows-alt-outlined"),p=v.resolveComponent("setting-outlined"),m=v.resolveComponent("clear-outlined"),b=v.resolveComponent("drag-area"),C=v.resolveComponent("pivot-filter"),_=v.resolveComponent("pivot-property"),w=v.resolveComponent("conditional-property"),y=v.resolveComponent("chart-modal"),S=v.resolveComponent("pivot-aggregate"),A=v.resolveComponent("pivot-top"),R=v.resolveComponent("pivot-detail"),x=v.resolveComponent("pivot-config"),T=v.resolveComponent("drill-modal");return i.pageMode==="design"?(v.openBlock(),v.createElementBlock("div",XK," 透视表格 ")):(v.openBlock(),v.createBlock(v.Teleport,{key:1,to:i.enlargeContainer,disabled:!i.largeVisible},[v.createElementVNode("div",{class:v.normalizeClass(["pivot-wrap",[i.largeVisible?"large":"",i.theme]]),style:v.normalizeStyle(i.pivotWrapStyle),id:`pivotWrap_${i.id}`,ref:"pivotWrapRef"},[i.fullMode?v.withDirectives((v.openBlock(),v.createElementBlock("div",{key:0,class:"data-source-list",style:v.normalizeStyle(i.sourceListStyle)},[v.createVNode(s,{value:i.searchText,"onUpdate:value":t[0]||(t[0]=P=>i.searchText=P),placeholder:"请输入关键字",onSearch:i.onSearch},null,8,["value","onSearch"]),v.createVNode(l,{ref:"indSourceRef",hasChildren:!0,isSub:!1,onOnDragStart:i.onDragStart,onOnDragEnd:i.onDragEnd,config:i.graphicConfig},null,8,["onOnDragStart","onOnDragEnd","config"])],4)),[[v.vShow,i.showTreeData]]):v.createCommentVNode("",!0),v.createElementVNode("div",{style:v.normalizeStyle({width:i.offsetWidth?`calc(100% - ${i.offsetWidth}px)`:"100%"})},[i.isTableInit&&(!i.showDefaultTableArea&&((M=i.innerFilterFieldList)!=null&&M.length)||i.showFilterWrap)?(v.openBlock(),v.createElementBlock("div",{key:0,class:"inner-filter-wrap",style:v.normalizeStyle(i.innerFilterStyle),ref:"innerFilterRef"},[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.innerFilterFieldList,P=>(v.openBlock(),v.createElementBlock("div",{key:P.name,class:"filter-tag",style:v.normalizeStyle({backgroundColor:i.adjustHSL(i.styleData.headerBgColor,-4)}),onClick:F=>i.handleInnerFilter(P)},[v.createElementVNode("div",{class:"tag-text",style:v.normalizeStyle({color:i.styleData.headerColor})},v.toDisplayString(P.showTitle),5),i.getFilterValue(P.label)?(v.openBlock(),v.createElementBlock("div",{key:0,class:"filter-value",style:v.normalizeStyle({color:i.adjustHSL(i.styleData.headerColor,8)}),title:i.getFilterValue(P.label)},v.toDisplayString(i.getFilterValue(P.label)),13,JK)):v.createCommentVNode("",!0),v.createElementVNode("span",{class:v.normalizeClass(i.fullMode?"hover-icon-wrap":"")},[v.createVNode(a,{class:"filter-icon",style:v.normalizeStyle({fontSize:i.fontSize+"px",color:i.styleData.headerColor})},null,8,["style"]),v.createVNode(d,{placement:"bottom"},{title:v.withCtx(()=>t[5]||(t[5]=[v.createElementVNode("span",null,"删除",-1)])),default:v.withCtx(()=>[v.createVNode(h,{class:"delete-icon",style:v.normalizeStyle({fontSize:i.fontSize+"px",color:i.styleData.headerColor}),onClick:v.withModifiers(F=>i.handleDelFilterTag(P),["stop"])},null,8,["style","onClick"])]),_:2},1024)],2)],12,ZK))),128))],4)):v.createCommentVNode("",!0),i.isTableInit&&i.showDefaultTableArea?(v.openBlock(),v.createElementBlock("div",{key:1,class:"empty-table",style:v.normalizeStyle(i.defaultTableStyle)}," 拖拽左侧数据源到此处 ",4)):v.createCommentVNode("",!0),v.withDirectives(v.createElementVNode("div",{class:"table-instance",style:{width:"100%"},id:i.pageMode!=="design"?`pivotTableContainer_${i.id}`:"",ref:"pivotTableRef"},null,8,QK),[[v.vShow,!i.showDefaultTableArea]])],4),i.loading?(v.openBlock(),v.createElementBlock("div",{key:1,class:"pivot-loading",style:v.normalizeStyle(i.loadingRect)},[v.createVNode(u,{size:"large",style:v.normalizeStyle({scale:i.scaleValue.widthScale})},null,8,["style"])],4)):v.createCommentVNode("",!0),i.pageMode!=="design"&&!i.graphicConfig.preview&&i.isTableInit&&!i.maskList.length&&!i.showDefaultTableArea?(v.openBlock(),v.createElementBlock("div",{key:2,class:"tool-box",style:v.normalizeStyle(i.toolBoxStyle)},[i.fullMode?(v.openBlock(),v.createBlock(d,{key:0,getPopupContainer:i.getPopupContainer},{title:v.withCtx(()=>[v.createElementVNode("span",tY,v.toDisplayString(i.showTreeData?"隐藏数据源":"显示数据源"),1)]),default:v.withCtx(()=>[v.createElementVNode("div",{class:v.normalizeClass(["box-item pivot-data",i.theme]),onClick:t[1]||(t[1]=(...P)=>i.toggleShowData&&i.toggleShowData(...P))},[v.createVNode(c,{style:v.normalizeStyle(i.dataIconStyle)},null,8,["style"])],2)]),_:1},8,["getPopupContainer"])):v.createCommentVNode("",!0),v.createVNode(d,{getPopupContainer:i.getPopupContainer},{title:v.withCtx(()=>[v.createElementVNode("span",eY,v.toDisplayString(i.largeVisible?"缩小":"放大"),1)]),default:v.withCtx(()=>[i.showFullScreen?(v.openBlock(),v.createElementBlock("div",{key:0,class:v.normalizeClass(["box-item pivot-large",i.theme]),onClick:t[2]||(t[2]=(...P)=>i.handleEnScale&&i.handleEnScale(...P))},[i.largeVisible?(v.openBlock(),v.createBlock(g,{key:0,style:v.normalizeStyle({fontSize:i.fontSize+"px",color:"#416EFF"})},null,8,["style"])):(v.openBlock(),v.createBlock(f,{key:1,style:v.normalizeStyle({fontSize:i.fontSize+"px"})},null,8,["style"]))],2)):v.createCommentVNode("",!0)]),_:1},8,["getPopupContainer"]),v.createVNode(d,{getPopupContainer:i.getPopupContainer},{title:v.withCtx(()=>t[6]||(t[6]=[v.createElementVNode("span",{class:"box-tooltip"},"设置",-1)])),default:v.withCtx(()=>[v.createElementVNode("div",{class:v.normalizeClass(["box-item pivot-config",i.theme]),onClick:t[3]||(t[3]=(...P)=>i.handleConfig&&i.handleConfig(...P))},[v.createVNode(p,{style:v.normalizeStyle({fontSize:i.fontSize+"px"})},null,8,["style"])],2)]),_:1},8,["getPopupContainer"]),v.createVNode(d,{getPopupContainer:i.getPopupContainer},{title:v.withCtx(()=>t[7]||(t[7]=[v.createElementVNode("span",{class:"box-tooltip"},"清空状态",-1)])),default:v.withCtx(()=>[i.showClear?(v.openBlock(),v.createElementBlock("div",{key:0,class:v.normalizeClass(["box-item pivot-config",i.theme]),onClick:t[4]||(t[4]=(...P)=>i.handleClearFilter&&i.handleClearFilter(...P))},[v.createVNode(m,{style:v.normalizeStyle({fontSize:i.fontSize+"px"})},null,8,["style"])],2)):v.createCommentVNode("",!0)]),_:1},8,["getPopupContainer"])],4)):v.createCommentVNode("",!0),(B=i.maskList)!=null&&B.length?(v.openBlock(),v.createBlock(b,{key:3,style:v.normalizeStyle(i.dragAreaStyle),maskList:i.maskList,onAdd:i.handleAddField},null,8,["style","maskList","onAdd"])):v.createCommentVNode("",!0)],14,qK),v.createVNode(C,{ref:"pivotFilterRef",data:i.filterData,customDimensions:i.customDimensions,dimensions:i.dimensionFieldList,indicators:i.indicatorFieldList,onChange:i.onFilterChange},null,8,["data","customDimensions","dimensions","indicators","onChange"]),v.createVNode(_,{ref:"pivotPropertyRef",onChange:i.handleFormat},null,8,["onChange"]),v.createVNode(w,{ref:"conditionalPropertyRef",onChange:i.handleCondition},null,8,["onChange"]),v.createVNode(y,{ref:"chartModalRef"},null,512),v.createVNode(S,{ref:"pivotAggregateRef",onConfirm:i.handleAggregate},null,8,["onConfirm"]),v.createVNode(A,{ref:"pivotTopRef",onConfirm:i.handleGetTop},null,8,["onConfirm"]),v.createVNode(R,{ref:"pivotDetailRef"},null,512),v.createVNode(x,{ref:"pivotConfigRef",fullMode:i.fullMode,onConfirm:i.handleGetConfig},null,8,["fullMode","onConfirm"]),v.createVNode(T,{ref:"drillModalRef",scaleValue:i.scaleValue,isIframeMode:i.isIframeMode},null,8,["scaleValue","isIframeMode"])],8,["to","disabled"]))}const lb=kB(Ti(YK,[["render",iY],["__scopeId","data-v-6c4da1ce"]])),dB=Object.freeze(Object.defineProperty({__proto__:null,EcanPivotTable:lb},Symbol.toStringTag,{value:"Module"})),nY={install:(i,t)=>{const{request:e}=t;i.provide("$request",e),Object.keys(dB).forEach(n=>{const o=dB[n];o.install&&i.use(o)})}},VX="",jX="",oY=v.defineComponent({name:"DrillModal",props:{scaleValue:{type:Object,default:()=>({widthScale:1,heightScale:1})},isIframeMode:{type:Boolean,default:!1}},components:{BorderOutlined:Bj,SwitcherOutlined:V$,CloseOutlined:Gj,EcanPivotTable:lb},setup(i,{expose:t}){const e={IN:"属于",NOT_IN:"不属于",LIKE:"包含",NOT_LIKE:"不包含","LIKE%":"开头是","%LIKE":"结尾是",EQUAL:"等于",LESS:"小于",LESS_EQUAL:"小于等于",GREATER:"大于",GREATER_EQUAL:"大于等于",NOT_EQUAL:"不等于"},n=.37,o=.6,r=.97,s=.9,l=`dmodal_${Es(6)}`,a=()=>document.querySelector("#ProviderConfig > #container")||document.body,h=v.inject("theme","light"),d=v.ref({}),u=v.ref([]),c=v.inject("indicatorUrl",""),g=v.ref([]),f=v.ref(!1),p=v.ref({}),m=v.reactive({keyName:"",visible:!1,columns:[],title:""}),b=v.ref([]),C=v.ref(),_=v.computed(()=>{let B=`drill-modal ${l}`;return f.value&&(B+=" full"),v.unref(h)&&(B+=` ${v.unref(h)}`),B}),w=B=>{const P=document.querySelector(`.${l} .ant-modal-header`);if(P)if(B)P.addEventListener("mousedown",S);else{const F=P.parentElement;F&&(F.style.left="",F.style.top=""),P.removeEventListener("mousedown",S)}},y=B=>{const P=document.querySelector(`.${l} .ant-modal-header`);P&&(B?P.addEventListener("dblclick",A):P.removeEventListener("dblclick",A))},S=B=>{X2(B,`.${l} .ant-modal-header`)},A=()=>{f.value=!f.value,v.nextTick(()=>{f.value?(v.unref(p).width=parseFloat(v.unref(d).width)*r+"px",v.unref(p).height=(i.isIframeMode?parseFloat(v.unref(d).height):window.screen.height)*s+"px",w(!1)):(v.unref(p).width=parseFloat(v.unref(d).width)*n+"px",v.unref(p).height=(i.isIframeMode?parseFloat(v.unref(d).height):window.screen.height)*o+"px",w(!0))})},R=()=>{f.value=!1,y(!1),w(!1)},x=({drillDimension:B,drillFieldData:P,usedDimensionFields:F,tableProps:H,splitSymbol:E})=>{const k=Ye.cloneDeep(H),{graphicConfig:I,allDimensions:L,pageConfig:D}=k,O=Es(6),N=[];b.value=[...F,B.label],L.value=L,D.value=D;const W=I.indicators.filter($=>$.show).map($=>$.label);W!=null&&W.length&&(m.title=`下钻:${W.join("、")}`);for(const $ of P){const U=L.find(G=>[G.title,G.label].includes($.dimensionKey)),Y=$.value.split(E);let j=$.value;Y!=null&&Y.length&&(j=Y[Y.length-1]),N.push({conditionKey:U.label,conditionLabel:U.title||U.label,conditionName:U.name,conditionValueType:U.genericType,indexCode:U.indexCode,typeGuid:U.typeGuid,indexCodeNum:U.indexCodeNum,rule:"EQUAL",dataType:"",customValue:j})}I.queryColumnList=[B],N!=null&&N.length&&(I.controlList||(I.controlList=[]),I.controlList.push(...N),I.controlList=[{join:"&&",conditions:I.controlList}]),p.value={...k,id:O,keyName:`透视表_${O}`,position:"relative",top:0,left:0,width:parseFloat(v.unref(D).width)*n+"px",height:(i.isIframeMode?parseFloat(v.unref(D).height):window.screen.height)*o+"px",graphicConfig:I},m.visible=!0,v.nextTick(()=>{v.unref(C).refreshData(),y(!0),w(!0)})},T=({type:B,data:P})=>{if(B==="11"&&P){const{indicatorList:F=[],queryColumns:H=[]}=P,k=F.concat(H).filter(D=>D.conditions||D.filter),I=M(k,"conditions",!0),L=M(P.sqlConditions,"sqlConditions",!1);g.value=I.concat(L).map(D=>{const O=v.unref(u).find(W=>W.label===D.label);let N=D.fieldValue;if(N&&typeof N=="string"){const W=N.split(",");(W==null?void 0:W.length)>3&&(N=W.slice(0,3).join(",")+"等")}else N||(N='""');return`${(O==null?void 0:O.title)||D.label} ${e[D.rule]} ${N}`})||[]}};function M(B,P,F){const H=[];for(const E of B)E[P]?H.push(...M(E[P],P,F)):E.filter?H.push({...E.filter,label:E.label}):(!F||E.dataType!=="component"&&!(E.fieldValue.startsWith("${")&&E.fieldValue.endsWith("}")))&&H.push(E);return H}return v.watch(m.visible,B=>{window.modalShow&&window.modalShow(B)}),t({showModal:x}),{theme:h,wrapClassName:_,conditionInfo:g,drillInfo:m,pivotTableConfig:p,indicatorUrl:c,isIndFullScreen:f,usedDimensionFields:b,pivotTableRef:C,toggleFullScreen:A,onDetailCancel:R,onPivotTableChange:T,getContainer:a}}}),rY=["title"];function sY(i,t,e,n,o,r){const s=v.resolveComponent("close-outlined"),l=v.resolveComponent("switcher-outlined"),a=v.resolveComponent("border-outlined"),h=v.resolveComponent("ecan-pivot-table"),d=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(d,{"wrap-class-name":i.wrapClassName,visible:i.drillInfo.visible,"onUpdate:visible":t[1]||(t[1]=u=>i.drillInfo.visible=u),width:"60%",footer:null,maskClosable:!1,destroyOnClose:!0,getContainer:i.getContainer,onCancel:i.onDetailCancel},{title:v.withCtx(()=>[v.createElementVNode("div",{class:"modal-title",title:i.conditionInfo.join("、")},v.toDisplayString(i.drillInfo.title)+" "+v.toDisplayString(i.conditionInfo.join("、")),9,rY)]),closeIcon:v.withCtx(()=>[v.createVNode(s,{class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"])]),default:v.withCtx(()=>[v.createElementVNode("div",{class:"zoom-btn",onClick:t[0]||(t[0]=(...u)=>i.toggleFullScreen&&i.toggleFullScreen(...u))},[i.isIndFullScreen?(v.openBlock(),v.createBlock(l,{key:0,class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"])):(v.openBlock(),v.createBlock(a,{key:1,class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"]))]),i.drillInfo.visible?(v.openBlock(),v.createElementBlock("div",{key:0,style:v.normalizeStyle({position:"relative",width:i.pivotTableConfig.width,height:i.pivotTableConfig.height})},[v.createVNode(h,v.mergeProps({ref:"pivotTableRef"},i.pivotTableConfig,{theme:i.theme,fullMode:!1,allowDrill:!0,showFullScreen:!1,showClear:!1,isAllowSaveConfig:!1,indicatorUrl:i.indicatorUrl,relateKeyName:i.drillInfo.keyName,usedDimensionFields:i.usedDimensionFields,scaleValue:i.scaleValue,onTableChange:i.onPivotTableChange}),null,16,["theme","indicatorUrl","relateKeyName","usedDimensionFields","scaleValue","onTableChange"])],4)):v.createCommentVNode("",!0)]),_:1},8,["wrap-class-name","visible","getContainer","onCancel"])}const lY=Object.freeze(Object.defineProperty({__proto__:null,default:Ti(oY,[["render",sY],["__scopeId","data-v-412e66d4"]])},Symbol.toStringTag,{value:"Module"}));Je.EcanPivotTable=lb,Je.default=nY,Object.defineProperties(Je,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
373
+ }`;return Function(`"use strict";return (${q})`)().call(this,K)}function DY(V){R.value=!0;const{value:K,key:q}=V;v.unref(x)[q]=K,gY(),ln({type:"6",data:{key:q,value:K}})}function Xl(){return n==null?void 0:n.getDrawRange()}const gf=v.ref([]),xB=v.ref(""),RB=v.ref(),OY=(V,K)=>{var Ie,ci,Po,Ho,xn;const q=K.dataViewColumns[V.oldIndex]||{},{scope:rt}=q;let Z=!1,tt=!1;["IDX","BUILT_IN_IDX"].includes(rt)?Z=!0:["DIM","BUILT_IN_DIM"].includes(rt)&&(tt=!0);const it=Xl(),{rows:pt,columns:Pt,indicators:Kt,records:It}=J,{top:kt,left:Ft}=it;if(v.unref(_e)){let pi=i.height;i.isIframeMode&&(pi=document.body.clientHeight+"px");let Ne=v.unref(Oe).width;Ne.includes("calc")&&(Ne=v.unref(yt)-v.unref(E)+"px"),k.value.main={width:Ne,height:pi,top:kt+v.unref(Lt)+"px",left:Ft+v.unref(be)+v.unref(Lt)+v.unref(j)+"px"},k.value.rows={width:parseFloat(Ne)/2-Ot*2+"px",height:parseFloat(pi)-Ot*2+"px",top:0,left:0},k.value.columns={width:parseFloat(Ne)/2-Ot*2+"px",height:parseFloat(pi)/3-Ot*2+"px",top:0,left:parseFloat(Ne)/2+"px"},k.value.indicators={width:parseFloat(Ne)/2-Ot*2+"px",height:parseFloat(pi)*2/3-Ot*2+"px",top:parseFloat(pi)/3+"px",left:parseFloat(Ne)/2+"px"}}else{let pi=50;(Ie=v.unref(Tt))!=null&&Ie.length?pi=v.unref($).clientHeight:tt&&(U.value=!0,v.unref(ie).height=pi+"px");let Ne=0,ur=1;const jt=n.getRowHeight(0),se={columnHeaderTitle:!0};if(Pt!=null&&Pt.length?ur+=Pt.length:se.columns=[{dimensionKey:Es(6),title:"",width:"100px",type:"columns"}],pt!=null&&pt.length?pt.forEach((Ze,Ge)=>{Ne+=n.getColWidth(Ge)}):(Ne=100,se.rows=[{dimensionKey:Es(6),title:"",width:"100px",type:"rows"}]),Kt!=null&&Kt.length||(se.indicators=[{indicatorKey:Es(6),title:"",width:"20%",format:()=>""}]),(ci=Object.keys(se))!=null&&ci.length){const{rows:Ze=[],columns:Ge=[]}=se;let ze=[];It!=null&&It.length?ze=Ye.cloneDeep(It):(Ho=(Po=v.unref(O))==null?void 0:Po.records)!=null&&Ho.length&&(ze=Ye.cloneDeep((xn=v.unref(O))==null?void 0:xn.records));let Fi=Pt.map(Rn=>Rn.dimensionKey);if(!(Fi!=null&&Fi.length)&&(Ge!=null&&Ge.length)&&(Fi=[Ge[0].dimensionKey]),ze!=null&&ze.length)for(const Rn of ze){for(const Zh of Ze)Rn[Zh.dimensionKey]="";let qh=!1;for(const Zh in Rn)if(Fi.includes(Zh)){qh=!0;break}tt?qh||(ur=2,Rn[Fi[0]]=""):Z&&(qh||(ur=1))}n.updateOption({...J,...se,records:ze})}v.nextTick(()=>{var Fi;const Ze=Xl(),Ge=Ze.width,ze=Ze.height;k.value.main={width:Ge+"px",height:ze+pi+"px",top:kt+v.unref(Lt)+"px",left:Ft+v.unref(be)+v.unref(Lt)+v.unref(j)+"px"},k.value.rows={width:Ne-Ot*2+"px",height:ze-Ot*2+"px",top:pi+"px",left:0},k.value.columns={width:Ge-Ne-Ot*2+"px",height:ur*jt-Ot*2+"px",top:pi+"px",left:Ne+"px"},k.value.indicators={width:Ge-Ne-Ot*2+"px",height:ze-ur*jt-Ot*2+"px",top:ur*jt+((Fi=v.unref(Tt))!=null&&Fi.length?pi:0)+"px",left:Ne+"px"},k.value.filters={width:Ge-Ot*2+"px",height:pi-Ot*2+"px",top:0,left:0}})}I.value=q,Z?gf.value=[0,1]:tt&&(gf.value=[2])},zY=()=>{var V;(V=v.unref(O).records)!=null&&V.length?n.updateOption({...J,records:v.unref(O).records}):n.updateOption(J),U.value=!1,v.unref(ie).height="",gf.value=[]},WY=()=>{var V;(V=v.unref(RB))==null||V.handleSearch(v.unref(xB))},AB=v.computed(()=>({defaultSortRule:r.value,dimensionData:s.value,currentClickCell:l.value,dimFilterData:a.value,indFilterData:h.value,filterData:d.value,indFilterConfig:c.value,topNumData:x.value,sortData:T.value,colSortData:M.value,indSortData:B.value,aggregateMap:P.value,subMenuLeft:F.value,subMenuTop:H.value,dragAreaStyle:k.value,showTreeData:L.value,largeVisible:D.value,temporaryData:O.value,splitSymbol:ot,sourceListStyle:ut.value,dimensionFieldList:Ht.value,indicatorFieldList:Et.value,computedIndKeys:Nt.value,computedIndMap:te.value,computedIndFieldMap:ae.value,option:J,loadingRect:Se.value,calculateList:qe.value,filterList:Kn.value,topNumMap:Vr.value,sortMap:Sn.value,customDimensions:ks.value,customIndicators:Ul.value,customRowKeys:Kl.value,customColKeys:Yl.value,cacheResData:Y.value,toolBoxStyle:jr.value,scrollTop:N.value,scrollLeft:W.value}));let fb=null;v.watch(AB,V=>{i.isIframeMode&&window.cacheTableData&&window.cacheTableData(V)},{deep:!0});function ln({type:V,data:K}){e("tableChange",{type:V,data:K}),!(!i.isAllowSaveConfig||["5"].includes(V))&&(fb&&clearTimeout(fb),fb=setTimeout(()=>{ab("save",{keyName:i.relateKeyName||i.keyName,data:v.unref(AB)})},500))}const pb=V=>{r.value=V.defaultSortRule,s.value=V.dimensionData,l.value=V.currentClickCell,a.value=V.dimFilterData,h.value=V.indFilterData,d.value=V.filterData,c.value=V.indFilterConfig,x.value=V.topNumData,T.value=V.sortData,M.value=V.colSortData,B.value=V.indSortData,P.value=V.aggregateMap,F.value=V.subMenuLeft,H.value=V.subMenuTop,k.value=V.dragAreaStyle,L.value=V.showTreeData,D.value=V.largeVisible,O.value=V.temporaryData,ot=V.splitSymbol,ut.value=V.sourceListStyle,Ht.value=V.dimensionFieldList,Et.value=V.indicatorFieldList,Nt.value=V.computedIndKeys,te.value=V.computedIndMap,ae.value=V.computedIndFieldMap,Se.value=V.loadingRect,qe.value=V.calculateList,Kn.value=V.filterList,Vr.value=V.topNumMap,Sn.value=V.sortMap,ks.value=V.customDimensions,Ul.value=V.customIndicators,Kl.value=V.customRowKeys,Yl.value=V.customColKeys,Y.value=V.cacheResData,jr.value=V.toolBoxStyle,N.value=V.scrollTop,W.value=V.scrollLeft,Object.assign(J,V.option),J.theme=Jt};async function NY(V){var K,q,rt;if(R.value=!0,V)pb(V);else if(i.isAllowSaveConfig){const Z=await ab("get",{keyName:i.relateKeyName||i.keyName}),tt=((q=(K=Z==null?void 0:Z.data)==null?void 0:K.data)==null?void 0:q.searchMap)||{};tt!=null&&tt.data&&!Array.isArray(tt.data)&&((rt=Object.keys(tt.data))!=null&&rt.length)&&pb(tt.data)}dr()}function VY(){return{dimensions:v.unref(Ht),indicators:v.unref(Et)}}const jY=V=>{const{scope:K,name:q,label:rt}=V;let Z=[];["IDX","BUILT_IN_IDX"].includes(K)?Z=v.unref(Et):["DIM","BUILT_IN_DIM"].includes(K)&&(Z=v.unref(Ht));const tt=Z.findIndex(it=>it.name===q);if(tt!==-1){delete v.unref(a)[Z[tt].label];const it=v.unref(Kn).findIndex(pt=>pt.key===rt);it!==-1&&v.unref(Kn).splice(it,1),Z[tt].show?Z[tt].isInnerFilter=!1:Z.splice(tt,1)}R.value=!0,Xh(),ln({type:"10",data:{dimensions:v.unref(Ht),indicators:v.unref(Et)}})},$Y=V=>{const{scope:K,label:q,showTitle:rt}=V,Z=Y2(K);Z==="indicator"||Z==="dimension"&&_B({dimensionKey:q,value:rt})};t({option:J,refreshData:NY,reRenderTable:pb,click:wB,getDrawRange:Xl,getSaveData:VY}),v.watch(()=>[i.graphicConfig,i.dimensionList,i.indicatorList],()=>{TB()},{immediate:!0,deep:!0});function TB(){const{queryColumnList:V=[],indicators:K=[]}=i.graphicConfig,q=Ye.cloneDeep(V),rt=Ye.cloneDeep(K);for(const Z of q){const tt=i.dimensionList.find(it=>it.key===Z.name);Z.positionType=(tt==null?void 0:tt.position)||"rows",Z.width=tt==null?void 0:tt.width,Z.showTitle=Z.title||Z.label}for(const Z of rt){const tt=i.indicatorList.find(it=>it.key===Z.name);Z.width=tt==null?void 0:tt.width,Z.showTitle=Z.label}Ht.value=q,Et.value=rt}const GY=()=>{o.value=!1,L.value=!L.value},UY=()=>{o.value=!1,D.value=!D.value,window.enScale&&window.enScale(v.unref(D))},KY=V=>{const K=v.unref(Ht).find(tt=>tt.label===V),q=v.unref(Et).find(tt=>tt.label===V),rt=K||q,Z=v.unref(a)[V];return Z?rt.genericType==="DATE"?Array.isArray(Z)?`${Z[0].value}~${Z[1].value}`:Z.value:Z.value&&Array.isArray(Z.value)?Z.value.join("、"):"":""},YY=V=>V.parentNode;return v.onMounted(()=>{Zt()}),{showDefaultTableArea:_e,maskList:gf,styleData:mt,subMenuLeft:F,subMenuTop:H,pivotWrapRef:S,pivotTableRef:_,pivotFilterRef:u,pivotPropertyRef:g,conditionalPropertyRef:f,chartModalRef:C,pivotTopRef:m,pivotConfigRef:b,drillModalRef:y,pivotAggregateRef:p,filterData:d,loadingRect:Se,loading:R,isTableInit:o,toolBoxStyle:jr,indSourceRef:RB,searchText:xB,dragAreaStyle:k,offsetWidth:be,showTreeData:L,dataIconStyle:He,largeVisible:D,sourceListStyle:ut,defaultTableStyle:Oe,innerFilterStyle:ie,innerFilterFieldList:Tt,innerFilterRef:$,showFilterWrap:U,customDimensions:ks,indicatorFieldList:Et,dimensionFieldList:Ht,pivotWrapStyle:A,fontSize:ht,click:wB,onFilterChange:FY,pivotDetailRef:w,handleFormat:SB,handleCondition:IY,handleAggregate:mY,handleGetTop:DY,handleConfig:PY,handleClearFilter:HY,handleGetConfig:EY,onDragStart:OY,onDragEnd:zY,onSearch:WY,handleAddField:LY,toggleShowData:GY,handleEnScale:UY,adjustHSL:PC,handleDelFilterTag:jY,handleInnerFilter:$Y,getFilterValue:KY,getPopupContainer:YY}}}),XK={key:0,class:"design-template"},qK=["id"],ZK=["onClick"],JK=["title"],QK=["id"],tY={class:"box-tooltip"},eY={class:"box-tooltip"};function iY(i,t,e,n,o,r){var M,B;const s=v.resolveComponent("a-input-search"),l=v.resolveComponent("ind-source-list"),a=v.resolveComponent("filter-outlined"),h=v.resolveComponent("delete-outlined"),d=v.resolveComponent("a-tooltip"),u=v.resolveComponent("a-spin"),c=v.resolveComponent("database-outlined"),g=v.resolveComponent("shrink-outlined"),f=v.resolveComponent("arrows-alt-outlined"),p=v.resolveComponent("setting-outlined"),m=v.resolveComponent("clear-outlined"),b=v.resolveComponent("drag-area"),C=v.resolveComponent("pivot-filter"),_=v.resolveComponent("pivot-property"),w=v.resolveComponent("conditional-property"),y=v.resolveComponent("chart-modal"),S=v.resolveComponent("pivot-aggregate"),A=v.resolveComponent("pivot-top"),R=v.resolveComponent("pivot-detail"),x=v.resolveComponent("pivot-config"),T=v.resolveComponent("drill-modal");return i.pageMode==="design"?(v.openBlock(),v.createElementBlock("div",XK," 透视表格 ")):(v.openBlock(),v.createBlock(v.Teleport,{key:1,to:i.enlargeContainer,disabled:!i.largeVisible},[v.createElementVNode("div",{class:v.normalizeClass(["pivot-wrap",[i.largeVisible?"large":"",i.theme]]),style:v.normalizeStyle(i.pivotWrapStyle),id:`pivotWrap_${i.id}`,ref:"pivotWrapRef"},[i.fullMode?v.withDirectives((v.openBlock(),v.createElementBlock("div",{key:0,class:"data-source-list",style:v.normalizeStyle(i.sourceListStyle)},[v.createVNode(s,{value:i.searchText,"onUpdate:value":t[0]||(t[0]=P=>i.searchText=P),placeholder:"请输入关键字",onSearch:i.onSearch},null,8,["value","onSearch"]),v.createVNode(l,{ref:"indSourceRef",hasChildren:!0,isSub:!1,onOnDragStart:i.onDragStart,onOnDragEnd:i.onDragEnd,config:i.graphicConfig},null,8,["onOnDragStart","onOnDragEnd","config"])],4)),[[v.vShow,i.showTreeData]]):v.createCommentVNode("",!0),v.createElementVNode("div",{style:v.normalizeStyle({width:i.offsetWidth?`calc(100% - ${i.offsetWidth}px)`:"100%"})},[i.isTableInit&&(!i.showDefaultTableArea&&((M=i.innerFilterFieldList)!=null&&M.length)||i.showFilterWrap)?(v.openBlock(),v.createElementBlock("div",{key:0,class:"inner-filter-wrap",style:v.normalizeStyle(i.innerFilterStyle),ref:"innerFilterRef"},[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.innerFilterFieldList,P=>(v.openBlock(),v.createElementBlock("div",{key:P.name,class:"filter-tag",style:v.normalizeStyle({backgroundColor:i.adjustHSL(i.styleData.headerBgColor,-4)}),onClick:F=>i.handleInnerFilter(P)},[v.createElementVNode("div",{class:"tag-text",style:v.normalizeStyle({color:i.styleData.headerColor})},v.toDisplayString(P.showTitle),5),i.getFilterValue(P.label)?(v.openBlock(),v.createElementBlock("div",{key:0,class:"filter-value",style:v.normalizeStyle({color:i.adjustHSL(i.styleData.headerColor,8)}),title:i.getFilterValue(P.label)},v.toDisplayString(i.getFilterValue(P.label)),13,JK)):v.createCommentVNode("",!0),v.createElementVNode("span",{class:v.normalizeClass(i.fullMode?"hover-icon-wrap":"")},[v.createVNode(a,{class:"filter-icon",style:v.normalizeStyle({fontSize:i.fontSize+"px",color:i.styleData.headerColor})},null,8,["style"]),v.createVNode(d,{placement:"bottom"},{title:v.withCtx(()=>t[5]||(t[5]=[v.createElementVNode("span",null,"删除",-1)])),default:v.withCtx(()=>[v.createVNode(h,{class:"delete-icon",style:v.normalizeStyle({fontSize:i.fontSize+"px",color:i.styleData.headerColor}),onClick:v.withModifiers(F=>i.handleDelFilterTag(P),["stop"])},null,8,["style","onClick"])]),_:2},1024)],2)],12,ZK))),128))],4)):v.createCommentVNode("",!0),i.isTableInit&&i.showDefaultTableArea?(v.openBlock(),v.createElementBlock("div",{key:1,class:"empty-table",style:v.normalizeStyle(i.defaultTableStyle)}," 拖拽左侧数据源到此处 ",4)):v.createCommentVNode("",!0),v.withDirectives(v.createElementVNode("div",{class:"table-instance",style:{width:"100%"},id:i.pageMode!=="design"?`pivotTableContainer_${i.id}`:"",ref:"pivotTableRef"},null,8,QK),[[v.vShow,!i.showDefaultTableArea]])],4),i.loading?(v.openBlock(),v.createElementBlock("div",{key:1,class:"pivot-loading",style:v.normalizeStyle(i.loadingRect)},[v.createVNode(u,{size:"large",style:v.normalizeStyle({scale:i.scaleValue.widthScale})},null,8,["style"])],4)):v.createCommentVNode("",!0),i.pageMode!=="design"&&!i.graphicConfig.preview&&i.isTableInit&&!i.maskList.length&&!i.showDefaultTableArea?(v.openBlock(),v.createElementBlock("div",{key:2,class:"tool-box",style:v.normalizeStyle(i.toolBoxStyle)},[i.fullMode?(v.openBlock(),v.createBlock(d,{key:0,getPopupContainer:i.getPopupContainer},{title:v.withCtx(()=>[v.createElementVNode("span",tY,v.toDisplayString(i.showTreeData?"隐藏数据源":"显示数据源"),1)]),default:v.withCtx(()=>[v.createElementVNode("div",{class:v.normalizeClass(["box-item pivot-data",i.theme]),onClick:t[1]||(t[1]=(...P)=>i.toggleShowData&&i.toggleShowData(...P))},[v.createVNode(c,{style:v.normalizeStyle(i.dataIconStyle)},null,8,["style"])],2)]),_:1},8,["getPopupContainer"])):v.createCommentVNode("",!0),v.createVNode(d,{getPopupContainer:i.getPopupContainer},{title:v.withCtx(()=>[v.createElementVNode("span",eY,v.toDisplayString(i.largeVisible?"缩小":"放大"),1)]),default:v.withCtx(()=>[i.showFullScreen?(v.openBlock(),v.createElementBlock("div",{key:0,class:v.normalizeClass(["box-item pivot-large",i.theme]),onClick:t[2]||(t[2]=(...P)=>i.handleEnScale&&i.handleEnScale(...P))},[i.largeVisible?(v.openBlock(),v.createBlock(g,{key:0,style:v.normalizeStyle({fontSize:i.fontSize+"px",color:"#416EFF"})},null,8,["style"])):(v.openBlock(),v.createBlock(f,{key:1,style:v.normalizeStyle({fontSize:i.fontSize+"px"})},null,8,["style"]))],2)):v.createCommentVNode("",!0)]),_:1},8,["getPopupContainer"]),v.createVNode(d,{getPopupContainer:i.getPopupContainer},{title:v.withCtx(()=>t[6]||(t[6]=[v.createElementVNode("span",{class:"box-tooltip"},"设置",-1)])),default:v.withCtx(()=>[v.createElementVNode("div",{class:v.normalizeClass(["box-item pivot-config",i.theme]),onClick:t[3]||(t[3]=(...P)=>i.handleConfig&&i.handleConfig(...P))},[v.createVNode(p,{style:v.normalizeStyle({fontSize:i.fontSize+"px"})},null,8,["style"])],2)]),_:1},8,["getPopupContainer"]),v.createVNode(d,{getPopupContainer:i.getPopupContainer},{title:v.withCtx(()=>t[7]||(t[7]=[v.createElementVNode("span",{class:"box-tooltip"},"清空状态",-1)])),default:v.withCtx(()=>[i.showClear?(v.openBlock(),v.createElementBlock("div",{key:0,class:v.normalizeClass(["box-item pivot-config",i.theme]),onClick:t[4]||(t[4]=(...P)=>i.handleClearFilter&&i.handleClearFilter(...P))},[v.createVNode(m,{style:v.normalizeStyle({fontSize:i.fontSize+"px"})},null,8,["style"])],2)):v.createCommentVNode("",!0)]),_:1},8,["getPopupContainer"])],4)):v.createCommentVNode("",!0),(B=i.maskList)!=null&&B.length?(v.openBlock(),v.createBlock(b,{key:3,style:v.normalizeStyle(i.dragAreaStyle),maskList:i.maskList,onAdd:i.handleAddField},null,8,["style","maskList","onAdd"])):v.createCommentVNode("",!0)],14,qK),v.createVNode(C,{ref:"pivotFilterRef",data:i.filterData,customDimensions:i.customDimensions,dimensions:i.dimensionFieldList,indicators:i.indicatorFieldList,onChange:i.onFilterChange},null,8,["data","customDimensions","dimensions","indicators","onChange"]),v.createVNode(_,{ref:"pivotPropertyRef",onChange:i.handleFormat},null,8,["onChange"]),v.createVNode(w,{ref:"conditionalPropertyRef",onChange:i.handleCondition},null,8,["onChange"]),v.createVNode(y,{ref:"chartModalRef"},null,512),v.createVNode(S,{ref:"pivotAggregateRef",onConfirm:i.handleAggregate},null,8,["onConfirm"]),v.createVNode(A,{ref:"pivotTopRef",onConfirm:i.handleGetTop},null,8,["onConfirm"]),v.createVNode(R,{ref:"pivotDetailRef"},null,512),v.createVNode(x,{ref:"pivotConfigRef",fullMode:i.fullMode,onConfirm:i.handleGetConfig},null,8,["fullMode","onConfirm"]),v.createVNode(T,{ref:"drillModalRef",scaleValue:i.scaleValue,isIframeMode:i.isIframeMode},null,8,["scaleValue","isIframeMode"])],8,["to","disabled"]))}const lb=kB(Ti(YK,[["render",iY],["__scopeId","data-v-3ce09276"]])),dB=Object.freeze(Object.defineProperty({__proto__:null,EcanPivotTable:lb},Symbol.toStringTag,{value:"Module"})),nY={install:(i,t)=>{const{request:e}=t;i.provide("$request",e),Object.keys(dB).forEach(n=>{const o=dB[n];o.install&&i.use(o)})}},VX="",jX="",oY=v.defineComponent({name:"DrillModal",props:{scaleValue:{type:Object,default:()=>({widthScale:1,heightScale:1})},isIframeMode:{type:Boolean,default:!1}},components:{BorderOutlined:Bj,SwitcherOutlined:V$,CloseOutlined:Gj,EcanPivotTable:lb},setup(i,{expose:t}){const e={IN:"属于",NOT_IN:"不属于",LIKE:"包含",NOT_LIKE:"不包含","LIKE%":"开头是","%LIKE":"结尾是",EQUAL:"等于",LESS:"小于",LESS_EQUAL:"小于等于",GREATER:"大于",GREATER_EQUAL:"大于等于",NOT_EQUAL:"不等于"},n=.37,o=.6,r=.97,s=.9,l=`dmodal_${Es(6)}`,a=()=>document.querySelector("#ProviderConfig > #container")||document.body,h=v.inject("theme","light"),d=v.ref({}),u=v.ref([]),c=v.inject("indicatorUrl",""),g=v.ref([]),f=v.ref(!1),p=v.ref({}),m=v.reactive({keyName:"",visible:!1,columns:[],title:""}),b=v.ref([]),C=v.ref(),_=v.computed(()=>{let B=`drill-modal ${l}`;return f.value&&(B+=" full"),v.unref(h)&&(B+=` ${v.unref(h)}`),B}),w=B=>{const P=document.querySelector(`.${l} .ant-modal-header`);if(P)if(B)P.addEventListener("mousedown",S);else{const F=P.parentElement;F&&(F.style.left="",F.style.top=""),P.removeEventListener("mousedown",S)}},y=B=>{const P=document.querySelector(`.${l} .ant-modal-header`);P&&(B?P.addEventListener("dblclick",A):P.removeEventListener("dblclick",A))},S=B=>{X2(B,`.${l} .ant-modal-header`)},A=()=>{f.value=!f.value,v.nextTick(()=>{f.value?(v.unref(p).width=parseFloat(v.unref(d).width)*r+"px",v.unref(p).height=(i.isIframeMode?parseFloat(v.unref(d).height):window.screen.height)*s+"px",w(!1)):(v.unref(p).width=parseFloat(v.unref(d).width)*n+"px",v.unref(p).height=(i.isIframeMode?parseFloat(v.unref(d).height):window.screen.height)*o+"px",w(!0))})},R=()=>{f.value=!1,y(!1),w(!1)},x=({drillDimension:B,drillFieldData:P,usedDimensionFields:F,tableProps:H,splitSymbol:E})=>{const k=Ye.cloneDeep(H),{graphicConfig:I,allDimensions:L,pageConfig:D}=k,O=Es(6),N=[];b.value=[...F,B.label],L.value=L,D.value=D;const W=I.indicators.filter($=>$.show).map($=>$.label);W!=null&&W.length&&(m.title=`下钻:${W.join("、")}`);for(const $ of P){const U=L.find(G=>[G.title,G.label].includes($.dimensionKey)),Y=$.value.split(E);let j=$.value;Y!=null&&Y.length&&(j=Y[Y.length-1]),N.push({conditionKey:U.label,conditionLabel:U.title||U.label,conditionName:U.name,conditionValueType:U.genericType,indexCode:U.indexCode,typeGuid:U.typeGuid,indexCodeNum:U.indexCodeNum,rule:"EQUAL",dataType:"",customValue:j})}I.queryColumnList=[B],N!=null&&N.length&&(I.controlList||(I.controlList=[]),I.controlList.push(...N),I.controlList=[{join:"&&",conditions:I.controlList}]),p.value={...k,id:O,keyName:`透视表_${O}`,position:"relative",top:0,left:0,width:parseFloat(v.unref(D).width)*n+"px",height:(i.isIframeMode?parseFloat(v.unref(D).height):window.screen.height)*o+"px",graphicConfig:I},m.visible=!0,v.nextTick(()=>{v.unref(C).refreshData(),y(!0),w(!0)})},T=({type:B,data:P})=>{if(B==="11"&&P){const{indicatorList:F=[],queryColumns:H=[]}=P,k=F.concat(H).filter(D=>D.conditions||D.filter),I=M(k,"conditions",!0),L=M(P.sqlConditions,"sqlConditions",!1);g.value=I.concat(L).map(D=>{const O=v.unref(u).find(W=>W.label===D.label);let N=D.fieldValue;if(N&&typeof N=="string"){const W=N.split(",");(W==null?void 0:W.length)>3&&(N=W.slice(0,3).join(",")+"等")}else N||(N='""');return`${(O==null?void 0:O.title)||D.label} ${e[D.rule]} ${N}`})||[]}};function M(B,P,F){const H=[];for(const E of B)E[P]?H.push(...M(E[P],P,F)):E.filter?H.push({...E.filter,label:E.label}):(!F||E.dataType!=="component"&&!(E.fieldValue.startsWith("${")&&E.fieldValue.endsWith("}")))&&H.push(E);return H}return v.watch(m.visible,B=>{window.modalShow&&window.modalShow(B)}),t({showModal:x}),{theme:h,wrapClassName:_,conditionInfo:g,drillInfo:m,pivotTableConfig:p,indicatorUrl:c,isIndFullScreen:f,usedDimensionFields:b,pivotTableRef:C,toggleFullScreen:A,onDetailCancel:R,onPivotTableChange:T,getContainer:a}}}),rY=["title"];function sY(i,t,e,n,o,r){const s=v.resolveComponent("close-outlined"),l=v.resolveComponent("switcher-outlined"),a=v.resolveComponent("border-outlined"),h=v.resolveComponent("ecan-pivot-table"),d=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(d,{"wrap-class-name":i.wrapClassName,visible:i.drillInfo.visible,"onUpdate:visible":t[1]||(t[1]=u=>i.drillInfo.visible=u),width:"60%",footer:null,maskClosable:!1,destroyOnClose:!0,getContainer:i.getContainer,onCancel:i.onDetailCancel},{title:v.withCtx(()=>[v.createElementVNode("div",{class:"modal-title",title:i.conditionInfo.join("、")},v.toDisplayString(i.drillInfo.title)+" "+v.toDisplayString(i.conditionInfo.join("、")),9,rY)]),closeIcon:v.withCtx(()=>[v.createVNode(s,{class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"])]),default:v.withCtx(()=>[v.createElementVNode("div",{class:"zoom-btn",onClick:t[0]||(t[0]=(...u)=>i.toggleFullScreen&&i.toggleFullScreen(...u))},[i.isIndFullScreen?(v.openBlock(),v.createBlock(l,{key:0,class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"])):(v.openBlock(),v.createBlock(a,{key:1,class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"]))]),i.drillInfo.visible?(v.openBlock(),v.createElementBlock("div",{key:0,style:v.normalizeStyle({position:"relative",width:i.pivotTableConfig.width,height:i.pivotTableConfig.height})},[v.createVNode(h,v.mergeProps({ref:"pivotTableRef"},i.pivotTableConfig,{theme:i.theme,fullMode:!1,allowDrill:!0,showFullScreen:!1,showClear:!1,isAllowSaveConfig:!1,indicatorUrl:i.indicatorUrl,relateKeyName:i.drillInfo.keyName,usedDimensionFields:i.usedDimensionFields,scaleValue:i.scaleValue,onTableChange:i.onPivotTableChange}),null,16,["theme","indicatorUrl","relateKeyName","usedDimensionFields","scaleValue","onTableChange"])],4)):v.createCommentVNode("",!0)]),_:1},8,["wrap-class-name","visible","getContainer","onCancel"])}const lY=Object.freeze(Object.defineProperty({__proto__:null,default:Ti(oY,[["render",sY],["__scopeId","data-v-412e66d4"]])},Symbol.toStringTag,{value:"Module"}));Je.EcanPivotTable=lb,Je.default=nY,Object.defineProperties(Je,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
374
374
  //# sourceMappingURL=index.umd.js.map