/*!
* Licensed Materials - Property of IBM
* IBM Cognos Products: Modeling UI
* (C) Copyright IBM Corp. 2020
* US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
*/
(window.caModellingPerspective=window.caModellingPerspective||[]).push([[42],{1016:function(e,t,r){"undefined"!=typeof self&&self,e.exports=function(e){return webpackJsonPBaGraphics([546],{"10eed102fbc488d5f846":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r("3865314c5959606874d4"),a=(r.n(i),r("33c7892ad4967aa3ba24"));t.default=a.a},"33c7892ad4967aa3ba24":function(e,t,r){"use strict";var i=r("9689a9c94ae38b47fa2c"),a=r.n(i),o=r("9ce58a7deea14f49ef01"),n=r.n(o),l=new a.a({id:"repeat_32_v7",use:"repeat_32_v7-usage",viewBox:"0 0 32 32",content:''});n.a.add(l),t.a=l},"3865314c5959606874d4":function(t,r){t.exports=e}},["10eed102fbc488d5f846"])}(r(15))},1743:function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return m});var i,a=r(1),o=r.n(a),n=r(3),l=r(25),c=r(5),s=r(2),p=r(10),u=r(44),g=r(1744),b=r(1752);var m=Object(u.a)(p.y,{initializer:function(e,t){return new b.a({},t)}})(i=Object(c.e)(function(e){return{simpleCalculationsStore:e,isValid:e.isValid,isDirty:e.isDirty,isMemberCalculation:e.isMemberCalculation,saveSimpleCalculation:e.saveSimpleCalculation,parentForSimpleCalculation:e.parentForSimpleCalculation}})(i=function(e){function t(){for(var t,r=arguments.length,i=new Array(r),a=0;a'});n.a.add(l),t.a=l}},["7119a1c97240ad971958"])}(r(15))},1747:function(e,t,r){var i=r(1748);"string"==typeof i&&(i=[[e.i,i,""]]);var a={hmr:!0,transform:void 0};r(36)(i,a);i.locals&&(e.exports=i.locals)},1748:function(e,t,r){(e.exports=r(32)(void 0)).push([e.i,'.bi-mui-collapsableMemberSearchView__toggleIcon{padding:8px;border:1px solid #eaeaea;border-left:3px solid #1f57a4}.bi-mui-collapsableMemberSearchView__collapsed{width:8px;background-color:#eaeaea;background-position:0;padding:0 3px 3px 0;background-repeat:no-repeat;background-origin:content-box;box-sizing:border-box;background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA4IDE2IiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iOHB4IiBoZWlnaHQ9IjE2cHgiPjxnIG9wYWNpdHk9IjEiPjxwYXRoIGQ9Ik01LjY2NyAxNmgtMVYwaDF2MTZ6TTMuMzMzIDBoLTF2MTZoMVYweiIgZmlsbD0iIzAwMDAwMCIvPjwvZz48L3N2Zz4=")}',""])},1749:function(e,t,r){"use strict";r.d(t,"a",function(){return m});var i,a=r(0),o=r.n(a),n=r(1),l=r.n(n),c=r(16),s=r(3),p=r(5),u=r(63);function g(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var b=Object(s.itemDnD)(function(e){function t(){return e.apply(this,arguments)||this}return g(t,e),t.prototype.render=function(){var e=this.props,t=e.hoveredActive;return(0,e.children)(t)},t}(n.Component),{dropItemType:u.e,simpleHoverStates:!1}),m=Object(p.e)(function(e){return{setLeftElement:e.setLeftElement,setRightElement:e.setRightElement}})(i=Object(c.observer)(i=function(e){function t(){for(var t,r=arguments.length,i=new Array(r),a=0;a0?r[I.a]:"",this.elementOperands[I.b]=r&&r.length>1?r[I.b]:"",this.showCalculateAfterAggregation=!0,this.calculateAfterAggregation=this.isGlobal),c&&(this.parentObject=Object(j.getParentHierarchy)(r[0])||Object(j.getAncestorOrModule)(r[0],C.a.MoserObjectTypes.QUERY_ITEM))},r._realSide=function(e){return this.swap?e===I.a?I.b:I.a:e},r._operands=function(e){var t=this._realSide(e);return this.elementOperands[t]?this.elementOperands[t]:void 0},r._label=function(e){var t=this._operands(e);return t?t.getLabel():void 0},r._value=function(e){return this.numberOperands[this._realSide(e)]},r.setCalculateAfterAggregation=function(e){this.calculateAfterAggregation=e,this.calculateAfterAggregationToggled=!0},r._loadBinInfoNewest=function(){var e=Object(A.getObjectProperty)(this.selectedMoserObject,M.t);Object.assign(this,e)},r._loadBinInfo=function(){if(this._loadBinInfoNewest(),this.elementOperands[I.a]){var e=C.a.ModuleUtils.getMoserObjectByIdForExpression(this.elementOperands[I.a],Object(j.getModule)(this.selectedMoserObject));e||this.provider.showToast(Object(L.getString)("errorCanNotResolveQI",{qi:this.elementOperands[I.a]})),this.elementOperands[I.a]=e||""}if(this.elementOperands[I.b]){var t=C.a.ModuleUtils.getMoserObjectByIdForExpression(this.elementOperands[I.b],Object(j.getModule)(this.selectedMoserObject));t||this.provider.showToast(Object(L.getString)("errorCanNotResolveQI",{qi:this.elementOperands[I.b]})),this.elementOperands[I.b]=t||""}},r.setOperation=function(e){this.operation=e},r.toggleSwap=function(){this.swap=!this.swap},r.setLeftElement=function(e){this.elementOperands[this.swap?I.b:I.a]=e,this.setLeftNumber("")},r.setLeftNumber=function(e){this.numberOperands[this.swap?I.b:I.a]=e},r.setRightElement=function(e){this.elementOperands[this.swap?I.a:I.b]=e,this.setRightNumber("")},r.setRightNumber=function(e){this.numberOperands[this.swap?I.a:I.b]=e},r.setDisplayName=function(e){this.inputtedName=e},r.setSelection=function(e){this.selection=e},r.toggleSearchPanelVisible=function(){this.isSearchCollapsed=!this.isSearchCollapsed},r.saveSimpleCalculation=function(){var e=this,t=Object(L.getString)("simpleCalcSave"),r=this.properties,i=this.edit?this.selectedMoserObject:Object(N.createExpressionObject)(this.context,this.parentForSimpleCalculation,r);return this.calculateAfterAggregationToggled&&(Object(V.h)(i,C.a.Features.REGULAR_AGGREGATE),this.calculateAfterAggregation?i.setRegularAggregate(C.a.RegularAggregateType.CALCULATED):i.setRegularAggregate(C.a.RegularAggregateType.TOTAL)),this.provider.saveGlobalSessionModule().then(function(){return Object(P.a)(e.context,{moduleId:e.provider.getModuleId(),moduleURL:e.provider.getModuleURL(),moserObject:i,moserObjectParent:e.parentForSimpleCalculation,expression:r.expression,calculateAfterAggregation:e.calculateAfterAggregation})}).then(function(a){return e.action(Object(S.b)(t)(function(){e.edit?Object(N.updateExpressionProperties)(e.context,i,z({},r,{},a.columnList[0])):(Object(N.updateExpressionProperties)(e.context,i,a.columnList[0]),Object(N.addExpressionObjectToModule)(e.context,e.parentForSimpleCalculation,i))}))},function(a){return Object(D.b)(a)&&e.provider.showToast(Object(L.getString)("calcParamErrorFromValidation")),e.action(Object(S.b)(t)(function(){e.edit?Object(N.updateExpressionProperties)(e.context,i,r):Object(N.addExpressionObjectToModule)(e.context,e.parentForSimpleCalculation,i)}))}).then(function(){return i})},function(e,t,r){t&&T(e.prototype,t),r&&T(e,r)}(t,[{key:"memberSearchStore",get:function(){var e=this,t=Object(E.n)(E.e,"stores/MemberSearchStore");return this.isMemberCalculation&&t&&this.parentObject?new t({getSelection:function(){return e.selection},setSelection:function(t){return e.setSelection(t)},getModuleId:function(){return e.provider.getModuleId()}},{parentMoserObject:this.parentObject}):null}},{key:"leftLabel",get:function(){return this._label(I.a)}},{key:"rightLabel",get:function(){return this._label(I.b)}},{key:"leftValue",get:function(){return this._label(I.a)?"":this._value(I.a)}},{key:"rightValue",get:function(){return this._label(I.b)?"":this._value(I.b)}},{key:"displayName",get:function(){return Object(I.c)(this.inputtedName,this.operation,this._operands(I.a)||this._value(I.a),this._operands(I.b)||this._value(I.b))}},{key:"parentForSimpleCalculation",get:function(){var e=[];return this.edit?e.push(this.selectedMoserObject):(this.elementOperands[I.a]&&e.push(this.elementOperands[I.a]),this.elementOperands[I.b]&&e.push(this.elementOperands[I.b])),Object(N.getParentForExpression)(e,this.forceGlobal)}},{key:"properties",get:function(){return Object(I.e)({inputtedName:this.inputtedName,operation:this.operation,swap:this.swap,elementOperands:this.elementOperands,numberOperands:this.numberOperands},this.parentForSimpleCalculation,this.forceGlobal)}},{key:"expression",get:function(){return Object(I.d)(this.operation,this.parentForSimpleCalculation,this._operands(I.a)||this._value(I.a),this._operands(I.b)||this._value(I.b),this.forceGlobal)}},{key:"calculationParameters",get:function(){return{calculateAfterAggregation:this.calculateAfterAggregation,expression:this.expression,displayName:this.displayName}}},{key:"isValid",get:function(){return!!("/"!==this.operation&&"%"!==this.operation&&"ยข"!==this.operation||this._operands(I.b)||0!==Number(this._value(I.b)))&&!(!(this._operands(I.a)||this._value(I.a).length&&!isNaN(this._value(I.a)))||!(this._operands(I.b)||this._value(I.b).length&&!isNaN(this._value(I.b))))}},{key:"isDirty",get:function(){return!v()(this.originalCalculation,this.calculationParameters)}},{key:"isGlobal",get:function(){return this.forceGlobal||Object(N.isExpressionParentGlobal)(this.parentForSimpleCalculation)}},{key:"isCalculateAfterAggregation",get:function(){return this.calculateAfterAggregation}}]),t}(x.a),s=R(c.prototype,"inputtedName",[_.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),p=R(c.prototype,"operation",[_.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"+"}}),u=R(c.prototype,"swap",[_.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),g=R(c.prototype,"elementOperands",[_.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return["",""]}}),b=R(c.prototype,"numberOperands",[_.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return["",""]}}),m=R(c.prototype,"forceGlobal",[_.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),d=R(c.prototype,"calculateAfterAggregation",[_.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),h=R(c.prototype,"showCalculateAfterAggregation",[_.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),f=R(c.prototype,"selection",[_.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),y=R(c.prototype,"isSearchCollapsed",[_.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),R(c.prototype,"memberSearchStore",[x.d],Object.getOwnPropertyDescriptor(c.prototype,"memberSearchStore"),c.prototype),R(c.prototype,"leftLabel",[_.computed],Object.getOwnPropertyDescriptor(c.prototype,"leftLabel"),c.prototype),R(c.prototype,"rightLabel",[_.computed],Object.getOwnPropertyDescriptor(c.prototype,"rightLabel"),c.prototype),R(c.prototype,"leftValue",[_.computed],Object.getOwnPropertyDescriptor(c.prototype,"leftValue"),c.prototype),R(c.prototype,"rightValue",[_.computed],Object.getOwnPropertyDescriptor(c.prototype,"rightValue"),c.prototype),R(c.prototype,"displayName",[_.computed],Object.getOwnPropertyDescriptor(c.prototype,"displayName"),c.prototype),R(c.prototype,"parentForSimpleCalculation",[_.computed],Object.getOwnPropertyDescriptor(c.prototype,"parentForSimpleCalculation"),c.prototype),R(c.prototype,"properties",[_.computed],Object.getOwnPropertyDescriptor(c.prototype,"properties"),c.prototype),R(c.prototype,"expression",[_.computed],Object.getOwnPropertyDescriptor(c.prototype,"expression"),c.prototype),R(c.prototype,"calculationParameters",[_.computed],Object.getOwnPropertyDescriptor(c.prototype,"calculationParameters"),c.prototype),R(c.prototype,"isValid",[_.computed],Object.getOwnPropertyDescriptor(c.prototype,"isValid"),c.prototype),R(c.prototype,"isDirty",[_.computed],Object.getOwnPropertyDescriptor(c.prototype,"isDirty"),c.prototype),R(c.prototype,"isGlobal",[_.computed],Object.getOwnPropertyDescriptor(c.prototype,"isGlobal"),c.prototype),R(c.prototype,"isCalculateAfterAggregation",[_.computed],Object.getOwnPropertyDescriptor(c.prototype,"isCalculateAfterAggregation"),c.prototype),R(c.prototype,"setCalculateAfterAggregation",[x.c],Object.getOwnPropertyDescriptor(c.prototype,"setCalculateAfterAggregation"),c.prototype),R(c.prototype,"setOperation",[x.c],Object.getOwnPropertyDescriptor(c.prototype,"setOperation"),c.prototype),R(c.prototype,"toggleSwap",[x.c],Object.getOwnPropertyDescriptor(c.prototype,"toggleSwap"),c.prototype),R(c.prototype,"setLeftElement",[i],Object.getOwnPropertyDescriptor(c.prototype,"setLeftElement"),c.prototype),R(c.prototype,"setLeftNumber",[a],Object.getOwnPropertyDescriptor(c.prototype,"setLeftNumber"),c.prototype),R(c.prototype,"setRightElement",[o],Object.getOwnPropertyDescriptor(c.prototype,"setRightElement"),c.prototype),R(c.prototype,"setRightNumber",[n],Object.getOwnPropertyDescriptor(c.prototype,"setRightNumber"),c.prototype),R(c.prototype,"setDisplayName",[l],Object.getOwnPropertyDescriptor(c.prototype,"setDisplayName"),c.prototype),R(c.prototype,"setSelection",[x.c],Object.getOwnPropertyDescriptor(c.prototype,"setSelection"),c.prototype),R(c.prototype,"toggleSearchPanelVisible",[x.c],Object.getOwnPropertyDescriptor(c.prototype,"toggleSearchPanelVisible"),c.prototype),R(c.prototype,"saveSimpleCalculation",[x.c],Object.getOwnPropertyDescriptor(c.prototype,"saveSimpleCalculation"),c.prototype),c)},709:function(e,t,r){"use strict";r.r(t);var i=r(1743);t.default={"components/SimpleCalculationsDialog":i}},736:function(e,t,r){var i=r(264);e.exports=function(e,t){return i(e,t)}}}]);
//# sourceMappingURL=simpleCalculations.js.map