/* @license Copyright (C) Exontrol. All rights reserved. */ !function(t,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports):"function"==typeof define&&define.amd?define(["exports"],o):(t="undefined"!=typeof globalThis?globalThis:t||self,o(t.exontrol||{}))}(this,function(t){"use strict";function o(t){return null!=t}function i(t){return null==t}function e(t,o,e){return i(t)?~~e:u.s2F(t,o)}function n(t){return t instanceof u.Pivot}function r(t){return t instanceof u.Tree.TV.PivotBar}function s(t){return t instanceof u.Pivot.CAr}function a(t){return u.Graph&&t instanceof u.Graph}function h(t,o){var i=new u.Lay.Container(t,o);return i.local=!0,i}function c(t,o){var i,e,n=(t=C(t)).lastIndexOf(":");if(n>=0){var r=t.substr(n+1).trim().toLowerCase();e="a"==r?1:"d"==r?2:0,t=t.substr(0,n)}return(i=o.Item(t))&&{c:i,s:e||0}}var u=u||window.exontrol,l=u.G,p="filter",f="exclude",v="content",g="conditional",d=",",C=u.ToS,y=Math.max,P=Math.min,w=u.Tree.TV.prototype,m=1;u.Mrg(u,function(){function t(t){this.init(t)}function n(t){t.oCV=this,this.init(t)}function r(t,o){this.init(t,o)}return t.prototype.init=function(t){function o(t){var o="";return t.oAgg?o="C"+i.c.indexOf(t.oAgg.b):(o="R",function(t){return t instanceof u.Tree.Column}(t.oCS)&&(o+=t.oCS.GetIndex())),o}var i=t.getL(),e=!i.isEmpty(),n=[];e&&(n=t.getLC().vc.rgE),this.data=e&&t.Export({items:"only(visible,!locked,sortable,leaf)"})||[],this.cat=e&&t.oTV.prC2()||0,this.col=n.map(function(t){return t.getCaption()}),this.i=this.data.length,this.s=y(n.length-this.cat),this.stk=n.map(function(t){return o(t)})},n.prototype.getType=function(){return"customView"},n.prototype.init=function(t){this.oTV=t,this.oO=u.Cpy(r.CustomViewOptions),this.oTV.export(this),this.import(this.oTV.oT)},n.prototype.import=function(t){t=t||this.oT,["bU","eU","CC","run","src","visP"].forEach(function(o){this[o]=t[o].bind(t)},this)},n.prototype.getVisibleRect=function(){return this.visP().oCV.GetClientRect()},n.prototype.resDV=function(){this.oDV=null},n.prototype.gDV=function(){return this.oDV||(this.oDV=new t(this.run()))},n.prototype.zoom=function(t){var o=this.getObject();o&&function(t){return t instanceof Function}(o.SetZoom)&&o.SetZoom(t)},n.prototype.update=function(){this.resDV(),this.getVisible()&&function(){var t=this.getObject(),o=a(t);return o&&(u.EyR(this.getVisibleRect())?t.Update:t.Smooth).call(t,function(){t.Reset(),!this.run().getL().isEmpty()&&this.onUGrph()},this),o}.call(this)},n.prototype.onIGrph=function(){var t=this.getObject();t.SetOptions(u.Apy(t.GetOptions(),{multiColorSerie:!1,valueSize:32,cursor:{visible:!0},misc:{}}))},n.prototype.onUGrph=function(){function t(){var t=o.oGV.back("seriesColors");return(function(t){return t instanceof Array}(t)?t:C(t).splitP(",")).length}var o=this.getObject(),i=this.gDV(),e=function(t){var o=0,i=new Map;return t.forEach(function(t){i.set(t,(i.get(t)||0)+1)}),i.forEach(function(t){o=y(o,t)}),o}(i.stk)<=t(),n=[],r=[];if(i.cat){for(s=i.cat-1;s>=0;s--)n.push({categories:s,format:"'' + value",split:!0,majorGridLines:s?null:{color:"rgb(240,240,240)"}});for(var s=0,a=i.cat,h=i.s;s1?t.apply(this,arguments):null}}(this.oR.oC.getTC),this.oTV.oCV=this.oCV=this.oR.oCV}r.lR--},r.prototype.onCol=function(){this.all().forEach(function(t){t.oPB.onPL(),t.oPCFB.resHVO()})},r.prototype.GetCanvas=function(){return this.oCW.GetCanvas()},r.prototype.CC=function(){return u.CC.c2CC(this.GetCanvas())},r.prototype.showP=function(t){var o,i=(t=t||this).oCW,e=this.CC();if(e){o=e.rgC;var n,r=i.CWs(),s=[],a=new u.Arr,c=this.all();if(o.forEach(function(t){~c.indexOf(t.oT)&&(t!=i&&s.push(t),t.CWs().forEach(function(t){a.push(t.ctx),u.EShow(t.canvas,r.has(t)),t._ctx=t.ctx,t.ctx=null}))}),a.forEach(function(t){t.gAO()&&t.gAO().clear()}),o.removeRange(s),o.add(i),n=s[0],r.forEach(function(t){u.EShow(t.canvas,!0),t.CWs().forEach(function(t){t.ctx=t._ctx||t.ctx,t._ctx=void 0})}),n&&(!function(t,o){var i=t.Column(0),e=o.Column(0);i&&e&&e.SetWidth(i.getWidth()),o.oPB.npW=t.oPB.npW,o.oPB.resHVO()}(n.oT,t),i.oPtr=n.oPtr),e.resize(),n){i.lHovWC();var l=h(null,"*hscroll *vscroll");l.bSv=!0,n.onlayout(l),l.bSv=!1,i.onlayout(l),i.uHovWC(!0)}}},r.prototype.visP=function(){var t=this.CC();return t&&this.all().forEachU(function(o){return t.rgC.has(o.oCW)&&o})||this},r.prototype.src=function(){return this.opR||this},r.prototype.run=function(){return this.oR||this},r.prototype.all=function(){return[this.src(),this.run()]},r.prototype.showD=function(t){var o=this.src(),i=this.run(),e=this.visP(),n=t?o:i;e!=n&&(e._scr=e.GetScrollPos(),o._bFPL=o._bFId,n.bU(),o.showP(n),o.setFI(t),n.SetScrollPos(n._scr),n.eU(),o._bFPL=!(o._bFId=!1))},r.prototype.showS=function(){this.showD(null)},r.prototype.ISOf=function(t,o){var i=t&&t.rgIS;if(i&&o){var e=[],n=o.length;i.forEach(function(t){(function(t){for(var i,e=!0,r=0;e&&r("+i+")"),i},r.prototype.addPT=function(t,o,i,e){var n,r=this.oTV;if(!t||r.isBT()){(n=(t?this.oI:this.LIOf(o)).Add({parent:t,value:this.capPC({t:i}),sortable:!1,selectable:!1})).oAgg=i;for(var s,a=this.oC.GetCount(),h=r.prC2();h=0&&function(){return a.GetCount()=0){var s=(i=i||new Map).get(r);!s&&i.set(r,s={}),s[t]=o}}},this)},this),i&&a.forEach(function(t){var e=i.get(t.getLevel());e&&(o.call(this,t,e,!1),o.call(this,t,e,!0))},this)}}.call(this))}this.format(!0),function(t){t.bSv=!1,this.onlayout(t)}.call(this,r),this.eU(),this.oLts.unlock()},r.prototype.format=function(t){function o(t){function o(o,e){if(o&&e){var n;e.forEach(function(e,s){s==i?(n=t.oFC&&t.oFC.get(e))&&o.SetFormat(n.expression):[t.oFA&&t.oFA.get(s),t.oFCA&&t.oFCA.get(s)].forEach(function(t){t&&r.Add({expression:t.expression||"1",applyTo:o.GetIndex(),shape:t.shape})})})}}function e(o,e){if(o&&e){var n,r,s;e.forEach(function(e,c){if(c==i){if(r=t.oFC&&t.oFC.get(e))for(var l=r.expression,p=h.prC2();p=0&&h=0},Object.addPrototypeOf(i.prototype,u.Arr.prototype),i.prototype.add=function(t){return function(o){var i=null;return!this.lA&&o instanceof u.Pivot.Layout&&(this.removeAt(this.iQ+1,this.len()-this.iQ),i=t.call(this,o.encPL()),this.iQ=this.len()-1),i}}(i.prototype.add),i.prototype.doQ=function(t){var i=this.at(this.iQ);return i&&(this.lA++,t.oPB.bL(),t.cwbU(),t.SetPivotRows(i.r),t.SetPivotColumns(i.c),t.SetPivotTotals(i.t),t.cweU(),t.oPB.eL(!1),this.lA--),o(i)},i.prototype.canUndo=function(){return this.len()&&this.iQ>0},i.prototype.undo=function(t){this.canUndo()&&(--this.iQ,this.doQ(t))},i.prototype.canRedo=function(){return this.iQ+1 0"}]},Object.addPrototypeOf(s.prototype,e.prototype),s.prototype.isValid=function(t){return function(o){return t.apply(this,arguments)&&u.Tree.CellF.Create(C(o.expression)).IsValid()}}(s.prototype.isValid),s.prototype.def=function(){return[{key:"numeric",expression:"len(value) ? (value format '') : ''"},{key:"currency",expression:"len(value) ? currency(value) :''"},{key:"date",expression:"date(dbl(value))"}]},a.prototype.adR=function(t){var o,i;return(t=C(t).trim())&&(i=c((o=u.B.split(t)[0]||{}).caption,this.oS.oC))&&(i.s=i.s||1,i.o=o.flags,(this.r=this.r||new u.Pivot.CAr).add(i)),i},a.prototype.adC=function(t){var o,i,e,n,r,s=this.oS.oPB.allowV(),h=this.oS.oC;if((t=t.trim())&&(o=t.splitP("/"),i=u.B.split(o[0])[0]||{},e=c(i.subText,h),(n=i.caption.trim())&&e)){if(e.a=n,e.o=i.flags,e.s=0,r=a.nwC(e),s)for(var l=1,p=o.length;l↻"}},t.apply(this,arguments)}}(i.prototype.init),i.prototype.isClkAble=function(){return this.oTV.isClkAble()},i.prototype.setTimeout=function(){return u.setTimeout.apply(this,arguments)},i.prototype.onsize=function(t){return function(){var o=this.resHVO;this.resHVO=function(){},t.apply(this,arguments),this.resHVO=o}}(i.prototype.onsize),i.prototype.onmIO=function(t){this.autoAddNew()&&(this.hmIO&&clearTimeout(this.hmIO),this.hmIO=this.setTimeout(function(){this.invHVO()},t?512:256))},i.prototype.isHov=function(){return this.oW==this.oW.oCW.oHovW},i.prototype.ondown=function(t){return function(o){if(o.altKey&&o.ctrlKey){var i=this.oTV.oT;return i.showP(i.oR||i.opR),!0}return t.apply(this,arguments)}}(i.prototype.ondown),i.prototype.showGlyphs=function(t){return function(){var o=t.apply(this,arguments);return o.e=!1,o}}(i.prototype.showGlyphs),i.prototype.onAObj=(i.prototype.onAObj,function(t,o){var i;o.t&&function(o){var e=this.toShapes(this.getType("total"));e&&(!u.EyO(e.hover)&&t.set({owner:this,id:o.idAOH||(o.idAOH={}),inv:this.inv,hitTest:function(t,e){return i?i==o:this.isAP(t,e)&&o==this.p2T([t,e])},duration:this.getSmooth()}),!u.EyO(e.click)&&t.set({owner:this,id:o.idAOC||(o.idAOC={}),inv:this.inv,hitTest:function(t,e){return i?i==o:this.isAP(t,e)&&o==this.p2T([t,e])},actOn:i==o?1:4,duration:this.getSmooth()}))}.call(this,o),o.n&&function(o){var e=this.toShapes(this.getType("addNew"));e&&(!u.EyO(e.hover)&&t.set({owner:this,id:o.idAOH||(o.idAOH={}),inv:this.inv,hitTest:function(t,e){return i?i==o:this.isAP(t,e)&&o==this.p2N([t,e])},duration:this.getSmooth()}),!u.EyO(e.click)&&t.set({owner:this,id:o.idAOC||(o.idAOC={}),inv:this.inv,hitTest:function(t,e){return i?i==o:this.isAP(t,e)&&o==this.p2N([t,e])},actOn:i==o?1:4,duration:this.getSmooth()}))}.call(this,o)}),i.prototype.getPad=function(){var t=this.oTV.getPad();return[2+t[0],2+t[1]]},i.prototype.alignBR=function(t,o){if(t&&t.length){o=o||this.dclient;var i=this.getPad(),e=i[0],n=i[1],r=u.ROf(o)-e,s=u.BOf(o)-n;t.forEach(function(t){t&&(r=(t[0]=r-t[2])-e,t[1]=s-t[3])})}},i.prototype.drawH=function(t){return function(o,i){function e(t){var o=n.get(t);o&&s.push(o)}var n=this.getHVO().lock,r=this.src().oPB,s=[];e(r.btnR),e(r.btnT),this.dclient=i,this.alignBR(s),t.apply(this,arguments),this.drawTGL(o,n.rgTL)}}(i.prototype.drawH),i.prototype.drawCH=function(t){return function(i,e,n,r){function s(o){var n=o.c;if(n){var s,a=n.isSort,h=n.getCaption,c=n.hasFilter;this.isSA()&&(s=function(){var t=this.getL().c;return t&&t.forEachU(function(t){return t.v.forEachU(function(t){return o==t})&&t})}.call(this))&&1==s.v.len()&&(s=null),n.getCaption=function(){var t=this.oC.oT.src(),i=t.capPC(o),e=t.capFO(o,!0);return i+=e&&i?" "+e:"",s&&(i+=" (+"+(s.v.len()-1)+")"),i},n.isSort=function(){return o.s},n.hasFilter=function(){return o.o&&o.o.has(p)},t.call(this,i,e,o,r),n.isSort=a,n.hasFilter=c,n.getCaption=h}return n}var a=this.isSA();(function(t){return t.t&&(this.drawT(i,e,t,r)||t.t)||null}).call(this,n)||function(t){var o=null;if(t.a&&(o=t.c)){var e,n=o.gCnt,h=this.showGlyphs,c=this.hasAG(t);c&&(o.gCnt=function(t,o){return(t=t.slice())[2]-=c.rtG[2],n.call(this,t,o)}),this.showGlyphs=function(){},a&&(e=o.oO.shape,o.oO.shape={}),s.call(this,t),a&&(o.oO.shape=e),c&&this.drawAG(i,c.rtG,c,r),this.showGlyphs=h,o.gCnt=n}return o}.call(this,n)||s.call(this,n)||function(t){var o=null;return t.tc&&(o=t.tc.c)&&i.drawHTMLText(this.oTV.oT.capPC(t),u.PRt(e.slice(),this.oTV.getPad(),-1),o.getFormatText()),o}.call(this,n)||function(t){return o(t.id)&&(this.drawID(i,e,t,r)||t)||null}.call(this,n)||function(t){return t.n&&(this.drawN(i,e,t,r)||t.n)||null}.call(this,n)||function(t){var o,n=C(t);if(o=n.sWith("h")){var r="h"==n,s=l.R2C(e,36);this.drawGL(i,l.R2C(e,33),s,r),r&&this.drawGL(i,s,[l.X(l.R2C(this.dclient,36)),l.Y(s)])}return o}.call(this,n)||function(t){var o,n,r,s=C(t);return(r=s.sWith("v"))&&(function(){var t;if(a&&(t=this.getL().c))return t.first().v.len()?s=="v"+(t.len()+1):s.sWith("v")&&s.length>1}.call(this)||(o="v"==s,n=l.R2C(e,18),this.drawGL(i,n,[l.X(n),l.Y(l.R2C(this.dclient,66))],o))),r}.call(this,n)||function(t){var o;return(o=C(t).sWith("rect"))&&this.dLCbk(i,function(){i.rect.apply(i,e)}),o}.call(this,n)||i.drawFrameRect(u.IRt(e.slice(),2,2))}}(i.prototype.drawCH),i.prototype.dLCbk=function(t,o,i){t.save(),t.beginPath(),this.oTV.pGL(t),o.call(i||this),t.stroke(),t.restore()},i.prototype.drawGL=function(t,o,i,e){this.dLCbk(t,function(){!this.isSA()&&e&&(t.strokeStyle="#000000",t.strokeStyle="rgba(0,0,0,0.5)",t.setLineDash([]),t.lineWidth+=.5),t.moveTo(l.X(o),l.Y(o)),t.lineTo(l.X(i),l.Y(i))})},i.prototype.drawTGL=function(t,o){function i(t,i){for(var e,n=i,r=o.len();i=t;i++)n=i;return n}var e=1;if(o&&o.len()>1)for(var n,r,s=this.oTV.getIndent(),a=0,h=o.len();a0){var c=o.at(a),u=o.at(r),p=l.R2C(c.rtL,33),f=l.R2C(u.rtL,33),v=P(l.X(p)+s*c.d,l.X(f)+s*u.d)-s/2,g=l.Y(p),d=l.Y(f);this.drawGL(t,[v,g],[v,d],!0),this.drawGL(t,[v,g],[v+s/3,g],!0),this.drawGL(t,[v,d],[v+s/3,d],!0)}e++}},i.prototype.drawT=function(t,o,i,e){if(i&&i.t){var n,r=this.t2Inf(i),s=this.oTV.getPad(),a=this.toShapes(r.s)||{},h=a.normal||a,c=r.e,l=this.oTV.oT.src(),p=l.capPC(i),f=l.capFO(i,!0);c?e&&(u.EyO(a.hover)||(n=e.get(this,i.idAOH))&&(h=u.R.Shape(n.state,n.range,{from:h,to:a.hover})),u.EyO(a.click)||(n=e.get(this,i.idAOC))&&(h=u.R.Shape(n.state,n.range,{from:h,to:a.click}))):u.EyO(a.disabled)||(h=u.Inh(a.disabled,h)),function(o,i,n){t.drawShape(o,h,{text:i,formatText:r.b?5:this.oTV.getFormatText(),padText:[-s[0],-s[1]],clientText:n?"[,,width-"+n.rtG[2]+s[1]+"]":null}),n&&this.drawAG(t,n.rtG,n,e)}.call(this,o,p+(f?" "+f:""),this.hasAG(i))}},i.prototype.drawN=function(t,o,i,e){function n(o){function i(t,o,i,e){var n=u.IRt(i.slice(),.2*-i[2],.2*-i[2]),r=t.lineWidth,s=function(t){if(t){var o=u.C.Convert(t);t=u.C.C2S(255-o.r,255-o.g,255-o.b,o.a)}return t}(this.fillColor)||"black";t.lineWidth=2,t.drawHLine([n[0],n[1]+n[3]/2],n[2],s),t.drawVLine([n[0]+n[2]/2,n[1]],n[3],s),t.lineWidth=r}var e=!a.text&&!a.draw;e&&(a.draw=i),t.drawShape(o,a),e&&(a.draw=null)}if(i&&i.n){var r,s=this.toShapes(this.getType("addNew"))||{},a=s.normal||s;this.isEnabled()?e&&(u.EyO(s.hover)||(r=e.get(this,i.idAOH))&&(a=u.R.Shape(r.state,r.range,{from:a,to:s.hover})),u.EyO(s.click)||(r=e.get(this,i.idAOC))&&(a=u.R.Shape(r.state,r.range,{from:a,to:s.click}))):u.EyO(s.disabled)||(a=u.Inh(s.disabled,a)),n.call(this,o)}},i.prototype.drawAG=function(t,o,i,e){if(o){var n=this.toShape(this.getType("aggregate"),!i.e)||{};t.drawShape(o,n,{text:C(n.text,"Σ")})}},i.prototype.drawID=function(t,o,i,e){if(o){var n=this.toShape(this.getType("idem"))||{};t.drawShape(o,n,{text:C(n.text,"”")})}},i.prototype.getCursor=function(t){return function(o){var i=t.apply(this,arguments);if(this.isClkAble()&&!i){var e,n=this.getCursors();(e=this.p2N(o))?i=u.GP.Get(this.getType("addNew"),n):((e=this.p2AG(o))&&e.e&&(i=u.GP.Get(this.getType("aggregate"),n)),!i&&(e=this.p2T(o))&&(i=u.GP.Get((this.t2Inf(e)||{}).s,n)))}return i||null}}(i.prototype.getCursor),i.prototype.p2CR=function(t){return this.isClkAble()&&this.allowCR()&&function(t){var o=this.p2Vl(t);return o&&{c:{o:this,i:~~o.substr(1),c:this.i2C(~~o.substr(1))instanceof u.Tree.Column,getWidth:function(){var t=this.o.gpWidth(this.i);if(!this.c)for(var o=1;o=s&&n<(s=u.ROf(o))&&(a=h);return a},i.prototype.rtPCxOf=function(t,o){var i,e=this.getL(),n=this.getHVO().lock,r=n.get("v"+(t||""));if(r){var s,a,h=this.oTV,c=this.getPad(),l=c[0],p=c[1],f=this.gpWidth(t),v=this.isSA(),g=v?0:h.getIndent(),d=h.getHeaderHeight(),C=[u.ROf(r)-f+l,p,f-2*l,d];switch(o){case"all":(i=C.slice())[3]=y(0,this.rtCA(this.GetClientRect())[3]-2*p);break;case"new":t?!v&&(s=e.c&&e.c.item(t-1))?(i=n.get(s.a),(a=n.get(s.v.last()))&&((i=u.ORt(a.slice(),g,d+p))[2]-=g)):i=u.ORt(C.slice(),0,(d+p)*(e.l.uC-1)):(a=e.r&&n.get(e.r.last()))?(i=u.ORt(a.slice(),g,d+p))[2]-=g:i=C.slice();break;case"agg":t&&(i=(s=e.c&&e.c.item(t-1))?n.get(s.a):u.ORt(C.slice(),0,(d+p)*(e.l.uC-1)))}}return i},i.prototype.p2TL=function(t,i){function e(t,i){function e(t){var o=r.at(t);return o&&o.o.t&&o}var n,s=r.len(),a=r.at(t),h=a&&a.d||0;if(s&&o(i)&&t>=0&&(!a||a.o.t)){if(t>=s-1)n={m:0,M:r.at(P(t,s)-1).d};else{var c=e(P(t,s)-1),u=e(P(t,s)+1),l=c||u,p=c&&u;l&&(n={m:P(p?c.d:h,p?u.d:l.d),M:y(p?c.d:h,p?u.d:l.d)})}n&&(h=y(P(y(0,~~i),n.M),n.m))}return h}var n=this.oTV.getIndent(),r=this.getTL(),s=n&&o(i)?~~(this.scaled(i-this.GetClientRect()[0])/n):void 0,a=this.getL().t?function(t){var o=this.ptCA(t),i=this.GetScroll(),e=l.Y(o)-i.y,n=-1;return r.forEachU(function(t){if(e>=u.TOf(t.rtL))return n=t.l,e>=u.BOf(t.rtL)&&n++,e=u.LOf(t)-n&&r1?i:0);return{width:n,height:n}}.call(this)),this.isAutoHide()&&!this.isHov()&&(t={width:0,height:0}),t},i.prototype.aSize=function(t){var o,i=u.CC.c2CC(this.GetCanvas());return i&&(t&&(i._aPBs=t),o=i._aPBs),o},i.prototype.onPL=function(){this.all().forEach(function(t){(function(){this.bU(),this.bdoL=!0,this.oL=null,this.resHVO(),this.eU()}).call(t.oPB)})},i.prototype.getL=function(){return this.oL||(this.oL=new u.Pivot.Layout(this.src(),this.gpLayout()))},i.prototype.doL=function(){if(this.bdoL){this.bdoL=!1;var t,o=this.src(),i=this.run();this.getL().isEmpty()?(o.setFI(),o.showP()):((t=i.oLF&&i.getL().cmpPO(i.oLF))&&!function(t){var o=this.oC.forEachU(function(o){return o.oAgg&&!t.has(o.oAgg.a)});if(!o)for(var i=[this.oI,this.oIT,this.oIB],e=0,n=i.length;!o&&e=0:!(o.tlx==v.tlx&&o.d==v.d))&&(r={a:p?"pivot-addtot":"pivot-postot",h:a,o:n,tlx:v.tlx,d:v.d,rtD:s.h2V(this,e(v.rtD))})}}else if(c)r={a:"pivot-delcol",h:a,o:o.o};else if(o.o&&o.o.a&&i.pcx>0&&o.pcx>0)o.pcx!=i.pcx&&(r={a:"pivot-pcxcol",h:a,o:o.o,pcx:o.pcx,tcx:i.pcx,rtD:s.h2V(this,e(this.rtPCxOf(i.pcx,"agg")))});else{var g,d,C,P,w=this.getL(),m=w.r,T=w.c,b=this.isSA(),O=i.pcx,S=1+(T&&T.len()||0),V=O<0||O==S;!b&&V?r={a:"pivot-aggcol",h:a,c:o.c,rtD:s.h2V(this,e(this.rtPCxOf(S,"new")))}:(O?V?(O=S,g=T.last().v):g=T.item(O-1).v:g=m,g?((C=O&&b&&o.o!=i.o||!g.has(o))||g.oHas(i.o)&&o.c!=i.c)&&(r={i:O,a:C?"pivot-addcol":"pivot-poscol",h:a,c:o.c},P=this.rtPCxOf(O,"new"),b&&O&&g.len()||(d=y(0,function(t,o){var i=-1;if(o)for(var e,n=this.ptCA(t),r=this.GetScroll(),s=l.Y(n)-r.y,a=this.getHVO().lock,h=0,c=o.len();h=u.TOf(e=a.get(o.item(h)));h++)i=h,s>u.BOf(e)&&i++;return i}.call(this,this.gPtr(t),g)),r.p=d,r.car=g,d=0)&&(c=i.car.item(l),i.car.setPos(c,i.p));break;case"pivot-addcol":i.car?(i.car.setPos(i.car.add({c:i.c}),i.p),n=e=!0):h&&(h.setPos(h.add(u.Pivot.Layout.nwC(h.first().a,{c:i.c})),i.i-1),n=e=!0);break;case"pivot-delcol":e=a.del(s);break;case"pivot-pcxcol":(e=!!h)&&(h.item(i.tcx-1)?h.setPos(h.item(i.pcx-1),i.tcx-1):h.add(u.Cpy(h.item(i.pcx-1))));break;case"pivot-deltot":var p=i.o.t,f=a.t2O(p);e=!(!f||!f.o.remove(p));break;case"pivot-addtot":case"pivot-postot":var p=i.o.t,v=(a.t2O(p)||{}).o,g=a.tlx2O(this.getTL(),i.tlx,i.d);(e=!!g)&&(g.o!=v&&(v&&v.remove(p),g.o.add(p)),g.o.setPos(p,g.p))}n&&o&&o.o&&(e=a.del(o.o)||e),this.eL(e)}},i.prototype.onRurScrollD=function(t){t.dx=0,t.dy=0},i.prototype.defSts=function(t){return function(o){t.apply(this,arguments),this.oTV.isDef()&&(o.Add("CTRL + Z",this.undo,this,"undoes the last action within the pivot rows, columns or totals"),o.Add("CTRL + Y",this.redo,this,"redoes the last undo action within the pivot rows, columns or totals"))}}(i.prototype.defSts),i.prototype.c2Vrt=function(t){var o=this.GetCanvas(),i=this.GetClientRect(),e=u.EArtC(o),n=u.CSSzom(o);return[e[0]+i[0]+t[0]/n,e[1]+i[1]+t[1]/n,t[2]/n,t[3]/n]},i.prototype.onlayout=function(t){if(!t.local){var i,e;t.IsSave()?(i=this.aSize())&&(t.Add("aw",i.width),t.Add("ah",i.height)):(o(e=t.GetValue("aw"))&&((i=i||{}).width=e),o(e=t.GetValue("ah"))&&((i=i||{}).height=e),i&&this.aSize(i))}},Object.addPrototypeOf(e.prototype,i.prototype),e.prototype.init=function(t){return function(){return["getL","bL","eL"].forEach(function(t){this[t]=this.oPB[t].bind(this.oPB)},this),t.apply(this,arguments)}}(e.prototype.init),e.prototype.getHVO=function(){var t=this.oPB.getHVO();return this.rgHVO&&t._bPRVO||(t._bPRVO=!0,this.rgHVO=function(){var o=u.Tree.VO(),i=this.oTV.getHeaderHeight()+2*this.getPad()[1]+m;return t.lock.forEach(function(t,e){o.lock.set(e,u.ORt(t.slice(),0,-i))}),o}.call(this)),this.rgHVO},e.prototype.gSize=function(){return{}},e.prototype.aSize=function(t){var o,i=u.CC.c2CC(this.GetCanvas());return i&&(t&&(i._aPRs=t),o=i._aPRs),o},e.prototype.onsize=function(t){return function(){this.oPB.resHVO(),t.apply(this,arguments)}}(u.Tree.TV.Header.prototype.onsize),{PivotFloatBar:t,PivotBar:i,PivotRowsBar:e}}()),w.init=function(t){return function(){t.apply(this,arguments),this.oPB=this.oT.oPB,this.oPR=this.oT.oPR,this.oPCFB=this.oT.oPCFB}}(w.init),w.defShp=function(t){return function(){return t.apply(this,arguments)+",Button(pivotBar-total,pivotBar-refresh,pivotBar-addNew,pivotBar-aggregate),Border(itemTot,itemSub)"}}(w.defShp),w.defCrs=function(t){return function(){return t.apply(this,arguments)+",pointer(pivotBar-total,pivotBar-refresh,pivotBar-addNew,pivotBar-aggregate)"}}(w.defCrs),w.SetReadOnly=function(t){return function(){return n(this.oT)&&this.oT.all().forEach(function(t){t.oPB.resHVO()}),t.apply(this,arguments)}}(w.SetReadOnly),w.wCH=function(t){return function(){return this._wCH||(this._wCH=function(){var o=t.apply(this,arguments);return o.push(this.oPB),o.push(this.oPR),o.push(this.oPCFB),o}.apply(this,arguments))}}(w.wCH),w.e2V=function(t){return function(o){return t.call(n(this.oT)?this.oT.visP().oTV:this,o)}}(w.e2V),w.wAO=function(t){return function(){return this._wAO||(this._wAO=function(){var o=t.apply(this,arguments);return o.push(this.oPB),o.push(this.oPCFB),o}.apply(this,arguments))}}(w.wAO),w.e2CH=function(t){return function(o){var i,e,n,s=t.apply(this,arguments);return s&&r(i=s.h)&&(e=i.gPtr(o),s.o=i.p2O(e),s.pcx=i.p2PCx(e),n=i.p2TL(e),s.tlx=n.tlx,s.d=n.d),s}}(w.e2CH),w.rurColDraw=function(t){return function(o,i,e){o&&r(o.h)?o.h.drawCH(i,e,o.o):t.apply(this,arguments)}}(w.rurColDraw),w.rurCol=function(t){return function(o){var i,e=t.apply(this,arguments);return o&&r(i=o.h)&&(!e&&o.o&&o.o.t?(o.rtC=this.h2V(i,i.getHVO().lock.get(o.o)),e=!0):e&&i.isSA()&&!o.pcx&&o.o&&o.o.a&&(e=!1)),e}}(w.rurCol),w.defSts=function(t){return function(o){t.apply(this,arguments),this.isDef()&&o.Add("Escape",this.oT.showS,this.oT,"shows the source-pivot")}}(w.defSts),w.onDblClk=function(t){return function(o){var i,e=this.oT;if(n(e))if(!this.getShowDataOnDblClick()||e==e.src()&&!e.oI.rgFI)i=t.apply(this,arguments);else{var r=this.e2IC(o);e.showD(e.ISOf(r&&r.oI||this.e2I(o),r&&r.oC.oAgg&&r.oC.oAgg.v)),i=!0}return i}}(w.onDblClk),w.e2IEC=function(t){return function(){return this.oI.rgFI?null:t.apply(this,arguments)}}(w.e2IEC),w.onChange=function(t){return function(o,i){var e=this.oT;return"change-cell"==o&&e==e.src()&&!e.getL().isEmpty()&&this.setTimeout(function(){var t=e.run(),o=t.showP;t.showP=function(){},e.oPB.onPL(),t.showP=o}),("drag-column"==o||"show-column"==o||"expand-column"==o)&&e.postViewChange(),t.apply(this,arguments)}}(w.onChange),w.drawI=function(t){return function(o,i,e,n,r){var s;e.oAgg&&(s=u.Tree.bSCTX(o,function(t){return this.toShape(t.oAgg.c?"itemSub":"itemTot",!t.isEnabled())}.call(this,e),i)),t.apply(this,arguments),s&&u.Tree.eSCTX(o,s)}}(w.drawI),w.getL=function(){return this.oPB.getL()},w.hasFilter=function(t){var o=0;return function(){var i=t.apply(this,arguments);return i||(0==o++&&(i=this.oPB&&this.getL().hF()||n(this.oT)&&this.oT.src().oTV.hasFilter()||0),--o),i}}(w.hasFilter),u.Tree.Options.pivotColumnsFloatBarVisible=null,w.GetPivotColumnsFloatBarVisible=function(){return this.oO.pivotColumnsFloatBarVisible},w.SetPivotColumnsFloatBarVisible=function(t){this.cwbU(),this.oO.pivotColumnsFloatBarVisible=t;var o=256&this.showPCFB()?0:4,i=this.oT.run();n(this.oT)&&this.oT.all().forEach(function(t){if(t){var e=t.oCW,n=e.W("control"),r=e.W("pivotfloatbar");r&&(o||t==i)&&e.Dock(r,n,o,r.oCW.w2R(r)),t.oPCFB.resHVO()}},this),this.cweU()},w.showPCFB=function(){return e(this.opt("pivotColumnsFloatBarVisible"),u.Tree.ColumnsFloatBarVisibleEnum,1)},u.Tree.Options.pivotBarVisible=null,w.GetPivotBarVisible=function(){return this.oO.pivotBarVisible},w.SetPivotBarVisible=function(t){var o=this.getPivotBarVisible();this.cwbU(),this.oO.pivotBarVisible=t;var i=this.getPivotBarVisible(),e=this.oT.run(),r=4&i?0:1;n(this.oT)&&this.oT.all().forEach(function(t){if(t){var o=t.oCW,i=o.W("control"),n=o.W("pivotbar");n&&(r||t==e)&&o.Dock(n,i,r,n.oCW.w2R(n)),t.oPB.resHVO(),o.onUI()}},this),(553648528&o)!=(553648528&i)&&this.oPB.onPL(),this.cweU()},w.getPivotBarVisible=function(){return e(this.opt("pivotBarVisible"),u.Pivot.PivotBarVisibleEnum,16781275)},u.Tree.Options.pivotRows=null,w.GetPivotRows=function(){return this.oO.pivotRows},w.SetPivotRows=function(t){this.cwbU(),this.oO.pivotRows=t,this.oPB.onPL(),this.cweU()},u.Tree.Options.pivotColumns=null,w.GetPivotColumns=function(){return this.oO.pivotColumns},w.SetPivotColumns=function(t){this.cwbU(),this.oO.pivotColumns=t,this.oPB.onPL(),this.cweU()},u.Tree.Options.pivotTotals=null,w.GetPivotTotals=function(){return this.oO.pivotTotals},w.SetPivotTotals=function(t){this.cwbU(),this.oO.pivotTotals=t,this.oPB.onPL(),this.cweU()},w.gpLayout=function(){return{r:C(this.GetPivotRows()).trim(),c:C(this.GetPivotColumns()).trim(),t:C(this.GetPivotTotals()).trim()}},w.isClkAble=function(){return this.isSelectable()&&(!this.oPB||!this.oPB.isReadOnly())},w.rurActionClick=function(t){return function(o,i){var e,n=this.e2V(i);if(this.isClkAble()&&r(n)){var s=n.gPtr(i);!e&&(e=n.p2N(s))&&this.onClickN(e,i),!e&&(e=n.p2AG(s))&&this.onClickAG(e,i),!e&&(e=n.p2R(s))&&this.onClickR(e,i),!e&&(e=n.p2PO(s))&&(this.onClickPO(e,i)||(e=null)),!e&&(e=n.hasAG(n.p2O(s)))&&this.onClickAG(e,i)}!e&&t.apply(this,arguments)}}(w.rurActionClick),w.norurAction=function(t){return function(o,i){var e=t.apply(this,arguments);return e||(e=n(this.oT)&&this.oT.visP()==this.oT.run()&&this.onClickPO(this.p2PO(this.gPtr(o)),o)),e}}(w.norurAction),w.onClickCF=function(t){return function(i,e,n){var s,a,h=!0,c=this,l=i.o;r(l)?(a=(s=l).p2O(this.gPtr(e)),(h=this.isClkAble()&&a&&a.c)&&((n=n||{}).f=a.o&&a.o.get(p)||null,n.e=a.o&&a.o.has(f)||!1,n.s=a.s||1,n.cbkF=function(t,i){void 0===t&&void 0===i||(s.bL(),a.o=a.o||new Map,t?a.o.set(f,null):a.o.delete(f),void 0!==i&&(o(i)?a.o.set(p,i):a.o.delete(p)),a.o.size||(a.o=null),s.eL())})):l instanceof u.Tree.TV.PivotFloatBar&&(c=this.oT.src().oTV),h&&t.call(c,i,e,n)}}(w.onClickCF),w.onClickC=function(t){return function(o,i){var e=this.e2V(i);if(e instanceof u.Tree.TV.PivotBar){if(this.isClkAble()){var n,r,s=e.p2O(e.gPtr(i));s&&s.c&&!s.a&&(n=e.getL(),e.bL(),r=n.r&&n.r.has(s),s.s=r?1+((s.s-1||0)+1)%2:((s.s||0)+1)%3,e.eL())}}else t.apply(this,arguments)}}(w.onClickC),w.rurColDrop=function(t){return function(o,i,e){var n=u.Tree.TV.PivotBar,r=e&&e.h instanceof n||i.h instanceof n,s=this.Smooth;r&&(this.Smooth=this.Smoothless),t.call(this,o,i,e),r&&(this.Smooth=s)}}(w.rurColDrop),w.onA=function(t){return function(o){t.apply(this,arguments),n(this.oT)&&u.H.VisitA((this.oT.opR||this.oT.oR).oTV,o)}}(w.onA),w.getCMA=function(t,o){var i=u.Tree.TV.cbkEsc(),e=this.oT.src().Aggregates,n="";for(var r in e)n&&(n+=d),n+=i(r)+"[id="+r+"][rad"+(t==r?"=1":"")+"][show=-1][grp=agg]",o&&(n+="[close=-1]");return n},w.getCMC=function(t,o,i){var e,n,r=u.Tree.TV.cbkEsc(),s=t instanceof u.Arr,a=this.oPCFB.cols(),h=this.oPB.reqSort(),c=i?"rad":"chk",l=i?"[close=-1]":"",p="";return o&&(n=this.oPCFB.cols(function(t){return 1==(15&t.getSortType())})).length&&(a=n),h&&(e=u.Cmp.S,2==h&&(e=u.Cmp.R(e)),a.sort(function(t,o){return e(t.pc(),o.pc())})),a.forEach(function(o){p&&(p+=d),p+=r(o.GetCaption())+"[id="+o.GetIndex()+"][grp=col]",s?p+=l+"[show=-1]["+c+"="+(t.has(o)?1:0)+"]":o==t&&(p+="[shapes=shitem.checked(item)]")}),p},w.runAG=function(t,o,i,e){t=t||this.oPB;var n,r=this,s=u.IRt(u.ORt(o.rtG.slice(),this.getPad()[0],0),0,(this.getHeaderHeight()-o.rtG[3])/2),a=0!=this.oPCFB.cols(function(t){return 1==(15&t.getSortType())}).length,h=t.c2Vrt(s);this.runCM({items:function(){var t,i="",e=o.a.a,n=this.getCMA(e,o.t);return!o.t&&(t=o.a.c)&&(i&&(i+=d),i+="Column[id=c-s](",i+=this.getCMC(t,this.oT.aggNumCol(e)),i+=")"),n&&(i&&(i+=",[sep],"),i+=n),i}.call(this),x:u.ROf(h),y:u.BOf(h),alignContextMenu:0,allowToggleRadio:!1,cbkS:function(t){if(a){var i=this.Item("c-s");i&&t.flags&&t.flags.has("rad")&&i.set(r.getCMC(o.a.c,r.oT.aggNumCol(t.id)))}n=t},cbkM:function(t){if(!t&&!this.esc){var o=this.forEachU(function(t){return t.getState()&&t.flags&&"agg"==t.flags.get("grp")&&t.caption||""}),r=n&&n.flags&&"col"==n.flags.get("grp")&&this.oR.oT.src().Column(n.id);i&&i.call(e||this,o,r)}}})},w.onClickAG=function(t,o){return this.runAG(this.e2V(o),t,function(o,i){var e,n=this.oPB,r=n.src().oPB.btnT==t.t;!r&&n.bL(),e=t.a.a!=o,t.a.a=o,i&&(e|=t.a.c!=i,t.a.c=i),!r&&n.eL(e),r&&e&&n.invAO()},this)},w.onClickN=function(t,o){function i(t){var o=function(t){var o=new u.Arr;return s(t)&&t.forEach(function(t){o.ann(t.c)}),o}.call(this,t),i={items:this.getCMC(o,null,this.oPB.isSA()&&!("row"==t.t||this.oPB.getL().r==t))};return i.cbkM=function(t){if(!t&&!this.esc){var o=!1,i=this.oR.n,e=this.oR.oT,n=this.oR.oT.oPB,r=e.src(),a=function(){var t=[];return this.forEachU(function(o){o.flags&&"col"==o.flags.get("grp")&&o.getState()&&t.push(o.id)}),t}.call(this),h=e.getL();if("row"==i.t&&(i=h.r=new u.Pivot.CAr),s(i)){n.bL(),a.length&&i._SAnwC&&h.c.add(i._SAnwC);var c=function(t,o){var i;return o.forEach(function(o){t.indexOf({c:r.Column(o)})<0&&(i=i||[]).push(o)}),i}.call(this,i,a),l=function(t,o){var i,e;return t.forEach(function(t){o.indexOf(i=t.c.GetIndex())<0&&(e=e||[]).push(i)}),e}.call(this,i,a);(o=!(!c&&!l))&&(c&&c.forEach(function(t){i.add({c:r.Column(t)})}),l&&l.forEach(function(t){i.remove({c:r.Column(t)})})),n.eL(o)}}},i}var e=this.e2V(o)||this.oPB,n=t.n,r=e.getHVO().lock.get(t),a=e.c2Vrt(r);n&&("value"==n.t?this.runAG(e,{a:{a:e.btnT.t.a,c:"new"},rtG:r},function(t,o){if(o){var i=this.oPB,e=this.oT.src(),n=e.GetPivotColumns()||"";n&&(n+=d),n+=t+"("+o.GetIndex()+")",i.bL(),e.SetPivotColumns(n),i.eL(!1)}},this):this.runCM(u.Mrg({n:n,x:u.ROf(a),y:u.BOf(a),alignContextMenu:0},i.call(this,n))))},w.onClickR=function(t,o){this.oT.src().oPB.doL()},w.p2PO=function(t){return this.HTl(t,function(){var o,i,e,n,r=this.p2ICHT(t),s=r&&r.c;return s&&(o=this.getL(),i=s.oC,(n=(e=s.oI).oAgg)||(i.oAgg?n=i.oAgg.a:o.r&&(this.isBT()?n=o.r.at(e.getLevel()):this.isBC()&&(n=o.r.at(i.GetIndex()))))),n})},w.onClickPO=function(t,i){function e(o){return t.o&&t.o.get(o)}function n(o,i){return t.o&&t.o.set(o,i)}function r(o){var i,e=o.mvF||o.mF;return t.o&&t.o.forEach(function(t,o){e.has(o)&&(i=i||new u.Arr).add(o)}),i}function s(o){var i=e(p),r=function(o){return t.o&&t.o.has(o)}(f);!P.oLF&&(P.oLF=P.getL()),c.oPB.bL(),t.o=new Map,C(o).split(m).forEach(function(t){if(t=t.trim()){var o=t.indexOf(T),i=(o<0?t:t.substr(0,o)).trim(),e=(o<0?"":t.substr(o+1)).trim()||null;i&&n(i,e)}}),i&&n(p,i),r&&n(f,null),t.o.size||(t.o=null),c.oPB.eL()}function a(){var n=this.GetClientRect(),a=this.gPtr(i),h=this.c2V(l.X(a)-n[0],l.Y(a)-n[1]),p=this.runCM({items:function(){var o="",i="";return w.allowFC()&&(i=y.oFC.getCM({group:v,sel:e(v)}))&&(o+=(o?d:"")+v,o+="(",o+=i,o+=")"),w.allowFA()&&(i=y.oFA.getCM({sel:r.call(this,y.oFA)}))&&(o+=o?",[sep],":"",o+=i),t.a&&!c.oPB.getL().t2O(t)&&w.allowFCA()&&(i=y.oFCA.getCM({sel:r.call(this,y.oFCA)}))&&(o+=(o?",[sep],":"")+g,o+="(",o+=i,o+=")"),o}.call(this),x:l.X(h),y:l.Y(h),alignContextMenu:0,cbkS:function(e){if(t){s(function(t){function i(t,i){(t=C(t).trim())&&(e+=(e?m:"")+t,o(i)&&(e+=T+i))}var e="";return t.forEachU(function(t){t.flags&&(t.flags.get("chk")&&i(t.caption),t.caption&&t.flags.get("rad")&&i(t.flags.get("grp"),t.caption))}),e}(this)),t=null;var n=c.e2V(i);n&&n.p2PO&&(t=n.p2PO(n.gPtr(i)))}},cbkM:function(t){!t&&f&&(this.drawItem=f)}}),f=p&&p.drawItem;f&&(p.drawItem=function(t,o,i,e){var n,r,s=e.get("item");if(s){p.getCriFlat()&&((s=s.slice())[2]=p.getFlatWidth(),s=u.IRt(s,-1,-1));var a,h,l=i.oP&&i.oP.caption;l==g&&(a=y.oFCA.mvF||y.oFCA.mF),l||i.rgCI.length||i.flags&&i.flags.has("sep")||(a=y.oFA.mvF||y.oFA.mF),a&&(h=a.get(i.caption))&&h.shape&&(r=c.toShapes(h.shape))}r&&(n=u.Tree.bSCTX(o,r,s)),f.apply(this,arguments),n&&u.Tree.eSCTX(o,n)},p.Refresh())}var h=!1,c=this,y=this.oT.src(),P=this.oT.run(),w=y.oPB,m=d,T="=",b=i.drag&&(i.drag.long?1:2==i.drag.click?2:0)||0;return(h=t&&this.gAA().CanDo(i,b,"format"))&&(u.Menu?a:function(){var o,i=y.capFO(t);(o=C(prompt("format",i),i))!=i&&s(o)}).call(this),h},u.Tree.Options.showDataOnDblClick=null,w.GetShowDataOnDblClick=function(){return this.oO.showDataOnDblClick},w.SetShowDataOnDblClick=function(t){this.cwbU(),this.oO.showDataOnDblClick=t,this.cweU()},w.getShowDataOnDblClick=function(){return this.opt("showDataOnDblClick",!0)},u.Tree.Options.displayPivotFields=null,w.GetDisplayPivotFields=function(){return this.oO.displayPivotFields},w.SetDisplayPivotFields=function(t){this.cwbU(),this.oO.displayPivotFields=t,this.oPB.onPL(),this.cweU()},w.getDisplayPivotFields=function(){return this.opt("displayPivotFields",256)},u.Tree.Options.displayPivotRows=null,w.GetDisplayPivotRows=function(){return this.oO.displayPivotRows},w.SetDisplayPivotRows=function(t){this.cwbU(),this.oO.displayPivotRows=t,this.oPB.onPL(),this.cweU()},w.getDisplayPivotRows=function(){return this.opt("displayPivotRows",16384)},u.Tree.Options.formatPivotHeader=null,w.GetFormatPivotHeader=function(){return this.oO.formatPivotHeader},w.SetFormatPivotHeader=function(t){this.cwbU(),this.oExPF=void 0,this.oO.formatPivotHeader=t,this.cweU()},w.getFormatPivotHeader=function(){return this.opt("formatPivotHeader","ilevel >= 0 ? (aggregate = `sum` ? (ilevel > 1 ? `Subtotal` : `Total`) : proper(aggregate)) : (aggregate and caption ? (proper(aggregate) + ' of ' + caption) : proper(aggregate) or caption)")},u.Tree.Options.showBranchRows=null,w.GetShowBranchRows=function(){return this.oO.showBranchRows},w.SetShowBranchRows=function(t){this.cwbU(),this.oO.showBranchRows=t,this.oPB.onPL(),this.cweU()},w.getShowBranchRows=function(){return e(this.opt("showBranchRows"),u.Pivot.ShowBranchRowsEnum,33)},w.isBT=function(){return 1==(15&this.getShowBranchRows())},w.isBC=function(){return 3==(15&this.getShowBranchRows())},w.prC2=function(){var t=0,o=this.getL();return o.isEmpty()||(this.isBC()&&o.r&&(t=o.r.len()),t=y(1,t)),t},u.Tree.Options.showIdem=null,w.GetShowIdem=function(){return this.oO.showIdem},w.SetShowIdem=function(t){this.cwbU(),this.oO.showIdem=t,this.oPB.onPL(),this.cweU()},w.getShowIdem=function(){return this.opt("showIdem")},u.Tree.Options.misc={columnEmptyPivotRows:"",rowEmptyPivotRows:"Total"},w.GetMisc=function(){return this.oO.misc},w.SetMisc=function(t){this.cwbU(),this.oMsc=null,this.oO.misc=t,this.cweU()},w.getMisc=function(){return this.oMsc||(this.oMsc=this.opt("misc",u.Pivot.MiscellaneousOptions)||{})},u.Tree.Options.customView={visible:null,object:null},w.SetCustomView=function(t){this.oCV.SetOptions(t)},w.GetCustomView=function(){return this.oCV},u.Tree.Cell.prototype.i=u.Tree.Cell.prototype.getImage=function(t){return function(){var o,i=this.oC;return this.oC.oCS&&(i=this.oC.oCS,this.oC.oCS.length&&(i=this.oC.oCS[this.oI.getLevel()])),(o=i.getFormatImage())?o.Evaluate(this):t.apply(this,arguments)}}(u.Tree.Cell.prototype.getImage),u.Shapes.Pivot=u.Shapes.Tree,t.Pivot=u.Pivot});