(window["webpackJsonptrueChart"]=window["webpackJsonptrueChart"]||[]).push([[30],{1131:function(e,t,i){"use strict";i.r(t);var Mt=i(1);var a=i(25);
/*!
 * High Coordination SUCCESS Business Engine v2019.5.4_11
 * http://www.highcoordination.com
 *
 * Copyright 2013-2016, HighCoordination GmbH
 *
 * Date: Wed, 18 Sep 2019 11:44:56 GMT
 */
/*!
 * High Coordination SUCCESS Business Engine v2019.5.4_11
 * http://www.highcoordination.com
 *
 * Copyright 2013-2016, HighCoordination GmbH
 *
 * Date: Wed, 18 Sep 2019 11:44:56 GMT
 */
(function(e){addSingleDoubleClickListener(e);if(typeof String.prototype.endsWith!=="function"){Object.defineProperty(String.prototype,"endsWith",{value:function(e,t){var i=this.toString();if(typeof t!=="number"||!isFinite(t)||Math.floor(t)!==t||t>i.length){t=i.length}t-=e.length;var a=i.lastIndexOf(e,t);return a!==-1&&a===t}})}if(typeof String.prototype.startsWith!=="function"){String.prototype.startsWith=function(e){if(e===null||e===undefined){return false}return e===this.substr(0,e.length)}}if(!Array.prototype.findIndex){Object.defineProperty(Array.prototype,"findIndex",{value:function(e){if(this==null){throw new TypeError('"this" is null or not defined')}var t=Object(this);var i=t.length>>>0;if(typeof e!=="function"){throw new TypeError("predicate must be a function")}var a=arguments[1];var n=0;while(n<i){var r=t[n];if(e.call(a,r,n,t)){return n}n++}return-1}})}function addSingleDoubleClickListener(e){
/**
         * @author Jacek Becela
         * @license MIT
         * @source http://gist.github.com/399624
         * @param single_click_callback
         * @param double_click_callback
         * @param timeout
         * @returns void
         */
e.fn.single_double_click=function(a,n,r){return this.each(function(){var t=0,i=this;if(HiCo.$.browser.msie){e(this).bind("dblclick",function(e){t=2;n.call(i,e)});e(this).bind("click",function(e){setTimeout(function(){if(t!=2){a.call(i,e)}t=0},r||300)})}else{e(this).bind("click",function(e){t++;if(t==1){setTimeout(function(){if(t==1){a.call(i,e)}else{n.call(i,e)}t=0},r||300)}})}})}}})(a["b"]);var n=i(633);var r=i(632);var Q=i(117);var U=i(212);var it=i(48);var H=i(2);var G=i(398);var q=i(24);var V=i(78);var z=i(15);var W=i(233);var J=i(94);var h=i(30);var j={updateIdentifiers:function(e){var c=null;loadCTIdsToReplace();e.forEach(function(e){var t=e.getController().getRootModel();var i=Mt["b"].DataObjects.DocumentDO.getIdentifiersToReplaceById(e.getId());c&&addCTIdsToReplace(i);updateRootModel(t,i);!Mt["b"].DataObjects.DocumentDO.getConnector().inPlayMode()&&updateCommentReferences(e,i);updateContextCTReferences(e,i)});function updateRootModel(i,e){for(var a in i){if(i.hasOwnProperty(a)){if(typeof i[a]==="object"&&i[a]!==null&&a!=="$scope"){updateRootModel(i[a],e)}else if(typeof i[a]==="string"){applyIdentifiers(e,function(e,t){i[a]=Mt["b"].Utils.GlobalFunctions.replaceAll(i[a],e,t)})}}}}function updateCommentReferences(i,t){var e=Mt["b"].DataObjects.DocumentDO.getAllExtensions();if(e.indexOf(i)<0){return}Mt["b"].DataObjects.CommentRepo.reloadComments(e);i.getAdapter().getExtensionDefinition().comments.forEach(function(e){replaceReferenceIds(e);var t=Mt["b"].DataObjects.CommentRepo.getCommentById(e.id,i.getId());t&&replaceReferenceIds(t)});function replaceReferenceIds(e){e.comments.forEach(function(e){e.grid.forEach(function(e){e.forEach(function(e){e.reference=e.reference.map(function(i){applyIdentifiers(t,function(e,t){i.extension=Mt["b"].Utils.GlobalFunctions.replaceAll(i.extension,e,t);i.refId=h["a"].createGuid()});return i})})})})}}function loadCTIdsToReplace(){var e=Mt["b"].DataObjects.DocumentDO.getConnector().getDocumentValues().textProperties.publication;var t=Mt["b"].DataObjects.DocumentDO.getConnector().isPublished&&Mt["b"].Utils.GlobalVariables.hasService;var i=e.renameCommonTables&&e.commonTablesSuffix;if(t&&i){var a=e.commonTablesSuffix;var n=Mt["b"].DataObjects.CommonTableRepo.getCommonTableRepo();c={};for(var r in n){var o=n[r];var l=o.key+a;for(var s in n){var d=n[s];if(d.key===l){c[r]=s;break}}}}}function addCTIdsToReplace(e){for(var t in c){if(c.hasOwnProperty(t)){e[t]=c[t]}}return e}function applyIdentifiers(e,t){for(var i in e){if(e.hasOwnProperty(i)&&i!==e[i]){t(i,e[i])}}}function updateContextCTReferences(e){if(c===null){return}var t=e.getContexts();t.forEach(function(e){e.columns.forEach(function(e){var t;e.commonTable&&(t=c[e.commonTable])&&(e.commonTable=t)})})}}};var at=i(166);var o=i(87);var K=i(59);var re=i(21);var X=i(10);var l=i(34);var s=i(636);var d=i(172);var c=i(637);var u=i(1489);var p=i(596);var Ot=i(3);var Y=i(67);var Z=i(113);var ee=i(507);var g=i(60);var te=i(628);var ie=i(426);var pe=i(26);var ae=i(98);var ne=["ExportAsPDF","ExportAsImage","ExportAsVectorGraphic","ExportAsExcel","ReloadComments","SaveCommentsInApp","Export_As_PDF","Export_As_PNG","Export_As_EMF","Export_As_XLS","Reload_Common_Tables","Save_Comments_In_App"];var f={checkEDXStatus:function(t,i,a){var n=this;function updatePainting(){q["a"].info("repaint triggered");a.paint()}Mt["b"].$.ajax({type:"POST",url:i.replace("TriggerEDXTask","GetEDXTaskStatus"),data:JSON.stringify(t),contentType:"application/json; charset=utf-8",dataType:"json",success:function(e){if(e.d.TaskStatus==="Failed"){q["a"].warn("Task failed");setTimeout(updatePainting,4e3)}else if(e.d.TaskStatus!=="Completed"){n.checkEDXStatusCall(t,i,a)}else{setTimeout(updatePainting,4e3)}}})},checkEDXStatusCall:function(e,t,i){var a=this;var n=function(){a.checkEDXStatus(e,t,i)};setTimeout(n,1e3)},triggerAction:function(B,k){var U=[];for(var e=2;e<arguments.length;e++){U[e-2]=arguments[e]}return H["b"](this,void 0,Promise,function(){var t,i,a,n,r,o,l,s,d,c,u,p,g,h,f,m,v,b,T,x,E,y,C,S,M,O,A,_,L,I,D,R,P,N,w,F;return H["e"](this,function(e){switch(e.label){case 0:if(Mt["b"].DataObjects.DocumentDO.preventLeftClickAndActions()){return[2]}if(~ne.indexOf(B)&&!pe["a"].hasService){throw new te["a"]("ACTION_NEEDS_SERVICE")}t={extension:k};i=B;switch(i){case"ToggleShowEditMode":return[3,1];case"Toggle_Show_Edit_Mode":return[3,1];case"SaveComments":return[3,2];case"Save_Changed":return[3,2];case"Refresh":return[3,3];case"ExportAsPDF":return[3,4];case"Export_As_PDF":return[3,4];case"ExportAsImage":return[3,5];case"Export_As_PNG":return[3,5];case"ExportAsVectorGraphic":return[3,6];case"Export_As_EMF":return[3,6];case"ExportAsExcel":return[3,7];case"Export_As_XLS":return[3,7];case"ReloadComments":return[3,8];case"Reload_Common_Tables":return[3,8];case"SaveCommentsInApp":return[3,9];case"Save_Comments_In_App":return[3,9]}return[3,14];case 1:k.dispatch("updateDocumentMode",{});return[3,15];case 2:a=[];n=k.RootModel.firstObjectGrid;Mt["b"].Models.Actions.ViewModelActions.General.getAllChartsByType(n,a,"TableModel");t.parameters={saveChanged:true};for(r=0,o=a;r<o.length;r++){l=o[r];t.model=l;k.dispatch("updateInputSaveStates",t)}k.dispatch("updateRootModel",t);return[2,k.paint()];case 3:setTimeout(function(){return location.reload()},500);return[3,15];case 4:k.dispatch("createPDF",t);return[3,15];case 5:k.dispatch("createPNG",t);return[3,15];case 6:k.dispatch("createEMF",t);return[3,15];case 7:k.dispatch("getXLSExporterDialog",t);return[3,15];case 8:t.parameters={saveChanged:true};Mt["b"].DataObjects.CommonTableRepo.refreshCommonTables();s=[];Mt["b"].Models.Actions.ViewModelActions.General.getAllChartsByType(k.RootModel.firstObjectGrid,s,"TableModel");for(d=0,c=s;d<c.length;d++){u=c[d];p=t.model=u;g=Mt["b"].DataObjects.ContextRepo.getContextByCid(p.extendedModel.contextId);h=p.multiplePath!==undefined?Mt["b"].Models.Actions.DataModelActions.getMultipleDimensionsByPath(g.dataModel,p.multiplePath,1,true,p.isMultipleTotal):Mt["b"].Models.Actions.DataModelActions.getMultipleDimensions(g.dataModel,1);for(f=0,m=h;f<m.length;f++){v=m[f];b={columns:[]};T=v.ref;x=v.path;E=T.nodes[0].nodes.length;y=-1;while(++y<E){C={commonTable:"",dataId_dims:[],representationType:"",extendedModel:p.extendedModel,saveName:"",addKeyVariable:""};S=null;for(M=0,O=p.extendedModel.expressions;M<O.length;M++){A=O[M];if(T.nodes[0].nodes[y].key===A.id.split(".").pop()){S=A;break}}if(S!=null&&S.commonTable!=null){C.commonTable=S.commonTable;C.representationType=S.representation;C.addKeyVariable=S.addKeyVariable;if(S.saveName&&S.saveName.toLowerCase()!=="auto"&&S.saveName!==""){C.saveName=S.saveName}else{C.saveName=S.id.split(".").pop().replace("expr","")}for(_=0,L=T.nodes;_<L.length;_++){I=L[_];D=x+(x===""?"":"@")+I.value;C.dataId_dims.push(D)}b.columns.push(C)}}Mt["b"].DataObjects.InlineCommentRepo.loadCommonComments(b)}}k.paint();return[3,15];case 9:R=U||[];P=Object(z["r"])(R[0])&&R[0].source||Object(z["r"])(R[3])&&R[3][0];N=P==="_self"?Mt["b"].DataObjects.DocumentDO.getHash():Z["a"].createSHA1Hash(P);e.label=10;case 10:e.trys.push([10,12,,13]);return[4,ee["a"].initCopy(Mt["b"].DataObjects.DocumentDO.getConnector(),N)];case 11:e.sent();K["a"].success(Ot["a"].getTranslation("DOWNLOAD_COMMENTS_SUCCESS"));return[3,13];case 12:w=e.sent();ae["a"].close();if(w instanceof ie["a"]){K["a"].warning(Ot["a"].getTranslation(w.TranslationKey))}else{F=w instanceof Error?w.message:w||Y["e"];q["a"].error(F);K["a"].error(Ot["a"].getTranslation("GENERIC_ERROR_MESSAGE"),Ot["a"].getTranslation("SAVE_COMMENTS_IN_APP"));throw w}return[3,13];case 13:return[3,15];case 14:throw new Error("Invalid button action");case 15:return[2]}})})}};var m=function(){function Actions(){Actions._instance=this}Object.defineProperty(Actions,"Instance",{get:function(){return this._instance||new Actions},enumerable:true,configurable:true});Object.defineProperty(Actions.prototype,"execute",{get:function(){var t=this;return this._execute||{None:function(){return Promise.resolve()},Custom:function(e,t,i){if(i===void 0){i={}}var a=new Function("$","element","mashUp","contextType","event","clickInfo",e.functionBody);return Promise.resolve(a(Mt["b"].$,i.element,null,{},i.event,i.clickInfo))},ToggleShowEditMode:function(){return t.run("ToggleShowEditMode")},SaveComments:function(e){return t.run("SaveComments",e)},Refresh:function(){return t.run("Refresh")},ExportAsPDF:function(e){return t.run("ExportAsPDF",e)},ExportAsImage:function(e){return t.run("ExportAsImage",e)},ExportAsVectorGraphic:function(e){return t.run("ExportAsVectorGraphic",e)},ExportAsExcel:function(e){return t.run("ExportAsExcel",e)},ReloadComments:function(e){return t.run("ReloadComments",e)},SaveCommentsInApp:function(e){return t.run("SaveCommentsInApp",e)}}},enumerable:true,configurable:true});Actions.prototype.supports=function(e){var t=this.execute;if(Array.isArray(e)){return e.every(function(e){return e in t})}else{return e in t}};Actions.prototype.preventActions=function(){return this.DocumentDO.preventLeftClickAndActions()};Actions.prototype.run=function(e,t){if(t===void 0){t={}}var i=this.execute[e];if(i){var a=t.objectId?this.DocumentDO.getExtension(t.objectId):this.DocumentDO.getAllExtensions()[0];return a?Promise.resolve(f.triggerAction(e,a,t)):Promise.resolve()}q["a"].warn("Can not execute an unsupported action: "+e);return Promise.resolve()};Object.defineProperty(Actions.prototype,"DocumentDO",{get:function(){return this._documentDO||(this._documentDO=Mt["b"].DataObjects.DocumentDO)},enumerable:true,configurable:true});return Actions}();function getBlacklistedActions(){var e=Mt["b"].DataObjects.DocumentDO.getApi().ConfigManager;var t=[];if(Mt["b"].Utils.GlobalVariables.hasService){t=t.concat([g["a"].ExportAsImage,g["a"].ExportAsExcel,g["a"].ExportAsPDF,g["a"].ExportAsVectorGraphic])}switch(e.getConfig().biType){case"sense":case"view":break;default:t=t.concat([g["a"].Refresh])}return t}var v=i(514);var b=i(488);Mt["b"].DataObjects.DocumentDO=function(e,t,i){var n=this;var p=this,l=e,a=l.getDocumentName(),r=l.getId(),g=t;var h;var s=[];var o=[];var d={};var c=0;var f=false;var m=false;var v={};var b={};var T={};var x={};var E={};var y=[];var C=[];var S=[];var M=[];var O={};var A=false;var _=[];var u={};var L={};var I=i.settings;var D=new G["a"](r,null);var R=null;var P=false;var N=[];var w=false;this.init=init;this.clearUsedVariables=clearUsedVariablesList;this.getApi=getApi;this.getConnector=getConnector;this.getOptionsData=getOptionsData;this.paintExtensions=paintExtensions;this.setUsedBIVariablesList=setUsedBIVariablesList;this.pushLayoutDefinitionUpdate=pushLayoutDefinitionUpdate;this.pushContextModelUpdate=pushContextModelUpdate;this.removeTemporaryDisabledVariables=function(){for(var e=s.length-1;e>=0;e--){if(s[e].temporaryDisabled){s.splice(e,1)}}};var F=i;if(F!=null){init(F)}function init(e){if(e.settings===null){e.settings=I}if(!Mt["b"].DataObjects.RuntimeDO.getUser().userSpecific){Mt["b"].DataObjects.RuntimeDO.setUserSettings({decimalSep:e.settings.decimalSep,thousandSep:e.settings.thousandSep,negativeStyle:e.settings.negativeStyle,docLanguage:e.settings.docLanguage,unitPosition:e.settings.unitPosition,documentMode:e.settings.documentMode,scalingGroups:e.settings.scalingGroups,dateFormat:e.settings.dateFormat})}s=o=e.variables||[];p.removeTemporaryDisabledVariables();if(e.settings.scalingSettings.value==""||e.settings.scalingSettings.value==undefined){e.settings.scalingSettings.value="{}"}if(e.settings.scalingGroups.value==""||e.settings.scalingGroups.value==undefined){e.settings.scalingGroups.value="{}"}if(typeof e.settings.scalingSettings.value==="string"){e.settings.scalingSettings.value=JSON.parse(e.settings.scalingSettings.value);if(typeof e.settings.scalingSettings.value==="string"){e.settings.scalingSettings.value=JSON.parse(e.settings.scalingSettings.value)}}if(typeof e.settings.scalingGroups.value==="string"){e.settings.scalingGroups.value=JSON.parse(e.settings.scalingGroups.value);if(typeof e.settings.scalingGroups.value==="string"){e.settings.scalingGroups.value=JSON.parse(e.settings.scalingGroups.value)}}if(Object.prototype.toString.call(e.settings.scalingGroups.value)==="[object Array]"){var t={};for(var i=0;i<e.settings.scalingGroups.value.length;i++){t[e.settings.scalingGroups.value[i]]={scalingFactor:null,auto:true,manualFactor:null}}e.settings.scalingGroups.value=t}I=e.settings;updateTimeoutSetting();p.setUpExpressionModule();p.setUpButtonModule();p.setUpModelModule();p.setUpComponentsModule()}function updateTimeoutSetting(){var e=parseFloat(I.paintTimeout.value);c=isNaN(e)||e<=0?200:Math.round(1e3*e)}function getApi(){return l.getApi()}this.addExtension=function(e){d[e.getId()]=e};this.getExtension=function(e){return d[e]||null};this.clearExtensions=function(){for(var e in d){if(!document.getElementById(e)||!d[e].getAdapter().isActive()){this.removeExtension(e)}}};this.removeExtension=function(e,t,i){if(t===void 0){t=false}if(i===void 0){i=true}var a=d[e];if(a===null||a===undefined){return null}delete Mt["b"].develop.penitentiary[e];delete Mt["b"].develop.hicoObjects[e];if(t){return delete d[e]}if(a.getAdapter().isSnapshotItem()&&!l.inPlayMode()){Mt["b"].DataObjects.CommentRepo.updateRefrencesForSnapshot(true);n.removeReferenceReplaceId(e)}a.onDestroy();Mt["b"].DataObjects.CommentRepo.deleteExtension(e);Mt["b"].DataObjects.RuntimeDO.clearClipboardState(e);i&&n.triggerDelayedRepaint();return delete d[e]};this.getAllExtensions=function(){var e=[];for(var t in d){e.push(d[t])}return e};this.updateDocumentScalingGroups=function(e){h=e};this.getName=function(){return a};this.getHash=function(){return r};function getConnector(){return l}this.getDocumentController=function(){return D};this.getPainter=function(){return g};this.getHiCoVariables=function(){var e=[];for(var t=0;t<s.length;t++){if(s[t].internal){e.push(s[t])}}return e};this.getUsedVariables=function(e){if(typeof e!=="undefined"){var t={};for(var i in u){u.hasOwnProperty(i)&&u[i].internal===e&&(t[i]=u[i])}return t}return u};this.getCurrentUsedVariables=function(){return L};this.getBIVariables=function(e){if(e===void 0){e=s}var t=[];for(var i=0,a=e.length;i<a;i++){var n=e[i];!n.internal&&t.push(n)}return t};this.getVariables=function(){return s};this.getCurrentBIVariables=function(){return n.getBIVariables(o)};this.getVariable=function(e,t){if(e===null||e===""){return null}for(var i=0;i<s.length;i++){if(s[i].name===e){return requestVariable(s[i])}}var a=l.varListReady();var n=_.indexOf(e)!==-1;if(a&&!n&&t!==false&&(!l.isPrinting()||false)){l.isPrinting()&&K["a"].error(s.map(function(e){return e.name}).join(", "),"Current variables",{preventDuplicates:true,timeOut:2e5});Mt["b"].Factories.DialogFactory.createMissingVariableDialog(e);_.push(e)}return null};this.getVariableById=function(e){for(var t=0;t<s.length;t++){if(s[t].id===e){return requestVariable(s[t])}}return null};this.getVariableByDefinition=function(e){for(var t=0;t<s.length;t++){if(s[t].definition===e){return s[t]}}return null};this.getVariableMetaData=function(e){var t=this.getVariable(e);if(t&&!t.internal){return l.getVariableMetaData(e)}else if(t){return Promise.resolve({definition:new X["a"](t.definition)})}return Promise.reject("No variable found with name: "+e)};this.addVariable=function(e){var t=false;if(e.internal){for(var i=0;i<s.length;i++){if(e.id===s[i].id){t=true;break}}}if(!t){s.push(e)}return!t};this.removeVariable=function(e){for(var t=0,i=s.length;t<i;t++){if(s[t].name===e.name){s.splice(t,1);delete u[name];delete L[name];break}}};function requestVariable(e){if(!u[e.name]){u[e.name]=e;if(!e.internal){l.getVariableValue(e.name);l.addToUsedBIVariables(e)}}L[e.name]=e;if(R&&R.getAdapter().isSnapshotItem()){e=R.getAdapter().getVariableForSnapshot(e.id)}return e}function setUsedBIVariablesList(e){var t=(e||[]).reduce(function(e,t){e[t]=true;return e},{});if(Object.keys(t).length){var i={};for(var a=0,n=s,r=n.length;a<r;a++){if(t[n[a].name]){var o=n[a];u[o.name]=o;i[o.id]=o.name}}l.setDocumentValue("usedBIVariables",i)}}function clearUsedVariablesList(){u={};L={};l.setDocumentValue("usedBIVariables",{})}function paintAllExtensions(){return H["b"](this,void 0,void 0,function(){var t,i,a,n,r,o,l,s,d,c,u;return H["e"](this,function(e){switch(e.label){case 0:if(A){j.updateIdentifiers(M);O={}}if(m){t=b,i=T,a=v,n=E,r=x;o=f;f=false;m=false;v={};b={};T={};E={};x={};Mt["b"].Utils.Update.ContextUpdater.finalUpdate(t,i,a,o,n,r)}else{Mt["b"].Utils.Update.ContextUpdater.synchronizeKeyColumnsNames()}if(!A)return[3,1];M.forEach(function(e){if(e.getMode()!==Mt["b"].Utils.Enums.EMode.READ_ONLY){saveObject(e);saveInlineComments(e);e.saveExtension();Mt["b"].DataObjects.RuntimeDO.setRebuildComments(e.getId()+"#"+e.getController().getRootModel().id,true)}});p.saveDocument();p.triggerDelayedRepaint();return[3,3];case 1:g.init();_=[];return[4,paintExtensions(p.getAllExtensions())];case 2:e.sent();if(h===true){D.dispatch("updateScalingGroups",{type:"document"});D.dispatch("updateScalingGroups",{type:"user"});h=false}e.label=3;case 3:l=[];while(C.length){s=p.getExtension(C.pop());R=s;s.getController().dispatch("updateRootModelState",{extension:s});l.push(s.LayoutDefinition.id)}while(y.length){d=y.pop();if(l.indexOf(d)===-1){c=p.getExtensionByLayoutDefinitionId(d);c&&c.getController().dispatch("updateRootModelState",{extension:c})}}while(S.length){u=it["a"].getExtensionByContextCid(S.pop());R=u;u.dispatch("createContextState",{async:false,extension:u,saveQVF:true})}M=[];A=false;return[2]}})})}function paintExtensions(a,n){return H["b"](this,void 0,void 0,function(){var t,t,i,t;return H["e"](this,function(e){switch(e.label){case 0:if(paintIsNotAllowed(a)||a.length===0){return[2]}q["a"].info("start painting trueChart");HiCoMVCInit.paintingPromise.createNewPromise();at["a"].clearAllInstances();L={};g.resetState();if(!n){rebuildContexts()}for(t=0;t<a.length;t++){a[t].initPainting()}return[4,Promise.all(mapExtension(function(e){return Promise.all([e.LayoutDefinition.evaluateExpressions(),Promise.all((it["a"].getExtensionContexts(e.getId())||[]).map(function(e){return e.DataContext.evaluateExpressions()}))])}))];case 1:e.sent();a.forEach(function(e){return e.updateContent()});rebuildContexts(true);Mt["b"].DataObjects.CommentRepo.reloadComments(a);for(t=0;t<a.length;t++){a[t].rebuildComments();a[t].updateLayout()}prePaintExtensions(a);if(paintIsNotAllowed(a)){return[2]}i=updateExtensionsLayout(a);if(i){q["a"].info("repainting trueChart");prePaintExtensions(a);i=updateExtensionsLayout(a)}Mt["b"].DataObjects.RuntimeDO.setPrePaint(false);if(i){q["a"].info("repainting trueChart");prePaintExtensions(a)}else{for(t=0;t<a.length;t++){a[t].finishPainting()}}Mt["b"].DataObjects.RuntimeDO.setPrePaint(true);HiCoMVCInit.paintingPromise.resolveProm();updateScalingGroups();Mt["b"].develop.runIntegrationTests();return[2]}})})}function saveObject(e){var t={extension:e,saveLocally:false,dontNotifyText:true};e.getController().dispatch("updateRootModel",t);var i=C.indexOf(e.getId());i>=0&&C.splice(i,1);i=y.indexOf(e.LayoutDefinition.id);i>=0&&y.splice(i,1);i=S.indexOf(e.getId());i>=0&&S.splice(i,1)}function saveInlineComments(i){var e=[];var t=i.getController().getRootModel().firstObjectGrid;Mt["b"].Models.Actions.ViewModelActions.General.getAllChartsByChartProperty(t,e);var a={extension:i,parameters:{saveChanged:true,saveLocally:false,savedBecauseCopied:true}};e.forEach(function(t){a.model=t;t.charts.forEach(function(e){if(e.model.instanceOf==="TableModel"){t.extendedModel=e.model;i.getController().dispatch("updateInputSaveStates",a)}})})}var B=null,k;this.triggerDelayedRepaint=function(e){if(e===void 0){e=c}window.clearTimeout(k);if(B!==null){B.reject()}B=new V["a"];k=window.setTimeout(function(){Promise.all(Object.keys(d).map(function(e){return d[e].isInitialized()}).concat([l.varValuesReady().promise,l.exprValuesReady().promise])).then(B.resolve,p.triggerDelayedRepaint)},e);return B.promise.then(paintAllExtensions).catch(function(e){return e&&q["a"].error("paintExtensions failed!",e.stack)})};this.clearDelayedRepaint=function(){window.clearTimeout(k)};this.getScalingGroups=function(){var e=Mt["b"].DataObjects.RuntimeDO.getUser().userSpecific;if(I.userSpecificScaling.value==="true"&&e){return e.scalingGroups.value}else{return I.scalingGroups.value}};this.removeInactiveScalingGroups=function(){var e;if(Mt["b"].DataObjects.RuntimeDO.getUser().userSpecific!==undefined){e=Mt["b"].DataObjects.RuntimeDO.getUser().userSpecific.scalingGroups.value}var t=I.scalingGroups.value;var i=it["a"].getAllContexts().reduce(function(e,t){for(var i=0,a=t.DataContext.measures;i<a.length;i++){var n=a[i];e[n.scalingGroup]=true}return e},{});for(var a in e){if(i[a]===undefined&&e[a].auto){delete e[a]}}for(var a in t){if(i[a]===undefined&&t[a].auto){delete t[a]}}};this.getDocSettings=function(e){if(e){return I}if(I.userSpecific.value==="true"&&Mt["b"].DataObjects.RuntimeDO.getUser().userSpecific){return Mt["b"].DataObjects.RuntimeDO.getUser().userSpecific}return I};this.getSettings=function(){if(I.userSpecific.value==="true"&&Mt["b"].DataObjects.RuntimeDO.getUser().userSpecific){return Mt["b"].DataObjects.RuntimeDO.getUser().userSpecific}return I};this.setDocSettings=function(e){I=e;updateTimeoutSetting()};this.allExtensionsHidden=function(){if(I.showUnlicensed.value==="false"){if(Mt["b"].DataObjects.RuntimeDO.getUser().sessionKey===""){return true}}return false};this.addChartExpressionToRemoveList=function(e,t){if(v[e]){v[e].push(t)}else{v[e]=[t]}m=true};this.addDidToRemoveList=function(e,t){if(b[e]){b[e].indexOf(t)===-1&&b[e].push(t)}else{b[e]=[t]}m=true};this.setPreventLeftClickAndActions=function(e){w=e};this.preventLeftClickAndActions=function(){return w||l.inEditMode()&&l.onSheet()};this.preventScrolling=function(){return l.inEditMode()&&l.onSheet()||l.inStoryMode()&&!l.inPlayMode()};this.addDidToRenameList=function(e,t,i){if(T[e]){T[e].push({oldDid:t,newDid:i})}else{T[e]=[{oldDid:t,newDid:i}]}m=true};this.addDidListToRenameList=function(e,t){if(T[e]){T[e]=T[e].concat(t)}else{T[e]=t}m=true};this.setContextFormulasModifiedFlag=function(){f=true};this.addDimensionToAddList=function(e,t){if(E[e]){E[e].push(t)}else{E[e]=[t]}m=true};this.addDimensionToRemoveList=function(e,t){if(x[e]){x[e].push(t)}else{x[e]=[t]}m=true};function pushLayoutDefinitionUpdate(e){if(y.indexOf(e)===-1){y.push(e)}}this.pushRootModelUpdate=function(e){if(C.indexOf(e)===-1){C.push(e)}};function pushContextModelUpdate(e){if(S.indexOf(e)===-1){S.push(e)}}this.addExtensionToUpdate=function(e){var t=this.getExtension(e);t&&M.push(t)};this.addIdentifierToReplace=function(e,t,i){O[e]=O[e]||{};O[e][t]=i;A=true};this.getIdentifiersToReplaceById=function(e){var t={},i=O[e];for(var a in i){t[a]=i[a]}for(var a in O){var n=O[a];if(a!==e){for(var r in n){t[r]===undefined&&(t[r]=n[r])}}}return t};this.getReferenceReplaceIds=function(){return N};this.addReferenceReplaceId=function(t){var i=false;N.some(function(e){if(e.newId===t.newId){i=true;return true}});if(!i){N.push(t)}};this.removeReferenceReplaceId=function(i){N.some(function(e,t){if(e.newId===i){N.splice(t,1);return true}})};this.clearReferenceReplaceIds=function(){var t=Object.keys(d);N=N.filter(function(e){return t.indexOf(e.newId)!==-1})};this.initViews=function(e){var t={};for(var i=0;i<e.length;i++){var a=e[i];if(!a.isNotVisible()){this.setCurrentPaintingExtension(a);W["a"].buildViews(a)}}if(l.varValuesReady().pending){console.log("cancel painting trueChart");return}var n=new Mt["b"].Layout.Iterator.Iterator;n.init();n.optimize();for(var i=0;i<e.length;i++){var a=e[i];if(!a.isNotVisible()){var r=a.getGlobalZoom();for(var o in r){if(t[o]===undefined||r[o]<t[o]){t[o]=r[o]}}}}for(var i=0;i<e.length;i++){var a=e[i];if(!a.isNotVisible()){a.updateGlobalZoom(t)}}for(var i=0;i<e.length;i++){var a=e[i];if(!a.isNotVisible()&&!a.hasError()){if(document.getElementById(a.getId())===null){continue}this.setCurrentPaintingExtension(a);W["a"].drawViews(a)}}};this.setCurrentPaintingExtension=function(e){if(this.getConnector().supportsSnapshots()){var t=e&&e.getAdapter();if(t&&t.isSnapshotItem()){s=t.getVariablesForSnapshot();Mt["b"].DataObjects.RuntimeDO.useNotationManual(t.getSnapshotData("notationManual"))}else{s=o;Mt["b"].DataObjects.RuntimeDO.useNotationManual(null)}}R=e};this.getCurrentPaintingExtension=function(){return R&&d[R.getId()]||null};this.setNeedsSnapshotReplace=function(e){P=e};this.freeScalingHelpers=[null,null,null];this.setDocumentValue=function(e,t){l.setDocumentValue(e,t)};this.saveDocument=function(){l.saveDocument()};function getOptionsData(){return H["b"](this,void 0,void 0,function(){var t,i,a,n;var r=this;return H["e"](this,function(e){switch(e.label){case 0:return[4,l.getOptionsData()];case 1:t=e.sent()||{};i=this.getApi().GlobalFeatureManager,a=i.Expression,n=i.Mashup;Mt["b"].DataObjects.DocumentDO.getDocumentController().dispatch("updateScalingGroups",{type:"document"});t.lazyLoaded=t.lazyLoaded||{};Object.defineProperties(t.lazyLoaded,{commentApps:{get:function(){var t=[{id:"_self",name:Ot["a"].getTranslation("SELF"),group:"Optimal",date:l.getDocumentValues().version}];return Mt["b"].Utils.GlobalVariables.hasService?re["a"].repositoryAsync("getApplicationsForCommentCopy",{meta:{currentDocumentHash:p.getHash()}}).then(function(e){return t.concat(e.mostPossible.map(function(e){return{id:e.name,name:e.title+" : "+e.name,group:"Optimal",date:e.publishTime}}),e.other.map(function(e){return{id:e.name,name:e.title+" : "+e.name,group:"Rest",date:e.publishTime}}))}):Promise.resolve(t)}}});return[2,H["a"]({},t,{biSystem:this.getApi().ConfigManager.getConfig().biSystem,biExpressionType:a.isEnabled?a.Feature.type:undefined,biFeatures:H["a"]({},t.biFeatures,{hasMashupSupport:n.isEnabled}),blacklistedActions:(t.blacklistedActions||[]).concat([]),dataContexts:it["a"].getAllContexts().map(function(e){return e.DataContext}),commonTables:Object(z["v"])(U["a"].getCommonTableRepo(),function(e){return{id:e.hash,key:e.key,additionInformation:e.additionInformation,description:e.description}}),scalingGroups:Object.keys(Mt["b"].DataObjects.DocumentDO.getDocSettings(true).scalingGroups.value).filter(function(e){return e!==""}),trueChartExtensions:p.getAllExtensions().map(function(e){return{id:e.getId(),name:e.getTitle()}}),callbacks:H["a"]({},t["callbacks"],{onResetVariableCache:function(){r.clearUsedVariables();r.triggerDelayedRepaint();return HiCoMVCInit.paintingPromise.getPromise()},getVariableList:function(){var t=r.getUsedVariables();var e=Object(z["v"])(t,function(e){return H["a"]({},e,{used:true})});var i=Object(z["g"])(r.getVariables().filter(function(e){return!t[e.name]}));i.forEach(function(e){return e.value=""});return e.concat(i).filter(function(e){return!e.internal})},getLayoutDefinitions:function(){return Mt["b"].DataObjects.DocumentDO.getAllExtensions().map(function(e){return e.LayoutDefinition})}})})]}})})}function prePaintExtensions(e){var t=[],i={};e.forEach(function(e){return e.rebuildModels(t,i)});if(P){p.clearReferenceReplaceIds();Mt["b"].DataObjects.CommentRepo.updateRefrencesForSnapshot();P=false}buildScalingHelpers(t,i);e.forEach(function(e){return e.rebuildViews()});Mt["b"].DataObjects.DocumentDO.initViews(e)}function updateExtensionsLayout(e){var t=false;for(var i=0;i<e.length;i++){t=e[i].updateLayout()||t}return t}function paintIsNotAllowed(e){var t=false;if(!Mt["b"].DataObjects.DocumentDO.getConnector().varValuesReady().resolved){t=true}else if(e.some(function(e){return e.getMode()===Mt["b"].Utils.Enums.EMode.EDIT_COMMENT})){t=true}return t}function rebuildContexts(e){if(e===void 0){e=false}var t=it["a"].getAllContexts();for(var i=0;i<t.length;i++){var a=it["a"].getExtensionByContextCid(t[i].cid);if(a){p.setCurrentPaintingExtension(a);if(e){t[i].hasDimensions()&&at["a"].getInstance(t[i].cid).setupDataTypesByRules();continue}t[i].dataModel=null;Mt["b"].Models.Actions.ModelActions.ContextModel.buildAllContextDataModel(t[i],a,e)}}}function buildScalingHelpers(e,t){p.freeScalingHelpers=[null,null,null];for(var i=0;i<e.length;i++){var a=e[i];a.charts=Mt["b"].Factories.ModelFactory.buildScalingHelpers1(a.root,a.charts,t)}for(var i=0;i<e.length;i++){var a=e[i];a.charts=Mt["b"].Factories.ModelFactory.buildScalingHelpers2(a.root,a.charts,t);delete a.root.maximizedScalingGroups}}function updateScalingGroups(){if(Mt["b"].DataObjects.RuntimeDO.getUpdateScalingGroups()){var e=p.getDocSettings(true);if(e.userSpecific.value==="true"&&e.userSpecificScaling.value==="true"&&Mt["b"].DataObjects.RuntimeDO.getUser().userSpecific){D.dispatch("updateScalingGroups",{type:"user"})}else{D.dispatch("updateScalingGroups",{type:"document"})}Mt["b"].DataObjects.RuntimeDO.setUpdateScalingGroups(false)}}function mapExtension(e){var t=[];for(var i=0,a=p.getAllExtensions();i<a.length;i++){var n=a[i];p.setCurrentPaintingExtension(n);t.push(e(n))}return t}};Mt["b"].DataObjects.DocumentDO.prototype={getMediaData:function(e,t){var i=this.getConnector();if(t&&(i.isPrinting()||i.inStoryMode()||i.inPlayMode())){var a=this.getExtension(t);if(a){var n=a.getAdapter();if(n.isSnapshotItem()){return Promise.resolve(n.getSnapshotData("media")[e]||null)}}return Promise.resolve(null)}try{return c["a"].Instance.loadData(e)}catch(e){q["a"].warn(e);e.message.indexOf("initialize")!==0&&c["a"].initialize({storage:new u["a"]});return Promise.resolve(null)}},getExtensionByLayoutDefinitionId:function(e){for(var t=0,i=this.getAllExtensions();t<i.length;t++){var a=i[t];if(a.LayoutDefinition.id===e){return a}}return null},setUpExpressionModule:function(){var e=this.getApi().GlobalFeatureManager;X["a"].init({biType:e.Expression.isEnabled?e.Expression.Feature.type:undefined,decode:at["a"].decodeExpression,encode:at["a"].encodeExpression,evaluate:at["a"].evaluateExpression,resolve:at["a"].resolveExpression,checkResult:at["a"].checkExpressionResult})},setUpButtonModule:function(){var e=this.getApi().GlobalFeatureManager,t=e.Actions,i=e.Selection,a=e.Storage;var n=Object.keys(m.Instance.execute).concat(Object.keys(t.isEnabled?t.Feature.execute:{}));if(t.isEnabled){var r=t.Feature.unsupported||[];n=n.filter(function(e){return r.indexOf(e)===-1})}Object(o["initializeButton"])({optionProviderOptions:{actions:n,customActionParameters:Mt["b"].Connector.ConnectorHelper.Settings.customActionParameters,fontFamilies:Mt["b"].Connector.ConnectorHelper.Settings.additionalFonts},actionManagerOptions:{actions:H["a"]({},m.Instance.execute,t&&t.isEnabled?t.Feature.execute:{}),customTriggerObject:Mt["a"],preventActions:t&&t.isEnabled?t.Feature.preventActions.bind(t.Feature):undefined,onSelection:i.isEnabled?i.Feature.onSelection.bind(i.Feature):undefined},expressionProviderOptions:{evaluate:at["a"].evaluateExpression,resolve:at["a"].resolveExpression},mediaProviderOptions:a.isEnabled?{getMediaDataByUrl:this.getMediaData.bind(this)}:{}})},setUpComponentsModule:function(){d["a"].initialize({translation:Ot["a"]});var e=this.getApi().GlobalFeatureManager.Storage;var t=e&&e.isEnabled?e.Feature.media:undefined;p["a"].initialize({canUseMediaLibrary:!!t,isUpdatable:!this.getConnector().isPublished,storage:t})},setUpModelModule:function(){var t=this;var i=Mt["b"].DataObjects.RuntimeDO;var a;l["a"].initialize({initialDataTypes:v["a"],initialParameters:b["a"],getParameter:function(e){return i.getParameter(e)},getParameterParsed:function(e){return i.getParameterParsed(e)},getDisplayIdByMeasureId:function(e,t){return it["a"].getDisplayIdByMeasureId(e,t)},encodeFormula:function(e,t){return(a||(a=at["a"].getInstance())).encode(e,t)},decodeFormula:function(e,t){return(a||(a=at["a"].getInstance())).decode(e,t)},getExtensionIdByContextCid:function(e){return it["a"].getExtensionIdByContextCid(e)},customClickBehavior:Y["d"],createInitialLayout:function(e,t,i){return Mt["b"].Factories.ModelFactory.createInitialLayout(e,t,i)},onRootModelUpdate:function(e){return t.pushRootModelUpdate(e)},onContextModelUpdate:function(e){return t.pushContextModelUpdate(e)},updateRootModel:J["e"],Parameters:Mt["b"].Utils.Constants.Parameters,createRootContainer:Mt["b"].Factories.ModelFactory.createRootContainer,createSHA1Hash:function(e){return Z["a"].createSHA1Hash(e)},throwError:function(e){return t.getAllExtensions()[0].getCore().EventsManager.throwError(e)},getCommentById:function(e,t){return Mt["b"].DataObjects.CommentRepo.getCommentById(e,t)},getTranslation:function(e){return Ot["a"].getTranslation(e)},getFullContextTitle:function(e){return Mt["b"].DataObjects.ContextRepo.getFullContextTitle(e)},getAllContexts:function(){return Mt["b"].DataObjects.ContextRepo.getAllContexts()},getContextByCidOrThrow:function(e){return Mt["b"].DataObjects.ContextRepo.getContextByCidOrThrow(e)},getContextByCid:function(e){return Mt["b"].DataObjects.ContextRepo.getContextByCid(e)},isReadOnly:function(e){return Mt["b"].DataObjects.ContextRepo.isReadOnly(e)}});s["a"].initialize({ContextRepo:it["a"],onLayoutUpdate:this.pushLayoutDefinitionUpdate,onDataUpdate:this.pushContextModelUpdate})}};var T=i(579);Mt["b"].DataObjects=Mt["b"].DataObjects||{};Mt["b"].DataObjects.InlineCommentRepo=function(){var c={},C=Mt["b"].DataObjects.RuntimeDO,u=C.getFullUserName(),g=Mt["b"].DataObjects.CommonTableRepo,S=Ot["a"].getTranslation("ENTER_COMMENT"),M=Mt["b"].Utils.Format.DateChecker,O=Mt["b"].Utils.Constants.TypeValues.tableRepresentation,A="rgb(255, 0, 0)",_="rgb(150, 150, 150)",L="rgb(255, 255, 255)",I="rgb(0, 0, 0)",D="choose",R="end",P="DESIGN",a="TableModel",d="InlineModel",p="tc##";var N=Ot["a"].getTranslation("HELP_TABLE_MANDATORY_LIST"),w=Ot["a"].getTranslation("HELP_TABLE_NUMBER_COMMENT"),F=Ot["a"].getTranslation("HELP_TABLE_DATE_COMMENT"),B=Ot["a"].getTranslation("HELP_TABLE_MANDATORY_COMMENT"),k=Ot["a"].getTranslation("HELP_TABLE_MANDATORY_FLAG");this.getInlineCommentRepo=function(){return c};function getInlineRepoAndRepresentation(e,t,i,a){var n={obj:null,repo:c[e]};if(!n.repo){n.repo=c[e]=[]}else{n.obj=getRepresentationFromRepository(n.repo,t,i,a)}return n}function getCommonRepoAndRepresentation(e,t,i,a){var n={obj:null,repo:g.getCommonTable(e).inlineComments};n.obj=getRepresentationFromRepository(n.repo,t,i,a);return n}this.setInlineComment=function(e,t,i){var a=Mt["b"].Factories.ModelFactory.getModelById(i.getController().getRootModel(),e.id.split(".")[0]);if(a){var n=a.extendedModel,r=Mt["b"].DataObjects.ContextRepo.getContextAndExtensionByCid(n.contextId);if(r.extension.getId()!==i.getId()){i=r.extension}var o=e.commonTable,l=e.type,s=e.saveName,d=void 0,c=void 0;if(o){d=generateTcKey(e.dataId_dim,n.input,e.addKeyVariable);c=getCommonRepoAndRepresentation(o,d,l,s)}else{d=generateTcKey(e.dataId_dim,n.input,e.addKeyVariable,i.getName());c=getInlineRepoAndRepresentation(i.getId(),d,l,s)}if(c.obj){if(c.obj.value!==t){c.obj.changed=true;c.obj.lastModified=h["a"].createFormattedDate();c.obj.lastModifiedBy=u;c.obj.value=t}updateRepoAndCommentObj(c.obj,e)}else{c.obj=createRepresentationObject(e,t,n.input);if(o){updateCommonRepresentationObject(c.obj,e,n.input,o);g.deleteEmptyInlineComment(o,c.obj)}else{updateInlineRepresentationObject(c.obj,e,n.input,i)}c.obj.changed=true;c.obj.lastModified=h["a"].createFormattedDate();c.obj.lastModifiedBy=u;c.repo.push(c.obj)}c.obj.dataId_dim=e.dataId_dim;this.setInlineCommentData(e,c.obj,true,i)}};function updateRepoAndCommentObj(e,t){e.edit=t.edit;e.isDate=t.isDate;e.number=t.number;e.mandatory=t.mandatory;e.visible=!t.hide;e.realease=t.release;if(t.type===O.LIST){e.listContent=t.listContent}e.addKeyVariable=resolveVariableId(e.addKeyVariable)}this.addInlineCommentToRepository=function(e,t,i){if(t.hide){return}if(t.type===O.LIST){if(t.text===0||t.text==="0"||t.text==null||t.text===""){return}}else if(t.type===O.COMMENT){if(t.text===t.placeholderText||t.text==null||t.text===""){return}var a=Mt["b"].Utils.DOM.strip(t.text);if(a===t.placeholderText||a==null||a===""){return}}else if(t.type===O.FLAG){if(t.text===""||t.text==null){return}}var n=t.commonTable;var r=t.type;var o=t.saveName;var l,s;if(n){l=generateTcKey(t.dataId_dim,e.input,t.addKeyVariable);s=getCommonRepoAndRepresentation(n,l,r,o)}else{l=generateTcKey(t.dataId_dim,e.input,t.addKeyVariable,i.getName());s=getInlineRepoAndRepresentation(i.getId(),l,r,o)}if(!s.obj){s.obj=createRepresentationObject(t,t.text,e.input);if(n){updateCommonRepresentationObject(s.obj,t,e.input,n);g.deleteEmptyInlineComment(n,s.obj)}else{updateInlineRepresentationObject(s.obj,t,e.input,i)}s.obj.dataId_dim=t.dataId_dim;s.obj.changed=false;s.obj.build=true;s.repo.push(s.obj)}else if(s.obj.build){var d=createRepresentationObject(t,t.text,e.input);updateBuildRepresentationObject(s.obj,d)}if(s.obj&&s.obj.invalid&&t.color&&t.color.pattern!=A){delete s.obj.invalid}};this.checkAllModelsForValidity=function(e,t){if(e){var i=e.length-1;while(0<=i){if(e[i].dataId_expr===t&&e[i].instanceOf===d){if(e[i].tooltip&&!e[i].hide){return false}}i--}}return true};this.loadComment=function(e,t){c[t.getId()]=e};this.getSingleComment=function(e,t,i,a,n,r){var o=c[e.getId()];if(o){var l=generateTcKey(t,a.input,r,e.getName());var s=getRepresentationFromRepository(o,l,i,n);if(s){return s}if(!r){var d=getRepresentationFromRepository(o,deprecated_generateTcKey(t,a.input,e),i,n);if(d){d.tcKey=l;return this.getSingleComment(e,t,i,a,n,r)}}}return null};this.setInlineCommentData=function(e,t,i,a){if(e.type!==t.type){e.hide=true;e.listContent=t.listContent;return}var n=Mt["b"].DataObjects.DocumentDO.getDocSettings();var r=false;if(t.visible!=null){var o=typeof t.visible==="string"?t.visible==="true":t.visible;r=!o}var l=null;var s=t.value,d=t.lastModified,c=t.lastModifiedBy;if(typeof t.listContent==="string"){t.listContent=JSON.parse(t.listContent)}var u=t.listContent;var p=typeof t.mandatory==="string"?t.mandatory==="true":t.mandatory;var g=typeof t.number==="string"?t.number==="true":t.number;var h=typeof t.isDate==="string"?t.isDate==="true":t.isDate;var f=t.maxLength;var m=typeof t.edit==="string"?t.edit==="true":t.edit;var v=t.transport;var b=t.saveName;var T=t.placeholderText;if(!T){T=S}m=m&&n.documentMode.value===P&&a.getMode()!==Mt["b"].Utils.Enums.EMode.READ_ONLY&&!Mt["b"].DataObjects.DocumentDO.preventLeftClickAndActions();e.color={border:I,background:L,pattern:I};if(e.type===O.LIST){for(var x=0;x<u.length;x++){if(u[x].key===""){break}if(u[x].key===s){s=x;break}}if(s===t.value){s=0}if(u[s].key===D){if(!m){r=true}if(p){e.color.pattern=A;l=N}else{e.color.pattern=_}}}else if(e.type===O.COMMENT){var E=Mt["b"].Utils.DOM.strip(s);if(s==null||E==null||E=="null"||E===T||E===""){s=T;E=T;e.color.pattern=_}if(g&&E!==T){e.textAnchor=R;var y=E;if(i){y=y.replace(n.negativeStyle.value,"-").split(n.thousandSep.value).join("").replace(n.decimalSep.value,".");if(isNaN(y)){e.color.pattern=A;l=w}else{s=createDisplayValue(y,n);t.value=y}}else{if(isNaN(y)){y=y.replace(n.negativeStyle.value,"-").split(n.thousandSep.value).join("").replace(n.decimalSep.value,".");if(isNaN(y)){e.color.pattern=A;l=w}else{s=createDisplayValue(y,n)}}else{s=createDisplayValue(y,n)}}}else if(h===true&&E!==T){M.setDateFormat(n.dateFormat.value);if(M.checkDate(E)===false){e.color.pattern=A;l=F}}else if(g){e.textAnchor=R}if(p&&E===T){e.color.pattern=A;l=B}if(!m&&(E===null||E===T||l!=null)){r=true}}else if(e.type===O.FLAG){s=typeof s==="string"?s==="true":s;if(p&&s===false&&m){e.color.border=A;l=k}else{e.color.border=_}}if(i){if(e.color.pattern==A){t.invalid=true}else if(t.invalid){delete t.invalid}}e.edit=m;e.isDate=h;e.number=g;e.mandatory=p;e.hide=r;e.tooltip=l;if(e.type===O.LIST){e.text=u[s].description;e.originalText=u[s].originalDescription;e.key=u[s].key}else{e.text=s;e.originalText=s}e.lastModified=d;e.lastModifiedBy=c;e.maxLength=f;e.listContent=u;e.saveName=b;e.color.background=e.edit?C.getParameter("COLOR_TEXT_BACKGROUND"):L;e.release=t.release;e.transport=v;e.placeholderText=T};function createDisplayValue(e,t){if(isNaN(e)){throw"createDisplayValue expected a valid number string for formatting"}var i=e.split(".");var a=i[0];var n=a.substring(0,1)=="-";if(isNaN(a.substring(0,1))){a=a.substring(1,a.length)}var r="";var o=a.length;while(--o>=0){r=a.substring(o,o+1)+r;if((o-a.length)%3==0&&o>0){r=t.thousandSep.value+r}}var l="";if(n){l=t.negativeStyle.value}l+=r;if(i.length>1){l+=t.decimalSep.value+i[1]}return l}this.updateSaveNamesInline=function(e,i,a,n,r,o){var t=c[n.getId()];if(t){var l=Mt["b"].DataObjects.ContextRepo.getContextByCid(r.contextId);var s=Mt["b"].Models.Actions.DataModelActions.getMultipleDimensions(l.dataModel,0);var d=[];s.forEach(function(e){var t=Mt["b"].DataObjects.InlineCommentRepo.getSingleComment(n,e.path,a,r,i,o.addKeyVariable);t&&d.push(t)});updateSaveNames(d,e,i,a)}};this.updateCreatedInlineCommentsListContent=function(e,t,i,a){var n=c[t.getId()];if(n){updateListContent(n,e,i,a)}};this.updateCreateInlineCommentsTransport=function(e,t,i,a){var n=c[t.getId()];if(n){updateTransport(n,e,i,a)}};this.getRepresentationInlineCommentObjects=function(e,t,i){var a=c[e.getId()];var n=[];if(a){var r=a.length;while(r--){var o=a[r];var l=i?o.changed:true;if(l&&o.value!==o.placeholderText&&!o.invalid&&(o.value!==0&&o.value!==""||!o.build)){var s=createRepresentationObject(o,o.value,t.extendedModel.input);updateInlineRepresentationObject(s,o,t.extendedModel.input,e);n.push(s);o.changed=false;delete o.build}}}return n};this.getReleaseRepresentations=function(e,t,i){function traverse(e){if(e){if(e.extendedModel&&e.extendedModel.instanceOf===a){getReleaseRepresentations(e)}else if(e.children){for(var t=0,i=e.children.length;t<i;t++){if(e.children[t].extendedModel&&e.children[t].extendedModel.instanceOf===a){getReleaseRepresentations(e.children[t])}else{traverse(e.children[t])}}}}}function getReleaseRepresentations(e){for(var t=0,i=e.children.length;t<i;t++){var a=e.children[t];if(a.instanceOf!==d){continue}var n={};if(a.saveName===s){var r=generateTcKey(a.dataId_dim,e.extendedModel.input,a.addKeyVariable,l.getName());n={tcKey:r,saveName:a.saveName,type:a.type};o.push(n)}}}var o=[];var l=e;var s=i;traverse(t.rootContainerModel);return o};function resolveVariableId(e){if(e!=null){var t=Mt["b"].DataObjects.DocumentDO.getVariableById(e);if(t){return t.name}}return e}function createRepresentationObject(e,t,i){var a={};a.loggable=i.loggable;a.keyColumns=i.keyColumns;a.releaseVariable=i.releaseVariable;a.keyVariable=resolveVariableId(i.keyVariable);a.editVariable=i.editVariable;a.showVariable=i.showVariable;a.saveVariable=i.saveVariable;a.type=e.type;a.number=e.number;a.edit=e.edit;a.mandatory=e.mandatory;a.listContent=e.listContent;a.maxLength=e.maxLength;a.saveName=e.saveName;a.value=t;a.release=e.release;a.isDate=e.isDate;a.transport=e.transport;a.addKeyVariable=e.addKeyVariable;a.placeholderText=e.placeholderText;a.lastModifiedBy=e.lastModifiedBy;a.lastModified=e.lastModified;return a}function updateInlineRepresentationObject(e,t,i,a){if(t.tcKey){e.tcKey=t.tcKey}else{e.tcKey=generateTcKey(t.dataId_dim,i,t.addKeyVariable,a.getName())}}function updateCommonRepresentationObject(e,t,i,a){e.commonTable=a;if(t.tcKey){e.tcKey=t.tcKey}else{e.tcKey=generateTcKey(t.dataId_dim,i,t.addKeyVariable)}}function updateBuildRepresentationObject(e,t){e.loggable=t.loggable;e.keyColumns=t.keyColumns;e.releaseVariable=t.releaseVariable;e.keyVariable=t.keyVariable;e.editVariable=t.editVariable;e.showVariable=t.showVariable;e.saveVariable=t.saveVariable;e.addKeyVariable=t.addKeyVariable;e.type=t.type;e.number=t.number;e.edit=t.edit;e.mandatory=t.mandatory;e.listContent=t.listContent;e.maxLength=t.maxLength;e.saveName=t.saveName;e.release=t.release;e.isDate=t.isDate;e.transport=t.transport}function getRepresentationFromRepository(e,t,i,a){var n=e.length;while(n--){var r=e[n];if(r.tcKey===t&&r.type===i&&r.saveName===a){return r}}return null}function deprecated_generateTcKey(e,t,i){var a=Mt["b"].DataObjects.DocumentDO.getVariableById(t.keyVariable);var n=a?i.getName()+a.value:i.getName();var r=e.split("@");for(var o=0,l=t.keyColumns.length;o<l;o++){var s=parseInt(t.keyColumns[o].id.split(".").pop().replace("dim",""));n+=r[s]}return n}this.getRepoAndRepresentationByViewModel=function(e){var t=e.getModel(),i=t.commonTable,a=Mt["b"].DataObjects.DocumentDO.getExtension(e.getController().getRootModel().extensionHash),n=Mt["b"].Factories.ModelFactory.getModelById(a.getController().getRootModel(),t.id.split(".")[0]),r=n.extendedModel,o;if(i){o=generateTcKey(t.dataId_dim,r.input,t.addKeyVariable);return getCommonRepoAndRepresentation(i,o,t.type,t.saveName)}else{o=generateTcKey(t.dataId_dim,r.input,t.addKeyVariable,a.getName());return getInlineRepoAndRepresentation(a.getId(),o,t.type,t.saveName)}};function generateTcKey(e,t,i,a){var n=a?a+p:"";var r=e.split("@");for(var o=0;o<t.keyColumns.length;o++){var l=parseInt(t.keyColumns[o].id.split(".").pop().replace("dim",""));n+=r[l]+p}var s=[t.keyVariable,i];for(var d=0;d<s.length;d++){var c=Mt["b"].DataObjects.DocumentDO.getVariableById(s[d]);if(!c){c=Mt["b"].DataObjects.DocumentDO.getVariable(s[d])}if(c){n+=c.value+p}}return n.substring(0,n.lastIndexOf(p))}function updateSaveNames(e,t,i,a){var n=e.length;while(n--){if(e[n].type===a&&e[n].saveName===i){e[n].saveName=t}}}function updateListContent(e,t,i,a){var n=e.length;while(n--){if(e[n].saveName===t&&e[n].build===true&&e[n].type===a){e[n].listContent=i}}}function updateTransport(e,t,i,a){var n=e.length;while(n--){if(e[n].saveName===t&&e[n].type===i&&e[n].transport!==a){e[n].transport=a;if(e[n].lastModified){e[n].changed=true}}}}this.loadCommonComments=function(e){var t=[];for(var i=0;i<e.length;i++){var a=e[i];for(var n=0;n<a.length;n++){var r=a[n];var o={commonTableHash:r.commonTable,type:r.representationType,saveName:r.saveName,tcKeys:[]};for(var l=0;l<r.dataId_dims.length;l++){var s=this.getSingleCommonComment(r.commonTable,r.dataId_dims[l],r.representationType,r.extendedModel,r.saveName,r.addKeyVariable,false);if(null===s||!s.hide){var d=generateTcKey(r.dataId_dims[l],r.extendedModel.input,r.addKeyVariable);var c={tcKey:d,saveName:r.saveName,type:r.representationType};if(!g.hasEmptyInlineComment(r.commonTable,c)){g.addEmptyInlineComment(r.commonTable,c);o.tcKeys.push(d)}}}if(o.tcKeys.length>0){addToRequestDati(t,o)}}}if(t.length>0){var u=Mt["b"].DataObjects.DocumentDO.getDocumentController().dispatch("getCommonTableComments",t);for(var p=0;p<u.length;p++){g.addInlineComment(u[p].commonTable,u[p])}}};function addToRequestDati(e,t){var i=null;for(var a=0;a<e.length;a++){if(e[a].commonTable==t.commonTableHash){i=e[a];break}}if(!i){i={commonTable:t.commonTableHash,comments:[]};e.push(i)}var n=null;for(var a=0;a<i.comments.length;a++){if(i.comments[a].type==t.type&&i.comments[a].saveName==t.saveName){n=i.comments[a];break}}if(!n){n={type:t.type,saveName:t.saveName,tcKeys:[]};i.comments.push(n)}n.tcKeys.push.apply(n.tcKeys,t.tcKeys)}this.getSingleCommonComment=function(e,t,i,a,n,r,o){var l=g.getCommonTable(e);if(undefined===l){return{hide:true}}l=l.inlineComments;var s=generateTcKey(t,a.input,r);var d=getRepresentationFromRepository(l,s,i,n);if(d===null&&o){if(!g.hasEmptyInlineComment(e,{tcKey:s,type:i,saveName:n})){var c=Mt["b"].DataObjects.DocumentDO.getDocumentController().dispatch("getCommonInlineComment",{commonTable:e,tcKey:s,type:i,saveName:n});if(c){g.addInlineComment(e,c);return c}else{g.addEmptyInlineComment(e,{tcKey:s,type:i,saveName:n})}}}return d};this.updateSaveNamesCommon=function(e,i,a,n,r,o){if(g.hasCommonTable(n)){var t=Mt["b"].DataObjects.ContextRepo.getContextByCid(r.contextId);var l=Mt["b"].Models.Actions.DataModelActions.getMultipleDimensions(t.dataModel,0);var s=[];l.forEach(function(e){var t=Mt["b"].DataObjects.InlineCommentRepo.getSingleCommonComment(n,e.path,a,r,i,o.addKeyVariable,false);t&&s.push(t)});updateSaveNames(s,e,i,a)}};this.updateCreatedCommonCommentsListContent=function(e,t,i,a){var n=g.getCommonTable(t);if(undefined!==n){n=n.inlineComments;updateListContent(n,e,i,a)}};this.updateCreateCommonCommentsTransport=function(e,t,i,a){var n=g.getCommonTable(t);if(undefined!==n){n=n.inlineComments;updateTransport(n,e,i,a)}};this.getRepresentationCommonCommentObjects=function(e,t,i){var a=g.getCommonTable(e);if(undefined===a){return[]}var a=a.inlineComments;var n=[];var r=a.length;while(r--){var o=a[r];var l=i?o.changed:true;if(l&&o.value!==o.placeholderText&&!o.invalid&&(o.value!==0&&o.value!==""||!o.build)){var s=createRepresentationObject(o,o.value,t.extendedModel.input);updateCommonRepresentationObject(s,o,t.extendedModel.input,e);n.push(s);o.changed=false;delete o.build}}return n}};var x=i(487);var E=function(){function ParameterSetsDefinition(){this.valueTypeIds=["FACTOR_AMOUNT","FACTOR_QUANTITY","FACTOR_RELATION"];this.valueTypeTranslations=[Ot["a"].getTranslation("AMOUNT"),Ot["a"].getTranslation("QUANTITY"),Ot["a"].getTranslation("RELATION")];this.timeValueTypeIds=["FACTOR_YEAR","FACTOR_QUARTER","FACTOR_MONTH","FACTOR_WEEK","FACTOR_DAY"];this.timeRepresentationTypeIds=["timeRepresentationType.0","timeRepresentationType.1","timeRepresentationType.2","timeRepresentationType.3","timeRepresentationType.4","timeRepresentationType.5","timeRepresentationType.6","timeRepresentationType.7"];this.timeRepresentationTypeTranslations=["-",Ot["a"].getTranslation("BAR"),Ot["a"].getTranslation("RODS"),Ot["a"].getTranslation("WATERFALL"),Ot["a"].getTranslation("LINE"),Ot["a"].getTranslation("SYMBOL"),Ot["a"].getTranslation("SYMBOL_LINE"),Ot["a"].getTranslation("VALUE")];this.timePositionTypeIds=["timePositionType.0","timePositionType.1","timePositionType.2","timePositionType.3","timePositionType.4","timePositionType.5","timePositionType.6"];this.timePositionTypeTranslations=[Ot["a"].getTranslation("LEFT_LEFT"),Ot["a"].getTranslation("MID_LEFT"),Ot["a"].getTranslation("LEFT"),Ot["a"].getTranslation("MID"),Ot["a"].getTranslation("RIGHT"),Ot["a"].getTranslation("MID_RIGHT"),Ot["a"].getTranslation("RIGHT_RIGHT")];this.timeBarWaterfallPositionTypeIds=["timePositionType.2","timePositionType.3","timePositionType.4"];this.timeBarWaterfallPositionTypeTranslations=[Ot["a"].getTranslation("LEFT"),Ot["a"].getTranslation("MID"),Ot["a"].getTranslation("RIGHT")];this.timeTypeIds=["timeType.0","timeType.1","timeType.2","timeType.3"];this.timeTypeTranslations=[Ot["a"].getTranslation("PAST_PAST"),Ot["a"].getTranslation("PAST"),Ot["a"].getTranslation("PRESENT"),Ot["a"].getTranslation("FUTURE")];this.timeLegendTypeIds=["-","LeftValue","LeftAxis","LeftMiddle","RightValue","RightAxis","RightMiddle"];this.timeLegendTypeTranslations=["-",Ot["a"].getTranslation("LEFT_VALUE"),Ot["a"].getTranslation("LEFT_AXIS"),Ot["a"].getTranslation("LEFT_MIDDLE"),Ot["a"].getTranslation("RIGHT_VALUE"),Ot["a"].getTranslation("RIGHT_AXIS"),Ot["a"].getTranslation("RIGHT_MIDDLE")];this.structureRepresentationTypeIds=["structureRepresentationType.0","structureRepresentationType.1","structureRepresentationType.2","structureRepresentationType.3","structureRepresentationType.4","structureRepresentationType.5","structureRepresentationType.6","structureRepresentationType.7"];this.structureRepresentationTypeTranslations=["-",Ot["a"].getTranslation("BAR"),Ot["a"].getTranslation("NEEDLE"),Ot["a"].getTranslation("WATERFALL"),Ot["a"].getTranslation("LINE"),Ot["a"].getTranslation("SYMBOL"),Ot["a"].getTranslation("SYMBOL_LINE"),Ot["a"].getTranslation("VALUE")];this.tableRepresentationTypeIds=["tableRepresentationType.0","tableRepresentationType.1","tableRepresentationType.2","tableRepresentationType.3","tableRepresentationType.4","tableRepresentationType.5","tableRepresentationType.6","tableRepresentationType.7","tableRepresentationType.8","tableRepresentationType.9","tableRepresentationType.10"];this.tableRepresentationTypeTranslations=["-",Ot["a"].getTranslation("VALUE"),Ot["a"].getTranslation("BAR"),Ot["a"].getTranslation("NEEDLE"),Ot["a"].getTranslation("WATERFALL"),Ot["a"].getTranslation("LINE"),Ot["a"].getTranslation("SYMBOL"),Ot["a"].getTranslation("SYMBOL_LINE"),Ot["a"].getTranslation("LIST"),Ot["a"].getTranslation("COMMENT"),Ot["a"].getTranslation("FLAG")];this.tableLegendTypeIds=["none","left","center","right","notation"];this.tableLegendTypeTranslations=["-",Ot["a"].getTranslation("LEFT"),Ot["a"].getTranslation("CENTER"),Ot["a"].getTranslation("RIGHT"),Ot["a"].getTranslation("NOTATION")];this.structurePositionTypeIds=["structurePositionType.0","structurePositionType.1","structurePositionType.2","structurePositionType.3","structurePositionType.4","structurePositionType.5","structurePositionType.6"];this.structurePositionTypeTranslations=[Ot["a"].getTranslation("TOP_TOP"),Ot["a"].getTranslation("MID_TOP"),Ot["a"].getTranslation("TOP"),Ot["a"].getTranslation("MID"),Ot["a"].getTranslation("BOTTOM"),Ot["a"].getTranslation("MID_BOTTOM"),Ot["a"].getTranslation("BOTTOM_BOTTOM")];this.structureBarWaterfallPositionTypeIds=["structurePositionType.2","structurePositionType.3","structurePositionType.4"];this.structureBarWaterfallPositionTypeTranslations=[Ot["a"].getTranslation("TOP"),Ot["a"].getTranslation("MID"),Ot["a"].getTranslation("BOTTOM")];this.structureLegendTypeIds=["structureLegendType.0","structureLegendType.1","structureLegendType.2","structureLegendType.3","structureLegendType.4","structureLegendType.5","structureLegendType.6"];this.structureLegendTypeTranslations=["-",Ot["a"].getTranslation("TOP_VALUE_POSITION"),Ot["a"].getTranslation("TOP_AXIS"),Ot["a"].getTranslation("TOP_MIDDLE"),Ot["a"].getTranslation("BOTTOM_VALUE_POSITION"),Ot["a"].getTranslation("BOTTOM_AXIS"),Ot["a"].getTranslation("BOTTOM_MIDDLE")];this.notationTypeIds=["notationType.0","notationType.1","notationType.2","notationType.3","notationType.4"];this.notationTypeTranslations=[Ot["a"].getTranslation("ELEMENT"),Ot["a"].getTranslation("AXIS"),Ot["a"].getTranslation("HEADER"),Ot["a"].getTranslation("ELEMENT_HEADER"),Ot["a"].getTranslation("ELEMENT_AXIS")];this.timeNotationTypeIds=["notationType.0","notationType.1","notationType.4"];this.timeNotationTypeTranslations=[Ot["a"].getTranslation("ELEMENT"),Ot["a"].getTranslation("AXIS"),Ot["a"].getTranslation("ELEMENT_AXIS")];this.conceptTypeIds=["conceptType.0","conceptType.1","conceptType.2","conceptType.3","conceptType.4","conceptType.6","conceptType.5"];this.conceptTypeTranslations=[Ot["a"].getTranslation("AREA"),Ot["a"].getTranslation("COLOR"),Ot["a"].getTranslation("SHAPE"),Ot["a"].getTranslation("AREA_SHAPE"),Ot["a"].getTranslation("AREA_COLOR"),Ot["a"].getTranslation("COLOR_SHAPE"),Ot["a"].getTranslation("AREA_COLOR_SHAPE")];this.shapeTypeIds=["square","triangle","diamond","circle"];this.shapeTypeTranslations=[Ot["a"].getTranslation("SQUARE"),Ot["a"].getTranslation("TRIANGLE"),Ot["a"].getTranslation("DIAMOND"),Ot["a"].getTranslation("CIRCLE")];this.otherTypeIds=["diagonal","diamond","circle","zickzack","chess","filled","empty"];this.otherTypeTranslations=[Ot["a"].getTranslation("DIAGONAL"),Ot["a"].getTranslation("DIAMOND"),Ot["a"].getTranslation("CIRCLE"),Ot["a"].getTranslation("ZICKZACK"),Ot["a"].getTranslation("CHESS"),Ot["a"].getTranslation("FILLED"),Ot["a"].getTranslation("EMPTY")];this.lineTypeIds=["solid","dashed","dotted"];this.lineTypeTranslations=[Ot["a"].getTranslation("SOLID"),Ot["a"].getTranslation("DASHED"),Ot["a"].getTranslation("DOTTED")];this.elementTypeTranslations=[Ot["a"].getTranslation("STRUCTURE"),Ot["a"].getTranslation("TABLE"),Ot["a"].getTranslation("TIME")];this.elementTypeStrings=["structure","table","time"];this.elementTypeIcons=["structure.png","table.png","time.png"];this.interpretationTypeIds=["interpretationType.0","interpretationType.1","interpretationType.2"];this.interpretationTypeTranslations=[Ot["a"].getTranslation("NORMAL"),Ot["a"].getTranslation("SUBTOTAL"),Ot["a"].getTranslation("TOTAL")];this.categoryLabelTypeIds=["categoryLabelType.0","categoryLabelType.1","categoryLabelType.2"];this.categoryLabelTypeTranslations=["-",Ot["a"].getTranslation("AXIS"),Ot["a"].getTranslation("FREE_AXIS_POSITION")];this.calculationTypeIds=["calculationType.0","calculationType.1"];this.calculationTypeTranslations=[Ot["a"].getTranslation("SUMMATION"),Ot["a"].getTranslation("CUMULATION")];this.dataTypeIds=["Actual","Budget","Forecast"];this.dataTypeTranslations=[Ot["a"].getTranslation("ACTUAL"),Ot["a"].getTranslation("BUDGET"),Ot["a"].getTranslation("FORECAST")];this.dimSortingOrderTypeIds=["dimSortingOrderType.0","dimSortingOrderType.1","dimSortingOrderType.2"];this.dimSortingOrderTypeTranslations=["-",Ot["a"].getTranslation("ARROW_UP"),Ot["a"].getTranslation("ARROW_DOWN")];this.dimSortingTypeTypeIds=["dimSortingTypeType.0","dimSortingTypeType.1"];this.dimSortingTypeTypeTranslations=["%","n"];this.dimSortingTargetTypeIds=["dimSortingTargetType.0"];this.dimSortingTargetTypeTranslations=[Ot["a"].getTranslation("SELF")];this.dimAdditionOrderTypeIds=["dimAdditionOrderType.0","dimAdditionOrderType.1","dimAdditionOrderType.2"];this.dimAdditionDynTypeIds=["000","100","010","001"];this.dimAdditionDynTypeTranslations=[Ot["a"].getTranslation("NONE"),Ot["a"].getTranslation("FIRST"),Ot["a"].getTranslation("REST"),Ot["a"].getTranslation("TOTAL")];this.categoriesWithoutValuesTypeIds=["categoryWithoutValuesType.0","categoryWithoutValuesType.1"];this.categoriesWithoutValuesTypeTL=[Ot["a"].getTranslation("UNCOLLAPSED"),Ot["a"].getTranslation("COLLAPSED")];this.axisCategoryAlignments=["Start","Mid","End"];this.axisCategoryAlignmentsTL=[Ot["a"].getTranslation("START"),Ot["a"].getTranslation("MID"),Ot["a"].getTranslation("END")];this.outlierStyles=["symbol-value","value-symbol"];this.outlierStylesTL=[Ot["a"].getTranslation("SYMBOL_AT_AXIS_VALUE_AT_VALUE"),Ot["a"].getTranslation("SYMBOL_AT_VALUE_VALUE_AT_AXIS")];this.emptySpacePositionTypeIds=["start","end"];this.emptySpacePositionTypeTranslations=[Ot["a"].getTranslation("START"),Ot["a"].getTranslation("END")];this.availableFactors=function(){var e=[];for(var t=-9;t<10;t++){e.push(Math.pow(10,t))}return e}();this.valueLabelTypes=["normal","%-self","%-stack","%-total"];this.valueLabelTypesTL=[Ot["a"].getTranslation("NORMAL"),Ot["a"].getTranslation("PERCENT_SELF"),Ot["a"].getTranslation("PERCENT_STACK"),Ot["a"].getTranslation("PERCENT_TOTAL")];this.stackTypes=["normal","%"];this.stackTypesTL=[Ot["a"].getTranslation("NORMAL"),"%"];this.monthsList=[Ot["a"].getTranslation("JANUARY"),Ot["a"].getTranslation("FEBRUARY"),Ot["a"].getTranslation("MARCH"),Ot["a"].getTranslation("APRIL"),Ot["a"].getTranslation("MAY"),Ot["a"].getTranslation("JUNE"),Ot["a"].getTranslation("JULY"),Ot["a"].getTranslation("AUGUST"),Ot["a"].getTranslation("SEPTEMBER"),Ot["a"].getTranslation("OCTOBER"),Ot["a"].getTranslation("NOVEMBER"),Ot["a"].getTranslation("DECEMBER")];this.daysList=[Ot["a"].getTranslation("SUNDAY"),Ot["a"].getTranslation("MONDAY"),Ot["a"].getTranslation("TUESDAY"),Ot["a"].getTranslation("WEDNESDAY"),Ot["a"].getTranslation("THURSDAY"),Ot["a"].getTranslation("FRIDAY"),Ot["a"].getTranslation("SATURDAY"),Ot["a"].getTranslation("SUNDAY")];this.LDAP="dGhhdCdzRm9ySGlDb01WQw==";this.documentModesValue=["DESIGN","PRESENTATION"];this.multiButtonActions=["ToggleShowEditMode","SaveComments","SaveCommentsInApp","SaveObject","Refresh","ExportAsPDF","ExportAsImage","ExportAsVectorGraphic","ExportAsExcel","ReloadComments"];this.multiButtonActionsTL=[Ot["a"].getTranslation("TOGGLE_SHOW_EDIT_MODE"),Ot["a"].getTranslation("SAVE_COMMENTS"),Ot["a"].getTranslation("SAVE_COMMENTS_IN_APP"),Ot["a"].getTranslation("SAVE_OBJECT"),Ot["a"].getTranslation("REFRESH"),Ot["a"].getTranslation("EXPORT_AS_PDF"),Ot["a"].getTranslation("EXPORT_AS_PNG"),Ot["a"].getTranslation("EXPORT_AS_EMF"),Ot["a"].getTranslation("EXPORT_AS_XLS"),Ot["a"].getTranslation("RELOAD_COMMON_TABLES")];ParameterSetsDefinition._instance=this}Object.defineProperty(ParameterSetsDefinition,"Instance",{get:function(){return ParameterSetsDefinition._instance||new ParameterSetsDefinition},enumerable:true,configurable:true});return ParameterSetsDefinition}();var y=i(409);var oe=i(515);Mt["b"].DataObjects.RuntimeDO=function(e,t,i){var a=this;var n=e.notationManual;var r=n;var o=JSON.stringify(n);var s=e.notationManualLocalVersion?JSON.stringify(e.notationManualLocalVersion):o;var l=null;var d=null;var c=null;var u="";var p={};var g=false;var h=0;var f=null;var m=false;var v=true;var b=null;setUser(t);init();function init(){Mt["b"].Utils.Constants.ParameterSets=new E;if(i){pe["a"].hasService=false;return}if(b.userSpecific&&b.userSpecific.documentMode){u=b.userSpecific.documentMode.value}if(!pe["a"].hasService&&b.userSpecific&&b.userSpecific.scalingGroups&&b.userSpecific.scalingGroups.value instanceof String){console.error("HICO-40817: Workaround for broken user scaling groups ")}parseScalingGroups();Mt["b"].Utils.Mobile.onPointerDown(document.body,function(e){var t=e.target;if(t){if(typeof x["a"].isOpen==="function"&&x["a"].isOpen()&&!Mt["b"].$(t).closest(".tc-contextmenu").length){x["a"].close()}if(t.id!=="HiCoInlineCommentListSelectBox"&&t.parentNode&&t.parentNode.parentNode&&t.parentNode.parentNode.id!=="HiCoInlineCommentListSelectBox"){Mt["b"].Utils.DOM.enableInlineCommentRows();Mt["b"].$("#HiCoInlineCommentListSelectBox").remove()}}});document.addEventListener("keydown",function(e){if(e.keyCode===27){if(typeof x["a"].isOpen==="function"&&x["a"].isOpen()){x["a"].close()}Mt["b"].DataObjects.DocumentDO.getAllExtensions().forEach(function(e){var t=e.getController(),i=t.getRootModel();i.selectedChart="";if(e.getMode()===Mt["b"].Utils.Enums.EMode.COMPARE||i.isCompareMode){t.dispatch("updateDisableCompareCollecting",{extension:e})}})}});document.documentElement.addEventListener("touchmove",function(e){if(pe["a"].onTouchMove){e.preventDefault()}},{passive:false});window.oncontextmenu=function(e){e.preventDefault();return false}}function parseScalingGroups(){if(b.userSpecific&&b.userSpecific.scalingGroups){var e=b.userSpecific.scalingGroups;if(e.value==null||e.value===""||e.value==="null"){e.value={}}else if(typeof e.value==="string"){e.value=JSON.parse(e.value);if(typeof e.value==="string"){e.value=JSON.parse(e.value)}}}}this.setPresentationMode=function(){T("PRESENTATION",[Y["c"].Permissions.Consumer])};this.setDesignMode=function(){var e=a.getOriginalUserPermissions();if(!e){q["a"].error("Invalid user permissions")}T(u||e.indexOf(Y["c"].Permissions.Designer)===-1?"PRESENTATION":"DESIGN",e)};var T=function(e,t){if(!b){return}b.permissions=t||[];var i=Mt["b"].DataObjects.DocumentDO.getDocSettings&&Mt["b"].DataObjects.DocumentDO.getDocSettings(true).userSpecific.value;if((!i||i==="true")&&b.userSpecific&&b.userSpecific.documentMode&&b.userSpecific.documentMode.value){b.userSpecific.documentMode.value=e}};this.getUser=function(){return b};this.getFullUserName=function(){return t.fullUsername};this.getOriginalUserPermissions=function(){return b.originalPermissions};this.setSessionKey=function(e){b.sessionKey=e};this.setUserSettings=function(e){b.userSpecific=e};this.setUpdateScalingGroups=function(e){g=e};this.getUpdateScalingGroups=function(){return g};this.getTranslation=function(e){return Ot["a"].getTranslation(e)};this.getTranslationHtml=function(e){return Ot["a"].getTranslationHtml(e)};this.updateRuntime=function(e){if(pe["a"].hasService){var t=b.permissions;setUser(re["a"].repository("getFrontendSession",undefined,{documentHash:Mt["b"].DataObjects.DocumentDO.getHash()},false));b.originalPermissions=Object(z["g"])(b.permissions);t=t.filter(function(e){return~b.permissions.indexOf(e)});b.permissions=t.length?t:[Y["c"].Permissions.Consumer];parseScalingGroups()}else{b.userSpecific=Mt["b"].DataObjects.DocumentDO.getConnector().getDocumentValues().userSettings}if(!Mt["b"].DataObjects.DocumentDO.getConnector().isUpdateable()){this.setPresentationMode()}Ot["a"].initTranslations(Mt["b"].DataObjects.DocumentDO.getSettings().docLanguage.value).then(function(){Mt["b"].Utils.Constants.ParameterSets=new E;e()})};this.getParameters=function(){return n.parameters};this.getParameter=function(e,t){if(n.parameters===null){return""}if(!n.parameters[e]){console.warn("fix me now! i said immediatly!!!",e)}switch(e){case"FONT_SIZE_TITLE":case"FONT_SIZE_SUBTITLE":case"FONT_SIZE_CHART":if(!t&&n.parameters[e+"_DYNAMIC"]==="true"){return Object(y["b"])(n.parameters[e],window.innerWidth)}break;case"FONT_FAMILY":return oe["a"].getValidFontFamily(n.parameters[e])}return n.parameters[e]};this.getParameterParsed=function(e){return parseFloat(this.getParameter(e))};this.getValueTypeFactor=function(e){if(e==="FACTOR_NONE"){return 0}var t=this.getParameter(e);return t===null||t===undefined?1:parseFloat(t)};this.getCentralNotationManual=function(){return JSON.parse(o)};this.getLocalNotationManual=function(){return JSON.parse(s)};this.getNotationManual=function(){return n};this.useNotationManual=function(e){n=e||r};this.setCurrentNotationManual=function(e){n=r=e};this.setNotationManual=function(e,t,i,a){this.setCurrentNotationManual(e);var n=this.getCentralNotationManual(),r=this.notationManualEqualsLocalVersion(),o=Object(z["p"])(e,n,["_UPDATED_AT","_UPDATED_BY"]),l=Object(z["p"])(e,this.getLocalNotationManual(),["_UPDATED_AT","_UPDATED_BY"]);if(a&&o){this.saveNotationManual(e,t,i)}else if(l||!r){e.parameters._UPDATED_AT=o?(new Date).toJSON():n.parameters._UPDATED_AT;e.parameters._UPDATED_BY=o?b.username:n.parameters._UPDATED_BY;Mt["b"].DataObjects.DocumentDO.setDocumentValue("notationManualLocalVersion",e);Mt["b"].DataObjects.DocumentDO.saveDocument()}s=JSON.stringify(e)};this.saveNotationManual=function(t,e,i){if(pe["a"].hasService){re["a"].repository("updateNotationManual",{setDefault:e,stateInfo:i},t,true,function(e){if(e["updatedAt"]&&e["updatedBy"]){t.parameters._UPDATED_AT=e["updatedAt"];t.parameters._UPDATED_BY=e["updatedBy"];a.setCurrentNotationManual(t);o=s=JSON.stringify(n)}saveNotationManualLocally()})}else{saveNotationManualLocally()}function saveNotationManualLocally(){Mt["b"].DataObjects.DocumentDO.setDocumentValue("notationManual",t);Mt["b"].DataObjects.DocumentDO.setDocumentValue("notationManualLocalVersion",undefined);Mt["b"].DataObjects.DocumentDO.saveDocument()}};this.getDataTypes=function(){return n.datatypes};this.getDataType=function(e){if(!n.datatypes[e]){console.warn("The following key isn't defined in datatypes: ",e)}return n.datatypes[e]};this.setClipboardState=function(e,t){this.clearClipboardState(d);l=e==null?null:JSON.stringify(e);d=t;c=e==null?null:Mt["b"].Models.Actions.ViewModelActions.ContainerModel.containsTextModels(e)};this.getClipboardState=function(){return{sourceExtensionId:d,state:JSON.parse(l)}};this.clearClipboardState=function(e){if(d===e){l=null;d=null;Mt["b"].DataObjects.DocumentDO.removeTemporaryDisabledVariables()}};this.isClipboardEmpty=function(){return l===null};this.setRebuildComments=function(e,t){p[e]=t};this.getRebuildComments=function(e){return p[e]};this.setRebuildCommentsAll=function(e){for(var t in p){p[t]=e}};this.getClipboardTextContent=function(){return c};this.isTextEditable=function(e){var t="DESIGN"===Mt["b"].DataObjects.DocumentDO.getSettings().documentMode.value;return t&&Mt["b"].DataObjects.RuntimeDO.evaluateCommentCondition(e)&&!Mt["b"].DataObjects.DocumentDO.preventLeftClickAndActions()};this.getAllowIcon=function(e){if(e=="Yes"){return true}if(e=="No"){return false}var t=Mt["b"].DataObjects.DocumentDO.getVariable(e);if(typeof t==="undefined"||t===null||t.value===null){return false}if(isFinite(t.value)){return parseInt(t.value)===1}return t.value.toLowerCase()==="true"};this.evaluateCommentCondition=function(e){if(e===""||e===undefined||e===null||e==="1"||e==="Yes"){return true}else if(e==="0"||e==="No"){return false}var t=Mt["b"].DataObjects.DocumentDO.getVariable(e);var i=null;if(t){if(!isNaN(parseInt(t.value))&&isFinite(t.value)){i=parseInt(t.value)}else{i=t.value.toLowerCase()}}return i===1||i==="true"};this.setEditCommentTopOffset=function(e){h=e};this.getEditCommentTopOffset=function(){return h};this.setDisabledInlineComments=function(e){f=e};this.getAndClearDisabledInlineComments=function(){var e=f;f=null;return e};this.testAndSetTextEditMode=function(e){var t=m;m=e;return t};this.notationManualDiffers=function(){return!this.notationManualEqualsCentralVersion()||!this.notationManualEqualsLocalVersion()};this.notationManualEqualsCentralVersion=function(){return!pe["a"].hasService||JSON.stringify(n)===o};this.notationManualEqualsLocalVersion=function(){return JSON.stringify(n)===s};this.useLocalVersion=function(){this.setCurrentNotationManual(JSON.parse(s))};this.useCentralVersion=function(){this.setCurrentNotationManual(JSON.parse(o))};this.isPrePaint=function(){return v};this.setPrePaint=function(e){v=e};this.isPrinting=function(){return i};function setUser(e){var t=e.displayName,i=e.username;e.fullUsername=e.displayName;if(e.firstName!==undefined&&e.lastName!==undefined){e.fullUsername=e.firstName+", "+e.lastName}else{q["a"].debug("firstName or lastName is not set on the user object, use the displayName as a backup")}Object.defineProperties(e,{displayName:{get:function(){return t}},username:{get:function(){return i}},IsDesigner:{get:function(){return e.permissions.indexOf(Y["c"].Permissions.Designer)!==-1}}});b=e}};var nt={build:[3,5,6],draw:[10,25],PREINIT:3,INIT:5,AXIS_ZOOM:6,LEGEND:10,DRAW:25,POST_DRAW:26};var rt=i(45);var ot=i(341);var C=Mt["b"].Utils.Constants={BuildUp:nt,Parameters:ot["a"],TypeValues:rt["a"]};var lt=i(93);var le=new function(){var e,u,t,a,n,i,r,x,p,o=false,g=false,E=false;var y=C.TypeValues;this.exportModel=exportModel;this.init=invalidateInit;function exportModel(e,t){try{!o&&init();u=Mt["b"].DataObjects.DocumentDO.getExtension(t.extensionHash);if(u){if(e.extendedModel.instanceOf==="TableModel"&&e.extendedModel.tableCellData){exportTableModel(e,t)}else if(e.extendedModel.instanceOf==="ContainerCommentGridModel"){exportCommentModel(e,t)}else{var i=e.id+"_"+t.extensionHash+"_export",a=document.getElementById(i);if(a){a.parentNode.removeChild(a)}}}}catch(e){console.error("HiCo",e)}}function init(){var e=Mt["b"].DataObjects.RuntimeDO;t=e.getParameter("FONT_FAMILY");a=e.getParameter("FONT_STYLE_CHART");n=e.getParameterParsed("FONT_SIZE_CHART");i=lt["a"].pt2pix(n);r={"*":{"font-size":i+"px","font-family":t,position:"static","white-space":"pre-wrap","word-wrap":"break-word"}};g=false;E=false;o=true}function invalidateInit(){o=false;g=false;E=false}function initTableConstants(){var e=Mt["b"].DataObjects.RuntimeDO,t=lt["a"].mm2pix(n*e.getParameterParsed("MMPT_TABLE_VALUE_BOTTOM_BORDER_SIZE"))+"px",i={"*":{"font-style:":a}};x={metaRepresentationTypes:{visual:[y.tableRepresentation.BAR,y.tableRepresentation.LINE,y.tableRepresentation.NEEDLE,y.tableRepresentation.SYMBOL,y.tableRepresentation.SYMBOL_LINE,y.tableRepresentation.WATERFALL],comment:[y.tableRepresentation.COMMENT,y.tableRepresentation.FLAG,y.tableRepresentation.LIST],value:[y.tableRepresentation.VALUE]},aggregatedHeadersPosition:e.getParameter("AGGREGATION_ALIGNMENT"),defaultBorderStyle:{"border-bottom":t+" solid "+e.getParameter("COLOR_BOTTOM_BORDER")},defaultColumnWidth:lt["a"].mm2pix(n*e.getParameterParsed("MMPT_TABLE_COLUMN_WIDTH")),defaultTdStyle:{padding:"0"},css:Object(z["g"])(H["a"]({},r["*"],i["*"]))};E=true}function initCommentConstants(){var e=Mt["b"].DataObjects.RuntimeDO,t=e.getParameter("FONT_STYLE_TITLE").split(" "),i=e.getParameter("FONT_STYLE_SUBTITLE").split(" "),a={".title":{"font-size":lt["a"].pt2pix(e.getParameter("FONT_SIZE_TITLE"))+"px","font-weight":t[0],"font-style":t[1]||""},".subtitle":{"font-size":lt["a"].pt2pix(e.getParameter("FONT_SIZE_SUBTITLE"))+"px","font-weight":i[0],"font-style":i[1]||""}};p={css:{textType:{title:Object(z["g"])(H["a"]({},r["*"],a[".title"])),subtitle:Object(z["g"])(H["a"]({},r["*"],a[".subtitle"])),comment:Object(z["g"])(r["*"])}},refLabelDistance:Mt["b"].Layout.CommentReference.ReferenceRepresentation.char.getReferenceSize(1).refLabelDistance};g=true}function initExportDiv(e,t){var i=document.getElementById(t+"_export");if(!i){i=document.createElement("div");i.className="HiCo";i.id=t+"_export";i.style.display="none";e.appendChild(i)}return i}function exportTableModel(i,e){!E&&initTableConstants();var r;var p=[],t=document.getElementById(e.extensionHash).parentNode,o=i.extendedModel,a=o.columnDefinitions,l=o.rowAlignment,n={meta:{chart:i.id,data:[],modelName:i.name||Mt["b"].DataObjects.DocumentDO.getExtension(e.extensionHash).getAdapter().getServerId()+"_"+i.id,extension:e.extensionHash,width:[]},head:[],body:[]};var s=a.map(function(e){return new ExtendedColDefObject(e)});var d=0,c=0;var u=s.filter(function(e){var t=!e.isHidden;if(e.width===undefined){if(r){e.width=calculateWidthOfVisualColumn(r.width,e,i);e.isDynamicCol=r.isDynamicCol}else{e.width=calculateWidthOfVisualColumn(x.defaultColumnWidth,e,i)}}if(t){d+=e.width;e.isDynamicCol&&c++}return t});var g=Math.round(100*(i.dimension.widthWithoutSpacing-d)/c)/100;for(var h=0,f=u.length;h<f;h++){var m=u[h];m.isDynamicCol&&(m.width+=g);n.meta.width.push(m.width+"px");if(h<f-1){n.meta.width.push(m.columnDefinition.spacing_right+"px")}}var v=[];for(var b=0,f=o.tableCellData.length;b<f;b++){var T=b<o.headerRows;v.push(new TableRow(o.tableCellData[b],s,T))}v.forEach(function(l,e){var s=v[e+1];var d=[];var c=l.isAnnotatorRow()?l.getDataFromAnnotatorRow():l.getValueAndStyling,u;c.forEach(function(e,t){if(!u){var i=document.createElement("div"),a=void 0,n=void 0,r=void 0;if(l.isAnnotatorRow()){u=p[t];a=t+(u||0)<c.length-1;n=Object(z["g"])(H["a"]({},x.defaultTdStyle,e.tdStyle));r=JSON.stringify(e.data)}else{applyStyles(i,x.css);if(l.isHeader&&e.element&&e.element.aggregatedHide){u=calculateColSpan(t,c);s.isAnnotatorRow()&&(p[t]=u)}a=t+(u||0)<c.length-1;setTextContent(i,e.element&&e.element.valueRowLabelPosition==="none"?"":e.content);if(e.element){var o=e.element;i.style.color=o.color;o.fontSize+"px"!==i.style.fontSize&&(i.style.fontSize=e.element.fontSize+"px");o.font!==i.style.fontFamily&&(i.style.fontFamily=e.element.font);o.fontWeight!==i.style.fontWeight&&(i.style.fontWeight=e.element.fontWeight)}n=Object(z["g"])(x.defaultTdStyle);buildUpAlignmentStyle(t,e,n,l.isHeader,u>0&&!s.isAnnotatorRow());buildUpBorderStyle(t,l,s,n);e.additionalStyle["textAlign"]=n["text-align"]||"";e.additionalStyle["verticalAlign"]=n["vertical-align"]||""}applyStyles(i,e.additionalStyle);d.push({value:i,tdStyle:n,tdData:r,colSpan:u?2*u+1:0});a&&d.push({tdStyle:x.defaultTdStyle})}else{u--}});l.isHeader?n.head.push(d):n.body.push(d)});initExportDiv(t,e.extensionHash).appendChild(createTable(n));function buildUpBorderStyle(e,t,i,a){if(i&&!(i.getIsTotalOrSubtotal()||t.getIsTotalOrSubtotal()||t.isHeader||i.isAnnotatorRow())){Mt["b"].$.extend(a,x.defaultBorderStyle)}else if(i&&!i.isAnnotatorRow()){var n=i?i.getBorder():undefined,r=n[e]["border-top"],o=t.getBorder();a["border-bottom"]=r?r:o[e]["border-bottom"]}}function buildUpAlignmentStyle(e,t,i,a,n){if(a){i["text-align"]=n||!t.element?x.aggregatedHeadersPosition:t.element.valueRowLabelPosition;i["vertical-align"]="bottom"}else{switch(l){case"top":i["vertical-align"]="top";break;case"mid":i["vertical-align"]="middle";break;case"bottom":i["vertical-align"]="bottom"}if(u[e].metaRepresentationType==="visual"||u[e].metaRepresentationType==="value"){t.content!==undefined&&(i["text-align"]="right")}else if(t.element){switch(t.element.horizontalAlign){case y.labelHorizontalAlignment.LEFT:i["text-align"]="left";break;case y.labelHorizontalAlignment.MIDDLE:i["text-align"]="center";break;case y.labelHorizontalAlignment.RIGHT:i["text-align"]="right"}}}}function calculateColSpan(e,t){var i=0,a;while((a=t[i+e+1])&&t[i+e].content===a.content&&a.element.valueRowLabelPosition!==y.tableLegend.NONE){i++}return i}function getRepresentationTypeFromExprId(e){if(e.indexOf("dim")===0){return}for(var t=0,i=o.expressions.length;t<i;t++){var a=o.expressions[t];if(a.id.split(".")[2]===e){return a.representation}}}function getMetaRepresentationType(e){var t=x.metaRepresentationTypes;for(var i in t){if(t.hasOwnProperty(i)&&t[i].indexOf(e)!==-1){return i}}}function calculateWidthOfVisualColumn(e,t,i){var a=t.columnDefinition.defMinWidth,n=i.scrollingData?i.scrollingData.realWidth:0;var r;if(a===-1){r=e}else{var o=lt["a"].convertToPixel(a,n,t.columnDefinition.defMinWidthType);r=Math.max(o,e)}return r}function ExtendedColDefObject(a){var n=this;this.columnDefinition=a;this.isDynamicCol=false;this.isHidden=false;this.representationType=undefined;this.metaRepresentationType=undefined;this.width=0;init();function init(){var e=a.exprId.indexOf("dim")>-1&&o.dimensionLabelModel.displayType===y.categoryLabel.NONE||a.IsHidden;n.isHidden=e;n.isDynamicCol=!e&&(!a.columnFix||a.defWidthType==="w");var t=getRepresentationTypeFromExprId(a.exprId),i=getMetaRepresentationType(t);i==="visual"?n.width=undefined:n.width=a.width;n.representationType=t;n.metaRepresentationType=i;!r&&i==="value"&&(r=n)}}}function exportCommentModel(e,t){!g&&initCommentConstants();var i=document.getElementById(t.extensionHash).parentNode,o=Mt["b"].DataObjects.CommentRepo.getCommentById(e.extendedModel.commentId,t.extensionHash),a=o?o.currContent.grid:[];var n={meta:{chart:e.id,modelName:e.name||u.getAdapter().getServerId()+"_"+e.id,extension:t.extensionHash,width:[]},body:[]};var l=[];var s=false;a.forEach(function(e){e.forEach(function(e,t){var i=e.reference.length>0;l[t]=l[t]||i;s=s||i})});for(var r=0,d=l;r<d.length;r++){var c=d[r];if(c){n.meta.width.push("auto")}n.meta.width.push(null)}a.forEach(function(e){var r=[];e.forEach(function(e,t){if(l[t]){if(e.reference[0]){var i=Mt["b"].Layout.CommentReference.ReferenceRepresentation.char.create(e.reference[0].id,true);if(i){r.push({value:i})}else{r.push({})}}else{r.push({})}}var a=document.createElement("div");applyStyles(a,p.css.textType[o.textType]);setTextContent(a,getLabelFormatterInstance().parseLabel(e.text));s&&(a.style.paddingTop=p.refLabelDistance+"px");var n={value:a};r.push(n)});n.body.push(r)});initExportDiv(i,t.extensionHash).appendChild(createTable(n))}function setTextContent(e,t){if(!t){e.innerText=""}else{e.innerHTML=keepDoubleWhiteSpace(t)}}function createTable(e){var t=e.meta.chart+"_"+e.meta.extension+"_export";var i=document.getElementById(t);if(i){while(i.firstChild){i.removeChild(i.firstChild)}}else{i=document.createElement("div");i.id=t}i.dataset.exportId=e.meta.modelName;var a=document.createElement("table");a.style.borderCollapse="collapse";if(e.head){var n=document.createElement("thead");if(e.meta.width){var r=document.createElement("tr");r.style.height="0px";e.meta.width.forEach(function(e){var t=document.createElement("th");t.style.width=e;r.appendChild(t)});n.appendChild(r)}e.head.forEach(function(e){var i=document.createElement("tr");e.forEach(function(t){i.appendChild(createTd("th",t,function(e){if(t.colSpan){e.colSpan=t.colSpan}}))});n.appendChild(i)});a.appendChild(n)}var o=document.createElement("tbody");e.body.forEach(function(e){var i=document.createElement("tr");e.forEach(function(t){i.appendChild(createTd("td",t,function(e){if(t.colSpan){e.colSpan=t.colSpan}}))});o.appendChild(i)});a.appendChild(o);if(e.footer){var l=document.createElement("tfoot");e.footer.forEach(function(e){var t=document.createElement("tr");e.forEach(function(e){t.appendChild(createTd("td",e))});l.appendChild(t)});a.appendChild(l)}i.appendChild(a);return i;function createTd(e,t,i){var a=document.createElement(e);t.value!==undefined&&a.appendChild(t.value);applyStyles(a,t.tdStyle);t.tdData&&(a.dataset.exportData=t.tdData);i&&i(a);return a}}function keepDoubleWhiteSpace(e){return Object(z["y"])(e,"  "," &nbsp;")}function applyStyles(e,t){if(e&&t){for(var i in t){if(t.hasOwnProperty(i)){e.style[i]=t[i]}}}}function getLabelFormatterInstance(){e||(e=new Mt["b"].Utils.Format.LabelFormatter);return e}function TableRow(u,p,g){var e,t,i,h=false;this.isHeader=g;this.getValueAndStyling=getValueAndStyling();this.isAnnotatorRow=function(){return e||(e=isAnnotatorRow())};this.getBorder=function(){return t||(t=getBorder())};this.getDataFromAnnotatorRow=function(){return i||(i=getDataFromAnnotatorRow())};this.getIsTotalOrSubtotal=function(){return h};function isAnnotatorRow(){for(var e=0,t=u.length;e<t;e++){if(u[e].elements.length===1&&u[e].elements[0].instanceOf!=="DataTypeAnnotatorModel"){return false}}return true}function getDataFromAnnotatorRow(){var e=[];for(var t=0,i=u.length;t<i;t++){if(!p[t].isHidden){var a=u[t].elements[0];if(!a){e.push({});continue}var n=a.color.pattern,r=a.color.background,o=a.color.border;if(a.dimension.height===0){e.push({data:{type:"hidden"},tdStyle:{}})}else if(a.dimension.height===1){e.push({data:{type:"line",color1:n},tdStyle:{borderTop:"1px solid "+n}})}else{var l={border:"1px solid "+o},s=a.dimension.height-2+"px";if(r===n||a.otherPattern===y.otherPattern.FILLED||a.otherPattern===y.otherPattern.EMPTY){var d=a.otherPattern===y.otherPattern.EMPTY?"rgb(255, 255, 255)":n;e.push({data:{type:"filled",color1:d},tdStyle:l,additionalStyle:{height:s,backgroundColor:d}})}else{var c="repeating-linear-gradient(-45deg, "+n+" 0px, "+n+" 2px, "+r+" 2px, "+r+" 4px, "+n+" 4px)";e.push({data:{type:"hatched",color1:n,color2:r},tdStyle:l,additionalStyle:{height:s,background:c}})}}}}return e}function getValueAndStyling(){var e=[];for(var t=0,i=u.length;t<i;t++){if(!p[t].isHidden){var a={},n=void 0,r=u[t].elements,o=void 0;if(p[t].metaRepresentationType==="visual"&&!g){for(var l=0,s=r.length;l<s;l++){if(r[l].instanceOf==="LabelModel"){n=r[l];o=getLabelFormatterInstance().parseLabel(n.text);(n.isSubtotal||n.isTotal)&&(h=true)}else{r[l].color&&r[l].color.pattern&&(a.color=r[l].color.pattern)}}}else if(p[t].metaRepresentationType==="comment"&&!g){var d=findModelInElementList(r,"InlineModel");if(d){o="";if(!d.hide){var c=y.tableRepresentation;switch(p[t].representationType){case c.FLAG:o=d.text.toString();break;case c.COMMENT:if(d.text!==d.placeholderText){o=getLabelFormatterInstance().parseLabel(d.text)}break;case c.LIST:if(d.listContent[0]===undefined||d.listContent[0].description!==d.text){o=getLabelFormatterInstance().parseLabel(d.text)}break}}}}else{n=findModelInElementList(r,"LabelModel");if(n){n.dataId_expr&&n.color&&(a.color=n.color);o=getLabelFormatterInstance().parseLabel(n.text);(n.isSubtotal||n.isTotal)&&(h=true)}}e.push({content:o,element:n,additionalStyle:a})}}return e;function findModelInElementList(e,t){for(var i=0,a=e.length;i<a;i++){if(e[i].instanceOf===t){return e[i]}}}}function getBorder(){var a=[];u.forEach(function(e,t){if(!p[t].isHidden){var i={};if(e.border){e.border.bottom&&(i["border-bottom"]=e.border.bottom+"px solid "+e.borderColor);e.border.top&&(i["border-top"]=e.border.top+"px solid "+e.borderColor)}a.push(i)}});return a}}};Mt["b"].UI=Mt["b"].UI||{};Mt["b"].UI.NotationManual=function(e){this.onApply=e;var b=this;var I;var o;var t=Mt["b"].DataObjects.DocumentDO.getDocSettings();var c=t.docLanguage.value;var D="12px";var l="630";if(c==="de_DE"){l="740"}var s="635";var d="430";var u="450";var n=18;var R="0";var P="&nbsp;%";var N="&nbsp;mm/10pt";var p="&nbsp;pt";var w=4;var F=1;var B=0;var k=Mt["b"].DataObjects.RuntimeDO;var x=k.getDataTypes();var E={Actual:{},Budget:{},Forecast:{}};var g="";var h="";var f="";var m=k.getParameters();var r=!Mt["b"].Connector.ConnectorHelper.Support.LocalNotationManual;var y=x["Actual"].subtypes;var C=x["Budget"].subtypes;var S=x["Forecast"].subtypes;for(var i in y){if(!y.hasOwnProperty(i)){continue}E["Actual"][i]="-"}for(var i in C){if(!C.hasOwnProperty(i)){continue}E["Budget"][i]="-"}for(var i in S){if(!S.hasOwnProperty(i)){continue}E["Forecast"][i]="-"}var T=Mt["b"].Utils.Constants.ParameterSets.shapeTypeTranslations;var M=Mt["b"].Utils.Constants.ParameterSets.shapeTypeIds;var O=Mt["b"].Utils.Constants.ParameterSets.lineTypeTranslations;var A=Mt["b"].Utils.Constants.ParameterSets.lineTypeIds;var _=Mt["b"].Utils.Constants.ParameterSets.otherTypeTranslations;var L=Mt["b"].Utils.Constants.ParameterSets.otherTypeIds;var v=Mt["b"].Utils.Constants.TypeValues;var U=oe["a"].getFontTypes();var H=[{id:"left",translation:Ot["a"].getTranslation("LEFT")},{id:"center",translation:Ot["a"].getTranslation("CENTER")},{id:"right",translation:Ot["a"].getTranslation("RIGHT")}];var G=[{id:"none",translation:"-"},{id:"left",translation:Ot["a"].getTranslation("LEFT")},{id:"center",translation:Ot["a"].getTranslation("CENTER")},{id:"right",translation:Ot["a"].getTranslation("RIGHT")}];var V=[{id:"symbol-value",translation:Ot["a"].getTranslation("SYMBOL_AT_AXIS_VALUE_AT_VALUE")},{id:"value-symbol",translation:Ot["a"].getTranslation("SYMBOL_AT_VALUE_VALUE_AT_AXIS")}];var $=[{id:"none",translation:"-"},{id:"circle",translation:Ot["a"].getTranslation("CIRCLE")},{id:"triangle",translation:Ot["a"].getTranslation("TRIANGLE")}];var z=[{id:"arrow",translation:Ot["a"].getTranslation("ARROW")},{id:"pin",translation:Ot["a"].getTranslation("PIN")}];var W=[{id:"",translation:"%"},{id:"",translation:"mm/10pt"}];var j=[{id:"tabs-general",text:Ot["a"].getTranslation("GENERAL"),buildUp:createGeneralTab},{id:"tabs-structure",text:Ot["a"].getTranslation("STRUCTURE"),buildUp:createStructureTab},{id:"tabs-table",text:Ot["a"].getTranslation("TABLE"),buildUp:createTableTab},{id:"tabs-time",text:Ot["a"].getTranslation("TIME"),buildUp:createTimeTab},{id:"tabs-multiple",text:Ot["a"].getTranslation("MULTIPLE"),buildUp:createMultipleTab},{id:"tabs-datatypes",text:Ot["a"].getTranslation("SCENARIOS"),buildUp:createDatatypeTab}];var K=[{id:"datatypeTabs-actual",text:Ot["a"].getTranslation("ACTUAL"),buildUp:createDatatypeActualTab},{id:"datatypeTabs-budget",text:Ot["a"].getTranslation("BUDGET"),buildUp:createDatatypeBudgetTab},{id:"datatypeTabs-forecast",text:Ot["a"].getTranslation("FORECAST"),buildUp:createDatatypeForecastTab}];var X=[];var Y=[];var Z=[];var a=[{id:"actual-",buildUp:createDefinition}];var Q=[{id:"budget-",buildUp:createDefinition}];var q=[{id:"forecast-",buildUp:createDefinition}];var J=[{id:"XXXgeneralFont",text:Ot["a"].getTranslation("TEXT"),buildUp:createGeneralFontTypes},{id:"XXXgeneralValue",text:Ot["a"].getTranslation("SIZE_FACTORS"),buildUp:createGeneralSizeFactors},{id:"XXXhighlightcompare",text:Ot["a"].getTranslation("HIGHLIGHT_COMPARE"),buildUp:createGeneralHighlightCompare},{id:"XXXnavigation",text:Ot["a"].getTranslation("NAVIGATION"),buildUp:createGeneralNavigation},{id:"XXXother",text:Ot["a"].getTranslation("OTHER"),buildUp:createGeneralOther}];var ee=[{id:"XXXstructurePresentation",text:Ot["a"].getTranslation("NOTATION"),buildUp:createStructureRepresentation},{id:"XXXstructureAxisAndLabel",text:Ot["a"].getTranslation("LEGEND_LABEL"),buildUp:createStructureAxisAndLabel},{id:"XXXstructureValues",text:Ot["a"].getTranslation("VALUES"),buildUp:createStructureValues},{id:"XXXstructureOther",text:Ot["a"].getTranslation("OTHER"),buildUp:createStructureOther}];var te=[{id:"XXXtablePresentation",text:Ot["a"].getTranslation("NOTATION"),buildUp:createTableRepresentation},{id:"XXXtableStructure",text:Ot["a"].getTranslation("VALUES"),buildUp:createTableStructure},{id:"XXXtableTitle",text:Ot["a"].getTranslation("OTHER"),buildUp:createTableOther}];var ie=[{id:"XXXtimePresentation",text:Ot["a"].getTranslation("NOTATION"),buildUp:createTimeRepresentation},{id:"XXXtimeAxisAndLabel",text:Ot["a"].getTranslation("LEGEND_LABEL"),buildUp:createTimeAxisAndLabel},{id:"XXXtimeValues",text:Ot["a"].getTranslation("VALUES"),buildUp:createTimeValues},{id:"XXXtimeAxisSeparator",text:Ot["a"].getTranslation("OTHER"),buildUp:createTimeAxisSeparator}];var ae=[{id:"XXXmultipleBorder",text:Ot["a"].getTranslation("BORDER"),buildUp:createMultipleBorder}];var ne="notationManual";b.repaintAllExtensions=repaintAllExtensions;b.open=function(){I=b.buildDialog();I.getDialog().dialog("open");b.updateDivHeight();var e=parseInt(I.highest());var t=parseInt(I.getDialog().offsetParent().css("z-index"));if(e>t){e+=1;I.getDialog().offsetParent().css("z-index",e)}};b.buildDialog=function(){var e=Ot["a"].getTranslation("NOTATION_MANUAL");var t=Ot["a"].getTranslation("NOTATION_MANUAL_DOCUMENT_VERSION_DIFFERS");if(k.notationManualDiffers()){e+=""+'<span style="text-align: center; position: absolute; left: 0; right: 0;">'+'\t\t<span style="padding: 3px 10px" class="lui-bg-warning">'+t+"!</span>"+"</span>"}var i=buildButtonBar();var a=new Mt["b"].UI.HiCoDialogDefinition(ne,e,i);a.setHeight(s);a.setWidth(l);a.setAutoOpen(false);D=a.getFontSize();I=new Mt["b"].UI.HiCoDialog(a);I.setEscapeBeforeHandler(escapeBeforeHandler);I.setEscapeAfterHandler(escapeAfterHandler);o=I.getDialogDiv();I.buildTabs("tabDiv",j,null,"auto",{top:"0px",left:"0px"},null,true);I.setEvent("dialogresize",function(){b.updateHeight()});Mt["b"].$(document).keyup(function(e){if(e.keyCode==27){if(e.isPropagationStopped()==false){var t=I.highest();var i=I.getDialog().offsetParent().css("z-index");if(t===i){if(I.getDialog().dialog("isOpen")===true){e.stopPropagation();b.close(false)}}}}});var n="#datatypeTabs-actual, #datatypeTabs-budget, #datatypeTabs-forecast, #generalTab, "+"#structureTab, #timeTab, #tableTab, #multipleTab, #datatypeTab";var r=["generalTab","structureTab","tableTab","timeTab","multipleTab","datatypeTab","datatypeTabs-actual","datatypeTabs-budget","datatypeTabs-forecast"];I.setTabsCss(n,r);b.setCSS();I.decorateTabs(0,j,null);I.decorateTabs(0,K,null);I.decorateTabs(0,J,null);I.decorateTabs(0,ee,null);I.decorateTabs(0,te,null);I.decorateTabs(0,ie,null);I.decorateTabs(0,ae,null);I.decorateTabs(0,X,null);I.decorateTabs(0,Y,null);I.decorateTabs(0,Z,null);return I};b.openLocalVersion=function(){b.close(true);Mt["b"].DataObjects.DocumentDO.getDocumentController().dispatch("getNotationManual",{parameters:{use:"local",supressDiffDialog:true,repaint:true}})};b.openCentralVersion=function(){b.close(true);Mt["b"].DataObjects.DocumentDO.getDocumentController().dispatch("getNotationManual",{parameters:{use:"central",supressDiffDialog:true,repaint:true}})};function buildRows(e,t){var t=t||document.createElement("table");t.setAttribute("cellspacing",R);function textInputChange(){var e=this.value;var t=false;var i=false;var a=e.length;for(var n=0;n<a;n++){var r=e[n];var o=parseInt(r);if(r==="."||r===","){if(t===false){t=true}else{i=true;break}}else if(r==="-"&&(this.id==="nm_i_MMPT_OFFSET_LEGEND_START"||this.id==="nm_i_MMPT_OFFSET_LEGEND_END"||this.id==="nm_i_MMPT_OFFSET_IN_CHART")){}else if(isNaN(o)){i=true;break}}if(i){if(this.style.borderColor===""){B++}this.style.borderColor="rgb(255,0,0)";var l=[document.getElementById("defaultButton")];l.push(document.getElementById("applyButton"));l.push(document.getElementById("saveButton"));var s=l.length;for(var n=0;n<s;n++){l[n].setAttribute("disabled","disabled");l[n].style.opacity=".35";l[n].style.filter="Alpha(Opacity=35)"}}}function textInputKeydown(){if(this.style.borderColor!==""){this.style.borderColor="";B--;if(B===0){var e=[document.getElementById("defaultButton")];e.push(document.getElementById("applyButton"));e.push(document.getElementById("saveButton"));var t=e.length;for(var i=0;i<t;i++){e[i].removeAttribute("disabled");e[i].style.opacity="";e[i].style.filter=""}}}}var i,a;var n=e.length;for(var r=0;r<n;r++){if(e[r].type==="section"){I.createSection(t,Ot["a"].getTranslation(e[r].name))}else if(e[r].type==="pureInput"){i=k.getParameter(e[r].parameter);a=Ot["a"].getTranslation(e[r].name);I.createTableRow(t,"nm_i_"+e[r].parameter,a,{text:i,labelText:"",keydown:textInputKeydown,inputStyle:{backgroundColor:"rgb(240, 240, 240)",border:"0px"}},"textInput")}else if(e[r].type===P){i=(k.getParameter(e[r].parameter)*100).toFixed(F);a=Ot["a"].getTranslation(e[r].name);if(e[r].extra==undefined){I.createTableRow(t,"nm_i_"+e[r].parameter,a,{text:i,labelText:P,change:textInputChange,keydown:textInputKeydown,inputStyle:{backgroundColor:"rgb(240, 240, 240)",border:"0px"}},"textInput")}else{I.createTableRow(t,"nm_i_"+e[r].parameter,a,{text:i,labelText:P,change:textInputChange,keydown:textInputKeydown,inputStyle:{backgroundColor:"rgb(240, 240, 240)",border:"0px"}},"textInput",e[r].extra)}}else if(e[r].type===N){i=(k.getParameter(e[r].parameter)*10).toFixed(w);a=Ot["a"].getTranslation(e[r].name);I.createTableRow(t,"nm_i_"+e[r].parameter,a,{text:i,labelText:N,change:textInputChange,keydown:textInputKeydown,maxLength:e[r].maxLength,length:e[r].size,style:e[r].style,width:e[r].width,textAlign:e[r].textAlign,inputStyle:{backgroundColor:"rgb(240, 240, 240)",border:"0px"}},"textInput")}else if(e[r].type==="dropdown"){i=k.getParameter(e[r].parameter);a=Ot["a"].getTranslation(e[r].name);I.createTableRow(t,"nm_i_"+e[r].parameter,a,{valueArray:e[r].valuesArray,selectedValue:i,clazz:e[r].clazz,colSpan:e[r].colSpan,textAlign:e[r].textAlign},"dropdown")}else if(e[r].type==="rgbDiv"){i=k.getParameter(e[r].parameter);a=Ot["a"].getTranslation(e[r].name);I.createTableRow(t,"nm_i_"+e[r].parameter,a,i,"rgbDiv")}else if(e[r].type==="checkBox"){e[r].value=k.getParameter(e[r].parameter);a=Ot["a"].getTranslation(e[r].name);I.createTableRow(t,"nm_i_"+e[r].parameter,a,e[r],"checkBox")}else if(e[r].type==="dynSize"){var o="FACTOR_"+e[r].parameter;var l="MMPT_"+e[r].parameter;var s=(k.getParameter(o)*100).toFixed(F);var d=(k.getParameter(l)*10).toFixed(w);a=Ot["a"].getTranslation(e[r].name);var c=document.createElement("tr");var u=document.createElement("td");var p=Mt["b"].Utils.DOM.createSpan(u,a,"");p.style.fontSize=D;Mt["b"].$(u).css("padding","5px 10px 5px 0px");c.appendChild(u);u=document.createElement("td");var g=Mt["b"].Utils.DOM.createTextInput(u,"nm_i_"+o,s,6,D);g.style.backgroundColor="rgb(240, 240, 240)";g.style.border="0px";g.setAttribute("maxlength","100");g.setAttribute("mmppt",P);Mt["b"].$(g).on("change",textInputChange);Mt["b"].$(g).on("keydown",textInputKeydown);var h=Mt["b"].Utils.DOM.createTextInput(u,"nm_i_"+l,d,6,D);h.style.backgroundColor="rgb(240, 240, 240)";h.style.border="0px";h.setAttribute("maxlength","100");h.setAttribute("mmppt",N);Mt["b"].$(h).on("change",textInputChange);Mt["b"].$(h).on("keydown",textInputKeydown);c.appendChild(u);var f=document.createElement("select");f.setAttribute("size","1");f.style.fontSize=D;f.setAttribute("id","nm_i_"+e[r].select);Mt["b"].$(f).attr("class","_lengthUnits");var m=k.getParameter(e[r].select);var v=W.length;for(var b=0;b<v;b++){var T=document.createElement("option");Mt["b"].$(T).html(W[b].translation);if(W[b].translation===m){T.setAttribute("selected","selected");if(b===0){h.style.display="none"}else{g.style.display="none"}}f.appendChild(T)}var x=function(e){var t=document.getElementById("nm_i_FACTOR_"+e.data.id);var i=document.getElementById("nm_i_MMPT_"+e.data.id);if(e.target.selectedIndex===0){i.style.display="none";t.style.display=""}else{t.style.display="none";i.style.display=""}};Mt["b"].$(f).on("change",{id:e[r].parameter},x);u.appendChild(f);c.appendChild(u);t.appendChild(c)}else if(e[r].type==="header"){var c=document.createElement("tr");c.innerHTML+='<td style="padding: '+(e[r].padding||"0 0 1px 0")+"; margin: 0;"+(e[r].font?"font-width: "+e[r].font:"")+'" valign="top" '+(e[r].rowSpan?'rowspan="'+e[r].rowSpan+'"':"")+">"+Ot["a"].getTranslation(e[r].name)+"</td>";t.appendChild(c)}else if(e[r].type==="line"){var E=document.createElement("tr");for(var b=0;b<e[r].colSpan;b++){E.innerHTML+='<td style="height: 1px; margin: 0; padding: '+(e[r].padding||"1px 0 1px")+'" valign="top">'+'<hr style="margin: 0 0 1px 0; color:'+e[r].color+"; background-color:"+e[r].color+'"></td>'}t.appendChild(E)}else if(e[r].type==="headers"){var c=document.createElement("tr");var y=document.createElement("tr");c.style.whiteSpace="nowrap";for(var b=0;b<e[r].names.length;b++){var u=document.createElement("td");a=e[r].names[b];if(a!==""){a=Ot["a"].getTranslation(a)}Mt["b"].$(u).html(a);if(e[r].font!=undefined){u.style.fontWeight=e[r].font}var C="0px 0px 1px 0px";if(e[r].padding){C=e[r].padding}Mt["b"].$(u).css("padding",C);if(e[r].rowSpan!=undefined){u.rowSpan=e[r].rowSpan}u.setAttribute("valign","top");u.style.margin=0+"px";u.style.textAlign="center";c.appendChild(u);u=document.createElement("td");if(a!==""){var S=document.createElement("span");S.style.margin="0px";Mt["b"].$(S).html('<hr style="margin:0 0 1px 0; color:'+e[r].color+"; background-color:"+e[r].color+'">');u=document.createElement("td");Mt["b"].$(u).css("height","1px");u.appendChild(S);Mt["b"].$(u).css("margin","0px");Mt["b"].$(u).css("padding","1px 8px 3px 0px");u.setAttribute("valign","top")}y.appendChild(u)}t.appendChild(c);t.appendChild(y)}else if(e[r].type==="multi"){var c=document.createElement("tr");var M={textAlign:"left",verticalAlign:"middle",whiteSpace:"nowrap"};Mt["b"].Utils.DOM.setStyle(c,M);var u=document.createElement("td");var O;if(e[r].groupPosition===0){O=Ot["a"].getTranslation(e[r].name)}else{O=Ot["a"].getTranslation(e[r].subString).toLowerCase()}I.createLabel(u,O,true);if(e[r].padding){u.style.padding=e[r].padding}c.appendChild(u);for(var b=0;b<e[r].parameters.length;b++){u=document.createElement("td");if(e[r].padding2){u.style.padding=e[r].padding2}if(e[r].createType==="textInput"){var A={text:k.getParameter(e[r].parameters[b],true),labelText:e[r].labelText,spin:false,maxLength:e[r].maxLength,fontSize:D,width:e[r].textWidth};if(A.labelText===N){A.text=(k.getParameter(e[r].parameters[b])*10).toFixed(w)}else if(A.labelText===P){A.text=(k.getParameter(e[r].parameters[b])*100).toFixed(F)}I.createItem(u,"nm_i_"+e[r].parameters[b],A,e[r].createType)}else if(e[r].createType==="rgbDiv"){var A=k.getParameter(e[r].parameters[b]);I.createItem(u,"nm_i_"+e[r].parameters[b],A,e[r].createType,null,null,e[r].noMargin)}else if(e[r].createType==="icon"){for(var _=0;_<e[r].icons.length;_++){var A={src:e[r].icons[_],selectedValue:k.getParameter(e[r].parameters[b]),tooltip:Ot["a"].getTranslationHtml(e[r].tooltip[_]),clazz:e[r].clazz[_],mainClazz:e[r].mainClazz,callback:e[r].callback};var L="nm_i_"+e[r].parameters[b];I.createItem(u,L,A,e[r].createType)}}else if(e[r].createType==="dropdown"){var A={clazz:e[r].clazz,valueArray:e[r].valuesArray,selectedValue:k.getParameter(e[r].parameters[b])};var L="nm_i_"+e[r].parameters[b];I.createItem(u,L,A,e[r].createType)}else if(e[r].createType==="checkBox"){var L="nm_i_"+e[r].parameters[b];I.createItem(u,L,k.getParameter(e[r].parameters[b]),e[r].createType)}c.appendChild(u)}t.appendChild(c)}}return t}function createGeneralTab(){return I.createTab("generalTab","XXXGeneral",J)}function createGeneralSizeFactors(){var e=document.createElement("div");e.setAttribute("id","GENERALValueTypes");Mt["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:u+"px"});var t=[{type:"section",name:"VALUE"},{type:P,name:"AMOUNT",parameter:"FACTOR_AMOUNT",extra:"70px"},{type:P,name:"QUANTITY",parameter:"FACTOR_QUANTITY",extra:"70px"},{type:P,name:"RELATION",parameter:"FACTOR_RELATION",extra:"70px"},{type:"section",name:"TIME"},{type:P,name:"YEAR",parameter:"FACTOR_YEAR"},{type:P,name:"QUARTER_NAME",parameter:"FACTOR_QUARTER"},{type:P,name:"MONTH",parameter:"FACTOR_MONTH"},{type:P,name:"WEEK_NAME",parameter:"FACTOR_WEEK"},{type:P,name:"DAY",parameter:"FACTOR_DAY"}];var i=buildRows(t);e.appendChild(i);return e}function createGeneralFontTypes(){var e=document.createElement("div");e.setAttribute("id","GENERALFontTypes");Mt["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:u+"px"});var t="3px 8px 0px 0px";var i="5px 8px 0px 0px;";var a=document.createElement("table");a.setAttribute("cellspacing",R);var n=[{type:"dropdown",name:"FONT_FAMILY",parameter:"FONT_FAMILY",valuesArray:U,clazz:"_fontTypes"},{type:"line",colSpan:4,color:"#eeeeee",padding:"10px 0px"},{type:"headers",names:["","TITLES","SUBTITLE","CHART"],color:"#BABABA"},{type:"multi",name:"FONT_SIZE",parameters:["FONT_SIZE_TITLE","FONT_SIZE_SUBTITLE","FONT_SIZE_CHART"],createType:"textInput",labelText:p,padding:t,padding2:i,groupPosition:0,textWidth:55,maxLength:4},{type:"multi",name:"FONT_SIZE_DYNAMIC",parameters:["FONT_SIZE_TITLE_DYNAMIC","FONT_SIZE_SUBTITLE_DYNAMIC","FONT_SIZE_CHART_DYNAMIC"],createType:"checkBox",labelText:p,padding:t,padding2:i,groupPosition:0,textWidth:55,maxLength:4},{type:"multi",name:"FONT_STYLE",subString:"STYLE",parameters:["FONT_STYLE_TITLE","FONT_STYLE_SUBTITLE","FONT_STYLE_CHART"],createType:"icon",icons:["bold_nm.png","italic_nm.png"],tooltip:["BOLD","ITALIC"],clazz:["bold","italic"],mainClazz:"_fontWeightTypes",padding:t,padding2:i,groupPosition:1,callback:changeIcon},{type:"multi",name:"BOTTOM_BORDER_COLOR",subString:"COLOR",parameters:["COLOR_TITLE_TITLE_BOTTOM_BORDER","COLOR_SUBTITLE_BOTTOM_BORDER"],createType:"rgbDiv",padding:t,padding2:i,groupPosition:0,noMargin:true},{type:"multi",name:"BOTTOM_BORDER_SIZE",subString:"SIZE",parameters:["MMPT_TITLE_BOTTOM_BORDER_SIZE","MMPT_SUBTITLE_BOTTOM_BORDER_SIZE"],createType:"textInput",labelText:N,padding:t,padding2:i,groupPosition:1,textWidth:55,maxLength:6},{type:"multi",name:"DISTANCE_TO_TOP",subString:"TOP",parameters:["MMPT_TITLE_TOP_DISTANCE","MMPT_SUBTITLE_TOP_DISTANCE"],createType:"textInput",labelText:N,padding:t,padding2:i,groupPosition:0,textWidth:55,maxLength:6},{type:"multi",name:"DISTANCE_TO_BOTTOM",subString:"BOTTOM",parameters:["MMPT_TITLE_BOTTOM_DISTANCE","MMPT_SUBTITLE_BOTTOM_DISTANCE"],createType:"textInput",labelText:N,padding:t,padding2:i,groupPosition:1,textWidth:55,maxLength:6},{type:"line",colSpan:4,color:"#eeeeee",padding:"10px 0px"},{type:"rgbDiv",name:"INPUT_CELL_BACKGROUND_COLOR",parameter:"COLOR_TEXT_BACKGROUND"},{type:"line",colSpan:4,color:"#eeeeee",padding:"10px 0px"},{type:N,name:"COMMENT_SPACING",parameter:"MMPT_COMMENT_LABEL_DISTANCE",width:55},{type:"headers",names:["","COLOR","INVERTED"],padding:i,color:"#BABABA"}];buildRows(n,a);var r=document.createElement("tr"),o,l=document.createElement("td"),s=Mt["b"].Utils.DOM.createSpan(l,Mt["b"].Utils.Translations.getTranslation("REFERENCE"));s.style.fontSize=D;l.style.padding="1px 8px 0px 0px";r.appendChild(l);o=document.createElement("td");var d=k.getParameter("REFERENCE_FONT_COLOR");I.createItem(o,"nm_i_REFERENCE_FONT_COLOR",d,"rgbDiv");r.appendChild(o);o=document.createElement("td");d=k.getParameter("REFERENCE_COLOR_INVERTED");I.createItem(o,"nm_i_REFERENCE_COLOR_INVERTED",d,"checkBox");var c=o.firstElementChild;c.style.marginRight=c.style.marginLeft="auto";c.style.display="block";r.appendChild(o);a.appendChild(r);n=[{name:"CHECK_COMMENT_MODIFIEDBY",parameter:"CHECK_COMMENT_MODIFIEDBY",type:"checkBox"},{type:"line",colSpan:4,color:"#eeeeee",padding:"10px 0px"},{type:"multi",name:"ADD_OVER_HEIGHT",parameters:["MMPT_ADD_OVER_HEIGHT"],createType:"textInput",labelText:N,padding:t,padding2:i,groupPosition:0,subString:"HEIGHT",textWidth:55,maxLength:6},{type:"multi",name:"ADD_OVER_WIDTH",parameters:["MMPT_ADD_OVER_WIDTH"],createType:"textInput",labelText:N,padding:t,padding2:i,groupPosition:1,subString:"WIDTH",textWidth:55,maxLength:6}];buildRows(n,a);e.appendChild(a);return e}function createGeneralHighlightCompare(){var e=document.createElement("div");e.setAttribute("id","HighlightCompare");var t=parseInt(u)+19;Mt["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:t+"px"});var i=document.createElement("table");var a="5px 33px 0px 0px";var n="5px 44px 0px 0px";var r="5px 30px 0px 0px";if(c==="de_DE"){a="5px 22px 0px 0px";n="5px 62px 0px 0px";r="5px 50px 0px 0px"}var o=[{type:"header",name:"HIGHLIGHT",padding:a,rowSpan:4},{type:"section",name:"ELEMENT"},{type:"rgbDiv",name:"COLOR",parameter:"COLOR_HIGHLIGHT"},{type:"header",name:"OVERALL",padding:n,rowSpan:7},{type:"section",name:"ELLIPSE"},{type:P,name:"WIDTH",parameter:"FACTOR_HIGHLIGHT_ELLIPSE_WIDTH"},{type:P,name:"HEIGHT",parameter:"FACTOR_HIGHLIGHT_ELLIPSE_HEIGHT"},{type:N,name:"STROKE_WIDTH",parameter:"MMPT_HIGHLIGHT_ELLIPSE_STROKE_WIDTH"},{type:"rgbDiv",name:"ELLIPSE_COLOR",parameter:"COLOR_HIGHLIGHT_ELLIPSE"},{type:"header",name:"COMPARE",padding:r,rowSpan:33},{type:"dropdown",name:"COMPARE_DEFAULT_TYPE",parameter:"COMPARE_DEFAULT_TYPE",valuesArray:z,clazz:"_defaultCompareStyle",style:{fontWeight:"bold"}},{type:"line",colSpan:2,color:"#eeeeee"},{type:"section",name:"ARROW"},{type:N,name:"BODY_SIZE",parameter:"MMPT_HIGHLIGHT_ARROW_SIZE"},{type:P,name:"HEAD_SIZE",parameter:"FACTOR_HIGHLIGHT_ARROW_HEAD"},{type:"dropdown",name:"CONNECTOR_TYPE",parameter:"CONNECTOR_ARROW_HEAD",valuesArray:$,clazz:"_pinStyle"},{type:"section",name:"PIN"},{type:N,name:"BODY_SIZE",parameter:"MMPT_HIGHLIGHT_PIN_SIZE"},{type:"dropdown",name:"CONNECTOR_TYPE",parameter:"CONNECTOR_PIN_HEAD",valuesArray:$,clazz:"_pinStyle"},{type:"section",name:"COLOR"},{type:"rgbDiv",name:"COLOR_FAVORABLE",parameter:"COLOR_COMPARE_POSITIVE"},{type:"rgbDiv",name:"COLOR_NEGATIVE",parameter:"COLOR_COMPARE_NEGATIVE"},{type:"section",name:"CON_CIRCLE"},{type:N,name:"CONNECTOR_AREA_SIZE",parameter:"MMPT_CIRCLE_AREA_SIZE"},{type:"rgbDiv",name:"CONNECTOR_COLOR",parameter:"CON_CIRCLE_COLOR"},{type:N,name:"CONNECTOR_BORDER_SIZE",parameter:"MMPT_CIRCLE_BORDER_SIZE"},{type:"rgbDiv",name:"CONNECTOR_BORDER_COLOR",parameter:"CON_CIRCLE_BORDER_COLOR"},{type:"section",name:"CON_TRIANGLE"},{type:N,name:"CONNECTOR_AREA_SIZE",parameter:"MMPT_TRIANGLE_AREA_SIZE"},{type:"rgbDiv",name:"CONNECTOR_COLOR",parameter:"CON_TRIANGLE_COLOR"},{type:N,name:"CONNECTOR_BORDER_SIZE",parameter:"MMPT_TRIANGLE_BORDER_SIZE"},{type:"rgbDiv",name:"CONNECTOR_BORDER_COLOR",parameter:"CON_TRIANGLE_BORDER_COLOR"},{type:"section",name:"OFFSET"},{type:N,name:"IN_CHART",parameter:"MMPT_OFFSET_IN_CHART"},{type:N,name:"LEGEND_END",parameter:"MMPT_OFFSET_LEGEND_END"},{type:N,name:"LEGEND_START",parameter:"MMPT_OFFSET_LEGEND_START"}];buildRows(o,i);e.appendChild(i);return e}function createGeneralOther(){var e=document.createElement("div");e.setAttribute("id","GeneralOther");var t=parseInt(u)+19;Mt["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:t+"px"});var i=c==="de_DE"?"5px 22px 0px 0px":"5px 33px 0px 0px";var a=[{type:"header",name:"SCALING_HELPER",padding:i,rowSpan:8},{type:N,name:"LINE_SIZE",parameter:"MMPT_SCALING_HELPER_LINE_SIZE"},{type:"checkBox",name:"WITH_AREA",parameter:"CHECK_SCALING_HELPER_WITH_AREA"},{type:"headers",names:["","LINE","AREA"],padding:{padding:"5px 10px 5px 0px"},color:"#eeeeee"}];var n=buildRows(a);for(var r=1;r<=3;r++){var o=document.createElement("tr");var l=document.createElement("td");var s="#"+r+" "+Ot["a"].getTranslation("COLOR");I.createLabel(l,s,true);o.appendChild(l);l=document.createElement("td");var d=k.getParameter("COLOR_SCALING_HELPER_"+r+"_LINE");I.createItem(l,"nm_i_COLOR_SCALING_HELPER_"+r+"_LINE",d,"rgbDiv");o.appendChild(l);l=document.createElement("td");l.style.width="110px";d=k.getParameter("COLOR_SCALING_HELPER_"+r+"_AREA");I.createItem(l,"nm_i_COLOR_SCALING_HELPER_"+r+"_AREA",d,"rgbDiv");o.appendChild(l);n.appendChild(o)}a=[{type:"line",colSpan:4,color:"#eeeeee"},{type:"header",name:"OUTLIER",padding:i,rowSpan:2,width:79},{type:"dropdown",name:"STYLE",parameter:"SELECT_OUTLIER_STYLE",valuesArray:V,clazz:"_outlierStyle",colSpan:2}];buildRows(a,n);e.appendChild(n);return e}function createGeneralNavigation(){var e=document.createElement("div");e.setAttribute("id","GeneralNavigation");Mt["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:u+"px"});var t=[{type:"section",name:"SEPARATOR"},{type:"pureInput",name:"DIMENSION_TO_DIMENSION_VALUE",parameter:"TEXT_NAVIGATION_SEPARATOR_DIM_CAT"},{type:"pureInput",name:"DIMENSION_TO_DIMENSION",parameter:"TEXT_NAVIGATION_SEPARATOR_DIM_DIM"},{type:"pureInput",name:"DIMENSION_TO_MEASURE",parameter:"TEXT_NAVIGATION_SEPARATOR_DIM_KEY"},{type:"pureInput",name:"MEASURE_TO_VALUE",parameter:"TEXT_NAVIGATION_SEPARATOR_KEY_VAL"}];var i=buildRows(t);e.appendChild(i);return e}function createStructureTab(){return I.createTab("structureTab","XXXStucture",ee)}function createStructureRepresentation(){var e=document.createElement("div");e.setAttribute("id","STRUCTUREPresentation");Mt["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:u+"px"});var t=[{type:"section",name:"ELEMENT"},{type:N,name:"BAR_HEIGHT",parameter:"MMPT_STRUCTURE_BAR_HEIGHT"},{type:N,name:"SYMBOL_SIZE",parameter:"MMPT_STRUCTURE_SYMBOL_SIZE"},{type:N,name:"NEEDLE_LINE_SIZE",parameter:"MMPT_STRUCTURE_NEEDLE_LINE_SIZE"},{type:N,name:"LINE_SIZE",parameter:"MMPT_STRUCTURE_LINE_SIZE"},{type:N,name:"THIN_LINE_SIZE",parameter:"MMPT_STRUCTURE_THIN_LINE_SIZE"},{type:N,name:"DIMENSION_DISTANCE",parameter:"MMPT_STRUCTURE_CATEGORY_DISTANCE"},{type:N,name:"OUTLIER_DISTANCE",parameter:"MMPT_STRUCTURE_OUTLIER_DISTANCE"},{type:P,name:"DISPLACEMENT",parameter:"FACTOR_STRUCTURE_ELEMENT_DISPLACEMENT"},{type:"section",name:"AXIS"},{type:N,name:"WITHOUT_AXIS_NOTATION",parameter:"MMPT_STRUCTURE_AXIS_WITHOUT_NOTATION"},{type:N,name:"WITH_AXIS_NOTATION",parameter:"MMPT_STRUCTURE_AXIS_WITH_NOTATION"},{type:"section",name:"HEADER"},{type:N,name:"TEXT_SPACE",parameter:"MMPT_STRUCTURE_HEADER_TEXT_SPACE"},{type:N,name:"BAR_HEIGHT",parameter:"MMPT_STRUCTURE_HEADER_BAR_HEIGHT"},{type:N,name:"ELEMENT_DISTANCE",parameter:"MMPT_STRUCTURE_HEADER_ELEMENT_DISTANCE"}];var i=buildRows(t);e.appendChild(i);return e}function createStructureAxisAndLabel(){var e=document.createElement("div");e.setAttribute("id","STRUCTUREAxisAndLabel");Mt["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:u+"px"});var t=[{type:"section",name:"LEGEND"},{type:N,name:"ELEMENT_DISTANCE",parameter:"MMPT_STRUCTURE_LEGEND_ELEMENT_DISTANCE"},{type:N,name:"MINIMUM_CONNECTOR_LENGTH",parameter:"MMPT_STRUCTURE_LEGEND_MIN_CONNECTOR_LENGTH"},{type:N,name:"CONNECTOR_WIDTH",parameter:"MMPT_STRUCTURE_LEGEND_CONNECTOR_WIDTH"},{type:N,name:"SYMBOL_WIDTH",parameter:"MMPT_STRUCTURE_LEGEND_SYMBOL_WIDTH"},{type:N,name:"PADDING",parameter:"MMPT_STRUCTURE_LEGEND_PADDING"},{type:"section",name:"VALUE_LABEL"},{type:N,name:"ELEMENT_DISTANCE",parameter:"MMPT_STRUCTURE_VALUE_LABEL_ELEMENT_DISTANCE"},{type:N,name:"ELEMENT_DISPLACEMENT_DISTANCE",parameter:"MMPT_STRUCTURE_VALUE_LABEL_ELEMENT_DISPLACEMENT_DISTANCE"},{type:P,name:"BACKGROUND_TRANSPARENCY",parameter:"FACTOR_STRUCTURE_LABEL_BACKGROUND_TRANSPARENCY"},{type:"section",name:"DIMENSION_LABEL"},{type:N,name:"AXIS_DISTANCE",parameter:"MMPT_STRUCTURE_CATEGORY_LABEL_AXIS_DISTANCE"},{type:N,name:"SIGN_DISTANCE",parameter:"MMPT_STRUCTURE_CATEGORY_LABEL_SIGN_DISTANCE"}];var i=buildRows(t);e.appendChild(i);return e}function createStructureOther(){var e=document.createElement("div");e.setAttribute("id","STRUCTUREOTHER");Mt["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:u+"px"});var t=[{type:"section",name:"SEPARATOR_CHANGE_OF"},{type:N,name:"SIZE",parameter:"MMPT_STRUCTURE_SEPARATOR_SIZE"},{type:"checkBox",name:"SEPARATOR_LEFT_AUTO_LENGTH",parameter:"CHECK_STRUCTURE_CHANGE_OF_SEPARATOR_NEGATIVE_AREA"},{type:P,name:"SEPARATOR_LENGTH_LEFT",parameter:"FACTOR_STRUCTURE_SEPARATOR_NEGATIVE_AREA"},{type:P,name:"SEPARATOR_LENGTH_RIGHT",parameter:"FACTOR_STRUCTURE_SEPARATOR_DRAWING_AREA"},{type:"rgbDiv",name:"COLOR",parameter:"COLOR_STRUCTURE_SEPARATOR"},{type:"section",name:"HIERARCHY"},{type:N,name:"OFFSET",parameter:"MMPT_STRUCTURE_HIERARCHY_OFFSET"},{type:"section",name:"CELL_PADDING"},{type:N,name:"TOP",parameter:"MMPT_STRUCTURE_CELL_PADDING_TOP"},{type:N,name:"LEFT_RIGHT",parameter:"MMPT_STRUCTURE_CELL_PADDING_SIDE"}];var i=buildRows(t);e.appendChild(i);return e}function createStructureValues(){var e=document.createElement("div");e.setAttribute("id","STRUCTUREValues");Mt["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:u+"px"});var t=[{type:"section",name:"SUBTOTAL"},{type:"checkBox",name:"FONT_BOLD",parameter:"CHECK_STRUCTURE_SUBTOTAL_FONT_BOLD"},{type:"rgbDiv",name:"SEPARATOR_COLOR",parameter:"COLOR_STRUCTURE_SUBTOTAL_SEPARATOR"},{type:N,name:"SEPARATOR_SIZE",parameter:"MMPT_STRUCTURE_SUBTOTAL_SEPARATOR_SIZE"},{type:"checkBox",name:"SEPARATOR_LEFT_AUTO_LENGTH",parameter:"CHECK_STRUCTURE_SUBTOTAL_SEPARATOR_NEGATIVE_AREA"},{type:P,name:"SEPARATOR_LENGTH_LEFT",parameter:"FACTOR_STRUCTURE_SUBTOTAL_SEPARATOR_NEGATIVE_AREA"},{type:P,name:"SEPARATOR_LENGTH_RIGHT",parameter:"FACTOR_STRUCTURE_SUBTOTAL_SEPARATOR_LENGTH"},{type:"section",name:"TOTAL_WITH_VALUES"},{type:"checkBox",name:"FONT_BOLD",parameter:"CHECK_STRUCTURE_TOTAL_WITH_VALUES_FONT_BOLD"},{type:"rgbDiv",name:"SEPARATOR_COLOR",parameter:"COLOR_STRUCTURE_TOTAL_WITH_VALUES_SEPARATOR"},{type:N,name:"SEPARATOR_SIZE",parameter:"MMPT_STRUCTURE_TOTAL_WITH_VALUES_SEPARATOR_SIZE"},{type:"checkBox",name:"SEPARATOR_LEFT_AUTO_LENGTH",parameter:"CHECK_STRUCTURE_TOTAL_WITH_VALUES_SEPARATOR_NEGATIVE_AREA"},{type:P,name:"SEPARATOR_LENGTH_LEFT",parameter:"FACTOR_STRUCTURE_TOTAL_WITH_VALUES_SEPARATOR_NEGATIVE_AREA"},{type:P,name:"SEPARATOR_LENGTH_RIGHT",parameter:"FACTOR_STRUCTURE_TOTAL_WITH_VALUES_SEPARATOR_LENGTH"},{type:"section",name:"TOTALS_WITHOUT_VALUES"},{type:"checkBox",name:"FONT_BOLD",parameter:"CHECK_STRUCTURE_TOTAL_WITHOUT_VALUES_FONT_BOLD"},{type:"rgbDiv",name:"SEPARATOR_COLOR",parameter:"COLOR_STRUCTURE_TOTAL_WITHOUT_VALUES_SEPARATOR"},{type:N,name:"SEPARATOR_SIZE",parameter:"MMPT_STRUCTURE_TOTAL_WITHOUT_VALUES_SEPARATOR_SIZE"},{type:"checkBox",name:"SEPARATOR_LEFT_AUTO_LENGTH",parameter:"CHECK_STRUCTURE_TOTAL_WITHOUT_VALUES_SEPARATOR_NEGATIVE_AREA"},{type:P,name:"SEPARATOR_LENGTH_LEFT",parameter:"FACTOR_STRUCTURE_TOTAL_WITHOUT_VALUES_SEPARATOR_NEGATIVE_AREA"},{type:P,name:"SEPARATOR_LENGTH_RIGHT",parameter:"FACTOR_STRUCTURE_TOTAL_WITHOUT_VALUES_SEPARATOR_LENGTH"}];var i=buildRows(t);e.appendChild(i);return e}function createTableTab(){return I.createTab("tableTab","XXXTable",te)}function createTableRepresentation(){var e=document.createElement("div");e.setAttribute("id","TABLEPresentation");Mt["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:u+"px"});var t=[{type:"section",name:"ELEMENT"},{type:N,name:"BAR_HEIGHT",parameter:"MMPT_TABLE_ELEMENT_BAR_HEIGHT"},{type:N,name:"SYMBOL_SIZE",parameter:"MMPT_TABLE_ELEMENT_SYMBOL_WIDTH"},{type:N,name:"NEEDLE_LINE_SIZE",parameter:"MMPT_TABLE_NEEDLE_LINE_SIZE"},{type:N,name:"LINE_SIZE",parameter:"MMPT_TABLE_LINE_SIZE"},{type:N,name:"VALUE_LABEL_DISTANCE",parameter:"MMPT_TABLE_ELEMENT_LABEL_AREA_DISTANCE"},{type:N,name:"OUTLIER_DISTANCE",parameter:"MMPT_TABLE_OUTLIER_DISTANCE"},{type:"section",name:"AXIS"},{type:N,name:"WITHOUT_AXIS_NOTATION",parameter:"MMPT_TABLE_AXIS_WITHOUT_NOTATION"},{type:N,name:"WITH_AXIS_NOTATION",parameter:"MMPT_TABLE_AXIS_WITH_NOTATION"},{type:"section",name:"HEADER"},{type:N,name:"TEXT_SPACE",parameter:"MMPT_TABLE_HEADER_TEXT_SPACE"},{type:N,name:"HEIGHT_WITH_NOTATION",parameter:"MMPT_TABLE_HEADER_WITH_NOTATION"},{type:N,name:"HEIGHT_WITHOUT_NOTATION",parameter:"MMPT_TABLE_HEADER_WITHOUT_NOTATION"},{type:N,name:"ELEMENT_DISTANCE",parameter:"MMPT_TABLE_HEADER_ELEMENT_DISTANCE"},{type:"checkBox",name:"REPEAT_NOTATION",parameter:"CHECK_TABLE_REPEAT_NOTATION"},{type:"section",name:"HEADER_LABEL"},{type:"dropdown",name:"LABEL_ALIGNMENT",parameter:"LABEL_ALIGNMENT",valuesArray:G,clazz:"_tableLabelAlignment"},{type:"dropdown",name:"AGGREGATED_LABEL_ALIGNMENT",parameter:"AGGREGATION_ALIGNMENT",valuesArray:H,clazz:"_labelAlignment"},{type:"rgbDiv",name:"AGGREGATED_BORDER_COLOR",parameter:"COLOR_AGGREGATION_BORDER"},{type:N,name:"AGGREGATED_BORDER_HEIGHT",parameter:"MMPT_AGGREGATION_BORDER_HEIGHT"},{type:N,name:"DISTANCE_TO_TOP",parameter:"MMPT_TABLE_HEADER_LABEL_DISTANCE_TOP"},{type:N,name:"DISTANCE_TO_BOTTOM",parameter:"MMPT_TABLE_HEADER_LABEL_DISTANCE_BOTTOM"}];var i=buildRows(t);e.appendChild(i);return e}function createTableStructure(){var e=document.createElement("div");e.setAttribute("id","TABLEStructure");Mt["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:u+"px"});var t=[{type:"section",name:"NORMAL"},{type:"rgbDiv",name:"BORDER_COLOR",parameter:"COLOR_BOTTOM_BORDER"},{type:N,name:"BORDER_SIZE",parameter:"MMPT_TABLE_VALUE_BOTTOM_BORDER_SIZE"},{type:N,name:"DISTANCE_TO_TOP",parameter:"MMPT_TABLE_TOP_DISTANCE_NORMAL"},{type:N,name:"DISTANCE_AFTER_NORMAL",parameter:"MMPT_TABLE_DISTANCE_AFTER_NORMAL"},{type:"section",name:"SUBTOTAL"},{type:"checkBox",name:"FONT_BOLD",parameter:"CHECK_TABLE_SUBTOTALS_FAT"},{type:"rgbDiv",name:"BORDER_COLOR",parameter:"COLOR_SUBTOTAL_BOTTOM_BORDER"},{type:N,name:"BORDER_SIZE",parameter:"MMPT_TABLE_SUBTOTAL_BOTTOM_BORDER_SIZE"},{type:N,name:"DISTANCE_TO_TOP",parameter:"MMPT_TABLE_TOP_DISTANCE_SUBTOTAL"},{type:N,name:"DISTANCE_AFTER_SUBTOTAL",parameter:"MMPT_TABLE_DISTANCE_AFTER_SUBTOTAL"},{type:"section",name:"TOTAL"},{type:"checkBox",name:"FONT_BOLD",parameter:"CHECK_TABLE_TOTALS_FAT"},{type:"rgbDiv",name:"BORDER_COLOR",parameter:"COLOR_TOTAL_BOTTOM_BORDER"},{type:N,name:"BORDER_SIZE",parameter:"MMPT_TABLE_TOTAL_BOTTOM_BORDER_SIZE"},{type:N,name:"DISTANCE_TO_TOP",parameter:"MMPT_TABLE_TOP_DISTANCE_TOTAL"},{type:N,name:"DISTANCE_AFTER_TOTAL",parameter:"MMPT_TABLE_DISTANCE_AFTER_TOTAL"},{type:"section",name:"TOTALS_WITHOUT_VALUES"},{type:"checkBox",name:"FONT_BOLD",parameter:"CHECK_TABLE_TOTALS_WITHOUT_VALUES_FONT_BOLD"},{type:"rgbDiv",name:"BORDER_COLOR",parameter:"COLOR_TABLE_TOTALS_WITHOUT_VALUES_BOTTOM_BORDER"},{type:N,name:"BORDER_SIZE",parameter:"MMPT_TABLE_TOTALS_WITHOUT_VALUES_BOTTOM_BORDER_SIZE"},{type:N,name:"DISTANCE_TO_TOP",parameter:"MMPT_TABLE_TOTALS_WITHOUT_VALUES_TOP_DISTANCE_TOTAL"},{type:N,name:"DISTANCE_AFTER_TOTAL",parameter:"MMPT_TABLE_TOTALS_WITHOUT_VALUES_DISTANCE_AFTER_TOTAL"}];var i=buildRows(t);e.appendChild(i);return e}function createTableOther(){var e=document.createElement("div");e.setAttribute("id","TABLEOther");Mt["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:u+"px"});var t=[{type:"section",name:"COLUMN"},{type:N,name:"COLUMN_WIDTH",parameter:"MMPT_TABLE_COLUMN_WIDTH"},{type:N,name:"DISTANCE_BETWEEN_COLUMNS",parameter:"MMPT_TABLE_COLUMN_DISTANCE"},{type:N,name:"DISTANCE_BETWEEN_COLUMNS_BIG",parameter:"MMPT_TABLE_COLUMN_DISTANCE_BIG"},{type:"section",name:"DIMENSION"},{type:"rgbDiv",name:"HEADER_BOTTOM_COLOR",parameter:"COLOR_TITLE_BOTTOM_BORDER"},{type:"section",name:"HIERARCHY"},{type:N,name:"OFFSET",parameter:"MMPT_TABLE_HIERARCHY_OFFSET"}];var i=buildRows(t);e.appendChild(i);return e}function createTimeTab(){return I.createTab("timeTab","XXXTime",ie)}function createTimeRepresentation(){var e=document.createElement("div");e.setAttribute("id","TIMEPresentation");Mt["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:u+"px"});var t=[{type:"section",name:"ELEMENT"},{type:N,name:"BAR_WIDTH",parameter:"MMPT_TIME_COLUMN_WIDTH"},{type:N,name:"SYMBOL_SIZE",parameter:"MMPT_TIME_SYMBOL_SIZE"},{type:N,name:"NEEDLE_LINE_SIZE",parameter:"MMPT_TIME_NEEDLE_LINE_SIZE"},{type:N,name:"LINE_SIZE",parameter:"MMPT_TIME_LINE_SIZE"},{type:N,name:"THIN_LINE_SIZE",parameter:"MMPT_TIME_THIN_LINE_SIZE"},{type:N,name:"DIMENSION_DISTANCE",parameter:"MMPT_TIME_CATEGORY_DISTANCE"},{type:N,name:"OUTLIER_DISTANCE",parameter:"MMPT_TIME_OUTLIER_DISTANCE"},{type:P,name:"DISPLACEMENT",parameter:"FACTOR_TIME_ELEMENT_DISPLACEMENT"},{type:"section",name:"AXIS"},{type:N,name:"WITHOUT_AXIS_NOTATION",parameter:"MMPT_TIME_AXIS_WITHOUT_NOTATION"},{type:N,name:"WITH_AXIS_NOTATION",parameter:"MMPT_TIME_AXIS_WITH_NOTATION"}];var i=buildRows(t);e.appendChild(i);return e}function createTimeAxisAndLabel(){var e=document.createElement("div");e.setAttribute("id","TIMEAxisAndLabel");Mt["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:u+"px"});var t=[{type:"section",name:"LEGEND"},{type:N,name:"ELEMENT_DISTANCE",parameter:"MMPT_TIME_LEGEND_ELEMENT_DISTANCE"},{type:N,name:"MINIMUM_CONNECTOR_LENGTH",parameter:"MMPT_TIME_LEGEND_MIN_CONNECTOR_LENGTH"},{type:N,name:"CONNECTOR_HEIGHT",parameter:"MMPT_TIME_LEGEND_CONNECTOR_HEIGHT"},{type:N,name:"SYMBOL_WIDTH",parameter:"MMPT_TIME_LEGEND_SYMBOL_WIDTH"},{type:N,name:"PADDING",parameter:"MMPT_TIME_LEGEND_PADDING"},{type:"section",name:"VALUE_LABEL"},{type:N,name:"ELEMENT_DISTANCE",parameter:"MMPT_TIME_LABEL_ELEMENT_DISTANCE"},{type:N,name:"ELEMENT_DISPLACEMENT_DISTANCE",parameter:"MMPT_TIME_LABEL_ELEMENT_DISPLACEMENT_DISTANCE"},{type:P,name:"BACKGROUND_TRANSPARENCY",parameter:"FACTOR_TIME_LABEL_BACKGROUND_TRANSPARENCY"},{type:"section",name:"DIMENSION_LABEL"},{type:N,name:"AXIS_DISTANCE",parameter:"MMPT_TIME_CATEGORY_LABEL_AXIS_DISTANCE"},{type:N,name:"SIGN_DISTANCE",parameter:"MMPT_TIME_CATEGORY_LABEL_SIGN_DISTANCE"}];var i=buildRows(t);e.appendChild(i);return e}function createTimeAxisSeparator(){var e=document.createElement("div");e.setAttribute("id","TIMEAxisSeparator");Mt["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:u+"px"});var t=[{type:"section",name:"SEPARATOR_CHANGE_OF"},{type:N,name:"SIZE",parameter:"MMPT_TIME_SEPARATOR_SIZE"},{type:"checkBox",name:"SEPARATOR_LEFT_AUTO_LENGTH",parameter:"CHECK_TIME_CHANGE_OF_SEPARATOR_NEGATIVE_AREA"},{type:P,name:"SEPARATOR_LENGTH_BOTTOM",parameter:"FACTOR_TIME_SEPARATOR_NEGATIVE_AREA"},{type:P,name:"SEPARATOR_LENGTH_TOP",parameter:"FACTOR_TIME_SEPARATOR_DRAWING_AREA"},{type:"rgbDiv",name:"COLOR",parameter:"COLOR_TIME_SEPARATOR"},{type:"section",name:"CELL_PADDING"},{type:N,name:"LEFT",parameter:"MMPT_TIME_VALUE_LABEL_PADDING_LEFT"},{type:N,name:"TOP_BOTTOM",parameter:"MMPT_TIME_VALUE_LABEL_PADDING_TOP"}];var i=buildRows(t);e.appendChild(i);return e}function createTimeValues(){var e=document.createElement("div");e.setAttribute("id","TIMEValues");Mt["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:u+"px"});var t=[{type:"section",name:"SUBTOTAL"},{type:"checkBox",name:"FONT_BOLD",parameter:"CHECK_TIME_SUBTOTAL_FONT_BOLD"},{type:"rgbDiv",name:"SEPARATOR_COLOR",parameter:"COLOR_TIME_SUBTOTAL_SEPARATOR"},{type:N,name:"SEPARATOR_SIZE",parameter:"MMPT_TIME_SUBTOTAL_SEPARATOR_SIZE"},{type:"checkBox",name:"SEPARATOR_BOTTOM_AUTO_LENGTH",parameter:"CHECK_TIME_SUBTOTAL_SEPARATOR_NEGATIVE_AREA"},{type:P,name:"SEPARATOR_LENGTH_BOTTOM",parameter:"FACTOR_TIME_SUBTOTAL_SEPARATOR_NEGATIVE_AREA"},{type:P,name:"SEPARATOR_LENGTH_TOP",parameter:"FACTOR_TIME_SUBTOTAL_SEPARATOR_LENGTH"},{type:"section",name:"TOTAL_WITH_VALUES"},{type:"checkBox",name:"FONT_BOLD",parameter:"CHECK_TIME_TOTAL_WITH_VALUES_FONT_BOLD"},{type:"rgbDiv",name:"SEPARATOR_COLOR",parameter:"COLOR_TIME_TOTAL_WITH_VALUES_SEPARATOR"},{type:N,name:"SEPARATOR_SIZE",parameter:"MMPT_TIME_TOTAL_WITH_VALUES_SEPARATOR_SIZE"},{type:"checkBox",name:"SEPARATOR_BOTTOM_AUTO_LENGTH",parameter:"CHECK_TIME_TOTAL_WITH_VALUES_SEPARATOR_NEGATIVE_AREA"},{type:P,name:"SEPARATOR_LENGTH_BOTTOM",parameter:"FACTOR_TIME_TOTAL_WITH_VALUES_SEPARATOR_NEGATIVE_AREA"},{type:P,name:"SEPARATOR_LENGTH_TOP",parameter:"FACTOR_TIME_TOTAL_WITH_VALUES_SEPARATOR_LENGTH"},{type:"section",name:"TOTALS_WITHOUT_VALUES"},{type:"checkBox",name:"FONT_BOLD",parameter:"CHECK_TIME_TOTAL_WITHOUT_VALUES_FONT_BOLD"},{type:"rgbDiv",name:"SEPARATOR_COLOR",parameter:"COLOR_TIME_TOTAL_WITHOUT_VALUES_SEPARATOR"},{type:N,name:"SEPARATOR_SIZE",parameter:"MMPT_TIME_TOTAL_WITHOUT_VALUES_SEPARATOR_SIZE"},{type:"checkBox",name:"SEPARATOR_BOTTOM_AUTO_LENGTH",parameter:"CHECK_TIME_TOTAL_WITHOUT_VALUES_SEPARATOR_NEGATIVE_AREA"},{type:P,name:"SEPARATOR_LENGTH_BOTTOM",parameter:"FACTOR_TIME_TOTAL_WITHOUT_VALUES_SEPARATOR_NEGATIVE_AREA"},{type:P,name:"SEPARATOR_LENGTH_TOP",parameter:"FACTOR_TIME_TOTAL_WITHOUT_VALUES_SEPARATOR_LENGTH"}];var i=buildRows(t);e.appendChild(i);return e}function createMultipleTab(){return I.createTab("multipleTab","XXXMultiple",ae)}function createMultipleBorder(){var e=document.createElement("div");e.setAttribute("id","MULTIPLEBorder");Mt["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:u+"px"});var t=[{type:"section",name:"TOP"},{type:N,name:"SIZE",parameter:"MMPT_MULTIPLE_CASE_TOP_BORDER_SIZE"},{type:"rgbDiv",name:"COLOR",parameter:"COLOR_MULTIPLE_CASE_TOP_BORDER"},{type:"section",name:"RIGHT"},{type:N,name:"SIZE",parameter:"MMPT_MULTIPLE_CASE_RIGHT_BORDER_SIZE"},{type:"rgbDiv",name:"COLOR",parameter:"COLOR_MULTIPLE_CASE_RIGHT_BORDER"},{type:"section",name:"BOTTOM"},{type:N,name:"SIZE",parameter:"MMPT_MULTIPLE_CASE_BOTTOM_BORDER_SIZE"},{type:"rgbDiv",name:"COLOR",parameter:"COLOR_MULTIPLE_CASE_BOTTOM_BORDER"},{type:"section",name:"LEFT"},{type:N,name:"SIZE",parameter:"MMPT_MULTIPLE_CASE_LEFT_BORDER_SIZE"},{type:"rgbDiv",name:"COLOR",parameter:"COLOR_MULTIPLE_CASE_LEFT_BORDER"}];var i=buildRows(t);e.appendChild(i);return e}function createDatatypeTab(){return I.createTab("datatypeTab","tabDatatypesDiv",K)}function createDatatypeActualTab(){var e=document.createElement("div");e.setAttribute("id","actualTab");var t=b.createDatatypeHeader("actual");e.appendChild(t);var i=b.createDatatypeContent("actual",y);e.appendChild(i);return e}function createDatatypeBudgetTab(){var e=document.createElement("div");e.setAttribute("id","budgetTab");var t=b.createDatatypeHeader("budget");e.appendChild(t);var i=b.createDatatypeContent("budget",C);e.appendChild(i);return e}function createDatatypeForecastTab(){var e=document.createElement("div");e.setAttribute("id","forecastTab");var t=b.createDatatypeHeader("forecast");e.appendChild(t);var i=b.createDatatypeContent("forecast",S);e.appendChild(i);return e}b.createDatatypeHeader=function(t){var e=document.createElement("div");Mt["b"].Utils.DOM.setStyle(e,{height:25+"px",width:"auto",overflow:"hidden"});var i=document.createElement("table");var a=document.createElement("tr");var n=document.createElement("td");Mt["b"].Utils.DOM.setStyle(n,{width:30+"px",minWidth:30+"px",whiteSpace:"nowrap"});Mt["b"].$(n).html(Ot["a"].getTranslationHtml("VERSION")+"&nbsp;&nbsp;");a.appendChild(n);n=document.createElement("td");Mt["b"].Utils.DOM.setStyle(n,{whiteSpace:"nowrap"});Mt["b"].$(n).html(Ot["a"].getTranslationHtml("DEFINITION")+"&nbsp;&nbsp;");a.appendChild(n);n=document.createElement("td");var r=Mt["b"].Utils.DOM.createSpan(n,"&nbsp;+&nbsp;","add_"+t);Mt["b"].$(r).click(function(){b.addTab(t)});Mt["b"].$(r).hover(function(){Mt["b"].$(this).css("text-decoration","underline")},function(){Mt["b"].$(this).css("text-decoration","none")});a.appendChild(n);n=document.createElement("td");var o=Mt["b"].Utils.DOM.createSpan(n,"&nbsp;-&nbsp;","remove_"+t);Mt["b"].$(o).click(function(e){b.removeTab(t,e)});Mt["b"].$(o).hover(function(){Mt["b"].$(this).css("text-decoration","underline")},function(){Mt["b"].$(this).css("text-decoration","none")});a.appendChild(n);i.appendChild(a);e.appendChild(i);var l=document.createElement("span");l.style.margin="0px";Mt["b"].$(l).html('<hr style="margin:0 0 3px 0; color:#000000; background-color:#000000">');e.appendChild(l);return e};b.createDatatypeContent=function(e,t){var i=document.createElement("div");if(e==="actual"){for(var a in t){if(!t.hasOwnProperty(a)){continue}X.push({id:"ACT"+t[a].version,text:"ACT_"+t[a].version,buildUp:createActualContentDefinition})}X.sort(function(e,t){return parseInt(e.id.substring(3))>parseInt(t.id.substring(3))});var n=X}else if(e==="budget"){for(var a in t){if(!t.hasOwnProperty(a)){continue}Y.push({id:"BUD"+t[a].version,text:"BUD_"+t[a].version,buildUp:createBudgetContentDefinition})}Y.sort(function(e,t){return parseInt(e.id.substring(3))>parseInt(t.id.substring(3))});var n=Y}else if(e==="forecast"){for(var a in t){if(!t.hasOwnProperty(a)){continue}Z.push({id:"FC"+t[a].version,text:"FC_"+t[a].version,buildUp:createForecastContentDefinition})}Z.sort(function(e,t){return parseInt(e.id.substring(2))>parseInt(t.id.substring(2))});var n=Z}I.buildTabs(e+"TabVersion",n,i,"auto",{top:"0px",left:"50px"},null,true);return i};function createActualContentDefinition(e){var t=document.createElement("div");t.setAttribute("id","actualDiv"+e);I.dataTypeTabs("actualContent"+e,a,t,"auto",{top:"0px",left:"0px"},null,true,e);return t}function createBudgetContentDefinition(e){var t=document.createElement("div");t.setAttribute("id","budgetDiv"+e);I.dataTypeTabs("budgetContent"+e,Q,t,"auto",{top:"0px",left:"0px"},null,true,e);return t}function createForecastContentDefinition(e){var t=document.createElement("div");t.setAttribute("id","forecastDiv"+e);I.dataTypeTabs("forecastContent"+e,q,t,"auto",{top:"0px",left:"0px"},null,true,e);return t}function createDefinition(e){var t=document.createElement("div");t.setAttribute("id","DefinitionTab_"+e);Mt["b"].Utils.DOM.setStyle(t,{overflow:"auto",width:"100%",height:d+"px"});var i=document.createElement("table");i.setAttribute("cellspacing","10");var a=b.createContent(e);var n=document.createElement("tr");var r=document.createElement("td");r.appendChild(a);n.appendChild(r);i.appendChild(n);t.appendChild(i);return t}b.createContent=function(e){var g=e.split("_").pop();var t=e.split("_")[0].split("-").pop();var u="12px 5px 0px 0px";var h="5px 5px 0px 0px";var p="12px 0px 0px 0px";var f=b.getDataObjectSettings(g,t);var i=document.createElement("div");var m=document.createElement("table");m.style.borderSpacing="0px 0px";var a=document.createElement("tr");var v=document.createElement("td");Mt["b"].$(v).html(Ot["a"].getTranslation("COLORS"));Mt["b"].$(v).css("padding","0px 0px 0px 0px");Mt["b"].$(v).css("margin","0px");v.setAttribute("valign","bottom");a.appendChild(v);m.appendChild(a);function buildUnderline(e,t){var i=document.createElement("tr");for(var a=0;a<7;a++){var n=document.createElement("span");n.style.margin="0px";Mt["b"].$(n).html('<hr style="margin:0 0 1px 0; color:'+e+"; background-color:"+e+'">');v=document.createElement("td");Mt["b"].$(v).css("height","1px");v.appendChild(n);Mt["b"].$(v).css("margin","0px");if(t){Mt["b"].$(v).css("padding","5px 0px 0px 0px")}else{Mt["b"].$(v).css("padding","0px 0px 0px 0px")}v.setAttribute("valign","top");i.appendChild(v)}m.appendChild(i)}buildUnderline("#000000",false);var n=[{html:"TYPE"},{html:"CONCEPT"},{html:"SUBTYPE"},{img:pe["a"].imgPath+"HiCo_Zeit_Vorvergangenheit.png",alt:"PAST_PAST"},{img:pe["a"].imgPath+"HiCo_Zeit_Vergangenheit.png",alt:"PAST"},{img:pe["a"].imgPath+"HiCo_Zeit_Heute.png",alt:"PRESENT"},{img:pe["a"].imgPath+"HiCo_Zeit_Zukunft.png",alt:"FUTURE"}];var r=document.createElement("tr");var o=n.length;for(var l=0;l<o;l++){v=document.createElement("td");if(n[l].html){Mt["b"].$(v).html(Ot["a"].getTranslation(n[l].html));Mt["b"].$(v).css("padding",h)}else if(n[l].img){Mt["b"].$(v).css("padding","5px 0px 0px 0px");var s=document.createElement("img");s.setAttribute("src",n[l].img);s.setAttribute("alt",Ot["a"].getTranslation(n[l].alt));s.setAttribute("title",Ot["a"].getTranslation(n[l].alt));Mt["b"].$(v).css("text-align","center");Mt["b"].$(s).css("text-align","center");v.appendChild(s)}Mt["b"].$(v).css("margin","0px");v.setAttribute("valign","bottom");r.appendChild(v)}m.appendChild(r);function buildColorSection(e){var t=e.length;for(var i=0;i<t;i++){var a=document.createElement("tr");var n=e[i];var r=n.texts.length;for(var o=0;o<r;o++){v=document.createElement("td");var l=n.texts[o]===""?"":Ot["a"].getTranslation(n.texts[o]);I.createLabel(v,l,true);Mt["b"].$(v).css("padding",u);a.appendChild(v)}var s=["ppy","py","p","f"];var d=s.length;for(var o=0;o<d;o++){var c=s[o];v=document.createElement("td");I.createItem(v,"input_"+c+"_"+g+"_"+n.idKey,f.settings[c][n.objectKey],"rgbDiv");Mt["b"].$(v).css("padding",p);Mt["b"].$(Mt["b"].$(v).find("div")[0]).css("margin-left","auto");Mt["b"].$(Mt["b"].$(v).find("div")[0]).css("margin-right","auto");a.appendChild(v)}m.appendChild(a)}}buildUnderline("#000000",false);var n=[{texts:["NORMAL","COLOR","BORDER"],objectKey:"colorBorder",idKey:"colorBorder"},{texts:["","","FILL1"],objectKey:"colorFill1",idKey:"ColorFill1"},{texts:["","","FILL2"],objectKey:"colorFill2",idKey:"ColorFill2"},{texts:["","OTHER","BORDER"],objectKey:"otherBorder",idKey:"otherBorder"},{texts:["","","FILL1"],objectKey:"otherFill1",idKey:"OtherFill1"},{texts:["","","FILL2"],objectKey:"otherFill2",idKey:"OtherFill2"}];buildColorSection(n);buildUnderline("#eeeeee",true);var n=[{texts:["POSITIVE","COLOR","BORDER"],objectKey:"positiveColorBorder",idKey:"positiveColorBorder"},{texts:["","","FILL1"],objectKey:"positiveColorFill1",idKey:"positiveColorFill1"},{texts:["","","FILL2"],objectKey:"positiveColorFill2",idKey:"positiveColorFill2"},{texts:["","OTHER","BORDER"],objectKey:"positiveOtherBorder",idKey:"positiveOtherBorder"},{texts:["","","FILL1"],objectKey:"positiveOtherFill1",idKey:"positiveOtherFill1"},{texts:["","","FILL2"],objectKey:"positiveOtherFill2",idKey:"positiveOtherFill2"}];buildColorSection(n);buildUnderline("#eeeeee",true);var n=[{texts:["NEGATIVE","COLOR","BORDER"],objectKey:"negativeColorBorder",idKey:"negativeColorBorder"},{texts:["","","FILL1"],objectKey:"negativeColorFill1",idKey:"negativeColorFill1"},{texts:["","","FILL2"],objectKey:"negativeColorFill2",idKey:"negativeColorFill2"},{texts:["","OTHER","BORDER"],objectKey:"negativeOtherBorder",idKey:"negativeOtherBorder"},{texts:["","","FILL1"],objectKey:"negativeOtherFill1",idKey:"negativeOtherFill1"},{texts:["","","FILL2"],objectKey:"negativeOtherFill2",idKey:"negativeOtherFill2"}];buildColorSection(n);m.style.borderSpacing="0px 0px";var r=document.createElement("tr");var a=document.createElement("tr");var v=document.createElement("td");Mt["b"].$(v).html(Ot["a"].getTranslation("SHAPES"));Mt["b"].$(v).css("padding",h);Mt["b"].$(v).css("margin","0px");v.setAttribute("valign","bottom");a.appendChild(v);m.appendChild(a);buildUnderline("#000000",false);v=document.createElement("td");Mt["b"].$(v).html(Ot["a"].getTranslation("TYPE"));Mt["b"].$(v).css("padding",h);Mt["b"].$(v).css("margin","0px");v.setAttribute("valign","bottom");r.appendChild(v);v=document.createElement("td");Mt["b"].$(v).html(Ot["a"].getTranslation("CONCEPT"));Mt["b"].$(v).css("padding",h);Mt["b"].$(v).css("margin","0px");v.setAttribute("valign","bottom");r.appendChild(v);v=document.createElement("td");Mt["b"].$(v).html("");Mt["b"].$(v).css("padding",h);Mt["b"].$(v).css("margin"," 0px");v.setAttribute("valign","bottom");r.appendChild(v);m.appendChild(r);var d=document.createElement("tr");for(var l=0;l<7;l++){var c=document.createElement("span");c.style.margin="0px";if(l!==2){Mt["b"].$(c).html('<hr style="margin:0 0 1px 0; color:#000000; background-color:#000000">')}v=document.createElement("td");Mt["b"].$(v).css("height","1px");v.appendChild(c);Mt["b"].$(v).css("margin","0px");v.setAttribute("valign","top");d.appendChild(v)}m.appendChild(d);function buildShapeSection(e){var t=e.length;for(var i=0;i<t;i++){var a=document.createElement("tr");var n=e[i];var r=n.texts.length;for(var o=0;o<r;o++){var l=document.createElement("td");var s=n.texts[o]===""?"":Ot["a"].getTranslation(n.texts[o]);I.createLabel(l,s,true);Mt["b"].$(l).css("padding",h);a.appendChild(l)}var d=["ppy","py","p","f"];var c=d.length;for(var o=0;o<c;o++){var u=d[o];var l=document.createElement("td");var p=getValueText(f.settings[u][n.objectKey],"shape");if(p===null||p===undefined){p="Square"}I.createItem(l,"input_"+u+"_"+g+"_"+n.idKey,{valueArray:n.valueArray,selectedValue:p,clazz:"_shapeType"},"dropdown",false,true);Mt["b"].$(Mt["b"].$(l).find("select")[0]).css("margin-left","0px");Mt["b"].$(l).css("padding","5px, 0px, 0px, 0x");a.appendChild(l)}m.appendChild(a)}}var n=[{texts:["SYMBOL","SHAPE",""],objectKey:"symbolShape",idKey:"symbolShape",valueArray:T},{texts:["","OTHER",""],objectKey:"symbolOther",idKey:"symbolOther",valueArray:T}];buildShapeSection(n);var a=document.createElement("tr");var v=document.createElement("td");Mt["b"].$(v).html(Ot["a"].getTranslation("AREAS"));Mt["b"].$(v).css("padding",h);Mt["b"].$(v).css("margin","0px");v.setAttribute("valign","bottom");a.appendChild(v);m.appendChild(a);buildUnderline("#000000",false);var r=document.createElement("tr");[Ot["a"].getTranslation("ELEMENT"),Ot["a"].getTranslation("CONCEPT"),""].forEach(function(e){r.innerHTML+='<td valign="bottom" style="margin: 0; padding: '+h+'">'+e+"</td>"});m.appendChild(r);var d=document.createElement("tr");for(var l=0;l<7;l++){var c=document.createElement("span");c.style.margin="0px";if(l!==2){Mt["b"].$(c).html('<hr style="margin:0 0 1px 0; color:#000000; background-color:#000000">')}v=document.createElement("td");Mt["b"].$(v).css("height","1px");v.appendChild(c);Mt["b"].$(v).css("margin","0px");v.setAttribute("valign","top");d.appendChild(v)}m.appendChild(d);function buildForecastPatternSection(e){var t=e.length;for(var i=0;i<t;i++){var a=document.createElement("tr");var n=e[i];var r=n.texts.length;for(var o=0;o<r;o++){var l=document.createElement("td");var s=n.texts[o]===""?"":Ot["a"].getTranslation(n.texts[o]);I.createLabel(l,s,true);Mt["b"].$(l).css("padding",h);a.appendChild(l)}var d=["ppy","py","p","f"];var c=d.length;for(var o=0;o<c;o++){var u=d[o];var l=document.createElement("td");if(n.idKey==="otherArea"||n.idKey==="otherOther"){var p=getValueText(f.settings[u][n.objectKey],"other");if(p===null||p===undefined){p="Diagonal"}I.createItem(l,"input_"+u+"_"+g+"_"+n.idKey,{valueArray:n.valueArray,selectedValue:p,clazz:"_shapeType"},"dropdown",false,true);Mt["b"].$(Mt["b"].$(l).find("select")[0]).css("margin-left","0px");Mt["b"].$(l).css("padding","5px, 0px, 0px, 0x");a.appendChild(l)}else{var p=getValueText(f.settings[u][n.objectKey],"line");if(p===null||p===undefined){p="Solid"}I.createItem(l,"input_"+u+"_"+g+"_"+n.idKey,{valueArray:n.valueArray,selectedValue:p,clazz:"_shapeType"},"dropdown",false,true);Mt["b"].$(Mt["b"].$(l).find("select")[0]).css("margin-left","0px");Mt["b"].$(l).css("padding","5px, 0px, 0px, 0x");a.appendChild(l)}}m.appendChild(a)}}var n=[{texts:["LINE","AREA",""],objectKey:"lineShape",idKey:"lineShape",valueArray:O},{texts:["","OTHER",""],objectKey:"lineOther",idKey:"lineOther",valueArray:O},{texts:["OTHER","AREA",""],objectKey:"otherArea",idKey:"otherArea",valueArray:_},{texts:["","OTHER",""],objectKey:"otherOther",idKey:"otherOther",valueArray:_}];buildForecastPatternSection(n);i.appendChild(m);return i};b.getDataObjectSettings=function(e,t){var i=null;if(t===null||t===undefined||t===""){if(e.substring(0,3)==="ACT"){i=y[e]}else if(e.substring(0,3)==="BUD"){i=C[e]}else if(e.substring(0,2)==="FC"){i=S[e]}}else if(t==="PPY"){if(e.substring(0,3)==="ACT"){i=y[e].settings.ppy}else if(e.substring(0,3)==="BUD"){i=C[e].settings.ppy}else if(e.substring(0,2)==="FC"){i=S[e].settings.ppy}}else if(t==="PY"){if(e.substring(0,3)==="ACT"){i=y[e].settings.py}else if(e.substring(0,3)==="BUD"){i=C[e].settings.py}else if(e.substring(0,2)==="FC"){i=S[e].settings.py}}else if(t==="Present"){if(e.substring(0,3)==="ACT"){i=y[e].settings.p}else if(e.substring(0,3)==="BUD"){i=C[e].settings.p}else if(e.substring(0,2)==="FC"){i=S[e].settings.p}}else if(t==="Future"){if(e.substring(0,3)==="ACT"){i=y[e].settings.f}else if(e.substring(0,3)==="BUD"){i=C[e].settings.f}else if(e.substring(0,2)==="FC"){i=S[e].settings.f}}return i};b.addTab=function(e){var t=b.getNextId(e);var i=t.id;var a=t.text;b.addNewObject(e,t.version);if(e==="actual"){X.push({id:i,text:a,buildUp:createActualContentDefinition});I.buildSingleTab("actualTabVersion",i,a,createActualContentDefinition,"auto",{top:"0px",left:"50px"});E["Actual"][i]="-"}else if(e==="budget"){Y.push({id:i,text:a,buildUp:createBudgetContentDefinition});I.buildSingleTab("budgetTabVersion",i,a,createBudgetContentDefinition,"auto",{top:"0px",left:"50px"});E["Budget"][i]="-"}else if(e==="forecast"){Z.push({id:i,text:a,buildUp:createForecastContentDefinition});I.buildSingleTab("forecastTabVersion",i,a,createForecastContentDefinition,"auto",{top:"0px",left:"50px"});E["Forecast"][i]="-"}b.setCSS()};b.getNextId=function(e){var t="";var i=-1;if(e==="actual"){t="ACT";for(var a in y){if(y.hasOwnProperty(a)&&parseInt(y[a].version)>i){i=parseInt(y[a].version)}}}else if(e==="budget"){t="BUD";for(var a in C){if(C.hasOwnProperty(a)&&C[a].version>i){i=parseInt(C[a].version)}}}else if(e==="forecast"){t="FC";for(var a in S){if(S.hasOwnProperty(a)&&parseInt(S[a].version)>i){i=parseInt(S[a].version)}}}i++;return{id:t+i,version:i,text:t+"_"+i}};b.addNewObject=function(e,t){if(e==="actual"){y["ACT"+t]={name:"Actual"+t,version:""+t,settings:{ppy:{colorBorder:"RGB(153,193,255)",ColorFill1:"RGB(153,193,255)",ColorFill2:"RGB(255,255,255)",otherBorder:"RGB(191,191,191)",OtherFill1:"RGB(191,191,191)",OtherFill2:"RGB(255,255,255)",positiveColorBorder:"RGB(140,180,0)",positiveColorFill1:"RGB(140,180,0)",positiveColorFill2:"RGB(255,255,255)",positiveOtherBorder:"RGB(191,191,191)",positiveOtherFill1:"RGB(191,191,191)",positiveOtherFill2:"RGB(255,255,255)",negativeColorBorder:"RGB(255,0,0)",negativeColorFill1:"RGB(255,0,0)",negativeColorFill2:"RGB(255,255,255)",negativeOtherBorder:"RGB(0,0,0)",negativeOtherFill1:"RGB(0,0,0)",negativeOtherFill2:"RGB(255,255,255)",symbolShape:"triangle",symbolOther:"square",lineShape:"solid",lineOther:"solid",otherArea:"filled",otherOther:"filled"},py:{colorBorder:"RGB(102,164,255)",ColorFill1:"RGB(128,128,128)",ColorFill2:"RGB(255,255,255)",otherBorder:"RGB(128,128,128)",OtherFill1:"RGB(128,128,128)",OtherFill2:"RGB(255,255,255)",positiveColorBorder:"RGB(140,180,0)",positiveColorFill1:"RGB(140,180,0)",positiveColorFill2:"RGB(255,255,255)",positiveOtherBorder:"RGB(191,191,191)",positiveOtherFill1:"RGB(191,191,191)",positiveOtherFill2:"RGB(255,255,255)",negativeColorBorder:"RGB(255,0,0)",negativeColorFill1:"RGB(255,0,0)",negativeColorFill2:"RGB(255,255,255)",negativeOtherBorder:"RGB(0,0,0)",negativeOtherFill1:"RGB(0,0,0)",negativeOtherFill2:"RGB(255,255,255)",symbolShape:"triangle",symbolOther:"square",lineShape:"solid",lineOther:"solid",otherArea:"filled",otherOther:"filled"},p:{colorBorder:"RGB(0,100,255)",ColorFill1:"RGB(0,100,255)",ColorFill2:"RGB(255,255,255)",otherBorder:"RGB(0,0,0)",OtherFill1:"RGB(0,0,0)",OtherFill2:"RGB(255,255,255)",positiveColorBorder:"RGB(140,180,0)",positiveColorFill1:"RGB(140,180,0)",positiveColorFill2:"RGB(255,255,255)",positiveOtherBorder:"RGB(191,191,191)",positiveOtherFill1:"RGB(191,191,191)",positiveOtherFill2:"RGB(255,255,255)",negativeColorBorder:"RGB(255,0,0)",negativeColorFill1:"RGB(255,0,0)",negativeColorFill2:"RGB(255,255,255)",negativeOtherBorder:"RGB(0,0,0)",negativeOtherFill1:"RGB(0,0,0)",negativeOtherFill2:"RGB(255,255,255)",symbolShape:"square",symbolOther:"square",lineShape:"solid",lineOther:"solid",otherArea:"filled",otherOther:"filled"},f:{colorBorder:"RGB(0,100,255)",ColorFill1:"RGB(0,100,255)",ColorFill2:"RGB(255,255,255)",otherBorder:"RGB(0,0,0)",OtherFill1:"RGB(0,0,0)",OtherFill2:"RGB(255,255,255)",positiveColorBorder:"RGB(140,180,0)",positiveColorFill1:"RGB(140,180,0)",positiveColorFill2:"RGB(255,255,255)",positiveOtherBorder:"RGB(191,191,191)",positiveOtherFill1:"RGB(191,191,191)",positiveOtherFill2:"RGB(255,255,255)",negativeColorBorder:"RGB(255,0,0)",negativeColorFill1:"RGB(255,0,0)",negativeColorFill2:"RGB(255,255,255)",negativeOtherBorder:"RGB(0,0,0)",negativeOtherFill1:"RGB(0,0,0)",negativeOtherFill2:"RGB(255,255,255)",symbolShape:"square",symbolOther:"square",lineShape:"solid",lineOther:"solid",otherArea:"filled",otherOther:"filled"}}}}else if(e==="budget"){C["BUD"+t]={name:"Budget"+t,version:""+t,settings:{ppy:{colorBorder:"RGB(255,153,209)",ColorFill1:"RGB(255,153,209)",ColorFill2:"RGB(255,255,255)",otherBorder:"RGB(0,0,0)",OtherFill1:"RGB(0,0,0)",OtherFill2:"RGB(255,255,255)",positiveColorBorder:"RGB(140,180,0)",positiveColorFill1:"RGB(140,180,0)",positiveColorFill2:"RGB(255,255,255)",positiveOtherBorder:"RGB(191,191,191)",positiveOtherFill1:"RGB(191,191,191)",positiveOtherFill2:"RGB(255,255,255)",negativeColorBorder:"RGB(255,0,0)",negativeColorFill1:"RGB(255,0,0)",negativeColorFill2:"RGB(255,255,255)",negativeOtherBorder:"RGB(0,0,0)",negativeOtherFill1:"RGB(0,0,0)",negativeOtherFill2:"RGB(255,255,255)",symbolShape:"circle",symbolOther:"square",lineShape:"dotted",lineOther:"solid",otherArea:"empty",otherOther:"empty"},py:{colorBorder:"RGB(255,102,186)",ColorFill1:"RGB(255,102,186)",ColorFill2:"RGB(255,255,255)",otherBorder:"RGB(0,0,0)",OtherFill1:"RGB(0,0,0)",OtherFill2:"RGB(255,255,255)",positiveColorBorder:"RGB(140,180,0)",positiveColorFill1:"RGB(140,180,0)",positiveColorFill2:"RGB(255,255,255)",positiveOtherBorder:"RGB(191,191,191)",positiveOtherFill1:"RGB(191,191,191)",positiveOtherFill2:"RGB(255,255,255)",negativeColorBorder:"RGB(255,0,0)",negativeColorFill1:"RGB(255,0,0)",negativeColorFill2:"RGB(255,255,255)",negativeOtherBorder:"RGB(0,0,0)",negativeOtherFill1:"RGB(0,0,0)",negativeOtherFill2:"RGB(255,255,255)",symbolShape:"circle",symbolOther:"square",lineShape:"dotted",lineOther:"solid",otherArea:"empty",otherOther:"empty"},p:{colorBorder:"RGB(255,0,140)",ColorFill1:"RGB(255,0,140)",ColorFill2:"RGB(255,255,255)",otherBorder:"RGB(0,0,0)",OtherFill1:"RGB(0,0,0)",OtherFill2:"RGB(255,255,255)",positiveColorBorder:"RGB(140,180,0)",positiveColorFill1:"RGB(140,180,0)",positiveColorFill2:"RGB(255,255,255)",positiveOtherBorder:"RGB(191,191,191)",positiveOtherFill1:"RGB(191,191,191)",positiveOtherFill2:"RGB(255,255,255)",negativeColorBorder:"RGB(255,0,0)",negativeColorFill1:"RGB(255,0,0)",negativeColorFill2:"RGB(255,255,255)",negativeOtherBorder:"RGB(0,0,0)",negativeOtherFill1:"RGB(0,0,0)",negativeOtherFill2:"RGB(255,255,255)",symbolShape:"circle",symbolOther:"square",lineShape:"dotted",lineOther:"solid",otherArea:"empty",otherOther:"empty"},f:{colorBorder:"RGB(255,0,140)",ColorFill1:"RGB(255,0,140)",ColorFill2:"RGB(255,255,255)",otherBorder:"RGB(0,0,0)",OtherFill1:"RGB(0,0,0)",OtherFill2:"RGB(255,255,255)",positiveColorBorder:"RGB(140,180,0)",positiveColorFill1:"RGB(140,180,0)",positiveColorFill2:"RGB(255,255,255)",positiveOtherBorder:"RGB(191,191,191)",positiveOtherFill1:"RGB(191,191,191)",positiveOtherFill2:"RGB(255,255,255)",negativeColorBorder:"RGB(255,0,0)",negativeColorFill1:"RGB(255,0,0)",negativeColorFill2:"RGB(255,255,255)",negativeOtherBorder:"RGB(0,0,0)",negativeOtherFill1:"RGB(0,0,0)",negativeOtherFill2:"RGB(255,255,255)",symbolShape:"circle",symbolOther:"square",lineShape:"dotted",lineOther:"solid",otherArea:"empty",otherOther:"empty"}}}}else if(e==="forecast"){S["FC"+t]={name:"Forecast"+t,version:""+t,settings:{ppy:{colorBorder:"RGB(255,232,119)",ColorFill1:"RGB(255,232,119)",ColorFill2:"RGB(255,255,255)",otherBorder:"RGB(0,0,0)",OtherFill1:"RGB(0,0,0)",OtherFill2:"RGB(255,255,255)",positiveColorBorder:"RGB(140,180,0)",positiveColorFill1:"RGB(140,180,0)",positiveColorFill2:"RGB(255,255,255)",positiveOtherBorder:"RGB(191,191,191)",positiveOtherFill1:"RGB(191,191,191)",positiveOtherFill2:"RGB(255,255,255)",negativeColorBorder:"RGB(255,0,0)",negativeColorFill1:"RGB(255,0,0)",negativeColorFill2:"RGB(255,255,255)",negativeOtherBorder:"RGB(0,0,0)",negativeOtherFill1:"RGB(0,0,0)",negativeOtherFill2:"RGB(255,255,255)",symbolShape:"diamond",symbolOther:"square",lineShape:"dashed",lineOther:"solid",otherArea:"diagonal",otherOther:"diagonal"},py:{colorBorder:"RGB(255,219,51)",ColorFill1:"RGB(255,219,51)",ColorFill2:"RGB(255,255,255)",otherBorder:"RGB(0,0,0)",OtherFill1:"RGB(0,0,0)",OtherFill2:"RGB(255,255,255)",positiveColorBorder:"RGB(140,180,0)",positiveColorFill1:"RGB(140,180,0)",positiveColorFill2:"RGB(255,255,255)",positiveOtherBorder:"RGB(191,191,191)",positiveOtherFill1:"RGB(191,191,191)",positiveOtherFill2:"RGB(255,255,255)",negativeColorBorder:"RGB(255,0,0)",negativeColorFill1:"RGB(255,0,0)",negativeColorFill2:"RGB(255,255,255)",negativeOtherBorder:"RGB(0,0,0)",negativeOtherFill1:"RGB(0,0,0)",negativeOtherFill2:"RGB(255,255,255)",symbolShape:"diamond",symbolOther:"square",lineShape:"dashed",lineOther:"solid",otherArea:"diagonal",otherOther:"diagonal"},p:{colorBorder:"RGB(170,140,0)",ColorFill1:"RGB(170,140,0)",ColorFill2:"RGB(255,255,255)",otherBorder:"RGB(0,0,0)",OtherFill1:"RGB(0,0,0)",OtherFill2:"RGB(255,255,255)",positiveColorBorder:"RGB(140,180,0)",positiveColorFill1:"RGB(140,180,0)",positiveColorFill2:"RGB(255,255,255)",positiveOtherBorder:"RGB(191,191,191)",positiveOtherFill1:"RGB(191,191,191)",positiveOtherFill2:"RGB(255,255,255)",negativeColorBorder:"RGB(255,0,0)",negativeColorFill1:"RGB(255,0,0)",negativeColorFill2:"RGB(255,255,255)",negativeOtherBorder:"RGB(0,0,0)",negativeOtherFill1:"RGB(0,0,0)",negativeOtherFill2:"RGB(255,255,255)",symbolShape:"diamond",symbolOther:"square",lineShape:"dashed",lineOther:"solid",otherArea:"diagonal",otherOther:"diagonal"},f:{colorBorder:"RGB(170,140,0)",ColorFill1:"RGB(170,140,0)",ColorFill2:"RGB(255,255,255)",otherBorder:"RGB(0,0,0)",OtherFill1:"RGB(0,0,0)",OtherFill2:"RGB(255,255,255)",positiveColorBorder:"RGB(140,180,0)",positiveColorFill1:"RGB(140,180,0)",positiveColorFill2:"RGB(255,255,255)",positiveOtherBorder:"RGB(191,191,191)",positiveOtherFill1:"RGB(191,191,191)",positiveOtherFill2:"RGB(255,255,255)",negativeColorBorder:"RGB(255,0,0)",negativeColorFill1:"RGB(255,0,0)",negativeColorFill2:"RGB(255,255,255)",negativeOtherBorder:"RGB(0,0,0)",negativeOtherFill1:"RGB(0,0,0)",negativeOtherFill2:"RGB(255,255,255)",symbolShape:"diamond",symbolOther:"square",lineShape:"dashed",lineOther:"solid",otherArea:"diagonal",otherOther:"diagonal"}}}}};b.removeTab=function(e){var t=null;if(e==="actual"){t=Mt["b"].$("#actualTabVersion");var i=Mt["b"].$(t[0].childNodes[0]).find("a");var a=i.length;for(r=0;r<a;r++){var n=Mt["b"].$(i[r]);if(n&&n.css("text-decoration").indexOf("underline")!==-1){g=Mt["b"].$(i[r]).attr("href").replace("#","");if(g==="ACT0"){return}Mt["b"].$(i[r]).remove();r=i.length}}for(var r=0;r<X.length;r++){if(X[r].id===g){X.splice(r,1)}}delete y[g];Mt["b"].$("#XXX-TAB-"+g).remove();Mt["b"].$("#"+g).remove();E["Actual"][g]="delete";Mt["b"].$(t).tabs("select",0)}else if(e==="budget"){t=document.getElementById("budgetTabVersion");var i=Mt["b"].$(t.childNodes[0]).find("a");var a=i.length;for(r=0;r<a;r++){var n=Mt["b"].$(i[r]);if(n&&n.css("text-decoration").indexOf("underline")!==-1){h=Mt["b"].$(i[r]).attr("href").replace("#","");if(h==="BUD0"){return}Mt["b"].$(i[r]).remove();r=i.length}}var o=Y.length;for(var r=0;r<o;r++){if(Y[r].id===h){Y.splice(r,1)}}delete C[h];Mt["b"].$("#XXX-TAB-"+h).remove();Mt["b"].$("#"+h).remove();E["Budget"][h]="delete";Mt["b"].$(t).tabs("select",0)}else if(e==="forecast"){t=document.getElementById("forecastTabVersion");var i=Mt["b"].$(t.childNodes[0]).find("a");var a=i.length;for(r=0;r<a;r++){var n=Mt["b"].$(i[r]);if(n&&n.css("text-decoration").indexOf("underline")!==-1){f=Mt["b"].$(i[r]).attr("href").replace("#","");if(f==="FC0"){return}Mt["b"].$(i[r]).remove();r=i.length}}for(var r=0;r<Z.length;r++){if(Z[r].id===f){Z.splice(r,1)}}delete S[f];Mt["b"].$("#XXX-TAB-"+f).remove();Mt["b"].$("#"+f).remove();E["Forecast"][f]="delete";Mt["b"].$(t).tabs("select",0)}};b.updateDivHeight=function(){var e=Mt["b"].$(o).dialog("option","height");o.style.height=e-70+"px";var t=122;var i=e-t;Mt["b"].$("#generalTab").css("height",i);Mt["b"].$("#structureTab").css("height",i);Mt["b"].$("#tableTab").css("height",i);Mt["b"].$("#timeTab").css("height",i);Mt["b"].$("#multipleTab").css("height",i);Mt["b"].$("#datatypeTab").css("height",i);i=e-t-81;for(var a in y){Mt["b"].$("#DefinitionTab_actual-_"+a).css("height",i)}for(var a in C){Mt["b"].$("#DefinitionTab_budget-_"+a).css("height",i)}for(var a in S){Mt["b"].$("#DefinitionTab_forecast-_"+a).css("height",i)}i=e-t-44;Mt["b"].$("#GENERALValueTypes").css("height",i);Mt["b"].$("#GENERALFontTypes").css("height",i);Mt["b"].$("#HighlightCompare").css("height",i);Mt["b"].$("#GeneralNavigation").css("height",i);Mt["b"].$("#GeneralOther").css("height",i);Mt["b"].$("#STRUCTUREPresentation").css("height",i);Mt["b"].$("#STRUCTUREAxisAndLabel").css("height",i);Mt["b"].$("#STRUCTUREOTHER").css("height",i);Mt["b"].$("#STRUCTUREValues").css("height",i);Mt["b"].$("#TABLEPresentation").css("height",i);Mt["b"].$("#TABLEStructure").css("height",i);Mt["b"].$("#TABLEAxis").css("height",i);Mt["b"].$("#TABLEColumnNotation").css("height",i);Mt["b"].$("#TABLEOther").css("height",i);Mt["b"].$("#TABLESubtotals").css("height",i);Mt["b"].$("#TABLETotals").css("height",i);Mt["b"].$("#TABLEAxisAndColumn").css("height",i);Mt["b"].$("#TIMEPresentation").css("height",i);Mt["b"].$("#TIMEFactor").css("height",i);Mt["b"].$("#TIMEAxis").css("height",i);Mt["b"].$("#TIMEAxisAndLabel").css("height",i);Mt["b"].$("#TIMEAxisSeparator").css("height",i);Mt["b"].$("#TIMECategoryLabel").css("height",i);Mt["b"].$("#TIMEValueLabel").css("height",i);Mt["b"].$("#TIMEValueRowLabel").css("height",i);Mt["b"].$("#TIMEOverallSeparator").css("height",i);Mt["b"].$("#TIMEValues").css("height",i);Mt["b"].$("#MULTIPLEBorder").css("height",i)};b.updateHeight=function(){var e=Mt["b"].$(o).parent().height()-70;o.style.height=e+"px";var t=50;var i=e-t;Mt["b"].$(".ui-tabs-panel",Mt["b"].$(o).parent()).height(i-Mt["b"].$("#tabDiv > .ui-tabs-nav").height()-n);Mt["b"].Utils.DOM.setStyle(document.getElementById("tabs-general"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("tabs-structure"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("tabs-table"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("tabs-time"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("tabs-datatypes"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("tabs-multiple"),{height:i+"px"});i=e-t-81;Mt["b"].Utils.DOM.setStyle(document.getElementById("generalTab"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("structureTab"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("tableTab"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("timeTab"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("multipleTab"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("datatypeTab"),{height:i+"px"});i=e-t-42;Mt["b"].Utils.DOM.setStyle(document.getElementById("XXXgeneralFont"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("XXXgeneralValue"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("XXXhighlightcompare"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("XXXnavigation"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("XXXother"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("XXXstructurePresentation"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("XXXstructureAxisAndLabel"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("XXXstructureOther"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("XXXstructureValues"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("XXXtablePresentation"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("XXXtableStructure"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("XXXtableTitle"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("XXXtimePresentation"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("XXXtimeAxisAndLabel"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("XXXtimeAxisSeparator"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("XXXtimeValues"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("XXXmultipleBorder"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("datatypeTabs-actual"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("datatypeTabs-budget"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("datatypeTabs-forecast"),{height:i+"px"});i=e-t-40;Mt["b"].Utils.DOM.setStyle(document.getElementById("GENERALValueTypes"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("GENERALFontTypes"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("HighlightCompare"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("GeneralNavigation"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("GeneralOther"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("STRUCTUREPresentation"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("STRUCTUREAxisAndLabel"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("STRUCTUREOTHER"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("STRUCTUREValues"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("TABLEPresentation"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("TABLEStructure"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("TABLEOther"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("TIMEPresentation"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("TIMEValues"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("TIMEAxisSeparator"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("TIMEAxisAndLabel"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("MULTIPLEBorder"),{height:i+"px"});i=e-t-81;for(var a in y){if(!y.hasOwnProperty(a)){continue}Mt["b"].Utils.DOM.setStyle(document.getElementById(a),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("DefinitionTab_actual-_"+a),{height:i+"px"})}for(var a in C){if(!C.hasOwnProperty(a)){continue}Mt["b"].Utils.DOM.setStyle(document.getElementById(a),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("DefinitionTab_budget-_"+a),{height:i+"px"})}for(var a in S){if(!S.hasOwnProperty(a)){continue}Mt["b"].Utils.DOM.setStyle(document.getElementById(a),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("DefinitionTab_forecast-_"+a),{height:i+"px"})}};b.changeSelection=function(e,t){var i=[y,C,S];var a=["ppy","py","p","f"];var n=["ppy","py","p","f"];for(var r=0;r<i.length;r++){for(var o in i[r]){if(!i[r].hasOwnProperty(o)){continue}var l=o;var s=i[r][o];for(var d=0;d<a.length;d++){var c=a[d];var u=n[d];var p=s.settings[c];var g=null;p.colorBorder=Mt["b"].$("#input_"+u+"_"+l+"_colorBorder").css("background-color");p.colorFill1=Mt["b"].$("#input_"+u+"_"+l+"_ColorFill1").css("background-color");p.colorFill2=Mt["b"].$("#input_"+u+"_"+l+"_ColorFill2").css("background-color");p.otherBorder=Mt["b"].$("#input_"+u+"_"+l+"_otherBorder").css("background-color");p.otherFill1=Mt["b"].$("#input_"+u+"_"+l+"_OtherFill1").css("background-color");p.otherFill2=Mt["b"].$("#input_"+u+"_"+l+"_OtherFill2").css("background-color");p.positiveColorBorder=Mt["b"].$("#input_"+u+"_"+l+"_positiveColorBorder").css("background-color");p.positiveColorFill1=Mt["b"].$("#input_"+u+"_"+l+"_positiveColorFill1").css("background-color");p.positiveColorFill2=Mt["b"].$("#input_"+u+"_"+l+"_positiveColorFill2").css("background-color");p.positiveOtherBorder=Mt["b"].$("#input_"+u+"_"+l+"_positiveOtherBorder").css("background-color");p.positiveOtherFill1=Mt["b"].$("#input_"+u+"_"+l+"_positiveOtherFill1").css("background-color");p.positiveOtherFill2=Mt["b"].$("#input_"+u+"_"+l+"_positiveOtherFill2").css("background-color");p.negativeColorBorder=Mt["b"].$("#input_"+u+"_"+l+"_negativeColorBorder").css("background-color");p.negativeColorFill1=Mt["b"].$("#input_"+u+"_"+l+"_negativeColorFill1").css("background-color");p.negativeColorFill2=Mt["b"].$("#input_"+u+"_"+l+"_negativeColorFill2").css("background-color");p.negativeOtherBorder=Mt["b"].$("#input_"+u+"_"+l+"_negativeOtherBorder").css("background-color");p.negativeOtherFill1=Mt["b"].$("#input_"+u+"_"+l+"_negativeOtherFill1").css("background-color");p.negativeOtherFill2=Mt["b"].$("#input_"+u+"_"+l+"_negativeOtherFill2").css("background-color");g=document.getElementById("input_"+u.toLowerCase()+"_"+l+"_symbolShape");p.symbolShape=M[g.selectedIndex];g=document.getElementById("input_"+u.toLowerCase()+"_"+l+"_symbolOther");p.symbolOther=M[g.selectedIndex];g=document.getElementById("input_"+u.toLowerCase()+"_"+l+"_lineShape");p.lineShape=A[g.selectedIndex];g=document.getElementById("input_"+u.toLowerCase()+"_"+l+"_lineOther");p.lineOther=A[g.selectedIndex];g=document.getElementById("input_"+u.toLowerCase()+"_"+l+"_otherArea");p.otherArea=L[g.selectedIndex];g=document.getElementById("input_"+u.toLowerCase()+"_"+l+"_otherOther");p.otherOther=L[g.selectedIndex]}}}var h=k.getParameters();for(var o in h){if(!h.hasOwnProperty(o)){continue}var f=document.getElementById("nm_i_"+o);if(!f){if(o.indexOf("_")!==0){console.warn("element "+o+" not found")}continue}var m=f.tagName.toLowerCase();if(m==="input"){var v=f.type.toLowerCase();if(v==="text"){var b=f.value;b=b.replace(/,/g,".");if(f.getAttribute("mmppt")===N){b=(parseFloat(b)/10).toString()}else if(f.getAttribute("mmppt")===P){b=(parseFloat(b)/100).toString()}h[o]=b}else if(v==="checkbox"){h[o]=f.checked.toString()}else if(v==="image"){h[o]=checkImage(f)}}else if(m==="select"){var T=f.getAttribute("class");if(T==="_fontTypes"){h[o]=U[f.selectedIndex].translation}else if(T==="_labelAlignment"){h[o]=H[f.selectedIndex].id}else if(T==="_lengthUnits"){h[o]=W[f.selectedIndex].translation}else if(T==="_outlierStyle"){h[o]=V[f.selectedIndex].id}else if(T==="_pinStyle"){h[o]=$[f.selectedIndex].id}else if(T==="_tableLabelAlignment"){h[o]=G[f.selectedIndex].id}else if(T==="_defaultCompareStyle"){h[o]=z[f.selectedIndex].id}}else if(m==="div"){h[o]=f.style.backgroundColor}}k.setNotationManual({parameters:h,datatypes:x},e,E,t)};function escapeBeforeHandler(){return true}function escapeAfterHandler(){}b.save=function(){b.changeSelection(false,true);I.close();repaintAllExtensions()};b.apply=function(){b.changeSelection(false,r);m=k.getParameters();repaintAllExtensions();b.onApplyChanges(false)};b.onApplyChanges=function(e){if(b.hasOwnProperty("onApply")){b.onApply&&b.onApply(e)}};b.close=function(e){if(e===true){I.close();b.onApplyChanges(true);return}var t=false;for(var i in m){var a=document.getElementById("nm_i_"+i);if(!m.hasOwnProperty(i)||!a){if(i.indexOf("_")!==0){console.warn("element "+i+" not found")}continue}var n=a.tagName.toLowerCase();if(n==="input"){var r=a.type.toLowerCase();if(r==="text"){var o=a.value;o=o.replace(/,/g,".");if(a.getAttribute("mmppt")===N){o=(parseFloat(o)/10).toString()}else if(a.getAttribute("mmppt")===P){o=(parseFloat(o)/100).toString()}if(o!==m[i]){t=true;break}}else if(r==="checkbox"){if(a.checked.toString()!==m[i].toString()){t=true;break}}}else if(n==="select"){var l=a.getAttribute("class");if(l==="_fontTypes"){if(U[a.selectedIndex].translation.toLowerCase()!==m[i].toLowerCase()){t=true;break}}else if(l==="_labelAlignment"){if(H[a.selectedIndex].id!==m[i]){t=true;break}}else if(l==="_lengthUnits"){if(W[a.selectedIndex].translation.toLowerCase()!==m[i].toLowerCase()){t=true;break}}else if(l==="_outlierStyle"){if(V[a.selectedIndex].id!==m[i]){t=true;break}}else if(l==="_pinStyle"){if($[a.selectedIndex].id!==m[i]){t=true;break}}else if(l==="_tableLabelAlignment"){if(G[a.selectedIndex].id!==m[i]){t=true;break}}else if(l==="_defaultCompareStyle"){if(z[a.selectedIndex].id!==m[i]){t=true;break}}}else if(n==="div"){if(a.style.backgroundColor!==m[i]){t=true;break}}}if(t===false){I.close();repaintAllExtensions();b.onApplyChanges(true)}else{Mt["b"].Factories.DialogFactory.createConfirmationDialog(Mt["b"].Utils.Translations.getTranslation("CONFIRM_CLOSE"),Mt["b"].Utils.Translations.getTranslation("CONFIRM_LOSING_UNSAVED_CHANGES"),function(e){Mt["b"].$(e.data.target).remove();b.close(true)},true)}};b.changeDefaultValues=function(){var e=confirm(Ot["a"].getTranslation("CONFIRM_GENERAL"));if(e){b.changeSelection(true,true)}};b.prev=function(){var e=k.getParameters();m=Mt["b"].$.extend({},e);for(var t in e){var i=document.getElementById("nm_i_"+t);if(!e.hasOwnProperty(t)||!i){if(t.indexOf("_")!==0){console.warn("element "+t+" not found")}continue}var a=i.tagName.toLowerCase();if(a==="input"){var n=i.type.toLowerCase();if(n==="text"){var r=i.value;r=r.replace(/,/g,".");if(i.getAttribute("mmppt")===N){r=(parseFloat(r)/10).toString()}else if(i.getAttribute("mmppt")===P){r=(parseFloat(r)/100).toString()}e[t]=r}else if(n==="checkbox"){e[t]=i.checked.toString()}}else if(a==="select"){var o=i.getAttribute("class");if(o==="_fontTypes"){e[t]=U[i.selectedIndex].translation}else if(o==="_labelAlignment"){e[t]=H[i.selectedIndex].id}else if(o==="_lengthUnits"){e[t]=W[i.selectedIndex].translation}else if(o==="_outlierStyle"){e[t]=V[i.selectedIndex].id}}else if(a==="div"){e[t]=i.style.backgroundColor}}};b.setDefaultValues=function(){var t;t=re["a"].repository("getDefaultParameters",undefined,{},false);for(var i in t){if(!t.hasOwnProperty(i)){continue}var e=i.replace(/\./g,"_");var a=document.getElementById("nm_i_"+e);if(a===null){continue}if(a.type==="text"){var n=t[i];n=n.replace(/,/g,".");switch(a.getAttribute("mmppt")){case N:n=n*10;n=n.toFixed(4);break;case P:n=n*100;n=n.toFixed(1);break}if(c==="de_DE"){n=n.replace(/\./g,",")}a.value=n}else if(a.tagName==="DIV"){a.style.backgroundColor=t[i]}else if(a.type==="checkbox"){if(t[i]==="true"||t[i]===true){Mt["b"].$(a).attr("checked",true)}else{Mt["b"].$(a).attr("checked",false)}}else if(a.type==="select-one"&&(a.className==="_fontTypes"||a.className==="_labelAlignment"||a.className==="_lengthUnits"||a.className==="_outlierStyle")){Mt["b"].$(a).children().each(function(e){if(Mt["b"].$(this).html().toLowerCase()===t[i].toLowerCase()){Mt["b"].$(a).val(e);Mt["b"].$(this).attr("selected","selected")}else{Mt["b"].$(this).removeAttr("selected")}})}}b.prev();repaintAllExtensions()};b.setCSS=function(){I.setCSS();var e=document.getElementById("actualTabVersion");I.manipulateCssForLeftTabs(e,"40px",false);e=document.getElementById("budgetTabVersion");I.manipulateCssForLeftTabs(e,"40px",false);e=document.getElementById("forecastTabVersion");I.manipulateCssForLeftTabs(e,"40px",false);for(var t in y){if(!y.hasOwnProperty(t)){continue}e=document.getElementById("actualDivACT"+y[t].version);I.manipulateCssResetTabs(e)}for(var t in C){if(!C.hasOwnProperty(t)){continue}e=document.getElementById("budgetDivBUD"+C[t].version);I.manipulateCssResetTabs(e)}for(var t in S){if(!S.hasOwnProperty(t)){continue}e=document.getElementById("forecastDivFC"+S[t].version);I.manipulateCssResetTabs(e)}};function buildButtonBar(){var e=Mt["b"].Utils.Translations.getTranslation,t=[],i=r?e("HELP_NM_SAVE_AND_CLOSE"):e("HELP_NM_SAVE_CENTRAL_AND_CLOSE"),a=r?e("HELP_NM_SAVE"):e("HELP_NM_SAVE_LOCAL");t.push({text:e("SAVE_CLOSE"),id:"saveButton",click:b.save,title:i});t.push({text:e("CLOSE"),id:"closeButton",title:e("HELP_DIALOG_CLOSE"),click:b.close});t.push({text:e(r?"SAVE":"SAVE_LOCAL"),id:"applyButton",title:a,click:b.apply});t.push({text:e("RESET"),id:"resetButton",title:e("HELP_NM_RESET"),click:b.setDefaultValues});if(Mt["b"].Utils.GlobalVariables.hasService){t.push({text:e("SET_AS_DEFAULT"),id:"defaultButton",title:e("HELP_NM_SET_AS_DEFAULT"),click:b.changeDefaultValues})}if(!k.notationManualEqualsLocalVersion()&&k.notationManualDiffers()){t.push({text:e("LOAD_LOCAL"),id:"loadLocalButton",title:e("HELP_NM_LOAD_LOCAL"),click:b.openLocalVersion})}else if(!k.notationManualEqualsCentralVersion()){t.push({text:e("LOAD_CENTRAL"),id:"loadCentralButton",title:e("HELP_NM_LOAD_CENTRAL"),click:b.openCentralVersion})}return t}function getValueText(e,t){var i=null;var a;if(t==="shape"){a=v.shape}else if(t==="other"){a=v.otherPattern}else if(t==="line"){a=v.line}for(var n in a){if(a.hasOwnProperty(n)&&a[n]===e){i=Ot["a"].getTranslation(n);break}}if(i===null||i===undefined){if(t==="shape"){e=getTranslatedShapeType(e)}else if(t==="other"){e=getTranslatedOtherType(e)}else if(t==="line"){e=getTranlastedLineType(e)}for(n in a){if(a.hasOwnProperty(n)&&a[n]===e){i=Ot["a"].getTranslation(n);break}}}return i}function getTranlastedLineType(e){switch(e){case"durchgehend":return"solid";case"gepunktet":return"dotted";case"gestrichelt":return"dashed";default:return e}}function getTranslatedOtherType(e){switch(e){case"raute":return"diamond";case"kreis":return"circle";case"schachbrett":return"chess";case"gefüllt":return"filled";case"leer":return"empty";default:return e}}function getTranslatedShapeType(e){switch(e){case"quadrat":return"square";case"dreieck":return"triangle";case"raute":return"diamond";case"kreis":return"circle";default:return e}}function checkImage(e){var t="";var i=Mt["b"].$(e.parentNode).find("._fontWeightTypes");for(var a=0;a<i.length;a++){var n=i[a];if(Mt["b"].$(n).hasClass("active")){var r=n.getAttribute("subType");t=t===""?r:t+" "+r}}if(t===""){t="normal"}else if(t==="italic"){t="normal "+t}return t}function changeIcon(e){Mt["b"].$(e.target).toggleClass("active opClass")}function repaintAllExtensions(){Mt["b"].Utils.Calculator.IFrameCalculation.cleanCache();Mt["b"].Layout.CommentReference.ReferenceRepresentation.init();le.init();Mt["b"].DataObjects.DocumentDO.triggerDelayedRepaint()}};Mt["b"].Layout=Mt["b"].Layout||{};Mt["b"].Layout.Button=Mt["b"].Layout.Button||{};Mt["b"].Layout.Button.ButtonPlusLayout=function(){var x={width:0,height:0};var E,y,C,S;var M,O,A,_;this.layoutPanels=function(e,t,i,a){var n={};if(e.length===0){return n}x={width:0,height:0};var r=e[0].getController().getRootModel();var o=a.getModel();if(r.buildUp===Mt["b"].Utils.Constants.BuildUp.DRAW){E=o.border.left.width+o.padding.left;y=o.border.right.width+o.padding.right;C=o.border.top.width+o.padding.top;S=o.border.bottom.width+o.padding.bottom;M=0;A=i.width-M-E-y;O=0;_=i.height-O-C-S;var l=A,s=_;for(var d=0;d<e.length;d++){var c=e[d],u=c.getModel();delete c.getModel().nestedContainerId;if(u.instanceOf==="ButtonModel"){var p=c.getDefinedSize(),g=p.width,h=p.height;x=c.getPreferredSize();if(x.width){l=x.width}else if(g&&g.indexOf("%")!==-1){l=Math.round(parseFloat(g)*A)/100}if(x.height){s=x.height}else if(h&&h.indexOf("%")!==-1){s=Math.round(parseFloat(h)*_)/100}c.setDimension({width:l,height:s});c.scrollingInfo={horizontal:l>A,vertical:s>_}}else{c.setDimension({width:Math.max(l,A),height:Math.max(s,_)})}c.setPosition({x:0,y:0});n[c.getId()]=c}var f=s,m=l,v=s>_,b=l>A;if(E+y+C+S>0||v||b){var T=Mt["b"].Utils.Constants.Parameters.idContainerContent+"."+o.id;o.scrollingData={realHeight:i.height,realWidth:i.width,height:i.height,width:i.width,scrollingVer:false,scrollingHor:false,x:t.x,y:t.y,children:{},id:o.id};o.scrollingData.children[T]={realHeight:f,realWidth:m,height:_,width:A,scrollingVer:!o.disableScrolling&&v,scrollingHor:!o.disableScrolling&&b,x:E,y:C,id:T};for(var d=0;d<e.length;d++){e[d].getModel().nestedContainerId=T}}else{o.scrollingData={realHeight:f,realWidth:m,width:i.width,height:i.height,scrollingVer:false,scrollingHor:false,x:t.x,y:t.y,id:o.id}}}return n};this.getPreferredLayoutSize=function(e,t,i){if(e.length){return e[0].getPreferredSize()}return x}};Mt["b"].Layout=Mt["b"].Layout||{};Mt["b"].Layout.Comment=Mt["b"].Layout.Comment||{};Mt["b"].Layout.Comment.CommentGridLayout=function(e,t,i,a){var n="grid";var M=null;var r=typeof e==="number"?e:1;var o=typeof t==="number"?t:1;var C={width:0,height:0};var l=Mt["b"].Utils.Calculator.Converter;var s=Mt["b"].DataObjects.RuntimeDO;var d=s.getParameterParsed("FONT_SIZE_CHART");var X=Mt["b"].Utils.Calculator.Converter.pt2pix(d);var O,A,_,L;var I,D,R,P;var Y;function mm2pix(e){return l.mm2pix(d*s.getParameterParsed(e))}this.getRows=function(){return r};this.setRows=function(e){r=e};this.getColumns=function(){return o};this.setColumns=function(e){o=e};this.setGridData=function(e){M=e};this.getType=function(){return n};this.layoutPanels=function(e,t,i,a){var n={};if(e.length===0){a.getModel().scrollingData={};return n}var r=e[0].getController().getRootModel();var o=a.getModel();var l=o.extendedModel;if(l.gridColumns.length>i.width){return n}if(r.buildUp===Mt["b"].Utils.Constants.BuildUp.PREINIT){var s=getAdditionalHeight(l);O=o.border.left.width+o.padding.left;A=o.border.right.width+o.padding.right;_=o.border.top.width+(o.padding.top||s.top);L=o.border.bottom.width+(o.padding.bottom||s.bottom);I=0;R=i.width-I-O-A;D=0;P=i.height-D-_-L;var d=l.gridRows.length*l.gridColumns.length;var c=e[e.length-1];c.setPosition({x:0,y:0});c.setDimension({width:i.width,height:i.height});if(l.gridColumns[l.gridColumns.length-1]!==R){recalculateCellSizes(l.gridColumns,l.gridColumnsFixed,R)}if(l.gridRows[l.gridRows.length-1]!==P){recalculateCellSizes(l.gridRows,l.gridRowsFixed,P)}Y=l.textType===Mt["b"].Utils.Constants.TypeValues.commentTextTypes.COMMENT?mm2pix("MMPT_COMMENT_LABEL_DISTANCE"):0;calculateCommentTextHeights(e,l,P,o);var u=I;var p=D;var g=M.gridColumns.length;var h=1;var f=1;for(var m=0;m<e.length;m++){var v=e[m];delete v.getModel().nestedContainerId;if(m>=d){break}var b=M.gridColumns[f-1]-(f===1?0:M.gridColumns[f-2]);var T=M.gridRows[h-1]-(h===1?0:M.gridRows[h-2]);v.setPosition({x:u-I,y:p-D});v.setDimension({width:b,height:T});if(f<g){f++;u+=b}else{f=1;h++;u=I;p+=T}}var x=Math.max(P,l.gridRows[l.gridRows.length-1]);var E=Math.max(R,l.gridColumns[l.gridColumns.length-1]);var y=1;if(O+A+_+L>0){var C=Mt["b"].Utils.Constants.Parameters.idContainerContent+"."+o.id;o.scrollingData={realHeight:i.height,realWidth:i.width,height:i.height,width:i.width,scrollingVer:false,scrollingHor:false,x:t.x,y:t.y,children:{},id:o.id};o.scrollingData.children[C]={realHeight:x,realWidth:E,height:P,width:R,scrollingVer:!o.disableScrolling&&x-P>y,scrollingHor:!o.disableScrolling&&E-R>y,x:O,y:_,id:C};for(var m=0;m<e.length;m++){if(m>=d){break}e[m].getModel().nestedContainerId=C}}else{o.scrollingData={realHeight:x,realWidth:E,width:i.width,height:i.height,scrollingVer:!o.disableScrolling&&x-i.height>y,scrollingHor:!o.disableScrolling&&E-i.width>y,x:t.x,y:t.y,id:o.id};if(e.length>0){var S=e[e.length-1].getModel();o.scrollingData.scrollingVer&&(S.dimension.height=x);o.scrollingData.scrollingHor&&(S.dimension.width=E)}}}for(var m=0;m<e.length;m++){n[e[m].getId()]=e[m]}return n};this.getPreferredLayoutSize=function(e,t,i){var a=i.getController().getRootModel();if(a.buildUp===Mt["b"].Utils.Constants.BuildUp.PREINIT&&!Mt["b"].DataObjects.RuntimeDO.isPrePaint()||Mt["b"].DataObjects.RuntimeDO.isPrePaint()&&a.buildUp===Mt["b"].Utils.Constants.BuildUp.POST_DRAW){var n=i.getModel(),r=n.extendedModel;if(r.textType===Mt["b"].Utils.Constants.TypeValues.commentTextTypes.COMMENT){var o=0;for(var l=e.length;l--;){var s=e[l],d=s.getModel();if(d.column===0){if(d.extendedModel&&d.extendedModel.instanceOf==="CommentModel"){var c=s.getLayout().getPreferredLayoutSize(s.getChildPanels(),s.getDimension(),s);o+=c.height}}}C={width:0,height:o}}else if(r.textType===Mt["b"].Utils.Constants.TypeValues.commentTextTypes.TITLE||r.textType===Mt["b"].Utils.Constants.TypeValues.commentTextTypes.SUBTITLE){var s=e[0];if(s&&(s=s.getModel())&&s.extendedModel&&s.extendedModel.instanceOf==="CommentModel"){for(var u=0;u<s.children.length;u++){var p=s.children[u];if(p.instanceOf==="LabelModel"&&p.id.indexOf("commentText")!==-1){var g=n.border,h=n.padding,f=s.border,m=s.padding,v=g.left.width+g.right.width+h.left+h.right+f.left.width+f.right.width+m.left+m.right,b=getAdditionalHeight(r),T=p.text===""?"|":p.text,x=e[0].getPainter(),E=x.getMeasuredTextDiv(t.width-v,T,p.fontSize,p.font,p.fontWeight);C.height=E+(h.top?0:b.top)+(h.bottom?0:b.bottom);var y=g.bottom.width;C.height+=y&&y!==b.bottomBorder?0:b.bottomBorder;break}}}}}return C};this.getCommentSize=function(e){var t=e.getModel(),i=t.extendedModel.gridRows.length*t.extendedModel.gridColumns.length;var a=0;for(var n=0;n<t.children.length;n++){if(n<i&&t.children[n].column===0){a+=t.children[n].dimension.height}}return a};function getAdditionalHeight(e){var t=0,i=0,a=0;if(e.textType===Mt["b"].Utils.Constants.TypeValues.commentTextTypes.TITLE){t=mm2pix("MMPT_TITLE_TOP_DISTANCE");i=mm2pix("MMPT_TITLE_BOTTOM_DISTANCE");a=mm2pix("MMPT_TITLE_BOTTOM_BORDER_SIZE")}else if(e.textType===Mt["b"].Utils.Constants.TypeValues.commentTextTypes.SUBTITLE){t=mm2pix("MMPT_SUBTITLE_TOP_DISTANCE");i=mm2pix("MMPT_SUBTITLE_BOTTOM_DISTANCE");a=mm2pix("MMPT_SUBTITLE_BOTTOM_BORDER_SIZE")}return{top:t,bottom:i,bottomBorder:a}}function recalculateCellSizes(e,t,i){var a=0;var n=0;if(!t[0]){a=e[0]}else{i-=e[0]}for(var r=1;r<e.length;r++){if(!t[r]){a+=e[r]-e[r-1];n++}else{i-=e[r]-e[r-1]}}if(n===0&&t[0]){return}var o=e[0];var l;var s=Math.max(i,0);if(!t[0]){if(n===0){e[0]=s}else{e[0]=a>0?e[0]/a*i:0}s-=e[0]}for(var r=1;r<e.length;r++){s=Math.max(s,0);l=e[r];if(t[r]){e[r]=e[r]-o+e[r-1]}else if(n===1){e[r]=s+e[r-1]}else{e[r]=a>0?(e[r]-o)/a*i:0;s-=e[r];e[r]+=e[r-1];n--}o=l}}function calculateCommentTextHeights(e,t,i,a){var n=[];var r=[];var o=[];var l=0;var s=0;var d={};var c=t.gridRows.length*t.gridColumns.length;for(var u=0;u<e.length;u++){var p=e[u];var g=p.getModel();if(t&&t.instanceOf==="ContainerCommentGridModel"&&u>=c){break}if(p.getChildPanels().length===0){break}if(g.extendedModel&&g.extendedModel.instanceOf==="CommentModel"){for(var h=0;h<g.children.length;h++){var f=g.children[h];if(f.instanceOf==="LabelModel"&&f.id.indexOf("commentText")!==-1){if(r[l]===undefined){r[l]={}}r[l].model=f;r[l].row=g.row;r[l].column=g.column;o[l]=p.getChildPanels()[h];l++}else if(f.instanceOf==="LabelModel"&&f.id.indexOf("commentReference")!==-1){if(n[s]===undefined){n[s]={}}n[s].model=f;n[s].row=g.row;n[s].column=g.column;s++}}}}for(var u=0;u<n.length;u++){d[n[u].column]={width:0}}for(var u=0;u<n.length;u++){var m=n[u].model;if(m.isCommentReference){var v=Mt["b"].Layout.CommentReference.ReferenceRepresentation.svg.getReferenceSize(m.text);m.radius=v.radius;d[n[u].column].width=v.dimension+Y*2}}t.maxReferenceWidthPerCol=[];var b=[];for(var T in d){b[T]=d[T].width}t.maxReferenceWidthPerCol=b;handleCommentAutoSize(r,o,n,t,i,a)}function handleCommentAutoSize(e,t,i,a,n,r){var o=Mt["b"].DataObjects.DocumentDO.getPainter();var l={};for(var s=0;s<e.length;s++){if(e[s]){if(l[e[s].row]===undefined){l[e[s].row]={height:null,numOfLines:0,distance:0,borderPadding:0}}}}var d=0;for(var s=0;s<e.length;s++){var c=e[s];if(c){var u=t[s],p=u.getModel();var g=c.row;var h=c.column;var f=h===0?a.gridColumns[h]:a.gridColumns[h]-a.gridColumns[h-1];var m=a.maxReferenceWidthPerCol[h];f-=m+Y*2;d=o.getMeasuredTextDiv("50","|",p.fontSize,p.font,p.fontWeight);var v=o.getMeasuredTextDiv(f,u.getText(),p.fontSize,p.font,p.fontWeight);var b=parseInt(v/u.getModel().fontSize);var T=Y*2;if(l[g].numOfLines<b){l[g].numOfLines=b}if(l[g].height<v){l[g].height=v}if(i[s].model.isCommentReference){var x=Mt["b"].Layout.CommentReference.ReferenceRepresentation.svg.getReferenceSize(i[s].model.text).refLabelDistance;T+=x+1}if(l[g].distance<T){l[g].distance=T}var E=r.children[s],y=E.border,C=E.padding,S=y.top.width+y.bottom.width+C.top+C.bottom;l[g].borderPadding=Math.max(l[g].borderPadding,S)}}var M=[];var O=0;var A=undefined;var _=0;var L=0;var I=0;var D=0;var R=[];for(var P in l){var N=l[P];R[P]=N;if(N.numOfLines>0){L+=N.height+N.borderPadding;I++}else{D+=N.borderPadding}if(!isNaN(N.height)){_+=N.height+N.borderPadding}}var w=0;if(_<=n){for(var F=0;F<R.length;F++){if(R[F].numOfLines>0&&L>0){L+=R[F].distance}if(R[F].numOfLines===0){w+=d+R[F].distance+l[F].borderPadding;if(A===undefined){A=F}else{O++}M[F]=R[F]}}var B=n-L-D;if(B<w){for(var F=0;F<R.length;F++){if(R[F].numOfLines===0){R[F].height=d}}}else{var k=a.gridRows.length-I;var U=Math.round(B/k);for(var F=0;F<M.length;F++){if(M[F]){R[F].height=U-R[F].distance}}var H=B;if(A!==undefined){var G=R[A].height+R[A].distance-l[A].borderPadding;var V=G/B;R[A].height=Math.round(V*B)-R[A].distance;H-=R[A].height+R[A].distance+l[A].borderPadding;for(var F=0;F<M.length;F++){if(M[F]){if(R[F].numOfLines===0){if(A!==F){if(O===1){R[F].height=H-R[F].distance}else if(O>1){R[F].height=Math.round(V*B)-R[F].distance;H-=R[F].height+R[F].distance+l[F].borderPadding;O--}}}}}}}}else{for(var F=0;F<R.length;F++){if(R[F].numOfLines===0){R[F].height=d}}}var $=a.gridColumns.length;for(var F=0;F<R.length;F++){if(R[F].height>=X){a.gridRows[F]=0;for(var z=0;z<a.gridColumns.length;z++){var W=F*$+z,j=r.children[W],y=j.border,C=j.padding,v=R[F].height+R[F].distance+y.top.width+C.top+y.bottom.width+C.bottom;if(F===0){a.gridRows[F]=Math.max(a.gridRows[F],v)}else{a.gridRows[F]=Math.max(a.gridRows[F],a.gridRows[F-1]+v)}}}}for(var F=0;F<R.length;F++){for(var s=0;s<e.length;s++){var c=e[s];if(c){var g=c.row;var K=c.model;if(F===g){if(R[F].height>=X){K.dimension.height=R[F].height}}}}}}};Mt["b"].Layout=Mt["b"].Layout||{};Mt["b"].Layout.Comment=Mt["b"].Layout.Comment||{};Mt["b"].Layout.Comment.CommentLayout=function(){var e=Mt["b"].DataObjects.RuntimeDO;var t=Mt["b"].Utils.Calculator.Converter;var U=t.mm2pix(e.getParameterParsed("FONT_SIZE_CHART")*e.getParameterParsed("MMPT_COMMENT_LABEL_DISTANCE"));var s=3;var H,G,V,$;var z=Mt["b"].Layout.CommentReference.ReferenceRepresentation.svg;this.layoutPanels=function(e,t,i,a){var n={};if(e.length===0){return n}var r=e[0].getController().getRootModel();var o=Mt["b"].DataObjects.DocumentDO.getExtension(r.extensionHash);var l=a.getModel();var s=l.extendedModel;var d=null;if(s.instanceOf==="CommentModel"){var c=Mt["b"].Factories.ModelFactory.getParentContainer(r.rootContainerModel,l);for(var u=0;u<c.length;u++){for(var p=0;p<c[u].children.length;p++){if(c[u].children[p].id===l.id){d=c[u];break}}}}if(d.extendedModel.textType===Mt["b"].Utils.Constants.TypeValues.commentTextTypes.TITLE||d.extendedModel.textType===Mt["b"].Utils.Constants.TypeValues.commentTextTypes.SUBTITLE){U=0}var g=Mt["b"].DataObjects.RuntimeDO.evaluateCommentCondition(d.extendedModel.showCondition);if(g===false){l.scrollingData={width:i.width,height:i.height,realWidth:i.width,realHeight:i.height,scrollingHor:false,scrollingVer:false,x:t.x,y:t.y};return n}if(r.buildUp===Mt["b"].Utils.Constants.BuildUp.PREINIT){var h=l.border,f=l.padding;G=t;H=i;$={x:0,y:0};V={width:H.width-h.left.width-h.right.width-f.left-f.right,height:H.height-h.top.width-h.bottom.width-f.top-f.bottom};var m={x:$.x+h.left.width+f.left,y:$.y+h.top.width+f.top};var v=bundeldViews(e);v.bundeldViews=resortViews(v);v.bundeldViews=removeHideLabels(v);var b=m.x;var T=m.y;var x=1;var E=d.extendedModel.maxReferenceWidthPerCol[l.column];var y=T+U;for(var C=0;C<v.bundeldViews.length;C++){var S=v.bundeldViews[C];for(var M=0;M<S.length;M++){var O=S[M],A=O.getModel();if(O.getId().indexOf("commentReference")!==-1){var _=z.getReferenceSize(A.text).refLabelDistance,L=A.fontWeight+" "+A.fontSize+"px"+(A.font!==""?" '"+A.font+"'":""),I=O.getPainter().measureTextDim(A.text,L),D=Math.max(I.width,I.height);y+=_+1;O.setPosition({x:b+U,y:y});O.setDimension({width:D,height:D})}else{O.setPosition({x:b+U+E,y:y});A.dimension.width=Math.max(0,V.width-E-U*2)}}if(x<d.extendedModel.gridColumns.length){x++;b+=V.width}else{x=1;b=m.x;T+=V.height}}if(o.getMode()!==Mt["b"].Utils.Enums.EMode.EDIT_COMMENT){for(var u=0;u<v.bundeldViews.length;u++){var S=v.bundeldViews[u];setDataForScrolling(S,l)}}}else if(r.buildUp===Mt["b"].Utils.Constants.BuildUp.DRAW){var R={};var P={};var N=d.extendedModel;var w=N.gridRows.length*N.gridColumns.length;for(var u=0;u<d.children.length;u++){if(N&&u>=w){break}var F=d.children[u];for(var p=0;p<F.children.length;p++){R[F.row]={isRef:false,position:null};P[F.column]={isRef:false,positionX:null,positionY:null,width:null}}}for(var u=0;u<d.children.length;u++){if(N&&u>=w){break}var F=d.children[u];for(var p=0;p<F.children.length;p++){var B=F.children[p];if(B.id.indexOf("commentReference")!==-1){if(R[F.row].isRef===false&&B.isCommentReference){R[F.row].isRef=B.isCommentReference;var k=Mt["b"].Factories.ModelFactory.getModelById(r,B.id.replace("Reference","Text"));R[F.row].positionY=k.position.y}if(P[F.column].isRef===false&&B.isCommentReference){P[F.column].isRef=B.isCommentReference;var k=Mt["b"].Factories.ModelFactory.getModelById(r,B.id.replace("Reference","Text"));P[F.column].positionX=k.position.x;P[F.column].width=k.dimension.width}}}}for(var u=0;u<d.children.length;u++){if(N&&u>=w){break}var F=d.children[u];for(var p=0;p<F.children.length;p++){var B=F.children[p];if(B.id.indexOf("commentText")!==-1){if(P[F.column].isRef===true){B.position.x=P[F.column].positionX;B.dimension.width=P[F.column].width}if(R[F.row].isRef===true){B.position.y=R[F.row].positionY}}}}}for(var u=0;u<e.length;u++){n[e[u].getId()]=e[u]}return n};this.getPreferredLayoutSize=function(e,t,i){return{height:t.height,width:t.width}};this.setDraggable=function(s,d){var a=null,c=s.getController(),u=c.getRootModel(),p=undefined,g=null,h=null;Mt["b"].$(d).draggable({disabled:true,containment:"parent",scroll:false,cancel:".ckeditor",revert:function(){if(!(g.extendedModel.isDragging&&p)){return true}},drag:function(i,e){Mt["b"].Utils.GlobalVariables.isDragDiv=true;Mt["b"].$(d).appendTo(this.parentNode);this.style.border="1px solid lightGray";this.style.cursor="pointer";a=this;h===null&&(h=Mt["b"].Factories.ModelFactory.getModelById(u,a.id.split("_")[0]));g===null&&(g=Mt["b"].Factories.ModelFactory.getParentContainer(u.firstObjectGrid,h)[0]);function helper(e){var t=document.elementFromPoint(i.clientX,i.clientY);if(!t){return}if(a!==t&&t.tagName==="DIV"&&t.classList.contains("ui-draggable")&&!t.classList.contains("ui.draggable-dragging")){if(p!==t){if(p){p.classList.remove("tc-commentHighlight")}t.classList.add("tc-commentHighlight");p=t}g.extendedModel.isDragging=true;return}if(e>20){if(p){p.classList.remove("tc-commentHighlight");p=undefined}return}t.style.visibility="hidden";helper(e+1);t.style.visibility=""}helper(0)},stop:function(e,t){if(g.extendedModel.isDragging&&p){Mt["b"].UI.HiCoConfirm(Mt["b"].DataObjects.RuntimeDO.getTranslation("ALERT_SAVE_COMMENT_ON_EDIT"),function(e){if(e===true){var t=Mt["b"].Factories.ModelFactory.getModelById(u,p.id.split("_")[0]);var i=Mt["b"].Models.Actions.ViewModelActions.ContainerModel.getChildIndexById(g,d.id.split("_")[0]);var a=Mt["b"].Models.Actions.ViewModelActions.ContainerModel.getChildIndexById(g,t.id.split("_")[0]);Mt["b"].Factories.ViewFactory.getViewById(c.getRootPanel(),g.id).flipChildren(i,a);if(u.id!==null){var n=Mt["b"].DataObjects.CommentRepo.getCommentById(g.extendedModel.commentId,s.getId());var r=n.currContent.grid[h.row][h.column];var o=n.currContent.grid[t.row][t.column];var l={extension:s,commentId:g.extendedModel.commentId,currCommentCell:r,currTargetCommentCell:o,dontConfirmText:true,updateCommentLastModified:true};c.dispatch("updateRootModelState",l)}else{c.dispatch("updateRootModel",{extension:s,dontConfirmText:true})}}p.classList.remove("tc-commentHighlight");p=null;g.extendedModel.isDragging=false;s.paint()})}Mt["b"].Utils.GlobalVariables.isDragDiv=false;d.style.border=null;d.style.cursor=""}})};function bundeldViews(e){var t=0,i=[],a="",n=-1;for(var r=0;r<e.length;r++){var o=e[r],l=o.getId().split(".")[3];if(t===0){n++;a=l;i[n]=[]}t++;if(a===l){i[n].push(o)}if(t===s){t=0}}return{bundeldViews:i}}function removeHideLabels(e){var t=[];for(var i=0;i<e.bundeldViews.length;i++){var a=e.bundeldViews[i];for(var n=a.length-1;n>=0;n--){if(a[n].getModel().hideLabel===true){t.push(a[n].getModel().id)}}}for(var i=0;i<e.bundeldViews.length;i++){var a=e.bundeldViews[i];for(var r=0;r<=t.length;r++){for(var n=a.length-1;n>=0;n--){if(a[n].getId().indexOf(t[r])!==-1){a.splice(n,1)}}}}return e.bundeldViews}function resortViews(e){for(var t=0;t<e.bundeldViews.length;t++){var i=e.bundeldViews[t],a=[];for(var n=0;n<i.length;n++){var r=i[n];if(r.getId().indexOf("commentReference")!==-1){a[0]=r}else if(r.getId().indexOf("commentText")!==-1){a[1]=r}}e.bundeldViews[t]=a}return e.bundeldViews}function setDataForScrolling(e,t){var i=e[e.length-1].getModel();var a=i.position.y+i.dimension.height+U+t.border.bottom.width+t.padding.bottom-$.y;t.scrollingData={width:H.width,height:H.height,realWidth:H.width,realHeight:a,scrollingHor:false,scrollingVer:!t.disableScrolling&&a>H.height,x:G.x,y:G.y}}};var S=i(618);Mt["b"].Layout=Mt["b"].Layout||{};Mt["b"].Layout.CommentReference={setDraggable:function(c,u,i){var p=Mt["b"].DataObjects.CommentRepo;var g=null;var s=null;var h=null;var f=null;var m=null;var v=null;var b=null;var e=c.id.split("_");var T=e[1];var x=e[3];var E=parseInt(e[4]);var y=i.reference[E];function getModelId(e){if(e.id.indexOf("compare")!==-1){var t;if(e.id.indexOf("pinCompare")!==-1){t=e.id.split(".");t.shift();return t.join(".")}else{t=e.id.split(".");if(t.length>2){t.pop();return t.join(".")}else{return e.id}}}else{return e.id.split("$")[0]}}function getChartId(e){if(e.id.indexOf("compare")!==-1){if(e.id.indexOf("pinCompare")!==-1){return e.id.split(".")[1]}else{return e.id.split(".")[0]}}else if(e.id.indexOf("valueRowLabelModel")!==-1){if(e.id.indexOf("structureLegendType")!==-1){return e.id.split(".")[0].replace("structureLegendType","")}else{var t=Mt["b"].Utils.Constants.ParameterSets.timeLegendTypeIds;var i=e.id.split(".")[0];for(var a=1;a<t.length;a++){if(i.indexOf(t[a])!==-1){i=i.replace(t[a],"");break}}return i}}else if(e.id.indexOf("dimensionchart")!==-1){return e.id.split(".")[0].replace("dimension","")}else{return e.id.split(".")[0]}}Mt["b"].$(c).draggable({distance:Mt["b"].Utils.Mobile.isTouchDevice?Mt["b"].Utils.Mobile.touchMoveDistance:1,drag:function(o){var l=null;y=i.reference[E];function helper(e){var t=document.elementFromPoint(o.clientX,o.clientY);if(t){var i=t.id,a,n=Object(z["m"])(t,["commentReference_","commentReference."],5);if(t.tagName==="svg"&&i.indexOf("_svg")!==-1&&!n){g=i.split("_")[1];s=Mt["b"].DataObjects.DocumentDO.getExtension(g)}if(!n){if(t.nodeName==="rect"){if(i.indexOf("representation")!==-1&&i.indexOf("representationLabel")===-1){a=i.replace("_bg","").replace("_fill","");l=Mt["b"].$(t.parentNode).find('rect[id="'+a+'"]')[0];m=l.id.split(".")[1]+"#rect"}else if(i.indexOf("compare")!==-1&&i.indexOf("pinCompare")===-1){l=t;m=l.id.split(".")[1]+"#text#"+l.id.split(".")[2]}else if(i.indexOf("pinCompare")!==-1){l=t;m=l.id.split(".")[2]+"#rect"}}else if(t.nodeName==="text"){var r=Mt["b"].$(t.parentNode).find('rect[id^="'+i+'"]')[0];l=r?r:t;if(i.indexOf("valueRowLabelModel")!==-1){m="valueRowLabelModel#text"}else if(i.indexOf("compare")!==-1){m=l.id.split(".")[1]+"#text#"+l.id.split(".")[2]}else if(i.indexOf("dimensionchart")!==-1){m=l.id.split(".")[0]+"#text"}else if(i.indexOf("representationLabel")!==-1){m=l.id.split(".")[1]+"#text";if(i.indexOf("stack_sum")!==-1){m+="#stack_sum";if(l.id.indexOf(".pos")!==-1){m+="#pos"}else if(l.id.indexOf(".neg")!==-1){m+="#neg"}}}else if(i.indexOf("merkmalsLabel")!==-1){m="merkmalsLabel#text"}else if(i.indexOf("annotationLabel")!==-1){m="annotationLabel#text"}}else if(t.nodeName==="polygon"){if(i.indexOf("compare")!==-1){l=t;m=l.id.split(".")[1]+"#polygon"}}else if(t.nodeName==="line"){if(i.indexOf("representation")!==-1&&i.indexOf("representationLabel")===-1){a=i.replace("_line","");l=Mt["b"].$(t.parentNode).find('[id="'+a+'"]')[0];m=l.id.split(".")[1]+"#line"}}else if(t.nodeName==="polyline"){if(i.indexOf("representation")!==-1&&i.indexOf("representationLabel")===-1){l=t;m=l.id.split(".")[1]+"#polyline"}}else if(t.nodeName==="path"){if(i.indexOf("representation")!==-1&&i.indexOf("representationLabel")===-1){l=t;m=l.id.split(".")[1]+"#path"}}else if(t.nodeName==="circle"){if(i.indexOf("representation")!==-1&&i.indexOf("representationLabel")===-1){l=t;m=l.id.split(".")[1]+"#circle"}}}if(e>10||l&&s){if(l===null){f=null}return}t.style.visibility="hidden";helper(e+1);t.style.visibility=""}}helper(0);if(v!==null&&l!==v){Mt["b"].Layout.CommentReference.removeHighlighting(v);v=null}if(l&&s){h=s.getController();var e=getModelId(l);b=getChartId(l);if(e){f=Mt["b"].Factories.ModelFactory.getModelById(h.getRootModel(),e);if(f){var t={extension:s,model:f,element:l};h.dispatch("updateHighlightCommentReferenceElement",t);v=l}}}},stop:function(){if(f){if(m.indexOf("valueRowLabelModel")!==-1){y.elementPath="#"+f.dataId_expr}else if(m.indexOf("compare")!==-1){y.elementPath=f.to.split("#")[0]+"#"+f.to.split("#")[1]+";"+f.from.split("#")[0]+"#"+f.from.split("#")[1]+";"}else if(m.indexOf("merkmalsLabel")!==-1){var e=Mt["b"].Factories.ModelFactory.getParentContainer(h.getRootModel().firstObjectGrid,f)[0];if(e){var t=f.id.split(".").pop();if(t&&e.extendedModel){var i=e.extendedModel.columnDefinitions[t];if(i){y.elementPath=f.dataId_dim+"#"+i.exprId}}}}else if(m.indexOf("dimension")===0){y.elementPath=f.dataId_dim+"#"+f.id.split(".").pop()}else{y.elementPath=f.dataId_dim+"#"+f.dataId_expr}y.elementType=m;y.chartId=b;y.extension=g}if(y.elementPath!==null){var a=Mt["b"].Layout.CommentReference.getReferencedModels(y);if(a){var n=parseInt(c.style.height),r=void 0;if(f){r=Mt["b"].Layout.CommentReference.getBindReferencePosition(a,y);Mt["b"].Layout.CommentReference.setReferenceOffsets(a,y,n,r.align)}else if(a.extension&&a.chartModel){var o=this.getBoundingClientRect(),l=Mt["b"].Utils.DOM.getPositionOnExtension(a.extension,{clientX:o.left+o.width/2,clientY:o.top+o.height/2}),s=a.extension.getController().getRootModel(),d=Mt["b"].Models.Actions.ViewModelActions.General.getAbsolutePositionWithScrolling(a.chartModel,s);r=Mt["b"].Layout.CommentReference.getBindReferencePosition(a,y);y.position.x=l.x-d.x-r.x;y.position.y=l.y-d.y-r.y;Mt["b"].Layout.CommentReference.convertCurrPositionToStructurePositivePosition(a,y,r.align)}}if(v!==null){Mt["b"].Layout.CommentReference.removeHighlighting(v);v=null}}else{p.convertToRelativeReferencePosition(y,{x:parseFloat(c.style.left),y:parseFloat(c.style.top)});b=null}Mt["b"].DataObjects.CommentRepo.removeCommentReferenceDiv(x,E,T,u);y.freshCreate=true;Mt["b"].DataObjects.CommentRepo.redrawLinkedReferences()}})},redrawReference:function(e,t,i,a,n){var r=Mt["b"].DataObjects.DocumentDO.getPainter();var o=e.getController().getRootModel();var l=t;var s=n.created_in_chart+".commentReference."+e.getId();var d=Mt["b"].Factories.ModelFactory.getModelById(o,s);if(!d){return}var c=n.reference[a];if(c.elementType){var u=c.elementType.split("#");if(u[0].indexOf("structureLegendType")!==-1||u[0].indexOf("valueRowLabelModel")!==-1){var p="valueRowLabelModel";u.splice(0,1);for(var g=0;g<u.length;g++){p+="#"+u[g]}c.elementType=p}}var h=Mt["b"].Layout.CommentReference.getReferencedModels(c);if(h){if(!h.referencedToModel||h.referencedToModel.hideLabel||h.extension.isHidden()||h.extension.getAdapter().isHidden()){return}}else if(c.elementPath){return}var f=Mt["b"].DataObjects.RuntimeDO.getParameter("FONT_FAMILY");var m=Mt["b"].DataObjects.RuntimeDO.getParameter("FONT_STYLE_CHART");var v=lt["a"].pt2pix(Mt["b"].DataObjects.RuntimeDO.getParameter("FONT_SIZE_CHART"));var b=new S["a"](f,m,v);b.id=d.id.replace("chart","object");b.font=d.font;b.fontSize=d.fontSize;b.text=c.id.toString();var T=Mt["b"].Layout.CommentReference.ReferenceRepresentation.svg.getReferenceSize(b.text);b.dimension.width=T.dimension;b.dimension.height=T.dimension;b.radius=c.position.radius=T.radius;if(h&&h.referencedToModel){l=Mt["b"].Layout.CommentReference.getBindReferencePosition(h,c)}d.isCommentReference=b.isCommentReference=true;var x=d.movedReferenceCounter;Mt["b"].DataObjects.CommentRepo.setMovedReferenceCounter(d,++x);var E=Mt["b"].Layout.CommentReference.getDivPosition(c);r.paintMoveableCommentReferences(b,E,i,a,h?h.referencedToModel:null,d,l,n);if(c.freshCreate){delete c.freshCreate;if(o.id!==null){e.getController().dispatch("updateRootModelState",{extension:e,commentId:i.id,currCommentCell:n,dontConfirmText:true,updateCommentLastModified:true})}}},getReferencedModels:function(e){var t=Mt["b"].DataObjects.DocumentDO.getExtension(e.extension);if(t){var i=Mt["b"].Factories.ModelFactory.getModelById(t.getController().getRootModel(),e.chartId);if(i&&i.extendedModel){var a=i.extendedModel.contextId;if(a){var n=Mt["b"].DataObjects.ContextRepo.getContextByCid(a);if(!n){return}var r=t.getController().getRootModel();var o=Mt["b"].Factories.ModelFactory.getParentContainer(r.firstObjectGrid,i);var l=o[0];var s=o[1];var d=e.elementPath.split("#"),c=d[0],u=d[1];var p=e.elementType.split("#")[0];for(var g=0;g<i.children.length;g++){var h=i.children[g];if(i.extendedModel.instanceOf==="TableModel"){if(h.id.indexOf(p)!==-1&&h.id.indexOf("merkmalsLabel")!==-1){for(var f=0;f<i.extendedModel.columnDefinitions.length;f++){if(i.extendedModel.columnDefinitions[f].exprId===u){return{referencedToModel:h,chartModel:i,extension:t,parentContainer:l,grandParentContainer:s}}}}else if(h.id.indexOf(p)!==-1&&h.id.indexOf("annotationLabel")!==-1){if(h.dataId_expr===u){return{referencedToModel:h,chartModel:i,extension:t,parentContainer:l,grandParentContainer:s}}}else if(h.id.indexOf(p)!==-1&&h.id.indexOf("dimensionchart")!==-1){if(h.dataId_dim===c&&(u==="null"||h.id.split(".").pop()===u)){return{referencedToModel:h,chartModel:i,extension:t,parentContainer:l,grandParentContainer:s}}}}else if(i.extendedModel.instanceOf==="ChartModel"||i.extendedModel.instanceOf==="TimeChartModel"){if(h.instanceOf==="ContainerModel"){for(var f=0;f<h.children.length;f++){if(h.children[f].id.indexOf(p)!==-1&&h.children[f].dataId_dim===c){if(i.extendedModel.dimensionLabelModel.displayType!=="categoryLabelType.0"){return{referencedToModel:h.children[f],chartModel:i,extension:t,parentContainer:l,grandParentContainer:s}}else{return null}}}}}var m=[];if(p==="representation"||p==="representationLabel"){m.push("representation");m.push("representationLabel")}else{if(e.elementType){m.push(p)}}for(var v=0;v<m.length;v++){var b,T;if(m[v].indexOf("valueRowLabel")!==-1){if(h.id.indexOf(m[v])!==-1){var x=h.dataId_expr;if(x===u){T=Mt["b"].Factories.ModelFactory.getModelById(t.getController().getRootModel(),h.id.replace("representation","representationLabel"));if(m[v].indexOf("valueRowLabel")!==-1){b=T.hideLabel}if(T&&b===false){return{referencedToModel:T,chartModel:i,extension:t,parentContainer:l,grandParentContainer:s}}}}}else if(m[v].indexOf("compare")!==-1){if(h.id.indexOf(m[v])!==-1){var E=h.from.split("#")[1];var y=h.from.split("#")[0];var C=h.to.split("#")[1];var S=h.to.split("#")[0];var M=e.elementPath.split(";");if(M.length===1){e.elementPath=h.to.split("#")[0]+"#"+h.to.split("#")[1]+";"+h.from.split("#")[0]+"#"+h.from.split("#")[1]+";"}var O=e.elementPath.split(";")[0];var A=e.elementPath.split(";")[1];if(S===O.split("#")[0]&&C===O.split("#")[1]&&y===A.split("#")[0]&&E===A.split("#")[1]){T=Mt["b"].Factories.ModelFactory.getModelById(t.getController().getRootModel(),h.id.replace("representation","representationLabel"));if(!h.active){b=true}else{b=false;if(e.elementType.split("#")[2]){if(e.elementType.split("#")[2]==="absolute"){if(T.absolute.legend==="none"){b=true}}else if(e.elementType.split("#")[2]==="percent"){if(T.percent.legend==="none"){b=true}}else if(e.elementType.split("#")[2]==="text"){if(T.text.legend==="none"){b=true}}}}if(T&&b===false){return{referencedToModel:T,chartModel:i,extension:t,parentContainer:l,grandParentContainer:s}}}}}else{if(h.id.indexOf(m[v])!==-1&&h.dataId_dim===c&&h.dataId_expr===u){if(e.elementType.indexOf("stack_sum")!==-1){if(h.stackModel===undefined){return null}var _=e.elementType.split("#");var L;if(_[3]==="pos"||_[3]==="neg"){if(h.stackModel.startOn+h.value<0){L=h.id.split(".")[0]+".representationLabel.stack_sum."+h.id.split(".")[2]+".neg"}else{L=h.id.split(".")[0]+".representationLabel.stack_sum."+h.id.split(".")[2]+".pos"}}else{L=h.id.replace("representation","representationLabel.stack_sum")}T=Mt["b"].Factories.ModelFactory.getModelById(t.getController().getRootModel(),L)}else{var I;if(h.id.indexOf("representationLabel")!==-1){I=Mt["b"].Factories.ModelFactory.getModelById(t.getController().getRootModel(),h.id.replace("representationLabel","representation"));T=h}else{I=h;T=Mt["b"].Factories.ModelFactory.getModelById(t.getController().getRootModel(),h.id.replace("representation","representationLabel"))}}if(T&&T.hideLabel===false){return{referencedToModel:T,chartModel:i,extension:t,parentContainer:l,grandParentContainer:s}}else if(T&&T.hideLabel&&T.isStackSum){return null}else if(h.instanceOf!=="ValueModel"&&h.valueType!=="FACTOR_NONE"&&!h.isNaN){var D=h.dimension.width>=1?h.dimension.width-1:0;var R=h.dimension.height>=1?h.dimension.height-1:0;if(h.instanceOf==="TimeColumnModel"&&(Math.abs(h.dimension.height)<.5||R===0)||h.instanceOf==="TimeWaterfallModel"&&(D<=.5&&D>=-.5||R===0)||(h.instanceOf==="BarModel"||h.instanceOf==="StructureWaterfallModel")&&(Math.abs(h.dimension.width)<=.5||D===0)){return null}return{referencedToModel:I,chartModel:i,extension:t,parentContainer:l,referencedLabelModel:T,grandParentContainer:s}}}}}}}}}return null},getDivPosition:function(e){if(e){if(e.elementPath===null){return{x:0,y:0}}else{var t=Mt["b"].DataObjects.DocumentDO.getExtension(e.extension);var i=t.getAdapter().getContainerElementCoordinates();return{x:i.x,y:i.y}}}},removeHighlighting:function(){Mt["b"].$(document.getElementById("HiCoHighlightedElementBorder")).remove()},getBindReferencePosition:function(e,t){if(t){var i=t.extension;if(i){var a=Mt["b"].DataObjects.DocumentDO.getExtension(i);if(a&&e.chartModel&&e.chartModel.extendedModel){if(e.chartModel.extendedModel.instanceOf==="TimeChartModel"){return this.getTimePositions(e,a,t)}else{return this.getStructureAndTablePositions(e,a,t)}}}}},setReferenceOffsets:function(e,t,i,a){var n=Mt["b"].Utils.Constants.TypeValues;if(e.chartModel){var r=e.chartModel.extendedModel;if(r){var o=Mt["b"].Utils.Constants.Parameters.distanceBetweenRefCircleAndModel;var l=e.referencedToModel.instanceOf==="CompareModel"&&(e.referencedToModel.absolute.legend!==n.indicator.NONE||e.referencedToModel.percent.legend!==n.indicator.NONE||e.referencedToModel.text.legend!==n.indicator.NONE)&&(t.elementType.split("#")[1]&&t.elementType.split("#")[1]==="text");if(r.instanceOf==="TimeChartModel"){if(a.x==="right"){if(e.referencedToModel.instanceOf==="CompareModel"){if(l){t.position.y=0;t.position.x=i/2+o}else{t.position.x=0;t.position.y=i/2+o}}else{t.position.y=0;t.position.x=0-i/2-o}}if(a.x==="left"){if(e.referencedToModel.instanceOf==="CompareModel"){if(l){t.position.y=0;t.position.x=0-i/2-o}else{t.position.x=0;t.position.y=0-i/2-o}}else{t.position.y=0;t.position.x=0-i/2-o}}if(a.y==="top"){t.position.x=0;t.position.y=i/2+o}if(a.y==="bottom"){t.position.x=0;t.position.y=i/2+o}}else{if(a.x==="right"){if(e.referencedToModel.instanceOf==="CompareModel"){if(l){t.position.y=0;t.position.x=i/2+o}}else{t.position.y=0;t.position.x=i/2+o}}if(a.x==="left"){t.position.y=0;t.position.x=i/2+o}if(a.y==="top"){if(e.referencedToModel.instanceOf==="CompareModel"){t.position.x=0;t.position.y=0-i/2-o}else{t.position.x=0;t.position.y=0-i/2-o}}if(a.y==="bottom"){if(e.referencedToModel.instanceOf==="CompareModel"){t.position.x=0;t.position.y=i/2+o}else{t.position.x=0;t.position.y=0-i/2-o}}}if(r.instanceOf==="TimeChartModel"){if(!(e.referencedToModel.instanceOf==="CompareModel"&&l)){var s=t.position.x;t.position.x=t.position.y;t.position.y=s}}}}},convertCurrPositionToStructurePositivePosition:function(e,t,i){if(!e.chartModel&&!e.chartModel.extendedModel){return}var a=e.chartModel.extendedModel,n=t.position.x,r=t.position.y;if(e.referencedToModel.instanceOf!=="CompareModel"){if(a.instanceOf==="TimeChartModel"){var o=t.position.x;n=t.position.y;r=o;if(i.x==="right"){r*=-1}if(i.y==="top"){n*=-1}}else{if(i.x==="left"){n*=-1}if(i.y==="bottom"){r*=-1}}}t.position.y=r;t.position.x=n},getMaxLineChartPosition:function(e,t){var i=e.getModel();if(i){var a;if(i.instanceOf==="TimeLineModel"){a=Mt["b"].DataObjects.DocumentDO.getPainter().getLineChartCords(e,t)}else{a=Mt["b"].DataObjects.DocumentDO.getPainter().getLineChartCordsTable(e)}if(a.length>0){var n=Math.min(a[0].x,a[1].x);var r=Math.min(a[0].y,a[1].y);var o=Math.max(a[0].x,a[1].x);var l=Math.max(a[0].y,a[1].y);if(a[2]){n=Math.min(n,a[2].x);r=Math.min(r,a[2].y);o=Math.max(o,a[2].x);l=Math.max(l,a[2].y)}if(i.instanceOf==="TimeLineModel"){if(t!=="timeRepresentationType.4"){n=Math.min(n,i.position.x);r=Math.min(r,i.position.y);o=Math.max(o,i.position.x+i.dimension.width);l=Math.max(l,i.position.y+i.dimension.height)}}else{if(i.needlepos){if(i.value>0){n=Math.min(n,i.needlepos.x);o=Math.max(o,i.needlepos.x+i.needledim.width);r=Math.min(r,i.position.y);l=Math.max(l,i.position.y+i.dimension.height)}else{n=Math.min(n,i.needlepos.x);o=Math.max(o,i.needlepos.x+i.needledim.width);r=Math.min(r,i.needlepos.y);l=Math.max(l,i.needlepos.y+i.needledim.height)}}}var s=o-n;var d=l-r;return{position:{x:n,y:r},dimension:{width:s,height:d}}}}return null},getStructureAndTablePositions:function(e,t,i){var a=e.referencedToModel;var n=e.chartModel;var r,o;var l=null;if(a.instanceOf==="LabelModel"&&a.id.indexOf("representationLabel")!==-1){l=Mt["b"].Factories.ModelFactory.getModelById(t.getController().getRootModel(),a.id.replace("Label",""))}var s;if(a.isStackSum){s=Mt["b"].Factories.ModelFactory.getStackSum(a,n)}else{s=l?l.value:a.value}var d={x:null,y:null};var c=null;var u=Mt["b"].Utils.Constants.TypeValues;var p=null;var g=t.getCanvasDO().getDOMElement();if(a.instanceOf==="BarModel"){p=Mt["b"].$(g).find('text[id^="'+a.id.replace(".representation.",".representationLabel.")+'$0"]')[0]}else if(a.instanceOf==="LabelModel"){var h=Mt["b"].$(g).find('text[id^="'+a.id+'"]');for(var f in h){if(h[f]&&h[f].id){if(h[f].id.split("$")[0]===a.id){p=h[f]}}}}else if(a.instanceOf==="CompareModel"&&i.elementType.split("#")[1]==="text"){p=Mt["b"].$(g).find('text[id^="'+a.id+'"]');for(var m=0;m<p.length;m++){if(p[m].id.indexOf(i.elementType.split("#")[2])!==-1){p=p[m];break}}}var v=p&&p.textContent==="";v&&(p.innerHTML="&nbsp;");var b=p&&p.getBBox?p.getBBox():null;v&&(p.textContent="");var T=b?b.width:a.dimension.width;var x=b?b.height:a.dimension.height;var E=b?Math.max(b.x,0):null;var y=b?Math.max(b.y,0):null;v&&(y+=4);if(y!==null&&n.extendedModel.instanceOf==="TableModel"&&a.nestedContainerId&&a.nestedContainerId.indexOf(Mt["b"].Utils.Constants.Parameters.idTableContent)>=0){y+=n.scrollingData.headerHeight}var C=u.structureRepresentation;var S=null;if(a.instanceOf==="StructureLineModel"){var M=Mt["b"].DataObjects.ContextRepo.getContextByCid(a.contextId);if(M){var O=Mt["b"].Models.Actions.ModelActions.ContextModel.getContextExpressions(M);for(var m=0;m<O.length;m++){if(O[m].id.split(".").pop()===a.dataId_expr){S=O[m].representation}}if(S===C.LINE||S===C.SYMBOL_LINE){var A=Mt["b"].Factories.ViewFactory.getViewById(t.getController().getRootPanel(),a.view);if(A){c=Mt["b"].Layout.CommentReference.getMaxLineChartPosition(A,S)}}}}if(a.instanceOf==="LabelModel"){if(a.id.indexOf("dimensionchart")!==-1){d={x:"left",y:"center"};if(E){r=E}else{r=a.position.x;if(a.textAnchor==="middle"){r-=T/2}else if(a.textAnchor==="end"){r-=T}}o=y?y:a.position.y;o+=x/2}else if(a.id.indexOf("structureLegendType")!==-1){var _=u.structureLegend;if(E){r=E+T/2}else{r=a.position.x;if(a.textAnchor==="start"){r+=T/2}else if(a.textAnchor==="end"){r-=T/2}}var L=getStructureLegends(a.valueRowLabelPosition);if(L===_.TOP_VALUE||L===_.TOP_MIDDLE||L===_.TOP_AXIS){o=y?y:a.position.y;d={x:"center",y:"top"}}else{o=y?y:a.position.y;o+=x;d={x:"center",y:"bottom"}}}else{o=y?y:a.position.y;o+=x/2;if(s<0){d={x:"left",y:"center"};if(E){r=E}else{if(a.textAnchor==="middle"){r=a.position.x-T/2}else if(a.textAnchor==="end"){r=a.position.x-T}else{r=a.position.x}}}else{d={x:"right",y:"center"};if(E){r=E+T}else{if(a.textAnchor==="middle"){r=a.position.x+T/2}else if(a.textAnchor==="end"){r=a.position.x}else{r=a.position.x+T}}}}}else if(a.id.indexOf("compare")!==-1){var I=Mt["b"].DataObjects.DocumentDO.getPainter();if(i.elementType.split("#")[1]!=="text"){d={x:"center",y:"top"};var D=Mt["b"].Layout.Common.getMaxPosition(a);T=D.dimension.width;x=D.dimension.height;r=I.cordCorrectionSVG(D.position.x+1+T/2);o=I.cordCorrectionSVG(D.position.y);if(a.compareLegend==="end"||a.compareLegend==="from"||a.compareLegend==="to"){o+=x;d={x:"center",y:"bottom"}}}else{d={x:"right",y:"center"};var R={x:null,y:null};if(E){R.x=E}if(y){R.y=y}r=E||I.cordCorrectionSVG(R.x);r+=T;o=y||I.cordCorrectionSVG(R.y);o+=x/2}}else{if(s<0){d={x:"left",y:"center"};if(a.instanceOf==="StructureLineModel"){if(c){T=c.dimension.width;x=c.dimension.height;r=c.position.x+c.dimension.width;o=c.position.y+c.dimension.height/2}else{r=a.needlepos.x;o=a.needlepos.y+a.needledim.height/2;T=a.needledim.width;x=a.needledim.height}}else if(a.instanceOf==="NeedleModel"){r=a.needlepos.x;o=a.needlepos.y+a.needledim.height/2;T=a.dimension.width+a.needleSize/2;x=a.dimension.width+a.needleSize/2}else{r=E?E:a.position.x;o=y?y:a.position.y;o+=x/2}}else{d={x:"right",y:"center"};if(a.instanceOf==="StructureLineModel"){if(c){r=c.position.x+c.dimension.width;o=c.position.y+c.dimension.height/2;T=c.dimension.width;x=c.dimension.height}else{T=a.needledim.width;x=a.needledim.height;r=a.needlepos.x+a.needledim.width;o=a.needlepos.y+Math.round(a.needledim.height/2)}}else if(a.instanceOf==="NeedleModel"){r=a.needlepos.x+a.needledim.width;o=a.needlepos.y+Math.round(a.needledim.height/2);T=a.dimension.width+a.needleSize/2;x=a.dimension.width+a.needleSize/2}else{r=E?E:a.position.x;r+=T;o=y?y:a.position.y;o+=x/2}}}return{x:r,y:o,align:d,width:T,height:x};function getStructureLegends(e){if(e){var t=e.split(".");if(t.length>2){t.pop();return t.join(".")}else{return e}}return""}},getTimePositions:function(e,t,i){var a=e.referencedToModel;var n=Mt["b"].Utils.Constants.TypeValues;var r={x:null,y:null};var o,l;var s=null;if(a.instanceOf==="LabelModel"&&a.id.indexOf("representationLabel")!==-1){s=Mt["b"].Factories.ModelFactory.getModelById(t.getController().getRootModel(),a.id.replace("Label",""))}var d;if(a.isStackSum){d=Mt["b"].Factories.ModelFactory.getStackSum(a,e.chartModel)}else{d=s?s.value:a.value}var c=null;var u=null;var p=t.getCanvasDO().getDOMElement();if(a.instanceOf==="TimeColumnModel"){u=Mt["b"].$(p).find('text[id^="'+a.id.replace(".representation.",".representationLabel.")+'$0"]')[0]}else if(a.instanceOf==="LabelModel"){var g=Mt["b"].$(p).find('text[id^="'+a.id+'"]');for(var h in g){if(g[h]&&g[h].id){if(g[h].id.split("$")[0]===a.id){u=g[h]}}}}else if(a.instanceOf==="CompareModel"&&i.elementType.split("#")[1]==="text"){u=Mt["b"].$(p).find('text[id^="'+a.id+'"]');for(var f=0;f<u.length;f++){if(u[f].id.indexOf(i.elementType.split("#")[2])!==-1){u=u[f];break}}}var m=u&&u.textContent==="";m&&(u.innerHTML="&nbsp;");var v=u&&u.getBBox?u.getBBox():null;m&&(u.textContent="");var b=v?v.width:a.dimension.width;var T=v?v.height:a.dimension.height;var x=v?Math.max(v.x,0):null;var E=v?Math.max(v.y,0):null;var y=n.timeRepresentation;var C=null;if(a.instanceOf==="TimeLineModel"){var S=Mt["b"].DataObjects.ContextRepo.getContextByCid(a.contextId);var M=Mt["b"].Models.Actions.ModelActions.ContextModel.getContextExpressions(S);for(var f=0;f<M.length;f++){if(M[f].id.split(".").pop()===a.dataId_expr){C=M[f].representation}}if(C===y.LINE||C===y.SYMBOL_LINE){var O=Mt["b"].Factories.ViewFactory.getViewById(t.getController().getRootPanel(),a.view);c=Mt["b"].Layout.CommentReference.getMaxLineChartPosition(O,C)}}if(a.instanceOf==="LabelModel"){if(a.id.indexOf("dimensionchart")!==-1){r={x:"center",y:"bottom"};l=E?E:a.position.y;l+=T;if(x){o=x+b/2}else{if(a.textAnchor==="middle"){o=a.position.x}else if(a.textAnchor==="end"){o=a.position.x-b/2}else{o=a.position.x+b/2}}}else if(a.id.indexOf("valueRowLabel")!==-1){var A=a.valueRowLabelPosition.split(".")[0];if(A==="LeftValue"||A==="LeftAxis"||A==="LeftMiddle"){r={x:"left",y:"center"};if(x){o=x}else{o=a.position.x}l=E?E:a.position.y;l+=T/2}else{r={x:"right",y:"center"};if(x){o=x}else{o=a.position.x}o+=b;l=E?E:a.position.y;l+=T/2}}else{if(x){o=x+b/2}else{if(a.textAnchor==="middle"){o=a.position.x}else if(a.textAnchor==="end"){o=a.position.x-b/2}else{o=a.position.x+b/2}}if(d<0){r={x:"center",y:"bottom"};l=E?E:a.position.y;l+=T}else{l=E?E:a.position.y;r={x:"center",y:"top"}}}}else if(a.id.indexOf("compare")!==-1){var _={x:null,y:null};if(a.absolute.legend===n.indicator.NONE&&a.percent.legend===n.indicator.NONE&&a.text.legend===n.indicator.NONE||i.elementType.split("#")[1]!=="text"){var L=Mt["b"].Layout.Common.getMaxPosition(a);_=L.position;b=L.dimension.width;T=L.dimension.height}else{if(x){_.x=x}if(E){_.y=E}}r={x:"left",y:"center"};o=_.x;l=_.y+T/2;if(a.compareLegend==="end"||(a.compareLegend==="from"||a.compareLegend==="to")){r={x:"right",y:"center"};o+=b}}else{if(d<0){r={x:"center",y:"bottom"};if(a.instanceOf==="TimeLineModel"){if(c){o=c.position.x+c.dimension.width/2;l=c.position.y+c.dimension.height;b=c.dimension.width;T=c.dimension.height}else{o=x?x:a.position.x;o+=b/2;l=E?E:a.position.y;l+=T}}else if(a.instanceOf==="RodModel"){o=a.linePos.x;l=a.linePos.y+a.lineDim.height+(a.needleSize?a.needleSize/2:a.dimension.height/2);b=a.dimension.width+a.needleSize/2;T=a.dimension.height+a.needleSize/2}else{o=x?x:a.position.x;o+=b/2;l=E?E:a.position.y;l+=T}}else{r={x:"center",y:"top"};if(a.instanceOf==="TimeLineModel"){if(c){o=c.position.x+c.dimension.width/2;l=c.position.y;b=c.dimension.width;T=c.dimension.height}else{o=x?x:a.position.x;o+=b/2;l=E?E:a.position.y}}else if(a.instanceOf==="RodModel"){o=a.linePos.x;l=a.linePos.y-(a.needleSize?a.needleSize/2:a.dimension.height/2);b=a.dimension.width+a.needleSize/2;T=a.dimension.height+a.needleSize/2}else{o=x?x:a.position.x;o+=b/2;l=E?E:a.position.y}}}return{x:o,y:l,align:r,width:b,height:T}},getReferenceCollisionOffset:function(e,t,i,a){var n=Mt["b"].DataObjects.CommentRepo.getLoadedCommentsByReferencedExtension(e.getId());var r=0;for(var o=0;o<n.length;o++){var l=n[o];var s=Mt["b"].DataObjects.DocumentDO.getExtension(l.extensionId);for(var d=0;d<l.currContent.grid.length;d++){var c=l.currContent.grid[d];for(var u=0;u<c.length;u++){var p=c[u];for(var g=0;g<p.reference.length;g++){var h=p.reference[g];var f=false;if(a.id.indexOf("representationLabel")!==-1&&h.elementType&&t.elementType&&(h.elementType.split("#")[0]==="representation"&&h.elementType.split("#")[1]==="rect")||t.elementType.split("#")[0]==="representation"&&t.elementType.split("#")[1]==="rect"){f=true}if(h.extension===t.extension&&h.chartId===t.chartId&&h.elementPath===t.elementPath&&(!f&&h.elementType===t.elementType||f)&&h.position.x===t.position.x&&h.position.y===t.position.y){var m=document.getElementById("DIV_"+p.created_in_chart.replace("chart","object")+"_commentReference_"+s.getId()+"_"+g);if(m){r++}}}}}}Mt["b"].DataObjects.CommentRepo.setMoveablePosCounter(r);var v=Mt["b"].Utils.Constants.Parameters.distanceBetweenRefCircleAndModel;return r*(i+v)},getMoveableCommentReferencePosition:function(e,t){var i=Mt["b"].Models.Actions.ViewModelActions.General.getAbsolutePosition(e,t.getController().getRootModel());return{x:i.x+2*Mt["b"].DataObjects.RuntimeDO.getParameterParsed("FONT_SIZE_CHART"),y:i.y}},ReferenceRepresentation:new function(){var p=false,i,g,t,h,f,r,d,c,u,o={refSize:[]};var l=["&#9312;","&#9313;","&#9314;","&#9315;","&#9316;","&#9317;","&#9318;","&#9319;","&#9320;","&#9321;","&#9322;","&#9323;","&#9324;","&#9325;","&#9326;","&#9327;","&#9328;","&#9329;","&#9330;","&#9331;"],s=["&#10102;","&#10103;","&#10104;","&#10105;","&#10106;","&#10107;","&#10108;","&#10109;","&#10110;","&#10111;","&#9451;","&#9452;","&#9453;","&#9454;","&#9455;","&#9456;","&#9457;","&#9458;","&#9459;","&#9460;"],m=1.75,v=1.35,b={red:"#ff0000",white:"#ffffff"};this.init=invalidateInit;this.char={create:createCharReference,setActive:activateCharReference,getReferenceSize:getReferenceSize};this.svg={create:createSVGReference,setActive:activateSVGReference,getReferenceSize:getReferenceSize};function init(){var e=Mt["b"].DataObjects.RuntimeDO;i=e.getParameter("REFERENCE_FONT_COLOR");g=e.getParameter("FONT_FAMILY");t=e.getParameterParsed("FONT_SIZE_CHART");h=Mt["b"].Utils.Calculator.Converter.pt2pix(t);f=e.getParameter("FONT_STYLE_CHART");r=f+" "+h+"px"+(g!==""?" '"+g+"'":"");d=e.getParameter("REFERENCE_COLOR_INVERTED")==="true";c=d?b.white:i;u=d?i:b.white;o={refSize:[]};p=true}function invalidateInit(){p=false}function createCharReference(e,t){!p&&init();e--;var i=d?s[e]:l[e];if(i){var a=document.createElement("div"),n=document.createElement("div");n.style.fontFamily=g;n.style.fontSize=Math.round(h*m)+"px";n.style.fontWeight=f;a.style.width=a.style.height=n.style.lineHeight=Math.round(h*v)+"px";a.style.overflow="hidden";a.style.display="flex";a.style.justifyContent="center";a.style.alignItems="center";a.style.flexDirection="row";a.style.flexWrap="wrap";n.innerHTML=i;a.appendChild(n);activateCharReference(a,t);return a}}function createSVGReference(e,t){!p&&init();var i=getReferenceSize(e),a=i.radius,n=i.dimension.toString(),r=i.refLabelDistance,o=i.refText,l=(a+r).toString(),s=document.createElement("div"),d=document.createElementNS("http://www.w3.org/2000/svg","svg"),c=document.createElementNS("http://www.w3.org/2000/svg","circle"),u=document.createElementNS("http://www.w3.org/2000/svg","text");d.style.height=d.style.width=s.style.height=s.style.width=n+"px";c.setAttribute("cx",l);c.setAttribute("cy",l);c.setAttribute("r",a.toString());u.setAttribute("y",(a+o.height/2-r).toString());u.setAttribute("x",(a-o.width/2+r).toString());u.appendChild(document.createTextNode(e.toString()));u.style.fontFamily=g;u.style.fontSize=h;u.style.fontWeight=f;u.style.fontStyle="normal";d.appendChild(c);d.appendChild(u);s.appendChild(d);activateSVGReference(s,t);return s}function getReferenceSize(e){!p&&init();e=e.toString();if(!o.refSize[e]){var t=Mt["b"].DataObjects.DocumentDO.getPainter().measureTextDim(e,r),i=t.height>=h?Math.round((t.height-h*.8)/2):0,a=Math.max(t.height,t.width)/2+i,n=(a+i)*2;o.refSize[e]={radius:a,dimension:n,refLabelDistance:i,refText:t}}return o.refSize[e]}function activateCharReference(e,t){e.firstElementChild.style.color=t?i:b.red}function activateSVGReference(e,t){var i=e.getElementsByTagName("circle")[0],a=e.getElementsByTagName("text")[0],n=t?c:b.red,r=t?u:b.red,o=d?r:b.white,l=d?r:n,s=d?b.white:n;i.setAttribute("fill",o);i.setAttribute("stroke",l);a.setAttribute("fill",s)}}};Mt["b"].Layout=Mt["b"].Layout||{};Mt["b"].Layout.Grid=Mt["b"].Layout.Grid||{};Mt["b"].Layout.Grid.AxisGridLayout=function(e,t){var i="AxisGrid";var w=null;var F=e!=null?e:1;var a=t!=null?t:1;var p=Mt["b"].Utils.Calculator.Converter;var g=Mt["b"].DataObjects.RuntimeDO;var h=null;var B=null;var f=null;var m=null;var k=null;var U={};var v=Mt["b"].Utils.Constants.TypeValues;var b;var T,H;var x=null;var c;var u;this.getRows=function(){return F};this.setRows=function(e){F=e};this.getColumns=function(){return a};this.setColumns=function(e){a=e};this.setGridData=function(e){w=e};this.getType=function(){return i};this.layoutPanels=function(e,t,i,a){var n={};k=a.getModel();if(e.length===0||k.extendedModel.displayType===v.categoryLabel.NONE){return{}}h=e[0].getController().getRootModel();if(h.buildUp===Mt["b"].Utils.Constants.BuildUp.PREINIT){x=Mt["b"].DataObjects.ContextRepo.getContextByCid(e[0].getModel().contextId);var r=Mt["b"].Factories.ModelFactory.getParentContainer(h.firstObjectGrid,a.getModel());B=r[0];f=r[1];var o=r[2];if(o&&o.extendedModel&&o.extendedModel.instanceOf==="MultipleContainerModel"){m=o;b=m.extendedModel.fontSize}else{b=g.getParameterParsed("FONT_SIZE_CHART")}T=getNMParameter("MMPT_TIME_CATEGORY_LABEL_SIGN_DISTANCE");H=getNMParameter("MMPT_TIME_CATEGORY_LABEL_AXIS_DISTANCE")}switch(h.buildUp){case Mt["b"].Utils.Constants.BuildUp.PREINIT:k.extendedModel.leftSpace=0;for(var l=0;l<e.length;l++){var s=e[l].getModel();var d=e[l].getPainter();setTotalFontWeight(s);setDimensionLabelText(s,d);calcDimensionHeightPerLevel(s,e,l)}var c=0;for(var u in U){c+=U[u]}k.dimension.height=c;break;case Mt["b"].Utils.Constants.BuildUp.INIT:break;case Mt["b"].Utils.Constants.BuildUp.LEGEND:setPanelPositions(e,n);break;case Mt["b"].Utils.Constants.BuildUp.DRAW:for(var l=0;l<e.length;l++){e[l].getModel().position.x+=k.position.x;e[l].getModel().position.y+=k.position.y;n[e[l].getId()]=e[l]}break}return n;function getNMParameter(e){return p.mm2pix(b*parseFloat(g.getParameter(e)))}};function setDimensionLabelText(e,t){var i=k.extendedModel.calculatedDimTextLength;var a=e.id.split(".").pop();var n=e.dataId_dim+"@"+a;var r=i[n];if(r!==null&&r!==undefined){if(r.hide){e.hideLabel=true}else{var o=e.fontWeight+" "+e.fontSize+"px '"+e.font+"'";var l=t.measureTextDim(e.text,o,e.lineSpacing);if(l.width>r.dim_px&&!r.dimAutoLength){e.text=fitStringToWidth(e.text,r.dim_px,o)}}}}function calculateTextWidth(e,t){var i;if(c===null||c===undefined){c=document.createElement("canvas");c.setAttribute("id","measureTextTestCanvas");u=c.getContext("2d")}if(u!==null&&u!==undefined){u.font=t;i=u.measureText(e).width}return i}function fitStringToWidth(e,t,i){var a=e;var n=0;var r;var o=e.length;var l=Math.floor((o-n)/2);while(l>=1){r=n+l;a=e.substring(0,r);a=a+"...";var s=calculateTextWidth(a,i);if(s>t){o=r;l=Math.floor((o-n)/2)}else{n=r;l=Math.floor((o-n)/2)}}var d=e.substring(0,n);d=d+"...";if(d==="..."){d=""}if(c!==null&&c!==undefined){c=null;u=null}return d}function setTotalFontWeight(e){var t=g.getParameter("CHECK_TIME_SUBTOTAL_FONT_BOLD")==="true"?"bold":"normal";var i=g.getParameter("CHECK_TIME_TOTAL_WITH_VALUES_FONT_BOLD")==="true"?"bold":"normal";var a=g.getParameter("CHECK_TIME_TOTAL_WITHOUT_VALUES_FONT_BOLD")==="true"?"bold":"normal";var n=e.dataId_dim;var r=Mt["b"].Models.Actions.DataModelActions.getDimensionNodeByPath(x.dataModel,n);if(r!==null&&(e.isTotal==true||e.isSubtotal==true)){if(e.isSubtotal==true){e.fontWeight=t}else if(e.isTotal==true){e.fontWeight=i}}else{if(e.catWithoutTotal==true){e.fontWeight=a}}}function setPanelPositions(S,M){var e=k.position.x;var O=k.position.y;var A=e;var _=O;var t=Mt["b"].Layout.Common.getLinkGroups(h,B.id,"Time");var i=t.legend?t.legend.categoryWidth:f.categoryWidth;var L=i.categorySize+2*i.categoryDistance;var I=B.extendedModel.dimensionLabelModel.calculatedEmptySpaces;var D=1;var R=1;var P=F;if(w!==null){P=w.gridRows.length}var N=0;Mt["b"].$.each(S,function(e,t){var i=t.getModel();var a=i.dataId_dim;var n=0;var r=i.id.split(".");var o=r[r.length-2]+"."+r[r.length-1];var l=r[1].replace("label","")*1+1;if(D===1){var s=I[a];if(s!==undefined&&l==s.positionCnt){if(s.position==="start"){A+=s.space_px}}}N=e%F===0?U[o]-H:N+=U[o];if(w===null){n=L}else{n=w.gridColumns[R-1]-(R===1?0:w.gridColumns[R-2])}if(i.instanceOf!=="LabelModel"){n=Math.round(n)}_=O+k.dimension.height-N;A=Number(A);_=Number(_);if(i.position.x==0&&i.position.y==0){if(i.instanceOf==="LabelModel"&&B.extendedModel&&B.extendedModel.instanceOf==="TimeChartModel"){var d=t.getPainter().measureTextDim(i.text).width;var c=0;if(i.hideLabel===false){if(k.extendedModel.leftSpace>=parseInt(A+n/2-d/2)){k.extendedModel.leftSpace=parseInt(A+n/2-d/2)}i.textAnchor="middle";t.setPosition({x:A+n/2,y:_});c=A+n/2+i.dimension.width/2}else{c=A+n;t.setPosition({x:t.getPosition().x,y:_})}var u=A+n;var p=e+P;for(var g=p;g<=S.length;g+=P){if(g<S.length){var h=S[g].getDimension().width;if(h<n&&h>0){u+=n/2-S[g].getDimension().width/2}else{u+=n}var f=0;var m=S[g-P].getModel();if(m!==undefined){var v=I[m.dataId_dim];var b=m.id.split(".")[1].replace("label","")*1+1;if(v!==undefined&&b==v.positionCnt){if(v.position==="end"){f=v.space_px}}}var T=0;var x=S[g].getModel();if(x!==undefined){var E=I[x.dataId_dim];var y=x.id.split(".")[1].replace("label","")*1+1;if(E!==undefined){if(E.position==="start"&&y==E.positionCnt){T=E.space_px}}}u+=f;u+=T;if(u<c){S[g].getModel().hideLabel=true;var C=Mt["b"].Layout.Common.getHighlight(B.extendedModel,S[g].getModel(),Mt["b"].Utils.Constants.TypeValues.highlightType.CATEGORY_LABEL,true);if(C&&C.highlight){C.highlight.active=false}if(h<n){u+=h/2}else{u+=h}}else{break}}}}else{t.setPosition({x:A,y:_})}}M[t.getId()]=t;if(D<P){D++}else{if(D===P){A+=L}D=1;R++;var s=I[a];if(s!==undefined&&l==s.positionCnt){if(s.position==="end"){A+=s.space_px}}}})}function calcDimensionHeightPerLevel(e,t,i){var a=t[0].getPainter();var n=i%F;if(e.instanceOf==="LabelModel"){var r=t[i].getModel().id.split(".");var o=r[r.length-2]+"."+r[r.length-1];var l=U[o];if(e.hideLabel){window.isNaN(l)&&(U[o]=0);return}if(l===undefined){U[o]=0;l=0}var s=e.fontWeight+" "+e.fontSize+"px '"+e.font+"'";e.dimension=a.measureTextDim(e.text,s);var d=n==0?H:T;if(e.dimension.height>l){U[o]=e.dimension.height+d}}}this.getPreferredLayoutSize=function(e,t){return{height:0,width:0}}};Mt["b"].Layout=Mt["b"].Layout||{};Mt["b"].Layout.Grid=Mt["b"].Layout.Grid||{};Mt["b"].Layout.Grid.EmptyLayout=function(e,t){var i="grid";var h=e!=null?e:1;var f=t!=null?t:1;var m,v,b,T;var x,E,y,C;this.getRows=function(){return h};this.setRows=function(e){h=e};this.getColumns=function(){return f};this.setColumns=function(e){f=e};this.getType=function(){return i};this.layoutPanels=function(e,t,i,a){var n={};if(e.length===0){return n}var r=e[0].getController().getRootModel();var o=a.getModel();if(r.buildUp===Mt["b"].Utils.Constants.BuildUp.PREINIT){m=o.border.left.width+o.padding.left;v=o.border.right.width+o.padding.right;b=o.border.top.width+o.padding.top;T=o.border.bottom.width+o.padding.bottom;x=0;y=i.width-x-m-v;E=0;C=i.height-E-b-T;var l=e[0];delete l.getModel().nestedContainerId;var s=y/f,d=C/h;l.setPosition({x:0,y:0});l.setDimension({width:s,height:d});var c=C,u=y;if(m+v+b+T>0){var p=Mt["b"].Utils.Constants.Parameters.idContainerContent+"."+o.id;o.scrollingData={realHeight:i.height,realWidth:i.width,height:i.height,width:i.width,scrollingVer:false,scrollingHor:false,x:t.x,y:t.y,children:{},id:o.id};o.scrollingData.children[p]={realHeight:c,realWidth:u,height:C,width:y,scrollingVer:false,scrollingHor:false,x:m,y:b,id:p};for(var g=0;g<e.length;g++){e[g].getModel().nestedContainerId=p}}else{o.scrollingData={realHeight:c,realWidth:u,width:i.width,height:i.height,scrollingVer:false,scrollingHor:false,x:t.x,y:t.y,id:o.id}}}for(var g=0;g<e.length;g++){n[e[g].getId()]=e[g]}return n};this.getPreferredLayoutSize=function(e,t,i){return{height:-1,width:-1}}};Mt["b"].Layout=Mt["b"].Layout||{};Mt["b"].Layout.Grid=Mt["b"].Layout.Grid||{};Mt["b"].Layout.Grid.GridLayout=function(e,t){var i="grid";var U=null;var H=e!=null?e:1;var G=t!=null?t:1;var M=null;var V=Mt["b"].Utils.Calculator.Converter;var $=Mt["b"].DataObjects.RuntimeDO;var z,W,j,K;var X,Y,Z,Q;this.getRows=function(){return H};this.setRows=function(e){H=e};this.getColumns=function(){return G};this.setColumns=function(e){G=e};this.setGridData=function(e){U=e};this.getType=function(){return i};this.layoutPanels=function(e,t,i,a){var n={};if(e.length===0){a.getModel().scrollingData={};return n}var r=e[0].getController().getRootModel();var o=a.getModel();var l=o.extendedModel;if(r.buildUp===Mt["b"].Utils.Constants.BuildUp.PREINIT){z=o.border.left.width+o.padding.left;W=o.border.right.width+o.padding.right;j=o.border.top.width+o.padding.top;K=o.border.bottom.width+o.padding.bottom;X=0;Z=i.width-X-z-W;Y=0;var s=0,d=0;var c,u,p=0;if(l&&l.multipleMode){var g=Mt["b"].Factories.ModelFactory.getParentContainer(r.firstObjectGrid,o)[0].extendedModel;c=e[e.length-2];u=e[e.length-1];var h=c.getModel();var f=Z;var m=g.dimensions[g.dimensions.length-1];if(m.categorySize!==null){f=Math.min(f,V.mm2pix(g.fontSize*m.categorySize))}h.dimension=rearrangeMultipleTitleText(h,f,m.categoryTextBreak,c.getPainter());s=h.dimension.height;u.setDimension({height:s,width:i.width});var v=0;if(g.activeElementType==="time"){d=V.mm2pix(g.fontSize*$.getParameterParsed("MMPT_TIME_VALUE_LABEL_PADDING_TOP"));v=V.mm2pix(g.fontSize*$.getParameterParsed("MMPT_TIME_VALUE_LABEL_PADDING_LEFT"))}else if(g.activeElementType==="structure"){d=V.mm2pix(g.fontSize*$.getParameterParsed("MMPT_STRUCTURE_CELL_PADDING_TOP"));v=V.mm2pix(g.fontSize*$.getParameterParsed("MMPT_STRUCTURE_CELL_PADDING_SIDE"))}var b=X+z;if(m.categoryAlignment==="Mid"){b+=Math.floor(Z/2);h.textAnchor="middle";h.horizontalAlign=Mt["b"].Utils.Constants.TypeValues.labelHorizontalAlignment.MIDDLE}else if(m.categoryAlignment==="Right"){b+=Z-v;h.textAnchor="end";h.horizontalAlign=Mt["b"].Utils.Constants.TypeValues.labelHorizontalAlignment.RIGHT}else{b+=v}c.setPosition({x:b,y:Y+d+j});u.setPosition({x:0,y:0});p=l.gridRows.length*l.gridColumns.length}Y+=s+d;Q=i.height-Y-j-K;var T=X;var x=Y;var E=T;var y=x;var C=U?U.gridRows.length:H;var S=U?U.gridColumns.length:G;var M=1;var O=1;if(l&&l.multipleMode){l.gridColumnsFixed=l.colDynamic.map(function(e,t){return!e&&l.colTypes[t]!=="w"});l.gridRowsFixed=l.rowDynamic.map(function(e,t){return!e&&l.rowTypes[t]!=="w"});if(l.gridColumns[l.gridColumns.length-1]!==Z){recalculateCellSizes(l.gridColumns,l.gridColumnsFixed,Z)}if(l.gridRows[l.gridRows.length-1]!==Q){recalculateCellSizes(l.gridRows,l.gridRowsFixed,Q)}}for(var A=0;A<e.length;A++){var _=e[A];delete _.getModel().nestedContainerId;if(l&&l.multipleMode&&A>=p){break}var L=0,I=0;if(U===null){L=Z/S;I=Q/C}else{L=U.gridColumns[O-1]-(O===1?0:U.gridColumns[O-2]);I=U.gridRows[M-1]-(M===1?0:U.gridRows[M-2])}_.setPosition({x:E,y:y});_.setDimension({width:L,height:I});if(O<S){O++;E+=L}else{O=1;M++;E=T;y+=I}}var D,R;if(l){D=Math.max(Q,l.gridRows[l.gridRows.length-1]);R=Math.max(Z,l.gridColumns[l.gridColumns.length-1])}else{D=Q;R=Z}var P=i.height-j-K,N=.5,w=!o.disableScrolling&&D-P>N,F=!o.disableScrolling&&R-Z>N;if(z+W+j+K>0){var B=Mt["b"].Utils.Constants.Parameters.idContainerContent+"."+o.id;o.scrollingData={realHeight:i.height,realWidth:i.width,height:i.height,width:i.width,scrollingVer:false,scrollingHor:false,x:t.x,y:t.y,children:{},id:o.id};o.scrollingData.children[B]={realHeight:D,realWidth:R,height:P,width:Z,scrollingVer:w,scrollingHor:F,x:z,y:j,id:B};for(var A=0;A<e.length;A++){if(l&&l.multipleMode&&A>=p){break}e[A].getModel().nestedContainerId=B}}else{o.scrollingData={realHeight:D,realWidth:R,width:i.width,height:i.height,scrollingVer:!o.disableScrolling&&D-i.height>N,scrollingHor:!o.disableScrolling&&R-i.width>N,x:t.x,y:t.y,id:o.id};if(l&&l.multipleMode&&e.length>0){var k=e[e.length-1].getModel();o.scrollingData.scrollingVer&&(k.dimension.height=D);o.scrollingData.scrollingHor&&(k.dimension.width=R)}}}for(var A=0;A<e.length;A++){n[e[A].getId()]=e[A]}return n};this.getPreferredLayoutSize=function(e,t,i){var a=i.getController().getRootModel(),n=Mt["b"].Utils.Constants.BuildUp,r=Mt["b"].DataObjects.RuntimeDO.isPrePaint(),o=r&&a.buildUp===n.POST_DRAW;M={height:0,width:0};if(a.buildUp===n.PREINIT&&!r||o){var l=i.getModel();var s=l.extendedModel;if(l.id===Mt["b"].Factories.ModelFactory.idCollection.rootContainer){var d=e[0];M=d.getPreferredSize()}else if(s.instanceOf==="ContainerGridModel"&&o){var c=s.gridRows.length,u=s.gridColumns.length,p=true;for(var g=0;g<c;g++){var h=g*u,f=s.rowWrappable[g],m=s.rowDynamic[g];for(var v=0;v<u;v++){var b=s.colDynamic[v],T=b||m||f,d=e[h+v],x=d.getModel();if(x.extendedModel&&x.extendedModel.instanceOf!=="ContainerGridModel"&&!T){delete x.prefSize;continue}var E=d.getPreferredSize(),y={width:E.width||0,height:E.height||0},C=x.prefSize||{width:0,height:0},S=C.width!==y.width||C.height!==y.height;if(S&&d.getId().indexOf("chart-")===-1){if(C.width!==y.width&&(f||b)){p=false}else if(C.height!==y.height&&m){p=false}x.prefSize=y}}}if(!p){i.getController().getExtension().setValid("layout",p)}}}return M};function rearrangeMultipleTitleText(e,o,t,l){var s=e.fontWeight+" "+e.fontSize+"px '"+e.font+"'";var i=/\n|<br>|<br \/>|<br\/>/;var a=e.text.split(i);var d=0;function findBreakPoint(e,t){var i=Math.round(e.length*o/t);var a=e.substring(0,i);var n=l.measureTextDim(a,s);if(n.width>0&&n.width>o){do{a=e.substring(0,--i);n=l.measureTextDim(a,s)}while(n.width>o);d=Math.max(d,n.width)}else if(n.width>0&&n.width<o){var r=n.width;while(true){a=e.substring(0,++i);n=l.measureTextDim(a,s);if(n.width===o){r=n.width;break}else if(n.width>o){i--;break}r=n.width}d=Math.max(d,r)}else{d=Math.max(d,n.width)}return i}for(var n=0;n<a.length;n++){var r=a[n];var c=l.measureTextDim(r,s);if(c.width>o){var u=findBreakPoint(r,c.width);a[n]=r.substring(0,u);if(t){a.splice(n+1,0,r.substring(u))}}else{d=Math.max(d,c.width)}}e.text=a.join("\n");return{height:(e.fontSize+e.lineSpacing)*a.length-e.lineSpacing,width:d}}function recalculateCellSizes(e,t,i){var a=0;var n=0;if(!t[0]){a=e[0]}else{i-=e[0]}for(var r=1;r<e.length;r++){if(!t[r]){a+=e[r]-e[r-1];n++}else{i-=e[r]-e[r-1]}}if(n===0&&t[0]){return}var o=e[0];var l;var s=Math.max(i,0);if(!t[0]){if(n===0){e[0]=s}else{e[0]=a>0?Math.round(e[0]/a*i):0}s-=e[0]}for(var r=1;r<e.length;r++){s=Math.max(s,0);l=e[r];if(t[r]){e[r]=e[r]-o+e[r-1]}else if(n===1){e[r]=s+e[r-1]}else{e[r]=a>0?Math.round((e[r]-o)/a*i):0;s-=e[r];e[r]+=e[r-1];n--}o=l}}};Mt["b"].Layout=Mt["b"].Layout||{};Mt["b"].Layout.Grid=Mt["b"].Layout.Grid||{};Mt["b"].Layout.Grid.PlaceHolderLayout=function(e,t){var i="grid";var p=e!=null?e:1;var g=t!=null?t:1;var h,f,m,v;var b,T,x,E;this.getRows=function(){return p};this.setRows=function(e){p=e};this.getColumns=function(){return g};this.setColumns=function(e){g=e};this.getType=function(){return i};this.layoutPanels=function(e,t,i,a){var n={};if(e.length===0){return n}var r=e[0].getController().getRootModel();var o=a.getModel();if(r.buildUp===Mt["b"].Utils.Constants.BuildUp.PREINIT){h=o.border.left.width+o.padding.left;f=o.border.right.width+o.padding.right;m=o.border.top.width+o.padding.top;v=o.border.bottom.width+o.padding.bottom;b=0;x=i.width-b-h-f;T=0;E=i.height-T-m-v;var l=e[0];delete l.getModel().nestedContainerId;var s=x/g,d=E/p;l.setPosition({x:b,y:T});l.setDimension({width:s,height:d});l.getModel().color="rgb(244,244,244)";if(h+f+m+v>0){var c=Mt["b"].Utils.Constants.Parameters.idContainerContent+"."+o.id;o.scrollingData={realHeight:i.height,realWidth:i.width,height:i.height,width:i.width,scrollingVer:false,scrollingHor:false,x:t.x,y:t.y,children:{},id:o.id};o.scrollingData.children[c]={realHeight:E,realWidth:x,height:E,width:x,scrollingVer:false,scrollingHor:false,x:h,y:m,id:c};for(var u=0;u<e.length;u++){e[u].getModel().nestedContainerId=c}}else{o.scrollingData={realHeight:E,realWidth:x,width:i.width,height:i.height,scrollingVer:false,scrollingHor:false,x:t.x,y:t.y,id:o.id}}}else if(r.buildUp===Mt["b"].Utils.Constants.BuildUp.DRAW){Mt["b"].Layout.Common.layoutClickBackground(e[0].getModel(),a.getPainter())}for(var u=0;u<e.length;u++){n[e[u].getId()]=e[u]}return n};this.getPreferredLayoutSize=function(e,t,i){var a=40;return{height:t.height>a?0:a,width:t.width>a?0:a}}};Mt["b"].Layout.Grid=Mt["b"].Layout.Grid||{};Mt["b"].Layout.Grid.StructureDimensionGridLayout=function(e,t){var i="StructureDimensionGrid";var n=null;var a=e!=null?e:1;var y=t!=null?t:1;var C={};var r=0;var g=new Array;var h=null;var S=null;var M=null;var f=null;var m=null;var O=null;var A=null;var _=Mt["b"].Utils.Constants.TypeValues;var v=Mt["b"].DataObjects.RuntimeDO;var b=Mt["b"].Utils.Calculator.Converter;var T;var L,I,D;var x=null;var d;var c;var o=v.getParameter("CHECK_STRUCTURE_SUBTOTAL_FONT_BOLD")==="true"?"bold":"normal";var l=v.getParameter("CHECK_STRUCTURE_TOTAL_WITH_VALUES_FONT_BOLD")==="true"?"bold":"normal";var s=v.getParameter("CHECK_STRUCTURE_TOTAL_WITHOUT_VALUES_FONT_BOLD")==="true"?"bold":"normal";this.getRows=function(){return a};this.setRows=function(e){a=e};this.getColumns=function(){return y};this.setColumns=function(e){y=e};this.setGridData=function(e){n=e};this.setCurrColumn=function(e){r=e};this.getColIndex=function(){return r};this.getType=function(){return i};this.layoutPanels=function(e,t,i,a){var n={};A=a.getModel();if(e.length===0||A.extendedModel.displayType===_.categoryLabel.NONE){return n}O=e[0].getController().getRootModel();if(O.buildUp===Mt["b"].Utils.Constants.BuildUp.PREINIT){h=Mt["b"].Factories.ModelFactory.getParentContainer(O.firstObjectGrid,A);M=h[1];S=h[0];m=S.extendedModel;x=Mt["b"].DataObjects.ContextRepo.getContextByCid(e[0].getModel().contextId);var r=h[2];if(r&&r.extendedModel&&r.extendedModel.instanceOf==="MultipleContainerModel"){f=r;T=f.extendedModel.fontSize}else{T=v.getParameter("FONT_SIZE_CHART")}L=getNMParameter("MMPT_STRUCTURE_CATEGORY_LABEL_AXIS_DISTANCE");I=getNMParameter("MMPT_STRUCTURE_HIERARCHY_OFFSET");D=getNMParameter("MMPT_STRUCTURE_CATEGORY_LABEL_SIGN_DISTANCE")}if(!m||!m.instanceOf||m.instanceOf!=="ChartModel"){return{}}switch(O.buildUp){case Mt["b"].Utils.Constants.BuildUp.PREINIT:var o=Mt["b"].DataObjects.DocumentDO.getPainter();for(var l=0;l<e.length;l++){var s=e[l].getModel();setTotalFontWeight(s);setDimensionLabelText(s,o);calcDimensionWidthPerLevel(s,e,l);if(A.extendedModel.displayType===_.categoryLabel.FREE_AXIS_POS){for(var d=0;d<S.children.length;d++){var c=S.children[d];if(c.instanceOf==="BarModel"||c.instanceOf==="NeedleModel"||c.instanceOf==="StructureWaterfallModel"||c.instanceOf==="StructureLineModel"||c.instanceOf==="ValueModel"){g.push(c)}}hideFreeAxisDimensionLabels()}}var u=0;for(var p in C){u+=C[p]}A.dimension.width=u;break;case Mt["b"].Utils.Constants.BuildUp.INIT:break;case Mt["b"].Utils.Constants.BuildUp.LEGEND:setPanelPositions(e,a,n);break;case Mt["b"].Utils.Constants.BuildUp.DRAW:for(var l=0;l<e.length;l++){e[l].getPosition().x+=A.position.x;e[l].getPosition().y+=A.position.y;n[e[l].getId()]=e[l]}break}return n;function getNMParameter(e){return b.mm2pix(T*parseFloat(v.getParameter(e)))}};function setDimensionLabelText(e,t){var i=A.extendedModel.calculatedDimTextLength;var a=e.id.split(".").pop();var n=e.dataId_dim+"@"+a;var r=i[n];if(r!==null&&r!==undefined){if(r.hide){e.hideLabel=true}else{var o=e.fontWeight+" "+e.fontSize+"px "+e.font;var l=t.measureTextDim(e.text,o,e.lineSpacing);if(l.width>r.dim_px&&!r.dimAutoLength){e.text=fitStringToWidth(e.text,r.dim_px,o)}}}}function calculateTextWidth(e,t){var i;if(d===null||d===undefined){d=document.createElement("canvas");d.setAttribute("id","measureTextTestCanvas");c=d.getContext("2d")}if(c!==null&&c!==undefined){c.font=t;i=c.measureText(e).width}return i}function fitStringToWidth(e,t,i){var a=e;var n=0;var r;var o=a.length;var l=Math.floor((o-n)/2);while(l>=1){r=n+l;a=e.substring(0,r);a=a+"...";if(calculateTextWidth(a,i)>t){o=r;l=Math.floor((o-n)/2)}else{n=r;l=Math.floor((o-n)/2)}}var s=e.substring(0,n);s!==""&&(s=s+"...");if(d!==null&&d!==undefined){d=null;c=null}return s}function setPanelPositions(e,t,f){var m=t.getModel();var v=0;var b=1;var i=Mt["b"].Layout.Common.getLinkGroups(O,S.id,"Structure");var a=i.legend?i.legend.categoryHeight:M.categoryHeight[S.row];var T=a.categorySize+2*a.categoryDistance;var x=S.extendedModel.dimensionLabelModel.calculatedEmptySpaces;var E=y;if(n!==null){E=n.gridColumns.length}Mt["b"].$.each(e,function(e,t){var i=t.getModel().dataId_dim;var a=parseInt(t.getModel().id.split(".")[1].replace("label",""))+1;if(e%y===0){var n=x[i];if(n!==undefined&&a==n.positionCnt){if(n.position==="start"){v+=n.space_px}}}var r=v+m.position.y+Math.round((T-t.getDimension().height)/2);var o=t.getModel().hierarchyLvl!=undefined?t.getModel().hierarchyLvl*I:0;var l=0;var s=0;var d=0;var c=_.labelHorizontalAlignment;var u=A.extendedModel.alignment;var p=0;for(var g in C){if(p<e%y){l+=C[g]}if(p==e%y){s=C[g]}if(p>e%y){d+=C[g]}p++}var h;if(A.extendedModel.displayType===_.categoryLabel.FREE_AXIS_POS){h=A.dimension.width-d;h-=b==y?L:D;t.getModel().textAnchor="end"}else{if(u!==c.LEFT){if(b==y){s-=L}else{s-=D}}h=l+o;if(t.getModel().hierarchyLvl===undefined){switch(u){case c.LEFT:t.getModel().textAnchor="start";break;case c.MIDDLE:h+=s/2;t.getModel().textAnchor="middle";break;case c.RIGHT:h+=s;t.getModel().textAnchor="end";break}}}t.setPosition({x:h,y:r});f[t.getId()]=t;if(b<E){b++}else{b=1}if(e%y===y-1){v+=T;var n=x[i];var a=parseInt(t.getModel().id.split(".")[1].replace("label",""))+1;if(n!==undefined&&a==n.positionCnt){if(n.position==="end"){v+=n.space_px}}}})}function setTotalFontWeight(e){var t=e.dataId_dim;var i=Mt["b"].Models.Actions.DataModelActions.getDimensionNodeByPath(x.dataModel,t);if(i!==null&&(e.isTotal||e.isSubtotal)){if(e.isSubtotal){e.fontWeight=o}else if(e.isTotal){e.fontWeight=l}}else{if(e.catWithoutTotal){e.fontWeight=s}}}function calcDimensionWidthPerLevel(e,t,i){var a=t[0].getPainter();var n=i%y;var r=e.id.split(".");var o=r[r.length-2]+"."+r[r.length-1];if(C[o]===undefined){C[o]=0}if(e.instanceOf==="LabelModel"&&!e.hideLabel){var l=e.fontWeight+" "+e.fontSize+"px '"+e.font+"'";e.dimension=a.measureTextDim(e.text,l);if(e.dimension.width!==0&&e.hierarchyLvl!=undefined){e.dimension.width+=e.hierarchyLvl*I}var s=n===y-1?L:D;C[o]=Math.max(C[o],e.dimension.width+s)}}function hideFreeAxisDimensionLabels(){for(var e=0;e<A.children.length;e++){var t=A.children[e];for(var i=0;i<g.length;i++){if(g[i].dataId_dim===t.dataId_dim&&g[i].value<0){t.hideLabel=true;var a=Mt["b"].Layout.Common.getHighlight(m,t,Mt["b"].Utils.Constants.TypeValues.highlightType.CATEGORY_LABEL,true);if(a&&a.highlight){a.highlight.active=false}t.dimension.width=0}}}}this.getPreferredLayoutSize=function(e,t){return{height:0,width:0}}};Mt["b"].Layout=Mt["b"].Layout||{};Mt["b"].Layout.Grid=Mt["b"].Layout.Grid||{};Mt["b"].Layout.Grid.UrlLayout=function(){var e="url";var r={height:0,width:0};this.getType=function(){return e};this.layoutPanels=function(e,t,i,a){var n={};if(e.length===0){return n}var r=e[0].getController().getRootModel();var o=a.getModel();var l=o.extendedModel;if(r.buildUp===Mt["b"].Utils.Constants.BuildUp.PREINIT){var s=Mt["b"].DataObjects.RuntimeDO.getUser().permissions.indexOf("Designer")===-1;var d=o.border.left.width+o.padding.left;var c=o.border.right.width+o.padding.right;var u=o.border.top.width+o.padding.top;var p=o.border.bottom.width+o.padding.bottom;var g=i.width-d-c;var h=i.height-u-p;var f=s?0:Math.min(16,i.height);var m=l.dimension.height;var v=m===null||m<h?h:m;var b=l.dimension.width;var T=b===null||b<g?g:b;var x=16;var E=e[0];var y=E.getModel();delete y.nestedContainerId;E.setPosition({x:0,y:0});E.setDimension({height:f,width:T});if(s||g<x||h<x){delete y.image1;delete y.image2}else if(g<32){y.image1=pe["a"].imgPath+"mouse_left_click_small.png";y.image1Dim={height:x,width:x};y.image1Pos={x:Math.min(10,g-x),y:0};delete y.image2}else{y.image1=pe["a"].imgPath+"mouse_left_click_small.png";y.image2=pe["a"].imgPath+"mouse_right_click_small.png";y.image1Dim={height:x,width:x};y.image2Dim={height:x,width:x};var C=g-32;var S=Math.min(10,Math.floor(C/2));y.image1Pos={x:S,y:0};y.image2Pos={x:S+x+S,y:0}}y.dynamicOpacity=true;E=e[1];y=E.getModel();delete y.nestedContainerId;E.setPosition({x:0,y:0});E.setDimension({height:v,width:T});if(d+c+u+p>0){var M=Mt["b"].Utils.Constants.Parameters.idContainerContent+"."+o.id;o.scrollingData={realHeight:i.height,realWidth:i.width,height:i.height,width:i.width,scrollingVer:false,scrollingHor:false,x:t.x,y:t.y,children:{},id:o.id};o.scrollingData.children[M]={realHeight:v,realWidth:T,height:h,width:g,scrollingVer:!o.disableScrolling&&v>h,scrollingHor:!o.disableScrolling&&T>g,x:d,y:u,id:M,svgContainerHeight:f};e[0].getModel().nestedContainerId=M;e[1].getModel().nestedContainerId=M}else{o.scrollingData={realHeight:v,realWidth:T,width:i.width,height:i.height,scrollingVer:!o.disableScrolling&&v>i.height,scrollingHor:!o.disableScrolling&&T>i.width,x:t.x,y:t.y,id:o.id,svgContainerHeight:f}}}for(var O=0;O<e.length;O++){n[e[O].getId()]=e[O]}return n};this.getPreferredLayoutSize=function(e,t,i){var a=i.getModel();var n=a.extendedModel;r.height=n.dimension.height?n.dimension.height:0;r.width=n.dimension.width?n.dimension.width:0;return r}};var M=i(331);Mt["b"].Layout=Mt["b"].Layout||{};Mt["b"].Layout.Multiple=Mt["b"].Layout.Multiple||{};Mt["b"].Layout.Multiple.MultipleHelperCommon={disperseFreeCellsForTime:function(e){for(var t=e.cells.length-1;t>=0;t--){var i=e.cells[t];if(i.state===0){var a=1;var n=t-e.columns;var r=e.cells[n];while(n>=0&&r.state!==2){a++;n-=e.columns;r=e.cells[n]}if(n>=0){r.span=a+1;i.state=1;i.ownerIndex=n;for(var o=1;o<a;o++){var l=e.cells[t-o*e.columns];l.state=1;l.ownerIndex=n}}}}},disperseFreeCellsForStructure:function(e){for(var t=e.cells.length-1;t>=0;t--){var i=e.cells[t];if(i.state===0){var a=Math.floor(t/e.columns)*e.columns;var n=1;var r=t-1;var o=e.cells[r];while(r>=a&&o.state!==2){n++;o=e.cells[--r]}if(r>=a){o.span=n+1;i.state=1;i.ownerIndex=r;for(var l=1;l<n;l++){var s=e.cells[t-l];s.state=1;s.ownerIndex=r}}}}},createTemporaryChartContainer:function(e,t,i,a){var n,r;if(e.instanceOf==="ChartModel"){n="structure";r=Mt["b"].Factories.ModelFactory.rebuildChart}else if(e.instanceOf==="TimeChartModel"){n="time";r=Mt["b"].Factories.ModelFactory.rebuildTimeChart}else if(e.instanceOf==="TableModel"){n="table";r=Mt["b"].Factories.ModelFactory.rebuildTable}var o=new M["a"];o.extendedModel=JSON.parse(JSON.stringify(e));o.layoutType=n;o.id="chart22";o.extendedModel.id="chartdata22";o.multiplePath=t;o.isMultipleTotal=i;var l={firstObjectGrid:{children:[o],instanceOf:"ContainerModel",extendedModel:{}},rootContainerModel:null,linkGroups:{}};l.rootContainerModel=l.firstObjectGrid;r(l,o,undefined);return o},getComparesOfChart:function(e,t,i,a,n){var r=e[e.activeElementType+"DataStorage"];if(r!==undefined&&r[t]){var o=r[t].chartCompares.nodes;if(o&&o[i]&&o[i][a]){return o[i][a].slice(0)}}return[]},getStructureCompareHeights:function(e,t){var i=Mt["b"].Utils.Calculator.Converter.pt2pix(t);var a=Mt["b"].Utils.Constants.Parameters.textLineSpacing;var n=Math.max(e.dimension.height,e.compareConnectorSize);var r={start:0,mid:0,end:0,auto:0,none:0};r[e.absolute.legend]++;r[e.percent.legend]++;r[e.text.legend]+=e.text.text.split("\n").length;var o=r.start?(i+a)*r.start:0;var l=r.mid?(i+a)*r.mid-a:0;var s=r.end?(i+a)*r.end:0;if(r.auto&&(o||!s)){o+=(i+a)*r.auto}else{s+=(i+a)*r.auto}var d=o&&s?o+Math.max(l,n)+s:o+l+s;return{start:o,mid:l,end:s,cmpDim:n,textSize:d,ellipseTextSize:d}},getTimeCompareWidths:function(e,t){var i=Mt["b"].DataObjects.DocumentDO.getPainter();var a=Mt["b"].Utils.Calculator.Converter.pt2pix(t);var n=e.font.fWeight+" "+a+"px '"+e.font.fType+"'";var r=Math.max(e.dimension.width,e.compareConnectorSize);var o={start:0,mid:0,end:0,auto:0};if(e.absolute.legend!=="none"){o[e.absolute.legend]=i.measureTextDim(e.absolute.text,n).width}if(e.percent.legend!=="none"){o[e.percent.legend]=Math.max(o[e.percent.legend],i.measureTextDim(e.percent.text,n).width)}if(e.text.legend!=="none"){var l=e.text.originalText?e.text.originalText:e.text.text;o[e.text.legend]=Math.max(o[e.text.legend],i.measureTextDim(l,n).width)}if(o.start!==0){o.start+=Math.round(e.compareConnectorSize/2)}if(o.end!==0){o.end+=Math.round(e.compareConnectorSize/2)}if(o.auto&&(o.start||!o.end)){o.start+=o.auto}else{o.end+=o.auto}var s=o.end?o.end:o.mid?o.mid:0;var d;if(o.start&&o.end){d=Math.max(o.mid,o.start+o.end)}else if(o.start||o.end){d=Math.round(o.mid/2+Math.max(o.mid/2,o.start+o.end))}else{d=o.mid}return{start:o.start,mid:o.mid,end:o.end,cmpDim:r,textSize:d,ellipseTextSize:s}},getCompareStartPosition:function(e,t,i,a,n,r,o,l){var s={type:null,categoryNumber:null};if(e.compareLegend==="start"||e.compareLegend==="end"){s.type=e.compareLegend}else{var d=e.compareLegend==="from"&&e.compareFromCat!=="axis"||e.compareToCat==="axis"?"From":"To";var c=e["compare"+d];var u=0;if(o||l){for(var p=0;p<n.children.length;p+=r,u++){if(n.children[p].dataId_dim===c.dataId_dim){break}}}else{}var g="mid";if(o){var h={0:"startStart",1:"midStart",2:"start",3:"mid",4:"end",5:"midEnd",6:"endEnd"};g=h[c.labelPosition.substr(17)]}else if(l){var h={0:"startStart",1:"midStart",2:"start",3:"mid",4:"end",5:"midEnd",6:"endEnd"};g=h[c.positioning.substr(22)]}s.type="rep";s.categoryNumber=u;s.position=g}return s},getCompareAreas:function(e,t,i,a,n,r,o,l,s,d){var c=Mt["b"].DataObjects.RuntimeDO;var u,p;var g=e.ellipse?Math.round((t.ellipseTextSize*o-t.ellipseTextSize)/2)+l:0;var h=Math.max(t.textSize+g,t.cmpDim);var f=t.start+Math.round(Math.max(t.mid,t.cmpDim)/2);var m=t.end||t.mid?Math.round(Math.max(t.mid,t.cmpDim)/2)+t.end+g:0;var v=Math.max(m,Math.round(t.cmpDim/2));var h=f+v;if(a.type==="start"){u=h-r;p=h+r-i}else if(a.type==="end"){u=-r-i;p=h+r}else{var b=n.categorySize+n.categoryDistance+n.categoryDistance;var T=a.categoryNumber*b+n.categoryDistance+d[a.categoryNumber]+r;switch(a.position){case"start":T+=n.startOffset;break;case"mid":T+=n.midOffset;break;case"end":T+=n.endOffset;break;case"startStart":T+=n.startOffset-Mt["b"].Utils.Calculator.Converter.mm2pix(c.getParameterParsed(s)*.8);break;case"midStart":T+=n.midOffset-Mt["b"].Utils.Calculator.Converter.mm2pix(c.getParameterParsed(s)*.8);break;case"midEnd":T+=n.midOffset+Mt["b"].Utils.Calculator.Converter.mm2pix(c.getParameterParsed(s)*.8);break;case"endEnd":T+=n.endOffset+Mt["b"].Utils.Calculator.Converter.mm2pix(c.getParameterParsed(s)*.8);break}u=f-T;p=v+T-i}return{start:u,end:p}},getComparesAreas:function(e,t,i,a,n,r,o,l,s){var d=Mt["b"].DataObjects.RuntimeDO;var c=Mt["b"].Utils.Calculator.Converter;var u=e.fontSize;function convertNMParameter(e){var e=d.getParameterParsed(e);var t=c.mm2pix(u*e);return e!==0?Math.max(1,t):t}function mm2pix(e){return c.mm2pix(u*e)}var p=t.extendedModel;var g=null;for(var h=0;h<t.children.length;h++){if(t.children[h].instanceOf==="ContainerModel"){g=t.children[1];break}}var f=0,m=0;var v,b,T,x;var E;var y;if(l){E=g.layoutData[0];y=g.children.length/g.layoutData[0];v="x";b=d.getParameterParsed("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH")*2;x=Mt["b"].Layout.Multiple.MultipleHelperCommon.getTimeCompareWidths;T="MMPT_TIME_COLUMN_WIDTH"}else if(s){E=g.layoutData[1];y=g.children.length/g.layoutData[1];v="y";b=d.getParameterParsed("FACTOR_HIGHLIGHT_ELLIPSE_HEIGHT");x=Mt["b"].Layout.Multiple.MultipleHelperCommon.getStructureCompareHeights;T="MMPT_STRUCTURE_BAR_HEIGHT"}else{v="y";b=d.getParameterParsed("FACTOR_HIGHLIGHT_ELLIPSE_HEIGHT");x=Mt["b"].Layout.Multiple.MultipleHelperCommon.getStructureCompareHeights;T="MMPT_TABLE_ELEMENT_BAR_HEIGHT"}var C=y*(n.categorySize+n.categoryDistance+n.categoryDistance);var S=convertNMParameter("MMPT_HIGHLIGHT_ELLIPSE_STROKE_WIDTH");for(var h=0;h<a.length;h++){var M=a[h];if(M.compareFromCat==="axis"&&M.compareToCat==="axis"){continue}var O=Mt["b"].Layout.Common.getCompareToAndFrom(M,t,o,undefined);M.compareFrom=O.compareFrom;M.compareTo=O.compareTo;if(M.compareFrom===null||M.compareTo===null){M.compareFrom=null;M.compareTo=null;continue}Mt["b"].Models.Actions.ViewModelActions.CompareModel.setText(M,r,t);if(!o.setupCompareFormulas(M,i,t.isMultipleTotal)){M.compareFrom=null;M.compareTo=null;continue}Mt["b"].Layout.Common.setCompareBasicMetaInformation(M,!l,u,convertNMParameter,mm2pix);var A=x(M,e.fontSize);var _=Mt["b"].Layout.Multiple.MultipleHelperCommon.getCompareStartPosition(M,r,i,t,g,E,l,s);var L=Mt["b"].Layout.Multiple.MultipleHelperCommon.getCompareAreas(M,A,C,_,n,M.offset[v],b,S,T,p.dimensionLabelModel.emptyBefore);f=Math.max(f,L.start);m=Math.max(m,L.end);M.compareFrom=null;M.compareTo=null}return{start:f,end:m}}};Mt["b"].Layout=Mt["b"].Layout||{};Mt["b"].Layout.Multiple=Mt["b"].Layout.Multiple||{};Mt["b"].Layout.Multiple.MultipleHelperFixed={calculateFixedStructure:function(e,t,i){},calculateStructure:function(e,t,i,a,n){}};Mt["b"].Layout=Mt["b"].Layout||{};Mt["b"].Layout.Multiple=Mt["b"].Layout.Multiple||{};Mt["b"].Layout.Multiple.MultipleHelperFlexible={createInitialCellsData:function(e,t,i,a){var n={};var r=e[e.activeElementType+"Elements"];for(var o=0;o<t.length;o++){var l=t[o];if(l.ref.hide){continue}var s=0,d=0,c=[],u=[],p=[];var g=Mt["b"].Models.Actions.ExtendedModelActions.MultipleContainerModel.getActiveCase(e,l.path,l.ref.isSum);if(g!==null){var h=r[g].nodes;c=new Array(h.length);u=new Array(h.length);p=new Array(h.length);for(var f=0;f<h.length;f++){var m=h[f].nodes;var v=Mt["b"].Models.Actions.ViewModelActions.ContainerModel.getActiveChartIndex({charts:m});u[f]=v;var b=null,T=null;if(v!==-1){b=Mt["b"].Layout.Multiple.MultipleHelperCommon.createTemporaryChartContainer(m[v].model,l.path,l.ref.isSum);T=Mt["b"].DataObjects.ContextRepo.getContextByCid(b.extendedModel.contextId)}c[f]=b;var x=T?parseFloat(Mt["b"].DataObjects.RuntimeDO.getParameter(Mt["b"].Models.Actions.ModelActions.ContextModel.getTimeFactor(T))):Number.NaN;p[f]=isNaN(x)?1:x}d=Mt["b"].Layout.Multiple.MultipleHelperFlexible.getGridValueSize(e,c,u,l.path,l.ref.isSum,i,a)}n[l.path]={caseIdx:g,grid:c,gridData:u,valueSize:d,categorySize:s,timeFactors:p,isTotal:l.ref.isSum}}return n},getGridValueSize:function(e,t,i,a,n,r,o){var l=0;var s,d,c;if(r){s=e.timeCellValueCount;d=e.timeCellCategoryCount;c=function(e,t){return e*d+t}}else if(o){s=e.structureCellValueCount;d=e.structureCellCategoryCount;c=function(e,t){return t*s+e}}if(o||r){for(var u=0;u<s;u++){var p=0;for(var g=0;g<d;g++){var h=c(u,g);var f=Mt["b"].Layout.Multiple.MultipleHelperFlexible.getChartMinMaxValues(t[h],a,n);p=Math.max(p,f.max-f.min);i[h]={maxValue:f.max,maxLabel:f.maxLabel,minValue:f.min,minLabel:f.minLabel,maxValValue:f.maxVal,maxValLabel:f.maxValLabel,minValValue:f.minVal,minValLabel:f.minValLabel,hasPositive:f.hasPositive,hasNegative:f.hasNegative,chartIdx:i[h]}}l+=p}}else{}return l},getChartMinMaxValues:function(e,t,i){if(e===null){return{max:0,min:0,maxLabel:"",minLabel:"",hasPositive:false,hasNegative:false,maxVal:0,maxValLabel:"",minVal:0,minValLabel:""}}var a=0,n=0;var r="",o="";var l=0,s=0;var d="",c="";var u=false,p=false;function updateValues(e,t,i){if(a<e){a=e;r=i.hideLabel?"":i.text;u=true}else if(n>e){n=e;o=i.hideLabel?"":i.text;p=true}if(e>0&&t<0){p=true}if(e<0&&t>0){u=true}}for(var g=0;g<e.children.length;g++){var h=e.children[g];if(h.isNaN!==false||h.valueType==undefined||h.valueType==="FACTOR_NONE"){continue}var f=e.children[g+1];if(h.instanceOf==="BarModel"||h.instanceOf==="TimeColumnModel"||h.instanceOf==="NeedleModel"||h.instanceOf==="RodModel"||h.instanceOf==="StructureLineModel"||h.instanceOf==="TimeLineModel"){updateValues(h.value+h.referencePointerSum,h.value,f)}else if(h.instanceOf==="StructureWaterfallModel"||h.instanceOf==="TimeWaterfallModel"){updateValues(h.relativeValue+h.referencePointerSum,h.value,f)}else if(h.instanceOf==="ValueModel"){if(l<h.value){l=h.value;d=f.hideLabel?"":f.text;u=true}else if(s>h.value){s=h.value;c=f.hideLabel?"":f.text;p=true}}}u=u||!u&&!p;return{max:a,min:n,maxLabel:r,minLabel:o,hasPositive:u,hasNegative:p,maxVal:l,maxValLabel:d,minVal:s,minValLabel:c}},getAdditionalValueSize:function(e,m,v,t){var i=0;var a=Mt["b"].Utils.Calculator.Converter;var n=Mt["b"].DataObjects.RuntimeDO;var b=Mt["b"].DataObjects.DocumentDO.getPainter();var g=a.pt2pix(e.fontSize);var T="normal "+g+"px '"+n.getParameter("FONT_FAMILY")+"'";var h,f,x,E;var y,C,S,M;if(t){h=a.mm2pix(e.fontSize*n.getParameter("MMPT_TIME_LABEL_ELEMENT_DISTANCE"));f=a.mm2pix(e.fontSize*n.getParameter("MMPT_TIME_CATEGORY_LABEL_AXIS_DISTANCE"));x=a.mm2pix(e.fontSize*n.getParameter("MMPT_TIME_CATEGORY_LABEL_SIGN_DISTANCE"));E=a.mm2pix(e.fontSize*n.getParameter("MMPT_TIME_VALUE_LABEL_PADDING_TOP"))}else{y=a.mm2pix(e.fontSize*n.getParameter("MMPT_STRUCTURE_VALUE_LABEL_ELEMENT_DISTANCE"));C=a.mm2pix(e.fontSize*n.getParameter("MMPT_STRUCTURE_CATEGORY_LABEL_AXIS_DISTANCE"));S=a.mm2pix(e.fontSize*n.getParameter("MMPT_STRUCTURE_CATEGORY_LABEL_SIGN_DISTANCE"));M=a.mm2pix(e.fontSize*n.getParameter("MMPT_STRUCTURE_HIERARCHY_OFFSET"));E=a.mm2pix(e.fontSize*n.getParameter("MMPT_STRUCTURE_CELL_PADDING_SIDE"))}function getAdditionalSizeStructure(e,t,i,a,n){var r=e.extendedModel;var o={size:0,categoryLabels:0,valueLabelsNeg:0,valueLabelsPos:0};var l=Mt["b"].DataObjects.ContextRepo.getContextByCid(r.contextId);if(l===null){return o}if(r.dimensionLabelModel.displayType===Mt["b"].Utils.Constants.TypeValues.categoryLabel.AXIS||t===0&&r.dimensionLabelModel.displayType===Mt["b"].Utils.Constants.TypeValues.categoryLabel.FREE_AXIS_POS){var s=Mt["b"].Models.Actions.DataModelActions.getDimensionTreeByPath(l.dataModel,v,m.isTotal);var d=s.ref;var c=s.pathLength;var u=l.dataModel.dimSize-c;var p=new Array(u);for(var g=0;g<u;g++){p[g]={width:0,hier:l.rows[g+c].additionsHierarchy}}if(d!==null){processNodes(d.nodes,0);var h=0;for(var g=0;g<p.length;g++){if(p[g].hier){var f=p[g].width;o.categoryLabels=Math.max(o.categoryLabels,h+f);h+=M}else{var f=p[g].width+S;o.categoryLabels=Math.max(o.categoryLabels,h+f);h+=f}}o.categoryLabels+=C-S}}for(var g=0;g<r.expressions.length;g++){if(r.expressions[g].valueLabelOpt[0]!=="-"){if(t<0){o.valueLabelsNeg+=y+b.measureTextDim(a,T).width}if(i>=0&&n!==""){o.valueLabelsPos+=y+b.measureTextDim(n,T).width}break}}o.size=o.categoryLabels+o.valueLabelsNeg+o.valueLabelsPos+E+E;return o;function processNodes(e,t){for(var i=0;i<e.length;i++){var a=e[i];var n=a.value.split("\n").reduce(function(e,t){return Math.max(b.measureTextDim(t,T).width,e)},0);p[t].width=Math.max(p[t].width,n);if(t<u-1){processNodes(a.nodes,t+1)}}}}function getAdditionalSizeTime(e,t,i){var a=e.extendedModel;var n={size:0,categoryLabels:0,valueLabelsNeg:0,valueLabelsPos:0};var r=Mt["b"].DataObjects.ContextRepo.getContextByCid(a.contextId);if(r===null){return n}if(a.dimensionLabelModel.displayType===Mt["b"].Utils.Constants.TypeValues.categoryLabel.AXIS||!t&&a.dimensionLabelModel.displayType===Mt["b"].Utils.Constants.TypeValues.categoryLabel.FREE_AXIS_POS){var o=Mt["b"].Models.Actions.DataModelActions.getDimensionTreeByPath(r.dataModel,v,m.isTotal);var l=o.ref;var s=o.pathLength;var d=r.dataModel.dimSize-s;var c=new Array(d);for(var u=0;u<d;u++){c[u]=0}if(l!==null){processNodes(l.nodes,0);n.categoryLabels=f+(c.length-1)*x;for(var u=0;u<d;u++){n.categoryLabels+=c[u]*g+(c[u]-1)*Mt["b"].Utils.Constants.Parameters.textLineSpacing}}}for(var u=0;u<a.expressions.length;u++){var p=a.expressions[u];if(p.valueLabelOpt[0]!=="-"){n.valueLabelsNeg=t?g+h:0;n.valueLabelsPos=i?g+h:0;break}}n.size=n.categoryLabels+n.valueLabelsNeg+n.valueLabelsPos+E+E;return n;function processNodes(e,t){for(var i=0;i<e.length;i++){var a=e[i];var n=a.value.split("\n").length;c[t]=Math.max(c[t],n);if(t<d-1){processNodes(a.nodes,t+1)}}}}function copyToGridData(e,t){e.categoryLabelsSize=t.categoryLabels;e.valueLabelsNegSize=t.valueLabelsNeg;e.valueLabelsPosSize=t.valueLabelsPos}if(t){if(e.valueLinking){for(var r=0;r<e.timeCellCategoryCount;r++){var o=0;for(var l=0;l<e.timeCellValueCount;l++){var s=l*e.timeCellCategoryCount+r;var d=m.grid[s];if(d===null){continue}var c=m.gridData[s];var u=getAdditionalSizeTime(d,c.hasNegative,c.hasPositive);o+=u.size;copyToGridData(c,u)}i=Math.max(i,o)}}else{for(var l=0;l<e.timeCellValueCount;l++){var p=0;for(var r=0;r<e.timeCellCategoryCount;r++){var s=l*e.timeCellCategoryCount+r;var d=m.grid[s];if(d===null){continue}var c=m.gridData[s];var u=getAdditionalSizeTime(d,c.hasNegative,c.hasPositive);p=Math.max(p,u.size);copyToGridData(c,u)}i+=p}}i+=m.titleDim.height}else{if(e.valueLinking){for(var l=0;l<e.structureCellCategoryCount;l++){var p=0;for(var r=0;r<e.structureCellValueCount;r++){var s=l*e.structureCellValueCount+r;var d=m.grid[s];if(d===null){continue}var c=m.gridData[s];var O=getMinMaxValues(c);var u=getAdditionalSizeStructure(d,O.minValue,O.maxValue,O.minLabel,O.maxLabel);p+=u.size;copyToGridData(c,u)}i=Math.max(i,p)}}else{for(var r=0;r<e.structureCellValueCount;r++){var o=0;for(var l=0;l<e.structureCellCategoryCount;l++){var s=l*e.structureCellValueCount+r;var d=m.grid[s];if(d===null){continue}var c=m.gridData[s];var O=getMinMaxValues(c);var u=getAdditionalSizeStructure(d,O.minValue,O.maxValue,O.minLabel,O.maxLabel);o=Math.max(o,u.size);copyToGridData(c,u)}i+=o}}}return i;function getMinMaxValues(e){var t={minValue:null,minLabel:null,maxValue:null,maxLabel:null};if(e.maxValue===0&&e.maxValValue!==0){t.maxValue=e.maxValValue;t.maxLabel=e.maxValLabel}else{t.maxValue=e.maxValue;t.maxLabel=e.maxLabel}if(e.minValue===0&&e.minValValue!==0){t.minValue=e.minValValue;t.minLabel=e.minValLabel}else{t.minValue=e.minValue;t.minLabel=e.minLabel}return t}},fillMultipleStructure:function(e,t,i){for(var a=0;a<e.cells.length;a++){var n=e.cells[a];if(n.path!==null){var r=t[n.path];n.grid=r.grid;n.gridData=r.gridData;n.valueSize=r.valueSize;n.fixedValueSize=Mt["b"].Layout.Multiple.MultipleHelperFlexible.getAdditionalValueSize(e,r,n.path,i);n.state=2;n.caseIdx=r.caseIdx;n.titleDim=r.titleDim;n.isTotal=r.isTotal}else{n.state=0}n.span=1}},adjustMultipleCellsForTime:function(s,e){var d;var t=s.cells,i=s.cells;var a=true;var r=Math.round(e/s.rows);function getHighestPriorityCellIdx(){var e=null,t=null;for(var i=0;i<s.cells.length;i++){var a=s.cells[i];var n=a.valueSize/(a.span*r-a.fixedValueSize);n=isNaN(n)?a.valueSize:n;if(a.span<s.rows&&a.valueSize!==0&&(e===null||n>t)){e=i;t=n}}return e}function getNextFreeCell(){for(var e=0;e<s.cells.length;e++){if(s.cells[e].state===0){return e}}}function getFreeCount(){var e=0;for(var t=0;t<s.cells.length;t++){if(s.cells[t].state===1){s.cells[t].state=0}if(s.cells[t].state===0){e++}}return e}function positionNext(e,t,i){var a=null;for(var n=t;n<e.length;n++){if(Math.floor(n/s.columns)+i.span>s.rows){break}var r=e[n]===undefined&&d>=i.span-1;if(r){for(var o=1;o<i.span;o++){if(e[n+o*s.columns]!==undefined){r=false;break}}}if(r){e[n]=i;for(var o=1;o<i.span;o++){var l=s.cells[getNextFreeCell()];l.state=1;e[n+o*s.columns]=l;d--}a=n;break}}return a}do{a=true;d=getFreeCount();if(d===0){break}var n=getHighestPriorityCellIdx();if(n===null){i=t;break}else{n=s.cells[n]}n.span++;t=new Array(s.cells.length);var o=0;var l=[];for(var c=0;c<s.cells.length;c++){var u=s.cells[c];if(u.state===0){l.push(u);continue}else if(u.state===1){continue}else{o=positionNext(t,o,u);if(o===null){a=false;break}else{o++}}}if(a){for(var c=0;c<l.length;c++){if(l[c].state===0){while(t[o]!==undefined){o++}t[o]=l[c]}}i=t}else{n.span--}}while(a);s.cells=i;for(c=0;c<s.cells.length;c++){var u=s.cells[c];u.state=u.state===2?2:0}Mt["b"].Layout.Multiple.MultipleHelperCommon.disperseFreeCellsForTime(s)},adjustMultipleCellsForStructure:function(r,e){var o=Math.round(e/r.columns);function getHighestPriorityCellIdx(){var e=null,t=null;for(var i=0;i<r.cells.length;i++){var a=r.cells[i];var n=a.valueSize/(a.span*o-a.fixedValueSize);n=isNaN(n)?a.valueSize:n;if(a.span<r.columns&&a.valueSize!==0&&(e===null||n>t)){e=i;t=n}}return e}function getNextFreeCell(){for(var e=0;e<r.cells.length;e++){if(r.cells[e].state===0){return e}}}function getFreeCount(){var e=0;for(var t=0;t<r.cells.length;t++){var i=r.cells[t];if(i.state===1){i.state=0}if(i.state===0){e++}}return e}var t=r.cells,i=r.cells;var a=true;do{a=true;var n=getFreeCount();if(n===0){break}var l=getHighestPriorityCellIdx();if(l===null){i=t;break}else{l=r.cells[l]}l.span++;t=new Array(r.cells.length);var s=0;var d=[];for(var c=0;c<r.cells.length;c++){var u=r.cells[c];if(u.state===0){d.push(u);continue}else if(u.state===1){continue}var p=s%r.columns;if(u.span===1){t[s++]=u}else{if(p+u.span>r.columns){var g=r.columns-p;for(var h=0;h<g;h++){if(n>0){t[s]=r.cells[getNextFreeCell()];t[s].state=1;s++;n--}else{a=false;break}}}t[s++]=u;for(var h=1;h<u.span;h++){if(n>0){t[s]=r.cells[getNextFreeCell()];t[s].state=1;s++;n--}else{a=false;break}}}if(!a){break}}if(a){for(var c=0;c<d.length;c++){if(d[c].state===0){t[s++]=d[c]}}i=t}else{l.span--}}while(a);r.cells=i;for(c=0;c<r.cells.length;c++){var u=r.cells[c];u.state=u.state===2?2:0}Mt["b"].Layout.Multiple.MultipleHelperCommon.disperseFreeCellsForStructure(r)},createMultipleCellsList:function(e,t,i){var a=[];for(var n=0;n<e.cells.length;n++){var r=e.cells[n];if(r.path!==null){var o=t[r.path];var l=Mt["b"].Layout.Multiple.MultipleHelperFlexible.getAdditionalValueSize(e,o,r.path,i);a.push({path:r.path,grid:o.grid,gridData:o.gridData,state:2,caseIdx:o.caseIdx,span:1,valueSize:o.valueSize,fixedValueSize:l,categorySize:o.categorySize,titleDim:o.titleDim,isTotal:o.isTotal})}}return a},assignFreeMultipleCells:function(l,s,e,t,d){var r=d?l.rows:l.columns;var i=0;var o=Math.round(t/r);function getHighestPriorityCell(){var e=null,t=null;for(var i=0;i<s.length;i++){var a=s[i];var n=a.valueSize/(a.span*o-a.fixedValueSize);n=isNaN(n)?a.valueSize:n;if(a.span<r&&a.valueSize!==0&&(e===null||n>t)){e=i;t=n}}return e}function checkLayout(){var e=s.slice(0);e.sort(function(e,t){return t.span-e.span});var a=new Array(l.cells.length);var n=d?l.rows:l.columns;function getNextPos(e){for(var t=0;t<a.length;t++){var i=a[t];if(i===undefined&&t%n+e<=n){return t}}return null}for(var t=0;t<e.length;t++){var i=e[t];var r=getNextPos(i.span);if(r===null){return false}else{for(var o=0;o<i.span;o++){a[r+o]=1}}}return true}for(var a=0;a<l.cells.length;a++){if(l.cells[a].path===null){var n=getHighestPriorityCell();if(n===null){break}s[n].span++;if(!checkLayout()){s[n].span--;break}i++;if(i>=e){break}}}return i},optimizeMultipleCellsOrder:function(e,t,i){var l=t.slice(0);l.sort(function(e,t){return t.valueSize/t.span-e.valueSize/e.span});var a=null;var n=false;var r,o;if(i){r=e.rows;o=e.columns}else{r=e.columns;o=e.rows}var c=new Array(o);for(var s=0;s<o;s++){c[s]=new Array(r)}for(var s=0;s<5;s++){buildGrid();if(n){return n}var d=getColumnWidths();if(a===null||a>d[d.length-1]){a=d[d.length-1]}var u=getMoveIndicies(d);var p=u.moveUps;var g=u.moveDowns;for(var h=0;h<p.length;h++){var f=p[h];var m=l[f];l[f]=l[f-1];l[f-1]=m}for(var h=0;h<g.length;h++){var v=g[h];if(v!==l.length-1){var m=l[v];l[v]=l[v+1];l[v+1]=m}}}var b=new Array(o);for(var s=0;s<o;s++){b[s]=new Array(r)}for(var h=0;h<c[0].length;h++){var T=[];for(var s=0;s<c.length;s++){if(c[s][h]){T.push(c[s][h])}}T.sort(function(e,t){return e.categorySize-t.categorySize});var x=0;for(var s=0;s<T.length;s++){while(b[x][h]!==undefined){x++}b[x][h]=T[s];for(var E=1;E<T[s].span;E++){b[x][h+E]=0}}}if(i){var y=0;for(var h=0;h<b[0].length;h++){for(var s=0;s<b.length;s++){var C=b[s][h];if(C){e.cells[y++]=C}else{var S=h-1;var M=b[s][S];for(;S>=0&&!M;S--,M=b[s][S]){}var O=S*b.length+s;e.cells[y++]={state:1,path:null,ownerIndex:O}}}}}else{var y=0;var O=0;for(var s=0;s<b.length;s++){var A=b[s];for(var h=0;h<A.length;h++){var C=A[h];if(C){O=y;e.cells[y++]=C}else{e.cells[y++]={state:1,path:null,ownerIndex:O}}}}}return n;function buildGrid(){var e=tryBuildGrid();var t=100;while(e!==null){if(t<=0){n=true;return}if(e===0){var i=l[0];l[0]=l[1];l[1]=i}else{var a=e-1;if(l[e].span>1){while(a>0&&l[a].span>=l[e].span){a--}}var i=l[e];l[e]=l[a];l[a]=i}e=tryBuildGrid();t--}}function tryBuildGrid(){var e=null;for(var t=0;t<c.length;t++){var i=c[t];for(var a=0;a<i.length;a++){i[a]=undefined}}for(var t=0;t<l.length;t++){var n=l[t];var r=getNextPositionForLength(n.span);if(r===null){e=t}else{n.sourceIndex=t;c[r.row][r.col]=n;for(var o=1;o<n.span;o++){c[r.row][r.col+o]=0}}}return e}function getNextPositionForLength(e){var t=null;var i=c[0].length;for(var a=0;a<i;a++){for(var n=0;n<c.length;n++){var r=true;for(var o=0;o<e;o++){if(a+o>=i||c[n][a+o]!==undefined){r=false;break}}if(r){t={row:n,col:a};break}}if(t!==null){break}}return t}function getColumnWidths(){var e=0;var t=c[0].length;var i=Mt["b"].Utils.GlobalFunctions.createArray(t,0);for(var a=0;a<t;a++){for(var n=0;n<c.length;n++){var r=c[n][a];if(r&&r.span===1){i[a]=Math.max(i[a],r.valueSize+e)}else if(r===0&&(a+1>=t||c[n][a+1])){var o=a-1;var l=c[n][o];for(;o>=0&&!l;o--,l=c[n][o]){}i[a]=Math.max(i[a],l.valueSize+(o===0?0:i[o-1]))}}e=i[a]}return i}function getMoveIndicies(e){var t=[],i=[];var a=c[0].length;for(var n=0;n<a;n++){for(var r=0;r<c.length;r++){var o=c[r][n];if(o===0&&(n+1>=a||c[r][n+1])){var l=n-1;var s=c[r][l];for(;l>=0&&!s;l--,s=c[r][l]){}var d=l===0?0:e[l-1];if((l!==0||r!==0)&&s.valueSize>=e[n]-d){t.push(s.sourceIndex)}else if(s.valueSize<e[n]-d){i.push(s.sourceIndex)}}}}return{moveUps:t,moveDowns:i}}},getStructureGridCategorySize:function(e,t,i,a,n,r){var o=Mt["b"].DataObjects.RuntimeDO;var l=Mt["b"].Utils.Calculator.Converter;var s=0;var d=t.grid;var c=t.gridData;var u=t.timeFactors;var p=l.pt2pix(r);var g=Mt["b"].Utils.Constants.TypeValues.structurePosition;var h={};h[g.TOP_TOP]="startStart";h[g.TOP]="start";h[g.MID_TOP]="midStart";h[g.MID]="mid";h[g.MID_BOTTOM]="midEnd";h[g.BOTTOM]="end";h[g.BOTTOM_BOTTOM]="endEnd";var f=parseFloat(o.getParameter("MMPT_STRUCTURE_BAR_HEIGHT"));var m=parseFloat(o.getParameter("MMPT_STRUCTURE_SYMBOL_SIZE"));var v=parseFloat(o.getParameter("FACTOR_STRUCTURE_ELEMENT_DISPLACEMENT"));var b=parseFloat(o.getParameter("MMPT_STRUCTURE_CATEGORY_DISTANCE"));var T=l.mm2pix(r*parseFloat(o.getParameter("MMPT_STRUCTURE_HEADER_BAR_HEIGHT")))+l.mm2pix(r*parseFloat(o.getParameter("MMPT_STRUCTURE_HEADER_ELEMENT_DISTANCE")));var x=l.mm2pix(r*parseFloat(o.getParameter("MMPT_STRUCTURE_HEADER_TEXT_SPACE")));var E=l.mm2pix(r*parseFloat(o.getParameter("MMPT_STRUCTURE_LEGEND_ELEMENT_DISTANCE")))+l.mm2pix(r*parseFloat(o.getParameter("MMPT_STRUCTURE_LEGEND_MIN_CONNECTOR_LENGTH")));var y=l.mm2pix(r*parseFloat(o.getParameter("MMPT_STRUCTURE_CELL_PADDING_TOP")));for(var C=0;C<a;C++){var S=[],M=[];var O=0,A=0;var _=false;var L=false,I=false;var D=0,R=0;var P=0;for(var N=0;N<i;N++){var w=C*i+N;var F=d[w];if(!F){continue}S.push(F);M.push(u[w])}var B=Mt["b"].Layout.CategorySizeCalculator.getCategorySizes(S,h,r,f,m,v,b,"structure",n,t.isTotal,M);for(var N=0;N<i;N++){var w=C*i+N;var k=d[w];if(!k){continue}var U=k.extendedModel.contextId;var H=Mt["b"].DataObjects.ContextRepo.getContextByCid(U);var G=new Mt["b"].Utils.Calculator(H);G.setupEmptySpaces(k,e.fontSize,n,t.isTotal);var V=k.extendedModel.dimensionLabelModel;P=Math.max(P,Mt["b"].Models.Actions.ExtendedModelActions.DimensionLabelModel.getEmptySpacesSum(V));for(var $=0;$<F.extendedModel.expressions.length;$++){var z=F.extendedModel.expressions[$];var W=z.name.split("\n").length;var j=z.valueRowLabelPosition.split(".")[1];if(j==="1"||j==="2"||j==="3"){O=Math.max(O,W*p+(W-1)*Mt["b"].Utils.Constants.Parameters.textLineSpacing);L=L||z.connector==="Always"}else if(j==="4"||j==="5"||j==="6"){A=Math.max(A,W*p+(W-1)*Mt["b"].Utils.Constants.Parameters.textLineSpacing);I=I||z.connector==="Always"}_=_||z.notation===Mt["b"].Utils.Constants.TypeValues.notation.HEADER||z.notation===Mt["b"].Utils.Constants.TypeValues.notation.ELEMENT_HEADER}var K=Mt["b"].Layout.Multiple.MultipleHelperCommon.getComparesOfChart(e,n,w,c[w].chartIdx,U);if(K.length>0){var X=Mt["b"].Layout.Multiple.MultipleHelperCommon.getComparesAreas(e,k,n,K,B,H,G,false,true);D=Math.max(D,X.start);R=Math.max(R,X.end)}}A+=I&&A>0?E:0;if(O>0){O+=Math.max(_?T+x:0,L?E:0)}else{O+=_?T:0}O=Math.max(O,D);A=Math.max(A,R);s+=y+O+B.totalLength+P+A}return s},getTimeGridCategorySize:function(e,t,i,a,n,r){var o=Mt["b"].DataObjects.RuntimeDO;var l=Mt["b"].Utils.Calculator.Converter;var s=Mt["b"].DataObjects.DocumentDO.getPainter();var d=0;var c=t.grid;var u=t.gridData;var p=t.timeFactors;var g=l.pt2pix(r);var h="normal "+g+"px '"+o.getParameter("FONT_FAMILY")+"'";var f=Mt["b"].Utils.Constants.TypeValues.timePosition;var m={};m[f.LEFT_LEFT]="startStart";m[f.LEFT]="start";m[f.MID_LEFT]="midStart";m[f.MID]="mid";m[f.MID_RIGHT]="midEnd";m[f.RIGHT]="end";m[f.RIGHT_RIGHT]="endEnd";var v=parseFloat(o.getParameter("MMPT_TIME_COLUMN_WIDTH"));var b=parseFloat(o.getParameter("MMPT_TIME_SYMBOL_SIZE"));var T=parseFloat(o.getParameter("FACTOR_TIME_ELEMENT_DISPLACEMENT"));var x=parseFloat(o.getParameter("MMPT_TIME_CATEGORY_DISTANCE"));var E=l.mm2pix(r*parseFloat(o.getParameter("MMPT_TIME_LEGEND_ELEMENT_DISTANCE")))+l.mm2pix(r*parseFloat(o.getParameter("MMPT_TIME_LEGEND_MIN_CONNECTOR_LENGTH")));var y=l.mm2pix(r*parseFloat(o.getParameter("MMPT_TIME_VALUE_LABEL_PADDING_LEFT")));for(var C=0;C<i;C++){var S=[],M=[];var O=false,A=false;var _=0,L=0,I=0,D=0,R=0,P=0;var N=0;for(var w=0;w<a;w++){var F=w*i+C;var B=c[F];if(!B){continue}S.push(B);M.push(p[F])}var k=Mt["b"].Layout.CategorySizeCalculator.getCategorySizes(S,m,r,v,b,T,x,"time",n,t.isTotal,M);for(var w=0;w<a;w++){var F=w*i+C;var U=c[F];if(!U){continue}var H=U.extendedModel.contextId;var G=Mt["b"].DataObjects.ContextRepo.getContextByCid(H);var V=new Mt["b"].Utils.Calculator(G);var $=U.extendedModel.expressions;V.setupEmptySpaces(U,e.fontSize,n,t.isTotal);var z=U.extendedModel.dimensionLabelModel;N=Math.max(N,Mt["b"].Models.Actions.ExtendedModelActions.DimensionLabelModel.getEmptySpacesSum(z));for(var W=0;W<$.length;W++){var j=$[W];if(j.valueRowLabelPosition.indexOf("Left")!==-1){_=j.name.split("\n").reduce(function(e,t){return Math.max(e,s.measureTextDim(t,h).width)},_);O=O||j.connector==="Always"}else if(j.valueRowLabelPosition.indexOf("Right")!==-1){L=j.name.split("\n").reduce(function(e,t){return Math.max(e,s.measureTextDim(t,h).width)},L);A=A||j.connector==="Always"}}for(var W=0,K=$.length;W<U.children.length&&K>0;W++){var X=U.children[W];if(X.dataId_dim!=null&&X.dataId_expr!=null&&X.instanceOf==="LabelModel"&&X.id.indexOf("representation")>=0){I=Math.max(I,s.measureTextDim(X.text,h).width);K--}}for(var W=U.children.length-1,K=$.length;W>=0&&K>0;W--){var X=U.children[W];if(X.dataId_dim!=null&&X.dataId_expr!=null&&X.instanceOf==="LabelModel"&&X.id.indexOf("representation")>=0){D=Math.max(D,s.measureTextDim(X.text,h).width);K--}}var Y=Mt["b"].Layout.Multiple.MultipleHelperCommon.getComparesOfChart(e,n,F,u[F].chartIdx,H);if(Y.length>0){var Z=Mt["b"].Layout.Multiple.MultipleHelperCommon.getComparesAreas(e,U,n,Y,k,G,V,true,false);R=Math.max(R,Z.start);P=Math.max(P,Z.end)}}_+=O?E:0;L+=A?E:0;var Q=Math.round(I/2-k.categoryDistance-k.categorySize/2);var q=Math.round(D/2-k.categoryDistance-k.categorySize/2);var J=Math.max(_,Q,R);var ee=Math.max(L,q,P);d+=y+J+k.totalLength+N+ee+1}return d},updateCategoryCellSizes:function(e,t,i,a,n,r,o){var l=Mt["b"].Utils.Calculator.Converter;var s=0,d=0;var c=e.dimensions[0].categoryTextBreak;if(e.dimensions[0].categorySize!==null){n=Math.min(n,l.mm2pix(e.fontSize*e.dimensions[0].categorySize))}var u,p,g,h,f;var m=0,v=0,b="top",T="bottom",x="category";var E=Mt["b"].DataObjects.RuntimeDO.getParameterParsed("FONT_SIZE_CHART");if(o){u=Mt["b"].Layout.Multiple.MultipleHelperFlexible.getStructureGridCategorySize;p=e.structureCellValueCount;g=e.structureCellCategoryCount;h=l.mm2pix(E*Mt["b"].DataObjects.RuntimeDO.getParameterParsed("MMPT_MULTIPLE_CASE_TOP_BORDER_SIZE"));f=l.mm2pix(E*Mt["b"].DataObjects.RuntimeDO.getParameterParsed("MMPT_MULTIPLE_CASE_BOTTOM_BORDER_SIZE"));m=l.mm2pix(e.fontSize*Mt["b"].DataObjects.RuntimeDO.getParameterParsed("MMPT_STRUCTURE_CELL_PADDING_TOP"));v=m}else if(r){u=Mt["b"].Layout.Multiple.MultipleHelperFlexible.getTimeGridCategorySize;p=e.timeCellCategoryCount;g=e.timeCellValueCount;h=l.mm2pix(E*Mt["b"].DataObjects.RuntimeDO.getParameterParsed("MMPT_MULTIPLE_CASE_LEFT_BORDER_SIZE"));f=l.mm2pix(E*Mt["b"].DataObjects.RuntimeDO.getParameterParsed("MMPT_MULTIPLE_CASE_RIGHT_BORDER_SIZE"));b="left";T="right";x="value";m=l.mm2pix(e.fontSize*Mt["b"].DataObjects.RuntimeDO.getParameterParsed("MMPT_TIME_VALUE_LABEL_PADDING_TOP"));v=l.mm2pix(e.fontSize*Mt["b"].DataObjects.RuntimeDO.getParameterParsed("MMPT_TIME_VALUE_LABEL_PADDING_LEFT"))}else{u=function(){return 100};p=e.tableCellValueCount;g=e.tableCellCategoryCount;h=l.mm2pix(E*Mt["b"].DataObjects.RuntimeDO.getParameterParsed("MMPT_MULTIPLE_CASE_TOP_BORDER_SIZE"));f=l.mm2pix(E*Mt["b"].DataObjects.RuntimeDO.getParameterParsed("MMPT_MULTIPLE_CASE_BOTTOM_BORDER_SIZE"))}for(var y=0;y<t.length;y++){var C=t[y];var S=i[C.path];if(S.caseIdx!==null){var M=e.cases[S.caseIdx].borders[b].width;var O=e.cases[S.caseIdx].borders[T].width;var A=e.cases[S.caseIdx].titleBold;var _=Mt["b"].Layout.Multiple.MultipleHelperFlexible.getTitleHeight(e.titleFontSize,A,C.path,n,c);S.titleDim={height:_+m,category:0,value:0};S.titleDim[x]=S.titleDim.height;S.categorySize=u(e,S,p,g,C.path,e.fontSize)+(M===null?h:l.mm2pix(E*M))+(O===null?f:l.mm2pix(E*O))+S.titleDim.category+v;s=Math.max(s,S.categorySize);if(r&&d<S.titleDim.height){d=S.titleDim.height}}}return{maxCategorySize:s,maxTitleValueSize:d}},getMultipleCategorySizeSum:function(e,t,i){var a=0;if(i){for(var n=0;n<e.columns;n++){var r=0;for(var o=0;o<e.rows;o++){var l=e.cells[o*e.columns+n];if(l.path!==null){r=Math.max(r,t[l.path].categorySize)}}a+=r}}else{for(var o=0;o<e.rows;o++){var s=0;for(var n=0;n<e.columns;n++){var l=e.cells[o*e.columns+n];if(l.path!==null){s=Math.max(s,t[l.path].categorySize)}}a+=s}}return a},getMinMaxFontSizes:function(e){var t,i;if(e.fontSizeType==="Fix"){i=t=e.inputFontSize===null?parseInt(Mt["b"].DataObjects.RuntimeDO.getParameter("FONT_SIZE_CHART")):e.inputFontSize}else{var a=parseInt(Mt["b"].DataObjects.RuntimeDO.getParameter("FONT_SIZE_CHART"));var n=e.inputFontSize===null?a:e.inputFontSize;t=Math.min(n,a);i=Math.max(n,a)}return{maxFontSize:i,minFontSize:t}},getTotalsSettings:function(e,t,i){var a=t.length;var n=0,r=0;var o=e.dimensions[0];var l=false;if(o.totalsPosition!=="Cell"){for(var s=0;s<t.length;s++){if(t[s].ref.isSum){a--;l=true;break}}if(l){if(o.totalsPosition==="None"){}else{r=1}}}return{cellCount:a,valueCount:n,categoryCount:r}},getTitleHeight:function(e,t,i,a,n){var r=-Mt["b"].Utils.Constants.Parameters.textLineSpacing;var o=Mt["b"].Utils.Calculator.Converter.pt2pix(e);var l=(t?"bold ":"normal ")+o+"px '"+Mt["b"].DataObjects.RuntimeDO.getParameter("FONT_FAMILY")+"'";var s=/\n|<br>|<br \/>|<br\/>/;var d=i.split(s);for(var c=0;c<d.length;c++){var u=1;if(n){var p=Mt["b"].DataObjects.DocumentDO.getPainter().measureTextDim(d[c],l).width;u=Math.ceil(p/a)}r+=(o+Mt["b"].Utils.Constants.Parameters.textLineSpacing)*u}return r},getBiggestTitleHeight:function(e,t,i,a){var n=0;var r=e.dimensions[0].categoryTextBreak;for(var o=0;o<t.length;o++){var l=t[o].path;if(i[l].caseIdx!==null){var s=e.cases[i[l].caseIdx].titleBold;var d=Mt["b"].Layout.Multiple.MultipleHelperFlexible.getTitleHeight(e.titleFontSize,s,l,a,r);n=Math.max(n,d)}}return n},calculateStructure:function(e,t,i){var a={"0000":Mt["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase01,"0010":Mt["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase02,"0001":Mt["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase03,"0011":Mt["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase04,"0100":Mt["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase05,1e3:Mt["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase05,1100:Mt["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase05,"0110":Mt["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase06,1010:Mt["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase06,1110:Mt["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase06,"0101":Mt["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase07,1001:Mt["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase07,1101:Mt["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase07,"0111":Mt["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase08,1011:Mt["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase08,1111:Mt["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase08};var n=e.activeElementType;var r=n==="time";var o=!r&&n==="structure";var l="";l+=e[n+"MultipleCategoryCount"]===null?"0":"1";l+=e[n+"MultipleValueCount"]===null?"0":"1";l+=e[n+"CellCategorySize"]===null?"0":"1";l+=e[n+"CellValueSize"]===null?"0":"1";var s=Mt["b"].Models.Actions.DataModelActions.getMultipleDimensions(t.dataModel,t.dataModel.dimSize-1);var d,c;if(r){d=i.width;c=i.height}else{d=i.height;c=i.width}var u=Mt["b"].Utils.Calculator.Converter;var p=Mt["b"].Layout.Multiple.MultipleHelperFlexible.getMinMaxFontSizes(e);var g=Mt["b"].Layout.Multiple.MultipleHelperFlexible.getTotalsSettings(e,s,r);var h=Mt["b"].Layout.Multiple.MultipleHelperFlexible.createInitialCellsData(e,s,r,o);a[l](e,s,h,g,d,c,u,p,r,o)},calculateFlexibleStructureCase01:function(e,t,i,a,n,r,o,l,s,d){var c,u,p,g,h;var f=e[e.activeElementType+"CellValueCount"];e.fontSize=l.maxFontSize+e.fontStep;do{e.fontSize-=e.fontStep;if(Math.abs(e.fontSize-Math.round(e.fontSize))<.05){e.fontSize=Math.round(e.fontSize)}p=Math.min(o.mm2pix(e.fontSize*Mt["b"].Utils.Constants.Parameters.minimalChartSize),r);var m;if(s){var v=r/(p*f);var b=Math.ceil(a.cellCount/v);m=Math.floor(n/b)}else{m=p*f}var T=Mt["b"].Layout.Multiple.MultipleHelperFlexible.updateCategoryCellSizes(e,t,i,a,m,s,d);var x=T.maxCategorySize;var E=T.maxTitleValueSize;var y=Math.max(1,Math.min(a.cellCount,Math.floor(n/x)-a.categoryCount));do{var C=Math.ceil(a.cellCount/y);c=Math.floor(r/C);u=(c-E)/f;Mt["b"].Layout.Multiple.MultipleHelperFlexible.updateMultipleRowsColumns(e,s,C,y);Mt["b"].Layout.Multiple.MultipleHelperFlexible.layoutMultipleCells(e,t,i,y,C,r,a,s);g=Mt["b"].Layout.Multiple.MultipleHelperFlexible.getMultipleCategorySizeSum(e,i,s);h=u>=p;if(h&&g<=n){return}y++;h=h||C<=1}while(!h&&g<n||!h&&e.fontSize===l.minFontSize)}while(e.fontSize>l.minFontSize)},calculateFlexibleStructureCase02:function(e,t,i,a,n,r,o,l,s,d){var c,u,p,g,h,f,m=0,v;var b=e[e.activeElementType+"CellValueCount"];var T=e[e.activeElementType+"CellCategorySize"];e.fontSize=l.maxFontSize+e.fontStep;do{e.fontSize-=e.fontStep;if(Math.abs(e.fontSize-Math.round(e.fontSize))<.05){e.fontSize=Math.round(e.fontSize)}f=Math.min(o.mm2pix(e.fontSize*Mt["b"].Utils.Constants.Parameters.minimalChartSize),r);p=o.mm2pix(e.fontSize*T);c=Math.max(1,Math.min(a.cellCount,Math.floor(n/p)-a.categoryCount));u=Math.ceil(a.cellCount/c);if(s){m=Mt["b"].Layout.Multiple.MultipleHelperFlexible.getBiggestTitleHeight(e,t,i,p)}g=r/u;h=(g-m)/b;v=h>=f;console.log(e.fontSize,c,u,e.cells,g,f,n);if(v){console.info("optimal state reached")}}while(e.fontSize>l.minFontSize&&!v);while(h<f&&u>1){c++;u=Math.ceil(a.cellCount/c);if(s){m=Mt["b"].Layout.Multiple.MultipleHelperFlexible.getBiggestTitleHeight(e,t,i,p)}g=Math.floor(r/u);h=(g-m)/b;console.warn("case02: chartValueSize too small... readjusting counts",g)}var x=s?p:g;Mt["b"].Layout.Multiple.MultipleHelperFlexible.updateMultipleRowsColumns(e,s,u,c);Mt["b"].Layout.Multiple.MultipleHelperFlexible.updateCategoryCellSizes(e,t,i,a,x,s,d);Mt["b"].Layout.Multiple.MultipleHelperFlexible.layoutMultipleCells(e,t,i,c,u,r,a,s)},calculateFlexibleStructureCase03:function(e,t,i,a,n,r,o,l,s,d){var c,u,p,g,h;var f=e[e.activeElementType+"CellValueSize"];e.fontSize=l.maxFontSize+e.fontStep;do{e.fontSize-=e.fontStep;if(Math.abs(e.fontSize-Math.round(e.fontSize))<.05){e.fontSize=Math.round(e.fontSize)}p=o.mm2pix(e.fontSize*f);u=Math.max(1,Math.min(a.cellCount,Math.floor(r/p)));c=Math.ceil(a.cellCount/u);var m=p;if(s){m=Math.floor(n/c)}Mt["b"].Layout.Multiple.MultipleHelperFlexible.updateMultipleRowsColumns(e,s,u,c);Mt["b"].Layout.Multiple.MultipleHelperFlexible.updateCategoryCellSizes(e,t,i,a,m,s,d);Mt["b"].Layout.Multiple.MultipleHelperFlexible.layoutMultipleCells(e,t,i,c,u,r,a,s);h=Mt["b"].Layout.Multiple.MultipleHelperFlexible.getMultipleCategorySizeSum(e,i,s);g=h<=n&&p<=r;if(g){console.info("optimal state reached")}}while(e.fontSize>l.minFontSize&&!g)},calculateFlexibleStructureCase04:function(e,t,i,a,n,r,o,l,s,d){var c,u,p,g,h;var f=e[e.activeElementType+"CellValueSize"];var m=e[e.activeElementType+"CellCategorySize"];e.fontSize=l.maxFontSize+e.fontStep;do{e.fontSize-=e.fontStep;if(Math.abs(e.fontSize-Math.round(e.fontSize))<.05){e.fontSize=Math.round(e.fontSize)}p=o.mm2pix(e.fontSize*m);g=o.mm2pix(e.fontSize*f);u=Math.max(1,Math.min(a.cellCount,Math.floor(r/g)));c=Math.ceil(a.cellCount/u);h=p*c<=n&&g<=r;console.log(e.fontSize,c,u,e.cells,g,r,p,n);if(h){console.info("optimal state reached")}}while(e.fontSize>l.minFontSize&&!h);var v=s?p:g;Mt["b"].Layout.Multiple.MultipleHelperFlexible.updateMultipleRowsColumns(e,s,u,c);Mt["b"].Layout.Multiple.MultipleHelperFlexible.updateCategoryCellSizes(e,t,i,a,v,s,d);Mt["b"].Layout.Multiple.MultipleHelperFlexible.layoutMultipleCells(e,t,i,c,u,r,a,s)},calculateFlexibleStructureCase05:function(e,t,i,a,n,r,o,l,s,d){var c,u,p,g,h;var f=e[e.activeElementType+"MultipleValueCount"];var m=e[e.activeElementType+"MultipleCategoryCount"];e.fontSize=l.maxFontSize+e.fontStep;do{e.fontSize-=e.fontStep;if(Math.abs(e.fontSize-Math.round(e.fontSize))<.05){e.fontSize=Math.round(e.fontSize)}if(f===null){c=Math.max(1,m-a.categoryCount);u=Math.ceil(a.cellCount/c)}else if(m===null){u=Math.max(1,f);c=Math.ceil(a.cellCount/u)}else{c=Math.max(1,m-a.categoryCount);u=Math.max(1,f);if(c*u<a.cellCount){Mt["b"].Layout.Multiple.MultipleHelperFlexible.updateMultipleRowsColumns(e,s,0,0);return}}p=Math.floor(r/u);var v=p;if(s){v=Math.floor(n/c)}Mt["b"].Layout.Multiple.MultipleHelperFlexible.updateMultipleRowsColumns(e,s,u,c);Mt["b"].Layout.Multiple.MultipleHelperFlexible.updateCategoryCellSizes(e,t,i,a,v,s,d);Mt["b"].Layout.Multiple.MultipleHelperFlexible.layoutMultipleCells(e,t,i,c,u,r,a,s);g=Mt["b"].Layout.Multiple.MultipleHelperFlexible.getMultipleCategorySizeSum(e,i,s);h=g<=n;if(h){console.info("optimal state reached")}}while(e.fontSize>l.minFontSize&&!h)},calculateFlexibleStructureCase06:function(e,t,i,a,n,r,o,l,s,d){var c,u,p,g,h;var f=e[e.activeElementType+"MultipleValueCount"];var m=e[e.activeElementType+"MultipleCategoryCount"];var v=e[e.activeElementType+"CellCategorySize"];e.fontSize=l.maxFontSize+e.fontStep;do{e.fontSize-=e.fontStep;if(Math.abs(e.fontSize-Math.round(e.fontSize))<.05){e.fontSize=Math.round(e.fontSize)}if(f===null){c=Math.max(1,m-a.categoryCount);u=Math.ceil(a.cellCount/c)}else if(m===null){u=Math.max(1,f);c=Math.ceil(a.cellCount/u)}else{c=Math.max(1,m-a.categoryCount);u=Math.max(1,f);if(c*u<a.cellCount){Mt["b"].Layout.Multiple.MultipleHelperFlexible.updateMultipleRowsColumns(e,s,0,0);return}}p=o.mm2pix(e.fontSize*v);g=Math.floor(r/u);h=p*c<=n;console.log(e.fontSize,c,u,e.cells,g,p,n);if(h){console.info("optimal state reached")}}while(e.fontSize>l.minFontSize&&!h);var b=s?p:g;Mt["b"].Layout.Multiple.MultipleHelperFlexible.updateMultipleRowsColumns(e,s,u,c);Mt["b"].Layout.Multiple.MultipleHelperFlexible.updateCategoryCellSizes(e,t,i,a,b,s,d);Mt["b"].Layout.Multiple.MultipleHelperFlexible.layoutMultipleCells(e,t,i,c,u,r,a,s)},calculateFlexibleStructureCase07:function(e,t,i,a,n,r,o,l,s,d){var c,u,p,g,h;var f=e[e.activeElementType+"MultipleValueCount"];var m=e[e.activeElementType+"MultipleCategoryCount"];var v=e[e.activeElementType+"CellValueSize"];e.fontSize=l.maxFontSize+e.fontStep;do{e.fontSize-=e.fontStep;if(Math.abs(e.fontSize-Math.round(e.fontSize))<.05){e.fontSize=Math.round(e.fontSize)}if(f===null){c=Math.max(1,m-a.categoryCount);u=Math.ceil(a.cellCount/c)}else if(m===null){u=Math.max(1,f);c=Math.ceil(a.cellCount/u)}else{c=Math.max(1,m-a.categoryCount);u=Math.max(1,f);if(c*u<a.cellCount){Mt["b"].Layout.Multiple.MultipleHelperFlexible.updateMultipleRowsColumns(e,s,0,0);return}}p=o.mm2pix(e.fontSize*v);var b=p;if(s){b=Math.floor(n/c)}Mt["b"].Layout.Multiple.MultipleHelperFlexible.updateMultipleRowsColumns(e,s,u,c);Mt["b"].Layout.Multiple.MultipleHelperFlexible.updateCategoryCellSizes(e,t,i,a,b,s,d);Mt["b"].Layout.Multiple.MultipleHelperFlexible.layoutMultipleCells(e,t,i,c,u,r,a,s);g=Mt["b"].Layout.Multiple.MultipleHelperFlexible.getMultipleCategorySizeSum(e,i,s);h=g<=n&&p*u<=r;if(h){console.info("optimal state reached")}}while(e.fontSize>l.minFontSize&&!h)},calculateFlexibleStructureCase08:function(e,t,i,a,n,r,o,l,s,d){var c,u,p,g,h;var f=e[e.activeElementType+"MultipleCategoryCount"];var m=e[e.activeElementType+"MultipleValueCount"];var v=e[e.activeElementType+"CellValueSize"];var b=e[e.activeElementType+"CellCategorySize"];e.fontSize=l.maxFontSize+e.fontStep;do{e.fontSize-=e.fontStep;if(Math.abs(e.fontSize-Math.round(e.fontSize))<.05){e.fontSize=Math.round(e.fontSize)}if(m===null){c=Math.max(1,f-a.categoryCount);u=Math.ceil(a.cellCount/c)}else if(f===null){u=Math.max(1,m);c=Math.ceil(a.cellCount/u)}else{c=Math.max(1,f-a.categoryCount);u=Math.max(1,m);if(c*u<a.cellCount){Mt["b"].Layout.Multiple.MultipleHelperFlexible.updateMultipleRowsColumns(e,s,0,0);return}}p=o.mm2pix(e.fontSize*b);g=o.mm2pix(e.fontSize*v);h=p*c<=n&&g*u<=r;console.log(e.fontSize,c,u,e.cells,g,r,p,n);if(h){console.info("optimal state reached")}}while(e.fontSize>l.minFontSize&&!h);var T=s?p:g;Mt["b"].Layout.Multiple.MultipleHelperFlexible.updateMultipleRowsColumns(e,s,u,c);Mt["b"].Layout.Multiple.MultipleHelperFlexible.updateCategoryCellSizes(e,t,i,a,T,s,d);Mt["b"].Layout.Multiple.MultipleHelperFlexible.layoutMultipleCells(e,t,i,c,u,r,a,s)},layoutMultipleCells:function(e,t,i,a,n,r,o,l){var s=o.cellCount===t.length;e.cells=new Array(a*n);for(var d=0;d<e.cells.length;d++){var c=t[d];if(c&&(s||!c.ref.isSum)){e.cells[d]={path:c.path,categorySize:i[c.path].categorySize}}else{e.cells[d]={path:null}}}if(e.optimizeCellOrder){var u=Mt["b"].Layout.Multiple.MultipleHelperFlexible.createMultipleCellsList(e,i,l);var p=e.cells.length;var g;var h=Date.now();do{p--;p=Mt["b"].Layout.Multiple.MultipleHelperFlexible.assignFreeMultipleCells(e,u,p,r,l);g=Mt["b"].Layout.Multiple.MultipleHelperFlexible.optimizeMultipleCellsOrder(e,u,l);var f=Date.now();if(g&&f-h>=2e3){console.warn("multipleHelperFlexible.layoutMultipleCells: endless loop while distributing free cells and trying to layout the result");p=Mt["b"].Layout.Multiple.MultipleHelperFlexible.assignFreeMultipleCells(e,u,1,r,l);g=Mt["b"].Layout.Multiple.MultipleHelperFlexible.optimizeMultipleCellsOrder(e,u,l)}}while(p>=0&&g);if(l){Mt["b"].Layout.Multiple.MultipleHelperCommon.disperseFreeCellsForTime(e)}else{Mt["b"].Layout.Multiple.MultipleHelperCommon.disperseFreeCellsForStructure(e)}}else{Mt["b"].Layout.Multiple.MultipleHelperFlexible.fillMultipleStructure(e,i,l);if(l){Mt["b"].Layout.Multiple.MultipleHelperFlexible.adjustMultipleCellsForTime(e,r)}else{Mt["b"].Layout.Multiple.MultipleHelperFlexible.adjustMultipleCellsForStructure(e,r)}}Mt["b"].Layout.Multiple.MultipleHelperFlexible.addTotalsToLayout(e,t,i,o,l)},addTotalsToLayout:function(n,t,r,e,o){function getTotalNode(){for(var e=0;e<t.length;e++){if(t[e].ref.isSum){return t[e]}}}function createTotalCell(e){var t=getTotalNode();var i=r[t.path];if(i.caseIdx===null){return{path:t.path,grid:[],gridData:[],state:2,span:e,valueSize:0,fixedValueSize:0,categorySize:0,caseIdx:null}}else{var a=Mt["b"].Layout.Multiple.MultipleHelperFlexible.getAdditionalValueSize(n,i,t.path,o);return{path:t.path,grid:i.grid,gridData:i.gridData,state:2,span:e,valueSize:i.valueSize,fixedValueSize:a,categorySize:i.categorySize,caseIdx:i.caseIdx,titleDim:i.titleDim,isTotal:true}}}if(!o&&e.categoryCount>0){var i=createTotalCell(n.columns);if(n.dimensions[0].totalsPosition==="CategoryStart"){for(var a=0;a<n.cells.length;a++){if(n.cells[a].state===1&&n.cells[a].ownerIndex!=undefined){n.cells[a].ownerIndex+=n.columns}}for(var a=1;a<n.columns;a++){n.cells.unshift({path:null,state:1,span:1,ownerIndex:0})}n.cells.unshift(i)}else{var l=n.cells.length;n.cells.push(i);for(var a=1;a<n.columns;a++){n.cells.push({path:null,state:1,span:1,ownerIndex:l})}}n.rows++}else if(o&&e.categoryCount>0){var i=createTotalCell(n.rows);var s;if(n.dimensions[0].totalsPosition==="CategoryStart"){s=0}else{s=n.columns}for(var a=n.rows-1;a>=1;a--){n.cells.splice(a*n.columns+s,0,{path:null,state:1,span:1,ownerIndex:s})}n.cells.splice(s,0,i);n.columns++;for(var d=0;d<n.cells.length;d++){var i=n.cells[d];if(i.state===2){for(var c=1;c<i.span;c++){n.cells[d+c*n.columns].ownerIndex=d}}}}},updateMultipleRowsColumns:function(e,t,i,a){if(t){e.rows=i;e.columns=a}else{e.columns=i;e.rows=a}}};Mt["b"].Layout=Mt["b"].Layout||{};Mt["b"].Layout.Multiple=Mt["b"].Layout.Multiple||{};Mt["b"].Layout.Multiple.MultipleHelperSemiFixed={calculateSemiFixedStructure:function(e,t,i){},getTotalsSettings:function(r,e,t){var o=0;var l=r.dimensions.length;var s=Mt["b"].Utils.GlobalFunctions.createArray(l,0);function traverse(e,t){if(t<l){for(var i=0;i<e.length;i++){traverse(e[i].nodes,t+1)}}else{for(var i=0;i<e.length;i++){var a=e[i];if(a.isSum){var n=r.dimensions[t-1];if(a.lvl===t){if(n.totalsPosition==="None"){}else if(n.totalsPosition==="Cell"){o++}else{s[t-1]+=1}}}else{o++}}}}var i=e.map(function(e,t,i){return e.ref});traverse(i,1);console.info(o,l,s,e);return{cellCount:o,categoryCount:s}},calculateStructure:function(e,t,i){}};Mt["b"].Layout=Mt["b"].Layout||{};Mt["b"].Layout.Multiple=Mt["b"].Layout.Multiple||{};Mt["b"].Layout.Multiple.MultipleLayout=function(e){var N=Mt["b"].Utils.Calculator.Converter;var t=Mt["b"].DataObjects.RuntimeDO;var ae=true;var o=t.getParameterParsed("FONT_SIZE_CHART");var l=N.mm2pix(o*t.getParameterParsed("MMPT_MULTIPLE_CASE_TOP_BORDER_SIZE"));var s=N.mm2pix(o*t.getParameterParsed("MMPT_MULTIPLE_CASE_RIGHT_BORDER_SIZE"));var d=N.mm2pix(o*t.getParameterParsed("MMPT_MULTIPLE_CASE_BOTTOM_BORDER_SIZE"));var c=N.mm2pix(o*t.getParameterParsed("MMPT_MULTIPLE_CASE_LEFT_BORDER_SIZE"));var ne=t.getParameter("COLOR_MULTIPLE_CASE_TOP_BORDER");var re=t.getParameter("COLOR_MULTIPLE_CASE_RIGHT_BORDER");var oe=t.getParameter("COLOR_MULTIPLE_CASE_BOTTOM_BORDER");var le=t.getParameter("COLOR_MULTIPLE_CASE_LEFT_BORDER");var se;var a={width:0,height:0};this.layoutPanels=function(e,t,i,a){var n={};if(e.length===0){return n}var r=e[0].getController().getRootModel();var o=a.getModel();var l=o.extendedModel;var s=l.activeElementType==="time";var d=!s&&l.activeElementType==="structure";if(ae){ae=false;var c=o.border,u=o.padding;se={width:i.width-c.left.width-c.right.width-u.left-u.right,height:i.height-c.top.width-c.bottom.width-u.top-u.bottom}}switch(r.buildUp){case Mt["b"].Utils.Constants.BuildUp.PREINIT:{var p=0;var g=0;var h=e[e.length-1];h.setDimension({height:i.height,width:i.width});h.setPosition({x:0,y:0});if(e.length===1){}else{var f=o.layoutData[1];var m=o.layoutData[0];var v=collectBorders(l);var b=collectRowColumnData(l,se,v);var T=b.rowsData;var x=b.colsData;var E=b.rowsBorderOverlapArea;var y=b.colsBorderOverlapArea;var C=0;var S=0,M=0;for(var O=0;O<l.cells.length;O++){var A=l.cells[O];var _=v[O];var L=O%f;var I=Math.floor(O/f);var D=T[I];var R=x[L];if(L===0){S=0}if(A.path!==null&&A.caseIdx!==null){var P=R.size;var N=D.size;if(d){var w=1;while(L+w<f&&O+w<l.cells.length&&A.span>w){P+=x[L+w].size-y[L+w-1];w++}}else if(s){var w=1;while(I+w<m&&O+w*f<l.cells.length&&A.span>w){N+=T[I+w].size-E[I+w-1];w++}}else{}var F=v[O-f],B=v[O+1],k=v[O+f],U=v[O-1],H=I===0||F.caseIdx>A.caseIdx?_.top:Math.max(0,_.top-F.bottom),G=L===f-1||B.caseIdx>=A.caseIdx?_.right:Math.max(0,_.right-B.left),V=I===m-1||k.caseIdx>=A.caseIdx?_.bottom:Math.max(0,_.bottom-k.top),$=L===0||U.caseIdx>A.caseIdx?_.left:Math.max(0,_.left-U.right);var z=H<_.top&&I>0?E[I-1]:0;var W=$<_.left&&L>0?y[L-1]:0;var j=P-W;var K=N-z;var X=S+W;var Y=M+z;var Z=e[C++];Z.setDimension({height:K,width:j});Z.setPosition({x:X,y:Y});var Q=l.cases[_.caseIdx].borders;var q=Z.getModel().border;q.top.width=H;q.left.width=$;q.bottom.width=V;q.right.width=G;q.top.color=Q.top.notationColor?ne:Q.top.color;q.left.color=Q.left.notationColor?le:Q.left.color;q.bottom.color=Q.bottom.notationColor?oe:Q.bottom.color;q.right.color=Q.right.notationColor?re:Q.right.color}S+=R.size-y[L];if(L===f-1){M+=D.size-E[I]}}var J=o.children[o.children.length-2];if(J){p=J.position.x+J.dimension.width;g=J.position.y+J.dimension.height}createValueLinking(l,o.children,r,s,d);createLegendLinking(l,o.children,r,s,d);createAxisLinking(o,r,s,d)}if(i.height>se.height||i.width>se.width){var ee=Mt["b"].Utils.Constants.Parameters.idContainerContent+"."+o.id,c=o.border,u=o.padding;o.scrollingData={realHeight:i.height,realWidth:i.width,height:i.height,width:i.width,scrollingVer:false,scrollingHor:false,x:t.x,y:t.y,children:{},id:o.id};o.scrollingData.children[ee]={realHeight:g,realWidth:p,height:se.height,width:se.width,scrollingVer:!o.disableScrolling&&g>se.height,scrollingHor:!o.disableScrolling&&p>se.width,x:c.left.width+u.left,y:c.top.width+u.top,id:ee};for(var O=e.length-2;O>=0;O--){e[O].getModel().nestedContainerId=ee}}else{o.scrollingData={realHeight:g,realWidth:p,width:i.width,height:i.height,scrollingVer:!o.disableScrolling&&g>i.height,scrollingHor:!o.disableScrolling&&p>i.width,x:t.x,y:t.y,id:o.id};if(e.length>0){var te=e[e.length-1].getModel();o.scrollingData.scrollingVer&&(te.dimension.height=g);o.scrollingData.scrollingHor&&(te.dimension.width=p)}}}break}for(var O=0;O<e.length;O++){var ie=e[O];n[ie.getId()]=ie}return n};function collectBorders(e){var t=new Array(e.cells.length);for(var i=0;i<e.cells.length;i++){var a=e.cells[i];var n={top:0,right:0,bottom:0,left:0,caseIdx:a.caseIdx};if(a.path!==null&&a.caseIdx!==null){var r=e.cases[a.caseIdx].borders;n.top=r.top.width===null?l:N.mm2pix(o*r.top.width);n.right=r.right.width===null?s:N.mm2pix(o*r.right.width);n.bottom=r.bottom.width===null?d:N.mm2pix(o*r.bottom.width);n.left=r.left.width===null?c:N.mm2pix(o*r.left.width)}t[i]=n}return t}function collectRowColumnData(l,e,t){var i=l.columns;var a=l.rows;var n=l.activeElementType==="time";var r=-1,o=-1;var s=new Array(a);var d=new Array(i);var c=combineBorders(l,t,n);var u=c.rowBorders;var p=c.colBorders;var g;var h=false,f=false;var m=u[0].topMax+u[0].botMax;var v=p[0].leftMax+p[0].rightMax;var b=Mt["b"].Utils.GlobalFunctions.createArray(a-1,999);var T=Mt["b"].Utils.GlobalFunctions.createArray(i-1,999);for(var x=1;x<a;x++){b[x-1]=Math.min(b[x-1],u[x-1].botMin,u[x].topMin);m+=u[x].topMax+u[x].botMax-b[x-1]}for(var x=1;x<i;x++){T[x-1]=Math.min(T[x-1],p[x-1].rightMin,p[x].leftMin);v+=p[x].leftMax+p[x].rightMax-T[x-1]}if(l[l.activeElementType+"CellCategorySize"]!==null){if(n){r=Math.floor(N.mm2pix(l.fontSize*l.timeCellCategorySize))}else{o=Math.floor(N.mm2pix(l.fontSize*l[l.activeElementType+"CellCategorySize"]))}}else if(l.expandCategories){f=n;h=!n}if(l[l.activeElementType+"CellValueSize"]!==null){if(n){o=Math.floor(N.mm2pix(l.fontSize*l.timeCellValueSize))}else{r=Math.floor(N.mm2pix(l.fontSize*l[l.activeElementType+"CellValueSize"]))}}else{if(l.optimizeCellStructureSize){g=collectValueSizes(l,n,e.height-m,e.width-v)}else{var E,y;if(n){E=a;y=Math.floor((e.height-m)/a)}else{E=i;y=Math.floor((e.width-v)/i)}g=new Array(E);for(var x=0;x<E;x++){g[x]=(x+1)*y}}}for(var x=0;x<l.cells.length;x++){var C=l.cells[x];if(C.path===null){continue}var S=x%i;var M=Math.floor(x/i);var O=u[M];var A=p[S];if(s[M]===undefined){s[M]={size:0,borderTopMax:O.topMax,borderTopMin:O.topMin,borderBotMax:O.botMax,borderBotMin:O.botMin}}var _=s[M];if(o===-1){if(n){var L=g[M]-(M===0?0:g[M-1]);_.size=L+O.topMax+O.botMax}else{_.size=Math.max(_.size,C.categorySize)}}else{_.size=o}if(d[S]===undefined){d[S]={size:0,borderLeftMax:A.leftMax,borderLeftMin:A.leftMin,borderRightMax:A.rightMax,borderRightMin:A.rightMin}}var I=d[S];if(r===-1){if(n){I.size=Math.max(I.size,C.categorySize)}else{var L=g[S]-(S===0?0:g[S-1]);I.size=L+A.leftMax+A.rightMax}}else{I.size=r}}var D=0,R=0;for(var x=0;x<a;x++){if(s[x]===undefined){var O=u[x];s[x]={size:0,borderTopMax:O.topMax,borderTopMin:O.topMin,borderBotMax:O.botMax,borderBotMin:O.botMin}}D+=s[x].size-(x===0?0:b[x-1])}for(var x=0;x<i;x++){if(d[x]===undefined){var A=p[x];d[x]={size:0,borderLeftMax:A.leftMax,borderLeftMin:A.leftMin,borderRightMax:A.rightMax,borderRightMin:A.rightMin}}R+=d[x].size-(x===0?0:T[x-1])}function getCountForExpand(e,t,i){var a=e;for(var n=0;n<e;n++){var r=true;for(var o=0;o<t;o++){if(l.cells[i(n,o)].path!==null){r=false;break}}if(r){a--}}return a}function expandSizes(e,t,i,a){var n=t-i;if(n<=0){return}var r=a-1;var o=Math.floor(n/a);for(var l=0;l<r;l++){e[l].size+=o}e[r].size+=n-o*r}if(h){var P=getCountForExpand(a,i,function(e,t){return e*i+t});expandSizes(s,e.height,D,P)}if(f){var P=getCountForExpand(i,a,function(e,t){return t*i+e});expandSizes(d,e.width,R,P)}return{rowsData:s,colsData:d,rowsBorderOverlapArea:b,colsBorderOverlapArea:T}}function combineBorders(e,t,i){var a=e.columns;var n=e.rows;var r=new Array(n);var o=new Array(a);for(var l=0;l<e.cells.length;l++){var s=l%a;var d=Math.floor(l/a);var c=e.cells[l];var u=t[l];if(c.path===null){continue}if(r[d]===undefined){r[d]={topMax:0,topMin:999,botMax:0,botMin:999}}if(o[s]===undefined){o[s]={leftMax:0,leftMin:999,rightMax:0,rightMin:999}}var p=r[d];var g=o[s];p.topMax=Math.max(p.topMax,u.top);p.topMin=Math.min(p.topMin,u.top);g.leftMax=Math.max(g.leftMax,u.left);g.leftMin=Math.min(g.leftMin,u.left);if(i){var h=d+c.span-1;if(r[h]===undefined){r[h]={topMax:0,topMin:999,botMax:0,botMin:999}}p=r[h]}else{var f=s+c.span-1;if(o[f]===undefined){o[f]={leftMax:0,leftMin:999,rightMax:0,rightMin:999}}g=o[f]}p.botMax=Math.max(p.botMax,u.bottom);p.botMin=Math.min(p.botMin,u.bottom);g.rightMax=Math.max(g.rightMax,u.right);g.rightMin=Math.min(g.rightMin,u.right)}for(var l=0;l<n;l++){if(r[l]===undefined){r[l]={topMax:0,topMin:0,botMax:0,botMin:0}}else{var p=r[l];if(p.topMin===999){p.topMin=0}if(p.botMin===999){p.botMin=0}}}for(var l=0;l<a;l++){if(o[l]===undefined){o[l]={leftMax:0,leftMin:0,rightMax:0,rightMin:0}}else{var g=o[l];if(g.leftMin===999){g.leftMin=0}if(g.rightMin===999){g.rightMin=0}}}return{rowBorders:r,colBorders:o}}function collectValueSizes(e,t,i,a){var n=e.rows;var r=e.columns;var o,l,s;if(t){o=n;l=r;s=i}else{o=r;l=n;s=a}var d=Mt["b"].Utils.GlobalFunctions.createArray(o,0);var c=0;var u=null;function getCellIdxTime(e,t,i){return t*i+e}function getCellIdxStructure(e,t,i){return e*i+t}var p=t?getCellIdxTime:getCellIdxStructure;for(var g=0;g<l;g++){var h=0;var f=0;for(var m=0;m<o;m++){var v=e.cells[p(g,m,r)];if(v.path!==null){h+=v.fixedValueSize;f+=v.valueSize}}c=Math.max(c,f);var b=f===0?0:(s-h)/f;if(u===null||b<u){u=b}}for(var T=0;T<5;T++){var x=tryLayoutCells(e,d,s,u,r,o,l,p);if(x<=0){break}var E=u*c;u=c===0?0:(E-x/2)/c}var y=[];for(var m=0;m<o;m++){for(var g=0;g<l;g++){var C=p(g,m,r);var v=e.cells[C];if(v.path!==null&&v.span!==1){y.push({idx:C,catLine:g,line:m,span:v.span})}}}y.sort(function(e,t){return t.span-e.span});for(var T=0;T<y.length;T++){var S=y[T];var M=getLinesToOptimize(e,S.idx,S.line,S.catLine,n,r,p,t,u);var O=0,A=0;for(var _=0;_<M.length;_++){var L=M[_];var I=d[L.end]-(L.start===0?0:d[L.start-1]);O+=I-L.value;A+=L.end-L.start+1}var D=O/A;for(var _=0;_<M.length;_++){var L=M[_];var R=L.end-L.start+1;var P=L.start===0?0:d[L.start-1];var N=_===M.length-1?O:Math.round(D*R);O-=N;N+=L.value;var w=d[L.end];d[L.end]=P+N;for(var F=L.end-1;F>=L.start;F--){if(d[F]===w){w=d[F];d[F]=d[F+1]}}}}return d}function tryLayoutCells(e,t,i,a,n,r,o,l){t[r-1]=i;var s,d=i;for(var c=r-1;c>=0;c--){s=d;var u=null;for(var p=0;p<o;p++){var g=e.cells[l(p,c,n)];if(g.path!==null&&g.grid[0]!==null&&g.grid[0].extendedModel.axisLinking){if(u===null||u<g.fixedValueSize){u=g.fixedValueSize}}}for(var p=0;p<o;p++){var h=l(p,c,n);var g=e.cells[h];if(g.path===null||g.grid[0]===null){continue}var f=g.grid[0].extendedModel.axisLinking?u:g.fixedValueSize;var m=f+2+Math.round(g.valueSize*a);var v=c+g.span-1;s=Math.min(s,t[v]-m)}if(c>0){t[c-1]=s}d=s}return Math.max(0,-s)}function getLinesToOptimize(e,t,i,a,n,r,o,l,s){var d=e.cells[t];var c=i+d.span-1;var u=[];var p=n,g=1;if(l){p=r;g=r}for(var h=i;h<=c;h++){var f=false;var m=h,v=h;var b=[];for(var T=0;T<p;T++){if(T===a){continue}var x=o(T,h,r);var E=e.cells[x];if(E.state===0){continue}var y=E,C=h;if(y.state===1){y=e.cells[E.ownerIndex];C-=(x-E.ownerIndex)/g}var S=C+y.span-1;if(C<=i&&S>=c){continue}else if(C<i&&S<c){f=true;h=S;break}else if(C>i&&S>c){f=true;h=c;break}else if(C<m){f=true;h=S;break}v=Math.max(v,S);b.push(T)}if(!f&&b.length>0){u.push({start:m,end:v,catLines:b});h=v}}if(u.length<2){u=[]}for(var M=0;M<u.length;M++){var O=u[M];var A=0;for(var _=0;_<O.catLines.length;_++){var T=O.catLines[_];var L=0;for(var h=O.start;h<=O.end;h++){var E=e.cells[o(T,h,r)];if(E.path!==null){L+=E.fixedValueSize+Math.round(E.valueSize*s);h+=E.span-1}}A=Math.max(A,L)}O.value=A}return u}function createValueLinking(e,t,i,a,n){var r=e[e.activeElementType+"CellValueCount"];if(!e.valueLinking||r<2||!a&&!n){return}var o=i.linkGroupsMultiple;var l=e[e.activeElementType+"CellCategoryCount"];var s=a?"Time":"Structure";var d=a?l:r;var c=a?function(e,t){return e*d+t}:function(e,t){return t*d+e};for(var u=0;u<t.length;u++){var p=t[u];if(p.instanceOf==="BackGroundModel"){continue}for(var g=0;g<l;g++){var h={type:"value",linkedType:s,linkedCharts:[]};for(var f=0;f<r;f++){var m=p.children[c(f,g)];h.linkedCharts.push(i.extensionHash+"."+m.id)}o.push(h)}}}function createLegendLinking(e,t,i,a,n){if(!a&&!n){return}var r=i.linkGroupsMultiple;var o=e[e.activeElementType+"CellValueCount"];var l=e[e.activeElementType+"CellCategoryCount"];var s,d,c,u,p,g,h,f;var m=0,v;if(a){s="Time";d="Left";c=l;u=function(e,t){return e*c+t};p=e.columns;g="column";f={Start:"Left",Mid:"Mid",End:"Right"}}else{s="Structure";d="Top";c=o;u=function(e,t){return t*c+e};p=e.rows;g="row";f={Start:"Top",Mid:"Mid",End:"Bottom"}}var h=new Array(l*p);var b=new Array(l*p);for(var T=0;T<t.length;T++){var x=t[T];if(x.instanceOf==="BackGroundModel"){continue}var E=x[g];do{v=e.cells[m++]}while(v.path===null);for(var y=0;y<l;y++){var C=E*l+y;if(h[C]===undefined){h[C]={type:"legend",linkedType:s,legendOrientation:d,linkedCharts:[]};b[C]={caseIdx:9999,gridIdx:9999,chartIdx:9999}}for(var S=0;S<o;S++){var M=u(S,y);var O=x.children[M];h[C].linkedCharts.push(i.extensionHash+"."+O.id);var A=b[C];if(v.caseIdx<A.caseIdx||v.caseIdx===A.caseIdx&&M<A.gridIdx||v.caseIdx===A.caseIdx&&M===A.gridIdx&&v.gridData[M].chartIdx<A.chartIdx){h[C].legendOrientation=f[O.extendedModel.axisAlignmentCategory];A.caseIdx=v.caseIdx;A.gridIdx=M;A.chartIdx=v.gridData[M].chartIdx}}}}for(var T=0;T<h.length;T++){if(h[T]!==undefined){r.push(h[T])}}}var k=.35;function createAxisLinking(e,t,i,a){if(!i&&!a){return}var n=e.extendedModel;var r=e.children;var o,l,s;if(i){o="Time";l=se.height;s=Math.round(k*se.height/n.rows)}else{o="Structure";l=se.width;s=Math.round(k*se.width/n.columns)}var d=initAxesClusters(n,r,i);for(var c=0;c<d.length;c++){var u=d[c].group;var p=d[c].clusters;var g=[];var h=20;while(h>0&&doClustersDiffer(p,g)){g=p;p=clusterizeAxesAnew(u,p,l,s);d[c].clusters=p;h--}for(var f=0;f<p.length;f++){var m=p[f];if(m.chartIds.length>=2){var v=new Array(m.chartIds.length);for(var b=0;b<m.chartIds.length;b++){v[b]=t.extensionHash+"."+m.chartIds[b]}t.linkGroupsMultiple.push({type:"axis",linkedType:o,axisOrientation:d[c].alignment,linkedCharts:v})}}}}function setAxesPositions(e,t,i,a){var n=t.children;var r=i.gridData;var o,l,s,d,c;if(a){o="height";l="y";s=e.timeCellValueCount;d=e.timeCellCategoryCount;c=function(e,t){return e*d+t}}else{o="width";l="x";s=e.structureCellValueCount;d=e.structureCellCategoryCount;c=function(e,t){return t*s+e}}if(e.valueLinking){for(var u=0;u<d;u++){var p=t.dimension[o]-i.fixedValueSize;var g=t.position[l];for(var h=0;h<s;h++){var f=c(h,u);var m=r[f];if(m&&n[f].extendedModel){var v=Math.round((m.maxValue-m.minValue)/i.valueSize*p);if(n[f].extendedModel.axisLinking){if(a){var b=Math.round(m.maxValue/(m.maxValue-m.minValue)*v);m.axisPos=g+m.valueLabelsPosSize+b}else{var b=Math.round(-m.minValue/(m.maxValue-m.minValue)*v);m.axisPos=g+m.categoryLabelsSize+m.valueLabelsNegSize+b}}g+=v+m.categoryLabelsSize+m.valueLabelsPosSize+m.valueLabelsNegSize}}}}else{var g=t.position[l]+i.titleDim.value;var T=t.dimension[o]-i.titleDim.value;var x=e[e.activeElementType+"CellGridSizes"][a?"rows":"columns"];for(var h=0;h<s;h++){var E=Math.round(x[h]*T);for(var u=0;u<d;u++){var f=c(h,u);var m=r[f];if(m&&n[f].extendedModel&&n[f].extendedModel.axisLinking){var v=E-(m.categoryLabelsSize+m.valueLabelsPosSize+m.valueLabelsNegSize);if(a){var y=m.maxValue/(m.maxValue-m.minValue);m.axisPos=g+m.valueLabelsPosSize+Math.round(y*v)}else{var y=-m.minValue/(m.maxValue-m.minValue);m.axisPos=g+m.categoryLabelsSize+m.valueLabelsNegSize+Math.round(y*v)}}}g+=E}}}function initAxesClusters(i,e,t){var a,n,r,o,l,s,d,c;if(t){a=i.timeCellValueCount;n=i.timeCellCategoryCount;r=function(e,t){return e*n+t};o=i.columns;l=i.rows;s=function(e,t){return t*i.columns+e};d=function(e,t){return e.dimension.height-t.titleDim.value};c="row"}else{a=i.structureCellValueCount;n=i.structureCellCategoryCount;r=function(e,t){return t*a+e};o=i.rows;l=i.columns;s=function(e,t){return e*i.columns+t};d=function(e,t){return e.dimension.width};c="column"}var u=[];for(var p=0;p<a;p++){var g=[];var h,f=9999,m=9999;for(var v=0;v<o;v++){for(var b=0;b<l;b++){var T=s(v,b);var x=i.cells[T];if(x.path===null){continue}var E=e[x.childIndex];var y=d(E,x);setAxesPositions(i,E,x,t);for(var C=0;C<n;C++){var S=r(p,C);var M=E.children[S];if(M.extendedModel&&M.extendedModel.axisLinking){var O=e[x.childIndex][c];g.push({axisPos:x.gridData[S].axisPos,cellIdx:T,chartIdx:S,chartId:M.id,cellValueSize:y,rowCol1:O,rowCol2:O+x.span-1});if(x.caseIdx<f||x.caseIdx===f&&x.gridData[S].chartIdx<m){h=M.extendedModel.axisAlignmentElement}}}}}g.sort(function(e,t){return e.axisPos-t.axisPos});var A=[];for(var C=0;C<g.length;C++){var _=g[C];var L=_.axisPos,I=_.axisPos,D=[_.chartId];var R=Math.round(k*_.cellValueSize);var P=L+R;var N=_.rowCol1;var w=_.rowCol2;var F=C+1,B=g[F];while(F<g.length&&B.axisPos<=P&&areClustersAligned(N,w,B.rowCol1,B.rowCol2)){I=B.axisPos;D.push(B.chartId);N=Math.max(N,B.rowCol1);w=Math.min(w,B.rowCol2);C++;B=g[++F]}L=Math.round((L+I)/2);A.push({position:L,chartIds:D,rowColStart:N,rowColEnd:w})}u.push({group:g,clusters:A,alignment:h})}return u}function areClustersAligned(e,t,i,a){return e<=i&&t>=i||e>=i&&e<=a}function doClustersDiffer(e,t){if(e.length!==t.length){return true}for(var i=0;i<e.length;i++){if(e[i].position!==t[i].position){return true}}return false}function clusterizeAxesAnew(e,t,i,a){var n=new Array(t.length);var r;for(var o=0;o<e.length;o++){var l=e[o];var s=i;var d=Math.round(k*l.cellValueSize);for(var c=0;c<t.length;c++){var u=t[c];var p=Math.abs(l.axisPos-u.position);if(p<s&&areClustersAligned(u.rowColStart,u.rowColEnd,l.rowCol1,l.rowCol2)){s=p;r=c}}if(s<=d){if(n[r]===undefined){n[r]={position:0,posCount:0,minPos:l.axisPos,maxPos:l.axisPos,chartIds:[],rowColStart:l.rowCol1,rowColEnd:l.rowCol2}}var u=n[r];u.position+=l.axisPos;u.posCount++;u.minPos=Math.min(u.minPos,l.axisPos);u.maxPos=Math.max(u.maxPos,l.axisPos);u.chartIds.push(l.chartId);u.rowColStart=Math.max(u.rowColStart,l.rowCol1);u.rowColEnd=Math.min(u.rowColEnd,l.rowCol2)}}for(var c=0;c<n.length;c++){if(n[c]){n[c].position=Math.round((n[c].minPos+n[c].maxPos)/2)}}for(var o=0;o<n.length;o++){if(n[o]===undefined){n.splice(o,1);o--;continue}var u=n[o];for(var c=o+1;c<n.length;c++){if(areClustersMergeable(u,n[c],a)){var g=n[c];u.posCount+=g.posCount;u.minPos=Math.min(u.minPos,g.minPos);u.maxPos=Math.max(u.maxPos,g.maxPos);u.position=Math.round((u.minPos+u.maxPos)/2);u.chartIds=u.chartIds.concat(g.chartIds);n.splice(c,1);c--}}}return n}function areClustersMergeable(e,t,i){return t&&(e.position<t.position?t.maxPos-e.minPos<=2*i:e.maxPos-t.minPos<=2*i)&&areClustersAligned(e.rowColStart,e.rowColEnd,t.rowColStart,t.rowColEnd)}this.getPreferredLayoutSize=function(e,t,i){return a}};Mt["b"].Layout.Iterator=Mt["b"].Layout.Iterator||{};Mt["b"].Layout.Iterator.Iterator=function(){var L=null;var q={};var J={};var I={};var o={};var u=[];var p=0;var e=30;var t=200;var R=.9;var ee=.4;var r=[];var D=[];this.init=function(){L=Mt["b"].DataObjects.DocumentDO;buildResolvedManualFactorsList();buildAllCharts();buildDependencies(false);buildDependencies(true);createVirtualGridCells();o={}};this.optimize=function(){p=e;intialQueueFill();iterateQueue(true);p=t;intialQueueFill();iterateQueue(false);orientateAxisLinks()};function buildResolvedManualFactorsList(){var e=Mt["b"].DataObjects.DocumentDO.getScalingGroups();for(var t in e){if(!e[t].auto){var i=Mt["b"].Utils.Calculator.resolveQvVars(t);if(r.indexOf(i)===-1){r.push(i)}}}}function checkManualFactors(e,t){var i=t.chart.extendedModel.zoom;for(var a=0;a<r.length;a++){var n=r[a];if(i[n]!==undefined){D.push(e);break}}}function buildAllCharts(){function buildAllChartsRecursive(e,t){var i=e.getChildPanels();if(i!==undefined){for(var a=0;a<i.length;a++){var n=i[a];var r=n.getModel();if(r.extendedModel!==undefined&&r.extendedModel!==null&&(r.extendedModel.instanceOf==="TimeChartModel"||r.extendedModel.instanceOf==="ChartModel"||r.extendedModel.instanceOf==="TableModel")){var o=new Mt["b"].Layout.Iterator.OptimizeChartNode;var l=t.split(".")[0];o.id=l+"."+n.getId();o.path=t+"."+n.getId();o.chart=r;o.panel=n;o.parent=e.getModel();J[l+"."+n.getId()]=o;I[l+"."+n.getId()]=r;checkManualFactors(l+"."+n.getId(),o)}if(r.instanceOf==="ContainerModel"&&(!r.extendedModel||r.extendedModel.instanceOf==="ContainerGridModel"||r.extendedModel.instanceOf==="MultipleContainerModel")){buildAllChartsRecursive(n,t+"."+n.getId())}}}}J={};I={};var e=L.getAllExtensions();for(var t=0;t<e.length;t++){var i=e[t].getController().getRootPanel();var a=e[t].getId()+"."+i.getModel().id;buildAllChartsRecursive(i,a)}}function buildDependencies(e){function doChartsIntersect(e,t,i,a){return e>i&&e<a||i>e&&i<t||e===i||t===a}var t=L.getAllExtensions();for(var i=0;i<t.length;i++){var a=t[i].getController().getRootModel();var n=e?a.linkGroupsMultiple:a.linkGroups;if(!n){continue}var r=new P(n);var o=null;while(o=r.next()){var l=o.linkedCharts;var s=[];var d=null;var c,u,p;var g,h,f;var m=false;var v=[];for(var b=0;b<l.length;b++){var T=J[l[b]];if(!T||!T.chart.extendedModel){continue}var x=Mt["b"].DataObjects.ContextRepo.getContextByCid(T.chart.extendedModel.contextId);if(D.indexOf(l[b])===-1&&x!==null&&x.dataModel&&x.dataModel.baseNode.nodes.length&&(o.linkedType==="Structure"&&T.chart.extendedModel.instanceOf==="ChartModel"||o.linkedType==="Time"&&T.chart.extendedModel.instanceOf==="TimeChartModel")){var E=[T.id];var y=calculateContainerPosByPath(T.path);if(o.linkedType==="Time"){c=y.y;u=c+T.chart.dimension.height;p=y.x}else{c=y.x;u=c+T.chart.dimension.width;p=y.y}for(var C=0;C<l.length;C++){var S=J[l[C]];if(S){if(d===null){d=S.parent.id}if(S.id===T.id){continue}var M=Mt["b"].DataObjects.ContextRepo.getContextByCid(S.chart.extendedModel.contextId);if(S&&S.chart.extendedModel&&D.indexOf(l[C])===-1&&M!==null&&M.dataModel&&M.dataModel.baseNode.nodes.length&&(o.linkedType==="Structure"&&S.chart.extendedModel.instanceOf==="ChartModel"||o.linkedType==="Time"&&S.chart.extendedModel.instanceOf==="TimeChartModel")){var O=calculateContainerPosByPath(S.path);if(o.linkedType==="Time"){g=O.y;h=g+S.chart.dimension.height;f=O.x}else{g=O.x;h=g+S.chart.dimension.width;f=O.y}if(o.type!=="axis"&&d===S.parent.id&&p===f){m=true}else if(o.type==="axis"&&doChartsIntersect(c,u,g,h)){m=true}}if(m&&s.indexOf(l[C])===-1){E.push(S.id);c=Math.max(c,g);u=Math.min(u,h);s.push(l[C]);m=false}}}v.push(E)}}var A=1;for(var b=0;b<v.length;b++){if(A<v[b].length){A=v[b].length;s=v[b]}}if(s.length>1){for(var b=0;b<s.length;b++){var T=s[b];var _=s.slice(0);_.splice(b,1);if(q[T]===undefined){q[T]=new Mt["b"].Layout.Iterator.OptimizeDependency;q[T].chart=T}if(o.type==="axis"){q[T].axisDep=_}else if(o.type==="value"){q[T].valueDep=_}delete I[T]}}}}}function createVirtualGridCells(){for(var e in q){var t=J[e];var i=t.parent;var a=i.extendedModel;if(a.virtualGridCells==null){a.virtualGridCells=new Array(i.children.length);for(var n=0;n<i.children.length;n++){a.virtualGridCells[n]={x:i.children[n].position.x,y:i.children[n].position.y,width:i.children[n].dimension.width,height:i.children[n].dimension.height}}}}}function intialQueueFill(){u=[];for(var e in q){u.push(e)}}function iterateQueue(e){while(u.length>0){var t=u[0];u.splice(0,1);calculateChart(t,e);globalZoomToChart();p--}}function calculateChart(e,t){if(J[e]===undefined){return}var i=q[e];var a=i.axisDep;var n=i.axisDep.length>0;if(n){n=optimizeAxes(e)}if(n===false&&p>0){for(var r=0;r<a.length;r++){u.push(a[r])}}if(n){var o=q[e].axisPosition;var l=a.slice(0);l.push(e);o+=optimizeAxesGlobal(l,undefined);for(var r=0;r<a.length;r++){q[a[r]].axisPosition=o}q[e].axisPosition=o}if(t===true){return}var s=i.valueDep;for(var r=0;r<s.length;r++){var d=s[r];if(J[d]===undefined){continue}var c=optimizeValue(e,d);if(c===false&&p>0){u.push(d)}}}function optimizeAxes(e){var t=J[e].chart.extendedModel.instanceOf==="TimeChartModel";var i=true;var a=true;var n=q[e].axisDep;var r=n.slice(0);r.push(e);var o=new Array(r.length);var l=new Array(r.length);var s=new Array(r.length);var d=new Array(r.length);var c=new Array(r.length);var u=new Array(r.length);var p=new Array(r.length);var g=0,h=0;for(var f=0;f<r.length;f++){var m=J[r[f]];o[f]=m.chart;l[f]=m.panel.getLayout();s[f]=calculateContainerPosByPath(m.path);d[f]=l[f].calcChartSpace(o[f]);var v=(t?s[f].y:s[f].x)+l[f].getAxisZeroPosition();c[f]=v+Math.round(d[f]*o[f].extendedModel.axisFactor);u[f]=v+Math.round(d[f]*l[f].limitAxisFactor(0,m.chart));p[f]=v+Math.round(d[f]*l[f].limitAxisFactor(1,m.chart));g+=c[f]}g=Math.round(g/o.length);var b=false,T=false;for(var f=0;f<u.length;f++){if(g<=u[f]){g=u[f];T=true}if(g>=p[f]){g=p[f];b=true}}if(b&&T){return false}for(var f=0;f<o.length;f++){var x=o[f];var E=c[f]-g;if(E===0){h+=c[f];continue}a=false;var y=l[f].calcFreeSpace(x);if(t){y=E>0?y.pos:y.neg}else{y=E>0?y.neg:y.pos}var C;if(y===0){C=.1}else if(y>=Math.abs(E)){C=1}else{C=y/Math.abs(E)}var S=C*E;var M=R;var O=Math.abs(S*M);var A=Math.round(.33*d[f]);if(O<1){M=1/Math.abs(S)}else if(O>A){M=A/Math.abs(S)}x.extendedModel.axisFactor-=Math.round(S*M)/d[f];x.extendedModel.axisFactor=l[f].limitAxisFactor(x.extendedModel.axisFactor,x);var v=(t?s[f].y:s[f].x)+l[f].getAxisZeroPosition();var _=v+Math.round(d[f]*x.extendedModel.axisFactor);h+=_;var L=g-_;if(L>1||L<-1){i=false}}h=Math.round(h/o.length);for(var f=0;f<r.length;f++){q[r[f]].axisPosition=h}if(!a){var I=[];for(var f=0;f<o.length;f++){for(var D in o[f].extendedModel.zoom){if(I.indexOf(D)===-1){I.push(D)}}}for(var f=0;f<I.length;f++){recalcGlobalZoomByScalingGroup(I[f])}}return i}function optimizeAxesGlobal(e,t){var i=2147483647;var a=2147483647;var n=[];var r=e.length>0&&J[e[0]].chart.extendedModel.instanceOf==="TimeChartModel";for(var o=0;o<e.length;o++){var l=J[e[o]].chart;var s=J[e[o]].panel.getLayout();var d=s.calcFreeSpace(l);i=Math.min(i,d.pos);a=Math.min(a,d.neg)}var c=Math.round((i-a)/2);if(t==="Start"){c=-a}else if(t==="End"){c=i}if(r){c=-c}for(var o=0;o<e.length;o++){var l=J[e[o]].chart;var u=J[e[o]].panel.getLayout();var p=u.calcChartSpace(l);var g=u.getAxisZeroPosition();var h=Math.round(p*l.extendedModel.axisFactor)+g;var f=h+c;l.extendedModel.axisFactor=(f-g)/p;for(var m in l.extendedModel.zoom){if(n.indexOf(m)===-1){n.push(m)}}}for(var o=0;o<n.length;o++){recalcGlobalZoomByScalingGroup(n[o])}return c}function optimizeValue(e,t){var i=false;var a=J[e].chart;var n=J[t].chart;var r=J[e].panel.getLayout();var o=J[t].panel.getLayout();var l=e.split(".")[0];var s=calculateContainerPosByPath(J[e].path);var d=calculateContainerPosByPath(J[t].path);var c=a.extendedModel.instanceOf==="TimeChartModel";var u=c?s.y:s.x;var p=c?d.y:d.x;var g=r.calcChartSpace(a);var h=o.calcChartSpace(n);var f=u<p;var m=axisPositionsOptimized(e,2);var v=axisPositionsOptimized(t,2);var b=u+r.getAxisZeroPosition()+Math.round(a.extendedModel.axisFactor*g);var T=p+o.getAxisZeroPosition()+Math.round(n.extendedModel.axisFactor*h);var x=b-q[e].axisPosition;var E=T-q[t].axisPosition;var y=o.calcFreeSpace(n);var C=r.calcFreeSpace(a);var S=m?calcLeastFreeSpaceForAxisDependency(e):{pos:0,neg:0};var M=v?calcLeastFreeSpaceForAxisDependency(t):{pos:0,neg:0};var O,A;if(c){if(f){O=calculateAvailableSpaceTop(m,C,x,S.pos,q[e].axisDep.length===0);A=calculateAvailableSpaceBottom(v,y,E,M.neg,q[t].axisDep.length===0)}else{O=calculateAvailableSpaceBottom(m,C,x,S.neg,q[e].axisDep.length===0);A=calculateAvailableSpaceTop(v,y,E,M.pos,q[t].axisDep.length===0)}}else{if(f){O=calculateAvailableSpaceBottom(m,C,x,S.neg,q[e].axisDep.length===0);A=calculateAvailableSpaceTop(v,y,E,M.pos,q[t].axisDep.length===0)}else{O=calculateAvailableSpaceTop(m,C,x,S.pos,q[e].axisDep.length===0);A=calculateAvailableSpaceBottom(v,y,E,M.neg,q[t].axisDep.length===0)}}var _=J[e].parent;var L=c?_.extendedModel.gridRows.length:_.extendedModel.gridColumns.length;var I=c?_.dimension.height:_.dimension.width;var D=1/L;if(I!==0){D=(c?a.dimension.height:a.dimension.width)/I}var R=J[t].parent;var P=c?R.extendedModel.gridRows.length:R.extendedModel.gridColumns.length;var N=c?R.dimension.height:R.dimension.width;var w=1/P;if(N!==0){w=(c?n.dimension.height:n.dimension.width)/N}var F=O+A;var B=D/(D+w);var k=Math.round(B*F);var U=k-O;if(U<0&&Math.abs(U)>O){U=-O}else if(U>0&&U>A){U=A}if(Math.abs(U)<=1){i=true}else{var H=Math.round(ee*U);var G=J[e].parent;var V=G.extendedModel;var $=collectInBetweenCells(G,c,a,n);var z=$.cells;for(var W=0;W<z.length;W++){var j=z[W].cell;var K=axisPositionsOptimized(l+"."+j.id,2);if(K){H=0;break}}if(H===0){return i}if(c){resizeContainersTime(e,t,V,H,$)}else{resizeContainersStructure(e,t,V,H,$)}var X=[];for(var Y in a.extendedModel.zoom){X.push(Y)}for(var Y in n.extendedModel.zoom){if(X.indexOf(Y)===-1){X.push(Y)}}for(var W=0;W<X.length;W++){recalcGlobalZoomByScalingGroup(X[W])}var Z=G.extendedModel;if(Z.instanceOf==="ContainerGridModel"){for(var Q=0;Q<G.children.length;Q++){G.children[Q].position.x=Z.virtualGridCells[Q].x;G.children[Q].position.y=Z.virtualGridCells[Q].y;G.children[Q].dimension.width=Z.virtualGridCells[Q].width;G.children[Q].dimension.height=Z.virtualGridCells[Q].height}}}return i}function resizeContainersTime(e,t,i,a,n){var r=J[e].chart;var o=J[t].chart;var l=J[e].panel.getLayout();var s=J[t].panel.getLayout();var d=n.cells;var c=n.iterateIndex;var u=n.referenceIndex;var p=calculateContainerPosByPath(J[e].path).y;var g=calculateContainerPosByPath(J[t].path).y;var h=l.calcChartSpace(r);var f=s.calcChartSpace(o);var m=p+l.getAxisZeroPosition()+Math.round(r.extendedModel.axisFactor*h);var v=g+s.getAxisZeroPosition()+Math.round(o.extendedModel.axisFactor*f);if(p<g){i.virtualGridCells[u].y+=a;o.position.y+=a;for(var b=0;b<d.length;b++){i.virtualGridCells[d[b].index].y+=a;d[b].cell.position.y+=a}}else{i.virtualGridCells[c].y-=a;r.position.y-=a;for(var b=0;b<d.length;b++){i.virtualGridCells[d[b].index].y-=a;d[b].cell.position.y-=a}}i.virtualGridCells[c].height+=a;i.virtualGridCells[u].height-=a;r.dimension.height+=a;o.dimension.height-=a;if(a>=0){resizeContainers(e,t,m,v)}else{resizeContainers(t,e,v,m)}}function resizeContainersStructure(e,t,i,a,n){var r=J[e].chart;var o=J[t].chart;var l=J[e].panel.getLayout();var s=J[t].panel.getLayout();var d=n.cells;var c=n.iterateIndex;var u=n.referenceIndex;var p=calculateContainerPosByPath(J[e].path).x;var g=calculateContainerPosByPath(J[t].path).x;var h=l.calcChartSpace(r);var f=s.calcChartSpace(o);var m=p+l.getAxisZeroPosition()+Math.round(r.extendedModel.axisFactor*h);var v=g+s.getAxisZeroPosition()+Math.round(o.extendedModel.axisFactor*f);if(p<g){i.virtualGridCells[u].x+=a;o.position.x+=a;for(var b=0;b<d.length;b++){i.virtualGridCells[d[b].index].x+=a;d[b].cell.position.x+=a}}else{i.virtualGridCells[c].x-=a;r.position.x-=a;for(var b=0;b<d.length;b++){i.virtualGridCells[d[b].index].x-=a;d[b].cell.position.x-=a}}i.virtualGridCells[c].width+=a;i.virtualGridCells[u].width-=a;r.dimension.width+=a;o.dimension.width-=a;if(a>=0){resizeContainers(e,t,m,v)}else{resizeContainers(t,e,v,m)}}function resizeContainers(e,t,i,a){var n=J[e].chart;var r=J[t].chart;var o=J[e].panel.getLayout();var l=J[t].panel.getLayout();var s=o.calcChartSpace(n);var d=l.calcChartSpace(r);var c=calculateContainerPosByPath(J[e].path);var u=calculateContainerPosByPath(J[t].path);var p=n.extendedModel.instanceOf==="TimeChartModel";if(q[t].axisDep.length>0){if(p){r.extendedModel.axisFactor=(a-(u.y+l.getAxisZeroPosition()))/d}else{r.extendedModel.axisFactor=(a-(u.x+l.getAxisZeroPosition()))/d}}else{l.recalcLocalAxisFactor(r)}r.extendedModel.axisFactor=l.limitAxisFactor(r.extendedModel.axisFactor,r);if(q[e].axisDep.length>0){if(p){n.extendedModel.axisFactor=(i-(c.y+o.getAxisZeroPosition()))/s}else{n.extendedModel.axisFactor=(i-(c.x+o.getAxisZeroPosition()))/s}}else{o.recalcLocalAxisFactor(n)}n.extendedModel.axisFactor=o.limitAxisFactor(n.extendedModel.axisFactor,n)}function calculateAvailableSpaceTop(e,t,i,a,n){var r;if(e){r=t.neg+a}else{if(i>10||n){r=t.pos+t.neg}else if(i<0){r=t.neg}else{r=t.neg}}return r}function calculateAvailableSpaceBottom(e,t,i,a,n){var r;if(e){r=t.pos+a}else{if(i<-10||n){r=t.pos+t.neg}else if(i>0){r=t.pos}else{r=t.pos}}return r}function collectInBetweenCells(e,t,i,a){var n,r;var o=[];if(t){var l=Math.min(i.row,a.row);var s=Math.max(i.row,a.row)}else{var l=Math.min(i.column,a.column);var s=Math.max(i.column,a.column)}for(var d=0;d<e.children.length;d++){var c=e.children[d];if(c.id===i.id){n=d}else if(c.id===a.id){r=d}else{if(t){if(c.row>l&&c.row<s&&c.column===i.column){o.push({cell:c,index:d})}}else{if(c.column>l&&c.column<s&&c.row===i.row){o.push({cell:c,index:d})}}}}return{cells:o,iterateIndex:n,referenceIndex:r}}function calcLeastFreeSpaceForAxisDependency(e){var t=J[e].chart;var i=J[e].panel;var a=i.getLayout();var n=a.calcFreeSpace(t);for(var r=0;r<q[e].axisDep.length;r++){var o=J[q[e].axisDep[r]].chart;var l=J[q[e].axisDep[r]].panel;var s=l.getLayout();var d=s.calcFreeSpace(o);n.neg=Math.min(n.neg,d.neg);n.pos=Math.min(n.pos,d.pos)}return n}function axisPositionsOptimized(e,t){if(q[e]===undefined){return false}var i=q[e].axisDep.slice(0);if(i.length===0){return false}i.push(e);var a=[];var n=J[i[0]].chart.extendedModel.instanceOf==="TimeChartModel";for(var r=0;r<i.length;r++){var o=J[i[r]].chart;var l=J[i[r]].panel;var s=l.getLayout();var d=calculateContainerPosByPath(J[i[r]].path);var c=d.x;var u=d.y;var p=s.calcChartSpace(o);if(n){var g=u+s.getAxisZeroPosition()+Math.round(p*o.extendedModel.axisFactor);a.push(g)}else{var g=c+s.getAxisZeroPosition()+Math.round(p*o.extendedModel.axisFactor);a.push(g)}}var h=a[0];for(var r=1;r<a.length;r++){if(Math.abs(a[r]-h)>t){return false}}return true}function globalZoomToChart(){var e=L.getAllExtensions();for(var t=0;t<e.length;t++){var i=e[t];var a=i.getMode();if(a!==Mt["b"].Utils.Enums.EMode.NOPAINT){i.updateGlobalZoom(o)}}}function recalcGlobalZoomByScalingGroup(e){var t=null;for(var i in J){var a=J[i].chart;var n=J[i].panel.getLayout();var r;if(I[i]){r=I[i].extendedModel.zoom[e]}else{r=n.recalcLocalZoom(a,e)}if(r!==null&&r!==undefined&&(t===null||r<t)){t=r}}o[e]=t}function calculateContainerPosByPath(e){var o={x:0,y:0};var t=L.getAllExtensions();var i=e.split(".");var a=i[0];i.splice(0,1);for(var n=0;n<t.length;n++){var r=t[n];if(r.getId()===a){calculateContainerPosByPathRecursive([r.getController().getRootPanel()],i)}}function calculateContainerPosByPathRecursive(e,t){if(t.length===0){return}var i=t[0];t.splice(0,1);for(var a=0;a<e.length;a++){var n=e[a];if(n.getId()===i){var r=n.getPosition();o.x+=r.x;o.y+=r.y;calculateContainerPosByPathRecursive(n.getChildPanels(),t)}}}return o}function orientateAxisLinks(){var e=[];var t=[];for(var i in q){if(q[i].axisDep.length>0&&e.indexOf(i)===-1){t.push(i);e.push(i);var a=q[i].axisDep;for(var n=0;n<a.length;n++){e.push(a[n])}}}for(var n=0;n<t.length;n++){orientateSingleAxisLink(t[n])}}function getOrientation(e,i,a){var n=null;function processLG(e){if(e.type==="axis"&&(e.linkedType==="Time"&&a.extendedModel&&a.extendedModel.instanceOf==="TimeChartModel"||e.linkedType==="Structure"&&a.extendedModel&&a.extendedModel.instanceOf==="ChartModel")){for(var t=0;t<e.linkedCharts.length;t++){if(e.linkedCharts[t]===i){n=e.axisOrientation;break}}}}for(var t in e.linkGroups){processLG(e.linkGroups[t]);if(n!==null){break}}for(var r=0;n===null&&r<e.linkGroupsMultiple.length;r++){processLG(e.linkGroupsMultiple[r])}return n}function orientateSingleAxisLink(e){var t=[e];var i=q[e].axisDep;for(var a=0;a<i.length;a++){t.push(i[a])}var n=J[e].chart;var r=e.split(".")[0];var o=Mt["b"].DataObjects.DocumentDO.getExtension(r);var l=o.getController().getRootModel();var s=getOrientation(l,e,n);var d=true;var c=null;for(var a=0;a<t.length;a++){var u=J[t[a]];var p=u.panel.getLayout();var g=calculateContainerPosByPath(u.path);var h=p.calcChartSpace(u.chart);var f=Math.round(u.chart.extendedModel.axisFactor*h)+(n.extendedModel.instanceOf==="TimeChartModel"?g.y:g.x)+p.getAxisZeroPosition();if(c!==null&&c!==f){d=false;break}c=f}if(d){optimizeAxesGlobal(t,s)}}};var P=function(){function Iterator(t){var e=this;var i,a;var n=function(){i=0;if(t.constructor===Array){e.next=function(){return t[i++]||false}}else if(t.constructor===Object){a=Object.getOwnPropertyNames(t);e.next=function(){var e=a[i++];return e&&t[e]||false}}else{throw new Error("obj is neither an object nor an array")}};n();this.reset=function(){n()}}return Iterator}();Mt["b"].Layout.Iterator.OptimizeDependency=function(){this.valueDep=[];this.axisDep=[];this.axisPosition=0};Mt["b"].Layout.Iterator.OptimizeChartNode=function(){this.id="";this.chart=null;this.panel=null;this.path="";this.parent=null};Mt["b"].Layout=Mt["b"].Layout||{};Mt["b"].Layout.Overlay=Mt["b"].Layout.Overlay||{};Mt["b"].Layout.Overlay.OverlayLayout=function(e){var t="overlay";var g=e;this.getType=function(){return t};this.layoutPanels=function(e,t,i,a){var l={};var s=i.width;var d=i.height;var c=t.x;var u=t.y;a.getModel().scrollingData={realHeight:d,realWidth:s,width:s,height:d,scrollingVer:false,scrollingHor:false,x:c,y:u};var p=0;e.forEach(function(e){if(p<g.length){var t=g[p];var i=c+t.x;var a=u+t.y;var n=t.width;var r=t.height;var o=e.getPreferredSize();if(n===0){n=o.width;if(n===0){n=s-t.x}}if(r===0){r=o.height;if(r===0){r=d-t.x}}if(n===-1){n=s-t.x}if(r===-1){r=d-t.y}e.setDimension({width:n,height:r});e.setPosition({x:i,y:a})}l[e.getId()]=e;if(e.getId().indexOf("commentReference")===-1){p++}});var n=e[0];if(e.length===1&&n.getModel().instanceOf==="BackGroundModel"&&n.getController().getRootModel().buildUp===Mt["b"].Utils.Constants.BuildUp.DRAW){Mt["b"].Layout.Common.layoutClickBackground(n.getModel(),n.getPainter())}return l};this.getPreferredLayoutSize=function(e,t){var d=0;var c=0;var u=0;e.forEach(function(e){if(e.getId().indexOf("commentReference")!==-1){var t=e.getPosition().x;var i=e.getPosition().y;var a=e.getDimension().width;var n=e.getDimension().height}else{var r=g[u];var t=r.x;var i=r.y;var a=r.width;var n=r.height}if(t>d){d=t}if(i>c){c=i}if(a>0){if(t+a>d){d=t+a}}if(n>0){if(i+n>c){c=i+n}}var o=e.getPreferredSize();if(a===0||n===0){if(a===0){var l=o.width;if(t+l>d){d=t+l}}if(n===0){var s=o.height;if(i+l>c){c=i+s}}}if(e.getId().indexOf("commentReference")===-1){u++}});return{width:d,height:c}}};Mt["b"].Layout=Mt["b"].Layout||{};Mt["b"].Layout.Structure=Mt["b"].Layout.Structure||{};Mt["b"].Layout.Structure.CompareLayoutHelpers={layoutCompares:function(e,t,i,A,a,n){var _=Mt["b"].DataObjects.RuntimeDO;var r=Mt["b"].Utils.Calculator.Converter;var o=convertNMParameterForMultiple("MMPT_HIGHLIGHT_ELLIPSE_STROKE_WIDTH");var l=convertNMParameterForMultiple("MMPT_HIGHLIGHT_ARROW_SIZE");var s=convertNMParameterForMultiple("MMPT_HIGHLIGHT_PIN_SIZE");var L=Mt["b"].Utils.Constants.TypeValues.indicator;var d=A.getPosition().x;var I=A.getPosition().y;for(var c=0;c<e.length;c++){var u=e[c];var D=u.getModel();if(D.active===false){continue}var m=D.font;var p=D.compareFrom;var g=D.compareTo;if(p&&g){if(D.offset.y==-1){D.offset.y=0}var h=calculateCompareLayout(p,g,D.offset.y,d);D.fromPosition=h.fromPosition;D.toPosition=h.toPosition;u.setPosition(h.position);u.setDimension(h.dimension);D.preferredDimension=h.dimension;D.preferredPosition=h.position;var f=calculateCompareTextLayout(h);D.percent.position=f.percentPos;D.absolute.position=f.absolutePos;D.text.position=f.textPos;D.ellipseArray=f.ellipse;D.ellipseStrokeWidth=o;D.arrowType=h.arrowType;var v=D.compareStyle;if(v===L.NOTATION){v=_.getParameter("COMPARE_DEFAULT_TYPE")}if(v==="arrow"){D.headBaseSize=l;D.headWidth=_.getParameterParsed("FACTOR_HIGHLIGHT_ARROW_HEAD")*l;D.headLength=l}else{D.headBaseSize=s;D.headWidth=0;D.headLength=0}revertLegend();i[u.getId()]=u}D.compareFrom=null;D.compareTo=null}function convertNMParameterForMultiple(e){e=_.getParameterParsed(e);return n&&e!==0?Math.max(1,r.mm2pix(a*e)):r.mm2pix(a*e)}function revertLegend(){if(D.absolute.originalLegend&&D.absolute.originalLegend===L.AUTO){D.absolute.legend=D.absolute.originalLegend;delete D.absolute.originalLegend}if(D.percent.originalLegend&&D.percent.originalLegend===L.AUTO){D.percent.legend=D.percent.originalLegend;delete D.percent.originalLegend}if(D.text.originalLegend&&D.text.originalLegend===L.AUTO){D.text.legend=D.text.originalLegend;delete D.text.originalLegend}}function calculateCompareLayout(e,t,i,a){var n=1;var r=1;var o;var l=D.dimension.height;var s=D.compareConnectorSize;var d=0;var c=0;if(e==="axis"||D.compareFromCat==="axis"){d=Math.round(a)}else if(e.value>=0){if(D.compareFromStart==="end"){d=Math.round(e.position.x+e.dimension.width-n)}else{d=Math.round(e.position.x)}}else{if(D.compareFromStart==="end"){d=Math.round(e.position.x)}else{d=Math.round(e.position.x+e.dimension.width)}}if(t==="axis"||D.compareToCat==="axis"){c=Math.round(a)}else if(t.value>=0){if(D.compareToStart==="end"){c=Math.round(t.position.x+t.dimension.width-r)}else{c=Math.round(t.position.x)}}else{if(D.compareToStart==="end"){c=Math.round(t.position.x)}else{c=Math.round(t.position.x+t.dimension.width)}}var u={x:d,y:e!=="axis"?e.position.y+e.dimension.height/2:0};var p={x:c,y:t!=="axis"?t.position.y+t.dimension.height/2:0};if(t==="axis"||D.compareToCat==="axis"){p.y=u.y}else if(e==="axis"||D.compareFromCat==="axis"){u.y=p.y}if(d>c){var g=d;d=c;c=g;g=u;u=p;p=g}if(p.x<=u.x){var h=true;i=i+u.y-p.y}else{var h=false;i=i+p.y-u.y}var f=c-d;var m;var v=D.font.fSize;var b=0;if(D.ellipse){var T=_.getParameterParsed("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH");b=Math.round(D.maxWidth*T*2)}if(D.ellipse){if(f>b+2*v+1){m=0}else if(f>v){m=1}else{m=2}}else{var x=D.compareStyle;if(x===L.NOTATION){x=_.getParameter("COMPARE_DEFAULT_TYPE")}if(x===L.ARROW){if(f>D.maxWidth){m=0}else if(f>v){m=1}else{m=2}}else{if(f>D.maxWidth){m=0}else{m=1}}}if(l<s){l=s}if(D.compareLegend===L.START){var E=D.midMaxHeight;var y=D.topMaxHeight;var C=D.bottomMaxHeight;var S=E-l;if(S<0){S=0}var M=C+S/2;var O=I-l-M+D.offset.y;o={x:d,y:Math.round(O)}}else if(D.compareLegend===L.END){var E=D.midMaxHeight;var y=D.topMaxHeight;var C=D.bottomMaxHeight;var S=E-l;if(S<0){S=0}var M=y+S/2;var O=I+A.getDimension().height+M+D.offset.y;o={x:d,y:Math.round(O)}}else if(D.compareLegend===L.FROM){if(e!=="axis"){o={x:d,y:e.position.y+D.offset.y+e.dimension.height/2-l/2}}else{o={x:d,y:u.y+D.offset.y-l/2}}}else if(D.compareLegend===L.TO){if(t!=="axis"){o={x:d,y:t.position.y+D.offset.y+t.dimension.height/2-l/2}}else{o={x:d,y:p.y+D.offset.y-l/2}}}else{if(h){o={x:d,y:p.y+i}}else{o={x:d,y:Math.round(u.y+i)}}}return{dimension:{width:f,height:l},position:o,fromPosition:u,toPosition:p,arrowType:m}}function calculateCompareTextLayout(e){var t={x:0,y:0};var i={x:0,y:0};var a={x:0,y:0};var n;var r=e.position.x+e.dimension.width/2;var o=e.position.y;var l=D.dimension.height;var s=D.compareConnectorSize;if(l<s){l=s}var d=0;var c=0;var u=0;if(D.percent.legend!==L.NONE){if(D.percent.legend==="start"){d=d+1}else if(D.percent.legend==="mid"){c=c+1}else if(D.percent.legend==="end"){u=u+1}}if(D.absolute.legend!==L.NONE){if(D.absolute.legend==="start"){d=d+1}else if(D.absolute.legend==="mid"){c=c+1}else if(D.absolute.legend==="end"){u=u+1}}if(D.text.legend!==L.NONE&&D.text.text!==""){if(D.text.legend==="start"){d=d+1}else if(D.text.legend==="mid"){c=c+1}else if(D.text.legend==="end"){u=u+1}}var p=.5;if(D.ellipse){p=parseFloat(_.getParameter("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH"))}if(D.percent.legend!==L.NONE){i.x=Math.round(r-D.percent.dimension.width/2);if(e.dimension.width<D.percent.dimension.width&&d+c+u===1&&D.percent.legend!==L.AUTO){var g=Math.round(D.percent.dimension.width*p-D.percent.dimension.width/2)+Math.round(s/2)+1;D.percent.moved=true;if(D.positive){i.x=e.position.x+e.dimension.width+g}else{i.x=e.position.x-g-D.percent.dimension.width}}i.y=setPercentPosition(o,l,d,c,u)}if(D.absolute.legend!==L.NONE){t.x=Math.round(r-D.absolute.dimension.width/2);if(e.dimension.width<D.absolute.dimension.width&&d+c+u===1&&D.absolute.legend!==L.AUTO){var g=Math.round(D.absolute.dimension.width*p-D.absolute.dimension.width/2)+Math.round(s/2)+1;D.absolute.moved=true;if(D.positive){t.x=e.position.x+e.dimension.width+g}else{t.x=e.position.x-g-D.absolute.dimension.width}}t.y=setAbsolutePosition(o,l,d,c,u)}if(D.text.legend!==L.NONE&&D.text.text!==""){a.x=Math.round(r-D.text.dimension.width/2);if(e.dimension.width<D.text.dimension.width&&d+c+u===1&&D.text.legend!==L.AUTO){var g=Math.round(D.text.dimension.width*p-D.text.dimension.width/2)+Math.round(s/2)+1;D.text.moved=true;if(D.positive){a.x=e.position.x+e.dimension.width+g}else{a.x=e.position.x-g-D.text.dimension.width}}a.y=setTextPosition(o,l,d,c,u)}if(D.ellipse){n=setEllipse(d,c,u,l,r,o,i,a,t)}return{absolutePos:t,percentPos:i,textPos:a,ellipse:n}}function setEllipse(e,t,i,a,n,r,o,l,s){r=r+a/2;var d=n;var c={x:0,y:0,width:0,height:0};var u=D.topMaxHeight;var p=D.bottomMaxHeight;var g=0,h=0,f=0;if(a<D.midMaxHeight){g=(D.midMaxHeight-a)/2}if(e===3){h=u/2+a/2+2}else if(e===2){if(t===1){h=g+m.fSize/2+a/2}else{if(i===1){h=a/2;f=a}else{h=u/2+a/2}}}else if(e===1){if(t===1){if(i!==1){h=g+a/2}}else if(t===2){h=m.fSize/2}else if(t===0){if(i===1){f=a}else if(i===2){h=a/2*-1;f=a}else if(i===0){h=a/2+u/2}}}else if(t===2){if(i===1){h=a/2*-1}}else if(t===1){if(i===1){h=a/2*-1}else if(i===2){h=-a/2+m.fSize/2*-1}}else if(i===3){h=-a/2+p/2*-1}else if(i===2){h=-a/2+p/2*-1}else if(i===1){h=-a/2+p/2*-1}if(D.text.moved&&D.text.legend!==L.NONE&&D.text.text!==""){d=l.x+D.text.dimension.width/2}else if(D.percent.moved&&D.percent.legend!==L.NONE){d=o.x+D.percent.dimension.width/2}else if(D.absolute.moved&&D.absolute.legend!==L.NONE){d=s.x+D.absolute.dimension.width/2}c.x=Math.round(d);c.y=Math.round(r-h);c.width=Math.round(D.maxWidth);c.height=Math.round(D.topMaxHeight+D.midMaxHeight+D.bottomMaxHeight+f);return c}function setAbsolutePosition(e,t,i,a,n){var r=D.absolute.dimension;var o=D.topMaxHeight;var l=D.midMaxHeight;e=e+t/2;var s=0;if(t<l){s=Math.abs((l-t)/2)}var d=0;if(D.absolute.legend==="start"){if(i===3){d=e-D.topMaxHeight/2+r.height/2-s-t/2+1}else if(i===2){d=e-D.topMaxHeight/2-s-t/2+1}else if(i===1){d=e-o-s-t/2+1}}else if(D.absolute.legend==="mid"){if(a===3){d=e-r.height/2+1}else if(a===2){if(D.text.legend==="mid"&&D.text.text!==""){d=e+1}else{d=e-l/2+1}}else if(a===1){d=e-l/2+1}}else{if(n===3){d=e+2+t/2+s}else if(n===2||n===1){d=e+2+t/2+s}}return Math.round(d)}function setPercentPosition(e,t,i,a,n){var r=D.percent.dimension;var o=D.topMaxHeight;var l=D.midMaxHeight;var s=D.bottomMaxHeight;e=e+t/2;var d=0;if(t<l){d=Math.abs((t-l)/2)}var c=0;if(D.percent.legend==="start"){if(i===2){if(D.text.legend==="start"&&D.text.text!==""){c=e-o/2-t/2-d+1}else{c=e-o-d-t/2+1}}else{c=e-D.topMaxHeight/2-r.height/2-d-t/2+1}}else if(D.percent.legend==="mid"){if(a===3){c=e+l/2-r.height+1}else if(a===2){c=e+l/2-r.height+1}else if(a===1){c=e-l/2+1}}else{if(n===3){c=e+2+t/2+s/2-r.height/2}else if(n===2||n===1){if(D.absolute.legend==="end"){c=e+2+t/2+d+s/2}else{c=e+2+t/2+d}}}return Math.round(c)}function setTextPosition(e,t,i,a,n){var r=D.text.dimension;var o=D.topMaxHeight;var l=D.midMaxHeight;var s=D.bottomMaxHeight;e=e+t/2;var d=0;var c=0;if(t<l){c=Math.abs((t-l)/2)}if(D.text.legend==="start"){d=e-t/2-o-c+1}else if(D.text.legend==="mid"){d=e-l/2+1}else{d=e+2+t/2+s-r.height+c}return Math.round(d)}},setTextAndDimensions:function(e,t,i,a,n,r,o,l){var m=Mt["b"].DataObjects.RuntimeDO;var v=Mt["b"].DataObjects.DocumentDO.getPainter();var s=new Mt["b"].Utils.Calculator(i);s.setCondenseRoot(i.dataModel.baseNode);if(i.dataModel.dimSize===1){s.setCondenseLevel(1)}else{s.setCondenseLevel(0)}var b=Mt["b"].Utils.Constants.TypeValues.indicator;for(var d=0;d<t.length;d++){var c=t[d];var T=c.getModel();var x=T.font;T.type="structure";var u=Mt["b"].Layout.Common.getCompareToAndFrom(T,l,s,a);T.compareFrom=u.compareFrom;T.compareTo=u.compareTo;if(T.compareFrom===b.AXIS&&T.compareTo===b.AXIS){T.active=false;T.hide=true;continue}Mt["b"].Models.Actions.ViewModelActions.CompareModel.setText(T,i,l);if(T.compareFrom&&T.compareTo){var p=s.setupCompareFormulas(T,l.multiplePath,l.isMultipleTotal);if(p){T.active=true}else{T.active=false}}else{T.active=false}var g=getTextDimensions();T.absolute.dimension=g.absDim;T.percent.dimension=g.percDim;T.text.dimension=g.textDim;T.topMaxHeight=g.topMaxHeight;T.midMaxHeight=g.midMaxHeight;T.bottomMaxHeight=g.bottomMaxHeight;T.maxWidth=g.maxWidth}function getTextDimensions(){var u=0;var e={width:0,height:0},t={width:0,height:0},i={width:0,height:0};var p=0;var g=0;var h=0;var f=x.fWeight+" "+x.fSize+"px "+x.fType;if(T.compareFrom&&T.compareTo){calcDimensionAndMaxHeights(e,T.absolute,false);calcDimensionAndMaxHeights(t,T.percent,false);calcDimensionAndMaxHeights(i,T.text,true);if(T.ellipse){var a=parseFloat(m.getParameter("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH"));u=Math.round(u*a*2)}}return{absDim:e,percDim:t,textDim:i,topMaxHeight:p,midMaxHeight:h,bottomMaxHeight:g,maxWidth:u};function calcDimensionAndMaxHeights(e,t,i){if(i&&t.text===""){return}if(t.legend===b.NONE){return}t.moved=false;var a=v.measureTextDim(t.text,f);e.width=a.width;e.height=a.height;if(i&&e.height===0){e.height=x.fSize}u=Math.max(e.width,u);if(t.legend===b.AUTO){var n=T.compareFrom.position.x;var r=T.compareTo.position.x;var o=T.compareFromCat!==b.AXIS?n:0;var l=T.compareToCat!==b.AXIS?r:0;var s=Math.abs(o-l);var d=e.width;if(T.ellipse){var c=parseFloat(m.getParameter("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH"));d=d*c*2}t.originalLegend=t.legend;if(d<s){t.legend=b.START;p+=e.height}else{t.legend=b.END;g+=e.height}}else{if(t.legend===b.START){p+=e.height}else if(t.legend===b.MID){h+=e.height}else{g+=e.height}}}}},displaceCompares:function(e,t){var i=Mt["b"].Utils.Constants.TypeValues.indicator;function intersect(e,t,i,a){return e>i&&e<a||i>e&&i<t||e===i||t===a}function sortAsc(e,t){return e.getModel().displacePriority-t.getModel().displacePriority}var a=e.slice(0);a=a.sort(sortAsc);for(var n=0;n<a.length;n++){var r=a[n].getModel();if(!r.active){continue}var o=Mt["b"].Layout.Common.getMaxPosition(r,true,t);var l=o.position;var s=o.dimension;for(var d=n+1;d<a.length;d++){var c=a[d].getModel();if(!c.active||r.displacePriority===-1&&c.displacePriority===-1){continue}var u=Mt["b"].Layout.Common.getMaxPosition(c,true,t);var p=u.position;var g=u.dimension;var h=intersect(l.x,l.x+s.width,p.x,p.x+g.width);var f=intersect(l.y,l.y+s.height,p.y,p.y+g.height);if(h&&f){var m=l.y+s.height-p.y;c.displacement=m;c.displaced=true;c.position.y+=m;if(c.absolute.legend!==i.NONE){c.absolute.position.y+=m}if(c.percent.legend!==i.NONE){c.percent.position.y+=m}if(c.text.legend!==i.NONE&&c.text.text!==""){c.text.position.y+=m}if(c.ellipse){c.ellipseArray.y+=m}}}}}};var Tt=i(43);Mt["b"].Layout=Mt["b"].Layout||{};Mt["b"].Layout.Structure=Mt["b"].Layout.Structure||{};Mt["b"].Layout.Structure.StructureChartLayout=function(){var w=Mt["b"].DataObjects.RuntimeDO;var a=Mt["b"].Utils.Calculator.Converter;var M=Mt["b"].Utils.Constants.Parameters;var e=Mt["b"].Utils.Constants.TypeValues;var h=e.structureRepresentation;var F=e.notation;var B=e.concept;var n=e.indicator;var R=e.structurePosition;var I=e.categoryLabel;var b=Mt["b"].DataObjects.DocumentDO.getScalingGroups();var t=w.getParameter("FONT_FAMILY");var i=w.getParameter("FONT_STYLE_CHART");var E,O;var p;var k={width:0,height:0};var y=false;function mm2pix(e){return a.mm2pix(E*e)}function convertNMParameter(e){return mm2pix(w.getParameterParsed(e))}function convertNMParameterForMultiple(e){var t=w.getParameterParsed(e),i=a.mm2pix(E*t);return y&&t!==0?Math.max(1,i):i}var U=["structureLegendType.1","structureLegendType.2","structureLegendType.3"];var H=["structureLegendType.4","structureLegendType.5","structureLegendType.6"];var r,o={};var C,P,l,d;var g={},f={};var A,G,_,V=0,$=0;var m,N,c,S;var L,D;var v,T,x;var z;var W;var j=w.getParameterParsed("FACTOR_STRUCTURE_LABEL_BACKGROUND_TRANSPARENCY");var K,X,Y;var Z,Q,q;var J,ee;var s=w.getParameter("CHECK_STRUCTURE_SUBTOTAL_FONT_BOLD")==="true";var u=w.getParameter("CHECK_STRUCTURE_TOTAL_WITH_VALUES_FONT_BOLD")==="true";var te=true;var ie=null,ae=null;var ne,re;var oe;var le,se,de=null;var ce,ue;var pe,ge,he,fe;var me;var ve=0;var be,Te;var xe,Ee,ye;var Ce=null;var Se;var Me=false,Oe=false;var Ae=false;var _e=false,Le=false,Ie=false;var De=true;var Re;var Pe;var Ne,we=[];var Fe=[],Be=[];var ke={};var Ue={};var He={};var Ge={};var Ve=null,$e=null,ze=null,We=null;var je=[],Ke=[],Xe=[],Ye=[],Ze=[],Qe=[];var qe=[],Je=[];var et=[];var tt={},it={};var at=[],nt=[],rt=[],ot=[];var lt=[],st=[],dt=[],ct=[];var ut=[];var pt=[],gt=[],ht=[],ft=[];var mt=[],vt=[],bt=[];this.getType=function(){return"structurechart"};this.recalcLocalAxisFactor=function(){me=getAvailableSpace();calculateInitialAxisAndZoomFactors(false)};this.recalcLocalZoom=function(e,t){me=getAvailableSpace();var i=getPosNegAreas();if(e===undefined&&t===undefined){var a={};for(var n in Ue){var r=Ue[n];a[n]=r.manualScaling?b[r.originalScalingGroup].manualFactor:recalculateSingleZoomFactor(r,i.pos,i.neg)}for(var o in He){ae.zoom[o]=a[o]===undefined?a[He[o]]:a[o]}}else if(He[t]!==undefined){var l=He[t];var r=Ue[l];var s=r.manualScaling?b[r.originalScalingGroup].manualFactor:recalculateSingleZoomFactor(r,i.pos,i.neg);for(var d in He){if(He[d]===l){ae.zoom[d]=s}}return s}else{return null}};this.calcFreeSpace=function(){me=getAvailableSpace();var r=getPosNegAreas();var i=r.pos,a=r.neg;function updateFreeSpaces(e,t){if(t){i=e>=r.pos?0:Math.min(i,r.pos-e)}else{a=e>=r.neg?0:Math.min(a,r.neg-e)}}function updateFreeSpacesWithLegends(e,t){for(var i=0;i<e.scalingData.legendValues.length;i++){var a=e.scalingData.legendLabelWidths[i];if(r.pos+r.neg>=2*a){var n=Math.round(t*e.scalingData.legendValues[i]);if(Math.abs(n)>=a){updateFreeSpaces(Math.abs(n)+a,n>=0)}else{updateFreeSpaces(a+n,true);updateFreeSpaces(a-n-Te,false)}}}}for(var e in Ue){var t=Ue[e];var n=ne.globalZoom[e];if(ae.stackType==="%"&&t.stackRepresentations.length>0){if(_e){updateFreeSpaces(t.scalingData.maxPosTotalLabel+n,true)}if(Le){updateFreeSpaces(t.scalingData.maxNegTotalLabel+n,false)}updateFreeSpacesWithLegends(t,n)}else{updateFreeSpaces(t.scalingData.maxLabelWidthPos,true);updateFreeSpaces(t.scalingData.maxLabelWidthNeg,false);for(var o=0;o<t.scalingData.values.length;o++){var l=t.scalingData.values[o];var s=Math.round(n*Math.abs(l));var d=l>0||!De&&0===l;updateFreeSpaces(s+t.scalingData.labelWidths[o],d);updateFreeSpaces(t.scalingData.symbolSizes[o]-s,!d)}for(var o=0;o<t.scalingData.invertedValues.length;o++){var c=t.scalingData.invertedLabelWidths[o]-Math.round(n*Math.abs(t.scalingData.invertedValues[o]));updateFreeSpaces(c,t.scalingData.invertedValues[o]<0)}updateFreeSpacesWithLegends(t,n)}}if(Te!==be){updateFreeSpaces(be,false)}return{pos:i,neg:a}};this.calcChartSpace=function(){me=getAvailableSpace();return me};this.limitAxisFactor=function(e){var t=1;var i=be!==Te?be/me:0;for(var a in Ue){var n=Ue[a];t=Math.min(t,1-n.scalingData.maxLabelWidthPos/me);i=Math.max(i,n.scalingData.maxLabelWidthNeg/me);if(n.stackRepresentations.length>0&&Ie){t=Math.min(t,1-n.scalingData.maxPosTotalLabel/me);i=Math.max(i,n.scalingData.maxNegTotalLabel/me)}for(var r=0;r<n.scalingData.invertedLabelWidths.length;r++){var o=n.scalingData.invertedLabelWidths[r];var l=n.scalingData.invertedValues[r];if(l>=0){i=Math.max(i,(o-Math.round(l*ne.globalZoom[a]))/me)}else{t=Math.min(t,1-(o+l*ne.globalZoom[a])/me)}}for(var r=0;r<n.scalingData.legendValues.length;r++){if(n.scalingData.legendValues[r]===0){var s=n.scalingData.legendLabelWidths[r]/me;i=Math.max(i,s);t=Math.min(t,1-s)}}}if(e>t){return t}else if(e<i){return i}else{return e}};this.getAxisZeroPosition=function(){return Te+q};this.layoutPanels=function(e,t,i,a){var n={};if(e.length===0){return n}ie=a.getModel();ae=ie.extendedModel;re=Mt["b"].DataObjects.ContextRepo.getContextByCid(ae.contextId);var r=ie.border,o=ie.padding;ce=i;ue=t;pe=0;ge=0;he={width:ce.width-r.left.width-r.right.width-o.left-o.right,height:ce.height-r.top.width-r.bottom.width-o.top-o.bottom};fe=r.left.width+r.right.width+o.left+o.right+r.top.width+r.bottom.width+o.top+o.bottom>0;if(re===null||re.dataModel===null||re.dataModel.baseNode.nodes.length===0){for(var l=0;l<e.length;l++){if(e[l].getModel().instanceOf==="BackGroundModel"){$e=e[l];layoutBackground(n);break}}ie.scrollingData={width:ce.width,height:ce.height,realWidth:ce.width,realHeight:ce.height,scrollingVer:false,scrollingHor:false,x:ue.x,y:ue.y,id:ie.id};return n}if(te){collectData(e)}switch(ne.buildUp){case Mt["b"].Utils.Constants.BuildUp.PREINIT:{Pe=Mt["b"].Layout.Common.getLinkGroups(ne,ie.id,"Structure");getCategoryHeight();setRepresentationsHeights();Re+=2*N;n[ze.getId()]=ze}break;case Mt["b"].Utils.Constants.BuildUp.INIT:{ae.zoom={};xe=Mt["b"].Layout.Common.getAxisNotation(ae.expressions);Ee=xe?L:D;ye=Math.floor(Ee/2);Ce=getHeaderNotationRepresentationIndex();Mt["b"].Layout.Common.hideMinMaxLabels(je,Xe,ae);if(ae.stackShowLabel.split(".")[0]==="MinMax"){Mt["b"].Layout.Common.hideMinMaxTotals(je,at.concat(rt),ae)}else if(ae.stackShowLabel.split(".")[0]==="-"){var s=at.concat(rt);for(var l=0;l<s.length;l++){s[l].hideLabel=true;var d=Mt["b"].Layout.Common.getHighlight(ae,s[l],Mt["b"].Utils.Constants.TypeValues.highlightType.VALUE,true);if(d&&d.highlight){d.highlight.active=false}}}if(ae.stackShowLabel.split(".")[0]==="Function"){Mt["b"].Layout.Common.hideStackedValueLabels(ae,re,at.concat(rt))}prepare();setRepresentationPositioningOffsets();be=ze.getDimension().width;Te=ze.getModel().extendedModel.displayType===I.FREE_AXIS_POS?0:be;me=getAvailableSpace();calculateInitialAxisAndZoomFactors.call(this,true)}break;case Mt["b"].Utils.Constants.BuildUp.AXIS_ZOOM:{adjustAxisFactorToGlobalZoom.call(this)}break;case Mt["b"].Utils.Constants.BuildUp.LEGEND:{var c=this.calcFreeSpace();if(!Pe.axis){alignAxisHorizontally(c)}var u=ie.row;var p=getLegendAreas();var g=p.top;if(ut.length>0){Mt["b"].Layout.Common.setCompareMetaInformation(ut,true,O,convertNMParameterForMultiple,ie.extendedModel,mm2pix);Mt["b"].Layout.Structure.CompareLayoutHelpers.setTextAndDimensions(ne,ut,re,Ke,Ge,Ie,getPercentStackTotalValues(),ie);var h=getCompareAreas();g[2]=Math.max(g[2],h.top);p.bottom=Math.max(p.bottom,h.bottom)}if(se.extendedModel.maxValueRowLabelStructure[u]===undefined){se.extendedModel.maxValueRowLabelStructure[u]=g}else{var f=se.extendedModel.maxValueRowLabelStructure[u];f[0]=Math.max(f[0],g[0]);f[1]=Math.max(f[1],g[1]);f[2]=Math.max(f[2],g[2])}if(se.extendedModel.maxValueRowLabelStructureBottom[u]===undefined||se.extendedModel.maxValueRowLabelStructureBottom[u]<p.bottom){se.extendedModel.maxValueRowLabelStructureBottom[u]=p.bottom}n[ze.getId()]=ze}break;case Mt["b"].Utils.Constants.BuildUp.DRAW:{var f=se.extendedModel.maxValueRowLabelStructure[ie.row];Se=ge+Q+Math.max(f[0]+f[1],f[2]);adjustTopOffsetToLinkingAndAlignment(Pe.legend);var m=getAxisPosition();layoutBackground(n);layoutAxis(m,n);var v=ze.getModel();v.position.y=Se;if(Te!==be){v.position.x=pe+Ve.getPosition().x-be}else if(Pe.axis){if(v.extendedModel.alignment===Mt["b"].Utils.Constants.TypeValues.labelHorizontalAlignment.LEFT){v.position.x=pe+q}else if(v.extendedModel.alignment===Mt["b"].Utils.Constants.TypeValues.labelHorizontalAlignment.MIDDLE){var c=this.calcFreeSpace();v.position.x=pe+Math.round(c.neg/2)+q}else{var c=this.calcFreeSpace();v.position.x=pe+c.neg+q}}else{v.position.x+=q}n[ze.getId()]=ze;var b=getInitialMinMaxLabelXPos(m);var T=layoutRepresentations(m,b,n);layoutValuesRepresentationLabel(m,n);layoutTotals(b,n);layoutOutliers(T,m,b,n);hideOverlappingLabels();var x=getLegendOffsets();x.side=0;layoutLegend(m,x,n);layoutAnnotator(m,n);layoutScalingHelpers(m,x,n);layoutStackLines(m,x,n);if(ut.length>0){Mt["b"].Layout.Structure.CompareLayoutHelpers.layoutCompares(ut,Ke,n,Ve,E,y);Mt["b"].Layout.Structure.CompareLayoutHelpers.displaceCompares(ut,convertNMParameterForMultiple)}setDataForScrolling(e);defineAxisSeparators(Math.round(Ve.getModel().position.x+Ve.getModel().dimension.width/2))}break}return n};function calculateInitialAxisAndZoomFactors(e){var t={};var i={};for(var a in Ue){i[a]=calculateSingleAxisAndZoom(Ue[a])}var n=false,r=false;for(var o=0;o<ae.expressions.length;o++){var l=ae.expressions[o];var s=Ge[l.id];if(i[s]===undefined){i[s]=i[He[s]]}t[s]=i[s].scalingFactor;if(i[s].maxPositive!==0&&i[s].maxPositive===Math.abs(i[s].maxNegative)){n=true;r=true}else if(i[s].maxPositive>Math.abs(i[s].maxNegative)){n=true}else if(i[s].maxPositive<Math.abs(i[s].maxNegative)){r=true}}if(n&&r){ae.axisFactor=.5}else if(n){ae.axisFactor=0;for(var a in i){if(i[a].maxPositive!==0&&i[a].axisFactor>ae.axisFactor){ae.axisFactor=i[a].axisFactor}}}else if(r){ae.axisFactor=1;for(var a in i){if(i[a].maxNegative!==0&&i[a].axisFactor<ae.axisFactor){ae.axisFactor=i[a].axisFactor}}}else{ae.axisFactor=.5}if(be!==Te){if(ae.axisFactor*me<be+ye){ae.axisFactor=(be+ye)/me}}if(ae.axisFactor!==0&&ae.axisFactor!==1){var d=ye/me;ae.axisFactor=Math.max(ae.axisFactor,d);ae.axisFactor=Math.min(ae.axisFactor,1-d)}if(e){ae.zoom=t;this.recalcLocalZoom();for(var a in t){if(ne.globalZoom[a]==undefined||ne.globalZoom[a]>t[a]){ne.globalZoom[a]=t[a]}}}}function calculateSingleAxisAndZoom(e){var t=11;var i=3;if(Ie&&e.stackRepresentations.length>0){return calculatePercentStackAxisAndZoom(e)}var a=e.scalingData.values;var n=e.scalingData.labelWidths;var r=e.scalingData.symbolSizes;var o=e.scalingData.invertedValues;var l=e.scalingData.invertedLabelWidths;var s=e.scalingData.maxPosVal;var d=e.scalingData.maxPosLabel;var c=e.scalingData.maxNegVal;var u=e.scalingData.maxNegLabel;var p=e.scalingData.maxLabelWidthPos;var g=e.scalingData.maxLabelWidthNeg;var h=e.scalingData.legendValues;var f=e.scalingData.legendLabelWidths;if(c===s&&s===0){return{axisFactor:.5,scalingFactor:Mt["b"].Utils.Constants.Parameters.defaultZoomFactor,maxPositive:s,maxNegative:c}}if(p+g>me-i){var m=g/(p+g);return{axisFactor:m,scalingFactor:0,maxPositive:s,maxNegative:c}}var v=(me-u-d)/(s-c);var m;if(s===0&&d===0){m=1}else if(c===0&&u===0){m=0}else{m=(-c*v+u)/me}var b,T;var x,E;for(var y=0;y<t;y++){x=p;E=g;b=Math.round(me*m);T=me-b;for(var C=0;C<a.length;C++){var S=a[C];var M=Math.round(Math.abs(S)*v);var O=M+n[C];if(S>0||!De&&0===S){x=Math.max(x,O);E=Math.max(E,r[C]-M)}else{E=Math.max(E,O);x=Math.max(x,r[C]-M)}}for(var C=0;C<o.length;C++){var O=l[C]-Math.round(Math.abs(o[C])*v);if(o[C]<0){x=Math.max(x,O)}else{E=Math.max(E,O)}}var A=x-T;var _=E-b;var L=Math.round((_-A)/2);var I=A+_;var D=v-I/me*v;b+=Te;var R=0,P=0;for(var N=0;N<h.length;N++){if(me+Te<f[N]*2){continue}if(h[N]===0){if(b<f[N]){var O=f[N]-b;P=Math.max(P,O)}else if(T<f[N]){var O=f[N]-T;R=Math.max(R,O)}}else{var w=Math.round(h[N]*v);var F=b+w;var B=T-w;if(F<f[N]){var O=f[N]-F;P=Math.max(P,O);if(h[N]<0){D=Math.min(D,(w+O)/h[N])}}else if(B<f[N]){var O=f[N]-B;R=Math.max(R,O);if(h[N]>0){D=Math.min(D,(w-O)/h[N])}}}}var k=P-R;L=k===0?L:k;m+=L/me;m=Math.min(Math.max(m,0),1);v-=v-D}return{axisFactor:m,scalingFactor:v,maxPositive:s,maxNegative:c}}function calculatePercentStackAxisAndZoom(e){var t=11;var i=3;var a=_e?2147483647:0;var n=Le?-2147483647:0;var r=e.scalingData.maxPosTotalLabel;var o=e.scalingData.maxNegTotalLabel;var l=e.scalingData.legendValues;var s=e.scalingData.legendLabelWidths;if(r+o>me-i){var d=o/(r+o);return{axisFactor:d,scalingFactor:0,maxPositive:2147483647,maxNegative:-2147483647}}var c=me-r-o;var d;if(_e&&Le){c=Math.floor(c/2);d=.5}else if(_e){d=0}else if(Le){d=1}else{c=2147483647;d=.5}var u,p;for(var g=0;g<t;g++){u=Math.round(me*d);p=me-u;if(_e&&Le){c=Math.min(p-r,u-o)}else if(_e){c=p-r}else if(Le){c=u-o}else{c=2147483647}u+=Te;var h=0,f=0;for(var m=0;m<l.length;m++){if(me+Te<s[m]*2){continue}if(l[m]===0){if(u<s[m]){var v=s[m]-u;f=Math.max(f,v)}else if(p<s[m]){var v=s[m]-p;h=Math.max(h,v)}}else{var b=Math.round(l[m]*c);var T=u+b;var x=p-b;if(T<s[m]){var v=s[m]-T;f=Math.max(f,v)}else if(x<s[m]){var v=s[m]-x;h=Math.max(h,v)}}}var E;if(h===0&&f===0){u=me-p;if(_e&&Le){E=Math.floor((p-r-(u-o))/2)}else{E=0}}else if(h>0&&f>0){E=Math.floor((f-h)/2)}else if(h>0){E=-Math.floor(h/2)}else{E=Math.floor(f/2)}d+=E/me;d=Math.min(Math.max(d,0),1)}return{axisFactor:d,scalingFactor:c,maxPositive:a,maxNegative:n}}function recalculateSingleZoomFactor(e,n,r){if(e.stackRepresentations.length>0&&ae.stackType==="%"){return recalculatePercenStackZoomFactor(e,n,r)}var o=null;function calcFactorNormal(e,t){var i=(e>0||!De&&0===e?n:r)-t+.49;var a=i/Math.abs(e);if(o===null||a<o){o=a}}var t=e.scalingData.values;var i=e.scalingData.labelWidths;for(var a=0;a<t.length;a++){if(t[a]!==0){calcFactorNormal(t[a],i[a])}}if(o===null){o=Mt["b"].Utils.Constants.Parameters.defaultZoomFactor}var l=e.scalingData.legendValues;var s=e.scalingData.legendLabelWidths;for(var a=0;a<l.length;a++){if(l[a]===0){}else if(n+r<2*s[a]){}else{var d=Math.round(o*l[a]);var c;if(l[a]>0){c=n-d;if(c<s[a]){var u=s[a]-c;o=(d-u)/l[a]}}else if(l[a]<0){c=r+d+Te;if(c<s[a]){var u=s[a]-c;o=(d+u)/l[a]}}o=Math.max(0,o)}}return o<0||!isFinite(o)?0:o}function adjustAxisFactorToGlobalZoom(){var e=0;var t=0;var i=Math.round(me*ae.axisFactor);var a=me-i;for(var n in Ue){var r=ne.globalZoom[n];for(var o in He){if(He[o]===n){r=Math.min(r,ne.globalZoom[o])}}if(ae.zoom[n]<=r*.9){continue}var l=Ue[n];var s=l.scalingData.values;var d=l.scalingData.symbolSizes;var c=l.scalingData.invertedValues;var u=l.scalingData.invertedLabelWidths;var p=l.scalingData.legendValues;var g=l.scalingData.legendLabelWidths;for(var h=0;h<s.length;h++){var f=s[h];var m=Math.round(Math.abs(f)*r);if(f>0||!De&&0===f){t=Math.max(t,d[h]-m)}else{e=Math.max(e,d[h]-m)}}for(var h=0;h<c.length;h++){var v=u[h]-Math.round(Math.abs(c[h])*r);if(c[h]<0){e=Math.max(e,v)}else{t=Math.max(t,v)}}for(var b=0;b<p.length;b++){if(me+Te<g[b]*2||p[b]===0){continue}var T=Math.round(p[b]*r);e=Math.max(e,g[b]+T);t=Math.max(t,g[b]-T-Te)}}var x=false;if(e>a&&t>i){}else if(e>a){ae.axisFactor-=(e-a)/me;x=true}else if(t>i){ae.axisFactor+=(t-i)/me;x=true}if(x){this.recalcLocalZoom();for(var n in ae.zoom){if(ne.globalZoom[n]==undefined||ne.globalZoom[n]>ae.zoom[n]){ne.globalZoom[n]=ae.zoom[n]}}}}function recalculatePercenStackZoomFactor(e,t,i){var a=Math.min(t-e.scalingData.maxPosTotalLabel,i-e.scalingData.maxNegTotalLabel);if(_e&&Le){a=Math.min(t-e.scalingData.maxPosTotalLabel,i-e.scalingData.maxNegTotalLabel)}else if(_e){a=t-e.scalingData.maxPosTotalLabel}else if(Le){a=i-e.scalingData.maxNegTotalLabel}else{a=2147483647}var n=e.scalingData.legendValues;var r=e.scalingData.legendLabelWidths;for(var o=0;o<n.length;o++){if(n[o]===0){}else if(t+i<2*r[o]){}else{var l=Math.round(a*n[o]);var s;if(n[o]>0){s=t-l;if(s<r[o]){a=Math.floor((t-r[o])/n[o])}}else if(n[o]<0){s=i+l+Te;if(s<r[o]){a=Math.floor((i+Te-r[o])/n[o])}}a=Math.max(0,a)}}return a<0||!isFinite(a)?0:a}function getHeaderNotationRepresentationIndex(){for(var e=0;e<ae.expressions.length;e++){var t=ae.expressions[e];if(t.notation===F.HEADER){var i=t.id.split(".").pop();for(var a=0;a<je.length;a++){var n=je[a];if(n.dataId_expr===i&&n.valueType!=="FACTOR_NONE"&&!n.isNaN){return a}}}else if(t.notation===F.ELEMENT_HEADER){var i=t.id.split(".").pop();for(var a=0;a<Be.length;a++){var r=Be[a];var o=r.usedRuledEntry;if(o.referenceUsed&&!isNaN(r.value)&&r.key===i&&o.valueType!=="FACTOR_NONE"){return a}}}}return null}function prepare(){if(u||s){for(var e=0;e<je.length;e++){var t=Ze[e];(u&&t.isTotal||s&&t.isSubtotal)&&(t.fontWeight="bold")}}setLabelDimensions(Xe.concat(lt,at,rt,ht,vt));for(var i in Ue){prepareScalingDataForScalingBlock(Ue[i])}}function setLabelDimensions(e){for(var t=0;t<e.length;t++){var i=e[t];i.dimension=oe.measureTextDim(i.text,p,i.lineSpacing)}}function prepareScalingDataForScalingBlock(e){var t=e.representations;var i=e.valueLabels;var a=e.stackRepresentations;var n=[],r=[],o=[];var l=[],s=[];var d=0,c=0;var u=0,p=0;var g=0,h=0;var f=0,m=0;var v=0,b=0;for(var T=0;T<t.length;T++){var x=t[T];var E=i[T];if(x.isOutlier&&E&&x.valueType!=="FACTOR_NONE"){if(x.value>0||!De&&0===x.value){f=Math.max(f,E.hideLabel?C+S:E.dimension.width+W)}else{m=Math.max(m,E.hideLabel?C+S:E.dimension.width+W)}}}h=f;g=m;function collectDataFromSingleValue(e,t){var i;if(e.instanceOf==="StructureWaterfallModel"){if(e.value<0&&e.relativeValue<0||e.value>=0&&e.relativeValue>=0){i=e.referencePointerSum+e.relativeValue}else{l.push(e.referencePointerSum+e.relativeValue);var a=t&&!t.hideLabel?t.dimension.width+W:0;s.push(a);return}}else if(e.instanceOf==="ValueModel"){i=e.value*1e-100;if(!Ae){var a=t&&!t.hideLabel?Math.round(t.dimension.width/2):0;if(n[0]===undefined){d=-1e-127;c=1e-127;n[0]=c;n[1]=d;o[0]=0;o[1]=0;r[0]=a;r[1]=a;p=a;u=a}else if(r[0]<a){r[0]=a;r[1]=a;p=a;u=a}return}}else{i=e.referencePointerSum!==undefined?e.referencePointerSum+e.value:e.value}n.push(i);o.push(e.needleSize===undefined?0:Math.floor(e.needleSize/2));var a=t&&!t.hideLabel?t.dimension.width+W:0;if(e.instanceOf==="StructureLineModel"){a+=Math.ceil(Math.max(e.needleSize,e.lineWidth)/2)}else{a+=e.needleSize?Math.ceil(e.needleSize/2):0}if(i>0||!De&&0===i){a=Math.max(a,f);h=Math.max(h,a)}else{a=Math.max(a,m);g=Math.max(g,a)}r.push(a);if(i<d){d=i;u=a}else if(i>c){c=i;p=a}}for(var T=0;T<t.length;T++){var x=t[T];if(x.valueType!=="FACTOR_NONE"&&!x.isNaN){if(!x.isOutlier){collectDataFromSingleValue(x,i[T])}}}if(Ie){for(var T=0;T<a.length;T++){var x=a[T];if(!x.label.hideLabel){if(x.value>0||!De&&0===x.value){v=Math.max(v,x.label.dimension.width)}else{b=Math.max(b,x.label.dimension.width)}}}}else{for(var T=0;T<a.length;T++){var x=a[T];collectDataFromSingleValue(x,x.label)}}p=p===0?f:p;u=u===0?m:u;ve=Math.max(u+p,ve);var y=collectLegendDataForScaling(e.exprs);e.scalingData={values:n,labelWidths:r,symbolSizes:o,invertedValues:l,invertedLabelWidths:s,maxPosVal:c,maxPosLabel:p,maxNegVal:d,maxNegLabel:u,maxLabelWidthPos:h,maxLabelWidthNeg:g,maxPosTotalLabel:v>0?v+W:0,maxNegTotalLabel:b>0?b+W:0,legendValues:y.values,legendLabelWidths:y.labelWidths}}function collectLegendDataForScaling(e){var n=[],r=[];var t=false;function getLabel(e){for(var t=0;t<lt.length;t++){if(lt[t].dataId_expr===e){return lt[t]}}return null}function getValue(e,t){if(!e||e.isOutlier){return 0}if(e.isStack){if(Ie){return getPercentStackValue(e,t)}else{return(e.referencePointerSum||0)+e.stackModel.startOn+e.value/t}}else if(e.relativeValue!=undefined){return(e.referencePointerSum||0)+e.relativeValue-(t===1?0:e.value/t)}else{return(e.referencePointerSum||0)+e.value/t}}for(var i=0;i<e.length;i++){var a=e[i];if(a.legendInGrid){var o=a.id.split(".").pop();var l=a.valueRowLabelPosition.split(".")[1];if(l!=="0"){var s;switch(l){case"2":case"5":s=0;break;case"1":var d=Mt["b"].Layout.Common.getFirstNonZeroRepresentationByExprId(tt[o],o,true);s=getValue(d,1);break;case"3":var d=Mt["b"].Layout.Common.getFirstNonZeroRepresentationByExprId(tt[o],o,true);s=getValue(d,2);break;case"4":var d=Mt["b"].Layout.Common.getFirstNonZeroRepresentationByExprId(tt[o],o,false);s=getValue(d,1);break;case"6":var d=Mt["b"].Layout.Common.getFirstNonZeroRepresentationByExprId(tt[o],o,false);s=getValue(d,2);break}n.push(s);var c=getLabel(a.id.split(".").pop());var u=c?Math.round(c.dimension.width/2):0;if(c){u=c.isHighlighted?u*G*2:u}r.push(c?u+Z-q:0)}t=true}}if(Ce!==null){var d=je[Ce];var a=ke[d.dataId_expr];if(a.legendInGrid){var l=a.valueRowLabelPosition.split(".")[1];var c=getLabel(d.dataId_expr);if(c===null||l!=="2"&&l!=="3"){n.push(0);var u=c===null?oe.measureTextDim(a.name,p).width:c.dimension.width;r.push(Math.round(u/2)+Z)}}}if(ae.stackMode&&Ie&&e[0].isStack&&t&&ae.stackLine!=="-"){if(_e){addStackPercentLabel("pos",1)}if(Le){addStackPercentLabel("neg",-1)}}return{values:n,labelWidths:r};function addStackPercentLabel(e,t){var i;for(var a=0;a<vt.length;a++){i=vt[a];if(i.id.substr(-3)===e){break}}n.push(t);r.push(Math.round(i.dimension.width/2))}}function getCategoryHeight(){var e=ie.row,t;if(Pe.legend&&Pe.legend.categoryHeight==undefined||!Pe.legend&&se.categoryHeight[e]===undefined){var i=[];if(Pe.legend){i=Mt["b"].Layout.Common.getLinkedContainers(Pe.legend,ne,ie)}else{var a=e*se.extendedModel.gridColumns.length;for(var n=0;n<se.extendedModel.gridColumns.length;n++){var r=se.children[n+a];var o=Mt["b"].DataObjects.ContextRepo.getContextByCid(r.extendedModel.contextId);if(r&&r.extendedModel.instanceOf==="ChartModel"&&o!==null&&o.dataModel&&o.dataModel.baseNode.nodes.length){i.push(r)}}}var l={};l[R.TOP_TOP]="startStart";l[R.TOP]="start";l[R.MID_TOP]="midStart";l[R.MID]="mid";l[R.MID_BOTTOM]="midEnd";l[R.BOTTOM]="end";l[R.BOTTOM_BOTTOM]="endEnd";t=Mt["b"].Layout.CategorySizeCalculator.getCategorySizes(i,l,E,w.getParameterParsed("MMPT_STRUCTURE_BAR_HEIGHT"),w.getParameterParsed("MMPT_STRUCTURE_SYMBOL_SIZE"),w.getParameterParsed("FACTOR_STRUCTURE_ELEMENT_DISPLACEMENT"),w.getParameterParsed("MMPT_STRUCTURE_CATEGORY_DISTANCE"),"structure",ie.multiplePath,ie.isMultipleTotal);Pe.legend?Pe.legend.categoryHeight=t:se.categoryHeight[e]=t}else{t=Pe.legend?Pe.legend.categoryHeight:se.categoryHeight[e]}Re=t.categorySize;m=t.categoryDistance;N=m}function setRepresentationsHeights(){var t=w.getParameterParsed("MMPT_STRUCTURE_BAR_HEIGHT")*r;var i=w.getParameterParsed("MMPT_STRUCTURE_SYMBOL_SIZE")*r;function getBarHeight(e){return mm2pix(t*e)}function getNeedleSize(e){return mm2pix(i*e)}for(var e=0;e<je.length;e++){var a=je[e];if(o[a.valueType]===undefined){o[a.valueType]=w.getValueTypeFactor(a.valueType);g[a.valueType]=getBarHeight(o[a.valueType]);f[a.valueType]=getNeedleSize(o[a.valueType])}if(a.instanceOf==="BarModel"||a.instanceOf==="StructureWaterfallModel"||a.instanceOf==="ValueModel"){a.dimension.height=g[a.valueType]}else{var n=ke[a.dataId_expr].representation;if(n===h.LINE){a.needleSize=0;a.dimension.height=a.lineWidth=l}else if(n===h.SYMBOL_LINE){a.needleSize=f[a.valueType];a.lineWidth=l;a.dimension.height=Math.max(a.needleSize,l)}else{a.dimension.height=a.needleSize=f[a.valueType]}}}}function setRepresentationPositioningOffsets(){var e=[];var t=Pe.legend?Pe.legend.categoryHeight:se.categoryHeight[ie.row];var i=t.positionCount===1;for(var a in ke){var n=tt[a];for(var r=0;r<n.length;r++){if(e[r]==undefined){e[r]=[]}e[r].push(n[r])}}function getMasterHeight(e,t){var i;if(e.valueType==="FACTOR_AMOUNT"){i="FACTOR_RELATION"}else if(e.valueType==="FACTOR_RELATION"){i="FACTOR_AMOUNT"}else if(e.valueType==="FACTOR_QUANTITY"){i="FACTOR_AMOUNT"}else{return 0}var a=null;for(var n=0;n<t.length;n++){if(e.valueType===t[n].valueType){a=t[n];break}else if(a===null||t[n].valueType===i){a=t[n]}}return g[a===null?e.valueType:a.valueType]}for(var r=0;r<e.length;r++){var o=e[r];var n={topTop:[],top:[],midTop:[],mid:[],midBot:[],bot:[],botBot:[]};for(var l=0;l<o.length;l++){var s=o[l];if(s.valueType==="FACTOR_NONE"){continue}switch(s.positioning){case R.TOP_TOP:(i?n.top:n.topTop).push(s);break;case R.MID_TOP:(i?n.mid:n.midTop).push(s);break;case R.TOP:n.top.push(s);break;case R.MID:n.mid.push(s);break;case R.BOTTOM:n.bot.push(s);break;case R.MID_BOTTOM:(i?n.mid:n.midBot).push(s);break;case R.BOTTOM_BOTTOM:(i?n.bot:n.botBot).push(s);break}}var d=t.startOffset,c=t.midOffset,u=t.endOffset;if(i){d=c=u=Math.round(t.categorySize/2)}for(var l=0;l<n.topTop.length;l++){var s=n.topTop[l];var p=getMasterHeight(s,n.top);s.position.y=d-Math.round(p/2)-s.dimension.height+Math.round(s.dimension.height/2)}for(var l=0;l<n.top.length;l++){n.top[l].position.y=d-Math.round(n.top[l].dimension.height/2)}for(var l=0;l<n.midTop.length;l++){var s=n.midTop[l];var p=getMasterHeight(s,n.mid);s.position.y=c-Math.round(p/2)-s.dimension.height+Math.round(s.dimension.height/2)}for(var l=0;l<n.mid.length;l++){n.mid[l].position.y=c-Math.round(n.mid[l].dimension.height/2)}for(var l=0;l<n.midBot.length;l++){var s=n.midBot[l];var p=getMasterHeight(s,n.mid);s.position.y=c-Math.round(p/2)+p-s.dimension.height+Math.round(s.dimension.height/2)-1}for(var l=0;l<n.bot.length;l++){n.bot[l].position.y=u-Math.round(n.bot[l].dimension.height/2)}for(var l=0;l<n.botBot.length;l++){var s=n.botBot[l];var p=getMasterHeight(s,n.bot);s.position.y=u-Math.round(p/2)+p-s.dimension.height+Math.round(s.dimension.height/2)-1}}}function getPosNegAreas(){var e=ae.axisFactor;var t=Math.round(me*e);var i=me-t;if(e===0){i-=ye}else if(e===1){t-=ye}return{pos:i,neg:t}}function getAxisPosition(){var e=Math.round(me*ae.axisFactor)+Te+q;if(ae.axisFactor===0){e+=ye}else if(ae.axisFactor===1){e-=ye}return e}function getLegendAreas(){var e=0,t=0;var i=preLayoutLegendLabels();for(var a=0;a<i.top.length;a++){var n=i.top[a];var r=-n.position.y+V/2;e=Math.max(e,r);Me=Me||n.showConnector}var o=i.top.length>0?Y:0;o+=Me?K:0;if(Ce!==null){o=Math.max(o,v+T+x)}var l=null;for(var a=0;a<je.length&&je[0].dataId_dim===je[a].dataId_dim;a++){var s=je[a];var d=s.position.y+Math.round((s.dimension.height-Ze[a].dimension.height)/2);l=l===null||l>d?d:l}var c=ze.getModel().children[0];if(c){var d=Math.round((Re-c.dimension.height)/2);l=l===null||l>d?d:l}if(l!==null&&l<0){l=-l}else{l=0}for(var a=0;a<i.bottom.length;a++){var n=i.bottom[a];var r=n.position.y+n.dimension.height+$/2;t=Math.max(t,r);Oe=Oe||n.showConnector}var u=t===0?0:Y+t+(Oe?K:0);return{top:[o,e,l],bottom:u}}function getCompareAreas(){var e=0,t=0;var n=ze.getModel().extendedModel;var i=Mt["b"].Models.Actions.ExtendedModelActions.DimensionLabelModel.getEmptySpacesSum(n);var a=we.length*Re+i;function getCategoryIndex(e){var t=0,i=0;for(;t<we.length&&we[t]!==e;t++){if(we[t]!==null){i++}}var a=Mt["b"].Models.Actions.ExtendedModelActions.DimensionLabelModel.getEmptySpacesBeforePosition(n,i);return{categoryIndex:t,emptysSum:a}}for(var r=0;r<ut.length;r++){var o=ut[r].getModel();if(o.font==null||o.compareFrom==null||o.compareTo==null){continue}var l=Math.max(o.dimension.height,o.compareConnectorSize);if(o.compareLegend==="start"){var s=o.topMaxHeight+Math.max(l,o.midMaxHeight)+o.bottomMaxHeight;e=Math.max(e,s-o.offset.y);t=Math.max(t,Math.round(s+o.offset.y-a))}else if(o.compareLegend==="end"){var s=o.topMaxHeight+Math.max(l,o.midMaxHeight)+o.bottomMaxHeight;e=Math.max(e,-o.offset.y-a);t=Math.max(t,s+o.offset.y)}else{var d=o.compareLegend==="from"&&o.compareFrom!=="axis"||o.compareTo==="axis"?o.compareFrom:o.compareTo;var c=getCategoryIndex(d.dataId_dim);var u=Re*c.categoryIndex+m+c.emptysSum+d.position.y+d.dimension.height/2;var p=Math.round(Math.max(l,o.midMaxHeight)/2);var g=p+o.topMaxHeight;var h=p+o.bottomMaxHeight;e=Math.max(e,Math.round(g-u-o.offset.y));t=Math.max(t,Math.round(h+u+o.offset.y-a))}}return{top:e,bottom:t}}function preLayoutLegendLabels(){if(ht.length===0&&lt.length===0&&vt.length===0){return{top:[],bottom:[]}}var e=sortLegendLabels();var r=[],o=[],l=[];var s=[],d=[],c=[];var u=[],p=[];var g=getAxisPosition();function getPosX(e,t,i){if(!t||t.isOutlier){return g}else{var a=Ge[ke[t.dataId_expr].id];var n;if(t.isStack){if(Ie){n=getPercentStackValue(t,i?1:2)}else{n=t.stackModel.startOn+(t.referencePointerSum||0)+(i?t.value:t.value/2)}}else if(t.relativeValue!=undefined){n=(t.referencePointerSum||0)+t.relativeValue-(i?0:t.value/2)}else{n=(t.referencePointerSum||0)+(i?t.value:t.value/2)}return g+Math.round(ne.globalZoom[a]*n)}}function allocate(e,t,i,a,n){if(i==="Always"){(t?r:s).push(e)}else if(i==="Horizontal"){if(t){o.push(e);u.push(n<a?[n,a]:[a,n])}else{d.push(e);p.push(n<a?[n,a]:[a,n])}}else if(i==="Vertical"){(t?l:c).push(e)}}if(Ie){var t=getPercentStackZoomFactor();for(var i=0;i<vt.length;i++){var a=vt[i];if(_e&&a.id.substr(-3)==="pos"){a.position.x=getPercentStackEndPosition(g,t,true);var n=ae.stackLine==="Start";a.position.y=n?-a.dimension.height-O-M.textLineSpacing:O+M.textLineSpacing;a.textAnchor="middle";allocate(a,n,"Always",g,a.position.x);var h={instanceOf:"LabelModel",position:{x:a.position.x,y:n?-O:0},dimension:{height:O,width:Math.round(O/2)},textAnchor:"middle"};allocate(h,n,"Always",g,h.position.x)}else if(Le&&a.id.substr(-3)==="neg"){a.position.x=getPercentStackEndPosition(g,t,false);var n=ae.stackLine==="Start";a.position.y=n?-a.dimension.height-O-M.textLineSpacing:O+M.textLineSpacing;a.textAnchor="middle";allocate(a,n,"Always",g,a.position.x);var h={instanceOf:"LabelModel",position:{x:a.position.x,y:n?-O:0},dimension:{height:O,width:Math.round(O/2)},textAnchor:"middle"};allocate(h,n,"Always",g,h.position.x)}}}for(var i=0;i<ht.length;i++){var a=ht[i];var f=a.id.split(".");var m,v=f[0]+"."+f[1].replace("scalingHelperLabel","scalingHelper");for(var b=0;b<pt.length;b++){if(pt[b].id===v){m=pt[b];break}}var T=Math.round(m.value*ne.globalZoom[Ge[m.expressionId]]);if(!isFinite(T)){T=0}var x=a.valueRowLabelPosition.split(".");var n=x[0]==="Start";a.position={x:g+T,y:n?-a.dimension.height:0};a.textAnchor="middle";allocate(a,n,x[1],g,a.position.x)}for(var i=0;i<e.length;i++){var a=e[i];var E=a.valueRowLabelPosition.split(".");var y;var n;switch(E[1]){case"1":n=true;var C=Mt["b"].Layout.Common.getFirstNonZeroRepresentationByExprId(je,a.dataId_expr,true);y=getPosX(a.dataId_expr,C,true);break;case"2":n=true;y=g;break;case"3":n=true;var C=Mt["b"].Layout.Common.getFirstNonZeroRepresentationByExprId(je,a.dataId_expr,true);y=getPosX(a.dataId_expr,C,false);break;case"4":n=false;var C=Mt["b"].Layout.Common.getFirstNonZeroRepresentationByExprId(je,a.dataId_expr,false);y=getPosX(a.dataId_expr,C,true);break;case"5":n=false;y=g;break;case"6":n=false;var C=Mt["b"].Layout.Common.getFirstNonZeroRepresentationByExprId(je,a.dataId_expr,false);y=getPosX(a.dataId_expr,C,false);break}allocate(a,n,E[2],g,y);var S=a.dimension.height;if(a.isHighlighted&&ke[a.dataId_expr].legendInGrid){if(n){V=Math.max(V,S*A+2*_-S)}else{$=Math.max($,S*A+2*_-S)}}a.position={x:y,y:n?-S:0};a.textAnchor="middle"}handleLegendDisplacement(r,o,l,u,true);handleLegendDisplacement(s,d,c,p,false);return{top:r.concat(o,l),bottom:s.concat(d,c)}}function getPercentStackZoomFactor(){var e;for(var t in Ue){if(Ue[t].stackRepresentations.length>0){e=ne.globalZoom[t];break}}return e}function getPercentStackEndPosition(e,t,i){return i?e+t-1:e-t+1}function sortLegendLabels(){var e=[R.BOTTOM_BOTTOM,R.MID_BOTTOM,R.BOTTOM,R.MID,R.TOP,R.MID_TOP,R.TOP_TOP];var t=[];for(var i=0;i<e.length;i++){for(var a=0;a<ae.expressions.length;a++){var n=ae.expressions[a];if(n.currPosition===e[i]){var r=n.id.split(".")[2];for(var o=0;o<lt.length;o++){var l=lt[o];if(l.dataId_expr===r){t.push(l)}}}}}return t}function handleLegendDisplacement(e,t,i,a,n){if(t.length===0&&i.length===0){return}var r=[];var o=[[pe,pe+he.width+1e3]];for(var l=0;l<e.length;l++){var s=e[l];var d=Mt["b"].Models.Actions.ViewModelActions.LabelModel.getBox(s);r.push(d);if(!s.id||s.id.indexOf("stackLineLabel")===-1){allocateLabel(o,[d.x,d.x+d.width])}}for(var l=0;l<t.length;l++){var s=t[l];var d=Mt["b"].Models.Actions.ViewModelActions.LabelModel.getBox(s);var c=findBestPosition(o,he.width,[d.x,d.x+d.width]);s.position.x-=d.x-c;d.x=c;r.push(d);allocateLabel(o,[d.x,d.x+d.width]);if(s.showConnector&&(s.position.x>a[l][1]||s.position.x<a[l][0])){s.showConnector=false}if(s.dataId_expr===null||ke[s.dataId_expr].legendInGrid){if(n){if(s.isHighlighted&&s.position.y<=d.y){V=Math.max(V,s.dimension.height*A+2*_-s.dimension.height)}}else{if(s.isHighlighted&&s.position.y>=d.y){$=Math.max($,s.dimension.height*A+2*_-s.dimension.height)}}}}for(var l=0;l<i.length;l++){var s=i[l];var d=Mt["b"].Models.Actions.ViewModelActions.LabelModel.getBox(s);var u=0;while(u<r.length){if(Mt["b"].Layout.Common.boxesOverlap(d,r[u],J,ee)){if(n){d.y=r[u].y-d.height-M.textLineSpacing}else{d.y=r[u].y+r[u].height+M.textLineSpacing}s.position.y=d.y;if(s.dataId_expr===null||ke[s.dataId_expr].legendInGrid){if(n){if(s.position.y<=r[u].y&&s.isHighlighted){V=Math.max(V,s.dimension.height*A+2*_-s.dimension.height)}else{V=0}}else{if(s.position.y>=r[u].y&&s.isHighlighted){$=Math.max($,s.dimension.height*A+2*_-s.dimension.height)}else{$=0}}}u=0}else{u++}}r.push(d)}function allocateLabel(e,t){var i=10;for(var a=0;a<e.length;a++){if(e[a][0]>t[1]||e[a][1]<t[0]){}else if(e[a][0]<=t[0]&&e[a][1]>=t[1]){var n=e[a][1];e[a][1]=t[0];if(n-t[1]>=i){e.splice(a+1,0,[t[1],n])}if(e[a][1]-e[a][0]<i){e.splice(a,1)}return}else if(e[a][0]<=t[1]&&e[a][0]>=t[0]){e[a][0]=t[1];if(e[a][1]-e[a][0]<i){e.splice(a,1)}return}else if(e[a][1]<=t[1]&&e[a][1]>=t[0]){e[a][1]=t[0];if(e[a][1]-e[a][0]<i){e.splice(a,1)}return}else{console.warn("structure.allocateLabel: impossible path")}}}function findBestPosition(e,t,i){var a=(i[0]+i[1])/2;var n=32767,r=-1;var o=32767,l=-1;for(var s=0;s<e.length;s++){if(e[s][0]<=i[0]&&e[s][1]>=i[1]){return i[0]}else{if(e[s][1]-e[s][0]>=i[1]-i[0]){var d=Math.min(Math.abs(a-e[s][0]),Math.abs(a-e[s][1]));if(i[0]<e[s][0]&&e[s][0]+i[1]-i[0]>t){if(d<o){o=d;l=s}}else{if(d<n){n=d;r=s}}}}}if(r===-1&&l===-1){console.warn("structure.findBestPosition: container is too small for legend");return i[0]}var c=r===-1?l:r;if(Math.abs(a-e[c][0])<Math.abs(a-e[c][1])){return e[c][0]}else{return e[c][1]-(i[1]-i[0])}}}function alignAxisHorizontally(e){var t=0;if(e.neg>0&&(ae.axisAlignmentElement==="Start"||ae.axisAlignmentElement==="Auto")){ae.axisFactor-=(e.neg-.49)/me;t=-e.neg}else if(e.pos>0&&ae.axisAlignmentElement==="End"){ae.axisFactor+=(e.pos-.49)/me;t=e.pos;ze.getModel().position.x+=e.pos+e.neg}else if(Math.abs(e.pos-e.neg)>=2&&ae.axisAlignmentElement==="Mid"){t=Math.floor((e.pos-e.neg)/2);ae.axisFactor+=t/me;ze.getModel().position.x+=e.neg+t}else if(ae.expressions.length===0&&ae.axisAlignmentElement==="Mid"){var i=e.pos+e.neg+convertNMParameter("MMPT_STRUCTURE_CATEGORY_LABEL_AXIS_DISTANCE");i>0&&(ze.getModel().position.x+=Math.floor(i/2))}return t}function adjustTopOffsetToLinkingAndAlignment(e){if(e!==null&&e!==undefined){for(var t=0;t<e.linkedCharts.length;t++){var i=e.linkedCharts[t].split(".").pop();if(i!==ie.id){var a=Mt["b"].Factories.ModelFactory.getModelById(ne,i);if(a!==null&&a!==undefined){var n=Mt["b"].Factories.ModelFactory.getParentContainer(ne.firstObjectGrid,a)[0];if(n!==null&&n!==undefined){if(se.id!==n.id){var r=n.extendedModel.maxValueRowLabelStructure[a.row];if(r!==null&&r!==undefined){var o=ge+Q+Math.max(r[0]+r[1],r[2]);Se=Math.max(Se,o)}}}}}}}var l=he.height-Se-Q-we.length*Re-se.extendedModel.maxValueRowLabelStructureBottom[ie.row];if(l>0){if(e!==null){if(e.legendOrientation==="Bottom"){Se+=l}else if(e.legendOrientation==="Mid"){Se+=Math.round(l/2)}}else{if(ae.axisAlignmentCategory==="End"){Se+=l}else if(ae.axisAlignmentCategory==="Mid"){Se+=Math.round(l/2)}}}}function layoutAxis(e,t){var i=Ve.getModel();var a=ae.dimensionLabelModel.calculatedEmptySpaces;var n=ze.getModel().extendedModel;var r=Mt["b"].Models.Actions.ExtendedModelActions.DimensionLabelModel.getEmptySpacesSum(n);var o=we.length*Re+r;i.position={y:Se,x:e-ye};i.dimension={width:Ee,height:o};if(je.length===0){Ve.setPosition({y:Se,x:e});i.paintAxis=Ae;t[Ve.getId()]=Ve;return}var l,s,d,c=0;if(xe){var u=0;var p=undefined;var g=undefined;for(var h=0,f=0;h<we.length;h++){if(we[h]===null){continue}var m=Re;var v=a[we[h]];if(v!==undefined&&h+1==v.positionCnt){if(v.position==="start"&&v.axisSplit===true){u+=v.space_px}else if(v.axisSplit===false){m+=v.space_px}}var b=Mt["b"].Models.Actions.DataModelActions.getDimensionNodeFromArray(we[h],Ne,f++);if(b===null||b.hide){continue}var T=Mt["b"].Layout.Common.getExpressionForAxisSegment(ae.expressions,b);var x=T.node.usedRuledEntry;var E=T.expr.notation===F.AXIS;var y,C,S,M,O;if(x.valueType==="FACTOR_NONE"||!E&&!x.referenceUsed){S=s="Actual";y=w.getDataType(S).subtypes.ACT0.settings.p;y=l={pattern:y.otherFill1,background:y.otherFill2,border:y.otherBorder};C=d=B.AREA;M=F.AXIS;O="diagonal"}else{if(T.expr.notation===F.ELEMENT_AXIS){C=d=T.expr.referenceConcept}else{C=d=T.expr.concept}M=T.expr.notation;S=s=E?x.baseDataType:x.referenceDataType;if(S==null){S=s=Tt["a"].dataType}var A;var _=tt[T.node.key];for(var L=0;L<_.length;L++){var I=_[L];if(I.dataId_dim===b.value){A=I.instanceOf==="StructureWaterfallModel"&&(I.waterfallType===0||I.waterfallType===1||I.waterfallType===2);break}}y=l=Mt["b"].Layout.Common.getNotationColorStructure(x,C,E,T.node.value>=0,A,false);O=Mt["b"].Layout.Common.getOtherPattern(x,M,C,E)}if(i.segments.length===0){i.segments.push({concept:C,y:Se+u,pattern:y.pattern,background:y.background,border:y.border,dataType:S,segLen:m,otherPattern:O});g=i.segments[i.segments.length-1]}else{g=i.segments[i.segments.length-1];var D=false;if(v!==undefined){if(v.position==="start"){D=true}}var R=false;if(p!==undefined){if(p.position==="end"){R=true}}if(S!==g.dataType||C!==g.concept||y.pattern!==g.pattern||y.border!==g.border||y.background!==g.background||D===true||R===true){i.segments.push({concept:C,y:Se+u,pattern:y.pattern,background:y.background,border:y.border,dataType:S,segLen:m,otherPattern:O});g=i.segments[i.segments.length-1]}else{g.segLen+=m}}if(v!==undefined){if(v.axisSplit===false){u+=v.space_px}}u+=Re;var v=a[we[h]];if(v!==undefined&&h+1===v.positionCnt){if(v.position==="end"&&v.axisSplit===true){u+=v.space_px}}if(v!==undefined){c+=v.space_px}p=v}i.concept=i.segments[0].concept;i.notation=M}else{var u=0;var p=undefined;var g=undefined;for(var h=0,f=0;h<we.length;h++){if(we[h]===null){continue}var m=Re;var v=a[we[h]];if(v!==undefined&&h+1==v.positionCnt){if(v.position==="start"&&v.axisSplit===true){u+=v.space_px}else if(v.axisSplit===false){m+=v.space_px}}var b=Mt["b"].Models.Actions.DataModelActions.getDimensionNodeFromArray(we[h],Ne,f++);if(b===null||b.hide){continue}var y,C,S;S=s="Actual";y=w.getDataType(S).subtypes.ACT0.settings.p;y=l={pattern:y.otherFill1,background:y.otherFill2,border:y.otherBorder};C=d=B.AREA;if(i.segments.length===0){i.segments.push({concept:C,y:Se+u,pattern:y.pattern,background:y.background,border:y.border,dataType:S,segLen:m});g=i.segments[i.segments.length-1]}else{g=i.segments[i.segments.length-1];var D=false;if(v!==undefined){if(v.position==="start"){D=true}}var R=false;if(p!==undefined){if(p.position==="end"){R=true}}if(D===true||R===true){i.segments.push({concept:C,y:Se+u,pattern:y.pattern,background:y.background,border:y.border,dataType:S,segLen:m});g=i.segments[i.segments.length-1]}else{g.segLen+=m}}if(v!==undefined){if(v.axisSplit===false){u+=v.space_px}}u+=Re;var v=a[we[h]];if(v!==undefined&&h+1==v.positionCnt){if(v.position==="end"&&v.axisSplit===true){u+=v.space_px}}if(v!==undefined){c+=v.space_px}p=v}i.concept=i.segments[0].concept}var P=0;i.segments.forEach(function(e){P+=e.segLen});if(P<i.dimension.height){var N=i.dimension.height-P-c;N>0&&i.segments.push({concept:d,y:i.segments[i.segments.length-1].y+i.segments[i.segments.length-1].segLen,pattern:l.pattern,background:l.background,border:l.border,dataType:s,segLen:N})}i.paintAxis=Ae;t[i.id]=Ve}function defineAxisSeparators(a){var e=Ve.getModel();var n=ze.getModel();var t=n.extendedModel.selectedKeyfigure.split(".").pop();var i=ke[t];var r=n.extendedModel;var o=r.separatorCategory;var l=r.separatorDataType;var s=r.separatorTimeType;var d=ze.getLayout().getColumns();var c=n.children;var u=r.displayType===I.NONE;var p=ae.dimensionLabelModel.calculatedEmptySpaces;function getAutoNegLen(e){if(u){return a}else{var t=c[e],i=t?Mt["b"].Models.Actions.ViewModelActions.LabelModel.getBox(t).x:0;return a-i-n.position.x}}if(i&&(o||l||s)){var g=getSeparatorParameters(a);var h=Mt["b"].Layout.Common.getChangeSeparators(we,t,o,l,s,Ne,ze,re,d);var f={};var m=-1;for(var v=0;v<h.length;v++){f[h[v].category]=h[v];if(h[v].category>m){m=h[v].category}}var b=0;if(c.length>0){for(var v=0;v<=m;v++){var T=f[v];var x=c[v*d].dataId_dim;var E=p[x];if(E!==undefined&&v+1==E.positionCnt){if(E.position==="start"){b+=E.space_px}}if(T!==undefined){var y;var C=e.position.y+b;if(g.autoLen){y=getAutoNegLen(T.dimLabelIdx)}else{y=g.neg}e.separators.push({y:C,neg:y,pos:g.pos,color:g.color,width:g.lineWidth,zIndex:T.zIndex})}b+=Re;var E=p[x];if(E!==undefined&&v+1==E.positionCnt){if(E.position==="end"){b+=E.space_px}}}}}var S=getTotalSeparatorParameters(a);var M=Mt["b"].Layout.Common.getTotalsSeparators(we,S.totalAutoLen&&!u,S.subtotalAutoLen&&!u,S.totalValAutoLen&&!u,Ne,ze,re,d);var f={};var m=-1;for(var v=0;v<M.length;v++){f[M[v].category]=M[v];if(M[v].category>m){m=M[v].category}}var b=0;if(c.length>0){for(var v=0;v<=m;v++){var T=f[v];var x=c[v*d].dataId_dim;var E=p[x];if(E!==undefined&&v+1==E.positionCnt){if(E.position==="start"){b+=E.space_px}}if(T!==undefined){var C=e.position.y+b;var O,A,_,L;if(T.type==="T"){A=S.totalPos;_=S.totalColor;L=S.totalLineWidth;if(S.totalAutoLen){O=getAutoNegLen(T.dimLabelIdx)}else{O=S.totalNeg}}else if(T.type==="S"){A=S.subtotalPos;_=S.subtotalColor;L=S.subtotalLineWidth;if(S.subtotalAutoLen){O=getAutoNegLen(T.dimLabelIdx)}else{O=S.subtotalNeg}}else{A=S.totalValPos;_=S.totalValColor;L=S.totalValLineWidth;if(S.totalValAutoLen){O=getAutoNegLen(T.dimLabelIdx)}else{O=S.totalValNeg}}e.separators.push({y:C,neg:O,pos:A,color:_,width:L,zIndex:T.zIndex})}b+=Re;var E=p[x];if(E!==undefined&&v+1==E.positionCnt){if(E.position==="end"){b+=E.space_px}}}}}function getSeparatorParameters(e){var t=ze.getModel().extendedModel;var i=0;var a=0,n=false;if(t.sepFromNotation){var r=parseFloat(w.getParameter("FACTOR_STRUCTURE_SEPARATOR_NEGATIVE_AREA"));i=Math.round(e-pe-be+be*r);n=w.getParameter("CHECK_STRUCTURE_CHANGE_OF_SEPARATOR_NEGATIVE_AREA")==="true"}else{if(t.sepLengthStartUnit==="%"){i=Math.round(e-pe-be+be*t.sepLengthStart_factor)}else{i=mm2pix(parseFloat(t.sepLengthStart_mmpt))}n=t.sepLengthStartAuto}if(t.sepEndFromNotation){a=Math.round((pe+he.width-e)*parseFloat(w.getParameter("FACTOR_STRUCTURE_SEPARATOR_DRAWING_AREA")))}else{a=t.sepLengthEndUnit==="%"?Math.round((pe+he.width-e)*parseFloat(t.sepLengthEnd_factor)):mm2pix(parseFloat(t.sepLengthEnd_mmpt))}return{neg:i,pos:a,autoLen:n,color:w.getParameter("COLOR_STRUCTURE_SEPARATOR"),lineWidth:convertNMParameterForMultiple("MMPT_STRUCTURE_SEPARATOR_SIZE")}}function getTotalSeparatorParameters(a){var e=ze.getModel().extendedModel;function getNegNM(e){return(a-pe)*parseFloat(w.getParameter(e))}function getNegDim(e,t,i){return e==="%"?(a-pe)*parseFloat(t):mm2pix(parseFloat(i))}function getPosNM(e){if(ie.scrollingData){return ie.scrollingData.scrollingHor?(pe+ie.scrollingData.realWidth-a)*parseFloat(w.getParameter(e)):(pe+he.width-a)*parseFloat(w.getParameter(e))}else{return(pe+he.width-a)*parseFloat(w.getParameter(e))}}function getPosDim(e,t,i){if(e==="%"){if(ie.scrollingData){return ie.scrollingData.scrollingHor?(pe+ie.scrollingData.realWidth-a)*parseFloat(t):(pe+he.width-a)*parseFloat(t)}else{return(pe+he.width-a)*parseFloat(t)}}else{return mm2pix(parseFloat(i))}}var t,i,n,r,o,l,s,d,c;if(e.sepTotalFromNotation){i=getNegNM("FACTOR_STRUCTURE_TOTAL_WITH_VALUES_SEPARATOR_NEGATIVE_AREA");n=w.getParameter("CHECK_STRUCTURE_TOTAL_WITH_VALUES_SEPARATOR_NEGATIVE_AREA")==="true"}else{i=getNegDim(e.sepTotalLengthStartUnit,e.sepTotalLengthStart_factor,e.sepTotalLengthStart_mmpt);n=e.sepTotalLengthStartAuto}if(e.sepTotalEndFromNotation){t=getPosNM("FACTOR_STRUCTURE_TOTAL_WITH_VALUES_SEPARATOR_LENGTH")}else{t=getPosDim(e.sepTotalLengthEndUnit,e.sepTotalLengthEnd_factor,e.sepTotalLengthEnd_mmpt)}if(e.sepSubtotalFromNotation){o=getNegNM("FACTOR_STRUCTURE_SUBTOTAL_SEPARATOR_NEGATIVE_AREA");l=w.getParameter("CHECK_STRUCTURE_SUBTOTAL_SEPARATOR_NEGATIVE_AREA")==="true"}else{o=getNegDim(e.sepSubtotalLengthStartUnit,e.sepSubtotalLengthStart_factor,e.sepSubtotalLengthStart_mmpt);l=e.sepSubtotalLengthStartAuto}if(e.sepSubtotalEndFromNotation){r=getPosNM("FACTOR_STRUCTURE_SUBTOTAL_SEPARATOR_LENGTH")}else{r=getPosDim(e.sepSubtotalLengthEndUnit,e.sepSubtotalLengthEnd_factor,e.sepSubtotalLengthEnd_mmpt)}if(e.sepTotalWVFromNotation){d=getNegNM("FACTOR_STRUCTURE_TOTAL_WITHOUT_VALUES_SEPARATOR_NEGATIVE_AREA");c=w.getParameter("CHECK_STRUCTURE_TOTAL_WITHOUT_VALUES_SEPARATOR_NEGATIVE_AREA")==="true"}else{d=getNegDim(e.sepTotalWVLengthStartUnit,e.sepTotalWVLengthStart_factor,e.sepTotalWVLengthStart_mmpt);c=e.sepTotalWVLengthStartAuto}if(e.sepTotalWVEndFromNotation){s=getPosNM("FACTOR_STRUCTURE_TOTAL_WITHOUT_VALUES_SEPARATOR_LENGTH")}else{s=getPosDim(e.sepTotalWVLengthEndUnit,e.sepTotalWVLengthEnd_factor,e.sepTotalWVLengthEnd_mmpt)}return{totalNeg:i,totalPos:t,totalAutoLen:n,totalColor:w.getParameter("COLOR_STRUCTURE_TOTAL_WITH_VALUES_SEPARATOR"),totalLineWidth:convertNMParameterForMultiple("MMPT_STRUCTURE_TOTAL_WITH_VALUES_SEPARATOR_SIZE"),subtotalNeg:o,subtotalPos:r,subtotalAutoLen:l,subtotalColor:w.getParameter("COLOR_STRUCTURE_SUBTOTAL_SEPARATOR"),subtotalLineWidth:convertNMParameterForMultiple("MMPT_STRUCTURE_SUBTOTAL_SEPARATOR_SIZE"),totalValNeg:d,totalValPos:s,totalValAutoLen:c,totalValColor:w.getParameter("COLOR_STRUCTURE_TOTAL_WITHOUT_VALUES_SEPARATOR"),totalValLineWidth:convertNMParameterForMultiple("MMPT_STRUCTURE_TOTAL_WITHOUT_VALUES_SEPARATOR_SIZE")}}function layoutBackground(e){var t=$e.getModel();t.position.x=0;t.position.y=0;t.dimension.width=ce.width;t.dimension.height=ce.height;e[t.id]=$e}function getInitialMinMaxLabelXPos(e){var t=0,i=0;for(var a in Ue){var n=Ue[a].scalingData;t=Math.max(t,n.maxLabelWidthPos);i=Math.max(i,n.maxLabelWidthNeg)}return{min:e-ye-i,max:e+ye+t}}function layoutRepresentations(e,t,i){var a=1;var n=[];var r=[];var o=0;var l=getPercentStackTotalValues();var s={},d={};var c={};var u=null;var p=ae.stackMode&&ae.stackLabelAlignment==="Displaced";var g=je.length>0?je[0].id.split(".")[2]:"0";var h=ze.getModel().extendedModel;for(var f=0;f<je.length;f++){if(je[f].instanceOf==="ValueModel"){continue}var m=je[f];var v=Ze[f];var b=0;var T=m.id.split(".")[2];if(T!==g){o++}if(we.length>0){while(we[o]!==m.dataId_dim){o++}}g=T;if(m.isNaN||m.valueType==="FACTOR_NONE"){v.hideLabel=true;var x=Mt["b"].Layout.Common.getHighlight(ae,v,Mt["b"].Utils.Constants.TypeValues.highlightType.VALUE,true);if(x&&x.highlight){x.highlight.active=false}continue}var E=Be[f].usedRuledEntry;var y=ke[m.dataId_expr];setRepresentationColor(m,y,E);var C=Ge[y.id];var S=ne.globalZoom[C];var M=Math.floor(f/ae.expressions.length);var O=Mt["b"].Models.Actions.ExtendedModelActions.DimensionLabelModel.getEmptySpacesBeforePosition(h,M);m.position.y+=Re*o+O+N+Se;var A=Mt["b"].Layout.Common.cumulateReferencePointerByRepFactor(m,S,ae);m.position.x=e+A;m.dimension.width=Math.abs(Math.round(m.value*S));if(m.isStack&&u===null){u=m.dimension.height;p=p||ae.stackMode&&ae.stackLabelAlignment==="Automatic"&&u<Xe[f].dimension.height}r.push(Ke[f]);if(m.isOutlier){n.push(f);s[m.dataId_expr]=undefined;if(m.waterfallType===2){d[m.dataId_expr]=undefined}c[m.dataId_expr]=undefined;if(m.instanceOf==="BarModel"){}else if(m.instanceOf==="NeedleModel"){m.dimension.height=Math.max(m.dimension.height,P)}}else{if(m.instanceOf!=="StructureWaterfallModel"){if(m.value<0){m.position.x-=m.dimension.width;if(A<=0){m.position.x+=a}}if(A<0&&m.value>0){m.position.x+=a}}switch(m.instanceOf){case"BarModel":if(m.isStack){if(Ie){if(m.value>0||!De&&0===m.value){var _=l[m.dataId_dim].pos||1;m.position.x=e+Math.round(m.stackModel.startOn/_*S);var L=e+Math.round((m.stackModel.startOn+m.value)/_*S)}else{var _=l[m.dataId_dim].neg;var L=e-Math.round(m.stackModel.startOn/_*S)+1;m.position.x=e-Math.round((m.stackModel.startOn+m.value)/_*S)+1}m.dimension.width=Math.abs(L-m.position.x)}else{m.position.x=e+Math.round(m.stackModel.startOn*S);m.dimension.width=Math.abs(Math.round((m.stackModel.startOn+m.value)*S)+e-m.position.x);if(m.value<0){m.position.x-=m.dimension.width;if(A<=0){m.position.x+=a}}else if(A<0&&m.value>0){m.position.x+=a}}}break;case"NeedleModel":m.lineWidth=P;Mt["b"].Layout.Common.setNotationShape(Ke[f],E,m.notation,m.concept,false);b=Math.ceil(m.needleSize/2);m.dimension.height=Math.max(m.dimension.height,P);break;case"StructureLineModel":Mt["b"].Layout.Common.setNotationShape(Ke[f],E,m.notation,m.concept,true);b=Math.ceil(Math.max(m.needleSize,m.lineWidth)/2);if(c[m.dataId_expr]){var I=c[m.dataId_expr];I.nextPosition={x:m.value<0?m.position.x:m.position.x+m.dimension.width,y:m.position.y+Math.floor(m.dimension.height/2)};m.previousPosition={x:I.value<0?I.position.x:I.position.x+I.dimension.width,y:I.position.y+Math.floor(I.dimension.height/2)}}c[m.dataId_expr]=m;break;case"StructureWaterfallModel":m.position.x=e+Math.round((m.relativeValue-m.value)*S)+A;m.dimension.width=Math.abs(e+Math.round(m.relativeValue*S)+A-m.position.x);if(m.value<0){m.position.x-=m.dimension.width}setWaterfallConnections(m,s[m.dataId_expr],d[m.dataId_expr]);s[m.dataId_expr]=m;if(m.waterfallType===2){d[m.dataId_expr]=m}m.dimension.width++;break}}i[m.id]=Ke[f];layoutValueLabel(f,b,y.valueLabelBackground,p,S,e,i);if(!m.isOutlier&&v&&!v.hideLabel){if(m.value>0||!De&&0===m.value){t.max=Math.max(t.max,v.position.x+v.dimension.width)}else{t.min=Math.min(t.min,v.position.x-v.dimension.width)}}}var D=[{pos:R.TOP,z:100},{pos:R.TOP_TOP,z:110},{pos:R.BOTTOM,z:120},{pos:R.BOTTOM_BOTTOM,z:130},{pos:R.MID,z:140},{pos:R.MID_TOP,z:150},{pos:R.MID_BOTTOM,z:160}];Mt["b"].Layout.Common.sortRepresentations(r,D,false);return n}function getPercentStackTotalValues(){var e={};if(ae.stackType==="%"){for(var t=0;t<qe.length;t++){var i=qe[t];var a=i.representation.dataId_dim;e[a]={pos:i.value,neg:0}}for(var t=0;t<Je.length;t++){var i=Je[t];var a=i.representation.dataId_dim;if(e[a]===undefined){e[a]={pos:0,neg:i.value}}else{e[a].neg=i.value}}}return e}function getPercentStackValue(e,t){if(e.value>0||!De&&0===e.value){for(var i=0;i<qe.length;i++){if(e.dataId_dim===qe[i].representation.dataId_dim){return(e.stackModel.startOn+e.value/t)/qe[i].value||1}}}else{for(var i=0;i<Je.length;i++){if(e.dataId_dim===Je[i].representation.dataId_dim){return-(e.stackModel.startOn+e.value/t)/Je[i].value||1}}}return 0}function setRepresentationColor(e,t,i){if(t.notation===F.ELEMENT||t.notation===F.ELEMENT_HEADER||t.notation===F.ELEMENT_AXIS){var a=e.waterfallType===0||e.waterfallType===1||e.waterfallType===2;e.color=Mt["b"].Layout.Common.getNotationColorStructure(i,t.concept,true,e.value>=0,a,false)}else{if(e.instanceOf==="StructureWaterfallModel"){var a=e.waterfallType===0||e.waterfallType===2;e.color=Mt["b"].Layout.Common.getNotationColorStructure(i,B.AREA,true,e.value>=0,a,true)}else{var n=w.getDataType("Actual").subtypes.ACT0.settings.p;e.color={pattern:n.otherFill1,background:n.otherFill2,border:n.otherBorder}}}}function setWaterfallConnections(e,t,i){if(t){var a;if(e.waterfallType===0){a=e.value>=0?e.position.x:e.position.x+e.dimension.width}else{a=e.value>=0?e.position.x+e.dimension.width:e.position.x}var n=t.value>0||!De&&0===t.value?t.position.x+t.dimension.width-1:t.position.x;if(a===n){var r=t.position.y;var o=e.position.y+e.dimension.height;e.rowConnectionPos={x1:a,x2:a,y1:r,y2:o}}}if(e.waterfallType===2&&i){var a=e.value>=0?e.position.x:e.position.x+e.dimension.width;var l=i.position.y+i.dimension.height;var s=e.position.y;e.rowConnectionPos.x3=a;e.rowConnectionPos.x4=a;e.rowConnectionPos.y3=l;e.rowConnectionPos.y4=s}}function layoutValuesRepresentationLabel(e,t){var i=0;var a=je.length>0?je[0].id.split(".")[2]:"0";var n=ze.getModel().extendedModel;for(var r=0;r<Ze.length;r++){var o=Ze[r];var l=je[r];if(l.isNaN||l.instanceOf!=="ValueModel"||l.valueType==="FACTOR_NONE"){continue}var s=Be[r].usedRuledEntry;var d=ke[o.dataId_expr];var c=Math.floor(r/ae.expressions.length);var u=Mt["b"].Models.Actions.ExtendedModelActions.DimensionLabelModel.getEmptySpacesBeforePosition(n,c);var p=l.id.split(".")[2];if(p!==a){i++}if(we.length>0){while(we[i]!==l.dataId_dim){i++}}a=p;if(o&&!o.hideLabel){o.showBackground=d.valueLabelBackground;o.backgroundColor=M.colorLabelBackground;o.backgroundTransparency=j;if(d.notation===F.ELEMENT||d.notation===F.ELEMENT_HEADER||d.notation===F.ELEMENT_AXIS){var g=Mt["b"].Layout.Common.getNotationColorStructure(s,d.concept,true,l.value>=0,false,false);o.color=g.pattern}else{var h=w.getDataType("Actual").subtypes.ACT0.settings.p;l.color={pattern:h.otherFill1,background:h.otherFill2,border:h.otherBorder}}l.position.y+=Re*i+u+N+Se;o.position.y=l.position.y+Math.round((l.dimension.height-o.dimension.height)/2);if(Ae){if(l.value>0||!De&&0===l.value){o.position.x=e+ye+W}else{o.position.x=e-ye-W;o.textAnchor="end"}}else{o.position.x=e;o.textAnchor="middle"}}t[o.id]=Qe[r]}}function layoutValueLabel(e,t,i,a,n,r,o){var l=je[e];if(l.instanceOf==="ValueModel"){return}var s=Ze[e];s.hideLabel=s.hideLabel||ae.stackMode&&l.isStack&&ae.stackLabelVisibility===false&&s.dimension.width>l.dimension.width;if(s.hideLabel){var d=Mt["b"].Layout.Common.getHighlight(ae,s,Mt["b"].Utils.Constants.TypeValues.highlightType.VALUE,true);if(d&&d.highlight){d.highlight.active=false}}if(s&&!s.hideLabel){s.showBackground=i;s.backgroundColor=M.colorLabelBackground;s.backgroundTransparency=j;if(!l.isOutlier){if(l.isStack){s.position.y=a?l.position.y+l.dimension.height+c:l.position.y+Math.round((l.dimension.height-s.dimension.height)/2);if(Ie){s.position.x=r+Math.round(n*getPercentStackValue(l,2))}else{s.position.x=r+Math.round(n*(l.stackModel.startOn+l.value/2))}s.textAnchor="middle"}else{s.position.y=l.position.y+Math.round((l.dimension.height-s.dimension.height)/2);if(l.value>0||!De&&0===l.value){if(l.dimension.width<ye&&Object.keys(l.referencePointer).length===0&&l.instanceOf!=="StructureWaterfallModel"){s.position.x=l.position.x+ye+W+t}else{s.position.x=l.position.x+l.dimension.width+W+t}}else{if(l.dimension.width<ye&&Object.keys(l.referencePointer).length===0&&l.instanceOf!=="StructureWaterfallModel"){s.position.x=l.position.x+l.dimension.width-ye-W-t}else{s.position.x=l.position.x-W-t}s.textAnchor="end"}}o[s.id]=Qe[e]}}}function layoutTotals(i,s){function helper(e,t,i){for(var a=0;a<e.length;a++){var n=e[a].representation;var r=e[a].label;if(r&&!r.hideLabel){r.position.y=n.position.y+Math.round((n.dimension.height-r.dimension.height)/2);i(r,n);r.showBackground="transparent";r.backgroundColor=M.colorLabelBackground;r.backgroundTransparency=j;var o;for(var l=0;l<t.length;l++){if(r.id===t[l].getId()){o=t[l];break}}s[r.id]=o}}}helper(qe,nt,function(e,t){e.position.x=t.position.x+t.dimension.width+W;i.max=Math.max(i.max,e.position.x+e.dimension.width)});helper(Je,ot,function(e,t){e.position.x=t.position.x-W;e.textAnchor="end";i.min=Math.min(i.min,e.position.x-e.dimension.width)})}function layoutOutliers(e,t,i,a){var n=0;var r=Math.round(Ee/2);var o=t+r;var l=t-r-n;for(var s=0;s<e.length;s++){var d=je[e[s]];var c=Ze[e[s]];var u=ke[d.dataId_expr];d.symbolSize=f[d.valueType];if(c&&!c.hideLabel){if(u.outlierStyle==="value-symbol"){if(d.value>=0){c.position.x=o+W;var p=i.max-S-c.position.x-c.dimension.width;d.dimension.width=u.outlierSymbols&&p>=C?C:0;d.position.x=i.max-d.dimension.width-S}else{c.position.x=l-W;c.textAnchor="end";var p=c.position.x-c.dimension.width-S-i.min;d.dimension.width=u.outlierSymbols&&p>=C?C:0;d.position.x=i.min}}else{if(d.value>=0){c.position.x=i.max;c.textAnchor="end";d.position.x=o+S;var p=c.position.x-c.dimension.width-W-d.position.x;d.dimension.width=u.outlierSymbols&&p>=C?C:0}else{c.position.x=i.min;var p=l-S-c.position.x-c.dimension.width-W;d.dimension.width=u.outlierSymbols&&p>=C?C:0;d.position.x=l-S-d.dimension.width}}c.position.y=d.position.y+Math.round((d.dimension.height-c.dimension.height)/2);a[c.id]=Qe[e[s]]}else{var g=he.width-q-o;var h=l-S-Te-q-pe;if(d.value>=0){d.dimension.width=u.outlierSymbols&&g>=C?C:0;d.position.x=o+S}else{d.dimension.width=u.outlierSymbols&&h>=C?C:0;d.position.x=l-S-d.dimension.width}}}}function hideOverlappingLabels(){var e={};for(var t in ke){e[t]=ke[t].valueLabelOpt.split(".")[1]==="Dynamic"}for(var t in ke){if(!ke[t].valueLabelOverlapSelf){Mt["b"].Layout.Common.hideExpressionOverlappingLabels(it[t],Ne,ae,J,ee)}}if(ae.stackMode&&!ae.stackLabelOverlapSelf){Mt["b"].Layout.Common.hideExpressionOverlappingLabels(at.concat(rt),Ne,ae,J,ee)}Mt["b"].Layout.Common.hideOverlappingLabels(Ze,at,rt,ie,Ne,e,J,ee)}function getLegendOffsets(){var e={top:0,bottom:0};var t=se.extendedModel.maxValueRowLabelStructure[ie.row];e.top=Se-t[0];var i=Y+(Oe?K:0);e.bottom=Se+Ve.getDimension().height+i;return e}function layoutLegend(e,t,i){for(var a=0;a<lt.length;a++){var n=lt[a];var r=n.valueRowLabelPosition.split(".")[1];if(r==="1"||r==="2"||r==="3"){n.position.y+=t.top}else if(r==="4"||r==="5"||r==="6"){n.position.y+=t.bottom}n.position.x+=t.side;i[n.id]=st[a];if(n.showConnector&&(Ce===null||r!=="2")){layoutLegendConnector(n,r,i)}}}function layoutLegendConnector(e,t,i){var a=t==="1"||t==="2"||t==="3";var n=(t==="4"||t==="5"||t==="6")&&Ae===true;var r=e.id.split(".");var o=Se+Ve.getDimension().height;for(var l=0;l<dt.length;l++){var s=dt[l];if(s.id.split(".")[3]===r[2]){var d=ke[e.dataId_expr];var c;if(d.representation===h.VALUE){c=Mt["b"].Layout.Common.getFirstNonZeroRepresentationByExprId(Ze,e.dataId_expr,a,true)}else{c=Mt["b"].Layout.Common.getFirstNonZeroRepresentationByExprId(je,e.dataId_expr,a,false)}if(c===null){if(Ae){n=true}else{break}}var u=!n&&(c.instanceOf==="BarModel"||c.instanceOf==="StructureWaterfallModel");var p=u&&c.instanceOf==="StructureWaterfallModel";var g=!n&&c.instanceOf==="NeedleModel";s.dimension.width=X;s.position.x=e.textAnchor==="middle"?e.position.x:e.position.x+Math.round(e.dimension.width/2);if(p){s.position.x-=c.value>0||!De&&0===c.value?X-1:0}else if(u){s.position.x-=c.value>0||!De&&0===c.value?X:-1}else{s.position.x-=Math.floor(X/2)}if(a){s.position.y=e.position.y+e.dimension.height+Y;s.dimension.height=(n?Se:u||g?c.position.y+Math.round(c.dimension.height/2):c.position.y)-s.position.y}else{s.position.y=n?o:c.position.y+(u||g?Math.round(c.dimension.height/2):c.dimension.height);s.dimension.height=e.position.y-Y-s.position.y}c&&c.color&&(s.color=c.instanceOf==="LabelModel"?c.color:c.color.border);s.valueRowLabelPosition=e.valueRowLabelPosition;s.representationId=ie.id;i[s.id]=ct[l];break}}}function layoutAnnotator(e,t){if(Ce!==null){var i=We.getModel();var a=je[Ce];var n=ke[a.dataId_expr];var r=Be[Ce].usedRuledEntry;var o=n.notation===F.HEADER;var l=false;i.dataType=o?r.baseDataType:r.referenceDataType;if(n.notation===F.ELEMENT_HEADER){var s=n.referenceConcept}else{var s=n.concept}i.color=Mt["b"].Layout.Common.getNotationColorStructure(r,s,o,a.value>=0,l,false);i.otherPattern=Mt["b"].Layout.Common.getOtherPattern(r,n.notation,s,o);i.concept=s;i.referenceUsed=r.referenceUsed;i.notation=n.notation;var d=null;for(var c=0;c<lt.length;c++){if(lt[c].dataId_expr===a.dataId_expr){d=lt[c];break}}i.dimension.width=Math.round((d===null?oe.measureTextDim(n.name,p).width:d.dimension.width)*1.1);i.dimension.height=v;i.position.y=Se-T-v;i.position.x=e-Math.round(i.dimension.width/2);t[i.id]=We}}function layoutScalingHelpers(e,t,i){var a=Ve.getModel();for(var n=0;n<pt.length;n++){var r=pt[n];var o=gt[n];var l=Ge[r.expressionId];var s=Math.round(r.value*ne.globalZoom[l]);if(!isFinite(s)){s=0}r.dimension={width:s,height:a.dimension.height};r.position={x:e,y:a.position.y};r.lineWidth=z;r.lineColor=w.getParameter("COLOR_SCALING_HELPER_"+r.number+"_LINE");r.areaColor=w.getParameter("COLOR_SCALING_HELPER_"+r.number+"_AREA");r.orientation="vertical";i[r.id]=o;if(r.legendShow!=="-"){var d,c;var u=r.id.replace("scalingHelper","scalingHelperLabel");for(var p=0;p<ht.length;p++){if(ht[p].id.indexOf(u)>=0){d=ht[p];c=ft[p];break}}if(r.legendShow==="Start"){d.position.y+=t.top}else if(r.legendShow==="End"){d.position.y+=t.bottom}d.color=r.lineColor;i[d.id]=c}}}function layoutStackLines(o,l,e){var s=getPercentStackZoomFactor();function getEdgeStackBar(e,t){var i=e?qe:Je;return t?i[0].representation:i[i.length-1].representation}function setStackLineData(e,t,i){e.dimension.width=d;e.arrowHeight=O;e.arrowWidth=convertNMParameterForMultiple("MMPT_STRUCTURE_LEGEND_SYMBOL_WIDTH");e.position.x=getPercentStackEndPosition(o,s,i);var a,n;if(ae.stackLine==="Start"){var r=getEdgeStackBar(i,false);a=Ve.getPosition().y;n=r.position.y+r.dimension.height;t.position.y+=l.top+se.extendedModel.maxValueRowLabelStructure[ie.row][0]}else{var r=getEdgeStackBar(i,true);a=r.position.y;n=Ve.getPosition().y+Ve.getDimension().height;t.position.y=n+e.arrowHeight+Y}e.position.y=a;e.dimension.height=n-a;t.textAnchor="middle";t.hideLabel=false}for(var t=0;t<mt.length;t++){var i=mt[t];var a=i.getModel();var n=vt[t];n.hideLabel=true;if(_e&&a.id.indexOf("pos")!==-1){setStackLineData(a,n,true);e[i.getId()]=i;e[bt[t].getId()]=bt[t]}else if(Le&&a.id.indexOf("neg")!==-1){setStackLineData(a,n,false);e[i.getId()]=i;e[bt[t].getId()]=bt[t]}}}function setDataForScrolling(e){var t=he.width;var i=he.height;var a=t;var n=Ve.getPosition().y+Ve.getDimension().height;var r=Ve.getPosition().y;var o=0,l=0;var s=ze.getPosition().x+ze.getDimension().width;var d=s;var c=false;for(var u in Ue){if(Ue[u].manualScaling){c=true;break}}for(var p=0;p<lt.length;p++){var g=lt[p];var h="structureLegendType."+g.valueRowLabelPosition.split(".")[1];r=Math.min(r,g.position.y);if(U.indexOf(h)!==-1){var f=V/2;if(r>g.position.y-f){r=r-f;n=n+f}}else if(H.indexOf(h)!==-1){n=Math.max(n,g.position.y+g.dimension.height+$/2)}var m=Mt["b"].Models.Actions.ViewModelActions.LabelModel.getBox(g).x;if(ke[g.dataId_expr].legendInGrid){o=Math.min(o,m);s=Math.max(s,m+g.dimension.width)}else{l=Math.min(l,m);d=Math.max(d,m+g.dimension.width)}}for(var p=0;p<vt.length;p++){var v=vt[p];r=Math.min(r,v.position.y);n=Math.max(n,v.position.y+v.dimension.height)}for(var p=0;p<Ze.length;p++){var v=Ze[p];var b=je[p];if(b.isNaN||b.valueType==="FACTOR_NONE"){continue}if(b.instanceOf!=="ValueModel"){var T=b.position.x;var x=b.position.x+b.dimension.width;if(b.needleSize!==undefined){if(b.value>0||!De&&0===b.value){T=b.position.x;x=x+Math.round(b.needleSize/2)}else{T=b.position.x-Math.round(b.needleSize/2)}}var E=T-Te;T=E<0?E:T;o=Math.min(o,T);s=Math.max(s,x)}if(!v.hideLabel){var m=Mt["b"].Models.Actions.ViewModelActions.LabelModel.getBox(v).x;var E=m-Te;m=E<0?E:m;o=Math.min(o,m);s=Math.max(s,m+v.dimension.width);var y=v.isHighlighted?Math.round(v.dimension.width*(G-1)/2):0;l=Math.min(l,m-y);d=Math.max(d,m+v.dimension.width+y)}}for(var p=0;p<qe.length;p++){var v=qe[p].label;if(!v.hideLabel){var m=Mt["b"].Models.Actions.ViewModelActions.LabelModel.getBox(v).x;var y=v.isHighlighted?Math.round(v.dimension.width*(G-1)/2):0;s=Math.max(s,m+v.dimension.width);d=Math.max(d,m+v.dimension.width+y)}}for(var p=0;p<Je.length;p++){var v=Je[p].label;if(!v.hideLabel){var m=Mt["b"].Models.Actions.ViewModelActions.LabelModel.getBox(v).x;var y=v.isHighlighted?Math.round(v.dimension.width*(G-1)/2):0;var E=m-Te;m=E<0?E:m;o=Math.min(o,m);l=Math.min(l,m-y)}}for(var p=0;p<ut.length;p++){var C=ut[p].getModel();if(C.hide||C.active===false){continue}var S=Mt["b"].Layout.Common.getMaxPosition(C,true,convertNMParameterForMultiple);r=Math.min(r,S.position.y);n=Math.max(n,S.position.y+S.dimension.height);if(C.text.moved||C.percent.moved||C.absolute.moved){s=Math.max(s,S.position.x+S.dimension.width)}}for(var M=0;M<ht.length;M++){var O=ht[M];r=Math.min(r,O.position.y);n=Math.max(n,O.position.y+O.dimension.height)}if(c&&s-o>t){o-=q;s+=q;l-=q;d+=q}a=s-o;if(a>t||l>o||d<s){l=Math.min(l,o);d=Math.max(d,s);a=d-l;updatePanelsPositionsForLeftOffset(l,e)}k={width:0,height:n-r+Q+Y};var A,_=2,L=!ie.disableScrolling&&n-i>_,I=!ie.disableScrolling&&a-t>_;if(fe){var D=ie.border.left.width+ie.padding.left,R=ie.border.top.width+ie.padding.top,P=Mt["b"].Utils.Constants.Parameters.idContainerContent+"."+ie.id;ie.scrollingData={width:ce.width,height:ce.height,realWidth:ce.width,realHeight:ce.height,scrollingVer:false,scrollingHor:false,x:ue.x,y:ue.y,children:{},id:ie.id};A={width:he.width,height:he.height,realWidth:a,realHeight:n,scrollingVer:L,scrollingHor:I,x:D,y:R,id:P};ie.scrollingData.children[P]=A}else{ie.scrollingData={width:ce.width,height:ce.height,realWidth:a,realHeight:n,scrollingVer:L,scrollingHor:I,x:ue.x,y:ue.y,id:ie.id};A=ie.scrollingData;var N=$e.getModel().dimension;ie.scrollingData.scrollingVer&&(N.height=n);ie.scrollingData.scrollingHor&&(N.width=a)}Pe.legend!==null&&(A.scrollingHorRef=Mt["b"].Layout.Common.extractLinkedChartIds(Pe.legend.linkedCharts,ie.id))}function updatePanelsPositionsForLeftOffset(e,t){for(var i=0;i<t.length;i++){var a=t[i].getModel();if(a.instanceOf==="StructureWaterfallModel"){a.position.x-=e;a.rowConnectionPos.x1-=e;a.rowConnectionPos.x2-=e;if(a.rowConnectionPos.x3!==undefined){a.rowConnectionPos.x3-=e;a.rowConnectionPos.x4-=e}}else if(a.instanceOf==="StructureLineModel"){a.position.x-=e;if(a.nextPosition.x!==0){a.nextPosition.x-=e}if(a.previousPosition.x!==0){a.previousPosition.x-=e}}else if(a.instanceOf==="CompareModel"&&a.active){a.fromPosition.x-=e;a.toPosition.x-=e;a.preferredPosition.x-=e;a.position.x-=e;if(a.absolute.legend!==n.NONE){a.absolute.position.x-=e}if(a.percent.legend!==n.NONE){a.percent.position.x-=e}if(a.text.legend!==n.NONE&&a.text.text!==""){a.text.position.x-=e}}else if(a.instanceOf!=="ContainerModel"&&a.instanceOf!=="BackGroundModel"){a.position.x-=e}}}function collectData(e){te=false;ne=e[0].getController().getRootModel();oe=e[0].getPainter();le=Mt["b"].Factories.ModelFactory.getParentContainer(ne.firstObjectGrid,ie);se=le[0];var t=le[1];if(ie.multiplePath!==undefined&&t&&t.extendedModel&&t.extendedModel.instanceOf==="MultipleContainerModel"){y=true;de=t}if(!se.extendedModel.maxValueRowLabelStructureBottom){console.warn("maxValueRowLabelStructureBottom is not defined",se.extendedModel);se.extendedModel.maxValueRowLabelStructureBottom=[]}readParameters();sortOutChildren(e);var i=ze.getModel().extendedModel.displayType!==I.NONE;for(var a=0;a<ae.expressions.length&&!Ae;a++){Ae=ae.expressions[a].representation!==h.VALUE||i}var n=ze.getLayout().getColumns();var r=ze.getModel().children;for(var a=0;a<r.length;a+=n){we.push(r[a].dataId_dim)}if(ie.multiplePath!=undefined){Ne=Mt["b"].Models.Actions.DataModelActions.getMultipleDimensionsByPath(re.dataModel,ie.multiplePath,0,true,ie.isMultipleTotal)}else{Ne=Mt["b"].Models.Actions.DataModelActions.getMultipleDimensions(re.dataModel,0)}Fe=new Array(je.length);Be=new Array(je.length);fillDataNodesAndHashes();fillStackData(et);fillScalingGroupData()}function readParameters(){E=y?de.extendedModel.fontSize:w.getParameterParsed("FONT_SIZE_CHART");O=a.pt2pix(E);p=i+" "+O+"px '"+t+"'";r=w.getParameterParsed(ae.timeFactor);C=convertNMParameterForMultiple("MMPT_STRUCTURE_SYMBOL_SIZE");P=convertNMParameterForMultiple("MMPT_STRUCTURE_NEEDLE_LINE_SIZE");l=convertNMParameterForMultiple("MMPT_STRUCTURE_LINE_SIZE");d=convertNMParameterForMultiple("MMPT_STRUCTURE_THIN_LINE_SIZE");A=w.getParameterParsed("FACTOR_HIGHLIGHT_ELLIPSE_HEIGHT");G=w.getParameterParsed("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH");_=convertNMParameterForMultiple("MMPT_HIGHLIGHT_ELLIPSE_STROKE_WIDTH");c=convertNMParameter("MMPT_STRUCTURE_VALUE_LABEL_ELEMENT_DISPLACEMENT_DISTANCE");S=convertNMParameter("MMPT_STRUCTURE_OUTLIER_DISTANCE");L=convertNMParameterForMultiple("MMPT_STRUCTURE_AXIS_WITH_NOTATION");D=convertNMParameterForMultiple("MMPT_STRUCTURE_AXIS_WITHOUT_NOTATION");v=convertNMParameterForMultiple("MMPT_STRUCTURE_HEADER_BAR_HEIGHT");T=convertNMParameter("MMPT_STRUCTURE_HEADER_ELEMENT_DISTANCE");x=convertNMParameter("MMPT_STRUCTURE_HEADER_TEXT_SPACE");z=convertNMParameterForMultiple("MMPT_SCALING_HELPER_LINE_SIZE");W=convertNMParameter("MMPT_STRUCTURE_VALUE_LABEL_ELEMENT_DISTANCE");K=convertNMParameterForMultiple("MMPT_STRUCTURE_LEGEND_MIN_CONNECTOR_LENGTH");X=convertNMParameterForMultiple("MMPT_STRUCTURE_LEGEND_CONNECTOR_WIDTH");Y=convertNMParameter("MMPT_STRUCTURE_LEGEND_ELEMENT_DISTANCE");Z=convertNMParameter("MMPT_STRUCTURE_LEGEND_PADDING");Q=convertNMParameter("MMPT_STRUCTURE_CELL_PADDING_TOP");q=convertNMParameter("MMPT_STRUCTURE_CELL_PADDING_SIDE");J=convertNMParameter("MMPT_ADD_OVER_HEIGHT");ee=convertNMParameter("MMPT_ADD_OVER_WIDTH")}function sortOutChildren(e){var t=fe?Mt["b"].Utils.Constants.Parameters.idContainerContent+"."+ie.id:undefined;for(var i=0;i<e.length;i++){var a=e[i];var n=a.getModel();var r=n.instanceOf;if(r==="BarModel"){je.push(n);Ke.push(a);if(n.isStack){et.push(n)}n.nestedContainerId=t}else if(r==="NeedleModel"||r==="StructureLineModel"||r==="StructureWaterfallModel"||r==="ValueModel"){je.push(n);Ke.push(a);n.nestedContainerId=t}else if(r==="LabelModel"){if(n.id.indexOf("stack_sum")>0){var o=n.id.split(".").pop();if(o==="pos"){at.push(n);nt.push(a)}else if(o==="neg"){rt.push(n);ot.push(a)}else{Xe.push(n);Ye.push(a)}}else if(n.id.indexOf("valueRowLabel")>=0){lt.push(n);st.push(a)}else if(n.id.indexOf("scalingHelperLabel")>=0){ht.push(n);ft.push(a)}else if(n.id.indexOf("stackLineLabel")>=0){vt.push(n);bt.push(a)}else{Xe.push(n);Ye.push(a)}n.nestedContainerId=t}else if(r==="RowConnectorModel"){dt.push(n);ct.push(a);n.nestedContainerId=t}else if(r==="AxisModel"){Ve=a;n.nestedContainerId=t}else if(r==="DataTypeAnnotatorModel"){We=a;n.nestedContainerId=t}else if(r==="BackGroundModel"){$e=a}else if(r==="CompareModel"){ut.push(a);n.nestedContainerId=t}else if(r==="ContainerModel"){if(n.extendedModel.instanceOf==="DimensionLabelModel"){ze=a}n.nestedContainerId=t}else if(r==="ScalingHelperModel"){pt.push(n);gt.push(a);n.nestedContainerId=t}else if(r==="StackLineModel"){mt.push(a);n.nestedContainerId=t}}}function fillStackData(e){var t={};var i=99,a=0;Ie=e.length>0&&ae.stackType==="%";for(var n=0;n<e.length;n++){var r=e[n];if(t[r.dataId_dim]===undefined){t[r.dataId_dim]=[]}t[r.dataId_dim].push(r);if(r.stackOrder<i){i=r.stackOrder;a=r.sequence}}for(var o in t){var l=t[o];l.sort(function(e,t){return e.stackOrder-t.stackOrder});var s=l[0].referencePointerSum;var d=l[0].referencePointerSum;var c=0;var u=0;var p=null;var g=null;for(var n=0;n<l.length;n++){var h=l[n];var f=h.value>0||!De&&0===h.value;h.stackModel={startOn:f?s:d};if(h.valueType!=="FACTOR_NONE"&&!h.isNaN){if(f){s=s+h.value;c+=h.value;p=h}else{d=d+h.value;u+=h.value;g=h}}h.sequence=a}if(c>0||c===0&&p!==null){qe.push({value:c+l[0].referencePointerSum,label:getTotalLabelByDimId(at,l[0].dataId_dim),representation:p});_e=true}if(u<0){Je.push({value:u+l[0].referencePointerSum,label:getTotalLabelByDimId(rt,l[0].dataId_dim),representation:g});Le=true}}}function getTotalLabelByDimId(e,t){for(var i=0;i<e.length;i++){var a=e[i];if(a.dataId_dim===t){return a}}return null}function fillDataNodesAndHashes(){function getExprNode(e,t){for(var i=0;i<e.nodes.length;i++){if(t===e.nodes[i].key){return e.nodes[i]}}return null}for(var e=0;e<ae.expressions.length;e++){var t=ae.expressions[e].id.split(".").pop();tt[t]=[];it[t]=[]}var i=-1;var a=false,n=false;for(var e=0;e<je.length;e++){var r=je[e];Fe[e]=Mt["b"].Models.Actions.DataModelActions.getDimensionNodeFromArray(r.dataId_dim,Ne,Math.floor(e/ae.expressions.length));Be[e]=getExprNode(Fe[e],r.dataId_expr);if(ke[r.dataId_expr]===undefined){for(var o=0;o<ae.expressions.length;o++){var l=ae.expressions[o];if(r.dataId_expr===l.id.split(".").pop()){ke[r.dataId_expr]=l;break}}}var s=r.id.split(".")[2];var d,c;do{d=Xe[++i];if(!d){break}c=d.id.split(".");c=c[c.length-2]}while(d.dataId_dim!==r.dataId_dim||d.dataId_expr!==r.dataId_expr||s!==c);if(d){Ze[e]=d;Qe[e]=Ye[i]}if(tt[r.dataId_expr]===undefined){console.warn("structure.fillDataNodesAndHashes")}tt[r.dataId_expr].push(r);it[r.dataId_expr].push(Ze[e]);a=a||r.value>0;n=n||r.value<0}De=n&&!a}function fillScalingGroupData(){var e={};var t=null;Ge={};He={};Ue={};function getContextExpression(e){for(var t=0;t<re.columns.length;t++){if(re.columns[t].id===e){return re.columns[t]}}return null}for(var i=0;i<ae.expressions.length;i++){var a=ae.expressions[i];var n=Mt["b"].Factories.ViewFactory.getScalingGroupByChartExpression(a,re,ie,ne);Ge[a.id]=n;if(He[n]!==undefined){e[He[n]].push(a);continue}var r=n;if(a.isStack){if(t===null){t=a.id}r=Ge[t]}if(e[r]===undefined){e[r]=[]}if(n!==r&&e[n]!==undefined){e[r]=e[r].concat(e[n]);delete e[n]}e[r].push(a);if(He[n]===undefined||n!==r){He[n]=r}}for(var o in e){var l=e[o];var s=[],d=[];var c=false;var u=null;for(var i=0;i<l.length;i++){var p=l[i];var g=getContextExpression(p.id);var h=Mt["b"].Utils.Calculator.resolveQvVars(g.scalingGroup);if(h===o&&b[g.scalingGroup]&&!b[g.scalingGroup].auto&&b[g.scalingGroup].manualFactor!=null){u=g.scalingGroup}if(p.isStack&&ae.stackMode){c=true}else{var f=p.id.split(".").pop();s=s.concat(tt[f]);d=d.concat(it[f])}}var m=u!==null;var v=c?qe.concat(Je):[];Ue[o]={representations:s,valueLabels:d,stackRepresentations:v,exprs:e[o],originalScalingGroup:u,manualScaling:m}}}function getAvailableSpace(){var e=ie.border,t=ie.padding;he.width=ce.width-e.left.width-e.right.width-t.left-t.right;he.height=ce.height-e.top.width-e.bottom.width-t.top-t.bottom;return Math.max(he.width-Te-q*2,ve)}this.getPreferredLayoutSize=function(){return k}};Mt["b"].Layout=Mt["b"].Layout||{};Mt["b"].Layout.Table=Mt["b"].Layout.Table||{};Mt["b"].Layout.Table.CompareLayoutHelpers={layoutCompares:function(e,R,t,i,a){var P=Mt["b"].DataObjects.RuntimeDO;var n=Mt["b"].Utils.Calculator.Converter;var r=n.mm2pix(a*P.getParameterParsed("MMPT_HIGHLIGHT_ELLIPSE_STROKE_WIDTH"));var o=n.mm2pix(a*P.getParameterParsed("MMPT_HIGHLIGHT_ARROW_SIZE"));var l=n.mm2pix(a*P.getParameterParsed("MMPT_HIGHLIGHT_PIN_SIZE"));var N=Mt["b"].Utils.Constants.TypeValues.indicator;for(var s=0;s<e.length;s++){var d=e[s];var w=d.getModel();if(w.active===false){continue}var m=w.font;var c=w.compareFrom;var u=w.compareTo;if(c&&u){if(w.offset.y==-1){w.offset.y=0}var p=0;if(c!==N.AXIS){var g=c.dataId_expr}else{var g=u.dataId_expr}for(var h=0;h<i.length;h++){if(i[h].getModel().id.split(".")[2]===g){p=i[h].getPosition().x+Math.round(i[h].getDimension().width/2)}}var f=calculateCompareLayout(c,u,w.offset.y,p-1);w.fromPosition=f.fromPosition;w.toPosition=f.toPosition;d.setPosition(f.position);d.setDimension(f.dimension);w.preferredDimension=f.dimension;w.preferredPosition=f.position;var v=calculateCompareTextLayout(f);w.percent.position=v.percentPosition;w.absolute.position=v.absolutePosition;w.text.position=v.textPosition;w.ellipseArray=v.ellipse;w.ellipseStrokeWidth=r;w.arrowType=f.arrowType;var b=w.compareStyle;if(b===N.NOTATION){b=P.getParameter("COMPARE_DEFAULT_TYPE")}if(b===N.ARROW){w.headBaseSize=o;w.headWidth=P.getParameterParsed("FACTOR_HIGHLIGHT_ARROW_HEAD")*o;w.headLength=o}else{w.headBaseSize=l;w.headWidth=0;w.headLength=0}revertLegend();t[d.getId()]=d}w.compareFrom=null;w.compareTo=null}function setEllipse(e,t,i,a,n,r,o,l,s){var d={x:0,y:0,width:0,height:0};var c=w.topMaxHeight;var u=w.bottomMaxHeight;var p=0,g=0,h=0;var f=n;if(a<w.midMaxHeight){p=(w.midMaxHeight-a)/2}if(e===3){g=c/2+a/2+2}else if(e===2){if(t===1){g=p+m.fSize/2+a/2}else{if(i===1){g=a/2;h=a}else{g=c/2+a/2}}}else if(e===1){if(t===1){if(i!==1){g=p+a/2}}else if(t===2){g=m.fSize/2}else if(t===0){if(i===1){h=a}else if(i===2){g=a/2*-1;h=a}else if(i===0){g=a/2+c/2}}}else if(t===2){if(i===1){g=a/2*-1}}else if(t===1){if(i===1){g=a/2*-1}else if(i===2){g=(a/2+m.fSize/2)*-1}}else if(i===3){g=(a/2+u/2)*-1}else if(i===2){g=(a/2+u/2)*-1}else if(i===1){g=(a/2+u/2)*-1}if(w.text.moved&&w.text.legend!==N.NONE&&w.text.text!==""){f=l.x+w.text.dimension.width/2}else if(w.percent.moved&&w.percent.legend!==N.NONE){f=o.x+w.percent.dimension.width/2}else if(w.absolute.moved&&w.absolute.legend!==N.NONE){f=s.x+w.absolute.dimension.width/2}d.x=Math.round(f);d.y=Math.round(r-g);d.width=Math.round(w.maxWidth);d.height=Math.round(w.topMaxHeight+w.midMaxHeight+w.bottomMaxHeight+h);return d}function calculateCompareTextLayout(e){var t;var i={x:0,y:0},a={x:0,y:0},n={x:0,y:0};var r=e.position.x+e.dimension.width/2;var o=e.position.y+e.dimension.height/2;var l=w.dimension.height;var s=w.compareConnectorSize;if(l<s){l=s}var d=0,c=0,u=0;if(w.absolute.legend!==N.NONE){if(w.absolute.legend===N.START){d=d+1}else if(w.absolute.legend===N.MID){c=c+1}else if(w.absolute.legend===N.END){u=u+1}}if(w.percent.legend!==N.NONE){if(w.percent.legend===N.START){d=d+1}else if(w.percent.legend===N.MID){c=c+1}else if(w.percent.legend===N.END){u=u+1}}if(w.text.legend!==N.NONE&&w.text.text!==""){if(w.text.legend===N.START){d=d+1}else if(w.text.legend===N.MID){c=c+1}else if(w.text.legend===N.END){u=u+1}}var p=1;if(w.ellipse){p=parseFloat(P.getParameter("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH"))}if(w.absolute.legend!==N.NONE){i.x=Math.round(r-w.absolute.dimension.width/2);if(e.dimension.width<w.absolute.dimension.width&&d+c+u===1&&w.absolute.legend!==N.AUTO){var g=Math.round(s/2)+1;if(w.ellipse){g+=Math.round(w.absolute.dimension.width*p-w.absolute.dimension.width/2)}if(w.positive){i.x=e.position.x+e.dimension.width+g}else{i.x=e.position.x-g-w.absolute.dimension.width}w.absolute.moved=true}i.y=setAbsolutePosition(o,l,d,c,u)}if(w.percent.legend!==N.NONE){a.x=Math.round(r-w.percent.dimension.width/2);if(e.dimension.width<w.percent.dimension.width&&d+c+u===1&&w.percent.legend!==N.AUTO){var g=Math.round(s/2)+1;if(w.ellipse){g+=Math.round(w.percent.dimension.width*p-w.percent.dimension.width/2)}if(w.positive){a.x=e.position.x+e.dimension.width+g}else{a.x=e.position.x-g-w.percent.dimension.width}w.percent.moved=true}a.y=setPercentPosition(o,l,d,c,u)}if(w.text.legend!==N.NONE&&w.text.text!==""){n.x=Math.round(r-w.text.dimension.width/2);if(e.dimension.width<w.text.dimension.width&&d+c+u===1&&w.text.legend!==N.AUTO){var g=Math.round(s/2)+1;if(w.ellipse){g+=Math.round(w.text.dimension.width*p-w.text.dimension.width/2)}if(w.positive){n.x=e.position.x+e.dimension.width+g}else{n.x=e.position.x-g-w.text.dimension.width}w.text.moved=true}n.y=setTextPosition(o,l,d,c,u)}if(w.ellipse){t=setEllipse(d,c,u,l,r,o,a,n,i)}return{absolutePosition:i,percentPosition:a,textPosition:n,ellipse:t}}function setPercentPosition(e,t,i,a,n){var r=w.percent.dimension;var o=w.topMaxHeight;var l=w.midMaxHeight;var s=w.bottomMaxHeight;var d=0,c=0;if(t<l){d=Math.abs((t-l)/2)}if(w.percent.legend===N.START){if(i===2){if(w.text.legend===N.START&&w.text.text!==""){c=e-o/2-t/2-d}else{c=e-o-d-t/2}}else{c=e-o/2-r.height/2-d-t/2}}else if(w.percent.legend===N.MID){if(a===3){c=e+l/2-r.height}else if(a===2){c=e+l/2-r.height}else if(a===1){c=e-l/2}}else{if(n===3){c=e+2+t/2+s/2-r.height/2}else if(n===2||n===1){if(w.absolute.legend===N.END){c=e+2+t/2+d+s/2}else{c=e+2+t/2+d}}}return Math.round(c)}function setTextPosition(e,t,i,a,n){var r=w.text.dimension;var o=w.topMaxHeight;var l=w.midMaxHeight;var s=w.bottomMaxHeight;var d=0,c=0;if(t<l){d=Math.abs((t-l)/2)}if(w.text.legend===N.START){c=e-t/2-o-d}else if(w.text.legend===N.MID){c=e-l/2}else{c=e+2+t/2+s-r.height+d}return Math.round(c)}function setAbsolutePosition(e,t,i,a,n){var r=w.absolute.dimension;var o=w.topMaxHeight;var l=w.midMaxHeight;var s=0,d=0;if(t<l){s=Math.abs((l-t)/2)}if(w.absolute.legend===N.START){if(i===3){d=e-o/2+r.height/2-s-t/2}else if(i===2){d=e-o/2-s-t/2}else if(i===1){d=e-o-s-t/2}}else if(w.absolute.legend===N.MID){if(a===3){d=e-r.height/2}else if(a===2){if(w.text.legend===N.MID&&w.text.text!==""){d=e}else{d=e-l/2}}else if(a===1){d=e-l/2}}else{if(n===3){d=e+2+t/2+s}else if(n===2||n===1){d=e+2+t/2+s}}return Math.round(d)}function revertLegend(){if(w.absolute.originalLegend&&w.absolute.originalLegend===N.AUTO){w.absolute.legend=w.absolute.originalLegend;delete w.absolute.originalLegend}if(w.percent.originalLegend&&w.percent.originalLegend===N.AUTO){w.percent.legend=w.percent.originalLegend;delete w.percent.originalLegend}if(w.text.originalLegend&&w.text.originalLegend===N.AUTO){w.text.legend=w.text.originalLegend;delete w.text.originalLegend}}function calculateCompareLayout(e,t,i,a){var n=0,r=0;var o=0,l=0;var s={x:0,y:0};var d=w.dimension.height;var c=w.compareConnectorSize;if(e!==N.AXIS){if(e.instanceOf==="NeedleModel"){n=e.needleSize/2;o=e.needleSize/2}}if(t!==N.AXIS){if(t.instanceOf==="NeedleModel"){r=t.needleSize/2;l=t.needleSize/2}}var u=0,p=0;if(e===N.AXIS||w.compareFromCat===N.AXIS){u=a}else if(e.value>0){if(w.compareFromStart===N.END){u=Math.round(e.position.x+e.dimension.width-n)}else{u=Math.round(e.position.x)}}else{if(w.compareFromStart===N.END){u=Math.round(e.position.x+n)}else{u=Math.round(e.position.x)}}if(t===N.AXIS||w.compareToCat===N.AXIS){p=a}else if(t.value>0){if(w.compareToStart===N.END){p=Math.round(t.position.x+t.dimension.width-r)}else{p=Math.round(t.position.x)}}else{if(w.compareToStart===N.END){p=Math.round(t.position.x+r)}else{p=Math.round(t.position.x)}}var g={x:0,y:0};var h={x:0,y:0};g.x=u;h.x=p;if(e!==N.AXIS){if(e.instanceOf!=="NeedleModel"){g.y=Math.round(e.position.y+e.dimension.height/2)}else{if(i+o>=0){g.y=Math.round(e.position.y+e.dimension.height/2+o)}else{g.y=Math.round(e.position.y+e.dimension.height/2-o)}}}if(t!==N.AXIS){if(t.instanceOf!=="NeedleModel"){h.y=Math.round(t.position.y+t.dimension.height/2)}else{if(g.y+i+o>t.position.y){h.y=Math.round(t.position.y+t.dimension.height/2+l)}else{h.y=Math.round(t.position.y+t.dimension.height/2-l)}}}if(e===N.AXIS||w.compareFromCat===N.AXIS){g.y=h.y}else if(t===N.AXIS||w.compareToCat===N.AXIS){h.y=g.y}if(u>p){var f=u;u=p;p=f;i=i+g.y-h.y;f=g;g=h;h=f}if(h.x<=g.x){var m=true;i=i+g.y-h.y}else{var m=false;i=i+h.y-g.y}var v=p-u;var b;var T=w.font.fSize;var x=0;var E=0;if(w.ellipse){x=parseFloat(P.getParameter("FACTOR_HIGHLIGHT_ELLIPSE_HEIGHT"));var y=parseFloat(P.getParameter("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH"));E=Math.round(w.maxWidth*y*2)}if(w.ellipse){if(v>E+2*T+1){b=0}else if(v>T){b=1}else{b=2}}else{var C=w.compareStyle;if(C===N.NOTATION){C=P.getParameter("COMPARE_DEFAULT_TYPE")}if(C===N.ARROW){if(v>w.maxWidth){b=0}else if(v>T){b=1}else{b=2}}else{if(v>w.maxWidth){b=0}else{b=1}}}if(d<c){d=c}if(w.compareLegend===N.END||w.compareLegend===N.START){var S=R.length-1;var M=R[S].getModel();if(M.isNaN){S--;while(S>=0){M=R[S].getModel();if(!M.isNaN){S=0}S--}}var O=w.midMaxHeight;var A=w.topMaxHeight;var _=O-d;if(_<0){_=0}var L=A+_/2;if(w.ellipse){L=L*x}var I=0;if(M.instanceOf!=="RodModel"&&M.instanceOf!=="NeedleModel"){I=M.position.y+M.dimension.height}else{I=M.position.y+M.needleSize}I=I+L+w.offset.y+3;if(I<0){I=20+w.topMaxHeight+w.midMaxHeight/2}s={x:u,y:Math.round(I)}}else if(w.compareLegend===N.FROM){var D=0;if(e!==N.AXIS){D=e.position.y+w.offset.y+e.dimension.height/2-d/2;if(D<0){D=20+w.topMaxHeight+w.midMaxHeight/2}}else{D=g.y+w.offset.y;if(D<0){D=20+w.topMaxHeight+w.midMaxHeight/2}}s={x:u,y:Math.round(D)}}else if(w.compareLegend===N.TO){var D=0;if(t!==N.AXIS){D=t.position.y+w.offset.y+t.dimension.height/2-d/2;if(D<0){D=20+w.topMaxHeight+w.midMaxHeight/2}}else{D=h.y+w.offset.y}s={x:u,y:Math.round(D)}}else{var D=0;if(m){D=h.y+i-x/2}else{D=g.y+i-x/2}s={x:u,y:Math.round(D)}}return{dimension:{width:v,height:d},position:s,fromPosition:g,toPosition:h,arrowType:b}}},setTextAndDimensions:function(e,t,i,a,n){var h=Mt["b"].DataObjects.RuntimeDO;var f=Mt["b"].DataObjects.DocumentDO.getPainter();var r=new Mt["b"].Utils.Calculator(i);r.setCondenseRoot(i.dataModel.baseNode);if(i.dataModel.dimSize===1){r.setCondenseLevel(1)}else{r.setCondenseLevel(0)}var m=Mt["b"].Utils.Constants.TypeValues.indicator;for(var o=0;o<e.length;o++){var l=e[o];var v=l.getModel();v.type="table";var s=Mt["b"].Layout.Common.getCompareToAndFrom(v,n,r,t);v.compareFrom=s.compareFrom;v.compareTo=s.compareTo;if(v.compareFrom===m.AXIS&&v.compareTo===m.AXIS){v.active=false;v.hide=true;continue}Mt["b"].Models.Actions.ViewModelActions.CompareModel.setText(v,i,n);if(v.compareFrom&&v.compareTo){var d=r.setupCompareFormulas(v,n.multiplePath,n.isMultipleTotal);if(d){v.active=true}else{v.active=false}}else{v.active=false}var c=getTextDimensions();v.absolute.dimension=c.absDim;v.percent.dimension=c.percDim;v.text.dimension=c.textDim;v.topMaxHeight=c.topMaxHeight;v.midMaxHeight=c.midMaxHeight;v.bottomMaxHeight=c.bottomMaxHeight;v.maxWidth=c.maxWidth}function getTextDimensions(){var e=0;var t={width:0,height:0},i={width:0,height:0},a={width:0,height:0};var n=0,r=0,o=0;var l=v.font;var s=l.fWeight+" "+l.fSize+"px "+l.fType;if(v.compareFrom&&v.compareTo){if(v.absolute.legend!==m.NONE){v.absolute.moved=false;t=f.measureTextDim(v.absolute.text,s);var e=Math.max(t.width,e);if(v.absolute.legend===m.AUTO){var d=0;var c=0,u=0;if(v.compareFromCat!==m.AXIS){c=v.compareFrom.position.x}if(v.compareToCat!==m.AXIS){u=v.compareTo.position.x}d=Math.abs(u-c);var p=t.width;if(v.ellipse){var g=parseFloat(h.getParameter("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH"));p=p*g*2}v.absolute.originalLegend=v.absolute.legend;if(p<d){v.absolute.legend=m.START;n+=t.height}else{v.absolute.legend=m.END;o+=t.height}}else{if(v.absolute.legend===m.START){n+=t.height}else if(v.absolute.legend===m.MID){r+=t.height}else{o+=t.height}}}if(v.percent.legend!==m.NONE){v.percent.moved=false;i=f.measureTextDim(v.percent.text,s);e=Math.max(i.width,e);if(v.percent.legend===m.AUTO){var d=0;var c=0,u=0;if(v.compareFromCat!==m.AXIS){c=v.compareFrom.position.x}if(v.compareToCat!==m.AXIS){u=v.compareTo.position.x}d=Math.abs(c-u);var p=i.width;if(v.ellipse){var g=parseFloat(h.getParameter("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH"));p=p*g*2}v.percent.originalLegend=v.percent.legend;if(p<d){v.percent.legend=m.START;n+=i.height}else{v.percent.legend=m.END;o+=i.height}}else{if(v.percent.legend===m.START){n+=i.height}else if(v.percent.legend===m.MID){r+=i.height}else{o+=i.height}}}if(v.text.legend!==m.NONE&&v.text.text!==""){v.text.moved=false;a=f.measureTextDim(v.text.text,s);if(a.height===0){a.height=l.fSize}e=Math.max(a.width,e);if(v.text.legend===m.AUTO){var d=0;var c=0,u=0;if(v.compareFromCat!==m.AXIS){c=v.compareFrom.position.x}if(v.compareToCat!==m.AXIS){u=v.compareTo.position.x}d=Math.abs(c-u);var p=a.width;if(v.ellipse){var g=parseFloat(h.getParameter("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH"));p=p*g*2}v.text.originalLegend=v.text.legend;if(p<d){v.text.legend=m.START;n+=a.height}else{v.text.legend=m.END;o+=a.height}}else{if(v.text.legend===m.START){n+=a.height}else if(v.text.legend===m.MID){r+=a.height}else{o+=a.height}}}if(v.ellipse){var g=parseFloat(h.getParameter("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH"));e=Math.round(e*g*2)}}return{absDim:t,percDim:i,textDim:a,topMaxHeight:n,midMaxHeight:r,bottomMaxHeight:o,maxWidth:e}}},displaceCompares:function(e,t){var i=Mt["b"].Utils.Constants.TypeValues.indicator;function intersect(e,t,i,a){return e>i&&e<a||i>e&&i<t||e===i||t===a}function sortAsc(e,t){return e.getModel().displacePriority-t.getModel().displacePriority}var a=e.slice(0);a=a.sort(sortAsc);for(var n=0;n<a.length;n++){var r=a[n].getModel();if(!r.active){continue}var o=Mt["b"].Layout.Common.getMaxPosition(r,true,t);var l=o.position;var s=o.dimension;for(var d=n+1;d<a.length;d++){var c=a[d].getModel();if(!c.active||r.displacePriority===-1&&c.displacePriority===-1){continue}var u=Mt["b"].Layout.Common.getMaxPosition(c,true,t);var p=u.position;var g=u.dimension;var h=intersect(l.x,l.x+s.width,p.x,p.x+g.width);var f=intersect(l.y,l.y+s.height,p.y,p.y+g.height);if(h&&f){var m=l.y+s.height-p.y;c.displacement=m;c.displaced=true;c.position.y+=m;if(c.absolute.legend!==i.NONE){c.absolute.position.y+=m}if(c.percent.legend!==i.NONE){c.percent.position.y+=m}if(c.text.legend!==i.NONE&&c.text.text!==""){c.text.position.y+=m}if(c.ellipse){c.ellipseArray.y+=m}}}}}};var st=i(54);var dt=i(340);Mt["b"].Layout.Table=Mt["b"].Layout.Table||{};Mt["b"].Layout.Table.TableLayout=function(e,t){var i="table";var a=e!=null?e:1,n=t!=null?t:1;var I=new Mt["b"].Utils.Format.LabelFormatter;var E=Mt["b"].DataObjects.RuntimeDO;var C=rt["a"].notation;var D=rt["a"].interpretation;var R=rt["a"].tableRepresentation;var P=rt["a"].labelHorizontalAlignment;var N=rt["a"].labelVerticalAlignment;var h=rt["a"].tableLegend;var c=E.getParameterParsed("FONT_SIZE_CHART");var w=lt["a"].pt2pix(c);var F=E.getParameter("FONT_FAMILY");var B=E.getParameter("FONT_STYLE_CHART");function mm2pix(e){return lt["a"].mm2pix(c*e)}function convertNMParameter(e){return mm2pix(E.getParameterParsed(e))}var S=convertNMParameter("MMPT_TABLE_AXIS_WITH_NOTATION");var M=convertNMParameter("MMPT_TABLE_AXIS_WITHOUT_NOTATION");var b=convertNMParameter("MMPT_TABLE_HEADER_WITH_NOTATION");var T=convertNMParameter("MMPT_TABLE_HEADER_WITHOUT_NOTATION");var x=E.getParameter("COLOR_TITLE_BOTTOM_BORDER");var f=convertNMParameter("MMPT_AGGREGATION_BORDER_HEIGHT");var m=E.getParameter("COLOR_AGGREGATION_BORDER");var v=E.getParameter("AGGREGATION_ALIGNMENT");var u=mm2pix(.02);var p=convertNMParameter("MMPT_TABLE_HEADER_LABEL_DISTANCE_TOP");var y=convertNMParameter("MMPT_TABLE_HEADER_LABEL_DISTANCE_BOTTOM");var r=convertNMParameter("MMPT_TABLE_HEADER_ELEMENT_DISTANCE");var o=0;var O=Math.max(y,convertNMParameter("MMPT_TABLE_HEADER_TEXT_SPACE"));var k=convertNMParameter("MMPT_TABLE_ELEMENT_BAR_HEIGHT");var U=convertNMParameter("MMPT_TABLE_ELEMENT_SYMBOL_WIDTH");var d=Math.round(U/2);var A=convertNMParameter("MMPT_TABLE_LINE_SIZE");var l=convertNMParameter("MMPT_TABLE_NEEDLE_LINE_SIZE");var H=convertNMParameter("MMPT_TABLE_ELEMENT_LABEL_AREA_DISTANCE");var G=convertNMParameter("MMPT_TABLE_OUTLIER_DISTANCE");var s=convertNMParameter("MMPT_TABLE_COLUMN_DISTANCE");var g=convertNMParameter("MMPT_TABLE_COLUMN_DISTANCE_BIG");var _=convertNMParameter("MMPT_TABLE_COLUMN_WIDTH");var V=parseFloat(E.getParameter("FACTOR_STRUCTURE_LABEL_BACKGROUND_TRANSPARENCY"));var L=convertNMParameter("MMPT_TABLE_VALUE_BOTTOM_BORDER_SIZE");var $=E.getParameter("COLOR_BOTTOM_BORDER");var z=convertNMParameter("MMPT_TABLE_DISTANCE_AFTER_NORMAL");var W=convertNMParameter("MMPT_TABLE_TOP_DISTANCE_NORMAL");var j=E.getParameter("CHECK_TABLE_SUBTOTALS_FAT")==="true"?"bold":"normal";var K=convertNMParameter("MMPT_TABLE_SUBTOTAL_BOTTOM_BORDER_SIZE");var X=E.getParameter("COLOR_SUBTOTAL_BOTTOM_BORDER");var Y=convertNMParameter("MMPT_TABLE_DISTANCE_AFTER_SUBTOTAL");var Z=convertNMParameter("MMPT_TABLE_TOP_DISTANCE_SUBTOTAL");var Q=E.getParameter("CHECK_TABLE_TOTALS_FAT")==="true"?"bold":"normal";var q=convertNMParameter("MMPT_TABLE_TOTAL_BOTTOM_BORDER_SIZE");var J=E.getParameter("COLOR_TOTAL_BOTTOM_BORDER");var ee=convertNMParameter("MMPT_TABLE_DISTANCE_AFTER_TOTAL");var te=convertNMParameter("MMPT_TABLE_TOP_DISTANCE_TOTAL");var ie=E.getParameter("CHECK_TABLE_TOTALS_WITHOUT_VALUES_FONT_BOLD")==="true"?"bold":"normal";var ae=convertNMParameter("MMPT_TABLE_TOTAL_BOTTOM_BORDER_SIZE");var ne=E.getParameter("COLOR_TABLE_TOTALS_WITHOUT_VALUES_BOTTOM_BORDER");var re=convertNMParameter("MMPT_TABLE_TOTALS_WITHOUT_VALUES_DISTANCE_AFTER_TOTAL");var oe=convertNMParameter("MMPT_TABLE_TOTALS_WITHOUT_VALUES_TOP_DISTANCE_TOTAL");var le=convertNMParameter("MMPT_TABLE_HIERARCHY_OFFSET");var se=null,de=null;var ce=[];var ue={};var pe=true;var ge=[];var he=[];var fe=[];var me={};var ve=[];var be=[];var Te={};var xe=[];var Ee;var ye;var Ce,Se,Me;var Oe,Ae;var _e,Le,Ie;var De,Re,Pe;var Ne=[];var we;var Fe=false;var Be=[];var ke,Ue;var He,Ge;var Ve,$e;var ze,We;var je;var Ke;var Xe=[];var Ye=[];var Ze=[];var Qe=[];var qe=[],Je=[],et,tt;this.getRows=function(){return a};this.setRows=function(e){a=e};this.getColumns=function(){return n};this.setColumns=function(e){n=e};this.getType=function(){return i};this.layoutPanels=function(e,t,i,a){var n={};if(e.length===0){return n}ye=n;if(pe){collectAllData(e,a);pe=false}ke=i;Ue=t;var r=_e.border,o=_e.padding;He={width:i.width-r.left.width-r.right.width-o.left-o.right,height:i.height-r.top.width-r.bottom.width-o.top-o.bottom};Ge={x:0,y:0};Ee.setPosition({x:0,y:0});Ee.setDimension({width:ke.width,height:ke.height});n[Ee.getId()]=Ee;if(Se===null||Se.dataModel===null||Se.dataModel.baseNode.nodes.length===0){_e.scrollingData={width:ke.width,height:ke.height,realWidth:ke.width,realHeight:ke.height,scrollingVer:false,scrollingHor:false,x:Ue.x,y:Ue.y,id:_e.id};return n}switch(Ce.buildUp){case nt.PREINIT:getCurrentCellDialogDefinition();aggregateHeaderLabels();setupRowAndSpacingData();tt=dt["a"].measureComment(Ot["a"].getTranslation("ENTER_COMMENT"),w,undefined,Le.fixRowHeight).width+5;setupHeaderRows();hideNonMinMaxLabels();setupOtherRows();calculateAutoWidths1Pass();updateGlobalTableSizes1Pass();break;case nt.INIT:updateGlobalTableSizes2Pass();calculateAutoWidths2Pass();recalculateRowHeights();cutElementsToWidth();updateGlobalTableSizes1Pass();break;case nt.AXIS_ZOOM:updateGlobalTableSizes2Pass();layoutCells();calculateRelativeValues();calculateScalingFactors();adjustAxisFactorToGlobalZoom();break;case nt.LEGEND:break;case nt.DRAW:for(var l=0;l<De.length;l++){if(De[l].IsHidden){continue}for(var s=0;s<$e;s++){var d=Pe[s][l].elements[0];if(d){layoutExprLabel(d,s,l)}}}layoutAnnotators();for(var l=0;l<De.length;l++){if(De[l].IsHidden){continue}if(De[l].exprId.substr(0,3)==="dim"){layoutDimColumnElements(l)}else if(Ye[l]){if(Ye[l].representation===R.VALUE){layoutValueColumnElements(l)}else if(Ye[l].representation===R.LIST||Ye[l].representation===R.COMMENT||Ye[l].representation===R.FLAG){layoutCommentElements(l)}else{layoutGraphicalColumnElements(l)}}}if(he.length>0){Mt["b"].Layout.Common.setCompareMetaInformation(he,true,w,convertNMParameter,Le,mm2pix);Mt["b"].Layout.Table.CompareLayoutHelpers.setTextAndDimensions(he,fe,Se,Ce,_e);Mt["b"].Layout.Table.CompareLayoutHelpers.layoutCompares(he,fe,n,ge,c);Mt["b"].Layout.Table.CompareLayoutHelpers.displaceCompares(he,convertNMParameter)}layoutScalingHelpers();setDataForScrolling();break}return n};function collectAllData(e,t){Ie=t;_e=t.getModel();ze=ot["a"].idTableContent+"."+_e.id;We=ot["a"].idTableHead+"."+_e.id;for(var i=0;i<e.length;i++){var a=e[i];var n=a.getModel();if(n.instanceOf==="BarModel"||n.instanceOf==="NeedleModel"||n.instanceOf==="StructureLineModel"||n.instanceOf==="StructureWaterfallModel"){fe.push(a)}else if(n.instanceOf==="AxisModel"){n.nestedContainerId=ze;ge.push(a)}else if(n.instanceOf==="CompareModel"){n.nestedContainerId=ze;he.push(a)}else if(n.instanceOf==="ScalingHelperModel"){ve.push(a)}else if(n.instanceOf==="LabelModel"){if(n.id.indexOf("scalingHelperLabel")>=0){be.push(a)}else{me[a.getId()]=a}}else if(n.instanceOf==="DataTypeAnnotatorModel"){xe.push(a)}else if(n.instanceOf==="BackGroundModel"){Ee=a}else if(n.instanceOf==="InlineModel"){Te[n.id]=a}}Le=_e.extendedModel;Le.zoom={};Fe=Le.dimensionLabelModel.repeatNotation==="on"||Le.dimensionLabelModel.repeatNotation==="notation"&&E.getParameter("CHECK_TABLE_REPEAT_NOTATION")==="true";De=Le.columnDefinitions;Re=Le.rowDefinitions;Pe=Le.tableCellData;we=Fe?Re.length-1:Re.length;Ve=Le.headerRows;$e=Le.headerRows-1;Se=it["a"].getContextByCid(Le.contextId);Ce=e[0].getController().getRootModel();Oe=Mt["b"].Factories.ModelFactory.getParentContainer(Ce.firstObjectGrid,_e);Ae=Oe[0].extendedModel;Me=e[0].getPainter();if(Se===null||Se.dataModel===null||Se.dataModel.baseNode.nodes.length===0){return}Ke=Mt["b"].Models.Actions.DataModelActions.getMultipleDimensions(Se.dataModel,0);for(var r=0;r<Le.dimensionColumns.length;r++){if(De[Le.dimensionColumns[r]].exprId.substr(0,3)!=="dim"){console.warn("oh noes!",Le.dimensionColumns,De[Le.dimensionColumns[r]].exprId);for(var i=0;i<De.length;i++){if(De[i].exprId.substr(0,3)==="dim"){Le.dimensionColumns[r]=i}}break}}fillIndexArrays()}function fillIndexArrays(){if(Xe&&Xe.length){return true}for(var e=0;e<Le.columns;e++){if(De[e].exprId===""||De[e].exprId.substr(0,3)==="dim"){Xe.push(null);Ze.push(null);Ye.push(null)}else{for(var t=0;t<Se.columns.length;t++){if(Se.columns[t].id.split(".").pop()===De[e].exprId){Xe.push(Se.columns[t]);Ze.push(t);break}}for(var t=0;t<Le.expressions.length;t++){if(Le.expressions[t].id.split(".").pop()===De[e].exprId){Ye.push(Le.expressions[t]);break}}}}if(Xe.length!==De.length||Ye.length!==De.length){console.warn("blam!: _col2Expr",Xe,De.length,Ye);return false}var i=0;for(var e=0;e<Le.headerRows;e++){Qe.push(null)}for(var e=Le.headerRows;e<we;e++){var a=Re[e];if(a.type==="empty"||a.nodePath===null||a.nodePath===""&&Ke[i].path!==""){Qe.push(null)}else if(Ke[i]){Qe.push(Ke[i].ref)}else{Se=null;break}i++}if(Fe){Qe.push(null)}if(i!==Ke.length){console.warn("blam!: _row2DimNode",Ke,Re.length,Re);Se=null}}function aggregateHeaderLabels(){function noLabel(e){return!e||e.text===""}ce=new Array($e);for(var e=0;e<$e;e++){ce[e]=0;for(var t=0;t<De.length;t++){var i=t,a=-1;for(;i<De.length;i++){var n=Pe[e][i],r=Pe[e][i+1],o=n&&n.elements[0],l=r&&r.elements[0];if(!o||!l||l.hideLabel||o.hideLabel||o.text!==l.text){break}var s=e>0?Pe[e-1][t].elements[0]:undefined,d=e>0?Pe[e-1][t+1].elements[0]:undefined,c=De[t].exprId.substr(0,3)==="dim",u=De[t+1].exprId.substr(0,3)==="dim";if(!((e===0||noLabel(s)&&noLabel(d)||s&&s.hideLabel&&d)&&(c===u||e!==$e-1))){break}o.hideLabel=true;o.aggregatedHide=true;var p=Mt["b"].Layout.Common.getHighlight(Le,o,rt["a"].highlightType.LEGEND);if(p&&p.highlight){o.isHighlighted=false;if(e===$e-1){p.highlight.active=false}}var g=Mt["b"].Layout.Common.getHighlight(Le,l,rt["a"].highlightType.LEGEND);if(g&&g.highlight){l.isHighlighted=false;if(e===$e-1){g.highlight.active=false}}if(e!==$e-1){ce[e]=f;if(o.text!==""){n.border.bottom=f;n.borderColor=m;r.border.bottom=f;r.borderColor=m}}if(!De[i+1].IsHidden){a=i+1}}if(a>-1){var h=Pe[e][a].elements[0];if(h){h.hideLabel=false;h.aggregatedHide=false}t=i}}}}function setupRowAndSpacingData(){for(var e=0;e<De.length;e++){De[e].spacing_left=0;De[e].spacing_right=getColumnSpacing(e)}for(var t=0;t<=$e;t++){Re[t].type=getRowType(t);Re[t].spacing_bottom=0;Re[t].spacing_top=0}Re[$e-1].spacing_bottom=o;Re[$e].spacing_bottom=r;for(var t=Le.headerRows;t<we;t++){var i=Re[t];i.type=getRowType(t);i.spacing_top=0;switch(i.type){case"":i.spacing_bottom=z;i.topDistance=W;break;case"total":i.spacing_bottom=ee;i.topDistance=te;break;case"subtotal":i.spacing_bottom=Y;i.topDistance=Z;break;case"totalsWithoutValues":i.spacing_bottom=re;i.topDistance=oe;break;case"empty":i.spacing_bottom=0;i.topDistance=0;break}}if(Fe){Re[we-1].spacing_bottom=0;Re[we].type=getRowType(we);Re[we].spacing_bottom=0;Re[we].spacing_top=O;Re[we].topDistance=0}}function setupHeaderRows(){var e=new Array(De.length),t=function(e){if(De[e].exprId.substr(0,3)==="dim"){return false}var t=true;for(var i=Ve;i<we&&t;i++){var a=Qe[i];if(a){var n=a.nodes[Ze[e]].usedRuledEntry;t=Q==="bold"&&n.interpretation===D.TOTAL||j==="bold"&&n.interpretation===D.SUBTOTAL}}return t};for(var i=0;i<Le.headerRows;i++){Re[i].height=0}for(var a=0;a<De.length;a++){var n=Pe[$e][a].elements[0];if(!n||De[a].IsHidden){continue}if(Ye[a]&&(Ye[a].notation===C.HEADER||Ye[a].notation===C.ELEMENT_HEADER)){n.dimension.height=b}else{n.dimension.height=T}Re[$e].height=Math.max(Re[$e].height,n.dimension.height);n.nestedContainerId=We;if(Fe){Re[we].height=Re[$e].height;Pe[we][a].elements[0].nestedContainerId=We}e[a]=t(a)}for(var r=0;r<$e;r++){var o=r>0&&ce[r-1]>0?u:0;for(var a=0;a<De.length;a++){if(De[a].IsHidden){continue}var l=Pe[r][a].elements[0];if(l){if(e[a]){l.fontWeight="bold"}var s=l.fontWeight+" "+w+"px "+F;l.dimension=Me.measureTextDim(l.text,s);l.nestedContainerId=We;var d=l.dimension.height;if(!l.hideLabel){var c=r===$e-1?O:y;Re[r].height=Math.max(Re[r].height,d+Pe[r][a].border.bottom+o+p+c)}}}}}function hideNonMinMaxLabels(){function processSingleCol(e){var t=null,i=null;var a=null,n=null;for(var r=Ve;r<we;r++){var o=getRepresentationAndLabel(r,e);var l=o.label;var s=o.rep;if(l&&(!s||s&&!s.isOutlier)){var d=Qe[r].nodes[Ze[e]];var c=isNaN(d.value)||d.usedRuledEntry.valueType==="FACTOR_NONE"?0:d.value;if(a===null){a=c;i=l;n=c;t=l}else if(c>a){if(i!==t){i.hideLabel=true;var u=Mt["b"].Layout.Common.getHighlight(Le,i,rt["a"].highlightType.VALUE,true);if(u&&u.highlight){u.highlight.active=false}}i=l;a=c}else if(c<n){if(i!==t){t.hideLabel=true;var u=Mt["b"].Layout.Common.getHighlight(Le,t,rt["a"].highlightType.VALUE,true);if(u&&u.highlight){u.highlight.active=false}}t=l;n=c}else{l.hideLabel=true;var u=Mt["b"].Layout.Common.getHighlight(Le,l,rt["a"].highlightType.VALUE,true);if(u&&u.highlight){u.highlight.active=false}}}}}for(var e=0;e<De.length;e++){var t=Ye[e];if(t&&t.instanceOf==="ChartExpressionModel"&&t.valueLabelOpt.substr(0,6)==="MinMax"){processSingleCol(e)}}}function setupOtherRows(){var e,t,i,a=P.LEFT;prepareForComments();if(Le.dimensionLabelModel!==undefined&&Le.dimensionLabelModel.alignment!==""){a=Le.dimensionLabelModel.alignment}for(var n=0;n<$e;n++){for(var r=0;r<De.length;r++){if(Le.dimensionColumns.indexOf(r)!==-1){if(De[r].IsHidden){continue}var o=Pe[n][r];var l=o.elements[0];if(l&&l.hierarchyLvl!==undefined){l.dimension.width+=l.hierarchyLvl*le}}}}for(var n=Ve;n<we;n++){qe[n]||(qe[n]=[]);var s=Re[n];s.height=0;s.singleLineHeight=0;s.singleLineElementsHeight=0;if(s.type==="empty"){for(var d=0;d<De.length;d++){Pe[n][d].border={top:0,bottom:0,left:0,right:0}}continue}var c=getBordersAndLabelDataForDim(n),u=false;for(var p=0;p<De.length;p++){var g=Pe[n][p],h=void 0;g.inContentCell=true;if(De[p].IsHidden){g.border={top:0,bottom:0,left:0,right:0};continue}if(Le.dimensionColumns.indexOf(p)!==-1){e=g.elements[0];e&&(e.nestedContainerId=ze);if(e===undefined||e.text===""&&u===false){continue}u=true;if(e.hierarchyLvl!==undefined){a=P.LEFT}e.horizontalAlign=a;e.verticalAlign=N.MIDDLE;e.fontSize=w;e.fontWeight=c.fontWeight;e.dimension=Me.measureTextDim(e.text,c.fontWeight+" "+w+"px "+F);if(e.hierarchyLvl!==undefined){e.dimension.width+=e.hierarchyLvl!=undefined?e.hierarchyLvl*le:0}h=e.dimension.height+c.borders.top+c.borders.bottom+s.topDistance;s.singleLineHeight=Math.max(s.singleLineHeight,h);s.singleLineElementsHeight=Math.max(s.singleLineElementsHeight,e.dimension.height)}else{if(Ye[p].representation===R.VALUE){e=getLabel(n,p);i=0;if(e){var f=Qe[n].nodes[Ze[p]].usedRuledEntry;if(f.valueType==="FACTOR_NONE"){e.hideLabel=true;var m=Mt["b"].Layout.Common.getHighlight(Le,e,rt["a"].highlightType.VALUE,true);if(m&&m.highlight){m.highlight.active=false}}if(e.hideLabel!==true){e.horizontalAlign=P.MIDDLE;e.verticalAlign=N.MIDDLE;e.fontSize=w;if(f.interpretation===D.TOTAL){e.fontWeight=Q}else if(f.interpretation===D.SUBTOTAL){e.fontWeight=j}else{e.fontWeight=c.fontWeight}e.dimension=Me.measureTextDim(e.text,c.fontWeight+" "+w+"px "+F);e.nestedContainerId=ze;i=e.dimension.height}}h=i+c.borders.top+c.borders.bottom+s.topDistance;s.singleLineHeight=Math.max(s.singleLineHeight,h);s.singleLineElementsHeight=Math.max(s.singleLineElementsHeight,i)}else if(Ye[p].representation===R.BAR||Ye[p].representation===R.NEEDLE||Ye[p].representation===R.WATERFALL||Ye[p].representation===R.LINE||Ye[p].representation===R.SYMBOL||Ye[p].representation===R.SYMBOL_LINE){if(De[p].IsHidden){continue}e=null;i=0;t=0;for(var v=0;v<g.elements.length;v++){g.elements[v].nestedContainerId=ze;if(g.elements[v].instanceOf==="LabelModel"){e=g.elements[v]}else if(g.elements[v].instanceOf==="BarModel"||g.elements[v].instanceOf==="StructureWaterfallModel"){t=k}else if(g.elements[v].instanceOf==="NeedleModel"||g.elements[v].instanceOf==="StructureLineModel"){t=U}}var f=Qe[n].nodes[Ze[p]].usedRuledEntry;if(f.valueType==="FACTOR_NONE"){e.hideLabel=true;var m=Mt["b"].Layout.Common.getHighlight(Le,e,rt["a"].highlightType.VALUE,true);if(m&&m.highlight){m.highlight.active=false}}if(e&&e.hideLabel!==true){e.horizontalAlign=P.MIDDLE;e.verticalAlign=N.MIDDLE;e.fontSize=w;if(f.interpretation===D.TOTAL){e.fontWeight=Q}else if(f.interpretation===D.SUBTOTAL){e.fontWeight=j}else{e.fontWeight=c.fontWeight}e.dimension=Me.measureTextDim(e.text,c.fontWeight+" "+w+"px "+F);i=e.dimension.height}h=Math.max(i,t)+c.borders.top+c.borders.bottom+s.topDistance;s.singleLineHeight=Math.max(s.singleLineHeight,h);s.singleLineElementsHeight=Math.max(s.singleLineElementsHeight,i,t)}else if(Ye[p].representation===R.LIST){var b=getOtherRepresentationType(n,p);if(n===Ve){var T="normal "+w+"px '"+F+"'",x="bold "+w+"px '"+F+"'",E={width:0,height:0,widthBold:0,heightBold:0,maxWidth:0};for(var y=0;y<b.listContent.length;y++){var C=b.listContent[y].originalDescription;if(I.checkVariable(C)){C=I.parseLabel(C)}var S=Me.measureTextDim(C,T);E.height=Math.max(E.height,S.height);E.width=Math.max(E.width,S.width);S=Me.measureTextDim(C,x);E.heightBold=Math.max(E.heightBold,S.height);E.widthBold=Math.max(E.widthBold,S.width)}ue[p]=E}var M=ue[p];if("bold"===c.fontWeight){b.dimension.height=M.heightBold;b.dimension.width=M.widthBold}else{b.dimension.height=M.height;b.dimension.width=M.width}b.triangle.dimension={width:.8*w,height:.8*w};M.maxWidth=Math.max(M.maxWidth,b.dimension.width+b.triangle.dimension.width);b.fontSize=w;b.font=F;b.fontStyle=B;b.lineHeight=w+ot["a"].textLineSpacing;b.fontWeight=c.fontWeight;b.nestedContainerId=ze;h=Math.max(b.dimension.height,b.triangle.dimension.height)+c.borders.top+c.borders.bottom+s.topDistance;s.singleLineHeight=Math.max(s.singleLineHeight,h);s.singleLineElementsHeight=Math.max(s.singleLineElementsHeight,b.dimension.height,b.triangle.dimension.height)}else if(Ye[p].representation===R.COMMENT){var O=getOtherRepresentationType(n,p);O.fontSize=w;O.font=F;O.fontStyle=B;O.lineHeight=w+ot["a"].textLineSpacing;O.fontWeight=c.fontWeight;O.nestedContainerId=ze;if(O.hide){var A=dt["a"].measureComment(O.placeholderText,w,undefined,Le.fixRowHeight);O.dimension.width=A.width+5;O.dimension.height=A.height;O.lines=1}else{var C=O.text;if(I.checkVariable(C)){C=I.parseLabel(C).toString()}var _=dt["a"].measureCommentMinWidth(C,w,Le.fixRowHeight);O.fixedWidth=De[p].columnFix;O.dimension.width=Math.max(tt,_.width);O.lines=_.lines}}else if(Ye[p].representation===R.FLAG){var L=getOtherRepresentationType(n,p);L.dimension.height=10;L.dimension.width=10;L.fontSize=w;L.font=F;L.fontStyle=B;L.lineHeight=w+ot["a"].textLineSpacing;L.fontWeight=c.fontWeight;L.nestedContainerId=ze;h=L.dimension.height+c.borders.top+c.borders.bottom+s.topDistance;s.singleLineHeight=Math.max(s.singleLineHeight,h);s.singleLineElementsHeight=Math.max(s.singleLineElementsHeight,L.dimension.height)}}g.border=st["a"].deepCopy(c.borders);g.borderColor=c.borderColor;s.height=Math.max(s.height,h||0);qe[n][p]=h}}}function prepareForComments(){dt["a"].setSpanFont("normal "+w+"px '"+F+"'");dt["a"].setSpanHTML("&nbsp;")}function calculateAutoWidths1Pass(){var e=_e.border,t=_e.padding,i=_e.dimension.width-getSumOfColumnSpacing()-e.left.width-e.right.width-t.left-t.right,a=[R.LIST,R.COMMENT,R.FLAG];_e.dimension.widthWithoutSpacing=i;for(var n=0;n<De.length;n++){var r={};var o=Ye[n],l=De[n];if(l.IsHidden){r={width:0,minWidth:0,maxWidth:0}}else{var s=l.columnFix===false||l.defWidth===-1||Le.columnMode==="autoContent"||l.defWidthType==="w";var d=Le.dimensionColumns.indexOf(n)!==-1,c=!d&&a.indexOf(o.representation)!==-1;if(s){r.width=calculateColumnAutoWidths(n);if(l.defWidth!==-1&&l.defWidthType!=="w"){r.width=Math.max(r.width,lt["a"].convertToPixel(l.defWidth,i,l.defWidthType))}}else{r.width=lt["a"].convertToPixel(l.defWidth,i,l.defWidthType)}if(l.columnFix===false){if(l.defMinWidth===-1&&!d){r.minWidth=c?r.width:_}else{r.minWidth=lt["a"].convertToPixel(l.defMinWidth,i,l.defMinWidthType);r.width=Math.max(r.minWidth,r.width)}if(l.defMaxWidth!==-1){r.maxWidth=lt["a"].convertToPixel(l.defMaxWidth,i,l.defMaxWidthType);r.width=Math.min(r.maxWidth,r.width)}}if(r.minWidth===undefined||l.columnFix){r.minWidth=l.columnFix?0:_}}Ne.push(r)}for(var n=0;n<De.length;n++){if(Ne[n].width>=0){De[n].width=Ne[n].width}}}function calculateAutoWidths2Pass(){var s=_e.dimension.widthWithoutSpacing,d=function(e,t){return e+t.width},c=function(e,t){return e+t},u=Ne.reduce(d,0),p=s-u;if(p!==0){Ne.reduce(function(e,t,i){return e||De[i].defWidthType==="w"},false)&&calculateWeightedColumns();calculateDynamicColumns()}calculateAutoWidthsForAggregatedHeaders(Ne);for(var e=0;e<De.length;e++){if(Ne[e].width>=0){De[e].width=Ne[e].width;if(!De[e].IsHidden&&Ye[e]&&Ye[e].representation===R.COMMENT&&!Le.fixRowHeight&&!De[e].columnFix){for(var t=Ve;t<we;t++){var i=Re[t],a=getOtherRepresentationType(t,e),n=Me.checkFormattingInText(Me.checkVariableInText(a.text,"textDiv")),r=dt["a"].measureComment(n,w,Ne[e].width,Le.fixRowHeight),o=getBordersAndLabelDataForDim(t),l=r.height+o.borders.top+o.borders.bottom+i.topDistance;a.dimension.height=r.height;i.height=Math.max(i.height,l)}}}}function calculateWeightedColumns(){Ne.forEach(function(e,t){De[t].defWidthType==="w"&&(e.width=0)});var e=function(e,t){var i=De[t];return i.IsHidden||i.defWidthType!=="w"||i.defWidthType==="w"&&i.defMaxWidth!==-1&&e.width>=e.maxWidth?0:i.defWidth},t=function(e,t){var i=De[t];return i.IsHidden||i.defWidthType!=="w"||i.defWidthType==="w"&&i.defMinWidth!==-1&&e.width<=e.minWidth?0:i.defWidth};calculateColumns(t,e,true);for(var i=0;i<De.length;i++){if(De[i].defWidthType==="w"){Ne[i].width=Math.max(Ne[i].width,Ne[i].minWidth)}}}function calculateDynamicColumns(){if(Le.columnMode!=="autoGrid"){return}var e=function(e,t){var i=De[t];return i.IsHidden||i.columnFix||i.defWidthType==="w"||e.width>=e.maxWidth?0:1},t=function(e,t){var i=De[t];return i.IsHidden||i.columnFix||i.defWidthType==="w"||e.width<=e.minWidth?0:1};calculateColumns(t,e,false)}function calculateColumns(n,r,e){var t=De.length,o=0;var l=e?function(e,t){De[e].defWidthType==="w"&&t()}:function(e,t){De[e].defWidthType!=="w"&&t()};var i=function(){u=Ne.reduce(d,0);p=s-u;var e=p>0?r:n,t=Ne.map(e);o=t.reduce(c,0);if(o){var i=function(e){l(e,function(){Ne[e].width+=t[e]/o*p;Ne[e].maxWidth&&(Ne[e].width=Math.min(Ne[e].width,Ne[e].maxWidth));Ne[e].width=Math.max(Ne[e].width,Ne[e].minWidth)})};for(var a=0;a<De.length;a++){i(a)}}};do{i()}while(p&&t--&&o)}}function recalculateRowHeights(){var e;if("top"===Le.rowAlignment){e=function(){return 0}}else if("mid"===Le.rowAlignment){e=function(e,t){return Math.round((e-t)/2)}}else{e=function(e,t){return e-t}}for(var t=Ve;t<we;t++){var i=Re[t];if(i.type==="empty"){continue}var a=getBordersAndLabelDataForDim(t);i.height=0;for(var n=0;n<De.length;n++){if(Le.dimensionColumns.indexOf(n)===-1&&!De[n].IsHidden&&Ye[n].representation===R.COMMENT){var r=getOtherRepresentationType(t,n);var o=r.text;if(I.checkVariable(o)){o=I.parseLabel(o).toString()}var l=dt["a"].measureComment(o,w,De[n].width,Le.fixRowHeight);r.dimension.height=l.height;r.lines=l.lines;qe[t][n]=r.dimension.height+a.borders.top+a.borders.bottom+i.topDistance;i.singleLineHeight=Math.max(i.singleLineHeight,w+a.borders.top+a.borders.bottom+i.topDistance);i.singleLineElementsHeight=Math.max(i.singleLineElementsHeight,w)}i.height=Math.max(i.height,qe[t][n]||0,Ae.tableRowHeights[_e.row][t])}i.singleLineOffset=e(i.height,i.singleLineHeight)}}function calculateColumnAutoWidths(e){var t=0;for(var i=0;i<$e;i++){var a=Pe[i][e].elements[0],n=Pe[i][e-1];if(a&&!a.aggregatedHide&&(e===0||!n.elements[0]||!n.elements[0].aggregatedHide)){t=Math.max(t,a.dimension.width)}}if(Le.dimensionColumns.indexOf(e)>=0){for(var i=Ve;i<we;i++){if(Re[i].type==="empty"){continue}var r=Pe[i][e].elements[0];if(r){t=Math.max(t,r.dimension.width)}}}else if(Ye[e].representation===R.LIST){t=Math.max(t,ue[e].maxWidth+2)}else if(Ye[e].representation===R.COMMENT){for(var i=Ve;i<we;i++){if(Re[i].type==="empty"){continue}var o=getOtherRepresentationType(i,e);t=Math.max(t,o.dimension.width)}}else if(Ye[e].representation===R.FLAG){var l=getOtherRepresentationType(Ve,e);t=Math.max(t,l.dimension.width)}else if(Ye[e].representation===R.VALUE){var s=De[e].defMinWidth===-1?_:De[e].defMinWidth;t=Math.max(t,s);for(var i=Ve;i<we;i++){if(Re[i].type==="empty"){continue}var r=getLabel(i,e);if(r&&!r.hideLabel){t=Math.max(t,r.dimension.width)}}}else{var d=Ye[e];var c=getScalingData(e);var u=c.outlierWidth;var p=c.axisWidth;var g=c.chartSymbolSize*2||U;var s=De[e].defMinWidth===-1?_:De[e].defMinWidth;var h=0;var f=0;var m=0;for(var i=Ve;i<we;i++){if(Re[i].type==="empty"){continue}var v=getRepresentationAndLabel(i,e),o=v.rep,r=v.label;m=0;if(r&&!r.hideLabel){m=r.dimension.width+H}m+=o.isOutlier?u:g;if(o.value>0||!c.onlyNegatives&&o.value===0){f=Math.max(f,m)}else{h=Math.min(h,-m)}}m=d.axisMid?Math.max(f,Math.abs(h))*2:f-h;t=Math.max(t,m+p,s)}return t+1}function calculateAutoWidthsForAggregatedHeaders(e){for(var t=$e-1;t>=0;t--){for(var i=0;i<De.length;i++){var a=Pe[t][i].elements[0];if(a&&a.hideLabel&&a.aggregatedHide){var n=i,r=void 0,o=De[i],l=e[i].width,s=l===-1?o.width:l,d=-1,c=void 0;do{r=Pe[t][n].elements[0];if(r&&!De[n].IsHidden){d=n;c=r}s+=o.spacing_right;o=De[n];l=e[n].width;s+=(l===-1?o.width:l)+o.spacing_left;n++}while(r&&r.hideLabel&&r.aggregatedHide&&r.text===a.text);if(d>-1&&s<(c||r).dimension.width){for(var u=d;u>=i;u--){if(e[u].width!==-1){e[u].width+=c.dimension.width-s;break}}}i=n}}}}function calculateRelativeValues(){for(var e=0;e<De.length;e++){var t=Ye[e];if(!t||t.representation!==R.WATERFALL){continue}var i=0;var a=0;for(var n=Ve;n<we;n++){var r=getRepresentation(n,e,"StructureWaterfallModel");if(!r){continue}if(r.waterfallType===0){r.relativeValue=i+(r.isNaN||r.isOutlier?0:r.value)}else if(r.waterfallType===1){r.relativeValue=r.isNaN||r.isOutlier?i:r.value;a=r.value}else if(r.waterfallType===2){if(!r.isNaN&&!r.isOutlier){r.relativeValue=a+r.value;a=r.relativeValue}}i=r.relativeValue}}}function calculateScalingFactors(){var e=[R.BAR,R.NEEDLE,R.WATERFALL,R.LINE,R.SYMBOL,R.SYMBOL_LINE];for(var t=0;t<De.length;t++){var i=Ye[t];if(!De[t].IsHidden&&i&&e.indexOf(i.representation)!==-1){var a=calculateAxisAndScalingFactors(t);De[t].axisFactor=a.axisFactor;var n=Xe[t].scalingGroup;if(i.scalingMaximize){n+="."+Ce.extensionHash+"."+_e.id}var r=at["a"].resolveQvVars(n);if(Ce.globalZoom[r]===undefined||Ce.globalZoom[r]>a.scalingFactor){Ce.globalZoom[r]=a.scalingFactor}if(Le.zoom[r]===undefined||Le.zoom[r]>a.scalingFactor){Le.zoom[r]=a.scalingFactor}}}}function adjustAxisFactorToGlobalZoom(){for(var e=0;e<De.length;e++){var t=De[e],i=Ye[e];if(De[e].IsHidden||!i||!(i.representation===R.WATERFALL)){continue}var a=Xe[e].scalingGroup;if(i.scalingMaximize){a+="."+Ce.extensionHash+"."+_e.id}var n=at["a"].resolveQvVars(a),r=Be[e],o=r.invertedValues,l=r.invertedLabelWidths,s=Pe[0][e].afterLayoutingSize.width-Pe[0][e].border.left-Pe[0][e].border.right,d=Math.round(s*t.axisFactor),c=s-d;var u=Ce.globalZoom[n],p=0,g=0;for(var h=0;h<o.length;h++){var f=l[h]-Math.round(Math.abs(o[h])*u);if(o[h]<0){g=Math.max(g,f)}else{p=Math.max(p,f)}}var m=false;if(g>c&&p>d){}else if(g>c){t.axisFactor-=(g-c)/s;m=true}else if(p>d){t.axisFactor+=(p-d)/s;m=true}if(m){u=calculateScalingFactor(e,t.axisFactor,s,r);if(Ce.globalZoom[n]>u){Ce.globalZoom[n]=u}if(Le.zoom[n]>u){Le.zoom[n]=u}}}}function getCurrentCellDialogDefinition(){var e=Mt["b"].DataObjects.DocumentDO.getExtension(Ce.extensionHash).getActiveMover(),t=e?e.getConfig():null,i=Ae.tableColWidths[_e.column]||(Ae.tableColWidths[_e.column]=[]);if(e&&t&&Ie.getId()===t.tableContainer.id&&t.tableContainer.column===_e.column){var a=t?t.colDef.filter(function(e){return!e.IsHidden}):[];for(var n=0;n<a.length;n++){i[n]={colDef:a[n],columnMode:t.columnMode}}}var r=Le.columnDefinitions.filter(function(e){return!e.IsHidden}).map(function(e){return e.clone()});if(r.length>i.length){for(var n=i.length-1;n<r.length;n++){if(!i[n]){i[n]={colDef:r[n],columnMode:i[0]?i[0].columnMode:_e.extendedModel.columnMode}}}}var o=Le.columnDefinitions.filter(function(e){return!e.IsHidden});for(var n=0;n<o;n++){o[n].defWidth=i[n].colDef.defWidth;o[n].defWidthType=i[n].colDef.defWidthType;o[n].defMinWidth=i[n].colDef.defMinWidth;o[n].defMinWidthType=i[n].colDef.defMinWidthType;o[n].defMaxWidth=i[n].colDef.defMaxWidth;o[n].defMaxWidthType=i[n].colDef.defMaxWidthType;o[n].columnFix=i[n].colDef.columnFix;_e.extendedModel.columnMode=i[n].columnMode}}function updateGlobalTableSizes1Pass(){var e=Ae.tableColWidths[_e.column],t=De.filter(function(e){return!e.IsHidden});for(var i=0;i<t.length;i++){e[i].colDef.width=t[i].width}var a=_e.row;if(!Ae.tableRowHeights[a]){Ae.tableRowHeights[a]=[];Ae.tableRowSpacings[a]=[]}var n=Ae.tableRowHeights[a],r=Ae.tableRowSpacings[a];for(var i=0;i<Re.length;i++){if(n[i]===undefined||n[i]<Re[i].height){n[i]=Re[i].height}if(r[i]===undefined||r[i]<Re[i].spacing_bottom){r[i]=Re[i].spacing_bottom}}}function updateGlobalTableSizes2Pass(){var e=[R.LIST,R.COMMENT,R.FLAG];var t=Ae.tableColWidths[_e.column],i=[],a=[],n=De.filter(function(e,t){if(!e.IsHidden){i.push(Ne[t]);a.push(Ye[t])}return!e.IsHidden});for(var r=0;r<n.length;r++){i[r].width=n[r].width=t[r].colDef.width;if(i[r].minWidth!==undefined&&i[r].minWidth<i[r].width&&a[r]&&e.indexOf(a[r].representation)>-1){i[r].minWidth=i[r].width}n[r].defWidth=t[r].colDef.defWidth;n[r].defWidthType=t[r].colDef.defWidthType;n[r].defMinWidth=t[r].colDef.defMinWidth;n[r].defMinWidthType=t[r].colDef.defMinWidthType;n[r].defMaxWidth=t[r].colDef.defMaxWidth;n[r].defMaxWidthType=t[r].colDef.defMaxWidthType;n[r].columnFix=t[r].colDef.columnFix;_e.extendedModel.columnMode=t[r].columnMode}var o=_e.row,l=Ae.tableRowHeights[o],s=Ae.tableRowSpacings[o];for(var r=0;r<Re.length;r++){Re[r].height=l[r];Re[r].spacing_bottom=s[r]}}function cutElementsToWidth(){for(var e=0;e<De.length;e++){var t=De[e];if(t.IsHidden){continue}for(var i=0;i<$e;i++){var a=Pe[i];var n=a[e].elements[0];if(n&&!n.hideLabel&&n.dimension.width>t.width){var r=getBordersAndLabelDataForDim(i).fontWeight+" "+w+"px '"+F+"'";var o=t.width;var l=e-1;while(l>=0&&a[l].elements[0]&&a[l].elements[0].aggregatedHide&&a[l].elements[0].text===n.text){o+=De[l+1].spacing_left+De[l].width+De[l].spacing_right;l--}n.text=Mt["b"].Models.Actions.ViewModelActions.InlineCommentModel.rewriteLabelToWidthBinary(n.text,o,r);n.dimension=Me.measureTextDim(n.text,r);for(l++;l<e;l++){var s=a[l].elements[0];s.text=n.text;s.dimension.width=n.dimension.width}}}if(Le.dimensionColumns.indexOf(e)>=0){for(var i=Ve;i<we;i++){var n=Pe[i][e].elements[0];if(n&&n.dimension.width>t.width){var r=getBordersAndLabelDataForDim(i).fontWeight+" "+w+"px '"+F+"'";n.text=Mt["b"].Models.Actions.ViewModelActions.InlineCommentModel.rewriteLabelToWidthBinary(n.text,t.width,r)}}}else if(Ye[e].representation===R.LIST){for(var i=Ve;i<we;i++){var d=getOtherRepresentationType(i,e);if(d.hide){continue}var c=t.width-d.triangle.dimension.width;var r=getBordersAndLabelDataForDim(i).fontWeight+" "+w+"px '"+F+"'";for(var u=0;u<d.listContent.length;u++){var p=d.listContent[u];p.description=Mt["b"].Models.Actions.ViewModelActions.InlineCommentModel.rewriteLabelToWidthBinary(p.originalDescription,c,r)}}}}}function layoutCells(){var e=0,t=0,i=Ge.x,a=Ge.y,n=Ae.tableColWidths[_e.column].map(function(e){return e.colDef.width});if(Le.axisAlignmentCategory!=="Start"){for(var r=0;r<Le.rows;r++){e+=Re[r].height+Re[r].spacing_bottom}e-=Re[Re.length-1].spacing_bottom;e+=getLayoutScalingHelpersHeight();if(e<He.height){if(Le.axisAlignmentCategory==="End"){a+=He.height-e}else if(Le.axisAlignmentCategory==="Mid"){a+=Math.round((He.height-e)/2)}}}if(Le.axisAlignmentElement!=="Start"&&Le.axisAlignmentElement!=="Auto"){for(var o=0;o<Le.columns;o++){if(De[o].IsHidden){t+=n[o]}else{t+=De[o].width+(o===Le.columns-1?0:De[o].spacing_right)}}if(t<He.width){if(Le.axisAlignmentElement==="End"){i+=He.width-t}else if(Le.axisAlignmentElement==="Mid"){i+=Math.round((He.width-t)/2)}}}var l=i,s=a;for(var d=0;d<Le.rows;d++){l=i;s+=Re[d].spacing_top;e=Re[d].height;for(var c=0;c<Le.columns;c++){var u=Pe[d][c];if(De[c].IsHidden){t=0}else{t=De[c].width}u.afterLayoutingPosition={x:l,y:s};u.afterLayoutingSize={width:t,height:e};l+=t+De[c].spacing_right}s+=e+Re[d].spacing_bottom;if(d===Ve-1){je=s;s=0}else if(Fe&&d===Le.rows-2){s+=je}}}function layoutDimColumnElements(e){var t=P.LEFT;if(Le.dimensionLabelModel!==undefined&&Le.dimensionLabelModel.alignment!==""){t=Le.dimensionLabelModel.alignment}for(var i=0;i<we;i++){if(i===$e){continue}var a=Pe[i][e].elements[0];if(a){var n=Pe[i][e].afterLayoutingPosition;var r=Pe[i][e].afterLayoutingSize;var o=getViewById2(me,a.id);if(a.hierarchyLvl===undefined){if(t===P.MIDDLE){a.position.x=n.x+r.width/2-a.dimension.width/2}else if(t===P.LEFT){a.position.x=n.x}else{a.position.x=n.x+r.width;a.textAnchor="end"}}else{var l=a.hierarchyLvl!=undefined?a.hierarchyLvl*le:0;a.position.x=n.x+l}if(i===$e-1){a.position.y=n.y+r.height-ce[i]-a.dimension.height-O}else if(i<$e){a.position.y=n.y+r.height-ce[i]-a.dimension.height-y}else{a.position.y=getElementYPosition(e,i,a)}ye[a.id]=o}}}function layoutValueColumnElements(e){for(var t=Ve;t<we;t++){var i=Pe[t][e].elements[0];if(i&&i.hideLabel!=true){var a=Pe[t][e].afterLayoutingPosition;var n=Pe[t][e].afterLayoutingSize;var r=getViewById2(me,i.id);i.position.x=a.x+n.width;i.textAnchor="end";i.position.y=getElementYPosition(e,t,i);var o=Qe[t].nodes[Ze[e]];var l=o.usedRuledEntry;var s=Ye[e];if(s.notation===C.ELEMENT||s.notation===C.ELEMENT_HEADER||s.notation===C.ELEMENT_AXIS){var d=Mt["b"].Layout.Common.getNotationColorStructure(l,s.concept,true,o.value>=0,null,null);i.color=d.pattern}else{i.color=E.getDataType("Actual").subtypes.ACT0.settings.p.areaFillingcolor}i.showBackground=s.valueLabelBackground;i.backgroundTransparency=V;ye[i.id]=r}}}function setNotationData(e,t,i,a){var n=Ye[a];var r=null;if(Qe[i]!==null){var o=Qe[i].nodes[Ze[a]];r=o.usedRuledEntry;if(n.notation===C.ELEMENT||n.notation===C.ELEMENT_HEADER||n.notation===C.ELEMENT_AXIS){var l=e.waterfallType===0||e.waterfallType===1||e.waterfallType===2;e.color=Mt["b"].Layout.Common.getNotationColorStructure(r,n.concept,true,e.value>=0,l,false);t.color=E.getDataType("Actual").subtypes.ACT0.settings.p.areaFillingcolor}else{var l=e.waterfallType===0||e.waterfallType===2;if(l){e.color=Mt["b"].Layout.Common.getNotationColorStructure(r,rt["a"].concept.AREA,true,e.value>=0,l,true);t.color=E.getDataType("Actual").subtypes.ACT0.settings.p.areaFillingcolor}else{var s=E.getDataType("Actual").subtypes.ACT0.settings.p;var d=s.otherFill1;var c=s.otherBorder;t.color=d;e.color={pattern:d,background:s.otherFill2,border:c}}}}else{var s=E.getDataType("Actual").subtypes.ACT0.settings.p;var d=s.otherFill1;var c=s.otherBorder;t.color=d;e.color={pattern:d,background:s.otherFill2,border:c}}return r}function setAxis(e,t,i,a){var n=null;for(var r=0;r<ge.length;r++){if(ge[r].getModel().id.split(".")[2]===De[e].exprId){layoutAxis(ge[r],e,t,i,a);n=ge[r].getModel();break}}return n}function setOutlierRepresentations(e,t,i,a,n){var r=Ye[t].outlierStyle==="value-symbol";var o=i.position.x+i.dimension.width;var l=i.position.x;for(var s=0;s<e.length;s++){var d=e[s].rep;var c=e[s].label;d.dimension.width=Ye[t].outlierSymbols?U:0;if(c&&!c.hideLabel){if(r){if(d.value>=0){c.position.x=o+H;d.position.x=a-d.dimension.width}else{c.position.x=l-H-c.dimension.width;d.position.x=n}}else{if(d.value>=0){c.position.x=a-c.dimension.width;d.position.x=o+G}else{c.position.x=n;d.position.x=l-G-d.dimension.width}}}else{if(d.value>=0){if(r){d.position.x=a-d.dimension.width}else{d.position.x=o+G}}else{if(r){d.position.x=n}else{d.position.x=l-G-d.dimension.width}}}if(d.dimension.width>0&&Ye[t].outlierSymbols){ye[d.id]=e[s].repView}d.symbolSize=U}}function layoutGraphicalColumnElements(e){if(De[e].IsHidden){return}var t=Xe[e];var i=Ye[e];var a=null,n=null;var r;var o=Pe[0][e];var l=t.scalingGroup;if(i&&i.scalingMaximize){l+="."+Ce.extensionHash+"."+_e.id}var s=at["a"].resolveQvVars(l);var d=Ce.globalZoom[s];var c=De[e].axisFactor;var u=o.afterLayoutingSize.width-o.border.left-o.border.right;var p=o.afterLayoutingPosition.x+o.border.left+Math.round(u*c);var g=[];var h=[];var f=0,m=2147483647;var v=0,b=0;var T=i.outlierSymbols?U+G:0;var x=null;var E=false;var y=false;var C=false;var S={normal:null,subTotal:null};var M=Be[e].onlyNegatives;switch(i.representation){case R.BAR:x=layoutBarColumnElements;break;case R.NEEDLE:x=layoutNeedleColumnElements;E=true;break;case R.WATERFALL:x=layoutWaterfallColumnElements;y=true;break;case R.LINE:x=layoutLineColumnElements;C=true;se=null;de=null;break;case R.SYMBOL:x=layoutLineColumnElements;E=true;break;case R.SYMBOL_LINE:x=layoutLineColumnElements;E=true;C=true;se=null;de=null;break}for(var O=Ve;O<we;O++){o=Pe[O][e];r=getRepresentationAndLabel(O,e);n=r.rep;a=r.label;if(!n||n.valueType==="FACTOR_NONE"){continue}var A=getViewById(fe,n.id);var _=getViewById2(me,a.id);var L=setNotationData(n,a,O,e);if(E||C){Mt["b"].Layout.Common.setNotationShape(A,L,i.notation,i.concept,C)}g.push({row:O,bar:n,usedRule:L});n.dimension.width=Math.round(Math.abs(n.value)*d);if(n.isOutlier){h.push({rep:n,label:a,repView:A})}else{if(y){n.position.x=p+Math.round((n.relativeValue-n.value)*d);n.dimension.width=Math.abs(p+Math.round(n.relativeValue*d)-n.position.x);if(n.value<0){n.position.x-=n.dimension.width}}else{if(n.value<0){n.position.x=p-n.dimension.width;if(c!==1){n.position.x++}}else{n.position.x=p}}}if(x){x(e,O,n,a,M,E,C,S)}if(a){if(n.value<0||M&&0===n.value){if(!n.isOutlier){m=Math.min(m,a.position.x)}else if(!a.hideLabel){b=Math.max(b,a.dimension.width+T)}}else{if(!n.isOutlier){f=Math.max(f,a.position.x+a.dimension.width)}else if(!a.hideLabel){v=Math.max(v,a.dimension.width+T)}}if(!a.hideLabel){a.position.y=getElementYPosition(e,O,a);a.showBackground=i.valueLabelBackground;a.backgroundTransparency=V;ye[a.id]=_}}n.zIndex=y||C?300:100;if(!n.isOutlier){ye[n.id]=A}}var I=setAxis(e,c,p,g);if(f===0){f=I.position.x+I.dimension.width+(v===0?U+G:v+H)}else{f=Math.max(f,I.position.x+I.dimension.width+v+H)}if(m===2147483647){m=I.position.x-(b===0?U+G:b+H)}else{m=Math.min(m,I.position.x-b-H)}setOutlierRepresentations(h,e,I,f,m)}function getMultiLineElementYPosition(e,t,i){var a=Pe[t][e];var n=a.afterLayoutingPosition.y+a.border.top+Re[t].topDistance;var r=a.afterLayoutingSize.height-Re[t].topDistance-a.border.top-a.border.bottom-i.dimension.height;if("bottom"===Le.rowAlignment){n+=r}else if("mid"===Le.rowAlignment){n+=Math.floor(r/2)}return n}function getElementYPosition(e,t,i){var a=Pe[t][e];var n=Re[t];var r=a.afterLayoutingPosition.y+a.border.top+n.topDistance+n.singleLineOffset;r+=Math.floor((n.singleLineElementsHeight-i.dimension.height)/2);return r}function layoutBarColumnElements(e,t,i,a,n){i.dimension.height=k;i.position.y=getElementYPosition(e,t,i);if(a){if(i.value<0||n&&0===i.value){a.position.x=i.position.x-H-a.dimension.width}else{a.position.x=i.position.x+H+i.dimension.width}}}function layoutNeedleColumnElements(e,t,i,a,n){i.dimension.height=U;i.needleSize=U;i.lineWidth=l;i.position.y=getElementYPosition(e,t,i);if(a){if(i.value<0||n&&0===i.value){a.position.x=i.position.x-H-a.dimension.width-d}else{a.position.x=i.position.x+H+i.dimension.width+d}}}function layoutWaterfallColumnElements(e,t,i,a,n,r,o,l){var s=Pe[t][e];s.afterLayoutingSize.height+=s.border.bottom;s.border.bottom=0;var d=i.value<0||n&&0===i.value;i.dimension.height=k;i.position.y=getElementYPosition(e,t,i);if(a){if(d){a.position.x=i.position.x-H-a.dimension.width}else{a.position.x=i.position.x+H+i.dimension.width+1}}if(l.normal){var c;if(i.waterfallType===0){c=d?i.position.x+i.dimension.width:i.position.x}else{c=d?i.position.x:i.position.x+i.dimension.width}var u=l.normal.value>0||!n&&l.normal.value>=0?l.normal.position.x+l.normal.dimension.width-1:l.normal.position.x;if(c===u){var p=l.normal.position.y;var g=i.position.y+i.dimension.height;i.rowConnectionPos={x1:c,x2:c,y1:p,y2:g}}}if(i.waterfallType===2){if(l.subTotal){var c=d?i.position.x+i.dimension.width:i.position.x;var h=l.subTotal.position.y+l.subTotal.dimension.height;var f=i.position.y;i.rowConnectionPos.x3=c;i.rowConnectionPos.x4=c;i.rowConnectionPos.y3=h;i.rowConnectionPos.y4=f}l.subTotal=i}else if(i.waterfallType===1){l.subTotal=i}l.normal=i;i.dimension.width++}function layoutLineColumnElements(e,t,i,a,n,r,o){var l=r?U:0;var s=Pe[t][e];if(o&&Re[t].type===""){s.afterLayoutingSize.height+=s.border.bottom;s.border.bottom=0}i.dimension.height=l;i.needleSize=l;i.position.y=getElementYPosition(e,t,i);if(i.isOutlier){if(se){se.nextPosition={x:0,y:0};se=null}de={x:0,y:0}}else{if(o){i.lineWidth=A;if(de){i.previousPosition=de}else{i.previousPosition={x:0,y:0}}de={x:i.value<0?i.position.x:i.position.x+i.dimension.width,y:i.position.y+Math.round(i.dimension.height/2)};i.nextPosition={x:0,y:0};if(se){se.nextPosition=de}se=i}}if(a){if(i.value<0||n&&0===i.value){a.position.x=i.position.x-H-a.dimension.width-(l===0?0:d)}else{a.position.x=i.position.x+H+i.dimension.width+(l===0?0:d)}}}function layoutCommentElements(e){var t=Ye[e];var i=Pe[0][e];var a=i.afterLayoutingPosition.x+i.border.left;var n=null;if(t.representation===R.LIST){n=layoutListColumnElements}else if(t.representation===R.COMMENT){n=layoutCommentColumnElements}else if(t.representation===R.FLAG){n=layoutFlagColumnElements}for(var r=Ve;r<we;r++){var o=getOtherRepresentationType(r,e);var l=getViewById2(Te,o.id);if(n){n(e,r,o,a)}o.zIndex=101;ye[o.id]=l}}function getViewById2(e,t){return e[t]||null}function layoutListColumnElements(e,t,i,a){var n=Pe[t][e];i.position.x=a;var r=getElementYPosition(e,t,i);i.position.y=r;i.triangle.position={x:n.afterLayoutingPosition.x+n.afterLayoutingSize.width-1,y:r};i.background={position:{x:a-1,y:n.afterLayoutingPosition.y-1+n.border.top},dimension:n.afterLayoutingSize}}function layoutCommentColumnElements(e,t,i,a){var n=Pe[t][e];i.position.x=a;var r=getMultiLineElementYPosition(e,t,i);i.position.y=r-1;i.background={position:{x:a-1,y:n.afterLayoutingPosition.y-1+n.border.top},dimension:n.afterLayoutingSize}}function layoutFlagColumnElements(e,t,i,a){var n=Pe[t][e];i.position.y=getElementYPosition(e,t,i);i.position.x=Math.round(a+n.afterLayoutingSize.width/2-i.dimension.width/2);i.clickDummy={x:a,y:n.afterLayoutingPosition.y+n.border.top,width:n.afterLayoutingSize.width,height:n.afterLayoutingSize.height};i.lineWidth=1}function calculateAxisAndScalingFactors(e){var t=3;var i=Ye[e];var a=Pe[0][e].afterLayoutingSize.width-Pe[0][e].border.left-Pe[0][e].border.right;var n=getScalingData(e);if(n.maxNegVal===n.maxPosVal&&n.maxPosVal===0){return{axisFactor:.5,scalingFactor:ot["a"].defaultZoomFactor}}if(n.negLabelWidth+n.posLabelWidth>a-t){var r=i.axisMid?.5:n.negLabelWidth/(n.negLabelWidth+n.posLabelWidth);return{axisFactor:r,scalingFactor:0}}var r;if(i.axisMid){r=.5}else{r=calculateAxisFactor(a,n).axisFactor}var o=calculateScalingFactor(e,r,a,n);return{axisFactor:r,scalingFactor:o}}function getScalingData(e){return Be[e]=collectScalingData(e)}function collectScalingData(e){var r=[];var o=[],l=[];var s=[],d=[];var c=0,u=0;var p=0,g=0;var h=false,t=false,i=false;var f=0,m=0;var v=0,b=0;var a=Ye[e];var n=a.representation===R.NEEDLE||a.representation===R.SYMBOL_LINE||a.representation===R.SYMBOL?Math.ceil(U/2):0;var T=a.representation===R.SYMBOL_LINE||a.representation===R.LINE?Math.ceil(A/2):0;var x=Math.max(n,T);for(var E=Ve;E<we;E++){var y=getRepresentationAndLabel(E,e);if(y.rep&&y.label){if(y.rep.isOutlier&&y.label&&y.rep.valueType!=="FACTOR_NONE"){if(y.rep.value>=0){v=Math.max(v,y.label.hideLabel?U+G:y.label.dimension.width+H)}else{b=Math.max(b,y.label.hideLabel?U+G:y.label.dimension.width+H)}}}if(y.rep){t=t||y.rep.value>0;i=i||y.rep.value<0}}if(i&&!t){h=true;b=Math.max(b,v);v=0}function collectDataFromSingleValue(e,t){var i;var a=0;if(e.instanceOf==="StructureWaterfallModel"){a=e.value>=0?1:0;if(e.value<0&&e.relativeValue<0||e.value>=0&&e.relativeValue>=0){i=e.relativeValue}else{s.push(e.relativeValue);var n=t&&!t.hideLabel?t.dimension.width+H:0;d.push(n+a);return}}else{i=e.value}r.push(e.isOutlier);o.push(i);var n=(t&&!t.hideLabel?t.dimension.width+H+x:0)+a;if(i>0||i>=0&&!h){n=Math.max(n,v);m=Math.max(m,n)}else{n=Math.max(n,b);f=Math.max(f,n)}l.push(n);if(i<p){p=i;g=n}else if(i>c){c=i;u=n}else if(i===0){if(p===0&&h){g=Math.max(g,n)}else if(c===0&&!h){u=Math.max(u,n)}}}for(var E=Ve;E<we;E++){var y=getRepresentationAndLabel(E,e);if(y.rep&&y.label){if(y.rep.valueType!=="FACTOR_NONE"){collectDataFromSingleValue(y.rep,y.label)}}}u=u===0?v:u;g=g===0?b:g;return{axisWidth:a.axisNotation?S:M,chartSymbolSize:x,outliers:r,outlierWidth:a.outlierSymbols?U+G:0,values:o,labelWidths:l,invertedValues:s,invertedLabelWidths:d,maxPosVal:c,maxPosLabel:u,maxNegVal:p,maxNegLabel:g,negLabelWidth:f,posLabelWidth:m,onlyNegatives:h}}function calculateAxisFactor(e,t){var i=7;var a,n;var r,o;var l=t.values;var s=t.outliers,d=t.outlierWidth;var c=t.labelWidths;var u=t.invertedValues;var p=t.invertedLabelWidths;var g=t.maxPosLabel;var h=t.maxNegLabel;e-=t.axisWidth/2;var f,m;f=(e-t.maxNegLabel-t.maxPosLabel)/(t.maxPosVal-t.maxNegVal);if(t.maxPosVal===0&&g===0){m=1}else if(t.maxNegVal===0&&h===0){m=0}else{m=(-t.maxNegVal*f+h)/e}for(var v=0;v<i;v++){r=g;o=h;a=Math.round(e*m);n=e-a;for(var b=0;b<l.length;b++){var T=l[b];var x=s[b]?d+c[b]:Math.round(Math.abs(T)*f)+c[b];if(T>0||!t.onlyNegatives&&T>=0){r=Math.max(r,x)}else{o=Math.max(o,x)}}for(var b=0;b<u.length;b++){var x=p[b]-Math.round(Math.abs(u[b])*f);if(u[b]<0){r=Math.max(r,x)}else{o=Math.max(o,x)}}var E=r-n;var y=o-a;var C=Math.round((y-E)/2);var S=E+y;var M=f-S/e*f;m+=C/e;m=Math.min(Math.max(m,0),1);f-=f-M}return{axisFactor:m,scalingFactor:f}}function calculateScalingFactor(e,t,i,r){var a=r.values;var n=r.labelWidths;var o=r.outliers;var l=Ye[e];var s=null;var d=Math.round(i*t);var c=i-d;if(t===0){c-=Math.floor((l.axisNotation?S:M)/2)}else if(t===1){d-=Math.floor((l.axisNotation?S:M)/2)}function calcFactorNormal(e,t){if(0===e){return}var i=e>0||!r.onlyNegatives&&e>=0?c:d;var a=i-t+.49;var n=a/Math.abs(e);if(s===null||n<s){s=n}}for(var u=0;u<a.length;u++){!o[u]&&calcFactorNormal(a[u],n[u])}return s}function layoutExprLabel(e,t,i){if(e.hideLabel){return}var a=Pe[t][i].afterLayoutingPosition;var n=Pe[t][i].afterLayoutingSize;var r,o,l=i,s;do{l--}while(l>=0&&(s=Pe[t][l].elements[0])&&s&&s.aggregatedHide&&s.text===e.text);l++;if(l<i){o=Pe[t][l];r=o.elements[0]}if(r){var d=v;if(t===$e-1){d=r.valueRowLabelPosition;if(d===""){var c=Ye[l];d=!c||c.representation===R.VALUE?"right":"center"}}if(d==="left"){e.position.x=o.afterLayoutingPosition.x}else if(d==="right"){e.position.x=a.x+n.width;e.textAnchor="end"}else if(d==="center"){e.position.x=Math.round((o.afterLayoutingPosition.x+a.x+n.width-e.dimension.width)/2)}}else{var u=e.valueRowLabelPosition;var p=Ye[i];if(p&&(p.representation===R.BAR||p.representation===R.NEEDLE||p.representation===R.WATERFALL||p.representation===R.LINE||p.representation===R.SYMBOL||p.representation===R.SYMBOL_LINE)){switch(u){case h.LEFT:e.position.x=a.x;break;case h.CENTER:default:e.position.x=a.x+Math.round((n.width-e.dimension.width)/2);break;case h.RIGHT:e.position.x=a.x+n.width;e.textAnchor="end";break}}else if(p){switch(u){case h.LEFT:e.position.x=a.x;break;case h.CENTER:e.position.x=a.x+Math.round((n.width-e.dimension.width)/2);break;case h.RIGHT:default:e.position.x=a.x+n.width;e.textAnchor="end";break}}}var g=t===$e-1?O:y;e.position.y=a.y+n.height-ce[t]-e.dimension.height-g;ye[e.id]=getViewById2(me,e.id)}function layoutAnnotators(){for(var e=0;e<De.length;e++){var t=Pe[$e][e],i=t.elements[0];if(!i||De[e].IsHidden){continue}var a=$e>=1?Pe[$e-1][e].elements[0]:null,n=Ye[e],r=n?n.notation:null,o=r===C.HEADER||r===C.ELEMENT_HEADER;var l=e;if(a&&a.aggregatedHide){var s=-1;do{l++;if(!De[l].IsHidden){s=l}}while((((Pe[$e-1][l]||{}).elements||[])[0]||{}).aggregatedHide);var d=void 0;if(o){d=getColumnNotation(e)}var c=true;for(var u=e+1;u<=l;u++){var p=n?n.notation:null,g=p===C.HEADER||p===C.ELEMENT_HEADER;if(o!==g){c=false;break}if(g){var h=getColumnNotation(u);if(d.dataType!==h.dataType||d.concept!==h.concept||d.colors.pattern!==h.colors.pattern||d.colors.border!==h.colors.border||d.colors.background!==h.colors.background||d.otherPattern!==h.otherPattern){c=false;break}}}if(c&&o){i.dimension.height=b;i.notation=r;i.dataType=d.dataType;i.color=d.colors;i.concept=d.concept;i.otherPattern=d.otherPattern}else{i.dimension.height=T;i.color={pattern:"rgb(0,0,0)",background:"rgb(255,255,255)",border:"rgb(0,0,0)"}}if(s>-1){var f=Pe[$e][s];i.dimension.width=f.afterLayoutingPosition.x+f.afterLayoutingSize.width-f.border.right-t.afterLayoutingPosition.x-t.border.left}}else{if(o){var d=getColumnNotation(e);i.dimension.height=b;i.notation=r;i.dataType=d.dataType;i.color=d.colors;i.concept=d.concept;i.otherPattern=d.otherPattern}else{i.dimension.height=T;if(De[e].exprId.substr(0,3)==="dim"){i.color={pattern:x,background:"rgb(255,255,255)",border:x}}else{i.color={pattern:"rgb(0,0,0)",background:"rgb(255,255,255)",border:"rgb(0,0,0)"}}}i.dimension.width=t.afterLayoutingSize.width-t.border.left-t.border.right}i.position.x=t.afterLayoutingPosition.x+t.border.left;i.position.y=t.afterLayoutingPosition.y+t.border.top;ye[i.id]=getViewById(xe,i.id);if(Fe){var m=Pe[Re.length-1][e],v=m.elements[0];v.dimension.height=i.dimension.height;v.dimension.width=i.dimension.width;v.color=i.color;v.notation=i.notation;v.concept=i.concept;v.otherPattern=i.otherPattern;v.position.x=i.position.x;v.position.y=m.afterLayoutingPosition.y+m.border.top;ye[v.id]=getViewById(xe,v.id)}if(a&&a.aggregatedHide){e=l}}}function getColumnNotation(e){var t=Ye[e];var i=null,a=null,n=null,r=null;var o=Ve;for(;o<Re.length;o++){if(Re[o].nodePath!==""&&Qe[o]!==null){break}}if(Qe[o]!=null){var l=Qe[o].nodes[Ze[e]];var s=l.usedRuledEntry;if(t.notation===C.HEADER){i=s.baseDataType;r=t.concept;a=Mt["b"].Layout.Common.getNotationColorStructure(s,t.concept,true,l.value>=0,null,null);n=Mt["b"].Layout.Common.getOtherPattern(s,t.notation,t.concept,true)}else{i=s.referenceDataType;r=t.referenceConcept;a=Mt["b"].Layout.Common.getNotationColorStructure(s,t.referenceConcept,false,l.value>=0,null,null);n=Mt["b"].Layout.Common.getOtherPattern(s,t.notation,t.referenceConcept,false)}}return{dataType:i,concept:r,colors:a,otherPattern:n}}function layoutAxis(e,t,i,a,n){var r=e.getModel();var o=Ye[t];var l=Ve;while(Re[l]==="empty"){l++}var s=we-1;while(Re[s]==="empty"){s--}var d=Pe[l][t];var c=Pe[s][t];var u=o.notation===C.AXIS||o.notation===C.ELEMENT_AXIS;o.axisNotation=u;if(u){r.dimension.width=S;r.concept=o.concept;r.notation=o.notation;r.segments=[];var p=o.notation===C.AXIS;for(var g=0;g<n.length;g++){var h=Pe[n[g].row][t];var f=p?n[g].usedRule.baseDataType:n[g].usedRule.referenceDataType;if(f==null){f=Tt["a"].dataType}var m=n[g].bar;var v=p?m.waterfallType===0||m.waterfallType===1||m.waterfallType===2:m.waterfallType===0||m.waterfallType===2;var b=!p&&o.referenceUsed?o.referenceConcept:o.concept;var T=Mt["b"].Layout.Common.getNotationColorStructure(n[g].usedRule,b,p,n[g].bar.value>=0,v,false);var x=Mt["b"].Layout.Common.getOtherPattern(n[g].usedRule,o.notation,b,p);if(r.segments.length===0){r.segments.push({concept:b,y:h.afterLayoutingPosition.y,pattern:T.pattern,background:T.background,border:T.border,dataType:f,otherPattern:x})}else{var E=r.segments[r.segments.length-1];if(f!==E.dataType||T.pattern!==E.pattern||T.border!==E.border||T.background!==E.background){r.segments.push({concept:b,y:h.afterLayoutingPosition.y-Math.round((Re[n[g].row].spacing_top+Re[n[g].row-1].spacing_bottom)/2),pattern:T.pattern,background:T.background,border:T.border,dataType:f,otherPattern:x})}}}}else{r.dimension.width=M}var y=r.dimension.width/2;r.dimension.height=c.afterLayoutingPosition.y+c.afterLayoutingSize.height-d.afterLayoutingPosition.y;r.position.y=d.afterLayoutingPosition.y;if(i===0){r.position.x=d.afterLayoutingPosition.x+d.border.left}else if(i===1){r.position.x=d.afterLayoutingPosition.x+d.afterLayoutingSize.width-d.border.right-r.dimension.width}else{r.position.x=Math.round(a-y)}ye[r.id]=e}function getLayoutScalingHelpersHeight(){for(var e=0;e<ve.length;e++){var t=ve[e].getModel();if(t.legendShow!=="-"){var i=void 0,a=t.id.replace("scalingHelper","scalingHelperLabel");for(var n=0;n<be.length;n++){if(be[n].getId().indexOf(a)>=0){i=be[n];break}}var r=i.getModel();r.dimension=Me.measureTextDim(r.text,"normal "+w+"px '"+F+"'");return r.dimension.height}}return 0}function layoutScalingHelpers(){var e=convertNMParameter("MMPT_SCALING_HELPER_LINE_SIZE");var t=_e.border,i=_e.padding;for(var a=0;a<ve.length;a++){var n=ve[a].getModel();var r=0,o;for(;r<De.length;r++){if(Ye[r]&&n.expressionId===Ye[r].id){o=Ye[r];break}}if(!o){continue}var l=Xe[r];var s=null;for(var d=0;d<ge.length;d++){if(ge[d].getModel().id.split(".")[2]===De[r].exprId){s=ge[d].getModel();break}}var c=l.scalingGroup;if(o.scalingMaximize){c+="."+Ce.extensionHash+"."+_e.id}var u=at["a"].resolveQvVars(c);var p=Math.round(n.value*Ce.globalZoom[u]);if(!isFinite(p)){p=0}n.dimension={width:p,height:s.dimension.height};n.position={x:s.position.x,y:Ge.y+t.top.width+i.top+je};n.lineWidth=e;n.lineColor=E.getParameter("COLOR_SCALING_HELPER_"+n.number+"_LINE");n.areaColor=E.getParameter("COLOR_SCALING_HELPER_"+n.number+"_AREA");n.orientation="vertical";ye[n.id]=ve[a];if(n.legendShow!=="-"){var g,h=n.id.replace("scalingHelper","scalingHelperLabel");for(var d=0;d<be.length;d++){if(be[d].getId().indexOf(h)>=0){g=be[d];break}}var f=g.getModel();f.dimension=Me.measureTextDim(f.text,"normal "+w+"px '"+F+"'");var m=Math.round(f.dimension.width/2);var v=Pe[0][r].afterLayoutingPosition.x;var b=v+Pe[0][r].afterLayoutingSize.width;var T=n.position.y+n.dimension.height+mm2pix(.06);var x=n.position.x+p;f.textAnchor="middle";if(x-m<v){x=v;delete f.textAnchor}if(x+m>b){x=b;f.textAnchor="end"}g.setPosition({x:x,y:T});f.color=n.lineColor;ye[g.getId()]=g}}}function getBordersAndLabelDataForDim(e){var t={fontWeight:B,borders:{top:0,bottom:0,left:0,right:0},borderColor:$};var i=Qe[e];switch(Re[e].type){case"":t.borders.bottom=L;t.borderColor=$;if(Re[e+1]&&(Re[e+1].type==="total"||Re[e+1].type==="subtotal")){t.borders.bottom=0}break;case"total":t.fontWeight=Q;var a=i.lvl!=undefined?i.lvl:i.lineLvl;if(Se.rows[a-1].additionsTotalOrder==="dimAdditionOrderType.0"){if(e<we-1){t.borders.bottom=q}}else{if(e!==Ve){t.borders.top=q}}t.borderColor=J;break;case"subtotal":t.fontWeight=j;var a=i.lvl!=undefined?i.lvl:i.lineLvl;if(Se.rows[a-1].additionsTotalOrder==="dimAdditionOrderType.0"){if(e<we-1){t.borders.bottom=K}}else{if(e!==Ve){t.borders.top=K}}t.borderColor=X;break;case"totalsWithoutValues":t.fontWeight=ie;if(Le.dimensionLabelModel.categoryEntriesPosition=="summingPosType.1"){t.borders.bottom=ae}else{t.borders.top=ae}t.borderColor=ne;break;case"empty":break}if(Fe&&e===we-1){t.borders.bottom=0}return t}function getColumnSpacing(e,t){if(e===De.length-1||t===De.length||De[e].IsHidden){return 0}else if(isAggregationBoundary(e)){return g}else if(t===undefined){return getColumnSpacing(e,e+1)}else if(De[t].IsHidden){return getColumnSpacing(e,t+1)}else{var i=getColumnType(e),a=getColumnType(t);return i.dimension&&!a.dimension||!i.dimension&&a.dimension||i.delta&&!a.delta||!i.delta&&a.delta||i.total?g:s}}function getSumOfColumnSpacing(){var e=0;for(var t=0,i=De.length;t<i;t++){e+=getColumnSpacing(t)}return e}function isAggregationBoundary(e){for(var t=$e-1;t>=0;t--){var i=Pe[t][e],a=i.elements[0];if(a&&a.aggregatedHide){continue}var n=Pe[t][e-1];if(n){var r=n.elements[0];if(r&&r.aggregatedHide){return true}}var o=Pe[t][e+1],l=o.elements[0];if(l&&l.aggregatedHide){return true}}return false}function getColumnType(e){var t=De[e];if(t.exprId.substr(0,3)==="dim"){return{dimension:true,delta:false,total:false}}var i={dimension:false,delta:true,total:true};var a=true;var n=true;for(var r=Ve;r<we;r++){var o=Qe[r];if(o){var l=o.nodes[Ze[e]].usedRuledEntry;if(a){i.delta=l.isDelta;a=false}n=n&&l.interpretation!==D.NORMAL;if(!n){break}}}i.total=n;return i}function getRowType(e){if(e<0||e>=Re.length){return""}else if(e>=0&&e<$e){return"header"}else if(e===$e){return"annotator"}if(Fe&&e===Re.length-1){return"annotator"}if(Re[e].type==="empty"){return Re[e].type}var t=0;for(;t<De.length;t++){if(De[t].exprId!==""&&De[t].exprId.substr(0,3)!=="dim"){break}}var i=Qe[e];if(t<De.length){if(i===null){var a=0;for(;a<De.length;a++){if(De[a].exprId.substr(0,3)==="dim"){break}}var n=Pe[e][a].elements[0];if(n.catWithoutTotal==true){return"totalsWithoutValues"}return""}var r=i.nodes[Ze[t]].usedRuledEntry.interpretation;if(r===D.TOTAL){return"total"}else if(r===D.SUBTOTAL){return"subtotal"}}if(i!==null){if(i.isSum===true){return"total"}}else{var a=0;for(;a<De.length;a++){if(De[a].exprId.substr(0,3)==="dim"){break}}var o=Pe[e][a].elements[0];if(o.catWithoutTotal==true){return"totalsWithoutValues"}return""}return""}function getViewById(e,t){for(var i=0;i<e.length;i++){if(e[i].getId()===t){return e[i]}}return null}function getRepresentationAndLabel(e,t,i){var a=Pe[e][t];var n=null;var r=null;for(var o=0;o<a.elements.length;o++){var l=a.elements[o].instanceOf;if(l==="LabelModel"){r=a.elements[o]}else if(i&&l===i){n=a.elements[o]}else if(l==="BarModel"||l==="NeedleModel"||l==="StructureLineModel"||l==="StructureWaterfallModel"){n=a.elements[o]}}return{rep:n,label:r}}function getOtherRepresentationType(e,t){var i=Pe[e][t];var a=null;for(var n=0,r=i.elements.length;n<r;n++){if(i.elements[n].instanceOf==="InlineModel"){a=i.elements[n];break}}return a}function getRepresentation(e,t,i){var a=Pe[e][t];var n=null;for(var r=0;r<a.elements.length;r++){var o=a.elements[r].instanceOf;if(i&&o===i){n=a.elements[r]}else if(o==="BarModel"||o==="NeedleModel"||o==="StructureLineModel"||o==="StructureWaterfallModel"){n=a.elements[r]}}return n}function getLabel(e,t){var i=Pe[e][t].elements;var a=null;for(var n=0;n<i.length;n++){if(i[n].instanceOf==="LabelModel"){a=i[n];break}}return a}function setDataForScrolling(){var e=Pe[Re.length-1][De.length-1];var t=e.afterLayoutingPosition.x+e.afterLayoutingSize.width;var i=e.afterLayoutingPosition.y+e.afterLayoutingSize.height;var a=Fe?Pe[we][0].afterLayoutingSize.height:0;var n=_e.border,r=_e.padding;for(var o=0;o<he.length;o++){var l=he[o].getModel();if(l.hide||l.active===false){continue}var s=Mt["b"].Layout.Common.getMaxPosition(l);i=Math.max(i,s.position.y+s.dimension.height)}var d=2;var c=i-(Fe?je+a:0);var u=He.height-je-a;var p=c-u>d;_e.scrollingData={id:_e.id,width:ke.width,height:ke.height,realWidth:ke.width,realHeight:ke.height,headerHeight:je,scrollingVer:false,scrollingHor:false,x:Ue.x,y:Ue.y,children:{}};_e.scrollingData.children[We]={id:We,width:He.width,height:He.height,realWidth:t,realHeight:He.height,scrollingVer:false,scrollingHor:!_e.disableScrolling&&t-He.width>d,scrollingHorRef:[ze],x:Ge.x+n.left.width+r.left,y:Ge.y+n.top.width+r.top,zIndex:0};_e.scrollingData.children[ze]={id:ze,width:He.width,height:u,realWidth:t,realHeight:c,scrollingVer:!_e.disableScrolling&&p,scrollingHor:false,scrolling:!_e.disableScrolling&&(p||t-He.width>d),overflowHiddenHor:t>He.width,forwardEvents:We,x:Ge.x+n.left.width+r.left,y:Ge.y+n.top.width+r.top+je,zIndex:1};if(Fe&&p){var g=c-u;var h=Pe[we];for(var f=0;f<h.length;f++){var m=h[f];m.afterLayoutingPosition.y-=g;for(var v=0;v<m.elements.length;v++){var b=m.elements[v];if(b){b.position.y-=g}}}}}this.getPreferredLayoutSize=function(e,t,i){if(!E.isPrePaint()||(Le.expressions&&Le.expressions.length===0||Le.columns<1)){return{width:0,height:0}}if(et){return et}initGlobalVariables(i);calculateMinSizes(i);var a=Je.reduce(function(e,t,i){return e+t.value+De[i].spacing_left+De[i].spacing_right},0)||0;var n=y+getLayoutScalingHelpersHeight()+Re.reduce(function(e,t){return e+t.height+t.spacing_top+t.spacing_bottom},0)||0;et={width:a,height:n};return et};function initGlobalVariables(e){Me=e.getPainter();Le=e.getModel().extendedModel;Se=it["a"].getContextByCid(Le.contextId);Se&&(Ke=Mt["b"].Models.Actions.DataModelActions.getMultipleDimensions(Se.dataModel,0));De=Le.columnDefinitions;Re=Le.rowDefinitions;Pe=Le.tableCellData;Ve=Le.headerRows;$e=Le.headerRows-1;Fe=Le.dimensionLabelModel.repeatNotation==="on"||Le.dimensionLabelModel.repeatNotation==="notation"&&E.getParameter("CHECK_TABLE_REPEAT_NOTATION")==="true";we=Fe?Re.length-1:Re.length;Xe=[];Ze=[];Ye=[];Qe=[];Se&&fillIndexArrays()}function calculateMinSizes(e){setupHeaderRows();setupOtherRows();var t=e.getModel().extendedModel.columnDefinitions,i={WIDTH:"mid",MIN:"min",MAX:"max"},n=[];for(var a=0;a<t.length;a++){var r=t[a];if(r.IsHidden){Je[a]={value:0};continue}var o=r.defWidth===-1||r.defWidthType==="w"||r.defWidthType==="%",l=r.columnFix===false||o;if(l){Je[a]={value:calculateColumnAutoWidths(a)};if(r.defWidthType==="%"&&r.defWidth>0){(r.columnFix||Le.columnMode!=="autoGrid")&&appendColDefToPercentWidthCalculation(a,r,i.WIDTH)}else if(!o&&r.columnFix){var s=r.defWidthType==="px"?r.defWidth:lt["a"].mm2pix(r.defWidth);Je[a]={value:Math.max(Je[a].value,s)}}if(r.columnFix===false){if(r.defMinWidthType==="%"&&r.defMinWidth>0){appendColDefToPercentWidthCalculation(a,r,i.MIN)}else if(r.defMinWidth>0){var d=r.defMinWidthType==="px"?r.defMinWidth:lt["a"].mm2pix(r.defMinWidth);Je[a]={value:Math.max(d,Je[a].value),minWidth:d}}if(r.defMaxWidthType==="%"&&r.defMaxWidth>0){appendColDefToPercentWidthCalculation(a,r,i.MAX)}else if(r.defMaxWidth>0){var c=r.defMaxWidthType==="px"?r.defMaxWidth:lt["a"].mm2pix(r.defMaxWidth);Je[a]={value:Math.min(c,Je[a].value),maxWidth:c}}}}else{Je[a]={value:r.defWidthType==="px"?r.defWidth:lt["a"].mm2pix(r.defWidth)}}}var u=0;n.forEach(function(e){var t=e.colDef;if(t.defWidthType==="%"&&t.defMinWidthType==="%"){u+=Math.max(t.defWidth,t.defMinWidth)}else if(t.defWidthType==="%"){u+=t.defWidth}else if(t.defMinWidthType==="%"){u+=t.defMinWidth}});if(u<100){var p=0,g=void 0;do{g=false;for(var a=0,h=n.length;a<h;a++){var f=n[a];if(!f){continue}var r=f.colDef,m=Je[a],v=sumExceptCol(a);for(var b=0,T=f.position.length;b<T;b++){var x=f.position[b];if(x===i.MIN){var d=Math.ceil(r.defMinWidth*v/(100-r.defMinWidth));d=Math.min(d,m.maxWidth||d);g=g||m.minWidth===d||!m.minWidth;m.minWidth=d}else if(x===i.MAX){var c=Math.ceil(r.defMaxWidth*v/(100-r.defMaxWidth));g=g||m.maxWidth===c||!m.minWidth;m.maxWidth=c}else{var s=Math.ceil(r.defWidth*v/(100-r.defWidth));s=Math.min(s,m.maxWidth||s);s=Math.max(s,m.minWidth||s);g=g||m.value!==s;m.value=s}}}p++}while(g&&p<10);Je.forEach(function(e){var t=e.value;e.minWidth&&(t=Math.max(e.minWidth,t));e.maxWidth&&(t=Math.min(e.maxWidth,t));e.value=t})}recalculateRowHeights();function sumExceptCol(n){return Je.reduce(function(e,t,i){if(i===n){return e}var a=t.value;t.minWidth&&(a=Math.max(t.minWidth,a));t.maxWidth&&(a=Math.min(t.maxWidth,a));return e+a},0)}function appendColDefToPercentWidthCalculation(e,t,i){var a=n[e];if(typeof a==="undefined"){a=n[e]={}}a.colDef=t;if(i){a.position!==undefined?a.position.push(i):a.position=[i]}}}};var O=i(629);Mt["b"].Layout=Mt["b"].Layout||{};Mt["b"].Layout.Time=Mt["b"].Layout.Time||{};Mt["b"].Layout.Time.CompareLayoutHelpers={layoutCompares:function(e,t,i,N,a,n,r,o){var w=Mt["b"].DataObjects.RuntimeDO;var l=Mt["b"].Utils.Calculator.Converter;var s=convertNMParameterForMultiple("MMPT_HIGHLIGHT_ELLIPSE_STROKE_WIDTH");var d=convertNMParameterForMultiple("MMPT_HIGHLIGHT_ARROW_SIZE");var c=convertNMParameterForMultiple("MMPT_HIGHLIGHT_PIN_SIZE");var u=Mt["b"].Utils.Constants.TypeValues.indicator;var p=N.getModel().position.y-.5;var F=Mt["b"].Utils.Constants.TypeValues.indicator;for(var g=0;g<e.length;g++){var h=e[g];var m=h.getModel();if(m.active===false){continue}var B=a.extendedModel;var f=m.compareFrom;var v=m.compareTo;if(f&&v){if(f!==F.AXIS||v!==F.AXIS){m.hide=false}var b={absDim:m.absolute.dimension,percDim:m.percent.dimension,textDim:m.text.dimension,maxWidth:m.maxTextWidth,maxHeight:m.ellipseHeight};if(m.offset.x==-1){m.offset.x=0}var T=p;var x=calculateCompareLayout(f,v,m,T,b);var E=calculateCompareTextLayout(x,b.absDim,b.percDim,b.textDim,b.maxWidth);m.fromPosition=x.fromPosition;m.toPosition=x.toPosition;h.setPosition(x.position);h.setDimension(x.dimension);m.preferredDimension=x.dimension;m.preferredPosition=x.position;m.absolute.position=E.absolute;m.percent.position=E.percent;m.text.position=E.text;m.ellipseArray=E.ellipse;m.ellipseStrokeWidth=s;m.arrowType=x.arrowType;var y=m.compareStyle;if(y===u.NOTATION){y=w.getParameter("COMPARE_DEFAULT_TYPE")}if(y===u.ARROW){m.headBaseSize=d;m.headWidth=w.getParameterParsed("FACTOR_HIGHLIGHT_ARROW_HEAD")*d;m.headLength=d}else{m.headBaseSize=c;m.headWidth=w.getParameterParsed("FACTOR_HIGHLIGHT_ARROW_HEAD")*c;m.headLength=c}revertLegend();i[h.getId()]=h}m.compareFrom=null;m.compareTo=null}function convertNMParameterForMultiple(e){e=w.getParameterParsed(e);return o&&e!==0?Math.max(1,l.mm2pix(r*e)):l.mm2pix(r*e)}function revertLegend(){if(m.absolute.originalLegend&&m.absolute.originalLegend===F.AUTO){m.absolute.legend=m.absolute.originalLegend;delete m.absolute.originalLegend}if(m.percent.originalLegend&&m.percent.originalLegend===F.AUTO){m.percent.legend=m.percent.originalLegend;delete m.percent.originalLegend}if(m.text.originalLegend&&m.text.originalLegend===F.AUTO){m.text.legend=m.text.originalLegend;delete m.text.originalLegend}}function calculateCompareTextLayout(e,t,i,a,n){var r={x:0,y:0};var o={x:0,y:0};var l={x:0,y:0};var s;var d=e.position.x+e.dimension.width/2;var c=e.position.y+e.dimension.height/2;var u=m.dimension.width;var p=m.compareConnectorSize;if(u<p){u=p}var g=0;var h=0;var f=0;if(m.percent.legend!==F.NONE){if(m.percent.legend===F.START){g+=1}else if(m.percent.legend===F.MID){f+=1}else if(m.percent.legend===F.END){h+=1}}if(m.text.legend!==F.NONE&&m.text.text!==""){if(m.text.legend===F.START){g+=1}else if(m.text.legend===F.MID){f+=1}else if(m.text.legend===F.END){h+=1}}if(m.absolute.legend!==F.NONE){if(m.absolute.legend===F.START){g+=1}else if(m.absolute.legend===F.MID){f+=1}else if(m.absolute.legend===F.END){h+=1}}if(m.percent.legend!==F.NONE){o.x=setPosition(d,u,m.percent.dimension,m.percent.legend);o.y=setPositionY(c,m.percent.dimension,f+g+h,F.PERCENT,e)}if(m.absolute.legend!==F.NONE){r.x=setPosition(d,u,m.absolute.dimension,m.absolute.legend);r.y=setPositionY(c,m.absolute.dimension,f+g+h,F.ABSOLUTE,e)}if(m.text.legend!==F.NONE&&m.text.text!==""){l.x=setPosition(d,u,m.text.dimension,m.text.legend);l.y=setPositionY(c,m.text.dimension,f+g+h,F.TEXT,e)}if(m.ellipse){s=setEllipse(g,f,h,m,u,d,c,o,l,r)}return{text:l,absolute:r,percent:o,ellipse:s}}function setPositionY(e,t,i,a,n){var r=0;e=e-t.height/4;var o;if(a===F.TEXT){o=m.text}else if(a===F.ABSOLUTE){o=m.absolute}else if(a===F.PERCENT){o=m.percent}var l=t.height;if(m.ellipse){l=m.font.fSize*parseFloat(w.getParameter("FACTOR_HIGHLIGHT_ELLIPSE_HEIGHT"))}if(n.dimension.height<l&&i===1&&o.legend!==F.AUTO){if(m.positive){r=e+t.height/4-n.dimension.height/2-t.height+t.height/4-1}else{r=e+t.height/4+n.dimension.height/2+1}}else{if(i===3){if(a===F.TEXT){r=e-t.height/2-t.height+t.height/4}else if(a===F.ABSOLUTE){r=e-t.height/2+t.height/4}else if(a===F.PERCENT){r=e+t.height/2+t.height/4}}else if(i===2){if(a===F.TEXT){r=e-t.height/2}else if(a===F.ABSOLUTE){if(m.text.legend!==F.NONE&&m.text.text!==""){r=e+t.height/2}else{r=e-t.height/2}}else if(a===F.PERCENT){r=e+t.height/2}}else if(i===1){if(a===F.TEXT){r=e}else if(a===F.ABSOLUTE){r=e}else if(a===F.PERCENT){r=e}}}return r}function setEllipse(e,t,i,a,n,r,o,l,s,d){var c=parseFloat(w.getParameter("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH"));var u=[];var p=a.topMaxHeight*2;var g=a.midMaxHeight*2;var h=a.bottomMaxHeight*2;if(e===1){var f={x:0,y:0,width:0,height:0};if(a.absolute.legend===F.START){f.x=d.x+a.absolute.dimension.width/2;f.y=d.y+a.absolute.dimension.height/2;f.width=a.absolute.dimension.width*c*2;f.height=a.absolute.dimension.height}else if(a.percent.legend===F.START){f.x=l.x+a.percent.dimension.width/2;f.y=l.y+a.percent.dimension.height/2;f.width=c*a.percent.dimension.width*2;f.height=a.percent.dimension.height}else{f.x=s.x+a.text.dimension.width/2;f.y=s.y+a.text.dimension.height/2;f.width=a.text.dimension.width*c*2;f.height=a.text.dimension.height}f.x=Math.round(f.x);f.y=Math.round(f.y);f.width=Math.round(f.width);f.height=Math.round(f.height);u.push(f)}else if(e===2){if(a.text.legend===F.START&&a.text.text!==""){if(a.absolute.legend===F.START){var f={x:0,y:0,width:0,height:0};f.x=d.x+a.absolute.dimension.width/2;f.y=d.y;f.height=a.text.dimension.height+a.absolute.dimension.height;f.width=p;f.x=Math.round(f.x);f.y=Math.round(f.y);f.width=Math.round(f.width);f.height=Math.round(f.height);u.push(f)}else{if(t===0&&i===0){var f={x:0,y:0,width:0,height:0};f.x=l.x+a.percent.dimension.width/2;f.y=l.y;f.width=Math.max(a.percent.dimension.width*c*2,a.text.dimension.width*c*2);f.height=a.percent.dimension.height+a.text.dimension.height;f.x=Math.round(f.x);f.y=Math.round(f.y);f.width=Math.round(f.width);f.height=Math.round(f.height);u.push(f)}else{var f={x:0,y:0,width:0,height:0};f.x=s.x+a.text.dimension.width/2;f.y=s.y+a.text.dimension.height/2;f.height=a.text.dimension.height;f.width=a.text.dimension.width*c*2;f.x=Math.round(f.x);f.y=Math.round(f.y);f.width=Math.round(f.width);f.height=Math.round(f.height);u.push(f);var f={x:0,y:0,width:0,height:0};f.x=l.x+a.percent.dimension.width/2;f.y=l.y+a.percent.dimension.height/2;f.height=a.percent.dimension.height;f.width=a.percent.dimension.width*c*2;f.x=Math.round(f.x);f.y=Math.round(f.y);f.width=Math.round(f.width);f.height=Math.round(f.height);u.push(f)}}}else if(a.absolute.legend===F.START){var f={x:0,y:0,width:0,height:0};f.x=l.x+a.percent.dimension.width/2;f.y=l.y;f.height=a.percent.dimension.height+a.absolute.dimension.height;f.width=p;f.x=Math.round(f.x);f.y=Math.round(f.y);f.width=Math.round(f.width);f.height=Math.round(f.height);u.push(f)}}else if(e===3){var f={x:0,y:0,width:0,height:0};f.x=r-p/2;f.y=o;f.width=p;f.height=a.absolute.dimension.height+a.percent.dimension.height+a.text.dimension.height;f.x=Math.round(f.x);f.y=Math.round(f.y);f.width=Math.round(f.width);f.height=Math.round(f.height);u.push(f)}if(t===1){var f={x:0,y:0,width:0,height:0};if(a.absolute.legend===F.MID){f.x=d.x+a.absolute.dimension.width/2;f.y=d.y+a.absolute.dimension.height/2;f.width=a.absolute.dimension.width*c*2;f.height=a.absolute.dimension.height}else if(a.percent.legend===F.MID){f.x=l.x+a.percent.dimension.width/2;f.y=l.y+a.percent.dimension.height/2;f.width=a.percent.dimension.width*c*2;f.height=a.percent.dimension.height}else{f.x=s.x+a.text.dimension.width/2;f.y=s.y+a.text.dimension.height/2;f.width=a.text.dimension.width*c*2;f.height=a.text.dimension.height}f.x=Math.round(f.x);f.y=Math.round(f.y);f.width=Math.round(f.width);f.height=Math.round(f.height);u.push(f)}else if(t===2){if(a.text.legend===F.MID&&a.text.text!==""){if(a.absolute.legend===F.MID){var f={x:0,y:0,width:0,height:0};f.x=d.x+a.absolute.dimension.width/2;f.y=d.y;f.height=a.absolute.dimension.height+a.text.dimension.height;f.width=g;f.x=Math.round(f.x);f.y=Math.round(f.y);f.width=Math.round(f.width);f.height=Math.round(f.height);u.push(f)}else{if(i===0&&e===0){var f={x:0,y:0,width:0,height:0};f.x=s.x+a.text.dimension.width/2;f.y=l.y;f.height=a.text.dimension.height+a.percent.dimension.height;f.width=Math.max(a.text.dimension.width*c*2,a.percent.dimension.width*c*2);f.x=Math.round(f.x);f.y=Math.round(f.y);f.width=Math.round(f.width);f.height=Math.round(f.height);u.push(f)}else{var f={x:0,y:0,width:0,height:0};f.x=s.x+a.text.dimension.width/2;f.y=s.y+a.text.dimension.height/2;f.width=a.text.dimension.width*c*2;f.height=a.text.dimension.height;f.x=Math.round(f.x);f.y=Math.round(f.y);f.width=Math.round(f.width);f.height=Math.round(f.height);u.push(f);var f={x:0,y:0,width:0,height:0};f.x=l.x+a.percent.dimension.width/2;f.y=l.y+a.percent.dimension.height/2;f.width=a.percent.dimension.width*c*2;f.height=a.percent.dimension.height;f.x=Math.round(f.x);f.y=Math.round(f.y);f.width=Math.round(f.width);f.height=Math.round(f.height);u.push(f)}}}else if(a.absolute.legend===F.MID){var f={x:0,y:0,width:0,height:0};f.x=l.x+a.percent.dimension.width/2;f.y=l.y;f.width=g;f.height=a.absolute.dimension.height+a.percent.dimension.height;f.x=Math.round(f.x);f.y=Math.round(f.y);f.width=Math.round(f.width);f.height=Math.round(f.height);u.push(f)}}else if(t===3){var f={x:0,y:0,width:0,height:0};f.x=r+n/2-1;f.y=o;f.width=g;f.height=a.absolute.dimension.height+a.percent.dimension.height+a.text.dimension.height;f.x=Math.round(f.x);f.y=Math.round(f.y);f.width=Math.round(f.width);f.height=Math.round(f.height);u.push(f)}if(i===1){var f={x:0,y:0,width:0,height:0};if(a.absolute.legend===F.END){f.x=d.x+a.absolute.dimension.width/2;f.y=d.y+a.absolute.dimension.height/2;f.width=a.absolute.dimension.width*c*2;f.height=a.absolute.dimension.height}else if(a.percent.legend===F.END){f.x=l.x+a.percent.dimension.width/2;f.y=l.y+a.percent.dimension.height/2;f.width=a.percent.dimension.width*c*2;f.height=a.percent.dimension.height}else{f.x=s.x+a.text.dimension.width/2;f.y=s.y+a.text.dimension.height/2;f.width=a.text.dimension.width*c*2;f.height=a.text.dimension.height}f.x=Math.round(f.x);f.y=Math.round(f.y);f.width=Math.round(f.width);f.height=Math.round(f.height);u.push(f)}else if(i===2){if(a.text.legend===F.END&&a.text.text!==""){if(a.absolute.legend===F.END){var f={x:0,y:0,width:0,height:0};f.x=d.x+a.absolute.dimension.width/2;f.y=d.y;f.width=h;f.height=a.absolute.dimension.height+a.text.dimension.height;f.x=Math.round(f.x);f.y=Math.round(f.y);f.width=Math.round(f.width);f.height=Math.round(f.height);u.push(f)}else{if(e===0&&t===0){var f={x:0,y:0,width:0,height:0};f.x=l.x+a.percent.dimension.width/2;f.y=l.y;f.width=Math.max(a.percent.dimension.width*c*2,a.text.dimension.width*c*2);f.height=a.percent.dimension.height+a.text.dimension.height;f.x=Math.round(f.x);f.y=Math.round(f.y);f.width=Math.round(f.width);f.height=Math.round(f.height);u.push(f)}else{var f={x:0,y:0,width:0,height:0};f.x=s.x+a.text.dimension.width/2;f.y=s.y+a.text.dimension.height/2;f.width=a.text.dimension.width*c*2;f.height=a.text.dimension.height;f.x=Math.round(f.x);f.y=Math.round(f.y);f.width=Math.round(f.width);f.height=Math.round(f.height);u.push(f);var f={x:0,y:0,width:0,height:0};f.x=l.x+a.percent.dimension.width/2;f.y=l.y+a.percent.dimension.height/2;f.width=a.percent.dimension.width*c*2;f.height=a.percent.dimension.height;f.x=Math.round(f.x);f.y=Math.round(f.y);f.width=Math.round(f.width);f.height=Math.round(f.height);u.push(f)}}}else if(a.absolute.legend===F.END){var f={x:0,y:0,width:0,height:0};f.x=l.x+a.percent.dimension.width/2;f.y=l.y;f.width=h;f.height=a.absolute.dimension.height+a.percent.dimension.height;f.x=Math.round(f.x);f.y=Math.round(f.y);f.width=Math.round(f.width);f.height=Math.round(f.height);u.push(f)}}else if(i===3){var f={x:0,y:0,width:0,height:0};f.x=r+n+h/2;f.y=o;f.width=h;f.height=a.absolute.dimension.height+a.percent.dimension.height+a.text.dimension.height;f.x=Math.round(f.x);f.y=Math.round(f.y);f.width=Math.round(f.width);f.height=Math.round(f.height);u.push(f)}return u}function calculateCompareLayout(e,t,i,a,n){var r="";var o="";var l=Mt["b"].Utils.Constants.TypeValues.timeRepresentation;var s;var d=i.dimension.width;if(e!==F.AXIS){var c=Mt["b"].Models.Actions.ExtendedModelActions.AnyChartModel.getExpressionByShortId(B,e.dataId_expr);r=c.representation}if(t!==F.AXIS){var c=Mt["b"].Models.Actions.ExtendedModelActions.AnyChartModel.getExpressionByShortId(B,t.dataId_expr);r=c.representation}var u=0;var p=0;var g=0;var h=0;if(e!==F.AXIS){if(e.instanceOf==="TimeLineModel"){u=e.dimension.height/2;g=e.dimension.height/2}else if(e.instanceOf==="RodModel"){u=e.needledim.height/2;g=e.needledim.height/2}}if(t!==F.AXIS){if(t.instanceOf==="TimeLineModel"){p=t.dimension.height/2;h=t.dimension.height/2}else if(t.instanceOf==="RodModel"){p=t.needledim.height/2;h=t.needledim.height/2}}var f;var m;if(e===F.AXIS||i.compareFromCat===F.AXIS){f=a}else if(e.value>=0){if(i.compareFromStart===F.START){if(e.instanceOf!=="NeedleModel"&&e.instanceOf!=="TimeLineModel"&&e.instanceOf!=="RodModel"){f=Math.round(e.position.y+g+e.dimension.height)}else{f=a}}else{f=Math.round(e.position.y+g)}}else{if(i.compareFromStart===F.START){if(e.instanceOf!=="NeedleModel"&&e.instanceOf!=="TimeLineModel"&&e.instanceOf!=="RodModel"){f=Math.round(e.position.y)}else{f=a}}else{f=Math.round(e.position.y+e.dimension.height-g)}}if(t===F.AXIS||i.compareToCat===F.AXIS){m=a}else if(t.value>=0){if(i.compareToStart===F.START){if(t.instanceOf!=="NeedleModel"&&t.instanceOf!=="TimeLineModel"&&t.instanceOf!=="RodModel"){m=Math.round(t.position.y+h+t.dimension.height)}else{m=a}}else{m=Math.round(t.position.y+h)}}else{if(i.compareToStart===F.START){if(t.instanceOf!=="NeedleModel"&&t.instanceOf!=="TimeLineModel"&&t.instanceOf!=="RodModel"){m=Math.round(t.position.y)}else{m=a}}else{m=Math.round(t.position.y+t.dimension.height-h)}}var v={x:0,y:0};var b={x:0,y:0};v.y=f;b.y=m;var T=i.offset.x;if(i.compareLegend===F.START){i.offset.x=-1}else if(i.compareLegend===F.END){i.offset.x=1}else if(i.compareLegend==="chart"){if(i.offset.x<0){i.offset.x=-1}else{i.offset.x=1}}if(e!==F.AXIS){if(r===l.LINE){if(i.offset.x>=0){v.x=Math.round(e.position.x-e.dimension.width/2)}else{v.x=Math.round(e.position.x+e.dimension.width/2)}}else if(r===l.NEEDLE||r===l.SYMBOL||r===l.SYMBOL_LINE){if(i.offset.x>=0){v.x=Math.round(e.position.x+e.dimension.width/2+u)}else{v.x=Math.round(e.position.x+e.dimension.width/2-u)}}else{v.x=Math.round(e.position.x+e.dimension.width/2)}}if(t!==F.AXIS){if(o===l.LINE){if(i.offset.x>=0){b.x=Math.round(t.position.x-t.dimension.width/2)}else{b.x=Math.round(t.position.x+t.dimension.width/2)}}else if(o===l.NEEDLE||o===l.SYMBOL||o===l.SYMBOL_LINE){if(i.offset.x>=0){b.x=Math.round(t.position.x+t.dimension.width/2+p)}else{b.x=Math.round(t.position.x+t.dimension.width/2-p)}}else{b.x=Math.round(t.position.x+t.dimension.width/2)}}if(e===F.AXIS||i.compareFromCat===F.AXIS){v.x=b.x}if(t===F.AXIS||i.compareToCat===F.AXIS){b.x=v.x}var x=false;if(m<f){var E=f;f=m;m=E;E=v;v=b;b=E}if(b.x<=v.x){x=true}i.offset.x=T;var y=m-f;var C;var S=i.font.fSize;var M=0;if(i.ellipse){M=i.font.fSize*parseFloat(w.getParameter("FACTOR_HIGHLIGHT_ELLIPSE_HEIGHT"))}if(y>M+2*S+1){C=0}else if(y>S){C=1}else{C=2}if(i.compareLegend===F.START){var O=N.getModel().position.x;var A=i.midMaxHeight;var _=i.topMaxHeight;var L=i.bottomMaxHeight;var I=A-d;if(I<0){I=0}var D=L-I/2;if(D<0){D=0}var R=D+I/2;s={x:Math.round(O-R-d+i.offset.x),y:f}}else if(i.compareLegend===F.END){var O=N.getModel().position.x+N.getModel().dimension.width;var A=i.midMaxHeight;var _=i.topMaxHeight;var L=i.bottomMaxHeight;var I=A-d;if(I<0){I=0}var P=_-I/2;var D=L-I/2;if(P<0){P=0}if(D<0){D=0}var R=P+I/2;s={x:Math.round(O+R+i.offset.x),y:f}}else if(i.compareLegend===F.FROM){if(e!==F.AXIS){s={x:Math.round(e.position.x+e.dimension.width/2+i.offset.x-d/2),y:f}}else{s={x:v.x+i.offset.x-d/2,y:f}}}else if(i.compareLegend===F.TO){if(t!==F.AXIS){s={x:Math.round(t.position.x+t.dimension.width/2+i.offset.x-d/2),y:f}}else{s={x:b.x+i.offset.x-d/2,y:f}}}else{if(x){s={x:b.x+i.offset.x,y:f}}else{s={x:v.x+i.offset.x,y:f}}}return{dimension:{width:d,height:y},position:s,fromPosition:v,toPosition:b,arrowType:C}}function setPosition(e,t,i,a){var n=0;var r=m.topMaxHeight;var o=m.bottomMaxHeight;if(a===F.START){n=e-t/2-r/2-i.width/2}else if(a===F.MID){n=e-i.width/2}else{n=e+t/2+o/2-i.width/2}return Math.round(n)}},setTextAndDimension:function(e,t,i,a,n){var r=Mt["b"].DataObjects.DocumentDO.getPainter();var o=null;var l=new Mt["b"].Utils.Calculator(a);l.setCondenseRoot(a.dataModel.baseNode);if(a.dataModel.dimSize===1){l.setCondenseLevel(1)}else{l.setCondenseLevel(0)}var s=Mt["b"].Utils.Constants.TypeValues.indicator;for(var d=0;d<e.length;d++){var c=e[d];var u=c.getModel();u.type="time";compareUpdater();var p=Mt["b"].Layout.Common.getCompareToAndFrom(u,n,l,t);u.compareFrom=p.compareFrom;u.compareTo=p.compareTo;if(u.compareFrom===null||u.compareTo===null){u.hide=true;u.active=false;continue}if(u.compareFrom===s.AXIS&&u.compareTo===s.AXIS){u.hide=true;u.active=false;continue}if(u.offset.x===-1){u.offset.x=0}Mt["b"].Models.Actions.ViewModelActions.CompareModel.setText(u,a,n);if(u.compareFrom&&u.compareTo){var g=l.setupCompareFormulas(u,n.multiplePath,n.isMultipleTotal);if(g){u.active=true}else{u.active=false}}else{u.active=false}var h=Mt["b"].Layout.Common.getTimeTextDimensions(u,r);u.absolute.dimension=h.absDim;u.percent.dimension=h.percDim;u.text.dimension=h.textDim;u.topMaxHeight=h.left;u.midMaxHeight=h.mid;u.bottomMaxHeight=h.right;u.maxHeight=h.maxHeight}function compareUpdater(){if(u.linkType===1){if(u.fromAbsolutePosition!==s.AXIS&&u.fromAbsolutePosition.notReversed!==true){o=o||Mt["b"].Models.Actions.DataModelActions.getMultipleDimensions(a.dataModel,0);if(o.length>u.fromAbsolutePosition.groupIndex){u.fromAbsolutePosition.groupIndex=o.length-u.fromAbsolutePosition.groupIndex-1;u.fromAbsolutePosition.notReversed=true}}if(u.toAbsolutePosition!==s.AXIS&&u.toAbsolutePosition.notReversed!==true){o=o||Mt["b"].Models.Actions.DataModelActions.getMultipleDimensions(a.dataModel,0);if(o.length>u.toAbsolutePosition.groupIndex){u.toAbsolutePosition.groupIndex=o.length-u.toAbsolutePosition.groupIndex-1;u.toAbsolutePosition.notReversed=true}}}else if(u.compareFromPos===s.POSITION&&u.fromAbsolutePosition.notReversed!==true){o=o||Mt["b"].Models.Actions.DataModelActions.getMultipleDimensions(a.dataModel,0);if(o.length>u.fromAbsolutePosition.groupIndex){u.fromAbsolutePosition.groupIndex=o.length-u.fromAbsolutePosition.groupIndex-1;u.fromAbsolutePosition.notReversed=true}}else if(u.compareToPos===s.POSITION&&u.toAbsolutePosition.notReversed!==true){o=o||Mt["b"].Models.Actions.DataModelActions.getMultipleDimensions(a.dataModel,0);if(o.length>u.toAbsolutePosition.groupIndex){u.toAbsolutePosition.groupIndex=o.length-u.toAbsolutePosition.groupIndex-1;u.toAbsolutePosition.notReversed=true}}}},calculateSpaceForCompares:function(e,n,t,i,a,r){var o=[0,0];var l;var s=Mt["b"].Utils.Constants.TypeValues.indicator;function getRep(e){for(var t=0;t<n.length;t++){var i=n[t].getModel();var a=i.dataId_dim+"#"+i.dataId_expr;if(a===e){return{representation:i,i:t}}}return{representation:n[0].getModel,i:0}}for(var d=0;d<e.length;d++){l=e[d].getModel();if(l.offset.x==-1||l.compareFrom===null||l.compareTo===null||l.compareFrom===undefined||l.compareTo===undefined){continue}if(l.active===false){continue}var c=l.dimension.width;var u=l.compareConnectorSize;if(c<u){c=u}var p=0;if(l.compareLegend===s.START){var g=0;for(var h=0;h<n.length;h++){var f=n[h].getModel();var m=f.id.split(".");var v=m[2];if(v==="0"){var b=parseInt(r(f.labelPosition,h,false,i));if(b<g){g=b}}else{break}}var T=l.midMaxHeight;var x=l.topMaxHeight;var E=l.bottomMaxHeight;var y=T-c;if(y<0){y=0}var C=x-y/2;var S=E-y/2;if(C<0){C=0}if(S<0){S=0}var M=C+y+S;g=Math.abs(g);p=Math.round(g+M+c-l.offset.x)}else if(l.compareLegend===s.END){var g=0;for(var h=0;h<n.length;h++){var f=n[h].getModel();var m=f.id.split(".");var v=m[2];if(v==="0"){var b=parseInt(r(f.labelPosition,h,false,i));if(b<g){g=b}}else{break}}var T=l.midMaxHeight;var x=l.topMaxHeight;var E=l.bottomMaxHeight;var y=T-c;if(y<0){y=0}var C=x-y/2;var S=E-y/2;if(C<0){C=0}if(S<0){S=0}var M=C+y+S;g=Math.abs(g);p=Math.round(g+M+c+l.offset.x)}else if(l.compareLegend===s.FROM){var f=getRep(l.from);var O=f.i;var A=f.representation;var _=A.instanceOf==="RodModel"||A.instanceOf==="NeedleModle"?true:false;var b=parseInt(r(A.labelPosition,O,_,i));b+=i/2;var T=l.midMaxHeight;var x=l.topMaxHeight;var E=l.bottomMaxHeight;var y=T-c;if(y<0){y=0}var C=x-y/2;var S=E-y/2;if(C<0){C=0}if(S<0){S=0}var M=C+y+S;b=Math.abs(b);var M=C+y+S;if(l.offset.x<0){p=Math.round(b+l.offset.x-c/2-M/2)}else{p=Math.round(b+l.offset.x+c/2+M/2)}if(p<0){p=Math.abs(p)}else{p=0}}else if(l.compareLegend===s.TO){var f=getRep(l.to);var O=f.i;var A=f.representation;var _=A.instanceOf==="RodModel"||A.instanceOf==="NeedleModle"?true:false;var b=parseInt(r(A.labelPosition,O,_,i));b+=i/2;var T=l.midMaxHeight;var x=l.topMaxHeight;var E=l.bottomMaxHeight;var y=T-c;if(y<0){y=0}var C=x-y/2;var S=E-y/2;if(C<0){C=0}if(S<0){S=0}var M=C+y+S;b=Math.abs(b);var M=C+y+S;if(l.offset.x<0){p=Math.round(b+l.offset.x-c/2-M/2)}else{p=Math.round(b+l.offset.x+c/2+M/2)}if(p<0){p=Math.abs(p)}else{p=0}}else{if(l.offset.x<0){var L=l.offset.x*-1;if(l.compareOffsetPoint===s.TO){var f=getRep(l.to)}else{var f=getRep(l.from)}var O=f.i;var A=f.representation;var _=A.instanceOf==="RodModel"||A.instanceOf==="NeedleModle"?true:false;var b=parseInt(r(A.labelPosition,O,_,i));b+=i/2;if(l.labelPosition===s.START){c=l.maxTextWidth+c/2;p=b-L-c}else if(l.labelPosition===s.MID){c=Math.max(l.maxTextWidth/2,c/2);p=b-L-c}else{p=b-L-c/2}if(p<0){p=Math.abs(Math.round(p))}else{p=0}}else{p=0}}if(p>0){if(l.compareLegend===s.START){if(o[0]<Math.abs(p)){o[0]=p}}else if(l.compareLegend===s.END){if(o[1]<Math.abs(p)){o[1]=p}}else if(l.compareLegend===s.FROM){if(o[0]<Math.abs(p)){o[0]=p}}else if(l.compareLegend===s.TO){if(o[0]<Math.abs(p)){o[0]=p}}}else{if(l.compareLegend===s.START){if(o[1]>Math.abs(p)){o[1]=p}}else if(l.compareLegend===s.END){if(o[1]<Math.abs(p)){o[1]=p}}else if(l.compareLegend===s.FROM){if(o[1]<Math.abs(p)){o[1]=p}}else if(l.compareLegend===s.TO){if(o[1]<Math.abs(p)){o[1]=p}}}}return o},displaceCompares:function(e,t){var i=Mt["b"].Utils.Constants.TypeValues.indicator;function intersect(e,t,i,a){return e>i&&e<a||i>e&&i<t||e===i||t===a}function sortAsc(e,t){return e.getModel().displacePriority-t.getModel().displacePriority}var a=e.slice(0);a=a.sort(sortAsc);for(var n=0;n<a.length;n++){var r=a[n].getModel();if(!r.active){continue}var o=Mt["b"].Layout.Common.getMaxPosition(r,false,t);var l=o.position;var s=o.dimension;for(var d=n+1;d<a.length;d++){var c=a[d].getModel();if(!c.active||r.displacePriority===-1&&c.displacePriority===-1){continue}var u=Mt["b"].Layout.Common.getMaxPosition(c,false,t);var p=u.position;var g=u.dimension;var h=intersect(l.x,l.x+s.width,p.x,p.x+g.width);var f=intersect(l.y,l.y+s.height,p.y,p.y+g.height);if(h&&f){var m=l.x+s.width-p.x;c.displacement=m;c.displaced=true;c.position.x+=m;if(c.absolute.legend!==i.NONE){c.absolute.position.x+=m}if(c.percent.legend!==i.NONE){c.percent.position.x+=m}if(c.text.legend!==i.NONE&&c.text.text!==""){c.text.position.x+=m}if(c.ellipse){for(var v=0;v<c.ellipseArray.length;v++){c.ellipseArray[v].x+=m}}}}}}};var A=i(630);Mt["b"].Layout=Mt["b"].Layout||{};Mt["b"].Layout.CategorySizeCalculator=new function(){this.getCategorySizes=function(e,t,i,a,n,r,o,l,s,d,c){var u=Mt["b"].Utils.Calculator.Converter;var p=Mt["b"].DataObjects.RuntimeDO;var g=0;o=u.mm2pix(o*i);var h=[];var f={startStart:0,startEnd:0,midStart:0,midEnd:0,endStart:0,endEnd:0};var m=0;for(var v=0;v<e.length;v++){var b=e[v].extendedModel;var T=Mt["b"].DataObjects.ContextRepo.getContextByCid(b.contextId);var x=c!=undefined?c[v]:p.getParameterParsed(Mt["b"].Models.Actions.ModelActions.ContextModel.getTimeFactor(T));var E;if(T===null){continue}else{if(s!=undefined){E=Mt["b"].Models.Actions.DataModelActions.getMultipleDimensionsByPath(T.dataModel,s,0,true,d)}else{E=Mt["b"].Models.Actions.DataModelActions.getMultipleDimensions(T.dataModel,0)}}g=Math.max(g,E.length);var y=collectReprentationsDimensions(b,x,E,l,t,h,i,a,n);var C=y.dims;var S=y.barSizes;fillMissingMasterPositions(C,"A","R","Q",S);fillMissingMasterPositions(C,"R","A","Q",S);fillMissingMasterPositions(C,"Q","A","R",S);var M=Math.max(C.A.start,C.R.start,C.Q.start);var O=Math.max(C.A.mid,C.R.mid,C.Q.mid);var A=Math.max(C.A.end,C.R.end,C.Q.end);m=Math.max(m,M,O,A);updateDimensionHalves(f,C,M,O,A)}var _=Math.round(r*m);var L=getCategorySize(f,h,_,m,u.mm2pix(a*i));var I=0;for(var v=0;v<e.length;v++){I=Math.max(I,getCategoryDistance(e[v],o,f,i))}var D,R,P;if(f.startStart!==0){D=f.startStart;R=D+_;P=D+_*2}else if(f.midStart!==0){D=f.startStart;R=f.midStart;P=R+_}else{D=f.startStart;R=f.midStart;P=f.endStart}return{categorySize:L,categoryDistance:I,categoryCount:g,positionCount:h.length,startOffset:D,midOffset:R,endOffset:P,totalLength:(L+I+I)*g}};function getExpressionIndex(e,t){var i=-1;for(var a=0;a<e.nodes.length;a++){if(e.nodes[a].key===t){i=a;break}}return i}function collectReprentationsDimensions(e,t,i,a,n,r,o,l,s){var d=Mt["b"].DataObjects.RuntimeDO;var c=Mt["b"].Utils.Calculator.Converter;var u={};var p={};var g={};var h={A:{startStart:0,start:0,midStart:0,mid:0,midEnd:0,end:0,endEnd:0},R:{startStart:0,start:0,midStart:0,mid:0,midEnd:0,end:0,endEnd:0},Q:{startStart:0,start:0,midStart:0,mid:0,midEnd:0,end:0,endEnd:0}};for(var f=0;f<e.expressions.length;f++){var m=e.expressions[f];var v=i.length>0?getExpressionIndex(i[0].ref,m.id.split(".").pop()):null;var b=m.isStack&&e.stackMode?e.stackLabelPosition:a==="time"?m.labelPosition:m.currPosition;b=n[b];if(r.indexOf(b)===-1){r.push(b)}var T=true;for(var x=0;x<i.length;x++){var E=i[x].ref.nodes[v];if(!E||isNaN(E.value)){continue}var y=E.usedRuledEntry.valueType;var C;if(y==="FACTOR_AMOUNT"){C=h.A}else if(y==="FACTOR_QUANTITY"){C=h.Q}else if(y==="FACTOR_RELATION"){C=h.R}else{continue}T=false;if(u[y]===undefined){var S=d.getValueTypeFactor(y);u[y]=S;p[y]=c.mm2pix(l*t*S*o);g[y]=c.mm2pix(s*t*S*o)}var M=b==="start"||b==="mid"||b==="end"?p[y]:g[y];C[b]=Math.max(C[b],M)}if(T){var y="FACTOR_AMOUNT";var C=h.A;if(u[y]===undefined){var S=d.getValueTypeFactor(y);u[y]=S;p[y]=c.mm2pix(l*t*S*o);g[y]=c.mm2pix(s*t*S*o)}var M=b==="start"||b==="mid"||b==="end"?p[y]:g[y];C[b]=Math.max(C[b],M)}}return{dims:h,barSizes:p}}function fillMissingMasterPositions(e,t,i,a,n){var r=t==="A"?"FACTOR_AMOUNT":t==="Q"?"FACTOR_QUANTITY":"FACTOR_RELATION";if(e[t].startStart!==0&&e[t].start===0){if(e[i].start!==0){e[t].start=e[i].start}else if(e[a].start!==0){e[t].start=e[a].start}else{e[t].start=n[r]||0}}if(e[t].endEnd!==0&&e[t].end===0){if(e[i].end!==0){e[t].end=e[i].end}else if(e[a].end!==0){e[t].end=e[a].end}else{e[t].end=n[r]||0}}if((e[t].midEnd!==0||e[t].midStart!==0)&&e[t].mid===0){if(e[i].mid!==0){e[t].mid=e[i].mid}else if(e[a].mid!==0){e[t].mid=e[a].mid}else{e[t].mid=n[r]||0}}}function updateDimensionHalves(e,t,i,a,n){var r=0,o=0,l=0,s=0,d=0,c=0;if(i!==0){for(var u in t){var p=t[u];r=Math.max(r,Math.round((p.start+p.startStart)/2));var g=p.start-Math.round(p.start/2);g=Math.max(g,p.startStart-Math.round(p.startStart/2)-g);o=Math.max(o,g)}e.startStart=Math.max(e.startStart,r);e.startEnd=Math.max(e.startEnd,o)}if(a!==0){for(var u in t){var p=t[u];l=Math.max(l,Math.round((p.mid+p.midStart)/2));s=Math.max(s,p.mid-Math.round(p.mid/2)+p.midEnd-Math.round(p.midEnd/2))}e.midStart=Math.max(e.midStart,l);e.midEnd=Math.max(e.midEnd,s)}if(n!==0){for(var u in t){var p=t[u];var h=Math.round(p.end/2);var f=Math.round(p.endEnd/2);var m=h;d=Math.max(d,Math.max(m,f-m));c=Math.max(c,p.end-h+p.endEnd-f)}e.endStart=Math.max(e.endStart,d);e.endEnd=Math.max(e.endEnd,c)}}function getCategorySize(e,t,i,a,n){var r=0;if(t.length===1){r=a}else{var o=0,l=0;var s=0,d=0;if(e.startStart!==0){o=i;l=i*2;s=-e.startStart;d=e.startEnd}else if(e.midStart!==0){l=i;s=-e.midStart}else{s=-e.endStart}if(e.midEnd!==0){d=Math.max(s,o+e.midEnd)}if(e.endEnd!==0){d=Math.max(s,l+e.endEnd)}r=d-s}if(r===0){r=n}return r}function getCategoryDistance(e,t,i,a){var n=Mt["b"].Utils.Calculator.Converter;var r=e.extendedModel.dimensionLabelModel;var o=1;if(r.hasCategoryDistanceMultiplier){o=(i.startStart!==0?1:0)+(i.midStart!==0?1:0)+(i.endStart!==0?1:0);o=o===0?1:o}var l=parseFloat(r.addCategoryDistance);return o*t+(isNaN(l)?0:n.mm2pix(l*a))}};var ge=i(95);Mt["b"].Layout=Mt["b"].Layout||{};Mt["b"].Layout.Common={getTimeKey:function(e){var t=Mt["b"].Utils.Constants.TypeValues.time;switch(e){case t.P:return"p";case t.F:return"f";case t.PY:return"py";case t.PPY:return"ppy";default:return"p"}},getNotationColor:function(i,a,e,n,r,o){var l=Mt["b"].Utils.Constants.TypeValues.concept;var s=Mt["b"].Utils.Constants.TypeValues.notation;var d=Mt["b"].DataObjects.RuntimeDO;var c=e&&i.valueRating==="+"||!e&&i.valueRating==="-";var t;var u;var p;var g;var h={};var f;function getNMColor(e,t){if(e){if(n===s.AXIS||n===s.HEADER){if(c){h.border=t.positiveOtherBorder;h.pattern=t.positiveOtherFill1;h.background=t.positiveOtherFill1}else{h.border=t.negativeOtherBorder;h.pattern=t.negativeOtherFill1;h.background=t.negativeOtherFill1}}else{switch(a){case l.AREA:case l.AREA_SHAPE:case l.SHAPE:if(c){h.border=t.positiveOtherBorder;h.pattern=t.positiveOtherFill1;h.background=t.positiveOtherFill2}else{h.border=t.negativeOtherBorder;h.pattern=t.negativeOtherFill1;h.background=t.negativeOtherFill2}break;case l.COLOR:case l.AREA_COLOR:case l.AREA_COLOR_SHAPE:case l.COLOR_SHAPE:if(c){h.border=t.positiveColorBorder;h.pattern=t.positiveColorFill1;h.background=t.positiveColorFill2}else{h.border=t.negativeColorBorder;h.pattern=t.negativeColorFill1;h.background=t.negativeColorFill2}break}}}else{if(r!==undefined){if(n===s.AXIS||n===s.HEADER){if(r===0||r===2){if(a===l.AREA||a===l.AREA_COLOR||a===l.AREA_SHAPE||a===l.AREA_COLOR_SHAPE){if(c){h.border=t.positiveOtherBorder;h.pattern=t.positiveOtherFill1;h.background=t.positiveOtherFill2;h.axisBorder=t.positiveOtherBorder;h.axisPattern=t.positiveOtherFill1;h.axisBackground=t.positiveOtherFill2;h.otherPattern=t.otherArea}else{h.border=t.negativeOtherBorder;h.pattern=t.negativeOtherFill1;h.background=t.negativeOtherFill2;h.axisBorder=t.negativeOtherBorder;h.axisPattern=t.negativeOtherFill1;h.axisBackground=t.negativeOtherFill2;h.otherPattern=t.otherArea}}else{if(c){h.border=t.positiveOtherBorder;h.pattern=t.positiveOtherFill1;h.background=t.positiveOtherFill2;h.axisBorder=t.positiveOtherBorder;h.axisPattern=t.positiveOtherFill1;h.axisBackground=t.positiveOtherFill2;h.otherPattern=t.otherOther}else{h.border=t.negativeOtherBorder;h.pattern=t.negativeOtherFill1;h.background=t.negativeOtherFill2;h.axisBorder=t.negativeOtherBorder;h.axisPattern=t.negativeOtherFill1;h.axisBackground=t.negativeOtherFill2;h.otherPattern=t.otherOther}}}if(r===1){if(a===l.AREA||a===l.AREA_COLOR||a===l.AREA_SHAPE||a===l.AREA_COLOR_SHAPE){h.border=t.otherBorder;h.pattern=t.otherFill1;h.background=t.otherFill2;h.axisBorder=t.otherBorder;h.axisPattern=t.otherFill1;h.axisBackground=t.otherFill2;h.otherPattern=t.otherArea}else{h.border=t.otherBorder;h.pattern=t.otherFill1;h.background=t.otherFill2;h.axisBorder=t.otherBorder;h.axisPattern=t.otherFill1;h.axisBackground=t.otherFill2;h.otherPattern=t.otherOther}}}else{switch(a){case l.AREA:case l.AREA_SHAPE:case l.SHAPE:if(r===0||r===2){if(c){h.border=t.positiveOtherBorder;h.pattern=t.positiveOtherFill1;h.background=t.positiveOtherFill2}else{h.border=t.negativeOtherBorder;h.pattern=t.negativeOtherFill1;h.background=t.negativeOtherFill2}}else{h.border=t.otherBorder;h.pattern=t.otherFill1;h.background=t.otherFill2}break;case l.COLOR:case l.AREA_COLOR:case l.AREA_COLOR_SHAPE:case l.COLOR_SHAPE:if(c){h.border=t.positiveColorBorder;h.pattern=t.positiveColorFill1;h.background=t.positiveColorFill2}else{h.border=t.negativeColorBorder;h.pattern=t.negativeColorFill1;h.background=t.negativeColorFill2}}}}else{if(n===s.AXIS||n===s.HEADER){if(a===l.AREA_COLOR||a===l.COLOR||a===l.AREA_COLOR_SHAPE||a===l.COLOR_SHAPE){if(a===l.AREA_COLOR||a===l.AREA_COLOR_SHAPE){h.border=t.otherBorder;h.pattern=t.otherFill1;h.background=t.otherFill1;h.axisBorder=t.colorBorder;h.axisPattern=t.colorFill1;h.axisBackground=t.colorFill2;h.otherPattern=t.otherArea}else{h.border=t.otherBorder;h.pattern=t.otherFill1;h.background=t.otherFill1;h.axisBorder=t.colorBorder;h.axisPattern=t.colorFill1;h.axisBackground=t.colorFill2;h.otherPattern=t.otherOther}}else{if(a===l.AREA||a===l.AREA_SHAPE){h.border=t.otherBorder;h.pattern=t.otherFill1;h.background=t.otherFill1;h.axisBorder=t.otherBorder;h.axisPattern=t.otherFill1;h.axisBackground=t.otherFill1;h.otherPattern=t.otherArea}else{h.border=t.otherBorder;h.pattern=t.otherFill1;h.background=t.otherFill1;h.axisBorder=t.otherBorder;h.axisPattern=t.otherFill1;h.axisBackground=t.otherFill1;h.otherPattern=t.otherOther}}}else{switch(a){case l.AREA:case l.AREA_SHAPE:case l.SHAPE:h.border=t.otherBorder;h.pattern=t.otherFill1;h.background=t.otherFill2;break;case l.AREA_COLOR:case l.AREA_COLOR_SHAPE:case l.COLOR:case l.COLOR_SHAPE:h.border=t.colorBorder;h.pattern=t.colorFill1;h.background=t.colorFill2;break}}}}if(n===s.ELEMENT_AXIS){u=d.getDataType(i.referenceDataType);p=i.referenceSubType;g=Mt["b"].Layout.Common.getTimeKey(i.referenceTimeType);h=getNMColorAxis(e,u.subtypes[p].settings[g],h,o)}else{u=d.getDataType(i.baseDataType);p=i.baseSubType;g=Mt["b"].Layout.Common.getTimeKey(i.timeType);h=getNMColorAxis(e,u.subtypes[p].settings[g],h,a)}return h}function getNMColorAxis(e,t,i,a){if(n!==s.HEADER&&e){if(e){switch(a){case l.AREA:case l.AREA_SHAPE:case l.SHAPE:if(a===l.AREA||a===l.AREA_SHAPE){if(c){i.axisBorder=t.positiveOtherBorder;i.axisPattern=t.positiveOtherFill1;i.axisBackground=t.positiveOtherFill2;i.otherPattern=t.otherArea}else{i.axisBorder=t.negativeOtherBorder;i.axisPattern=t.negativeOtherFill1;i.axisBackground=t.negativeOtherFill2;i.otherPattern=t.otherArea}}else{if(c){i.axisBorder=t.positiveOtherBorder;i.axisPattern=t.positiveOtherFill1;i.axisBackground=t.positiveOtherFill2;i.otherPattern=t.otherOther}else{i.axisBorder=t.negativeOtherBorder;i.axisPattern=t.negativeOtherFill1;i.axisBackground=t.negativeOtherFill2;i.otherPattern=t.otherOther}}break;case l.COLOR:if(c){i.axisBorder=t.positiveColorBorder;i.axisPattern=t.positiveColorFill1;i.axisBackground=t.positiveColorFill1}else{i.axisBorder=t.negativeColorBorder;i.axisPattern=t.negativeColorFill1;i.axisBackground=t.negativeColorFill1}break;case l.AREA_COLOR:case l.AREA_COLOR_SHAPE:case l.COLOR_SHAPE:if(a===l.AREA_COLOR||a===l.AREA_COLOR_SHAPE){if(c){i.axisBorder=t.positiveColorBorder;i.axisPattern=t.positiveColorFill1;i.axisBackground=t.positiveColorFill2;i.otherPattern=t.otherArea}else{i.axisBorder=t.negativeColorBorder;i.axisPattern=t.negativeColorFill1;i.axisBackground=t.negativeColorFill2;i.otherPattern=t.otherArea}}else{if(c){i.axisBorder=t.positiveColorBorder;i.axisPattern=t.positiveColorFill1;i.axisBackground=t.positiveColorFill2;i.otherPattern=t.otherOther}else{i.axisBorder=t.negativeColorBorder;i.axisPattern=t.negativeColorFill1;i.axisBackground=t.negativeColorFill2;i.otherPattern=t.otherOther}}break}}}else if(r!==undefined&&n===s.HEADER){switch(a){case l.AREA:case l.AREA_SHAPE:case l.SHAPE:if(a===l.AREA||a===l.AREA_SHAPE){if(c){i.axisBorder=t.otherBorder;i.axisPattern=t.otherFill1;i.axisBackground=t.otherFill2;i.otherPattern=t.otherArea}else{i.axisBorder=t.otherBorder;i.axisPattern=t.otherFill1;i.axisBackground=t.otherFill2;i.otherPattern=t.otherArea}}else{if(c){i.axisBorder=t.otherBorder;i.axisPattern=t.otherFill1;i.axisBackground=t.otherFill2;i.otherPattern=t.otherOther}else{i.axisBorder=t.otherBorder;i.axisPattern=t.otherFill1;i.axisBackground=t.otherFill2;i.otherPattern=t.otherOther}}break;case l.COLOR:case l.AREA_COLOR:case l.AREA_COLOR_SHAPE:case l.COLOR_SHAPE:if(a===l.AREA_COLOR||a===l.AREA_COLOR_SHAPE){if(c){i.axisBorder=t.colorBorder;i.axisPattern=t.colorFill1;i.axisBackground=t.colorFill2;i.otherPattern=t.otherArea}else{i.axisBorder=t.colorBorder;i.axisPattern=t.colorFill1;i.axisBackground=t.colorFill2;i.otherPattern=t.otherArea}}else{if(c){i.axisBorder=t.colorBorder;i.axisPattern=t.colorFill1;i.axisBackground=t.colorFill2;i.otherPattern=t.otherOther}else{i.axisBorder=t.colorBorder;i.axisPattern=t.colorFill1;i.axisBackground=t.colorFill2;i.otherPattern=t.otherOther}}}}else{switch(a){case l.AREA:case l.AREA_SHAPE:case l.SHAPE:if(a===l.AREA||a===l.AREA_SHAPE){i.axisBorder=t.otherBorder;i.axisPattern=t.otherFill1;i.axisBackground=t.otherFill2;i.otherPattern=t.otherArea}else{i.axisBorder=t.otherBorder;i.axisPattern=t.otherFill1;i.axisBackground=t.otherFill2;i.otherPattern=t.otherOther}break;case l.AREA_COLOR:case l.AREA_COLOR_SHAPE:case l.COLOR_SHAPE:case l.COLOR:if(a===l.AREA_COLOR||a===l.AREA_COLOR_SHAPE){i.axisBorder=t.colorBorder;i.axisPattern=t.colorFill1;i.axisBackground=t.colorFill2;i.otherPattern=t.otherArea}else{i.axisBorder=t.colorBorder;i.axisPattern=t.colorFill1;i.axisBackground=t.colorFill2;i.otherPattern=t.otherOther}break}}return i}if(n===s.AXIS||n===s.HEADER){u=d.getDataType("Actual");p="ACT0";g="p";if(a===l.AREA||a===l.AREA_COLOR||a===l.AREA_SHAPE||a===l.AREA_COLOR_SHAPE){f=u.subtypes[p].settings[g].otherArea}else{f=u.subtypes[p].settings[g].otherOther}if(i.isDelta){if(i.baseColorDeltaIndividual){if(c){t={axisBorder:i.baseColorDeltaPlusBorder,axisPattern:i.baseColorDeltaPlusPattern,axisBackground:i.baseColorDeltaPlus,border:u.subtypes[p].settings[g].positiveOtherBorder,pattern:u.subtypes[p].settings[g].positiveOtherFill1,background:u.subtypes[p].settings[g].positiveOtherFill2,otherPattern:f}}else{t={axisBorder:i.baseColorDeltaMinusBorder,axisPattern:i.baseColorDeltaMinusPattern,axisBackground:i.baseColorDeltaMinus,border:u.subtypes[p].settings[g].negativeOtherBorder,pattern:u.subtypes[p].settings[g].negativeOtherFill1,background:u.subtypes[p].settings[g].negativeOtherFill2,otherPattern:f}}}else{t=getNMColor(true,u.subtypes[p].settings[g])}}else{if(i.baseColorIndividual){if(r!==undefined){if(r===0||r===2){if(c){t={axisBorder:i.baseColorBorder,axisPattern:i.baseColorPattern,axisBackground:i.baseColor,border:u.subtypes[p].settings[g].positiveOtherBorder,pattern:u.subtypes[p].settings[g].positiveOtherFill1,background:u.subtypes[p].settings[g].positiveOtherFill2,otherPattern:f}}else{t={axisBorder:i.baseColorBorder,axisPattern:i.baseColorPattern,axisBackground:i.baseColor,border:u.subtypes[p].settings[g].negativeOtherBorder,pattern:u.subtypes[p].settings[g].negativeOtherFill1,background:u.subtypes[p].settings[g].negativeOtherFill2,otherPattern:f}}}else{t={axisBorder:i.baseColorBorder,axisPattern:i.baseColorPattern,axisBackground:i.baseColor,border:u.subtypes[p].settings[g].otherBorder,pattern:u.subtypes[p].settings[g].otherFill1,background:u.subtypes[p].settings[g].otherFill2,otherPattern:f}}}else{t={axisBorder:i.baseColorBorder,axisPattern:i.baseColorPattern,axisBackground:i.baseColor,border:u.subtypes[p].settings[g].otherBorder,pattern:u.subtypes[p].settings[g].otherFill1,background:u.subtypes[p].settings[g].otherFill2,otherPattern:f}}}else{t=getNMColor(false,u.subtypes[p].settings[g])}}}else{u=d.getDataType(i.baseDataType);p=i.baseSubType;g=Mt["b"].Layout.Common.getTimeKey(i.timeType);if(i.isDelta){if(i.baseColorDeltaIndividual){if(c){t={border:i.baseColorDeltaPlusBorder,pattern:i.baseColorDeltaPlusPattern,background:i.baseColorDeltaPlus}}else{t={border:i.baseColorDeltaMinusBorder,pattern:i.baseColorDeltaMinusPattern,background:i.baseColorDeltaMinus}}}else{t=getNMColor(true,u.subtypes[p].settings[g])}}else{if(i.baseColorIndividual){t={border:i.baseColorBorder,pattern:i.baseColorPattern,background:i.baseColor}}else{t=getNMColor(false,u.subtypes[p].settings[g])}}}if(i.referenceUsed&&(n===s.ELEMENT_HEADER||n===s.ELEMENT_AXIS)){var m={};u=d.getDataType(i.referenceDataType);p=i.referenceSubType;g=Mt["b"].Layout.Common.getTimeKey(i.referenceTimeType);if(a===l.AREA||a===l.AREA_COLOR||a===l.AREA_SHAPE||a===l.AREA_COLOR_SHAPE){f=u.subtypes[p].settings[g].otherArea}else{f=u.subtypes[p].settings[g].otherOther}if(i.referenceIsDelta){if(i.referenceColorDeltaIndividual){if(c){t.axisBorder=i.referenceColorDeltaPlusBorder;t.axisPattern=i.referenceColorDeltaPlusPattern;t.axisBackground=i.referenceColorDeltaPlus;t.otherPattern=f}else{t.axisBorder=i.referenceColorDeltaMinusBorder;t.axisPattern=i.referenceColorDeltaMinusPattern;t.axisBackground=i.referenceColorDeltaMinus;t.otherPattern=f}}else{m=getNMColorAxis(true,u.subtypes[p].settings[g],m,o);t.axisBorder=m.axisBorder;t.axisPattern=m.axisPattern;t.axisBackground=m.axisBackground;t.otherPattern=m.otherPattern}}else{if(i.referenceColorIndividual){t.axisBorder=i.referenceColorBorder;t.axisPattern=i.referenceColorPattern;t.axisBackground=i.referenceColor;t.otherPattern=f}else{m=getNMColorAxis(false,u.subtypes[p].settings[g],m,o);t.axisBorder=m.axisBorder;t.axisPattern=m.axisPattern;t.axisBackground=m.axisBackground;t.otherPattern=m.otherPattern}}}return t},getNotationColorStructure:function(e,a,t,i,n,r){var o=Mt["b"].Utils.Constants.TypeValues.concept;var l=Mt["b"].DataObjects.RuntimeDO;var s=i&&e.valueRating==="+"||!i&&e.valueRating==="-";var d;var c;var u;var p;function getNMColor(e,t){var i={pattern:null,border:null,background:null};if(e){switch(a){case o.AREA:case o.AREA_SHAPE:case o.SHAPE:if(s){i.border=t.positiveOtherBorder;i.pattern=t.positiveOtherFill1;i.background=t.positiveOtherFill2}else{i.border=t.negativeOtherBorder;i.pattern=t.negativeOtherFill1;i.background=t.negativeOtherFill2}break;case o.COLOR:case o.AREA_COLOR:case o.AREA_COLOR_SHAPE:case o.COLOR_SHAPE:if(s){i.border=t.positiveColorBorder;i.pattern=t.positiveColorFill1;i.background=t.positiveColorFill2}else{i.border=t.negativeColorBorder;i.pattern=t.negativeColorFill1;i.background=t.negativeColorFill2}break}}else{switch(a){case o.AREA:case o.AREA_SHAPE:case o.SHAPE:i.border=t.otherBorder;i.pattern=t.otherFill1;i.background=t.otherFill2;break;case o.AREA_COLOR:case o.AREA_COLOR_SHAPE:case o.COLOR:case o.COLOR_SHAPE:i.border=t.colorBorder;i.pattern=t.colorFill1;i.background=t.colorFill2;break}}return i}if(t){c=l.getDataType(e.baseDataType);u=e.baseSubType;p=r?"p":Mt["b"].Layout.Common.getTimeKey(e.timeType);if(e.isDelta||!e.baseColorIndividual&&n){if(e.baseColorDeltaIndividual){if(s){d={border:e.baseColorDeltaPlusBorder,pattern:e.baseColorDeltaPlusPattern,background:e.baseColorDeltaPlus}}else{d={border:e.baseColorDeltaMinusBorder,pattern:e.baseColorDeltaMinusPattern,background:e.baseColorDeltaMinus}}}else{d=getNMColor(true,c.subtypes[u].settings[p])}}else{if(e.baseColorIndividual){d={border:e.baseColorBorder,pattern:e.baseColorPattern,background:e.baseColor}}else{d=getNMColor(false,c.subtypes[u].settings[p])}}}else{c=l.getDataType(e.referenceDataType);u=e.referenceSubType;p=r?"p":Mt["b"].Layout.Common.getTimeKey(e.referenceTimeType);if(e.referenceIsDelta){if(e.referenceColorDeltaIndividual){if(s){d={pattern:e.referenceColorDeltaPlusPattern,background:e.referenceColorDeltaPlus,border:e.referenceColorDeltaPlusBorder}}else{d={pattern:e.referenceColorDeltaMinusPattern,background:e.referenceColorDeltaMinus,border:e.referenceColorDeltaMinusBorder}}}else{d=getNMColor(true,c.subtypes[u].settings[p])}}else{if(e.referenceColorIndividual){d={pattern:e.referenceColorPattern,background:e.referenceColor,border:e.referenceColorBorder}}else{d=getNMColor(false,c.subtypes[u].settings[p])}}}return d},setNotationShape:function(e,t,i,a,n){var r=Mt["b"].DataObjects.RuntimeDO;var o=e.getModel();var l=Mt["b"].Utils.Constants.TypeValues.concept;var s=Mt["b"].Utils.Constants.TypeValues.notation;if(i===s.ELEMENT||i===s.ELEMENT_HEADER||i===s.ELEMENT_AXIS){var d=r.getDataType(t.baseDataType);var c=d.subtypes[t.baseSubType];var u=Mt["b"].Layout.Common.getTimeKey(t.timeType);if(a===l.AREA_COLOR_SHAPE||a===l.AREA_SHAPE||a===l.SHAPE||a===l.COLOR_SHAPE){o.shapeSymbol=c.settings[u].symbolShape}else{o.shapeSymbol=c.settings[u].symbolOther}if(n){if(a===l.AREA_COLOR_SHAPE||a===l.AREA_SHAPE||a===l.AREA||a===l.AREA_COLOR){o.lineStyle=c.settings[u].lineShape}else{o.lineStyle=c.settings[u].lineOther}}}else{var d=r.getDataType(t.baseDataType);var c=d.subtypes[t.baseSubType];var u=Mt["b"].Layout.Common.getTimeKey(t.timeType);o.shapeSymbol=c.settings[u].symbolOther;if(n){o.lineStyle=c.settings[u].lineOther}}},getNotationShape:function(e,t,i){var a=Mt["b"].DataObjects.RuntimeDO;var n=Mt["b"].Utils.Constants.TypeValues.concept;var r=Mt["b"].Utils.Constants.TypeValues.notation;var o;if(t===r.ELEMENT||t===r.ELEMENT_HEADER||t===r.ELEMENT_AXIS){var l=a.getDataType(e.baseDataType);var s=l.subtypes[e.baseSubType];var d=Mt["b"].Layout.Common.getTimeKey(e.timeType);if(i===n.AREA_COLOR_SHAPE||i===n.AREA_SHAPE||i===n.SHAPE||i===n.COLOR_SHAPE){o=s.settings[d].symbolShape}else{o=s.settings[d].symbolOther}}else{var l=a.getDataType(e.baseDataType);var s=l.subtypes[e.baseSubType];var d=Mt["b"].Layout.Common.getTimeKey(e.timeType);o=s.settings[d].symbolOther}return o},getOtherPattern:function(e,t,i,a){var n=Mt["b"].DataObjects.RuntimeDO;var r=Mt["b"].Utils.Constants.TypeValues.concept;var o=Mt["b"].Utils.Constants.TypeValues.otherPattern;if(a===false){if(i===r.AREA||i===r.AREA_COLOR||i===r.AREA_SHAPE||i===r.AREA_COLOR_SHAPE){if(e.referenceUsed===false){var l=n.getDataType(e.baseDataType);var s=l.subtypes[e.baseSubType];var d=Mt["b"].Layout.Common.getTimeKey(e.timeType);var c=s.settings[d].otherArea}else{var l=n.getDataType(e.referenceDataType);var s=l.subtypes[e.referenceSubType];var d=Mt["b"].Layout.Common.getTimeKey(e.referenceTimeType);var c=s.settings[d].otherArea}}else{if(e.referenceUsed===false){var l=n.getDataType(e.baseDataType);var s=l.subtypes[e.baseSubType];var d=Mt["b"].Layout.Common.getTimeKey(e.timeType);var c=s.settings[d].otherOther}else{var l=n.getDataType(e.referenceDataType);var s=l.subtypes[e.referenceSubType];var d=Mt["b"].Layout.Common.getTimeKey(e.referenceTimeType);var c=s.settings[d].otherOther}}}else{if(i===r.AREA||i===r.AREA_COLOR||i===r.AREA_SHAPE||i===r.AREA_COLOR_SHAPE){var l=n.getDataType(e.baseDataType);var s=l.subtypes[e.baseSubType];var d=Mt["b"].Layout.Common.getTimeKey(e.timeType);var c=s.settings[d].otherArea}else{var l=n.getDataType(e.baseDataType);var s=l.subtypes[e.baseSubType];var d=Mt["b"].Layout.Common.getTimeKey(e.timeType);var c=s.settings[d].otherOther}}if(c===undefined){c="diagonal";c=o.DIAGONAL}return c},sortRepresentations:function(e,t,i){var a=new Array(t.length);var n=0;for(var r=0;r<e.length;r++){var o=e[r].getModel();var l=parseInt(o.id.split(".")[2]);n=Math.max(n,l);for(var s=0;s<t.length;s++){if(!i&&o.positioning===t[s].pos||i&&o.labelPosition===t[s].pos){if(a[s]==undefined){a[s]=[]}if(a[s][l]==undefined){a[s][l]=[]}a[s][l].push(o);break}}}function sortHelper(e,t){if(e.sequence===t.sequence){return parseInt(t.id.split(".")[3])-parseInt(e.id.split(".")[3])}else{return t.sequence-e.sequence}}for(var r=0;r<a.length;r++){for(var s=0;s<=n;s++){if(a[r]&&a[r][s]){a[r][s].sort(sortHelper);var d=0;var c=Math.min(3,a[r][s].length);for(;d<c;d++){a[r][s][d].zIndex=t[r].z+d*3}for(;d<a[r][s].length;d++){a[r][s][d].zIndex=t[r].z}}}}},hideMinMaxLabels:function(e,t,i){var a=i.expressions;var n=null,r=null;for(var o=0;o<a.length;o++){var l=a[o];if(l.valueLabelOpt.substr(0,6)==="MinMax"){var s=l.id.substr(l.id.lastIndexOf(".")+1);n=null;r=null;for(var d=0;d<e.length;d++){var c=e[d];if(!c.isOutlier&&c.dataId_expr===s){if(n===null){n=c;r=c}else if(c.value>n.value){n=c}else if(c.value<r.value){r=c}}}for(var d=0;d<t.length;d++){var u=t[d];if(n!==null&&u.dataId_expr===s){u.hideLabel=u.dataId_dim!==n.dataId_dim&&u.dataId_dim!==r.dataId_dim;if(u.hideLabel){var p=Mt["b"].Layout.Common.getHighlight(i,u,Mt["b"].Utils.Constants.TypeValues.VALUE,true);if(p&&p.highlight){p.highlight.active=false}}}}}}},hideMinMaxTotals:function(e,t,i){var a;var n;var r=[];var o=null;var l=e[0];var s=[];for(var d=0;d<e.length;d++){o=e[d];if(o.isStack){if(o.dataId_dim!==l.dataId_dim){r.push(Mt["b"].Layout.Common.getLastStackElement(s,l.dataId_dim));l=o;s=[];s.push(o)}else{s.push(o)}}}r.push(Mt["b"].Layout.Common.getLastStackElement(s,o.dataId_dim));for(var d=0;d<r.length;d++){if(r[d].pos){if(a==undefined){a=r[d].pos}else{if(a.stackModel.startOn+a.value<r[d].pos.stackModel.startOn+r[d].pos.value){a=r[d].pos}}if(n==undefined){n=r[d].pos}else{if(n.stackModel.startOn+n.value>r[d].pos.stackModel.startOn+r[d].pos.value){n=r[d].pos}}}if(r[d].neg){if(a==undefined){a=r[d].neg}else{if(a.stackModel.startOn+a.value<r[d].neg.stackModel.startOn+r[d].neg.value){a=r[d].neg}}if(n==undefined){n=r[d].neg}else{if(n.stackModel.startOn+n.value>r[d].neg.stackModel.startOn+r[d].neg.value){n=r[d].neg}}}}for(var d=0;d<t.length;d++){var c=t[d];c.hideLabel=!(c.dataId_expr===a.dataId_expr&&c.dataId_dim===a.dataId_dim||c.dataId_expr===n.dataId_expr&&c.dataId_dim===n.dataId_dim);if(c.hideLabel){var u=Mt["b"].Layout.Common.getHighlight(i,c,Mt["b"].Utils.Constants.TypeValues.highlightType.VALUE,true);if(u&&u.highlight){u.highlight.active=false}}}},hideStackedValueLabels:function(e,t,i){var a=new Mt["b"].Utils.Calculator(t);var n=t.dataModel.baseNode.nodes;for(var r=0;r<n.length;r++){for(var o=0;o<n[r].nodes.length;o++){if(!isNaN(n[r].nodes[o].value)){var l=Mt["b"].Factories.ModelFactory.setupFunctionValueLabel(e,n[r].nodes[o],n[r].value,t,r,a);if(!l){break}}}if(e.instanceOf==="ChartModel"){i[r].hideLabel=l;if(i[r].hideLabel){var s=Mt["b"].Layout.Common.getHighlight(e,i[r],Mt["b"].Utils.Constants.TypeValues.highlightType.VALUE,true);if(s&&s.highlight){s.highlight.active=false}}if(l&&i[r+n.length]!==undefined){i[r+n.length].hideLabel=l;if(i[r+n.length].hideLabel){var s=Mt["b"].Layout.Common.getHighlight(e,i[r+n.length],Mt["b"].Utils.Constants.TypeValues.highlightType.VALUE,true);if(s&&s.highlight){s.highlight.active=false}}}}if(e.instanceOf==="TimeChartModel"){i[r].getModel().hideLabel=l;if(i[r].getModel().hideLabel){var s=Mt["b"].Layout.Common.getHighlight(e,i[r].getModel(),Mt["b"].Utils.Constants.TypeValues.highlightType.VALUE,true);if(s&&s.highlight){s.highlight.active=false}}if(l&&i[r+n.length]!==undefined){i[r+n.length].getModel().hideLabel=l;if(i[r+n.length].getModel().hideLabel){var s=Mt["b"].Layout.Common.getHighlight(e,i[r+n.length].getModel(),Mt["b"].Utils.Constants.TypeValues.highlightType.VALUE,true);if(s&&s.highlight){s.highlight.active=false}}}}}},getAxisNotation:function(e){for(var t=0;t<e.length;t++){if(e[t].axisNotation){return true}}return false},getExpressionForAxisSegment:function(e,t){var i=null,a=null;var n=false;for(var r=0;r<e.length&&!n;r++){var o=e[r];if(o.axisNotation){var l=o.id.split(".").pop();for(var s=0;s<t.nodes.length;s++){if(t.nodes[s].key===l){if(t.nodes[s].usedRuledEntry.valueType!=="FACTOR_NONE"){i=o;a=t.nodes[s];n=true}else if(i===null){i=o;a=t.nodes[s]}break}}}}return{expr:i,node:a}},getFirstNonZeroRepresentationByExprId:function(e,t,i,a){var n=null;if(i){for(var r=0;r<e.length;r++){var o=e[r];if(o.dataId_expr===t&&!o.isNaN&&o.valueType!=="FACTOR_NONE"){if(o.value!==0&&!o.isOutlier){n=o;break}else if(n===null){n=o;if(a){break}}}}}else{for(var r=e.length-1;r>=0;r--){var o=e[r];if(o.dataId_expr===t&&!o.isNaN&&o.valueType!=="FACTOR_NONE"){if(o.value!==0&&!o.isOutlier){n=o;break}else if(n===null){n=o;if(a){break}}}}}return n},boxesOverlap:function(e,t,i,a){function intersect1D(e,t,i,a){return e>i&&e<a||i>e&&i<t||e===i||t===a}return intersect1D(e.x-a,e.x+e.width+a,t.x-a,t.x+t.width+a)&&intersect1D(e.y-i,e.y+e.height+i,t.y-i,t.y+t.height+i)},labelsOverlap:function(e,t,i,a){var n=Mt["b"].Models.Actions.ViewModelActions.LabelModel.getBox(e);var r=Mt["b"].Models.Actions.ViewModelActions.LabelModel.getBox(t);return Mt["b"].Layout.Common.boxesOverlap(n,r,i,a)},hideOverlappingLabels:function(e,t,i,a,r,n,o,l){function getLowerPriorityLabel(e,t,i,a){if(i&&a){var n=s(e.dataId_dim);var r=s(t.dataId_dim);if(n<r){return t}else if(n>r){return e}else{if(e.relativePosition<=t.relativePosition){return e}else{return t}}}else if(i){return e}else{return t}}var s=function(){var n={};return function(e){var t=n[e];if(t!==undefined){return t}for(var i=0,a=r.length;i<a;i++){if(r[i].path===e){n[e]=i;return i}}n[e]=r.length;return r.length}}();var d=a.extendedModel;var c=d.stackMode&&d.stackShowLabel.split(".")[1]==="Dynamic";var u=c;var p=[];var g=[];for(var h=0,f=e.length;h<f;h++){var m=e[h];if(!m.hideLabel){g.push(m);var v=n[m.dataId_expr];p.push(v);u=u||v}}if(u){var b=t.concat(i).filter(function(e){return!e.hideLabel});g=g.concat(b);p=p.concat(Mt["b"].Utils.GlobalFunctions.createArray(b.length,c));var h=0,f=g.length;while(h<f){var T=g[h];for(var x=0;x<h;x++){var E=g[x];if(!E.hideLabel&&E.dataId_expr!==T.dataId_expr&&Mt["b"].Layout.Common.labelsOverlap(E,T,o,l)&&(p[h]||p[x])){var y=getLowerPriorityLabel(E,T,p[x],p[h]);y.hideLabel=true;var C=Mt["b"].Layout.Common.getHighlight(d,y,Mt["b"].Utils.Constants.TypeValues.highlightType.VALUE,true);if(C&&C.highlight){C.highlight.active=false}}}h++}}},hideExpressionOverlappingLabels:function(e,t,i,a,n){function getLowerPriorityLabel(e,t){var i=r[e.dataId_dim];var a=r[t.dataId_dim];return i<a?t:e}var r={};for(var o=0,l=t.length;o<l;o++){r[t[o].ref.value]=o}var s=e.filter(function(e){return!e.hideLabel});for(var o=1,l=s.length;o<l;o++){var d=s[o];for(var c=o-1;c>=0;c--){var u=s[c];if(!u.hideLabel&&Mt["b"].Layout.Common.labelsOverlap(d,u,a,n)){var p=getLowerPriorityLabel(d,u);p.hideLabel=true;var g=Mt["b"].Layout.Common.getHighlight(i,p,Mt["b"].Utils.Constants.TypeValues.highlightType.VALUE,true);if(g&&g.highlight){g.highlight.active=false}break}}}},getChangeSeparators:function(e,t,i,a,n,r,o,l,s){var d=[];var c=o.getModel().children;var u=null,p;var g=null,h=null;var f=o.getModel().extendedModel.categoryEntriesPosition===Mt["b"].Utils.Constants.TypeValues.summingPos.START;var m=o.getModel().extendedModel.orientation===Mt["b"].Utils.Constants.TypeValues.labelOrientation.HORIZONTAL;function getLabelIndex(e){for(var t=0;t<s;t++){if(c[e*s+t].text!==""){return t}}return null}var v=false;for(var b=0;b<c.length;b++){if(c[b].catWithoutTotal){v=true;break}}v=v&&o.getModel().extendedModel.categoriesWithoutTotals==="categoryWithoutValuesType.0";var T=new Array(l.rows.length);if(T.length>1){T[T.length-1]=false;for(var b=l.rows.length-2;b>=0;b--){T[b]=T[b+1]||l.rows[b].additionsHierarchy}}for(var b=0,x=0;b<e.length;b++){if(e[b]===null){continue}var E=Mt["b"].Models.Actions.DataModelActions.getDimensionNodeFromArray(e[b],r,x++);if(E===null||E.hide){continue}p=e[b].split("@");var y;for(var C=0;C<E.nodes.length;C++){if(E.nodes[C].key===t){y=E.nodes[C].usedRuledEntry;break}}if(g!==null){if(a&&g!==y.baseDataType||n&&h!==y.timeType){var S;var M=getLabelIndex(b);var O=getLabelIndex(b-1);if(M===null){S=(b-1)*s+O}else if(O===null){S=b*s+M}else{var A=c[b*s+M].position;var _=c[(b-1)*s+O].position;if(m){S=A.y>=_.y?b*s+M:(b-1)*s+O}else{S=A.x<=_.x?b*s+M:(b-1)*s+O}}d.push({category:b,dimLabelIdx:S,zIndex:310})}else if(i&&u!==null){var L=0;for(;L<l.rows.length&&p[L]===u[L];L++){}if(L<l.rows.length-1){var I=b,D=L;if(T[L]||v&&e[I-1]===null){if(f){while(e[I-1]===null){I--}}else{if(e[I-1]===null){I--}}}else{if(!f){I=b-1}}D=getLabelIndex(I);D=D===null?L:D;d.push({category:f?I:I+1,dimLabelIdx:I*s+D,zIndex:310})}}}g=y.baseDataType;h=y.timeType;u=p}return d},getTotalsSeparators:function(e,t,i,a,n,r,o,l){var s=[];var d=r.getModel().children;var c=r.getModel().extendedModel.categoryEntriesPosition===Mt["b"].Utils.Constants.TypeValues.summingPos.START;function getDimNode(e,t){var i=d[e];return Mt["b"].Models.Actions.DataModelActions.getDimensionNodeFromArray(i.dataId_dim,n,t)}function isSeparatorTop(e){return!e.isFirst&&(e.isSum===false||o.rows[e.lvl-1].additionsTotalOrder==="dimAdditionOrderType.2")}function getLabelIndex(e,t,i){if(!i||i.isSum||i.isFirst){for(var a=0;a<=t;a++){var n=d[e+a];if(n.text!==""){return e+a}}}else if(i.lineLvl!=undefined){return e+i.lineLvl-1}else{return e+t}}for(var u=0,p=-1;u<e.length;u++){var g=-1,h=-1,f=-1;var m=u*l;if(e[u]===null){for(var v=0;v<l;v++){var b=d[m+v];if(b.catWithoutTotal&&b.text!==""){f=v;break}}}else{for(var v=0;v<l;v++){var b=d[m+v];if(g===-1&&b.isTotal&&b.text!==""){g=v}if(h===-1&&b.isSubtotal&&b.text!==""){h=v}}p++}if(g>=0){var T=getDimNode(m+g,p);var x=isSeparatorTop(T);if(!x&&u<e.length-1||x&&u>0){var E=x?u:u+1;var y={type:"T",category:E,zIndex:312};if(t){y.dimLabelIdx=getLabelIndex(m,g,T)}s.push(y)}}if(h>=0){var T=getDimNode(m+h,p);var x=isSeparatorTop(T);if(!x&&u<e.length-1||x&&u>0){var E=x?u:u+1;var y={type:"S",category:E,zIndex:311};if(i){y.dimLabelIdx=getLabelIndex(m,h,T)}s.push(y)}}if(f>=0){var E=c?u+1:u;var y={type:"TV",category:E,zIndex:313};if(a){y.dimLabelIdx=getLabelIndex(m,f,null)}s.push(y)}}return s},getLinkGroups:function(e,t,i){var a={axis:false,legend:null};var n=e.extensionHash+"."+t;function processLG(e){if(e.linkedType===i){if(a.legend===null&&e.type==="legend"){for(var t=0;t<e.linkedCharts.length;t++){if(e.linkedCharts[t]===n){a.legend=e;break}}}else if(!a.axis&&e.type==="axis"){for(var t=0;t<e.linkedCharts.length;t++){if(e.linkedCharts[t]===n){a.axis=true;break}}}}}for(var r in e.linkGroups){processLG(e.linkGroups[r]);if(a.axis&&a.legend!==null){break}}if(e.linkGroupsMultiple){for(var o=0;o<e.linkGroupsMultiple.length;o++){processLG(e.linkGroupsMultiple[o]);if(a.axis&&a.legend!==null){break}}}return a},getLinkedContainers:function(e,t,i){var a=i?i.id:null;var n=t.extensionHash.length+1;var r=[];var o=e.linkedType==="Time"?"TimeChartModel":e.linkedType==="Structure"?"ChartModel":"TableModel";for(var l=0,s=e.linkedCharts.length;l<s;l++){var d=e.linkedCharts[l].substr(n);if(d===a){r.push(i)}else{var c=Mt["b"].Factories.ModelFactory.getModelById(t,d);if(c&&c.extendedModel&&c.extendedModel.instanceOf===o){var u=Mt["b"].DataObjects.ContextRepo.getContextByCid(c.extendedModel.contextId);u&&u.dataModel&&u.dataModel.baseNode.nodes.length&&r.push(c)}}}return r},setLowerExpressionReferencePointer:function(e,t,i,a,n,r){var o=t.instanceOf==="TimeChartModel"?"TimeWaterfallModel":"StructureWaterfallModel";var l=undefined;for(var s in e.referencePointer){for(var d=0;d<r.length;d++){var c=r[d];if(n.dataId_dim===c.dataId_dim&&s===c.dataId_expr){l=c.isStack;break}}if(n.instanceOf===o){if(l){n.referencePointer[s]=a[a.waterfallStartReference][s]}else{n.referencePointer[s]=i[s]}}else{n.referencePointer[s]=e.referencePointer[s]}}},initStackValues:function(e,t){var i={};e.length>0&&(i.waterfallStartReference=e[0].dataId_dim);var a=null;for(var n=0;n<e.length;n++){var r=e[n];if(a!==r.dataId_dim){a=r.dataId_dim;i[r.dataId_dim]={}}if(e[n].isStack===true){i[r.dataId_dim][r.dataId_expr]=e[n].value}}return i},initFirstWaterfallValues:function(e,t){var i=t.instanceOf==="TimeChartModel"?"TimeWaterfallModel":"StructureWaterfallModel";var a={},n;for(var r=0;r<e.length;r++){var o=e[r];for(var l=0;l<t.expressions.length;l++){var s=t.expressions[l].id.split(".").pop();if(a[s]===undefined){a[s]=null}if(s===o.dataId_expr){n=t.expressions[l]}}if(n.reference!==undefined&&n.reference!=="Zero"){for(var l=0;l<e.length;l++){var d=e[l];if(d.dataId_expr===n.reference&&d.dataId_dim===o.dataId_dim){if(d.active!==undefined){if(a[n.reference]===undefined){a[n.reference]=null}}break}}if(a[n.reference]===null){if(d.instanceOf===i){a[n.reference]=d.relativeValue}else{a[n.reference]=d.value}}}}return a},resortRepresentationExpressionsByReference:function(e,t){var i=[];var a=[];for(var n=0;n<e.length;n++){var r=e[n];i.push(r)}var o=0;while(a.length<t.expressions.length&&o<100){for(var n=0;n<t.expressions.length;n++){var l=t.expressions[n].id.split(".").pop();if(t.expressions[n].reference==="Axis"){t.expressions[n].reference="Zero"}var s=false;for(var d=0;d<t.expressions.length;d++){if(t.expressions[d].id.split(".").pop()===t.expressions[n].reference){s=true}}if(t.expressions[n].reference==="Zero"||s===false){if(a.indexOf(l)===-1){a.push(l)}}else{for(var d=0;d<a.length;d++){if(t.expressions[n].reference===a[d]){if(a.indexOf(l)===-1){a.push(l);break}}}}}o++}if(o>=100){q["a"].warn("Endless loop interrupted at LayoutCommon: resortRepresentationExpressionsByReference()")}a=Mt["b"].Utils.GlobalFunctions.array_unique(a);for(var d=0;d<a.length;d++){for(var n=0;n<i.length;n++){var c=n%t.expressions.length;if(i[n].dataId_expr===a[d]){i.splice(n-c+d,0,i[n]);i.splice(n+1,1)}}}return i},setReferencePointer:function(e,t,i){var a=this.resortRepresentationExpressionsByReference(e,i);var n=this.initFirstWaterfallValues(t,i);var r=this.initStackValues(a,i);for(var o=0;o<a.length;o++){var l=a[o];if(i.instanceOf==="TableModel"&&l.instanceOf==="InlineModel"){continue}l.referencePointer={};if(i.instanceOf==="TimeChartModel"){var s="timeRepresentationType.0";var d="TimeWaterfallModel"}else if(i.instanceOf==="ChartModel"){var s="structureRepresentationType.0";var d="StructureWaterfallModel"}for(var c=0;c<i.expressions.length;c++){if(i.expressions[c].id.split(".").pop()===l.dataId_expr){var u=i.expressions[c];break}}if(u.isStack&&i.stackMode&&i.stackType==="%"){continue}if(u&&u.representation!==s){if(u.reference!==undefined&&u.reference!=="Zero"){for(var c=0;c<t.length;c++){var p=t[c];if(p.dataId_expr===u.reference&&p.dataId_dim===l.dataId_dim){break}}if(p.isOutlier===true){continue}if(p.isStack===false){var g=undefined;if(l.instanceOf===d){if(n[u.reference]!==null){g=n[u.reference]}}else if(p.instanceOf!==d){g=p.value}else if(p.instanceOf===d){g=p.relativeValue}l.referencePointer[u.reference]=g}else{var h=l.instanceOf===d?r.waterfallStartReference:l.dataId_dim;for(var f in r[h]){l.referencePointer[f]=r[h][f]}}this.setLowerExpressionReferencePointer(p,i,n,r,l,a)}}}},cumulateReferencePointer:function(e,t){for(var i=0;i<e.length;i++){var a=e[i];if(t.instanceOf==="TableModel"&&a.instanceOf==="InlineModel"){continue}var n=0;if(a.referencePointer&&Object.keys(a.referencePointer).length){for(var r in a.referencePointer){n+=a.referencePointer[r]}a.referencePointerSum=n}else{a.referencePointerSum=0}}},cumulateReferencePointerByRepFactor:function(e,t,i){if(e.referencePointer&&Object.keys(e.referencePointer).length){var a=0;for(var n in e.referencePointer){if(i.instanceOf==="TimeChartModel"){a+=parseInt(e.referencePointer[n]*t)}else{a+=Math.round(e.referencePointer[n]*t)}}return a}else{return 0}},getTimeTextDimensions:function(e,t){var i=e.font.fWeight+" "+e.font.fSize+"px "+e.font.fType;var a={width:0,height:0},n={width:0,height:0},r={width:0,height:0};var o=Mt["b"].Utils.Constants.TypeValues.indicator;var l=0;var s=0;var d=0;var c=0;if(e.absolute.legend!==o.NONE){if(t){a=t.measureTextDim(e.absolute.text,i)}else{a=e.absolute.dimension}l+=a.height;if(e.absolute.legend===o.START){s=Math.max(s,a.width)}else if(e.absolute.legend===o.MID){d=Math.max(d,a.width)}else if(e.absolute.legend===o.END){c=Math.max(c,a.width)}}if(e.percent.legend!==o.NONE){if(t){n=t.measureTextDim(e.percent.text,i)}else{n=e.percent.dimension}l+=n.height;if(e.percent.legend===o.START){s=Math.max(s,n.width)}else if(e.percent.legend===o.MID){d=Math.max(d,n.width)}else if(e.percent.legend===o.END){c=Math.max(c,n.width)}}if(e.text.legend!==o.NONE&&e.text.text!==""){if(t){r=t.measureTextDim(e.text.text,i)}else{r=e.text.dimension}if(r.height===0){l+=e.font.fSize}else{l+=r.height}if(e.text.legend===o.START){s=Math.max(s,r.width)}else if(e.text.legend===o.MID){d=Math.max(d,r.width)}else if(e.text.legend===o.END){c=Math.max(c,r.width)}}return{absDim:a,percDim:n,textDim:r,left:s,mid:d,right:c,maxHeight:l}},parseCompareVariable:function(e,t){var i=null;if(isNaN(t)){var a=ge["a"];var n={};e.addQvVariables(n,false);i=a.resolveVariables(e,e.encode(t),n,null,null,false)}else{i=parseFloat(t)}if(isNaN(i)){return Number.NaN}return i-1},getPreviousStackElement:function(e,t){var i=e;var a=i.getModel().id.split(".")[2];if(i.getModel().stackOrder===0){return Mt["b"].Utils.Constants.TypeValues.indicator.AXIS}for(var n=0;n<t.length;n++){var r=t[n];var o=r.getModel().id.split(".")[2];if(a===o&&i.getModel().stackOrder>r.getModel().stackOrder){i=r;break}}return i},setCompareMetaInformation:function(e,t,i,a,n,r){for(var o=0;o<e.length;o++){var l=e[o].getModel?e[o].getModel():e[o];Mt["b"].Layout.Common.setCompareBasicMetaInformation(l,t,i,a,r);Mt["b"].Layout.Common.setIsHighlighted(n,l,Mt["b"].Utils.Constants.TypeValues.highlightType.COMPARE)}},setCompareBasicMetaInformation:function(e,t,i,a,n){var r=Mt["b"].DataObjects.RuntimeDO;var o=Mt["b"].Utils.Constants.TypeValues.indicator;var l=Mt["b"].Utils.Constants.TypeValues.shape;e.font={fSize:i,fType:r.getParameter("FONT_FAMILY"),fWeight:r.getParameter("FONT_STYLE_CHART")};var s=0;var d=e.compareStyle===o.NOTATION?r.getParameter("COMPARE_DEFAULT_TYPE"):e.compareStyle;if(d===o.PIN){e.compareConnector=r.getParameter("CONNECTOR_PIN_HEAD");s=a("MMPT_HIGHLIGHT_PIN_SIZE")}else{e.compareConnector=r.getParameter("CONNECTOR_ARROW_HEAD");s=r.getParameterParsed("FACTOR_HIGHLIGHT_ARROW_HEAD")*a("MMPT_HIGHLIGHT_ARROW_SIZE")}if(e.compareConnector===l.CIRCLE){e.compareConnectorColor=r.getParameter("CON_CIRCLE_COLOR");e.compareConnectorSize=a("MMPT_CIRCLE_AREA_SIZE");e.compareConnectorBorderColor=r.getParameter("CON_CIRCLE_BORDER_COLOR");e.compareConnectorBorderSize=a("MMPT_CIRCLE_BORDER_SIZE")}else if(e.compareConnector===l.TRIANGLE){e.compareConnectorColor=r.getParameter("CON_TRIANGLE_COLOR");e.compareConnectorSize=a("MMPT_TRIANGLE_AREA_SIZE");e.compareConnectorBorderColor=r.getParameter("CON_TRIANGLE_BORDER_COLOR");e.compareConnectorBorderSize=a("MMPT_TRIANGLE_BORDER_SIZE")}else{e.compareConnectorColor=null;e.compareConnectorSize=0;e.compareConnectorBorderColor=null;e.compareConnectorBorderSize=0}e.allowDragging=e.compareLegend!==o.END&&e.compareLegend!==o.START;e.displacement=0;var c=e.displayOffset;if(c==="Notation"){if(e.compareLegend===o.START){c=r.getParameterParsed("MMPT_OFFSET_LEGEND_START")}else if(e.compareLegend===o.END){c=r.getParameterParsed("MMPT_OFFSET_LEGEND_END")}else{c=r.getParameterParsed("MMPT_OFFSET_IN_CHART")}}else{c=parseFloat(c)/10}if(t){e.dimension.height=s;e.offset.y=n(c)}else{e.dimension.width=s;e.offset.x=n(c)}},getCompareToAndFrom:function(a,e,n,t){var i=null;var r=null;var o=e.extendedModel;if(a.from==="axis"||a.fromAbsolutePosition==="axis"||a.compareFromCat==="axis"){i="axis"}if(a.to==="axis"||a.toAbsolutePosition==="axis"||a.compareToCat==="axis"){r="axis"}function isRepSource(e){var t;if(a.compareFromPos==="position"){a.fromAbsolutePosition.groupIndex=Mt["b"].Layout.Common.parseCompareVariable(n,a.positionFromInput);t=e.absolutePosition.groupIndex==a.fromAbsolutePosition.groupIndex&&e.absolutePosition.positionInGroup==a.fromAbsolutePosition.positionInGroup}else{var i=Mt["b"].Layout.Common.decodeCompareVariable(a.from,n);t=e.dataId_dim+"#"+e.dataId_expr===i}return t&&!e.isNaN&&e.valueType!=="FACTOR_NONE"}function isRepTarget(e){var t;if(a.compareToPos==="position"){a.toAbsolutePosition.groupIndex=Mt["b"].Layout.Common.parseCompareVariable(n,a.positionToInput);t=e.absolutePosition.groupIndex==a.toAbsolutePosition.groupIndex&&e.absolutePosition.positionInGroup==a.toAbsolutePosition.positionInGroup}else{var i=Mt["b"].Layout.Common.decodeCompareVariable(a.to,n);t=e.dataId_dim+"#"+e.dataId_expr===i}return t&&!e.isNaN&&e.valueType!=="FACTOR_NONE"}if(t!==undefined){for(var l=0;l<t.length;l++){var s=t[l].getModel();var d=Mt["b"].Models.Actions.ExtendedModelActions.AnyChartModel.getExpressionByShortId(o,s.dataId_expr);if(Mt["b"].Models.Actions.ExtendedModelActions.ChartExpressionModel.isExpressionValue(d)){continue}if(!r&&isRepTarget(s)){r=s}if(!i&&isRepSource(s)){i=s}if(i&&r){break}}}else{for(var l=0;l<e.children.length;l++){var s=e.children[l];if(s.instanceOf!=="BarModel"&&s.instanceOf!=="TimeColumnModel"&&s.instanceOf!=="RodModel"&&s.instanceOf!=="NeedleModel"&&s.instanceOf.indexOf("eLineModel")===-1&&s.instanceOf.indexOf("WaterfallModel")===-1){continue}var d=Mt["b"].Models.Actions.ExtendedModelActions.AnyChartModel.getExpressionByShortId(o,s.dataId_expr);if(Mt["b"].Models.Actions.ExtendedModelActions.ChartExpressionModel.isExpressionValue(d)){continue}if(!r&&isRepTarget(s)){r=s}if(!i&&isRepSource(s)){i=s}if(i&&r){break}}}if(r&&r!=="axis"){a.positionToInput=(r.absolutePosition.groupIndex+1).toString();a.to=r.dataId_dim+"#"+r.dataId_expr}else if(r==="axis"&&a.to===""&&i!=="axis"&&a.from!==""){a.to=a.from}if(i&&i!=="axis"){a.positionFromInput=(i.absolutePosition.groupIndex+1).toString();a.from=i.dataId_dim+"#"+i.dataId_expr}else if(i==="axis"&&a.from===""&&r!=="axis"&&a.to!==""){a.from=a.to}return{compareFrom:i,compareTo:r}},decodeCompareVariable:function(e,t){var i=e.split("#");var a=i[1];var n=i[0].split("@");var r=[];var o=ge["a"];var l={};t.addQvVariables(l,false);for(var s=0;s<n.length;s++){var d=n[s];if(d[0]==="$"&&d[1]==="("&&d[d.length-1]===")"){d=o.resolveVariables(t,t.encode(d),l,null,null,false)}r.push(d)}r=r.join("@");r=r+"#"+a;return r},getLastStackElement:function(e,t){var i;var a;var n=-1;var r=-1;for(var o=0;o<e.length;o++){if(e[o].isStack){if(e[o].dataId_dim===t){if(e[o].value>=0&&e[o].stackOrder>n&&e[o].isNaN===false){i=e[o];n=e[o].stackOrder}if(e[o].value<0&&e[o].stackOrder>r&&e[o].isNaN===false){a=e[o];r=e[o].stackOrder}}}}return{pos:i,neg:a}},setIsHighlighted:function(e,t,i,a){var n=ge["a"];var r=Mt["b"].Utils.Constants.TypeValues.highlightType;var o=Mt["b"].Utils.Constants.TypeValues.indicator;var l=Mt["b"].DataObjects.ContextRepo.getContextByCid(e.contextId);var s=new Mt["b"].Utils.Calculator(l);s.setCondenseRoot(l.dataModel.baseNode);if(l.dataModel.dimSize===1){s.setCondenseLevel(1)}else{s.setCondenseLevel(0)}for(var d=0;d<e.highlights.length;d++){var c=e.highlights[d];if(c.type!==i){continue}var u;if(t.dataId_expr){u=Mt["b"].Models.Actions.ModelActions.ContextModel.getExpressionByShortId(l,t.dataId_expr)}var p=s.setupHighlightFormulas(c,t,u,a);if(!p){if(i===r.COMPARE){t.text.isHighlighted=false;t.absolute.isHighlighted=false;t.percent.isHighlighted=false}return false}switch(i){case r.VALUE:var g=u.id;if(t.instanceOf==="LabelModel"){if(t.id.split(".").pop()==="pos"||t.id.split(".").pop()==="neg"){var h=o.STACK;g="#"+t.id.split(".").pop()+"#"}else{var h=o.LABEL}}else{var h=o.ELEMENT}if(c.value.category===o.TEXT){var f=c.value.path.split("@");for(var m=0;m<f.length;m++){if(f[m][0]==="$"&&f[m][1]==="("&&f[m][f[m].length-1]===")"){var v={};s.addQvVariables(v,false);f[m]=n.resolveVariables(s,f[m],v,null,null,false)}}f=f.join("@");if(f+"#"+c.value.keyfigure===t.dataId_dim+"#"+g&&h===c.value.type){c.active=true;return true}}else{var a=c.value.position;if(a[0]==="$"&&a[1]==="("&&a[a.length-1]===")"){var v={};s.addQvVariables(v,false);a=n.resolveVariables(s,a,v,null,null,false)}var b=parseInt(t.id.split(".").pop());var T=parseInt(t.id.split(".")[2]);if(t.isStack&&h===o.LABEL){T=parseInt(t.id.split(".")[3])}if(t.isStackSum&&h===o.STACK){T=parseInt(t.id.split(".")[3]);b="#"+t.id.split(".").pop()+"#"}if(parseInt(a)-1===T&&c.value.inGroup===b&&h===c.value.type){c.active=true;return true}}break;case r.COMPARE:if(c.compare.id===t.id){t.percent.isHighlighted=c.compare.element.percent;t.absolute.isHighlighted=c.compare.element.absolute;t.text.isHighlighted=c.compare.element.text;if(t.text.isHighlighted||t.absolute.isHighlighted||t.percent.isHighlighted){c.active=true;return true}}break;case r.LEGEND:if(t.dataId_expr===c.legend.keyfigure.split(".").pop()){c.active=true;return true}break;case r.CATEGORY_LABEL:if(c.categoryLabel.category===o.TEXT){var f=c.categoryLabel.path.split("@");for(var m=0;m<f.length;m++){if(f[m][0]==="$"&&f[m][1]==="("&&f[m][f[m].length-1]===")"){var v={};s.addQvVariables(v,false);f[m]=n.resolveVariables(s,f[m],v,null,null,false)}}f=f.join("@");if(f===t.dataId_dim&&t.text!==""){var x=c.categoryLabel.elements.split("@");for(var m=0;m<x.length;m++){if(x[m]===t.text){c.active=true;return true}}}}else{var a=c.categoryLabel.position;if(a[0]==="$"&&a[1]==="("&&a[a.length-1]===")"){var v={};s.addQvVariables(v,false);a=n.resolveVariables(s,a,v,null,null,false)}var E=parseInt(t.id.split(".")[1].match(/\d+/g));if(parseInt(a)-1===E){var x=c.categoryLabel.elements.split("@");for(var m=0;m<x.length;m++){if(x[m]===t.text){c.active=true;return true}}}}}}return false},getHighlight:function(e,t,i,a){var n=Mt["b"].Utils.Constants.TypeValues.highlightType;var r=Mt["b"].Utils.Constants.TypeValues.indicator;if(a){var o=new Mt["b"].Utils.Calculator(null);var l=ge["a"]}for(var s=0;s<e.highlights.length;s++){var d=e.highlights[s];if(d.type!==i||d.active===false){continue}switch(i){case n.VALUE:var c=Mt["b"].DataObjects.ContextRepo.getContextByCid(e.contextId);var u=Mt["b"].Models.Actions.ModelActions.ContextModel.getExpressionByShortId(c,t.dataId_expr).id;if(t.instanceOf==="LabelModel"){if(t.id.split(".").pop()==="pos"||t.id.split(".").pop()==="neg"){var p=r.STACK;u="#"+t.id.split(".").pop()+"#"}else{var p=r.LABEL}}else{var p=r.ELEMENT}if(d.value.category===r.TEXT){var g=d.value.path.split("@");for(var h=0;h<g.length;h++){if(g[h][0]==="$"&&g[h][1]==="("&&g[h][g[h].length-1]===")"){var f={};o.addQvVariables(f,false);g[h]=l.resolveVariables(o,g[h],f,null,null,false)}}g=g.join("@");if(g+"#"+d.value.keyfigure===t.dataId_dim+"#"+u&&p===d.value.type){return{highlight:d,index:s}}}else{var m=d.value.position;if(m[0]==="$"&&m[1]==="("&&m[m.length-1]===")"){var f={};o.addQvVariables(f,false);m=l.resolveVariables(o,m,f,null,null,false)}var v=parseInt(t.id.split(".")[2]);var b=parseInt(t.id.split(".").pop());if(t.isStack&&p===r.LABEL){v=parseInt(t.id.split(".")[3])}if(t.isStackSum&&p===r.STACK){v=parseInt(t.id.split(".")[3]);b="#"+t.id.split(".").pop()+"#"}if(parseInt(m)-1===v&&d.value.inGroup===b&&p===d.value.type){return{highlight:d,index:s}}}break;case n.COMPARE:if(d.compare.id===t.id){return{highlight:d,index:s}}break;case n.CATEGORY_LABEL:if(d.categoryLabel.category===r.TEXT){var g=d.categoryLabel.path.split("@");for(var h=0;h<g.length;h++){if(g[h][0]==="$"&&g[h][1]==="("&&g[h][g[h].length-1]===")"){var f={};o.addQvVariables(f,false);g[h]=l.resolveVariables(o,g[h],f,null,null,false)}}g=g.join("@");if(g===t.dataId_dim&&t.text!==""){return{highlight:d,index:s}}}else{var m=d.categoryLabel.position;if(m[0]==="$"&&m[1]==="("&&m[m.length-1]===")"){var f={};o.addQvVariables(f,false);m=l.resolveVariables(o,m,f,null,null,false)}var T=parseInt(t.id.split(".")[1].match(/\d+/g));if(parseInt(m)-1===T){return{highlight:d,index:s}}}break;case n.LEGEND:if(t.dataId_expr===d.legend.keyfigure.split(".").pop()){return{highlight:d,index:s}}break}}return null},clearHighlights:function(e){for(var t=0;t<e.highlights.length;t++){e.highlights[t].active=false}},getMaxPosition:function(e,t,i){var a=e.position.x;var n=e.position.x+e.dimension.width;var r=e.position.y;var o=e.position.y+e.dimension.height;var l=Mt["b"].Utils.Constants.TypeValues.indicator;if(e.absolute.legend!==l.NONE){a=Math.min(e.absolute.position.x,a);n=Math.max(e.absolute.position.x+e.absolute.dimension.width,n);r=Math.min(e.absolute.position.y,r);o=Math.max(e.absolute.position.y+e.absolute.dimension.height,o)}if(e.percent.legend!==l.NONE){a=Math.min(e.percent.position.x,a);n=Math.max(e.percent.position.x+e.percent.dimension.width,n);r=Math.min(e.percent.position.y,r);o=Math.max(e.percent.position.y+e.percent.dimension.height,o)}if(e.text.legend!==l.NONE&&e.text.text!==""){a=Math.min(e.text.position.x,a);n=Math.max(e.text.position.x+e.text.dimension.width,n);r=Math.min(e.text.position.y,r);o=Math.max(e.text.position.y+e.text.dimension.height,o)}if(t&&e.ellipse){var s=Mt["b"].DataObjects.RuntimeDO.getParameter("FACTOR_HIGHLIGHT_ELLIPSE_HEIGHT");var d=i("MMPT_HIGHLIGHT_ELLIPSE_STROKE_WIDTH");if(e.type==="time"){for(var c=0;c<e.ellipseArray.length;c++){a=Math.min(e.ellipseArray[c].x-e.ellipseArray[c].width/2-d,a);n=Math.max(e.ellipseArray[c].x+e.ellipseArray[c].width/2+2*d,n);r=Math.min(e.ellipseArray[c].y-e.ellipseArray[c].height*s/2-d-1,r);o=Math.max(e.ellipseArray[c].y+e.ellipseArray[c].height*s/2+d+1,o)}}else{a=Math.min(e.ellipseArray.x-e.ellipseArray.width/2,a);n=Math.max(e.ellipseArray.x+e.ellipseArray.width/2,n);r=Math.min(e.ellipseArray.y-e.ellipseArray.height*s/2-d-1,r);o=Math.max(e.ellipseArray.y+e.ellipseArray.height*s/2+d+1,o)}}var u=n-a;var p=o-r;return{position:{x:a,y:r},dimension:{width:u,height:p}}},layoutClickBackground:function(e,t){var i=32;var a=5;var n=5;var r=Mt["b"].DataObjects.RuntimeDO;var o=Mt["b"].Utils.Calculator.Converter.pt2pix(r.getParameterParsed("FONT_SIZE_CHART"));var l="normal "+o+"px '"+r.getParameter("FONT_FAMILY")+"'";if(e.text==="Click"||e.text===r.getTranslation("CLICK")||e.text==="Click for Context"||e.text===""&&(e.color==="rgb(13, 171, 213)"||e.color==="rgb(156,158,159)")){if(Mt["b"].DataObjects.DocumentDO.preventLeftClickAndActions()){e.image1=null;e.text1=""}else{e.image1=pe["a"].imgPath+"mouse_left_click.png";e.text1=r.getTranslation("TO_DEFINE_CELL_CONTENT")}e.image2=pe["a"].imgPath+"mouse_right_click.png";e.text2=r.getTranslation("FOR_MORE_OPTIONS")}var s=t.measureTextDim(e.text1,l);var d=t.measureTextDim(e.text2,l);var c=i+a+Math.max(s.width,d.width);if(c>e.dimension.width){c=i;a=0;e.text1=null;e.text2=null;s={height:0,width:0};d={height:0,width:0}}var u=Math.max(i,s.height)+n+Math.max(i,d.height);if(u>e.dimension.height||c>e.dimension.width){delete e.image1;delete e.image2;e.text1=null;e.text2=null}else{var p=e.position.x+Math.round((e.dimension.width-c)/2);var g=p+i+a;var h=e.position.y+Math.round((e.dimension.height-u)/2);var f=!Mt["b"].DataObjects.DocumentDO.preventLeftClickAndActions()?h+i+n:(e.dimension.height-u)/2;var m=0,v=0;if(s.height>i){m=Math.round((s.height-i)/2)}else if(s.height<i){v=Math.round((i-s.height)/2)}e.image1Dim={height:i,width:i};e.image2Dim={height:i,width:i};e.image1Pos={x:p,y:h+m};e.image2Pos={x:p,y:f+m};e.text1Dim=s;e.text2Dim=d;e.text1Pos={x:g,y:h+v};e.text2Pos={x:g,y:f+v}}},extractLinkedChartIds:function(e,t){var i=e.map(function(e){return e.split(".")[1]});return t?i.filter(function(e){return e!==t}):i}};var _=i(578);var L=i(146);Mt["b"].Factories=Mt["b"].Factories||{};Mt["b"].Factories.UIFactory={createDialog:function(e,t,i,a){if(a===void 0){a={}}a=H["a"]({width:"100%",maxwidth:"400px",minwidth:"200px",modal:true,draggable:false,center:true,resizable:false,className:""},a);var n=createOverlay(a.modal),r=createWindow(),o=createHeader(e),l=createBody(t),s=createFooter(i,n);r.appendChild(o);r.appendChild(l);r.appendChild(s);n.appendChild(r);document.body.appendChild(n);r.classList.add(a.center?"center":"nocenter");if(a.center){var d=r.getBoundingClientRect();r.style.marginTop="-"+d.height/2+"px";r.style.marginLeft="-"+d.width/2+"px"}return n;function createWindow(){var e=document.createElement("div");e.className="lui-dialog "+a.className;e.style.width=a.width;e.style.maxWidth=a.maxwidth;e.style.minWidth=a.minwidth;e.style.boxShadow="none";if(a.draggable){Mt["b"].$(e).draggable({handle:".lui-dialog__header, .lui-dialog__footer"})}if(Mt["b"].Factories.UIFactory.isIE(9)){e.style.top="50%";e.style.msTransform="translate(0, -50%"}return e}function createOverlay(e){var t=document.createElement("div");t.className="HiCo hico-lui hico-fa hicoDialog ui-widget";t.style.position="absolute";!e&&(t.style.pointerEvents="none");if(Mt["b"].Factories.UIFactory.isIE(10)||Mt["b"].Factories.UIFactory.isIE(11)){t.style.alignItems="center"}if(document.getElementsByClassName("lui-modal-background").length===0&&a.modal){var i=document.createElement("div");i.className="lui-modal-background";t.appendChild(i)}return t}function createHeader(e){var t=document.createElement("div");t.className="lui-dialog__header";var i=document.createElement("div");i.className="lui-dialog__title";i.innerHTML=e;t.appendChild(i);return t}function createBody(e){var t=document.createElement("div");t.className="lui-dialog__body";if(typeof e==="string"){t.innerHTML=e}else if(typeof e==="object"){t.appendChild(e)}return t}function createFooter(e,t){var i=document.createElement("div");i.className="lui-dialog__footer";if(e===undefined){i.appendChild(createDefaultOkButton(t))}else{e.forEach(function(e){if(e){i.appendChild(createButton(e.text,e.handler,t))}})}return i}function createButton(e,t,i){var a=L["a"].createButton(e).htmlnode;Mt["b"].$(a).click({target:i},t);return a}function createDefaultOkButton(e){return createButton("OK",function(){Mt["b"].$(e).remove()},e)}},isIE:function(e){var t=navigator.userAgent.toLowerCase();if(e<11){return t.indexOf("msie")!==-1?parseInt(t.split("msie")[1])===e:false}else if(e===11){return t.indexOf("rv:11.0")!==-1}return false}};Mt["b"].Factories.DialogFactory={createConfirmationDialog:function(e,t,i,a){var n=function(e){Mt["b"].$(e.data.target).remove()},r=i?{text:Mt["b"].Utils.Translations.getTranslation("CONFIRM_YES"),handler:typeof i==="function"?i:n}:undefined,o=a?{text:Mt["b"].Utils.Translations.getTranslation("CANCEL"),handler:typeof a==="function"?a:n}:undefined;var l=[];r&&l.push(r);o&&l.push(o);Mt["b"].Factories.UIFactory.createDialog(e,t,l)},createMissingVariableDialog:function(e){var t=Mt["b"].Utils.Translations.getTranslation("VARIABLE_MISSING_TITLE");var i=Mt["b"].Utils.Translations.getTranslation("VARIABLE_MISSING_BODY",e);Mt["b"].Factories.UIFactory.createDialog(t,i)},createMissingKeyDialog:function(e,t,i){var a=Mt["b"].Utils.Translations.getTranslation("KEY_MISSING_TITLE",t);var n=Mt["b"].Utils.Translations.getTranslation("KEY_MISSING_BODY",e,i);Mt["b"].Factories.UIFactory.createDialog(a,n)},createMissingFieldDialog:function(){var e=Mt["b"].Utils.Translations.getTranslation("FIELD_MISSING_TITLE");var t=Mt["b"].Utils.Translations.getTranslation("FIELD_MISSING_BODY");Mt["b"].Factories.UIFactory.createDialog(e,t)},createDuplicateChartNameDialog:function(){var e=Mt["b"].Utils.Translations.getTranslation("DUPLICATE_CHARTNAME_TITLE");var t=Mt["b"].Utils.Translations.getTranslation("DUPLICATE_CHARTNAME_BODY");Mt["b"].Factories.UIFactory.createDialog(e,t)},createDuplicateEntriesDialog:function(){var e=Mt["b"].Utils.Translations.getTranslation("DUPLICATE_ENTRIE_TITLE");var t=Mt["b"].Utils.Translations.getTranslation("DUPLICATE_ENTRIE_BODY");Mt["b"].Factories.UIFactory.createDialog(e,t)},createDiffNotationManualNotificationDialog:function(e,t,i){var a=Mt["b"].Utils.Translations.getTranslation;var n=a("NOTATION_MANUAL_DIFFERS");var r=typeof t==="string"?t:""+"<h4>"+a("ATTENTION")+"</h4>"+"<p>"+a("NOTATION_MANUAL_DIFFERS_OVERWRITE_CENTRAL_MESSAGE")+"</p>"+"<p>"+a("NOTATION_MANUAL_DIFFERS_OVERWRITE_WARNING")+"</p>";r+='<hr/> <div class="row">';for(var o=0;o<e.length;o++){r+=""+'<fieldset style="width: 46%; margin: 0 2%; box-sizing: border-box; padding: 5px; float: left">'+'\t\t<legend style="padding: 0 10px">'+e[o].legend+"</legend>"+"\t\t<div><b>"+a("CHANGED_AT")+":</b> "+e[o].date+"</div>"+"\t\t<div><b>"+a("CHANGED_BY")+":</b> "+e[o].user+"</div>"+"</fieldset>"}r+="</div>";var l=[{text:a("OK"),handler:function(e){Mt["b"].$(e.data.target).remove();i&&i()}}];Mt["b"].Factories.UIFactory.createDialog(n,r,l,{maxwidth:"550px"})}};Mt["b"].Utils.ExpressionParser=new function(){var d=this;var n="[^$.|?*+(){}";var C=5;var v=5;var S=7;var m=4;var i="tclt:";var a="tccm:";var r="tcfl:";var M="tc;;";var O="tc$$";var p="tc§#";var g="tc§§";var A="tc##";var b=";;";var T="";var _="";var x="";var E=[];setupDefinitionCheckRegex();d.getType=function(e){var t=getTypeInternal(e);if(t!==null){return t.type}else{return null}};d.parseInlineCommentQVExpression=function(e,t,i,a,n){var r=getTypeInternal(e);if(r===null){r={type:t.representation}}switch(r.type){case Mt["b"].Utils.Constants.TypeValues.tableRepresentation.LIST:return parseList(e,t,i.extendedModel);case Mt["b"].Utils.Constants.TypeValues.tableRepresentation.COMMENT:return parseComment(e,t,i,a,n);case Mt["b"].Utils.Constants.TypeValues.tableRepresentation.FLAG:return parseFlag(e,t,i.extendedModel)}return null};d.getDefaultValue=function(e){var t=e.indexOf(M);return getDefaultValueInternal(e,t)};d.getOverwrite=function(e){var t=getTypeInternal(e);if(t==null){return null}var i=e.indexOf(M);var a=e.substring(C,i);return getCharBooleanValue(a,t.parmLen)};d.fillKeyColumns=function(e,t){var i=getKeyColumns(e);t.input.keyColumns=JSON.parse(JSON.stringify(i))};function getKeyColumns(e){var t=[];for(var i=0,a=e.rows.length;i<a;i++){t.push({id:e.rows[i].id,name:e.rows[i].name,hide:false})}return t}d.getCopyData=function(e,t){if(!e||typeof e!=="string"||!t){return null}var i=e.indexOf(A)>0?A:O;var a=e.substring(e.indexOf(i)+i.length).split(b);var n=null,r=null,o=null;if(a.length===2){o=parseInt(a[0].replace("K",""))-1;r=parseInt(a[1].replace("K",""))-1}else if(a.length===3){n=parseInt(a[0].replace("C",""))-1;o=parseInt(a[1].replace("K",""))-1;r=parseInt(a[2].replace("K",""))-1}else{return null}if(typeof o!=="number"||o<0||typeof r!=="number"||r<0){K["a"].warning('No valid "copy" or "value" definition found',e);return null}var l=t.alternativeCharts||t.charts;var s=null,d=null;for(var c=0;c<l.length;c++){if(!l[c]){continue}var u=l[c].model;if(u.instanceOf==="TableModel"&&u.contextId===t.extendedModel.contextId){if(n!==null&&c===n||n===null){var p=u.expressions;var g=p[o];var h=p[r];var f=void 0,m=void 0;if(g){f=g.saveName||g.id.split(".").pop().replace("expr","");s=u}if(h){m=h.saveName||h.id.split(".").pop().replace("expr","");d=u}if(f&&m){return{copyChartModel:s,copyExpression:g,copySaveName:f,valueChartModel:d,valueExpression:h,valueSaveName:m}}}}}return null};function parseCopy(e,t,i,a){var n=d.getCopyData(e,t);if(n!==null){var r=n.copyExpression;var o=n.valueExpression;var l=null;if(r.commonTable){l=Mt["b"].DataObjects.InlineCommentRepo.getSingleCommonComment(r.commonTable,a.dataId_dim,r.representation,n.copyChartModel,n.copySaveName,r.addKeyVariable,true)}else{l=Mt["b"].DataObjects.InlineCommentRepo.getSingleComment(i,a.dataId_dim,r.representation,n.copyChartModel,n.copySaveName,r.addKeyVariable)}if(l&&(l.value==="true"||l.value===true)){var s=null;if(o.commonTable){s=Mt["b"].DataObjects.InlineCommentRepo.getSingleCommonComment(o.commonTable,a.dataId_dim,o.representation,n.valueChartModel,n.valueSaveName,o.addKeyVariable,true)}else{s=Mt["b"].DataObjects.InlineCommentRepo.getSingleComment(i,a.dataId_dim,o.representation,n.valueChartModel,n.valueSaveName,o.addKeyVariable)}if(s){return s.value}}}return null}function parseComment(e,t,i,a,n){var r=e.indexOf(M);var o=e.substring(C,r);var l=r-C;var s=getExpressionDefaults(t,i.extendedModel);var d=s.visible;var c=s.edit;var u=s.mandatory;var p=s.number===1;var g=s.number===2;var h=false;var f=true;var m=s.overwrite;var v=null;var b="";var T=s.transport;var x=Mt["b"].DataObjects.RuntimeDO.getTranslation("ENTER_COMMENT");if(checkWithRegex(e,_)===true){for(var E=0;E<S;E++){var y=null;if(E>=l){}else{y=o.charAt(E)}d=parseFunction(d,E,0,y,s.visible,getCharBooleanValue);c=parseFunction(c,E,1,y,s.edit,getCharBooleanValue);u=parseFunction(u,E,2,y,s.mandatory,getCharBooleanValue);f=parseFunction(f,E,3,y,s.release,getCharBooleanValue);m=parseFunction(m,E,4,y,s.overwrite,getCharBooleanValue);v=parseFunction(v,E,5,y,s.number,getCharNumberValue);if(v!==null){p=v===1;g=v===2}h=parseFunction(h,E,6,y,false,getCharBooleanValue);if(h){b=parseCopy(e,i,a,n)}}if(e.indexOf(A)>e.indexOf(O)){x=e.substring(e.indexOf(O)+O.length,e.indexOf(A))}if(!b){b=getDefaultValueInternal(e,r);if(b===""){b=null}}}return{visible:d,edit:c,mandatory:u,number:p,isDate:g,value:b,transport:T,release:f,overwrite:m,maxLength:s.maxLength,listContent:undefined,type:Mt["b"].Utils.Constants.TypeValues.tableRepresentation.COMMENT,saveName:s.saveName,placeholderText:x}}function parseList(e,t,i){var a=e.indexOf(M);var n=e.substring(C,a);var r=a-C;var o=getExpressionDefaults(t,i);var l=o.visible;var s=o.edit;var d=o.mandatory;var c=true;var u=o.overwrite;var p=o.listContent;var g=o.listContentDefault;var h=o.transport;if(checkWithRegex(e,T)===true){for(var f=0;f<v;f++){var m=null;if(f>=r){}else{m=n.charAt(f)}l=parseFunction(l,f,0,m,o.visible,getCharBooleanValue);s=parseFunction(s,f,1,m,o.edit,getCharBooleanValue);d=parseFunction(d,f,2,m,o.mandatory,getCharBooleanValue);c=parseFunction(c,f,3,m,o.release,getCharBooleanValue);u=parseFunction(u,f,4,m,o.overwrite,getCharBooleanValue)}g=getDefaultValueInternal(e,a);if(o.listContentDefault!==null&&o.listContentDefault!=="choose"){g=o.listContentDefault}if(e!==0&&E[e]!=undefined){p=E[e]}else{p=parseInlineCommentListEntries(e,o.listContent,t.name);if(e!==0){E[e]=p}}}else{}return{visible:l,edit:s,mandatory:d,number:null,isDate:null,value:g,transport:h,release:c,overwrite:u,listContent:p,maxLength:0,type:Mt["b"].Utils.Constants.TypeValues.tableRepresentation.LIST,saveName:o.saveName}}function parseFlag(e,t,i){var a=e.indexOf(M);var n=e.substring(C,a);var r=a-C;var o=getExpressionDefaults(t,i);var l=o.visible;var s=o.edit;var d=true;var c=o.overwrite;var u="";var p=o.transport;var g=o.mandatory;if(checkWithRegex(e,x)===true){for(var h=0;h<m;h++){var f=null;if(h>=r){}else{f=n.charAt(h)}l=parseFunction(l,h,0,f,o.visible,getCharBooleanValue);s=parseFunction(s,h,1,f,o.edit,getCharBooleanValue);g=parseFunction(g,h,2,f,o.mandatory,getCharBooleanValue);d=parseFunction(d,h,3,f,o.release,getCharBooleanValue);c=parseFunction(c,h,4,f,o.overwrite,getCharBooleanValue)}u=getDefaultValueInternal(e,a);u=u==="true"||u==="1"}else{}return{visible:l,edit:s,mandatory:g,number:null,isDate:null,listContent:undefined,value:u,transport:p,release:d,overwrite:c,maxLength:0,type:Mt["b"].Utils.Constants.TypeValues.tableRepresentation.FLAG,saveName:o.saveName}}function parseFunction(e,t,i,a,n,r){var o=e;if(t===i){if(a!==null){o=r(a)}else{o=n}}return o}function getExpressionDefaults(e,t){var i={visible:true,edit:true,mandatory:true,number:0,release:true,overwrite:false,saveName:"",listContent:[],listContentDefault:"choose",maxLength:0,transport:Mt["b"].Utils.Constants.TypeValues.transport.BACKEND};i.listContent.push({description:Mt["b"].DataObjects.RuntimeDO.getTranslation("CHOOSE"),key:"choose",originalDescription:Mt["b"].DataObjects.RuntimeDO.getTranslation("CHOOSE")});if(e!==null&&e){i.visible=e.visible!=null?e.visible:true;i.edit=e.edit!=null?e.edit:true;i.mandatory=e.mandatory!=null?e.mandatory:false;if(e.saveName&&e.saveName.toLowerCase()!=="auto"&&e.saveName!==""){i.saveName=e.saveName}else{i.saveName=e.id.split(".").pop().replace("expr","")}if(e.number!=null&&e.isDate!=null){i.number=0;if(e.number===true){i.number=1}if(e.isDate===true){i.number=2}}if(e.listContent){i.listContent=e.listContent}if(e.listContentDefault){i.listContentDefault=e.listContentDefault}if(e.maxLength){i.maxLength=e.maxLength}if(e.transport){i.transport=e.transport}}if(t){i.release=t.input.releaseVariable}return i}function parseInlineCommentListEntries(e,t,i){var a=e.indexOf(O);if(a>-1){a+=O.length}else{a=e.length}var n=e.substring(a,e.length);var r=n.split(g);var o=[];o.push({description:Mt["b"].DataObjects.RuntimeDO.getTranslation("CHOOSE"),key:"choose",originalDescription:Mt["b"].DataObjects.RuntimeDO.getTranslation("CHOOSE")});for(var l=0,s=r.length;l<s;l++){var d=r[l];if(d==="'"||d==='"'||d===""){continue}var c=d.split(p);var u=c[0].replace(/\n/g," ").trim();if(c[1]==undefined||c[1]===""){Mt["b"].Factories.DialogFactory.createMissingKeyDialog(e,u,i)}else{o.push({description:u,key:c[1],originalDescription:u})}}if(o.length===1&&t.length>1){o=t}return o}function getDefaultValueInternal(e,t){var i=e.indexOf(O);var a="";if(i>-1){a=e.substring(t+O.length,i)}return a}function getTypeInternal(e){var t=e.substr(0,C);switch(t){case i:return{type:Mt["b"].Utils.Constants.TypeValues.tableRepresentation.LIST,parmLen:v};case a:return{type:Mt["b"].Utils.Constants.TypeValues.tableRepresentation.COMMENT,parmLen:S};case r:return{type:Mt["b"].Utils.Constants.TypeValues.tableRepresentation.FLAG,parmLen:m}}return null}function getCharNumberValue(e){var t=parseInt(e);if(isNaN(t)===false){return t}else{return 0}}function getCharBooleanValue(e){return parseInt(e)===1}function setupDefinitionCheckRegex(){T=escapeForRegex(i);T+="([01]*";T+=escapeForRegex(M)+"){1}";T+="([\\d\\w-]*";T+=escapeForRegex(O)+"){1}";T+="(";T+="(.*";T+=escapeForRegex(p)+"){1}";T+="(.*";T+=escapeForRegex(g)+"){1}";T+=")*";_=escapeForRegex(a);_+="[01]{5}[012][01]"+escapeForRegex(M)+".*"+escapeForRegex(O)+"(.*"+escapeForRegex(A)+")?"+"((C[\\d]{2};;)?K[\\d]{2};;K[\\d]{2})?";x=escapeForRegex(r);x+="([01]*";x+=escapeForRegex(M)+"){1}";x+="([01]?";x+=escapeForRegex(O)+"){1}"}function checkWithRegex(e,t){if(e.indexOf(i)>-1||e.indexOf(a)>-1||e.indexOf(r)>-1){return e.match(new RegExp(t))!==null}else{return true}}function escapeForRegex(e){var t="";for(var i=0;i<e.length;i++){var a=e.charAt(i);if(n.indexOf(a)===-1){t+=a}else{t+="\\"+a}}return t}};var I=i(485);var D=i(601);Mt["b"].Utils=Mt["b"].Utils||{};Mt["b"].Utils.Calculator=Mt["b"].Utils.Calculator||{};Mt["b"].Utils.Calculator.FormulaTester=new function(){this.testFormulaFromOutside=function(){var o=new Mt["b"].Utils.Calculator;var e=Mt["b"].DataObjects.DocumentDO.getVariables();var t=e.slice();var i=[{formula:"$(D0100)",compiledFormula:null,testResult:"8"},{formula:"10e+0",compiledFormula:null,testResult:"10"},{formula:"$(D0100)e-0",compiledFormula:null,testResult:"8"},{formula:"$(D0100)e+1",compiledFormula:null,testResult:"80"},{formula:"$(D0100)e-1",compiledFormula:null,testResult:"0.8"},{formula:"$(D0100)*8",compiledFormula:null,testResult:"64"},{formula:"$(D0100)*$(Var4)",compiledFormula:null,testResult:"8"},{formula:"$(D0100)*$(Var5)",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100)==1",compiledFormula:null,testResult:"0"},{formula:"$(D0100)==8",compiledFormula:null,testResult:"1"},{formula:"$(D0100) == 2-1",compiledFormula:null,testResult:"0"},{formula:"$(D0100) == 0+1",compiledFormula:null,testResult:"0"},{formula:"$(D0100) == 9-1",compiledFormula:null,testResult:"1"},{formula:"$(D0100) == 5+3",compiledFormula:null,testResult:"1"},{formula:"$(D0100) == 2**3",compiledFormula:null,testResult:"1"},{formula:"$(D0100) <> 2**3",compiledFormula:null,testResult:"0"},{formula:"$(D0100) == $(Var11)**$(Var12)",compiledFormula:null,testResult:"1"},{formula:"$(D0100) <> $(Var11)**$(Var12)",compiledFormula:null,testResult:"0"},{formula:"($(D0100)==$(Var1))",compiledFormula:null,testResult:"0"},{formula:"($(D0100)==$(Var7))",compiledFormula:null,testResult:"1"},{formula:"$(D0100) == $(Var1)+7",compiledFormula:null,testResult:"1"},{formula:"$(D0100) == $(Var1)+1",compiledFormula:null,testResult:"0"},{formula:"$(D0100) == $(Var1)-2",compiledFormula:null,testResult:"0"},{formula:"$(D0100) == $(Var9)-2",compiledFormula:null,testResult:"1"},{formula:"$(D0100) == $(Var10)+2",compiledFormula:null,testResult:"1"},{formula:"$(D0100) < $(Var1)",compiledFormula:null,testResult:"0"},{formula:"$(D0100) > $(Var1)",compiledFormula:null,testResult:"1"},{formula:"$(D0100) <= $(Var1)",compiledFormula:null,testResult:"0"},{formula:"$(D0100) >= $(Var1)",compiledFormula:null,testResult:"1"},{formula:"$(D0100) >= $(Var6)",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) <= $(Var6)",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) < $(Var6)",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) > $(Var6)",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) == $(Var1)*1",compiledFormula:null,testResult:"0"},{formula:"$(D0100) == $(Var1)/1",compiledFormula:null,testResult:"0"},{formula:"$(D0100) == $(Var4)/1",compiledFormula:null,testResult:"0"},{formula:"$(D0100) == $(Var5)/1",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) == $(Var6)/1",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) == $(Var7)*1",compiledFormula:null,testResult:"1"},{formula:"$(D0100) <= $(Var7)*1",compiledFormula:null,testResult:"1"},{formula:"$(D0100) >= $(Var7)*1",compiledFormula:null,testResult:"1"},{formula:"$(D0100) == $(Var7)/1",compiledFormula:null,testResult:"1"},{formula:"$(D0100) <> $(Var7)/1",compiledFormula:null,testResult:"0"},{formula:"$(D0100) <> $(Var$(Var7))/1",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) <> $($(Var$(Var7)))/1",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) == $(Var$(Var7))/1",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) == $(Var$(Var10))",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) < $(Var$(Var10))",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) > $(Var$(Var10))",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) <> $(Var$(Var10))",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) == $(Var$(Var7))",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) <> $(Var$(Var7))",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) <> $(Var$(Var7))+$(Var1)-$(Var2)",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) == $(Var$(Var7))+$(Var1)-$(Var2)",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) < $(Var$(Var7))",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) <= $(Var$(Var7))",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) > $(Var$(Var7))",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) >= $(Var$(Var7))",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) == $(Var$(Var7)) AND $(D0100) ==$(Var1) ",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) == $(Var$(Var7)) OR $(D0100) ==$(Var1) ",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) == $(Var$(Var7)) AND $(D0100) ==$(Var7) ",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) <> $(Var$(Var7)) AND $(D0100) ==$(Var7) ",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) <> $(Var$(Var7)) OR $(D0100) <> $(Var7) ",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) == $(Var$(Var7)) OR $(D0100) ==$(Var7) ",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) == $(OR:$(Var1),2)",compiledFormula:null,testResult:"0"},{formula:"$(D0100) == $(AND:$(Var1),2)",compiledFormula:null,testResult:"0"},{formula:"$(D0100) <> $(OR:$(Var1),2)",compiledFormula:null,testResult:"1"},{formula:"$(D0100) <> $(AND:$(Var1),2)",compiledFormula:null,testResult:"1"},{formula:"$(D0100) == $(OR:2)",compiledFormula:null,testResult:"0"},{formula:"$(D0100) == $(OR:1)",compiledFormula:null,testResult:"0"},{formula:"$(D0100) <> $(OR:2)",compiledFormula:null,testResult:"1"},{formula:"$(D0100) == $(AND:2)",compiledFormula:null,testResult:"0"},{formula:"$(D0100) <> $(AND:2)",compiledFormula:null,testResult:"1"},{formula:"$(D0100) == $(OR: $(Var8),$(Var$(Var7)))",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) <> $(OR: $(Var8),$(Var$(Var7)))",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) == $(AND: $(Var8),$(Var$(Var7)))",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) <> $(AND: $(Var8),$(Var$(Var7)))",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) == $(AND: $(Var8),$(Var7))",compiledFormula:null,testResult:"0"},{formula:"$(D0100) <> $(AND: $(Var8),$(Var7))",compiledFormula:null,testResult:"0"},{formula:"$(D0100) <> $(OR: $(Var8),$(Var7))",compiledFormula:null,testResult:"1"},{formula:"$(D0100) == $(OR: $(Var8),$(Var7))",compiledFormula:null,testResult:"1"},{formula:"$(D0200) == $(VarS1)",compiledFormula:null,testResult:"1"},{formula:"$(D0200) == 'A1'",compiledFormula:null,testResult:"1"},{formula:"$(D0200) == $(VarS2)",compiledFormula:null,testResult:"0"},{formula:"$(D0200) <> $(VarS1)",compiledFormula:null,testResult:"0"},{formula:"$(D0200) <> $(VarS2)",compiledFormula:null,testResult:"1"},{formula:"$(D0200) <> $(Var15)",compiledFormula:null,testResult:"NaN"},{formula:"$(D0200) == $(Var15)",compiledFormula:null,testResult:"NaN"},{formula:"$(D0200) <> $(OR: $(Var15))",compiledFormula:null,testResult:"NaN"},{formula:"$(D0200) <> $(OR: 'A1')",compiledFormula:null,testResult:"0"},{formula:"$(D0200) <> $(OR:'A1')",compiledFormula:null,testResult:"0"},{formula:"$(D0200) == $(OR: $(Var15))",compiledFormula:null,testResult:"NaN"},{formula:"$(D0200) == $(OR: $(Var15),$(VarS2))",compiledFormula:null,testResult:"NaN"},{formula:"$(D0200) == $(OR: $(VarS3),$(VarS2))",compiledFormula:null,testResult:"0"},{formula:"$(D0200) <> $(OR: $(Var15),$(VarS2))",compiledFormula:null,testResult:"NaN"},{formula:"$(D0200) <> $(OR: $(VarS3),$(VarS2))",compiledFormula:null,testResult:"1"},{formula:"$(D0200) == $(AND: $(Var15),$(VarS2))",compiledFormula:null,testResult:"NaN"},{formula:"$(D0200) <> $(AND: $(Var15),$(VarS2))",compiledFormula:null,testResult:"NaN"},{formula:"$(D0200) <> $(AND: $(VarS3),$(VarS2))",compiledFormula:null,testResult:"1"},{formula:"$(D0200) == $(AND: $(VarS3),$(VarS2))",compiledFormula:null,testResult:"0"},{formula:"$(D0100) == $",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) == $()",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) == $(",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) == $)",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) == $())",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) == $(()",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) == $(OR: $($Var8),$(Var7))",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) == $(OR: $(Var8),$$(Var7))",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) == $(Var1)$",compiledFormula:null,testResult:"NaN"},{formula:"$(D0100) == $($(Var1)+$(Var2))",compiledFormula:null,testResult:"NaN"},{formula:"$($(Var1)+$(Var2))",compiledFormula:null,testResult:"NaN"}];var a={D0100:8,Var1:1,Var2:1,Var9:10,Var10:6,Var11:2,Var12:3,D0200:"A1",VarS1:"A1",VarS2:"A3",VarS3:"A4",Var4:1,Var7:8,Var8:1,1:1};checkModeOffTest(i,a);e=e.splice(t.length,e.length);function checkModeOffTest(e,t){var i=[];var a=0;var n=0;for(var r=0;r<e.length;r++){n=o.calculateFomulaCFM(e[r],t,e[r].formula,"1",false);i.push(n)}for(var r=0;r<i.length;r++){if(i[r].toString()!==e[r].testResult){a++;console.log("Test failed, ",e[r]," Result : ",i[r].toString())}}console.log("Test finished - Tests done: ",r," - Result: failed with ",a," errors")}}};var R=i(631);var N=i(370);Mt["b"].Utils=Mt["b"].Utils||{};Mt["b"].Utils.Calculator=Mt["b"].Utils.Calculator||{};Mt["b"].Utils.Calculator.Parser=function(){var e=this;var u=[{op:"AND",precedence:10,assoc:"LR",func:[{call:calcANDN,op1:"number",op2:"number",result:"number"},{call:calcANDS,op1:"string",op2:"string",result:"string"}]},{op:"and",precedence:10,assoc:"LR",func:[{call:calcANDN,op1:"number",op2:"number",result:"number"},{call:calcANDS,op1:"string",op2:"string",result:"string"}]},{op:"OR",precedence:11,assoc:"LR",func:[{call:calcORN,op1:"number",op2:"number",result:"number"},{call:calcORS,op1:"string",op2:"string",result:"string"}]},{op:"or",precedence:11,assoc:"LR",func:[{call:calcORN,op1:"number",op2:"number",result:"number"},{call:calcORS,op1:"string",op2:"string",result:"string"}]},{op:"%O",precedence:2,assoc:"LR",func:[{call:calcPercentOfN,op1:"number",op2:"number",result:"number"},{call:calcPercentOfS,op1:"string",op2:"string",result:"string"}]},{op:"**",precedence:4,assoc:"LR",func:[{call:calcPowerN,op1:"number",op2:"number",result:"number"},{call:calcPowerS,op1:"string",op2:"string",result:"string"}]},{op:"&&",precedence:10,assoc:"LR",func:[{call:calcANDN,op1:"number",op2:"number",result:"number"},{call:calcANDS,op1:"string",op2:"string",result:"string"}]},{op:"||",precedence:11,assoc:"LR",func:[{call:calcORN,op1:"number",op2:"number",result:"number"},{call:calcORS,op1:"string",op2:"string",result:"string"}]},{op:"<=",precedence:8,assoc:"LR",func:[{call:calcLEN,op1:"number",op2:"number",result:"number"},{call:calcLES,op1:"string",op2:"string",result:"string"}]},{op:">=",precedence:8,assoc:"LR",func:[{call:calcGEN,op1:"number",op2:"number",result:"number"},{call:calcGES,op1:"string",op2:"string",result:"string"}]},{op:"==",precedence:9,assoc:"LR",func:[{call:calcEQN,op1:"number",op2:"number",result:"number"},{call:calcEQS,op1:"string",op2:"string",result:"string"}]},{op:"<>",precedence:9,assoc:"LR",func:[{call:calcNEN,op1:"number",op2:"number",result:"number"},{call:calcNES,op1:"string",op2:"string",result:"string"}]},{op:"+",precedence:6,assoc:"LR",func:[{call:calcPlusN,op1:"number",op2:"number",result:"number"},{call:calcPlusS,op1:"string",op2:"string",result:"string"}]},{op:"-",precedence:6,assoc:"LR",func:[{call:calcMinusN,op1:"number",op2:"number",result:"number"},{call:calcMinusS,op1:"string",op2:"string",result:"string"}]},{op:"<",precedence:8,assoc:"LR",func:[{call:calcLTN,op1:"number",op2:"number",result:"number"},{call:calcLTS,op1:"string",op2:"string",result:"string"}]},{op:">",precedence:8,assoc:"LR",func:[{call:calcGTN,op1:"number",op2:"number",result:"number"},{call:calcGTS,op1:"string",op2:"string",result:"string"}]},{op:"*",precedence:5,assoc:"LR",func:[{call:calcMultiplyN,op1:"number",op2:"number",result:"number"},{call:calcMultiplyS,op1:"string",op2:"string",result:"string"}]},{op:"/",precedence:5,assoc:"LR",func:[{call:calcDivideN,op1:"number",op2:"number",result:"number"},{call:calcDivideS,op1:"string",op2:"string",result:"string"}]},{op:"%",precedence:3,assoc:"LR",func:[{call:calcPercentN,op1:"number",op2:"number",result:"number"},{call:calcPercentS,op1:"string",op2:"string",result:"string"}]},{op:"#",precedence:1,assoc:"RL",func:[{call:calcUnaryPlusN,op1:"number",op2:"number",result:"number"},{call:calcUnaryPlusS,op1:"string",op2:"string",result:"string"}]},{op:"§",precedence:1,assoc:"RL",func:[{call:calcUnaryMinusN,op1:"number",op2:"number",result:"number"},{call:calcUnaryMinusS,op1:"string",op2:"string",result:"string"}]}];var p=null;e.getTopLevelOperator=function(){return p};e.parse=function(e){var t=0;var i=resolveUnaryOperators(e);t=parseByRecursion(i);var a=t.length;if(t[0]==="'"&&t[a-1]==="'"||t[0]==='"'&&t[a-1]==='"'){t=t.substr(1,a-2)===""?0:1}return t};function resolveUnaryOperators(e){for(var t=0;t<e.length;t++){var i=e[t];if(i!=="+"&&i!=="-"){continue}if(t===0){var a=i==="+"?"#":"§";e=setCharAt(e,t,a);continue}if(e[t-1]==="("){var a=i==="+"?"#":"§";e=setCharAt(e,t,a);continue}var n=false;for(var r=0;r<u.length;r++){var o=u[r].op;var l=o.length;if(t>=l){if(e.substr(t-l,l)===o){n=true}}}if(n===true){var a=i==="+"?"#":"§";e=setCharAt(e,t,a)}}return e}function parseByRecursion(e){var t=Number.NaN;e=removeOuterBrackets(e);var i=findOperator(e);if(i===null){if(e==="true"){t=1}else if(e==="false"){t=0}else if(isQuotedString(e)){t=e}else{var a=String(e).search(/^\s*((\d+(\.\d+)?)|(\.\d+))([eE][\+-]?\d+)?\s*$/)!=-1;var n=String(e).search(/^\s*((\d+(\,\d+)?)|(\,\d+))([eE][\+-]?\d+)?\s*$/)!=-1;if(a===true||n===true){if(n===true){e=e.replace(",",".")}t=parseFloat(e)}else{t=Number.NaN}}}else{var r=i.operator;var o=i.position;var l=r.op.length;var s=e.substr(0,o);var d=e.substr(o+l);if(r.assoc==="RL"){if(s===""&&d!==""){s="0"}}var c=parseByRecursion(s);var u=parseByRecursion(d);t=evalOperator(r,c,u);if(!isFinite(t)){t=Number.NaN}p=r}return t}function removeOuterBrackets(e){e=e.replace(/^\s+/,"").replace(/\s+$/,"");while(isEmbracedByMatchingBrackets(e)===true){var t=e.length;e=e.substr(1,t-2);e=e.replace(/^\s+/,"").replace(/\s+$/,"")}return e}function isEmbracedByMatchingBrackets(e){var t=false;var i=e.length-1;if(e[0]==="("&&e[i]===")"){t=true;var a=0;for(var n=0;n<=i;n++){if(e[n]==="("){a++;continue}else if(e[n]===")"){a--;continue}if(a===0&&n!==i){t=false;break}}}return t}function findOperator(e){var t=[];var i=0;var a=false;var n=false;for(var r=0;r<e.length;r++){if(e[r]==="("){i++;continue}if(e[r]===")"){i--;continue}if(e[r]==="'"&&!n){if(!a||e[r-1]!=="\\"){a=!a}}else if(e[r]==='"'&&!a){if(!n||e[r-1]!=="\\"){n=!n}}if(!a&&!n&&i===0){for(var o=0;o<u.length;o++){var l=u[o].op.length;if(l<=e.length-r){var s=e.substr(r,l);if(s===u[o].op&&(e[r-1]!=="e"&&e[r-1]!=="E"||u[o].op!=="-"&&u[o].op!=="+")){t.push({position:r,operator:u[o]});r+=l-1;break}}}}}var d=null;for(var r=t.length-1;r>=0;r--){var c=t[r];if(d===null||c.operator.precedence>d.operator.precedence){d=c}}return d}function evalOperator(e,t,i){if(!isNaN(t)&&!isNaN(i)){t=Number(t);i=Number(i)}else{if(typeof t==="number"){if(isNaN(t)){return Number.NaN}else{t=t.toString(10)}}else if(typeof t==="string"){t=unquoteString(t)}if(typeof i==="number"){if(isNaN(i)){return Number.NaN}else{i=i.toString(10)}}else if(typeof i==="string"){i=unquoteString(i)}}if(typeof t==="number"&&typeof i==="number"){return e.func[0].call(t,i)}else{return e.func[1].call(t,i)}}function checkPercentSigns(e,t){var i="+";if(e<0){i="-"}var a="+";if(t<0){a="-"}if(i===a){return true}if(i==="-"&&a==="+"){return true}return false}function setCharAt(e,t,i){if(t>e.length-1){return e}return e.substr(0,t)+i+e.substr(t+1)}function isQuotedString(e){var t=e.length-1;if(e[0]==="'"&&e[t]==="'"){for(var i=1;i<t;i++){if(e[i]==="'"&&e[i-1]!=="\\"){return false}}}else if(e[0]==='"'&&e[t]==='"'){for(var i=1;i<t;i++){if(e[i]==='"'&&e[i-1]!=="\\"){return false}}}else{return false}return true}function unquoteString(e){var t=e.length;if(e[0]==="'"&&e[t-1]==="'"){e=e.substr(1,t-2).replace(/\\'/g,"'")}else if(e[0]==='"'&&e[t-1]==='"'){e=e.substr(1,t-2).replace(/\\"/g,'"')}return e}function calcPercentN(e,t){if(checkPercentSigns(e,t)===false){return Number.NaN}if(t===0){return Number.NaN}var i=(e-t)/t*100;return i}function calcPercentS(e,t){return Number.NaN}function calcPercentOfN(e,t){if(checkPercentSigns(e,t)===false){return Number.NaN}if(t===0){return Number.NaN}var i=e/t*100;return i}function calcPercentOfS(e,t){return Number.NaN}function calcPowerN(e,t){var i=Math.pow(e,t);return i}function calcPowerS(e,t){return Number.NaN}function calcMultiplyN(e,t){var i=e*t;return i}function calcMultiplyS(e,t){return Number.NaN}function calcDivideN(e,t){if(t===0){return Number.NaN}var i=e/t;return i}function calcDivideS(e,t){return Number.NaN}function calcPlusN(e,t){var i=e+t;return i}function calcPlusS(e,t){var i=e+t;return i}function calcMinusN(e,t){var i=e-t;return i}function calcMinusS(e,t){return Number.NaN}function calcLTN(e,t){var i=e<t?1:0;return i}function calcLTS(e,t){var i=e<t?1:0;return i}function calcGTN(e,t){var i=e>t?1:0;return i}function calcGTS(e,t){var i=e>t?1:0;return i}function calcLEN(e,t){var i=e<=t?1:0;return i}function calcLES(e,t){var i=e<=t?1:0;return i}function calcGEN(e,t){var i=e>=t?1:0;return i}function calcGES(e,t){var i=e>=t?1:0;return i}function calcEQN(e,t){var i=e===t?1:0;return i}function calcEQS(e,t){var i=e===t?1:0;return i}function calcNEN(e,t){var i=e!==t?1:0;return i}function calcNES(e,t){var i=e!==t?1:0;return i}function calcANDN(e,t){var i=e!==0&&t!==0?1:0;return i}function calcANDS(e,t){var i=e&&t?1:0;return i}function calcORN(e,t){var i=e!==0||t!==0?1:0;return i}function calcORS(e,t){var i=e||t?1:0;return i}function calcUnaryPlusN(e,t){var i=+t;return i}function calcUnaryPlusS(e,t){return Number.NaN}function calcUnaryMinusN(e,t){var i=-t;return i}function calcUnaryMinusS(e,t){return Number.NaN}};var w=i(182);var se=i(17);Mt["b"].Utils=Mt["b"].Utils||{};Mt["b"].Utils.DragAndDropProvider=function(e){var m=e.getCanvasDO().getDOMElement();var c=e;var t=Mt["b"].Utils.Calculator.Converter;var v=null;var b=null;var T=null;var u=null;var p=null;var g=false;var x;var i=false;this.setup=function(){Mt["b"].$(m).mousedown(mouseDown);Mt["b"].$(m).single_double_click(mouseClick,function(){});Mt["b"].$(m).mouseup(mouseUp);Mt["b"].$(m).mousemove(mouseMove);Mt["b"].$(m).mouseleave(mouseLeft)};function getRelativeMousePosition(e){var t=Mt["b"].$(m).offset();var i={x:e.clientX-t.left+window.pageXOffset,y:e.clientY-t.top+window.pageYOffset};return i}function mouseDown(e){if(e.which!==1){return}var t=c.getMode();if(t===se["a"].EDIT_COMMENT||t===se["a"].EDIT_SETTINGS){return}var i=c.getController().getRootModel().rootContainerModel;var a=c.getController().getRootPanel();var n=getRelativeMousePosition(e);var r={x:e.clientX,y:e.clientY};var o=Mt["b"].Factories.ModelFactory.collectModelsAtPosition([i],r,false,c,true);for(var l=o.length-1;l>=0;l--){var s=o[l];if(s.allowDragging===true){b=s;v=Mt["b"].Factories.ViewFactory.getViewById(a,s.view);break}}if(b===null){return}if(b.id.indexOf("object")!==-1&&b.id.indexOf("comment")!==-1){c.setMode(Mt["b"].Utils.Enums.EMode.MOVE_COMMENT_REFERENCE)}var d=raiseDragEvents(null,"startDragging");if(d.cancelDragging){releaseDraggedElements();return}u={x:b.position.x,y:b.position.y};x=document.getElementById("select##"+b.id+"##compareOffset");if(x){x.style.color=""}p={x:b.offset.x,y:b.offset.y};g=b.isUserLayouted;T=n;e.stopImmediatePropagation()}function mouseUp(e){if(v===null){return}if(!moveModel(e,"endDragging")){return}i=true;releaseDraggedElements();c.getController().updateLayoutDefinition();Mt["b"].DataObjects.DocumentDO.triggerDelayedRepaint();e.stopImmediatePropagation()}function mouseMove(e){if(v===null){return}if(!moveModel(e,"whileDragging")){return}e.stopImmediatePropagation()}function mouseClick(e){if(!i){return}i=false;e.stopImmediatePropagation()}function mouseLeft(){if(v===null){return}releaseDraggedElements()}function moveModel(e,t){var i=getRelativeMousePosition(e);if(isNaN(i.x)||isNaN(i.y)){i={x:b.position.x,y:b.position.y}}var a=v.getController().getRootModel();var n=Mt["b"].Factories.ModelFactory.getParentContainer(a.firstObjectGrid,b)[0];var r=Mt["b"].Models.Actions.ViewModelActions.General.getAbsolutePositionWithScrolling(n,a);r.x+=n.scrollingData.scrollLeft;r.y+=n.scrollingData.scrollTop;var o={x:b.position.x+(i.x-T.x),y:b.position.y+(i.y-T.y),width:b.dimension.width,height:b.dimension.height};var l={x:b.absolute.position.x+(i.x-T.x),y:b.absolute.position.y+(i.y-T.y),width:b.absolute.dimension.width,height:b.absolute.dimension.height};var s={x:b.percent.position.x+(i.x-T.x),y:b.percent.position.y+(i.y-T.y),width:b.percent.dimension.width,height:b.percent.dimension.height};var d={x:b.text.position.x+(i.x-T.x),y:b.text.position.y+(i.y-T.y),width:b.text.dimension.width,height:b.text.dimension.height};var c={x:b.offset.x+(o.x-b.position.x),y:b.offset.y+(o.y-b.position.y)};if(arguments.length>1){var u=raiseDragEvents(o,t,l,s,d);if(u.cancelDragging){if(!u.handled){mouseLeft(e)}else{releaseDraggedElements()}return false}if(u.handled){return true}}var p=i.x>r.x+5&&i.x<r.x+n.dimension.width-5&&i.y>r.y+5&&i.y<r.y+n.dimension.height-5;if(!p){return true}b.isUserLayouted=true;b.position.x=o.x;b.position.y=o.y;b.offset.x=c.x;b.offset.y=c.y;if(b.type==="time"){b.displayOffset=getOffsetValue(c.x)}else{b.displayOffset=getOffsetValue(c.y)}if(x){x.value=parseFloat(b.displayOffset).toFixed(4)}if(b.type==="time"){b.absolute.position.x=l.x;b.percent.position.x=s.x;b.text.position.x=d.x}else{b.absolute.position.y=l.y;b.percent.position.y=s.y;b.text.position.y=d.y}if(b.ellipse===true){if(b.type==="time"){for(var g=0;g<b.ellipseArray.length;g++){b.ellipseArray[g].x=b.ellipseArray[g].x+(i.x-T.x)}}else{b.ellipseArray.y=b.ellipseArray.y+(i.y-T.y)}}var h=b.id.replace("containerModel","");var f=Mt["b"].$(m).find('g[id^="'+h+'_"]')[0];moveArrow(f,i.x-T.x,i.y-T.y,b.type);T=i;return true}function moveArrow(e,t,i,a){if(a==="structure"||a==="table"){for(var n=0;n<e.childNodes.length;n++){if(e.childNodes[n].nodeName==="polyline"||e.childNodes[n].nodeName==="polygon"){var r=e.childNodes[n].getAttribute("points");r=r.split(/[, ]+/);if(r[r.length-1]===""){r.pop()}for(var o=1;o<r.length;o+=2){if(o!==1||e.childNodes[n].nodeName==="polygon"){r[o]=(parseFloat(r[o])+parseFloat(i)).toString()}}r=r.join(",");e.childNodes[n].setAttribute("points",r)}else if(e.childNodes[n].nodeName==="ellipse"){e.childNodes[n].cy.baseVal.value+=i}else if(e.childNodes[n].nodeName==="text"){Mt["b"].$(e.childNodes[n]).attr("y",Mt["b"].$(e.childNodes[n]).attr("y")*1+i*1)}else if(e.childNodes[n].nodeName==="circle"){e.childNodes[n].cy.baseVal.value+=i}else if(e.childNodes[n].nodeName==="rect"){e.childNodes[n].y.baseVal.value+=i}}}else if(a==="time"){for(var n=0;n<e.childNodes.length;n++){if(e.childNodes[n].nodeName==="polyline"||e.childNodes[n].nodeName==="polygon"){var r=e.childNodes[n].getAttribute("points");r=r.split(/[, ]+/);if(r[r.length-1]===""){r.pop()}for(var o=0;o<r.length;o+=2){if(o!==0||e.childNodes[n].nodeName==="polygon"){r[o]=(parseFloat(r[o])+parseFloat(t)).toString()}}r=r.join(",");e.childNodes[n].setAttribute("points",r)}else if(e.childNodes[n].nodeName==="ellipse"){e.childNodes[n].cx.baseVal.value+=t}else if(e.childNodes[n].nodeName==="text"){Mt["b"].$(e.childNodes[n]).attr("x",Mt["b"].$(e.childNodes[n]).attr("x")*1+t*1)}else if(e.childNodes[n].nodeName==="circle"){e.childNodes[n].cx.baseVal.value+=t}else if(e.childNodes[n].nodeName==="rect"){e.childNodes[n].x.baseVal.value+=t}}}}function getOffsetValue(e){return t.pix2mm(Math.round(e)/t.pix2pt(b.font.fSize))*10}function releaseDraggedElements(){if(b&&b.displaced){if(b.type==="time"){var e=b.position.x-(u.x-b.displacement);if(g===true){e=p.x-b.displacement+e}b.offset.x=e;b.displayOffset=getOffsetValue(e);b.displaced=false}else{var e=b.position.y-(u.y-b.displacement);if(g===true){e=p.y-b.displacement+e}b.offset.y=e;b.displayOffset=getOffsetValue(e);b.displaced=false}}if(x){x.value=parseFloat(b.displayOffset).toFixed(4)}if(Mt["b"].UI.IndicationDialog.isOpen()){Mt["b"].UI.IndicationDialog.getDialog().update()}b=null;v=null;T=null}function raiseDragEvents(e,t,i,a,n){var r=new Mt["b"].Utils.DragEventArgs(c,b,e,i,a,n);if(v.getActions()[t]!==undefined){c.getController().dispatch(v.getActions()[t],r)}return r}};Mt["b"].Utils=Mt["b"].Utils||{};Mt["b"].Utils.DragEventArgs=function(e,t,i,a,n,r){this.extension=e;this.draggedModel=t;this.dragTargetPosition=i;this.dragTargetAbsolutePosition=a;this.dragTargetPercentPosition=n;this.dragTargetTextPosition=r;this.handled=false;this.cancelDragging=false;this.outOfBounds=false};var F=i(1122);Mt["b"].Utils=Mt["b"].Utils||{};Mt["b"].Utils.EditorCommon=function(e){var t=this,i=e.extension,a=e.model,n=e.container,r=e.parentContainer,o=e.div,l=e.parent,s=i.getController(),d=null,c=null;t.getData=function(){return{extension:i,model:a,container:n,parentContainer:r,currDiv:o,currParent:l,controller:s,ckEditorEditField:d}};t.setNewFields=function(e){if(e){d=e}};t.getSavedAlignment=function(){switch(a.textAnchor){case"start":return"left";case"center":return"center";case"end":return"right"}return"left"};t.setCaretPosition=function(e){var t=e.createRange();t.moveToElementEditEnd(t.root);e.getSelection().selectRanges([t])};var u=function(){Mt["b"].UI.Tooltip.closeLastTooltip();c.createNewElements();var e=c.replaceEditor();e.on("instanceReady",function(e){Mt["b"].Utils.InitDynamicCssClasses("editor");this.setKeystroke([[CKEDITOR.SHIFT+13,"enter"]]);c.editorReady(e)});if(/Android/.test(navigator.userAgent)){e.on("focus",function(){document.documentElement.classList.add("HiCo-android-scrollFix")});e.on("blur",function(){document.documentElement.classList.remove("HiCo-android-scrollFix")})}e.on("afterCommandExec",function(e){if("ok"===e.data.name){c.leaveEditor()}else if("colordialog"===e.data.name){Mt["b"].Utils.InitDynamicCssClasses("dialog")}c.afterCommandExec(e)});e.on("paste",function(e){if(Mt["b"].DataObjects.DocumentDO.getDocSettings(true).pasteWithoutFormat.value==="true"){var t=document.createElement("div");t.innerHTML=e.data.dataValue;e.data.dataValue=Mt["b"].Utils.DOM.removeFormatFromText(t)}})};t.createCkEditorInstance=function(){var e=Mt["b"].DataObjects.DocumentDO.getConnector().getDocumentValues().copyCommentState;if(!Mt["b"].DataObjects.DocumentDO.getConnector().isPublished&&e&&!Object(z["q"])(e)&&e.documentHash){F["a"].show({header:Ot["a"].getTranslation("DIALOG_LOOSE_PREPARED_OFFLINE_COMMENTS_HEADER"),content:Ot["a"].getTranslation("DIALOG_LOOSE_PREPARED_OFFLINE_COMMENTS_CONTENT"),confirmText:Ot["a"].getTranslation("CANCEL"),cancelText:Ot["a"].getTranslation("CONTINUE"),onConfirm:function(){i.setMode(se["a"].DEFAULT);Mt["b"].DataObjects.RuntimeDO.testAndSetTextEditMode(false)},onCancel:function(){Mt["b"].DataObjects.DocumentDO.getConnector().applyDocumentValues([{key:"copyCommentState",value:undefined}]).then(function(){u()})}})}else{u()}};if(a.instanceOf==="InlineModel"){c=new Mt["b"].Utils.InlineCommentEditor(t)}else if(a.instanceOf==="LabelModel"){if(a.id.indexOf("comment")!==-1){c=new Mt["b"].Utils.CommentEditor(t)}}t.isPartOfCKE=function(e){while(e.parentElement){if(e.id&&e.id.indexOf("cke_")!==-1||e.className==="cke_dialog_background_cover"||e.classList.contains("cke_editable_inline")||e.classList.contains("tc-scrollbar")||e.classList.contains("hicoDialog")){return true}e=e.parentElement}return false}};Mt["b"].Utils.CommentEditor=function(e){var r=this,l=new at["a"](null),a=e,s=null,i=false;r.instanceOf=function(){return"CommentEditor"};function touchmoveEvent(){i=true}function leaveEvent(e){if(i||s.extension.getMode().id!==se["a"].EDIT_COMMENT.id){i=false;return}var t=Mt["b"].$(e.target)["context"];if(!a.isPartOfCKE(t)){r.leaveEditor()}}r.createNewElements=function(){s=a.getData();var e=s.currDiv,t=s.currParent,i=document.createElement("div");i.contentEditable=true;i.id=e.id.replace("commentText","commentEdit").replace(/\./g,"-")+"-commentDiv";i.className="ckeditor";i.innerHTML=Mt["b"].DataObjects.DocumentDO.getPainter().checkFormattingInText(r.getText());i.style.backgroundColor=s.model.backgroundColor;i.style.overflow="auto";i.style.maxHeight=t.parentElement.offsetHeight+"px";t.style.zIndex=parseInt(e.style.zIndex)+1;t.style.overflow="visible";e.classList.add("isOpen");e.innerHTML="";e.appendChild(i);a.setNewFields(i);s=a.getData()};r.replaceEditor=function(){var e=Mt["b"].DataObjects.RuntimeDO.getAllowIcon(s.parentContainer.extendedModel.allowNumber)&&s.model.titleLabelType===rt["a"].commentTextTypes.COMMENT,t={extraPlugins:[]};e&&t.extraPlugins.push("hiconumber");t.extraPlugins=t.extraPlugins.join(",");return CKEDITOR.inline(s.ckEditorEditField,t)};r.afterCommandExec=function(e){var t=s.parentContainer.extendedModel.gridRows.length,i=s.parentContainer.extendedModel.gridColumns.length,a=t===1&&i>1||t>1&&i===1;switch(e.data.name){case"clearComment":var n=CKEDITOR.instances[s.ckEditorEditField.id];n.setData("");runAfterPreChecks();break;case"removeComment":if(!a){Mt["b"].Factories.DialogFactory.createConfirmationDialog(Ot["a"].getTranslation("CONFIRM_COMMENT_CONTENT_DELETE_TITLE"),Ot["a"].getTranslation("CONFIRM_COMMENT_CONTENT_DELETE_MESSAGE"),function(e){Mt["b"].$(e.data.target).remove();var t=CKEDITOR.instances[s.ckEditorEditField.id];t.setData("");runAfterPreChecks()},true)}else{runAfterPreChecks()}break;default:runAfterPreChecks();break}function runAfterPreChecks(){if(["addNumber","removeNumber","removeComment"].indexOf(e.data.name)!==-1){r.leaveEditor()}switch(e.data.name){case"addNumber":s.controller.dispatch("createCommentReferenceLink",{extension:s.extension,model:J["a"](s.controller.getRootModel(),s.model.id.split(".")[0])});break;case"removeNumber":s.controller.dispatch("deleteCommentReference",{extension:s.extension,model:J["a"](s.controller.getRootModel(),s.model.id.replace("commentText","commentReference")),parameters:{menuType:"editor"}});break;case"removeComment":if(a){s.controller.dispatch("deleteCommentAction",{extension:s.extension,model:J["a"](s.controller.getRootModel(),s.model.id.split(".")[0])})}break}}};r.editorReady=function(e){var t=e.editor;s=a.getData();t.focus();a.setCaretPosition(t);Mt["b"].$(document.body).bind("mousedown",leaveEvent);Mt["b"].$(document.body).bind("touchmove",touchmoveEvent);Mt["b"].$(document.body).bind("touchend",leaveEvent)};r.leaveEditor=function(){var e=CKEDITOR.instances[s.ckEditorEditField.id],t=s.controller,i=t.getRootModel(),a=e.getData(),n=Mt["b"].DataObjects.CommentRepo.getCommentById(s.parentContainer.extendedModel.commentId,s.extension.getId()),r=n.currContent.grid[s.container.row][s.container.column];if(s.model&&r){var o=false;if(a===""){if(s.parentContainer.extendedModel.showDefaultText){switch(s.model.titleLabelType){case rt["a"].commentTextTypes.COMMENT:s.model.text=Ot["a"].getTranslation("NO_COMMENTS");break;case rt["a"].commentTextTypes.TITLE:s.model.text=Ot["a"].getTranslation("NO_TITLE");break;case rt["a"].commentTextTypes.SUBTITLE:s.model.text=Ot["a"].getTranslation("NO_SUBTITLE");break}}else{s.model.text=""}o=s.model.text!==r.text;r.text=""}else{a=a.replace(/[\n\r]/g,"");s.model.text=l.encode(a);o=s.model.text!==r.text;r.text=s.model.text}s.extension.setMode(se["a"].DEFAULT);i.isCompareMode=false;Mt["b"].DataObjects.CommentRepo.updateCommentRepository(s.extension);if(o){n.exists_in_db&&!r.originalLastModified&&(r.originalLastModified=r.lastModified);r.lastModified=h["a"].createFormattedDate();r.lastModifiedBy=Mt["b"].DataObjects.RuntimeDO.getUser().displayName;if(s.parentContainer.extendedModel.autoSave){if(i&&i.id){t.dispatch("updateRootModel",{extension:s.extension,dontConfirmText:true,showMessage:false,updateOnlyComments:true,commentId:n.id,currCommentCell:r})}else{F["a"].show({header:Ot["a"].getTranslation("CONFIRM_SAVE"),content:Ot["a"].getTranslation("ALERT_SAVE_COMMENT_ON_EDIT"),onConfirm:function(){return t.dispatch("updateRootModel",{extension:s.extension,dontConfirmText:true,showMessage:true})}})}}}e.fire("blur");e.destroy();Mt["b"].$(document.body).unbind("mousedown",leaveEvent);Mt["b"].$(document.body).unbind("touchmove",touchmoveEvent);Mt["b"].$(document.body).unbind("touchend",leaveEvent);Mt["b"].DataObjects.RuntimeDO.testAndSetTextEditMode(false);Mt["b"].DataObjects.DocumentDO.triggerDelayedRepaint();i.selectedChart=""}};r.getText=function(){return s.model.text.indexOf(Ot["a"].getTranslation("NO_COMMENTS"))!==-1||s.model.text.indexOf(Ot["a"].getTranslation("NO_TITLE"))!==-1||s.model.text.indexOf(Ot["a"].getTranslation("NO_SUBTITLE"))!==-1?"":unescape(l.decode(s.model.text))}};Mt["b"].Utils.InlineCommentEditor=function(e){var a=this,t=new at["a"](null),r=Mt["b"].DataObjects.InlineCommentRepo,n=e,l=null,o=-1,s=null,d=false,c=null,u=false,p=Mt["b"].DataObjects.DocumentDO.getPainter();a.instanceOf=function(){return"InlineCommentEditor"};a.getAlignment=function(){return c};a.getText=function(){return l.model.originalText===l.model.placeholderText?"":unescape(t.decode(l.model.originalText))};a.createNewElements=function(){l=n.getData();c=n.getSavedAlignment();var e=document.createElement("div");e.contentEditable=true;e.id=("inlineCommentDiv##"+l.extension.getId()+"##"+l.model.id.replace(/\./g,"-")).replace(/#/g,"-");e.className="ckeditor";e.innerHTML=p.checkFormattingInText(a.getText());e.style.backgroundColor=l.model.color.background;e.style.color="#000";var t=document.getElementById(l.model.id+"-"+l.extension.getId());t.classList.add("isOpen");t.innerHTML="";t.appendChild(e);t.style.zIndex=parseInt(t.style.zIndex)+1;t.style.overflow="visible";n.setNewFields(e);l=n.getData()};a.replaceEditor=function(){return CKEDITOR.inline(l.ckEditorEditField,{maxCharCount:l.model.maxLength})};a.afterCommandExec=function(e){switch(e.data.name){case"clearComment":var t=CKEDITOR.instances[l.ckEditorEditField.id];t.setData("");runAfterPreChecks();break;case"removeComment":Mt["b"].Factories.DialogFactory.createConfirmationDialog(Ot["a"].getTranslation("CONFIRM_COMMENT_CONTENT_DELETE_TITLE"),Ot["a"].getTranslation("CONFIRM_COMMENT_CONTENT_DELETE_MESSAGE"),function(e){Mt["b"].$(e.data.target).remove();var t=CKEDITOR.instances[l.ckEditorEditField.id];t.setData("");runAfterPreChecks()},true);break;default:runAfterPreChecks();break}function runAfterPreChecks(){if("removeComment"===e.data.name){a.leaveEditor()}}};a.editorReady=function(e){var t=e.editor;l=n.getData();s=t.getSnapshot();setEditorEvents(t);t.focus();n.setCaretPosition(t);Mt["b"].$(document.body).bind("mousedown",leaveEvent);Mt["b"].$(document.body).bind("touchmove",touchMoveEvent);Mt["b"].$(document.body).bind("touchend",leaveEvent);if(l.model.fontWeight==="bold"){t.execCommand("bold")}};a.leaveEditor=function(){var e=CKEDITOR.instances[l.ckEditorEditField.id],t=l.controller;if(e&&l.extension){var i=false;if(l.model){var a=e.getData(),n=a;a=a.replace(/(\r\n|\n|\r)/g,"");a=new at["a"](null).encode(a);if(l.model.originalText!==a){i=true;setData(l.model,a,n,l.extension)}Mt["b"].Utils.DOM.enableInlineCommentRows()}l.extension.setMode(se["a"].DEFAULT);var r=l.model.id.split(".")[0],o=p.getContainerScrollPosition(r,l.extension.getId());e.fire("blur");e.destroy();Mt["b"].$(document.body).unbind("mousedown",leaveEvent);Mt["b"].$(document.body).unbind("touchmove",touchMoveEvent);Mt["b"].$(document.body).unbind("touchend",leaveEvent);Mt["b"].DataObjects.RuntimeDO.testAndSetTextEditMode(false);i&&t.dispatch("updateInlineCommentsOnAutoSave",{extension:l.extension,model:l.model,container:l.container});Mt["b"].DataObjects.DocumentDO.triggerDelayedRepaint();if(o){p.setContainerScrollPosition(r,l.extension.getId(),o)}}};function touchMoveEvent(){u=true}function leaveEvent(e){if(u){u=false;return}if(document.getElementsByClassName("ckeditor")){var t=Mt["b"].$(e.target)["context"];var i=true;if(n.isPartOfCKE(t)){i=false}if(i){a.leaveEditor()}}}function setData(e,t,i,a){r.setInlineComment(e,t,a);e.originalText=i;var n="start";switch(c){case"left":n="start";break;case"center":n="center";break;case"right":n="end";break}e.textAnchor=n}function setEditorEvents(e){e.on("key",updateCounter,e,null,9);e.on("afterPaste",updateCounter,e,null,9);e.on("dataReady",updateCounter,e,null,9);e.on("change",updateCounter,e,null,9)}function updateCounter(e){var t=e.editor;if(t.config.maxCharCount===0){return true}var i=countCharacters(t);var a=i-o;o=i;if(o===-1){o=i}if(t.config.maxCharCount>-1&&i>t.config.maxCharCount&&a>0){limitReached(t)}else if(!d&&(t.config.maxCharCount===-1||i<t.config.maxCharCount)){limitRestored(t)}else{s=t.getSnapshot()}return true}function limitReached(e){K["a"].warning(Ot["a"].getTranslation("TOAST_COMMENT_MAX_LENGTH_REACHED",e.config.maxCharCount));d=false;e.loadSnapshot(s);n.setCaretPosition(e)}function limitRestored(e){d=true;s=e.getSnapshot()}function countCharacters(e){var t=e.getData();t=t.replace(/(\r\n|\n|\r)/gm,"").replace(/&nbsp;/gi," ");t=Mt["b"].Utils.DOM.strip(t).replace(/^([\t\r\n]*)$/,"");return t.length}};var B=i(506);Mt["b"].Utils.Format.DateChecker=new function(){var i=this;var a="DD.MM.YYYY";var e=[".",",","/","\\","-"];var s=[".","-","\\"];var o=true;var l=1960;var d=2060;var c=null;var u=null;var p=null;var g=null;var n=null;var r=null;var h=null;constructor();function constructor(){setupDateFormat()}i.getDateFormat=function(){return a};i.setDateFormat=function(e){a=e;setupDateFormat()};i.getCheckYearRange=function(){return o};i.setCheckYearRange=function(e){o=e};i.getYearRangeFrom=function(){return l};i.setYearRangeFrom=function(e){l=e};i.getYearRangeTo=function(){return d};i.setYearRangeTo=function(e){d=e};i.checkDate=function(e){if(i.checkCurrentDateFormat()===false){return}var t=buildDateFormatRegex();if(e.match(t)){return checkDateLogical(e)}else{return false}};i.checkCurrentDateFormat=function(){if(c===null){return false}if(c.length!==1){return false}if(e.indexOf(c)===-1){return}if(u===null||p===null||g===null){return false}if(n===null||r===null||h===null){return false}if(n!==2){return false}if(r!==2){return false}if(h!==2&&h!==4){return false}return true};function setupDateFormat(){c=a.replace(/D/g,"").replace(/M/g,"").replace(/Y/g,"");if(c.length>0){c=c[0]}else{c=null}var e=a.split(c);for(var t=0;t<e.length;t++){if(e[t].substr(0,1)==="D"){u=t;n=e[t].length}}for(var t=0;t<e.length;t++){if(e[t].substr(0,1)==="M"){p=t;r=e[t].length}}for(var t=0;t<e.length;t++){if(e[t].substr(0,1)==="Y"){g=t;h=e[t].length}}}function buildDateFormatRegex(){var e="(0?[1-9]|[12][0-9]|3[01])";var t="(0?[1-9]|1[012])";var i=h===4?"((19|20)\\d\\d)":"(\\d\\d)";var a="";if(u===0){a=e}if(p===0){a=t}if(g===0){a=i}var n="";if(u===1){n=e}if(p===1){n=t}if(g===1){n=i}var r="";if(u===2){r=e}if(p===2){r=t}if(g===2){r=i}var o=false;if(s.indexOf(c)!==-1){o=true}var l="["+(o===true?"\\":"")+c+"]";return a+l+n+l+r}function checkDateLogical(e){var t=e.split(c);if(isNaN(t[u])===true){return false}if(isNaN(t[p])===true){return false}if(isNaN(t[g])===true){return false}var i=parseInt(t[u]);var a=parseInt(t[p]);var n=parseInt(t[g]);if(h===2){if(n<0||n>99){return false}if(n>60){n=1900+n}else{n=2e3+n}}var r=new Array("31","28","31","30","31","30","31","31","30","31","30","31");if(isLeapyear(n)==true){r[1]="29"}if(i<0||i>r[a-1]){return false}if(a<0||a>12){return false}if(o===true){if(n<l||n>d){return false}}return true}function isLeapyear(e){var t=new Date(e,1,28).getTime();var i=new Date(e,2,1).getTime();var a=(i-t)/864e5;if(a==1){return false}else{return true}}};Mt["b"].Utils=Mt["b"].Utils||{};Mt["b"].Utils.Format=Mt["b"].Utils.Format||{};Mt["b"].Utils.Format.NumberFormat=Mt["b"].Utils.Format.NumberFormat||{formatNumber:function(e,t,i,a,n){var r=-1,o="";var l=a===true?0:t.numberFormat.decimal;l=n===undefined?l:n;e=Number(e);e=e/Number(i);e=e.toFixed(l);if(l>0){e=String(e);r=e.indexOf(".");e=e.split("");e.splice(r,1,t.numberFormat.decimalSeparator)}else{if(e=="-0"){return"0"}e=e.split("");r=e.length}while(r>=4){r-=3;if(!(r===1&&e[0]==="-")){e.splice(r,0,t.numberFormat.decimalThousandSeparator)}}if(e[0]==="-"&&t.numberFormat.negativeStyle==="()"){e[0]="(";e[e.length]=")"}Mt["b"].$.each(e,function(e,t){o+=String(t)});return o}};Mt["b"].Utils=Mt["b"].Utils||{};Mt["b"].Utils.Format=Mt["b"].Utils.Format||{};Mt["b"].Utils.Format.LabelFormatter=function(){var e=this;var t=Mt["b"].DataObjects.DocumentDO.getDocSettings();var a={numberFormat:{decimal:Mt["b"].Utils.Constants.Parameters.numberFormatDisplayedDecimals,decimalSeparator:t.decimalSep.value,decimalThousandSeparator:t.thousandSep.value,negativeStyle:t.negativeStyle.value}};var d=[{op:"ContextData",parm:3,func:execContextData},{op:"Date",parm:1,func:execDate}];e.parseLabel=function(e){if(typeof e!=="string"){return e instanceof Date?e.toLocaleDateString():e.toString()}var t=unescape(e);var i=getRegex();var a,n,r;while(a=i.exec(t)){var o=a[0].substring(2,a[0].length-1);r=Mt["b"].DataObjects.DocumentDO.getVariableById(o);if(r!==null){if(r.value){n=r.value}else{n=""}var l=new RegExp("\\$\\("+o+"\\)","g");e=e.replace(l,n)}else{var l=new RegExp("\\$\\("+o+"\\)","g");e=e.replace(l,"")}}for(var s=0;s<d.length;s++){e=parseLabelOperator(d[s],e)}return e};e.checkVariable=function(e){return getRegex().test(e)};function getRegex(){var e=/\$\([A-Za-z_#0-9]*\)/g;return e}function parseLabelOperator(e,t){var i="$"+e.op+"(";var a=t.indexOf(i);while(a!==-1){var n=-1;for(var r=a+1;r<t.length;r++){if(t[r]===")"){n=r;break}}if(n===-1){break}var o=n-a+1;var l=t.substr(a,o);var s=t.substr(0,a);var d="";if(t.length>n+1){d=t.substr(n+1)}var c="";l=l.replace(i,"");l=l.substr(0,l.length-1);var u=l.split(",");if(u.length===e.parms){break}for(var r=0;r<u.length;r++){u[r]=u[r].replace(/^\s+/,"").replace(/\s+$/,"");if(u[r][0]==='"'&&u[r][u[r].length-1]==='"'){u[r]=u[r].substr(1,u[r].length-2)}}var c=e.func(u);t=s+c+d;a=t.indexOf(i)}return t}function execContextData(e){var t=Mt["b"].Models.Actions.ModelActions.ContextModel.getContextDataByName(e[0],e[1],e[2]);var i=Mt["b"].Utils.Format.NumberFormat.formatNumber(t,a,1);return i}function execDate(e){var t=new Date;var i=t.getDate()+"."+(t.getMonth()+1)+"."+t.getFullYear();return i}};var k=i(181);Mt["b"].Utils.InitDynamicCssClasses=function(e){var l,t='url("'+k["c"]+"ckeditor/plugins/icons",i='url("'+k["c"]+"ckeditor/skins/moono-lisa/images",a=[{filename:"ckeditor/skins/moono-lisa/editor.css",search:'url("icons',replace:t},{filename:"ckeditor/skins/moono-lisa/editor_gecko.css",search:'url("icons',replace:t},{filename:"ckeditor/skins/moono-lisa/editor_ie.css",search:'url("icons',replace:t}],n=[{filename:"ckeditor/skins/moono-lisa/dialog.css",search:'url("images',replace:i},{filename:"ckeditor/skins/moono-lisa/dialog_ie.css",search:'url("images',replace:i}],s=false;switch(e){case"editor":l=a;break;case"dialog":l=n;break;default:return}function runIt(){for(var e=0;e<document.styleSheets.length;e++){var t=document.styleSheets[e];for(var i=l.length-1;i>=0;i--){try{if(t.href&&t.href.indexOf(k["c"]+l[i].filename)>-1){var a=t.cssRules||t.rules;for(var n=a.length-1;n>=0;n--){var r=a[n];if(r&&typeof r.cssText==="string"&&r.cssText.indexOf(l[i].search)>-1){var o=r.cssText;do{o=o.replace(l[i].search,l[i].replace)}while(o.indexOf(l[i].search)>-1);t.deleteRule(n);t.insertRule(o,n)}}s=true}}catch(e){s=true}}}}function doAgain(){runIt();!s&&window.setTimeout(doAgain,500)}window.setTimeout(doAgain,0)};Mt["b"].Utils=Mt["b"].Utils||{};Mt["b"].Utils.Mobile={isTouchDevice:"ontouchstart"in document,isIOS:/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,touchMoveDistance:8,onPointerDown:function(e,t){var i=false;e.addEventListener("touchstart",helper);e.addEventListener("mousedown",helper);function helper(e){if(i){i=false;return}if(e.type==="touchstart"){i=true}t(e)}},onTouchHold:function(i,a,n){var r=this;var o,l,s;i.addEventListener("touchstart",function(e){var t=e.touches[0];l=t.clientX;s=t.clientY;o=setTimeout(function(){e.clientX=t.clientX;e.clientY=t.clientY;e.pageX=t.pageX;e.pageY=t.pageY;e.hicoCurrentTarget=i;n(e)},a)});i.addEventListener("touchmove",function(e){if(!o){return}var t=e.touches[0];if(r.hasMoved(l,s,t.clientX,t.clientY,r.touchMoveDistance)){clearTimeout(o);o=undefined}});i.addEventListener("touchend",function(){clearTimeout(o);o=undefined})},hasMoved:function(e,t,i,a,n){return i<e-n||i>e+n||a<t-n||a>t+n}};var de=i(28);var ce=i(0);var ue=i(4);var he=i(110);var fe=i(1209);var me=i(62);var ve=i(248);var be=i(18);var Te;(function(e){e["Cell"]="cell";e["Layout"]="layout"})(Te||(Te={}));var xe=function(n){H["d"](InitialInlineSettings,n);function InitialInlineSettings(e){var o=n.call(this,e)||this;o.handleChange=function(e){var t=o.props.controller,i=o.extension;t.updateRootModel();var a=t.getRootModel(),n=Mt["b"].Factories.ModelFactory.getModelById(a,o.props.chartId);i.getMode()===se["a"].SET_CONTEXT&&i.setMode(se["a"].DEFAULT);Mt["b"].DataObjects.DocumentDO.triggerDelayedRepaint();switch(e){case rt["a"].EChartType.Url:case rt["a"].EChartType.Button:t.dispatch("getCellSettingsEditor",{extension:i,model:n,onOpen:function(){e===rt["a"].EChartType.Url&&document.getElementById("tc-url-input").select()}})}};o.openEditor=function(e){var t=e.currentTarget.dataset.type,i=o.props.controller,a=i.getRootModel(),n=t===Te.Cell?"getCellSettingsEditor":"getLayoutEditMode",r=Mt["b"].Factories.ModelFactory.getModelById(a,o.props.chartId);i.dispatch(n,{extension:i.getExtension(),model:r})};o.loadTemplate=function(t){return new Promise(function(e){o.props.controller.dispatch("getLoadTemplateDialog",{extension:o.extension,cellContainer:t,callback:e})})};o.state={isTiny:false};var t=Object(me["i"])(o.props.chartId,e.controller.getLayoutDefinition().rootCell),i=e.controller.getExtension();if(!t||!i){var a=!t?"CellContainer was not found in the LayoutDefinition: "+o.props.chartId:"Extension is not available.";throw new Error(a)}o.cellContainer=t;o.extension=i;return o}Object.defineProperty(InitialInlineSettings,"container",{get:function(){var e=document.createElement("div");e.className="hico-semantic cell cell-initial";return e},enumerable:true,configurable:true});InitialInlineSettings.renderAtNode=function(e,t){if(t===void 0){t=InitialInlineSettings.container}de["render"](ce["createElement"](InitialInlineSettings,H["a"]({},e)),t);return t};InitialInlineSettings.prototype.componentDidMount=function(){var e=this;var t=this.props.targetContainer;var i=function(){if(t.scrollHeight>t.offsetHeight||t.scrollWidth>t.offsetWidth){e.setState({isTiny:true})}};requestAnimationFrame(i)};InitialInlineSettings.prototype.render=function(){return ce["createElement"](ce["Fragment"],null,this.state.isTiny?this.renderCellButton():this.renderFull())};InitialInlineSettings.prototype.renderFull=function(){return ce["createElement"](ce["Fragment"],null,ce["createElement"](ve["a"],{inactive:this.props.inactive,extension:this.extension,cellContainer:this.cellContainer,onContentChange:this.handleChange,onLoadTemplate:this.loadTemplate}),ce["createElement"]("div",{className:Object(be["d"])("cell-initial-buttons",{"tc-unclickable":this.props.inactive})},this.renderCellButton(),ce["createElement"](ue["b"],{"data-type":Te.Layout,onClick:this.openEditor,title:this.translate("HELP_CONTEXTMENU_OPEN_LAYOUT_EDITOR")},ce["createElement"](ue["h"],{className:"tc-block layout"}),this.translate("LAYOUT"))))};InitialInlineSettings.prototype.renderCellButton=function(){var e=this.state.isTiny;return ce["createElement"](ue["b"],{"data-type":Te.Cell,onClick:this.openEditor,title:this.translate("HELP_CONTEXTMENU_CELL_NEW"),icon:e},ce["createElement"](ue["h"],{name:"settings"}),!e&&this.translate("CELL"))};return InitialInlineSettings}(he["a"]);var Ee=Mt["b"].Utils.Painter.SVGPainter=function(){var R=Mt["b"].DataObjects.RuntimeDO;var i;var T=rt["a"].timeRepresentation,x=rt["a"].notation,p=rt["a"].concept,g=rt["a"].shape,v=rt["a"].otherPattern,E=rt["a"].line,h=dt["a"],m={};var K=R.isPrinting()?1e4:600,f=R.isPrinting()?0:2e3;var y="";var M=R.getParameterParsed("FONT_SIZE_CHART");var b,P,C;var N,w;var _,S,O;var a,n;var e=document.createElement("canvas");var A=e.getContext("2d");var L=null;var u=null;var o=null;var I=null;var r=null;var l=null;var X={};var D=null;var Y=null;var Z=null;var s=null;var F={};var B={};var k={movingScrollbar:false,leftScrollContainer:false};var U={};var H=this;var G=[];var V=14;var $={right:false,left:false};var d={};var c=document.createElement("div");var z="",W="",j;this.init=function(){var e=Mt["b"].DataObjects.DocumentDO.getConnector().getMainContainer();if(!s){s=document.createElement("div");s.className="HiCoTextClass measureTextDiv";s.style.display="none";document.body.appendChild(s)}if(Y&&e===Y||e===null){return}Y=e;Z=Mt["b"].$(Y).offset()};this.checkVariableInText=checkVariableInText;this.checkFormattingInText=checkFormattingInText;this.handleScrolling=handleScrolling;this.createDOMElement=function(e,t,i){if(L!==null&&L.id===e){q["a"].warn("painter.createDOMElement: Element already exists",e)}u=document.createElementNS("http://www.w3.org/2000/svg","svg");u.id=e+"_svg";u.setAttributeNS(null,"width",t);u.setAttributeNS(null,"height",i);u.style.position="relative";u.style.top=0;u.style.left=0;L=document.createElement("div");L.id=e;L.style.width=t;L.style.height=i;L.className="unselectable";L.appendChild(u);return L};this.resetState=function(){b=R.getParameterParsed("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH");P=R.getParameterParsed("FACTOR_HIGHLIGHT_ELLIPSE_HEIGHT");C=R.getParameterParsed("MMPT_HIGHLIGHT_ELLIPSE_STROKE_WIDTH");N=R.getParameter("COLOR_HIGHLIGHT");w=R.getParameter("COLOR_HIGHLIGHT_ELLIPSE");a=R.getParameter("COLOR_COMPARE_POSITIVE");n=R.getParameter("COLOR_COMPARE_NEGATIVE");_=R.getParameter("FONT_FAMILY");S=R.getParameter("FONT_STYLE_CHART");M=R.getParameterParsed("FONT_SIZE_CHART");O=lt["a"].pt2pix(M);j=lt["a"].mm2pix(M*R.getParameterParsed("MMPT_COMMENT_LABEL_DISTANCE"));F={};B={};X={};k.movingScrollbar=false;k.leftScrollContainer=false;U={};var e=window["CKEDITOR"];if(e&&e.instances){for(var t in e.instances){var i=e.instances[t];i.fire("blur");i.destroy()}}Mt["b"].UI.Tooltip.closeLastTooltip()};this.paintContainer=function(e){var t=e.getModel();var i=e.getController();var a=i.getRootModel();paintBorders(e);if(t.extendedModel!==null){var n=t.extendedModel;window.HiCoMVCInit.paintingPromise.addCallback(function(){if(Mt["b"].DataObjects.DocumentDO.getAllExtensions().some(function(e){return e.getId()===a.extensionHash})){le.exportModel(t,a)}});if(n.instanceOf==="TableModel"){this.drawTable(e)}else if(n.instanceOf==="ContainerCommentGridModel"&&n.isTextEditable&&n.textType===Mt["b"].Utils.Constants.TypeValues.commentTextTypes.COMMENT&&R.getAllowIcon(n.allowBottom)){var r=e.getLayout().getCommentSize(e),o=t.dimension.height-j*2-r;if(o>M){var l=r+j;var s=t.children[t.children.length-1];var d=(s?s.zIndex:t.zIndex)+1;var c=Mt["b"].Utils.Constants.Parameters.idContainerContent+"."+t.id;var u=t.scrollingData.children&&t.scrollingData.children[c];if(u){H.beginNestedContainer(c,u);var p=t.border,g=t.padding;o-=p.top.width+p.bottom.width+g.top+g.bottom}if(i.getExtension().getMode()!==se["a"].READ_ONLY&&o>0){for(var h=0;h<t.extendedModel.gridColumns.length;h++){var f=t.children[h];var m=f.children.filter(function(e){return e.id.startsWith(f.id+".commentText.")})[0];var v=document.createElementNS("http://www.w3.org/2000/svg","rect");v.id=t.id+".background."+h;v.setAttributeNS(null,"class","HiCoCommentGridBackground");v.setAttributeNS(null,"width",m.dimension.width);v.setAttributeNS(null,"height",o);v.setAttributeNS(null,"x",f.position.x+m.position.x);v.setAttributeNS(null,"y",l);v.setAttributeNS(null,"fill",m.backgroundColor);addToElementsBuffer(v,d)}}if(u){H.endNestedContainer()}}}}};this.beginNestedContainer=function(e,t){o.setAndBeginNestedBuffer(e,t);I=o.getElementsBuffer();r=o.getGroupsBuffer();l=o.getDivsBuffer();D=o.getEllipsesBuffer()};this.endNestedContainer=function(){o.endNestedBuffer();I=o.getElementsBuffer();r=o.getGroupsBuffer();l=o.getDivsBuffer();D=o.getEllipsesBuffer()};function paintText(e,t,i,a,n,r,o,l,s,d,c,u,p,g,h){var f=r.split(" ");var m=document.createElementNS("http://www.w3.org/2000/svg","text");n=checkVariableInText(n);if(a.width===undefined){a.width=H.measureTextDim(n,r).width}var v;var b=r.match(/'([^']+)'/);if(b!=null){v=b[1]}var T=f[1];var x="normal";var E="normal";if(r.indexOf("bold")>-1){x=f[0]}if(r.indexOf("italic")>-1&&r.indexOf("bold")===-1){T=f[2];E=f[1]}if(r.indexOf("bold")>-1&&r.indexOf("italic")>-1){T=f[2];E=f[1]}if(r.indexOf("underline")>-1){m.setAttributeNS(null,"text-decoration",f[f.length-1])}m.style.fontFamily=v!==null?v:"";m.style.fontSize=T;m.style.fontWeight=x;m.style.fontStyle=E;if(c){m.style.cursor="pointer"}if(e.indexOf("compare")!==-1){m.style.cursor="pointer"}if(d!==undefined&&d!==null){e+="_"+d}m.id=e;m.setAttributeNS(null,"x",i.x.toString(10));m.setAttributeNS(null,"y",(i.y+a.height-Math.round(a.height/4)).toString(10));if(e.indexOf("dimensionchart")!==-1){m.addEventListener("mouseover",function(e){var t=e.target.parentNode.id.split("_");var i=t[0].replace(ot["a"].idTableContent+".","").replace(ot["a"].idContainerContent+".","");var a=t[1];Mt["b"].UI.CycleMenu.createCycleDIV(a,i)})}if(l!=null){m.setAttributeNS(null,"text-anchor",l)}if(o!==undefined&&o!==null){var y=rgb2hex(o);o=y.color;m.setAttributeNS(null,"fill",o)}var C=document.createTextNode(n);m.appendChild(C);if(e.indexOf("chart")!==-1&&e.indexOf("commentReference")!==-1){var S=L.parentNode.parentNode;Mt["b"].$(S).attrchange({trackValues:true,callback:function(){if(Mt["b"].$(this).css("display")==="none"){var e=this.getElementsByClassName("QvContent")[0];if(e){e=e.getElementsByClassName("unselectable")[0];if(e){var t=e.id;if(t){Mt["b"].DataObjects.CommentRepo.clearCommentReferenceViews(t)}}}}}})}if(s!==null&&s!==undefined){addToGroupsBuffer(s,m,t)}else{addToElementsBuffer(m,t)}var M;if(l==="middle"){M={x:i.x-a.width/2,y:i.y}}else if(l==="end"){M={x:i.x-a.width,y:i.y}}else{M={x:i.x,y:i.y}}paintSingleRect(e+"_boundingRect",t-2,M,a,"stroke","none",null,null,null,null,null,u);if(u!=null){var O=document.createElementNS("http://www.w3.org/2000/svg","title");O.textContent=u;m.appendChild(O)}else if(p!=null){var A=Mt["b"].$(m);A.data("originalText",p);A.data("extensionId",g)}if(h&&m.id.indexOf(".representation.")>0){var _=Mt["b"].DataObjects.InlineCommentRepo.getRepoAndRepresentationByViewModel(h).obj;window.setTimeout(function(){return Mt["b"].UI.Tooltip.createTooltip(m,_)},1e3)}}function paintBorders(e){var t=e.getBorder(),i=e.getDimension(),a=0,n=0,r=300;var o=i.width,l=i.height;if(t.top.width>0){paintSingleLine("",r,{x1:a,y1:n,x2:o,y2:n},t.top.color,t.top.width,"")}if(t.left.width>0){paintSingleLine("",r,{x1:a,y1:n,x2:a,y2:l},t.left.color,t.left.width,"")}if(t.right.width>0){o-=t.right.width;paintSingleLine("",r,{x1:o,y1:n,x2:o,y2:l},t.right.color,t.right.width,"")}if(t.bottom.width>0){l-=t.bottom.width;paintSingleLine("",r,{x1:a,y1:l,x2:o,y2:l},t.bottom.color,t.bottom.width,"")}}function createOtherPattern(e,t,i,a,n,r,o){var l=document.createElementNS("http://www.w3.org/2000/svg","pattern");l.id=a;l.setAttributeNS(null,"patternUnits","userSpaceOnUse");l.setAttributeNS(null,"width","10");l.setAttributeNS(null,"height","10");l.setAttributeNS(null,"x","0");l.setAttributeNS(null,"y","0");var s=document.createElementNS("http://www.w3.org/2000/svg","rect");if(i.pattern===undefined||i.background===null){i={pattern:i.axisPattern,background:i.axisBackground}}s.setAttributeNS(null,"fill",i.background);s.setAttributeNS(null,"width","10");s.setAttributeNS(null,"height","10");s.setAttributeNS(null,"x","0");s.setAttributeNS(null,"y","0");l.appendChild(s);if(n===null||n===undefined){n=0}if(typeof r==="undefined"){drawDiagonalOtherPattern(l,t,i)}else{switch(r){case v.DIAGONAL:drawDiagonalOtherPattern(l,t,i);break;case v.ZICKZACK:drawZickzackOtherPattern(l,t,i);break;case v.DIAMOND:drawDiamondOtherPattern(l,t,i);l.setAttributeNS(null,"patternTransform","scale(0.7)");break;case v.CIRCLE:drawCircleOtherPattern(l,t,i);break;case v.CHESS:drawChessOtherPattern(l,t,i);break;case v.EMPTY:q["a"].warn("painter.createOtherPattern: pattern for empty!");drawEmptyOtherPattern(l,t,i);break;case v.FILLED:q["a"].warn("painter.createOtherPattern: pattern for filled!");drawFilledOtherPattern(l,t,i);break}}if(n!==0){l.setAttributeNS(null,"patternTransform","rotate("+-n+",0,0)")}if(o===true&&r===v.ZICKZACK){l.setAttributeNS(null,"patternTransform","rotate(90,0,0)")}var d=u.querySelector("defs")||u.insertBefore(document.createElementNS("http://www.w3.org/2000/svg","defs"),u.firstChild);if(d!==undefined&&d.children!==undefined){for(var c=0;c<d.children.length;c++){if(d.children[c].id===a){Mt["b"].$(d.children[c]).remove()}}}d.appendChild(l)}function drawEmptyOtherPattern(e,t,i){if(i.highlight===true){e.setAttributeNS(null,"fill",N)}return e}function drawFilledOtherPattern(e,t,i){var a=document.createElementNS("http://www.w3.org/2000/svg","rect");a.setAttributeNS(null,"x","-20");a.setAttributeNS(null,"y","-10");a.setAttributeNS(null,"width",(t*200).toString());a.setAttributeNS(null,"height",(t*200).toString());a.setAttributeNS(null,"fill",i.highlight===true?N:i.pattern);e.appendChild(a);return e}function drawChessOtherPattern(e,t,i){var a=-20;var n=-10;while(a<=20){while(n<=20){var r=document.createElementNS("http://www.w3.org/2000/svg","rect");r.setAttributeNS(null,"x",a.toString());r.setAttributeNS(null,"y",n.toString());r.setAttributeNS(null,"width","5");r.setAttributeNS(null,"height","5");r.setAttributeNS(null,"fill",i.highlight===true?N:i.pattern);n+=10;e.appendChild(r)}a+=5;if(n%10===0){n=-5}else{n=-10}}return e}function drawDiagonalOtherPattern(e,t,i){var a=10;var n=-20;while(n<=20){var r=document.createElementNS("http://www.w3.org/2000/svg","line");r.setAttributeNS(null,"stroke-width",t);r.setAttributeNS(null,"x1",a);r.setAttributeNS(null,"y1","-10");r.setAttributeNS(null,"x2",n);r.setAttributeNS(null,"y2","20");r.setAttributeNS(null,"stroke",i.highlight===true?N:i.pattern);a+=5;n+=5;e.appendChild(r)}return e}function buildDataPointsForPolyline(e){var t=-20;var i=[];for(var a=0;a<=8;a++){i.push(e+","+t);if(a%2==0){e-=5}else{e+=5}t+=5}return i.join(" ")}function drawZickzackOtherPattern(e,t,i){var a=-20;while(a<=25){var n=a;var r=document.createElementNS("http://www.w3.org/2000/svg","polyline");var o=buildDataPointsForPolyline(n);r.setAttributeNS(null,"points",o);r.setAttributeNS(null,"fill",i.background);r.setAttributeNS(null,"stroke-width",t);r.setAttributeNS(null,"stroke",i.highlight===true?N:i.pattern);a+=5;e.appendChild(r)}return e}function drawDiamondOtherPattern(e,t,i){var a=20;var n=-20;while(n<=20){var r=document.createElementNS("http://www.w3.org/2000/svg","line");r.setAttributeNS(null,"stroke-width",1);r.setAttributeNS(null,"x1",a);r.setAttributeNS(null,"y1","-20");r.setAttributeNS(null,"x2",n);r.setAttributeNS(null,"y2","20");r.setAttributeNS(null,"stroke",i.highlight===true?N:i.pattern);a+=10;n+=10;e.appendChild(r)}var a=-20;var n=20;while(a<=20){var r=document.createElementNS("http://www.w3.org/2000/svg","line");r.setAttributeNS(null,"stroke-width",1);r.setAttributeNS(null,"x1",a);r.setAttributeNS(null,"y1","-20");r.setAttributeNS(null,"x2",n);r.setAttributeNS(null,"y2","20");r.setAttributeNS(null,"stroke",i.highlight===true?N:i.pattern);a+=10;n+=10;e.appendChild(r)}return e}function drawCircleOtherPattern(e,t,i){var a=-20;var n=-10;while(a<=20){while(n<=20){var r=document.createElementNS("http://www.w3.org/2000/svg","circle");r.setAttributeNS(null,"cx",a);r.setAttributeNS(null,"cy",n);r.setAttributeNS(null,"r",t);r.setAttributeNS(null,"fill",i.highlight===true?N:i.pattern);n+=10;e.appendChild(r)}a+=5;if(n%10===0){n=-5}else{n=-10}}return e}this.drawTable=function(e){var t=e.getModel();var i=t.extendedModel;var a=i.cellSelection;if(a.rowLength>0&&a.columnLength>0){var n=i.tableCellData[a.startRow][a.startColumn].afterLayoutingPosition;var r=i.tableCellData[a.startRow+a.rowLength-1][a.startColumn+a.columnLength-1];var o=r.afterLayoutingPosition;var l=r.afterLayoutingSize;var s=o.x-n.x+l.width;var d=o.y-n.y+l.height;paintSingleRectTable("tableSelection"+t.id,300,n,{height:d,width:s},"stroke",N)}var c=false,u=false;var p=ot["a"].idTableContent+"."+t.id;var g=ot["a"].idTableHead+"."+t.id;for(var h=0;h<i.rows;h++){for(var f=0;f<i.columns;f++){var m=i.tableCellData[h][f];if(m.inContentCell&&!u){c&&(this.endNestedContainer(),c=false);this.beginNestedContainer(p,t.scrollingData.children[p]);u=true}else if(!c&&!m.inContentCell){u&&(this.endNestedContainer(),u=false);this.beginNestedContainer(g,t.scrollingData.children[g]);c=true}var v=m.afterLayoutingPosition;var b=m.afterLayoutingSize;var T;var x=t.id+"."+h+"."+f;if(m.border.left>0){T={x1:v.x,y1:v.y,x2:v.x,y2:v.y+b.height};paintSingleLine(x+".left.line",300,T,m.borderColor,m.border.left,t.id+".line")}if(m.border.right>0){var E=v.x+b.width-m.border.right;T={x1:E,y1:v.y,x2:E,y2:v.y+b.height};paintSingleLine(x+".right.line",300,T,m.borderColor,m.border.right,"")}if(m.border.top>0){T={x1:v.x,y1:v.y,x2:v.x+b.width,y2:v.y};paintSingleLine(x+".top.line",300,T,m.borderColor,m.border.top,"")}if(m.border.bottom>0){var y="",C;if(h<i.headerRows-1&&f<i.columnDefinitions.length-1&&(i.tableCellData[h][f].elements[0]&&i.tableCellData[h][f].elements[0].hideLabel)){C=i.tableCellData[h][f+1].afterLayoutingPosition.x;y=".annotationLabel"}else{C=v.x+b.width;if(h<i.headerRows-1){y=".annotationLabel"}}var S=v.y+b.height-m.border.bottom;T={x1:v.x,y1:S,x2:C,y2:S};paintSingleLine(x+y+".bottom.line",300,T,m.borderColor,m.border.bottom,"")}}}if(c||u){this.endNestedContainer()}};this.paintAxis=function(e){var t=e.getModel();if(t.separators.length>0){var i=t.position.x+Math.round(t.dimension.width/2);for(var a=0;a<t.separators.length;a++){var n=t.separators[a];var r=n.y-Math.floor(n.width/2);var o={x1:i-n.neg,y1:r,x2:i+n.pos,y2:r};paintSingleLine(t.id+".separator."+a,n.zIndex,o,n.color,n.width,t.id)}}if(t.paintAxis===false){return}if(t.segments&&t.segments.length>0){if(t.dimension.width>1){var l=t.segments.length-1;for(var a=0;a<t.segments.length;a++){var s=t.segments[a];var o={x:t.position.x,y:s.y};var d={width:t.dimension.width};if(s.segLen!==undefined){d.height=s.segLen}else{d.height=(a===l?t.dimension.height+t.position.y:t.segments[a+1].y)-s.y}if(s.otherPattern!==v.FILLED&&s.otherPattern!==v.EMPTY){var c={border:s.border,pattern:s.pattern,background:s.background};paintSingleRectTable(t.id+"_fill_"+a,t.zIndex-1,o,d,"forecast",c,null,null,s.otherPattern)}else{var c=s.otherPattern===v.FILLED?s.pattern:s.background;paintSingleRectTable(t.id+"_fill_"+a,t.zIndex-1,o,d,"fill",c)}paintSingleRectTable(t.id+a,t.zIndex,o,d,"stroke",s.border)}}else{var l=t.segments.length-1;for(var a=0;a<t.segments.length;a++){var o={x1:t.position.x,y1:t.segments[a].y,x2:t.position.x};if(t.segments[a].segLen!==undefined){o.y2=t.segments[a].y+t.segments[a].segLen}else{o.y2=a===l?t.dimension.height+t.position.y:t.segments[a+1].y}paintSingleLine(t.id+a,t.zIndex,o,t.segments[a].border,1,t.id)}}}else{if(t.dimension.width>1){paintSingleRectTable(t.id+"_fill",t.zIndex-1,t.position,t.dimension,"fill",t.color);paintSingleRectTable(t.id,t.zIndex,t.position,t.dimension,"stroke",t.color)}else{var o={x1:t.position.x,y1:t.position.y,x2:t.position.x,y2:t.position.y+t.dimension.height};paintSingleLine(t.id,t.zIndex,o,t.color,1,t.id)}}};function paintAxisBorder(e,t,i,a,n,r,o){var l;if(e!==undefined){l=e.axisBorder}if(a==="Time"){var s={};s.x=t.x;s.y=t.y-i.height/2;paintSingleRect(r,o,s,i,"stroke",l)}}function paintAxisFilling(e,t,i,a,n,r,o,l,s){if(a==="Time"){var d={};d.x=t.x;d.y=t.y-i.height/2}if(s!==v.FILLED&&s!==v.EMPTY){paintSingleRect(r+Math.random(),l,d,i,"forecast",e,null,null,s)}else if(s===v.FILLED){paintSingleRect(r+Math.random(),l,d,i,"fill",e.axisPattern)}else{paintSingleRect(r+Math.random(),l,d,i,"fill",e.axisBackground)}}function getHighestPriorityPositioning(a){var n=function(e,t){for(var i=0;i<e.length;i++){if(e[i]===t){return true}}return false};var r=[];Mt["b"].$.each(a.children,function(e,t){if(t.instanceOf==="RodModel"||t.instanceOf==="TimeLineModel"||t.instanceOf==="TimeColumnModel"||t.instanceOf==="TimeWaterfallModel"||t.instanceOf==="NeedleModel"||t.instanceOf==="StructureLineModel"||t.instanceOf==="BarModel"||t.instanceOf==="StructureWaterfallModel"){if(a.layoutType==="time"||a.layoutType==="elementType.2"){var i=t.labelPosition;if(i===-1||i===undefined){i=t.positioning}if(r.length==0){r.push(i)}else{if(!n(r,i)){r.push(i)}}}else{var i=t.positioning;if(i===-1||i===undefined){i=t.positioning}if(r.length==0){r.push(i)}else{if(!n(r,i)){r.push(i)}}}}});var e=[];if(r[0]!==-1&&r[0]!==undefined){if(r[0].indexOf("timePositionType")>-1){e=["timePositionType.3","timePositionType.4","timePositionType.2","timePositionType.5","timePositionType.1","timePositionType.6","timePositionType.0"]}}var t="";for(var i=0;i<=7;i++){if(n(r,e[i])){t=e[i];break}}return t}this.paintTimeAxis=function(e){var t={y:e.getModel().position.y,x:e.getModel().position.x};var i=e.getDimension();var a=e.getModel();var n=e.getController();var r=n.getRootModel();var o=Mt["b"].Factories.ModelFactory.getParentContainer(r.firstObjectGrid,e.getModel());var l=o[0];var s=Mt["b"].DataObjects.ContextRepo.getContextByCid(e.getModel().contextId);var d=Mt["b"].Layout.Common.getLinkGroups(r,l.id,"Time");var c=d.legend?d.legend.categoryWidth:o[1].categoryWidth;var u=c.categorySize+2*c.categoryDistance;var p=Mt["b"].Factories.ModelFactory.getSelectedKeyfigure(l);var g=getHighestPriorityPositioning(l);var h=isAxisNotationAndNotationType(s,l,g).axisNotation;var f=isAxisNotationAndNotationType(s,l,g).notationTypeId;var m={};var v={};if(a.separators.length>0){var b=a.position.y+Math.floor(a.dimension.height/2);for(var T=0;T<a.separators.length;T++){var x=a.separators[T];var E=x.x-Math.floor(x.width/2);var y={x1:cordCorrectionSVG(E)+.001,y1:b-x.pos,x2:cordCorrectionSVG(E),y2:b+x.neg};paintSingleLine(a.id+".separator."+T,x.zIndex,y,x.color,x.width,a.id)}}if(a.paintAxis===false){return}var C=getAxisDataType(p,l,g,f);C.id=e.getModel().id;if(h===true){var S={};var M={};M.height=i.height;M.width=i.width-2;S.y=t.y-i.height/2;S.x=t.x;m.x=t.x;m.y=t.y;v.height=i.height;v.width=i.width;defineAxisDatatypeParts(C,m,v,u,f,"Time",e.getModel().zIndex,l)}else{var O=ot["a"].colorDraw;var A=t.x;var _=t.y;var L=A;var I=C.number;for(var T=0;T<I;T++){var D=u;if(i.height/2>1){t.y=_-i.height/2;t.x=L;i.width=D;paintSingleRect(e.getModel().id,e.getModel().zIndex,t,i,"fill",O)}else{var R=Mt["b"].Models.Actions.ExtendedModelActions.DimensionLabelModel.getAxisSplit(l.extendedModel,T+1);if(R!==undefined&&R!==null){var P=R.space_px;if(R.axisSplit===true){if(R.position==="start"){var N={x1:L+P,y1:t.y-1,x2:L+P+D,y2:t.y-1};paintSingleLine(a.id,a.zIndex,N,O,1)}else{var N={x1:L,y1:t.y-1,x2:L+D,y2:t.y-1};paintSingleLine(a.id,a.zIndex,N,O,1)}}else{var N={x1:L,y1:t.y-1,x2:L+D+P,y2:t.y-1};paintSingleLine(a.id,a.zIndex,N,O,1)}}else{var P=0;var N={x1:L,y1:t.y-1,x2:L+D,y2:t.y-1};paintSingleLine(a.id,a.zIndex,N,O,1)}L=L+D+P}}}};function defineAxisPartColor(e,t,i){var a;if(e===x.AXIS){if(t.baseColors[i].fillingColor===undefined){a={axisBorder:t.baseColors[i].axisBorder,axisPattern:t.baseColors[i].axisPattern,axisBackground:t.baseColors[i].axisBackground,otherPattern:t.baseColors[i].otherPattern}}}else if(e===x.ELEMENT_AXIS){a={axisBorder:t.referenceColors[i].axisBorder,axisPattern:t.referenceColors[i].axisPattern,axisBackground:t.referenceColors[i].axisBackground,otherPattern:t.referenceColors[i].otherPattern}}return a}function defineAxisDatatypeParts(e,t,i,a,n,r,o,l){var s=e.number;var d=false;var c=parseInt(e.dataTypeOccurence[0]);var u=false;var p=0;i.width=a*parseInt(e.dataTypeOccurence[p]);for(var g=0;g<s;g++){if(c===0){p+=1;c=parseInt(e.dataTypeOccurence[p]);i.width=a*parseInt(e.dataTypeOccurence[p])}if(c===1){u=true;d=true}c-=1;var h=Mt["b"].Models.Actions.ExtendedModelActions.DimensionLabelModel.getAxisSplit(l.extendedModel,g+1);var f=defineAxisPartColor(n,e,g);if(r==="Time"){var m=0;if(h!==undefined&&h!==null){m=h.space_px;if(h.axisSplit===true){if(h.position==="start"){t.x+=m}}else{i.width+=m}}}if(u){if(i.height-1<1){var v={x1:t.x,x2:t.x+i.width,y1:t.y-1,y2:t.y-1};paintSingleLine(e.id+".axisNotation"+g,o,v,f.axisBorder,i.height)}else{var v={x:t.x,y:t.y-1},b={width:i.width,height:i.height-1};paintAxisBorder(f,v,b,r,e.dataTypes[g],e.id+".axisNotation"+g,o-1,n);paintAxisFilling(f,v,b,r,e.dataTypes[g],e.id+".axisNotation"+g,e.representationConcept,o,f.otherPattern)}u=false}if(r==="Time"){if(h!==undefined&&h!==null){if(h.axisSplit===true&&h.position==="end"){t.x+=m}}if(d===true){t.x=t.x+i.width;i.width=0;d=false}}}}function getAxisDataType(e,t,a,n){var r=[];var o=[];var l=[];var s=[];var d=[];var c=0;var u=0;var p=0;var g=false;var h=0;var f=[];var m="Area";var v=null;Mt["b"].$.each(t.children,function(e,t){if(t.instanceOf=="RodModel"||t.instanceOf=="TimeLineModel"||t.instanceOf=="TimeColumnModel"||t.instanceOf=="TimeWaterfallModel"||t.instanceOf=="NeedleModel"||t.instanceOf=="StructureLineModel"||t.instanceOf=="BarModel"||t.instanceOf=="StructureWaterfallModel"||t.instanceOf=="ValueModel"){h++;if(v===null){if((t.labelPosition==a||t.positioning==a)&&(t.notation===x.AXIS||t.notation===x.ELEMENT_AXIS)){v=t.dataId_expr}}if((t.labelPosition==a||t.positioning==a)&&v===t.dataId_expr){if(t.color.axisBorder!==-1&&t.color.axisPattern!==undefined){var i={axisBorder:t.color.axisBorder,axisPattern:t.color.axisPattern,axisBackground:t.color.axisBackground,otherPattern:t.color.otherPattern};r[p]=i;o[u]=i;p++;u++}else{r[p]=t.baseColorSettings;p++}g=t.isDelta;if(t.notation===x.ELEMENT_AXIS){m=t.referenceConcept}else{m=t.concept}if(n===x.ELEMENT_AXIS&&t.referenceDataType!==undefined){if(s[c]!=undefined&&d[c]!=undefined){if(s[c]!=t.referenceDataType||d[c]!==t.timeType){c++;s[c]=t.referenceDataType;d[c]=t.timeType;l[c]=1}else{l[c]++}}else{s[c]=t.referenceDataType;d[c]=t.timeType;l[c]=1}}else{if(s[c]!=undefined&&d[c]!=undefined){if(s[c]!=t.dataType||d[c]!==t.timeType){c++;s[c]=t.dataType;d[c]=t.timeType;l[c]=1}else{l[c]++}}else{s[c]=t.dataType;d[c]=t.timeType;l[c]=1}}}f.push({baseColors:r,referenceColors:o,dataTypes:s,dataTypeOccurence:l,representationConcept:m,isDelta:g})}});var i=h/t.extendedModel.expressions.length;var b={baseColors:r,referenceColors:o,dataTypes:s,dataTypeOccurence:l,representationConcept:m,isDelta:g,newAxis:f,number:i};breakAxisWithEmptySpaces(t,b,i);return b}function breakAxisWithEmptySpaces(e,t,i){var a=[];var n=e.extendedModel.dimensionLabelModel.calculatedEmptySpaces;for(var r in n){var o=n[r];var l=o.position;var s=o.positionCnt;if(l=="start"){s--}if(a.indexOf(s)===-1){a.push(s)}}if(t.dataTypes.length===0){if(e.extendedModel.expressions.length>0){t.dataTypes.push("Actual");t.dataTypeOccurence.push(i)}}var d=99999;while(a.length>0&&d!==0){var c=0;var u=[];var p=[];var g=0;for(var h=0;h<t.dataTypes.length;h++){var f=t.dataTypeOccurence[h];var m=false;for(var v=0;v<a.length;v++){var b=a[v];var T=g+f;if(b>g&&b<T){m=true;c++}if(m===true){var x=b-g;var E=f-x;u.push(t.dataTypes[h]);u.push(t.dataTypes[h]);p.push(x);p.push(E);a.splice(v,1);break}}if(m===false){u.push(t.dataTypes[h]);p.push(t.dataTypeOccurence[h])}g+=f}t.dataTypes=u;t.dataTypeOccurence=p;d=c}}this.paintBackground=function(r){var e=r.getDimension(),o=r.getModel(),t=isClickBehaviorEnabled(o);var i=r.getPosition(),a=null,n=null,l=null;if(o.dynamicOpacity){l={mouseover:function(){this.setAttributeNS(null,"fill-opacity",.5);a&&a.setAttributeNS(null,"opacity",.5);n&&n.setAttributeNS(null,"opacity",.5)},mouseout:function(){this.setAttributeNS(null,"fill-opacity",0);a&&a.setAttributeNS(null,"opacity",0);n&&n.setAttributeNS(null,"opacity",0)}}}if(o.text!==""){var s=S+" "+O+"px '"+_+"'";var d=J["b"](r.getController().getRootModel().firstObjectGrid,o)[0];if(d.layoutType==="placeholder"){if(Mt["b"].DataObjects.RuntimeDO.getUser().permissions.indexOf("Designer")>-1){this.paintInitial(r)}return}if(o.text==="Click"||o.text===R.getTranslation("CLICK")){if(o.image1){a=createImage(o.image1,o.image1Pos,o.image1Dim)}if(o.text1){paintText(r.getId()+"_text1",o.zIndex+400,o.text1Pos,o.text1Dim,o.text1,s,null,null,null,null,t)}if(o.image2){n=createImage(o.image2,o.image2Pos,o.image2Dim)}if(o.text2){paintText(r.getId()+"_text2",o.zIndex+400,o.text2Pos,o.text2Dim,o.text2,s,null,null,null,null,t)}}else{var c=o.text;var u=this.measureTextDim(c,s).width;var p=O;var g={width:u,height:p};if(u<e.width&&p<e.height){i={x:i.x+e.width/2-u/2,y:i.y+e.height/2-p/2};paintText(r.getId(),o.zIndex+400,i,g,c,s,null,null,null,null,t)}}}paintSingleRect(r.getId(),o.zIndex,i,e,"fill",o.color,null,null,null,null,t||o.isButton,null,l);function createImage(e,t,i){var a=document.createElementNS("http://www.w3.org/2000/svg","image");var n=r.getModel().zIndex+400;a.id=r.getId();a.setAttributeNS("http://www.w3.org/1999/xlink","href",e);a.setAttributeNS(null,"width",dimCorrectionSVG(i.width));a.setAttributeNS(null,"height",dimCorrectionSVG(i.height));a.setAttributeNS(null,"x",cordCorrectionSVG(t.x));a.setAttributeNS(null,"y",cordCorrectionSVG(t.y));if(o.dynamicOpacity){a.setAttributeNS(null,"opacity","0");a.style.pointerEvents="none"}addToElementsBuffer(a,n);return a}};this.paintUrl=function(e){var t=e.getModel();var i=o.getIframesBuffer();var a=i[t.id];if(!a){var n=e.getController().getRootModel();a=document.createElement("iframe");a.setAttribute("id",n.extensionHash+"_"+t.id+"_iFrame");a.setAttribute("src",t.url||"about:blank");a.style.height=t.dimension.height+"px";a.style.width=t.dimension.width+"px";a.style.borderWidth="0";i[t.id]=a}else{var r=t.url||"about:blank";a.getAttribute("src")!==r&&a.setAttribute("src",r);a.style.height!==t.dimension.height+"px"&&(a.style.height=t.dimension.height+"px");a.style.width!==t.dimension.width+"px"&&(a.style.width=t.dimension.width+"px")}addToDivsBuffer(a)};function createTextDiv(e){var t=e.getModel();var i=checkFormattingInText(checkVariableInText(t.text,"textDiv"));var a=document.createElement("div");a.id=t.id;a.className="comment HiCoTextClass";a.style.width=t.dimension.width+"px";a.style.height=t.dimension.height+"px";a.style.top=t.position.y+"px";a.style.left=t.position.x+"px";a.style.fontSize=t.fontSize+"px";a.style.fontFamily=t.font;a.style.fontWeight=t.fontWeight;a.style.fontStyle=t.fontStyle;a.style.zIndex=t.zIndex;a.style.postion="absolute";var n=Mt["b"].Factories.ModelFactory.getParentContainer(e.getController().getRootModel().firstObjectGrid,t);var r=null,o=null;for(var l=0;l<n.length;l++){if(n[l].extendedModel.instanceOf==="CommentModel"){o=n[l]}else if(n[l].extendedModel.instanceOf==="ContainerCommentGridModel"){r=n[l];break}}if(r){if(r.extendedModel.isTextEditable){a.style.background=t.backgroundColor;a.classList.add("isEditable");createTouchDummy(a,e,function(){!Mt["b"].Utils.Mobile.isTouchDevice&&Mt["b"].$(a.parentElement).draggable("enable")},function(){!Mt["b"].Utils.Mobile.isTouchDevice&&Mt["b"].$(a.parentElement).draggable("disable")})}else{if(isClickBehaviorEnabled(r.extendedModel)){a.style.cursor="pointer"}}}if(t.dimension.width>0&&t.dimension.height>0){a.innerHTML=i;if(i===""){a.classList.add("isEmpty")}else{var s=Mt["b"].DataObjects.DocumentDO.getApi().GlobalFeatureManager.Actions;if(s&&s.isEnabled&&s.Feature.supports("GoToURL")){var d=a.getElementsByTagName("a");for(var c=0;c<d.length;c++){var u=d.item(c);if(u.target){u.addEventListener("click",function(e){s.Feature.execute.GoToURL({url:e.target.href});e.preventDefault()})}}}}}return{div:a,parent:o,parentGrid:r}}this.paintComment=function(e){var t=e.getModel();if(t.id.indexOf("commentText")!==-1){var i=createTextDiv(e);var a=e.getController().getRootModel();var n=Mt["b"].Factories.ModelFactory.getParentContainer(a.firstObjectGrid,e.getModel())[0];var r=Mt["b"].DataObjects.CommentRepo.getCommentById(i.parentGrid.extendedModel.commentId,a.extensionHash).currContent.grid[n.row][n.column];window.setTimeout(function(){return Mt["b"].UI.Tooltip.createTooltip(i.div,r)},1e3);addToDivsBuffer(i.div,e,i.parent)}else if(t.isCommentReference){this.paintCommentReference(t)}};this.convertOffsets=function(e,t,i,a,n,r){var o=r/2;var l={x:0,y:0};var s=Mt["b"].Layout.CommentReference.getReferenceCollisionOffset(e,i,r,t);if(a.extendedModel.instanceOf==="TimeChartModel"){if(t.instanceOf==="CompareModel"){l.y=i.position.y;l.x=i.position.x;if(n.align.x==="right"||n.align.x==="left"){l.x-=s}}else{l.y=i.position.x;l.x=i.position.y;if(n.align.x==="right"){l.x-=s;l.x*=-1}if(n.align.y==="top"){l.y+=s;l.y*=-1}if(n.align.y==="bottom"){l.y+=s}if(n.align.x==="left"){l.x-=s}}}else{l.y=i.position.y;l.x=i.position.x;if(t.instanceOf!=="CompareModel"){if(n.align.x==="left"){l.x*=-1}if(n.align.y==="bottom"){l.y*=-1}}if(n.align.x==="left"){l.x-=s}if(n.align.x==="right"){l.x+=s}if(n.align.y==="bottom"){l.y+=s}if(n.align.y==="top"){l.y-=s}}l.x-=o;l.y-=o;return l};function hideShowScrolledReferences(e,t,i,a){var n=a&&a.textContent==="";n&&(a.innerHTML="&nbsp;");var r=a.getBoundingClientRect();var o=t;n&&(a.textContent="");while(o.id!==i&&o.parentNode){var l=o.getBoundingClientRect();if(l.width===0||l.height===0||r.left+r.width<l.left||r.left>l.left+l.width||r.top+r.height<l.top||r.top>l.top+l.height){e.style.display="none";return}o=o.parentNode}e.style.display="block"}function handleScrolledReferences(e,t,r){var i=t.id.replace(ot["a"].idTableHead+".","").replace(ot["a"].idTableContent+".","").replace(ot["a"].idContainerContent+".",""),a=r.getChartById(i.split(".")[0].split("_")[0]);var o=X[i]||[];if(a.layoutType==="grid"){recursivelySearchCommentReferences(a)}function recursivelySearchCommentReferences(e){var t=e.children;for(var i=t.length;i--;){var a=t[i];if(a.layoutType==="grid"){recursivelySearchCommentReferences(a)}else{var n=X[a.id+"_"+r.getId()];n&&(o=o.concat(n))}}}function getScrollDiv(e){var t=e;while(t.tagName!=="svg"){t=t.parentNode}var i=t.parentNode,a=i.parentNode;return a&&a.tagName==="DIV"||a.className==="tc-scroll"?i:null}if(o.length>0){for(var n=0;n<o.length;n++){var l=o[n].divElement,s=Mt["b"].$.data(l),d=s.currCommentCell.reference[s.selectedReference],c=getScrollDiv(s.referencedElement),u=l.parentNode;if(d.elementPath){if(e==="left"){var p=s.x+s.borderOffset.x;var g=c;do{p-=g.scrollLeft}while(g!==u&&(g=g.parentNode));l.style.left=p+"px"}else{var h=s.y+s.borderOffset.y;var g=c;do{h-=g.scrollTop}while(g!==u&&(g=g.parentNode));l.style.top=h+j+"px"}}hideShowScrolledReferences(l,c,s.targetExtension.getId(),s.referencedElement)}}}function createTouchDummy(e,n,r,t){var o=n.getModel();var l=o.fontSize+"px";e.addEventListener("mouseenter",function(e){if(e.target.id==="touch-dummy"||document.querySelector('.comment > [contenteditable="true"]')){return}var t=document.getElementById("touch-dummy");t&&t.parentElement.removeChild(t);var i=document.createElement("div");i.id="touch-dummy";i.style.fontSize=l+"px";i.dataset.isClicked="";i.addEventListener("mousedown",function(){if(i.dataset.isAndroidFix!=="1"){i.dataset.isClicked="1"}});var a=document.createElement("i");$.left&&(a.style.left="16px");a.style.position="absolute";a.className="fa fa-pencil-square-o";a.setAttribute("aria-hidden","true");i.appendChild(a);paintDeleteCommentIcon(i,n,o);this.appendChild(i,o);i.dataset.isAndroidFix="1";setTimeout(function(){i.dataset.isAndroidFix=""},0);r&&r()});e.addEventListener("mouseleave",function(){var e=document.getElementById("touch-dummy");e&&e.parentElement.removeChild(e);t&&t()})}function paintDeleteCommentIcon(e,t,i){var a=t.getController(),n=a.getRootModel(),r=Mt["b"].Factories.ModelFactory.getParentContainer(n.firstObjectGrid,i),o=r[0];if(o&&o.extendedModel&&o.extendedModel.instanceOf==="CommentModel"){var l=o.extendedModel;if(l.textType!=="comment"){return}var s=r[1];if(s&&s.extendedModel&&s.extendedModel.instanceOf==="ContainerCommentGridModel"&&s.extendedModel.gridRows){if(s.extendedModel.gridRows.length>1){var d=document.createElement("i");d.className="fa fa-trash";d.id="delete-comment-icon";d.setAttribute("aria-hidden","true");$.right&&(d.style.right="16px");d.addEventListener("click",function(){a.dispatch("deleteRemoveRow",{model:o,extension:a.getExtension(),deleteCommentText:true})});e.appendChild(d)}}else{q["a"].warn("Find a CommentModel without a ContainerCommentGridModel as parent. The DeleteCommentIcon can not be printed!",o,s)}}}this.paintMoveableCommentReferences=function(e,t,i,a,n,r,o,l){var s=e.id.split("."),d="DIV_"+s[0]+"_"+s[1]+"_"+s[2]+"_"+a,c;while(c=document.getElementById(d)){c.parentNode.removeChild(c)}c=this.paintCommentReference(r,e);if(!c){return}c.id=d;c.style.position="absolute";c.style.zIndex=K;var u=l.reference[a],p=Mt["b"].DataObjects.DocumentDO.getExtension(s[2]),g=p.getController(),h=Mt["b"].DataObjects.DocumentDO.getExtension(u.extension),f=h?h.getController().getRootModel():null,m=Mt["b"].Factories.ModelFactory.getParentContainer(g.getRootModel().firstObjectGrid,r),v=0,b=null,T={x:0,y:0},x=null;for(var E=m.length;E--;){if(m[E].extendedModel.instanceOf==="ContainerCommentGridModel"){b=m[E];break}}var y=b&&b.extendedModel.isTextEditable;c.style.cursor=y?"move":"default";if(y){Mt["b"].Layout.CommentReference.setDraggable(c,i.id,l);Mt["b"].$(c).on("contextmenu",function(e){contextMenuFunction(e.originalEvent)});Mt["b"].Utils.Mobile.onTouchHold(c,800,contextMenuFunction)}if(n){var C=Mt["b"].Factories.ModelFactory.getModelById(f,u.chartId);if(C){var S=Mt["b"].Models.Actions.ViewModelActions.General.getAbsolutePosition(C,f);var M=this.convertOffsets(h,n,u,C,o,v);var O=t.x+S.x+o.x+M.x-parseInt(c.style.width)/2,A=t.y+S.y+o.y+M.y-parseInt(c.style.height)/2,_={xStart:t.x+S.x,yStart:t.y+S.y};if(C.scrollingData.headerHeight!=undefined&&(n.nestedContainerId==undefined||n.nestedContainerId.indexOf(ot["a"].idTableContent)>=0)){_.yStart+=C.scrollingData.headerHeight}var L=null,I=null;if(n.instanceOf==="CompareModel"){var D=u.elementType.split("#");if(D[1]==="text"){var R=D.pop();L=Mt["b"].$(h.getAdapter().getContainerElement()).find('[id="'+n.id+"."+R+'"]')[0];L&&(I=L.parentNode.parentNode)}else{var P=Mt["b"].$(h.getAdapter().getContainerElement()).find('g[id^="'+n.id+'"]')[0];if(P){for(var N=0;N<P.children.length;N++){if(P.children[N].tagName===D[1]){L=P.children[N];I=L.parentNode.parentNode;break}}}}}else{var w=Mt["b"].$(h.getAdapter().getContainerElement()).find('[id^="'+n.id+'"]');for(var N=0;N<w.length;N++){var F=w[N];if(w[N].tagName!=="pattern"&&(!F.id||!F.id.endsWith("_boundingRect"))&&(F.id&&F.id.split("$")[0]===n.id)){L=w[N];I=L.parentNode;break}}}if(L){getScrollDiv(I);if(x){var B=C.id.split(".")[0]+"_"+h.getId();if(X[B]===undefined){X[B]=[]}for(var N=0;N<X[B].length;N++){if(X[B][N].divElement.id===c.id){X[B].splice(N,1);break}}X[B].push({divElement:c})}var k=Mt["b"].Models.Actions.ViewModelActions.General.getAbsolutePositionWithScrolling(C,f);var U=0,H=0;if(C.scrollingData.children){var G=C.scrollingData.children[n.nestedContainerId];if(G){U+=G.scrollLeft;H+=G.scrollTop}}var V=C.border,$=C.padding;T={x:V.left.width+$.left,y:V.top.width+$.top};var z=Mt["b"].Connector.ConnectorHelper.Settings.borderOfExtensionRoot;c.style.left=O+(k.x-S.x-U)+z+"px";c.style.top=A+(k.y-S.y-H)+z+"px";Y.appendChild(c);hideShowScrolledReferences(c,I,h.getId(),L)}}}else{var W=Q["a"].getAbsoluteReferencePosition(u);c.style.left=W.x;c.style.top=W.y;Y.appendChild(c)}var j=Mt["b"].DataObjects.DocumentDO.getExtension(u.extension).getAdapter().getContainerElementCoordinates();c.setAttribute("extension-x",j.x-Z.left);c.setAttribute("extension-y",j.y-Z.top);Mt["b"].$.data(c,{currComment:i,currCommentCell:l,selectedReference:a,extension:p,targetExtension:h,objectId:s[0],fixReferenceModel:r,referencePoints:o,referencedElement:L,x:O,y:A,containerPos:_?_:undefined,borderOffset:T,offset:M,posCnt:Mt["b"].DataObjects.CommentRepo.getMoveablePosCounter()});function getScrollDiv(e){if(e){var t=e.parentNode;if(t&&t.tagName==="DIV"&&t.className==="tc-scroll"){x=e}else if(t&&t.id===h.getId()){}else{getScrollDiv(t)}}}function contextMenuFunction(e){var t=Mt["b"].DataObjects.RuntimeDO.getUser().sessionKey;if(t!==""){var i={x:e.clientX,y:e.clientY,pageX:e.pageX,pageY:e.pageY,parent:g.getRootPanel().rootContainerModel,canvas:p.getCanvasDO().getDOMElement(),extension:p,divId:e.currentTarget?e.currentTarget.id:e.hicoCurrentTarget.id};g.dispatch("getCommentReferenceMenuContent",i)}}};this.paintCommentReference=function(e,t){if(t===undefined){t=e}var i=Mt["b"].Layout.CommentReference.ReferenceRepresentation.svg,a=i.getReferenceSize(t.text).refLabelDistance,n=!(e.showFixReference===false||e.movedReferenceCounter===0),r=document.getElementById(e.id),o=i.create(t.text,n);r&&i.setActive(r,n);if(o){if(t.id.indexOf("object")!==-1&&t.id.indexOf("commentReference")!==-1){return o}else{o.id=e.id;o.style.paddingTop=a+j+"px";o.style.paddingLeft=a+"px";addToDivsBuffer(o,t.zIndex+20)}}};this.paintLabel=function(e){var t=e.getModel();if(t.hideLabel===true){return}var i={x:Math.round(t.position.x),y:Math.round(t.position.y)};var a=e.getDimension();i.x+=2;var n=e.getController().getRootModel();var r=t.id.split(".");var o=r[0];if((t.isHighlighted||t.highlightedCompare)&&t.id.indexOf("dimensionchart")===-1){var l=lt["a"].pix2pt(t.fontSize);var s=lt["a"].mm2pix(l*C);if(t.textAnchor==="middle"){this.paintEllipse(e,i.x-3,i.y+a.height/2-2,a.width*b,a.height*P,N,false,s)}else if(t.textAnchor==="end"){this.paintEllipse(e,i.x-a.width/2,i.y+a.height/2-2,a.width*b,a.height*P,N,false,s)}else{this.paintEllipse(e,i.x+a.width/2-2,i.y+a.height/2-2,a.width*b,a.height*P,N,false,s)}}else if(t.isHighlighted&&t.id.indexOf("dimensionchart")>=0){var d={x:0,y:0,width:0,height:0,dataId_dim:null,strokeWidth:0,view:null,labelSignDistance:0,type:null};var c=o.slice(9,o.length);c=Mt["b"].Factories.ModelFactory.getModelById(n,c);var l=lt["a"].pix2pt(t.fontSize);var u=0;d.type=c.layoutType;if(d.type==="structure"){u=lt["a"].mm2pix(l*R.getParameter("MMPT_STRUCTURE_CATEGORY_LABEL_SIGN_DISTANCE"))}else if(d.type==="table"){var p=t.dataId_dim.split("@");var g={width:0,spacing_right:0};for(var h=0;h<p.length;h++){if(p[h]===t.text){g=c.extendedModel.columnDefinitions[h];break}}u=g.width-a.width+g.spacing_right}else if(d.type==="time"){u=lt["a"].mm2pix(l*R.getParameter("MMPT_TIME_CATEGORY_LABEL_SIGN_DISTANCE"))}var s=lt["a"].mm2pix(l*C);if(t.textAnchor==="middle"){d.x=i.x-3}else if(t.textAnchor==="end"){d.x=i.x-a.width/2-2}else{d.x=i.x+a.width/2-2}d.y=i.y+a.height/2-1;d.width=a.width;d.height=a.height;d.dataId_dim=t.dataId_dim;d.view=e;d.strokeWidth=s;d.labelSignDistance=u;D.push(d)}if(t.showBackground==="transparent"){drawLabelBackground(t)}var f=checkVariableInText(t.text);if(t.id.indexOf("dimensionchart")==-1&&Mt["b"].Utils.DOM.checkForHTML(f)===true){drawTextHTML(e)}else{if(t.showBackground==="inverted"){var m=Mt["b"].Factories.ModelFactory.getModelById(n,o);drawTextInverted(e,m)}else{drawText(e,this)}}};this.paintButton=function(e){addToDivsBuffer(e)};this.paintInitial=function(e){var t="InitialInlineSettings";var i=o.getComponentNode(t,e.getId())||o.addToComponentsBuffer(xe.container,t,e.getId());de["unmountComponentAtNode"](i);i.id=e.getId();xe.renderAtNode({inactive:Mt["b"].Components.LayoutEditor.isOpen(),targetContainer:i,controller:e.getController(),chartId:e.getModel().chartId},i);addToDivsBuffer(i)};function drawLabelBackground(e){var t={x:e.position.x,y:e.position.y};var i={width:e.dimension.width,height:e.dimension.height};if(e.textAnchor==="middle"){t.x-=i.width/2}else if(e.textAnchor==="end"){t.x-=i.width}if(Mt["b"].$.browser.mozilla){t.x-=1;t.y-=2;i.height=i.height*1.1}if(Mt["b"].$.browser.msie){t.y-=2;i.height=i.height*1.1}if(Mt["b"].$.browser.webkit){t.x-=2;t.y-=2;i.width+=2;i.height=i.height*1.1}var a=e.backgroundColor;var n=a.indexOf("rgb(");var r=a.indexOf(")");if(n!==-1&&r!==-1){a="rgba("+a.substring(n+4,r)+","+(1-e.backgroundTransparency)+")"}paintSingleRect(e.id,e.zIndex-10,t,i,"fill",a)}function drawTextHTML(e){var t=e.getModel();var i={x:t.position.x,y:t.position.y};var a={width:t.dimension.width,height:t.dimension.height};var n=t.fontSize+"px '"+(t.font!=""?t.font:_)+"'";var r=checkVariableInText(t.text);var o=null;var l=t.originalText;var s=e.getController().getRootModel().extensionHash;if(t.instanceOf==="InlineModel"){o=!t.edit;if(l===t.placeholderText||t.text===l){l=null}}var d=Mt["b"].Utils.DOM.createTextArrayFromHTML(r);var c=d.length;var u=i.x;for(var p=0;p<c;p++){var g=d[p];var h=0;var f=0;for(var m=0;m<g.length;m++){var v=g[m];var b=v.text;var T=v.bold;var x=v.italic;var E=v.underline;var y=0;var C=(T?"bold ":"normal ")+(x?"italic ":"")+n+(E?" underline":"");var S=measureTextDim(b,C);i.x=u;h=S.height;var M=getTotalOffset(C,g);y=getOffsetPositionX(t,M);y-=1;var O=h-S.height;i.x+=y+f;i.y+=O;a.height=S.height;var A=null;if(t.color&&t.color.pattern){A=t.color.pattern}paintText(e.getId()+"_"+m,e.getModel().zIndex,i,a,b,C,A,null,null,p,o,t.tooltip,l,s);h=S.height;f+=S.width}i.y+=t.fontSize+t.lineSpacing}}function getTotalOffset(e,t){var i=e;var a=0;var n=0;var r=i.split(" ");if(e.indexOf("italic")>-1){var o=r[3];var l=r[2]}else{var o=r[2];var l=r[1]}for(var s=0;s<t.length;s++){var d=t[s].bold===true?"bold ":"normal ";var c=t[s].italic===true?"italic ":"";i=d+c+l+" "+o;a=measureTextDim(t[s].text,i);n+=a.width}return n}function getOffsetPositionY(e,t,i){if(e.verticalAlign===Mt["b"].Utils.Constants.TypeValues.labelVerticalAlignment.MIDDLE){return 0}else if(e.verticalAlign===Mt["b"].Utils.Constants.TypeValues.labelVerticalAlignment.BOTTOM){return t.height-(e.fontSize*i+e.lineSpacing*(i-1))*i}else{return 0}}function getOffsetPositionX(e,t){var i=e.dimension;if(isNaN(i.width)||e.textAnchor==="middle"||e.textAnchor==="end"){return 0}else{if(e.horizontalAlign===Mt["b"].Utils.Constants.TypeValues.labelHorizontalAlignment.MIDDLE){return i.width/2-t/2}else if(e.horizontalAlign===Mt["b"].Utils.Constants.TypeValues.labelHorizontalAlignment.RIGHT){return i.width-t}else{return 0}}}function drawTextInverted(e,t){var i=e.getModel();for(var a=0;a<t.children.length;a++){if((t.children[a].instanceOf=="TimeColumnModel"||t.children[a].instanceOf=="BarModel")&&t.children[a].dataId_expr==i.dataId_expr&&t.children[a].dataId_dim==i.dataId_dim&&i.id.split(".").pop()!="neg"&&i.id.split(".").pop()!="pos"){var n=t.children[a];if(n.isStack===true&&t.extendedModel.stackLabelAlignment=="In-Line"){var r=n.color.pattern;if(n.dataType==="Budget"){r=n.color.background}var o=parseRgbString(r);var l=parseRgbString(i.color);var s=l.r;var d=l.g;var c=l.b;if(o.r<128&&o.g<128&&o.b<128&&n.isHighlighted===false){s=255;d=255;c=255}else{s=0;d=0;c=0}i.color="rgb("+s+","+d+","+c+")";drawText(e,this);break}else{var s=0;var d=0;var c=0;i.color="rgb("+s+","+d+","+c+")";drawText(e,this);break}}else if((i.id.split(".").pop()=="neg"||i.id.split(".").pop()=="pos")&&t.children[a].dataId_dim){drawText(e,this);break}}}function drawText(e){var t=e.getModel();var i={x:t.position.x,y:t.position.y};var a=checkVariableInText(t.text);var n=isClickBehaviorEnabled(t);var r=t.originalText;var o=e.getController().getRootModel().extensionHash;if(t.instanceOf==="InlineModel"){n=!t.edit;if(r===t.placeholderText||t.text===r){r=null}}var l=/\n|<br>|<br \/>|<br\/>/;var s=a.split(l);var d=s.length;var c=t.fontWeight+" "+t.fontSize+"px '"+(t.font!=""?t.font:_)+"'";var u=t.id.indexOf(".buttonText")>0;for(var p=0;p<d;p++){var g=H.measureTextDim(s[p],c,t.lineSpacing);var h=getOffsetPositionX(t,g.width);var f=getOffsetPositionY(t,g,d);var m=i.x+h-.5;if(d>1){if(p>0){i.y=i.y+f+t.fontSize+t.lineSpacing}}if(!isNaN(m)&&!isNaN(i.y)){var v={x:m,y:i.y};var b=t.color;if(t.color&&t.color.pattern){b=t.color.pattern}paintText(t.id+"$"+p,t.zIndex,v,g,s[p],c,b,t.textAnchor,null,null,n||u,t.tooltip,r,o)}}}function isAxisNotationAndNotationType(e,t,i){var a=false;var n=undefined;for(var r=0;r<t.extendedModel.expressions.length;r++){if(t.extendedModel.expressions[r].labelPosition===i&&t.extendedModel.expressions[r].axisNotation){a=true;n=t.extendedModel.expressions[r].notation}}return{axisNotation:a,notationTypeId:n}}this.paintList=function(e){var t=e.getModel();if(t.hide){return}var i=e.getController().getRootModel().extensionHash;var a=t.fontWeight+" "+t.fontSize+"px '"+t.font+"'";var n=t.originalText;if(t.text===0||t.text==="0"||t.text===n){n=null}if(t.edit){var r=[{x:t.triangle.position.x,y:t.triangle.position.y},{x:t.triangle.position.x-t.triangle.dimension.width,y:t.triangle.position.y},{x:t.triangle.position.x-t.triangle.dimension.width/2,y:t.triangle.position.y+t.triangle.dimension.height}];paintSinglePolygon(t.id+"##triangle",t.zIndex+1,r,"fill",t.triangle.color,null,null,null,null,null,t.tooltip)}paintSingleRect(t.id+"##cellBackground",t.zIndex,t.background.position,t.background.dimension,"fill",t.color.background,null,null,null,null,null,t.tooltip);paintText(t.id,t.zIndex+2,t.position,t.dimension,t.text,a,t.color.pattern,null,null,null,!t.edit,t.tooltip,n,i,e)};this.paintInlineComment=function(e){var t=e.getModel();if(t.hide){return}paintSingleRect(t.id+"##cellBackground",t.zIndex-1,t.background.position,t.background.dimension,"fill",t.color.background,null,null,null,null,null,t.tooltip);addToDivsBuffer(createInlineDiv(e),null,null)};function createInlineDiv(e){var t=e.getModel(),i="left";if(t.originalText!==t.placeholderText){switch(t.textAnchor){case"start":i="left";break;case"center":i="center";break;case"end":i="right";break}}var a=t.lineHeight-t.fontSize,n=t.background.dimension.width-3,r=checkFormattingInText(checkVariableInText(t.text,"textDiv")),o=document.createElement("div");o.id=t.id+"-"+e.getController().getExtension().getId();o.className="comment HiCoInlineComment";o.className+=t.fixRowHeight?" HiCoInlineCommentFixedHeight":" HiCoInlineCommentLineBreak";o.className+=t.edit?" isEditable":"";o.style.width=n+"px";o.style.height=t.dimension.height+"px";o.style.top=t.position.y-a+.5+"px";o.style.left=t.position.x+.5+"px";o.style.fontSize=t.fontSize+"px";o.style.fontFamily='"'+t.font+'"';o.style.lineHeight="normal";o.style.zIndex=t.zIndex;o.style.textAlign=i;o.style.color=t.color.pattern;o.style.position="absolute";t.edit&&createTouchDummy(o,e);if(t.dimension.width>0&&t.dimension.height>0){if(t.fixRowHeight&&t.lines>1){o.innerHTML=setEllipsis(r,t)}else{o.innerHTML=r;if(!t.fixRowHeight){o.style.whiteSpace="normal";o.style.wordWrap="normal"}}var l=Mt["b"].DataObjects.DocumentDO.getApi().GlobalFeatureManager.Actions;if(l&&l.isEnabled&&l.Feature.supports("GoToURL")){var s=o.getElementsByTagName("a");for(var d=0;d<s.length;d++){var c=s.item(d);if(c.target){c.addEventListener("click",function(e){l.Feature.execute.GoToURL({url:e.target.href});e.preventDefault()})}}}}if(t.fixRowHeight){applyBiggestFontSize(o)}if(t.tooltip){o.title=t.tooltip}else{var u=t.originalText;if(u===t.placeholderText){u=null;o.classList.add("isEmpty")}var p=Mt["b"].DataObjects.InlineCommentRepo.getRepoAndRepresentationByViewModel(e).obj;window.setTimeout(function(){return Mt["b"].UI.Tooltip.createTooltip(o,p)},1e3)}return o}function setEllipsis(e,t){var i=t.fontWeight+" "+t.fontSize+"px '"+t.font+"'";h.setSpanFont(i);h.setSpanHTML(e);e=h.reduceToFirst();if(h.countBlockLevelElements(e)>0){var a=document.createElement("div");a.innerHTML=e;var n=a.firstChild;if(n.tagName==="OL"||n.tagName==="UL"){n.firstChild.innerHTML+="..."}else{n.innerHTML+="..."}e=a.innerHTML}else{e+="..."}return e}function applyBiggestFontSize(e){var t=h.countBlockLevelElements(e.innerHTML)>0;var i=parseInt(e.style.fontSize)||12;if(e.children[0]&&t){i=parseInt(e.children[0].style.fontSize)||i}var a=i;if(t){var n=e.innerHTML;e.innerHTML=e.children[0].innerHTML}for(var r=0,o=e.childNodes.length;r<o;r++){var l=e.childNodes[r];if(l.nodeName==="#text"&&l.textContent!=="..."){var s=document.createElement("span");s.style.fontSize=i+"px";s.appendChild(l);if(e.childNodes[r]){e.insertBefore(s,e.childNodes[r])}else{e.appendChild(s)}}else if(["B","I","U"].indexOf(l.nodeName)>-1){l.style.fontSize=i+"px"}else if(l.nodeName==="SPAN"){if(l.style.fontSize){var d=parseInt(l.style.fontSize);a=d>a?d:a}else{for(var c=0;c<l.children.length;++c){var d=parseInt(l.children[c].style.fontSize);a=d>a?d:a}}}}e.style.fontSize=a+"px";if(t){var u=e.innerHTML;e.innerHTML=n;e.children[0].innerHTML=u}}this.paintFlag=function(e){var t=e.getModel(),i="flagGroup_"+t.id;if(t.hide){return}t.clickDummy&&paintSingleRectTable(t.id+"##clickDummy",t.zIndex-1,t.clickDummy,t.clickDummy,"fill","#FFFFFF",null,null,null,i,!t.edit,t.tooltip);paintSingleRectTable(t.id+"##cellBackground",t.zIndex,t.position,t.dimension,"fill",t.color.background,null,null,null,i,!t.edit,t.tooltip);paintSingleRectTable(t.id,t.zIndex+1,t.position,t.dimension,"stroke",t.color.border,null,null,null,i,!t.edit,t.tooltip);if(t.text){var a=2;var n=[{x:t.position.x+a,y:Math.round(t.position.y+t.dimension.height/2)},{x:Math.round(t.dimension.width/2-a),y:Math.round(t.dimension.height/2-a+t.lineWidth)},{x:Math.round(t.dimension.width/2-a+t.lineWidth),y:2*a-t.dimension.height-t.lineWidth}];paintPath(t.id+"##tick",t.zIndex+1,n,null,"stroke",t.color.pattern,null,null,null,i,null,!t.edit,null)}G.push({groupId:i+"_"+e.getController().getRootModel().extensionHash+"_svg",toolTipModel:Mt["b"].DataObjects.InlineCommentRepo.getRepoAndRepresentationByViewModel(e).obj})};this.isEllipsis=function(e,t){var i,a=0,n;if("text"===e.tagName){n=e.style.fontWeight+" "+e.style.fontSize+" "+e.style.fontFamily;i=e.getComputedTextLength()}else{n="normal "+e.style.fontSize+" "+e.style.fontFamily;i=e.clientWidth;a=e.clientHeight}h.setSpanFont(n);h.setSpanHTML(t);var r=h.getSpanWidth();return r>i||a!==0&&r>a};this.paintBar=function(e){var t=e.getModel();if(t.isNaN){return}if(t.referencePointer&&Object.keys(t.referencePointer).length){t.zIndex+=200}if(e.getOrientation()==="horizontal"){this.paintBarTable(e);return}if(t.instanceOf==="TimeColumnModel"&&Math.abs(t.dimension.height)<.5){return}var i=isClickBehaviorEnabled(t);var a=t.position;var n={width:t.dimension.width-1,height:t.dimension.height-1};var r=t.highlightedCompare||t.isHighlighted;t.color["highlight"]=r?true:false;if(t.isOutlier===true){calcOutlier(e,t.notation,t.isAxisNotationAndCorrectPosition,r)}else{var o=t.zIndex-1;if(t.notation!==x.AXIS){if(t.otherPattern!==v.FILLED&&t.otherPattern!==v.EMPTY){paintSingleRect(t.id,o,a,n,"forecast",t.color,null,null,t.otherPattern,null,i)}else{var l=t.otherPattern===v.EMPTY?t.color.background:r?N:t.color.pattern;paintSingleRect(t.id,o,a,n,"fill",l,null,null,null,null,i)}paintSingleRect(t.id,t.zIndex,a,n,"stroke",r?N:t.color.border,null,null,null,null,i)}else{var l=r?N:t.color.border;paintSingleRect(t.id,o,a,n,"fill",l,null,null,null,null,i);paintSingleRect(t.id,t.zIndex,a,n,"stroke",l,null,null,null,null,i)}}};function paintOutlierTable(e){var t=e.getModel();var i=t.symbolSize;if(t.dimension.width<i){return}var a=Math.floor(i/2);var n=[];var r=0;var o=0;if(t.value>=0){o=t.position.x;r=o+i}else{r=t.position.x+t.dimension.width;o=r-i}var l=t.position.y+Math.round(t.dimension.height/2);var s=l-a;var d=l+a;if(t.value>=0){n=[{x:o,y:s},{x:r,y:l},{x:o,y:d},{x:o,y:s}]}else{n=[{x:r,y:s},{x:o,y:l},{x:r,y:d},{x:r,y:s}]}var c=t.highlightedCompare||t.isHighlighted;paintSinglePolygonTable(t.id+"_fill",t.zIndex-1,n,"fill",c?N:t.color.pattern,null);paintSinglePolygonTable(t.id,t.zIndex,n,"stroke",c?N:t.color.border,null)}this.paintBarTable=function(e){var t=e.getModel();var i=isClickBehaviorEnabled(t);if(t.isOutlier===true){paintOutlierTable(e)}else{if(t.instanceOf==="BarModel"&&Math.abs(t.dimension.width)<=.5){return}if(t.highlightedCompare||t.isHighlighted){if(t.notation===x.AXIS||t.notation===x.HEADER){paintSingleRectTable(t.id+"_fill",t.zIndex-1,t.position,t.dimension,"fill",N,null,null,null,null,i);paintSingleRectTable(t.id,t.zIndex,t.position,t.dimension,"stroke",N,null,null,null,null,i)}else{if(t.otherPattern!==v.FILLED&&t.otherPattern!==v.EMPTY){var a={border:N,pattern:N,background:t.color.background};paintSingleRectTable(t.id+"_fill",t.zIndex-1,t.position,t.dimension,"forecast",a,null,null,t.otherPattern,null,i)}else{var a=t.otherPattern===v.FILLED?N:t.color.background;paintSingleRectTable(t.id+"_fill",t.zIndex-1,t.position,t.dimension,"fill",a,null,null,t.otherPattern,null,i)}paintSingleRectTable(t.id,t.zIndex,t.position,t.dimension,"stroke",N,null,null,null,null,i)}}else{if(t.notation===x.AXIS||t.notation===x.HEADER){paintSingleRectTable(t.id+"_fill",t.zIndex-1,t.position,t.dimension,"fill",t.color.pattern,null,null,t.otherPattern,null,i);paintSingleRectTable(t.id,t.zIndex,t.position,t.dimension,"stroke",t.color.border,null,null,null,null,i)}else{if(t.otherPattern!==v.FILLED&&t.otherPattern!==v.EMPTY){var a={border:t.color.border,pattern:t.color.pattern,background:t.color.background};paintSingleRectTable(t.id+"_fill",t.zIndex-1,t.position,t.dimension,"forecast",a,null,null,t.otherPattern,null,i)}else{var a=t.otherPattern===v.FILLED?t.color.pattern:t.color.background;paintSingleRectTable(t.id+"_fill",t.zIndex-1,t.position,t.dimension,"fill",a,null,null,t.otherPattern,null,i)}paintSingleRectTable(t.id,t.zIndex,t.position,t.dimension,"stroke",t.color.border,null,null,null,null,i)}}}};this.paintLineChart=function(e){var t=e.getModel();if(t.isNaN){return}if(t.zIndex<=200){t.zIndex+=200}if(e.getOrientation()==="horizontal"){this.paintLineChartTable(e);return}var i=e.getController();var a=i.getRootModel();var n="";var r=isClickBehaviorEnabled(t);var o=t.id.split(".");var l=o[0];var s=Mt["b"].Factories.ModelFactory.getModelById(a,l);var d=s.extendedModel.expressions;for(var c=0;c<d.length;c++){if(t.dataId_expr===d[c].id.split(".").pop()){n=d[c].representation}}var u=t.highlightedCompare||t.isHighlighted;t.color["highlight"]=u?true:false;var p=t.lineWidth;var g=t.lineStyle;if(t.isOutlier===true){if(t.valueType==="FACTOR_NONE"){return}calcOutlier(e,t.notation,t.isAxisNotationAndCorrectPosition,u)}else{if((n===T.LINE||n===T.SYMBOL_LINE)&&t.isNextOutlier===false){var h=this.getLineChartCords(e,n);var f=t.zIndex-2;var m=u?N:t.color.pattern;if(t.dataType==="Actual"||t.concept==="conceptType.1"||t.dataType==="Budget"||t.dataType==="Forecast"){if(h.length===3){paintPolyLine(e.getId(),f,[h[1],h[0]],"stroke",m,p,g,null,null,null,null,r);paintPolyLine(e.getId(),f,[h[1],h[2]],"stroke",m,p,g,null,null,null,null,r);paintSingleCircle(e.getId(),f,h[1],p/2,"fill",m,null,null,null,null,null,r)}else if(e.getNextPosition().x!==0){paintPolyLine(e.getId(),f,[h[0],h[1]],"stroke",m,p,g,null,null,null,null,r);paintSingleCircle(e.getId(),f,h[0],p/2,"fill",m,null,null,null,null,null,r)}else if(e.getPreviousPosition().x!==0){paintPolyLine(e.getId(),f,[h[1],h[0]],"stroke",m,p,g,null,null,null,null,r);paintSingleCircle(e.getId(),f,h[1],p/2,"fill",m,null,null,null,null,null,r)}}}if(n!==T.LINE){selectRodHead(e,u)}}};this.paintLineChartTable=function(e){var t=e.getModel();var i=t.highlightedCompare||t.isHighlighted;var a=isClickBehaviorEnabled(t);if(t.isOutlier){paintOutlierTable(e)}else{if(t.lineWidth!==0){var n=this.getLineChartCordsTable(e);var r=i?N:t.color.pattern;paintPolyLine(t.id,t.zIndex-2,n,"stroke",r,t.lineWidth,t.lineStyle,null,null,null,null,a)}if(t.needleSize!==0){t.needledim={height:t.needleSize,width:t.needleSize};var o=t.needleSize/2;t.needlepos={};if(t.value>=0){t.needlepos.x=t.position.x+t.dimension.width-Math.floor(o)}else{t.needlepos.x=t.position.x-Math.round(o)}t.needlepos.y=t.position.y+Math.round(t.dimension.height/2-t.needleSize/2);selectRodHeadTable(e,i)}}};this.getLineChartCords=function(e){var t=[];var i=e.getPreviousPosition().x;var a=e.getPreviousPosition().y;var n=e.getPosition().x;var r=e.getPosition().y;var o=e.getNextPosition().x;var l=e.getNextPosition().y;var s=e.getDimension().height;var d=e.getDimension().width;if(e.getModel().shapeSymbol===g.DIAMOND){var c=Math.round((d-d/Math.sqrt(2))/2);n+=c;r+=c;d=Math.round(d/Math.sqrt(2));s=Math.round(s/Math.sqrt(2))}if(i!==0&&o!==0){t=[{x:parseInt((i+n)/2+d/2),y:(a+r)/2+s/2},{x:parseInt(n+d/2),y:r+s/2},{x:parseInt((n+o)/2+d/2),y:(r+l)/2+s/2}]}else if(o!==0){t=[{x:parseInt(n+d/2),y:r+s/2},{x:parseInt((n+o)/2+d/2),y:(r+s+l)/2}]}else if(i!==0){t=[{x:parseInt((i+n)/2+d/2),y:(a+r)/2+s/2},{x:parseInt(n+d/2),y:r+s/2}]}return t};this.getLineChartCordsTable=function(e){var t=[];var i=e.getDimension().height/2+e.getPosition().y;var a=e.getModel().value<0?e.getPosition().x:e.getPosition().x+e.getDimension().width;var n=e.getPreviousPosition().x;var r=e.getNextPosition().x;if(n!==0&&r!==0){t=[{x:Math.floor((n+a)/2),y:Math.floor((e.getPreviousPosition().y+i)/2)},{x:a,y:Math.floor(i)},{x:Math.floor((r+a)/2),y:Math.floor((e.getNextPosition().y+i)/2)}]}else if(n!==0){t=[{x:Math.floor((n+a)/2),y:Math.floor((e.getPreviousPosition().y+i)/2)},{x:a,y:Math.floor(i)}]}else if(r!==0){t=[{x:a,y:Math.floor(i)},{x:Math.floor((r+a)/2),y:Math.floor((e.getNextPosition().y+i)/2)}]}return t};this.paintConnector=function(e){var t=e.getModel().position;if(e.getModel().show){if(e.getModel().valueRowLabelPosition&&e.getModel().valueRowLabelPosition.indexOf("structureLegendType")>=0){var i=e.getModel();var a={x1:i.position.x,y1:i.position.y,x2:i.position.x,y2:i.position.y+i.dimension.height};paintSingleLine(i.id,i.zIndex,a,i.color,i.dimension.width,i.id)}else{var n=e.getModel().representationId.split(".");var r=n[0];var o=e.getController().getRootModel();var l=Mt["b"].Factories.ModelFactory.getModelById(o,r);var s=l.extendedModel.expressions;var d="";for(var c=0;c<s.length;c++){if(e.getModel().name===s[c].name){d=s[c].representation;break}}var u=getConnectorColor(e);var p=e.getModel().representationPosition;var g=e.getModel().representationDimWidth;var h=e.getDimension();if(e.getModel().valueRowLabelPosition&&e.getModel().valueRowLabelPosition.split(".")[0].substr(0,4)==="Left"){if(p.x!=0&&p.y!=0){var f=p.x;if(d===T.LINE){f+=g}var m=e.getModel().labelEndPositionX;var v={x:m,y:cordCorrectionSVG(t.y)};var b={width:f-v.x,height:h.height};var a={x1:v.x,y1:v.y,x2:v.x+b.width,y2:v.y-1e-4};paintSingleLine(r+"."+e.getId(),e.getModel().zIndex,a,u,b.height,e.getId())}}else if(e.getModel().valueRowLabelPosition&&e.getModel().valueRowLabelPosition.split(".")[0].substr(0,5)==="Right"){var f=p.x;if(d===T.LINE){f=f+g/2}else{f=f+g}var m=e.getModel().labelEndPositionX;var v={x:m,y:cordCorrectionSVG(t.y)};var b={width:f-v.x,height:h.height};var a={x1:v.x,y1:v.y-.001,x2:v.x+b.width,y2:v.y};paintSingleLine(r+"."+e.getId(),e.getModel().zIndex,a,u,b.height,e.getId())}}}};function getConnectorColor(e){var t=ot["a"].colorActualBorder;var i=ot["a"].colorForecastBorder;var a=ot["a"].colorPreviousBorder;var n=e.getModel().concept;var r="";var o=e.getModel().dataType;var l=e.getModel().baseColorSettings;var s=Mt["b"].Factories.ModelFactory.getModelById(e.getController().getRootModel(),e.getModel().representationId);if(s.color.border!==null&&s.color.border!==undefined){r=s.color.border}else if(s.instanceOf==="LabelModel"){r=s.color}else if(s.instanceOf.indexOf("Waterfall")!==-1){if(s.concept===p.AREA||s.concept===p.AREA_SHAPE||s.notation!=="notationType.0"){if(s.waterfallType!==1){if(s.isRatedPositive&&s.value>=0||!s.isRatedPositive&&s.value<=0){r=s.baseColorSettings.areaPositivecolor}else{r=s.baseColorSettings.areaNegativecolor}}else{r=s.baseColorSettings.areaNegativecolor}}else if(s.concept===p.AREA_COLOR||s.concept===p.AREA_COLOR_SHAPE||s.concept===p.COLOR){if(s.waterfallType!==1){if(s.isRatedPositive&&s.value>=0||!s.isRatedPositive&&s.value<=0){r=s.baseColorSettings.colorPositivecolor}else{r=s.baseColorSettings.colorNegativecolor}}else{r=s.baseColorSettings.colorNegativecolor}}}else if(n===p.AREA){if(o==="Actual"){r=t}else if(o==="dataType.2"){r="rgb(50,50,50)"}else if(o==="Budget"){r=a}else if(o==="Forecast"){r=i}}else if(n===p.SHAPE){if(o==="Actual"){r=t}else if(o==="Budget"){r="black"}else if(o==="Forecast"){r=i}else if(o==="dataType.2"){r="black"}}else if(n===p.AREA_SHAPE){if(o==="Actual"){r=t}else if(o==="Budget"){r=a}else if(o==="Forecast"){r=i}else if(o==="dataType.2"){r="black"}}else if(n===p.AREA_COLOR||n===p.AREA_COLOR_SHAPE||n===p.COLOR){r=l.colorColor}return r}this.paintDataAnnotator=function(e){var t=e.getModel();if(t.dimension.height===1){var i={x1:t.position.x,y1:t.position.y,x2:t.position.x+t.dimension.width,y2:t.position.y};paintSingleLine(t.id,t.zIndex,i,t.color.border,1,t.id)}else{paintSingleRectTable(t.id,t.zIndex,t.position,t.dimension,"stroke",t.color.border);if(t.otherPattern!==v.FILLED&&t.otherPattern!==v.EMPTY){var a={border:t.color.border,pattern:t.color.pattern,background:t.color.background};paintSingleRectTable(t.id+"_fill",t.zIndex-1,t.position,t.dimension,"forecast",a,null,null,t.otherPattern)}else{var a=t.otherPattern===v.FILLED?t.color.pattern:t.color.background;paintSingleRectTable(t.id+"_fill",t.zIndex-1,t.position,t.dimension,"fill",a)}}};this.paintNeedle=function(e){var t=e.getPosition();var i=e.getDimension();var a=e.getModel();if(a.isNaN){return}var n=isClickBehaviorEnabled(a);var r=a.highlightedCompare||a.isHighlighted;if(a.isOutlier===true){paintOutlierTable(e)}else{var o=a.lineWidth;if(a.valueType==="FACTOR_NONE"){o=0}var l=a.needleSize;var s=l/2;var d=t.y+Math.floor(i.height/2);var c={x1:t.x,y1:d,x2:t.x+i.width,y2:d};paintSingleLineCentered(a.id+"_line",a.zIndex-2,c,r?N:"rgb(0,0,0)",o,null,n);if(a.value>=0){a.needlepos.x=t.x+i.width-Math.floor(s)}else{a.needlepos.x=t.x-Math.round(s)}a.needlepos.y=t.y+Math.round(i.height/2-l/2);a.needledim.height=l;a.needledim.width=l;selectRodHeadTable(e,r)}};function drawShapeForConceptShape(e,t,i,a,n){var r=t.getModel();var o=isClickBehaviorEnabled(r);var l=0;if(r.labelPosition==="timePositionType.0"||r.labelPosition==="timePositionType.1"){l=90}else if(r.labelPosition==="timePositionType.5"||r.labelPosition==="timePositionType.6"){l=-90}var s;var d;if(r.instanceOf==="TimeLineModel"){s=r.position.x;d=t.getValue()>=0?r.position.y:r.position.y-1}else if(r.instanceOf==="RodModel"){s=r.linePos.x-Math.round(i/2);d=r.needlepos.y}else{s=r.position.x;d=r.value>=0?r.position.y:r.position.y-1}switch(e){case g.SQUARE:drawPinQuadColored(s,d,i,a,2,null,t,n,o);break;case g.TRIANGLE:drawPinTriColored(s,d,i,a,null,l,t,n,o);break;case g.DIAMOND:var c=Math.round(i/Math.sqrt(2));var u=(i-c)/2;d+=u;s+=u;drawPinQuadColored(s,d,c,a,2,45,t,n,o);break;case g.CIRCLE:drawPinRoundColored(s,d,i,a,2,t,n,o)}}this.paintRod=function(e){var t=e.getModel();if(t.isNaN){return}var i=t.highlightedCompare||t.isHighlighted;var a=isClickBehaviorEnabled(t);t.color["highlight"]=i?true:false;if(t.isOutlier===true){if(t.valueType==="FACTOR_NONE"){return}calcOutlier(e,t.notation,t.isAxisNotationAndCorrectPosition,i)}else{var n={x1:Math.floor(t.linePos.x)+.5,y1:t.linePos.y,x2:Math.floor(t.linePos.x)+.51,y2:t.linePos.y+t.lineDim.height};paintSingleLine(t.id,t.zIndex-2,n,i?N:"rgb(0,0,0)",t.lineDim.width,null,a);selectRodHead(e,i)}};function selectRodHead(e,t){var i=e.getModel();var a=i.dataType;var n=i.shapeSymbol;var r=i.needleSize!==undefined&&i.needleSize!==null?i.needleSize:i.dimension.width;if(i.zIndex<=200){i.zIndex+=200}drawShapeForConceptShape(n,e,r,a,t)}function selectRodHeadTable(e,t){var i=e.getModel();var a=i.needlepos;if(i.zIndex<=200){i.zIndex+=200}switch(i.shapeSymbol){case g.SQUARE:drawPinQuadColoredTable(a.x,a.y,0,e,t);break;case g.DIAMOND:drawPinQuadColoredTable(a.x,a.y,45,e,t);break;case g.TRIANGLE:drawPinTriColoredTable(a.x,a.y,0,e,t);break;case g.CIRCLE:drawPinRoundColoredTable(a.x,a.y,i.needleSize,e,t)}}function drawPinRoundColoredTable(e,t,i,a,n){var r=a.getModel();var o=isClickBehaviorEnabled(r);var l=n?N:r.color.pattern;var s=n?N:r.color.border;var d={x:e+i/2,y:t+i/2};var c=r.notation;var u=c===x.ELEMENT||c===x.ELEMENT_HEADER||c===x.ELEMENT_AXIS;if(u===true){paintSingleCircle(r.id,r.zIndex,d,i/2,"stroke",s,null,null,null,null,null,o);if(r.otherPattern!==v.FILLED&&r.otherPattern!==v.EMPTY){var p={border:s,pattern:l,background:r.color.background};paintSingleCircle(r.id,r.zIndex-1,d,i/2,"forecast",p,null,null,r.otherPattern,null,null,o)}else{var p=r.otherPattern===v.FILLED?l:r.color.background;paintSingleCircle(r.id,r.zIndex-1,d,i/2,"fill",p,null,null,null,null,null,o)}}else{paintSingleCircle(r.id,r.zIndex,d,i/2,"stroke",s,null,null,null,null,null,o);paintSingleCircle(r.id,r.zIndex-1,d,i/2,"fill",l,null,null,null,null,null,o)}}function drawPinQuadColoredTable(e,t,i,a,n){var r=a.getModel();var o=isClickBehaviorEnabled(r);var l=r.zIndex;var s=n?N:r.color.pattern;var d=n?N:r.color.border;var c={x:e,y:t};var u=r.notation;var p=u===x.ELEMENT||u===x.ELEMENT_HEADER||u===x.ELEMENT_AXIS;if(p===true){paintSingleRectTable(r.id,l,c,r.needledim,"stroke",d,null,i);if(r.otherPattern!==v.FILLED&&r.otherPattern!==v.EMPTY){var g={border:d,pattern:s,background:r.color.background};paintSingleRectTable(r.id+"_fill",l-1,c,r.needledim,"forecast",g,null,i,r.otherPattern,null,o)}else{var g=r.otherPattern===v.FILLED?s:r.color.background;paintSingleRectTable(r.id+"_fill",l-1,c,r.needledim,"fill",g,null,i,r.otherPattern,null,o)}}else{paintSingleRectTable(r.id,l,c,r.needledim,"stroke",d,null,i,null,null,o);paintSingleRectTable(r.id+"_fill",l-1,c,r.needledim,"fill",s,null,i,r.otherPattern,null,o)}}this.paintWaterfall=function(e){var t=e.getModel();if(t.zIndex<=200){t.zIndex+=200}if(e.getOrientation()==="horizontal"){this.paintStructureWaterfall(e);return}var i=e.getPosition();var a={width:t.dimension.width>=1?t.dimension.width-1:0,height:t.dimension.height>=1?t.dimension.height-1:0};var n=isClickBehaviorEnabled(t);var r=t.highlightedCompare||t.isHighlighted;t.color["highlight"]=r?true:false;var o=r?N:t.color.border;var l=r?N:t.color.pattern;var s=t.concept;var d=t.notation;if(t.isOutlier===true){calcOutlier(e,d,t.isAxisNotationAndCorrectPosition,r)}else if(a.width>.5||a.width<-.5){var c=t.zIndex+1;if(d===x.AXIS){paintSingleRect(e.getId(),t.zIndex,i,a,"fill",r?N:t.color.border)}else{if(s===p.AREA||s===p.AREA_COLOR||s===p.AREA_SHAPE||s===p.AREA_COLOR_SHAPE){paintSingleRect(e.getId(),c,i,a,"stroke",o,null,null,null,null,n);if(t.otherPattern!==v.FILLED&&t.otherPattern!==v.EMPTY){paintSingleRect(e.getId(),t.zIndex,i,a,"forecast",t.color,null,null,t.otherPattern,null,n)}else{var u=t.otherPattern===v.FILLED?l:t.color.background;paintSingleRect(e.getId(),t.zIndex,i,a,"fill",u,null,null,null,null,n)}}else{paintSingleRect(e.getId(),c,i,a,"stroke",o,null,null,null,null,n);paintSingleRect(e.getId(),t.zIndex,i,a,"fill",l,null,null,null,null,n)}}}};this.paintStructureWaterfall=function(e){var t=e.getModel();var i=isClickBehaviorEnabled(t);if(t.isOutlier===true){paintOutlierTable(e);return}else if(Math.abs(t.dimension.width)<=.5){return}var a,n;if(t.highlightedCompare||t.isHighlighted){a=n=N}else{a=t.color.pattern;n=t.color.border}var r=t.position;var o=t.dimension;if((t.notation===x.ELEMENT||t.notation===x.ELEMENT_HEADER||t.notation===x.ELEMENT_AXIS)&&(t.concept===p.AREA||t.concept===p.AREA_SHAPE||t.concept===p.AREA_COLOR||t.concept===p.AREA_COLOR_SHAPE)){paintSingleRectTable(t.id,t.zIndex+1,r,o,"stroke",n,null,null,null,null,i);if(t.otherPattern!==v.FILLED&&t.otherPattern!==v.EMPTY){var l={border:n,pattern:a,background:t.color.background};paintSingleRectTable(t.id+"_fill",t.zIndex,r,o,"forecast",l,null,null,t.otherPattern,null,i)}else{var l=t.otherPattern===v.FILLED?a:t.color.background;paintSingleRectTable(t.id+"_fill",t.zIndex,r,o,"fill",l,null,null,null,null,i)}}else{paintSingleRectTable(t.id+"_fill",t.zIndex,r,o,"fill",a,null,null,null,null,i);paintSingleRectTable(t.id,t.zIndex+1,r,o,"stroke",n,null,null,null,null,i)}};this.paintTimeScalingHelper=function(e){var t=e.getModel();var i={width:t.dimension.width,height:Math.abs(t.dimension.height)};var a={x:t.position.x,y:t.dimension.height>=0?t.position.y:t.position.y+t.dimension.height};paintSingleRect(t.id,1,a,i,"fill",t.areaColor);var n={x1:t.position.x,y1:t.position.y+t.dimension.height,x2:t.position.x+t.dimension.width,y2:t.position.y+t.dimension.height};paintSingleLine(t.id+"Line",2,n,t.lineColor,t.lineWidth,t.id+"Line")};this.paintStructureScalingHelper=function(e){var t=e.getModel();var i=parseInt(t.id.charAt(t.id.length-1))-1;i*=2;var a=Math.abs(t.dimension.width);var n=t.dimension.width>=0?t.position.x:t.position.x-a;var r={width:a,height:t.dimension.height};var o={x:n,y:t.position.y};paintSingleRectTable(t.id,t.zIndex+i,o,r,"fill",t.areaColor);var l=Math.floor(t.lineWidth/2);var n=t.position.x+t.dimension.width-l;var s={x1:n,y1:t.position.y,x2:n,y2:t.position.y+t.dimension.height};if(t.dimension.width>=0){s.x1--;s.x2--}paintSingleLine(t.id+"Line",t.zIndex+i+1,s,t.lineColor,t.lineWidth,t.id+"Line")};this.paintPercentStackLine=function(e){var t;var i=e.getModel();var a=i.position.x;var n=i.position.y;if(i.orientation==="vertical"){if(i.id.substr(-3)==="pos"){t={x1:a-i.dimension.width+1,y1:i.position.y,x2:a-i.dimension.width+1,y2:i.position.y+i.dimension.height}}else{t={x1:a,y1:i.position.y,x2:a,y2:i.position.y+i.dimension.height}}paintSingleLine(i.id,i.zIndex,t,i.color,i.dimension.width,i.id);var r=Math.round(i.arrowWidth/2);if(i.arrowPosition==="Start"){t=[{x:a,y:n},{x:a+r,y:n-i.arrowHeight},{x:a-r,y:n-i.arrowHeight},{x:a,y:n}]}else{var o=n+i.dimension.height-1;t=[{x:a,y:o},{x:a+r,y:o+i.arrowHeight},{x:a-r,y:o+i.arrowHeight},{x:a,y:o}]}paintSinglePolygonTable(i.id+"_arrow",i.zIndex,t,"fill",i.color,null,i.id+"_arrow")}else{t={x1:i.position.x,y1:i.position.y,x2:i.position.x+i.dimension.width,y2:i.position.y};paintSingleLine(i.id,i.zIndex,t,i.color,i.dimension.height,i.id);var l=Math.round(i.arrowHeight/2);n=n+Math.floor(i.dimension.height/2);if(i.arrowPosition==="Start"){t=[{x:a,y:n},{x:a-i.arrowWidth,y:n-l},{x:a-i.arrowWidth,y:n+l},{x:a,y:n}]}else{var s=a+i.dimension.width-1;t=[{x:s,y:n},{x:s+i.arrowWidth,y:n-l},{x:s+i.arrowWidth,y:n+l},{x:s,y:n}]}paintSinglePolygonTable(i.id+"_arrow",i.zIndex,t,"fill",i.color,null,i.id+"_arrow")}};function paintSingleLine(e,t,i,a,n,r,o){if(a===undefined||a===null){a="rgb(250,0,120)"}var l=rgb2hex(a);a=l.color;var s={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2};if(s.x1===s.x2){s.x1+=n/2;s.x2+=n/2}else if(s.y1===s.y2){s.y1+=n/2;s.y2+=n/2}var d=document.createElementNS("http://www.w3.org/2000/svg","line");d.setAttributeNS(null,"stroke-width",n);d.setAttributeNS(null,"x1",s.x1);d.setAttributeNS(null,"y1",s.y1);d.setAttributeNS(null,"x2",s.x2);d.setAttributeNS(null,"y2",s.y2);d.setAttributeNS(null,"stroke",a);d.id=e;if(o){d.style.cursor="pointer"}addToElementsBuffer(d,t)}function paintSingleLineCentered(e,t,i,a,n,r,o){if(a===undefined||a===null){a="rgb(250,0,120)"}var l=rgb2hex(a);a=l.color;var s,d,c,u;if(i.y1===i.y2){s=i.x1;d=i.x2}else{s=i.x1+.5;d=i.x2+.5}if(i.x1===i.x2){c=i.y1;u=i.y2}else{c=i.y1+.5;u=i.y2+.5}var p=document.createElementNS("http://www.w3.org/2000/svg","line");p.setAttributeNS(null,"stroke-width",n);p.setAttributeNS(null,"x1",s);p.setAttributeNS(null,"y1",c);p.setAttributeNS(null,"x2",d);p.setAttributeNS(null,"y2",u);p.setAttributeNS(null,"stroke",a);p.id=e;if(o){p.style.cursor="pointer"}addToElementsBuffer(p,t)}function paintSinglePolygon(e,t,i,a,n,r,o,l,s,d,c){if(a!=="forecast"){if(n===undefined||n===null){n="rgb(250,0,120)"}var u=rgb2hex(n);n=u.color}if(i.length===0){return}var p=document.createElementNS("http://www.w3.org/2000/svg","polygon");if(e.indexOf("compare")!==-1){p.style.cursor="pointer"}p.id=e;if(a==="stroke"){var g=[0,0];if(r==="line1"||r==="1"||r===E.SOLID){g=[-1,-1]}else if(r==="line2"||r===E.DASHED){g=[4,4]}else if(r==="line3"||r===E.DOTTED){g=[6,2,6,4]}else if(r==="line4"){g=[1,1,1,1]}if(g[0]>0&&g[1]>0){p.setAttributeNS(null,"stroke-dasharray",g)}p.setAttributeNS(null,"stroke",n);if(s!==null&&s!==undefined){p.setAttributeNS(null,"stroke-width",s)}p.setAttributeNS(null,"fill","none")}else if(a==="fill"){if(u.alpha!==undefined&&u.alpha!==null){p.setAttributeNS(null,"fill-opacity",u.alpha)}p.setAttributeNS(null,"fill",n)}var h="";if(d){for(var f=0;f<i.length;f++){h+=i[f].x+","+i[f].y+","}}else{for(var f=0;f<i.length;f++){h+=cordCorrectionSVG(i[f].x)+","+cordCorrectionSVG(i[f].y)+","}}h=h.substr(0,h.length-1);p.setAttributeNS(null,"points",h);if(c){var m=document.createElementNS("http://www.w3.org/2000/svg","title");m.textContent=c;p.appendChild(m)}if(o!==null&&o!==undefined){addToGroupsBuffer(o,p,t)}else{addToElementsBuffer(p,t)}}function paintSinglePolygonTable(e,t,i,a,n,r,o,l,s){if(a!=="forecast"){var d=rgb2hex(n);n=d.color}var c=document.createElementNS("http://www.w3.org/2000/svg","polygon");if(e.indexOf("compare")!==-1){c.style.cursor="pointer"}c.id=e;if(a==="stroke"){var u=[0,0];if(r==="line1"||r==="1"||r===E.SOLID){u=[-1,-1]}else if(r==="line2"||r===E.DASHED){u=[10,4]}else if(r==="line3"||r===E.DOTTED){u=[6,2,6,4]}else if(r==="line4"){u=[1,1,1,1]}if(u[0]>0&&u[1]>0){c.setAttributeNS(null,"stroke-dasharray",u)}c.setAttributeNS(null,"stroke",n);if(s!==null&&s!==undefined){c.setAttributeNS(null,"stroke-width",s)}c.setAttributeNS(null,"fill","none")}else if(a==="fill"){if(d.alpha!==undefined&&d.alpha!==null){c.setAttributeNS(null,"fill-opacity",d.alpha)}c.setAttributeNS(null,"fill",n)}var p="";for(var g=0;g<i.length;g++){p+=i[g].x+.5+","+(i[g].y+.5)+","}p=p.substr(0,p.length-1);c.setAttributeNS(null,"points",p);if(o!==null&&o!==undefined){addToGroupsBuffer(o,c,t)}else{addToElementsBuffer(c,t)}}function paintSingleCircleConnector(e,t,i,a,n,r,o,l,s,d,c){if(a==0){return}if(n!=="forecast"&&r!=="none"){if(r===undefined||r===null){r="rgb(250,0,120)"}var u=rgb2hex(r);r=u.color}var p=document.createElementNS("http://www.w3.org/2000/svg","circle");p.id=e;if(n==="stroke"){p.setAttributeNS(null,"stroke",r);p.setAttributeNS(null,"fill","none");if(c!==null&&c!==undefined){p.setAttributeNS(null,"stroke-width",c)}}else if(n==="fill"){if(u.alpha!==undefined&&u.alpha!==null){p.setAttributeNS(null,"fill-opacity",u.alpha)}p.setAttributeNS(null,"fill",r)}p.setAttributeNS(null,"cx",i.x);p.setAttributeNS(null,"cy",i.y);p.setAttributeNS(null,"r",a);if(d!==null&&d!==undefined){addToGroupsBuffer(d,p,t)}else{addToElementsBuffer(p,t)}}function paintSingleCircle(e,t,i,a,n,r,o,l,s,d,c,u,p){if(a==0){return}if(n!=="forecast"&&r!=="none"){if(r===undefined||r===null){r="rgb(250,0,120)"}var g=rgb2hex(r);r=g.color}var h=document.createElementNS("http://www.w3.org/2000/svg","circle");h.id=e;if(u){h.style.cursor="pointer"}if(n==="stroke"){h.setAttributeNS(null,"stroke",r);if(c!==null&&c!==undefined){h.setAttributeNS(null,"stroke-width",c)}h.setAttributeNS(null,"fill","none")}else if(n==="fill"){if(g.alpha!==undefined&&g.alpha!==null){h.setAttributeNS(null,"fill-opacity",g.alpha)}h.setAttributeNS(null,"fill",r)}else if(n==="forecast"){var f=Math.random();createOtherPattern("forecast","2",r,e+f,l,s);h.setAttributeNS(null,"fill","url('"+y+"#"+e+f+"')")}else if(n==="clip"||n==="clear"){var m=document.createElementNS("http://www.w3.org/2000/svg","clipPath");m.id="clip"+e}h.setAttributeNS(null,"cx",cordCorrectionSVG(i.x));h.setAttributeNS(null,"cy",cordCorrectionSVG(i.y));h.setAttributeNS(null,"r",a);if(e.indexOf("object")!==-1&&e.indexOf("commentReference")!==-1){return h}if(d!==null&&d!==undefined){addToGroupsBuffer(d,h,t)}else{if(m!==undefined&&m!==null){m.appendChild(h);addToElementsBuffer(m,t)}else{addToElementsBuffer(h,t)}}}function paintPolyLine(e,t,i,a,n,r,o,l,s,d,c,u){if(i.length===0){return}if(n===undefined||n===null){n="rgb(250,0,120)"}var p=rgb2hex(n);n=p.color;var g=document.createElementNS("http://www.w3.org/2000/svg","polyline");g.id=e;if(u){g.style.cursor="pointer"}if(a==="stroke"){var h=[0,0];if(o==="line1"||o==="1"||o===E.SOLID){h=[-1,-1]}else if(o==="dashed"||o===E.DASHED){h=[10,4]}else if(o==="dotted"||o===E.DOTTED){h=[1,2]}else if(o==="line4"){h=[1,1,1,1]}if(h[0]>0&&h[1]>0){g.setAttributeNS(null,"stroke-dasharray",h)}g.setAttributeNS(null,"stroke",n);g.setAttributeNS(null,"stroke-width",r);g.setAttributeNS(null,"fill","none")}else if(a==="fill"){g.setAttributeNS(null,"fill",n);if(p.alpha!==undefined&&p.alpha!==null){g.setAttributeNS(null,"fill-opacity",p.alpha)}}else if(a==="forecast"){var f=Math.random();createOtherPattern("forecast","2",n,e+f,null,c);g.setAttributeNS(null,"fill","url('"+y+"#"+e+f+"')")}if(s!==null&&s!==undefined){var m="";for(var v=0;v<s.length-1;v++){m+=s[v]+","}m+=s[s.length-1];g.setAttributeNS(null,"stroke-dasharray",m)}if(d===true){g.setAttributeNS(null,"stroke-linecap","round")}var b="";for(var v=0;v<i.length;v++){b+=cordCorrectionSVG(i[v].x)+","+cordCorrectionSVG(i[v].y)+","}b=b.substr(0,b.length-1);g.setAttributeNS(null,"points",b);if(l!==null&&l!==undefined){addToGroupsBuffer(l,g,t)}else{addToElementsBuffer(g,t)}}function paintPolyLineTable(e,t,i,a,n,r,o,l,s,d){var c=rgb2hex(n);n=c.color;var u=document.createElementNS("http://www.w3.org/2000/svg","polyline");u.id=e;if(a==="stroke"){var p=[0,0];if(o==="line1"||o==="1"||o===E.SOLID){p=[-1,-1]}else if(o==="dashed"||o===E.DASHED){p=[10,4]}else if(o==="dotted"||o===E.DOTTED){p=[1,2]}else if(o==="line4"){p=[1,1,1,1]}if(p[0]>0&&p[1]>0){u.setAttributeNS(null,"stroke-dasharray",p)}u.setAttributeNS(null,"stroke",n);u.setAttributeNS(null,"stroke-width",r);u.setAttributeNS(null,"fill","none")}else if(a==="fill"){u.setAttributeNS(null,"fill",n);if(c.alpha!==undefined&&c.alpha!==null){u.setAttributeNS(null,"fill-opacity",c.alpha)}}if(s!==null&&s!==undefined){var g="";for(var h=0;h<s.length-1;h++){g+=s[h]+","}g+=s[s.length-1];u.setAttributeNS(null,"stroke-dasharray",g)}if(d===true){u.setAttributeNS(null,"stroke-linecap","round")}var f="";for(var h=0;h<i.length;h++){f+=i[h].x+.5+","+(i[h].y+.5)+","}f=f.substr(0,f.length-1);u.setAttributeNS(null,"points",f);if(l!==null&&l!==undefined){addToGroupsBuffer(l,u,t)}else{addToElementsBuffer(u,t)}}function paintSingleEllipse(e,t,i,a,n,r,o,l,s){if(i.length===0){return}if(n===undefined||n===null){n="rgb(250,0,120)"}var d=rgb2hex(n);n=d.color;var c=document.createElementNS("http://www.w3.org/2000/svg","ellipse");c.id=e;if(e.indexOf("compare")!==-1){c.style.cursor="pointer"}if(a==="stroke"){var u=[0,0];if(r==="line1"||r==="1"||r===E.SOLID){u=[-1,-1]}else if(r==="line2"||r===E.DASHED){u=[10,4]}else if(r==="line3"||r===E.DOTTED){u=[6,2,6,4]}else if(r==="line4"){u=[1,1,1,1]}if(u[0]>0&&u[1]>0){c.setAttributeNS(null,"stroke-dasharray",u)}c.setAttributeNS(null,"stroke",n);c.setAttributeNS(null,"fill","#FFFFFF");c.setAttributeNS(null,"fill-opacity","0");if(l===undefined||l===null){l=1}if(l!=undefined){c.setAttributeNS(null,"stroke-width",l)}}else if(a==="fill"){c.setAttributeNS(null,"fill",n);if(d.alpha!==undefined&&d.alpha!==null){c.setAttributeNS(null,"fill-opacity",d.alpha)}}else if(a==="forecast"){var p=Math.random();createOtherPattern("forecast","2",n,e+p,null,s);c.setAttributeNS(null,"fill","url('"+y+"#"+e+p+"')")}var g=cordCorrectionSVG(i.cx);var h=cordCorrectionSVG(i.cy);var f=cordCorrectionSVG(i.rx);var m=cordCorrectionSVG(i.ry);if(f%1!==0&&g%1!==0){g=parseInt(g)}c.setAttributeNS(null,"cx",g);c.setAttributeNS(null,"cy",h);c.setAttributeNS(null,"rx",f);c.setAttributeNS(null,"ry",m);if(o!==null&&o!==undefined){addToGroupsBuffer(o,c,t)}else{addToElementsBuffer(c,t)}}function paintSingleRect(e,t,i,a,n,r,o,l,s,d,c,u,p){if(a.width==0||a.height==0){return}if(n!=="forecast"&&r!=="none"){if(r===undefined||r===null){r="rgb(250,0,120)"}var g=rgb2hex(r);r=g.color}if(a.width<0){i.x+=a.width;a.width=-a.width}if(a.height<0){i.y+=a.height;a.height=-a.height}var h=document.createElementNS("http://www.w3.org/2000/svg","rect");h.id=e;if(c){h.style.cursor="pointer"}if(n==="stroke"){var f=[0,0];if(o==="line1"||o==="1"||o===E.SOLID){f=[-1,-1]}else if(o==="line2"||o===E.DASHED){f=[10,4]}else if(o==="line3"||o===E.DOTTED){f=[6,2,6,4]}else if(o==="line4"){f=[1,1,1,1]}if(f[0]>0&&f[1]>0){h.setAttributeNS(null,"stroke-dasharray",f)}h.setAttributeNS(null,"stroke-width","1");h.setAttributeNS(null,"stroke",r);h.setAttributeNS(null,"fill","none")}else if(n==="fill"){if(g.alpha!==undefined&&g.alpha!==null){h.setAttributeNS(null,"fill-opacity",g.alpha)}h.setAttributeNS(null,"fill",r)}else if(n==="forecast"){var m=Math.random();createOtherPattern("forecast","2",r,e+m,l,s);h.setAttributeNS(null,"fill","url('"+y+"#"+e+m+"')")}else if(n==="clip"||n==="clear"){var v=document.createElementNS("http://www.w3.org/2000/svg","clipPath");v.id="clip"+e}h.setAttributeNS(null,"width",dimCorrectionSVG(a.width));h.setAttributeNS(null,"height",dimCorrectionSVG(a.height));if(a.width>1){h.setAttributeNS(null,"x",cordCorrectionSVG(i.x));h.setAttributeNS(null,"y",cordCorrectionSVG(i.y));if(n==="fill"){h.setAttributeNS(null,"width",dimCorrectionSVG(a.width)-1);h.setAttributeNS(null,"height",dimCorrectionSVG(a.height)-1);h.setAttributeNS(null,"x",cordCorrectionSVG(i.x)+.5);h.setAttributeNS(null,"y",cordCorrectionSVG(i.y)+.5)}}else{h.setAttributeNS(null,"x",dimCorrectionSVG(i.x));h.setAttributeNS(null,"y",dimCorrectionSVG(i.y))}if(l!==undefined&&l!==null){var b="rotate("+l+","+cordCorrectionSVG(i.x+a.width/2)+","+cordCorrectionSVG(i.y+a.height/2)+")";h.setAttributeNS(null,"transform",b)}if(u!=null){var T=document.createElementNS("http://www.w3.org/2000/svg","title");T.textContent=u;h.appendChild(T)}if(p){for(var x in p){h["on"+x]=p[x]}}if(d!==null&&d!==undefined){addToGroupsBuffer(d,h,t)}else if(v!==undefined&&v!==null){v.appendChild(h);addToElementsBuffer(v,t)}else{addToElementsBuffer(h,t)}}function paintSingleRectTable(e,t,i,a,n,r,o,l,s,d,c,u){if(a.width<=0||a.height<=0){return}else if(a.width===1){var p=n==="forecast"?r.border:r;var g={x1:i.x,y1:i.y,x2:i.x,y2:i.y+a.height};paintSingleLine(e,t,g,p,a.width,e)}else if(a.width===1||a.height===1){var p=n==="forecast"?r.border:r;var g={x1:i.x,y1:i.y,x2:i.x+a.width,y2:i.y};paintSingleLine(e,t,g,p,a.height,e)}if(n!=="forecast"&&r!=="none"){if(r===undefined||r===null){r="rgb(250,0,120)"}var h=rgb2hex(r);r=h.color}var f=document.createElementNS("http://www.w3.org/2000/svg","rect");if(e.indexOf("compare")!==-1){f.style.cursor="pointer"}f.id=e;if(c){f.style.cursor="pointer"}if(n==="stroke"){var m=[0,0];if(o==="line1"||o==="1"||o===E.SOLID){m=[-1,-1]}else if(o==="line2"||o===E.DASHED){m=[10,4]}else if(o==="line3"||o===E.DOTTED){m=[6,2,6,4]}else if(o==="line4"){m=[1,1,1,1]}if(m[0]>0&&m[1]>0){f.setAttributeNS(null,"stroke-dasharray",m)}f.setAttributeNS(null,"stroke-width","1");f.setAttributeNS(null,"stroke",r);f.setAttributeNS(null,"fill","none")}else if(n==="fill"){if(h.alpha!==undefined&&h.alpha!==null){f.setAttributeNS(null,"fill-opacity",h.alpha)}f.setAttributeNS(null,"fill",r)}else if(n==="forecast"){var v=Math.random();createOtherPattern("forecast","2",r,e+v,l,s,true);f.setAttributeNS(null,"fill","url('"+y+"#"+e+v+"')")}else if(n==="clip"||n==="clear"){var b=document.createElementNS("http://www.w3.org/2000/svg","clipPath");b.id="clip"+e}f.setAttributeNS(null,"width",a.width-1);f.setAttributeNS(null,"height",a.height-1);f.setAttributeNS(null,"x",i.x+.5);f.setAttributeNS(null,"y",i.y+.5);if(l!==undefined&&l!==null){f.setAttributeNS(null,"transform","rotate("+l+","+(i.x+.5+a.width/2)+","+(i.y+.5+a.height/2)+")")}if(u!=null){var T=document.createElementNS("http://www.w3.org/2000/svg","title");T.textContent=u;f.appendChild(T)}if(d!==null&&d!==undefined){addToGroupsBuffer(d,f,t)}else if(b!==undefined&&b!==null){b.appendChild(f);addToElementsBuffer(b,t)}else{addToElementsBuffer(f,t)}}function paintPath(e,t,i,a,n,r,o,l,s,d,c,u,p){if(i.length===0){return}if(n!=="forecast"){if(r===undefined||r===null){r="rgb(250,0,120)"}var g=rgb2hex(r);r=g.color}var h=document.createElementNS("http://www.w3.org/2000/svg","path");h.id=e;if(u){h.style.cursor="pointer"}if(n==="stroke"){var f=[0,0];if(o==="line1"||o==="1"||o===E.SOLID){f=[-1,-1]}else if(o==="line2"||o===E.DASHED){f=[10,4]}else if(o==="line3"||o===E.DOTTED){f=[6,2,6,4]}else if(o==="line4"){f=[1,1,1,1]}if(f[0]>0&&f[1]>0){h.setAttributeNS(null,"stroke-dasharray",f)}if(c!==null&&c!==undefined){h.setAttributeNS(null,"stroke-width",c)}else{h.setAttributeNS(null,"stroke-width","1")}h.setAttributeNS(null,"stroke",r);h.setAttributeNS(null,"fill","none")}else if(n==="fill"){h.setAttributeNS(null,"fill",r);if(g.alpha!==undefined&&g.alpha!==null){h.setAttributeNS(null,"fill-opacity",g.alpha)}}else if(n==="forecast"){var m=Math.random();createOtherPattern("forecast","2",r,e+m,null,s);h.setAttributeNS(null,"fill","url('"+y+"#"+e+m+"')")}else if(n==="clip"||n==="clear"){var v=document.createElementNS("http://www.w3.org/2000/svg","clipPath");v.id="clip"+e}var b="M"+i[0].x+" "+i[0].y;for(var T=1;T<i.length;T++){b+="l"+i[T].x+" "+i[T].y}h.setAttributeNS(null,"d",b);if(l!==undefined&&l!==null){h.setAttributeNS(null,"transform","rotate("+l+","+Math.round(a.x)+","+Math.round(a.y)+")")}if(p){var x=document.createElementNS("http://www.w3.org/2000/svg","title");x.textContent=p;h.appendChild(x)}if(d!==null&&d!==undefined){addToGroupsBuffer(d,h,t)}else if(v!==undefined&&v!==null){v.appendChild(h);addToElementsBuffer(v,t)}else{addToElementsBuffer(h,t)}return h}function drawPinRoundColored(e,t,i,a,n,r,o,l){var s=r.getModel();var d=t;var c=e;if(r!==undefined&&r!==null){if(s.instanceOf==="TimeLineModel"){c+=s.dimension.width/2;d+=s.dimension.height/2}else if(s.instanceOf==="RodModel"){c+=s.dimension.width/2;d+=i/2}}var u={x:c,y:d};var p=o?N:s.color.pattern;var g=o?N:s.color.border;paintSingleCircle(r.getId(),s.zIndex,u,i/2,"stroke",g,null,null,null,null,null,l);if(s.notation===x.AXIS){paintSingleCircle(r.getId(),s.zIndex-1,u,i/2,"fill",p,null,null,null,null,null,l)}else{if(s.otherPattern!==v.FILLED&&s.otherPattern!==v.EMPTY){paintSingleCircle(r.getId(),s.zIndex-1,u,i/2,"forecast",s.color,null,null,s.otherPattern,null,null,l)}else{var g=s.otherPattern===v.FILLED?p:s.color.background;paintSingleCircle(r.getId(),s.zIndex-1,u,i/2,"fill",g,null,null,null,null,null,l)}}}function drawPinQuadColored(e,t,i,a,n,r,o,l,s){var d=o.getModel();var c={x:e,y:t};var u={width:i,height:i};var p=l?N:d.color.pattern;var g=l?N:d.color.border;paintSingleRect(o.getId(),d.zIndex,c,u,"stroke",g,null,r,null,null,s);if(d.notation===x.AXIS){paintSingleRect(o.getId(),d.zIndex-1,c,u,"fill",p,null,r,null,null,s)}else{if(d.otherPattern!==v.FILLED&&d.otherPattern!==v.EMPTY){paintSingleRect(o.getId(),d.zIndex-1,c,u,"forecast",d.color,null,r,d.otherPattern,null,s)}else{var g=d.otherPattern===v.FILLED?p:d.color.background;paintSingleRect(o.getId(),d.zIndex-1,c,u,"fill",g,null,r,null,null,s)}}}function drawPinTriColored(e,t,i,a,n,r,o,l,s){var d=o.getModel();var c=i*1.3;var u=t;var p=e;if(o!==undefined){if(d.instanceOf==="TimeLineModel"){p-=d.dimension.width/4;u-=d.dimension.height/2}else if(d.instanceOf==="RodModel"){p-=c/5;u-=d.needledim.height/4}else{p-=d.dimension.width/2;u-=d.dimension.height/2}}var g=[{x:p,y:u},{x:Math.sin(0)*c,y:Math.cos(0)*c},{x:Math.sin(Math.PI*2/3)*c,y:Math.cos(Math.PI*2/3)*c},{x:Math.sin(Math.PI*4/3)*c,y:Math.cos(Math.PI*4/3)*c},{x:Math.sin(0)*c,y:Math.cos(0)*c}];var h={x:p+c/2+1,y:u+c/2};var f=l?N:d.color.pattern;var m=l?N:d.color.border;paintPath(o.getId(),d.zIndex,g,h,"stroke",m,null,-90+r,null,null,null,s);if(d.notation===x.AXIS){paintPath(o.getId(),d.zIndex-1,g,h,"fill",f,null,-90+r,null,null,null,s)}else{if(d.otherPattern!==v.FILLED&&d.otherPattern!==v.EMPTY){paintPath(o.getId(),d.zIndex-1,g,h,"forecast",d.color,null,-90+r,d.otherPattern,null,null,s)}else{var m=d.otherPattern===v.FILLED?f:d.color.background;paintPath(o.getId(),d.zIndex-1,g,h,"fill",m,null,-90+r,null,null,null,s)}}}function drawPinTriColoredTable(e,t,i,a,n){var r=a.getModel();var o=isClickBehaviorEnabled(r);var l=r.needleSize*1.1;var s;var d=n?N:r.color.pattern;var c=n?N:r.color.border;if(r.positioning===rt["a"].structurePosition.TOP_TOP||r.positioning===rt["a"].structurePosition.MID_TOP){s=[{x:e,y:t},{x:l,y:0},{x:-l/2,y:Math.sin(Math.PI*2/3)*l},{x:-l/2,y:Math.sin(Math.PI*4/3)*l}]}else{s=[{x:e,y:t+r.needleSize},{x:l,y:0},{x:-l/2,y:-Math.sin(Math.PI*2/3)*l},{x:-l/2,y:-Math.sin(Math.PI*4/3)*l}]}var u={x:e+l/2,y:t+l/2};paintPath(r.id,r.zIndex,s,u,"stroke",c,null,i,null,null,null,o);var p=r.notation;if(p===x.ELEMENT||p===x.ELEMENT_HEADER||p===x.ELEMENT_AXIS){if(r.otherPattern!==v.FILLED&&r.otherPattern!==v.EMPTY){var g={border:c,pattern:d,background:r.color.background};paintPath(r.id,r.zIndex-1,s,u,"forecast",g,null,i,r.otherPattern,null,null,o)}else{var g=r.otherPattern===v.FILLED?d:r.color.background;paintPath(r.id,r.zIndex-1,s,u,"fill",g,null,i,null,null,null,o)}}else{paintPath(r.id,r.zIndex-1,s,u,"fill",c,null,i,null,null,null,o)}}function calcOutlier(e,t,i,a){var n=e.getPosition();var r=e.getDimension();if(e.getModel().valueType==="FACTOR_NONE"){return}var o;if(e.getModel().instanceOf==="TimeColumnModel"||e.getModel().instanceOf==="TimeLineModel"||e.getModel().instanceOf==="TimeWaterfallModel"){o=r.height}else if(e.getModel().instanceOf==="RodModel"){o=e.getModel().needledim.height}var l=n.x+parseInt(r.width/2)-parseInt(o/2);var s=n.y;var d={x:l,y:s};var c={width:o,height:o};paintOutlier(e.getModel().zIndex,e.getModel().id,d,c,e.getValue()>0,e.getModel().isRatedPositive,"vertical",e.getModel().color,a)}function paintOutlier(e,t,i,a,n,r,o,l,s){if(a.height===0||a.width===0){return}var d;var c=a.height;var u;var p=a.width;if(p<0){p=-p}var g=s?N:l.pattern;var h=s?N:l.border;var f;if(o==="vertical"){f=lt["a"].mm2pix(R.getParameter("MMPT_TIME_OUTLIER_DISTANCE")*M)}else{f=lt["a"].mm2pix(R.getParameter("MMPT_STRUCTURE_OUTLIER_DISTANCE")*M)}var m=[];p=parseInt(p);d=p/c;u=d.toString().split(".");u=parseInt(u[0]);var v=u;if(isNaN(v)){q["a"].log("woops")}if(!isNaN(v)){var b=0;var T=0;var x=0;var E=0;var y=0;var C=0;var S=0;if(o=="vertical"){if(n===true){E=i.y-f;C=E;y=E-c}else{E=i.y+f;C=E+c;y=E}b=i.x;x=b;T=parseInt(b+p);S=parseInt(b+p/2)}else if(o==="horizontal"){if(n===true){b=i.x+f+2;T=b+c;x=b}else{b=i.x-f;T=b;x=b-c}E=i.y;y=E-2;C=y+a.height;S=(y+C)/2}if(n===true){if(o=="vertical"){m=[{x:x,y:C},{x:S,y:y},{x:T,y:C},{x:x,y:C}];paintSinglePolygon(t,e,m,"stroke",h,null);paintSinglePolygon(t,e-1,m,"fill",g,null)}else if(o==="horizontal"){m=[{x:x,y:y},{x:T,y:S},{x:x,y:C},{x:x,y:y}];paintSinglePolygon(t,e,m,"stroke",h,null);paintSinglePolygon(t,e-1,m,"fill",g,null)}}else{if(o=="vertical"){m=[{x:x,y:y},{x:S,y:C},{x:T,y:y},{x:x,y:y}];paintSinglePolygon(t,e,m,"stroke",h,null);paintSinglePolygon(t,e-1,m,"fill",g,null)}else if(o==="horizontal"){m=[{x:T,y:y},{x:x,y:S},{x:T,y:C},{x:T,y:y}];paintSinglePolygon(t,e,m,"stroke",h,null);paintSinglePolygon(t,e-1,m,"fill",g,null)}}}}this.paintCompare=function(e){var t=e.getModel();if(t.active===false){return}var i=ot["a"].colorCompareLine,a=ot["a"].colorCompareText,n=e.getPosition(),r=e.getDimension(),o=Mt["b"].Utils.Constants.TypeValues.indicator,l=Mt["b"].Utils.Constants.TypeValues.shape;var s=t.id.replace("tableContainer","chart").replace("containerModel","");var d=t.font.fWeight+" "+t.font.fSize+"px"+(t.font.fType!=""?" '"+t.font.fType+"'":"");var c=t.fromPosition.y;var u=t.fromPosition.x;var p=t.toPosition.y;var g=t.toPosition.x;var h=n.y+Math.round(r.height/2);var f;var m=t.positive?0:180;f=getCompareColor(t,o);var v=t.headBaseSize;var b=t.headWidth;var T=t.headLength;var x=[{x:u,y:c},{x:u,y:h}];paintPolyLineTable(t.id,t.zIndex,x,"stroke",i,"1","",s);var x=[{x:g,y:p},{x:g,y:h}];paintPolyLineTable(t.id,t.zIndex,x,"stroke",i,"1","",s);var E=(u+g)/2;var y=t.compareStyle;if(y===o.NOTATION){y=R.getParameter("COMPARE_DEFAULT_TYPE")}if(y===o.ARROW){if(t.arrowType==0){this.paintPixelArrow(e,f,E,h,r.width,v,T,b,m,s)}else{if(t.arrowType==1){this.paintPixelArrow(e,f,E,h,r.width,v,T,b,m,s)}else{this.paintPixelArrow(e,f,E,h,r.width,v,0,0,m,s)}}}else{var C={width:r.width,height:v};var S={x:n.x+.5,y:h-Math.round(v/2)};paintSingleRectTable("pinCompare."+t.id,t.zIndex,S,C,"fill",f,null,null,null,s)}if(t.compareConnector===l.CIRCLE){var M=h;var y=t.compareStyle;if(y===o.NOTATION){y=R.getParameter("COMPARE_DEFAULT_TYPE")}if(y!==o.ARROW){M=h-Math.round(v/2)+v/2}paintCircleConnector(t,M,p,g,c,u,s)}else if(t.compareConnector===l.TRIANGLE){paintTriangleConnector(t,n,r,s,u,c,g,p,m)}if(t.ellipse===true){var O=t.ellipseArray.x;var A=t.ellipseArray.y;var _=t.ellipseArray.height;var L=t.ellipseArray.width;this.paintEllipse(e,O,A,L/2,_*P,w,true,t.ellipseStrokeWidth,s,t.zIndex+10)}if(t.absolute.legend!==o.NONE){var C={height:t.font.fSize,width:t.absolute.dimension.width};var S={x:t.absolute.position.x,y:t.absolute.position.y-1.5};if(t.ellipse===false){paintSingleRect(t.id+".absolute",t.zIndex+10,S,C,"fill","rgb(255,255,255,0.7)","solid",0,null,s)}S={x:t.absolute.position.x,y:t.absolute.position.y};paintText(t.id+".absolute",t.zIndex+20,S,C,t.absolute.text,d,a,null,s)}if(t.percent.legend!==o.NONE){var C={height:t.font.fSize,width:t.percent.dimension.width};var S={x:t.percent.position.x,y:t.percent.position.y-1.5};if(t.ellipse===false){paintSingleRect(t.id+".percent",t.zIndex+10,S,C,"fill","rgb(255,255,255,0.7)","solid",0,null,s)}S={x:t.percent.position.x,y:t.percent.position.y};paintText(t.id+".percent",t.zIndex+20,S,C,t.percent.text,d,a,null,s)}if(t.text.legend!==o.NONE&&t.text.text!==""){var C={height:t.font.fSize,width:t.text.dimension.width};var S={x:t.text.position.x,y:t.text.position.y-1.5};if(t.ellipse===false){paintSingleRect(t.id+".text",t.zIndex+10,S,C,"fill","rgb(255,255,255,0.7)","solid",0,null,s)}S={x:t.text.position.x,y:t.text.position.y};paintText(t.id+".text",t.zIndex+20,S,C,t.text.text,d,a,null,s)}if(t.absolute.isHighlighted||t.text.isHighlighted||t.percent.isHighlighted){var I=setHighlightEllipse(e);for(var D=0;D<I.length;D++){this.paintEllipse(e,I[D].x,I[D].y,I[D].width,I[D].height,N,false,t.ellipseStrokeWidth,s,t.zIndex)}}};function setHighlightEllipse(e){var t=e.getModel();var i=[];var a=Mt["b"].Utils.Constants.TypeValues.indicator;if(t.text.isHighlighted&&t.text.legend!==a.NONE&&t.text.text!==""){var n={x:0,y:0,width:0,height:0,realWidth:0,realHeight:0,type:null,pos:null};n.x=t.text.position.x+t.text.dimension.width/2;n.y=t.text.position.y+t.text.dimension.height/2-1;n.width=t.text.dimension.width*b;n.realWidth=t.text.dimension.width;n.height=t.text.dimension.height*P;n.realHeight=t.text.dimension.height;n.type=a.TEXT;n.pos=t.text.legend;i.push(n)}if(t.absolute.isHighlighted&&t.absolute.legend!==a.NONE){var n={x:0,y:0,width:0,height:0,realWidth:0,realHeight:0,type:null,pos:null};n.x=t.absolute.position.x+t.absolute.dimension.width/2;n.y=t.absolute.position.y+t.absolute.dimension.height/2-1;n.width=t.absolute.dimension.width*b;n.realWidth=t.absolute.dimension.width;n.height=t.absolute.dimension.height*P;n.realHeight=t.absolute.dimension.height;n.type=a.ABSOLUTE;n.pos=t.absolute.legend;i.push(n)}if(t.percent.isHighlighted&&t.percent.legend!==a.NONE){var n={x:0,y:0,width:0,height:0,realWidth:0,realHeight:0,type:null,pos:null};n.x=t.percent.position.x+t.percent.dimension.width/2;n.y=t.percent.position.y+t.percent.dimension.height/2-1;n.width=t.percent.dimension.width*b;n.realWidth=t.percent.dimension.width;n.height=t.percent.dimension.height*P;n.realHeight=t.percent.dimension.height;n.type=a.PERCENT;n.pos=t.percent.legend;i.push(n)}function intersect(e,t,i,a){return e>i&&e<a||i>e&&i<t||e===i||t===a}for(var r=0;r<i.length;r++){for(var o=0;o<i.length;o++){var l=i[r];var s=i[o];if(l.type===s.type){continue}var d=intersect(l.x-l.width,l.x+l.width,s.x-s.width,s.x+s.width);var c=intersect(l.y-l.height/2,l.y+l.height/2,s.y-s.height/2,s.y+s.height/2);if(d&&c){var n={x:0,y:0,width:0,height:0,realWidth:0,realHeight:0,type:null};n.x=(l.x+s.x)/2;n.y=l.y<s.y?l.y+s.realHeight/2:s.y+l.realHeight/2;n.realWidth=Math.max(l.realWidth,s.realWidth);n.realHeight=l.realHeight+s.realHeight;n.width=n.realWidth*b;n.height=n.realHeight*P;i.splice(o,1);o=0;i.splice(r,1);r=0;i.push(n)}}}return i}function paintCircleConnector(e,t,i,a,n,r,o){var l={x:a,y:t};paintSingleCircleConnector(e.id,e.zIndex+1,l,e.compareConnectorSize/2,"fill",e.compareConnectorColor,"solid",null,null,o);paintSingleCircleConnector(e.id,e.zIndex+2,l,e.compareConnectorSize/2,"stroke",e.compareConnectorBorderColor,"solid",null,null,o,e.compareConnectorBorderSize);l={x:r,y:t};paintSingleCircleConnector(e.id,e.zIndex+1,l,e.compareConnectorSize/2,"fill",e.compareConnectorColor,"solid",null,null,o);paintSingleCircleConnector(e.id,e.zIndex+2,l,e.compareConnectorSize/2,"stroke",e.compareConnectorBorderColor,"solid",null,null,o,e.compareConnectorBorderSize);l={x:r,y:n};paintSingleCircle(e.id,e.zIndex+1,l,e.compareConnectorSize/2,"fill",e.compareConnectorColor,"solid",null,null,null);paintSingleCircle(e.id,e.zIndex+2,l,e.compareConnectorSize/2,"stroke",e.compareConnectorBorderColor,"solid",null,null,null,e.compareConnectorBorderSize);l={x:a,y:i};paintSingleCircle(e.id,e.zIndex+1,l,e.compareConnectorSize/2,"fill",e.compareConnectorColor,"solid",null,null,null);paintSingleCircle(e.id,e.zIndex+2,l,e.compareConnectorSize/2,"stroke",e.compareConnectorBorderColor,"solid",null,null,null,e.compareConnectorBorderSize)}function paintTriangleConnector(e,t,i,a,n,r,o,l,s){var d=Math.round(t.y+i.height/2);var c=Math.round(t.y+i.height/2+e.compareConnectorSize/2);var u=Math.round(t.x+e.compareConnectorSize);var p=Math.round(t.y+i.height/2-e.compareConnectorSize/2);var g=Math.round(t.x-e.compareConnectorSize);if(s===180){var h=[{x:u,y:c},{x:u,y:p},{x:g,y:d},{x:u,y:c}]}else{var h=[{x:g,y:c},{x:g,y:p},{x:u,y:d},{x:g,y:c}]}paintSinglePolygonTable(e.id,e.zIndex+1,h,"fill",e.compareConnectorColor,null,a);paintSinglePolygonTable(e.id,e.zIndex+2,h,"stroke",e.compareConnectorBorderColor,"solid",a,null,e.compareConnectorBorderSize);g=Math.round(t.x-e.compareConnectorSize+i.width);u=Math.round(t.x+e.compareConnectorSize+i.width);if(s===180){h=[{x:u,y:c},{x:u,y:p},{x:g,y:d},{x:u,y:c}]}else{h=[{x:g,y:c},{x:g,y:p},{x:u,y:d},{x:g,y:c}]}paintSinglePolygonTable(e.id,e.zIndex+1,h,"fill",e.compareConnectorColor,null,a);paintSinglePolygonTable(e.id,e.zIndex+2,h,"stroke",e.compareConnectorBorderColor,"solid",a,null,e.compareConnectorBorderSize);c=Math.round(r-e.compareConnectorSize/2);p=Math.round(r+e.compareConnectorSize/2);g=Math.round(n-e.compareConnectorSize);u=Math.round(n+e.compareConnectorSize);d=r;if(s===180){h=[{x:u,y:c},{x:u,y:p},{x:g,y:d},{x:u,y:c}]}else{h=[{x:g,y:c},{x:g,y:p},{x:u,y:d},{x:g,y:c}]}paintSinglePolygonTable(e.id,e.zIndex+1,h,"fill",e.compareConnectorColor,null,null);paintSinglePolygonTable(e.id,e.zIndex+2,h,"stroke",e.compareConnectorBorderColor,"solid",null,null,e.compareConnectorBorderSize);c=Math.round(l-e.compareConnectorSize/2);p=Math.round(l+e.compareConnectorSize/2);g=Math.round(o-e.compareConnectorSize);u=Math.round(o+e.compareConnectorSize);d=l;if(s===180){h=[{x:u,y:c},{x:u,y:p},{x:g,y:d},{x:u,y:c}]}else{h=[{x:g,y:c},{x:g,y:p},{x:u,y:d},{x:g,y:c}]}paintSinglePolygonTable(e.id,e.zIndex+1,h,"fill",e.compareConnectorColor,null,null);paintSinglePolygonTable(e.id,e.zIndex+2,h,"stroke",e.compareConnectorBorderColor,"solid",null,null,e.compareConnectorBorderSize)}this.paintTimeCompare=function(e){var t=e.getModel();if(t.active===false){return}var i=ot["a"].colorCompareLine;var a=ot["a"].colorCompareText;var n=e.getPosition();var r=e.getDimension();var o=Mt["b"].Utils.Constants.TypeValues.indicator;var l=t.id.replace("containerModel","").replace("tableContainer","chart");var s=t.font.fWeight+" "+t.font.fSize+"px"+(t.font.fType!=""?" '"+t.font.fType+"'":"");var d=t.fromPosition.x.toString();var c=t.fromPosition.y.toString();var u=t.toPosition.x.toString();var p=t.toPosition.y.toString();var g=n.x+r.width/2;var h;var f=t.positive?90:270;h=getCompareColor(t,o);var m=t.headBaseSize;var v=t.headWidth;var b=t.headLength;var T=[{x:d,y:c},{x:g,y:c}];paintPolyLine(t.id,t.zIndex,T,"stroke",i,"1","",l);var T=[{x:u,y:p},{x:g,y:p}];paintPolyLine(t.id,t.zIndex,T,"stroke",i,"1","",l);var x=n.y+t.preferredDimension.height/2;var E=t.compareStyle;if(E===o.NOTATION){E=R.getParameter("COMPARE_DEFAULT_TYPE")}if(E===o.ARROW){if(t.arrowType==0){this.paintPixelArrow(e,h,g,x,r.height,m,b,v,f,l)}else{var y=0;if(t.arrowType==1){this.paintPixelArrow(e,h,g,x+y,r.height,m,b,v,f,l)}else{this.paintPixelArrow(e,h,g,x+y,r.height,m,0,0,f,l)}}}else{var C={width:m,height:r.height};var S={x:g-m/2,y:n.y};paintSingleRect("pinCompare."+t.id,t.zIndex,S,C,"fill",h,null,null,null,l)}if(t.compareConnector==="circle"){paintCircleConnectorTime(t,g+.5,c,d,p,u,l)}else if(t.compareConnector==="triangle"){paintTriangleConnectorTime(t,n,r,l,parseFloat(d),parseFloat(c),parseFloat(u),parseFloat(p),f)}if(t.ellipse===true){for(var M=0;M<t.ellipseArray.length;M++){var O=t.ellipseArray[M].x;var A=t.ellipseArray[M].y-1;var _=t.ellipseArray[M].height;var L=t.ellipseArray[M].width;this.paintEllipse(e,O,A,L/2,_*P,w,true,t.ellipseStrokeWidth,l,t.zIndex+20)}}if(t.absolute.legend!==o.NONE){var C={height:t.font.fSize,width:t.absolute.dimension.width};var S={x:t.absolute.position.x,y:t.absolute.position.y-1.5};if(t.ellipse===false){paintSingleRect(t.id+".absolute",t.zIndex+20,S,C,"fill","rgb(255,255,255,0.7)","solid",0,null,l)}S={x:t.absolute.position.x,y:t.absolute.position.y};paintText(t.id+".absolute",t.zIndex+30,S,C,t.absolute.text,s,a,null,l)}if(t.percent.legend!==o.NONE){var C={height:t.font.fSize,width:t.percent.dimension.width};var S={x:t.percent.position.x,y:t.percent.position.y-1.5};if(t.ellipse===false){paintSingleRect(t.id+".percent",t.zIndex+20,S,C,"fill","rgb(255,255,255,0.7)","solid",0,null,l)}S={x:t.percent.position.x,y:t.percent.position.y};paintText(t.id+".percent",t.zIndex+30,S,C,t.percent.text,s,a,null,l)}if(t.text.legend!==o.NONE&&t.text.text!==""){var C={height:t.font.fSize,width:t.text.dimension.width};var S={x:t.text.position.x,y:t.text.position.y-1.5};if(t.ellipse===false){paintSingleRect(t.id+".text",t.zIndex+20,S,C,"fill","rgb(255,255,255,0.7)","solid",0,null,l)}S={x:t.text.position.x,y:t.text.position.y};paintText(t.id+".text",t.zIndex+30,S,C,t.text.text,s,a,null,l)}if(t.absolute.isHighlighted||t.text.isHighlighted||t.percent.isHighlighted){var I=setHighlightEllipse(e);for(var M=0;M<I.length;M++){this.paintEllipse(e,I[M].x,I[M].y,I[M].width,I[M].height,N,false,t.ellipseStrokeWidth,l,t.zIndex)}}};function paintTriangleConnectorTime(e,t,i,a,n,r,o,l,s){var d=t.x+i.width/2;d=roundToHalf(d);var c=Math.round(t.y-e.compareConnectorSize);var u=Math.round(t.x-.5+e.compareConnectorSize/2+i.width/2);var p=Math.round(t.y+e.compareConnectorSize);var g=Math.round(t.x-.5-e.compareConnectorSize/2+i.width/2);if(s===270){var h=[{x:cordCorrectionSVG(g),y:cordCorrectionSVG(c)},{x:cordCorrectionSVG(u),y:cordCorrectionSVG(c)},{x:d,y:cordCorrectionSVG(p)},{x:cordCorrectionSVG(g),y:cordCorrectionSVG(c)}]}else{var h=[{x:d,y:cordCorrectionSVG(c)},{x:cordCorrectionSVG(u),y:cordCorrectionSVG(p)},{x:cordCorrectionSVG(g),y:cordCorrectionSVG(p)},{x:d,y:cordCorrectionSVG(c)}]}paintSinglePolygon(e.id,e.zIndex+1,h,"fill",e.compareConnectorColor,null,a,null,null,true);paintSinglePolygon(e.id,e.zIndex+2,h,"stroke",e.compareConnectorBorderColor,"solid",a,null,e.compareConnectorBorderSize,true);c+=i.height;p+=i.height;if(s===270){h=[{x:cordCorrectionSVG(g),y:cordCorrectionSVG(c)},{x:cordCorrectionSVG(u),y:cordCorrectionSVG(c)},{x:d,y:cordCorrectionSVG(p)},{x:cordCorrectionSVG(g),y:cordCorrectionSVG(c)}]}else{h=[{x:d,y:cordCorrectionSVG(c)},{x:cordCorrectionSVG(u),y:cordCorrectionSVG(p)},{x:cordCorrectionSVG(g),y:cordCorrectionSVG(p)},{x:d,y:cordCorrectionSVG(c)}]}paintSinglePolygon(e.id,e.zIndex+1,h,"fill",e.compareConnectorColor,null,a,null,null,true);paintSinglePolygon(e.id,e.zIndex+2,h,"stroke",e.compareConnectorBorderColor,"solid",a,null,e.compareConnectorBorderSize,true);c=Math.round(r-e.compareConnectorSize);c=cordCorrectionSVG(c);u=Math.round(n+e.compareConnectorSize/2);u=cordCorrectionSVG(u);p=Math.round(r+e.compareConnectorSize);p=cordCorrectionSVG(p);g=Math.round(n-e.compareConnectorSize/2);g=cordCorrectionSVG(g);d=g+e.compareConnectorSize/2;d=roundToHalf(d);if(s===270){h=[{x:g,y:c},{x:u,y:c},{x:d,y:p},{x:g,y:c}]}else{h=[{x:d,y:c},{x:u,y:p},{x:g,y:p},{x:d,y:c}]}paintSinglePolygon(e.id,e.zIndex+1,h,"fill",e.compareConnectorColor,null,null,null,null,true);paintSinglePolygon(e.id,e.zIndex+2,h,"stroke",e.compareConnectorBorderColor,"solid",null,null,e.compareConnectorBorderSize,true);c=Math.round(l-e.compareConnectorSize);c=cordCorrectionSVG(c);u=Math.round(o+e.compareConnectorSize/2);u=cordCorrectionSVG(u);p=Math.round(l+e.compareConnectorSize);p=cordCorrectionSVG(p);g=Math.round(o-e.compareConnectorSize/2);g=cordCorrectionSVG(g);d=g+e.compareConnectorSize/2;d=roundToHalf(d);if(s===270){h=[{x:g,y:c},{x:u,y:c},{x:d,y:p},{x:g,y:c}]}else{h=[{x:d,y:c},{x:u,y:p},{x:g,y:p},{x:d,y:c}]}paintSinglePolygon(e.id,e.zIndex+1,h,"fill",e.compareConnectorColor,null,null,null,null,true);paintSinglePolygon(e.id,e.zIndex+2,h,"stroke",e.compareConnectorBorderColor,"solid",null,null,e.compareConnectorBorderSize,true)}function roundToHalf(e){var t=parseFloat(e);var i=t-parseInt(t,10);i=Math.round(i*10);if(i==5){return parseInt(t,10)+.5}if(i<3||i>7){return Math.round(t)}else{return parseInt(t,10)+.5}}function paintCircleConnectorTime(e,t,i,a,n,r,o){var l={x:t,y:n};paintSingleCircleConnector(e.id,e.zIndex+1,l,e.compareConnectorSize/2,"fill",e.compareConnectorColor,"solid",null,null,o);paintSingleCircleConnector(e.id,e.zIndex+2,l,e.compareConnectorSize/2,"stroke",e.compareConnectorBorderColor,"solid",null,null,o,e.compareConnectorBorderSize);l={x:t,y:i};paintSingleCircleConnector(e.id,e.zIndex+1,l,e.compareConnectorSize/2,"fill",e.compareConnectorColor,"solid",null,null,o);paintSingleCircleConnector(e.id,e.zIndex+2,l,e.compareConnectorSize/2,"stroke",e.compareConnectorBorderColor,"solid",null,null,o,e.compareConnectorBorderSize);l={x:a,y:i};paintSingleCircleConnector(e.id,e.zIndex+1,l,e.compareConnectorSize/2,"fill",e.compareConnectorColor,"solid",null,null,null);paintSingleCircleConnector(e.id,e.zIndex+2,l,e.compareConnectorSize/2,"stroke",e.compareConnectorBorderColor,"solid",null,null,null,e.compareConnectorBorderSize);l={x:r,y:n};paintSingleCircleConnector(e.id,e.zIndex+1,l,e.compareConnectorSize/2,"fill",e.compareConnectorColor,"solid",null,null,null);paintSingleCircleConnector(e.id,e.zIndex+2,l,e.compareConnectorSize/2,"stroke",e.compareConnectorBorderColor,"solid",null,null,null,e.compareConnectorBorderSize)}this.paintEllipse=function(e,t,i,a,n,r,o,l,s,d){if(d===null||d===undefined){d=e.getModel().zIndex}var c=ot["a"].colorBackground;var u={cx:t,cy:i,rx:a,ry:n/2};if(o===true){paintSingleEllipse(e.getId(),d,u,"fill",c,"",s)}paintSingleEllipse(e.getId(),d,u,"stroke",r,"",s,l)};this.paintPixelArrow=function(e,t,i,a,n,r,o,l,s,d){i=i*1;a=a*1;n=n*1;r=r*1;o=o*1;l=l*1;var c=0;var u=0;var p=0;var g=0;var h=0;var f=0;var m=0;var v=0;var b=0;var T=0;if(s===0){c=i-n/2;p=a-r/2;u=i+n/2-o;g=a+r/2;h=i+n/2;f=a;m=u-1;v=a-l/2;b=u-1;T=a+l/2}else if(s===90){c=i-r/2;p=a-n/2+o;u=i+r/2;g=a+n/2;h=i;f=a-n/2;m=i-l/2;v=p+1;b=i+l/2;T=p+1}else if(s===180){c=i-n/2+o;p=a-r/2;u=i+n/2;g=a+r/2;h=i-n/2;f=a;m=c+1;v=a-l/2;b=c+1;T=a+l/2}else if(s===270){c=i-r/2;p=a-n/2;u=i+r/2;g=a+n/2-o;h=i;f=a+n/2;m=i+l/2;v=g-1;b=i-l/2;T=g-1}c=c.toString();p=p.toString();u=u.toString();g=g.toString();var x=[{x:c,y:p},{x:c,y:g},{x:u,y:g},{x:u,y:p},{x:c,y:p}];paintSinglePolygon(e.getId(),e.getModel().zIndex+10,x,"fill",t,null,d==undefined?e.getId():d);x=[{x:h,y:f},{x:m,y:v},{x:b,y:T},{x:h,y:f}];paintSinglePolygon(e.getId(),e.getModel().zIndex+10,x,"fill",t,null,d==undefined?e.getId():d)};this.paintWaterfallAdditions=function(e){if(e.getModel().isOutlier===true){return}var t=e.getModel().rowConnectionPos,i=ot["a"].colorRowConnector,a=ot["a"].colorRowConnectorWidth,n=e.getDimension();if(n.width!==0||n.height!==0){var r={x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2};paintSingleLine(e.getId(),e.getModel().zIndex,r,i,a,e.getId());if(t.x3!==undefined){r={x1:t.x3,x2:t.x4,y1:t.y3,y2:t.y4};paintSingleLine(e.getId(),e.getModel().zIndex,r,i,a,e.getId())}}};this.resizeDrawingArea=function(e){var t=e.getAdapter();var i=e.getCanvasDO().getBCR();var a=i.width,n=i.height;var r=e.getController().getRootPanel();r.setDimension({width:a,height:n});L=document.getElementById(t.getId());u=document.getElementById(t.getId()+"_svg");if(u===null){u=document.createElementNS("http://www.w3.org/2000/svg","svg");u.setAttribute("id",t.getId()+"_svg");L.appendChild(u)}u.setAttribute("width",a.toString());u.setAttribute("height",n.toString());L.width=a;L.height=n;if(Mt["b"].Components.LayoutEditor.isOpen()&&[se["a"].EDIT_GRID,se["a"].EDIT_SETTINGS].indexOf(e.getMode())!==-1){Mt["b"].Components.LayoutEditor.paint(i)}};function rgb2hex(e){if(e=="-1"){q["a"].warn("color is minus one");e="rgb(250,0,120)"}if(typeof e==="object"){q["a"].warn("color is object");return"#000000"}if(e.indexOf("#")===0){return{color:e}}var t=d[e];if(t){return t}var i=e.indexOf("rgb(");if(i===-1){i=e.indexOf("rgba(")+1}var a=e.indexOf(")");var n=e.substring(i+4,a);n=n.split(",");var r=n[0];var o=n[1];var l=n[2];for(var s=0;s<n.length;s++){n[s]=n[s].replace(/\s+/g,"")}if(n.length>=4){return d[e]={color:"#"+toHex(r)+toHex(o)+toHex(l),alpha:n[3]}}else{return d[e]={color:"#"+toHex(r)+toHex(o)+toHex(l)}}}function toHex(e){e=parseInt(e,10);if(isNaN(e)){return"00"}e=Math.max(0,Math.min(e,255));return"0123456789ABCDEF".charAt((e-e%16)/16)+"0123456789ABCDEF".charAt(e%16)}this.measureTextDim=measureTextDim;function measureFontHeight(e,t){var i;if(t==undefined){i=O}else{var a=t.split(" ");var n=a[1];if(t.indexOf("italic")>-1){n=a[2]}i=parseInt(n.replace("px",""))}return i}function checkVariableInText(e,t){if(typeof e!=="string"){return e instanceof Date?e.toLocaleDateString():e.toString()}if(!i){i=new Mt["b"].Utils.Format.LabelFormatter}if(i.checkVariable(e)){e=i.parseLabel(e)}return t==="textDiv"?e:e.replace(/ /g," ")}function checkFormattingInText(e){var t=c;t.innerHTML=e;if(e===W){return z}t.innerHTML=W=e;for(var i=0,a=t.children.length;i<a;i++){var n=t.children[i];if(n.style.fontSize===""){switch(n.tagName){case"H1":n.style.fontSize="24px";break;case"H2":n.style.fontSize="18px";break;case"H3":n.style.fontSize="14px";break;case"H4":n.style.fontSize="12px";break;case"H5":n.style.fontSize="10px";break;case"H6":n.style.fontSize="8px";break}}if(n.tagName==="P"){n.outerHTML="<div>"+n.innerHTML+"</div>"}}return z=t.innerHTML}function measureTextDim(e,t,i){e=e instanceof Date?e.toLocaleDateString():e.toString();if(!e||!e.trim()){return{width:0,height:0}}e=checkVariableInText(e);var a=t;var n,r,o,l;if(a===undefined){n=O+"px";a=S+" "+n+" '"+_+"'"}else{var s=a.split(" ");var d=s[1];if(a.indexOf("italic")>-1){d=s[2]}if(s.length<3||d.indexOf("px")===-1){q["a"].warn("painter.measureTextDim: badly formatted font string",a);n=O+"px";a=S+" "+n+" '"+_+"'"}}if(m[a]===undefined){m[a]=measureFontHeight("Gg",a)}var c=m[a];var u=/\n|<br>|<br \/>|<br\/>/;var p=e.split(u);var g=c*p.length+(i!=undefined?i*(p.length-1):0);if(a.indexOf("italic")!==-1){var s=a.split(" ");if(a.indexOf("bold")!==-1){r=s[0];l=s[1];n=s[2]?s[2]:"13px";o=s[3]?s[3]:"Arial";a=r+" "+l+" "+n+" "+o}else{l=s[0];n=s[1]?s[1]:"13px";o=s[2]?s[2]:"Arial";a=l+" "+n+" "+o}}var h=0;A.font=a;for(var f=0;f<p.length;f++){h=Math.max(h,A.measureText(p[f]).width)}return{width:Math.ceil(h),height:Math.ceil(g)}}function parseRgbString(e){var t={};t.r=0;t.g=0;t.b=0;if(e){var i=e.match(/^RGB\((\d+),\s*(\d+),\s*(\d+)\)$/);if(i&&i.length>1){t.r=i[1];t.g=i[2];t.b=i[3]}i=e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);if(i&&i.length>1){t.r=i[1];t.g=i[2];t.b=i[3]}}return t}function dimCorrectionSVG(e){return Math.round(parseFloat(e))}function cordCorrectionSVG(e){e=parseFloat(e);var t=e<0;t&&(e*=-1);e=Math.floor(e)+.5;t&&(e*=-1);return e}this.cordCorrectionSVG=cordCorrectionSVG;this.dimCorrectionSVG=dimCorrectionSVG;function getRealGroup(e){if(e.indexOf("Left")!==-1){e=e.substring(0,e.indexOf("Left"))}else if(e.indexOf("Right")!==-1){e=e.substring(0,e.indexOf("Right"))}else if(e.indexOf("containerModel")!==-1){e=e.substring(0,e.indexOf("containerModel"))}else if(e.indexOf("dimension")!==-1){e="chart"+e.substring(14)}return e}function paintEllipseBuffer(e){function intersect(e,t,i,a){return e>i&&e<a||i>e&&i<t||e===i||t===a}for(var t=0;t<e.length;t++){for(var i=0;i<e.length;i++){var a=e[t];var n=e[i];if(t===i||a.dataId_dim!==n.dataId_dim){continue}var r=a.width*b;var o=n.width*b;var l=a.height*P;var s=n.height*P;var d=intersect(a.x-r,a.x+r,n.x-o,n.x+o);var c=intersect(a.y-l/2,a.y+l/2,n.y-s/2,n.y+s/2);if(d&&c){if(a.type==="structure"){a.x=a.x<n.x?a.x+r/2+a.labelSignDistance+o/2+2*a.strokeWidth:n.x+o/2+n.labelSignDistance+r/2+2*n.strokeWidth;a.y=(a.y+n.y)/2;a.width=a.width+n.width+a.labelSignDistance;a.height=Math.max(a.height,n.height)}else if(a.type==="table"){var u=(a.width/2+a.labelSignDistance+n.width/2)/2;a.x=a.x<n.x?a.x+u:n.x+u;a.y=(a.y+n.y)/2;a.width=a.width+n.width+a.labelSignDistance;a.height=Math.max(a.height,n.height)}else if(a.type==="time"){a.x=(a.x+n.x)/2;a.y=(a.y+n.y)/2;a.width=Math.max(a.width,n.width);a.height=a.height+n.height+a.labelSignDistance}e.splice(i,1);t=0;break}}}for(var t=0;t<e.length;t++){var p=e[t];H.paintEllipse(p.view,p.x,p.y,p.width*b,p.height*P,N,false,p.strokeWidth)}}this.updateDom=function(e){L=e.getDOMElement();u=L.firstChild;y=location.href;e.clearElementsBuffer();o=e};this.clear=function(){for(var e=L.childNodes.length;e>1;e--){Mt["b"].$(L.lastChild).remove()}Mt["b"].$(u).empty();o.clearElementsBuffer()};this.completePainting=function(){var e=document.createDocumentFragment();appendElements(o.getElementsBufferComplete(),e,"");L.appendChild(e)};function appendElements(e,t,i){function sortByZIndex(e,t){return e.zIndex-t.zIndex}e.scrollingData.scrollLeft=0;e.scrollingData.scrollTop=0;if(e.ellipses.length>0){I=e.elements;paintEllipseBuffer(e.ellipses)}for(var a in e.groups){var n=e.groups[a];n.elements.sort(sortByZIndex);var r=document.createElementNS("http://www.w3.org/2000/svg","g");r.setAttributeNS(null,"id",a);for(var o=0;o<n.elements.length;o++){r.appendChild(n.elements[o].element)}var l=G.filter(function(e){return a===e.groupId})[0];if(l){window.setTimeout(function(){return Mt["b"].UI.Tooltip.createTooltip(r,l.toolTipModel)},1e3)}e.elements.push({element:r,zIndex:n.zIndex})}var s=e.elements.length,d=createContainer(e.scrollingData,i,e.extensionId,s>0);e.elements.sort(sortByZIndex);for(var c=0;c<s;c++){d.svgContainer&&d.svgContainer.appendChild(e.elements[c].element)}for(var o=0;o<e.divs.length;o++){var u=e.divs[o];if(u.view){addPlusIconsToComment(u.div,u.view,u.parent,d.innerContainer)}d.innerContainer.appendChild(u.div)}t.appendChild(d.outerContainer);var p=[];for(var g in e.children){var h=e.children[g].scrollingData.zIndex;p.push({id:g,zIndex:h!==undefined?h:0})}p.sort(sortByZIndex);for(var o=0;o<p.length;o++){var f=p[o].id;appendElements(e.children[f],d.innerContainer,f)}}function createContainer(t,e,i,a){(t.realHeight<0||t.realHeight===undefined)&&(q["a"].info("Fix GridLayout realHeight"),t.realHeight=0);(t.realWidth<0||t.realWidth===undefined)&&(q["a"].info("Fix GridLayout realWidth"),t.realWidth=0);(t.height<0||t.height===undefined)&&(q["a"].info("Fix GridLayout height"),t.height=0);(t.width<0||t.width===undefined)&&(q["a"].info("Fix GridLayout width"),t.width=0);var n=document.createElement("div");n.style.position="absolute";n.style.width=t.width+"px";n.style.height=t.height+"px";n.id=e+"_"+i;if(e.startsWith("chart")&&e.match(/^chart[0-9]+$/)||e.startsWith("chartgrid01")){var r=Mt["b"].DataObjects.DocumentDO.getExtension(i),o=r.getChartById(e);if(o){n.dataset.id=o.name||r.getAdapter().getServerId()+"_"+o.id;if(false){var l}}addCellBackground(o,n,i)}var s=undefined;if(a){var d=Math.max(t.realWidth,t.width);var c=Math.max(t.realHeight,t.height);s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.id=e+"_"+i+"_svg";s.setAttributeNS(null,"width",d);if(t.svgContainerHeight!==undefined){s.setAttributeNS(null,"height",t.svgContainerHeight)}else{s.setAttributeNS(null,"height",c)}s.style.position="absolute";s.style.overflow="visible";s.style.top=0;s.style.left=0;n.appendChild(s)}if(t.scrollingVer||t.scrollingHor||t.scrolling){return createScrollContainer(s,n,t,i)}else{n.style.top=t.y+"px";n.style.left=t.x+"px";n.style.overflow="hidden";if(t.forwardEvents){n.onmouseenter=function(e){forwardEvent(e,t.forwardEvents,i)};n.onmouseleave=function(e){forwardEvent(e,t.forwardEvents,i)};n.addEventListener("wheel",function(e){forwardEvent(e,t.forwardEvents,i)},false);n.addEventListener("touchstart",function(e){forwardEvent(e,t.forwardEvents,i)},false);n.addEventListener("touchmove",function(e){forwardEvent(e,t.forwardEvents,i)},false)}return{svgContainer:s,innerContainer:n,outerContainer:n}}}function createScrollContainer(e,l,s,o){B[l.id]=s;var d=document.createElement("div"),t=!Mt["b"].DataObjects.DocumentDO.preventScrolling();d.className="tc-scroll";d.style.top=s.y+"px";d.style.left=s.x+"px";d.style.width=s.width+"px";d.style.height=s.height+"px";d.style.overflow="hidden";l.style.overflow="hidden";d.appendChild(l);var i,a;if(s.scrollingVer){d.appendChild(i=getScrollbarVer(s,l,d));i.style.height=Math.max(s.height/s.realHeight*s.height,30)+"px";i.style.top="0px";i.style.display="block"}if(s.scrollingHor){d.appendChild(a=getScrollbarHor(s,l,d));a.style.width=Math.max(s.width/s.realWidth*s.width,30)+"px";a.style.left="0px";a.style.display="block"}var n=setTimeout(function(){s.scrollingVer&&(i.style.display="none");s.scrollingHor&&(a.style.display="none")},f);d.onmouseenter=function(e){if(U[l.id]){return}n&&clearTimeout(n);k.leftScrollContainer=false;if(!(Mt["b"].Utils.Mobile.isIOS&&document.querySelector('.comment > [contenteditable="true"]'))){s.scrollingVer&&(i.style.display="block");s.scrollingHor&&(a.style.display="block")}s.forwardEvents&&forwardEvent(e,s.forwardEvents,o)};d.onmouseleave=function(e){k.leftScrollContainer=true;if(!k.movingScrollbar){s.scrollingVer&&(i.style.display="none");s.scrollingHor&&(a.style.display="none")}s.forwardEvents&&forwardEvent(e,s.forwardEvents,o)};function wheel(e){e=(e.detail instanceof WheelEvent||typeof MouseWheelEvent!=="undefined"&&e.detail instanceof MouseWheelEvent)&&e.detail||e||window.event;e.stopPropagation();e.preventDefault();var t=0;if(e.wheelDelta){t=-e.wheelDelta}else if(e.deltaY){if(e.deltaMode===1){t=e.deltaY*40}else if(e.deltaMode===2){t=e.deltaY*120}else{t=e.deltaY}}else if(e.detail){t=e.detail*40}if(s.scrollingVer){t=Math.max(Math.min(t,s.height),-s.height);var i=(l.scrollTop+t)/(l.scrollHeight-s.height);triggerCustomEvent(l.parentNode,{topPct:i,scrollingData:s,mousePos:{x:e.pageX,y:e.pageY}})}else if(s.scrollingHor){t=Math.max(Math.min(t,s.width),-s.width);var a=(l.scrollLeft+t)/(l.scrollWidth-s.width);triggerCustomEvent(l.parentNode,{leftPct:a,scrollingData:s,mousePos:{x:e.pageX,y:e.pageY}})}}if(s.scrollingVer||s.scrollingHor){l.addEventListener("scroll",function(){if(s.forwardEvents){var e=H.getContainerScrollDivElement(s.forwardEvents,o);if(e){var t=l.scrollLeft/(l.scrollWidth-s.width);triggerCustomEvent(e,{leftPct:t,scrollingData:s})}}});d.addEventListener("wheel",wheel);var c=0,u=0,p=false,r=null,g=null;t&&d.addEventListener("touchstart",function(e){if(e.touches.length){c=e.touches[0].pageY;u=e.touches[0].pageX}if(U[l.id]){return}g=setTimeout(function(){p=true},500);clearTimeout(r);Mt["b"].Utils.GlobalVariables.onTouchMove=true;k.leftScrollContainer=false;s.scrollingVer&&(i.style.display="block");s.scrollingHor&&(a.style.display="block")});t&&d.addEventListener("touchmove",function(e){if(p){return}else{clearTimeout(g)}if(e.touches.length){var t=e.touches[0].pageY;var i=e.touches[0].pageX;var a=c-t;var n=u-i;c=t;u=i;if(l.id.indexOf("tableContent.")===0||s.scrollingVer){var r=(l.scrollTop+a)/(l.scrollHeight-s.height);triggerCustomEvent(d,{topPct:r,scrollingData:s,mousePos:{x:e.pageX,y:e.pageY}})}var o=(l.scrollLeft+n)/(l.scrollWidth-s.width);triggerCustomEvent(d,{leftPct:o,scrollingData:s,mousePos:{x:e.pageX,y:e.pageY}})}},false);t&&d.addEventListener("touchend",function(e){r=setTimeout(function(){k.leftScrollContainer=true;if(!k.movingScrollbar){s.scrollingVer&&(i.style.display="none");s.scrollingHor&&(a.style.display="none")}},1e3);Mt["b"].Utils.GlobalVariables.onTouchMove=false;clearTimeout(g);p=false})}else if(t&&s.forwardEvents){d.addEventListener("wheel",function(e){forwardEvent(e,s.forwardEvents,o)},false);d.addEventListener("touchstart",function(e){forwardEvent(e,s.forwardEvents,o)},false);d.addEventListener("touchmove",function(e){forwardEvent(e,s.forwardEvents,o)},false);d.addEventListener("touchend",function(e){forwardEvent(e,s.forwardEvents,o)},false)}if(t&&(s.scrollingHorRef||s.scrollingVerRef)){var h=l.id;F[h]===undefined&&(F[h]=[]);s.scrollingHorRef&&s.scrollingHorRef.forEach(registerCallback);s.scrollingVerRef&&s.scrollingVerRef.forEach(registerCallback)}return{svgContainer:e,innerContainer:l,outerContainer:d,scrollbarVer:i,scrollbarHor:a};function registerCallback(r){F[h].push(function(e){var t=H.getContainerScrollDivElement(ot["a"].idContainerContent+"."+r,o);if(t){r=ot["a"].idContainerContent+"."+r}else{t=H.getContainerScrollDivElement(r,o)}if(t){var i=r+"_"+o,a=B[i],n={detail:{leftPct:e.leftPct,topPct:e.topPct,scrollingData:a}};handleScrolling(t,n,false)}})}}function forwardEvent(e,t,i){if(!e){return}var a,n=H.getContainerScrollDivElement(t,i);if(n){if(typeof e.constructor==="function"){a=new e.constructor(e.type,e)}else{if(e.type==="wheel"){a=document.createEvent("WheelEvent");var r=(e.altKey?"Alt ":"")+(e.ctrlKey?"Control ":"")+(e.metaKey?"Meta ":"")+(e.shiftKey?"Shift ":"");r!==""&&(r=r.substr(0,r.length-1));a.initWheelEvent(e.type,e.bubbles,e.cancelable,window,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.button,e.relatedTarget,r,e.deltaX,e.deltaY,e.deltaY,e.deltaMode)}else if(e.type.indexOf("touch")>=0){a=document.createEvent("TouchEvent");a.initUIEvent(e.type,e.bubbles,e.cancelable,window,e.detail)}else{a=document.createEvent("MouseEvent");a.initMouseEvent(e.type,e.bubbles,e.cancelable,window,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}}n.dispatchEvent(a)}}function triggerCustomEvent(e,t,i){handleScrolling(e,{detail:t},true,i)}function handleScrolling(e,t,i,a){var n,r,o;for(var l=0;l<e.childNodes.length;l++){var s=e.childNodes[l];if(s.classList.contains("tc-scrollbar-ver")){if(o===undefined){o=s}else{q["a"].warn("Non unique result for scrollBarVer");return}}else if(s.classList.contains("tc-scrollbar-hor")){if(r===undefined){r=s}else{q["a"].warn("Non unique result for scrollBarHor");return}}else if(s.id!=="selectionFrameDiv"){if(n===undefined){n=s}else if(s.id.indexOf("CYCLEDIV")!==1){q["a"].warn("Non unique result for container");return}}}if(U[n.id]){return}var d=t.detail.scrollingData,c=Mt["b"].DataObjects.DocumentDO.getExtension(n.id.split("_").pop());if(t.detail.leftPct!==undefined&&t.detail.leftPct!==null){var u=Math.min(Math.max(0,t.detail.leftPct),1);n.scrollLeft=(n.scrollWidth-d.width)*u;if(r){r.style.left=(d.width-parseInt(r.style.width))*u+"px"}d.scrollLeft=n.scrollLeft;handleScrolledReferences("left",n,c)}else if(t.detail.topPct!==undefined&&t.detail.topPct!==null){var p=Math.min(Math.max(0,t.detail.topPct),1);n.scrollTop=(n.scrollHeight-d.height)*p;if(o){o.style.top=(d.height-parseInt(o.style.height))*p+"px"}d.scrollTop=n.scrollTop;handleScrolledReferences("top",n,c)}a!==false&&saveScrollOffset(c,t);var g=F[n.id];if(i&&g){for(var l=0;l<g.length;l++){g[l](t.detail)}}function saveScrollOffset(e,t){if(!R.isPrinting()){if(e!==null){e.setScrollingData(t)}}}}function getScrollbarVer(r,o,l){var s=document.createElement("div");s.className="tc-scrollbar tc-scrollbar-ver";s.onmousedown=Mt["b"].DataObjects.DocumentDO.preventScrolling()?undefined:function(e){k.movingScrollbar=true;var t=document.querySelector('.HiCo [contenteditable="true"]');if(t){t.contentEditable=false}var i=parseFloat(s.style.top)||0,a=r.height-parseInt(s.style.height);var n=e.pageY;function moveScrollbar(e){var t=(i+e.pageY-n)/a;triggerCustomEvent(o.parentNode,{topPct:t,scrollingData:r,mousePos:{x:e.pageX,y:e.pageY}})}document.addEventListener("mousemove",moveScrollbar,false);document.addEventListener("mouseup",function(e){var t=document.querySelector('.HiCo [contenteditable="false"]');if(t){t.contentEditable=true}document.removeEventListener("mousemove",moveScrollbar,false);k.movingScrollbar=false;if(k.leftScrollContainer){l.onmouseleave()}},false)};return s}function getScrollbarHor(r,o,t){var l=document.createElement("div");l.className="tc-scrollbar tc-scrollbar-hor";l.onmousedown=Mt["b"].DataObjects.DocumentDO.preventScrolling()?undefined:function(e){k.movingScrollbar=true;var i=parseFloat(l.style.left),a=r.width-parseInt(l.style.width);var n=e.pageX;function moveScrollbar(e){var t=(i+e.pageX-n)/a;triggerCustomEvent(o.parentNode,{leftPct:t,scrollingData:r,mousePos:{x:e.pageX,y:e.pageY}})}document.addEventListener("mousemove",moveScrollbar,false);document.addEventListener("mouseup",function(e){document.removeEventListener("mousemove",moveScrollbar,false);k.movingScrollbar=false;if(k.leftScrollContainer){t.onmouseleave()}},false)};return l}function addToGroupsBuffer(e,t,i){var a=getRealGroup(e)+"_"+u.id;var n=r[a];if(!n){n=r[a]={zIndex:i,elements:[]}}else if(n.zIndex<i){n.zIndex=i}n.elements.push({element:t,zIndex:i})}function addToElementsBuffer(e,t){I.push({element:e,zIndex:t})}function addToDivsBuffer(e,t,i){l.push({div:e,view:t,parent:i})}function addPlusIconsToComment(i,e,a,n){if(!a||a.extendedModel.textType===Mt["b"].Utils.Constants.TypeValues.commentTextTypes.TITLE||a.extendedModel.textType===Mt["b"].Utils.Constants.TypeValues.commentTextTypes.SUBTITLE||Mt["b"].DataObjects.DocumentDO.getSettings().documentMode.value==="PRESENTATION"){return}var t=e.getController().getRootModel(),r=e.getController().getRootPanel(),o=t.extensionHash,l=Mt["b"].DataObjects.DocumentDO.getExtension(o),s=Mt["b"].Factories.ViewFactory.getViewById(r,a.id),d=Mt["b"].Factories.ModelFactory.getParentContainer(t.firstObjectGrid,a)[0];if(d.extendedModel.isTextEditable){s.getLayout().setDraggable(l,n);var c=d.id+"_"+o;F[c]=F[c]||[];F[c].push(function(e){var t=n.getBoundingClientRect();if(t.left<=e.mousePos.x&&t.left+t.width>=e.mousePos.x&&t.top<=e.mousePos.y&&t.top+t.height>=e.mousePos.y){H.paintIcons(l,n,a,d)}})}Mt["b"].$(n).hover(function(e){if(l.getMode()===se["a"].EDIT_COMMENT){return}if(d.extendedModel.isDragging){return}if(d.extendedModel.isTextEditable){H.paintIcons(l,n,a,d)}},function(e){var t=e.toElement||e.relatedTarget;if(t&&t.classList&&t.classList.contains("addComment")){Mt["b"].$(e.toElement).mouseleave(function(e){if(Mt["b"].$(i).find(e.toElement)[0]===undefined){H.removeAddCommentIcons()}})}else{H.removeAddCommentIcons()}})}this.noPaint=function(e,t){var i=e.getDOMElement();var a=measureTextDim(t);var n=document.createElement("div");n.innerHTML=t;n.style.fontFamily=R.getParameter("FONT_FAMILY");n.style.fontSize=a.height+"px";n.style.fontWeight=R.getParameter("FONT_STYLE_CHART");n.style.left=Math.round((parseInt(i.getAttribute("width"))-a.width)/2)+"px";n.style.top=Math.round((parseInt(i.getAttribute("height"))-a.height)/2)+"px";n.style.width=a.width+"px";n.style.height=a.height+"px";n.style.position="absolute";i.parentNode.appendChild(n)};this.getModelIdsAtPosition=function(r,o,e,l){var s=[],d=e.getId();function helper(e){if(e>35){q["a"].warn("painter.getModelIdsAtPosition: recursion too deep",r,o,s);return}var t=document.elementFromPoint(r,o);var i=t&&t.tagName!=="HTML"&&t.id!==d&&!(l&&(t.id.indexOf(ot["a"].idTableContent)>=0||t.id.indexOf(ot["a"].idContainerContent)>=0));if(i){if(t.id!==""&&t.id!==d+"_svg"){var a=t.id;var n=a.indexOf("_bg");if(n===-1){n=a.indexOf("_fill")}if(n>=0){a=a.substring(0,n)}if(t.tagName==="text"||a.indexOf("boundingRect")>=0){n=a.indexOf("$");if(n!==-1){a=a.substring(0,n)}n=a.indexOf("_");if(n!==-1&&a.indexOf("stack_sum")===-1){a=a.substring(0,n)}}if(t.tagName==="rect"&&a.indexOf("##cellBackground")>-1){a=a.replace("##cellBackground","")}s.indexOf(a)===-1&&s.push(a)}if(t.tagName!=="image"&&!t.hasAttribute("data-hico-button")){t.style.visibility="hidden";helper(e+1);t.style.visibility=""}}}helper(0);return s};this.updateCommentHighlightElement=function(e,t,i,a){if(document.getElementById("HiCoHighlightedElementBorder")===null){var n=document.createElementNS("http://www.w3.org/2000/svg","rect");n.id="HiCoHighlightedElementBorder";n.setAttributeNS(null,"fill","rgb(211,211,211)");var r=1;var o=2;if(a){o=5;r=2}var l=t.x-r;if(i==="middle"){l-=t.width/2}else if(i==="end"){l-=t.width}n.setAttributeNS(null,"x",l.toString(10));n.setAttributeNS(null,"y",(t.y-o).toString(10));n.setAttributeNS(null,"width",(t.width+o).toString(10));n.setAttributeNS(null,"height",(t.height+o).toString(10));n.style.strokeWidth="1";n.style.stroke="rgb(0, 176, 240)";n.style.strokeDasharray="5, 2";var s=Mt["b"].$(e.parentNode).find('[id^="'+e.id.split("_")[0]+'"]')[0];if(s){e.parentNode.insertBefore(n,s)}}};this.getMeasuredTextDiv=function(e,t,i,a,n){t=checkVariableInText(t,"textDiv");s.innerHTML=t;s.style.width=e+"px";s.style.fontSize=i+"px";s.style.fontFamily=a;s.style.fontWeight=n;s.style.position="absolute";s.style.display="block";var r=s.clientHeight;s.style.display="none";return r};this.paintIcons=function(i,e,a,n){H.removeAddCommentIcons();var t=i.getId();var r=0,o=0,l=e;do{r+=l.offsetLeft-l.scrollLeft;o+=l.offsetTop-l.scrollTop}while(l.id!==t&&(l=l.offsetParent));var s=r-(e.offsetLeft-e.scrollLeft),d=o-(e.offsetTop-e.scrollTop),c=e.offsetParent;if(c.parentNode.className==="tc-scroll"){s-=c.offsetLeft-c.scrollLeft;d-=c.offsetTop-c.scrollTop}var u=s+n.dimension.width,p=d+n.dimension.height,g=a.dimension.height,h=a.dimension.width;var f=n.extendedModel.allowLeft==="undefined"||R.getAllowIcon(n.extendedModel.allowLeft),m=n.extendedModel.allowTop==="undefined"||R.getAllowIcon(n.extendedModel.allowTop),v=n.extendedModel.allowRight==="undefined"||R.getAllowIcon(n.extendedModel.allowRight),b=n.extendedModel.allowBottom==="undefined"||R.getAllowIcon(n.extendedModel.allowBottom);var T={chartContainerModel:n,model:a,extension:i,parameters:null},x={x:0,y:0},E;if(f){if(s===r){x={x:r,y:o+g/2-V/2}}else{x={x:r-V/2,y:o+g/2-V/2}}if(r>=s&&x.y>=d&&x.y+V/2<=p){E=H.addIcon(t,x);Mt["b"].$(E).click(function(){T.parameters={position:"left",caller:"commentModel"};i.getController().dispatch("createAddColumn",T);var e=Mt["b"].Models.Actions.ViewModelActions.ContainerModel.getChildIndexById(n,a.id);var t=n.children[e-1];Mt["b"].DataObjects.CommentRepo.openEditField(i,t)})}$.left=g<3*V}if(m){if(d===o){x={x:r+h/2-V/2,y:o}}else{x={x:r+h/2-V/2,y:o-V/2}}if(o>=d&&x.x>=s&&x.x<=u){E=H.addIcon(t,x);Mt["b"].$(E).click(function(){T.parameters={position:"above",caller:"commentModel"};i.getController().dispatch("createAddRow",T);var e=Mt["b"].Models.Actions.ViewModelActions.ContainerModel.getChildIndexById(n,a.id);var t=n.children[e-n.extendedModel.gridColumns.length];Mt["b"].DataObjects.CommentRepo.openEditField(i,t)})}}if(v){if(u===r+h){x={x:r+h-V,y:o+g/2-V/2}}else{x={x:r+h-V/2,y:o+g/2-V/2}}if(x.x<=u&&x.y>=d&&x.y+V/2<=p){E=H.addIcon(t,x);Mt["b"].$(E).click(function(){T.parameters={position:"right",caller:"commentModel"};i.getController().dispatch("createAddColumn",T);var e=Mt["b"].Models.Actions.ViewModelActions.ContainerModel.getChildIndexById(n,a.id);var t=n.children[e+1];Mt["b"].DataObjects.CommentRepo.openEditField(i,t)})}$.right=g<3*V}if(b){if(p===o+g){x={x:r+h/2-V/2,y:o+g-V}}else{x={x:r+h/2-V/2,y:o+g-V/2}}if(x.y+V/2<=p&&x.x>=s&&x.x<=u){E=H.addIcon(t,x);Mt["b"].$(E).click(function(){T.parameters={position:"below",caller:"commentModel"};i.getController().dispatch("createAddRow",T);var e=Mt["b"].Models.Actions.ViewModelActions.ContainerModel.getChildIndexById(n,a.id);var t=n.children[e+n.extendedModel.gridColumns.length];Mt["b"].DataObjects.CommentRepo.openEditField(i,t)})}}};this.addIcon=function(e,t){var i=document.createElement("i");i.className="fa fa-plus-circle addComment";i.setAttribute("aria-hidden","true");i.style.left=t.x+"px";i.style.top=t.y+"px";i.style.width=V+"px";i.style.lineHeight=V+"px";document.getElementById(e).parentNode.appendChild(i);return i};this.removeAddCommentIcons=function(){$={right:false,left:false};Mt["b"].$(".addComment").remove()};this.getCommentReferenceScrollingElement=function(e,t){return X[t+"_"+e]};this.getContainerOutermostDivElement=function(e,t){var i=document.getElementById(e+"_"+t);return i&&i.parentNode.className==="tc-scroll"?i.parentNode:i};this.getContainerScrollDivElement=function(e,t){var i=document.getElementById(e+"_"+t);if(i){if(i.parentNode.className==="tc-scroll"){return i.parentNode}else{for(var a=i.childNodes.length-1;a>=0;a--){var n=i.childNodes[a];if(n.className==="tc-scroll"){return n}}}}return null};this.getContainerContentDivElement=function(e,t){var i=document.getElementById(e+"_"+t);if(i){var a=[ot["a"].idContainerContent+"."+e+"_"+t,ot["a"].idTableContent+"."+e+"_"+t];for(var n=i.childNodes.length-1;n>=0;n--){var r=i.childNodes[n];if(r.className==="tc-scroll"){for(var o=0;o<r.childNodes.length;o++){if(a.indexOf(r.childNodes[o].id)>=0){i=r.childNodes[o];break}}break}else if(a.indexOf(r.id)>=0){i=r;break}}}return i};this.disableContainerScrolling=function(e,t){var i=H.getContainerContentDivElement(e,t);if(i){U[i.id]=true;i.parentNode.onmouseleave()}};function isClickBehaviorEnabled(e){if(e.navigationVariable&&typeof e.navigationVariable==="object"){return e.navigationVariable.check?e.navigationVariable.check.default||e.navigationVariable.check.custom:e.navigationVariable.variable!==""}return false}this.getContainerScrollPosition=function(e,t){var i=H.getContainerContentDivElement(e,t),a=i&&i.parentNode,n=null;if(a&&a.className==="tc-scroll"){n={left:i.scrollLeft,top:i.scrollTop}}return n};this.setContainerScrollPosition=function(e,t,i,a){var n=H.getContainerContentDivElement(e,t),r=n&&n.parentNode,e=n.id;if(r&&r.className==="tc-scroll"){var o=B[e];var l=i.top/(n.scrollHeight-o.height);triggerCustomEvent(r,{topPct:l,scrollingData:o,mousePos:{x:0,y:0}},a)}if(e.indexOf(ot["a"].idTableContent)>=0){e=e.replace(ot["a"].idTableContent,ot["a"].idTableHead);n=document.getElementById(e);r=n&&n.parentNode}if(r&&r.className==="tc-scroll"){var o=B[e];var s=i.left/(n.scrollWidth-o.width);triggerCustomEvent(r,{leftPct:s,scrollingData:o,mousePos:{x:0,y:0}},a)}};function addCellBackground(e,t,i){if(e.cellDefinition&&e.cellDefinition.background.isActive){var a=e.cellDefinition.background;var n=a.url.value;var r=document.createElement("div");r.className="cell-background";r.style.width=Math.max(e.scrollingData.realWidth,e.scrollingData.width)+"px";r.style.height=Math.max(e.scrollingData.realHeight,e.scrollingData.height)+"px";r.style.backgroundColor=a.color;r.style.backgroundSize=a.size;n&&Mt["b"].DataObjects.DocumentDO.getMediaData(n,i).then(function(e){return r.style.backgroundImage='url("'+(e||n)+'")'});r.style.opacity=a.opacity;r.style.backgroundRepeat=a.repeat;r.style.backgroundPositionX=a.positionX;r.style.backgroundPositionY=a.positionY;t.appendChild(r)}}function getCompareColor(e,t){if(e.notation===t.NOTATION){var i=e.positive;if(e.negativeIsPositive){i=!i}return i?a:n}return e.individualColor}};var ye=i(266);var Ce=i(108);var Se=i(337);var Me=i(194);var Oe=i(297);var Ae=i(278);var _e=i(147);var Le=i(228);var Ie=i(230);var De=i(184);var Re=Mt["b"].Utils.Update.ContextUpdater=new function(){var d;var a;var r;var s=false;var c=false;this.update=function(e,t){d=e;var i=t.getAdapter();a=i.getExpressions(d.cid);r=i.getDimensions(d.cid);s=false;c=false;if(e.rows.length<r.length){t.getController().dispatch("showDimensionLimitationsInfoAction",{extension:t})}createDefinitionParts();removeMarkedExpressions();adjustContextExpressions();removeMarkedDimensions();adjustContextDimensions();if(s){Mt["b"].DataObjects.DocumentDO.setContextFormulasModifiedFlag()}d.dataContext=Object(ye["a"])(d)};this.setContext=function(e){d=e};this.generateExpressionDisplayId=function(e){return(e>=10?"K":"K0")+e.toString(10)};this.removeExpressionFromContext=function(o,e){var t=o.columns[e];if(t.definitionType==="QV"){console.warn("expressionUpdater.removeExpressionFromContext")}function removeFormula(e){if(e!==undefined&&e!==-1){Mt["b"].Models.Actions.ModelActions.ContextModel.removeFormulaFromRepository(o,e)}}var i=t.ruleRepository;for(var a=0;a<i.length;a++){var n=i[a];removeFormula(n.conditionFormula);removeFormula(n.appliesFormula)}var r=t.definitionPartArray;for(var a=0;a<r.length;a++){var l=r[a];removeFormula(l.appliesFormula);removeFormula(l.conditionFormula)}o.columns.splice(e,1);var s={};s[o.cid]=[t.displayId,t.id];var d={};d[o.cid]=[];function cleanContextFormulas(e){for(var t=0;t<o.formulaRepository.length;t++){var i=o.formulaRepository[t];deleteDidFromFormula(e,i,"formula",true)}}cleanContextFormulas(t.displayId);cleanContextFormulas(t.id);function processContextFormulas(e,t){var i=new RegExp("\\$\\("+e+"(,[A-Z]+)?\\)","g");var a="$("+t+"$1)";d[o.cid].push({oldDid:i,newDid:a});for(var n=0;n<o.formulaRepository.length;n++){var r=o.formulaRepository[n];replaceDidInFormula(i,a,r,"formula",true)}}for(var a=e;a<o.columns.length;a++){var c=o.columns[a];var u=Mt["b"].Utils.Update.ContextUpdater.generateExpressionDisplayId(a+1);processContextFormulas(c.displayId,u);c.displayId=u}var p=parseInt(t.id.split(".").pop().replace("expr",""));var g={};g[o.cid]=[p];updateRootModels(s,d,g,{},{})};this.shiftExpressionsDids=function(o,e){var l={};l[o.cid]=[];function processContextFormulas(e,t){var i=new RegExp("\\$\\("+e+"(,[A-Z]+)?\\)","g");var a="$("+t+"$1)";l[o.cid].push({oldDid:i,newDid:a});for(var n=0;n<o.formulaRepository.length;n++){var r=o.formulaRepository[n];replaceDidInFormula(i,a,r,"formula",true)}}for(var t=o.columns.length-1;t>=e;t--){var i=o.columns[t];if(i.definitionType==="HiCo"){var a=Mt["b"].Utils.Update.ContextUpdater.generateExpressionDisplayId(t+1);if(a!==i.displayId){processContextFormulas(i.displayId,a);i.displayId=a}}}updateRootModels({},l,[],{},{})};this.finalUpdate=function(e,t,i,a,n,r){c=false;updateRootModels(e,t,i,n,r);if((c||a)&&Mt["b"].$.inArray("Designer",Mt["b"].DataObjects.RuntimeDO.getUser().permissions)!==-1){var o=Mt["b"].DataObjects.DocumentDO.getAllExtensions();var l=c?function(e){return e.dispatch("updateRootModel",{extension:e})}:function(e){return e.dispatch("createContextState",{extension:e,saveQVF:true,async:false})};for(var s=0;s<o.length;s++){l(o[s])}}};this.synchronizeKeyColumnsNames=function(){function processContainer(e){var t=e.extendedModel;if(t&&t.instanceOf==="ContainerGridModel"){for(var i=0;i<e.children.length;i++){processContainer(e.children[i])}}else if(t&&t.instanceOf==="MultipleContainerModel"){}else if(e.charts){for(var i=0;i<e.charts.length;i++){var a=e.charts[i].model;a.instanceOf==="TableModel"&&synchronizeKeyColumnsNames(a)}}}var e=Mt["b"].DataObjects.DocumentDO.getAllExtensions();for(var t=0;t<e.length;t++){var i=e[t].getController().getRootModel();var a=i.rootContainerModel.children[0];if(a.children&&a.children.length>0){processContainer(a.children[0])}}};this.createContextId=function(e,t){return e.getId()+".ctx"+(parseInt(t.substr(-5))+1).toString(10)};this.buildContext=function(e,t){var i=e.getAdapter(),a=i.getDimensions(t),n=i.getExpressions(t);var r=new Ce["a"](this.createContextId(e,t));r.cid=t;r.name="globalContext";d=r;r.rows=a.map(function(e){return createNewDimension(e)});r.columns=n.map(function(e,t){return createNewExpression(t,e)});r.dataContext=Object(ye["a"])(r);return r};this.mergeContextDefinition=function(t,e,i){i&&e.dataContext.measures.forEach(function(e){if(!e.originatesFromBI){t.dataContext.measures.push(e)}});t.DataContext=e.DataContext};function synchronizeKeyColumnsNames(e){var t=it["a"].getContextByCid(e.contextId);if(!t){return}for(var i=0;i<e.input.keyColumns.length;i++){var a=e.input.keyColumns[i];for(var n=0;n<t.rows.length;n++){if(a.id===t.rows[n].id){a.name=t.rows[n].name;break}}}}function getIdSteps(i,e){if(i>1e3){return 0}else{var t=e.filter(function(e){return e<1e3});return t.reduce(function(e,t){return e+(t<i?1:0)},0)}}function updateSingleChart(e,t,i,a,n,r){var o=e.contextId,l=it["a"].getContextByCid(o);if(!l){return}var s=t[o]||[];var d=i[o]||[];var c=a[o]||[];for(var u=e.expressions.length-1;u>=0;u--){var p=e.expressions[u];var g=p.id.split(".");var h=g.pop();var f=parseInt(h.replace("expr",""));var m=getIdSteps(f,c);if(m>0){p.id=g.join(".")+".expr"+(f-m).toString(10);if(e.instanceOf==="TableModel"){for(var v=0;v<e.columnDefinitions.length;v++){if(e.columnDefinitions[v].exprId===h){e.columnDefinitions[v].exprId="expr"+(f-m).toString(10);break}}}}for(var v=0;v<p.valueLabelFormulaArray.length;v++){var b=p.valueLabelFormulaArray[v];for(var T=0;T<s.length;T++){deleteDidFromFormula(s[T],b.appliesFormula,"formula",false);deleteDidFromFormula(s[T],b.conditionFormula,"formula",false)}replaceDidsInFormulaByList(d,b.appliesFormula,"formula",false);replaceDidsInFormulaByList(d,b.conditionFormula,"formula",false)}}if(e.dimensionLabelModel&&e.dimensionLabelModel.emptySpaceRepository){var x=e.dimensionLabelModel.emptySpaceRepository;for(var u=0;u<x.length;u++){var E=x[u];for(var T=0;T<s.length;T++){deleteDidFromFormula(s[T],E,"appliesFormula",false)}replaceDidsInFormulaByList(d,E,"appliesFormula",false)}}if(e.dimensionLabelModel&&e.dimensionLabelModel.dimensionFormulaRepository&&l){var y=e.dimensionLabelModel.dimensionFormulaRepository;if(l.rows.length<y.length){y=e.dimensionLabelModel.dimensionFormulaRepository=e.dimensionLabelModel.dimensionFormulaRepository.slice(0,l.rows.length)}for(var u=0;u<y.length;u++){var C=y[u];for(var T=0;T<s.length;T++){deleteDidFromFormula(s[T],C.appliesFormula,"formula",false);deleteDidFromFormula(s[T],C.conditionFormula,"formula",false)}replaceDidsInFormulaByList(d,C.appliesFormula,"formula",false);replaceDidsInFormulaByList(d,C.conditionFormula,"formula",false)}for(var v=y.length;v<l.rows.length;v++){var S=new Se["a"].DimensionFormulaModel;S.id=l.rows[v].id;S.dimAutoLength=true;S.dimension_mmpt=0;S.appliesFormula={formula:"true",compiledFormula:null};S.conditionFormula={formula:"true",compiledFormula:null};e.dimensionLabelModel.dimensionFormulaRepository.push(S)}}if(e.instanceOf==="TableModel"){if(r[e.contextId]){var M=r[e.contextId],O=e.input.keyColumns;for(var A=O.length-1;A>=0;A--){M.indexOf(O[A].id)>=0&&O.splice(A,1)}}if(n[e.contextId]){var M=n[e.contextId],O=e.input.keyColumns;for(var A=O.length-1;A>=0;A--){M.indexOf(O[A].id)>=0&&O.splice(A,1)}for(var A=0;A<M.length;A++){var _=M[A],L;for(var u=0;u<l.rows.length;u++){L=l.rows[u];if(L.id===_){break}}O.push({id:L.id,name:L.nameInternal?L.nameInternal:L.name,hide:false})}}synchronizeKeyColumnsNames(e)}}function updateMultipleContainer(e,l,s,d,c,u){var p=e.extendedModel;var t=l[p.contextId];var i=s[p.contextId];if(t){var a=it["a"].getContextByCid(p.contextId);if(p.dimensions.length>=a.rows.length){p.dimensions=p.dimensions.slice(0,a.rows.length-1);if(p.dimensions.length>0){p.dimensions[p.dimensions.length-1].categoryOrientation="Cell"}}for(var n=0;n<p.cases.length;n++){var r=p.cases[n];for(var o=0;o<t.length;o++){deleteDidFromFormula(t[o],r.appliesFormula,"formula",false);deleteDidFromFormula(t[o],r.conditionFormula,"formula",false)}}}if(i){for(var n=0;n<p.cases.length;n++){var r=p.cases[n];replaceDidsInFormulaByList(i,r.appliesFormula,"formula",false);replaceDidsInFormulaByList(i,r.conditionFormula,"formula",false)}}function updateElements(e){var t=p[e+"Elements"];for(var i=0;i<t.length;i++){var a=t[i].nodes;for(var n=0;n<a.length;n++){var r=a[n].nodes;for(var o=0;o<r.length;o++){updateSingleChart(r[o].model,l,s,d,c,u)}}}}updateElements("time");updateElements("structure")}function updateRootModels(a,n,r,o,l){function processContainer(e){var t=e.extendedModel;if(t&&t.instanceOf==="ContainerGridModel"){for(var i=0;i<e.children.length;i++){processContainer(e.children[i])}}else if(t&&t.instanceOf==="MultipleContainerModel"){updateMultipleContainer(e,a,n,r,o,l)}else if(e.charts){for(var i=0;i<e.charts.length;i++){updateSingleChart(e.charts[i].model,a,n,r,o,l)}}}var e=Mt["b"].DataObjects.DocumentDO.getAllExtensions();for(var t=0;t<e.length;t++){var i=e[t].getController();var s=i.getRootModel();var d=s.rootContainerModel.children[0];if(d.children&&d.children.length>0){processContainer(d.children[0])}i.updateLayoutDefinition()}}function replaceDidInFormula(t,i,e,a,n){function replacer(e){if(e.instanceOf==="CompiledFormulaNode"){replacer(e.operand1);replacer(e.operand2)}else if(e.instanceOf==="VariableOperand"){e.variable=e.variable.replace(t,i)}}var r=e[a];e[a]=r.replace(t,i);if(e.compiledFormula){replacer(e.compiledFormula.topNode)}if(e[a]!==r){if(n){s=true}else{c=true}}}function replaceDidInContextFormulas(e,t){var i=new RegExp("\\$\\("+e+"(,[A-Z]+)?\\)","g");var a="$("+t+"$1)";for(var n=0;n<d.formulaRepository.length;n++){var r=d.formulaRepository[n];replaceDidInFormula(i,a,r,"formula",true)}Mt["b"].DataObjects.DocumentDO.addDidToRenameList(d.cid,i,a)}function replaceDidsInFormulaByList(r,e,t,i){function replaceInNode(e){var t=false;if(e.instanceOf==="CompiledFormulaNode"){t=replaceInNode(e.operand1)||t;t=replaceInNode(e.operand2)||t}else if(e.instanceOf==="VariableOperand"){var i=e.variable;for(var a=0;a<r.length;a++){var n=r[a];e.variable=e.variable.replace(n.oldDid,n.newDid);if(e.variable!==i){t=true;break}}}return t}if(e.compiledFormula==null){e.compiledFormula=I["a"].compile(e[t])}var a=e.compiledFormula;if(replaceInNode(a.topNode)){e[t]=reconstructFormulaFromNode(a.topNode).value;if(i){s=true}else{c=true}}}function replaceDidsInContextFormulasByList(e){for(var t=0;t<d.formulaRepository.length;t++){var i=d.formulaRepository[t];replaceDidsInFormulaByList(e,i,"formula",true)}Mt["b"].DataObjects.DocumentDO.addDidListToRenameList(d.cid,e)}function reconstructFormulaFromNode(e){var t;if(e.instanceOf==="CompiledFormulaNode"){var i=reconstructFormulaFromNode(e.operand1);var a=reconstructFormulaFromNode(e.operand2);var n=N["a"].getOperator(e.operator);if(i.precedence>n.precedence){i.value="("+i.value+")"}if(a.precedence>n.precedence){a.value="("+a.value+")"}if(n.op==="§"){t={precedence:n.precedence,value:"-"+a.value}}else if(n.op==="#"){t={precedence:n.precedence,value:"+"+a.value}}else{t={precedence:n.precedence,value:i.value+" "+e.operator+" "+a.value}}}else if(e.instanceOf==="VariableOperand"){t={precedence:0,value:e.variable}}else if(e.instanceOf==="ValueOperand"){t={precedence:0,value:e.value.toString()}}return t}function getOperandForOp(e,t){if((e==="=="||e===">"||e==="<"||e===">="||e==="<="||e==="<>")&&t.instanceOf==="ValueOperand"){var i=new Me["c"];i.value=0;i.type="number";return i}else if(e==="#"||e==="§"){return null}else{return t}}function deleteDidFromFormula(e,t,i,a){var n="$("+e+")";var r="$("+e+",";var o=false;function removeFromNode(e){var t=e;if(e.instanceOf==="CompiledFormulaNode"){var i=e.operand2.instanceOf!=="ValueOperand";e.operand1=removeFromNode(e.operand1);e.operand2=removeFromNode(e.operand2);if(e.operand1===null&&e.operand2===null){t=null;o=true}else if(e.operand1===null){t=getOperandForOp(e.operator,e.operand2);o=true}else if(e.operand2===null){t=getOperandForOp(e.operator,e.operand1);o=true}else{if(e.operator==="/"){if(i&&e.operand2.instanceOf==="ValueOperand"&&e.operand2.value===0){t=e.operand1;o=true}}}}else if(e.instanceOf==="VariableOperand"){var a=e.variable.substr(0,n.length);if(a===n||a===r){t=null;o=true}}return t}if(t.compiledFormula==null){t.compiledFormula=I["a"].compile(t[i])}var l=t.compiledFormula;l.topNode=removeFromNode(l.topNode);if(l.topNode===null){l.topNode=new Me["c"];l.topNode.type="number";l.topNode.value=0}if(o){t[i]=reconstructFormulaFromNode(l.topNode).value;if(a){s=true}else{c=true}}}function removeDidFromContextFormulas(e){for(var t=0;t<d.formulaRepository.length;t++){var i=d.formulaRepository[t];deleteDidFromFormula(e,i,"formula",true)}Mt["b"].DataObjects.DocumentDO.addDidToRemoveList(d.cid,e)}this.removeDidFromContextFormulas=removeDidFromContextFormulas;function removeMarkedDimensions(){var e=d.rows;for(var t=0;t<e.length;t++){var i=e[t];if(i.markedForDeletion){Mt["b"].DataObjects.DocumentDO.addDimensionToRemoveList(d.cid,i.id);removeDimension(t,true,true);t--}}}function removeDimension(e,t,i){var a=d.rows[e];function removeFormula(e){if(e!==undefined&&e!==-1){Mt["b"].Models.Actions.ModelActions.ContextModel.removeFormulaFromRepository(d,e)}}if(a.dimensionType==="std"){removeFormula(a.sortingCondFormula);if(i){removeDidFromContextFormulas(a.displayId)}}else if(a.dimensionType==="drill"||a.dimensionType==="cyclic"){for(var n=0;n<a.groupMembers.length;n++){removeFormula(a.groupMembers[n].sortingCondFormula);removeDidFromContextFormulas(a.groupMembers[n].displayId)}}else if(a.dimensionType==="dynamic"){for(var n=0;n<a.dynamicNames.length;n++){removeFormula(a.dynamicNames[n].formulaId);removeDidFromContextFormulas(a.dynamicNames[n].displayId)}if(i){removeDidFromContextFormulas(a.displayId)}}if(t){d.rows.splice(e,1)}}function createNewDrilldownElement(e,t){var i=new Oe["a"](d.id+"."+e);i.sequence=t.sequence;i.active=t.active;i.name=t.name;i.qvName=t.qvName;i.valueType=t.valueType;i.displayId=e;Mt["b"].Models.Actions.ModelActions.DrillDownElementModel.initDimensionSorting(i,d);Mt["b"].Models.Actions.ModelActions.DrillDownElementModel.initDimensionAdditions(i);return i}function createNewDynamicElement(e,t){var i=new Ae["a"];i.name=t.name;i.qvName=t.qvName;i.updateNameFromQV=t.updateNameFromQV;i.id=t.id;i.displayId=e;return i}function createNewDimension(e,t){var i=new _e["a"](d.id+"."+e.id);i.nameBi=i.name=e.name;i.dimensionType=e.dimensionType;i.groupActualLevel=e.groupActualLevel;i.displayId=t?t:Mt["b"].Models.Actions.ModelActions.ContextModel.getNextDimensionId(d);var a=i.displayId.substr(0,3);Mt["b"].Models.Actions.ModelActions.DimensionModel.initDimensionSorting(i,d);Mt["b"].Models.Actions.ModelActions.DimensionModel.initDimensionAdditions(i);i.groupMembers=new Array(e.groupMembers.length);for(var n=0;n<e.groupMembers.length;n++){var r=a+Mt["b"].Models.Actions.ModelActions.DimensionModel.getNextSubDimensionId(i);i.groupMembers[n]=createNewDrilldownElement(r,e.groupMembers[n])}i.dynamicNames=new Array(e.dynamicNames.length);for(var n=0;n<e.dynamicNames.length;n++){var r=a+Mt["b"].Models.Actions.ModelActions.DimensionModel.getNextSubDimensionId(i);i.dynamicNames[n]=createNewDynamicElement(r,e.dynamicNames[n])}return i}function adjustContextDimensions(){var e=new Array(r.length);for(var t=0;t<r.length;t++){var i=r[t];var a=d.rows[t];if(a===undefined){e[t]=createNewDimension(i);Mt["b"].DataObjects.DocumentDO.addDimensionToAddList(d.cid,e[t].id)}else if(i.dimensionType!==a.dimensionType){e[t]=createNewDimension(i,a.displayId);removeDimension(t,false,false)}else{adjustSingleDimension(a,i);e[t]=a}}for(var n=d.rows.length-1;n>=r.length;n--){Mt["b"].DataObjects.DocumentDO.addDimensionToRemoveList(d.cid,d.rows[n].id);removeDimension(n,false,true)}d.rows=e}function removeMarkedDrillElements(e){for(var t=0;t<e.groupMembers.length;t++){var i=e.groupMembers[t];if(i.markedForDeletion){Mt["b"].Models.Actions.ModelActions.ContextModel.removeFormulaFromRepository(d,i.sortingCondFormula);removeDidFromContextFormulas(i.displayId);e.groupMembers.splice(t,1);t--}}}function adjustSingleDimension(e,t){if(e.useQvName){e.name=t.name;if(e.nameInternal!==undefined){e.nameInternal=t.name}}e.id=d.id+"."+t.id;e.biColumnId=t.biColumnId;e.nameBi=t.nameBi;e.groupActualLevel=t.groupActualLevel;if(e.dimensionType==="drill"||e.dimensionType==="cyclic"){removeMarkedDrillElements(e);var i=e.displayId.substr(0,3);for(var a=0;a<t.groupMembers.length;a++){var n=e.groupMembers[a];var r=t.groupMembers[a];if(n===undefined){var o=i+Mt["b"].Models.Actions.ModelActions.DimensionModel.getNextSubDimensionId(e);e.groupMembers[a]=createNewDrilldownElement(o,r)}else{n.qvName=r.qvName;n.useQvName&&(n.name=n.nameInternal=r.name)}}for(var a=e.groupMembers.length-1;a>=t.groupMembers.length;a--){var n=e.groupMembers[a];Mt["b"].Models.Actions.ModelActions.ContextModel.removeFormulaFromRepository(d,n.sortingCondFormula);removeDidFromContextFormulas(n.displayId);e.groupMembers.splice(a,1)}}else if(e.dimensionType==="dynamic"){updateDynamicDimension(e,t)}}function removeMarkedDynamicElements(e){for(var t=0;t<e.dynamicNames.length;t++){var i=e.dynamicNames[t];if(i.markedForDeletion){removeDidFromContextFormulas(i.displayId);removeDidFromContextFormulas(i.id);shiftDynamicElements(e,t);e.dynamicNames.splice(t,1);t--}}}function shiftDynamicElements(e,t){var i=e.dynamicNames[t].id.indexOf("dynd")===0?parseInt(e.dynamicNames[t].id.substr(4)):99;for(var a=0;a<e.dynamicNames.length;a++){var n=e.dynamicNames[a];if(n.instanceOf==="DynamicElementDO"){var r=parseInt(n.id.replace("dynd",""));if(r>i){var o="dynd"+(r-1);replaceDidInContextFormulas(n.id,o);n.id=o}}}}function updateDynamicDimension(e,t){removeMarkedDynamicElements(e);var i=e.displayId.substr(0,3);for(var a=0;a<t.dynamicNames.length;a++){var n=t.dynamicNames[a];var r=null;for(var o=0;o<e.dynamicNames.length;o++){if(n.id===e.dynamicNames[o].id){r=e.dynamicNames[o];break}}if(r!==null){r.qvName=n.qvName;if(r.updateNameFromQV){r.internalName=r.name=n.qvName}}else{var l=i+Mt["b"].Models.Actions.ModelActions.DimensionModel.getNextSubDimensionId(e);e.dynamicNames.push(createNewDynamicElement(l,n))}}var s=parseInt(t.dynamicNames[t.dynamicNames.length-1].id.substr(4));for(var a=0;a<e.dynamicNames.length;a++){var r=e.dynamicNames[a];if(r.instanceOf==="DynamicElementDO"&&parseInt(r.id.substr(4))>s){removeDidFromContextFormulas(r.displayId);removeDidFromContextFormulas(r.id);e.dynamicNames.splice(a,1);a--}}}function createDefinitionParts(){var e=d.formulaRepository;for(var t=0;t<d.columns.length;t++){var i=d.columns[t];if(i.definitionPartArray&&i.definitionPartArray.length){return}var a=new Mt["b"].DataObjects.ExpressionPartDO;a.appliesFormula=Mt["b"].Models.Actions.ModelActions.ContextModel.addFormulaToRepository(d,"PartCond&FID","true",false);if("HiCo"===i.definitionType&&-1!==i.definition&&""!==i.definition){var n=Mt["b"].Models.Actions.ModelActions.ContextModel.getFormulaById(d,i.definition).formula;Mt["b"].Models.Actions.ModelActions.ContextModel.removeFormulaFromRepository(d,i.definition);i.definition=-1;a.partFormula=Mt["b"].Models.Actions.ModelActions.ContextModel.addFormulaToRepository(d,"PartFormula&FID",n,false)}else if(i.definitionType==="QV"){a.partFormula=-1}a.id=0;a.name="New 0";i.definitionPartArray=[a]}var r=new Mt["b"].Utils.Calculator(d);for(var t=0;t<e.length;t++){var o=e[t];o.formula=r.encode(o.formula)}}function removeMarkedExpressions(){var e=d.columns;for(var t=e.length-1;t>=0;t--){var i=e[t];if(i.markedForDeletion){Mt["b"].DataObjects.DocumentDO.addChartExpressionToRemoveList(d.cid,i.definition);removeExpression(t,true)}}}function removeExpression(e,t){var i=d.columns[e];if(i.definitionType!=="QV"){console.warn("expressionUpdater.removeExpression")}var a=function(e){if(e!==undefined&&e!==-1){Mt["b"].Models.Actions.ModelActions.ContextModel.removeFormulaFromRepository(d,e)}};var n=i.ruleRepository;for(var r=0;r<n.length;r++){var o=n[r];a(o.conditionFormula);a(o.appliesFormula)}var l=i.definitionPartArray;for(var r=0;r<l.length;r++){var s=l[r];a(s.appliesFormula)}removeDidFromContextFormulas(i.displayId);removeDidFromContextFormulas(i.id);if(t){d.columns.splice(e,1)}}function createNewExpression(e,t){var i=new Le["a"](d.id+"."+t.id,t.biColumnId);i.nameBi=i.name=t.name;i.definition=t.id;i.definitionType="QV";i.displayId=Mt["b"].Utils.Update.ContextUpdater.generateExpressionDisplayId(e+1);i.definitionPartArray=[];var a=new Ie["a"];a.id=0;a.name="New 0";a.appliesFormula=Mt["b"].Models.Actions.ModelActions.ContextModel.addFormulaToRepository(d,"Formula&FID","true",true);a.partFormula=-1;i.definitionPartArray.push(a);var n=new De["a"];n.conditionFormula=Mt["b"].Models.Actions.ModelActions.ContextModel.addFormulaToRepository(d,"RuleCond&FID","true",true);n.appliesFormula=Mt["b"].Models.Actions.ModelActions.ContextModel.addFormulaToRepository(d,"RuleApplies&FID","true",true);n.id=0;n.name="New 0";i.ruleRepository.push(n);return i}function adjustContextExpressions(){Mt["b"].Connector.ConnectorHelper.ContextUpdater_adjustContextExpressions(a,createNewExpression.bind(this),d,removeExpression.bind(this),replaceDidsInContextFormulasByList.bind(this))}};Mt["b"].Utils.Update.CommentUpdater=new function(){var c=null;var u=null;var p=false;var g=false;this.update=function(e,t){c=null;u=null;p=false;g=false;var i=Mt["b"].DataObjects.CommentRepo.getAllSelectedExtensionComments(t);for(var a=0;a<i.length;a++){var n=i[a];if(e.id===n.rootModel){if(c===null){c=[];u=[];collectIds(e)}updateComment(n,e,t)}}delete e.freshTransport;if(p){t.getController().dispatch("updateRootModelState",{extension:t,parameters:{saveQVF:true}})}else if(g){for(var a=0;a<i.length;a++){var n=i[a];if(e.id===n.rootModel){t.dispatch("createOrUpdateCommentAction",{extension:t,comment:n,lastModified:null})}}Mt["b"].DataObjects.CommentRepo.updateCommentRepository(t,true)}};function collectIds(e){function helper(e){var t=e.extendedModel;if(t&&t.instanceOf==="ContainerCommentGridModel"){u.push(parseInt(e.id.substr(5)))}else{c.push(parseInt(e.id.substr(5)));if(t&&(t.instanceOf==="ContainerGridModel"||t.instanceOf==="MultipleContainerModel")){for(var i=0;i<e.children.length;i++){if(e.children[i].instanceOf==="ContainerModel"){helper(e.children[i])}}}}}for(var t=0;t<e.firstObjectGrid.children.length;t++){helper(e.firstObjectGrid.children[t])}}function updateComment(e,t,i){var a=parseInt(e.grid.substr(5));if(u.indexOf(a)===-1){Mt["b"].DataObjects.CommentRepo.removeCommentById(e.id,i);g=true;return}for(var n=0;n<e.comments.length;n++){for(var r=0;r<e.comments[n].grid.length;r++){var o=e.comments[n].grid[r];for(var l=0;l<o.length;l++){var s=o[l],d=parseInt(s.created_in_chart.substr(5));if(t.objectCounter<d||c.indexOf(d)>=0){console.log("Cell Id ",d);console.log("ObjCnt ",t.objectCounter);s.created_in_chart="chart"+Mt["b"].Models.Actions.ModelActions.RootModel.getNextId(t);!s.originalLastModified&&(s.originalLastModified=s.lastModified);g=true;p=true}c.push(d)}}}}};var Pe=i(625);Mt["b"].UI=Mt["b"].UI||{};Mt["b"].UI.ColorPicker=Mt["b"].UI.ColorPicker||{createColorPicker:function(e,t,i,a,n){if(a===true||a===undefined){var r=new Mt["b"].UI.ColorPickerDialog(i);r.open(e,n);return r}if(!document.getElementById(e).isColorPickerOpen){document.getElementById(e).isColorPickerOpen=true;openNewColorPicker(e,t)}function openNewColorPicker(r,e){var o=function(e,t){var i="rgb("+t.r+","+t.g+","+t.b+")";document.getElementById(e).style.backgroundColor=i};var t=function(e){var t={};t.r=0;t.g=0;t.b=0;if(e){var i=e.match(/^RGB\((\d+),\s*(\d+),\s*(\d+)\)$/);if(i&&i.length>1){t.r=i[1];t.g=i[2];t.b=i[3]}i=e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);if(i&&i.length>1){t.r=i[1];t.g=i[2];t.b=i[3]}}return t};if(!e){var i=document.getElementById(r);var a=t(i.style["background-color"]);Mt["b"].$(i).CanvasColorPicker({width:400,height:200,showRGB:true,showHSB:false,showColor:false,color:{r:a.r,g:a.g,b:a.b},onColorChange:function(e,t){o(r,e)},onOK:function(e,t){o(r,e);var i=r.replace("_colorPicker","_field");var a=document.getElementById(i);var n=e.r+","+e.g+","+e.b;a.value=n;return true}})}}}};Mt["b"].UI.ColorPickerDialog=function(r){var s=this;var u=Mt["b"].DataObjects.RuntimeDO;var d=u.getTranslation("COLOR_PICKER");var p=null;var a="rgb(50,50,50)";var n="rgb(140, 180, 0)";var o="rgb(255, 0, 0)";var c,g;s.open=function(e,t){Mt["b"].$(document.body).bind("mousedown",closedFromEvent);var i=document.getElementById("colorPickerDialog");if(i===null){var a="colorPickerDialog";var n=[{text:u.getTranslation("OKAY"),id:"colorDialogOkayButton",click:s.okay},{text:u.getTranslation("CANCEL"),id:"colorDialogCancelButton",click:s.cancel}];var r=new Mt["b"].UI.HiCoDialogDefinition(a,d,n);var o=document.getElementById(e);var l=getPosition(o);l=[l.x,l.y+12];r.setWidth(155);r.setPosition(l);r.setResizable(false);g=new Mt["b"].UI.HiCoDialog(r);c=g.getDialogDiv();c.setAttribute("class","colorPicker");g.setCSS();g.getDialog().offsetParent().css("z-index",9999);g.getDialog().offsetParent().on("mousedown",function(e){e.stopPropagation()});if(t){g.getDialog().offsetParent().css("height","115px");g.getDialog().css("height","50px");g.getDialog().css("min-height","50px")}else{g.getDialog().offsetParent().css("height","90px");g.getDialog().css("height","25px");g.getDialog().css("min-height","25px")}c.appendChild(fillContent(e,t));Mt["b"].UI.ColorPicker.createColorPicker(e+"_colorPicker",false,false,false,t)}else{i.parentNode.remove(i);s.open(e)}};function getPosition(e){var t=0;var i=0;while(e){t+=e.offsetLeft-e.scrollLeft+e.clientLeft;i+=e.offsetTop-e.scrollTop+e.clientTop;e=e.offsetParent}return{x:t,y:i}}function fillContent(a,e){var t=document.createElement("table");var i=document.getElementById(a);if(e){var n=document.createElement("tr");var r=document.createElement("td");Mt["b"].$(r).html(u.getTranslation("NOTATION"));n.appendChild(r);r=document.createElement("td");var o=Mt["b"].Utils.DOM.createCheckBoxWithLabel(r,a+"_notation",null,"","");if(i.style.backgroundImage!==""&&i.style.backgroundImage!=="none"&&i.style.backgroundImage!=undefined){o.checkBox.setAttribute("checked","checked")}Mt["b"].$(o.checkBox).change(function(e){checkBoxHandler(e)});n.appendChild(r);t.appendChild(n)}var n=document.createElement("tr");var r=document.createElement("td");var l=u.getTranslation("RGB");Mt["b"].$(r).html(l);n.appendChild(r);r=document.createElement("INPUT");r.setAttribute("type","text");var s=i.style.backgroundColor;s=createInputRGB(s);r.setAttribute("value",s);r.setAttribute("id",a+"_field");r.style.width=80+"px";Mt["b"].$(r).focusout(function(){var e=$(this).val();e=createRGB(e);var t=document.getElementById(a+"_colorPicker");t.style.backgroundColor=e;t=document.getElementById(a+"_field");e=createInputRGB(e);t.value=e});Mt["b"].$(r).keypress(function(e){if(e.which==13){var t=$(this).val();t=createRGB(t);var i=document.getElementById(a+"_colorPicker");i.style.backgroundColor=t;i=document.getElementById(a+"_field");t=createInputRGB(t);i.value=t}});if(o){if(o.checkBox.checked){r.setAttribute("disabled","disabled")}}n.appendChild(r);function createRGB(e){var t=e;t=t.split(",");var i=t.length;if(i>3){t=t.slice(0,3);i=t.length}for(var a=0;a<3;a++){if(t[a]===undefined||t[a]===""){t[a]="0"}var n=false;var r=t[a].split("");var o=r.length;for(var l=0;l<o;l++){if(isNumber(r[l])!=true){delete r[l];n=true}}r=r.join("");o=r.length;if(o>3){r=r.slice(0,3);n=true}if(n===true){t[a]=r}}for(var a=0;a<i;a++){if(isNumber(t[a])!==true){t[a]="0"}if(t[a]>255){t[a]="255"}if(t[a]<0){t[a]="0"}}function isNumber(e){return!isNaN(parseFloat(e))}t=t.join(",");e="rgb("+t+")";return e}function getStyle(e,t){return{height:"12px",width:"12px",minHeight:"12px",minWidth:"12px",backgroundColor:e,margin:"auto",textAlign:"center",border:"1px solid #aaaaaa",display:t?"block":"none"}}var r=document.createElement("td");var d=document.createElement("div");p=a+"_colorPicker";d.setAttribute("id",p);Mt["b"].Utils.DOM.setStyle(d,getStyle(i.style.backgroundColor,true));if(o){if(o.checkBox.checked){d.className="opClass"}}r.appendChild(d);n.appendChild(r);if(e){var c={border:"1px solid #aaaaaa"};t.className="ui-corner-bottom";Mt["b"].Utils.DOM.setStyle(t,c)}t.appendChild(n);return t}function checkBoxHandler(e){var t=e.target;var i=t.id.replace("_notation","");var a=document.getElementById(i+"_field");var n=document.getElementById(i+"_colorPicker");if(t.checked){n.className="opClass";a.disabled=true}else{n.className="noOpClass";a.disabled=false}}function createInputRGB(e){e=e.replace("rgb","");e=e.replace("(","");e=e.replace(")","");e=e.replace(" ","");e=e.replace(" ","");return e}s.okay=function(){var e=p;var t=document.getElementById(e);var i=t.style.backgroundColor;var a=e.replace("_colorPicker","");if(r){r(a,i)}var n=document.getElementById(a+"_notation");if(n){if(!n.checked){setSymbolOrDiv(a,i)}else{setSymbolOrDiv(a,null,r)}}else{setDataRulesColor(a,i)}s.cancel()};function setSymbolOrDiv(e,t,i){var a=document.getElementById(e);var n="none";var r="none";var o="12px";var l="12px";var s="1px solid #aaaaaa";var d=t;if(t===undefined||t===null){n="url('"+pe["a"].imgPath+"notation.png')";if(i){n="url('"+pe["a"].imgPath+"notation_grey.png')"}r=Mt["b"].DataObjects.RuntimeDO.getTranslation("NOTATION");o="16px";l="16px";s="none";d=a.style.backgroundColor}var c={backgroundColor:d,backgroundImage:n,title:r,width:o,minWidth:o,height:l,minHeight:l,border:s,display:"block",margin:"auto",textAlign:"left"};Mt["b"].Utils.DOM.setStyle(a,c)}function setDataRulesColor(e,t){var i=document.getElementById(e);i.style.backgroundColor=t}function closedFromEvent(){var e=Mt["b"].$(".canvas-color-picker").filter(function(e,t){return t.style.visibility!=="hidden"}),t=Mt["b"].$("[id^=cp-mask-]").filter(function(e,t){return t.style.display!=="none"});if(e.length===0&&t.length===0){s.cancel()}}s.cancel=function(){Mt["b"].$(document.body).unbind("mousedown",closedFromEvent);g.close()};s.reset=function(){var e=p;var t=e.replace("_colorPicker","_field");var i=null;if(e.indexOf("Delta")===-1){i=document.getElementById(e);i.style.backgroundColor=a;i=document.getElementById(t);i.value=a}else{if(e.indexOf("2")===-1){i=document.getElementById(e);i.style.backgroundColor=n;i=document.getElementById(t);i.value=n}else{i=document.getElementById(e);i.style.backgroundColor=o;i=document.getElementById(t);i.value=o}}}};Mt["b"].UI=Mt["b"].UI||{};Mt["b"].UI.CommonTableDialog=function(e){var l=this;var c=Mt["b"].DataObjects.RuntimeDO;var t=e.parent;var i=e.parentId;var o=e.expr;var s=725;var d=480;var u=c.getTranslation("COMMON_TABLE");var p=[c.getTranslation("KEY"),c.getTranslation("DESCRIPTION")];var g=null,h=null,a="",n="",f=null,r=null,m=null,v=null;var b='<span style="margin: 0px;"><hr style="margin: 0px 0px 1px 0px; background-color: Gray"></span>';var T="1px solid lightGray";var x='<span style="margin: 0px;"><hr style="margin: 0px 0px 1px 0px; background-color: #bfbfbf"></span>';var E="34%";var y="66%";var C=20;var S=40;var M="rgb(150, 150, 150)";var O="rgb(0, 0, 0)";var A="commonTableKey";var _="commonTableDescription";var L="commonTableSearch";var I="Key (20 digits)";var D="Description (40 digits)";var R="Search key or description";var P="Enter password";var N=null;var w={background:"rgb(240, 240, 240)",border:"none",color:M};var F=JSON.parse(JSON.stringify(Mt["b"].DataObjects.CommonTableRepo.getCommonTableRepo()));var B={key:"",description:"",additionInformation:""};var k={border:"1px solid rgb(170, 170, 170)",height:95+"%",padding:6+"px"};l.open=function(){var e=document.getElementById("commonTableDialog");if(!e){var t="commonTableDialog";var i=[{text:c.getTranslation("OKAY"),id:"commonTableOkayButton",click:l.okay},{text:c.getTranslation("CANCEL"),id:"commonTableCancelButton",click:l.close},{text:c.getTranslation("NO_COMMONTABLE"),id:"commonTableClearButton",click:l.clear}];var a=new Mt["b"].UI.HiCoDialogDefinition(t,u,i);a.setWidth(s+"px");a.setHeight(d);a.setPosition("center");a.setResizable(true);h=new Mt["b"].UI.HiCoDialog(a);g=h.getDialogDiv();h.setCSS("overflow","hidden");h.getDialog().dialog("option","minWidth",s);h.setCSS();g.appendChild(fillContent());var n=parseInt(h.highest());var r=parseInt(h.getDialog().offsetParent().css("z-index"));if(n>r){n+=1;h.getDialog().offsetParent().css("z-index",n)}h.getDialog().dialog("open");if(N){var o=document.getElementById(N);if(o){setRowHighlight(o)}}}else{e.parentNode.remove(e);l.open()}};l.okay=function(){if(N&&N!=="new"){var e=Mt["b"].DataObjects.CommonTableRepo.checkPassword({hash:N,password:a});if(e){Mt["b"].DataObjects.CommonTableRepo.updateCommonTable(F[N]);t.setCommonTable({parentId:i,hash:N});l.close()}else{Mt["b"].UI.HiCoNotification(c.getTranslation("PASSWORD_WRONG"))}}else if(N==="new"){if(checkRepeatPassword()){B.password=a;if(B.key&&B.key!==""){B.hash=Z["a"].createSHA1Hash(B.key);var e=Mt["b"].DataObjects.CommonTableRepo.addCommonTable(B);if(e){t.setCommonTable({parentId:i,hash:B.hash,key:B.key});l.close()}else{Mt["b"].UI.HiCoNotification(c.getTranslation("KEY_EXISTS"))}}else{Mt["b"].UI.HiCoNotification(c.getTranslation("KEY_EMPTY"))}}else{Mt["b"].UI.HiCoNotification(c.getTranslation("PASSWORD_WRONG"))}}else if(N==null){t.setCommonTable({parentId:i,hash:N});l.close()}};l.close=function(){h.close()};l.clear=function(){t.setCommonTable({parentId:i,hash:null});l.close()};function fillContent(){var e=document.createElement("div");e.setAttribute("id","commonTableDialogDiv");Mt["b"].$(e).addClass("ui-corner-bottom");Mt["b"].$(e).css(k);var t=document.createElement("div");t.setAttribute("id","HiCoCommonTableLeftDiv");t.style.cssFloat="left";t.style.width="70%";t.style.height="100%";t.appendChild(createTopTable());t.appendChild(createSeparationLine());t.appendChild(createMidTable());t.appendChild(createBottomTableHeader());t.appendChild(createBottomTableBody());t.appendChild(createSeparationLine());t.appendChild(createPasswordTable());var i=document.createElement("div");i.setAttribute("id","HiCoCommonTableRightDiv");i.style.cssFloat="left";i.style.width="30%";i.style.height="100%";i.appendChild(createAdditionInformationHeader());i.appendChild(createAdditionInformationBody());e.appendChild(t);e.appendChild(i);return e}function createTopTable(){var e=document.createElement("div");e.setAttribute("id","topDiv");e.style.marginBottom="5px";var t=createTable();createHeader(t);createTopBody(t);e.appendChild(t);return e}function createMidTable(){var e=document.createElement("div");e.setAttribute("id","midDiv");e.style.marginTop="10px";var t=createTable();createMidBody(t);e.appendChild(t);return e}function createBottomTableHeader(){var e=document.createElement("div");e.setAttribute("id","bottomDiv");var t=createTable();createHeader(t);e.appendChild(t);return e}function createBottomTableBody(){var e=document.createElement("div");e.setAttribute("id","bottomBodyDiv");e.style.overflow="auto";e.style.height="205px";r=createTable();r.style.width="100%";createBottomBody(r);Mt["b"].$(r).click(getTableRow);e.appendChild(r);return e}function createPasswordTable(){var e=document.createElement("div");e.setAttribute("id","passwordDiv");var t=createTable();createPasswordBody(t);e.appendChild(t);return e}function createTable(){var e=document.createElement("table");e.style.width="98%";return e}function createSeparationLine(){var e=document.createElement("td");e.style.width=s+"px";e.innerHTML=x;return e}function createHeader(e){var t=e.appendChild(document.createElement("tr"));var i=e.appendChild(document.createElement("tr"));for(var a=0;a<p.length;a++){var n=t.appendChild(document.createElement("td"));n.innerHTML=p[a];var r=i.appendChild(document.createElement("td"));r.innerHTML=b;if(a===0){n.style.width=E}else{n.style.width=y}}}function createTopBody(e){v=e.appendChild(document.createElement("tr"));for(var t=0;t<p.length;t++){var i=v.appendChild(document.createElement("td"));i.style.borderBottom=T;var a=i.appendChild(document.createElement("input"));a.setAttribute("type","text");if(t===0){a.setAttribute("value",I);a.setAttribute("id",A);a.maxLength=C;a.style.width="100%"}else{a.setAttribute("value",D);a.setAttribute("id",_);a.maxLength=S;a.style.width="100%"}Mt["b"].$(a).css(w);Mt["b"].$(a).focus(focusFieldAction);Mt["b"].$(a).lostFocus(focusoutFieldAction)}}function createMidBody(e){var t=e.appendChild(document.createElement("tr"));for(var i=0;i<p.length;i++){var a=t.appendChild(document.createElement("td"));if(i===0){a.innerHTML=c.getTranslation("COMMON_TABLE_EXISTS");a.style.width=E}else{var n=a.appendChild(document.createElement("input"));n.setAttribute("type","text");n.setAttribute("value",R);n.setAttribute("id",L);n.maxLength=S;n.style.width="100%";Mt["b"].$(n).css(w);Mt["b"].$(n).focus(focusFieldAction);Mt["b"].$(n).keyup(searchForRow);Mt["b"].$(n).lostFocus(focusoutFieldAction);a.style.width=y}}}function createBottomBody(e){for(var t in F){var i=e.appendChild(document.createElement("tr"));i.setAttribute("id",t);for(var a=0;a<p.length;a++){var n=i.appendChild(document.createElement("td"));if(a===0){n.style.borderBottom=T;if(!isNaN(F[t].key)){n.style.textAlign="right"}n.innerHTML=F[t].key;n.style.width=E}else{var r=n.appendChild(document.createElement("input"));r.setAttribute("type","text");r.setAttribute("id",t+"##"+_);r.maxLength=S;r.style.width="100%";Mt["b"].$(r).css(w);if(F[t].description===""){r.setAttribute("value",D)}else{r.setAttribute("value",F[t].description);r.style.color=O}Mt["b"].$(r).focus(focusFieldAction);Mt["b"].$(r).lostFocus(focusoutFieldAction);n.style.width=y}}if(t===o.commonTable){N=t}}}function createPasswordBody(e){var t=[c.getTranslation("PASSWORD"),c.getTranslation("PASSWORD_REPEAT")];var i=["password","repeatPassword"];for(var a=0;a<t.length;a++){var n=e.appendChild(document.createElement("tr"));var r=n.appendChild(document.createElement("td"));var o=n.appendChild(document.createElement("td"));o=o.appendChild(document.createElement("input"));o.setAttribute("id",i[a]);o.setAttribute("real-value","");var l=false;var s=false;var d=[-1,-1];o.onkeyup=function(e){if(e.keyCode==17){l=false}else{var t=this.getAttribute("real-value");if(s){t=t.substring(0,d[0])+this.value.split("*").join("")+t.substring(d[1],t.length);s=false}else{if(e.keyCode!=8){t+=this.value.split("*").join("")}else{var i=t.length-this.value.length;if(t.length>0){t=t.substring(0,t.length-i)}}}this.setAttribute("real-value",t);var a="";for(var n=0;n<t.length;n++){a+="*"}this.value=a}};o.onkeydown=function(e){if(e.keyCode==17){l=true}if(e.keyCode==86){if(l){d[0]=this.selectionStart;d[1]=this.selectionEnd;s=true}}};r.innerHTML=t[a];r.style.width=E;o.setAttribute("type","text");o.setAttribute("value",P);Mt["b"].$(o).css(w);o.style.width="100%";o.maxLength=S;Mt["b"].$(o).focus(focusPasswordAction);Mt["b"].$(o).lostFocus(focusoutPasswordAction);if(a==1){f=n}}}function createAdditionInformationHeader(){var e=document.createElement("td");e.innerHTML="Addition key information";return e}function createAdditionInformationBody(){var e=document.createElement("div");e.style.width="100%";e.style.height="94%";m=e.appendChild(document.createElement("textarea"));m.setAttribute("id","additionInformation");m.style.width="100%";m.style.height="100%";m.style.resize="none";m.setAttribute("rows",1);Mt["b"].$(m).focusout(setAdditionInformation);return e}function getTableRow(e){if(e.target.tagName.toUpperCase()==="TD"){var t=e.target.parentNode;if(t){setRowHighlight(t)}}}function resetRowHighlights(e){var t=r;if(t){for(var i=0;i<t.rows.length;i++){var a=t.rows[i];if(e==undefined||a.id!==e.id){Mt["b"].$(a).removeClass("rowHighlight")}}}}function focusFieldAction(){if(this.id===A||this.id===_){if(this.value.toUpperCase()===I.toUpperCase()||this.value.toUpperCase()===D.toUpperCase()){this.value="";this.style.color=O}Mt["b"].$(v).addClass("rowHighlight");N="new";resetRowHighlights();getAdditionInformation();Mt["b"].$(f).show();Mt["b"].$(m).prop("disabled",false)}else if(this.id.indexOf(_)>-1){N=this.id.split("##")[0];if(this.value.toUpperCase()===D.toUpperCase()){this.value="";this.style.color=O}Mt["b"].$(v).removeClass("rowHighlight");resetRowHighlights();Mt["b"].$(this.parentElement.parentElement).addClass("rowHighlight");getAdditionInformation();Mt["b"].$(f).hide();Mt["b"].$(m).prop("disabled",false)}else if(this.value.toUpperCase()===R.toUpperCase()){this.value="";this.style.color=O;Mt["b"].$(v).removeClass("rowHighlight");N=null;resetRowHighlights();Mt["b"].$(f).hide();Mt["b"].$(m).prop("disabled",true)}}function focusoutFieldAction(){if(this.value===""){this.style.color=M;if(this.id===A){this.value=I;B.key=""}else if(this.id===_){this.value=D;B.description=""}else if(this.id===L){this.value=R}else if(this.id.indexOf(_)>-1&&N!=null&&N!=="new"){this.value=D;F[N].description=""}}else{if(this.id===A){B.key=this.value}else if(this.id===_){B.description=this.value}else if(this.id.indexOf(_)>-1&&N!=null&&N!=="new"){F[N].description=this.value}}}function focusPasswordAction(){if(this.value.toUpperCase()===P.toUpperCase()){this.value="";this.style.color=O}}function focusoutPasswordAction(){if(this.value===""){this.value=P;this.style.color=M;if(this.id==="password"){a=""}else{n=""}}else{var e=this.getAttribute("real-value");if(this.id==="password"){a=Z["a"].encrypt(e,Mt["b"].Utils.Constants.ParameterSets.LDAP)}else{n=Z["a"].encrypt(e,Mt["b"].Utils.Constants.ParameterSets.LDAP)}}}function searchForRow(e){Mt["b"].$(v).removeClass("rowHighlight");resetRowHighlights();if(e.keyCode!=13){var n=this.value.toUpperCase();var t=r;var i=Mt["b"].$(t).find("tr");if(n===""){i.show();return}i.hide();i.filter(function(e,t){var i=Mt["b"].$(this).children();for(var e=0;e<i.length;e++){var a=Mt["b"].$(i[e]).text().toUpperCase();if(a.indexOf(n)>-1){return true}}return false}).show()}}function checkRepeatPassword(){if(a!==""&&a===n){return true}else{return false}}function setAdditionInformation(){var e=F[N];if(e){e.additionInformation=m.value}else if(N==="new"){B.additionInformation=m.value}}function getAdditionInformation(){if(N){var e=F[N];if(e){m.value=e.additionInformation}else if(N==="new"){m.value=B.additionInformation}}else{m.value=""}}function setRowHighlight(e){Mt["b"].$(m).prop("disabled",false);var t=Mt["b"].$(e);if(t.hasClass("rowHighlight")){t.removeClass("rowHighlight");N=null;getAdditionInformation()}else{t.addClass("rowHighlight");N=e.id;Mt["b"].$(f).hide();getAdditionInformation()}resetRowHighlights(e);Mt["b"].$(v).removeClass("rowHighlight")}};Mt["b"].UI=Mt["b"].UI||{};Mt["b"].UI.CompareProperties=function(r){var h=this;var L=JSON.parse(JSON.stringify(r.currComp));var e=r.dialogObj?r.dialogObj:null;var I=Mt["b"].DataObjects.RuntimeDO;var D=r.extension;var f=D.getCanvasDO().getDOMElement();var p=r.containerModel;var o=p?p.extendedModel:null;var t=Mt["b"].DataObjects.ContextRepo.getContextByCid(o.contextId);var g=ge["a"];var M=new Mt["b"].Utils.Calculator(t);var R;var m=Mt["b"].DataObjects.DocumentDO.getDocSettings().docLanguage.value==="en_US"?"450":"480";var v="190";var P=Mt["b"].Utils.Constants.TypeValues.indicator;var N=r.availCompares;var b=I.getTranslation("PROPERTIES")+" ("+(L.name!=undefined?L.name:L.id)+")";var T;var x;var E=null;var y=e?e.getDialogDiv():null;var w=null;var C=[{id:"comp-tabsProps-from",text:I.getTranslation("COMPARE_FROM"),tooltip:I.getTranslation("HELP_COMPAREPROPERTIES_FROM"),buildUp:createFromTab},{id:"comp-tabsProps-to",text:I.getTranslation("TO"),tooltip:I.getTranslation("HELP_COMPAREPROPERTIES_TO"),buildUp:createToTab},{id:"comp-tabsProps-content",text:I.getTranslation("DESCRIPTION"),tooltip:I.getTranslation("HELP_COMPAREPROPERTIES_DESCRIPTION"),buildUp:createContentTab},{id:"comp-tabsProps-rest",text:I.getTranslation("REST"),tooltip:I.getTranslation("HELP_COMPAREPROPERTIES_REST"),buildUp:createRestTab}];var S=["type","posField","category","keyfigure","start"];var a=["HELP_COMPAREPROPERTIES_FROM_TYPE","HELP_COMPAREPROPERTIES_FROM_POSITION","HELP_COMPAREPROPERTIES_FROM_DIMENSION","HELP_COMPAREPROPERTIES_FROM_MEASURE","HELP_COMPAREPROPERTIES_FROM_START"];var n=["HELP_COMPAREPROPERTIES_TO_TYPE","HELP_COMPAREPROPERTIES_TO_POSITION","HELP_COMPAREPROPERTIES_TO_DIMENSION","HELP_COMPAREPROPERTIES_TO_MEASURE","HELP_COMPAREPROPERTIES_TO_START"];var O=[I.getTranslation("TYPE"),I.getTranslation("POSITION"),I.getTranslation("DIMENSION"),I.getTranslation("MEASURE"),I.getTranslation("START")];var A=[0,0,0,0,0];var u=[P.ABSOLUTE,P.PERCENT,P.LABEL];var _=[I.getTranslation("ABSOLUTE"),I.getTranslation("PERCENT"),I.getTranslation("LABEL")];var F=["HELP_COMPAREPROPERTIES_DESCRIPTION_ABSOLUTE","HELP_COMPAREPROPERTIES_DESCRIPTION_PERCENT","HELP_COMPAREPROPERTIES_DESCRIPTION_LABEL"];var B=[0,0,0];var k=null;var U=null;var H=null;var G="Notation";var V=I.getTranslation("ENTER_HERE");var $={backgroundColor:"rgb(240, 240, 240)",border:"0px none",textAlign:"right",verticalAlign:"middle"};var z={verticalAlign:"middle"};var W=["color","ellipse","compareStyle","offsetPoint","OffsetIn_mm/10pt","displace"];var j=[I.getTranslation("COLOR"),I.getTranslation("ELLIPSE"),I.getTranslation("STYLE"),I.getTranslation("OFFSET_POINT"),I.getTranslation("OFFSET_MMPT"),I.getTranslation("DISPLACE_PRIORITY")];var K=["HELP_COMPAREPROPERTIES_REST_COLOR","HELP_COMPAREPROPERTIES_REST_ELLIPSE","HELP_COMPAREPROPERTIES_REST_STYLE","HELP_COMPAREPROPERTIES_REST_OFFSET","HELP_COMPAREPROPERTIES_REST_OFFSETMMPT","HELP_COMPAREPROPERTIES_REST_DISPLACE"];var X=[0,0,0,0,0,0];var Y=null;var Z=[P.FROM,P.TO,P.START,P.END];var Q=[I.getTranslation("COMPARE_FROM"),I.getTranslation("TO"),I.getTranslation("LEGEND_START"),I.getTranslation("LEGEND_END")];if(L.type==="table"){Z=[P.FROM,P.TO,P.END];Q=[I.getTranslation("COMPARE_FROM"),I.getTranslation("TO"),I.getTranslation("LEGEND_END")]}var q=[-1,0,1,2,3,4,5,6,7,8,9];var J=["-","0","1","2","3","4","5","6","7","8","9"];var ee=[P.START,P.END];var te=[I.getTranslation("BEGIN"),I.getTranslation("END")];var ie=[P.POSITION,P.LABEL];var ae=[I.getTranslation("POSITION"),I.getTranslation("LABEL")];var ne=[];var re=[];for(var i=0;i<t.columns.length;i++){ne[i]=t.columns[i].name;re[i]=t.columns[i].id.split(".").pop()}var oe=[P.AXIS,P.KEYFIGURE];var le=[I.getTranslation("ZERO"),I.getTranslation("MEASURE")];var se=18;var de=4;var ce=null;var ue=null;h.open=function(e){E=e;var t=document.getElementById("compareProperties");if(t===null||t===undefined){var i="compareProperties";var a=y?Mt["b"].$(Mt["b"].$(y).parent()).offset():null;var n=y?Mt["b"].$(Mt["b"].$(y).parent()).width():null;var r=7;var o=[{text:I.getTranslation("OKAY"),id:"comparePropertiesDialogOkayButton",click:h.okay},{text:I.getTranslation("CANCEL"),id:"comparePropertiesDialogCancelButton",click:h.cancel}];var l=new Mt["b"].UI.HiCoDialogDefinition(i,b,o);R=l.getFontSize();var s=a&&n?[a.left+n+r,a.top]:"center";l.setPosition(s);l.setWidth(m+"px");l.setHeight(v);l.setResizable(true);l.setParentDomElement(f.parentNode);l.setTooltip(I.getTranslation("HELP_COMPAREPROPERTIES"));x=new Mt["b"].UI.HiCoDialog(l);T=x.getDialogDiv();var d={position:"absolute",visibility:"hidden",height:"auto",width:"auto"};var c=document.createElement("div");c.setAttribute("id","hiddenDiv");Mt["b"].Utils.DOM.setStyle(c,d);c.style.fontSize=R;T.appendChild(c);calculateLength();var u=x.buildTabs("comparePropertiesTabDiv",C,null,"auto",{top:"0px",left:"0px"},null,true);x.decorateTabs(0,C);Mt["b"].$(u).height("100%");x.setEvent("dialogresize",function(e,t){var i=Mt["b"].$(T).parent().height()-70;Mt["b"].$(T).height(i);Mt["b"].$(".ui-tabs-panel",Mt["b"].$(T).parent()).height(i-Mt["b"].$("#comparePropertiesTabDiv > .ui-tabs-nav").height()-se);i-=200;Mt["b"].Utils.DOM.setStyle(document.getElementById("comparePropertiesFromTableDiv"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("comparePropertiesToTableDiv"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("comparePropertiesContentTableDiv"),{height:i+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("comparePropertiesRestTableDiv"),{height:i+"px"})});T.setAttribute("class","compareProperties");x.setCSS();var p=parseInt(x.highest());var g=parseInt(x.getDialog().offsetParent().css("z-index"));if(p>g){p+=1;x.getDialog().offsetParent().css("z-index",p)}x.getDialog().dialog("open")}else{t.parentNode.remove(t);h.open(e)}};h.okay=function(){var e=L;e.compareFromPos=ie[document.getElementById("select##"+e.id+"##compareFromPosition").selectedIndex];if(e.compareFromPos===P.LABEL){e.from=M.encodeInputField(ce)}else{e.positionFromInput=ce}updateCompareFromAndTo(e,"From");e.compareFromCat=oe[document.getElementById("select##"+e.id+"##compareFromCat").selectedIndex];var t=e.from.split("#")[0];var i=re[document.getElementById("select##"+e.id+"##compareFromKeyfigure").selectedIndex];e.from=t+"#"+i;e.fromAbsolutePosition.positionInGroup=document.getElementById("select##"+e.id+"##compareFromKeyfigure").selectedIndex;e.compareFromStart=ee[document.getElementById("select##"+e.id+"##compareFromStart").selectedIndex];e.compareToPos=ie[document.getElementById("select##"+e.id+"##compareToPosition").selectedIndex];if(e.compareToPos===P.LABEL){e.to=M.encodeInputField(ue)}else{e.positionToInput=ue}updateCompareFromAndTo(e,"To");e.compareToCat=oe[document.getElementById("select##"+e.id+"##compareToCat").selectedIndex];var t=e.to.split("#")[0];var i=re[document.getElementById("select##"+e.id+"##compareToKeyfigure").selectedIndex];e.to=t+"#"+i;e.toAbsolutePosition.positionInGroup=document.getElementById("select##"+e.id+"##compareToKeyfigure").selectedIndex;e.compareToStart=ee[document.getElementById("select##"+e.id+"##compareToStart").selectedIndex];e.absolute.legend=k;e.percent.legend=U;var a=document.getElementById("select##"+e.id+"##text").value;if(a.indexOf("$")>-1){a=M.encode(a)}e.text.text=a===V?"":a;e.text.legend=H;if(e.text.originalText){delete e.text.originalText}var n=document.getElementById("select##"+e.id+"##rgb").style;if(n.backgroundImage!=="none"&&n.backgroundImage!==""&&n.backgroundImage!=undefined){e.notation=P.NOTATION}else{e.notation=P.INDIVIDUAL;e.individualColor=n.backgroundColor}e.ellipse=document.getElementById("select##"+e.id+"##ellipse").checked;e.compareStyle=Y;e.compareLegend=Z[document.getElementById("select##"+e.id+"##offsetPoint").selectedIndex];e.displayOffset=document.getElementById("select##"+e.id+"##compareOffset").value;if(e.compareToPos===P.POSITION&&e.compareFromPos===P.POSITION){e.linkType=1}else{e.linkType=0}e.displacePriority=q[document.getElementById("select##"+e.id+"##displacePriority").selectedIndex];e.isStackCompare=!!o.stackMode;E.setCompare(e,r);h.cancel()};h.cancel=function(){if(w&&w.cancel){w.cancel()}x.close()};function autoFocusIn(e){e.style.color="";if(e.value===G||e.value===V){e.value=""}}function autoFocusOut(e){if(e.id.split("##").pop()==="text"){if(e.value===""){e.value=V;e.style.color="rgb(150,150,150)"}}else if(e.value===""||isNaN(e.value)){e.value=G;e.style.color="rgb(150,150,150)"}}function updateCompareFromAndTo(e,t){var i=M.encodeInputField(document.getElementById("select##"+e.id+"##position"+t+"Input").value);var a="compare"+t+"Pos";var n=t==="To"?"to":"from";if(e[a]===P.LABEL){var r=i.split("@");for(var o=0;o<r.length;o++){var l=r[o];if(l[0]==="$"&&l[1]==="("&&l[l.length-1]===")"){var s={};M.addQvVariables(s,false);r[o]=g.resolveVariables(M,r[o],s,null,null,false)}}i=r.join("@")}else{if(i[0]==="$"&&i[1]==="("&&i[i.length-1]===")"){var s={};M.addQvVariables(s,false);i=g.resolveVariables(M,i,s,null,null,false)}}for(var o=0;o<p.children.length;o++){var d=p.children[o];if(d.instanceOf!=="BackGroundModel"&&d.instanceOf!=="CompareModel"&&d.instanceOf!=="ContainerModel"&&d.instanceOf!=="AxisModel"&&d.instanceOf!=="LabelModel"&&d.instanceOf!=="DataTypeAnnotatorModel"&&d.instanceOf!=="RowConnectorModel"){if(e[a]===P.POSITION&&d.absolutePosition&&(d.absolutePosition.groupIndex+1).toString()===i){var c=e[n].split("#")[1];var r=e[n].split("#")[0].split("@");var u=true;for(var o=0;o<r.length;o++){var l=r[o];if(l[0]==="$"&&l[1]==="("&&l[l.length-1]===")"){u=false;break}}e[n]=u?d.dataId_dim:e[n];e[n]=e[n]+"#"+c;break}else if(t==="From"&&e.compareFromPos===P.LABEL&&d.dataId_dim&&d.dataId_dim===i){if(e.positionFromInput[0]!=="$"&&e.positionFromInput[1]!=="("&&e.positionFromInput[e.positionFromInput.length-1]!==")"){e.positionFromInput=(d.absolutePosition.groupIndex+1).toString()}break}else if(t==="To"&&e.compareToPos===P.LABEL&&d.dataId_dim&&d.dataId_dim===i){if(e.positionToInput[0]!=="$"&&e.positionToInput[1]!=="("&&e.positionToInput[e.positionToInput.length-1]!==")"){e.positionToInput=(d.absolutePosition.groupIndex+1).toString()}break}}}}function changeConnectorStyleHandler(e){var t=e.target;var i=Mt["b"].$("#comparePropertiesRestTableDiv").find(".connectorSymbol");for(var a=0;a<i.length;a++){switch(i[a].id.split("##").pop()){case"conArrow":i[a].src=pe["a"].imgPath+(i[a].id===t.id?"arrow_up_active.png":"arrow_up.png");if(i[a].id===t.id){Y=P.ARROW}break;case"conPin":i[a].src=pe["a"].imgPath+(i[a].id===t.id?"pin_active.png":"pin.png");if(i[a].id===t.id){Y=P.PIN}break;case"conNotation":i[a].src=pe["a"].imgPath+(i[a].id===t.id?"notation.png":"notation_inactive.png");if(i[a].id===t.id){Y=P.NOTATION}break}}}function changeLegendPosition(e){var t=e.target.id.split("##").pop();var i=e.target.className.split(/\s+/);var a=null;var n=null;for(var r=0;r<i.length;r++){if(i[r].indexOf("absolute")>-1){a=P.ABSOLUTE;n=k;break}else if(i[r].indexOf("percent")>-1){a=P.PERCENT;n=U;break}else if(i[r].indexOf("text")>-1){a=P.TEXT;n=H;break}}switch(t){case"auto":n=n===P.AUTO?P.NONE:P.AUTO;break;case"legendTop":n=n===P.START?P.NONE:P.START;break;case"legendMid":n=n===P.MID?P.NONE:P.MID;break;case"legendBot":n=n===P.END?P.NONE:P.END;break}switch(a){case P.ABSOLUTE:k=n;break;case P.PERCENT:U=n;break;case P.TEXT:H=n;break}refreshImages(e,a,n)}function refreshImages(e,t,i){if(t!==null){var a=Mt["b"].$("#comparePropertiesContentTableDiv").find("."+t);for(var n=0;n<a.length;n++){Mt["b"].$(a[n]).removeClass("opClass");switch(a[n].id.split("##").pop()){case"auto":a[n].src=pe["a"].imgPath+(i===P.AUTO?"order_auto_HI.png":"order_auto_N.png");i===P.NONE&&Mt["b"].$(a[n]).addClass("opClass");break;case"legendTop":a[n].src=pe["a"].imgPath+(i===P.START?"order_top_HI.png":"order_top_N.png");(i===P.AUTO||i===P.NONE)&&Mt["b"].$(a[n]).addClass("opClass");break;case"legendMid":a[n].src=pe["a"].imgPath+(i===P.MID?"order_sort_HI.png":"order_sort_N.png");(i===P.AUTO||i===P.NONE)&&Mt["b"].$(a[n]).addClass("opClass");break;case"legendBot":a[n].src=pe["a"].imgPath+(i===P.END?"order_bottom_HI.png":"order_bottom_N.png");(i===P.AUTO||i===P.NONE)&&Mt["b"].$(a[n]).addClass("opClass");break}}}}function checkFormulas(e){var t=e.target.id.split("##");var i=e.target.value;var a=0;if(t[2]==="positionFromInput"){a=document.getElementById("select##"+t[1]+"##compareFromPosition").selectedIndex}else if(t[2]==="positionToInput"){a=document.getElementById("select##"+t[1]+"##compareToPosition").selectedIndex}a=ie[a];if(a===P.POSITION){if(validateVariable(i)){if(t[2]==="positionFromInput"){ce=i}else if(t[2]==="positionToInput"){ue=i}e.target.style.color="#000000";e.target.blur()}else{e.target.style.color="#FF0000"}}else{var n=i.slice(1,i.length-1);if(validateVariable(n)){if(t[2]==="positionFromInput"){ce=i}else if(t[2]==="positionToInput"){ue=i}e.target.style.color="#000000";e.target.blur()}else{e.target.style.color="#FF0000"}}}function validateVariable(e){if(e[0]!=="$"||e[1]!=="("||e[e.length-1]!==")"){return true}else{var t={};M.addQvVariables(t,true);return g.resolveVariables(M,M.encode(e),t,null,null,false)}}function calculateLength(){var e=document.getElementById("hiddenDiv");for(var t=0;t<S.length;t++){Mt["b"].$(e).html(O[t]);A[t]=e.clientWidth+1}for(var t=0;t<ie.length;t++){Mt["b"].$(e).html(ae[t]);var i=e.clientWidth+30;if(A[0]<i){A[0]=i}}A[1]=Math.max(A[1],100);for(var t=0;t<oe.length;t++){Mt["b"].$(e).html(le[t]);var i=e.clientWidth+30;if(A[2]<i){A[2]=i}}for(var t=0;t<re.length;t++){Mt["b"].$(e).html(ne[t]);var i=e.clientWidth+30;if(A[3]<i){A[3]=i}}for(var t=0;t<ee.length;t++){Mt["b"].$(e).html(te[t]);var i=e.clientWidth+30;if(A[4]<i){A[4]=i}}for(var t=0;t<u.length;t++){Mt["b"].$(e).html(_[t]);B[t]=e.clientWidth+1}B[0]=Math.max(B[0],70);B[1]=Math.max(B[1],70);B[2]=Math.max(B[2],281);for(var t=0;t<W.length;t++){Mt["b"].$(e).html(j[t]);X[t]=e.clientWidth+1}X[2]=Math.max(X[2],53);for(var t=0;t<Z.length;t++){Mt["b"].$(e).html(Q[t]);var i=e.clientWidth+35;if(X[3]<i){X[3]=i}}}function createFromTab(){var e=document.createElement("div");e.setAttribute("id","tabCompareFromPropDiv");var t=createCompareFromToHeader(a);e.appendChild(t);var i=createCompareFromTable();e.appendChild(i);return e}function createCompareFromToHeader(e){var t=document.createElement("div");t.setAttribute("id","headerDiv");var i={height:25+"px",width:"auto"};Mt["b"].Utils.DOM.setStyle(t,i);var a=document.createElement("table");var n=document.createElement("tr");var r=document.createElement("tr");for(var o=0;o<S.length;o++){var l=document.createElement("td");var s=document.createElement("td");var d=A[o];var c={width:d+"px",minWidth:d+"px",whiteSpace:"nowrap",textAlign:"center"};Mt["b"].Utils.DOM.setStyle(l,c);Mt["b"].Utils.DOM.setStyle(s,c);Mt["b"].$(l).html(O[o]);l.setAttribute("title",I.getTranslation(e[o]));var u=document.createElement("span");u.style.margin="0px";Mt["b"].$(u).html('<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">');s.appendChild(u);r.appendChild(s);n.appendChild(l)}a.appendChild(n);a.appendChild(r);t.appendChild(a);return t}function createCompareFromTable(){var e=document.createElement("div");e.setAttribute("id","comparePropertiesFromTableDiv");var t={height:25+"px",width:"100%"};Mt["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");var n=L;if(n!==null&&n!==undefined){var a=document.createElement("tr");var r={width:A[0]+"px",minWidth:A[0]+"px",textAlign:"center"};var o=document.createElement("td");Mt["b"].Utils.DOM.setStyle(o,r);var l=n.compareFromPos;var s=Mt["b"].Utils.DOM.createSelectBox(o,"select##"+n.id+"##compareFromPosition",ie,ae,l,R);s.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_FROM_TYPE"));Mt["b"].$(o).on("change",function(e){var t=e.target;var i=t.id.split("##")[1];var a=ie[t.selectedIndex];updateCompareFromAndTo(n,"From");if(a===P.POSITION){ce=n.positionFromInput.toString();document.getElementById("select##"+i+"##positionFromInput").value=ce}else{ce=M.decodeInputField(n.from,true);document.getElementById("select##"+i+"##positionFromInput").value=ce}});a.appendChild(o);r={width:A[1]+"px",minWidth:A[1]+"px",textAlign:"center"};o=document.createElement("td");Mt["b"].Utils.DOM.setStyle(o,r);var d;if(n.compareFromPos===P.POSITION){d=M.decode(n.positionFromInput.toString());ce=n.positionFromInput.toString()}else{d=M.decodeInputField(n.from,true);ce=d}var c=Mt["b"].Utils.DOM.createTextInputNoMax(o,"select##"+n.id+"##positionFromInput",d,0,R);c.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_FROM_POSITION"));Mt["b"].$(c).css({width:"95px"});Mt["b"].Utils.DOM.setStyle(c,$);Mt["b"].$(c).on("focusout",function(e){checkFormulas(e)});Mt["b"].$(c).on("keydown",function(e){if(e.which===13){checkFormulas(e)}});a.appendChild(o);r={width:A[2]+"px",minWidth:A[2]+"px",textAlign:"center"};o=document.createElement("td");Mt["b"].Utils.DOM.setStyle(o,r);var u=n.compareFromCat;var s=Mt["b"].Utils.DOM.createSelectBox(o,"select##"+n.id+"##compareFromCat",oe,le,u,R);s.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_FROM_DIMENSION"));Mt["b"].$(o).on("change",function(e){var t=e.target.id.split("##")[1];if(oe[e.target.selectedIndex]===P.AXIS){var i=document.getElementById("select##"+t+"##compareFromKeyfigure");i.disabled=true;document.getElementById("select##"+t+"##compareFromStart").disabled=true}else{var i=document.getElementById("select##"+t+"##compareFromKeyfigure");i.disabled=false;document.getElementById("select##"+t+"##compareFromStart").disabled=false}});a.appendChild(o);r={width:A[3]+"px",minWidth:A[3]+"px",textAlign:"center"};o=document.createElement("td");Mt["b"].Utils.DOM.setStyle(o,r);var l=n.from.split("#").pop();var s=Mt["b"].Utils.DOM.createSelectBox(o,"select##"+n.id+"##compareFromKeyfigure",re,ne,l,R);s.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_FROM_MEASURE"));if(u==="axis"){s.disabled=true}a.appendChild(o);r={width:A[4]+"px",minWidth:A[4]+"px",textAlign:"center"};o=document.createElement("td");Mt["b"].Utils.DOM.setStyle(o,r);var l=n.compareFromStart;var s=Mt["b"].Utils.DOM.createSelectBox(o,"select##"+n.id+"##compareFromStart",ee,te,l,R);s.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_FROM_START"));if(u==="axis"){s.disabled=true}a.appendChild(o);i.appendChild(a)}e.appendChild(i);return e}function createToTab(){var e=document.createElement("div");e.setAttribute("id","tabCompareToPropDiv");var t=createCompareFromToHeader(n);e.appendChild(t);var i=createCompareToTable();e.appendChild(i);return e}function createCompareToTable(){var e=document.createElement("div");e.setAttribute("id","comparePropertiesToTableDiv");var t={height:25+"px",width:"100%"};Mt["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");var n=L;if(n!==null&&n!==undefined){var a=document.createElement("tr");var r={width:A[0]+"px",minWidth:A[0]+"px",textAlign:"center"};var o=document.createElement("td");Mt["b"].Utils.DOM.setStyle(o,r);var l=n.compareToPos;var s=Mt["b"].Utils.DOM.createSelectBox(o,"select##"+n.id+"##compareToPosition",ie,ae,l,R);s.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_TO_TYPE"));Mt["b"].$(s).on("change",function(e){var t=e.target;var i=ie[t.selectedIndex];var a=t.id.split("##")[1];updateCompareFromAndTo(n,"To");if(i===P.POSITION){ue=n.positionToInput.toString();document.getElementById("select##"+a+"##positionToInput").value=ue}else{ue=M.decodeInputField(n.to,true);document.getElementById("select##"+a+"##positionToInput").value=ue}});a.appendChild(o);r={width:A[1]+"px",minWidth:A[1]+"px",textAlign:"center"};o=document.createElement("td");Mt["b"].Utils.DOM.setStyle(o,r);var d;if(n.compareToPos===P.POSITION){d=M.decode(n.positionToInput.toString());ue=n.positionToInput.toString()}else{d=M.decodeInputField(n.to,true);ue=d}var c=Mt["b"].Utils.DOM.createTextInputNoMax(o,"select##"+n.id+"##positionToInput",d,0,R);c.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_TO_POSITION"));Mt["b"].$(c).css({width:"95px"});Mt["b"].Utils.DOM.setStyle(c,$);Mt["b"].$(c).on("focusout",function(e){checkFormulas(e)});Mt["b"].$(c).on("keydown",function(e){if(e.which===13){checkFormulas(e)}});a.appendChild(o);r={width:A[2]+"px",minWidth:A[2]+"px",textAlign:"center"};o=document.createElement("td");Mt["b"].Utils.DOM.setStyle(o,r);var u=n.compareToCat;var s=Mt["b"].Utils.DOM.createSelectBox(o,"select##"+n.id+"##compareToCat",oe,le,u,R);s.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_TO_DIMENSION"));Mt["b"].$(s).on("change",function(e){var t=e.target.id.split("##")[1];if(oe[e.target.selectedIndex]===P.AXIS){var i=document.getElementById("select##"+t+"##compareToKeyfigure");i.disabled=true;document.getElementById("select##"+t+"##compareToStart").disabled=true}else{var i=document.getElementById("select##"+t+"##compareToKeyfigure");i.disabled=false;document.getElementById("select##"+t+"##compareToStart").disabled=false}});a.appendChild(o);r={width:A[3]+"px",minWidth:A[3]+"px",textAlign:"center"};o=document.createElement("td");Mt["b"].Utils.DOM.setStyle(o,r);var l=n.to.split("#").pop();var s=Mt["b"].Utils.DOM.createSelectBox(o,"select##"+n.id+"##compareToKeyfigure",re,ne,l,R);s.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_TO_MEASURE"));if(u==="axis"){s.disabled=true}a.appendChild(o);r={width:A[4]+"px",minWidth:A[4]+"px",textAlign:"center"};o=document.createElement("td");Mt["b"].Utils.DOM.setStyle(o,r);var l=n.compareToStart;var s=Mt["b"].Utils.DOM.createSelectBox(o,"select##"+n.id+"##compareToStart",ee,te,l,R);s.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_TO_START"));if(u==="axis"){s.disabled=true}a.appendChild(o);i.appendChild(a)}e.appendChild(i);return e}function createContentTab(){var e=document.createElement("div");e.setAttribute("id","tabCompareContentPropDiv");var t=createContentHeader();e.appendChild(t);var i=createCompareContentTable();e.appendChild(i);return e}function createContentHeader(){var e=document.createElement("div");e.setAttribute("id","headerDiv");var t={height:25+"px",width:"auto",textAlign:"center"};Mt["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");var a=document.createElement("tr");for(var n=0;n<u.length;n++){var r=document.createElement("td");var o=B[n];if(u[n]===P.TEXT){o=B[B.length-1]}r.colSpan=3;var l={width:o+"px",minWidth:o+"px",whiteSpace:"nowrap",textAlign:"center"};Mt["b"].Utils.DOM.setStyle(r,l);Mt["b"].$(r).html(_[n]);r.setAttribute("title",I.getTranslation(F[n]));a.appendChild(r)}i.appendChild(a);var s=document.createElement("tr");for(var n=0;n<u.length;n++){var d=document.createElement("td");d.colSpan=3;var o=B[n];if(u[n]===P.TEXT){o=B[B.length-1]}var l={width:o+"px",minWidth:o+"px",whiteSpace:"nowrap",textAlign:"center"};Mt["b"].Utils.DOM.setStyle(d,l);var c=document.createElement("span");c.style.margin="0px";Mt["b"].$(c).html('<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">');d.appendChild(c);s.appendChild(d)}i.appendChild(s);e.appendChild(i);return e}function createCompareContentTable(){var e=document.createElement("div");e.setAttribute("id","comparePropertiesContentTableDiv");var t={height:25+"px",width:"100%"};Mt["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");var a=L;if(a!==null&&a!==undefined){var n=document.createElement("tr");var r,o,l,s;var d={width:B[0]+"px",minWidth:B[0]+"px",textAlign:"center"};var c=document.createElement("td");Mt["b"].Utils.DOM.setStyle(c,d);k=a.absolute.legend;s=pe["a"].imgPath+(k===P.AUTO?"order_auto_HI.png":"order_auto_N.png");var u=Mt["b"].Utils.DOM.createIconButton(c,"select##"+a.id+"##auto","","",R,s,Mt["b"].DataObjects.RuntimeDO.getTranslation("AUTO"));u.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_DESCRIPTION_POS_AUTO"));u.className=P.ABSOLUTE;Mt["b"].Utils.DOM.setStyle(u,z);Mt["b"].$(u).on("click",function(e){changeLegendPosition(e)});r=pe["a"].imgPath+(k===P.START?"order_top_HI.png":"order_top_N.png");var p=Mt["b"].Utils.DOM.createIconButton(c,"select##"+a.id+"##legendTop","","",R,r,Mt["b"].DataObjects.RuntimeDO.getTranslation("START"));p.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_DESCRIPTION_POS_TOP"));p.className=P.ABSOLUTE;Mt["b"].Utils.DOM.setStyle(p,z);Mt["b"].$(p).on("click",function(e){changeLegendPosition(e)});if(k===P.MID){o=pe["a"].imgPath+"order_sort_HI.png"}else{o=pe["a"].imgPath+"order_sort_N.png"}var g=Mt["b"].Utils.DOM.createIconButton(c,"select##"+a.id+"##legendMid","","",R,o,Mt["b"].DataObjects.RuntimeDO.getTranslation("MID"));g.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_DESCRIPTION_POS_MIDDLE"));g.className=P.ABSOLUTE;Mt["b"].Utils.DOM.setStyle(g,z);Mt["b"].$(g).on("click",function(e){changeLegendPosition(e)});l=pe["a"].imgPath+(k===P.END?"order_bottom_HI.png":"order_bottom_N.png");var h=Mt["b"].Utils.DOM.createIconButton(c,"select##"+a.id+"##legendBot","","",R,l,Mt["b"].DataObjects.RuntimeDO.getTranslation("END"));h.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_DESCRIPTION_POS_BOTTOM"));h.className=P.ABSOLUTE;Mt["b"].Utils.DOM.setStyle(h,z);Mt["b"].$(h).on("click",function(e){changeLegendPosition(e)});if(k===P.AUTO){Mt["b"].$(p).addClass("opClass");Mt["b"].$(g).addClass("opClass");Mt["b"].$(h).addClass("opClass")}else if(k===P.NONE){Mt["b"].$(u).addClass("opClass");Mt["b"].$(p).addClass("opClass");Mt["b"].$(g).addClass("opClass");Mt["b"].$(h).addClass("opClass")}n.appendChild(c);d={width:B[1]+"px",minWidth:B[1]+"px",textAlign:"center"};U=a.percent.legend;c=document.createElement("td");Mt["b"].Utils.DOM.setStyle(c,d);s=pe["a"].imgPath+(U===P.AUTO?"order_auto_HI.png":"order_auto_N.png");var f=Mt["b"].Utils.DOM.createIconButton(c,"select##"+a.id+"##auto","","",R,s,Mt["b"].DataObjects.RuntimeDO.getTranslation("AUTO"));f.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_DESCRIPTION_POS_AUTO"));f.className=P.PERCENT;Mt["b"].Utils.DOM.setStyle(f,z);Mt["b"].$(f).on("click",function(e){changeLegendPosition(e)});r=pe["a"].imgPath+(U===P.START?"order_top_HI.png":"order_top_N.png");var m=Mt["b"].Utils.DOM.createIconButton(c,"select##"+a.id+"##legendTop","","",R,r,Mt["b"].DataObjects.RuntimeDO.getTranslation("START"));m.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_DESCRIPTION_POS_TOP"));m.className=P.PERCENT;Mt["b"].Utils.DOM.setStyle(m,z);Mt["b"].$(m).on("click",function(e){changeLegendPosition(e)});o=pe["a"].imgPath+(U===P.MID?"order_sort_HI.png":"order_sort_N.png");var v=Mt["b"].Utils.DOM.createIconButton(c,"select##"+a.id+"##legendMid","","",R,o,Mt["b"].DataObjects.RuntimeDO.getTranslation("MID"));v.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_DESCRIPTION_POS_MIDDLE"));v.className=P.PERCENT;Mt["b"].Utils.DOM.setStyle(v,z);Mt["b"].$(v).on("click",function(e){changeLegendPosition(e)});l=pe["a"].imgPath+(U===P.END?"order_bottom_HI.png":"order_bottom_N.png");var b=Mt["b"].Utils.DOM.createIconButton(c,"select##"+a.id+"##legendBot","","",R,l,Mt["b"].DataObjects.RuntimeDO.getTranslation("END"));b.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_DESCRIPTION_POS_BOTTOM"));b.className=P.PERCENT;Mt["b"].Utils.DOM.setStyle(b,z);Mt["b"].$(b).on("click",function(e){changeLegendPosition(e)});if(U===P.AUTO){Mt["b"].$(m).addClass("opClass");Mt["b"].$(v).addClass("opClass");Mt["b"].$(b).addClass("opClass")}else if(U===P.NONE){Mt["b"].$(f).addClass("opClass");Mt["b"].$(m).addClass("opClass");Mt["b"].$(v).addClass("opClass");Mt["b"].$(b).addClass("opClass")}n.appendChild(c);d={width:B[2]+"px",minWidth:B[2]+"px",textAlign:"center"};c=document.createElement("td");Mt["b"].Utils.DOM.setStyle(c,d);H=a.text.legend;s=pe["a"].imgPath+(H===P.AUTO?"order_auto_HI.png":"order_auto_N.png");var T=Mt["b"].Utils.DOM.createIconButton(c,"select##"+a.id+"##auto","","",R,s,Mt["b"].DataObjects.RuntimeDO.getTranslation("AUTO"));T.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_DESCRIPTION_POS_AUTO"));T.className=P.TEXT;Mt["b"].Utils.DOM.setStyle(T,z);Mt["b"].$(T).on("click",function(e){changeLegendPosition(e)});r=pe["a"].imgPath+(H===P.START?"order_top_HI.png":"order_top_N.png");var x=Mt["b"].Utils.DOM.createIconButton(c,"select##"+a.id+"##legendTop","","",R,r,Mt["b"].DataObjects.RuntimeDO.getTranslation("START"));x.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_DESCRIPTION_POS_TOP"));x.className=P.TEXT;Mt["b"].Utils.DOM.setStyle(x,z);Mt["b"].$(x).on("click",function(e){changeLegendPosition(e)});o=pe["a"].imgPath+(H===P.MID?"order_sort_HI.png":"order_sort_N.png");var E=Mt["b"].Utils.DOM.createIconButton(c,"select##"+a.id+"##legendMid","","",R,o,Mt["b"].DataObjects.RuntimeDO.getTranslation("MID"));E.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_DESCRIPTION_POS_MIDDLE"));E.className=P.TEXT;Mt["b"].Utils.DOM.setStyle(E,z);Mt["b"].$(E).on("click",function(e){changeLegendPosition(e)});l=pe["a"].imgPath+(H===P.END?"order_bottom_HI.png":"order_bottom_N.png");var y=Mt["b"].Utils.DOM.createIconButton(c,"select##"+a.id+"##legendBot","","",R,l,Mt["b"].DataObjects.RuntimeDO.getTranslation("END"));y.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_DESCRIPTION_POS_BOTTOM"));y.className=P.TEXT;Mt["b"].Utils.DOM.setStyle(y,z);Mt["b"].$(y).on("click",function(e){changeLegendPosition(e)});if(H===P.AUTO){Mt["b"].$(x).addClass("opClass");Mt["b"].$(E).addClass("opClass");Mt["b"].$(y).addClass("opClass")}else if(H===P.NONE){Mt["b"].$(T).addClass("opClass");Mt["b"].$(x).addClass("opClass");Mt["b"].$(E).addClass("opClass");Mt["b"].$(y).addClass("opClass")}var C=a.text.originalText||a.text.text;if(C.indexOf("$")>-1){C=M.decode(C)}var S=Mt["b"].Utils.DOM.createTextInputNoMax(c,"select##"+a.id+"##text",C,0,R);S.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_DESCRIPTION_TEXT"));if(S.value===""){Mt["b"].$(S).val(V);Mt["b"].Utils.DOM.setStyle(S,{color:"rgb(150, 150, 150)"})}Mt["b"].Utils.DOM.setStyle(S,{width:"210px"});Mt["b"].Utils.DOM.setStyle(S,$);Mt["b"].$(S).focus(function(e){autoFocusIn(e.target)});Mt["b"].$(S).on("focusout",function(e){checkFormulas(e);autoFocusOut(e.target)});Mt["b"].$(S).on("keydown",function(e){if(e.which===13){checkFormulas(e);autoFocusOut(e.target)}});n.appendChild(c);i.appendChild(n)}e.appendChild(i);return e}function createRestTab(){var e=document.createElement("div");e.setAttribute("id","tabComparePropDiv");var t=createRestHeader();e.appendChild(t);var i=createRestTable();e.appendChild(i);return e}function createRestHeader(){var e=document.createElement("div");e.setAttribute("id","headerDiv");var t={height:25+"px",width:"auto",textAlign:"center"};Mt["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");var a=document.createElement("tr");var n=document.createElement("tr");for(var r=0;r<W.length;r++){var o=document.createElement("td");var l=document.createElement("td");var s=X[r];var d={width:s+"px",minWidth:s+"px",whiteSpace:"nowrap",textAlign:"center"};Mt["b"].Utils.DOM.setStyle(o,d);Mt["b"].Utils.DOM.setStyle(l,d);Mt["b"].$(o).html(j[r]);o.setAttribute("title",I.getTranslation(K[r]));var c=document.createElement("span");c.style.margin="0px";Mt["b"].$(c).html('<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">');l.appendChild(c);n.appendChild(l);a.appendChild(o)}i.appendChild(a);i.appendChild(n);e.appendChild(i);return e}function createRestTable(){var e=document.createElement("div");e.setAttribute("id","comparePropertiesRestTableDiv");var t={height:25+"px",width:"100%"};Mt["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");var a=L;if(a!==null&&a!==undefined){var n=document.createElement("tr");var r={width:X[0]+"px",minWidth:X[0]+"px",textAlign:"center"};var o=document.createElement("td");Mt["b"].Utils.DOM.setStyle(o,r);var l=document.createElement("div");var s="select##"+a.id+"##rgb";l.setAttribute("id",s);var d=a.individualColor;var c="none";var u="none";var p="12px";var g="12px";var h="1px solid #aaaaaa";if(a.notation===P.NOTATION){d=I.getParameter("COLOR_COMPARE_POSITIVE");c=Mt["b"].DataObjects.RuntimeDO.getTranslation("NOTATION");u="url('"+pe["a"].imgPath+"notation.png')";p="16px";g="16px";h="none"}r={width:p,minWidth:p,height:g,minHeight:g,border:h,display:"block",margin:"auto",textAlign:"left",backgroundColor:d,backgroundImage:u,title:c};Mt["b"].Utils.DOM.setStyle(l,r);l.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_REST_COLOR"));Mt["b"].$(l).hover(function(){this.style.cursor="pointer"},function(){this.style.cursor="auto"});Mt["b"].$(l).on("click",function(e){w=Mt["b"].UI.ColorPicker.createColorPicker(s,false,false,true,a)});o.appendChild(l);n.appendChild(o);r={width:X[1]+"px",minWidth:X[1]+"px",textAlign:"center"};o=document.createElement("td");Mt["b"].Utils.DOM.setStyle(o,r);var f=Mt["b"].Utils.DOM.createCheckBoxWithLabel(o,"select##"+a.id+"##ellipse","","","");f.checkBox.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_REST_ELLIPSE"));if(a.ellipse===true){f.checkBox.setAttribute("checked","checked")}n.appendChild(o);r={width:X[2]+"px",minWidth:X[2]+"px",textAlign:"center"};o=document.createElement("td");Mt["b"].Utils.DOM.setStyle(o,r);var m=a.compareStyle;Y=m;var v=pe["a"].imgPath+"notation_inactive.png";var b=pe["a"].imgPath+"arrow_up_active.png";var T=pe["a"].imgPath+"pin.png";if(m===P.PIN){b=pe["a"].imgPath+"arrow_up.png";T=pe["a"].imgPath+"pin_active.png";v=pe["a"].imgPath+"notation_inactive.png"}else if(m===P.NOTATION){b=pe["a"].imgPath+"arrow_up.png";T=pe["a"].imgPath+"pin.png";v=pe["a"].imgPath+"notation.png"}var x=Mt["b"].Utils.DOM.createIconButton(o,"select##"+a.id+"##conNotation","","",R,v,Mt["b"].DataObjects.RuntimeDO.getTranslation("NOTATION"));x.className="connectorSymbol";Mt["b"].$(x).on("click",function(e){changeConnectorStyleHandler(e)});var E=Mt["b"].Utils.DOM.createIconButton(o,"select##"+a.id+"##conArrow","","",R,b,Mt["b"].DataObjects.RuntimeDO.getTranslation("ARROW"));E.className="connectorSymbol";Mt["b"].$(E).on("click",function(e){changeConnectorStyleHandler(e)});var y=Mt["b"].Utils.DOM.createIconButton(o,"select##"+a.id+"##conPin","","",R,T,Mt["b"].DataObjects.RuntimeDO.getTranslation("PIN"));y.className="connectorSymbol";Mt["b"].$(y).on("click",function(e){changeConnectorStyleHandler(e)});n.appendChild(o);r={width:X[3]+"px",minWidth:X[3]+"px",textAlign:"center"};o=document.createElement("td");Mt["b"].Utils.DOM.setStyle(o,r);var m=a.compareLegend;var C=Mt["b"].Utils.DOM.createSelectBox(o,"select##"+a.id+"##offsetPoint",Z,Q,m,R);C.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_REST_OFFSET"));n.appendChild(o);r={width:X[4]+"px",minWidth:X[4]+"px",textAlign:"center"};o=document.createElement("td");Mt["b"].Utils.DOM.setStyle(o,r);var S=a.displayOffset;if(S!==G){S=parseFloat(S).toFixed(de)}var M=Mt["b"].Utils.DOM.createTextInputNoMax(o,"select##"+a.id+"##compareOffset",S,0,R);M.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_REST_OFFSETMMPT"));Mt["b"].$(M).css({width:"90px"});Mt["b"].Utils.DOM.setStyle(M,$);if(S===G){M.style.color="rgb(150,150,150)"}Mt["b"].$(M).focusout(function(e){autoFocusOut(e.target)});Mt["b"].$(M).focus(function(e){autoFocusIn(e.target)});Mt["b"].$(M).on("keydown",function(e){if(e.which===13){autoFocusOut(e.target);e.target.blur()}});Mt["b"].$(M).css("padding",0);n.appendChild(o);r={width:X[5]+"px",minWidth:X[5]+"px",textAlign:"center"};o=document.createElement("td");Mt["b"].Utils.DOM.setStyle(o,r);var O=Mt["b"].Utils.DOM.createSelectBox(o,"select##"+a.id+"##displacePriority",q,J,a.displacePriority,R);O.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_REST_DISPLACE"));for(var A=0;A<N.length;A++){for(var _=0;_<q.length;_++){if(N[A].comp.displacePriority===q[_]&&N[A].comp.id.split(".")[0]===a.id.split(".")[0]&&q[_]!==-1&&q[_]!==a.displacePriority&&N[A].extensionId===D.getId()){O[_].style.backgroundColor="rgb(255, 0, 0)";O[_].disabled=true}}}n.appendChild(o);i.appendChild(n);e.appendChild(i);return e}}};Mt["b"].UI=Mt["b"].UI||{};Mt["b"].UI.CopyDatarulesDialog=function(e){var a=this;var t=e.extension;var i=e.parentDialog;var f=e.level;var m=e.cid;var n=e.title;var l=f==="expression"?e.displayId:null;var r=t.getCanvasDO().getDOMElement();var v=Mt["b"].DataObjects.RuntimeDO;var b=null;var T=null;var s=null;var x="12px";var o=null;var E=null;a.open=function(){var e="copyDatarulesDialog";var t=[{text:v.getTranslation("OKAY"),id:"copyDatarulesOkayButton",click:a.okay},{text:v.getTranslation("CANCEL"),id:"copyDatarulesCancelButton",click:a.close}];var i=new Mt["b"].UI.HiCoDialogDefinition(e,n,t);x=i.getFontSize();i.setParentDomElement(r.parentNode);i.setHeight(300);i.setWidth(400);i.setPosition({});i.setResizable(true);i.setModal(true);E=new Mt["b"].UI.HiCoDialog(i);o=E.getDialogDiv();E.setCSS();o.appendChild(fillContent())};function fillContent(){var e=f==="expression";var t=document.createElement("div");var i=document.createElement("table");var a=document.createElement("tr");var n=document.createElement("td");var r=Mt["b"].Utils.DOM.createCheckBoxWithLabel(n,"copyDatarulesAdjustCheck","",v.getTranslation("ADJUST_EXPRESSION_IDS_FORMULAS"),"");r.checkBox.setAttribute("checked","checked");a.appendChild(n);i.appendChild(a);var o=document.createElement("tr");var l=document.createElement("td");l.setAttribute("id","copyDatarulesContextCell");o.appendChild(l);i.appendChild(o);if(e){var s=document.createElement("tr");var d=document.createElement("td");d.setAttribute("id","copyDatarulesExprCell");s.appendChild(d);i.appendChild(s)}t.appendChild(i);b=Mt["b"].DataObjects.ContextRepo.getAllContexts().slice(0);if(!e){for(var c=0;c<b.length;c++){if(b[c].cid===m){b.splice(c,1);break}}}T=b.length>0?b[0]:null;var u=new Array(b.length);var p=new Array(b.length);for(var c=0;c<u.length;c++){u[c]=b[c].cid;var g=Mt["b"].DataObjects.ContextRepo.getExtensionByContextCid(b[c].cid).getTitle();p[c]=g+" - "+b[c].name;if(b[c].cid===m){T=b[c]}}var h=Mt["b"].Utils.DOM.createSelectBox(l,"copyDatarulesContextSelect",u,p,m,x);if(b.length===0){h.setAttribute("disabled","disabled");E.disableButton("copyDatarulesOkayButton")}if(e){Mt["b"].$(h).change(t,changeContextHandler)}if(e){changeContextHandler({exprCell:d,target:h})}return t}function changeContextHandler(e){T=b[e.target.selectedIndex];var t=e.exprCell||document.getElementById("copyDatarulesExprCell");Mt["b"].$(document.getElementById("copyDatarulesExpressionSelect")).remove();s=[];var i=[];var a=[];for(var n=0;n<T.columns.length;n++){var r=T.columns[n];if(T.cid!==m||r.displayId!==l){s.push(r);i.push(r.displayId);a.push(r.displayId+": "+r.name)}}var o=Mt["b"].Utils.DOM.createSelectBox(t,"copyDatarulesExpressionSelect",i,a,null,x);if(s.length===0){o.setAttribute("disabled","disabled");E.disableButton("copyDatarulesOkayButton")}else{E.enableButton("copyDatarulesOkayButton")}}a.okay=function(){var e=document.getElementById("copyDatarulesAdjustCheck");e=e&&e.checked;if(f==="expression"){if(s.length>0){var t=s[document.getElementById("copyDatarulesExpressionSelect").selectedIndex];i.copyDatarulesFrom(T.cid,t.displayId,e)}}else{T=b[document.getElementById("copyDatarulesContextSelect").selectedIndex];i.copyDatarulesFrom(T.cid,e)}a.close()};a.close=function(){E.close()}};Mt["b"].UI=Mt["b"].UI||{};Mt["b"].UI.CopyEmptySpacesDialog=function(e){var t=this;var s=e.containerModel;var d=e.extension;var i=e.parentDialog;var c=e.tmpEmptySpaceRepository;var a=Mt["b"].DataObjects.DocumentDO.getAllExtensions();var u=[];var n=true;var p=Mt["b"].DataObjects.RuntimeDO;var g=2;var h=2;for(var r=0;r<a.length;r++){var o=[];var l=a[r];var f=l.getController();var m=f.getRootModel().rootContainerModel;Mt["b"].Models.Actions.ViewModelActions.General.getAllCharts(m,o);u.push({extension:l,charts:o})}var v={padding:"0px",position:"absolute",top:"0px",height:"0px",left:"0px",width:"0px",border:"1px solid rgb(37,157,187)",backgroundColor:"rgba(217, 217, 217, 0.2)",visibility:"visibility",zIndex:"998"};t.open=function(){i.hide();setupGrid()};function closeCopy(){n=false;Mt["b"].$('div[id*="emptySpaceCopy_"]').remove();i.show();i.createDimensionsEmptyTable()}function setupGrid(){Mt["b"].$('div[id*="emptySpaceCopy_"]').remove();var e=0;for(var t=0;t<u.length;t++){var i=u[t].extension;var a=i.getCanvasDO().getDOMElement();for(var n=0;n<u[t].charts.length;n++){var r=u[t].charts[n];var o=document.getElementById("emptySpaceCopy_"+t+"_cId_"+r.id);if(!o){if((d.getId()!==i.getId()||s.id!==r.id&&d.getId()===i.getId())&&r.extendedModel.dimensionLabelModel.emptySpaceRepository.length>0){v.top=r.position.y+"px";v.height=r.dimension.height-h+"px";v.left=r.position.x+"px";v.width=r.dimension.width-g+"px";e++;var l=document.createElement("div");a.parentNode.appendChild(l);l.setAttribute("id","emptySpaceCopy_"+t+"_cId_"+r.id+"_cExt_"+i.getId());l.setAttribute("title",p.getTranslation("HELP_CELL_DIMENSIONS_GAP_COPY_FROM_CONTAINER"));Mt["b"].Utils.DOM.setStyle(l,v);Mt["b"].$(l).click(function(e){applyChanges(e.target.id)});Mt["b"].$(l).hover(function(){Mt["b"].$(this).css({cursor:"crosshair","background-color":"rgba(0, 176, 240, 0.2)"})},function(){Mt["b"].$(this).css({cursor:"auto","background-color":"rgba(217, 217, 217, 0.2)"})})}}else{Mt["b"].Utils.DOM.setStyle(o,v)}}}if(e==0){Mt["b"].UI.HiCoNotification(p.getTranslation("NOTHING_TO_COPY"),function(){closeCopy()})}}function applyChanges(t){if(c.length!==0){n=false;Mt["b"].UI.HiCoConfirm(p.getTranslation("CONFIRM_OVERWRITE"),function(e){n=true;copyEmptySpaces(t,e);closeCopy()})}else{copyEmptySpaces(t);closeCopy()}}function copyEmptySpaces(e,t){if(t===true){while(c.length>0){c.pop()}}var i=e.split("_");var a=i[5];a=Mt["b"].DataObjects.DocumentDO.getExtension(a);var n=a.getController().getRootModel();var r=Mt["b"].Factories.ModelFactory.getModelById(n,i[3]);r=r.extendedModel;var o=r.dimensionLabelModel.emptySpaceRepository;for(var l=0;l<o.length;l++){var s=o[l];var d=new Se["a"].EmptySpaceModel;d.id=s.id;d.appliesFormula=s.appliesFormula;d.space_mmpt=s.space_mmpt;d.position=s.position;d.axisSplit=s.axisSplit;c.push(d)}}Mt["b"].$(document).keyup(function(e){if(e.keyCode==27){if(n){closeCopy()}}})};Mt["b"].UI=Mt["b"].UI||{};Mt["b"].UI.CopyLabelFunctionDialog=function(e){var a=this;var t=e.extension;var i=e.parentDialog;var g=e.cid;var l=e.displayId;var n=e.title;var r=t.getCanvasDO().getDOMElement();var h=Mt["b"].DataObjects.RuntimeDO;var f="12px";var o=null;var m=null;var v=null;var b=null;var s=null;a.open=function(){var e="copyLabelFunctionDialog";var t=[{text:h.getTranslation("OKAY"),id:"copyLabelFunctionDialogOkayButton",click:a.okay},{text:h.getTranslation("CANCEL"),id:"copyLabelFunctionDialogCancelButton",click:a.close}];var i=new Mt["b"].UI.HiCoDialogDefinition(e,n,t);f=i.getFontSize();i.setParentDomElement(r.parentNode);i.setHeight(170);i.setWidth(470);i.setPosition({});i.setResizable(true);i.setModal(true);m=new Mt["b"].UI.HiCoDialog(i);o=m.getDialogDiv();m.setCSS();o.appendChild(fillContent())};function fillContent(){var e=document.createElement("div");var t=document.createElement("table");var i=document.createElement("tr");var a=document.createElement("td");var n=Mt["b"].Utils.DOM.createCheckBoxWithLabel(a,"copyLabelFunctionDialogAdjustCheck","",h.getTranslation("ADJUST_EXPRESSION_IDS_FORMULAS"),"");n.checkBox.setAttribute("checked","checked");i.appendChild(a);t.appendChild(i);var r=document.createElement("tr");var o=document.createElement("td");o.setAttribute("id","copyLabelFunctionDialogContextCell");r.appendChild(o);t.appendChild(r);var l=document.createElement("tr");var s=document.createElement("td");s.setAttribute("id","copyLabelFunctionDialogExprCell");l.appendChild(s);t.appendChild(l);e.appendChild(t);v=Mt["b"].DataObjects.ContextRepo.getAllContexts().slice(0);b=v.length>0?v[0]:null;var d=new Array(v.length);var c=new Array(v.length);for(var u=0;u<d.length;u++){d[u]=v[u].cid;c[u]=v[u].cid+": "+v[u].name;if(v[u].cid===g){b=v[u]}}var p=Mt["b"].Utils.DOM.createSelectBox(o,"copyLabelFunctionDialogContextSelect",d,c,g,f);if(v.length===0){p.setAttribute("disabled","disabled");m.disableButton("copyLabelFunctionDialogOkayButton")}Mt["b"].$(p).change(e,changeContextHandler);changeContextHandler({exprCell:s,target:p});return e}function changeContextHandler(e){b=v[e.target.selectedIndex];var t=e.exprCell||document.getElementById("copyLabelFunctionDialogExprCell");Mt["b"].$(document.getElementById("copyLabelFunctionDialogExpressionSelect")).remove();s=[];var i=[];var a=[];for(var n=0;n<b.columns.length;n++){var r=b.columns[n];if(b.cid!==g||r.id!==l){s.push(r);i.push(r.displayId);a.push(r.displayId+": "+r.name)}}var o=Mt["b"].Utils.DOM.createSelectBox(t,"copyLabelFunctionDialogExpressionSelect",i,a,null,f);if(s.length===0){o.setAttribute("disabled","disabled");m.disableButton("copyLabelFunctionDialogOkayButton")}else{m.enableButton("copyLabelFunctionDialogOkayButton")}}a.okay=function(){var e=document.getElementById("copyLabelFunctionDialogAdjustCheck");e=e&&e.checked;if(s.length>0){var t=s[document.getElementById("copyLabelFunctionDialogExpressionSelect").selectedIndex];i.copyValueLabelFunctionFrom(b.cid,t.displayId,e)}a.close()};a.close=function(){m.close()}};Mt["b"].UI=Mt["b"].UI||{};Mt["b"].UI.CycleMenu={createCycleDIV:function(e,t){var i=Mt["b"].DataObjects.DocumentDO.getPainter().getContainerOutermostDivElement(t,e);var a=Mt["b"].DataObjects.DocumentDO.getExtension(e);if(a==undefined){return}var n=a.getController().getRootModel();var r=Mt["b"].Factories.ModelFactory.getModelById(n,t);var o=r.extendedModel.contextId;var l="CYCLEDIV_"+e+"_"+t+"_"+o;var s=document.getElementById(l);if(s===null){var d=Mt["b"].DataObjects.ContextRepo.getContextByCid(o);var c=0;for(var u=0;u<d.rows.length;u++){if(d.rows[u].dimensionType==="cyclic"||d.rows[u].dimensionType==="drill"){c++}}if(c===0){return}s=document.createElement("div");s.setAttribute("id",l);s.style.left="1px";if(r.layoutType==="time"){s.style.top=r.dimension.height-16+"px";for(var u=0;u<r.children.length;u++){var p=r.children[u];if(p.layoutType==="AxisGrid"){s.style.top=p.position.y+"px";break}}}else{s.style.top="0px"}s.style.width="16px";s.style.height="16px";s.style.position="absolute";s.style.zIndex="109";Mt["b"].$(s).mouseenter(function(e){Mt["b"].$(this).clearQueue()});Mt["b"].$(s).mouseleave(function(e){Mt["b"].$(this).fadeOut(500,function(){Mt["b"].$("#"+l).remove()})});Mt["b"].$(s).click(function(e){e.stopPropagation();Mt["b"].UI.CycleMenu.createCycleGroupsDIV(this.id)});var g=document.createElement("img");g.src=pe["a"].imgPath+"cycle.png";s.appendChild(g);Mt["b"].$(s).hide();i.appendChild(s);Mt["b"].$(s).fadeIn(500);Mt["b"].$(s).delay(2e3).fadeOut(500,function(){Mt["b"].$(this).remove()})}},createCycleGroupsDIV:function(e){var t=e.split("_");var i=t[1];var a=t[2];var n=t.slice(3).join("_");var r="#F3F3F3";var o="#FFFFFF";var l="#5555FF";var s="#D0D0FF";var d="#A0A0A0";var c=Mt["b"].DataObjects.DocumentDO.getExtension(i);var u=c.getController().getRootModel();var p=Mt["b"].Factories.ModelFactory.getModelById(u,a);var g=Mt["b"].DataObjects.ContextRepo.getContextByCid(n);var h=[];var f=[];var m=[];var v=0;for(var b=0;b<g.rows.length;b++){if(g.rows[b].dimensionType==="cyclic"||g.rows[b].dimensionType==="drill"){h.push(n+"_"+b);m.push(b);v=Math.max(v,g.rows[b].groupMembers.length);f.push(g.rows[b].dimensionType)}}var T="CYCLESELECTDIV_"+i+"_"+a+"_"+n;var x=document.getElementById(T);var E=Mt["b"].DataObjects.DocumentDO.getConnector().getMainContainer(),y=E.getBoundingClientRect(),C=Mt["b"].DataObjects.DocumentDO.getPainter().getContainerOutermostDivElement(a,i),S=C.getBoundingClientRect();if(x===undefined||x===null){x=document.createElement("div");x.setAttribute("id",T);x.style.left=S.left+16-y.left+"px";if(p.layoutType==="time"){x.style.top=S.top+p.scrollingData.height-16-y.top+"px";for(var b=0;b<p.children.length;b++){var M=p.children[b];if(M.layoutType==="AxisGrid"){x.style.top=S.top+Math.min(M.position.y,p.scrollingData.height)-y.top+"px";break}}}else{x.style.top=S.top-y.top+"px"}x.style.width="60px";x.style.height=16*(h.length+1)+"px";x.style.position="absolute";Mt["b"].$(x).mouseenter(function(e){Mt["b"].$(this).clearQueue()});Mt["b"].$(x).mouseleave(function(e){Mt["b"].$(this).fadeOut(500,function(){Mt["b"].$(this).remove()})});var O=document.createElement("table");O.style.backgroundColor=o;O.style.border="1px solid "+d;var A=document.createElement("tr");var _=document.createElement("td");A.appendChild(_);O.appendChild(A);Mt["b"].$(O).click(function(e){e.stopPropagation()});var L=document.createElement("table");var I=document.createElement("tr");for(var b=0;b<h.length;b++){var D=document.createElement("td");D.style.backgroundColor=r;var R=document.createElement("input");R.setAttribute("type","button");R.setAttribute("id",h[b]+"_"+f[b]);R.setAttribute("name",h[b]);R.style.fontSize="10px";R.style.border="none";R.style.background="none";R.style.fontWeight="bold";var P=h[b].split("_");var N=parseInt(P[P.length-1]);R.value=N+1+" : "+(f[b]==="drill")?"Drill":"Cycle";Mt["b"].$(R).click(function(e){e.stopPropagation();var t=this.id.split("_");var i=t[t.length-1];var a=t[0];for(var n=1;n<t.length-2;n++){a+="_"+t[n]}var r=Mt["b"].DataObjects.ContextRepo.getContextAndExtensionByCid(a);if(!r){return}if(i==="cyclic"){r.extension.getAdapter().cycle(a,parseInt(t[t.length-2]))}else{r.extension.getAdapter().drillUp(a,parseInt(t[t.length-2]),1)}var o=Mt["b"].$(e.target).closest("div");if(o!==undefined&&o!==null){o.clearQueue();o.fadeOut(500,function(){Mt["b"].$(this).remove()})}});Mt["b"].$(R).mouseenter(function(e){Mt["b"].$(this).parent().css("background-color",s)});Mt["b"].$(R).mouseleave(function(e){Mt["b"].$(this).parent().css("background-color",r)});D.appendChild(R);I.appendChild(D)}L.appendChild(I);for(var w=0;w<v;w++){var F=document.createElement("tr");for(var b=0;b<h.length;b++){var B=document.createElement("td");var N=m[b];if(g.rows[N].groupMembers[w]!==undefined){var R=document.createElement("input");R.setAttribute("type","button");R.setAttribute("id",h[b]+"_"+w+"_"+f[b]);R.setAttribute("name",h[b]+"_"+w);R.style.fontSize="10px";R.style.border="none";R.style.background="none";if(g.rows[N].groupActualLevel===w){R.style.color=l}R.value=g.rows[N].groupMembers[w].nameInternal?g.rows[N].groupMembers[w].nameInternal:g.rows[N].groupMembers[w].name;Mt["b"].$(R).click(function(e){e.stopPropagation();var t=this.id.split("_");var i=t[t.length-1];var a=parseInt(t[t.length-2]);var n=parseInt(t[t.length-3]);var r=t[0];for(var o=1;o<t.length-3;o++){r+="_"+t[o]}var l=Mt["b"].DataObjects.ContextRepo.getContextAndExtensionByCid(r);if(!l){return}if(i==="cyclic"){l.extension.getAdapter().cycle(r,n,a)}else if(l.context.rows[n].groupActualLevel>a){var s=l.context.rows[n].groupActualLevel-a;l.extension.getAdapter().drillUp(r,n,s)}var d=Mt["b"].$(e.target).closest("div");if(d!==undefined&&d!==null){d.clearQueue();d.fadeOut(500,function(){Mt["b"].$(this).remove()})}});if(g.rows[N].groupActualLevel!==w&&f[b]==="cyclic"){Mt["b"].$(R).mouseenter(function(e){Mt["b"].$(this).parent().css("background-color",s)});Mt["b"].$(R).mouseleave(function(e){Mt["b"].$(this).parent().css("background-color",o)})}if(g.rows[N].groupActualLevel>w&&f[b]==="drill"){Mt["b"].$(R).mouseenter(function(e){Mt["b"].$(this).parent().css("background-color",s)});Mt["b"].$(R).mouseleave(function(e){Mt["b"].$(this).parent().css("background-color",o)})}B.appendChild(R)}F.appendChild(B)}L.appendChild(F)}_.appendChild(L);x.style.zIndex="200";x.appendChild(O);Mt["b"].$(x).hide();E.appendChild(x);Mt["b"].$(x).fadeIn(500);Mt["b"].$(x).delay(5e3).fadeOut(500,function(){Mt["b"].$(this).remove()})}}};Mt["b"].UI=Mt["b"].UI||{};Mt["b"].UI.DimensionMenu=function(e){var F=this;var B=e.extension;var S=e.model.extendedModel;var k=e.containerModel;var M=e.activeKeyfigures;var O=Mt["b"].DataObjects.ContextRepo.getContextByCid(S.contextId);if(O===null){return}var U=Mt["b"].DataObjects.RuntimeDO;var _=null;var m;var v=null;var L=null;var H=null;var g=null;var l=null;var G=[];var V=0;var $="12px";var z=Mt["b"].Utils.Constants.TypeValues.formulaEdit;var s=null;var W=Mt["b"].Utils.Constants.ParameterSets.emptySpacePositionTypeIds;var j=Mt["b"].Utils.Constants.ParameterSets.emptySpacePositionTypeTranslations;var I=Mt["b"].Utils.Constants.ParameterSets.categoryLabelTypeIds;var D=Mt["b"].Utils.Constants.ParameterSets.categoryLabelTypeTranslations;var R,P;var N=Mt["b"].Utils.Constants.ParameterSets.categoriesWithoutValuesTypeIds;var w=Mt["b"].Utils.Constants.ParameterSets.categoriesWithoutValuesTypeTL;var t=Mt["b"].Utils.Constants.TypeValues.labelOrientation;var K=Mt["b"].Utils.Constants.TypeValues.categoryLabel;var X=Mt["b"].Utils.Constants.TypeValues.labelHorizontalAlignment;var A=[{id:"sepFromNotation",param:"sepFromNotation"},{id:"sepSubtotalFromNotation",param:"sepSubtotalFromNotation"},{id:"sepTotalFromNotation",param:"sepTotalFromNotation"},{id:"sepTotalWVFromNotation",param:"sepTotalWVFromNotation"}];var Y=[{id:"sepStartAuto",param:"sepLengthStartAuto"},{id:"sepSubtotalStartAuto",param:"sepSubtotalLengthStartAuto"},{id:"sepTotalStartAuto",param:"sepTotalLengthStartAuto"},{id:"sepTotalWVStartAuto",param:"sepTotalWVLengthStartAuto"}];var Z=[{id:"sepStart",param:"sepLengthStart",unitId:"sepStartUnit",unitParam:"sepLengthStartUnit"},{id:"sepSubtotalStart",param:"sepSubtotalLengthStart",unitId:"sepSubtotalStartUnit",unitParam:"sepSubtotalLengthStartUnit"},{id:"sepTotalStart",param:"sepTotalLengthStart",unitId:"sepTotalStartUnit",unitParam:"sepTotalLengthStartUnit"},{id:"sepTotalWVStart",param:"sepTotalWVLengthStart",unitId:"sepTotalWVStartUnit",unitParam:"sepTotalWVLengthStartUnit"}];var Q=[{id:"sepEndFromNotation",param:"sepEndFromNotation"},{id:"sepSubtotalEndFromNotation",param:"sepSubtotalEndFromNotation"},{id:"sepTotalEndFromNotation",param:"sepTotalEndFromNotation"},{id:"sepTotalWVEndFromNotation",param:"sepTotalWVEndFromNotation"}];var q=[{id:"sepEnd",param:"sepLengthEnd",unitId:"sepEndUnit",unitParam:"sepLengthEndUnit"},{id:"sepSubtotalEnd",param:"sepSubtotalLengthEnd",unitId:"sepSubtotalEndUnit",unitParam:"sepSubtotalLengthEndUnit"},{id:"sepTotalEnd",param:"sepTotalLengthEnd",unitId:"sepTotalEndUnit",unitParam:"sepTotalLengthEndUnit"},{id:"sepTotalWVEnd",param:"sepTotalWVLengthEnd",unitId:"sepTotalWVEndUnit",unitParam:"sepTotalWVLengthEndUnit"}];var J;var ee=4;var f=1;var te=["%","mm/10pt"];var b="Auto";var ie=S?S.dimensionLabelModel:null;var i=false;var ae=false;var ne=false;if(ie.orientation===t.VERTICAL){if(S.instanceOf==="ChartModel"){i=true}else{ne=true}}else{ae=true}var T=170+"px";var re=[];var x=[{id:"subtab-category",text:U.getTranslation("OVERALL"),buildUp:createDimensionsCategoryTab,title:U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION")},{id:"subtab-separator",text:U.getTranslation("SEPARATOR"),buildUp:createSeparatorTab,title:U.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR")},{id:"subtab-empty",text:U.getTranslation("GAP"),buildUp:createEmptyTab,title:U.getTranslation("HELP_CELL_DIMENSIONS_GAP")}];F.embed=function(e,t,i,a){if(O===null){return null}V=new Mt["b"].Utils.Calculator(O);G=[];if(ie.emptySpaceRepository===undefined){ie.emptySpaceRepository=[]}var n=ie.emptySpaceRepository;for(var r=0;r<n.length;r++){var o=new Se["a"].EmptySpaceModel;o.id=n[r].id;o.space_mmpt=n[r].space_mmpt;o.position=n[r].position;o.axisSplit=n[r].axisSplit;var l=n[r].appliesFormula.toString();o.appliesFormula=l;o.compiledFormula=null;G.push(o)}re=[];if(ie.contextId!==O.cid){ie.contextId=O.cid;ie.dimensionFormulaRepository=[];var s=O.rows;for(var r=0;r<s.length;r++){var d=new Se["a"].DimensionFormulaModel;d.id=s[r].id;d.dimAutoLength=true;d.dimension_mmpt=0;d.appliesFormula={formula:"true",compiledFormula:null};d.conditionFormula={formula:"true",compiledFormula:null};re.push(d);ie.dimensionFormulaRepository.push(d)}}if(ie.dimensionFormulaRepository===undefined){ie.dimensionFormulaRepository=[]}var c=ie.dimensionFormulaRepository;for(var r=0;r<c.length;r++){var d=new Se["a"].DimensionFormulaModel;d.id=c[r].id;d.dimAutoLength=c[r].dimAutoLength;d.dimension_mmpt=c[r].dimension_mmpt;d.appliesFormula.formula=c[r].appliesFormula.formula;d.appliesFormula.compiledFormula=null;d.conditionFormula.formula=c[r].conditionFormula.formula;d.conditionFormula.compiledFormula=null;re.push(d)}_=e;v=_.getDialogDiv();var u={position:"absolute",visibility:"hidden",height:"auto",width:"auto"};var p=document.createElement("div");p.setAttribute("id","hiddenDiv");Mt["b"].Utils.DOM.setStyle(p,u);$=i;p.style.fontSize=$;v.appendChild(p);createDimensionsTab();t.appendChild(m);_.setCSS("overflow","hidden");_.setCSS();_.decorateTabs(0,x);var g=parseInt(_.highest());var h=parseInt(_.getDialog().offsetParent().css("z-index"));if(g>h){g+=1;_.getDialog().offsetParent().css("z-index",g)}if(!ne){for(var r=0;r<re.length;r++){for(var f=0;f<O.rows.length;f++){if(re[r].id===O.rows[f].id.split(".")[0]){F.dimensionLengthAuto(re[r].id,re[r].dimAutoLength)}}}}F.updateTableDivHeightFromOutside(Mt["b"].$(v).parent().height());return this};F.updateTableDivHeightFromOutside=function(e){if(L==null||H==null){return}Mt["b"].Utils.DOM.setStyle(m,{height:e-117+"px"});e-=117+30+12;Mt["b"].Utils.DOM.setStyle(document.getElementById("subtab-category"),{height:e+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("subtab-separator"),{height:e+"px"});Mt["b"].Utils.DOM.setStyle(document.getElementById("subtab-empty"),{height:e+"px"});Mt["b"].Utils.DOM.setStyle(L,{height:e+"px"});Mt["b"].Utils.DOM.setStyle(H,{height:e+"px"});if(l!=null){Mt["b"].Utils.DOM.setStyle(l,{height:e+"px"})}};function createDimensionsTab(){m=_.buildTabs("dimensionsTabDiv",x,null,"auto",{top:"0px",left:"0px"},null,true)}function createDimensionsCategoryTab(){var e=document.createElement("div");e.setAttribute("id","tabCategoryDiv");var t=F.createDimensionsCategoryTable();e.appendChild(t);return e}function createSeparatorTab(){var e=document.createElement("div");e.setAttribute("id","tabSeparatorDiv");l=e;var t=document.createElement("table");var i=document.createElement("tr");var a=document.createElement("td");var n=F.createChangeSeparatorsTable();a.appendChild(n);Mt["b"].Utils.DOM.setStyle(a,{paddingRight:"10px",verticalAlign:"top"});i.appendChild(a);a=document.createElement("td");var r=F.createTotalSeparatorsTable();a.appendChild(r);Mt["b"].Utils.DOM.setStyle(a,{verticalAlign:"top"});i.appendChild(a);t.appendChild(i);e.appendChild(t);var o={overflow:"auto"};Mt["b"].Utils.DOM.setStyle(e,o);return e}function createEmptyTab(){var e=document.createElement("div");e.setAttribute("id","tabEmptyDiv");F.createDimensionsEmptyTable(e);return e}F.createDimensionsCategoryTable=function(){var e=document.createElement("div");L=e;e.setAttribute("id","dimensionCategoryTableDiv");Mt["b"].$(e).empty();var t=document.createElement("table");t.setAttribute("cellSpacing","3px");t.setAttribute("cellPadding","3px");var i,a;var n=document.createElement("td");var r=document.createElement("td");var o=document.createElement("td");var l=document.createElement("tr");n.style.verticalAlign="top";r.style.verticalAlign="top";R=I.slice(0);P=D.slice(0);if(ne){var s=R.indexOf(K.FREE_AXIS_POS);if(s!=-1){R.splice(s,1);P.splice(s,1)}}i=document.createElement("tr");i.style.verticalAlign="middle";a=document.createElement("td");Mt["b"].$(a).html(U.getTranslation("SHOW_AT"));a.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_SHOW_AT"));i.appendChild(a);a=document.createElement("td");var d=document.createElement("select");d.setAttribute("size","1");d.setAttribute("id","displayType");d.style.fontSize=$;d.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_SHOW_AT"));for(var c=0;c<R.length;c++){var u=document.createElement("option");if(R[c]===ie.displayType){u.setAttribute("selected","selected")}Mt["b"].$(u).html(P[c]);d.appendChild(u)}a.appendChild(d);i.appendChild(a);n.appendChild(i);i=document.createElement("tr");i.style.verticalAlign="middle";a=document.createElement("td");Mt["b"].$(a).html(U.getTranslation("ALIGNMENT"));a.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_ENTRIES"));i.appendChild(a);a=document.createElement("td");if(ae){var p=Mt["b"].Utils.Constants.TypeValues.summingPos.START;var g=ie.categoryEntriesPosition===p?"text_align_left.png":"text_align_left_grey.png";var h=Mt["b"].Utils.DOM.createIconButton(a,"hicoCellCategoryEntriesPosition.start",p,"Start",$,pe["a"].imgPath+g,U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_ENTRIES"));Mt["b"].$(h).click(entriesClickHandlerHorizontal);var p=Mt["b"].Utils.Constants.TypeValues.summingPos.END;var g=ie.categoryEntriesPosition===p?"text_align_right.png":"text_align_right_grey.png";var f=Mt["b"].Utils.DOM.createIconButton(a,"hicoCellCategoryEntriesPosition.end",p,"End",$,pe["a"].imgPath+g,U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_ENTRIES"));Mt["b"].$(f).click(entriesClickHandlerHorizontal)}else{var p=Mt["b"].Utils.Constants.TypeValues.summingPos.START;var g=ie.categoryEntriesPosition===p?"text_align_top.png":"text_align_top_grey.png";var h=Mt["b"].Utils.DOM.createIconButton(a,"hicoCellCategoryEntriesPosition.start",p,"Start",$,pe["a"].imgPath+g,U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_ENTRIES"));Mt["b"].$(h).click(entriesClickHandlerVertical);var p=Mt["b"].Utils.Constants.TypeValues.summingPos.END;var g=ie.categoryEntriesPosition===p?"text_align_bottom.png":"text_align_bottom_grey.png";var f=Mt["b"].Utils.DOM.createIconButton(a,"hicoCellCategoryEntriesPosition.end",p,"End",$,pe["a"].imgPath+g,U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_ENTRIES"));Mt["b"].$(f).click(entriesClickHandlerVertical)}i.appendChild(a);n.appendChild(i);if(!ae){i=document.createElement("tr");i.style.verticalAlign="middle";a=document.createElement("td");a.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_ALIGNMENT"));i.appendChild(a);a=document.createElement("td");var p=X.LEFT;var g=ie.alignment===p?"text_align_left.png":"text_align_left_grey.png";var m=Mt["b"].Utils.DOM.createIconButton(a,"hicoCellCategoryAlignment.left",p,"Left",$,pe["a"].imgPath+g,U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_ALIGNMENT"));Mt["b"].$(m).click(alignmentClickHandler);var p=X.MIDDLE;var g=ie.alignment===p?"text_align_center.png":"text_align_center_grey.png";var v=Mt["b"].Utils.DOM.createIconButton(a,"hicoCellCategoryAlignment.center",p,"Mid",$,pe["a"].imgPath+g,U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_ALIGNMENT"));Mt["b"].$(v).click(alignmentClickHandler);var p=X.RIGHT;var g=ie.alignment===p?"text_align_right.png":"text_align_right_grey.png";var b=Mt["b"].Utils.DOM.createIconButton(a,"hicoCellCategoryAlignment.right",p,"Right",$,pe["a"].imgPath+g,U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_ALIGNMENT"));Mt["b"].$(b).click(alignmentClickHandler);i.appendChild(a);n.appendChild(i)}i=document.createElement("tr");i.style.verticalAlign="middle";a=document.createElement("td");Mt["b"].$(a).html(U.getTranslation("LABELS_WITHOUT_TOTALS"));a.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_LABELS_WITHOUT_TOTALS"));i.appendChild(a);a=document.createElement("td");var T=document.createElement("select");T.setAttribute("size","1");T.setAttribute("id","categoriesWithoutTotals");T.style.fontSize=$;for(var c=0;c<N.length;c++){var u=document.createElement("option");if(N[c]===ie.categoriesWithoutTotals){u.setAttribute("selected","selected")}Mt["b"].$(u).html(w[c]);T.appendChild(u)}T.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_LABELS_WITHOUT_TOTALS"));a.appendChild(T);i.appendChild(a);r.appendChild(i);if(ne){i=document.createElement("tr");a=document.createElement("td");Mt["b"].$(a).html(U.getTranslation("SHOW_HEADER"));a.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_SHOW_HEADER"));i.appendChild(a);a=document.createElement("td");var x=Mt["b"].Utils.DOM.createCheckBoxWithLabel(a,"showCategoryHeader","","","");if(ie.hideCategoryHeader!==true){x.checkBox.setAttribute("checked","checked")}x.checkBox.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_SHOW_HEADER"));i.appendChild(a);r.appendChild(i);J=ie.repeatNotation;var E=[{value:"notation",id:"repeatNotation##notation",activeIcon:"notation.png",inactiveIcon:"notation_inactive.png",tooltip:U.getTranslation("NOTATION")},{value:"on",id:"repeatNotation##on",activeIcon:"on.png",inactiveIcon:"on_inactive.png",tooltip:U.getTranslation("ON")},{value:"off",id:"repeatNotation##off",activeIcon:"off.png",inactiveIcon:"off_inactive.png",tooltip:U.getTranslation("OFF")}];var y=[{type:"text",value:U.getTranslation("REPEAT_NOTATION"),tdStyle:{tooltip:U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_REPEAT_NOTATION")}},{type:"iconselector",value:J,values:E,tdStyle:{textAlign:"left"},click:repeatNotationEventHandler,tooltip:U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_REPEAT_NOTATION")}];_.buildTableRow(r,y)}else{i=document.createElement("tr");i.style.verticalAlign="middle";a=document.createElement("td");Mt["b"].Utils.DOM.createSpan(a,U.getTranslation("ADDITIONAL_WIDTH"));a.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_ADDITIONAL_DISTANCE"));i.appendChild(a);a=document.createElement("td");var C=(ie.addCategoryDistance*10).toFixed(ee);var S=Mt["b"].Utils.DOM.createTextInput(a,"addCategoryDistance",C,10,$);Mt["b"].Utils.DOM.setStyle(S,{textAlign:"right",width:"60px%"});S.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_ADDITIONAL_DISTANCE"));Mt["b"].Utils.DOM.createSpan(a,"&nbsp;mm/10pt");i.appendChild(a);r.appendChild(i);i=document.createElement("tr");a=document.createElement("td");Mt["b"].Utils.DOM.createSpan(a,U.getTranslation("DISTANCE_MULTIPLIER"));a.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_DISTANCE_MULTIPLIER"));i.appendChild(a);a=document.createElement("td");var M=Mt["b"].Utils.DOM.createCheckBoxWithLabel(a,"hasCategoryDistanceMultiplier","","","");if(ie.hasCategoryDistanceMultiplier===true){M.checkBox.setAttribute("checked","checked")}M.checkBox.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_DISTANCE_MULTIPLIER"));i.appendChild(a);r.appendChild(i)}Mt["b"].Utils.DOM.setStyle(o,{width:"50px"});l.appendChild(n);l.appendChild(o);l.appendChild(r);t.appendChild(l);l=document.createElement("tr");var O=document.createElement("td");O.setAttribute("colspan","3");var A=document.createElement("span");A.style.margin="0px";Mt["b"].$(A).html('<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">');O.appendChild(A);l.appendChild(O);t.appendChild(l);l=document.createElement("tr");O=document.createElement("td");O.setAttribute("colspan","3");if(!ne){O.appendChild(createDimensionsForTimeStructure())}l.appendChild(O);t.appendChild(l);e.appendChild(t);Mt["b"].Utils.DOM.setStyle(e,{overflow:"auto"});return e;function alignmentClickHandler(e){var t=["left","center","right"];for(var i=0;i<t.length;i++){var a="hicoCellCategoryAlignment."+t[i];if(a===this.id){this.src=pe["a"].imgPath+"text_align_"+t[i]+".png"}else{var n=document.getElementById(a);n.src=pe["a"].imgPath+"text_align_"+t[i]+"_grey.png"}}}function entriesClickHandlerHorizontal(e){if(this.id.indexOf("start")>=0){this.src=pe["a"].imgPath+"text_align_left.png";document.getElementById("hicoCellCategoryEntriesPosition.end").src=pe["a"].imgPath+"text_align_right_grey.png"}else{document.getElementById("hicoCellCategoryEntriesPosition.start").src=pe["a"].imgPath+"text_align_left_grey.png";this.src=pe["a"].imgPath+"text_align_right.png"}}function entriesClickHandlerVertical(e){if(this.id.indexOf("start")>=0){this.src=pe["a"].imgPath+"text_align_top.png";document.getElementById("hicoCellCategoryEntriesPosition.end").src=pe["a"].imgPath+"text_align_bottom_grey.png"}else{document.getElementById("hicoCellCategoryEntriesPosition.start").src=pe["a"].imgPath+"text_align_top_grey.png";this.src=pe["a"].imgPath+"text_align_bottom.png"}}function repeatNotationEventHandler(e){var t=this.id.split("##");J=t[1];for(var i=0;i<E.length;i++){var a=E[i];var n=document.getElementById(a.id);n.src=pe["a"].imgPath+(J===a.value?a.activeIcon:a.inactiveIcon)}}};function createDimensionsForTimeStructure(){var e=["60px","220px","220px","110px"];var t=document.createElement("div");t.setAttribute("id","dimensionCategoryDimensionTableDiv");var i=document.createElement("table");Mt["b"].Utils.DOM.setStyle(i,{borderCollapse:"separate",borderSpacing:"5px 0",width:"100%",overflow:"hidden"});_.buildTableRow(i,[{type:"empty",tdStyle:{width:e[0],minWidth:e[0]}},{type:"text",value:U.getTranslation("APPLIES_TO"),tooltip:U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_APPLIES_TO"),tdStyle:{borderBottom:"1px solid black",width:e[1],minWidth:e[1],whiteSpace:"nowrap"}},{type:"text",value:U.getTranslation("CONDITION"),tooltip:U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_CONDITION"),tdStyle:{borderBottom:"1px solid black",width:e[2],minWidth:e[2],whiteSpace:"nowrap"}},{type:"text",value:U.getTranslation("CUT_AT"),tooltip:U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_CUT_AT"),tdStyle:{borderBottom:"1px solid black",width:e[3],minWidth:e[3],whiteSpace:"nowrap"}}]);var a=O.rows;for(var n=0;n<a.length;n++){var r=a[n];var o=getDimensionFormula(r.id);if(o===-1||o===null||o===undefined){var l=new Se["a"].DimensionFormulaModel;l.id=r.id;l.dimAutoLength=true;l.dimension_mmpt=0;l.appliesFormula={formula:"true",compiledFormula:null};l.conditionFormula={formula:"true",compiledFormula:null};re.push(l)}o=getDimensionFormula(r.id);var s=re[o];var d=document.createElement("tr");var c={width:e[0],minWidth:e[0],whiteSpace:"nowrap"};var u=document.createElement("td");var p=r.name;if(p.length>20){p=p.substr(0,20)+"..."}Mt["b"].$(u).html(p);Mt["b"].Utils.DOM.setStyle(u,c);u.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_ID"));d.appendChild(u);c.width=e[1];c.minWidth=e[1];u=document.createElement("td");var g=V.invertNames(V.decode(s.appliesFormula.formula));u=buildTextInput("ruleDimAppliesEdit##"+r.id,g,0,null,true);u.childNodes[0].style.width=T;var h=buildFormulaButton("ruleDimApplies##"+r.id,"ruleDimAppliesEdit##"+r.id,z.APPLIES_TO,U.getTranslation("APPLIES_TO"));u.appendChild(h.childNodes[0]);Mt["b"].Utils.DOM.setStyle(u,c);u.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_APPLIES_TO"));d.appendChild(u);c.width=e[2];c.minWidth=e[2];var f=V.invertNames(V.decode(s.conditionFormula.formula));u=buildTextInput("ruleDimConditionEdit##"+r.id,f,0,null,true);u.childNodes[0].style.width=T;var h=buildFormulaButton("ruleDimCondition##"+r.id,"ruleDimConditionEdit##"+r.id,z.CONDITION,U.getTranslation("CONDITION"));u.appendChild(h.childNodes[0]);Mt["b"].Utils.DOM.setStyle(u,c);u.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_CONDITION"));d.appendChild(u);c.width=e[3];c.minWidth=e[3];var m=buildTextInput("dimCutAtMMPT##"+r.id,(parseFloat(s.dimension_mmpt)*10).toFixed(ee),6,null);var v=Mt["b"].$(m).find("input").get(0);Mt["b"].Utils.DOM.setStyle(v,{textAlign:"right",backgroundColor:"rgb(240, 240, 240)",border:"0px"});Mt["b"].$(v).focus(autoFocusIn);Mt["b"].$(v).focusout(autoFocusOut);if(s.dimAutoLength){v.value=b;v.style.color="rgb(150,150,150)"}Mt["b"].Utils.DOM.createSpan(m,"&nbsp;mm/10pt");Mt["b"].Utils.DOM.setStyle(m,c);m.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_CUT_AT"));d.appendChild(m);i.appendChild(d)}t.appendChild(i);return t;function autoFocusIn(e){this.style.color="";if(this.value===b){this.value=""}}function autoFocusOut(e){if(this.value===""){this.value=b;this.style.color="rgb(150,150,150)"}}}function buildFormulaButton(e,n,r,o){var t=document.createElement("td");var i=Mt["b"].Utils.DOM.createButtonInput(t,e,"","fx",$);Mt["b"].$(i).click(function(e){var t=document.getElementById("formulaEditor");if(t!==null){return}var i=Mt["b"].$(m).parent().offset();s=new Mt["b"].UI.FormulaEditor(O,r);var a=document.getElementById(n).value;s.open(V.encode(a),n,[],F,{x:i.left+20,y:i.top+20},o)});return t}F.dimensionLengthAuto=function(e,t){var i=document.getElementById("dimCutAtMMPT##"+e);t===true?i.disabled=true:i.disabled=false};F.createChangeSeparatorsTable=function(){var e=document.createElement("div");e.setAttribute("id","changeSeparatorsTableDiv");if(!ne){var t=document.createElement("table");t.setAttribute("cellSpacing","3px");var i=document.createElement("tr");var a=document.createElement("td");Mt["b"].$(a).html(U.getTranslation("REFERENCE"));Mt["b"].Utils.DOM.setStyle(a,{fontWeight:"bold",borderBottom:"1px solid black"});a.setAttribute("colspan","2");a.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_REFERENCE"));i.appendChild(a);t.appendChild(i);i=document.createElement("tr");a=document.createElement("td");var n=document.createElement("select");n.setAttribute("size","1");n.setAttribute("id","selectedKeyfigure");n.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_REFERENCE"));n.style.fontSize=$;var r=false;for(var o=0;o<M.length;o++){var l=document.createElement("option");if(M[o].id===ie.selectedKeyfigure){l.setAttribute("selected","selected");r=true}var s=M[o].name.length<=30?M[o].name:M[o].name.substr(0,28)+"...";Mt["b"].$(l).html(s);n.appendChild(l)}if(r===false&&n.length>0){n.options[0].setAttribute("selected","selected")}a.appendChild(n);a.setAttribute("colspan","2");i.appendChild(a);t.appendChild(i);i=document.createElement("tr");a=document.createElement("td");Mt["b"].$(a).html(U.getTranslation("CHANGE_OF"));Mt["b"].Utils.DOM.setStyle(a,{fontWeight:"bold",borderBottom:"1px solid black"});a.setAttribute("colspan","2");a.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_CHANGE_OF"));i.appendChild(a);t.appendChild(i);i=document.createElement("tr");a=document.createElement("td");Mt["b"].$(a).html(U.getTranslation("TIMETYPE"));a.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_TIMETYPE"));i.appendChild(a);a=document.createElement("td");var d=Mt["b"].Utils.DOM.createCheckBoxWithLabel(a,"separatorTimeType","","","");if(r&&ie.separatorTimeType===true){d.checkBox.setAttribute("checked","checked")}d.checkBox.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_TIMETYPE"));i.appendChild(a);t.appendChild(i);i=document.createElement("tr");a=document.createElement("td");Mt["b"].$(a).html(U.getTranslation("SCENARIO"));a.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_SCENARIO"));i.appendChild(a);a=document.createElement("td");var c=Mt["b"].Utils.DOM.createCheckBoxWithLabel(a,"separatorDataType","","","");if(r&&ie.separatorDataType===true){c.checkBox.setAttribute("checked","checked")}c.checkBox.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_SCENARIO"));i.appendChild(a);t.appendChild(i);i=document.createElement("tr");a=document.createElement("td");Mt["b"].$(a).html(U.getTranslation("DIMENSION"));a.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_DIMENSION"));i.appendChild(a);a=document.createElement("td");var u=Mt["b"].Utils.DOM.createCheckBoxWithLabel(a,"separatorCategory","","","");if(r&&ie.separatorCategory===true){u.checkBox.setAttribute("checked","checked")}u.checkBox.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_DIMENSION"));i.appendChild(a);t.appendChild(i);e.appendChild(t)}return e};F.setParameters=function(){if(ie.sepLengthStart_factor===null){if(ae){ie.sepLengthStart_factor=U.getParameter("FACTOR_TIME_SEPARATOR_NEGATIVE_AREA");ie.sepLengthEnd_factor=U.getParameter("FACTOR_TIME_SEPARATOR_DRAWING_AREA");ie.sepSubtotalLengthStart_factor=U.getParameter("FACTOR_TIME_SUBTOTAL_SEPARATOR_NEGATIVE_AREA");ie.sepSubtotalLengthEnd_factor=U.getParameter("FACTOR_TIME_SUBTOTAL_SEPARATOR_LENGTH");ie.sepTotalLengthStart_factor=U.getParameter("FACTOR_TIME_TOTAL_WITH_VALUES_SEPARATOR_NEGATIVE_AREA");ie.sepTotalLengthEnd_factor=U.getParameter("FACTOR_TIME_TOTAL_WITH_VALUES_SEPARATOR_LENGTH");ie.sepTotalWVLengthStart_factor=U.getParameter("FACTOR_TIME_TOTAL_WITHOUT_VALUES_SEPARATOR_NEGATIVE_AREA");ie.sepTotalWVLengthEnd_factor=U.getParameter("FACTOR_TIME_TOTAL_WITHOUT_VALUES_SEPARATOR_LENGTH")}else if(i){ie.sepLengthStart_factor=U.getParameter("FACTOR_STRUCTURE_SEPARATOR_NEGATIVE_AREA");ie.sepLengthEnd_factor=U.getParameter("FACTOR_STRUCTURE_SEPARATOR_DRAWING_AREA");ie.sepSubtotalLengthStart_factor=U.getParameter("FACTOR_STRUCTURE_SUBTOTAL_SEPARATOR_NEGATIVE_AREA");ie.sepSubtotalLengthEnd_factor=U.getParameter("FACTOR_STRUCTURE_SUBTOTAL_SEPARATOR_LENGTH");ie.sepTotalLengthStart_factor=U.getParameter("FACTOR_STRUCTURE_TOTAL_WITH_VALUES_SEPARATOR_NEGATIVE_AREA");ie.sepTotalLengthEnd_factor=U.getParameter("FACTOR_STRUCTURE_TOTAL_WITH_VALUES_SEPARATOR_LENGTH");ie.sepTotalWVLengthStart_factor=U.getParameter("FACTOR_STRUCTURE_TOTAL_WITHOUT_VALUES_SEPARATOR_NEGATIVE_AREA");ie.sepTotalWVLengthEnd_factor=U.getParameter("FACTOR_STRUCTURE_TOTAL_WITHOUT_VALUES_SEPARATOR_LENGTH")}}};F.createTotalSeparatorsTable=function(){F.setParameters();g=document.createElement("div");g.setAttribute("id","headerSeparatorDiv");if(ne){return g}var e=document.createElement("table");e.setAttribute("cellSpacing","3px");var t=document.createElement("tr");var i=document.createElement("td");Mt["b"].$(i).html(U.getTranslation("LENGTH"));Mt["b"].Utils.DOM.setStyle(i,{fontWeight:"bold"});i.setAttribute("colspan","6");i.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_LENGTH"));i.style.borderBottom="1px solid black";t.appendChild(i);e.appendChild(t);var a=[U.getTranslation("TYPE"),U.getTranslation("CHANGE_OF"),U.getTranslation("SUBTOTAL"),U.getTranslation("TOTAL"),U.getTranslation("TOTALS_WITHOUT_VALUES")];var n=[U.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_TYPE"),U.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_TYPE_CHANGE_OF"),U.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_TYPE_SUBTOTAL"),U.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_TYPE_TOTAL"),U.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_TYPE_TOTALS_WO_VALUES")];var t=document.createElement("tr");for(var r=0;r<a.length;r++){var i=document.createElement("td");Mt["b"].$(i).html(a[r]);if(r===0){i.setAttribute("colspan","2")}i.setAttribute("title",n[r]);i.style.borderBottom="1px solid black";t.appendChild(i)}e.appendChild(t);var o=document.createElement("tr");var l=U.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_NOTATION");var i=document.createElement("td");Mt["b"].$(i).html(U.getTranslation("START"));i.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_START"));o.appendChild(i);i=document.createElement("td");Mt["b"].$(i).html(U.getTranslation("NOTATION"));i.setAttribute("title",l);o.appendChild(i);for(var r=0;r<A.length;r++){i=document.createElement("td");var s=Mt["b"].Utils.DOM.createCheckBoxWithLabel(i,A[r].id,"","","");if(ie[A[r].param]){s.checkBox.setAttribute("checked","checked")}Mt["b"].$(s.checkBox).change(function(e){var t=this.id.replace("FromNotation","")+"Start";if(this.checked){document.getElementById(t+"Auto").setAttribute("disabled","disabled");document.getElementById(t+"_factor").setAttribute("disabled","disabled");document.getElementById(t+"_mmpt").setAttribute("disabled","disabled");document.getElementById(t+"Unit").setAttribute("disabled","disabled")}else{document.getElementById(t+"Auto").removeAttribute("disabled");document.getElementById(t+"_factor").removeAttribute("disabled");document.getElementById(t+"_mmpt").removeAttribute("disabled");document.getElementById(t+"Unit").removeAttribute("disabled")}});s.checkBox.setAttribute("title",l);o.appendChild(i)}e.appendChild(o);var o=document.createElement("tr");var d=U.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_AUTO");var i=document.createElement("td");o.appendChild(i);i=document.createElement("td");Mt["b"].$(i).html(U.getTranslation("AUTO"));i.setAttribute("title",d);o.appendChild(i);for(var r=0;r<Y.length;r++){i=document.createElement("td");var c=Mt["b"].Utils.DOM.createCheckBoxWithLabel(i,Y[r].id,"","","");if(ie[Y[r].param]){c.checkBox.setAttribute("checked","checked")}if(ie[A[r].param]){c.checkBox.setAttribute("disabled","disabled")}c.checkBox.setAttribute("title",d);o.appendChild(i)}e.appendChild(o);var o=document.createElement("tr");var h=U.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_MANUAL");var i=document.createElement("td");o.appendChild(i);i=document.createElement("td");Mt["b"].$(i).html(U.getTranslation("MANUAL"));i.setAttribute("title",h);o.appendChild(i);function createDynamicLengthEntry(e,t,i,a,n,r){var o=(ie[i+"_factor"]*100).toFixed(f);var l=(ie[i+"_mmpt"]*10).toFixed(ee);var s=Mt["b"].Utils.DOM.createTextInput(e,t+"_factor",o,4,$);s.setAttribute("maxlength","10");s.setAttribute("title",h);var d=Mt["b"].Utils.DOM.createTextInput(e,t+"_mmpt",l,4,$);d.setAttribute("maxlength","10");d.setAttribute("title",h);var c=document.createElement("select");c.setAttribute("size","1");c.style.fontSize=$;c.setAttribute("id",a);Mt["b"].$(c).attr("class","_lengthUnits");c.setAttribute("title",h);for(var u=0;u<te.length;u++){var p=document.createElement("option");Mt["b"].$(p).html(te[u]);c.appendChild(p)}var g=ie[n];if(te.indexOf(g)===1||!isNaN(g)&&parseInt(g)===1){s.style.display="none";c.selectedIndex=1}else{d.style.display="none";c.selectedIndex=0}function selectorOnChange(e){if(e.target.selectedIndex===0){d.style.display="none";s.style.display=""}else{s.style.display="none";d.style.display=""}}Mt["b"].$(c).on("change",selectorOnChange);if(r){s.setAttribute("disabled","disabled");d.setAttribute("disabled","disabled");c.setAttribute("disabled","disabled")}e.appendChild(c)}for(var r=0;r<Z.length;r++){var i=document.createElement("td");var u=Z[r];createDynamicLengthEntry(i,u.id,u.param,u.unitId,u.unitParam,ie[A[r].param]);o.appendChild(i)}e.appendChild(o);var o=document.createElement("tr");var i=document.createElement("td");Mt["b"].$(i).html(U.getTranslation("END"));i.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_END"));o.appendChild(i);i=document.createElement("td");Mt["b"].$(i).html(U.getTranslation("NOTATION"));i.setAttribute("title",l);o.appendChild(i);for(var r=0;r<Q.length;r++){i=document.createElement("td");var p=Mt["b"].Utils.DOM.createCheckBoxWithLabel(i,Q[r].id,"","","");if(ie[Q[r].param]){p.checkBox.setAttribute("checked","checked")}p.checkBox.setAttribute("title",l);Mt["b"].$(p.checkBox).change(function(e){var t=this.id.replace("FromNotation","");if(this.checked){document.getElementById(t+"_factor").setAttribute("disabled","disabled");document.getElementById(t+"_mmpt").setAttribute("disabled","disabled");document.getElementById(t+"Unit").setAttribute("disabled","disabled")}else{document.getElementById(t+"_factor").removeAttribute("disabled");document.getElementById(t+"_mmpt").removeAttribute("disabled");document.getElementById(t+"Unit").removeAttribute("disabled")}});o.appendChild(i)}e.appendChild(o);var o=document.createElement("tr");var i=document.createElement("td");o.appendChild(i);i=document.createElement("td");Mt["b"].$(i).html(U.getTranslation("MANUAL"));i.setAttribute("title",h);o.appendChild(i);for(var r=0;r<q.length;r++){var i=document.createElement("td");var u=q[r];createDynamicLengthEntry(i,u.id,u.param,u.unitId,u.unitParam,ie[Q[r].param]);o.appendChild(i)}e.appendChild(o);g.appendChild(e);return g};F.createDimensionsEmptyTable=function(e){var t=e||document.getElementById("tabEmptyDiv");Mt["b"].$(t).empty();var i=document.createElement("div");H=i;i.setAttribute("id","emptyTableDiv");var a=document.createElement("table");Mt["b"].Utils.DOM.setStyle(a,{borderCollapse:"separate",borderSpacing:"5px 0"});var r={borderBottom:"1px solid black",textAlign:"left",maxWidth:"110px",overflow:"hidden",fontWeight:"normal"};function buildHeader(e,t){var i=document.createElement("thead");for(var a=0;a<e.length;a++){var n=document.createElement("th");Mt["b"].Utils.DOM.setStyle(n,r);if(e[a]){Mt["b"].Utils.DOM.createSpan(n,e[a]);n.setAttribute("title",t[a])}i.appendChild(n)}return i}var n=U.getTranslation("HELP_CELL_DIMENSIONS_GAP_APPLIES_TO");var o=U.getTranslation("HELP_CELL_DIMENSIONS_GAP_MMPT");var l=U.getTranslation("HELP_CELL_DIMENSIONS_GAP_POSITION");var s=U.getTranslation("HELP_CELL_DIMENSIONS_GAP_AXIS_SPLIT");var d=U.getTranslation("HELP_CELL_DIMENSIONS_GAP_DELETE");var c=U.getTranslation("HELP_CELL_DIMENSIONS_GAP_COPY_FROM");var u=[null,U.getTranslation("APPLIES_TO"),null,U.getTranslation("MMPT"),U.getTranslation("POSITION"),U.getTranslation("SPLIT_AXIS")];var p=[null,n,null,o,l,s];var g=buildHeader(u,p);var h=document.createElement("th");Mt["b"].Utils.DOM.setStyle(h,{borderBottom:"1px solid black",width:"20px",maxWidth:"20px",minWidth:"20px",overflow:"hidden",textAlign:"center"});var f=Mt["b"].Utils.DOM.createSpan(h,"+","dimensionMenuAddEmptySpace."+E);f.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_GAP_ADD"));Mt["b"].$(f).click(function(e){F.addEmptySpace(e);F.createDimensionsEmptyTable()});Mt["b"].$(f).hover(function(){this.style.textDecoration="underline"},function(){this.style.textDecoration="none"});g.appendChild(h);var m=document.createElement("tbody");a.appendChild(m);var v=document.createElement("th");var b=Mt["b"].Utils.DOM.createButtonInput(v,"emptyCopyFromButton","",U.getTranslation("COPY_FROM"),$);b.setAttribute("title",c);Mt["b"].$(b).click(function(e){var t={extension:B,parentDialog:F,tmpEmptySpaceRepository:G,containerModel:k};var i=new Mt["b"].UI.CopyEmptySpacesDialog(t);i.open()});g.appendChild(v);a.appendChild(g);var T=["12px","200px","40px","80px","70px","55px","20px","100px"];if(G.length===0){var x=document.createElement("tr");for(var E=0;E<T.length;E++){var y=document.createElement("td");y.style.width=T[E];x.appendChild(y)}a.appendChild(x)}else{for(var E=0;E<G.length;E++){var C=document.createElement("tr");C.setAttribute("id","emptyRow."+E);var S=document.createElement("td");var M=document.createElement("div");M.setAttribute("id","emptyDragger."+E);M.setAttribute("title",U.getTranslation("HELP_CELL_DIMENSIONS_GAP_DRAGGER"));Mt["b"].Utils.DOM.setStyle(M,{height:"10px",width:"10px",background:"rgb(150,150,150)"});S.appendChild(M);S.style.width=T[0];M.style.marginLeft="1px";C.appendChild(S);var O=G[E].appliesFormula;var A=buildTextInput("emptyApplies."+E,V.invertNames(V.decode(O)),26,null,true);A.style.width=T[1];A.childNodes[0].style.width="98%";A.setAttribute("title",n);C.appendChild(A);var _=buildFormulaButton("emptyAppliesB."+E,"emptyApplies."+E,z.APPLIES_TO,U.getTranslation("APPLIES_TO"));_.style.width=T[2];_.setAttribute("title",n);C.appendChild(_);var L=buildTextInput("emptyMMPT."+E,(parseFloat(G[E].space_mmpt)*10).toFixed(ee),6,null);L.style.width=T[3];L.setAttribute("title",o);C.appendChild(L);var I=W.indexOf(G[E].position);var D=buildListBox("emptyPosition."+E,j,j[I],null);D.style.width=T[4];D.style.textAlign="left";D.setAttribute("title",l);C.appendChild(D);S=document.createElement("td");var R=Mt["b"].Utils.DOM.createCheckBoxWithLabel(S,"axisSplit."+E,"","","");if(G[E].axisSplit===true){R.checkBox.setAttribute("checked","checked")}S.style.textAlign="center";R.checkBox.setAttribute("title",s);C.appendChild(S);var P=document.createElement("td");Mt["b"].Utils.DOM.setStyle(P,{width:T[6],maxWidth:T[6],minWidth:T[6],overflow:"hidden",textAlign:"center"});var N=Mt["b"].Utils.DOM.createSpan(P,"-","dimensionMenuRemoveEmptySpace."+E);N.setAttribute("title",d);Mt["b"].$(N).click(function(e){F.removeEmptySpace(e);F.createDimensionsEmptyTable()});Mt["b"].$(N).hover(function(){this.style.textDecoration="underline"},function(){this.style.textDecoration="none"});C.appendChild(P);var w=document.createElement("td");w.style.width=T[7];C.appendChild(w);m.appendChild(C)}}if(G.length>1){Mt["b"].$(m).sortable({axis:"y",containment:m,cursor:"crosshair",distance:3,stop:F.sortEmptySpace,start:F.startEmptySpaceSorting})}i.appendChild(a);t.appendChild(i);return i};F.getActiveTab=function(){return Mt["b"].$(m).tabs("option","selected")};F.setActiveTab=function(e){return Mt["b"].$(m).tabs("option","selected",e)};F.updateActiveKeyfigures=function(e){var t=document.getElementById("selectedKeyfigure");var i="";if(t!==null){if(t.selectedIndex>=0&&M[t.selectedIndex]){i=M[t.selectedIndex].id}Mt["b"].$(t).empty();var a=false;M=e;for(var n=0;n<M.length;n++){var r=document.createElement("option");if(M[n].id===i){r.setAttribute("selected","selected");a=true}Mt["b"].$(r).html(M[n].name);t.appendChild(r)}if(a===false&&t.length>0){t.options[0].setAttribute("selected","selected")}}};F.changeSelection=function(e){applyEmptySpace(false);if(S==null||ie===null){console.warn("saveDimensionSettings");return}var t=document.getElementById("displayType");var i=R[t.selectedIndex];ie.displayType=i;var a=null;var n=["left","center","right"];for(var r=0;r<n.length;r++){var a=document.getElementById("hicoCellCategoryAlignment."+n[r]);if(a&&a.src.indexOf("grey")===-1){a=a.getAttribute("name");break}}if(a){if(ie.displayType!==K.FREE_AXIS_POS&&i===K.FREE_AXIS_POS){a=X.RIGHT}if(ie.displayType===K.FREE_AXIS_POS&&i!==K.FREE_AXIS_POS){if(ie.alignment===X.RIGHT&&a===X.RIGHT){a=X.LEFT}}ie.alignment=a}var o=document.getElementById("hicoCellCategoryEntriesPosition.start");if(o&&o.src.indexOf("grey")===-1){ie.categoryEntriesPosition=o.getAttribute("name")}else{o=document.getElementById("hicoCellCategoryEntriesPosition.end");if(o&&o.src.indexOf("grey")===-1){ie.categoryEntriesPosition=o.getAttribute("name")}}var l=document.getElementById("categoriesWithoutTotals");if(l!==null){var s=N[l.selectedIndex];ie.categoriesWithoutTotals=s}var d=document.getElementById("hasCategoryDistanceMultiplier");var c=document.getElementById("addCategoryDistance");if(d!==null){ie.hasCategoryDistanceMultiplier=d.checked;ie.addCategoryDistance=parseFloat(c.value)/10}var u=document.getElementById("selectedKeyfigure");if(u!==null&&u.selectedIndex>=0){var p=M[u.selectedIndex].id;ie.selectedKeyfigure=p}var g=document.getElementById("separatorDataType");if(g!==null){ie.separatorDataType=g.checked}var h=document.getElementById("separatorCategory");if(h!==null){ie.separatorCategory=h.checked}var f=document.getElementById("separatorTimeType");if(f!==null){ie.separatorTimeType=f.checked}var m=document.getElementById("showCategoryHeader");if(m!==null){ie.hideCategoryHeader=!m.checked}if(ne){ie.repeatNotation=J}for(var r=0;r<re.length;r++){var v=document.getElementById("ruleDimAppliesEdit##"+re[r].id);if(v!==null){re[r].appliesFormula.formula=V.encode(v.value);re[r].appliesFormula.compiledFormula=null}var b=document.getElementById("ruleDimConditionEdit##"+re[r].id);if(b!==null){re[r].conditionFormula.formula=V.encode(b.value);re[r].conditionFormula.compiledFormula=null}var T=document.getElementById("dimCutAtMMPT##"+re[r].id);if(T!==null){var x=parseFloat(T.value.replace(",","."));re[r].dimAutoLength=isNaN(x);if(!re[r].dimAutoLength){re[r].dimension_mmpt=x/10}}}if(!ne){savingHelper1(A);savingHelper1(Y);savingHelper2(Z);savingHelper1(Q);savingHelper2(q)}if(ne===true){S.hideDimensionColumns=[];for(var r=0;r<O.rows.length;r++){var E=O.rows[r];var y=document.getElementById("dimensionHide##"+E.id);if(y!==null){if(y.checked===true){S.hideDimensionColumns.push(E.id)}}}}ie.emptySpaceRepository=[];for(var C=0;C<G.length;C++){ie.emptySpaceRepository.push(G[C])}ie.dimensionFormulaRepository=re;G=[];re=[];if(!e){B.paint()}function savingHelper1(e){for(var t=0;t<e.length;t++){var i=document.getElementById(e[t].id);ie[e[t].param]=i.checked}}function savingHelper2(e){for(var t=0;t<e.length;t++){var i=document.getElementById(e[t].id+"_factor");ie[e[t].param+"_factor"]=parseFloat(i.value.replace(",","."))/100;var i=document.getElementById(e[t].id+"_mmpt");ie[e[t].param+"_mmpt"]=parseFloat(i.value.replace(",","."))/10;var i=document.getElementById(e[t].unitId);ie[e[t].unitParam]=te[i.selectedIndex]}}};F.freeResources=function(){var e=document.getElementById("formulaEditor");if(e!==null){if(s!==null){s.close()}}};function buildTextInput(e,t,i,a,n,r){var o=document.createElement("td");var l=Mt["b"].Utils.DOM.createTextInputNoMax(o,e,t,i,$);if(a){Mt["b"].$(l).keyup(a)}if(n){var s=t;var d=Mt["b"].$(l).keydown(function(e){if(e.which===13){var t={formula:V.encode(this.value),compiledFormula:null};if(V.checkFormulaCFM(t)===false||r&&r(this.value)){this.style.color="#FF0000"}else{this.value=V.invertNames(V.decode(this.value));s=this.value;Mt["b"].$(this).blur()}}});d.focus(function(e){this.style.color="#5555FF";s=this.value});d.focusout(function(e){this.style.color="#000000";this.value=s})}return o}function buildListBox(e,t,i,a,n){var r=document.createElement("td");Mt["b"].Utils.DOM.setStyle(r,{textAlign:"center"});var o=null;o=Mt["b"].Utils.DOM.createSelectBox(r,e,t,t,i,$);if(a){Mt["b"].$(o).change(a)}if(n){o.setAttribute("disabled","disabled")}return r}function applyEmptySpace(e){if(!e){if(checkEmptySpaceFormulas()){return false}}for(var t=0;t<G.length;t++){var i=document.getElementById("emptyApplies."+t);G[t].appliesFormula=V.encode(i.value);G[t].compiledFormula=null;var a=document.getElementById("emptyMMPT."+t);G[t].space_mmpt=parseFloat(a.value.replace(",","."))/10;var n=document.getElementById("emptyPosition."+t);var r=j.indexOf(n.value);G[t].position=W[r];G[t].axisSplit=document.getElementById("axisSplit."+t).checked}return true}F.setValuesFromFormulaEditorCFM=function(e,t){var i=document.getElementById(t);if(i){i.value=V.invertNames(V.decode(e.formula))}};function getDimensionFormula(e){var t=-1;for(var i=0;i<re.length;i++){var a=re[i];if(a.id===e){t=i;break}}return t}F.addEmptySpace=function(e){applyEmptySpace(false);var t=0;for(var i=0;i<G.length;i++){if(G[i].id>t){t=G[i].id}}var a=t+1;var n=new Se["a"].EmptySpaceModel;n.appliesFormula="true";n.id=a;G.push(n)};F.hide=function(){_.visibility("hidden")};F.show=function(){_.visibility("visible")};F.removeEmptySpace=function(e){applyEmptySpace(false);var t=parseInt(e.target.id.split(".").pop());if(t>=0&&t<G.length){G.splice(t,1)}};F.startEmptySpaceSorting=function(e,t){var i=t.item.get()[0].id;var a=i.split(".");var n="emptyDragger."+a[1];document.getElementById(n).style.background="rgb(37,157,187)"};F.sortEmptySpace=function(e,t){var i=e.target.childNodes;var a=new Array(G.length);var n=false;var r=0;for(var o=0;o<i.length;o++){var l=parseInt(i[o].id.split(".").pop());if(!isNaN(l)){a[o-r]=G[l]}else{r=1}if(o-r!==l){n=true}}if(n){applyEmptySpace(false);G=a;F.createDimensionsEmptyTable()}else{var s=t.item.get()[0].id;var d=s.split(".");var c="emptyDragger."+d[1];document.getElementById(c).style.background="rgb(150,150,150)"}};function checkEmptySpaceFormulas(){var e=false;for(var t=0;t<G.length;t++){var i=document.getElementById("emptyApplies."+t);var a={formula:V.encode(i.value),compiledFormula:null};if(V.checkFormulaCFM(a)===false){i.style.color="#FF0000";e=true}}return e}};Mt["b"].UI=Mt["b"].UI||{};Mt["b"].UI.DocumentSettings=function(){var x=Mt["b"].Utils.Translations,C=new Mt["b"].Utils.Calculator(null);Mt["b"].DataObjects.DocumentDO.getDocumentController().dispatch("updateScalingGroups",{type:"document"});var t=this,S=Mt["b"].DataObjects.DocumentDO.getDocSettings(true),M=Mt["b"].Utils.Calculator.Converter;var o=[{id:"",translation:"-"},{id:"",translation:"()"}],n=[{id:"",translation:"de_DE"},{id:"",translation:"en_US"}],O=["END","BY_VALUETYPE"],l=[{id:"",translation:x.getTranslation("END")},{id:"",translation:x.getTranslation("BY_VALUETYPE")}],T=[x.getTranslation("AUTO"),"1","2","3"],A=[{id:"",translation:"DD.MM.YYYY"},{id:"",translation:"YYYY.MM.DD"},{id:"",translation:"MM/DD/YYYY"}],_=Mt["b"].Utils.Constants.ParameterSets.documentModesValue,r=[{id:"",translation:x.getTranslation("DESIGN")},{id:"",translation:x.getTranslation("PRESENTATION")}];var e=Mt["b"].DataObjects.ContextRepo.getAllContexts(),E={};for(var i=0;i<e.length;i++){for(var a=0;a<e[i].columns.length;a++){E[e[i].columns[a].scalingGroup]=true}}var y=2;var s=[{id:"XXXgeneralOverall",text:x.getTranslation("OVERALL"),tooltip:x.getTranslation("HELP_DOCSETTINGS_OVERALL"),buildUp:createOverall},{id:"XXXgeneralDisplay",text:x.getTranslation("NUMBERS"),tooltip:x.getTranslation("HELP_DOCSETTINGS_NUMBER"),buildUp:createNumber},{id:"XXXgeneralScalingGroups",text:x.getTranslation("SCALING_GROUPS"),tooltip:x.getTranslation("HELP_DOCSETTINGS_SCALINGGROUPS"),buildUp:createScalingGroups},{id:"XXXgeneralScalingHelper",text:x.getTranslation("SCALING_HELPER"),tooltip:x.getTranslation("HELP_DOCSETTINGS_SCALINGHELPER"),buildUp:createScaling}];var d="numberFormat";var c="440";var u="400",L="260px",p=17,g=50;var h=[x.getTranslation(S.userSpecificScaling.name),"",x.getTranslation("AUTO_SCALING"),"",""],I=["","SCALING_GROUPS","SCALING__PER_CM","",""],D=["",x.getTranslation("SCALING_GROUPS"),x.getTranslation("SCALING__PER_CM"),"",""],R=["","HELP_DOCSETTINGS_SCALINGGROUPS_SCALINGGROUP","HELP_DOCSETTINGS_SCALINGGROUPS_SCALING","",""],P=["","","AUTO","","MANUAL"],N=["","",x.getTranslation("AUTO"),"",x.getTranslation("MANUAL")],w=["","","HELP_DOCSETTINGS_SCALINGGROUPS_AUTO","","HELP_DOCSETTINGS_SCALINGGROUPS_MANUAL"];var f,m,F;var v=[],b=[],B=[],k=[];this.open=function(){var e=x.getTranslation("DOCUMENT");var t=buildButtonBar();var i=new Mt["b"].UI.HiCoDialogDefinition(d,e,t);i.setWidth(c);i.setHeight(u);i.setPosition({});i.setResizable(true);i.setTooltip(x.getTranslation("HELP_DOCSETTINGS"));F=i.getFontSize();f=new Mt["b"].UI.HiCoDialog(i);m=f.getDialogDiv();var a={position:"absolute",visibility:"hidden",height:"auto",width:"auto"};var n=document.createElement("div");n.setAttribute("id","hiddenDivDocuments");Mt["b"].Utils.DOM.setStyle(n,a);n.style.fontSize=i.getFontSize();m.appendChild(n);calculateStdLength();f.buildTabs("tabDiv",s,null,L,{top:"0px",left:"0px"},null,true);function adjustSize(){var e=Mt["b"].$(m).parent().height()-70;Mt["b"].$(m).height(e);var t=Mt["b"].$("#tabDiv > .ui-tabs-nav").height();Mt["b"].$(".ui-tabs-panel",Mt["b"].$(m).parent()).height(e-t-p);Mt["b"].$(".ui-tabs-panel","#XXXgeneralOverall").height(e-t-g);Mt["b"].$("#GENERALDisplayDocument",Mt["b"].$(m)).height(e-t-p);Mt["b"].$("#GENERALLanguageDocument",Mt["b"].$(m)).height(e-t-p);Mt["b"].$("#GENERALScalingGroupDocument",Mt["b"].$(m)).height(e-t-p);Mt["b"].$("#GENERALScalingDocument",Mt["b"].$(m)).height(e-t-p)}adjustSize();f.setEvent("dialogresize",adjustSize);f.setTabsCss("#generalTab",["generalTab"]);f.setCSS("overflow","hidden");f.setCSS();var r=parseInt(f.highest());var o=parseInt(f.getDialog().offsetParent().css("z-index"));if(r>o){r+=1;f.getDialog().offsetParent().css("z-index",r)}f.decorateTabs(0,s,null)};function buildButtonBar(){var e=[];e.push({text:x.getTranslation("SAVE_CLOSE"),id:"okayButton",click:t.okay});e.push({text:x.getTranslation("CANCEL"),id:"closeButton",click:t.close});e.push({text:x.getTranslation("SAVE"),id:"applyButton",click:t.apply});return e}function createOverall(){var e=document.createElement("table"),t=document.createElement("div");t.setAttribute("id","GENERALLanguageDocument");Mt["b"].Utils.DOM.setStyle(t,{width:"100%",height:L,overflow:"auto"});var i=S.userSpecific.value,a=x.getTranslation(S.userSpecific.name);f.createTableRow(e,"CHECK_ALLOW_USER_LANG",a,i,"checkBox",x.getTranslation("HELP_DOCSETTINGS_OVERALL_USERSPECIFIC"));i=S.documentMode.value;a=x.getTranslation(S.documentMode.name);f.createTableRow(e,"docPropertyType_documentMode",a,{valueArray:r,selectedValue:i},"dropdown",x.getTranslation("HELP_DOCSETTINGS_OVERALL_MODE"));i=S.showUnlicensed.value;a=x.getTranslation(S.showUnlicensed.name);f.createTableRow(e,"CHECK_SHOW_UNLICENSED",a,i,"checkBox",x.getTranslation("HELP_DOCSETTINGS_OVERALL_UNLICENSED"));i=S.docLanguage.value;a=x.getTranslation(S.docLanguage.name);f.createTableRow(e,"docPropertyType_15",a,{valueArray:n,selectedValue:i,clazz:"_languageAbbr"},"dropdown",x.getTranslation("HELP_DOCSETTINGS_OVERALL_LANGUAGE"));i=S.dateFormat.value;a=x.getTranslation(S.dateFormat.name);f.createTableRow(e,"DD_DATEFORMAT",a,{valueArray:A,selectedValue:i,clazz:"_dateFormats"},"dropdown",x.getTranslation("HELP_DOCSETTINGS_OVERALL_DATEFORMAT"));i=S.paintTimeout.value;a=x.getTranslation(S.paintTimeout.name);f.createTableRow(e,"DD_PAINT_TIMEOUT",a,{text:i,labelText:""},"textInput",x.getTranslation("HELP_DOCSETTINGS_OVERALL_PAINT_TIMEOUT"));Mt["b"].Connector.ConnectorHelper.DocumentSettings_createOverall(e,F);i=S.pasteWithoutFormat.value;a=x.getTranslation(S.pasteWithoutFormat.name);f.createTableRow(e,"CHECK_PASTE_WITHOUT_FORMAT",a,i,"checkBox",x.getTranslation("HELP_DOCSETTINGS_OVERALL_PASTE_WITHOUT_FORMAT"));t.appendChild(e);return t}function createNumber(){var e=document.createElement("div");e.setAttribute("id","GENERALDisplayDocument");Mt["b"].Utils.DOM.setStyle(e,{width:"100%",height:L,overflow:"auto"});var t=document.createElement("table");f.createSection(t,x.getTranslation("DECIMAL_SEPARATORS"),x.getTranslation("HELP_DOCSETTINGS_NUMBER_DECSEP"));var i=S.decimalSep.value;var a=x.getTranslation(S.decimalSep.name);f.createTableRow(t,"docPropertyType_0",a,{text:i,labelText:""},"textInput",x.getTranslation("HELP_DOCSETTINGS_NUMBER_DECSEP_DECIMAL"));i=S.thousandSep.value;a=x.getTranslation(S.thousandSep.name);f.createTableRow(t,"docPropertyType_1",a,{text:i,labelText:""},"textInput",x.getTranslation("HELP_DOCSETTINGS_NUMBER_DECSEP_THOUSAND"));f.createSection(t,x.getTranslation("UNITS"),x.getTranslation("HELP_DOCSETTINGS_NUMBER_UNITS"));i=S.unitPosition.value;a=x.getTranslation(S.unitPosition.name);var n=0;for(var r=0;r<O.length;r++){if(O[r]===i){n=r;break}}f.createTableRow(t,"docPropertyType_2",a,{valueArray:l,selectedValue:l[n].translation,clazz:"_unitPosition"},"dropdown",x.getTranslation("HELP_DOCSETTINGS_NUMBER_UNITS_POSITION"));f.createSection(t,x.getTranslation("NEGATIVES"),x.getTranslation("HELP_DOCSETTINGS_NUMBER_NEGATIVE"));i=S.negativeStyle.value;a=x.getTranslation(S.negativeStyle.name);f.createTableRow(t,"docPropertyType_5",a,{valueArray:o,selectedValue:i,clazz:"_negativeStyle"},"dropdown",x.getTranslation("HELP_DOCSETTINGS_NUMBER_NEGATIVE_STYLE"));e.appendChild(t);return e}function scalingClickDeleteHandler(e){for(var t in S.scalingGroups.value){if(t===e&&Object.keys(E).indexOf(t)===-1){delete S.scalingGroups.value[t];var i=document.getElementById("GENERALScalingGroupDocumentPart2");Mt["b"].$(i).empty();i.appendChild(createScalingGroupTablePart2());return}}}function documentHandler(e){var t=e.target.id;var i=S.scalingGroups.value;var a=t.split("##");var n=a[0];var r=a[1];function getFactor(e){return e==null?"":M.zoomFactor2cm(e).toFixed(3).toString(10)}switch(n){case"docPropertyType_columnsMinus":scalingClickDeleteHandler(r);break;case"docPropertyType_AutoScalingPerSg":var o=true;for(var l in i){var s=document.getElementById("docPropertyType_AutoScalingPerSg##"+l);if(s&&!s.checked){o=false;break}}var s=document.getElementById("docPropertyType_AutoScaling");s.checked=o;var d=document.getElementById("docPropertyType_ScalingFactor##"+r);var c=document.getElementById("docPropertyType_ManualFactor##"+r);if(e.target.checked){Mt["b"].$(d).html(getFactor(i[r].scalingFactor));c.style.visibility="hidden";d.style.visibility="visible"}else{c.value=getFactor(i[r].manualFactor)||getFactor(i[r].scalingFactor);c.style.visibility="visible";d.style.visibility="hidden"}break;case"docPropertyType_AutoScaling":for(var r in i){var s=document.getElementById("docPropertyType_AutoScalingPerSg##"+r);if(s){s.checked=e.target.checked;var c=document.getElementById("docPropertyType_ManualFactor##"+r);var d=document.getElementById("docPropertyType_ScalingFactor##"+r);if(e.target.checked){Mt["b"].$(d).html(getFactor(i[r].scalingFactor));c.style.visibility="hidden";d.style.visibility="visible"}else{c.value=getFactor(i[r].manualFactor)||getFactor(i[r].scalingFactor);c.style.visibility="visible";d.style.visibility="hidden"}}}break}}function calculateStdLength(){var e=document.getElementById("hiddenDivDocuments");Mt["b"].$(e).html(h[0]);var t=e.clientWidth+1+y;v[0]=t;var i=document.createElement("td");var a=Mt["b"].Utils.DOM.createCheckBoxWithLabel(i,"","","","").checkBox;Mt["b"].$(e).html(a);var t=e.clientWidth+1+y;v[1]=t;Mt["b"].$(e).html(h[2]);var t=e.clientWidth+1+y;v[2]=t;var i=document.createElement("td");var a=Mt["b"].Utils.DOM.createCheckBoxWithLabel(i,"","","","").checkBox;Mt["b"].$(e).html(a);var t=e.clientWidth+1+y;v[3]=t;for(var n=0;n<D.length;n++){Mt["b"].$(e).html(D[n]);var t=e.clientWidth+1+y;b[n]=t}for(var n=0;n<N.length;n++){Mt["b"].$(e).html(N[n]);var t=e.clientWidth+1+y;B[n]=t}}function calculateColumnsLength(){var e=document.getElementById("hiddenDivDocuments");for(var t in S.scalingGroups.value){var i=S.scalingGroups.value[t];var a=document.createElement("td");var n=Mt["b"].Utils.DOM.createIconButton(a,"docPropertyType_columnsMinus##"+t,"","",F,pe["a"].imgPath+"delete_small.png",x.getTranslation("DELETE"));Mt["b"].$(e).html(n);var r=e.clientWidth+1+y;if(k[0]){k[0]=Math.max(r,b[0],B[0],k[0])}else{k[0]=Math.max(r,b[0],B[0])}Mt["b"].$(e).html(C.decode(t));var r=e.clientWidth+1+y;if(k[1]){k[1]=Math.max(r,b[1],B[1],k[1])}else{k[1]=Math.max(r,b[1],B[1])}var o=i.scalingFactor==null?"":i.scalingFactor.toFixed(3);Mt["b"].$(e).html(o);var r=e.clientWidth+1+y;if(r>83){r=83}if(k[2]){k[2]=Math.max(r,b[2],B[2],k[2])}else{k[2]=Math.max(r,b[2],B[2])}Mt["b"].$(e).html("");var r=e.clientWidth+1+y;if(k[3]){k[3]=Math.max(r,b[3],B[3],k[3])}else{k[3]=Math.max(r,b[3],B[3])}var l=o;if(i.manualFactor!=null){l=i.manualFactor.toFixed(3)}Mt["b"].$(e).html(l);var r=e.clientWidth+1+y;if(r>83){r=83}if(k[4]){k[4]=Math.max(r,b[4],B[4],k[4])}else{k[4]=Math.max(r,b[4],B[4])}}var s=k[0]+k[1]+k[2];var d=v[0]+v[1]+v[2];var c=d-s;k[1]+=c}function createScalingGroupTablePart1(){var e=document.createElement("div");e.setAttribute("id","GENERALScalingGroupDocumentPart1");Mt["b"].Utils.DOM.setStyle(e,{width:"100%",height:"auto"});var t=S.scalingGroups.value;var i=true;for(var a in t){if(!t[a].auto){i=false;break}}var n=document.createElement("table");Mt["b"].Utils.DOM.setStyle(n,{padding:"0",borderSpacing:y+"px"});var r=document.createElement("tr");var o=S.userSpecificScaling;var l=document.createElement("td");l.setAttribute("title",x.getTranslation("HELP_DOCSETTINGS_SCALINGGROUPS_USERSPECIFIC"));Mt["b"].$(l).html(x.getTranslation(o.name));Mt["b"].Utils.DOM.setStyle(l,{width:v[0]+"px",padding:"0"});r.appendChild(l);var l=document.createElement("td");Mt["b"].Utils.DOM.setStyle(l,{width:v[1]+"px",padding:0});var s=Mt["b"].Utils.DOM.createCheckBoxWithLabel(l,"docPropertyType_userSpecificScaling","","","").checkBox;l.setAttribute("title",x.getTranslation("HELP_DOCSETTINGS_SCALINGGROUPS_USERSPECIFIC"));Mt["b"].Utils.DOM.setStyle(s,{padding:0,margin:0});s.checked=o.value==="true";r.appendChild(l);var l=document.createElement("td");l.setAttribute("title",x.getTranslation("HELP_DOCSETTINGS_SCALINGGROUPS_ALLAUTO"));Mt["b"].$(l).html(x.getTranslation("AUTO_SCALING"));Mt["b"].Utils.DOM.setStyle(l,{width:v[2]+"px",padding:0});r.appendChild(l);var l=document.createElement("td");Mt["b"].Utils.DOM.setStyle(l,{width:k[3]+"px",textAlign:"center",padding:0});var s=Mt["b"].Utils.DOM.createCheckBoxWithLabel(l,"docPropertyType_AutoScaling","","","").checkBox;l.setAttribute("title",x.getTranslation("HELP_DOCSETTINGS_SCALINGGROUPS_ALLAUTO"));Mt["b"].Utils.DOM.setStyle(s,{padding:0,margin:0});Mt["b"].$(s).bind("click",function(e){documentHandler(e)});s.checked=i;r.appendChild(l);var l=document.createElement("td");var d=v[0]+v[1]+v[2]+v[3];var c=0;for(var u=0;u<k.length;u++){c+=k[u]}l.style.width=c-d+"px";r.appendChild(l);n.appendChild(r);e.appendChild(n);return e}function createScalingGroupTablePart2(){var e=document.createElement("div");e.setAttribute("id","GENERALScalingGroupDocumentPart2");Mt["b"].Utils.DOM.setStyle(e,{width:"100%",height:"auto"});var t=S.scalingGroups.value;var i=document.createElement("table");Mt["b"].Utils.DOM.setStyle(i,{padding:"0",borderSpacing:y+"px"});var a={whiteSpace:"nowrap",textAlign:"left",overflow:"hidden",fontWeight:"bold",padding:"0"};var n={whiteSpace:"nowrap",textAlign:"right",borderBottom:"1px solid black",fontWeight:"bold",padding:"0"};var r=document.createElement("tr");for(var o=0;o<I.length;o++){if(I[o]==""&&o!==0){continue}var l=document.createElement("td");var s=k[o];var d=1;for(var c=o+1;c<I.length;c++){if(I[c]==""){d++;s+=k[c]}else{break}}if(R[o]!==""){l.setAttribute("title",x.getTranslation(R[o]))}a.width=s+"px";a.minWidth=s+"px";Mt["b"].Utils.DOM.setStyle(l,a);if(d>1){l.setAttribute("colspan",d)}Mt["b"].$(l).html(D[o]);if(I[o]==="SCALING"){Mt["b"].Utils.DOM.setStyle(l,{borderBottom:"1px solid black"})}r.appendChild(l)}i.appendChild(r);var r=document.createElement("tr");for(var o=0;o<P.length;o++){var l=document.createElement("td");var s=k[o];n.width=s+"px";n.minWidth=s+"px";Mt["b"].Utils.DOM.setStyle(l,n);Mt["b"].$(l).html(N[o]);if(w[o]!==""){l.setAttribute("title",x.getTranslation(w[o]))}r.appendChild(l)}i.appendChild(r);for(var u in t){var p=t[u];var r=document.createElement("tr");r.setAttribute("id",u);var g="";if(p.manualFactor!=null){g=M.zoomFactor2cm(p.manualFactor).toFixed(3)}var l=document.createElement("td");Mt["b"].Utils.DOM.setStyle(l,{width:k[0]+"px",padding:"0"});var h=Mt["b"].Utils.DOM.createIconButton(l,"docPropertyType_columnsMinus##"+u,"","",F,pe["a"].imgPath+"delete_small.png",x.getTranslation("DELETE"));h.setAttribute("title",x.getTranslation("HELP_DOCSETTINGS_SCALINGHELPER_DELETE"));Mt["b"].Utils.DOM.setStyle(h,{padding:"0",margin:"0"});Mt["b"].$(h).bind("click",function(e){documentHandler(e)});r.appendChild(l);var l=document.createElement("td");Mt["b"].$(l).html(C.decode(u));l.setAttribute("title",x.getTranslation("HELP_DOCSETTINGS_SCALINGGROUPS_SCALINGGROUP"));Mt["b"].Utils.DOM.setStyle(l,{width:k[1]+"px",padding:"0"});r.appendChild(l);var l=document.createElement("td");var f=M.zoomFactor2cm(p.scalingFactor==null?"":p.scalingFactor).toFixed(3);var m=Mt["b"].Utils.DOM.createSpan(l,f,"docPropertyType_ScalingFactor##"+u);m.setAttribute("title",x.getTranslation("HELP_DOCSETTINGS_SCALINGGROUPS_FACTOR"));var v={width:k[2]+"px",maxWidth:"83px",padding:"0",display:"block",overflow:"hidden",textAlign:"right"};Mt["b"].Utils.DOM.setStyle(m,v);r.appendChild(l);var l=document.createElement("td");Mt["b"].Utils.DOM.setStyle(l,{width:k[3]+"px",padding:"0",textAlign:"center"});var b=Mt["b"].Utils.DOM.createCheckBoxWithLabel(l,"docPropertyType_AutoScalingPerSg##"+u,"","","").checkBox;b.setAttribute("title",x.getTranslation("HELP_DOCSETTINGS_SCALINGGROUPS_AUTO"));Mt["b"].Utils.DOM.setStyle(b,{padding:"0",marginLeft:"0",marginRight:"0"});if(t[u].auto||g===""){b.checked=true}Mt["b"].$(b).bind("click",function(e){documentHandler(e)});r.appendChild(l);l=document.createElement("td");Mt["b"].Utils.DOM.setStyle(l,{width:k[4]+"px",padding:"0"});var T=Mt["b"].Utils.DOM.createTextInputNoMax(l,"docPropertyType_ManualFactor##"+u,g,12,F);T.setAttribute("title",x.getTranslation("HELP_DOCSETTINGS_SCALINGGROUPS_MANUAL"));Mt["b"].Utils.DOM.setStyle(T,{padding:0,marginLeft:"0",marginRight:"0",textAlign:"right"});T.setAttribute("maxlength",30);r.appendChild(l);if(b.checked===true){T.style.visibility="hidden";m.style.visibility="visible"}else{T.style.visibility="visible";m.style.visibility="hidden"}i.appendChild(r)}e.appendChild(i);return e}function createScalingGroups(){calculateColumnsLength();var e=document.createElement("div");e.setAttribute("id","GENERALScalingGroupDocument");Mt["b"].Utils.DOM.setStyle(e,{height:L,overflow:"auto"});var t=document.createElement("table");var i=document.createElement("tr");var a=document.createElement("td");a.appendChild(createScalingGroupTablePart1());a.setAttribute("style","border-bottom: 1px solid black;");i.appendChild(a);t.appendChild(i);var i=document.createElement("tr");var a=document.createElement("td");a.appendChild(createScalingGroupTablePart2());i.appendChild(a);t.appendChild(i);e.appendChild(t);return e}function createScaling(t,e){var i;if(e){i=document.getElementById("GENERALScalingDocument");Mt["b"].$(i).empty()}else{i=document.createElement("div");i.setAttribute("id","GENERALScalingDocument");Mt["b"].Utils.DOM.setStyle(i,{width:"100%",height:L,overflow:"auto"})}var a=document.createElement("table");var n=document.createElement("tr");var r=document.createElement("tr");var o;var l=["SCALING_GROUP","VALUE","NUMBER","DELETE"];var s=["HELP_DOCSETTINGS_SCALINGHELPER_SCALINGGROUP","HELP_DOCSETTINGS_SCALINGHELPER_VALUE","HELP_DOCSETTINGS_SCALINGHELPER_NUMBER","HELP_DOCSETTINGS_SCALINGHELPER_DELETE"];for(var d=0;d<l.length;d++){o=document.createElement("td");Mt["b"].$(o).html(x.getTranslation(l[d]));o.setAttribute("title",x.getTranslation(s[d]));Mt["b"].Utils.DOM.setStyle(o,{fontWeight:"bold",margin:"0px",padding:"5px 0px 0px"});n.appendChild(o);o=document.createElement("td");var c=document.createElement("span");Mt["b"].Utils.DOM.setStyle(c,{margin:"0px"});var u=document.createElement("hr");Mt["b"].Utils.DOM.setStyle(u,{margin:"0px 0px 1px 0px",color:"#eeeeee",backgroundColor:"#eeeeee"});c.appendChild(u);o.appendChild(c);r.appendChild(o)}a.appendChild(n);a.appendChild(r);var p=S.scalingSettings.value;for(var g in p){var h=p[g];n=document.createElement("tr");o=document.createElement("td");Mt["b"].Utils.DOM.setStyle(o,{padding:"5px 10px 5px 0px"});var f=Mt["b"].Utils.DOM.createSpan(o,g===""?'""':C.decode(g),"");f.setAttribute("title",x.getTranslation(s[0]));f.style.fontSize=F;o.appendChild(f);n.appendChild(o);o=document.createElement("td");var m=C.decode(h.value);var v=Mt["b"].Utils.DOM.createTextInput(o,"docPropertyType_value_"+g,m,8,F);v.setAttribute("title",x.getTranslation(s[1]));v.setAttribute("maxlength","100");n.appendChild(o);o=document.createElement("td");var b=Mt["b"].Utils.DOM.createSelectBox(o,"docPropertyType_number_"+g,T,T,h.number,F);b.setAttribute("title",x.getTranslation(s[2]));n.appendChild(o);o=document.createElement("td");if(E[g]==undefined){var c=Mt["b"].Utils.DOM.createSpan(o,"-","docPropertyType_delete_"+g);c.setAttribute("title",x.getTranslation(s[3]));Mt["b"].$(c).hover(function(){Mt["b"].$(this).css("text-decoration","underline")},function(){Mt["b"].$(this).css("text-decoration","none")});Mt["b"].$(c).click(function(){var e=this.id.replace("docPropertyType_delete_","");delete p[e];createScaling(t,true)})}n.appendChild(o);a.appendChild(n)}i.appendChild(a);return i}function getLeastDecimalPosition(e){var t=0;var i,a;var n=1;do{i=e*n;a=Math.floor(i);if(a<i){t++}else{break}n*=10}while(true);return t}this.okay=function(){t.changeSelection();f.close()};this.apply=function(){t.changeSelection()};this.close=function(){f.close()};this.changeSelection=function(){var e=document.getElementById("docPropertyType_0");var t=e.value;e=document.getElementById("docPropertyType_1");var i=e.value;var a=document.getElementById("docPropertyType_2"),n=a.selectedIndex,r=O[n];e=document.getElementById("docPropertyType_5");var o=e.value;e=document.getElementById("docPropertyType_15");var l=e.value;e=document.getElementById("CHECK_ALLOW_USER_LANG");var s=e.checked.toString();e=document.getElementById("docPropertyType_documentMode");var d=_[e.selectedIndex];e=document.getElementById("docPropertyType_userSpecificScaling");var c=e.checked.toString();for(var u in S.scalingGroups.value){var p=document.getElementById("docPropertyType_AutoScalingPerSg##"+u);if(p!==null){S.scalingGroups.value[u]={auto:p.checked,scalingFactor:null,manualFactor:null};var g=S.scalingGroups.value[u];if(p.checked){}else{var h=document.getElementById("docPropertyType_ManualFactor##"+u).value;var f=parseFloat(h);if(!isNaN(f)){g.manualFactor=M.zoomFactor2cm(f);g.leastDecimalPosition=getLeastDecimalPosition(f)}else{g.auto=true;document.getElementById("docPropertyType_AutoScalingPerSg##"+u).checked=true;document.getElementById("docPropertyType_ScalingFactor##"+u).style.visibility="visible";document.getElementById("docPropertyType_ManualFactor##"+u).style.visibility="hidden"}}}}e=document.getElementById("CHECK_SHOW_UNLICENSED");var m=e.checked.toString();e=document.getElementById("DD_DATEFORMAT");var v=A[e.selectedIndex].translation;e=document.getElementById("DD_PAINT_TIMEOUT");var b=isNaN(parseFloat(e.value))?"0.2":e.value;e=document.getElementById("CHECK_PASTE_WITHOUT_FORMAT");var T=e.checked.toString();S.decimalSep.value=t;S.thousandSep.value=i;S.unitPosition.value=r;S.negativeStyle.value=o;S.docLanguage.value=l;S.userSpecific.value=s;S.showUnlicensed.value=m;S.documentMode.value=d;S.userSpecificScaling.value=c;S.dateFormat.value=v;S.paintTimeout.value=b;S.pasteWithoutFormat.value=T;var x=S.scalingSettings.value;for(var E in x){var y=document.getElementById("docPropertyType_value_"+E);if(y){x[E].value=C.encode(y.value)}y=document.getElementById("docPropertyType_number_"+E);if(y){x[E].number=y.value}}Mt["b"].Connector.ConnectorHelper.DocumentSettings_changeSelection();Mt["b"].DataObjects.DocumentDO.setDocSettings(S);Mt["b"].DataObjects.DocumentDO.getDocumentController().dispatch("updateDocument",{saveQVF:true,async:false});Mt["b"].DataObjects.RuntimeDO.updateRuntime(function(){var e=Mt["b"].DataObjects.DocumentDO.getAllExtensions();Mt["b"].DataObjects.DocumentDO.triggerDelayedRepaint();for(var t=0;t<e.length;t++){var i=e[t];i.getController().dispatch("createMenus",{extension:i})}Mt["b"].DataObjects.DocumentDO.getDocumentController().dispatch("updateScalingGroups",{type:"document"});for(var a in S.scalingGroups.value){var n=S.scalingGroups.value[a];if(n.auto&&n.scalingFactor!=null){var r=M.zoomFactor2cm(parseFloat(n.scalingFactor)).toFixed(3);Mt["b"].$(document.getElementById("docPropertyType_ScalingFactor##"+a)).html(r)}}})}};var At=i(724);Mt["b"].UI=Mt["b"].UI||{};Mt["b"].UI.FormulaEditor=function(n,b,e,t){var T=this;var C=Mt["b"].DataObjects.RuntimeDO;var x=Mt["b"].Utils.Constants.TypeValues.formulaEdit;var E=13;var y=null;var S=null;var M="";var O="";var A=null;var _=null;var L="10px";var I=new Mt["b"].Utils.Calculator(n);var D=["DIMENSION"];for(var i=0;i<n.rows.length;i++){var a=n.rows[i];if(e&&a.dimensionType==="dynamic"){for(var i=0;i<a.dynamicNames.length;i++){var r=a.dynamicNames[i];if(e.id!==r.id){D.push(r.displayId+"; "+I.invertNames(I.decode(r.name.replace(/\n/g," "))))}}}else{if(a.dimensionType==="drill"||a.dimensionType==="cyclic"){D.push(a.displayId);for(var o=0;o<a.groupMembers.length;o++){D.push(a.groupMembers[o].displayId+"; "+I.invertNames(I.decode(a.groupMembers[o].name.replace(/\n/g," "))))}}else{D.push(a.displayId+"; "+I.invertNames(I.decode(a.name.replace(/\n/g," "))))}}}var R=C.getTranslation("MEASURE");var P="-";var l=Mt["b"].Models.Actions.ModelActions.ContextModel.getContextExpressions(n);var N=[];if(b===x.CONDITION){if(t){N.push(C.getTranslation("THIS_COMP"))}for(var i=0;i<l.length;i++){N.push(l[i].displayId+"; "+I.invertNames(I.decode(l[i].name.replace(/\n/g," "))))}}if(b===x.APPLIES_TO){N.push("-");N.push("POSITION");N.push("FST");N.push("RST");N.push("TTL");R=C.getTranslation("TYPE")}var w=["+","-","*","/","**","(",")","%","%O"];var F=["<","<=","==",">=",">","AND","OR","$(OR:)","$(AND:)"];var B=["-","SUM","AVG","MIN","MAX"];var k=Mt["b"].DataObjects.DocumentDO.getBIVariables().map(function(e){return e.name.replace(/\n/g," ")});k.sort();T.open=function(e,t,i,a,n,r){n=n||null;var o=I.decode(e);e=I.invertNames(o);M=e;O=t;A=i;_=a;var r=r||C.getTranslation("EDIT_FORMULA");A.splice(0,0,"-");A.push("true");A.push("false");var l=[{text:C.getTranslation("OKAY"),title:C.getTranslation("HELP_FORMULA_OKAY"),click:T.okaySelection},{text:C.getTranslation("CANCEL"),title:C.getTranslation("HELP_FORMULA_OKAY"),click:T.cancelSelection}];var s=new Mt["b"].UI.HiCoDialogDefinition("formulaEditor",r,l);s.setWidth("615");if(n!==null){s.setPosition([n.x,n.y])}s.setResizable(false);s.setTooltip(C.getTranslation("HELP_FORMULA"));E=s.getFontSize();S=new Mt["b"].UI.HiCoDialog(s);y=S.getDialogDiv();S.setCSS();if(At["a"].detectIE()){Mt["b"].$(y).css("height","200px")}var d=document.createElement("div");Mt["b"].Utils.DOM.setStyle(d,{marginTop:"15px",height:"auto"});if(b!==x.QV_CONDITION){var c=document.createElement("div");Mt["b"].Utils.DOM.setStyle(c,{width:"120px",height:"18px",marginRight:L,border:"1px solid #808080",cssFloat:"left",position:"relative"});c.setAttribute("title",C.getTranslation("HELP_FORMULA_DIMENSION"));var u=Mt["b"].Utils.DOM.createTextInput(c,"dimensionText",C.getTranslation("DIMENSION"),14,E,undefined,500);u.setAttribute("readonly","readonly");Mt["b"].$(u).css("border","0px solid black");var p=Mt["b"].Utils.DOM.createIconButton(c,"dimensionTextButton","","",12,pe["a"].imgPath+"dropDown.ico");Mt["b"].$(p).css("background-color","#ffffff");Mt["b"].$(p).css("border","none");Mt["b"].$(p).css("padding","0px");Mt["b"].$(p).css("position","absolute");Mt["b"].$(p).css("right","0");Mt["b"].$(p).click(function(e){if(Mt["b"].$("#dimensionList").is(":visible")){Mt["b"].$("#dimensionList").hide()}else{Mt["b"].$("#dimensionList").show()}});var g=T.createListBox("dimensionList","dimensionText","120px","120px",D,"formula_insert_dimension");Mt["b"].$(g).hover(function(){},function(){if(Mt["b"].$("#dimensionList").is(":visible")){Mt["b"].$("#dimensionList").hide()}});c.appendChild(g);d.appendChild(c)}if(b===x.CONDITION){var c=document.createElement("div");Mt["b"].Utils.DOM.setStyle(c,{width:"55px",height:"18px",marginRight:L,border:"1px solid #808080",cssFloat:"left",position:"relative"});c.setAttribute("title",C.getTranslation("HELP_FORMULA_MEASURE_AGGREGATION"));var u=Mt["b"].Utils.DOM.createTextInput(c,"aggregationText",P,4,E,undefined);u.setAttribute("readonly","readonly");Mt["b"].$(u).css("border","0px solid black");var p=Mt["b"].Utils.DOM.createIconButton(c,"aggregationTextButton","","",12,pe["a"].imgPath+"dropDown.ico");Mt["b"].$(p).css("background-color","#ffffff");Mt["b"].$(p).css("border","none");Mt["b"].$(p).css("padding","0px");Mt["b"].$(p).css("position","absolute");Mt["b"].$(p).css("right","0");Mt["b"].$(p).click(function(e){if(Mt["b"].$("#aggregationList").is(":visible")){Mt["b"].$("#aggregationList").hide()}else{Mt["b"].$("#aggregationList").show()}});var g=T.createListBox("aggregationList","aggregationText","55px","90px",B,"formula_change_aggregation");Mt["b"].$(g).hover(function(){},function(){if(Mt["b"].$("#aggregationList").is(":visible")){Mt["b"].$("#aggregationList").hide()}});c.appendChild(g);d.appendChild(c)}if(b!==x.SORT_CONDITION&&b!==x.QV_CONDITION){var c=document.createElement("div");Mt["b"].Utils.DOM.setStyle(c,{width:"120px",height:"18px",marginRight:L,border:"1px solid #808080",cssFloat:"left",position:"relative"});c.setAttribute("title",b===x.CONDITION?C.getTranslation("HELP_FORMULA_MEASURE"):C.getTranslation("HELP_FORMULA_DIMENSION_AGGREGATION"));var u=Mt["b"].Utils.DOM.createTextInput(c,"keyfigureText",R,14,E,undefined,500);u.setAttribute("readonly","readonly");Mt["b"].$(u).css("border","0px solid black");p=Mt["b"].Utils.DOM.createIconButton(c,"keyfigureTextButton","","",12,pe["a"].imgPath+"dropDown.ico");Mt["b"].$(p).css("background-color","#ffffff");Mt["b"].$(p).css("border","none");Mt["b"].$(p).css("padding","0px");Mt["b"].$(p).css("position","absolute");Mt["b"].$(p).css("right","0");Mt["b"].$(p).click(function(e){if(Mt["b"].$("#keyfigureList").is(":visible")){Mt["b"].$("#keyfigureList").hide()}else{Mt["b"].$("#keyfigureList").show()}});var h=b===x.APPLIES_TO?"formula_change_keyfigure":"formula_insert_keyfigure";var g=T.createListBox("keyfigureList","keyfigureText","120px","120px",N,h);Mt["b"].$(g).hover(function(){},function(){if(Mt["b"].$("#keyfigureList").is(":visible")){Mt["b"].$("#keyfigureList").hide()}});c.appendChild(g);if(b===x.CONDITION){d.appendChild(c)}else{d.insertBefore(c,d.childNodes[d.childNodes.length-1])}}var c=document.createElement("div");Mt["b"].Utils.DOM.setStyle(c,{width:"75px",height:"18px",marginRight:L,border:"1px solid #808080",cssFloat:"left",position:"relative"});c.setAttribute("title",C.getTranslation("HELP_FORMULA_OPERATOR"));var u=Mt["b"].Utils.DOM.createTextInput(c,"operatorText",C.getTranslation("OPERATOR"),7,E,undefined,500);u.setAttribute("readonly","readonly");Mt["b"].$(u).css("border","0px solid black");var p=Mt["b"].Utils.DOM.createIconButton(c,"operatorTextButton","","",12,pe["a"].imgPath+"dropDown.ico");Mt["b"].$(p).css("background-color","#ffffff");Mt["b"].$(p).css("border","none");Mt["b"].$(p).css("padding","0px");Mt["b"].$(p).css("position","absolute");Mt["b"].$(p).css("right","0");Mt["b"].$(p).click(function(e){if(Mt["b"].$("#operatorList").is(":visible")){Mt["b"].$("#operatorList").hide()}else{Mt["b"].$("#operatorList").show()}});var g=T.createListBox("operatorList","operatorText","75px","120px",w,"formula_insert_operator");Mt["b"].$(g).hover(function(){},function(){if(Mt["b"].$("#operatorList").is(":visible")){Mt["b"].$("#operatorList").hide()}});c.appendChild(g);d.appendChild(c);c=document.createElement("div");Mt["b"].Utils.DOM.setStyle(c,{width:"55px",height:"18px",marginRight:L,border:"1px solid #808080",cssFloat:"left",position:"relative"});c.setAttribute("title",C.getTranslation("HELP_FORMULA_BOOLEAN"));u=Mt["b"].Utils.DOM.createTextInput(c,"boolText",C.getTranslation("BOOL"),4,E);u.setAttribute("readonly","readonly");u.setAttribute("maxlength",500);Mt["b"].$(u).css("border","0px solid black");p=Mt["b"].Utils.DOM.createIconButton(c,"boolTextButton","","",12,pe["a"].imgPath+"dropDown.ico");Mt["b"].$(p).css("background-color","#ffffff");Mt["b"].$(p).css("border","none");Mt["b"].$(p).css("padding","0px");Mt["b"].$(p).css("position","absolute");Mt["b"].$(p).css("right","0");Mt["b"].$(p).click(function(e){if(Mt["b"].$("#boolList").is(":visible")){Mt["b"].$("#boolList").hide()}else{Mt["b"].$("#boolList").show()}});g=T.createListBox("boolList","boolText","55px","120px",F,"formula_insert_bool");Mt["b"].$(g).hover(function(){},function(){if(Mt["b"].$("#boolList").is(":visible")){Mt["b"].$("#boolList").hide()}});c.appendChild(g);d.appendChild(c);c=document.createElement("div");Mt["b"].Utils.DOM.setStyle(c,{width:"120px",height:"18px",border:"1px solid #808080",cssFloat:"left",position:"relative"});c.setAttribute("title",C.getTranslation("HELP_FORMULA_VARIABLE"));u=Mt["b"].Utils.DOM.createTextInput(c,"variableText","Variable",12,E,undefined,500);u.setAttribute("readonly","readonly");Mt["b"].$(u).css("border","0px solid black");p=Mt["b"].Utils.DOM.createIconButton(c,"variableTextButton","","",5,pe["a"].imgPath+"dropDown.ico");Mt["b"].$(p).css("background-color","#ffffff");Mt["b"].$(p).css("border","none");Mt["b"].$(p).css("padding","0px");Mt["b"].$(p).css("position","absolute");Mt["b"].$(p).css("right","0");Mt["b"].$(p).click(function(e){if(Mt["b"].$("#variableList").is(":visible")){Mt["b"].$("#variableList").hide()}else{Mt["b"].$("#variableList").show()}});var f=T.createListBox("variableList","variableText","120px","120px",k,"formula_insert_variable");Mt["b"].$(f).hover(function(){},function(){if(Mt["b"].$("#variableList").is(":visible")){Mt["b"].$("#variableList").hide()}});c.appendChild(f);d.appendChild(c);y.appendChild(d);var m=document.createElement("span");m.innerHTML='<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">';y.appendChild(m);var v=document.createElement("textarea");v.style.fontSize=E;v.setAttribute("id","selectedFEFormula");Mt["b"].Utils.DOM.setStyle(v,{overflow:"auto"});v.setAttribute("rows","10");v.setAttribute("cols","115");v.value=e;v.style.border="0px solid black";v.style.resize="none";v.style.width="99%";v.setAttribute("title",C.getTranslation("HELP_FORMULA_TERM"));Mt["b"].$(v).keydown(function(e){if(this.value==="edit formula"){this.value=""}});y.appendChild(v)};T.close=function(){S.close()};T.okaySelection=function(){var e=document.getElementById("selectedFEFormula");M=e.value;var t=new Mt["b"].Utils.Calculator(n);var i=t.encode(M);var a={formula:i,compiledFormula:null};if(t.checkFormulaCFM(a)===false){alert(C.getTranslation("ALERT_CHECK_FORMULA")+t.lastCheckError);return}_.setValuesFromFormulaEditorCFM(a,O);T.close()};T.cancelSelection=function(){T.close()};T.createListBox=function(a,n,e,t,r,o){var i=document.createElement("div");Mt["b"].$(i).css("position","absolute");Mt["b"].Utils.DOM.setStyle(i,{overflow:"auto",width:e,height:t});Mt["b"].$(i).css("border","1px solid #808080");Mt["b"].$(i).css("background-color","#ffffff");i.setAttribute("id",a);Mt["b"].$(i).hide();var l=document.createElement("ul");Mt["b"].$(l).css("list-style-type","none");Mt["b"].$(l).css("padding","0px");Mt["b"].$(l).css("margin","0px");for(var s=0;s<r.length;s++){var d=document.createElement("li");Mt["b"].$(d).html(r[s]);d.setAttribute("arrayIdx",s);Mt["b"].Utils.DOM.setStyle(d,{width:"100%"});Mt["b"].$(d).css("clear","left");Mt["b"].$(d).css("float","left");Mt["b"].$(d).css("padding","0px");Mt["b"].$(d).css("margin","0px");Mt["b"].$(d).click(function(e){var t=parseInt(e.currentTarget.getAttribute("arrayIdx"));var i=r[t];document.getElementById(n).value=i;Mt["b"].$("#"+a).hide();T.formulaHandlerFE({target:{id:o}})});Mt["b"].$(d).hover(function(){Mt["b"].$(this).css("cursor","default");Mt["b"].$(this).css("background-color","#eeeeee")},function(){Mt["b"].$(this).css("cursor","auto");Mt["b"].$(this).css("background-color","#ffffff")});l.appendChild(d)}i.appendChild(l);return i};T.formulaHandlerFE=function(e){var t=e.target.id;if(t==="formula_change_aggregation"){return}if(t==="formula_change_keyfigure"){var i=document.getElementById("dimensionList");var a=document.getElementById("keyfigureText");if(a.value!=="-"){var n=i.childNodes[0];for(var r=0;r<n.children.length;r++){if(n.children[r].textContent.indexOf(";")>-1){var o=n.children[r].textContent.split(";");o=o[0].replace("D","");o=o.split("");o=o[2]+o[3];if(o!=="00"){n.children[r].hidden=true}}}}else{var n=i.childNodes[0];for(var r=0;r<n.children.length;r++){if(n.children[r].textContent.indexOf(";")>-1){n.children[r].hidden=false}}}return}var a=null;a=document.getElementById("selectedFEFormula");var l=0;var s=0;if(At["a"].detectIE()!==false){var d=getInputSelection(a);l=d.start;s=d.end}else{l=a.selectionStart;s=a.selectionEnd}var c=a.value;var u="";var p="";var u="";if(l>0){u=c.substr(0,l)}var p="";if(s<c.length){p=c.substr(s)}if(c===C.getTranslation("EDIT_FORMULA")){u="";p=""}var g="";if(t==="formula_insert_dimension"){var h=document.getElementById("dimensionText").value;if(h==="true"||h==="false"){g=u+h+p}else{var f="";var m=document.getElementById("keyfigureText").value;if(m==="POSITION"||m==="FST"||m==="RST"||m==="TTL"){if(m!=="-"){f=m}var v=h.split("; ");var b=v[1];var T=v[0]}if(f!==""){if(b===undefined){g=u+"$("+T+","+f+")"+p}else{g=u+"$("+T+","+f+"; "+b+")"+p}}else{g=u+"$("+h+")"+p}}}if(t==="formula_insert_keyfigure"){var h=document.getElementById("keyfigureText").value;var v=h.split("; ");var b=v[1];var T=v[0];var x="";var E=document.getElementById("aggregationText").value;if(E!=="-"){x=E}if(h==="true"||h==="false"){g=u+h+p}else{if(x!==""){g=u+"$("+v[0]+","+x+"; "+v[1]+")"+p}else{g=u+"$("+h+")"+p}}}if(t==="formula_insert_operator"){var h=document.getElementById("operatorText").value;g=u+h+p}if(t==="formula_insert_bool"){var h=document.getElementById("boolText").value;g=u+h+p}if(t==="formula_insert_variable"){var h=document.getElementById("variableText").value.split(": ").pop();g=u+"$("+h+")"+p}a.value=g;var y=g.length-p.length;a.selectionStart=y;a.selectionEnd=y;function getInputSelection(e){e.focus();var t=0,i=0,a,n,r,o,l;if(typeof e.selectionStart=="number"&&typeof e.selectionEnd=="number"){t=e.selectionStart;i=e.selectionEnd}else{n=document.selection.createRange();if(n&&n.parentElement()==e){o=e.value.length;a=e.value.replace(/\r\n/g,"\n");r=e.createTextRange();r.moveToBookmark(n.getBookmark());l=e.createTextRange();l.collapse(false);if(r.compareEndPoints("StartToEnd",l)>-1){t=i=o}else{t=-r.moveStart("character",-o);t+=a.slice(0,t).split("\n").length-1;if(r.compareEndPoints("EndToEnd",l)>-1){i=o}else{i=-r.moveEnd("character",-o);i+=a.slice(0,i).split("\n").length-1}}}}return{start:t,end:i}}}};Mt["b"].UI=Mt["b"].UI||{};Mt["b"].UI.HiCoDialog=function(e){var T=this;var t=e.getId();var i=e.getTitle();var y=e.getFontSize();var a=e.getButtonsBar();var r=null;var o=null;var n=e.getParentDomElement();if(n===null){var n=getDomElement()}var l=e.getPosition();if(l===null){l=Mt["b"].$(n).offset();l=[l.left,l.top]}var x=document.createElement("div");x.setAttribute("id",t);x.setAttribute("title",i);x.style.fontSize=y;n.appendChild(x);var u=null;var s=Mt["b"].$(x).dialog({buttons:a,position:l,height:e.getHeight(),width:e.getWidth(),modal:e.getModal(),resizable:e.getResizable(),closeOnEscape:e.getCloseOnEscape(),autoOpen:e.getAutoOpen()});s.parents(".ui-dialog:eq(0)").wrap('<div class="HiCo hico-lui hico-fa"></div>');var d=e.getOptions();if(d!=null){for(var c in d){s.dialog("options",c,d[c])}}if(e.getTooltip()){Mt["b"].$(x).parent().children(".ui-dialog-titlebar").attr("title",e.getTooltip())}this.getDialog=function(){return s};this.getDialogDiv=function(){return x};this.getTitle=function(){return x.getAttribute("title")};this.setEscapeBeforeHandler=function(e){r=e};this.setEscapeAfterHandler=function(e){o=e};this.setTitle=function(e){x.setAttribute("title",e)};this.getId=function(){return x.getAttribute("id")};this.setId=function(e){x.setAttribute("id",e)};this.getButtons=function(){return s.dialog("option","buttons")};this.setButtons=function(e){s.dialog("option","buttons",e)};this.deleteButton=function(e){var t=s.dialog("option","buttons");for(var i=0;i<t.length;i++){if(t[i].text===e.text){t.splice(i,1);break}}s.dialog("option","buttons",t)};this.addButton=function(e){var t=s.dialog("option","buttons");t.push(e);s.dialog("option","buttons",t)};this.getOption=function(e){return s.dialog("option",e)};this.setOption=function(e,t){s.dialog("option",e,t)};this.getEvent=function(e){s.dialog("option",e)};this.setEvent=function(e,t){s.bind(e,t)};this.visibility=function(e){if(e==="hidden"){s.dialog("close")}else if(e==="visible"){var t=Mt["b"].$(s).height();s.dialog("open");Mt["b"].$(s).height(t)}};this.createTab=function(e,t,i){var a=document.createElement("div");a.setAttribute("id",e);this.buildTabs(t,i,a,"auto",{top:"0px",left:"0px"},{select:function(e,t){T.decorateTabs(t.index,i,null)}},true);return a};this.createSection=function(e,t,i){if(t!==null){var a=document.createElement("tr");var n=document.createElement("td");n.style.fontWeight="bold";Mt["b"].$(n).css("margin","0px");Mt["b"].$(n).css("padding","5px 0px 0px 0px");Mt["b"].$(n).html(t);if(i!==undefined&&i!==null){n.setAttribute("title",i)}a.appendChild(n);e.appendChild(a)}var r=document.createElement("tr");for(var o=0;o<2;o++){var l=document.createElement("span");l.style.margin="0px";Mt["b"].$(l).html('<hr style="margin:0px 0px 1px 0px; color:#eeeeee; background-color:#eeeeee">');n=document.createElement("td");Mt["b"].$(n).css("height","1px");n.appendChild(l);Mt["b"].$(n).css("margin","0px");Mt["b"].$(n).css("padding","1px 0px 0px 0px");n.setAttribute("valign","top");r.appendChild(n)}e.appendChild(r)};this.buildSingleTab=function(e,t,i,a,n,r){var o=document.getElementById(e);Mt["b"].$(o).tabs("add","#"+t,i);var l=document.getElementById(t);l.style.fontSize=y;l.style.height=n;l.setAttribute("id",t);l.style.border="none";l.style.marginLeft=r.left;l.style.marginTop=r.top;var s=a;if(s!==null){var d=s(t);l.appendChild(d)}var c=Mt["b"].$("a[href=#"+t+"]");Mt["b"].$(c).attr("id","a-"+t);var u=document.getElementById("a-"+t);u.style.textDecoration="none";u.style.fontWeight="normal";u.style.color="#000000";u.style.overflow="auto";var p=Mt["b"].$(u).parent();p.attr("id","XXX-TAB-"+t)};this.buildTabs=function(e,i,t,a,n,r,o,l){var s=document.createElement("div");s.style.fontSize=y;s.setAttribute("id",e);var d="";if(l!==undefined){d="_"+l}if(o){var c=document.createElement("ul");for(var u=0;u<i.length;u++){var p=i[u];var g=document.createElement("li");if(p.hidden===true){g.style.display="none"}var h=p.tooltip?' title="'+p.tooltip.replace(/"/g,"&#34")+'"':"";Mt["b"].$(g).html('<a id="a-'+p.id+d+'" href="#'+p.id+d+'"'+h+">"+p.text+"</a>");c.appendChild(g)}s.appendChild(c)}for(var f=0;f<i.length;f++){var m=document.createElement("div");m.style.fontSize=y;if(a!=""){m.style.height=a}m.setAttribute("id",i[f].id+d);m.style.border="none";m.style.marginLeft=n.left;m.style.marginTop=n.top;var v=i[f].buildUp;if(v!==null){var b=v(i[f].id+d);m.appendChild(b)}s.appendChild(m)}t=t||x;t.appendChild(s);if(r===null){r={select:function(e,t){T.decorateTabs(t.index,i,l)}}}Mt["b"].$(s).tabs(r).height("100%");return s};this.dataTypeTabs=function(e,i,t,a,n,r,o,l){if(n===undefined){var n={top:"0px",left:"0px"}}var s=document.createElement("div");s.style.fontSize=y;s.setAttribute("id",e);var d="";if(l!==undefined){d="_"+l}for(var c=0;c<i.length;c++){var u=document.createElement("div");u.style.fontSize=y;if(a!=""){u.style.height=a}u.setAttribute("id",i[c].id+d);u.style.border="none";u.style.marginLeft=n.left;u.style.marginTop=n.top;var p=i[c].buildUp;if(p!==null){var g=p(i[c].id+d);u.appendChild(g)}s.appendChild(g)}t=t||x;t.appendChild(s);if(r===null){r={select:function(e,t){T.decorateTabs(t.index,i,l)}}}Mt["b"].$(s).tabs(r).height("100%");return s};this.decorateTabs=function(e,t,i){var a="";if(i!==null&&i!==undefined){a="_"+i}for(var n=0;n<t.length;n++){var r=document.getElementById("a-"+t[n].id+a);if(n===e){r.style.textDecoration="underline";r.style.fontWeight="bold"}else{r.style.textDecoration="none";r.style.fontWeight="normal"}r.style.color="#000000";r.style.overflow="auto"}};this.createTableRow=function(e,t,i,a,n,r){var o=document.createElement("tr");var l=document.createElement("td");var s=Mt["b"].Utils.DOM.createSpan(l,i,"");if(r!==undefined&&r!==null){s.setAttribute("title",r)}s.style.fontSize=y;if(a.style){Mt["b"].Utils.DOM.setStyle(s,a.style)}if(a.textAlign){l.style.textAlign=a.textAlign}Mt["b"].$(l).css("padding","5px 10px 05px 0px");o.appendChild(l);var d=document.createElement("td");if(a.colSpan){d.colSpan=a.colSpan}if(n==="textInput"){var c=a.text;var u=6;if(a.length!==undefined&&a.length!==null){u=a.length}var p=Mt["b"].Utils.DOM.createTextInput(d,t,c,u,y);if(a.maxLength!==undefined){p.setAttribute("maxlength",a.maxLength)}else{p.setAttribute("maxlength","100")}if(a.width){p.style.width=a.width+"px"}if(a.style){Mt["b"].Utils.DOM.setStyle(d,a.style)}if(a.inputStyle){Mt["b"].Utils.DOM.setStyle(p,a.inputStyle)}p.setAttribute("mmppt",a.labelText);p.style.textAlign="right";var g=document.createElement("label");g.setAttribute("for",t);Mt["b"].$(g).html(a.labelText);if(a.change!==undefined){Mt["b"].$(p).on("change",a.change)}if(a.keydown!==undefined){Mt["b"].$(p).on("keydown",a.keydown)}d.appendChild(g)}else if(n==="rgbDiv"){var p=document.createElement("div");p.setAttribute("id",t);if(Mt["b"].$.browser.msie&&Mt["b"].$.browser.version<9){Mt["b"].Utils.DOM.setStyle(p,{height:"12px",width:"12px",minHeight:"12px",minWidth:"12px",background:a,backgroundColor:a,border:"1px solid #aaaaaa"})}else{Mt["b"].Utils.DOM.setStyle(p,{height:"12px",width:"12px",minHeight:"12px",minWidth:"12px",backgroundColor:a,border:"1px solid #aaaaaa"})}Mt["b"].$(p).on("click",function(){Mt["b"].UI.ColorPicker.createColorPicker(t,false)});d.appendChild(p)}else if(n==="checkBox"){var p=document.createElement("input");p.setAttribute("type","checkbox");Mt["b"].$(p).css("padding","2px 2px 0px 0px");Mt["b"].$(p).css("margin","0px 0px 0px 0px");p.setAttribute("id",t);var h=a.value!==undefined?a.value:a;if(h==="true"||h===true){Mt["b"].$(p).attr("checked",true);p.setAttribute("value","true")}else{Mt["b"].$(p).attr("checked",false);p.setAttribute("value","false")}d.appendChild(p)}else if(n==="dropdown"){var p=document.createElement("select");p.setAttribute("size","1");p.style.fontSize=y;p.setAttribute("id",t);Mt["b"].$(p).attr("class",a.clazz);var f=a.valueArray;var m=a.selectedValue;for(var v=0;v<f.length;v++){var b=document.createElement("option");Mt["b"].$(b).html(f[v].translation);if(f[v].id==="normal"){}else if(f[v].id==="fat"){b.style.fontWeight="bold"}else if(f[v].id==="italic"){b.style.fontStyle="italic"}else if(f[v].id==="fatAndItalic"){b.style.fontStyle="italic";b.style.fontWeight="bold"}if(f[v].translation.toUpperCase()===m.toUpperCase()){b.setAttribute("selected","selected")}p.appendChild(b)}if(a.style){Mt["b"].Utils.DOM.setStyle(d,a.style)}d.appendChild(p)}o.appendChild(d);e.appendChild(o);if(r!==undefined&&r!==null){if(p!==undefined&&p!==null){p.setAttribute("title",r)}}return o};this.createItem=function(e,t,i,a,n,r,o){if(n===true){var l=document.createElement("div")}else{var l=e}if(a==="textInput"){var s=i.text;var d=i.length;var c=i.fontSize||y;var u=Mt["b"].Utils.DOM.createTextInput(l,t,s,d,c);if(i.maxLength!==undefined){u.setAttribute("maxlength",i.maxLength)}else{u.setAttribute("maxlength","100")}u.style.textAlign="right";u.style.backgroundColor="rgb(240, 240, 240)";u.style.border="0px";if(i.width){u.style.width=i.width+"px"}u.setAttribute("mmppt",i.labelText);if(i.labelText!==undefined){var p=document.createElement("label");p.setAttribute("for",t);Mt["b"].$(p).html(i.labelText)}l.appendChild(p)}else if(a==="rgbDiv"){var u=document.createElement("div");u.setAttribute("id",t);if(Mt["b"].$.browser.msie&&Mt["b"].$.browser.version<9){Mt["b"].Utils.DOM.setStyle(u,{height:"12px",width:"12px",minHeight:"12px",minWidth:"12px","margin-left":"auto","margin-right":"auto",background:i,backgroundColor:i,border:"1px solid #aaaaaa"})}else{if(i===undefined){i="RGB(100,100,100)"}var g={height:"12px",minHeight:"12px",width:"12px",minWidth:"12px",marginLeft:"auto",marginRight:"auto",backgroundColor:i,border:"1px solid #aaaaaa"};if(o){g.marginLeft="";g.marginRight=""}Mt["b"].Utils.DOM.setStyle(u,g)}Mt["b"].$(u).on("click",function(){Mt["b"].UI.ColorPicker.createColorPicker(t,false)});l.appendChild(u)}else if(a==="checkBox"){var u=document.createElement("input");u.setAttribute("type","checkbox");Mt["b"].$(u).css("padding","2px 2px 0px 0px");Mt["b"].$(u).css("margin","0px 0px 0px 0px");u.setAttribute("id",t);u.setAttribute("value","north");if(i==="true"||i===true){Mt["b"].$(u).attr("checked",true)}else{Mt["b"].$(u).attr("checked",false)}l.appendChild(u)}else if(a==="dropdown"){var u=document.createElement("select");u.setAttribute("size","1");u.style.fontSize=y;u.setAttribute("id",t);Mt["b"].$(u).attr("class",i.clazz);var h=i.valueArray;var f=i.selectedValue;for(var m=0;m<h.length;m++){var v=document.createElement("option");var b=r?h[m]:h[m].translation;Mt["b"].$(v).html(b);if(f!==undefined){if(b.toUpperCase()===f.toUpperCase()){v.setAttribute("selected","selected")}}u.appendChild(v)}l.appendChild(u)}else if(a==="icon"){var c=i.fontSize||y;var T=pe["a"].imgPath+i.src;var x=Mt["b"].Utils.DOM.createIconButton(l,t,"","",c,T,i.tooltip);var g={width:10+"px",height:10+"px",padding:0+"px "+2+"px"};var E="";if(i.selectedValue.indexOf(i.clazz)>-1){E="active"}else{E="opClass"}if(i.style){g=i.style}l.style.textAlign="left";Mt["b"].Utils.DOM.setStyle(x,g);x.className=i.mainClazz+" "+E;x.setAttribute("subType",i.clazz);if(i.callback){Mt["b"].$(x).on("click",function(e){i.callback(e)})}}if(n===true){e.appendChild(l)}return l};this.createLabel=function(e,t,i){Mt["b"].$(e).html(t);e.setAttribute("valign","top");if(i===true){e.style.whiteSpace="nowrap"}};this.buildTableRow=function(e,t){var u=document.createElement("tr");t.forEach(function(e,t,i){var a=document.createElement("td");if(e.colSpan!==undefined){a.setAttribute("colspan",e.colSpan)}if(e.visible!==undefined){a.style.display=e.visible?"block":"none"}var n=null;switch(e.type){case"text":n=Mt["b"].Utils.DOM.createSpan(a,e.value,e.id!==undefined?e.id:null);break;case"selectbox":n=Mt["b"].Utils.DOM.createSelectBox(a,e.id,e.values,e.translations,e.value,y,e.width);break;case"textinput":n=Mt["b"].Utils.DOM.createTextInputNoMax(a,e.id,e.value,e.length,y);if(e.maxLength!=undefined){n.setAttribute("maxlength",e.maxLength.toString())}break;case"checkbox":n=Mt["b"].Utils.DOM.createCheckBox(a,e.id,e.checked,e.value,e.group,e.disabled);break;case"button":n=Mt["b"].Utils.DOM.createButtonInput(a,e.id,e.name||"",e.value,y,e.style);break;case"iconbutton":a.style.textAlign="center";n=Mt["b"].Utils.DOM.createIconButton(a,e.id,e.name||"",e.value||"",y,pe["a"].imgPath+e.iconName,e.tooltip||"",e.style);break;case"rgbdiv":n=document.createElement("div");n.setAttribute("id",e.id);var r="12px";var o="1px solid #aaaaaa";var l="";if(e.withNotationCheckbox){if(e.notationColor){r="16px";o="0px none";l="url('"+pe["a"].imgPath+"notation.png')"}else{l="none"}}Mt["b"].Utils.DOM.setStyle(n,{height:r,width:r,minHeight:r,minWidth:r,backgroundColor:e.color,backgroundImage:l,border:o});Mt["b"].$(n).on("click",function(){Mt["b"].UI.ColorPicker.createColorPicker(e.id,false,e.callback,undefined,e.withNotationCheckbox)});a.appendChild(n);break;case"div":n=document.createElement("div");n.setAttribute("id",e.id);a.appendChild(n);break;case"formulainput":n=buildFormulaInput(a,e);break;case"iconselector":buildIconSelector(a,e);break;case"separator":n=document.createElement("span");n.style.margin="0px";var s=e.color||"#eeeeee";n.innerHTML='<hr style="margin:0px 0px 1px 0px; color:'+s+"; background-color:"+s+'">';a.appendChild(n);break;case"icon":n=document.createElement("img");n.setAttribute("id",e.id?e.id:"");n.setAttribute("src",pe["a"].imgPath+e.iconName);n.setAttribute("alt",e.value);a.appendChild(n);break;case"append":n=e.element;a.appendChild(n);break;case"radio":n=document.createElement("input");n.setAttribute("type","radio");n.setAttribute("id",e.id);n.setAttribute("name",e.group);if(e.checked){n.setAttribute("checked",true)}a.appendChild(n);break;case"combobox":var d=Mt["b"].Utils.DOM.createComboBoxNativeFake(a,e.id,e.length,e.width,e.values,e.value,y,null,null,null);n=d.childNodes[0];break;case"empty":default:break}if(n&&e.attributes){for(var c in e.attributes){e.attributes.hasOwnProperty(c)&&n.setAttribute(c,e.attributes[c])}}if(n&&e.style){Mt["b"].Utils.DOM.setStyle(n,e.style)}if(n&&e.tooltip!=undefined){n.setAttribute("title",e.tooltip)}if(n&&e.active!=undefined&&e.active===false){Mt["b"].$(n).addClass("cellOpClass")}if(n&&e.disabled){n.setAttribute("disabled","disabled")}if(n&&e.click){Mt["b"].$(n).click(e.click)}if(n&&e.keydown){Mt["b"].$(n).keydown(e.keydown)}if(n&&e.change){Mt["b"].$(n).change(e.change)}if(n&&e.focusIn){Mt["b"].$(n).focus(e.focusIn)}if(n&&e.focusOut){Mt["b"].$(n).focusout(e.focusOut)}if(n&&e.hover){Mt["b"].$(n).hover(e.hover["in"],e.hover["out"])}if(e.tdStyle){Mt["b"].Utils.DOM.setStyle(a,e.tdStyle)}u.appendChild(a)});e.appendChild(u);return u};function buildFormulaInput(e,a){var n=a.context;var r=a.calculator;var o=a.callerObject;var l=a.callerDivOffset;var s=a.formulaObject;var d=a.formulaEditorType||Mt["b"].Utils.Constants.TypeValues.formulaEdit.QV_CONDITION;var c=a.formulaTitle;var t=Mt["b"].Utils.DOM.createTextInputNoMax(e,a.id,r.invertNames(r.decode(s.formula)),20,y);Mt["b"].$(t).keydown(function(e){if(e.which===13){var t=r.encode(this.value);var i={formula:t,compiledFormula:null};if(r.checkFormulaCFM(i)===false){this.style.color="#FF0000"}else{s.formula=i.formula;s.compiledFormula=i.compiledFormula;Mt["b"].$(this).blur()}}});Mt["b"].$(t).focus(function(e){this.style.color="#5555FF"});Mt["b"].$(t).focusout(function(e){this.style.color="#000000";this.value=r.invertNames(r.decode(s.formula))});var i=Mt["b"].Utils.DOM.createButtonInput(e,a.buttonId,"","fx",y);i.style.marginLeft="3px";Mt["b"].$(i).click(function(e){var t=document.getElementById("formulaEditor");if(t!==null){return}u=new Mt["b"].UI.FormulaEditor(n,d);var i=r.invertNames(r.decode(s.formula));u.open(i,a.formulaEditorId,[],o,{x:l.left+20,y:l.top+20},c)});return t}function buildIconSelector(e,t){var i=t.values;for(var a=0;a<i.length;a++){var n=i[a];var r=n.inactiveIcon;if(t.value===n.value&&n.activeIcon){r=n.activeIcon}var o=Mt["b"].Utils.DOM.createIconButton(e,n.id,"","",y,pe["a"].imgPath+r,n.tooltip);Mt["b"].$(o).click(t.click);if(n.clazz){Mt["b"].$(o).addClass(n.clazz)}}}this.setCSS=function(){if(arguments.length>0){s.css.apply(s,arguments)}else{Mt["b"].$("a.ui-dialog-titlebar-close",Mt["b"].$(x).parent()).remove();Mt["b"].$(".ui-dialog-buttonpane",Mt["b"].$(x).parent()).css("text-align","left");Mt["b"].$(".ui-dialog-buttonset",Mt["b"].$(x).parent()).css("float","none");Mt["b"].$(".ui-dialog",Mt["b"].$(x).parent()).css("background","none");Mt["b"].$(".ui-widget",Mt["b"].$(x).parent()).css("background","none");Mt["b"].$(".ui-tabs",Mt["b"].$(x).parent()).css("background","none");Mt["b"].$(".ui-tabs-nav",Mt["b"].$(x).parent()).css("background","none");Mt["b"].$("a.ui-tabs-nav",Mt["b"].$(x).parent()).css("background","none");Mt["b"].$(".ui-tabs-panel",Mt["b"].$(x).parent()).css("background","none");Mt["b"].$(".ui-state-default",Mt["b"].$(x).parent()).css("background","#ffffff");Mt["b"].$(".ui-state-active",Mt["b"].$(x).parent()).css("background","#ffffff");Mt["b"].$(".ui-tabs-selected",Mt["b"].$(x).parent()).css("background","#ffffff");Mt["b"].$(Mt["b"].$(x).parent()).css("background","#ffffff");Mt["b"].$(x).css("background","#ffffff");Mt["b"].$(".ui-dialog",Mt["b"].$(x).parent()).css("background-color","#ffffff");Mt["b"].$(".ui-widget",Mt["b"].$(x).parent()).css("background-color","#ffffff");Mt["b"].$(".ui-draggable",Mt["b"].$(x).parent()).css("background-color","#ffffff");Mt["b"].$(".ui-widget-content",Mt["b"].$(x).parent()).css("background-color","#ffffff");Mt["b"].$(".ui-widget-header",Mt["b"].$(x).parent()).css("background-color","#ffffff");Mt["b"].$(".ui-tabs",Mt["b"].$(x).parent()).css("background-color","#ffffff");Mt["b"].$(".ui-tabs-panel",Mt["b"].$(x).parent()).css("background-color","#ffffff");Mt["b"].$(".ui-helper-clearfix",Mt["b"].$(x).parent()).css("background-color","#ffffff");Mt["b"].$(".ui-corner-all",Mt["b"].$(x).parent()).css("background-color","#ffffff");Mt["b"].$(".ui-dialog-titlebar",Mt["b"].$(x).parent()).css("background-color","#f9f9f9");Mt["b"].$(".ui-widget-header",Mt["b"].$(x).parent()).css("border","0px solid black");Mt["b"].$(".ui-tabs-panel",Mt["b"].$(x).parent()).css("border","1px solid #aaaaaa");Mt["b"].$(".ui-tabs-nav",Mt["b"].$(x).parent()).css("border","0px solid black");Mt["b"].$(".ui-tabs",Mt["b"].$(x).parent()).css("border","0px solid black");Mt["b"].$(".ui-dialog-buttonpane",Mt["b"].$(x).parent()).css("border","0px solid black");Mt["b"].$(".ui-dialog-titlebar",Mt["b"].$(x).parent()).css("border","1px solid #aaaaaa");Mt["b"].$(x,Mt["b"].$(x).parent()).css("padding","3px 0px 0px 0px");Mt["b"].$(".ui-dialog",Mt["b"].$(x).parent()).css("padding","0px");Mt["b"].$(".ui-dialog-buttonpane",Mt["b"].$(x).parent()).css("padding"," 0px 3px 0px 3px");Mt["b"].$(".ui-dialog-titlebar",Mt["b"].$(x).parent()).css("padding"," 1px 5px 1px 5px");Mt["b"].$(".ui-tabs",Mt["b"].$(x).parent()).css("padding","0px");Mt["b"].$(".ui-tabs-panel",Mt["b"].$(x).parent()).css("padding","6px");Mt["b"].$(".ui-tabs-nav",Mt["b"].$(x).parent()).css("font-size","11px")}};this.manipulateCssForLeftTabs=function(e,t,i){Mt["b"].$(".ui-tabs-nav",e).css("position","absolute");Mt["b"].$(".ui-tabs-nav",e).css("left","0px");Mt["b"].$(".ui-tabs-nav",e).css("top","5px");Mt["b"].$(".ui-tabs-nav",e).css("bottom","5px");Mt["b"].$(".ui-tabs-nav",e).css("width",t);Mt["b"].$(".ui-tabs-nav li",e).css("right","0px");Mt["b"].$(".ui-tabs-nav li",e).css("width","100%");Mt["b"].$(".ui-tabs-nav li",e).css("border-right","none");Mt["b"].$(".ui-tabs-nav li",e).css("border-top","none");Mt["b"].$(".ui-tabs-nav li",e).css("border-left","none");Mt["b"].$(".ui-tabs-nav li",e).css("border-bottom","1px solid black");Mt["b"].$(".ui-tabs-nav li",e).css("border-radius","0px 0px 0px 0px");Mt["b"].$(".ui-tabs-nav li",e).css("-moz-border-radius","0px 0px 0px 0px");Mt["b"].$(".ui-tabs-nav li",e).css("-webkit-border-radius","0px 0px 0px 0px");Mt["b"].$(".ui-tabs-nav li",e).css("overflow","hidden");Mt["b"].$(".ui-tabs-nav li a",e).css("float","right");Mt["b"].$(".ui-tabs-nav li a",e).css("width","100%");Mt["b"].$(".ui-tabs-nav li a",e).css("text-align","right");Mt["b"].$(".ui-tabs-nav li a",e).css("padding","0px 0px 4px 0px");if(i===false){Mt["b"].$(".ui-tabs-panel",e).css("border","0px solid black")}};this.manipulateCssResetTabs=function(e){Mt["b"].$(".ui-tabs-nav",e).css("position","");Mt["b"].$(".ui-tabs-nav",e).css("left","");Mt["b"].$(".ui-tabs-nav",e).css("top","");Mt["b"].$(".ui-tabs-nav",e).css("bottom","");Mt["b"].$(".ui-tabs-nav",e).css("width","auto");Mt["b"].$(".ui-tabs-nav li",e).css("right","");Mt["b"].$(".ui-tabs-nav li",e).css("width","");if(Mt["b"].$.browser.msie&&Mt["b"].$.browser.version<"9.0"){Mt["b"].$(".ui-tabs-nav li",e).each(function(e,t){t.style.borderRight="";t.style.borderRightColor="";t.style.borderRightWidth="";t.style.borderRightStyle="";t.style.borderLeft="";t.style.borderLeftColor="";t.style.borderLeftWidth="";t.style.borderLeftStyle="";t.style.borderTop="";t.style.borderTopColor="";t.style.borderTopWidth="";t.style.borderTopStyle="";t.style.borderBottom="";t.style.borderBottomColor="";t.style.borderBottomWidth="";t.style.borderBottomStyle=""})}else{Mt["b"].$(".ui-tabs-nav li",e).css("border-right","");Mt["b"].$(".ui-tabs-nav li",e).css("border-top","");Mt["b"].$(".ui-tabs-nav li",e).css("border-left","");Mt["b"].$(".ui-tabs-nav li",e).css("border-bottom","")}Mt["b"].$(".ui-tabs-nav li",e).css("border-radius","");Mt["b"].$(".ui-tabs-nav li",e).css("-moz-border-radius","");Mt["b"].$(".ui-tabs-nav li",e).css("-webkit-border-radius","");Mt["b"].$(".ui-tabs-nav li",e).css("overflow","");Mt["b"].$(".ui-tabs-nav li a",e).css("float","");Mt["b"].$(".ui-tabs-nav li a",e).css("width","");Mt["b"].$(".ui-tabs-nav li a",e).css("text-align","");Mt["b"].$(".ui-tabs-nav li a",e).css("padding","");Mt["b"].$(".ui-tabs-panel",Mt["b"].$(e).parent()).css("border","1px solid #aaaaaa")};this.setTabsCss=function(e,t){s.parent(".ui-dialog").draggable({cancel:e,handle:".ui-dialog-titlebar"});s.parent(".ui-dialog-buttonpane").hover(function(){Mt["b"].$(this).css("cursor","move")},function(){Mt["b"].$(this).css("cursor","auto")});s.parent(".ui-dialog-content").hover(function(){Mt["b"].$(this).css("cursor","move")},function(){Mt["b"].$(this).css("cursor","auto")});for(var i=0;i<t.length;i++){Mt["b"].$("#"+t[i]).hover(function(){Mt["b"].$(this).css("cursor","default")},function(){Mt["b"].$(this).css("cursor","auto")})}};this.enableButton=function(e){var t=document.getElementById(e);if(t){t.removeAttribute("disabled");t.style.opacity="";t.style.filter=""}};this.disableButton=function(e){var t=document.getElementById(e);if(t){t.setAttribute("disabled","disabled");t.style.opacity=".35";t.style.filter="Alpha(Opacity=35)"}};this.close=function(){var e=document.getElementById("formulaEditor");if(e!==null){if(u!==null){u.close()}}var t=s.parents(".HiCo");if(Mt["b"].$(x).dialog("isOpen")===true){Mt["b"].$(x).dialog("close");Mt["b"].$(x).dialog("destroy");Mt["b"].$(x).remove()}t.remove()};this.highest=function(){var e=0;Mt["b"].$("div.ui-dialog").each(function(){if(Mt["b"].$(this).css("z-index")>e){e=Mt["b"].$(this).css("z-index")}});return e};function getDomElement(){var e=document.getElementById(t+"Canvas");if(e===null){e=document.createElement("canvas");e.setAttribute("id",t+"Canvas")}return e}s.bind("beforeClose",Mt["b"].$(document).keyup(function(e){if(e.keyCode==27){if(e.isPropagationStopped()==false){var t=T.highest();var i=T.getDialog().offsetParent().css("z-index");if(t===i){if(T.getDialog().dialog("isOpen")===true){e.stopPropagation();if(r!==null&&r!==undefined){var a=r();if(a===true){return}}var n=document.getElementById("formulaEditor");if(n!==null){if(u!==null){u.close()}}if(T.getDialog().dialog("isOpen")===true){T.getDialog().dialog("close");T.getDialog().dialog("destroy");T.getDialog().remove()}if(o!==null&&o!==undefined){o()}}}}}}))};Mt["b"].UI.HiCoDialogDefinition=function(e,t,i){var a=e;var n=t;var r=i;var o=null;var l="auto";var s="auto";var d=false;var c=true;var u=false;var p=null;var g=null;var h=true;var f=null;var m="12px";this.getId=function(){return a};this.setId=function(e){a=e};this.getTitle=function(){return n};this.setTitle=function(e){n=e};this.getButtonsBar=function(){return r};this.setButtonsBar=function(e){r=e};this.getHeight=function(){return l};this.setHeight=function(e){l=e};this.getWidth=function(){return s};this.setWidth=function(e){s=e};this.getModal=function(){return d};this.setModal=function(e){d=e};this.getResizable=function(){return c};this.setResizable=function(e){c=e};this.getCloseOnEscape=function(){return u};this.setCloseOnEscape=function(e){u=e};this.getOptions=function(){return p};this.setOptions=function(e){p=e};this.getParentDomElement=function(){return g};this.setParentDomElement=function(e){g=e};this.getPosition=function(){return o};this.setPosition=function(e){o=e};this.getFontSize=function(){return m};this.setFontSize=function(e){m=e};this.getAutoOpen=function(){return h};this.setAutoOpen=function(e){h=e};this.getTooltip=function(){return f};this.setTooltip=function(e){f=e}};Mt["b"].UI.HiCoConfirm=function(e,t){var i=Mt["b"].DataObjects.RuntimeDO;var a=[{text:i.getTranslation("OKAY"),id:"HiCoConfirmDialogConfirmOkayButton",click:okay},{text:i.getTranslation("CANCEL"),id:"HiCoConfirmDialogConfirmCancelButton",click:cancel}];var n=new Mt["b"].UI.HiCoDialogDefinition("HiCoConfirmDialog",i.getTranslation("CONFIRM_SAVE"),a);n.setModal(true);n.setResizable(false);n.setPosition("center");var r=new Mt["b"].UI.HiCoDialog(n);r.setEscapeBeforeHandler(escapeBeforeHandler);r.setEscapeAfterHandler(escapeAfterHandler);var o=r.getDialogDiv();r.setCSS();var l=document.createElement("div");Mt["b"].$(l).html(e);o.appendChild(l);r.getDialog().dialog({draggable:false,minHeight:"0px"});r.getDialog().dialog("open");function okay(){t(true);r.close()}function cancel(){t(false);r.close()}function escapeBeforeHandler(){var e=true;return e}function escapeAfterHandler(){}};Mt["b"].UI.HiCoNotification=function(e,t){var i=Mt["b"].DataObjects.RuntimeDO;var a=[{text:i.getTranslation("OKAY"),id:"HiCNotificationDialogConfirmOkayButton",click:okay}];var n=new Mt["b"].UI.HiCoDialogDefinition("HiCoNotificationDialog",i.getTranslation("NOTIFICATION"),a);n.setModal(true);n.setResizable(false);n.setPosition("center");var r=new Mt["b"].UI.HiCoDialog(n);var o=r.getDialogDiv();r.setCSS();var l=document.createElement("div");l.style.margin="0px 5px";Mt["b"].$(l).html(e);o.appendChild(l);r.getDialog().dialog({draggable:false,minHeight:"0px"});r.getDialog().dialog("open");var s=Mt["b"].$("#HiCNotificationDialogConfirmOkayButton").width();Mt["b"].$("#HiCNotificationDialogConfirmOkayButton").parent().css({width:s+"px",margin:"0 auto"});function okay(){if(t!==undefined&&t!==null){t(false)}r.close()}};Mt["b"].UI=Mt["b"].UI||{};Mt["b"].UI.HighlightProperties=function(i){var g=this;var h=Mt["b"].DataObjects.RuntimeDO;var f=JSON.parse(JSON.stringify(i.highlight));var e=i.dialogObj?i.dialogObj:null;var t=i.extension;var m=t.getCanvasDO().getDOMElement();var s=i.containerModel;var v=s.extendedModel;var b=Mt["b"].DataObjects.ContextRepo.getContextByCid(v.contextId);var T;var x;var E=Mt["b"].DataObjects.DocumentDO.getDocSettings().docLanguage.value==="en_US"?"475":"540";var y="150";var C;var S;var M=null;var O=e?e.getDialogDiv():null;var A=Mt["b"].Utils.Constants.TypeValues.highlightType;var _=Mt["b"].Utils.Constants.TypeValues.indicator;var d=ge["a"];var L=h.getTranslation("PROPERTIES")+" ("+(f.name!=undefined?f.name:f.id)+")";var a=fillHeader(f.type);var u=a.header;var p=a.headerTL;var I=a.headerTooltips;var D=a.width;var R=[A.CATEGORY_LABEL,A.COMPARE,A.LEGEND,A.VALUE];var P=[h.getTranslation("DIMENSION_LABEL"),h.getTranslation("COMPARE"),h.getTranslation("LEGEND"),h.getTranslation("VALUE")];var N=a.compName?a.compName:null;var w=a.compId?a.compId:null;var n=a.category?a.category:null;var r=a.categoryTL?a.categoryTL:null;var o=a.keyfigureTypes?a.keyfigureTypes:null;var l=a.keyfigureTypesTL?a.keyfigureTypesTL:null;var F=[];var B=[];fillExpressions();var k={backgroundColor:"rgb(240, 240, 240)",border:"0px none",textAlign:"right"};g.open=function(e){T=new Mt["b"].Utils.Calculator(b);M=e;var t=document.getElementById("highlightProperties");if(t===null||t===undefined){var i="highlightProperties";var a=O?Mt["b"].$(Mt["b"].$(O).parent()).offset():null;var n=O?Mt["b"].$(Mt["b"].$(O).parent()).width():null;var r=7;var o=[{text:h.getTranslation("OKAY"),id:"highlightPropertiesDialogOkayButton",click:g.apply},{text:h.getTranslation("CANCEL"),id:"highlightPropertiesDialogCancelButton",click:g.cancel}];var l=new Mt["b"].UI.HiCoDialogDefinition(i,L,o);x=l.getFontSize();var s=a&&n?[a.left+n+r,a.top]:"center";l.setPosition(s);l.setWidth(E);l.setHeight(y);l.setResizable(true);l.setParentDomElement(m.parentNode);l.setTooltip(h.getTranslation("HELP_HIGHLIGHTPROPERTIES"));S=new Mt["b"].UI.HiCoDialog(l);C=S.getDialogDiv();var d={position:"absolute",visibility:"hidden",height:"auto",width:"auto"};var c=document.createElement("div");c.setAttribute("id","hiddenDiv");Mt["b"].Utils.DOM.setStyle(c,d);c.style.fontSize=x;C.appendChild(c);calculateLength();C.setAttribute("class",i);S.setCSS();C.appendChild(fillContent());var u=parseInt(S.highest());var p=parseInt(S.getDialog().offsetParent().css("z-index"));if(u>p){u+=1;S.getDialog().offsetParent().css("z-index",u)}S.getDialog().dialog("open")}else{t.parentNode.remove(t);g.open(e)}};g.apply=function(){applyChanges();g.cancel()};g.cancel=function(){S.close()};function fillExpressions(){F=[];B=[];if(f.value.type===_.STACK&&f.type===A.VALUE){F=[h.getTranslation("POSITIVE"),h.getTranslation("NEGATIVE")];B=["#pos#","#neg#"]}else{for(var e=0;e<b.columns.length;e++){F[e]=b.columns[e].name;B[e]=b.columns[e].id}}}function fillHeader(e){var t=[];var i=[];var a=[];var n=[];var r;var o;var l;var s;var d;var c;if(e===A.VALUE){t=["type","keyfigureType","category","position","keyfigure"];i=[h.getTranslation("TYPE"),h.getTranslation("MEASURE_TYPE"),h.getTranslation("DIMENSION"),h.getTranslation("POSITION"),h.getTranslation("MEASURE")];a=["HELP_HIGHLIGHTPROPERTIES_TYPE","HELP_HIGHLIGHTPROPERTIES_VALUE_MEASURETYPE","HELP_HIGHLIGHTPROPERTIES_VALUE_DIMENSION","HELP_HIGHLIGHTPROPERTIES_VALUE_POSITION","HELP_HIGHLIGHTPROPERTIES_VALUE_MEASURE"];n=[0,0,0,0,0];r=[_.LABEL,_.ELEMENT];o=[h.getTranslation("LABEL"),h.getTranslation("ELEMENT")];l=[_.TEXT,_.POSITION];s=[h.getTranslation("TEXT"),h.getTranslation("POSITION")]}else if(e===A.COMPARE){t=["type","compareName","compareElement"];i=[h.getTranslation("TYPE"),h.getTranslation("NAME"),h.getTranslation("ELEMENT")];a=["HELP_HIGHLIGHTPROPERTIES_TYPE","HELP_HIGHLIGHTPROPERTIES_COMPARE_NAME","HELP_HIGHLIGHTPROPERTIES_COMPARE_ELEMENT"];n=[0,0,0];d=[];c=[];for(var u=0;u<v.compares.length;u++){if(v.compares[u].name){d.push(v.compares[u].name);c.push(v.compares[u].id)}else{d.push(v.compares[u].id);c.push(v.compares[u].id)}}}else if(e===A.CATEGORY_LABEL){t=["type","category","position","elements"];i=[h.getTranslation("TYPE"),h.getTranslation("DIMENSION"),h.getTranslation("POSITION"),h.getTranslation("ELEMENTS")];a=["HELP_HIGHLIGHTPROPERTIES_TYPE","HELP_HIGHLIGHTPROPERTIES_CATLABEL_DIMENSION","HELP_HIGHLIGHTPROPERTIES_CATLABEL_POSITION","HELP_HIGHLIGHTPROPERTIES_CATLABEL_ELEMENTS"];n=[0,0,0,0];l=[_.TEXT,_.POSITION];s=[h.getTranslation("TEXT"),h.getTranslation("POSITION")]}else if(e===A.LEGEND){t=["type","keyfigure"];i=[h.getTranslation("TYPE"),h.getTranslation("MEASURE")];a=["HELP_HIGHLIGHTPROPERTIES_TYPE","HELP_HIGHLIGHTPROPERTIES_LEGEND_MEASURE"];n=[0,0]}return{header:t,headerTL:i,headerTooltips:a,width:n,keyfigureTypes:r,keyfigureTypesTL:o,category:l,categoryTL:s,compName:d,compId:c}}function calculateLength(){var e=document.getElementById("hiddenDiv");for(var t=0;t<u.length;t++){Mt["b"].$(e).html(p[t]);var i=e.clientWidth+1;D[t]=i}for(var t=0;t<R.length;t++){Mt["b"].$(e).html(P[t]);var i=e.clientWidth+30;if(D[0]<i){D[0]=i}}if(f.type===A.VALUE){for(var t=0;t<o.length;t++){Mt["b"].$(e).html(l[t]);var i=e.clientWidth+30;if(D[1]<i){D[1]=i}}if(D[2]<50){D[2]=50}if(D[3]<120){D[3]=120}for(var t=0;t<B.length;t++){Mt["b"].$(e).html(F[t]);var i=e.clientWidth+30;if(D[4]<i){D[4]=i}}}else if(f.type===A.COMPARE){for(var t=0;t<N.length;t++){Mt["b"].$(e).html(N[t]);var i=e.clientWidth+30;if(D[1]<i){D[1]=i}}if(D[2]<60){D[2]=60}}else if(f.type===A.CATEGORY_LABEL){for(var t=0;t<n.length;t++){Mt["b"].$(e).html(r[t]);var i=e.clientWidth+30;if(D[1]<i){D[1]=i}}if(D[2]<120){D[2]=120}if(D[3]<100){D[3]=100}}else if(f.type===A.LEGEND){for(var t=0;t<B.length;t++){Mt["b"].$(e).html(F[t]);var i=e.clientWidth+30;if(D[1]<i){D[1]=i}}}}function updateTable(e){f.type=R[e.selectedIndex];Mt["b"].$("#highlightPropDiv").empty();var t=document.getElementById("highlightPropDiv");a=fillHeader(f.type);u=a.header;p=a.headerTL;I=a.headerTooltips;D=a.width;N=a.compName?a.compName:null;w=a.compId?a.compId:null;n=a.category?a.category:null;r=a.categoryTL?a.categoryTL:null;o=a.keyfigureTypes?a.keyfigureTypes:null;l=a.keyfigureTypesTL?a.keyfigureTypesTL:null;calculateLength();t.appendChild(createHeader());t.appendChild(createTable())}function fillContent(){var e=document.createElement("div");e.setAttribute("id","highlightPropDiv");var t=createHeader();e.appendChild(t);var i=createTable();e.appendChild(i);return e}function createHeader(){var e=document.createElement("div");e.setAttribute("id","headerDiv");var t={height:25+"px",width:"auto"};Mt["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");var a=document.createElement("tr");var n=document.createElement("tr");for(var r=0;r<u.length;r++){var o=document.createElement("td");var l=document.createElement("td");var s=D[r];var d={width:s+"px",minWidth:s+"px",whiteSpace:"nowrap",textAlign:"center"};Mt["b"].Utils.DOM.setStyle(o,d);Mt["b"].Utils.DOM.setStyle(l,d);Mt["b"].$(o).html(p[r]);o.setAttribute("title",h.getTranslation(I[r]));var c=document.createElement("span");c.style.margin="0px";Mt["b"].$(c).html('<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">');l.appendChild(c);n.appendChild(l);a.appendChild(o)}i.appendChild(a);i.appendChild(n);e.appendChild(i);return e}function createTable(){var e=document.createElement("div");e.setAttribute("id","highlightPropertiesTableDiv");var t={height:50+"px",width:"100%"};Mt["b"].Utils.DOM.setStyle(e,t);if(f){var i=document.createElement("table");var a=document.createElement("tr");var n={width:D[0]+"px",minWidth:D[0]+"px",textAlign:"center"};var r=document.createElement("td");Mt["b"].Utils.DOM.setStyle(r,n);var o=Mt["b"].Utils.DOM.createSelectBox(r,"select##"+f.id+"##highlightType",R,P,f.type,x);o.setAttribute("title",h.getTranslation("HELP_HIGHLIGHTPROPERTIES_TYPE"));Mt["b"].$(o).change(function(e){updateTable(e.target)});a.appendChild(r);if(f.type===A.VALUE){n={width:D[1]+"px",minWidth:D[1]+"px",textAlign:"center"};r=document.createElement("td");Mt["b"].Utils.DOM.setStyle(r,n);var l=f.value.type===_.LABEL?"highlight_label.png":"highlight_label_grey.png";var s=Mt["b"].Utils.DOM.createIconButton(r,"select##"+f.id+"##highlightKeyfigureTypeLabel","","",x,pe["a"].imgPath+l,Mt["b"].DataObjects.RuntimeDO.getTranslation("LABEL"));s.style.marginRight="3px";s.style.marginLeft="3px";Mt["b"].$(s).click(function(e){changeValueTypeToLabel(e)});l=f.value.type===_.ELEMENT?"highlight_element.png":"highlight_element_grey.png";var s=Mt["b"].Utils.DOM.createIconButton(r,"select##"+f.id+"##highlightKeyfigureTypeElement","","",x,pe["a"].imgPath+l,Mt["b"].DataObjects.RuntimeDO.getTranslation("ELEMENT"));s.style.marginRight="3px";s.style.marginLeft="3px";Mt["b"].$(s).click(function(e){changeValueTypeToElement(e)});if(v.stackMode){fillExpressions();l=f.value.type===_.STACK?"stack.png":"stack_grey.png";var s=Mt["b"].Utils.DOM.createIconButton(r,"select##"+f.id+"##highlightKeyfigureTypeStack","","",x,pe["a"].imgPath+l,Mt["b"].DataObjects.RuntimeDO.getTranslation("STACK"));s.style.marginRight="3px";s.style.marginLeft="3px";Mt["b"].$(s).click(function(e){changeValueTypeToStack(e)})}a.appendChild(r);n={width:D[2]+"px",minWidth:D[2]+"px",textAlign:"center"};r=document.createElement("td");Mt["b"].Utils.DOM.setStyle(r,n);l=f.value.category===_.TEXT?"highlight_text.png":"highlight_text_grey.png";s=Mt["b"].Utils.DOM.createIconButton(r,"select##"+f.id+"##highlightCategoryText","","",x,pe["a"].imgPath+l,Mt["b"].DataObjects.RuntimeDO.getTranslation("TEXT"));Mt["b"].$(s).click(function(e){updateHighlight(f.value);changeInput(f.value)});l=f.value.category===_.TEXT?"highlight_position_grey.png":"highlight_position.png";s=Mt["b"].Utils.DOM.createIconButton(r,"select##"+f.id+"##highlightCategoryPosition","","",x,pe["a"].imgPath+l,Mt["b"].DataObjects.RuntimeDO.getTranslation("POSITION"));Mt["b"].$(s).click(function(e){updateHighlight(f.value);changeInput(f.value)});a.appendChild(r);n={width:D[3]+"px",minWidth:D[3]+"px",textAlign:"center"};r=document.createElement("td");Mt["b"].Utils.DOM.setStyle(r,n);if(f.value.category===_.TEXT){var d=T.decodeInputField(f.value.path,true)}else{var d=T.decodeInputField(f.value.position)}var c=Mt["b"].Utils.DOM.createTextInputNoMax(r,"select##"+f.id+"##highlightPosition",d,0,x);c.setAttribute("title",h.getTranslation("HELP_HIGHLIGHTPROPERTIES_VALUE_POSITION"));Mt["b"].$(c).css({width:"95px"});Mt["b"].Utils.DOM.setStyle(c,k);Mt["b"].$(c).on("focusout",function(e){checkFormulas(e,f.value.category)});Mt["b"].$(c).on("keydown",function(e){if(e.which===13){checkFormulas(e,f.value.category)}});var u=Mt["b"].DataObjects.RuntimeDO.getTranslation("HIGHLIGHT_HELP");u=u.replace(/&quot;/g,'"');s=Mt["b"].Utils.DOM.createIconButton(r,"select##"+f.id+"##helpIcon","","",x,pe["a"].imgPath+"help.png",u);Mt["b"].Utils.DOM.setStyle(s,{verticalAlign:"top"});a.appendChild(r);n={width:D[4]+"px",minWidth:D[4]+"px",textAlign:"center"};r=document.createElement("td");Mt["b"].Utils.DOM.setStyle(r,n);var o=Mt["b"].Utils.DOM.createSelectBox(r,"select##"+f.id+"##highlightKeyfigure",B,F,f.value.keyfigure,x);o.setAttribute("title",h.getTranslation("HELP_HIGHLIGHTPROPERTIES_VALUE_MEASURE"));Mt["b"].$(o).change(function(e){f.value.keyfigure=B[e.target.selectedIndex]});a.appendChild(r)}else if(f.type===A.COMPARE){n={width:D[1]+"px",minWidth:D[1]+"px",textAlign:"center"};r=document.createElement("td");Mt["b"].Utils.DOM.setStyle(r,n);var o=Mt["b"].Utils.DOM.createSelectBox(r,"select##"+f.id+"##highlightCompareName",w,N,f.compare.id,x);o.setAttribute("title",h.getTranslation("HELP_HIGHLIGHTPROPERTIES_COMPARE_NAME"));a.appendChild(r);n={width:D[2]+"px",minWidth:D[2]+"px",textAlign:"center"};r=document.createElement("td");Mt["b"].Utils.DOM.setStyle(r,n);var p=f.compare.element.absolute?pe["a"].imgPath+"absolute_active.png":pe["a"].imgPath+"absolute_inactive.png";var s=Mt["b"].Utils.DOM.createIconButton(r,"select##"+f.id+"##highlightCompareElementAbsolute","","",x,p,Mt["b"].DataObjects.RuntimeDO.getTranslation("ABSOLUTE"));Mt["b"].$(s).click(function(e){f.compare.element.absolute=!f.compare.element.absolute;e.target.src=f.compare.element.absolute===true?pe["a"].imgPath+"absolute_active.png":pe["a"].imgPath+"absolute_inactive.png"});p=f.compare.element.percent?pe["a"].imgPath+"percent_active.png":pe["a"].imgPath+"percent_inactive.png";s=Mt["b"].Utils.DOM.createIconButton(r,"select##"+f.id+"##highlightCompareElementPercent","","",x,p,Mt["b"].DataObjects.RuntimeDO.getTranslation("PERCENT"));Mt["b"].$(s).click(function(e){f.compare.element.percent=!f.compare.element.percent;e.target.src=f.compare.element.percent===true?pe["a"].imgPath+"percent_active.png":pe["a"].imgPath+"percent_inactive.png"});p=f.compare.element.text?pe["a"].imgPath+"text_active.png":pe["a"].imgPath+"text_inactive.png";s=Mt["b"].Utils.DOM.createIconButton(r,"select##"+f.id+"##highlightCompareElementText","","",x,p,Mt["b"].DataObjects.RuntimeDO.getTranslation("TEXT"));Mt["b"].$(s).click(function(e){f.compare.element.text=f.compare.element.text!==true;e.target.src=f.compare.element.text?pe["a"].imgPath+"text_active.png":pe["a"].imgPath+"text_inactive.png"});a.appendChild(r)}else if(f.type===A.CATEGORY_LABEL){n={width:D[1]+"px",minWidth:D[1]+"px",textAlign:"center"};r=document.createElement("td");Mt["b"].Utils.DOM.setStyle(r,n);var l=f.categoryLabel.category===_.TEXT?"highlight_text.png":"highlight_text_grey.png";var s=Mt["b"].Utils.DOM.createIconButton(r,"select##"+f.id+"##highlightCategoryText","","",x,pe["a"].imgPath+l,Mt["b"].DataObjects.RuntimeDO.getTranslation("TEXT"));Mt["b"].$(s).click(function(e){updateHighlight(f.categoryLabel);changeInput(f.categoryLabel)});l=f.categoryLabel.category===_.TEXT?"highlight_position_grey.png":"highlight_position.png";s=Mt["b"].Utils.DOM.createIconButton(r,"select##"+f.id+"##highlightCategoryPosition","","",x,pe["a"].imgPath+l,Mt["b"].DataObjects.RuntimeDO.getTranslation("POSITION"));Mt["b"].$(s).click(function(e){updateHighlight(f.categoryLabel);changeInput(f.categoryLabel)});a.appendChild(r);n={width:D[2]+"px",minWidth:D[2]+"px",textAlign:"center"};r=document.createElement("td");Mt["b"].Utils.DOM.setStyle(r,n);var d=f.categoryLabel.category===_.TEXT?T.decodeInputField(f.categoryLabel.path,true):T.decodeInputField(f.categoryLabel.position);var c=Mt["b"].Utils.DOM.createTextInputNoMax(r,"select##"+f.id+"##highlightPosition",d,0,x);c.setAttribute("title",h.getTranslation("HELP_HIGHLIGHTPROPERTIES_CATLABEL_POSITION"));Mt["b"].$(c).css({width:"95px"});Mt["b"].Utils.DOM.setStyle(c,k);Mt["b"].$(c).on("focusout",function(e){checkFormulas(e,f.categoryLabel.category)});Mt["b"].$(c).on("keydown",function(e){if(e.which===13){checkFormulas(e,f.categoryLabel.category)}});var u=Mt["b"].DataObjects.RuntimeDO.getTranslation("HIGHLIGHT_HELP");u=u.replace(/&quot;/g,'"');s=Mt["b"].Utils.DOM.createIconButton(r,"select##"+f.id+"##helpIcon","","",x,pe["a"].imgPath+"help.png",u);Mt["b"].Utils.DOM.setStyle(s,{verticalAlign:"top"});a.appendChild(r);n={width:D[3]+"px",minWidth:D[3]+"px",textAlign:"center"};r=document.createElement("td");Mt["b"].Utils.DOM.setStyle(r,n);var d=T.decodeInputField(f.categoryLabel.elements,true);var c=Mt["b"].Utils.DOM.createTextInputNoMax(r,"select##"+f.id+"##highlightElements",d,0,x);c.setAttribute("title",h.getTranslation("HELP_HIGHLIGHTPROPERTIES_CATLABEL_ELEMENTS"));Mt["b"].$(c).css({width:"95px"});Mt["b"].Utils.DOM.setStyle(c,k);a.appendChild(r)}else if(f.type===A.LEGEND){fillExpressions();n={width:D[1]+"px",minWidth:D[1]+"px",textAlign:"center"};r=document.createElement("td");Mt["b"].Utils.DOM.setStyle(r,n);var o=Mt["b"].Utils.DOM.createSelectBox(r,"select##"+f.id+"##highlightKeyfigure",B,F,f.legend.keyfigure,x);o.setAttribute("title",h.getTranslation("HELP_HIGHLIGHTPROPERTIES_LEGEND_MEASURE"));Mt["b"].$(o).change(function(e){f.legend.keyfigure=B[e.target.selectedIndex]});a.appendChild(r)}i.appendChild(a)}e.appendChild(i);return e}function applyChanges(){var e=JSON.parse(JSON.stringify(f));if(e.type===A.VALUE){if(e.value.category===_.TEXT){e.value.path=T.encodeInputField(document.getElementById("select##"+e.id+"##highlightPosition").value)}else{e.value.position=T.encodeInputField(document.getElementById("select##"+e.id+"##highlightPosition").value);if(e.value.type===_.STACK){e.value.inGroup=B[document.getElementById("select##"+e.id+"##highlightKeyfigure").selectedIndex]}else{e.value.inGroup=document.getElementById("select##"+e.id+"##highlightKeyfigure").selectedIndex}}e.value.keyfigure=B[document.getElementById("select##"+e.id+"##highlightKeyfigure").selectedIndex]}else if(e.type===A.COMPARE){var t=w[document.getElementById("select##"+e.id+"##highlightCompareName").selectedIndex];if(e.compare.id!==t){resetOldCompareHighlight()}e.compare.id=t}else if(e.type===A.CATEGORY_LABEL){if(e.categoryLabel.category===_.TEXT){e.categoryLabel.path=T.encodeInputField(document.getElementById("select##"+e.id+"##highlightPosition").value)}else{e.categoryLabel.position=T.encodeInputField(document.getElementById("select##"+e.id+"##highlightPosition").value)}e.categoryLabel.elements=T.encodeInputField(document.getElementById("select##"+e.id+"##highlightElements").value)}else if(e.type===A.LEGEND){e.legend.keyfigure=B[document.getElementById("select##"+e.id+"##highlightKeyfigure").selectedIndex]}if(e.type!==A.COMPARE){resetOldCompareHighlight()}M.setHighlight(e,i)}function updateHighlight(e){var t=T.encodeInputField(document.getElementById("select##"+f.id+"##highlightPosition").value);if(e.category===_.POSITION){if(t[0]==="$"&&t[1]==="("&&t[t.length-1]===")"){var i={};T.addQvVariables(i,false);t=d.resolveVariables(T,t,i,null,null,false)}}else{var a=t.split("@");for(var n=0;n<a.length;n++){var r=a[n];if(r[0]==="$"&&r[1]==="("&&r[r.length-1]===")"){var i={};T.addQvVariables(i,false);a[n]=d.resolveVariables(T,a[n],i,null,null,false)}}t=a.join("@")}for(var n=0;n<s.children.length;n++){var o=s.children[n];if(o.instanceOf!=="BackGroundModel"&&o.instanceOf!=="CompareModel"&&o.instanceOf!=="ContainerModel"&&o.instanceOf!=="AxisModel"&&o.instanceOf!=="LabelModel"&&o.instanceOf!=="DataTypeAnnotatorModel"&&o.instanceOf!=="RowConnectorModel"){if(e.category===_.POSITION&&o.absolutePosition&&(o.absolutePosition.groupIndex+1).toString()===t){var a=e.path.split("@");var l=true;for(var n=0;n<a.length;n++){var r=a[n];if(r[0]==="$"&&r[1]==="("&&r[r.length-1]===")"){l=false;break}}e.path=l?o.dataId_dim:e.path;break}else if(e.category===_.TEXT&&o.dataId_dim&&o.dataId_dim===t){if(e.position[0]!=="$"&&e.position[1]!=="("&&e.position[e.position.length-1]!==")"){e.position=(o.absolutePosition.groupIndex+1).toString()}break}}}}function changeInput(e){if(e.category===_.POSITION){e.category=_.TEXT;var t=document.getElementById("select##"+f.id+"##highlightCategoryText");t.src=pe["a"].imgPath+"highlight_text.png";t=document.getElementById("select##"+f.id+"##highlightPosition");t.value=T.decodeInputField(e.path,true);t=document.getElementById("select##"+f.id+"##highlightCategoryPosition");t.src=pe["a"].imgPath+"highlight_position_grey.png"}else{e.category=_.POSITION;var t=document.getElementById("select##"+f.id+"##highlightCategoryPosition");t.src=pe["a"].imgPath+"highlight_position.png";t=document.getElementById("select##"+f.id+"##highlightPosition");t.value=T.decodeInputField(e.position);t=document.getElementById("select##"+f.id+"##highlightCategoryText");t.src=pe["a"].imgPath+"highlight_text_grey.png"}}function checkFormulas(e,t){var i=e.target.value;if(validateVariable(i,t)){e.target.style.color="#000000";e.target.blur()}else{e.target.style.color="#FF0000"}}function resetOldCompareHighlight(){var e=M.getAvailCompares();for(var t=0;t<e.length;t++){if(e[t].comp.id===f.compare.id){e[t].comp.absolute.isHighlighted=false;e[t].comp.percent.isHighlighted=false;e[t].comp.text.isHighlighted=false;break}}}function changeValueTypeToLabel(e){f.value.type=_.LABEL;e.target.src=pe["a"].imgPath+"highlight_label.png";var t=document.getElementById("select##"+f.id+"##highlightKeyfigureTypeElement");t.src=pe["a"].imgPath+"highlight_element_grey.png";t=document.getElementById("select##"+f.id+"##highlightKeyfigureTypeStack");if(t){t.src=pe["a"].imgPath+"stack_grey.png";t=document.getElementById("select##"+f.id+"##highlightKeyfigure");t.options.length=0;fillExpressions();for(var i=0;i<B.length;i++){var a=document.createElement("option");var n=F[i];Mt["b"].$(a).html(n);t.appendChild(a)}}}function changeValueTypeToElement(e){f.value.type=_.ELEMENT;e.target.src=pe["a"].imgPath+"highlight_element.png";var t=document.getElementById("select##"+f.id+"##highlightKeyfigureTypeLabel");t.src=pe["a"].imgPath+"highlight_label_grey.png";t=document.getElementById("select##"+f.id+"##highlightKeyfigureTypeStack");if(t){t.src=pe["a"].imgPath+"stack_grey.png";t=document.getElementById("select##"+f.id+"##highlightKeyfigure");t.options.length=0;fillExpressions();for(var i=0;i<B.length;i++){var a=document.createElement("option");var n=F[i];Mt["b"].$(a).html(n);t.appendChild(a)}}}function changeValueTypeToStack(e){f.value.type=_.STACK;e.target.src=pe["a"].imgPath+"stack.png";var t=document.getElementById("select##"+f.id+"##highlightKeyfigureTypeLabel");t.src=pe["a"].imgPath+"highlight_label_grey.png";t=document.getElementById("select##"+f.id+"##highlightKeyfigureTypeElement");t.src=pe["a"].imgPath+"highlight_element_grey.png";t=document.getElementById("select##"+f.id+"##highlightKeyfigure");t.options.length=0;fillExpressions();for(var i=0;i<B.length;i++){var a=document.createElement("option");var n=F[i];Mt["b"].$(a).html(n);t.appendChild(a)}}function validateVariable(e,t){var i=e.split(",");var a=true;for(var n=0;n<i.length;n++){var r=i[n];if(t===_.TEXT){if(r[0]!=='"'||r[r.length-1]!=='"'){a=false}else{r=r.slice(1,r.length-1)}}else if(t===_.POSITION){if(r[0]==='"'&&r[r.length-1]==='"'){a=false}}if(a){if(r[0]==="$"&&r[1]==="("&&r[r.length-1]===")"){var o={};T.addQvVariables(o,true);a=d.resolveVariables(T,T.encode(r),o,null,null,false)}}else{return a}}return a}};Mt["b"].UI=Mt["b"].UI||{};Mt["b"].UI.KeyDialog=function(e){var o=this;var t=e.chartModel;var n=JSON.parse(JSON.stringify(t.input));var i=e.parent;var l=Mt["b"].DataObjects.RuntimeDO;var r=Mt["b"].DataObjects.ContextRepo.getContextByCid(t.contextId);var s=450;var d=300;var c=l.getTranslation("KEYDIALOG");var a,u,p,g,h,f;var m=[];var v=[];var b,T;var x={border:"1px solid rgb(170, 170, 170)",height:190+"px",padding:6+"px",overflow:"auto"};var E={width:150+"px",height:170+"px",border:"1px solid rgb(170, 170, 170)",overflow:"auto"};var y=getButtons();getLists();o.open=function(){var e=document.getElementById("keyDialog");if(!e){var t="keyDialog";var i=[{text:l.getTranslation("OKAY"),id:"keyOkayButton",click:o.okay},{text:l.getTranslation("CANCEL"),id:"keyCancelButton",click:o.close}];var a=new Mt["b"].UI.HiCoDialogDefinition(t,c,i);g=a.getFontSize();a.setWidth(s+"px");a.setHeight(d);a.setPosition("center");b=new Mt["b"].UI.HiCoDialog(a);T=b.getDialogDiv();b.setEvent("dialogresize",resizeDialog);b.setCSS("overflow","hidden");b.getDialog().dialog("option","minWidth",s);b.setCSS();T.appendChild(fillContent());var n=parseInt(b.highest());var r=parseInt(b.getDialog().offsetParent().css("z-index"));if(n>r){n+=1;b.getDialog().offsetParent().css("z-index",n)}b.getDialog().dialog("open")}else{e.parentNode.remove(e);o.open()}};o.okay=function(){if(m.length>0){n.keyColumns=m;i.setKeyColumns(n);o.close()}else{Mt["b"].UI.HiCoNotification(l.getTranslation("SELECT_ONE"))}};o.close=function(){b.close()};function fillContent(){var e=document.createElement("div");e.setAttribute("id","keyDialogDiv");Mt["b"].$(e).addClass("ui-corner-bottom");Mt["b"].$(e).css(x);createLeftTable();e.appendChild(a);createMidTable();e.appendChild(u);createRightTable();e.appendChild(p);return e}function createHeader(e){var t=document.createElement("div");var i=document.createElement("tr");var a=document.createElement("td");a.innerHTML=e;i.appendChild(a);t.appendChild(i);return t}function createLeftTable(){a=document.createElement("div");a.setAttribute("id","leftDiv");Mt["b"].$(a).addClass("floatingDiv");a.appendChild(createHeader(l.getTranslation("AVAILABLE")));a.setAttribute("title",l.getTranslation("HELP_CELL_INPUT_AVAILABLE"));var e=document.createElement("div");h=document.createElement("ul");h.setAttribute("id","leftList");Mt["b"].$(h).addClass("listSelectable");e.appendChild(h);fillLeftTable();Mt["b"].$(e).css(E);a.appendChild(e)}function createMidTable(){u=document.createElement("div");u.setAttribute("id","midDiv");Mt["b"].$(u).addClass("floatingDiv");var e=document.createElement("div");Mt["b"].$(e).css({margin:"20px 10px 0px"});var t=document.createElement("table");Mt["b"].$(t).addClass("floatingDivTable");for(var i=0,a=y.length;i<a;i++){var n=document.createElement("tr");if(y[i].entries){for(var r=0,o=y[i].entries.length;r<o;r++){var l=document.createElement("td");l.setAttribute("id",y[i].entries[r].id);if(y[i].entries[r].type==="iconbutton"){Mt["b"].Utils.DOM.createIconButton(l,y[i].entries[r].id,"","",g,pe["a"].imgPath+y[i].entries[r].src,y[i].entries[r].tooltip);Mt["b"].$(l).click(sortUpAndDown)}else if(y[i].entries[r].type==="text"){l.colSpan=y[i].entries[r].colSpan;l.setAttribute("title",y[i].entries[r].tooltip);Mt["b"].Utils.DOM.createSpan(l,y[i].entries[r].value,y[i].entries[r].id);Mt["b"].$(l).click(addRemoveElement)}else if(y[i].entries[r].type==="empty"){Mt["b"].$(l).css({border:0+"px"})}n.appendChild(l)}}else{var l=document.createElement("td");l.colSpan=2;Mt["b"].$(l).css({height:15+"px",border:"0px"});n.appendChild(l)}t.appendChild(n)}e.appendChild(t);u.appendChild(e)}function createRightTable(){p=document.createElement("div");p.setAttribute("id","rightDiv");Mt["b"].$(p).addClass("floatingDiv");p.appendChild(createHeader(l.getTranslation("KEY")));p.setAttribute("title",l.getTranslation("HELP_CELL_INPUT_KEY"));var e=document.createElement("div");f=document.createElement("ul");f.setAttribute("id","rightList");Mt["b"].$(f).addClass("listSelectable");fillRightTable();e.appendChild(f);Mt["b"].$(e).css(E);p.appendChild(e)}function resizeDialog(){var e=Mt["b"].$(T).parent().height()-70;Mt["b"].$(T).height(e);Mt["b"].$("#keyDialogDiv").height(e-15)}function selectElement(){Mt["b"].$(this).toggleClass("listSelected").siblings().removeClass("listSelected");if(this.parentNode.id==="leftList"){Mt["b"].$(f).children().removeClass("listSelected")}else if(this.parentNode.id==="rightList"){Mt["b"].$(h).children().removeClass("listSelected")}}function addRemoveElement(){if(this.id==="addOne"){var e=Mt["b"].$(".listSelected")[0];if(e){Mt["b"].$(e).removeClass("listSelected");f.appendChild(e);addOneToRightList(e.id)}}else if(this.id==="addAll"){var t=Mt["b"].$(h).children();if(t){addAllToRightList();for(var i=0,a=t.length;i<a;i++){Mt["b"].$(t[i]).removeClass("listSelected");f.appendChild(t[i])}}}else if(this.id==="removeOne"){var e=Mt["b"].$(".listSelected")[0];if(e){Mt["b"].$(e).removeClass("listSelected");h.appendChild(e);removeOneFromRightList(e.id)}}else if(this.id==="removeAll"){var t=Mt["b"].$(f).children();if(t){removeAllFromRightList();for(var i=0,a=t.length;i<a;i++){Mt["b"].$(t[i]).removeClass("listSelected");h.appendChild(t[i])}}}}function addOneToRightList(e){for(var t=0,i=v.length;t<i;t++){if(v[t].id===e){var a=v.splice(t,1);m.push(a[0]);break}}}function addAllToRightList(){var e=v.splice(0,v.length);m=m.concat(e)}function removeOneFromRightList(e){for(var t=0,i=m.length;t<i;t++){if(m[t].id===e){var a=m.splice(t,1);v.push(a[0]);break}}}function removeAllFromRightList(){var e=m.splice(0,m.length);v=v.concat(e)}function sortUpAndDown(){if(this.id==="sortUp"){var e=Mt["b"].$(".listSelected");if(e){var t=e.prev();e.insertBefore(t);if(t[0]){swapEntries(v,e[0].id,t[0].id)}}}else if(this.id==="sortDown"){var e=Mt["b"].$(".listSelected");if(e){var i=e.next();e.insertAfter(i);if(i[0]){swapEntries(v,e[0].id,i[0].id)}}}}function swapEntries(e,t,i){var a=getIndex(t,e);var n=getIndex(i,e);if(a&&n){var r=e[a];e[a]=e[n];e[n]=r}}function getIndex(e,t){for(var i=0,a=t.length;i<a;i++){if(e===t[i].id){return i}}return null}function fillLeftTable(){for(var e=0,t=v.length;e<t;e++){var i=document.createElement("li");i.setAttribute("id",v[e].id);i.innerHTML=v[e].nameInternal?v[e].nameInternal:v[e].name;Mt["b"].$(i).click(selectElement);h.appendChild(i)}}function fillRightTable(){for(var e=0,t=m.length;e<t;e++){var i=document.createElement("li");i.setAttribute("id",m[e].id);i.innerHTML=m[e].nameInternal?m[e].nameInternal:m[e].name;Mt["b"].$(i).click(selectElement);f.appendChild(i)}}function getLists(){for(var e=0,t=n.keyColumns.length;e<t;e++){var i={name:n.keyColumns[e].name};for(var a=0;a<r.rows.length;a++){if(r.rows[a].id===n.keyColumns[e].id){i=r.rows[a];break}}m.push({id:n.keyColumns[e].id,name:i.nameInternal?i.nameInternal:i.name,hide:n.keyColumns[e].hide})}for(var e=0,t=r.rows.length;e<t;e++){var i=r.rows[e];if(!contains(i.id)){v.push({id:i.id,name:i.nameInternal?i.nameInternal:i.name,hide:false})}}function contains(e){var t=m.length;while(t--){if(m[t].id===e){return true}}return false}}function getButtons(){var e=[{entries:[{type:"text",id:"addOne",value:l.getTranslation("ADD_ONE"),tooltip:l.getTranslation("HELP_KEYDIALOG_ADD_ONE"),colSpan:3},{type:"text",id:"addAll",value:">>",tooltip:l.getTranslation("HELP_KEYDIALOG_ADD_ALL"),colSpan:1}]},{entries:[{type:"text",id:"removeAll",value:"<<",tooltip:l.getTranslation("HELP_KEYDIALOG_REMOVE_ALL"),colSpan:1},{type:"text",id:"removeOne",value:l.getTranslation("REMOVE_ONE"),tooltip:l.getTranslation("HELP_KEYDIALOG_REMOVE_ONE"),colSpan:3}]},{type:"empty"},{entries:[{type:"empty"},{type:"iconbutton",id:"sortUp",src:"sort_arrow_up.png",tooltip:l.getTranslation("HELP_KEYDIALOG_SORT_UP")},{type:"iconbutton",id:"sortDown",src:"sort_arrow_down.png",tooltip:l.getTranslation("HELP_KEYDIALOG_SORT_DOWN")}]}];return e}};var Ne=i(318);Mt["b"].UI=Mt["b"].UI||{};Mt["b"].UI.LinkDialog=function(e){var f=this;var n;var r;var d=e;var u=d.getCanvasDO().getDOMElement();var m=d.RootModel;var p=null;var v=Mt["b"].DataObjects.RuntimeDO;var o=Mt["b"].Utils.Constants.TypeValues.element;deleteXYFromLink();var g=Mt["b"].Models.Actions.ViewModelActions.General.getAllSingleChartsByType(m.firstObjectGrid,"TimeChartModel");var h=Mt["b"].Models.Actions.ViewModelActions.General.getAllSingleChartsByType(m.firstObjectGrid,"ChartModel");var c=g.concat(h);var b=["Left","Mid","Right"];var i=["Start","Mid","End"];var T=[v.getTranslation("LEFT"),v.getTranslation("MID"),v.getTranslation("RIGHT")];var x=["Top","Mid","Bottom"];var E=[v.getTranslation("TOP"),v.getTranslation("MID"),v.getTranslation("BOTTOM")];var y=["-"];var C=["-"];var S={padding:"0px",position:"absolute",top:"0px",height:"0px",left:"0px",width:"0px",border:"0px solid black",backgroundColor:"rgba(100,50,200,0.2)",visibility:"hidden",zIndex:"998"};var l=[{id:"XXXAxisLinking",text:v.getTranslation("AXIS"),buildUp:createAxisLinking,tooltip:v.getTranslation("HELP_LINK_AXIS")},{id:"XXXLegendLinking",text:v.getTranslation("LEGEND"),buildUp:createLegendLinking,tooltip:v.getTranslation("HELP_LINK_LEGEND")},{id:"XXXValueLinking",text:v.getTranslation("VALUE"),buildUp:createValueLinking,tooltip:v.getTranslation("HELP_LINK_VALUE")},{id:"XXXLinkingSettings",text:v.getTranslation("SETTINGS"),buildUp:createLinkingSettings,tooltip:v.getTranslation("HELP_LINK_SETTINGS")}];var s="_linkDialog";var M="340";var O="140";this.createLinkDiv=function(){var e=new Mt["b"].UI.HiCoDialogDefinition(s,v.getTranslation("LINKING"),[{text:v.getTranslation("OKAY"),click:this.closeDialog}]);e.setParentDomElement(u.parentNode);e.setWidth(M);e.setPosition({});n=new Mt["b"].UI.HiCoDialog(e);r=n.getDialogDiv();n.setEscapeAfterHandler(this.closeDialog);var t={select:function(e,t){Mt["b"].$('div[id*="linkGroup_"]').remove();n.decorateTabs(t.index,l,null);f.showExistingLinks()}};n.buildTabs("tabDiv",l,null,"auto",{top:"0px",left:"0px"},t,true);n.setEvent("dialogresize",function(e,t){f.updateDivHeight()});n.setTabsCss("#generalTab",["generalTab"]);n.setCSS();n.decorateTabs(0,l,null);f.showExistingLinks();var i=parseInt(n.highest());var a=parseInt(n.getDialog().offsetParent().css("z-index"));if(i>a){i+=1;n.getDialog().offsetParent().css("z-index",i)}};this.closeDialog=function(){n.close();Mt["b"].$('div[id*="linkGroup_"]').remove();deleteXYFromLink();d.LayoutDefinition.link=Ne["a"].convertCellLinks(m)};this.updateDivHeight=function(){var e=parseFloat(r.style.height);var t=44;var i=e-t;Mt["b"].$("#XXXAxisLinking").css("height",i);Mt["b"].$("#XXXValueLinking").css("height",i);Mt["b"].$("#XXXLegendLinking").css("height",i);Mt["b"].$("#XXXLinkingSettings").css("height",i);i=e-t-2;Mt["b"].$("#AxisLinking").css("height",i);Mt["b"].$("#ValueLinking").css("height",i);Mt["b"].$("#LegendLinking").css("height",i);Mt["b"].$("#LinkingSettings").css("height",i)};this.addLinkGroup=function(e){var t=0;while(m.linkGroups[t]!==undefined){t++}m.linkGroups[t]={linkedType:"-",linkedCharts:[],axisOrientation:"Start",legendOrientation:"Left",type:e};f.showExistingLinks(t)};this.showExistingLinks=function(e){if(Mt["b"].$("#axisLinkingTableBody")){Mt["b"].$("#axisLinkingTableBody").remove()}if(Mt["b"].$("#valueLinkingTableBody")){Mt["b"].$("#valueLinkingTableBody").remove()}if(Mt["b"].$("#legendLinkingTableBody")){Mt["b"].$("#legendLinkingTableBody").remove()}var t=1;var i=1;var a=1;var n=document.createElement("tbody");n.setAttribute("ID","axisLinkingTableBody");var r=document.createElement("tbody");r.setAttribute("ID","valueLinkingTableBody");var o=document.createElement("tbody");o.setAttribute("ID","legendLinkingTableBody");for(var l in m.linkGroups){var s=m.linkGroups[l];if(s.type==="axis"){var d=f.createTbody_axis(s,l,t);n.appendChild(d);Mt["b"].$("#axisLinkingTable").append(n);t++}else if(s.type==="value"){var d=f.createTbody_value(s,l,i);r.appendChild(d);Mt["b"].$("#valueLinkingTable").append(r);i++}else if(s.type==="legend"){var d=f.createTbody_legend(s,l,a);o.appendChild(d);Mt["b"].$("#legendLinkingTable").append(o);a++}}if(m.linkGroups[e]!=undefined){f.activeLinkSelection({id:"linkGroup_"+e,type:m.linkGroups[e].type})}};this.createTbody_axis=function(e,t,i){var a=document.createElement("tr");a.setAttribute("ID","linkGroup_"+t);var n=f.buildDragger();n.setAttribute("ID","linkGroup_"+t+"_dragger");n.setAttribute("title",v.getTranslation("HELP_LINK_AXIS_DRAGGER"));Mt["b"].$(n).click(function(){f.activeLinkSelection({id:"linkGroup_"+t,type:"axis"})});var r=document.createElement("td");Mt["b"].$(r).html(i);r.setAttribute("title",v.getTranslation("HELP_LINK_AXIS_LINK"));r.style.textAlign="right";var o=document.createElement("td");Mt["b"].$(o).html(e.linkedType);o.setAttribute("title",v.getTranslation("HELP_LINK_AXIS_TYPE"));o.style.textAlign="right";var l=document.createElement("td");l.setAttribute("ID","linkGroupLength_"+t);l.setAttribute("title",v.getTranslation("HELP_LINK_AXIS_CELLS"));Mt["b"].$(l).html(e.linkedCharts.length);l.style.textAlign="right";var s=document.createElement("td");s.setAttribute("ID","linkGroup_"+t);Mt["b"].$(s).css("cursor","pointer");Mt["b"].$(s).html("-");s.setAttribute("title",v.getTranslation("HELP_LINK_AXIS_MINUS"));s.style.textAlign="center";Mt["b"].$(s).click(function(){!m.linkSettings.automaticLinking&&f.removeLinkGroup(this.id,"axis")});var d=Mt["b"].Utils.Constants.ParameterSets.axisCategoryAlignments;var c=Mt["b"].Utils.Constants.ParameterSets.axisCategoryAlignmentsTL;if(d.indexOf(m.linkGroups[t].axisOrientation)===-1){m.linkGroups[t].axisOrientation=d[0]}var u=document.createElement("td");u.setAttribute("ID","orientationLinkGroup_"+t);u.setAttribute("title",v.getTranslation("HELP_LINK_AXIS_ORIENTATION"));var p=Mt["b"].Utils.DOM.createSelectBox(u,"orientationLinkGroup_"+t,d,c,m.linkGroups[t].axisOrientation,13,"100%");Mt["b"].$(p).change(function(){f.changeAxisOrientation(this)});if(m.linkSettings.automaticLinking){p.setAttribute("disabled","disabled")}else{p.removeAttribute("disabled")}a.appendChild(n);a.appendChild(r);a.appendChild(o);a.appendChild(l);a.appendChild(u);a.appendChild(s);return a};this.createTbody_value=function(e,t,i){var a=document.createElement("tr");a.setAttribute("ID","linkGroup_"+t);var n=f.buildDragger();n.setAttribute("ID","linkGroup_"+t+"_dragger");n.setAttribute("title",v.getTranslation("HELP_LINK_VALUE_DRAGGER"));Mt["b"].$(n).click(function(){f.activeLinkSelection({id:"linkGroup_"+t,type:"value"})});var r=document.createElement("td");Mt["b"].$(r).html(i);r.setAttribute("title",v.getTranslation("HELP_LINK_VALUE_LINK"));r.style.textAlign="right";var o=document.createElement("td");o.setAttribute("title",v.getTranslation("HELP_LINK_VALUE_TYPE"));Mt["b"].$(o).html(e.linkedType);o.style.textAlign="right";var l=document.createElement("td");l.setAttribute("ID","linkGroupLength_"+t);l.setAttribute("title",v.getTranslation("HELP_LINK_VALUE_CELLS"));Mt["b"].$(l).html(e.linkedCharts.length);l.style.textAlign="right";var s=document.createElement("td");s.setAttribute("ID","linkGroup_"+t);Mt["b"].$(s).css("cursor","pointer");Mt["b"].$(s).html("-");s.setAttribute("title",v.getTranslation("HELP_LINK_VALUE_MINUS"));s.style.textAlign="center";Mt["b"].$(s).click(function(){!m.linkSettings.automaticLinking&&f.removeLinkGroup(this.id,"value")});a.appendChild(n);a.appendChild(r);a.appendChild(o);a.appendChild(l);a.appendChild(s);return a};this.createTbody_legend=function(e,t,i){var a=document.createElement("tr");a.setAttribute("ID","linkGroup_"+t);var n=f.buildDragger();n.setAttribute("ID","linkGroup_"+t+"_dragger");n.setAttribute("title",v.getTranslation("HELP_LINK_LEGEND_DRAGGER"));Mt["b"].$(n).click(function(){f.activeLinkSelection({id:"linkGroup_"+t,type:"legend"})});var r=document.createElement("td");Mt["b"].$(r).html(i);r.setAttribute("title",v.getTranslation("HELP_LINK_LEGEND_LINK"));r.style.textAlign="right";var o=document.createElement("td");Mt["b"].$(o).html(e.linkedType);o.setAttribute("title",v.getTranslation("HELP_LINK_LEGEND_TYPE"));o.style.textAlign="right";var l=document.createElement("td");l.setAttribute("ID","linkGroupLength_"+t);l.setAttribute("title",v.getTranslation("HELP_LINK_LEGEND_CELLS"));Mt["b"].$(l).html(e.linkedCharts.length);l.style.textAlign="right";if(e.linkedType==="Time"){var s=b;var d=T}else if(e.linkedType==="Structure"){var s=x;var d=E}else{var s=y;var d=C}if(s.indexOf(m.linkGroups[t].legendOrientation)===-1){m.linkGroups[t].legendOrientation=s[0]}var c=document.createElement("td");c.setAttribute("ID","orientationLinkGroup_"+t);var u=Mt["b"].Utils.DOM.createSelectBox(c,"orientationLinkGroup_"+t,s,d,m.linkGroups[t].legendOrientation,13,"100%");u.setAttribute("title",v.getTranslation("HELP_LINK_LEGEND_ORIENTATION"));Mt["b"].$(u).change(function(){f.changeLegendOrientation(this)});if(m.linkSettings.automaticLinking){u.setAttribute("disabled","disabled")}else{u.removeAttribute("disabled")}var p=document.createElement("td");p.setAttribute("ID","linkGroup_"+t);Mt["b"].$(p).css("cursor","pointer");Mt["b"].$(p).html("-");p.setAttribute("title",v.getTranslation("HELP_LINK_LEGEND_MINUS"));p.style.textAlign="center";Mt["b"].$(p).click(function(){!m.linkSettings.automaticLinking&&f.removeLinkGroup(this.id,"legend")});a.appendChild(n);a.appendChild(r);a.appendChild(o);a.appendChild(l);a.appendChild(c);a.appendChild(p);return a};this.buildDragger=function(e){var t=document.createElement("td");var i=document.createElement("div");i.style.height="10px";i.style.width="10px";i.style.background="rgb(150,150,150)";t.appendChild(i);return t};this.activeLinkSelection=function(e){Mt["b"].$('div[id*="linkGroup_"]').remove();f.showExistingLinks();Mt["b"].$("#"+e.id+"_dragger").children().css("background","rgb(0, 176, 240)");p=e.id.split("_").pop();var t=Mt["b"].$("#"+e.id)[0].childNodes[2].innerHTML;if(t==="-"){f.highlightLinkContainers("Structure",true,e);f.highlightLinkContainers("Time",true,e)}else{f.highlightLinkContainers(t,false,e)}};this.changeAxisOrientation=function(e){var t=m.linkGroups[e.id.split("_").pop()];if(t.linkedType==="Time"||t.linkedType==="Structure"){t.axisOrientation=i[e.selectedIndex]}else{t.axisOrientation=y[e.selectedIndex]}d.paint()};this.changeLegendOrientation=function(e){var t=m.linkGroups[e.id.split("_").pop()];if(t.linkedType==="Time"){t.legendOrientation=b[e.selectedIndex]}else if(t.linkedType==="Structure"){t.legendOrientation=x[e.selectedIndex]}else{t.legendOrientation=y[e.selectedIndex]}d.paint()};this.updateLink=function(e,t){var i=Mt["b"].Factories.ModelFactory.getModelById(m,e.id.split("_").pop());var a=m.extensionHash+"."+i.id;var n=m.linkGroups[p].linkedCharts.indexOf(a);if(n>=0){m.linkGroups[p].linkedCharts.splice(n,1);if(i.extendedModel.linkGroup){delete i.extendedModel.linkGroup}d.paint();Mt["b"].$("#linkGroupLength_"+p).html(m.linkGroups[p].linkedCharts.length);e.style.backgroundColor="rgba(217, 217, 217, 0.2)";f.showExistingLinks(p)}else{if(i.layoutType==="structure"||i.layoutType===o.STRUCTURE){m.linkGroups[p].linkedType="Structure"}else if(i.layoutType==="time"||i.layoutType===o.TIME){m.linkGroups[p].linkedType="Time"}m.linkGroups[p].linkedCharts.push(a);d.paint();Mt["b"].$("#linkGroupLength_"+p).html(m.linkGroups[p].linkedCharts.length);e.style.backgroundColor="rgba(37, 157, 187, 0.2)";f.activeLinkSelection({id:"linkGroup_"+p,type:m.linkGroups[p].type});f.showExistingLinks(p)}};this.removeLinkGroup=function(e,t){var i=e.split("_").pop();var a=m.linkGroups;var n=a[i];for(var r=0;r<n.linkedCharts.length;r++){var o=null;var l=n.linkedCharts[r].split(".")[1];for(var s=0;s<c.length;s++){if(l===c[s].id){o=c[s];break}}if(o&&o.extendedModel.linkGroup){delete o.extendedModel.linkGroup}}delete a[i];d.paint();if(p==i){f.highlightLinkContainers("",false)}f.showExistingLinks()};this.highlightLinkContainers=function(a,e,t){function getLinked(e){var t=m.extensionHash+"."+e.id;var i=m.linkGroups[p];return i.linkedType===a&&i.linkedCharts.indexOf(t)>=0}if(!e){Mt["b"].$('div[id*="linkGroup_"]').remove()}var i=[];if(a==="Time"){i=g}else if(a==="Structure"){i=h}var n=null;for(var r=0;i.length>r;r++){if(getLinked(i[r])){n=Mt["b"].Factories.ModelFactory.getParentContainer(m.firstObjectGrid,i[r])[0];break}}for(var o=0;o<i.length;o++){for(var l=0;i.length>l;l++){var s=Mt["b"].Models.Actions.ViewModelActions.General.getAbsolutePosition(i[l],m);S.top=s.y+"px";S.height=i[l].dimension.height+"px";S.left=s.x+"px";S.width=i[l].dimension.width+"px";if(getLinked(i[l])){S.backgroundColor="rgba(37, 157, 187, 0.2)";if(a==="Time"){if(t.type==="value"){if(m.linkGroups[p].x==undefined){m.linkGroups[p].x=s.x}}}else if(a==="Structure"){if(t.type==="value"){if(m.linkGroups[p].y==undefined){m.linkGroups[p].y=s.y}}}var d=document.getElementById("linkGroup_"+l+"_cId_"+i[l].id);if(!d){var c=document.createElement("div");u.parentNode.appendChild(c);c.setAttribute("id","linkGroup_"+l+"_cId_"+i[l].id);Mt["b"].Utils.DOM.setStyle(c,S);c.style.visibility="visible";Mt["b"].$(c).click(function(){f.updateLink(this,t)})}else{S.visibility="visible";Mt["b"].Utils.DOM.setStyle(d,S)}}else{if(n===null){var d=document.getElementById("linkGroup_"+l+"_cId_"+i[l].id);if(!d){S.backgroundColor="rgba(217, 217, 217, 0.2)";var c=document.createElement("div");u.parentNode.appendChild(c);c.setAttribute("id","linkGroup_"+l+"_cId_"+i[l].id);Mt["b"].Utils.DOM.setStyle(c,S);c.style.visibility="visible";Mt["b"].$(c).click(function(){f.updateLink(this,t)})}else{S.backgroundColor="rgba(217, 217, 217, 0.2)";S.visibility="visible";Mt["b"].Utils.DOM.setStyle(d,S)}}else{if(t.type==="axis"||t.type==="legend"||Mt["b"].Factories.ModelFactory.getParentContainer(m.firstObjectGrid,i[l])[0].id===n.id){if(a==="Time"&&t.type==="value"){if(s.x<=m.linkGroups[p].x+2&&s.x>=m.linkGroups[p].x-2){var d=document.getElementById("linkGroup_"+l+"_cId_"+i[l].id);if(!d){S.backgroundColor="rgba(217, 217, 217, 0.2)";var c=document.createElement("div");u.parentNode.appendChild(c);c.setAttribute("id","linkGroup_"+l+"_cId_"+i[l].id);Mt["b"].Utils.DOM.setStyle(c,S);c.style.visibility="visible";Mt["b"].$(c).click(function(){f.updateLink(this,t)})}else{S.backgroundColor="rgba(217, 217, 217, 0.2)";S.visibility="visible";Mt["b"].Utils.DOM.setStyle(d,S)}}}else if(a==="Structure"&&t.type==="value"){if(s.y<=m.linkGroups[p].y+2&&s.y>=m.linkGroups[p].y-2){var d=document.getElementById("linkGroup_"+l+"_cId_"+i[l].id);if(!d){S.backgroundColor="rgba(217, 217, 217, 0.2)";var c=document.createElement("div");u.parentNode.appendChild(c);c.setAttribute("id","linkGroup_"+l+"_cId_"+i[l].id);Mt["b"].Utils.DOM.setStyle(c,S);c.style.visibility="visible";Mt["b"].$(c).click(function(){f.updateLink(this,t)})}else{S.backgroundColor="rgba(217, 217, 217, 0.2)";S.visibility="visible";Mt["b"].Utils.DOM.setStyle(d,S)}}}else{var d=document.getElementById("linkGroup_"+l+"_cId_"+i[l].id);if(!d){S.backgroundColor="rgba(217, 217, 217, 0.2)";var c=document.createElement("div");u.parentNode.appendChild(c);c.setAttribute("id","linkGroup_"+l+"_cId_"+i[l].id);Mt["b"].Utils.DOM.setStyle(c,S);c.style.visibility="visible";Mt["b"].$(c).click(function(){f.updateLink(this,t)})}else{S.backgroundColor="rgba(217, 217, 217, 0.2)";S.visibility="visible";Mt["b"].Utils.DOM.setStyle(d,S)}}}}}}}};function createAxisLinking(){var e={"vertical-align":"top",borderBottom:"1px solid black"};var t={textAlign:"right"};var i=document.createElement("div");i.setAttribute("id","AxisLinking");Mt["b"].Utils.DOM.setStyle(i,{overflow:"auto",width:"100%",height:O+"px"});var a=document.createElement("table");a.setAttribute("cellSpacing","5px");a.setAttribute("ID","axisLinkingTable");var n=document.createElement("div");n.style.padding="0px 1px";Mt["b"].$(n).html("Axis Linking");var r=document.createElement("div");var o=document.createElement("hr");var l={margin:"0px 0px 0px 0px",color:"black",background:"black",height:"1px",padding:"0px 0 px 0 px 0 px"};Mt["b"].Utils.DOM.setStyle(o,l);r.appendChild(o);var s=document.createElement("tr");var d=document.createElement("td");Mt["b"].Utils.DOM.setStyle(d,e);d.setAttribute("width","10px");s.appendChild(d);var c=document.createElement("td");Mt["b"].$(c).html(v.getTranslation("LINK"));c.setAttribute("title",v.getTranslation("HELP_LINK_AXIS_LINK"));Mt["b"].Utils.DOM.setStyle(c,e);Mt["b"].Utils.DOM.setStyle(c,t);s.appendChild(c);var u=document.createElement("td");Mt["b"].$(u).html(v.getTranslation("TYPE"));u.setAttribute("title",v.getTranslation("HELP_LINK_AXIS_TYPE"));Mt["b"].Utils.DOM.setStyle(u,e);Mt["b"].Utils.DOM.setStyle(u,t);s.appendChild(u);var p=document.createElement("td");Mt["b"].$(p).html(v.getTranslation("CELLS"));p.setAttribute("title",v.getTranslation("HELP_LINK_AXIS_CELLS"));Mt["b"].Utils.DOM.setStyle(p,e);Mt["b"].Utils.DOM.setStyle(p,t);s.appendChild(p);var g=document.createElement("td");Mt["b"].$(g).html(v.getTranslation("ORIENTATION"));g.setAttribute("title",v.getTranslation("HELP_LINK_AXIS_ORIENTATION"));Mt["b"].Utils.DOM.setStyle(g,e);Mt["b"].Utils.DOM.setStyle(g,t);g.setAttribute("width","81px");g.style.textAlign="center";s.appendChild(g);var h=document.createElement("td");Mt["b"].$(h).html("+");h.setAttribute("title",v.getTranslation("HELP_LINK_AXIS_PLUS"));Mt["b"].$(h).css("cursor","pointer");Mt["b"].$(h).click(function(){!m.linkSettings.automaticLinking&&f.addLinkGroup("axis")});Mt["b"].Utils.DOM.setStyle(h,e);s.appendChild(h);a.appendChild(s);i.appendChild(a);return i}function createValueLinking(){var e={"vertical-align":"top",borderBottom:"1px solid black"};var t={textAlign:"right"};var i=document.createElement("div");i.setAttribute("id","ValueLinking");Mt["b"].Utils.DOM.setStyle(i,{overflow:"auto",width:"100%",height:O+"px"});var a=document.createElement("table");a.setAttribute("cellSpacing","5px");a.setAttribute("ID","valueLinkingTable");var n=document.createElement("div");n.style.padding="0px 1px";Mt["b"].$(n).html(v.getTranslation("VALUE_LINKING"));var r=document.createElement("div");var o=document.createElement("hr");var l={margin:"0px 0px 0px 0px",color:"black",background:"black",height:"1px",padding:"0px 0 px 0 px 0 px"};Mt["b"].Utils.DOM.setStyle(o,l);r.appendChild(o);var s=document.createElement("tr");var d=document.createElement("td");Mt["b"].Utils.DOM.setStyle(d,e);d.setAttribute("width","10px");s.appendChild(d);var c=document.createElement("td");Mt["b"].$(c).html(v.getTranslation("LINK"));c.setAttribute("title",v.getTranslation("HELP_LINK_VALUE_LINK"));Mt["b"].Utils.DOM.setStyle(c,e);Mt["b"].Utils.DOM.setStyle(c,t);s.appendChild(c);var u=document.createElement("td");Mt["b"].$(u).html(v.getTranslation("TYPE"));u.setAttribute("title",v.getTranslation("HELP_LINK_VALUE_TYPE"));Mt["b"].Utils.DOM.setStyle(u,e);Mt["b"].Utils.DOM.setStyle(u,t);s.appendChild(u);var p=document.createElement("td");Mt["b"].$(p).html(v.getTranslation("CELLS"));p.setAttribute("title",v.getTranslation("HELP_LINK_VALUE_CELLS"));Mt["b"].Utils.DOM.setStyle(p,e);Mt["b"].Utils.DOM.setStyle(p,t);s.appendChild(p);var g=document.createElement("td");Mt["b"].$(g).html("+");g.setAttribute("title",v.getTranslation("HELP_LINK_VALUE_PLUS"));Mt["b"].$(g).click(function(){!m.linkSettings.automaticLinking&&f.addLinkGroup("value")});Mt["b"].Utils.DOM.setStyle(g,e);s.appendChild(g);a.appendChild(s);i.appendChild(a);return i}function createLegendLinking(){var e={"vertical-align":"top",borderBottom:"1px solid black"};var t={textAlign:"right"};var i=document.createElement("div");i.setAttribute("id","LegendLinking");Mt["b"].Utils.DOM.setStyle(i,{overflow:"auto",width:"100%",height:O+"px"});var a=document.createElement("table");a.setAttribute("cellSpacing","5px");a.setAttribute("ID","legendLinkingTable");var n=document.createElement("div");n.style.padding="0px 1px";Mt["b"].$(n).html(v.getTranslation("DESCRIPTION_LINKING"));var r=document.createElement("div");var o=document.createElement("hr");var l={margin:"0px 0px 0px 0px",color:"black",background:"black",height:"1px",padding:"0px 0 px 0 px 0 px"};Mt["b"].Utils.DOM.setStyle(o,l);r.appendChild(o);var s=document.createElement("tr");var d=document.createElement("td");Mt["b"].Utils.DOM.setStyle(d,e);d.setAttribute("width","10px");s.appendChild(d);var c=document.createElement("td");Mt["b"].$(c).html(v.getTranslation("LINK"));c.setAttribute("title",v.getTranslation("HELP_LINK_LEGEND_LINK"));Mt["b"].Utils.DOM.setStyle(c,e);Mt["b"].Utils.DOM.setStyle(c,t);s.appendChild(c);var u=document.createElement("td");Mt["b"].$(u).html(v.getTranslation("TYPE"));u.setAttribute("title",v.getTranslation("HELP_LINK_LEGEND_TYPE"));Mt["b"].Utils.DOM.setStyle(u,e);Mt["b"].Utils.DOM.setStyle(u,t);s.appendChild(u);var p=document.createElement("td");Mt["b"].$(p).html(v.getTranslation("CELLS"));p.setAttribute("title",v.getTranslation("HELP_LINK_LEGEND_CELLS"));Mt["b"].Utils.DOM.setStyle(p,e);Mt["b"].Utils.DOM.setStyle(p,t);s.appendChild(p);var g=document.createElement("td");Mt["b"].$(g).html(v.getTranslation("ORIENTATION"));g.setAttribute("title",v.getTranslation("HELP_LINK_LEGEND_ORIENTATION"));Mt["b"].Utils.DOM.setStyle(g,e);Mt["b"].Utils.DOM.setStyle(g,t);g.setAttribute("width","81px");g.style.textAlign="center";s.appendChild(g);var h=document.createElement("td");Mt["b"].$(h).html("+");h.setAttribute("title",v.getTranslation("HELP_LINK_LEGEND_PLUS"));Mt["b"].$(h).click(function(){!m.linkSettings.automaticLinking&&f.addLinkGroup("legend")});Mt["b"].Utils.DOM.setStyle(h,e);s.appendChild(h);a.appendChild(s);i.appendChild(a);return i}function createLinkingSettings(){var e=document.createElement("div"),t=document.createElement("table");e.id="LinkingSettings";e.style.minHeight=O+"px";e.style.overflow="auto";e.appendChild(t);updateLinkingSettingsTable(t);return e}function updateLinkingSettingsTable(t){var e=m.linkSettings;n.buildTableRow(t,[{type:"text",value:v.getTranslation("AUTO_LINKING")},{type:"checkbox",change:autoLinkingHandle,id:"automaticLinkingCheck",checked:e.automaticLinking}]);n.buildTableRow(t,[{type:"separator"},{type:"separator"}]);n.buildTableRow(t,[{type:"text",value:v.getTranslation("STRUCTURE_AXIS"),disabled:!e.automaticLinking},{type:"selectbox",disabled:!e.automaticLinking,width:"100%",change:onChangeDropdown,id:"structureAxisOrientation",value:e.structureAxisOrientation,values:i,translations:[v.getTranslation("START"),v.getTranslation("MID"),v.getTranslation("END")]}]);n.buildTableRow(t,[{type:"text",value:v.getTranslation("STRUCTURE_LEGEND"),disabled:!e.automaticLinking},{type:"selectbox",disabled:!e.automaticLinking,width:"100%",change:onChangeDropdown,id:"structureLegendOrientation",value:e.structureLegendOrientation,values:x,translations:[v.getTranslation("TOP"),v.getTranslation("MID"),v.getTranslation("BOTTOM")]}]);n.buildTableRow(t,[{type:"separator"},{type:"separator"}]);n.buildTableRow(t,[{type:"text",value:v.getTranslation("TIME_AXIS"),disabled:!e.automaticLinking},{type:"selectbox",disabled:!e.automaticLinking,width:"100%",change:onChangeDropdown,id:"timeAxisOrientation",value:e.timeAxisOrientation,values:i,translations:[v.getTranslation("START"),v.getTranslation("MID"),v.getTranslation("END")]}]);n.buildTableRow(t,[{type:"text",value:v.getTranslation("TIME_LEGEND"),disabled:!e.automaticLinking},{type:"selectbox",disabled:!e.automaticLinking,width:"100%",change:onChangeDropdown,id:"timeLegendOrientation",value:e.timeLegendOrientation,values:b,translations:[v.getTranslation("LEFT"),v.getTranslation("MID"),v.getTranslation("RIGHT")]}]);function autoLinkingHandle(e){m.linkSettings.automaticLinking=e.currentTarget.checked;while(t.hasChildNodes()){t.removeChild(t.firstChild)}updateLinkingSettingsTable(t);f.showExistingLinks();Mt["b"].DataObjects.DocumentDO.triggerDelayedRepaint()}function onChangeDropdown(e){m.linkSettings[e.currentTarget.id]=Ne["a"].translateValue(e.currentTarget.value);while(t.hasChildNodes()){t.removeChild(t.firstChild)}updateLinkingSettingsTable(t);Mt["b"].DataObjects.DocumentDO.triggerDelayedRepaint()}}function deleteXYFromLink(){for(var e in m.linkGroups){var t=m.linkGroups[e];delete t.x;delete t.y}}};Mt["b"].UI=Mt["b"].UI||{};Mt["b"].UI.ListKeyDialog=function(e){var s=this;var d=JSON.parse(JSON.stringify(e.obj));var o=e.parent;var l=e.id;var t=e.context;var c=Mt["b"].DataObjects.RuntimeDO;var u=new Mt["b"].Utils.Calculator(t);var p=490;var g=300;var h=6;var f=c.getTranslation("INPUT_LIST_DEFINITIONS");var m,v,b,T,x;var n=[c.getTranslation("LINE"),"",c.getTranslation("DESCRIPTION"),c.getTranslation("KEY"),c.getTranslation("DEFAULT")];var r={backgroundColor:"rgb(240, 240, 240)",border:"0px"};var E={backgroundColor:"rgb(240, 240, 240)",border:"0px",color:"rgb(150,150,150)"};var y="Auto",C=c.getTranslation("NEW_ENTRY");var S=3;var M=2;var O=[0,16,175,175,0];var A="0px 3px";s.open=function(){var e=document.getElementById("listKeyDialog");if(!e){var t="listKeyDialog";var i=[{text:c.getTranslation("OKAY"),id:"listKeyOkayButton",click:s.okay},{text:c.getTranslation("CANCEL"),id:"listKeyCancelButton",click:s.close}];var a=new Mt["b"].UI.HiCoDialogDefinition(t,f,i);m=a.getFontSize();a.setWidth(p+"px");a.setHeight(g);a.setPosition("center");v=new Mt["b"].UI.HiCoDialog(a);b=v.getDialogDiv();var n={position:"absolute",visibility:"hidden",height:"auto",width:"auto"};var r=document.createElement("div");r.setAttribute("id","hiddenDiv");Mt["b"].Utils.DOM.setStyle(r,n);r.style.fontSize=m;b.appendChild(r);v.setEvent("dialogresize",function(e,t){var i=Mt["b"].$(b).parent().height()-70;var a=Mt["b"].$(b).parent().width();Mt["b"].$(b).height(i);Mt["b"].$(x).height(i-39);Mt["b"].$(T).width(a-h-h);Mt["b"].$(x).width(a-h-h)});v.setCSS("overflow","hidden");v.setCSS();calculateLengths();b.appendChild(fillContent());linkScrollBar();var o=parseInt(v.highest());var l=parseInt(v.getDialog().offsetParent().css("z-index"));if(o>l){o+=1;v.getDialog().offsetParent().css("z-index",o)}v.getDialog().dialog("open");Mt["b"].$(x.children[0]).sortable()}else{e.parentNode.remove(e);s.open()}};s.okay=function(){if(checkForNonDuplicates()){if(saveInput()){s.close()}else{Mt["b"].Factories.DialogFactory.createMissingFieldDialog()}}else{Mt["b"].Factories.DialogFactory.createDuplicateEntriesDialog()}};s.close=function(){v.close()};function calculateLengths(){var e=document.getElementById("hiddenDiv");for(var t=0,i=n.length;t<i;t++){Mt["b"].$(e).html(n[t]);var a=e.clientWidth+1;if(O[t]<a){O[t]=a}}}function linkScrollBar(){T.scrollLeft=x.scrollLeft}function saveInput(){d.listContent=[];d.listContent.push({description:c.getTranslation("CHOOSE"),key:"choose",originalDescription:c.getTranslation("CHOOSE")});var e,t,i,a,n="choose";var r=Mt["b"].$(x).find("tr");for(e=0,t=r.length;e<t;e++){if(!Mt["b"].$(r[e]).hasClass("dummyRow")){i=u.encode(r[e].cells[S].children[0].value);a=r[e].cells[M].children[0].value;d.listContent.push({description:i,key:u.encode(a),originalDescription:i});if(i==undefined||i===""||i===C){return false}if(a==undefined||a===""||a===y){return false}if(r[e].cells[4].children[0].checked){n=u.encode(a)}}}d.listContentDefault=n;o.setListKeyDialog(d,l);return true}function fillContent(){var e=document.createElement("div");e.setAttribute("id","keyDialogDiv");Mt["b"].$(e).addClass("ui-corner-bottom");Mt["b"].$(e).css({border:"1px solid rgb(170, 170, 170)"});createHeader();e.appendChild(T);createTable();e.appendChild(x);return e}function createHeader(){T=document.createElement("div");T.setAttribute("id","keyDialogHeaderDiv");Mt["b"].$(T).css({height:"20px",width:p-h-h+"px",overflow:"hidden",padding:"0 6px"});var e=document.createElement("table");var t=[{type:"text",value:n[0],tdStyle:{padding:A,width:O[0]+"px",minWidth:O[0]+"px"}},{type:"text",value:n[1],tdStyle:{padding:A,width:O[1]+"px",minWidth:O[1]+"px"}},{type:"text",value:n[3],tdStyle:{padding:A,width:O[M]+"px",minWidth:O[M]+"px"}},{type:"text",value:n[2],tdStyle:{padding:A,width:O[S]+"px",minWidth:O[S]+"px",marginRight:"20px"}},{type:"text",value:n[4],tdStyle:{padding:A,width:O[4]+"px",minWidth:O[4]+"px",marginRight:"20px"}}];v.buildTableRow(e,t);t=[{type:"separator",color:"lightGray",tdStyle:{padding:A,width:O[0]+"px",minWidth:O[0]+"px"}},{type:"separator",color:"lightGray",tdStyle:{padding:A,width:O[1]+"px",minWidth:O[1]+"px"}},{type:"separator",color:"lightGray",tdStyle:{padding:A,width:O[2]+"px",minWidth:O[2]+"px"}},{type:"separator",color:"lightGray",tdStyle:{padding:A,width:O[3]+"px",minWidth:O[3]+"px"}},{type:"separator",color:"lightGray",tdStyle:{padding:A,width:O[4]+"px",minWidth:O[4]+"px",marginRight:"20px"}}];v.buildTableRow(e,t);T.appendChild(e)}function createTable(){x=document.createElement("div");x.setAttribute("id","keyDialogTableDiv");Mt["b"].$(x).css({height:"165px",width:p-h-h+"px",overflow:"auto",padding:"6px"});var e=document.createElement("table");Mt["b"].$(x).scroll(function(){linkScrollBar()});var t=d.listContent?d.listContent:[];var i=d.listContentDefault?d.listContentDefault:"choose";for(var a=1,n=t.length;a<n;a++){var r=t[a];var o=i===t[a].key;var l=r.key?r.key:y;var s=createRows(a,l,r.originalDescription,o);v.buildTableRow(e,s)}addNewDummyRow(e);x.appendChild(e)}function createRows(e,t,i,a){var n=[{type:"iconbutton",id:e+"##delete",iconName:"delete_small.png",click:deleteRow,tooltip:c.getTranslation("HELP_TABLE_LISTKEYDIALOG_DELETE"),tdStyle:{padding:A,textAlign:"center",width:O[0]+"px",minWidth:O[0]+"px"}},{type:"icon",id:e+"##dragger",iconName:"move.png",tooltip:c.getTranslation("HELP_TABLE_LISTKEYDIALOG_DRAG"),style:{height:"16px",width:"16px"},tdStyle:{padding:A,width:O[1]+"px",minWidth:O[1]+"px",textAlign:"center"}},{type:"textinput",id:e+"##key",value:u.decode(t),length:25,style:t===y?E:r,focusIn:autoFocusIn,focusOut:checkDescription,tdStyle:{padding:A,width:O[M]+"px",minWidth:O[M]+"px",textAlign:"center"}},{type:"textinput",id:e+"##description",value:u.decode(i),length:25,style:i===C?E:r,focusIn:entryFocusIn,focusOut:autoFocusOut,tdStyle:{padding:A,width:O[S]+"px",minWidth:O[S]+"px",textAlign:"center"}},{type:"checkbox",id:e+"##default",checked:a,click:handleDefault,group:"entryDefaultGroup",tooltip:c.getTranslation("HELP_TABLE_LISTKEYDIALOG_DEFAULT"),tdStyle:{padding:A,textAlign:"center",width:O[4]+"px",minWidth:O[4]+"px"}}];return n}function handleDefault(){var e=Mt["b"].$("[name='entryDefaultGroup']");for(var t=0,i=e.length;t<i;t++){if(e[t].id!==this.id){e[t].checked=false}}}function checkForNonDuplicates(){var e=Mt["b"].$(x).find("tr");var t={},i,a;for(i=0,a=e.length;i<a;i++){if(t[e[i].children[M].children[0].value]){return false}t[e[i].children[M].children[0].value]=true}return true}function autoFocusIn(){this.style.color="";if(this.value===y){this.value=""}}function entryFocusIn(){this.style.color="";if(this.value===C){this.value=""}}function autoFocusOut(){if(this.value===""){this.value=C;this.style.color="rgb(150,150,150)"}if(this.value===""){this.value=C;this.style.color="rgb(150,150,150)";if(Mt["b"].$(this).closest("tr")[0].children[M].children[0].value===y){Mt["b"].$(this).closest("tr").addClass("dummyRow");removeDummyRow()}}else if(Mt["b"].$(this).closest("tr").hasClass("dummyRow")){Mt["b"].$(this).closest("tr").removeClass("dummyRow");Mt["b"].$(this).closest("tr").find('input[id*="##default"]').show();Mt["b"].$(this).closest("tr").find('input[id*="##delete"]').show();addNewDummyRow()}}function deleteRow(){var e=this.id.split("##")[0];var t=document.getElementById(e+"##default").checked;Mt["b"].$(this).closest("tr").remove();if(t){var i=Mt["b"].$(x).find("tr");for(var a=0,n=i.length;a<n;a++){if(!Mt["b"].$(i[a]).hasClass("dummyRow")){i[a].children[4].children[0].checked=true;break}}}if(checkForNonDuplicates()){updateRowColorsNoDuplicates()}}function updateRowColorsNoDuplicates(){var e=Mt["b"].$(x).find("tr");for(var t=0,i=e.length;t<i;t++){if(!Mt["b"].$(e[t]).hasClass("dummyRow")){e[t].children[M].children[0].style.color=""}}}function getNewIdx(e){var t=0;for(var i=0,a=e.length;i<a;i++){var n=parseInt(e[i].children[0].children[0].id.split("##")[0]);if(t<=n){t=n+1}}return t}function checkDescription(){if(checkValue(this)){this.style.color="rgb(255, 0, 0)"}if(this.value===""){this.value=y;this.style.color="rgb(150,150,150)";if(Mt["b"].$(this).closest("tr")[0].children[S].children[0].value===C){Mt["b"].$(this).closest("tr").addClass("dummyRow");removeDummyRow()}}else if(Mt["b"].$(this).closest("tr").hasClass("dummyRow")){Mt["b"].$(this).closest("tr").removeClass("dummyRow");Mt["b"].$(this).closest("tr").find('input[id*="##default"]').show();Mt["b"].$(this).closest("tr").find('input[id*="##delete"]').show();addNewDummyRow()}}function checkValue(e){var t=Mt["b"].$(x).find("tr");for(var i=0,a=t.length;i<a;i++){if(e.id!==t[i].children[M].children[0].id&&t[i].children[M].children[0].value===e.value){return true}}return false}function removeDummyRow(){var e=Mt["b"].$(x).find(".dummyRow");if(e.length>1){for(var t=1,i=e.length;t<i;t++){var a=e[t];Mt["b"].$(a).remove()}}Mt["b"].$(e[0]).find('input[id*="##default"]')[0].disabled=true}function addNewDummyRow(e){var t=e;if(!t){t=x.children[0]}var i=getNewIdx(t.children);var a=createRows(i,y,C,false);v.buildTableRow(t,a);var n=t.children[t.children.length-1];Mt["b"].$(n).addClass("dummyRow");Mt["b"].$(n).find('input[id*="##default"]').hide();Mt["b"].$(n).find('input[id*="##delete"]').hide()}};Mt["b"].UI=Mt["b"].UI||{};Mt["b"].UI.IndicationDialog=function(){var u=this;var C=Mt["b"].DataObjects.RuntimeDO;var s;var S;var c=C.getTranslation("INDICATIONS");var p;var g;var h=18;var n=false;var f;var M=Mt["b"].Utils.Constants.TypeValues.highlightType;var m=Mt["b"].Utils.Constants.TypeValues.indicator;var t=null;var i=["","HELP_INDICATIONS_COMPARE_ACTIVE","HELP_INDICATIONS_COMPARE_CONDITION","HELP_INDICATIONS_COMPARE_NAME","HELP_INDICATIONS_COMPARE_CONTEXT","HELP_INDICATIONS_COMPARE_CHART"];var a=["","HELP_INDICATIONS_HIGHLIGHT_ACTIVE","HELP_INDICATIONS_HIGHLIGHT_CONDITION","HELP_INDICATIONS_HIGHLIGHT_NAME","HELP_INDICATIONS_HIGHLIGHT_CONTEXT","HELP_INDICATIONS_HIGHLIGHT_CHART"];var v=[{id:"comp-tabs-compares",text:C.getTranslation("COMPARES"),tooltip:C.getTranslation("HELP_INDICATIONS_COMPARE"),buildUp:createCompareTab},{id:"comp-tabs-highlight",text:C.getTranslation("HIGHLIGHTS"),tooltip:C.getTranslation("HELP_INDICATIONS_HIGHLIGHT"),buildUp:createHighlightTab}];var b=["function","active","condition","name","context","chart"];var T=["",C.getTranslation("ACTIVE"),C.getTranslation("CONDITION"),C.getTranslation("NAME"),C.getTranslation("EXTENSION"),C.getTranslation("CHART")];var O=[0,0,0,0,0,0];var A;var x;var E;var _;var L;update();u.open=function(e){var t="indicationDialog";var i=Mt["b"].$(e).offset();var a=[{text:C.getTranslation("OKAY"),id:"indicationDialogOkayButton",click:okay},{text:C.getTranslation("CANCEL"),id:"indicationDialogCancelButton",click:cancel},{text:C.getTranslation("APPLY"),id:"indicationDialogApplyButton",click:assume}];var n=new Mt["b"].UI.HiCoDialogDefinition(t,c,a);S=n.getFontSize();n.setPosition([i.left,i.top]);n.setWidth(710);n.setHeight(350);n.setResizable(true);n.setParentDomElement(e.parentNode);n.setTooltip(C.getTranslation("HELP_INDICATIONS"));g=new Mt["b"].UI.HiCoDialog(n);g.setEscapeBeforeHandler(escapeBeforeHandler);g.setEscapeAfterHandler(escapeAfterHandler);p=g.getDialogDiv();var r={position:"absolute",visibility:"hidden",height:"auto",width:"auto"};var o=document.createElement("div");o.setAttribute("id","hiddenDiv");Mt["b"].Utils.DOM.setStyle(o,r);o.style.fontSize=S;p.appendChild(o);calculateLength();f=g.buildTabs("compCompareTabDiv",v,p,"auto",{top:"0px",left:"0px"},null,true);g.decorateTabs(0,v);Mt["b"].$(f).height("100%");g.setEvent("dialogresize",function(e,t){var i=Mt["b"].$(p).parent().height()-70;Mt["b"].$(p).height(i);Mt["b"].$(".ui-tabs-panel",Mt["b"].$(p).parent()).height(i-Mt["b"].$("#compCompareTabDiv > .ui-tabs-nav").height()-h)});p.setAttribute("class",t);g.setCSS("overflow","hidden");g.setCSS();var l=parseInt(g.highest());var s=parseInt(g.getDialog().offsetParent().css("z-index"));if(l>s){l+=1;g.getDialog().offsetParent().css("z-index",l)}g.getDialog().dialog("open");Mt["b"].$(".ui-tabs-panel",Mt["b"].$(p).parent()).css("overflow-y","auto");var d=Mt["b"].$(p).height()-Mt["b"].$("#compCompareTabDiv > .ui-tabs-nav").height();Mt["b"].$(".ui-tabs-panel",Mt["b"].$(p).parent()).height(d-h)};function okay(){changeSelection();cancel();s[0]&&s[0].paint()}function assume(){changeSelection();freeResources();s[0]&&s[0].paint()}function changeSelection(){var e={};for(var t=0;t<A.length;t++){var i=Mt["b"].DataObjects.DocumentDO.getExtension(A[t].extensionId);var a=A[t].comp.id.split(".")[0];a=a.replace("tableContainer","chart").replace("containerModel","");var n=Mt["b"].Factories.ModelFactory.getModelById(i.getController().getRootModel(),a);var r=checkChart(A[t],n,t);e[i.getId()]=i;for(var o=0;o<r.extendedModel.compares.length;o++){if(r.extendedModel.compares[o].id===A[t].comp.id){r.extendedModel.compares[o]=clone(A[t].comp);break}}}for(var t=0;t<x.length;t++){var i=Mt["b"].DataObjects.DocumentDO.getExtension(x[t].extensionId);var n=Mt["b"].Factories.ModelFactory.getModelById(i.getController().getRootModel(),x[t].highlight.id.split(".")[0]);var r=checkContextAndChart(x[t],n,t);e[i.getId()]=i;for(var o=0;o<r.extendedModel.highlights.length;o++){if(r.extendedModel.highlights[o].id===x[t].highlight.id){r.extendedModel.highlights[o]=clone(x[t].highlight);break}}}for(var l in e){if(e.hasOwnProperty(l)){e[l].getController().updateLayoutDefinition()}}}function cancel(){Mt["b"].$("#highlightProperties").remove();Mt["b"].$("#compareProperties").remove();A=[];x=[];E=[];_=[];L=[];freeResources();g.close()}function escapeBeforeHandler(){var e=document.getElementById("highlightProperties");if(e){e.parentNode.remove(e)}e=document.getElementById("compareProperties");if(e){e.parentNode.remove(e)}A=[];x=[];E=[];_=[];L=[];freeResources();return false}function escapeAfterHandler(){}function freeResources(){var e=document.getElementById("formulaEditor");if(e!==null){if(t!==null){t.close()}}}u.setCompare=function(e,t){var i=t.idx;var a=t.containerModel;A[i].comp=e;checkForPlausability(A[i],a,i)};u.setHighlight=function(e,t){var i=t.idx;var a=t.containerModel;x[i].highlight=clone(e);checkHighlightPlausability(x[i],a,i)};u.getDialog=function(){return g};u.getAvailCompares=function(){return A};u.setActiveTab=function(e){return Mt["b"].$(f).tabs("option","selected",e)};u.getAvailHighlights=function(){return x};u.update=function(){update();rebuildTabs()};Mt["b"].UI.IndicationDialog.iconAction=function(e,t,i){var a=e.target;var n=a.id.split("##");switch(n[1]){case"descIcon":i.count=Mt["b"].$(a).hasClass("active")?1:0;break;case"ascIcon":i.count=Mt["b"].$(a).hasClass("active")?1:2;break}};Mt["b"].UI.IndicationDialog.changeIconFromOutside=function(e){var t=e.config.sortList;var i=Mt["b"].$(e).find(".sortIcon").removeClass("active");for(var a=0;a<i.length;a++){i[a].src=i[a].id.split("##")[1]==="descIcon"?pe["a"].imgPath+"descending.png":pe["a"].imgPath+"ascending.png";for(var n=0;n<t.length;n++){if(t[n][0]!==parseInt(i[a].id.split("##")[2])){continue}if(t[n][1]===1||t[n][1]==="d"){if(i[a].id.split("##")[1]==="descIcon"){i[a].src=pe["a"].imgPath+"descending_active.png";Mt["b"].$(i[a]).addClass("active")}}else if(t[n][1]===0||t[n][1]==="a"){if(i[a].id.split("##")[1]==="ascIcon"){i[a].src=pe["a"].imgPath+"ascending_active.png";Mt["b"].$(i[a]).addClass("active")}}}}};Mt["b"].UI.IndicationDialog.getDialog=function(){return u};function update(){s=Mt["b"].DataObjects.DocumentDO.getAllExtensions();getAvailCompares();getAvailHighlights();E=Mt["b"].DataObjects.DocumentDO.getAllExtensions().filter(function(e){return e.getController().getRootModel().firstObjectGrid!==null});_=[];L=[];for(var e=0;e<E.length;e++){_.push(E[e].getId());L.push(E[e].getTitle())}}function checkContextAndChart(e,t,i){var a=e.highlight;var n=a.id+"."+i;var r=E[document.getElementById("select##"+n+"##highlightContext").selectedIndex];var o=r.getController().getRootModel();var l=[];if(o.firstObjectGrid){Mt["b"].Models.Actions.ViewModelActions.General.getAllCharts(o.firstObjectGrid,l)}var s=document.getElementById("select##"+n+"##highlightChart").selectedIndex;var d=l[s];if(d&&(r.getId()!==e.extensionId||d.id!==a.id.split(".")[0])){var c=clone(a);var u=d.extendedModel.expressions[0].id;for(var p=0;p<d.extendedModel.expressions.length;p++){if(d.extendedModel.expressions[p].id.split(".").pop()===c.value.keyfigure.split(".").pop()){u=d.extendedModel.expressions[p].id;break}}c.value.keyfigure=u;c.legend.keyfigure=u;var g=Mt["b"].Models.Actions.ViewModelActions.General.getNewHighlightId(d.extendedModel.highlights);c.id=d.id+".highlight."+g;c.name=c.id;Mt["b"].Models.Actions.ExtendedModelActions.AnyChartModel.addHighlight(d.extendedModel,c);Mt["b"].Models.Actions.ExtendedModelActions.AnyChartModel.removeHighlight(t.extendedModel,a.id);a.id=c.id;a.name=c.name;a.value.keyfigure=c.value.keyfigure;a.legend.keyfigure=c.legend.keyfigure;e.extensionId=r.getId();return d}return t}function checkChart(e,t,i){var a=e.comp;var n=a.id+"."+i;var r=E[document.getElementById("select##"+n+"##context").selectedIndex];var o=r.getController().getRootModel();var l=[];if(o.firstObjectGrid){Mt["b"].Models.Actions.ViewModelActions.General.getAllCharts(o.firstObjectGrid,l)}var s=document.getElementById("select##"+n+"##chart").selectedIndex;var d=l[s];var c=a.id.split(".")[0];c=c.replace("tableContainer","chart").replace("containerModel","");if(d&&(r.getId()!==e.extensionId||d.id!==c)){var u=clone(a);var p=Mt["b"].Models.Actions.ViewModelActions.CompareModel.getNewId(d.extendedModel.compares);u.id=d.id+".compare"+p;u.name=u.id;u.view=u.id;u.isUserLayouted=false;var g=Mt["b"].DataObjects.DocumentDO.getExtension(e.extensionId);var n=a.id.split(".")[0];var h="COMP:"+g.getId()+"#ctx1#"+n+"#"+a.id.split(".").pop();var f=Mt["b"].DataObjects.DocumentDO.getVariableByDefinition(h);if(f){f.definition="COMP:"+r.getId()+"#ctx1#"+u.id.split(".")[0]+"#"+u.id.split(".").pop()}Mt["b"].Models.Actions.ExtendedModelActions.AnyChartModel.addCompare(d.extendedModel,u);Mt["b"].DataObjects.CommentRepo.updateCompareReference(g.getId(),r.getId(),a.id,u);Mt["b"].Models.Actions.ExtendedModelActions.AnyChartModel.removeCompare(t.extendedModel,a.id);a.id=u.id;e.extensionId=r.getId();a.name=u.name;var m=Mt["b"].DataObjects.ContextRepo.getContextByCid(d.extendedModel.contextId);for(var v=0;v<m.columns.length;v++){if(m.columns[v].id.split(".").pop()===a.from.split("#").pop()){a.fromAbsolutePosition.positionInGroup=v}if(m.columns[v].id.split(".").pop()===a.to.split("#").pop()){a.toAbsolutePosition.positionInGroup=v}}return d}return t}function rebuildTabs(){if(Mt["b"].$(p).dialog("isOpen")===true){calculateLength();var e=Mt["b"].$("#compareTable")[0].config.sortList;Mt["b"].$("#comp-tabs-compares").html(createCompareTab());Mt["b"].$("#compareTable").trigger("sorton",[e]);e=Mt["b"].$("#highlightTable")[0].config.sortList;Mt["b"].$("#comp-tabs-highlight").html(createHighlightTab());Mt["b"].$("#highlightTable").trigger("sorton",[e])}}function clone(e){return JSON.parse(JSON.stringify(e))}function checkForPlausability(e,t,i){var a=e.comp.from;var n=e.comp.to;var r=a.split("#");var o=n.split("#");a=r[0].split("@");n=o[0].split("@");var l=a.length;var s=Mt["b"].DataObjects.ContextRepo.getContextByCid(t.extendedModel.contextId);if(!s||l!==s.rows.length){if(e.comp.compareFromPos!==m.POSITION&&e.comp.compareToPos!==m.POSITION){markElement(e.comp,i);return}}var d=false;var c=false;if(a[0]===m.AXIS){d=true}if(n[0]===m.AXIS){c=true}for(var u=0;u<t.extendedModel.expressions.length;u++){var p=t.extendedModel.expressions[u].id.split(".").pop();if(p===r[1]){d=true}if(p===o[1]){c=true}}if(d!==true||c!==true){markElement(e.comp,i);return}unMarkElement(e.comp,i)}function checkHighlightPlausability(e,t,i){var e=e.highlight;var a=Mt["b"].DataObjects.ContextRepo.getContextByCid(t.extendedModel.contextId);if(e.type===M.VALUE){if(e.value.category!==m.POSITION){var n=e.value.path.split("@");if(!a||n.length!==a.rows.length){markElement(e,i);return}}if(e.value.type!==m.STACK){var r=false;for(var o=0;o<t.extendedModel.expressions.length;o++){var l=t.extendedModel.expressions[o].id;if(l===e.value.keyfigure){r=true;break}}if(r!==true){markElement(e,i);return}}}else if(e.type===M.CATEGORY_LABEL){var n=e.categoryLabel.path.split("@");if(!a||n.length!==a.rows.length){markElement(e,i);return}}else if(e.type===M.LEGEND){var r=false;for(var o=0;o<t.extendedModel.expressions.length;o++){var l=t.extendedModel.expressions[o].id;if(l===e.legend.keyfigure){r=true;break}}if(r!==true){markElement(e,i);return}}unMarkElement(e,i)}function markElement(e,t){document.getElementById("select##"+e.id+"."+t+"##name").style.color="#FF0000"}function unMarkElement(e,t){document.getElementById("select##"+e.id+"."+t+"##name").style.color="#000000"}function getAvailHighlights(){x=[];for(var e=0;e<s.length;e++){var t=s[e];var i=t.getController().getRootModel();if(i.firstObjectGrid!==null&&i.firstObjectGrid!==undefined){var a=[];Mt["b"].Models.Actions.ViewModelActions.General.getAllCharts(i.firstObjectGrid,a);for(var n=0;n<a.length;n++){var r=a[n].extendedModel;for(var o=0;o<r.highlights.length;o++){var l=clone(r.highlights[o]);x.push({extensionId:t.getId(),highlight:l})}}}}}function getAvailCompares(){A=[];for(var e=0;e<s.length;e++){var t=s[e];var i=t.getController().getRootModel();if(i.firstObjectGrid!==null&&i.firstObjectGrid!==undefined){var a=[];Mt["b"].Models.Actions.ViewModelActions.General.getAllCharts(i.firstObjectGrid,a);for(var n=0;n<a.length;n++){var r=a[n].extendedModel;for(var o=0;o<r.compares.length;o++){var l=clone(r.compares[o]);A.push({comp:l,extensionId:t.getId()})}}}}}function setCharts(e){var t=[];var i=[];for(var a=0;a<e.length;a++){var n=e[a].name?e[a].name:e[a].id;i.push(n);t.push(e[a].id)}return{names:i,ids:t}}function closeInput(e){if(n){return}n=true;var t=e.parentNode;var i=e.value;Mt["b"].$(e).remove();t.innerHTML=i;var a=t.id.split("##");if(a[1].indexOf("compare")!==-1){A[a[1].split(".").pop()].comp.name=i}else if(a[1].indexOf("highlight")!==-1){x[a[1].split(".").pop()].highlight.name=i}}function addInput(e){if(e.getElementsByTagName("input").length>0){return}n=false;var t=e.innerHTML;e.innerHTML="";var i=15;var a=document.createElement("input");a.setAttribute("type","text");a.setAttribute("size",i.toString());a.setAttribute("maxlength",i.toString());a.setAttribute("value",t);a.style.fontSize=2;a.style.fontWeight=12;Mt["b"].$(a).on("focusout",function(e){closeInput(e.target)});Mt["b"].$(a).on("keydown",function(e){if(e.which===13){closeInput(e.target)}});e.appendChild(a);a.focus()}u.openCompareProperties=function(e,t){var i=t.getController().getRootModel();var a=e.id.split(".")[0].replace("tableContainer","chart").replace("containerModel","");var n=Mt["b"].Factories.ModelFactory.getModelById(i,a);if(!n){console.warn("IndicationDialog.openCompareProperties: could not locate chart");return}var r=-1,o=null;for(var l=0;l<A.length;l++){if(A[l].comp.id===e.id&&A[l].extensionId===t.getId()){r=l;o=A[l].comp;break}}if(!o){console.warn("IndicationDialog.openCompareProperties: could not locate compare");return}var s={extension:t,containerModel:n,idx:r,currComp:o,dialogObj:g,availCompares:A};var d=new Mt["b"].UI.CompareProperties(s);d.open(u)};function openCompareProperties(e){var t=e.target.id.split("##");var i=document.getElementById("select##"+t[1]+"##context").selectedIndex;var a=E[i];var n=a.getController().getRootModel();var r=[];if(n.firstObjectGrid){Mt["b"].Models.Actions.ViewModelActions.General.getAllCharts(n.firstObjectGrid,r)}var i=document.getElementById("select##"+t[1]+"##chart").selectedIndex;var o=r[i];if(o){var l=t[1].split(".").pop();var s=A[l];if(s){var d={extension:a,containerModel:o,idx:l,currComp:s.comp,dialogObj:g,availCompares:A};var c=new Mt["b"].UI.CompareProperties(d);c.open(u)}}}u.openHighlightProperties=function(e,t,i){var a=-1,n=null;for(var r=0;r<x.length;r++){var o=x[r];if(o.highlight.id===e.id&&o.extensionId===i.getId()){a=r;n=o.highlight;break}}if(!n){console.warn("IndicationDialog.openHighlightProperties: could not locate highlight");return}var l={extension:i,idx:a,highlight:n,dialogObj:g,containerModel:t};var s=new Mt["b"].UI.HighlightProperties(l);s.open(u)};function openHighlightProperties(e){var t=e.target.id.split("##")[1];var i=document.getElementById("select##"+t+"##highlightContext").selectedIndex;var a=E[i];var n=a.getController().getRootModel();var r=[];if(n.firstObjectGrid){Mt["b"].Models.Actions.ViewModelActions.General.getAllCharts(n.firstObjectGrid,r)}var i=document.getElementById("select##"+t+"##highlightChart").selectedIndex;var o=r[i];if(o){var l=t.split(".").pop();var s=x[l];var d={extension:a,idx:l,highlight:s.highlight,dialogObj:g,containerModel:o};var c=new Mt["b"].UI.HighlightProperties(d);c.open(u)}}function openFormulaEditor(e,t){var i=e.target.id.split("##")[1];var a,n,r,o,l,s,d;if(t===M.COMPARE){a=A[i.split(".").pop()];n=a.comp.name?a.comp.name:a.comp.id;s=a.comp.id;d=a.comp}else if(t===M.HIGHLIGHT){a=x[i.split(".").pop()];n=a.highlight.name?a.highlight.name:a.highlight.id;s=a.highlight.id;d=a.highlight}r=Mt["b"].DataObjects.DocumentDO.getExtension(a.extensionId);o=Mt["b"].Factories.ModelFactory.getModelById(r.getController().getRootModel(),i.split(".")[0]);l={extension:r,cid:o.extendedModel.contextId,parentDialog:u,title:n,expressionObject:d,functionTarget:s,type:t};var c=new Mt["b"].UI.ValueLabelShowFormulaDialog(l);c.open(e.target)}function copyCompare(e){var t=e.target.id.split("##");var i=A[t[1].split(".").pop()];if(i){var a=clone(i.comp);var n=Mt["b"].DataObjects.DocumentDO.getExtension(i.extensionId);var r=Mt["b"].Factories.ModelFactory.getModelById(n.getController().getRootModel(),t[1].split(".")[0]);var o=Mt["b"].Models.Actions.ViewModelActions.CompareModel.getNewId(r.extendedModel.compares);a.id=r.id+".compare"+o;a.name=a.id;a.isUserLayouted=false;Mt["b"].Models.Actions.ExtendedModelActions.AnyChartModel.addCompare(r.extendedModel,a);n.getController().updateLayoutDefinition();u.update()}}function removeCompare(o){Mt["b"].UI.HiCoConfirm(C.getTranslation("CONFIRM_REMOVE_COMPARE"),function(e){if(e===true){var t=o.target.id.split("##");var i=A[t[1].split(".").pop()];if(i){var a=Mt["b"].DataObjects.DocumentDO.getExtension(i.extensionId);var n=a.getController();var r={model:i.comp,extension:a};n.dispatch("deleteCompareAction",r)}}})}function copyHighlight(e){var t=e.target.id.split("##")[1];var i=x[t.split(".").pop()];if(i){var a=clone(i.highlight);var n=Mt["b"].DataObjects.DocumentDO.getExtension(i.extensionId);var r=Mt["b"].Factories.ModelFactory.getModelById(n.getController().getRootModel(),t.split(".")[0]);var o=Mt["b"].Models.Actions.ViewModelActions.General.getNewHighlightId(r.extendedModel.highlights);a.id=r.id+".highlight."+o;a.name=a.id;a.active=false;Mt["b"].Models.Actions.ExtendedModelActions.AnyChartModel.addHighlight(r.extendedModel,a);u.update()}}function removeHighlight(e){var e=e.split("##")[1];var t=e.split(".")[0];var i=e.split(".").pop();var a=x[i];x.splice(i,1);var n=Mt["b"].DataObjects.DocumentDO.getExtension(a.extensionId);var r=Mt["b"].Factories.ModelFactory.getModelById(n.getController().getRootModel(),t);Mt["b"].Models.Actions.ExtendedModelActions.AnyChartModel.removeHighlight(r.extendedModel,a.highlight.id);n.getController().updateLayoutDefinition();n.paint()}function chartChangeHandler(e,t){var i=e.target;var a=e.target.id.split("##");var n=t===M.COMPARE?"##context":"##highlightContext";var r=document.getElementById("select##"+a[1]+n).selectedIndex;var o=E[r];var l=o.getController().getRootModel();var s=[];if(l.firstObjectGrid){Mt["b"].Models.Actions.ViewModelActions.General.getAllCharts(l.firstObjectGrid,s)}var d=s[i.selectedIndex];if(t===M.COMPARE){var c=A[a[1].split(".").pop()];if(c){checkForPlausability(c,d,a[1].split(".").pop())}}else if(t===M.HIGHLIGHT){var u=x[a[1].split(".").pop()];if(u){checkHighlightPlausability(u,d,a[1].split(".").pop())}}}function contextChangeHandler(e,t){var i=e.target;var a=i.id.split("##");var n=E[i.selectedIndex];var r=n.getController().getRootModel();var o=[];if(r.firstObjectGrid){Mt["b"].Models.Actions.ViewModelActions.General.getAllCharts(r.firstObjectGrid,o)}var l=t===M.COMPARE?"##chart":"##highlightChart";var s=document.getElementById("select##"+a[1]+l);var d=o[s.selectedIndex];s.options.length=0;if(o.length===0){var c=document.createElement("option");Mt["b"].$(c).html(C.getTranslation("COMPARE_CHART"));s.appendChild(c)}for(var u=0;u<o.length;u++){var c=document.createElement("option");var p=o[u].name?o[u].name:o[u].id;Mt["b"].$(c).html(p);s.appendChild(c)}if(d){if(t===M.COMPARE){var g=A[a[1].split(".").pop()];if(g){checkForPlausability(g,d,a[1].split(".").pop())}}else if(t===M.HIGHLIGHT){var h=x[a[1].split(".").pop()];if(h){checkHighlightPlausability(h,d,a[1].split(".").pop())}}}}function calculateLength(){var e=document.getElementById("hiddenDiv");for(var t=0;t<b.length;t++){Mt["b"].$(e).html(T[t]);O[t]=e.clientWidth+1}for(var t=0;t<A.length;t++){Mt["b"].$(e).html(A[t].comp.id);var i=e.clientWidth+35;if(i>O[3]){O[3]=i}}for(var t=0;t<x.length;t++){Mt["b"].$(e).html(T[t]);var i=e.clientWidth+35;if(i>O[3]){O[3]=i}}if(O[0]<60){O[0]=60}if(O[1]<O[1]+40){O[1]=O[1]+40}if(O[3]<75){O[3]=75}O[4]=250;if(O[5]<100){O[5]=100}}function createCompareTab(){var e=document.createElement("div");e.setAttribute("id","tabCompareDiv");var t=document.createElement("table");t.setAttribute("id","compareTable");t=createHeader(t,i);t=createCompareTable(t);e.appendChild(t);Mt["b"].$(t).tablesorter({sortReset:true,sortRestart:true,sortList:[[3,0]],tabIndex:false,selectorHeaders:"> thead th",selectorSort:"th",headers:{0:{sorter:false},2:{sorter:false},4:{sorter:false},5:{sorter:false}}});Mt["b"].UI.IndicationDialog.changeIconFromOutside(t);return e}function createHeader(e,t){e.setAttribute("class","tablesorter");var i=e.createTHead();var a=document.createElement("tr");var n=document.createElement("tr");n.setAttribute("class","tablesorter-ignoreRow");for(var r=0;r<b.length;r++){var o=document.createElement("th");var l=document.createElement("td");var s=O[r];var d={width:s+"px",minWidth:s+"px",whiteSpace:"nowrap",textAlign:"center",fontWeight:"normal"};Mt["b"].Utils.DOM.setStyle(o,d);Mt["b"].Utils.DOM.setStyle(l,d);Mt["b"].$(o).html(T[r]);if(r!==0){o.setAttribute("title",C.getTranslation(t[r]))}if(r===1||r===3){var c=document.createElement("td");var u=Mt["b"].Utils.DOM.createIconButton(c,b[r]+"##ascIcon##"+r,"","",S,pe["a"].imgPath+"ascending.png",C.getTranslation("SORT_ORDER_ASC"));u.className="sortIcon";Mt["b"].$(u).css({"padding-left":"3px"});o.appendChild(c);c=document.createElement("td");var p=Mt["b"].Utils.DOM.createIconButton(c,b[r]+"##descIcon##"+r,"","",S,pe["a"].imgPath+"descending.png",C.getTranslation("SORT_ORDER_DESC"));p.className="sortIcon";o.appendChild(c)}var g=document.createElement("span");g.style.margin="0px";Mt["b"].$(g).html('<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">');l.appendChild(g);n.appendChild(l);a.appendChild(o)}i.appendChild(a);i.appendChild(n);return e}function createCompareTable(e){var t=document.createElement("tbody");for(var i=0;i<A.length;i++){var a=A[i].comp;var n=a.id+"."+i;var r=document.createElement("tr");r.setAttribute("id",n+"##general");var o={width:O[0]+"px",minWidth:O[0]+"px",textAlign:"center"};var l=document.createElement("td");Mt["b"].Utils.DOM.setStyle(l,o);var s=Mt["b"].Utils.DOM.createIconButton(l,"select##"+n+"##edit","","",S,pe["a"].imgPath+"pencil.png",C.getTranslation("EDIT"));s.className="icon";s.setAttribute("title",C.getTranslation("HELP_INDICATIONS_COMPARE_EDIT"));Mt["b"].$(s).click(function(e){openCompareProperties(e)});var d=Mt["b"].Utils.DOM.createIconButton(l,"select##"+n+"##copy","","",S,pe["a"].imgPath+"page_white_copy.png",C.getTranslation("COPY"));d.className="icon";d.setAttribute("title",C.getTranslation("HELP_INDICATIONS_COMPARE_COPY"));Mt["b"].$(d).click(function(e){copyCompare(e)});var c=Mt["b"].Utils.DOM.createIconButton(l,"select##"+n+"##delete","","",S,pe["a"].imgPath+"delete.png",C.getTranslation("REMOVE"));c.className="icon";c.setAttribute("title",C.getTranslation("HELP_INDICATIONS_COMPARE_DELETE"));Mt["b"].$(c).click(function(e){removeCompare(e)});r.appendChild(l);o={width:O[1]+"px",minWidth:O[1]+"px",textAlign:"center"};l=document.createElement("td");Mt["b"].Utils.DOM.setStyle(l,o);var u=a.active?"tick.png":"cross.png";var p=a.active?C.getTranslation("ACTIVE"):C.getTranslation("INACTIVE");var g=Mt["b"].Utils.DOM.createStateImg(l,"select##"+n+"##state",u,p,S);g.setAttribute("title",C.getTranslation("HELP_INDICATIONS_COMPARE_ACTIVE"));r.appendChild(l);l=document.createElement("td");o={width:O[2]+"px",minWidth:O[2]+"px",textAlign:"center"};var h=Mt["b"].Utils.DOM.createButtonInput(l,"select##"+n+"##condition","","fx",S);Mt["b"].Utils.DOM.setStyle(l,o);h.setAttribute("title",C.getTranslation("HELP_INDICATIONS_COMPARE_CONDITION"));Mt["b"].$(h).click(function(e){openFormulaEditor(e,M.COMPARE)});r.appendChild(l);l=document.createElement("td");l.setAttribute("id","select##"+n+"##name");l.setAttribute("title",C.getTranslation("HELP_INDICATIONS_COMPARE_NAME"));o={width:O[3]+"px",minWidth:O[3]+"px",textAlign:"center"};Mt["b"].Utils.DOM.setStyle(l,o);Mt["b"].$(l).on("click",function(e){addInput(e.target)});Mt["b"].$(l).hover(function(){this.style.cursor="pointer";this.style.textDecoration="underline"},function(){this.style.cursor="auto";this.style.textDecoration="none"});a.name?Mt["b"].$(l).html(a.name):Mt["b"].$(l).html(a.id);l.style.whiteSpace="nowrap";r.appendChild(l);l=document.createElement("td");o={width:O[4]+"px",minWidth:O[4]+"px",textAlign:"center"};Mt["b"].Utils.DOM.setStyle(l,o);var f=Mt["b"].Utils.DOM.createSelectBox(l,"select##"+n+"##context",_,L,A[i].extensionId,S,"250px");f.setAttribute("title",C.getTranslation("HELP_INDICATIONS_COMPARE_CONTEXT"));Mt["b"].$(f).on("change",function(e){contextChangeHandler(e,M.COMPARE)});r.appendChild(l);l=document.createElement("td");o={width:O[5]+"px",minWidth:O[5]+"px",textAlign:"center"};Mt["b"].Utils.DOM.setStyle(l,o);var m=Mt["b"].DataObjects.DocumentDO.getExtension(A[i].extensionId);var v=m.getController().getRootModel();var b=[];if(v.firstObjectGrid){Mt["b"].Models.Actions.ViewModelActions.General.getAllCharts(v.firstObjectGrid,b)}var T=setCharts(b);var x=T.names;var E=T.ids;var y=n.split(".")[0];y=y.replace("tableContainer","chart").replace("containerModel","");var f=Mt["b"].Utils.DOM.createSelectBox(l,"select##"+n+"##chart",E,x,y,S,"100px");f.setAttribute("title",C.getTranslation("HELP_INDICATIONS_COMPARE_CHART"));Mt["b"].$(f).on("change",function(e){chartChangeHandler(e,M.COMPARE)});r.appendChild(l);t.appendChild(r)}e.appendChild(t);return e}function createHighlightTab(){var e=document.createElement("div");e.setAttribute("id","tabHighlightDiv");var t=document.createElement("table");t.setAttribute("id","highlightTable");t=createHeader(t,a);t=createHighlightTable(t);e.appendChild(t);Mt["b"].$(t).tablesorter({sortReset:true,sortRestart:true,sortList:[[3,0]],tabIndex:false,selectorHeaders:"> thead th",selectorSort:"th",headers:{0:{sorter:false},2:{sorter:false},4:{sorter:false},5:{sorter:false}}});Mt["b"].UI.IndicationDialog.changeIconFromOutside(t);return e}function createHighlightTable(e){var t=document.createElement("tbody");for(var i=0;i<x.length;i++){var a=x[i].highlight;var n=a.id+"."+i;var r=document.createElement("tr");r.setAttribute("id",n+"##general");var o={width:O[0]+"px",minWidth:O[0]+"px",textAlign:"center"};var l=document.createElement("td");Mt["b"].Utils.DOM.setStyle(l,o);var s=Mt["b"].Utils.DOM.createIconButton(l,"select##"+n+"##edit","","",S,pe["a"].imgPath+"pencil.png",C.getTranslation("EDIT"));s.setAttribute("title",C.getTranslation("HELP_INDICATIONS_HIGHLIGHT_EDIT"));s.className="icon";Mt["b"].$(s).click(function(e){openHighlightProperties(e)});s=Mt["b"].Utils.DOM.createIconButton(l,"select##"+n+"##copy","","",S,pe["a"].imgPath+"page_white_copy.png",C.getTranslation("COPY"));s.setAttribute("title",C.getTranslation("HELP_INDICATIONS_HIGHLIGHT_COPY"));s.className="icon";Mt["b"].$(s).click(function(e){copyHighlight(e)});s=Mt["b"].Utils.DOM.createIconButton(l,"select##"+n+"##delete","","",S,pe["a"].imgPath+"delete.png",C.getTranslation("REMOVE"));s.setAttribute("title",C.getTranslation("HELP_INDICATIONS_HIGHLIGHT_DELETE"));s.className="icon";Mt["b"].$(s).click(function(t){Mt["b"].UI.HiCoConfirm(C.getTranslation("HIGHLIGHT_REMOVE"),function(e){if(e===true){removeHighlight(t.target.id)}})});r.appendChild(l);o={width:O[1]+"px",minWidth:O[1]+"px",textAlign:"center"};l=document.createElement("td");Mt["b"].Utils.DOM.setStyle(l,o);var d=a.active?"tick.png":"cross.png";var c=a.active?C.getTranslation("ACTIVE"):C.getTranslation("INACTIVE");s=Mt["b"].Utils.DOM.createStateImg(l,"select##"+n+"##highlightState",d,c,S);s.setAttribute("title",C.getTranslation("HELP_INDICATIONS_HIGHLIGHT_ACTIVE"));r.appendChild(l);o={width:O[2]+"px",minWidth:O[2]+"px",textAlign:"center"};l=document.createElement("td");Mt["b"].Utils.DOM.setStyle(l,o);s=Mt["b"].Utils.DOM.createButtonInput(l,"select##"+n+"##highlightCondition","","fx",S);s.setAttribute("title",C.getTranslation("HELP_INDICATIONS_HIGHLIGHT_CONDITION"));Mt["b"].$(s).click(function(e){openFormulaEditor(e,M.HIGHLIGHT)});r.appendChild(l);o={width:O[3]+"px",minWidth:O[3]+"px",textAlign:"center",whiteSpace:"nowrap"};l=document.createElement("td");l.setAttribute("title",C.getTranslation("HELP_INDICATIONS_HIGHLIGHT_NAME"));l.setAttribute("id","select##"+n+"##name");Mt["b"].Utils.DOM.setStyle(l,o);Mt["b"].$(l).click(function(e){addInput(e.target)});Mt["b"].$(l).hover(function(){this.style.cursor="pointer";this.style.textDecoration="underline"},function(){this.style.cursor="auto";this.style.textDecoration="none"});a.name?Mt["b"].$(l).html(a.name):Mt["b"].$(l).html(a.id);r.appendChild(l);l=document.createElement("td");o={width:O[4]+"px",minWidth:O[4]+"px",textAlign:"center"};Mt["b"].Utils.DOM.setStyle(l,o);var u=Mt["b"].Utils.DOM.createSelectBox(l,"select##"+n+"##highlightContext",_,L,x[i].extensionId,S,"250px");u.setAttribute("title",C.getTranslation("HELP_INDICATIONS_HIGHLIGHT_CONTEXT"));Mt["b"].$(u).on("change",function(e){contextChangeHandler(e,M.HIGHLIGHT)});r.appendChild(l);l=document.createElement("td");o={width:O[5]+"px",minWidth:O[5]+"px",textAlign:"center"};Mt["b"].Utils.DOM.setStyle(l,o);var p=Mt["b"].DataObjects.DocumentDO.getExtension(x[i].extensionId);var g=p.getController().getRootModel();var h=[];if(g.firstObjectGrid){Mt["b"].Models.Actions.ViewModelActions.General.getAllCharts(g.firstObjectGrid,h)}var f=setCharts(h);var m=f.names;var v=f.ids;var b=a.id.split(".")[0];var u=Mt["b"].Utils.DOM.createSelectBox(l,"select##"+n+"##highlightChart",v,m,b,S,"100px");u.setAttribute("title",C.getTranslation("HELP_INDICATIONS_HIGHLIGHT_CHART"));Mt["b"].$(u).on("change",function(e){chartChangeHandler(e,M.HIGHLIGHT)});r.appendChild(l);t.appendChild(r)}e.appendChild(t);return e}};Mt["b"].UI.IndicationDialog.isOpen=function(){return document.getElementById("indicationDialog")?true:false};Mt["b"].UI=Mt["b"].UI||{};Mt["b"].UI.MultipleGridEditor=function(e){var i=this;var t=e.model;var a=e.type;var n=e.extension;var r=n.getCanvasDO().getDOMElement();var d=Mt["b"].DataObjects.RuntimeDO;var g,h,c;if(a==="time"){g=t.timeCellValueCount;h=t.timeCellCategoryCount;c=t.timeCellGridSizes}else{g=t[a+"CellCategoryCount"];h=t[a+"CellValueCount"];c=t[a+"CellGridSizes"]}var f=JSON.parse(JSON.stringify(c));var o=null;var u=null;this.open=function(){var e=[{text:d.getTranslation("OKAY"),id:"multipleGridEditorOkayButton",click:i.okay},{text:d.getTranslation("CANCEL"),id:"multipleGridEditorCancelButton",click:i.close}];var t=new Mt["b"].UI.HiCoDialogDefinition("multipleGridEditor",d.getTranslation("GRID"),e);t.setParentDomElement(r.parentNode);t.setHeight(270);t.setWidth(230);t.setPosition({});t.setResizable(true);t.setModal(true);u=new Mt["b"].UI.HiCoDialog(t);o=u.getDialogDiv();u.setCSS();o.appendChild(fillContent())};function fillContent(){var e={width:"55px",textAlign:"right",backgroundColor:"rgb(240, 240, 240)",border:"0px"};var t={borderBottom:"1px solid black"};var i={borderBottom:"1px solid black",textAlign:"right"};var a={borderBottom:"1px solid grey",textAlign:"right"};var n=document.createElement("div");var r=document.createElement("table");Mt["b"].Utils.DOM.setStyle(r,{borderSpacing:"5px 0",width:"100%"});var o=[{type:"text",value:d.getTranslation("ROW"),tdStyle:t},{type:"text",value:d.getTranslation("HEIGHT")+" in %",tdStyle:i},{type:"text",value:d.getTranslation("COLUMN"),tdStyle:t},{type:"text",value:d.getTranslation("WIDTH")+" in %",tdStyle:i}];u.buildTableRow(r,o);var l=Math.max(g,h);for(var s=0;s<l;s++){var o=new Array(4);if(g>s){o[0]={type:"text",id:"multipleGridEditorRowN."+s.toString(10),value:(s+1).toString(10),tdStyle:a};o[1]={type:"textinput",id:"multipleGridEditorRowInput."+s.toString(10),value:(c.rows[s]*100).toFixed(1),length:4,maxLength:4,tdStyle:a,style:e,change:changeValueHandler};if(g===s+1){o[1].disabled=true}}else{o[0]={type:"empty"};o[1]={type:"empty"}}if(h>s){o[2]={type:"text",id:"multipleGridEditorColN."+s.toString(10),value:(s+1).toString(10),tdStyle:a};o[3]={type:"textinput",id:"multipleGridEditorColInput."+s.toString(10),value:(c.columns[s]*100).toFixed(1),length:4,maxLength:4,tdStyle:a,style:e,change:changeValueHandler};if(h===s+1){o[3].disabled=true}}else{o[2]={type:"empty"};o[3]={type:"empty"}}u.buildTableRow(r,o)}n.appendChild(r);return n}function changeValueHandler(e){var t=this.id.split(".");var i=parseInt(t[1]);var a=(this.id.indexOf("Row")===-1?h:g)-1;var n=this.id.indexOf("Row")===-1?"columns":"rows";var r=parseFloat(this.value)/100;if(isNaN(r)||r<0||r>1){this.value=(f[n][i]*100).toFixed(1);return}var o=0;for(var l=0;l<i;l++){o+=f[n][l]}if(o+r>1){this.value=(f[n][i]*100).toFixed(1);return}f[n][i]=r;var s=1-o-r;var d=0;for(var l=i+1;l<=a;l++){d+=f[n][l]}var c=d-s;for(var l=i+1;l<a;l++){var u=f[n][l]/d*c;c-=u;f[n][l]-=u;var p=document.getElementById(t[0]+"."+l.toString(10));p.value=(f[n][l]*100).toFixed(1)}f[n][l]-=c;var p=document.getElementById(t[0]+"."+a.toString(10));p.value=(f[n][a]*100).toFixed(1)}this.okay=function(){for(var e=0;e<g;e++){c.rows[e]=f.rows[e]}for(var e=0;e<h;e++){c.columns[e]=f.columns[e]}i.close()};this.close=function(){u.close()}};var we=i(682);Mt["b"].UI=Mt["b"].UI||{};Mt["b"].UI.NavigationMenu=function(i){var e=this;var g=i.extendedModel;if(!g){return}var h=new Mt["b"].Utils.Calculator(null),t=i.extension.getScope().getActionBlacklist(),a=t.indexOf("customClickBehaviour")===-1&&t.indexOf("*")===-1,f="Auto",n={width:"200px",textAlign:"left",backgroundColor:"rgb(240, 240, 240)",border:"0px"},r={width:"200px",textAlign:"left",backgroundColor:"rgb(240, 240, 240)",border:"0px",color:"rgb(150,150,150)"},m=[""].concat(Mt["b"].DataObjects.DocumentDO.getBIVariables().map(function(e){return e.name}).sort()),s=[{id:"default",text:Mt["b"].Utils.Translations.getTranslation("DEFAULT"),tooltip:"",buildUp:createClickBehaviorDefault}],d={check:[]};if(a){s.push({id:"custom",text:Mt["b"].Utils.Translations.getTranslation("CUSTOM"),tooltip:"",buildUp:createClickBehaviorCustom})}if(!g.navigationVariable){g.navigationVariable={variable:"",auto:true,value:"",useQVNav:true}}function createClickBehaviorDefault(e){var t=document.createElement("div");var i=document.createElement("table");Mt["b"].Utils.DOM.setStyle(i,{borderCollapse:"separate",borderSpacing:"5px 0"});var a={borderBottom:"1px solid black"},n={borderBottom:"1px solid black",width:"100px"},r={borderBottom:"1px solid black",width:"160px"};e.buildTableRow(i,[{type:"text",value:Mt["b"].Utils.Translations.getTranslation("SET_THIS_VARIABLE"),tdStyle:r,tooltip:Mt["b"].Utils.Translations.getTranslation("HELP_CELL_CLICK_BEHAVIOUR_SET_VARIABLE")},{type:"text",value:Mt["b"].Utils.Translations.getTranslation("DOTS_WITH"),tdStyle:n,tooltip:Mt["b"].Utils.Translations.getTranslation("HELP_CELL_CLICK_BEHAVIOUR_SET_WITH")},{type:"text",value:Mt["b"].Utils.Translations.getTranslation("BI_SELECTION"),tdStyle:a,tooltip:Mt["b"].Utils.Translations.getTranslation("HELP_CELL_CLICK_BEHAVIOUR_QV_SELECTION")}]);var o=m.indexOf(g.navigationVariable.variable)>=0?g.navigationVariable.variable:"",l={marginLeft:"auto",display:"block",width:"100%"},s=g.navigationVariable.auto?"":h.decode(g.navigationVariable.value),d={textAlign:"center",verticalAlign:"middle"},c=s===""||s==="auto"?f:s;var u=e.buildTableRow(i,[{type:"selectbox",id:"navigationVariableSelect",value:o,values:m,translations:m,style:l,tooltip:Mt["b"].Utils.Translations.getTranslation("HELP_CELL_CLICK_BEHAVIOUR_SET_VARIABLE")},{type:"textinput",id:"variableInput",value:c,tdStyle:{width:"200px"},style:getTextStyle(c),focusIn:autoFocusIn,focusOut:autoFocusOut,tooltip:Mt["b"].Utils.Translations.getTranslation("HELP_CELL_CLICK_BEHAVIOUR_SET_WITH")},{type:"checkbox",id:"useQVNav",group:"useQVNavG",value:"",checked:g.navigationVariable.useQVNav,tdStyle:d,tooltip:Mt["b"].Utils.Translations.getTranslation("HELP_CELL_CLICK_BEHAVIOUR_QV_SELECTION")}]);t.appendChild(i);if(c===f){var p=u.querySelector("#variableInput");p.style.color="rgb(150,150,150)"}return t}function createClickBehaviorCustom(){var e=document.createElement("div");var t=document.createElement("div");t.textContent=Mt["b"].Connector.ConnectorHelper.Settings.customActionParameters;d.customClickBehavior=document.createElement("textarea");d.customClickBehavior.rows=17;d.customClickBehavior.value=g.navigationVariable.customClickBehavior||Y["d"];e.appendChild(t);e.appendChild(d.customClickBehavior);we["a"].compile(d.customClickBehavior,i.extension.getScope());return e}e.tabActivated=function(){};e.embed=function(o,l){if(!g){return null}s.forEach(function(e,t){var i=document.createElement("div");var a=document.createElement("div");a.className="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all leftContent";d.check[e.id]=document.createElement("input");d.check[e.id].id=l.id+"-"+t;d.check[e.id].type="checkbox";d.check[e.id].checked=g.navigationVariable.check!=undefined?g.navigationVariable.check[e.id]:t===0;var n=document.createElement("label");n.innerText=e.text;n.title=e.tooltip;n.for=d.check[e.id].id;a.appendChild(d.check[e.id]);a.appendChild(n);i.appendChild(a);var r=e.buildUp(o);r.className="ui-tabs-panel ui-widget-content ui-corner-bottom rightContent";i.appendChild(r);l.appendChild(i)});return this};e.changeSelection=function(){var e=document.getElementById("navigationVariableSelect");var t=h.encode(document.getElementById("variableInput").value);g.navigationVariable.variable=e.childNodes[e.selectedIndex].text;g.navigationVariable.auto=t===""||t==="Auto";g.navigationVariable.value=t===""||t==="Auto"?"":t;g.navigationVariable.useQVNav=document.getElementById("useQVNav").checked;g.navigationVariable.check=g.navigationVariable.check||{};g.navigationVariable.check[s[0].id]=d.check[s[0].id].checked;if(a){g.navigationVariable.customClickBehavior=d.customClickBehavior.value;if(g.navigationVariable.customClickBehavior.trim()===""||g.navigationVariable.customClickBehavior===Y["d"]){g.navigationVariable.customClickBehavior=undefined}g.navigationVariable.check[s[1].id]=d.check[s[1].id].checked}};function autoFocusIn(){this.style.color="";if(this.value===f){this.value=""}}function autoFocusOut(){if(this.value===""){this.value=f;this.style.color="rgb(150,150,150)"}}function getTextStyle(e){return e==null?r:n}};var Fe=i(148);Mt["b"].UI=Mt["b"].UI||{};Mt["b"].UI.TableAddRowSelector=function(e){var c=this;var r=e.extension;var t=e.model;var u=r.getCanvasDO().getDOMElement();var i=t;var p=i.extendedModel;var g=["total","subtotal","empty"];var h=null;var f=Mt["b"].DataObjects.RuntimeDO;var m={padding:"10px",fontFamily:f.getParameter("FONT_FAMILY"),position:"absolute",top:0+"px",height:"auto !important",left:0+"px",width:"auto !important",border:"1px solid black",backgroundColor:Mt["b"].Utils.Constants.Parameters.colorBackground,visibility:"hidden",zIndex:"100"};var v="12px";c.createSelectorDiv=function(){if(p.cellSelection.rowLength>0){Mt["b"].$("#selectorDiv").remove();h=document.createElement("div");Mt["b"].Utils.DOM.setStyle(h,m);h.setAttribute("id","selectorDiv");h.style.fontSize=v;u.parentNode.appendChild(h);Mt["b"].$("#selectorDiv").draggable();var e=document.createElement("span");Mt["b"].$(e).html("<b>Add Row</b><br><br>");h.appendChild(e);var t=document.createElement("table");t.setAttribute("cellSpacing","3px");t.setAttribute("cellPadding","3px");var i=document.createElement("tr");var a=document.createElement("label");a.setAttribute("id","rowTypeLabel");Mt["b"].$(a).html("&nbsp;&nbsp;Type&nbsp;&nbsp;");a.setAttribute("for","rowTypeSelect");var n=document.createElement("select");n.setAttribute("id","rowTypeSelect");for(var r=0;r<g.length;r++){var o=document.createElement("option");Mt["b"].$(o).html(g[r]);n.appendChild(o)}a.appendChild(n);i.appendChild(a);t.appendChild(i);h.appendChild(t);var l=document.createElement("span");Mt["b"].$(l).html("<br>");h.appendChild(l);var s=document.createElement("input");s.setAttribute("type","button");s.setAttribute("value",f.getTranslation("CANCEL"));s.style.fontSize=v;Mt["b"].$(s).bind("click",function(){c.closeSelector()});var d=document.createElement("input");d.setAttribute("type","button");d.setAttribute("value",f.getTranslation("OK"));d.style.fontSize=v;Mt["b"].$(d).bind("click",function(){c.changeSelections()});h.appendChild(d);h.appendChild(s);h.style.visibility="visible"}else{alert("Please select a cell or row to add a new row!")}};c.changeSelections=function(){if(p.instanceOf==="TableModel"){var e=p.cellSelection.startRow+p.cellSelection.rowLength;var t=document.getElementById("rowTypeSelect").selectedIndex;var i=g[t];var a=new Fe["a"].SpecialRowContent;a.row=e;a.contentType=i;c.shiftBackwards(e);p.specialRowContent.push(a);if(i==="total"&&e<p.rows){var n=new Fe["a"].SpecialRowContent;n.row=e+1;n.contentType="empty";c.shiftBackwards(e+1);p.specialRowContent.push(n)}}r.paint();c.closeSelector()};c.shiftBackwards=function(e){for(var t=0;t<p.specialRowContent.length;t++){if(p.specialRowContent[t].row>=e){p.specialRowContent[t].row+=1}}};c.closeSelector=function(){Mt["b"].$("#tableAddRowSelector").draggable("destroy");Mt["b"].$(h).remove()}};Mt["b"].UI.Tooltip=new function(){var i,c;this.createTooltip=createTooltip;this.closeLastTooltip=closeLastTooltip;function closeLastTooltip(){clearTimeout(i);if(c){c.close();c=undefined}}function createTooltip(e,t){if(!t){return}e.addEventListener("mousemove",function(){if(!c){clearTimeout(i);if(!this.firstElementChild||!this.firstElementChild.classList.contains("ckeditor")){if(document.documentElement.classList.contains("touch-on")){openTooltip.bind(this,t)()}else{i=setTimeout(openTooltip.bind(this,t),500)}}}});e.addEventListener("mouseleave",closeLastTooltip)}function getTextValue(e){var t=e.type?e.value:e.text;if(t){while(t.indexOf("&nbsp;")>=0){t=t.replace("&nbsp;"," ")}if(e.type===Mt["b"].Utils.Constants.TypeValues.tableRepresentation.LIST){t=(e.listContent.filter(function(e){return e.key===t})[0]||e.listContent[0]).description}t=Mt["b"].DataObjects.DocumentDO.getPainter().checkVariableInText(t,"textDiv")}return t}function openTooltip(e){if(typeof e==="function"){e=e()}var t=document.getElementById(this.id)||this;var i=e.lastModifiedBy||e.lastModified,a="";if(e.type!==Mt["b"].Utils.Constants.TypeValues.tableRepresentation.FLAG){var n=getTextValue(e);var r=n&&n!==""&&(Mt["b"].DataObjects.DocumentDO.getPainter().isEllipsis(t,n)||t.clientHeight<t.scrollHeight-1);r&&(a+=n);r&&i&&(a+="<hr>")}if(i){var o=Mt["b"].DataObjects.RuntimeDO.getParameter("CHECK_COMMENT_MODIFIEDBY")==="true",l=e.lastModified?h["a"].parseFormattedDate(e.lastModified).toLocaleString():"",s=e.lastModifiedBy||"";o&&(a+=Mt["b"].Utils.Translations.getTranslation("MODIFIEDBY")+": "+s+"<br>");a+=Mt["b"].Utils.Translations.getTranslation("MODIFIEDAT")+": "+l}if(a.trim()!==""){closeLastTooltip();var d={alignTo:t,content:"<span>"+a+"</span>",dock:["bottom","top","left","right"]};if(t.tagName==="text"){d.dock=["top","left","right"]}c=L["a"].createTooltip(d);c.element.classList.add("lui-bg-default")}}};Mt["b"].UI=Mt["b"].UI||{};Mt["b"].UI.UserSettings=function(){var t=this;var p;var o;var l=50;var C=Mt["b"].DataObjects.RuntimeDO;var S=new Mt["b"].Utils.Calculator(null);var M=Mt["b"].Utils.Calculator.Converter;var O="12px";Mt["b"].DataObjects.DocumentDO.getDocumentController().dispatch("updateScalingGroups",{type:"document"});Mt["b"].DataObjects.DocumentDO.getDocumentController().dispatch("updateScalingGroups",{type:"user"});var g,A;reloadInitialSettings();var s=[{id:"",translation:"-"},{id:"",translation:"()"}];var h=[{id:"",translation:"de_DE"},{id:"",translation:"en_US"}];var f=["END","BY_VALUETYPE"];var d=[{id:"",translation:C.getTranslation("END")},{id:"",translation:C.getTranslation("BY_VALUETYPE")}];var m=Mt["b"].Utils.Constants.ParameterSets.documentModesValue;var v=[{id:"",translation:C.getTranslation("DESIGN")},{id:"",translation:C.getTranslation("PRESENTATION")}];var b=[{id:"",translation:"DD.MM.YYYY"},{id:"",translation:"YYYY.MM.DD"},{id:"",translation:"MM/DD/YYYY"}];var c=[{id:"XXXgeneralOverallUser",text:C.getTranslation("OVERALL"),tooltip:C.getTranslation("HELP_USERSETTINGS_OVERALL"),buildUp:createOverall},{id:"XXXgeneralDisplayUser",text:C.getTranslation("NUMBERS"),tooltip:C.getTranslation("HELP_USERSETTINGS_NUMBER"),buildUp:createNumber},{id:"XXXgeneralScalingGroupsUser",text:C.getTranslation("SCALING_GROUPS"),tooltip:C.getTranslation("HELP_USERSETTINGS_SCALINGGROUPS"),buildUp:createScalingGroups}];var u="userSettingsDialog";var T="360";var x="340";var E="200px";var y=17;var _=2;this.open=function(){var e=C.getTranslation("MY_SETTINGS");var t=buildButtonBar();var i=new Mt["b"].UI.HiCoDialogDefinition(u,e,t);i.setWidth(T);i.setHeight(x);i.setPosition({});i.setResizable(true);i.setTooltip(C.getTranslation("HELP_USERSETTINGS"));O=i.getFontSize();p=new Mt["b"].UI.HiCoDialog(i);o=p.getDialogDiv();var a=p.buildTabs("userSettingsTabDiv",c,null,E,{top:"0px",left:"0px"},null,true);Mt["b"].$(a).height("100%");function adjustSize(){var e=Mt["b"].$(o).parent().height()-70;Mt["b"].$(o).height(e);var t=Mt["b"].$("#userSettingsTabDiv > .ui-tabs-nav").height();Mt["b"].$(".ui-tabs-panel",Mt["b"].$(o).parent()).height(e-t-y);Mt["b"].$(".ui-tabs-panel","#XXXgeneralOverall").height(e-t-l);Mt["b"].$("#GENERALLanguageSettingsUser",Mt["b"].$(o)).height(e-t-y);Mt["b"].$("#GENERALDisplaySettingsUser",Mt["b"].$(o)).height(e-t-y);Mt["b"].$("#GENERALScalingGroupSettingsUser",Mt["b"].$(o)).height(e-t-y)}adjustSize();p.setEvent("dialogresize",adjustSize);p.setTabsCss("#generalTab",["generalTab"]);p.setCSS("overflow","hidden");p.setCSS();p.decorateTabs(0,c,null);var n=parseInt(p.highest());var r=parseInt(p.getDialog().offsetParent().css("z-index"));if(n>r){n+=1;p.getDialog().offsetParent().css("z-index",n)}};function buildButtonBar(){var e=[];e.push({text:C.getTranslation("SAVE_CLOSE"),id:"okayButton",click:t.okay});e.push({text:C.getTranslation("CANCEL"),id:"closeButton",click:t.close});e.push({text:C.getTranslation("SAVE"),id:"applyButton",click:t.apply});return e}function createOverall(){var e=document.createElement("div");e.setAttribute("id","GENERALLanguageSettingsUser");Mt["b"].Utils.DOM.setStyle(e,{width:"100%",height:E,overflow:"auto"});var t=document.createElement("table");c=A.documentMode.value;u=C.getTranslation(g.documentMode.name);var i=0;for(var a=0;a<m.length;a++){if(m[a]===c){i=a;break}}var n=document.createElement("tr");var r=document.createElement("td");var o=Mt["b"].Utils.DOM.createSpan(r,u,"");o.setAttribute("title",C.getTranslation("HELP_USERSETTINGS_OVERALL_MODE"));o.style.fontSize=O;Mt["b"].$(r).css("padding","5px 10px 05px 0px");n.appendChild(r);var l=document.createElement("td");var s=[];for(var a=0;a<v.length;a++){s[a]=v[a].translation}var d=Mt["b"].Utils.DOM.createSelectBox(l,"userPropertyType_documentMode",s,s,v[i].translation,O);d.setAttribute("title",C.getTranslation("HELP_USERSETTINGS_OVERALL_MODE"));n.appendChild(l);Mt["b"].$(d).bind("change",function(e){documentHandler(e)});t.appendChild(n);var c=A.docLanguage.value;var u=C.getTranslation(g.docLanguage.name);p.createTableRow(t,"docPropertyType_125",u,{valueArray:h,selectedValue:c,clazz:"_languageAbbr"},"dropdown",C.getTranslation("HELP_USERSETTINGS_OVERALL_LANGUAGE"));c=A.dateFormat.value;u=C.getTranslation(g.dateFormat.name);p.createTableRow(t,"DD_DATEFORMAT",u,{valueArray:b,selectedValue:c,clazz:"_dateFormats"},"dropdown",C.getTranslation("HELP_USERSETTINGS_OVERALL_DATEFORMAT"));e.appendChild(t);return e}function createNumber(){var e=document.createElement("div");e.setAttribute("id","GENERALDisplaySettingsUser");var t={height:E,width:"100%",overflow:"auto"};Mt["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");p.createSection(i,C.getTranslation("DECIMAL_SEPARATORS"),C.getTranslation("HELP_USERSETTINGS_NUMBER_DECSEP"));var a=A.decimalSep.value;var n=C.getTranslation(g.decimalSep.name);p.createTableRow(i,"docPropertyType_110",n,{text:a,labelText:""},"textInput",C.getTranslation("HELP_USERSETTINGS_NUMBER_DECSEP_DECIMAL"));a=A.thousandSep.value;n=C.getTranslation(g.thousandSep.name);p.createTableRow(i,"docPropertyType_111",n,{text:a,labelText:""},"textInput",C.getTranslation("HELP_USERSETTINGS_NUMBER_DECSEP_THOUSAND"));p.createSection(i,C.getTranslation("UNITS"),C.getTranslation("HELP_USERSETTINGS_NUMBER_UNITS"));var a=A.unitPosition.value;var n=C.getTranslation(g.unitPosition.name);var r=0;for(var o=0;o<f.length;o++){if(f[o]===a){r=o;break}}p.createTableRow(i,"docPropertyType_114",n,{valueArray:d,selectedValue:d[r].translation,clazz:"_unitPosition"},"dropdown",C.getTranslation("HELP_USERSETTINGS_NUMBER_UNITS_POSITION"));p.createSection(i,C.getTranslation("NEGATIVES"),C.getTranslation("HELP_USERSETTINGS_NUMBER_NEGATIVE"));a=A.negativeStyle.value;n=C.getTranslation(g.negativeStyle.name);p.createTableRow(i,"docPropertyType_115",n,{valueArray:s,selectedValue:a,clazz:"_negativeStyle"},"dropdown",C.getTranslation("HELP_USERSETTINGS_NUMBER_NEGATIVE_STYLE"));e.appendChild(i);return e}function createScalingGroups(){var e=document.createElement("div");e.setAttribute("id","GENERALScalingGroupSettingsUser");var t={height:E,width:"100%",overflow:"auto"};Mt["b"].Utils.DOM.setStyle(e,t);document.createElement("table");e.appendChild(createScalingGroupTable());return e}function createScalingGroupTable(){var e=A.scalingGroups.value;var t={whiteSpace:"nowrap",overflow:"hidden",textAlign:"left",fontWeight:"bold",padding:"0"};var i={whiteSpace:"nowrap",overflow:"hidden",textAlign:"left",fontWeight:"bold",padding:"0",borderBottom:"1px solid black"};var a=document.createElement("table");Mt["b"].Utils.DOM.setStyle(a,{padding:"0",borderSpacing:_+"px"});var n=true;for(var r in e){if(!e[r].auto){n=false;break}}var o=document.createElement("tr");var l=document.createElement("td");var s=document.createElement("label");s.setAttribute("title",C.getTranslation("HELP_USERSETTINGS_SCALINGGROUPS_ALLAUTO"));Mt["b"].$(s).html(C.getTranslation("AUTO_SCALING"));l.appendChild(s);var d=Mt["b"].Utils.DOM.createCheckBoxWithLabel(l,"userPropertyType_AutoScaling","","","").checkBox;d.setAttribute("title",C.getTranslation("HELP_USERSETTINGS_SCALINGGROUPS_ALLAUTO"));Mt["b"].$(d).bind("click",function(e){documentHandler(e)});if(n===true){d.checked=true}Mt["b"].Utils.DOM.setStyle(d,{margin:"0 4px",verticalAlign:"top"});l.setAttribute("colspan","4");l.setAttribute("style","border-bottom: 1px solid black");o.appendChild(l);a.appendChild(o);var o=document.createElement("tr");var l=document.createElement("td");Mt["b"].$(l).html(C.getTranslation("SCALING_GROUPS"));l.setAttribute("title",C.getTranslation("HELP_USERSETTINGS_SCALINGGROUPS_SCALINGGROUP"));Mt["b"].Utils.DOM.setStyle(l,t);o.appendChild(l);var l=document.createElement("td");Mt["b"].$(l).html(C.getTranslation("SCALING"));l.setAttribute("title",C.getTranslation("HELP_USERSETTINGS_SCALINGGROUPS_SCALING"));l.setAttribute("colspan",3);Mt["b"].Utils.DOM.setStyle(l,i);o.appendChild(l);a.appendChild(o);var o=document.createElement("tr");var c=["",C.getTranslation("SCALING_UNIT"),C.getTranslation("AUTO"),C.getTranslation("MANUAL")];var u=["",C.getTranslation("HELP_USERSETTINGS_SCALINGGROUPS_UNIT"),C.getTranslation("HELP_USERSETTINGS_SCALINGGROUPS_AUTO"),C.getTranslation("HELP_USERSETTINGS_SCALINGGROUPS_MANUAL")];for(var p=0;p<c.length;p++){var l=document.createElement("td");Mt["b"].$(l).html(c[p]);l.setAttribute("title",u[p]);Mt["b"].Utils.DOM.setStyle(l,i);o.appendChild(l)}a.appendChild(o);var g={padding:"0"};var h={width:"83px",maxWidth:"83px",padding:0,display:"block",overflow:"hidden",textAlign:"right"};var f={padding:0,textAlign:"center"};var m={padding:0};for(var r in e){var v=e[r];var b="";if(v.manualFactor!=null){b=M.zoomFactor2cm(v.manualFactor).toFixed(3)}var o=document.createElement("tr");var l=document.createElement("td");Mt["b"].$(l).html(S.decode(r));l.setAttribute("title",C.getTranslation("HELP_USERSETTINGS_SCALINGGROUPS_SCALINGGROUP"));Mt["b"].Utils.DOM.setStyle(l,g);o.appendChild(l);var l=document.createElement("td");var T=v.scalingFactor==null?"":M.zoomFactor2cm(v.scalingFactor).toFixed(3);var x=Mt["b"].Utils.DOM.createSpan(l,T,"userPropertyType_ScalingFactor##"+r);x.setAttribute("title",C.getTranslation("HELP_USERSETTINGS_SCALINGGROUPS_FACTOR"));Mt["b"].Utils.DOM.setStyle(x,h);o.appendChild(l);var l=document.createElement("td");var E=Mt["b"].Utils.DOM.createCheckBoxWithLabel(l,"userPropertyType_AutoScalingPerSg##"+r,"","","").checkBox;E.setAttribute("title",C.getTranslation("HELP_USERSETTINGS_SCALINGGROUPS_AUTO"));Mt["b"].Utils.DOM.setStyle(l,f);if(v.auto||b===""){E.checked=true}Mt["b"].$(E).bind("click",function(e){documentHandler(e)});o.appendChild(l);var l=document.createElement("td");Mt["b"].Utils.DOM.setStyle(l,m);var y=Mt["b"].Utils.DOM.createTextInputNoMax(l,"userPropertyType_ManualFactor##"+r,b,12,O);y.setAttribute("title",C.getTranslation("HELP_USERSETTINGS_SCALINGGROUPS_MANUAL"));Mt["b"].Utils.DOM.setStyle(y,{padding:"0",marginLeft:"0",marginRight:"0",textAlign:"right"});y.setAttribute("maxlength",30);o.appendChild(l);if(E.checked){y.style.visibility="hidden";x.style.visibility="visible"}else{y.style.visibility="visible";x.style.visibility="hidden"}a.appendChild(o)}return a}function documentHandler(e){var t=e.target.id;var i=A.scalingGroups.value;var a=t.split("##");var n=a[0];a.shift();var r=a.join("##");switch(n){case"userPropertyType_AutoScalingPerSg":var o=true;for(var l in i){var s=document.getElementById("userPropertyType_AutoScalingPerSg##"+l);if(s&&!s.checked){o=false;break}}var s=document.getElementById("userPropertyType_AutoScaling");s.checked=o;var d=document.getElementById("userPropertyType_ScalingFactor##"+r);var c=document.getElementById("userPropertyType_ManualFactor##"+r);if(e.target.checked){if(i[r].scalingFactor===null){d.value=C.getTranslation("NA")}else{d.value=M.zoomFactor2cm(i[r].scalingFactor)}c.style.visibility="hidden";d.style.visibility="visible"}else{var u=M.zoomFactor2cm(i[r].manualFactor||i[r].scalingFactor);c.value=u.toFixed(3);c.style.visibility="visible";d.style.visibility="hidden"}break;case"userPropertyType_AutoScaling":for(var r in i){var s=document.getElementById("userPropertyType_AutoScalingPerSg##"+r);if(s){s.checked=e.target.checked;var c=document.getElementById("userPropertyType_ManualFactor##"+r);var d=document.getElementById("userPropertyType_ScalingFactor##"+r);if(e.target.checked){if(i[r].scalingFactor===null){Mt["b"].$(d).html(C.getTranslation("NA"))}else{Mt["b"].$(d).html(M.zoomFactor2cm(i[r].scalingFactor))}c.style.visibility="hidden";d.style.visibility="visible"}else{var u=M.zoomFactor2cm(i[r].manualFactor||i[r].scalingFactor);c.value=u.toFixed(3);c.style.visibility="visible";d.style.visibility="hidden"}}}break}}function getLeastDecimalPosition(e){var t=0;var i,a;var n=1;do{i=e*n;a=Math.floor(i);if(a<i){t++}else{break}n*=10}while(true);return t}function reloadInitialSettings(){g=Mt["b"].DataObjects.DocumentDO.getDocSettings(true);A=Mt["b"].DataObjects.RuntimeDO.getUser().userSpecific}this.okay=function(){t.changeSelection();p.close()};this.apply=function(){t.changeSelection()};this.close=function(){p.close()};this.changeSelection=function(){var e=document.getElementById("userPropertyType_documentMode");var t=m[e.selectedIndex];var i=Mt["b"].$("#docPropertyType_110").val();var a=Mt["b"].$("#docPropertyType_111").val();var n=document.getElementById("docPropertyType_114");var r=f[n.selectedIndex];var o=Mt["b"].$("#docPropertyType_115").val();var l=Mt["b"].$("#docPropertyType_125").val();e=document.getElementById("DD_DATEFORMAT");var s=b[e.selectedIndex].translation;var d={};for(var c in A.scalingGroups.value){var u=document.getElementById("userPropertyType_AutoScalingPerSg##"+c);if(u!==null){d[c]={auto:u.checked,scalingFactor:null,manualFactor:null};if(u.checked){}else{var p=document.getElementById("userPropertyType_ManualFactor##"+c).value;var g=parseFloat(p);if(!isNaN(g)){d[c].manualFactor=M.cm2zoomFactor(g);d[c].leastDecimalPosition=getLeastDecimalPosition(g)}else{d[c].auto=A.scalingGroups.value[c].auto=true;document.getElementById("userPropertyType_AutoScalingPerSg##"+c).checked=true;document.getElementById("userPropertyType_ScalingFactor##"+c).style.visibility="visible";document.getElementById("userPropertyType_ManualFactor##"+c).style.visibility="hidden"}}}}var h={decimalSep:{name:"Decimal",value:i},thousandSep:{name:"Thousand",value:a},unitPosition:{name:"Position",value:r},negativeStyle:{name:"Style",value:o},docLanguage:{name:"Default language",value:l},documentMode:{name:"DOCUMENT_MODE",value:t},scalingGroups:{name:"SCALING_GROUPS",value:d},dateFormat:{name:"DATEFORMAT",value:s}};Mt["b"].DataObjects.RuntimeDO.setUserSettings(h);Mt["b"].DataObjects.DocumentDO.getDocumentController().dispatch("updateUserSettings",null);Mt["b"].DataObjects.RuntimeDO.updateRuntime(function(){var e=Mt["b"].DataObjects.DocumentDO.getAllExtensions();Mt["b"].DataObjects.DocumentDO.triggerDelayedRepaint();for(var t=0;t<e.length;t++){var i=e[t];i.getController().dispatch("createMenus",{extension:i})}Mt["b"].DataObjects.DocumentDO.getDocumentController().dispatch("updateScalingGroups",{type:"user"});reloadInitialSettings();for(var a in A.scalingGroups.value){var n=A.scalingGroups.value[a];if(n.auto&&n.scalingFactor!=null){var r=M.zoomFactor2cm(n.scalingFactor);Mt["b"].$(document.getElementById("userPropertyType_ScalingFactor##"+a)).html(r.toFixed(3))}}})}};Mt["b"].UI=Mt["b"].UI||{};Mt["b"].UI.ValueLabelShowFormulaDialog=function(e){var l=this;var o=e.title;var t=e.extension;var i=e.cid;var c=e.functionTarget;var a=e.expressionObject;var n=e.type;var u=Mt["b"].DataObjects.ContextRepo.getContextByCid(i);var h=new Mt["b"].Utils.Calculator(u);var f=Mt["b"].DataObjects.RuntimeDO;var s=t.getCanvasDO().getDOMElement();var m=Mt["b"].Utils.Constants.TypeValues.formulaEdit;var d=null;var v=[];var r;if(n==="compare"||n==="highlight"){r=a.formulaRepository}else{r=a.valueLabelFormulaArray}for(var p=0;p<r.length;p++){var g=r[p];v.push({id:g.id,appliesFormula:{formula:g.appliesFormula.formula,compiledFormula:null},conditionFormula:{formula:g.conditionFormula.formula,compiledFormula:null}})}var b=new Array("",f.getTranslation("APPLIES_TO"),"",f.getTranslation("CONDITION"),"");var T="12px";var x=null;var E=null;l.open=function(e){var t=document.getElementById("valueLabelShowFormulaDialog");if(!t){var i="valueLabelShowFormulaDialog";var a=[{text:f.getTranslation("OKAY"),id:"valueLabelShowFormulaOkayButton",click:l.okay},{text:f.getTranslation("CANCEL"),id:"valueLabelShowFormulaCancelButton",click:l.close}];var n=new Mt["b"].UI.HiCoDialogDefinition(i,o,a);T=n.getFontSize();n.setParentDomElement(s.parentNode);n.setHeight(200);n.setWidth(510);var r=Mt["b"].$(e).offset();n.setPosition([r.left,r.top+e.offsetHeight]);n.setResizable(true);n.setModal(false);E=new Mt["b"].UI.HiCoDialog(n);E.setEscapeBeforeHandler(escapeBeforeHandler);E.setEscapeAfterHandler(escapeAfterHandler);x=E.getDialogDiv();E.setCSS();fillContent();checkEntryFormulas()}else{t.parentNode.remove(t);l.open(e)}};l.okay=function(){if(applyFormulas(true)===true){if(n==="compare"||n==="highlight"){a.formulaRepository=[];for(var e=0;e<v.length;e++){var t=v[e];a.formulaRepository.push({id:t.id,appliesFormula:{formula:t.appliesFormula.formula,compiledFormula:null},conditionFormula:{formula:t.conditionFormula.formula,compiledFormula:null}})}}else{a.valueLabelFormulaArray=[];for(var e=0;e<v.length;e++){var t=v[e];a.valueLabelFormulaArray.push({id:t.id,appliesFormula:{formula:t.appliesFormula.formula,compiledFormula:null},conditionFormula:{formula:t.conditionFormula.formula,compiledFormula:null}})}}}E.close()};l.close=function(){var e=document.getElementById("formulaEditor");if(e!==null){if(d!==null){d.close()}}E.close()};function escapeBeforeHandler(){var e=false;return e}function escapeAfterHandler(){var e=document.getElementById("formulaEditor");if(e!==null){if(d!==null){d.close()}}}l.setValuesFromFormulaEditorCFM=function(e,t){var i=document.getElementById(t);if(i){i.value=h.invertNames(h.decode(e.formula));i.style.color="#000000"}};l.copyValueLabelFunctionFrom=function(e,i,t){var a=Mt["b"].DataObjects.ContextRepo.getContextByCid(e);if(a===null){return}var n=Mt["b"].Models.Actions.ModelActions.ContextModel.getContextContentByDid(a,i);if(n===null){return}var r=Mt["b"].Models.Actions.ModelActions.ContextModel.getContextContentById(u,c.split(".").pop());function renameVars(e){var t=new RegExp("\\$\\("+i+"\\)","g");return e.replace(t,"$("+r.displayId+")")}var o=[];for(var l=0;l<n.valueLabelFormulaArray.length;l++){var s=n.valueLabelFormulaArray[l].appliesFormula.formula;var d=n.valueLabelFormulaArray[l].conditionFormula.formula;if(t){s=renameVars(s);d=renameVars(d)}o.push({id:l,appliesFormula:{formula:s,compiledFormula:null},conditionFormula:{formula:d,compiledFormula:null}})}v=o;fillContent();checkEntryFormulas()};function fillContent(){var e=document.createElement("div");var t=["20px","165px","30px","165px","24px","20px","80px"];var i=document.createElement("table");i.setAttribute("cellSpacing","2px");i.setAttribute("cellPadding","2px");i.appendChild(createHeader(t));i.appendChild(createTable(t));e.appendChild(i);Mt["b"].$(x).empty();x.appendChild(e)}function createHeader(e){var t=document.createElement("thead");var i=document.createElement("tr");for(var a=0;a<b.length;a++){var n=document.createElement("td");var r=e[a];var o={width:r,minWidth:r,whiteSpace:"nowrap"};Mt["b"].Utils.DOM.setStyle(n,o);Mt["b"].$(n).html(b[a]);Mt["b"].Utils.DOM.setStyle(n,{textAlign:"left",fontWeight:"bold",textDecoration:"underline"});i.appendChild(n)}var l=document.createElement("td");Mt["b"].Utils.DOM.setStyle(l,{width:"20px",maxWidth:"30px",minWidth:"20px",overflow:"hidden",textAlign:"center"});var s=Mt["b"].Utils.DOM.createSpan(l,"+","addvalueLabelFormula");Mt["b"].$(s).click(function(e){if(applyFormulas(true)===true){addEntry()}fillContent()});Mt["b"].$(s).hover(function(){this.style.textDecoration="underline"},function(){this.style.textDecoration="none"});var r=e[5];var o={width:r,minWidth:r,whiteSpace:"nowrap"};Mt["b"].Utils.DOM.setStyle(l,o);i.appendChild(l);t.appendChild(i);return t}function createTable(e){var t=document.createElement("tbody");if(v.length>1){Mt["b"].$(t).sortable({axis:"y",containment:t,cursor:"crosshair",distance:3,stop:sortEntries,start:startEntrySorting})}for(var i=0;i<v.length;i++){var a=v[i];var n=document.createElement("tr");n.setAttribute("id","emptyRow."+i);var r=buildDragger("valueLabelDragger."+i);r.style.width=e[0];r.style.minWidth=e[0];n.appendChild(r);var o=a.appliesFormula.formula;var l=buildTextInput("valueLabelApplies."+i,h.invertNames(h.decode(o)),26,null,true);l.style.width=e[1];l.style.minWidth=e[1];n.appendChild(l);var s=buildFormulaButton("valueLabelAppliesB."+i,"valueLabelApplies."+i,m.APPLIES_TO,f.getTranslation("APPLIES_TO"));s.style.width=e[2];s.style.minWidth=e[2];n.appendChild(s);var d=a.conditionFormula.formula;var c=buildTextInput("valueLabelCondition."+i,h.invertNames(h.decode(d)),26,null,true);c.style.width=e[3];c.style.minWidth=e[3];n.appendChild(c);var u=buildFormulaButton("valueLabelConditionB."+i,"valueLabelCondition."+i,m.CONDITION,f.getTranslation("CONDITION"));u.style.width=e[4];u.style.minWidth=e[4];n.appendChild(u);var p=document.createElement("td");Mt["b"].Utils.DOM.setStyle(p,{width:e[5],maxWidth:e[5],minWidth:e[5],overflow:"hidden",textAlign:"center"});var g=Mt["b"].Utils.DOM.createSpan(p,"-","removeValueLabelEntry."+i);Mt["b"].$(g).click(function(e){if(applyFormulas(true)===true){removeEntry(e)}fillContent()});Mt["b"].$(g).hover(function(){this.style.textDecoration="underline"},function(){this.style.textDecoration="none"});n.appendChild(p);t.appendChild(n)}return t}function buildFormulaButton(e,n,r,o){var t=document.createElement("td");var i=Mt["b"].Utils.DOM.createButtonInput(t,e,"","fx",T);Mt["b"].$(i).click(function(e){var t=document.getElementById("formulaEditor");if(t!==null){return}var i=Mt["b"].$("div:visible[id*='valueLabelShowFormulaDialog']").parent().offset();d=new Mt["b"].UI.FormulaEditor(u,r);var a=document.getElementById(n).value;d.open(h.encode(a),n,[],l,{x:i.left+20,y:i.top+20},o)});return t}function buildTextInput(e,t,i){var a=document.createElement("td");var n=Mt["b"].Utils.DOM.createTextInputNoMax(a,e,t,i,T);var r=t;var o="#000000";var l=Mt["b"].$(n).keydown(function(e){if(e.which===13){var t;var i={formula:h.encode(this.value),compiledFormula:null};t=h.checkFormulaCFM(i);if(!t){this.style.color="#FF0000";o=this.style.color}else{this.value=h.invertNames(h.decode(this.value));r=this.value;o="#000000";Mt["b"].$(this).blur()}}});l.focus(function(e){o=this.style.color;this.style.color="#5555FF";r=this.value});l.focusout(function(e){this.style.color=o;this.value=r});return a}function buildDragger(e){var t=document.createElement("td");var i=document.createElement("div");i.setAttribute("id",e);i.style.height="10px";i.style.width="10px";i.style.background="rgb(150,150,150)";t.appendChild(i);return t}function addEntry(){var e=0;for(var t=0;t<v.length;t++){var i=v[t].id;if(i>e){e=i}}e++;v.push({id:e,appliesFormula:{formula:"true",compiledFormula:null},conditionFormula:{formula:"true",compiledFormula:null}})}function removeEntry(e){if(v.length===1){return}var t=e.target.id.split(".");var i=parseInt(t[1]);var a=-1;for(var n=0;n<v.length;n++){var r=v[n];if(r.id===i){a=n;break}}if(a!==-1){v.splice(a,1)}for(var n=0;n<v.length;n++){v[n].id=n}}function applyFormulas(e){if(!e){if(checkEntryFormulas()){return false}}for(var t=0;t<v.length;t++){var i=document.getElementById("valueLabelApplies."+t);v[t].appliesFormula.formula=h.encode(i.value);v[t].appliesFormula.compiledFormula=null;var a=document.getElementById("valueLabelCondition."+t);v[t].conditionFormula.formula=h.encode(a.value);v[t].conditionFormula.compiledFormula=null}return true}function sortEntries(e,t){var i=e.target.childNodes;var a=new Array(v.length);var n=false;var r=0;for(var o=0;o<i.length;o++){var l=parseInt(i[o].id.split(".").pop());if(!isNaN(l)){a[o-r]=v[l]}else{r=1}if(o-r!==l){n=true}}if(n){applyFormulas(false);v=a;for(var o=0;o<v.length;o++){v[o].id=o}fillContent()}else{var s=t.item.get()[0].id;var d=s.split(".");var c="valueLabelDragger."+d[1];document.getElementById(c).style.background="rgb(150,150,150)"}}function startEntrySorting(e,t){var i=t.item.get()[0].id;var a=i.split(".");var n="valueLabelDragger."+a[1];document.getElementById(n).style.background="rgb(37,157,187)"}function checkEntryFormulas(){var e=false;for(var t=0;t<v.length;t++){var i=document.getElementById("valueLabelApplies."+t);var a={formula:h.encode(i.value),compiledFormula:null};if(h.checkFormulaCFM(a)===false){i.style.color="#FF0000";e=true}var n=document.getElementById("valueLabelCondition."+t);var a={formula:h.encode(n.value),compiledFormula:null};if(h.checkFormulaCFM(a)===false){n.style.color="#FF0000";e=true}}return e}};var _t=i(497);Mt["b"].UI=Mt["b"].UI||{};Mt["b"].UI.VisualizationMenu=function(e){var E=Mt["b"].DataObjects.InlineCommentRepo;var B=this;var y=e.extension;var o=y.getCanvasDO().getDOMElement();var le=e.chartModel;var C=Mt["b"].DataObjects.ContextRepo.getContextByCid(le.contextId);if(C===null){return}var se=Ot["a"];var de=Mt["b"].Utils.Constants.TypeValues;var ce=de.notation;var c=null;var r=null;var s=null;var k=null;var h=null;var A=null;var f=null;var b=null;var u=null;var S=null;var v=null;var m=null;var T=null;var U=null;var ue=false;var i=0;var H="12px";var x="835";var l="384";var a=getScrollBarWidth();var n=1;var d=At["a"].detectIE()?"ie":"firefox";var M="Auto";var p={width:16+"px",height:16+"px"};var O=null;var g="";var G=[0,0,0,0,0,0,0,0,0];var V=[0,0,0,0,0,0,0,0,0,0];var _=[0,0,0,0,0,0,0,0,0,0,0,0];var L=[0,0,0,0,0,0];var I=[0,0,0,0,0,0,0,0,0];var D=[0,0,0,0,0];var R=[0,0,0,0,0,0,0,0,0];var P;var pe="Axis";var ge="Zero";var N=createInputBoxArray();var he=Mt["b"].Utils.Constants.ParameterSets.structurePositionTypeIds;var fe=Mt["b"].Utils.Constants.ParameterSets.structurePositionTypeTranslations;var me=[false,0,1,2,3,4,5,6,7,8,9];var ve=["-","0","1","2","3","4","5","6","7","8","9"];var be=[1,2,3,4,5,6,7,8,9];var Te=["1","2","3","4","5","6","7","8","9"];var xe=Mt["b"].Utils.Constants.ParameterSets.notationTypeIds;var Ee=Mt["b"].Utils.Constants.ParameterSets.notationTypeTranslations;var ye=Mt["b"].Utils.Constants.ParameterSets.conceptTypeIds;var Ce=Mt["b"].Utils.Constants.ParameterSets.conceptTypeTranslations;var Se=Mt["b"].Utils.Constants.ParameterSets.conceptTypeIds;var Me=Mt["b"].Utils.Constants.ParameterSets.conceptTypeTranslations;var w=["-","All","MinMax","Function"];var F=["-",se.getTranslation("ALL"),se.getTranslation("MIN_MAX"),se.getTranslation("FUNCTION")];var $=["Automatic","In-Line","Displaced"];var z=[se.getTranslation("AUTOMATIC"),se.getTranslation("IN_LINE"),se.getTranslation("DISPLACED")];var W=["","Left","Right"];var j=["-",se.getTranslation("LEFT"),se.getTranslation("RIGHT")];var K=["-","transparent","inverted"];var X=["-",se.getTranslation("TRANSPARENT"),se.getTranslation("INVERTED")];var Y=Mt["b"].Utils.Constants.ParameterSets.valueLabelTypes;var Z=Mt["b"].Utils.Constants.ParameterSets.valueLabelTypesTL;var Q=["value","symbol","-"];var q=[se.getTranslation("VALUE"),se.getTranslation("SYMBOL"),"-"];var J=[">=",">"];var ee=Mt["b"].Utils.Constants.ParameterSets.outlierStyles;var te=Mt["b"].Utils.Constants.ParameterSets.outlierStylesTL;var ie=["Keyfigures","Value label","","","","","","","Legend","","",""];var ae=[se.getTranslation("MEASURES"),se.getTranslation("VALUE_LABEL"),"","","","","","",se.getTranslation("LEGEND"),"","",""];var ne=[se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_MEASURES"),se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_VALUELABEL"),"","","","","","",se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_LEGEND"),"","",""];var re=["","Show","Function","Type","Overlap self","Overlap others","Background","Units","Show","Displace","Connector","InGrid"];var oe=["",se.getTranslation("SHOW"),"",se.getTranslation("TYPE"),se.getTranslation("OVERLAP_SELF"),se.getTranslation("OVERLAP_OTHERS"),se.getTranslation("BACKGROUND"),se.getTranslation("UNITS"),se.getTranslation("SHOW"),se.getTranslation("DISPLACE"),se.getTranslation("CONNECTOR"),se.getTranslation("IN_GRID")];var Oe=["",se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_VALUE_SHOW"),"",se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_VALUE_TYPE"),se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_VALUE_OVERLAP_SELF"),se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_VALUE_OVERLAP_OTHERS"),se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_VALUE_BACKGROUND"),se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_VALUE_UNITS"),se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_LEGEND_SHOW"),se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_LEGEND_DISPLACE"),se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_LEGEND_CONNECTOR"),se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_LEGEND_IN_GRID")];var Ae=["Keyfigures","Operator","Value","Show as","Symbol","Style"];var _e=[se.getTranslation("MEASURES"),se.getTranslation("OPERATOR"),se.getTranslation("VALUE"),se.getTranslation("SHOW_AS"),se.getTranslation("SYMBOL"),se.getTranslation("STYLE")];var Le=[se.getTranslation("HELP_CELL_MEASURES_OUTLIER_MEASURES"),se.getTranslation("HELP_CELL_MEASURES_OUTLIER_OPERATOR"),se.getTranslation("HELP_CELL_MEASURES_OUTLIER_VALUE"),se.getTranslation("HELP_CELL_MEASURES_OUTLIER_SHOW_AS"),se.getTranslation("HELP_CELL_MEASURES_OUTLIER_SYMBOL"),se.getTranslation("HELP_CELL_MEASURES_OUTLIER_STYLE")];var Ie=["","","Alignment","Show small elements","Units","Show","Function","Overlap self","Overlap others","100%-line"];var De=["","",se.getTranslation("ALIGNMENT"),se.getTranslation("SHOW_SMALL_ELEMENTS"),se.getTranslation("UNITS"),se.getTranslation("SHOW"),"",se.getTranslation("OVERLAP_SELF"),se.getTranslation("OVERLAP_OTHERS"),se.getTranslation("100PP_LINE")];var Re=["","",se.getTranslation("HELP_CELL_MEASURES_STACK_ALIGNMENT"),se.getTranslation("HELP_CELL_MEASURES_STACK_SHOW_SMALL_ELEMENTS"),se.getTranslation("HELP_CELL_MEASURES_STACK_UNITS"),se.getTranslation("HELP_CELL_MEASURES_STACK_SHOW"),se.getTranslation("HELP_CELL_MEASURES_STACK_FORMULA"),se.getTranslation("HELP_CELL_MEASURES_STACK_OVERLAP_SELF"),se.getTranslation("HELP_CELL_MEASURES_STACK_OVERLAP_OTHERS"),se.getTranslation("HELP_CELL_MEASURES_STACK_100_PERCENT_LINE")];var Pe=Mt["b"].Utils.Constants.ParameterSets.stackTypes;var Ne=Mt["b"].Utils.Constants.ParameterSets.stackTypesTL;var we=["-","Start","End"];var Fe=["-","Start","End"];var Be=["Keyfigures","Maximize","Legend","",""];var ke=[se.getTranslation("MEASURES"),se.getTranslation("MAXIMIZE"),se.getTranslation("LEGEND"),"",""];var Ue=[se.getTranslation("HELP_CELL_MEASURES_SCALING_HELPER_MEASURES"),se.getTranslation("HELP_CELL_MEASURES_SCALING_HELPER_MAXIMIZE"),se.getTranslation("HELP_CELL_MEASURES_SCALING_HELPER_LEGEND"),"",""];var He=["","","Show","Displace","Sign"];var Ge=["","",se.getTranslation("SHOW"),se.getTranslation("DISPLACE"),se.getTranslation("SIGN")];var Ve=["","",se.getTranslation("HELP_CELL_MEASURES_SCALING_HELPER_SHOW"),se.getTranslation("HELP_CELL_MEASURES_SCALING_HELPER_DISPLACE"),se.getTranslation("HELP_CELL_MEASURES_SCALING_HELPER_SIGN")];var $e=["","Always"];var ze=["-",se.getTranslation("NOTATION")];var We=C.columns;var je=["-","Start","End"];var Ke=["-","Start","End"];var Xe=["Always","Vertical","Horizontal"];var Ye=["-",se.getTranslation("VERTICAL"),se.getTranslation("HORIZONTAL")];var Ze=Mt["b"].Utils.Constants.ParameterSets.structureBarWaterfallPositionTypeIds;var Qe=Mt["b"].Utils.Constants.ParameterSets.structureBarWaterfallPositionTypeTranslations;var qe=Mt["b"].Utils.Constants.ParameterSets.timeBarWaterfallPositionTypeIds;var Je=Mt["b"].Utils.Constants.ParameterSets.timeBarWaterfallPositionTypeTranslations;var et=new Mt["b"].Utils.Calculator(C);var tt=[[],J,"",q,[],te];var it={};var at=[se.getTranslation("MEASURE"),se.getTranslation("TYPE"),se.getTranslation("LENGTH"),se.getTranslation("COMMON_TABLE"),se.getTranslation("SAVE_AS_INPUT"),se.getTranslation("KEY"),se.getTranslation("EDIT"),se.getTranslation("MANDATORY"),se.getTranslation("TRANSPORT"),se.getTranslation("CHECK")];var nt=Mt["b"].Utils.Constants.TypeValues.transport,rt=Mt["b"].Connector.ConnectorHelper.Settings.transportIcons;var ot,lt,st,dt,ct,ut,pt,gt,ht,ft,mt,vt,bt;var Tt,xt,Et;if(le.instanceOf==="ChartModel"){W=Mt["b"].Utils.Constants.ParameterSets.structureLegendTypeIds;j=Mt["b"].Utils.Constants.ParameterSets.structureLegendTypeTranslations;st=["Always","Vertical","Horizontal"];dt=["-",se.getTranslation("VERTICAL"),se.getTranslation("HORIZONTAL")];xe=Mt["b"].Utils.Constants.ParameterSets.notationTypeIds;Ee=Mt["b"].Utils.Constants.ParameterSets.notationTypeTranslations;he=Mt["b"].Utils.Constants.ParameterSets.structurePositionTypeIds;fe=Mt["b"].Utils.Constants.ParameterSets.structurePositionTypeTranslations;ot=["Keyfigures","Show as","Sum as value","Reference","Position","Stack","Order","Notation","Concept"];Tt=["RST","SubTTL","TTL"];lt=[se.getTranslation("MEASURES"),se.getTranslation("SHOW_AS"),se.getTranslation("SUM_AS_VALUE"),se.getTranslation("STARTING_AT"),se.getTranslation("POSITION"),se.getTranslation("STACK"),se.getTranslation("ORDER"),se.getTranslation("NOTATION"),se.getTranslation("CONCEPT")];xt=[se.getTranslation("SUM_AS_VALUE-RST"),se.getTranslation("SUM_AS_VALUE-SubTTL"),se.getTranslation("SUM_AS_VALUE-TTL")];ct=[se.getTranslation("HELP_CELL_MEASURES_ELEMENT_MEASURES"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_SHOW_AS"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_SUM_AS_VALUE"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_STARTING_AT"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_POSITION"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_STACK"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_ORDER"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_NOTATION"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_CONCEPT")];Et=[se.getTranslation("HELP_CELL_MEASURES_ELEMENT_SUM_REST"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_SUM_SUBTOTAL"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_SUM_TOTAL")];pt=["Keyfigures","Show as","Sum as value","Reference","Position","Stack","Order","Notation","Base Concept","Reference Concept"];gt=[se.getTranslation("MEASURES"),se.getTranslation("SHOW_AS"),se.getTranslation("SUM_AS_VALUE"),se.getTranslation("STARTING_AT"),se.getTranslation("POSITION"),se.getTranslation("STACK"),se.getTranslation("ORDER"),se.getTranslation("NOTATION"),se.getTranslation("BASE_CONCEPT"),se.getTranslation("REFERENCE")];ut=[se.getTranslation("HELP_CELL_MEASURES_ELEMENT_MEASURES"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_SHOW_AS"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_SUM_AS_VALUE"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_STARTING_AT"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_POSITION"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_STACK"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_ORDER"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_NOTATION"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_BASE_CONCEPT"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_REFERENCE_CONCEPT")];ht=Mt["b"].Utils.Constants.ParameterSets.structureRepresentationTypeIds;ft=Mt["b"].Utils.Constants.ParameterSets.structureRepresentationTypeTranslations;mt=[We,ft,[],We,fe,ve,Te,Ee,Ce];vt=[We,ft,[],We,fe,ve,Te,Ee,Ce,Me];bt=[Ne,Qe,z,[],[],F,[],[],Fe]}else if(le.instanceOf==="TableModel"){W=Mt["b"].Utils.Constants.ParameterSets.tableLegendTypeIds;j=Mt["b"].Utils.Constants.ParameterSets.tableLegendTypeTranslations;ot=["Keyfigures","Show as","Sum as value","","","","","Notation","Concept","Axis mid"];Tt=["RST","SubTTL","TTL"];lt=[se.getTranslation("MEASURES"),se.getTranslation("SHOW_AS"),se.getTranslation("SUM_AS_VALUE"),"","","","",se.getTranslation("NOTATION"),se.getTranslation("CONCEPT"),se.getTranslation("AXIS_MID")];xt=[se.getTranslation("SUM_AS_VALUE-RST"),se.getTranslation("SUM_AS_VALUE-SubTTL"),se.getTranslation("SUM_AS_VALUE-TTL")];ct=[se.getTranslation("HELP_CELL_MEASURES_ELEMENT_MEASURES"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_SHOW_AS"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_SUM_AS_VALUE"),"","","","",se.getTranslation("HELP_CELL_MEASURES_ELEMENT_NOTATION"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_CONCEPT"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_AXIS_MID")];Et=[se.getTranslation("HELP_CELL_MEASURES_ELEMENT_SUM_REST"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_SUM_SUBTOTAL"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_SUM_TOTAL")];pt=["Keyfigures","Show as","Sum as value","","","","","Notation","Base Concept","Reference Concept","Axis mid"];gt=[se.getTranslation("MEASURES"),se.getTranslation("SHOW_AS"),se.getTranslation("SUM_AS_VALUE"),"","","","",se.getTranslation("NOTATION"),se.getTranslation("BASE_CONCEPT"),se.getTranslation("REFERENCE"),se.getTranslation("AXIS_MID")];ut=[se.getTranslation("HELP_CELL_MEASURES_ELEMENT_MEASURES"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_SHOW_AS"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_SUM_AS_VALUE"),"","","","",se.getTranslation("HELP_CELL_MEASURES_ELEMENT_NOTATION"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_BASE_CONCEPT"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_REFERENCE_CONCEPT"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_AXIS_MID")];ht=Mt["b"].Utils.Constants.ParameterSets.tableRepresentationTypeIds;ft=Mt["b"].Utils.Constants.ParameterSets.tableRepresentationTypeTranslations;xe=Mt["b"].Utils.Constants.ParameterSets.notationTypeIds;Ee=Mt["b"].Utils.Constants.ParameterSets.notationTypeTranslations;mt=[We,ft,[],[],[],[],[],Ee,Ce];vt=[We,ft,[],[],[],[],[],Ee,Ce,Me];ie=["Keyfigures","Value label","","","","","Legend"];ae=[se.getTranslation("MEASURES"),se.getTranslation("VALUE_LABEL"),"","","","",se.getTranslation("LEGEND")];ne=[se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_MEASURES"),se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_VALUELABEL"),"","","","",se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_LEGEND")];re=["","Show","Function","Type","Background","Units","Show"];oe=["",se.getTranslation("SHOW"),"",se.getTranslation("TYPE"),se.getTranslation("BACKGROUND"),se.getTranslation("UNITS"),se.getTranslation("SHOW")];Oe=["",se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_VALUE_SHOW"),"",se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_VALUE_TYPE"),se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_VALUE_BACKGROUND"),se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_VALUE_UNITS"),se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_LEGEND_SHOW")];je=["-","End"];Ke=["-","End"];bt=[[],[],[],[],[],[],[],[],[]]}else if(le.instanceOf==="TimeChartModel"){he=Mt["b"].Utils.Constants.ParameterSets.timePositionTypeIds;fe=Mt["b"].Utils.Constants.ParameterSets.timePositionTypeTranslations;xe=Mt["b"].Utils.Constants.ParameterSets.timeNotationTypeIds;Ee=Mt["b"].Utils.Constants.ParameterSets.timeNotationTypeTranslations;ot=["Keyfigures","Show as","Sum as value","Reference","Position","Stack","Order","Notation","Concept"];Tt=["RST","SubTTL","TTL"];lt=[se.getTranslation("MEASURES"),se.getTranslation("SHOW_AS"),se.getTranslation("SUM_AS_VALUE"),se.getTranslation("STARTING_AT"),se.getTranslation("POSITION"),se.getTranslation("STACK"),se.getTranslation("ORDER"),se.getTranslation("NOTATION"),se.getTranslation("CONCEPT")];xt=[se.getTranslation("SUM_AS_VALUE-RST"),se.getTranslation("SUM_AS_VALUE-SubTTL"),se.getTranslation("SUM_AS_VALUE-TTL")];ct=[se.getTranslation("HELP_CELL_MEASURES_ELEMENT_MEASURES"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_SHOW_AS"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_SUM_AS_VALUE"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_STARTING_AT"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_POSITION"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_STACK"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_ORDER"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_NOTATION"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_CONCEPT")];Et=[se.getTranslation("HELP_CELL_MEASURES_ELEMENT_SUM_REST"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_SUM_SUBTOTAL"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_SUM_TOTAL")];pt=["Keyfigures","Show as","Sum as value","Reference","Position","Stack","Order","Notation","Base Concept","Reference Concept"];gt=[se.getTranslation("MEASURES"),se.getTranslation("SHOW_AS"),se.getTranslation("SUM_AS_VALUE"),se.getTranslation("STARTING_AT"),se.getTranslation("POSITION"),se.getTranslation("STACK"),se.getTranslation("ORDER"),se.getTranslation("NOTATION"),se.getTranslation("BASE_CONCEPT"),se.getTranslation("REFERENCE")];ut=[se.getTranslation("HELP_CELL_MEASURES_ELEMENT_MEASURES"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_SHOW_AS"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_SUM_AS_VALUE"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_STARTING_AT"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_POSITION"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_STACK"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_ORDER"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_NOTATION"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_BASE_CONCEPT"),se.getTranslation("HELP_CELL_MEASURES_ELEMENT_REFERENCE_CONCEPT")];ht=Mt["b"].Utils.Constants.ParameterSets.timeRepresentationTypeIds;ft=Mt["b"].Utils.Constants.ParameterSets.timeRepresentationTypeTranslations;mt=[We,ft,[],We,fe,ve,Te,Ee,Ce];vt=[We,ft,[],We,fe,ve,Te,Ee,Ce,Me];W=Mt["b"].Utils.Constants.ParameterSets.timeLegendTypeIds;j=Mt["b"].Utils.Constants.ParameterSets.timeLegendTypeTranslations;st=["Always","Vertical","Horizontal"];dt=["-",se.getTranslation("VERTICAL"),se.getTranslation("HORIZONTAL")];bt=[Ne,Je,z,[],[],F,[],[],Fe]}var yt=!(le.instanceOf==="TableModel")?[[],F,[],Z,[],[],X,[],j,dt,ze,[]]:[[],F,[],Z,X,[],j,[],[],[],[],[],[]];var Ct=[[],[],Ke,Ye,[]];fillExpressionCollection();var St=[{id:"subtab-general",text:se.getTranslation("ELEMENT"),tooltip:se.getTranslation("HELP_CELL_MEASURES_ELEMENT"),buildUp:createExpressionsGeneralTab},{id:"subtab-co-des",text:se.getTranslation("DESCRIPTION"),tooltip:se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION"),buildUp:createExpressionsColorsDescriptionsTab},{id:"subtab-outlier",text:se.getTranslation("OUTLIER"),tooltip:se.getTranslation("HELP_CELL_MEASURES_OUTLIER"),buildUp:createExpressionsOutlierTab},{id:"subtab-totals",text:se.getTranslation("STACK"),tooltip:se.getTranslation("HELP_CELL_MEASURES_STACK"),buildUp:createExpressionsTotalTab},{id:"subtab-scaling",text:se.getTranslation("SCALING_HELPER"),tooltip:se.getTranslation("HELP_CELL_MEASURES_SCALING_HELPER"),buildUp:createExpressionsScalingTab},{id:"subtab-input",text:se.getTranslation("INPUT"),tooltip:"pH",buildUp:createExpressionsInputTab}];B.open=function(){if(C===null){return}var e=Mt["b"].$(o).offset();var t=[];t.push({text:se.getTranslation("OKAY"),id:"okayButton",click:B.okay});t.push({text:se.getTranslation("CANCEL"),id:"closeButton",click:B.close});t.push({text:se.getTranslation("APPLY"),id:"applyButton",click:B.apply});var i=new Mt["b"].UI.HiCoDialogDefinition("visualizationMenu","Keyfigures",t);i.setParentDomElement(o.parentNode);i.setWidth(x);i.setHeight(l);i.setPosition([e.left,e.top]);H=i.getFontSize();c=new Mt["b"].UI.HiCoDialog(i);s=c.getDialogDiv();var a={position:"absolute",visibility:"hidden",height:"auto",width:"auto"};var n=document.createElement("div");n.setAttribute("id","hiddenDiv");Mt["b"].Utils.DOM.setStyle(n,a);n.style.fontSize=i.getFontSize();s.appendChild(n);calculateStdLength();createExpressionsTab();c.setEvent("dialogresizestop",function(e,t){B.updateTableDivHeight(k,A,b,S,m)});c.setCSS("overflow","hidden");c.setCSS();c.decorateTabs(0,St);B.linkScrollbarGeneralTab();B.linkScrollbarColorsDescriptionsTab();B.linkScrollbarOutlierTab();B.linkScrollbarTotalTab();B.linkScrollbarScalingTab();B.updateAllExpressionCollectionObjects();for(var r=0;r<We.length;r++){B.setRowHighlightForStartUp(We[r].id)}};B.embed=function(e,t,i,a){if(C===null){return null}c=e;s=c.getDialogDiv();O=a;var n={position:"absolute",visibility:"hidden",height:"auto",width:"auto"};var r=document.createElement("div");r.setAttribute("id","hiddenDiv");Mt["b"].Utils.DOM.setStyle(r,n);H=i;r.style.fontSize=H;s.appendChild(r);calculateStdLength();createExpressionsTab();t.appendChild(U);c.setCSS("overflow","hidden");c.setCSS();c.decorateTabs(0,St);B.linkScrollbarGeneralTab();B.linkScrollbarColorsDescriptionsTab();B.linkScrollbarOutlierTab();B.linkScrollbarTotalTab();B.linkScrollbarScalingTab();B.updateAllExpressionCollectionObjects();for(var o=0;o<We.length;o++){B.setRowHighlightForStartUp(We[o].id)}if(le.instanceOf==="TableModel"){for(var o=0,l=We.length;o<l;o++){B.setRowHighlightForInputStartUp(We[o].id)}}B.updateTableDivHeightFromOutside(Mt["b"].$(s).parent().height(),Mt["b"].$(s).parent().width());return this};B.getSize=function(){return x};B.getDialogObj=function(){return c};function createExpressionsTab(){B.calculateColumnsLength();var e={show:function(e,t){i=t.index;c.decorateTabs(t.index,St);B.updateTableDivHeightFromOutside(Mt["b"].$(s).parent().height(),parseFloat(s.parentNode.style.width))}};U=c.buildTabs("propertiesExpressionsTabDiv",St,null,"auto",{top:"0px",left:"0px"},e,true);if(!le.stackMode){Mt["b"].$(U).tabs("disable",3)}if(checkExpressionsForInput()){Mt["b"].$(U).tabs("disable",5)}}function checkExpressionsForInput(){if(le.instanceOf!=="TableModel"){return true}var e=de.tableRepresentation;for(var t=0,i=We.length;t<i;t++){var a=We[t];var n=it[a.id];var r=n?n.representations.currSelected:null;if(r&&r!==e.NONE&&(r===e.LIST||r===e.COMMENT||r===e.FLAG)){return false}}return true}function getScrollBarWidth(){var e=Mt["b"].$("<div>").css({visibility:"hidden",width:100,overflow:"scroll"}).appendTo("body"),t=Mt["b"].$("<div>").css({width:"100%"}).appendTo(e).outerWidth();e.remove();return 100-t}function createExpressionsGeneralTab(){var e=document.createElement("div");e.setAttribute("id","tabGeneralDiv");var t=B.createExpressionsGeneralHeader();e.appendChild(t);var i=B.createExpressionsGeneralTable();e.appendChild(i);return e}B.createExpressionsGeneralHeader=function(){x="835";if(ue===true){return B.createExpressionsGeneralHeaderRef()}var e=document.createElement("div");h=e;e.setAttribute("id","headerDiv");var t={height:50+"px",width:"auto",overflow:"hidden"};Mt["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");var a=document.createElement("tr");for(var n=0;n<ot.length;n++){if(ot[n]===""){continue}var r=document.createElement("td");var o=G[n];var l={width:o+"px",minWidth:o+"px",whiteSpace:"nowrap"};Mt["b"].Utils.DOM.setStyle(r,l);Mt["b"].$(r).html(lt[n]);if(ct[n]!=""){r.setAttribute("title",ct[n])}a.appendChild(r)}i.appendChild(a);var s=document.createElement("tr");for(var n=0;n<ot.length;n++){if(ot[n]===""){continue}var d=document.createElement("td");var o=G[n];var l={width:o+"px",minWidth:o+"px",whiteSpace:"nowrap"};Mt["b"].Utils.DOM.setStyle(d,l);var c=document.createElement("span");c.style.margin="0px";Mt["b"].$(c).html('<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">');d.appendChild(c);s.appendChild(d)}i.appendChild(s);var u=document.createElement("tr");for(var n=0;n<ot.length;n++){if(ot[n]===""){continue}var r=document.createElement("td");var o=G[n];var l={width:o+"px",minWidth:o+"px",whiteSpace:"nowrap"};Mt["b"].Utils.DOM.setStyle(r,l);if(ot[n]==="Sum as value"){for(var p=0;p<Tt.length;p++){var g=document.createElement("span");Mt["b"].$(g).text(xt[p]);Mt["b"].Utils.DOM.setStyle(g,{marginRight:"4px"});if(Et[p]!=""){g.setAttribute("title",Et[p])}r.appendChild(g)}}u.appendChild(r)}i.appendChild(u);e.appendChild(i);return e};B.createExpressionsGeneralHeaderRef=function(){x="965";var e=document.createElement("div");h=e;e.setAttribute("id","headerDiv");var t={height:50+"px",width:"auto",overflow:"hidden"};Mt["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");var a=document.createElement("tr");for(var n=0;n<pt.length;n++){if(pt[n]===""){continue}var r=document.createElement("td");var o=G[n];var l={width:o+"px",minWidth:o+"px",whiteSpace:"nowrap"};Mt["b"].Utils.DOM.setStyle(r,l);Mt["b"].$(r).html(gt[n]);if(ut[n]!=""){r.setAttribute("title",ut[n])}a.appendChild(r)}i.appendChild(a);var s=document.createElement("tr");for(var n=0;n<pt.length;n++){if(pt[n]===""){continue}var d=document.createElement("td");var o=G[n];var l={width:o+"px",minWidth:o+"px",whiteSpace:"nowrap"};Mt["b"].Utils.DOM.setStyle(d,l);var c=document.createElement("span");c.style.margin="0px";Mt["b"].$(c).html('<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">');d.appendChild(c);s.appendChild(d)}i.appendChild(s);var u=document.createElement("tr");for(var n=0;n<pt.length;n++){if(pt[n]===""){continue}var r=document.createElement("td");var o=G[n];var l={width:o+"px",minWidth:o+"px",whiteSpace:"nowrap"};Mt["b"].Utils.DOM.setStyle(r,l);if(pt[n]==="Sum as value"){for(var p=0;p<Tt.length;p++){var g=document.createElement("span");Mt["b"].$(g).text(xt[p]);Mt["b"].Utils.DOM.setStyle(g,{marginRight:"4px"});if(Et[p]!=""){g.setAttribute("title",Et[p])}r.appendChild(g)}}u.appendChild(r)}i.appendChild(u);e.appendChild(i);return e};B.getNotationType=function(e,t){if(t===true){for(var i=0;i<e.length;i++){if(e[i].selected===true){var a=e[i].value;break}}}else{var a=e.currSelected}switch(a){case se.getTranslation("ELEMENT"):a=ce.ELEMENT;break;case se.getTranslation("AXIS"):a=ce.AXIS;break;case se.getTranslation("HEADER"):a=ce.HEADER;break;case se.getTranslation("ELEMENT_HEADER"):a=ce.ELEMENT_HEADER;break;case se.getTranslation("ELEMENT_AXIS"):a=ce.ELEMENT_AXIS;break}return a};B.getRepresentationType=function(e,t){if(t===true){for(var i=0;i<e.length;i++){if(e[i].selected===true){var a=e[i].value;break}}}else{var a=e.currSelected}if(a==="timeRepresentationType.0"||a==="structureRepresentationType.0"||a==="tableRepresentationType.0"||a==="-"){a="-"}else if(a==="timeRepresentationType.1"||a==="structureRepresentationType.1"||a==="tableRepresentationType.2"||a===se.getTranslation("BAR")){a=se.getTranslation("BAR")}else if(a==="timeRepresentationType.2"||a==="structureRepresentationType.2"||a==="tableRepresentationType.3"||a===se.getTranslation("NEEDLE")){a=se.getTranslation("NEEDLE")}else if(a==="timeRepresentationType.3"||a==="structureRepresentationType.3"||a==="tableRepresentationType.4"||a===se.getTranslation("WATERFALL")){a=se.getTranslation("WATERFALL")}else if(a==="timeRepresentationType.4"||a==="structureRepresentationType.4"||a==="tableRepresentationType.5"||a===se.getTranslation("LINE")){a=se.getTranslation("LINE")}else if(a==="timeRepresentationType.5"||a==="structureRepresentationType.5"||a==="tableRepresentationType.6"||a===se.getTranslation("SYMBOL")){a=se.getTranslation("SYMBOL")}else if(a==="timeRepresentationType.6"||a==="structureRepresentationType.6"||a==="tableRepresentationType.7"||a===se.getTranslation("SYMBOL_LINE")){a=se.getTranslation("SYMBOL_LINE")}else if(a==="tableRepresentationType.1"||a==="timeRepresentationType.7"||a==="structureRepresentationType.7"){a=se.getTranslation("VALUE")}return a};B.referenceConceptChange=function(e,t,i,a){var n=B.getNotationType(i,a);var r=B.getRepresentationType(e,a);if(r!="-"){if(n==ce.ELEMENT_AXIS||n==ce.ELEMENT_HEADER){t.disabled=false}else{t.disabled=true}}else{t.disabled=true}};B.typeChange=function(e,t,i){var a=it[t];var n=a.representations.currSelected;var r;if(e.instanceOf==="ChartModel"){r=de.structureRepresentation}else if(e.instanceOf==="TimeChartModel"){r=de.timeRepresentation}else{r=de.tableRepresentation}var o=B.getAllCurrentDropboxContent(a,e,r,i);if(n===r.NONE){B.disableTabElements(true,t,"subtab-outlier",n,0);B.disableTabElements(true,t,"subtab-scaling",n,0);B.disableTabElements(true,t,"subtab-general",n,0);B.disableTabElements(true,t,"subtab-co-des",n,0);if(checkExpressionsForInput()){Mt["b"].$(U).tabs("disable",5)}Mt["b"].$("#tabInputTableDiv").html(B.createExpressionsInputTable())}else if(e.instanceOf==="TableModel"&&(n===r.LIST||n===r.COMMENT||n===r.FLAG)){B.disableTabElements(true,t,"subtab-outlier",n,0);B.disableTabElements(true,t,"subtab-scaling",n,0);B.disableTabElements(false,t,"subtab-general",n,0);B.disableTabElements(true,t,"subtab-co-des",n,0);var l=document.getElementById("select##"+t+"##axisMid");l.setAttribute("disabled","disabled");if(o.notationArray){var s=document.getElementById("select##"+t+"##notation");B.updateDropboxElements(s,o.notationArray,a.notation,a.notation.availNotations,a.notation.availNotationsTL,e)}if(o.conceptArray){var d=document.getElementById("select##"+t+"##concept");B.updateDropboxElements(d,o.conceptArray,a.concept,a.concept.availConcepts,a.concept.availConceptsTL,e)}Mt["b"].$(U).tabs("enable",5);Mt["b"].$("#tabInputTableDiv").html(B.createExpressionsInputTable())}else{if(i===true){if(o.conceptArray){var d=document.getElementById("select##"+t+"##concept");B.updateDropboxElements(d,o.conceptArray,a.concept,a.concept.availConcepts,a.concept.availConceptsTL,e)}}else{if(o.notationArray){var s=document.getElementById("select##"+t+"##notation");B.updateDropboxElements(s,o.notationArray,a.notation,a.notation.availNotations,a.notation.availNotationsTL,e)}if(o.conceptArray){var d=document.getElementById("select##"+t+"##concept");B.updateDropboxElements(d,o.conceptArray,a.concept,a.concept.availConcepts,a.concept.availConceptsTL,e)}if(o.backgroundArray){var c=document.getElementById("select##"+t+"##valueLabelBackground");B.updateDropboxElements(c,o.backgroundArray,a.valueLabelBackground,K,X,e)}if(o.legendArray){var u=document.getElementById("select##"+t+"##legend");B.updateDropboxElements(u,o.legendArray,a.legend,W,j,e)}if(o.positionArray){var p=document.getElementById("select##"+t+"##position");B.updateDropboxElements(p,o.positionArray,a.positions,a.positions.availPositions,a.positions.availPositionsTL,e)}if(o.valueLabelTypesArray){var g=document.getElementById("select##"+t+"##valueLabelType");B.updateDropboxElements(g,o.valueLabelTypesArray,a.valueLabelType,Y,Z,e)}if(n==r.VALUE&&e.instanceOf!=="TableModel"){B.disableTabElements(true,t,"subtab-outlier",n);B.disableTabElements(true,t,"subtab-scaling",n);B.disableTabElements(true,t,"subtab-general",n);B.disableTabElements(false,t,"subtab-co-des",n)}else{B.disableTabElements(false,t,"subtab-outlier",n);B.disableTabElements(false,t,"subtab-scaling",n);B.disableTabElements(false,t,"subtab-general",n);B.disableTabElements(false,t,"subtab-co-des",n)}}}};B.getAllCurrentDropboxContent=function(e,t,i,a){var n=e.representations.currSelected;var r=e.notation.currSelected;var o=undefined;var l=undefined;var s=undefined;var d=undefined;var c=undefined;if(n===i.VALUE){if(t.instanceOf!=="TableModel"){l=[se.getTranslation("ELEMENT")]}else{if(e.referenceUsed===false){l=[se.getTranslation("ELEMENT"),se.getTranslation("HEADER")]}else{l=[se.getTranslation("ELEMENT"),se.getTranslation("HEADER"),se.getTranslation("ELEMENT_HEADER")]}}s=[se.getTranslation("AREA"),se.getTranslation("COLOR")];d=["-",se.getTranslation("TRANSPARENT")];if(t.instanceOf!=="TableModel"){if(t.instanceOf==="ChartModel"){c=["-",se.getTranslation("TOP_AXIS"),se.getTranslation("BOTTOM_AXIS")]}else{c=["-",se.getTranslation("LEFT_AXIS"),se.getTranslation("RIGHT_AXIS")]}o=fe}else{c=j}}else if(n===i.BAR||n===i.WATERFALL||n==i.LINE||n===i.COLUMN){s=[se.getTranslation("AREA"),se.getTranslation("COLOR"),se.getTranslation("AREA_COLOR")];l=Ee;d=X;c=j;if(t.instanceOf!=="TableModel"){if(t.instanceOf==="ChartModel"){o=Qe}else{o=Je}}}else if(t.instanceOf==="TableModel"&&n===i.LIST||n===i.COMMENT||n===i.FLAG){if(e.referenceUsed===false){l=[se.getTranslation("ELEMENT"),se.getTranslation("HEADER")]}else{l=[se.getTranslation("ELEMENT"),se.getTranslation("HEADER"),se.getTranslation("ELEMENT_HEADER")]}s=[se.getTranslation("AREA"),se.getTranslation("COLOR"),se.getTranslation("AREA_COLOR")];c=j}else{if(r===ce.ELEMENT||r===ce.ELEMENT_AXIS||r===ce.ELEMENT_HEADER){s=Ce}else{s=[se.getTranslation("AREA"),se.getTranslation("COLOR"),se.getTranslation("AREA_COLOR")]}if(a===false){l=Ee;d=X;c=j;if(t.instanceOf!=="TableModel"){o=fe}}}var u=Z.slice(0);if(!t.stackMode||e.stack.currSelected===false){u.splice(3,1);u.splice(2,1)}return{conceptArray:s,notationArray:l,backgroundArray:d,positionArray:o,legendArray:c,valueLabelTypesArray:u}};B.disableTabElements=function(e,t,i,a,n){var r,o;if(i==="subtab-outlier"){o=["##outlierSymbols","##outlierStyle"]}else if(i==="subtab-scaling"){o=["##scalingMaximize","##scalingLegendShow","##scalingLegendDisplace","##scalingLegendSign"]}else if(i==="subtab-general"){if(le.instanceOf!=="TableModel"){o=["##position","##reference","##stack","##sequence","##notation","##concept"]}else{o=["##notation","##concept","##axisMid"]}}else if(i==="subtab-co-des"){if(le.instanceOf!=="TableModel"){o=["##valueLabel","##valueLabelType","##valueLabelCollisionD","##valueLabelBackground","##valueLabelUnitsD","##legend","##legendCollision","##connector","##legendInGrid"]}else{o=["##valueLabel","##valueLabelType","##valueLabelBackground","##valueLabelUnitsD","##legend"]}}for(var l=0;l<o.length;l++){r=document.getElementById("select##"+t+o[l]);if(o[l]==="##legend"){if(a===de.tableRepresentation.LIST||a===de.tableRepresentation.COMMENT||a===de.tableRepresentation.FLAG){r.removeAttribute("disabled");continue}}if(o[l]==="##stack"){if(a===de.timeRepresentation.COLUMN||a===de.structureRepresentation.BAR){r.removeAttribute("disabled")}else{r.value=false;r.selectedIndex=0;it[t].stack.currSelected=false;r.setAttribute("disabled","disabled");var s=document.getElementById("select##"+t+"##valueLabelType");if(s){var d=Z.slice(0);d.splice(3,1);d.splice(2,1);B.updateDropboxElements(s,d,it[t].valueLabelType,Y,Z,le)}}continue}if((a===de.timeRepresentation.VALUE||a===de.structureRepresentation.VALUE||a===de.tableRepresentation.VALUE)&&e===true&&i==="subtab-general"){if(o[l]!=="##sequence"&&o[l]!=="##stack"){r.removeAttribute("disabled");continue}}if(e===true){r.setAttribute("disabled","disabled")}else{r.removeAttribute("disabled")}}};B.updateDropboxElements=function(e,t,i,a,n,r){var o=e.id.split("##").pop();var l=false;var s;if(o==="legend"){if(r.instanceOf==="ChartModel"){var d=i.currSelected.split(".");if(d.length>2){d.pop();s=d.join(".")}else{s=i.currSelected}}else if(r.instanceOf==="TableModel"){s=i.currSelected}else{s=i.currSelected.split(".")[0]}}else{s=i.currSelected}var c=a.indexOf(s);var u=n[c];for(var p=0;p<e.length;p++){var g=false;for(var h=0;h<t.length;h++){if(u===t[h]){l=true}if(e[p].text===t[h]){g=true}}if(g){if(e[p].disabled===true){e[p].disabled=false;e[p].hidden=false}continue}e[p].disabled=true;e[p].hidden=true}if(l===false){if(o==="position"){if(r.instanceOf==="ChartModel"){i.currSelected=de.structurePosition.MID}else{i.currSelected=de.timePosition.MID}}else{i.currSelected=a[0]}c=a.indexOf(i.currSelected)}if(e[c].selected===false){e[c].selected=true}};B.createExpressionsGeneralTable=function(){var e=document.createElement("div");k=e;e.setAttribute("id","tableDiv");var t={height:175+"px",width:"100%",overflow:"auto"};Mt["b"].Utils.DOM.setStyle(e,t);Mt["b"].$(e).scroll(function(){B.linkScrollbarGeneralTab()});var i=document.createElement("table");var p=[];for(var a=0;a<We.length;a++){var n=We[a];var r=n.id;var o=n.name;var l=it[r];var s=document.createElement("tr");s.setAttribute("id",r+"##general");var d=ct;var c=Et;if(ue===true){G=V;d=ut}var u=document.createElement("td");var g={width:G[0]+"px",minWidth:G[0]+"px"};Mt["b"].Utils.DOM.setStyle(u,g);Mt["b"].$(u).html(o);u.setAttribute("id",r);u.setAttribute("title",d[0]);Mt["b"].$(u).bind("click",function(e){B.highlightRow(e)});u.style.whiteSpace="nowrap";s.appendChild(u);var h=document.createElement("td");g={width:G[1]+"px",minWidth:G[1]+"px"};Mt["b"].Utils.DOM.setStyle(h,g);var f=l.representations;var m=Mt["b"].Utils.DOM.createSelectBox(h,"select##"+r+"##representation",f.availRepresentations,f.availRepresentationsTL,f.currSelected,H);m.setAttribute("title",d[1]);m.setAttribute("style","width: "+(G[1]-5)+"px");Mt["b"].$(m).bind("change",function(e){B.temporaryChangeSelection(e);if(le.instanceOf!=="TableModel"){B.updateExpressionCollectionReferenceObject()}});s.appendChild(h);g={width:G[2]+"px",minWidth:G[2]+"px"};var h=document.createElement("td");Mt["b"].Utils.DOM.setStyle(h,g);var v=Mt["b"].Utils.DOM.createCheckBoxWithLabel(h,"select##"+r+"##showRestAsValue","select##"+r+"##showRestAsValue","","").checkBox;v.checked=l.showRestAsValue===true;v.title=c[0];v.style.width=G[2]/3-5+"px";if(le.instanceOf==="TableModel"){v.checked=false;v.disabled="disabled"}var v=Mt["b"].Utils.DOM.createCheckBoxWithLabel(h,"select##"+r+"##showSubtotalAsValue","select##"+r+"##showSubtotalAsValue","","").checkBox;v.checked=l.showSubtotalAsValue===true;v.title=c[1];v.style.width=G[2]/3+5+"px";if(le.instanceOf==="TableModel"){v.checked=false;v.disabled="disabled"}var v=Mt["b"].Utils.DOM.createCheckBoxWithLabel(h,"select##"+r+"##showTotalAsValue","select##"+r+"##showTotalAsValue","","").checkBox;v.checked=l.showTotalAsValue===true;v.title=c[2];v.style.width=G[2]/3-5+"px";if(le.instanceOf==="TableModel"){v.checked=false;v.disabled="disabled"}s.appendChild(h);if(le.instanceOf!=="TableModel"){var b=l.stack;var T=b.currSelected;h=document.createElement("td");var x=G[3];var E=l.reference;var g={width:x+"px",minWidth:x+"px"};Mt["b"].Utils.DOM.setStyle(h,g);var y=E.currSelected;var C=l.stack.currSelected!==false;for(var S=0;S<We.length;S++){var M=it[We[S].id];var O=We[S].id.split(".").pop();if(n.id!==We[S].id){if(n.scalingGroup===We[S].scalingGroup&&l.representations.currSelected!==de.timeRepresentation.NONE&&l.representations.currSelected!==de.structureRepresentation.NONE&&M.representations.currSelected!==de.timeRepresentation.VALUE){if(C===false||M.stack.currSelected===false){E.availReferences.push(We[S].name);E.availReferencesIds.push(O)}}}}if(E.availReferencesIds.indexOf(y)===-1){E.currSelected=ge}var m=Mt["b"].Utils.DOM.createSelectBox(h,"select##"+r+"##reference",E.availReferencesIds,E.availReferences,E.currSelected,H);m.style.minWidth=x-5+"px";m.style.width=x-5+"px";m.setAttribute("title",d[3]);Mt["b"].$(m).bind("change",function(e){B.temporaryChangeSelection(e)});s.appendChild(h);var h=document.createElement("td");var g={width:G[4]+"px",minWidth:G[4]+"px"};Mt["b"].Utils.DOM.setStyle(h,g);var A="top";var m=Mt["b"].Utils.DOM.createSelectBox(h,"select##"+r+"##position",he,fe,A,H);m.style.width=G[4]-5+"px";m.style.minWidth=G[4]-5+"px";m.setAttribute("title",d[4]);if(le.stackMode&&T!==false&&T!==undefined){m.disabled=true}Mt["b"].$(m).bind("change",function(e){B.temporaryChangeSelection(e)});s.appendChild(h);h=document.createElement("td");var g={width:G[5]+"px",minWidth:G[5]+"px"};Mt["b"].Utils.DOM.setStyle(h,g);var _=null;for(var L=0;L<le.expressions.length;L++){if(le.expressions[L].id===r){_=L;break}}var I=false;if(_===null||!le.expressions[_]||le.expressions[_].representation!==de.timeRepresentation.COLUMN&&le.expressions[_].representation!==de.structureRepresentation.BAR){b.currSelected=false;I=true}var m=Mt["b"].Utils.DOM.createSelectBox(h,"select##"+r+"##stack",b.availStack,b.availStackTL,b.currSelected,H);m.setAttribute("title",d[6]);p.push(m);m.disabled=I;Mt["b"].$(m).bind("change",function(e){B.temporaryChangeSelection(e);var t=this.id.split("##");var i=it[t[1]];var a=i.stack;var n=this.selectedIndex;var r=a.availStack[n];if(this.lastSelectedIndex&&this.lastSelectedIndex!=n){r=a.availStack[this.lastSelectedIndex];for(var o=0;o<p.length;o++){if(p[o]!=this){Mt["b"].$(p[o]).find("option:eq("+this.lastSelectedIndex+")").css("background","none").removeAttr("disabled")}}r=a.availStack[n]}for(var o=0;o<p.length;o++){if(p[o]!=this&&r!==false){Mt["b"].$(p[o]).find("option:eq("+n+")").css("background","#f00").attr("disabled","disabled")}}var l=0;for(var o=0;o<p.length;o++){if(p[o].selectedIndex!=0){l++}}var s=t.slice(0);s[s.length-1]="valueLabelType";s=s.join("##");var d=document.getElementById(s);if(d){var c=Z.slice(0);if(l<2||this.selectedIndex===0){c.splice(3,1);c.splice(2,1)}B.updateDropboxElements(d,c,i.valueLabelType,Y,Z,le)}if(l>=2){Mt["b"].$(U).tabs("enable",3);for(var o=0;o<p.length;o++){var u=p[o].id.split("##");if(p[o].selectedIndex!=0){document.getElementById("select##"+u[1]+"##position").disabled="disabled"}else{document.getElementById("select##"+u[1]+"##position").removeAttribute("disabled")}}}else{Mt["b"].$(U).tabs("disable",3);for(var o=0;o<p.length;o++){var u=p[o].id.split("##");document.getElementById("select##"+u[1]+"##position").removeAttribute("disabled")}}this.lastSelectedIndex=n}).bind("click, mouseover",function(e){var t=this;var i=[];for(var a=0;a<We.length;a++){var n=document.getElementById("select##"+We[a].id+"##stack");var r=n.selectedIndex;if(n!=t){i.push(r)}}for(var o in b.availStack){t[o].style.backgroundColor="#ffffff";t[o].removeAttribute("disabled")}for(var o=0;o<i.length;o++){if(i[o]!=0){t[i[o]].style.backgroundColor="#f00";t[i[o]].disabled="disabled"}}});s.appendChild(h);h=document.createElement("td");var g={width:G[6]+"px",minWidth:G[6]+"px"};Mt["b"].Utils.DOM.setStyle(h,g);var D=l.sequence;var m=Mt["b"].Utils.DOM.createSelectBox(h,"select##"+r+"##sequence",D.availSequence,D.availSequenceTL,D.currSelected,H);m.setAttribute("title",d[6]);m.disabled=l.representations.currSelected===de.timeRepresentation.VALUE||l.representations.currSelected===de.structureRepresentation.VALUE;Mt["b"].$(m).bind("change",function(e){B.temporaryChangeSelection(e)});s.appendChild(h)}h=document.createElement("td");var x=G[7];var g={width:x+"px",minWidth:x+"px"};Mt["b"].Utils.DOM.setStyle(h,g);var R=l.notation;var m=Mt["b"].Utils.DOM.createSelectBox(h,"select##"+r+"##notation",R.availNotations,R.availNotationsTL,R.currSelected,H);m.style.width=x-5+"px";m.style.minWidth=x-5+"px";m.setAttribute("title",d[7]);Mt["b"].$(m).bind("change",function(e){B.temporaryChangeSelection(e);var t=e.target.id.split("##")[1];var i=document.getElementById("select##"+t+"##notation");var a=document.getElementById("select##"+t+"##representation");var n=document.getElementById("select##"+t+"##referenceConcept");B.typeChange(le,t,true);if(n!==null){B.referenceConceptChange(a,n,i,true)}});s.appendChild(h);h=document.createElement("td");var x=G[8];var g={width:x+"px",minWidth:x+"px"};Mt["b"].Utils.DOM.setStyle(h,g);var P=l.concept;var m=Mt["b"].Utils.DOM.createSelectBox(h,"select##"+r+"##concept",P.availConcepts,P.availConceptsTL,P.currSelected,H);m.style.width=x-5+"px";m.style.minWidth=x-5+"px";m.setAttribute("title",d[8]);Mt["b"].$(m).bind("change",function(e){B.temporaryChangeSelection(e)});s.appendChild(h);if(ue===true){h=document.createElement("td");var x=G[9];var g={width:x+"px",minWidth:x+"px"};Mt["b"].Utils.DOM.setStyle(h,g);var N=l.referenceConcept;var m=Mt["b"].Utils.DOM.createSelectBox(h,"select##"+r+"##referenceConcept",N.availConceptsRef,N.availConceptsTLRef,N.currSelected,H);m.style.width=x-5+"px";m.style.minWidth=x-5+"px";m.setAttribute("title",d[9]);Mt["b"].$(m).bind("change",function(e){B.temporaryChangeSelection(e)});s.appendChild(h);B.referenceConceptChange(l.representations,m,l.notation,false)}if(le.instanceOf==="TableModel"){var w=ue===true?10:9;var g={width:G[w]+"px",minWidth:G[w]+"px"};h=document.createElement("td");Mt["b"].Utils.DOM.setStyle(h,g);var F=Mt["b"].Utils.DOM.createCheckBoxWithLabel(h,"select##"+r+"##axisMid","select##"+r+"##axisMid","","").checkBox;if(l.axisMid.currSelected===true){F.setAttribute("checked","checked")}F.setAttribute("title",d[w]);s.appendChild(h)}i.appendChild(s)}e.appendChild(i);return e};function createExpressionsColorsDescriptionsTab(){var e=document.createElement("div");e.setAttribute("id","tabColorsDescriptionsDiv");var t=B.createExpressionsColorsDescriptionsHeader();e.appendChild(t);var i=B.createExpressionsColorsDescriptionsTable();e.appendChild(i);return e}B.createExpressionsColorsDescriptionsHeader=function(){var e=document.createElement("div");f=e;e.setAttribute("id","headerColorsDescriptionsDiv");var t={height:50+"px",width:"auto",overflow:"hidden"};Mt["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");var a=document.createElement("tr");var n=document.createElement("tr");for(var r=0;r<ae.length;r++){if(ae[r]==""){continue}var o=document.createElement("td");var l=document.createElement("td");var s=_[r];var d=1;for(var c=r+1;c<ae.length;c++){if(ae[c]==""){d++;s+=_[c]}else{break}}var u={width:s+"px",minWidth:s+"px",whiteSpace:"nowrap"};Mt["b"].Utils.DOM.setStyle(o,u);o.setAttribute("colspan",d);Mt["b"].$(o).html(ae[r]);o.setAttribute("title",ne[r]);a.appendChild(o);Mt["b"].Utils.DOM.setStyle(l,u);l.setAttribute("colspan",d);var p=document.createElement("span");p.style.margin="0px";Mt["b"].$(p).html('<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">');if(ae[r]!="Keyfigures"){l.appendChild(p)}n.appendChild(l)}i.appendChild(a);i.appendChild(n);var g=document.createElement("tr");for(var r=0;r<re.length;r++){var o=document.createElement("td");var s=_[r];var u={width:s+"px",minWidth:s+"px",whiteSpace:"nowrap"};Mt["b"].Utils.DOM.setStyle(o,u);Mt["b"].$(o).html(oe[r]);if(Oe[r]!=""){o.setAttribute("title",Oe[r])}g.appendChild(o)}i.appendChild(g);var n=document.createElement("tr");for(var r=0;r<re.length;r++){var l=document.createElement("td");var s=_[r];var u={width:s+"px",minWidth:s+"px",whiteSpace:"nowrap"};Mt["b"].Utils.DOM.setStyle(o,u);Mt["b"].Utils.DOM.setStyle(l,u);var p=document.createElement("span");p.style.margin="0px";Mt["b"].$(p).html('<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">');l.appendChild(p);n.appendChild(l)}i.appendChild(n);e.appendChild(i);return e};B.activateDeactivateButton=function(e){var t=it[e];var i=t.valueLabel.currSelected;i=i.split(".");i=i[0];var a=document.getElementById("select##"+e+"##functionButton");if(i===w[3]){a.disabled=false}else{a.disabled=true;var n=document.getElementById("visualMenuFunctionProp##"+e);if(n!==null){n.parentNode.remove(n)}}};B.activateDeactivateButtonStack=function(e){var t=e.selectedIndex;var i=document.getElementById("select##_##functionButton");if(w[t]==="Function"){i.disabled=false}else{i.disabled=true}};B.createExpressionsColorsDescriptionsTable=function(){var e=document.createElement("div");A=e;e.setAttribute("id","tableColorsDescriptionsDiv");var t={height:175+"px",width:"100%",overflow:"auto"};Mt["b"].Utils.DOM.setStyle(e,t);Mt["b"].$(e).scroll(function(){B.linkScrollbarColorsDescriptionsTab()});var i=document.createElement("table");for(var a=0;a<We.length;a++){var n=We[a];var r=n.id;var o=n.name;var l=it[r];var s=document.createElement("tr");s.setAttribute("id",r+"##colordesc");var d=document.createElement("td");var c={width:_[0]+"px",minWidth:_[0]+"px"};Mt["b"].Utils.DOM.setStyle(d,c);d.setAttribute("id",r);d.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_MEASURES"));Mt["b"].$(d).bind("click",function(e){B.highlightRow(e)});Mt["b"].$(d).html(o);d.style.whiteSpace="nowrap";s.appendChild(d);var u=document.createElement("td");var c={width:_[1]+"px",minWidth:_[1]+"px"};Mt["b"].Utils.DOM.setStyle(u,c);var p=l.valueLabel;var g=Mt["b"].Utils.DOM.createSelectBox(u,"select##"+r+"##valueLabel",w,F,p.currSelected&&p.currSelected.split(".").length>1?p.currSelected.split(".")[0]:"All",H);g.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_VALUE_SHOW"));Mt["b"].$(g).bind("change",function(e){B.temporaryChangeSelection(e)}).bind("change",function(e){var t=e.target.id.split("##")[1];B.activateDeactivateButton(t)});s.appendChild(u);var h=document.createElement("td");var c={width:_[2]+"px",minWidth:_[2]+"px"};var f=Mt["b"].Utils.DOM.createButtonInput(h,"select##"+r+"##functionButton","","fx",H);f.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_VALUE_SHOW"));Mt["b"].$(f).on("click",function(e){B.openFunctionDialog(e)});Mt["b"].Utils.DOM.setStyle(h,c);s.appendChild(h);var u=document.createElement("td");var c={width:_[3]+"px",minWidth:_[3]+"px"};Mt["b"].Utils.DOM.setStyle(u,c);var m=l.valueLabelType;var g=Mt["b"].Utils.DOM.createSelectBox(u,"select##"+r+"##valueLabelType",Y,Z,m.currSelected,H);g.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_VALUE_TYPE"));Mt["b"].$(g).bind("change",function(e){B.temporaryChangeSelection(e)});s.appendChild(u);if(le.instanceOf!=="TableModel"){var u=document.createElement("td");var c={width:_[4]+"px",minWidth:_[4]+"px"};Mt["b"].Utils.DOM.setStyle(u,c);var v=Mt["b"].Utils.DOM.createCheckBoxWithLabel(u,"select##"+r+"##valueLabelCollisionSelfD","select##"+r+"##valueLabelCollisionSelfG","","").checkBox;v.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_VALUE_OVERLAP_SELF"));if(l.valueLabelOverlapSelf.currSelected){v.setAttribute("checked","checked")}s.appendChild(u);var u=document.createElement("td");var c={width:_[5]+"px",minWidth:_[5]+"px"};Mt["b"].Utils.DOM.setStyle(u,c);var v=Mt["b"].Utils.DOM.createCheckBoxWithLabel(u,"select##"+r+"##valueLabelCollisionD","select##"+r+"##valueLabelCollisionG","","").checkBox;v.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_VALUE_OVERLAP_OTHERS"));if(p.currSelected&&p.currSelected.split(".")[1]==="Always"){v.setAttribute("checked","checked")}s.appendChild(u)}var u=document.createElement("td");if(le.instanceOf!=="TableModel"){var c={width:_[6]+"px",minWidth:_[6]+"px"}}else{var c={width:_[4]+"px",minWidth:_[4]+"px"}}Mt["b"].Utils.DOM.setStyle(u,c);Mt["b"].Utils.DOM.setStyle(u,c);var b=l.valueLabelBackground;var T=K;var x=X;var g=Mt["b"].Utils.DOM.createSelectBox(u,"select##"+r+"##valueLabelBackground",T,x,b.currSelected,H);g.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_VALUE_BACKGROUND"));Mt["b"].$(g).bind("change",function(e){B.temporaryChangeSelection(e)});s.appendChild(u);var u=document.createElement("td");if(le.instanceOf!=="TableModel"){var c={width:_[7]+"px",minWidth:_[7]+"px"}}else{var c={width:_[5]+"px",minWidth:_[5]+"px"}}Mt["b"].Utils.DOM.setStyle(u,c);var E=l.valueLabelUnits;var v=Mt["b"].Utils.DOM.createCheckBoxWithLabel(u,"select##"+r+"##valueLabelUnitsD","select##"+r+"##valueLabelUnitsG","","").checkBox;v.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_VALUE_UNITS"));if(E.currSelected){v.setAttribute("checked","checked")}s.appendChild(u);u=document.createElement("td");if(le.instanceOf!=="TableModel"){var c={width:_[8]+"px",minWidth:_[8]+"px"}}else{var c={width:_[6]+"px",minWidth:_[6]+"px"}}Mt["b"].Utils.DOM.setStyle(u,c);var y=l.legend;var C="";var S=y.currSelected?y.currSelected.split(".").pop():"";var M=y.currSelected&&W.some(function(e,t){var i=e===y.currSelected||e&&y.currSelected.indexOf(e)!==-1;if(i){C=W[t];y.currSelected=W[t]}return i});if(!M){if(le.instanceOf==="ChartModel"||le.instanceOf==="TimeChartModel"){C=W[3];y.currSelected=W[3]}else if(le.instanceOf==="TableModel"){if(l.representations.currSelected===ht[1]){C=W[3];y.currSelected=W[3]}else{C=W[2];y.currSelected=W[2]}}}var g=Mt["b"].Utils.DOM.createSelectBox(u,"select##"+r+"##legend",W,j,C,H);g.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_LEGEND_SHOW"));Mt["b"].$(g).bind("change",function(e){B.temporaryChangeSelection(e)});s.appendChild(u);if(le.instanceOf!=="TableModel"){var u=document.createElement("td");var c={width:_[9]+"px",minWidth:_[9]+"px"};Mt["b"].Utils.DOM.setStyle(u,c);var y=l.legend;var C="Always";if(S){if(S==="Dynamic"){C="Vertical";y.currSelected=y.currSelected.replace("Dynamic","Vertical")}else{C=S}}var g=Mt["b"].Utils.DOM.createSelectBox(u,"select##"+r+"##legendCollision",st,dt,C,H);g.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_LEGEND_DISPLACE"));Mt["b"].$(g).bind("change",function(e){B.temporaryChangeSelection(e)});s.appendChild(u);u=document.createElement("td");var c={width:_[10]+"px",minWidth:_[10]+"px"};Mt["b"].Utils.DOM.setStyle(u,c);var O=l.connector;var g=Mt["b"].Utils.DOM.createSelectBox(u,"select##"+r+"##connector",$e,ze,O.currSelected,H);g.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_LEGEND_CONNECTOR"));Mt["b"].$(g).bind("change",function(e){B.temporaryChangeSelection(e)});s.appendChild(u);u=document.createElement("td");var c={width:_[11]+"px",minWidth:_[11]+"px"};Mt["b"].Utils.DOM.setStyle(u,c);var v=Mt["b"].Utils.DOM.createCheckBoxWithLabel(u,"select##"+r+"##legendInGrid","select##"+r+"##legendInGrid","","").checkBox;v.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_LEGEND_IN_GRID"));if(l.legendInGrid&&l.legendInGrid.currSelected){v.setAttribute("checked","checked")}Mt["b"].$(v).bind("change",function(e){B.temporaryChangeSelection(e)});s.appendChild(u)}i.appendChild(s)}e.appendChild(i);return e};function createExpressionsOutlierTab(){var e=document.createElement("div");e.setAttribute("id","tabOutlierDiv");var t=B.createExpressionsOutlierHeader();e.appendChild(t);var i=B.createExpressionsOutlierTable();e.appendChild(i);return e}B.createExpressionsOutlierHeader=function(){var e=document.createElement("div");u=e;e.setAttribute("id","headerOutlierDiv");var t={height:25+"px",width:"auto",overflow:"hidden"};Mt["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");var a=document.createElement("tr");for(var n=0;n<Ae.length;n++){var r=document.createElement("td");if(Ae[n]==="Keyfigures"){var o=L[n]}else{var o=L[n]}var l={width:o+"px",minWidth:o+"px",whiteSpace:"nowrap"};Mt["b"].Utils.DOM.setStyle(r,l);Mt["b"].$(r).html(_e[n]);if(Le[n]!=""){r.setAttribute("title",Le[n])}a.appendChild(r)}i.appendChild(a);var s=document.createElement("tr");for(var n=0;n<Ae.length;n++){var d=document.createElement("td");if(Ae[n]==="Keyfigures"){var o=L[n]}else{var o=L[n]}var l={width:o+"px",minWidth:o+"px",whiteSpace:"nowrap"};Mt["b"].Utils.DOM.setStyle(r,l);Mt["b"].Utils.DOM.setStyle(d,l);var c=document.createElement("span");c.style.margin="0px";Mt["b"].$(c).html('<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">');d.appendChild(c);s.appendChild(d)}i.appendChild(s);e.appendChild(i);return e};B.createExpressionsOutlierTable=function(){var e=document.createElement("div");b=e;e.setAttribute("id","tableOutlierDiv");var t={height:200+"px",width:"100%",overflow:"auto"};Mt["b"].Utils.DOM.setStyle(e,t);Mt["b"].$(e).scroll(function(){B.linkScrollbarOutlierTab()});var i=document.createElement("table");for(var a=0;a<We.length;a++){var n=We[a];var r=n.id;var o="";if(n.nameInternal!==null){o=n.nameInternal}else{o=n.name}o=et.invertNames(et.decode(o));var l=it[r];var s=document.createElement("tr");s.setAttribute("id",r+"##outlier");var d=document.createElement("td");var c={width:L[0]+"px",minWidth:L[0]+"px"};Mt["b"].Utils.DOM.setStyle(d,c);d.setAttribute("id",r);Mt["b"].$(d).bind("click",function(e){B.highlightRow(e)});Mt["b"].$(d).html(o);if(Le[0]!=""){d.setAttribute("title",Le[0])}d.style.whiteSpace="nowrap";s.appendChild(d);var u=document.createElement("td");c={width:L[1]+"px",minWidth:L[1]+"px"};Mt["b"].Utils.DOM.setStyle(u,c);var p=l.outlierOperator;var g=Mt["b"].Utils.DOM.createSelectBox(u,"select##"+r+"##outlierOperator",J,J,p,H);g.setAttribute("title",Le[1]);Mt["b"].$(g).bind("change",function(e){B.temporaryChangeSelection(e)});if(Le[1]!=""){d.setAttribute("title",Le[1])}s.appendChild(u);var u=document.createElement("td");c={width:L[2]+"px",minWidth:L[2]+"px"};Mt["b"].Utils.DOM.setStyle(u,c);var h=l.outlier?l.outlier:"";var f=et.decode(h);h=et.invertNames(f);var m=Mt["b"].Utils.DOM.createTextInput(u,"select##"+r+"##outlier",h,0,H);m.setAttribute("size","8");Mt["b"].$(m).css("padding",0);if(Le[2]!=""){u.setAttribute("title",Le[2])}s.appendChild(u);var u=document.createElement("td");c={width:L[3]+"px",minWidth:L[3]+"px"};Mt["b"].Utils.DOM.setStyle(u,c);var p=l.outlierLabel;var g=Mt["b"].Utils.DOM.createSelectBox(u,"select##"+r+"##outlierLabel",Q,q,p,H);Mt["b"].$(g).bind("change",function(e){B.temporaryChangeSelection(e)});if(Le[3]!=""){u.setAttribute("title",Le[3])}s.appendChild(u);var u=document.createElement("td");c={width:L[4]+"px",minWidth:L[4]+"px"};Mt["b"].Utils.DOM.setStyle(u,c);var v=Mt["b"].Utils.DOM.createCheckBoxWithLabel(u,"select##"+r+"##outlierSymbols","select##"+r+"##outlierSymbolsName","","").checkBox;if(l.outlierSymbols){v.setAttribute("checked","checked")}if(Le[4]!=""){u.setAttribute("title",Le[4])}s.appendChild(u);var u=document.createElement("td");c={width:L[5]+"px",minWidth:L[5]+"px"};Mt["b"].Utils.DOM.setStyle(u,c);var p=l.outlierStyle;var g=Mt["b"].Utils.DOM.createSelectBox(u,"select##"+r+"##outlierStyle",ee,te,p,H);Mt["b"].$(g).bind("change",function(e){B.temporaryChangeSelection(e)});if(Le[5]!=""){u.setAttribute("title",Le[5])}s.appendChild(u);i.appendChild(s)}e.appendChild(i);return e};function createExpressionsTotalTab(){var e=document.createElement("div");e.setAttribute("id","tabTotalDiv");var t=B.createExpressionsTotalHeader();e.appendChild(t);var i=B.createExpressionsTotalTable();e.appendChild(i);return e}B.createExpressionsTotalHeader=function(){var e=document.createElement("div");v=e;e.setAttribute("id","headerTotalDiv");var t={height:50+"px",width:"auto",overflow:"hidden"};Mt["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");var a=document.createElement("tr");var n=document.createElement("td");var r={width:I[0]+"px",minWidth:I[0]+"px",whiteSpace:"nowrap"};Mt["b"].Utils.DOM.setStyle(n,r);Mt["b"].$(n).html(se.getTranslation("TYPE"));n.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_STACK_TYPE"));var o=document.createElement("td");var r={width:I[1]+"px",minWidth:I[1]+"px",whiteSpace:"nowrap"};Mt["b"].Utils.DOM.setStyle(o,r);Mt["b"].$(o).html(se.getTranslation("POSITION"));o.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_STACK_POSITION"));var l=document.createElement("td");var s=I[2]+I[3]+I[4];var r={width:s+"px",minWidth:s+"px",whiteSpace:"nowrap"};Mt["b"].Utils.DOM.setStyle(l,r);Mt["b"].$(l).html(se.getTranslation("VALUE_LABELS"));l.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_STACK_VALUE_LABELS"));l.setAttribute("colspan","3");var d=document.createElement("span");d.style.margin="0px";Mt["b"].$(d).html('<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">');l.appendChild(d);var c=document.createElement("td");var s=0;for(var u=5;u<I.length;u++){s+=I[u]}var r={width:s+"px",minWidth:s+"px",whiteSpace:"nowrap"};Mt["b"].Utils.DOM.setStyle(c,r);Mt["b"].$(c).html(se.getTranslation("TOTALS"));c.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_STACK_TOTALS"));c.setAttribute("colspan","5");var d=document.createElement("span");d.style.margin="0px";Mt["b"].$(d).html('<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">');c.appendChild(d);a.appendChild(n);a.appendChild(o);a.appendChild(l);a.appendChild(c);i.appendChild(a);var p=document.createElement("tr");for(var u=0;u<Ie.length;u++){var g=document.createElement("td");var h=I[u];var r={width:h+"px",minWidth:h+"px",whiteSpace:"nowrap"};Mt["b"].Utils.DOM.setStyle(g,r);Mt["b"].$(g).html(De[u]);g.setAttribute("title",Re[u]);p.appendChild(g)}i.appendChild(p);var f=document.createElement("tr");for(var u=0;u<Ie.length;u++){var m=document.createElement("td");h=I[u];var r={width:h+"px",minWidth:h+"px",whiteSpace:"nowrap"};Mt["b"].Utils.DOM.setStyle(g,r);Mt["b"].Utils.DOM.setStyle(m,r);var d=document.createElement("span");d.style.margin="0px";Mt["b"].$(d).html('<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">');m.appendChild(d);f.appendChild(m)}i.appendChild(f);e.appendChild(i);return e};B.createExpressionsTotalTable=function(){var e=document.createElement("div");S=e;e.setAttribute("id","tableTotalDiv");var t={height:175+"px",width:"100%",overflow:"auto"};Mt["b"].Utils.DOM.setStyle(e,t);Mt["b"].$(e).scroll(function(){B.linkScrollbarTotalTab()});var i=document.createElement("table");var a=document.createElement("tr");var n={currSelected:le.stackType};var r=le.instanceOf==="ChartModel"?"structurePositionType.3":"timePositionType.3";var o={currSelected:le.stackLabelPosition?le.stackLabelPosition:r};var l={currSelected:le.stackMode&&le.stackShowLabel?le.stackShowLabel:"All.false"};var s={currSelected:le.stackLabelOverlapSelf};var d={currSelected:le.stackMode&&le.stackLabelAlignment?le.stackLabelAlignment:"In-Line"};var c={currSelected:le.stackMode&&(le.stackLabelVisibility===undefined?true:le.stackLabelVisibility)};var u={currSelected:le.stackMode&&(le.stackLabelUnits===undefined?false:le.stackLabelUnits)};var p={currSelected:le.stackLine};var g=document.createElement("td");var h={width:I[0]+"px",minWidth:I[0]+"px",backgroundColor:"rgb(232,232,232)"};Mt["b"].Utils.DOM.setStyle(g,h);var f=Mt["b"].Utils.DOM.createSelectBox(g,"select##_##stackType",Pe,Ne,n.currSelected,H);f.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_STACK_TYPE"));a.appendChild(g);var g=document.createElement("td");var h={width:I[1]+"px",minWidth:I[1]+"px",backgroundColor:"rgb(232,232,232)"};Mt["b"].Utils.DOM.setStyle(g,h);if(le.instanceOf==="ChartModel"){var m=Ze;var v=Qe}else{var m=qe;var v=Je}var f=Mt["b"].Utils.DOM.createSelectBox(g,"select##_##stackPosition",m,v,o.currSelected,H);f.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_STACK_POSITION"));a.appendChild(g);var g=document.createElement("td");var h={width:I[2]+"px",minWidth:I[2]+"px",backgroundColor:"rgb(232,232,232)"};Mt["b"].Utils.DOM.setStyle(g,h);var f=Mt["b"].Utils.DOM.createSelectBox(g,"select##_##stackLabelAlignment",$,z,d.currSelected?d.currSelected.split(".")[0]:"",H);f.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_STACK_ALIGNMENT"));a.appendChild(g);var g=document.createElement("td");var h={width:I[3]+"px",minWidth:I[3]+"px",backgroundColor:"rgb(232,232,232)"};Mt["b"].Utils.DOM.setStyle(g,h);var b=Mt["b"].Utils.DOM.createCheckBoxWithLabel(g,"select##_##stackLabelVisibility","select##_##stackLabelVisibilityName","","").checkBox;b.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_STACK_SHOW_SMALL_ELEMENTS"));if(c.currSelected){b.setAttribute("checked","checked")}a.appendChild(g);var g=document.createElement("td");var h={width:I[4]+"px",minWidth:I[4]+"px",backgroundColor:"rgb(232,232,232)"};Mt["b"].Utils.DOM.setStyle(g,h);var b=Mt["b"].Utils.DOM.createCheckBoxWithLabel(g,"select##_##stackLabelUnits","select##_##stackLabelUnitsName","","").checkBox;if(u.currSelected){b.setAttribute("checked","checked")}b.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_STACK_UNITS"));a.appendChild(g);var g=document.createElement("td");var h={width:I[5]+"px",minWidth:I[5]+"px",backgroundColor:"rgb(232,232,232)"};Mt["b"].Utils.DOM.setStyle(g,h);var f=Mt["b"].Utils.DOM.createSelectBox(g,"select##_##stackShowLabel",w,F,l.currSelected?l.currSelected.split(".")[0]:"",H);f.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_STACK_SHOW"));Mt["b"].$(f).bind("change",function(e){B.temporaryChangeSelection(e);B.activateDeactivateButtonStack(e.target)});a.appendChild(g);var g=document.createElement("td");var h={width:I[6]+"px",minWidth:I[6]+"px",backgroundColor:"rgb(232,232,232)"};var T=Mt["b"].Utils.DOM.createButtonInput(g,"select##_##functionButton","","fx",H);var x=l.currSelected?l.currSelected.split(".")[0]:"";if(x!=="Function"){T.disabled=true}Mt["b"].$(T).on("click",function(e){B.openFunctionDialogStack(e)});Mt["b"].Utils.DOM.setStyle(g,h);T.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_STACK_FORMULA"));a.appendChild(g);var g=document.createElement("td");var h={width:I[7]+"px",minWidth:I[7]+"px",backgroundColor:"rgb(232,232,232)"};Mt["b"].Utils.DOM.setStyle(g,h);var b=Mt["b"].Utils.DOM.createCheckBoxWithLabel(g,"select##_##stackCollisionSelfD","select##_##stackCollisionSelfG","","").checkBox;if(s.currSelected){b.setAttribute("checked","checked")}b.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_STACK_OVERLAP_SELF"));a.appendChild(g);var g=document.createElement("td");var h={width:I[8]+"px",minWidth:I[8]+"px",backgroundColor:"rgb(232,232,232)"};Mt["b"].Utils.DOM.setStyle(g,h);var b=Mt["b"].Utils.DOM.createCheckBoxWithLabel(g,"select##_##stackCollisionD","select##_##stackCollisionG","","").checkBox;if(l.currSelected&&l.currSelected.split(".").pop()==="Always"){b.setAttribute("checked","checked")}b.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_STACK_OVERLAP_OTHERS"));a.appendChild(g);var g=document.createElement("td");var h={width:I[9]+"px",minWidth:I[9]+"px",backgroundColor:"rgb(232,232,232)"};Mt["b"].Utils.DOM.setStyle(g,h);var f=Mt["b"].Utils.DOM.createSelectBox(g,"select##_##stackLine",we,Fe,p.currSelected,H);f.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_STACK_100_PERCENT_LINE"));a.appendChild(g);i.appendChild(a);e.appendChild(i);return e};function createExpressionsScalingTab(){var e=document.createElement("div");e.setAttribute("id","tabScalingDiv");var t=B.createExpressionsScalingHeader();e.appendChild(t);var i=B.createExpressionsScalingTable();e.appendChild(i);return e}B.createExpressionsScalingHeader=function(){var e=document.createElement("div");T=e;e.setAttribute("id","headerScalingDiv");var t={height:50+"px",width:"auto",overflow:"hidden"};Mt["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");var a=document.createElement("tr");var n=document.createElement("tr");for(var r=0;r<ke.length;r++){if(ke[r]==""){continue}var o=document.createElement("td");var l=document.createElement("td");var s=D[r];var d=1;for(var c=r+1;c<ke.length;c++){if(ke[c]==""){d++;s+=D[c]}else{break}}var u={width:s+"px",minWidth:s+"px",whiteSpace:"nowrap"};Mt["b"].Utils.DOM.setStyle(o,u);o.setAttribute("colspan",d);Mt["b"].$(o).html(ke[r]);o.setAttribute("title",Ue[r]);a.appendChild(o);Mt["b"].Utils.DOM.setStyle(l,u);l.setAttribute("colspan",d);var p=document.createElement("span");p.style.margin="0px";Mt["b"].$(p).html('<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">');if(Be[r]!=="Keyfigures"&&Be[r]!=="Maximize"){l.appendChild(p)}n.appendChild(l)}i.appendChild(a);i.appendChild(n);var g=document.createElement("tr");for(var r=0;r<He.length;r++){var o=document.createElement("td");var s=D[r];var u={width:s+"px",minWidth:s+"px",whiteSpace:"nowrap"};Mt["b"].Utils.DOM.setStyle(o,u);Mt["b"].$(o).html(Ge[r]);o.setAttribute("title",Ve[r]);g.appendChild(o)}i.appendChild(g);var n=document.createElement("tr");for(var r=0;r<He.length;r++){var l=document.createElement("td");var s=D[r];var u={width:s+"px",minWidth:s+"px",whiteSpace:"nowrap"};Mt["b"].Utils.DOM.setStyle(o,u);Mt["b"].Utils.DOM.setStyle(l,u);var p=document.createElement("span");p.style.margin="0px";Mt["b"].$(p).html('<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">');l.appendChild(p);n.appendChild(l)}i.appendChild(n);e.appendChild(i);return e};B.createExpressionsScalingTable=function(){var e=document.createElement("div");m=e;e.setAttribute("id","tableScalingDiv");var t={height:175+"px",width:"100%",overflow:"auto"};Mt["b"].Utils.DOM.setStyle(e,t);Mt["b"].$(e).scroll(function(){B.linkScrollbarScalingTab()});var i=document.createElement("table");for(var a=0;a<We.length;a++){var n=We[a];var r=n.id;var o="";if(n.nameInternal!==null){o=n.nameInternal}else{o=n.name}o=et.invertNames(et.decode(o));var l=it[r];var s=document.createElement("tr");s.setAttribute("id",r+"##scaling");var d=document.createElement("td");var c={width:D[0]+"px",minWidth:D[0]+"px"};Mt["b"].Utils.DOM.setStyle(d,c);d.setAttribute("id",r);Mt["b"].$(d).bind("click",function(e){B.highlightRow(e)});Mt["b"].$(d).html(o);d.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_SCALING_HELPER_MEASURES"));d.style.whiteSpace="nowrap";s.appendChild(d);g=document.createElement("td");var c={width:D[1]+"px",minWidth:D[1]+"px"};Mt["b"].Utils.DOM.setStyle(g,c);var u=l.scalingMaximize;var p=Mt["b"].Utils.DOM.createCheckBoxWithLabel(g,"select##"+r+"##scalingMaximize","select##"+r+"##scalingMaximize","","").checkBox;if(u){p.setAttribute("checked","checked")}Mt["b"].$(p).bind("change",function(e){B.temporaryChangeSelection(e)});g.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_SCALING_HELPER_MAXIMIZE"));s.appendChild(g);var g=document.createElement("td");c={width:D[2]+"px",minWidth:D[2]+"px"};Mt["b"].Utils.DOM.setStyle(g,c);var h=Mt["b"].Utils.DOM.createSelectBox(g,"select##"+r+"##scalingLegendShow",je,Ke,l.scalingLegendShow,H);Mt["b"].$(h).bind("change",function(e){B.temporaryChangeSelection(e)});g.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_SCALING_HELPER_SHOW"));s.appendChild(g);var g=document.createElement("td");c={width:D[3]+"px",minWidth:D[3]+"px"};Mt["b"].Utils.DOM.setStyle(g,c);var h=Mt["b"].Utils.DOM.createSelectBox(g,"select##"+r+"##scalingLegendDisplace",Xe,Ye,l.scalingLegendDisplace,H);Mt["b"].$(h).bind("change",function(e){B.temporaryChangeSelection(e)});g.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_SCALING_HELPER_DISPLACE"));s.appendChild(g);g=document.createElement("td");var c={width:D[4]+"px",minWidth:D[4]+"px"};Mt["b"].Utils.DOM.setStyle(g,c);var p=Mt["b"].Utils.DOM.createCheckBoxWithLabel(g,"select##"+r+"##scalingLegendSign","select##"+r+"##scalingLegendSign","","").checkBox;if(l.scalingLegendSign){p.setAttribute("checked","checked")}g.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_SCALING_HELPER_SIGN"));s.appendChild(g);i.appendChild(s)}e.appendChild(i);return e};function createExpressionsInputTab(){var e=document.createElement("div");e.setAttribute("id","tabInputDiv");if(le.instanceOf==="TableModel"){e.appendChild(B.createExpressionsInputHeader());e.appendChild(B.createExpressionsInputTable())}return e}B.createExpressionsInputHeader=function(e){var t=document.createElement("div");t.setAttribute("id","tabInputHeaderDiv");t.appendChild(createInputHeaderRow());return t};function createInputHeaderRow(){var e="0px 6px 0px 0px",t="0px 3px",i="0px 0px 0px 12px",a="1px solid lightGray",n="pointer";var r=document.createElement("table");if(le.input.keyColumns.length>C.rows.length||le.input.keyColumns.length===0){Mt["b"].Utils.ExpressionParser.fillKeyColumns(C,le)}var o=le.input.keyColumns.length+" "+se.getTranslation("OF")+" "+C.rows.length+" "+se.getTranslation("KEY_COLUMN");var l=le.input.keyVariable!=null?se.getTranslation("WITH_EXTRA_KEY"):se.getTranslation("WITHOUT_EXTRA_KEY");var s=le.input.saveVariable!=null?se.getTranslation("ALLOWED"):se.getTranslation("NOT_ALLOWED");var d=[{type:"text",value:se.getTranslation("SAVE_INPUT_KEY")},{type:"text",value:se.getTranslation("WITH")},{type:"text",id:"inputKeyVariable",value:l,style:{padding:t,border:a,cursor:n,backgroundColor:"rgb(240, 240, 240)"},click:openKeyVariable,tooltip:se.getTranslation("HELP_CELL_INPUT_EXTRA_KEYS_VARIABLE")},{type:"text",value:se.getTranslation("AND")},{type:"text",id:"inputKeyColumns",value:o,style:{padding:t,border:a,cursor:n,backgroundColor:"rgb(240, 240, 240)"},click:openKeyDialog,tooltip:se.getTranslation("HELP_CELL_INPUT_KEYCOLUMNS")},{type:"text",value:se.getTranslation("ENABLE_LOG"),style:{padding:i},tooltip:se.getTranslation("HELP_CELL_INPUT_LOG")},{type:"checkbox",id:"inputLogBox",checked:le.input.loggable,style:{padding:e},click:updateInputCheckBoxes,tooltip:se.getTranslation("HELP_CELL_INPUT_LOG")},{type:"text",value:se.getTranslation("SAVE_ALL")},{type:"text",id:"inputSaveAll",value:s,style:{padding:t,border:a,cursor:n,backgroundColor:"rgb(240, 240, 240)"},click:openKeyVariable,tooltip:se.getTranslation("HELP_CELL_INPUT_SAVE_ALL")},{type:"text",value:se.getTranslation("AUTO_SAVE"),tooltip:se.getTranslation("HELP_CELL_INPUT_SAVE_CHANGED")},{type:"checkbox",id:"inputAutoSaveBox",checked:le.input.autoSave,change:updateInputCheckBoxes,tooltip:se.getTranslation("HELP_CELL_INPUT_SAVE_CHANGED")}];c.buildTableRow(r,d);var d=[{type:"separator",colSpan:11,color:"lightGray"}];c.buildTableRow(r,d);return r}B.createExpressionsInputTable=function(){var e=de.tableRepresentation;var t=document.createElement("div");t.setAttribute("id","tabInputTableDiv");var i=document.createElement("table");var a=getInputSaveNames(C.id);var n=createInputTabHeaderRow();c.buildTableRow(i,n.headers);c.buildTableRow(i,n.separator);n=null;for(var r in it){var o=it[r];if(o.representations.currSelected===e.LIST){n=createInputTabList(o,r,a)}else if(o.representations.currSelected===e.COMMENT){n=createInputTabComment(o,r,a)}else if(o.representations.currSelected===e.FLAG){n=createInputTabFlag(o,r,a)}if(n){c.buildTableRow(i,n);n=null}}t.appendChild(i);return t};function getInputSaveNames(e){var t=[];var i=e.split(".")[0];var a=Mt["b"].DataObjects.InlineCommentRepo.getInlineCommentRepo()[i];if(a){for(var n=0;n<a.length;n++){if(t.indexOf(a[n].saveName)===-1){t.push(a[n].saveName)}}}return t}B.updateInputTab=function(e){if(checkExpressionsForInput()){Mt["b"].$(U).tabs("disable",5)}else{Mt["b"].$(U).tabs("enable",5)}Mt["b"].$("#tabInputTableDiv").html(B.createExpressionsInputTable())};function createInputBoxArray(){var e=Mt["b"].DataObjects.DocumentDO.getBIVariables().sort(function(e,t){if(e.name<t.name){return-1}else if(e.name>t.name){return 1}return 0});var t=Mt["b"].Utils.Calculator.IFrameCalculation;t.setSpanFont("normal "+H+" 'Arial'");t.setSpanHTML("None");var i={names:["None"],ids:["none"],width:[t.getSpanWidth()]};for(var a=0,n=e.length;a<n;a++){i.names.push(e[a].name);i.ids.push(e[a].id);t.setSpanHTML(e[a].name);i.width.push(t.getSpanWidth())}return i}function openKeyDialog(){var e=new Mt["b"].UI.KeyDialog({chartModel:le,parent:B});e.open()}function openCommonTableDialog(){var e=it[this.id.split("##")[0]];if(e){var t=new Mt["b"].UI.CommonTableDialog({parent:B,parentId:this.id,expr:e});t.open()}}B.setCommonTable=function(e){var t=e.parentId.split("##");var i=it[t[0]];if(i){var a=document.getElementById(e.parentId);if(e.hash){i.commonTable=e.hash;if(a){a.innerHTML=Mt["b"].DataObjects.CommonTableRepo.getCommonTable(e.hash).key}Mt["b"].Connector.ConnectorHelper.VisualizationMenu_setCommonTable_addStyles(t[0])}else{i.commonTable=null;if(a){a.innerHTML=se.getTranslation("SELF")}Mt["b"].Connector.ConnectorHelper.VisualizationMenu_setCommonTable_removeStyles(t[0],i)}}};function openKeyVariable(){Mt["b"].$(document.getElementById("HiCoKeyVariableSelectBox")).remove();var e=this.getBoundingClientRect();var t=document.createElement("div");t.setAttribute("id","HiCoKeyVariableSelectBox");var i=t.appendChild(document.createElement("ul"));Mt["b"].Utils.DOM.setStyle(i,{listStyleType:"none",padding:"2px 4px",margin:0+"px"});createEntry(i,this);document.body.appendChild(t);var a=8;for(var n=0;n<N.width.length;n++){a=Math.max(a,N.width[n]+8)}var r=i.children[0].clientHeight*7;if(r<i.clientHeight){var o=getScrollBarWidth();a+=o}Mt["b"].Utils.DOM.setStyle(t,{position:"absolute",backgroundColor:"rgb(240, 240, 240)",fontFamily:"'Arial'",fontSize:H,top:e.top+"px",left:e.left+"px",border:"1px solid lightGray",overflow:"auto",maxHeight:r+"px",width:a+"px",zIndex:9999})}function equalsVariable(e,t){return e==N.ids[t]||e==N.names[t]}function createEntry(e,t){var i="none";for(var a=0;a<N.ids.length;a++){var n=e.appendChild(document.createElement("li"));n.setAttribute("id",t.id+"##"+a);if(N.names[a].toUpperCase()===i.toUpperCase()){Mt["b"].$(n).css("color","rgb(150, 150, 150)");if(t.id==="inputKeyVariable"){n.innerHTML=se.getTranslation("NONE")}else{n.innerHTML=se.getTranslation("NOT_ALLOWED")}}else{if(t.id==="inputKeyVariable"){if(equalsVariable(le.input.keyVariable,a)){Mt["b"].$(n).css("font-weight","bold")}}else{if(equalsVariable(le.input.saveVariable,a)){Mt["b"].$(n).css("font-weight","bold")}}n.innerHTML=N.names[a]}Mt["b"].$(n).hover(function(){Mt["b"].$(this).addClass("highlightListElement")},function(){Mt["b"].$(this).removeClass("highlightListElement")});Mt["b"].$(n).click(selectListBoxElement)}}function selectListBoxElement(){var e=this.id.split("##");var t=parseInt(e[1]);if(e[0]==="inputKeyVariable"){if(t!==0){le.input.keyVariable=N.names[t]}else{le.input.keyVariable=null}}else{if(t!=0){le.input.saveVariable=N.names[t]}else{le.input.saveVariable=null}}if(e[0]==="inputKeyVariable"){var i=le.input.keyVariable!==null?se.getTranslation("WITH_EXTRA_KEY"):se.getTranslation("WITHOUT_EXTRA_KEY")}else{var i=le.input.saveVariable!==null?se.getTranslation("ALLOWED"):se.getTranslation("NOT_ALLOWED")}var a=document.getElementById(e[0]);a&&(a.textContent=i);Mt["b"].$(document.getElementById("HiCoKeyVariableSelectBox")).remove()}function saveAddKey(){var e=it[this.id.split("##")[0]];if(this.value!==""){var t=-1;for(var i=0;i<N.names.length;i++){if(N.names[i]===this.value){t=i;break}}if(t!==-1){e.addKeyVariable=N.names[i]}else{e.addKeyVariable=null}}else{e.addKeyVariable=null}checkValue(document.getElementById(this.id.split("##")[0]+"##inputSaveAs_text").value,this.id.split("##")[0])}function getScrollBarWidth(){var e=Mt["b"].$("<div>").css({visibility:"hidden",width:100,overflow:"scroll"}).appendTo("body"),t=Mt["b"].$("<div>").css({width:"100%"}).appendTo(e).outerWidth();e.remove();return 100-t}function openInputListKeyDialog(){var e=this.id.split("##")[0];var t=it[e];var i=new Mt["b"].UI.ListKeyDialog({obj:t,parent:B,id:e,context:C});i.open()}function updateInputCheckBoxes(){switch(this.id){case"inputReleaseBox":le.input.releaseVariable=this.checked;break;case"inputLogBox":le.input.loggable=this.checked;break;case"inputAutoSaveBox":le.input.autoSave=this.checked;break}}function saveInputText(){resetSaveNameColors();var e=this.id.split("##");var t=it[e[0]];if(t){if(e[1]==="inputSaveAs_text"){if(this.value!==""&&this.value.toLowerCase()!==M.toLowerCase()){if(checkValue(this.value,e[0])){t.saveName=this.value;this.style.color="rgb(0, 0, 0)";this.title=se.getTranslation("HELP_CELL_INPUT_SAVE_AS")}else{this.style.color="rgb(255, 0, 0)";this.title=se.getTranslation("UNIQUE_SAVENAME")}}else{this.value=M;t.saveName=M;this.style.color="rgb(150, 150, 150)";this.title=se.getTranslation("HELP_CELL_INPUT_SAVE_AS")}}else if(e[1]==="inputCommentLength"){t.maxLength=parseInt(this.value)}}}function resetSaveNameColors(){for(var e in it){var t=it[e];var i=document.getElementById(e+"##inputSaveAs_text");if(i&&(i.value===t.saveName||i.value.toLowerCase()===M.toLowerCase())){i.style.color="rgb(0,0,0)"}}}function checkValue(e,t){for(var i in it){var a=it[i];var n;if(document.getElementById(t+"##inputAddKey_text")){n=document.getElementById(t+"##inputAddKey_text").value}if(i!==t&&a.saveName===e&&a.addKeyVariable===n){var r=document.getElementById(i+"##inputSaveAs_text");if(r){r.style.color="rgb(255,0,0)";return false}}}return true}function clearInputText(){if(this.value.toLowerCase()===M.toLowerCase()){this.value=""}this.style.color="rgb(0, 0, 0)"}B.setListKeyDialog=function(e,t){var i=it[t];if(i){i.listContent=JSON.parse(JSON.stringify(e.listContent));i.listContentDefault=e.listContentDefault}var a=document.getElementById(t+"##inputLength");a.innerHTML=i.listContent.length-1};B.setKeyColumns=function(e){le.input.keyColumns=JSON.parse(JSON.stringify(e.keyColumns));var t=document.getElementById("inputKeyColumns");var i=le.input.keyColumns.length+" "+se.getTranslation("OF")+" "+C.rows.length;t.innerHTML=i};function updateInputCheckbox(){var e=this.id.split("##");var t=it[e[0]];if(t){switch(e[1]){case"inputEdit":t.edit=this.checked;break;case"inputMandatory":t.mandatory=this.checked;break;case"inputNumbers":t.number=this.checked;if(t.isDate&&t.number){var i=document.getElementById(e[0]+"##inputDate");if(i){i.checked=false;t.isDate=false}}break;case"inputDate":t.isDate=this.checked;if(t.number&&t.isDate){var i=document.getElementById(e[0]+"##inputNumbers");if(i){i.checked=false;t.number=false}}break}}}function updateExprSetting(){var e=this.id.split("##");var t=it[e[0]];if(t){var i=document.getElementById(e[0]+"##"+nt.ACTIVE);var a=document.getElementById(e[0]+"##"+nt.INACTIVE);var n=document.getElementById(e[0]+"##"+nt.BACKEND);var r=Mt["b"].Connector.ConnectorHelper.IsActivateTransport(t);switch(e[1]){case"inputNumbers":if(Mt["b"].$(this).hasClass("cellOpClass")){t.number=true;Mt["b"].$(this).removeClass("cellOpClass")}else{t.number=false;Mt["b"].$(this).addClass("cellOpClass")}if(t.isDate){var o=document.getElementById(e[0]+"##inputDate");if(o){Mt["b"].$(o).addClass("cellOpClass");t.isDate=false}}break;case"inputDate":if(Mt["b"].$(this).hasClass("cellOpClass")){t.isDate=true;Mt["b"].$(this).removeClass("cellOpClass")}else{t.isDate=false;Mt["b"].$(this).addClass("cellOpClass")}if(t.number){var o=document.getElementById(e[0]+"##inputNumbers");if(o){Mt["b"].$(o).addClass("cellOpClass");t.number=false}}break;case"inputEdit":if(Mt["b"].$(this).hasClass("cellOpClass")){t.edit=true;Mt["b"].$(this).removeClass("cellOpClass")}else{t.edit=true;Mt["b"].$(this).addClass("cellOpClass")}break;case"inputMandatory":if(Mt["b"].$(this).hasClass("cellOpClass")){t.mandatory=true;Mt["b"].$(this).removeClass("cellOpClass")}else{t.mandatory=true;Mt["b"].$(this).addClass("cellOpClass")}break;case nt.ACTIVE:r&&Mt["b"].$(i).removeClass("cellOpClass");Mt["b"].$(n).addClass("cellOpClass");t.transport=nt.ACTIVE;break;case nt.INACTIVE:Mt["b"].$(i).addClass("cellOpClass");Mt["b"].$(a).removeClass("cellOpClass");Mt["b"].$(n).addClass("cellOpClass");t.transport=nt.INACTIVE;break;case nt.BACKEND:Mt["b"].$(i).addClass("cellOpClass");r&&Mt["b"].$(n).removeClass("cellOpClass");t.transport=nt.BACKEND;break}}}function createInputTabHeaderRow(){var e=de.tableRepresentation;var t=false;for(var i in it){var a=it[i];if(a.representations.currSelected===e.COMMENT){t=true;break}}var n=[{type:"text",value:at[0],tdStyle:{width:R[0]+"px"},tooltip:se.getTranslation("HELP_CELL_INPUT_MEASURE")},{type:"text",value:at[1],tdStyle:{width:R[1]+"px"},tooltip:se.getTranslation("HELP_CELL_INPUT_TYPE")},{type:"text",value:at[2],tdStyle:{width:R[2]+"px",textAlign:"center"},tooltip:se.getTranslation("HELP_CELL_INPUT_LENGTH")},{type:"text",value:at[3],tdStyle:{width:R[3]+"px",textAlign:"left"},tooltip:se.getTranslation("HELP_CELL_INPUT_SOURCE")},{type:"text",value:at[4],tdStyle:{width:R[4]+"px"},tooltip:se.getTranslation("HELP_CELL_INPUT_SAVE_AS")},{type:"text",value:at[5],tdStyle:{width:R[5]+"px"},tooltip:se.getTranslation("HELP_CELL_INPUT_ADDITIONAL_KEY")},{type:"text",value:at[6],tdStyle:{width:R[6]+"px",textAlign:"center"},tooltip:se.getTranslation("HELP_CELL_INPUT_EDIT")},{type:"text",value:at[7],tdStyle:{width:R[7]+"px",textAlign:"center"},tooltip:se.getTranslation("HELP_CELL_INPUT_MANDATORY")},{type:"text",value:at[8],tdStyle:{width:R[8]+"px",textAlign:"center"},tooltip:se.getTranslation(Mt["b"].Connector.ConnectorHelper.Settings.translations.transportSettingsTooltip)}];var r=[{type:"separator",color:"lightGray",tdStyle:{width:R[0]+"px"}},{type:"separator",color:"lightGray",tdStyle:{width:R[1]+"px"}},{type:"separator",color:"lightGray",tdStyle:{width:R[2]+"px"}},{type:"separator",color:"lightGray",tdStyle:{width:R[3]+"px"}},{type:"separator",color:"lightGray",tdStyle:{width:R[4]+"px"}},{type:"separator",color:"lightGray",tdStyle:{width:R[5]+"px"}},{type:"separator",color:"lightGray",tdStyle:{width:R[6]+"px"}},{type:"separator",color:"lightGray",tdStyle:{width:R[7]+"px"}},{type:"separator",color:"lightGray",tdStyle:{width:R[8]+"px"}}];if(t){n.push({type:"text",value:at[9],tdStyle:{width:R[9]+"px",textAlign:"center"},colSpan:2,tooltip:se.getTranslation("HELP_CELL_INPUT_CHECK")});r.push({type:"separator",color:"lightGray",tdStyle:{width:R[9]+"px"},colSpan:2})}return{headers:n,separator:r}}function createInputTabList(e,t,i){var a=M;var n="rgb(150, 150, 150)";if(e.saveName){a=e.saveName;n="rgb(0, 0, 0)"}var r=e.commonTable&&Mt["b"].DataObjects.CommonTableRepo.getCommonTable(e.commonTable);var o=r?r.key:se.getTranslation("SELF");var l=Mt["b"].Connector.ConnectorHelper.Settings.disableTransport&&r;var s=selectTransportIcon(t,e.transport,l);return[{type:"text",value:e.nameInternal?e.nameInternal:e.name,tdStyle:{width:R[0]+"px"},tooltip:se.getTranslation("HELP_CELL_INPUT_MEASURE")},{type:"text",value:se.getTranslation("LIST"),tdStyle:{width:R[1]+"px"},tooltip:se.getTranslation("HELP_CELL_INPUT_TYPE")},{type:"text",value:e.listContent?e.listContent.length-1:0,id:t+"##inputLength",click:openInputListKeyDialog,style:{border:"1px solid lightGray",padding:"0 0 0 24px",cursor:"pointer",textAlign:"right"},tdStyle:{width:R[2]+"px",textAlign:"center"},tooltip:se.getTranslation("HELP_CELL_INPUT_LENGTH_LIST")},{type:"text",id:t+"##inputExtraKey",value:o,tdStyle:{width:R[3]+"px",textAlign:"left",display:"block"},style:{cursor:"pointer",backgroundColor:"rgb(240, 240, 240",width:R[3]+"px"},click:openCommonTableDialog,tooltip:se.getTranslation("HELP_CELL_INPUT_EXTRA_KEYS")},{type:"combobox",id:t+"##inputSaveAs",style:{backgroundColor:"rgb(240, 240, 240)",color:n},length:21,value:a,values:i,width:R[4]+"px",tdStyle:{width:R[4]+"px"},focusOut:saveInputText,focusIn:clearInputText,tooltip:se.getTranslation("HELP_CELL_INPUT_SAVE_AS")},{type:"combobox",id:t+"##inputAddKey",style:{},length:21,value:getVariableByKey(e.addKeyVariable),values:getKeyVariables(),width:R[5]+"px",tdStyle:{width:R[5]+"px",border:"1px solid lightGray"},focusOut:saveAddKey,tooltip:se.getTranslation("HELP_CELL_INPUT_ADDITIONAL_KEY")},{type:"checkbox",id:t+"##inputEdit",checked:e.edit,tdStyle:{width:R[6]+"px",textAlign:"center"},tooltip:se.getTranslation("HELP_CELL_INPUT_EDIT"),click:updateInputCheckbox},{type:"checkbox",id:t+"##inputMandatory",checked:e.mandatory,tdStyle:{width:R[7]+"px",textAlign:"center"},tooltip:se.getTranslation("HELP_CELL_INPUT_MANDATORY"),click:updateInputCheckbox},{type:"iconselector",value:e.transport,values:s,tdStyle:{width:R[8]+"px",textAlign:"center"},click:updateExprSetting}]}function createInputTabComment(e,t,i){var a=M;var n="rgb(150, 150, 150)";if(e.saveName){a=e.saveName;n="rgb(0, 0, 0)"}var r=e.commonTable&&Mt["b"].DataObjects.CommonTableRepo.getCommonTable(e.commonTable);var o=r?r.key:se.getTranslation("SELF");var l=Mt["b"].Connector.ConnectorHelper.Settings.disableTransport&&r;var s=selectTransportIcon(t,e.transport,l);return[{type:"text",value:e.nameInternal?e.nameInternal:e.name,tdStyle:{width:R[0]+"px"}},{type:"text",value:se.getTranslation("COMMENT"),tdStyle:{width:R[1]+"px"},tooltip:se.getTranslation("HELP_CELL_INPUT_TYPE")},{type:"textinput",id:t+"##inputCommentLength",style:{backgroundColor:"rgb(240, 240, 240)",border:"0px",textAlign:"right"},value:e.maxLength!=null?e.maxLength:0,length:2,tdStyle:{width:R[2]+"px",textAlign:"center"},focusOut:saveInputText,tooltip:se.getTranslation("HELP_CELL_INPUT_LENGTH_COMMENT")},{type:"text",id:t+"##inputExtraKey",value:o,tdStyle:{width:R[3]+"px",textAlign:"left"},style:{cursor:"pointer",backgroundColor:"rgb(240, 240, 240",width:R[3]+"px",display:"block",overflow:"hidden",textOverflow:"ellipsis"},click:openCommonTableDialog,tooltip:se.getTranslation("HELP_CELL_INPUT_EXTRA_KEYS")},{type:"combobox",id:t+"##inputSaveAs",style:{backgroundColor:"rgb(240, 240, 240)",color:n},length:21,value:a,values:i,width:R[4]+"px",tdStyle:{width:R[4]+"px"},focusOut:saveInputText,focusIn:clearInputText,tooltip:se.getTranslation("HELP_CELL_INPUT_SAVE_AS")},{type:"combobox",id:t+"##inputAddKey",style:{},length:21,value:getVariableByKey(e.addKeyVariable),values:getKeyVariables(),width:R[5]+"px",tdStyle:{width:R[5]+"px",border:"1px solid lightGray"},focusOut:saveAddKey,tooltip:se.getTranslation("HELP_CELL_INPUT_ADDITIONAL_KEY")},{type:"checkbox",id:t+"##inputEdit",checked:e.edit,tdStyle:{width:R[6]+"px",textAlign:"center"},tooltip:se.getTranslation("HELP_CELL_INPUT_EDIT"),click:updateInputCheckbox},{type:"checkbox",id:t+"##inputMandatory",checked:e.mandatory,tdStyle:{width:R[7]+"px",textAlign:"center"},tooltip:se.getTranslation("HELP_CELL_INPUT_MANDATORY"),click:updateInputCheckbox},{type:"iconselector",value:e.transport,values:s,tdStyle:{width:R[8]+"px",textAlign:"center"},click:updateExprSetting},{type:"iconbutton",id:t+"##inputNumbers",iconName:"numbers.png",tooltip:se.getTranslation("HELP_CELL_INPUT_NUMBERS"),click:updateExprSetting,tdStyle:{textAlign:"center"},style:p,active:e.number},{type:"iconbutton",id:t+"##inputDate",iconName:"date.png",tooltip:se.getTranslation("HELP_CELL_INPUT_DATE"),click:updateExprSetting,tdStyle:{textAlign:"center"},style:p,active:e.isDate}]}function getKeyVariables(){var e=[""];for(var t=0;t<N.names.length;t++){if(N.names[t]!=="None"){e.push(N.names[t])}}return e}function getVariableByKey(e){if(e==null){return""}for(var t=0;t<N.ids.length;t++){if(equalsVariable(e,t)){return N.names[t]}}return""}function createInputTabFlag(e,t,i){var a=M;var n="rgb(150, 150, 150)";if(e.saveName){a=e.saveName;n="rgb(0, 0, 0)"}var r=e.commonTable&&Mt["b"].DataObjects.CommonTableRepo.getCommonTable(e.commonTable);var o=r?r.key:se.getTranslation("SELF");var l=Mt["b"].Connector.ConnectorHelper.Settings.disableTransport&&r;var s=selectTransportIcon(t,e.transport,l);return[{type:"text",value:e.nameInternal?e.nameInternal:e.name,tdStyle:{width:R[0]+"px"}},{type:"text",value:se.getTranslation("FLAG"),tdStyle:{width:R[1]+"px"},tooltip:se.getTranslation("HELP_CELL_INPUT_TYPE")},{type:"empty",tdStyle:{width:R[2]+"px"}},{type:"text",id:t+"##inputExtraKey",value:o,tdStyle:{width:R[3]+"px",textAlign:"left"},style:{cursor:"pointer",backgroundColor:"rgb(240, 240, 240",width:R[3]+"px",display:"block"},click:openCommonTableDialog,tooltip:se.getTranslation("HELP_CELL_INPUT_EXTRA_KEYS")},{type:"combobox",id:t+"##inputSaveAs",style:{backgroundColor:"rgb(240, 240, 240)",color:n},length:21,value:a,values:i,width:R[4]+"px",tdStyle:{width:R[4]+"px"},focusOut:saveInputText,focusIn:clearInputText,tooltip:se.getTranslation("HELP_CELL_INPUT_SAVE_AS")},{type:"combobox",id:t+"##inputAddKey",style:{},length:21,value:getVariableByKey(e.addKeyVariable),values:getKeyVariables(),width:R[5]+"px",tdStyle:{width:R[5]+"px",border:"1px solid lightGray"},focusOut:saveAddKey,tooltip:se.getTranslation("HELP_CELL_INPUT_ADDITIONAL_KEY")},{type:"checkbox",id:t+"##inputEdit",checked:e.edit,tdStyle:{width:R[6]+"px",textAlign:"center"},tooltip:se.getTranslation("HELP_CELL_INPUT_EDIT"),click:updateInputCheckbox},{type:"checkbox",id:t+"##inputMandatory",tooltip:se.getTranslation("HELP_CELL_INPUT_MANDATORY"),click:updateInputCheckbox,checked:e.mandatory?e.mandatory:false,tdStyle:{width:R[7]+"px",textAlign:"center"}},{type:"iconselector",value:e.transport,values:s,tdStyle:{width:R[8]+"px",textAlign:"center"},click:updateExprSetting}]}function selectTransportIcon(e,t,i){var a=JSON.parse(JSON.stringify(rt));for(var n=0;n<a.length;n++){a[n].id=e+"##"+a[n].value;if(i||a[n].value!==t&&!castInactiveToBackend(a[n].value)){a[n].clazz="cellOpClass"}}return a;function castInactiveToBackend(e){return Mt["b"].Connector.ConnectorHelper.VisualizationMenu_castInactiveToBackend(e,t)}}B.updateTableDivHeight=function(e,t,i,a,n){if(e===null||t==null||i===null||a===null||n==null){return}var r=c.getDialog().dialog("option","height");Mt["b"].$(s).height(r-70);r-=160;Mt["b"].Utils.DOM.setStyle(e,{height:r-25+"px"});Mt["b"].Utils.DOM.setStyle(t,{height:r-25+"px"});Mt["b"].Utils.DOM.setStyle(i,{height:r+"px"});Mt["b"].Utils.DOM.setStyle(a,{height:r-25+"px"});Mt["b"].Utils.DOM.setStyle(n,{height:r-25+"px"})};B.updateTableDivHeightFromOutside=function(e,t){if(k==null||A==null||b==null||S==null||m==null||U==null||f==null||h==null||u==null||v==null||T==null){return}U.style.height=e-117+"px";t-=14+14;e-=117+30+12;document.getElementById(St[i].id).style.height=e+"px";e-=25;switch(i){case 0:k.style.height=e-25+"px";if(k.clientHeight<k.scrollHeight-n){if(d==="firefox"&&k.clientHeight>33||d==="ie"){t-=a+n}else if(d==="chrome"){t-=a}t=t+"px"}else if(k.clientHeight>=k.scrollHeight-n){t="auto"}h.style.width=t;break;case 1:A.style.height=e-25+"px";if(A.clientHeight<A.scrollHeight-n||d==="ie"){if(d==="firefox"&&A.clientHeight>33){t-=a+n}else if(d==="chrome"){t-=a}t=t+"px"}else if(A.clientHeight>=A.scrollHeight-n){t="auto"}f.style.width=t;break;case 2:b.style.height=e+"px";if(b.clientHeight<b.scrollHeight-n||d==="ie"){if(d==="firefox"&&b.clientHeight>33){t-=a+n}else if(d==="chrome"){t-=a}t=t+"px"}else if(b.clientHeight>=b.scrollHeight-n){t="auto"}u.style.width=t;break;case 3:S.style.height=e-25+"px";if(S.clientHeight<S.scrollHeight-n||d==="ie"){if(d==="firefox"&&S.clientHeight>33){t-=a+n}else if(d==="chrome"){t-=a}t=t+"px"}else if(S.clientHeight>=S.scrollHeight-n){t="auto"}v.style.width=t;break;case 4:m.style.height=e-25+"px";if(m.clientHeight<m.scrollHeight-n||d==="ie"){if(d==="firefox"&&m.clientHeight>33){t-=a+n}else if(d==="chrome"){t-=a}t=t+"px"}else if(m.clientHeight>=m.scrollHeight-n){t="auto"}T.style.width=t;break}};B.linkScrollbarGeneralTab=function(){var e=document.getElementById("headerDiv");var t=document.getElementById("tableDiv");e.scrollLeft=t.scrollLeft};B.linkScrollbarColorsDescriptionsTab=function(){var e=document.getElementById("headerColorsDescriptionsDiv");var t=document.getElementById("tableColorsDescriptionsDiv");e.scrollLeft=t.scrollLeft};B.linkScrollbarOutlierTab=function(){var e=document.getElementById("headerOutlierDiv");var t=document.getElementById("tableOutlierDiv");e.scrollLeft=t.scrollLeft};B.linkScrollbarTotalTab=function(){var e=document.getElementById("headerTotalDiv");var t=document.getElementById("tableTotalDiv");e.scrollLeft=t.scrollLeft};B.linkScrollbarScalingTab=function(){var e=document.getElementById("headerScalingDiv");var t=document.getElementById("tableScalingDiv");e.scrollLeft=t.scrollLeft};B.highlightRow=function(e){var t=e.target.id;var i=it[g];var a=document.getElementById(g+"##general");var n=document.getElementById(g+"##colordesc");var r=document.getElementById(g+"##outlier");var o=document.getElementById(g+"##scaling");if(i!==undefined){if(i.representations.currSelected.split(".").pop()==="0"){Mt["b"].$(Mt["b"].$(a),Mt["b"].$(a)).css("background-color","#ffffff");Mt["b"].$(Mt["b"].$(n),Mt["b"].$(n)).css("background-color","#ffffff");Mt["b"].$(Mt["b"].$(r),Mt["b"].$(r)).css("background-color","#ffffff");Mt["b"].$(Mt["b"].$(o),Mt["b"].$(o)).css("background-color","#ffffff")}else{Mt["b"].$(Mt["b"].$(a),Mt["b"].$(a)).css("background-color","rgb(232,232,232)");Mt["b"].$(Mt["b"].$(n),Mt["b"].$(n)).css("background-color","rgb(232,232,232)");Mt["b"].$(Mt["b"].$(r),Mt["b"].$(r)).css("background-color","rgb(232,232,232)");Mt["b"].$(Mt["b"].$(o),Mt["b"].$(o)).css("background-color","rgb(232,232,232)")}}var l=g;g="";if(t!==l){a=document.getElementById(t+"##general");n=document.getElementById(t+"##colordesc");r=document.getElementById(t+"##outlier");o=document.getElementById(t+"##scaling");Mt["b"].$(Mt["b"].$(a),Mt["b"].$(a)).css("background-color","#999999");Mt["b"].$(Mt["b"].$(n),Mt["b"].$(n)).css("background-color","#999999");Mt["b"].$(Mt["b"].$(r),Mt["b"].$(r)).css("background-color","#999999");Mt["b"].$(Mt["b"].$(o),Mt["b"].$(o)).css("background-color","#999999");g=t}};B.highlightInlineCommentRow=function(e){var t=e.target.id;var i=it[g];var a=document.getElementById(g+"##general");if(i!==undefined){if(i.representations.currSelected.split(".").pop()==="0"){Mt["b"].$(Mt["b"].$(a),Mt["b"].$(a)).css("background-color","#ffffff")}else{Mt["b"].$(Mt["b"].$(a),Mt["b"].$(a)).css("background-color","rgb(232,232,232)")}}var n=g;g="";if(t!==n){a=document.getElementById(t+"##general");Mt["b"].$(Mt["b"].$(a),Mt["b"].$(a)).css("background-color","#999999");g=t}};B.setRowHighlightForStartUp=function(e){var t=it[e];var i=document.getElementById(e+"##general");var a=document.getElementById(e+"##colordesc");var n=document.getElementById(e+"##outlier");var r=document.getElementById(e+"##scaling");if(t.representations.currSelected.split(".").pop()!=="0"){Mt["b"].$(Mt["b"].$(i),Mt["b"].$(i)).css("background-color","rgb(232,232,232)");Mt["b"].$(Mt["b"].$(a),Mt["b"].$(a)).css("background-color","rgb(232,232,232)");Mt["b"].$(Mt["b"].$(n),Mt["b"].$(n)).css("background-color","rgb(232,232,232)");Mt["b"].$(Mt["b"].$(r),Mt["b"].$(r)).css("background-color","rgb(232,232,232)")}};B.setRowHighlightForInputStartUp=function(e){var t=it[e];var i=document.getElementById(e+"##general");if(t.representations.currSelected.split(".").pop()!=="0"){Mt["b"].$(Mt["b"].$(i),Mt["b"].$(i)).css("background-color","rgb(232,232,232)")}};B.setRowHighlightRepresentation=function(e){var t=it[e];var i=document.getElementById(e+"##general");var a=document.getElementById(e+"##colordesc");var n=document.getElementById(e+"##outlier");var r=document.getElementById(e+"##scaling");if(g===e){return}if(t.representations.currSelected.split(".").pop()==="0"){Mt["b"].$(Mt["b"].$(i),Mt["b"].$(i)).css("background-color","#ffffff");Mt["b"].$(Mt["b"].$(a),Mt["b"].$(a)).css("background-color","#ffffff");Mt["b"].$(Mt["b"].$(n),Mt["b"].$(n)).css("background-color","#ffffff");Mt["b"].$(Mt["b"].$(r),Mt["b"].$(r)).css("background-color","#ffffff")}else{Mt["b"].$(Mt["b"].$(i),Mt["b"].$(i)).css("background-color","rgb(232,232,232)");Mt["b"].$(Mt["b"].$(a),Mt["b"].$(a)).css("background-color","rgb(232,232,232)");Mt["b"].$(Mt["b"].$(n),Mt["b"].$(n)).css("background-color","rgb(232,232,232)");Mt["b"].$(Mt["b"].$(r),Mt["b"].$(r)).css("background-color","rgb(232,232,232)")}};function calculateStdLength(){var e=document.getElementById("hiddenDiv");if(ue!==true){for(var t=0;t<ot.length;t++){var i=0;Mt["b"].$(e).html(lt[t]);var a=e.clientWidth+1;if(t==2){for(var n=0;n<xt.length;n++){Mt["b"].$(e).html(xt[n]);i+=e.clientWidth+5}}G[t]=Math.max(a,i)}}else{for(var t=0;t<pt.length;t++){var i=0;Mt["b"].$(e).html(gt[t]);var a=e.clientWidth+1;if(t==2){for(var n=0;n<xt.length;n++){Mt["b"].$(e).html(xt[n]);i+=e.clientWidth+5}}V[t]=Math.max(a,i)}G=V}for(var t=0;t<ie.length;t++){Mt["b"].$(e).html(ie[t]);var a=e.clientWidth+1;_[t]=a}for(var t=0;t<re.length;t++){if(re[t]==="Function"){_[t]=35}else{Mt["b"].$(e).html(oe[t]);var a=e.clientWidth+1;if(a>_[t]){_[t]=a}}}for(var t=0;t<Ae.length;t++){Mt["b"].$(e).html(_e[t]);var a=e.clientWidth+1;L[t]=a}for(var t=0;t<Ie.length;t++){Mt["b"].$(e).html(De[t]);var a=e.clientWidth+1;if(Ie[t]==="Function"){a=35}I[t]=a}for(var t=0;t<Be.length;t++){Mt["b"].$(e).html(ke[t]);var a=e.clientWidth+1;D[t]=a}for(var t=0;t<He.length;t++){Mt["b"].$(e).html(Ge[t]);var a=e.clientWidth+1;if(a>D[t]){D[t]=a}}for(var t=0,r=at.length;t<r;t++){Mt["b"].$(e).html(at[t]);var a=e.clientWidth+1;R[t]=a}}B.calculateColumnsLength=function(){var e=document.getElementById("hiddenDiv");if(ue!==true){for(var t=0;t<We.length;t++){Mt["b"].$(e).html(We[t].name);var i=e.clientWidth+35;if(i>G[0]){G[0]=i;if(le.instanceOf!=="TableModel"){G[3]=i}else{V[3]=V[4]}}}if(le.instanceOf==="TableModel"){for(var t=0;t<We.length;t++){Mt["b"].$(e).html(We[t].name);var i=e.clientWidth+35;if(i>G[0]){G[0]=i}}}for(var a=1;a<mt.length;a++){var n=mt[a];for(var t=0;t<n.length;t++){if(n[t].instanceOf!=="ExpressionDO"||n[t].instanceOf===undefined){if(n[t].translation!==undefined){Mt["b"].$(e).html(n[t].translation)}else{Mt["b"].$(e).html(n[t])}var i=e.clientWidth+35;if(i>G[a]){G[a]=i}}else{break}}}}else{for(var t=0;t<We.length;t++){Mt["b"].$(e).html(We[t].name);var i=e.clientWidth+35;if(i>V[0]){V[0]=i;if(le.instanceOf!=="TableModel"){V[3]=i}else{V[3]=V[4]}}}for(var a=1;a<vt.length;a++){var n=vt[a];for(var t=0;t<n.length;t++){if(n[t].instanceOf!=="ExpressionDO"||n[t].instanceOf===undefined){if(n[t].translation!==undefined){Mt["b"].$(e).html(n[t].translation)}else{Mt["b"].$(e).html(n[t])}var i=e.clientWidth+35;if(i>V[a]){V[a]=i}}else{break}}}G=V}_[0]=G[0];for(var a=1;a<yt.length;a++){var n=yt[a];for(var t=0;t<n.length;t++){Mt["b"].$(e).html(n[t]);var i=e.clientWidth+35;if(i>_[a]){_[a]=i}}}L[0]=G[0];for(var a=1;a<tt.length;a++){var n=tt[a];if(n===""){var r=document.createElement("input");r.type="text";r.setAttribute("size","8");Mt["b"].$(e).html(r);var i=e.clientWidth;if(i>L[a]){L[a]=i}}else{for(var t=0;t<n.length;t++){Mt["b"].$(e).html(n[t]);var i=e.clientWidth+35;if(i>L[a]){L[a]=i}}}}for(var a=0;a<bt.length;a++){var n=bt[a];for(var t=0;t<n.length;t++){Mt["b"].$(e).html(n[t]);var i=e.clientWidth+35;if(i>I[a]){I[a]=i}}}D[0]=G[0];for(var a=1;a<Ct.length;a++){var n=Ct[a];for(var t=0;t<n.length;t++){Mt["b"].$(e).html(n[t]);var i=e.clientWidth+35;if(i>D[a]){D[a]=i}}}for(var t=0,o=We.length;t<o;t++){Mt["b"].$(e).html(We[t].nameInternal?We[t].nameInternal:We[t].name);var i=e.clientWidth+35;if(R[0]<i){R[0]=i}}Mt["b"].$(e).html(se.getTranslation("LIST"));var i=e.clientWidth+1;if(R[1]<i){R[1]=i}Mt["b"].$(e).html(se.getTranslation("COMMENT"));var i=e.clientWidth+1;if(R[1]<i){R[1]=i}Mt["b"].$(e).html(se.getTranslation("FLAG"));var i=e.clientWidth+1;if(R[1]<i){R[1]=i}if(R[2]<40){R[2]=40}if(R[3]<90){R[3]=90}if(R[4]<160){R[4]=160}if(R[5]<120){R[5]=120}};function fillExpressionCollection(){for(var e=0;e<We.length;e++){it[We[e].id]=createExpressionObject(We[e])}}function createExpressionObject(e){var t=null;var i=e;if(le.expressions){for(var a=0;a<le.expressions.length;a++){if(le.expressions[a].id===e.id){t=le.expressions[a];break}}}if(t){i=t;if(!i.addKeyVariable){i.addKeyVariable=e.addKeyVariable}}var n=e.name;var r="";var o="";var l=-1;if(le.instanceOf==="ChartModel"){r=de.structureRepresentation.NONE;o=ce.ELEMENT;l=i.currPosition}else if(le.instanceOf==="TableModel"){r=de.tableRepresentation.NONE;o=ce.HEADER}else if(le.instanceOf==="TimeChartModel"){r=de.timeRepresentation.NONE;o=ce.ELEMENT;l=i.labelPosition}if(t){r=t.representation;o=t.notation}if(l===-1){if(le.instanceOf==="ChartModel"){l=de.structurePosition.MID}else if(le.instanceOf==="TimeChartModel"){l=de.timePosition.MID}}var s={availRepresentations:ht,availRepresentationsTL:ft,currSelected:r};s=changeRepresentationTypesForInlineComments(i,s);if(i.reference===pe){i.reference=ge}var d={availReferences:[ge],availReferencesIds:[ge],currSelected:i.reference};var c={availConcepts:ye,availConceptsTL:Ce,currSelected:i.concept};var u=se.getTranslation("AREA");var p=se.getTranslation("COLOR");var g=se.getTranslation("AREA_COLOR");var h=[];var f=[];for(var a=0;a<Se.length;a++){if(Se[a]==="conceptType.0"||Se[a]==="conceptType.1"||Se[a]==="conceptType.4"){h.push(Se[a])}}for(var a=0;a<Me.length;a++){if(Me[a]===u||Me[a]===p||Me[a]===g){f.push(Me[a])}}if(i.referenceConcept===undefined){i.referenceConcept=i.concept}var m={availConceptsRef:h,availConceptsTLRef:f,currSelected:i.referenceConcept};var v=null;var b=null;var T=null;var x={currSelected:false};if(le.instanceOf!=="TableModel"){v={availPositions:he,availPositionsTL:fe,currSelected:l};var E=t?t.stackOrder:false;T={availStack:me,availStackTL:ve,currSelected:E};b={availSequence:be,availSequenceTL:Te,currSelected:e.sequence}}else{x.currSelected=i.axisMid?i.axisMid:false}var y=false;for(var a=0;a<e.ruleRepository.length;a++){if(e.ruleRepository[a].referenceUsed==true){y=true;ue=true;break}}if(!y){if(le.instanceOf==="TimeChartModel"){var C=xe.slice(0,2);var S=Ee.slice(0,2)}else{var C=xe.slice(0,3);var S=Ee.slice(0,3)}if(le.instanceOf==="TableModel"&&e.representation===de.tableRepresentation.VALUE){C=[C[0],C[2]];S=[S[0],S[2]]}var M={availNotations:C,availNotationsTL:S,currSelected:o}}else{var M={availNotations:xe,availNotationsTL:Ee,currSelected:o}}var O=i.outlier;var A=i.outlierLabel;var _=i.outlierOperator;var L=i.outlierSymbols;var I=t?t.outlierStyle:Mt["b"].DataObjects.RuntimeDO.getParameter("SELECT_OUTLIER_STYLE");var D={currSelected:i.valueLabelOpt?i.valueLabelOpt:"All.Dynamic"};var R=[];for(var P=0;P<i.valueLabelFormulaArray.length;P++){var N=i.valueLabelFormulaArray[P].id;var w=i.valueLabelFormulaArray[P].appliesFormula.formula;var F=i.valueLabelFormulaArray[P].conditionFormula.formula;var B={id:N,appliesFormula:{formula:w,compiledFormula:null},conditionFormula:{formula:F,compiledFormula:null}};R.push(B)}var k={currSelected:i.units};var U={currSelected:i.valueLabelBackground?i.valueLabelBackground:"transparent"};var H={currSelected:i.valueLabelType?i.valueLabelType:i.type};var G={currSelected:i.valueLabelOverlapSelf};var V={currSelected:i.valueRowLabelPosition};var $={currSelected:i.legendInGrid};if(i.connector==="Notation"){i.connector="Always"}var z={currSelected:i.connector};var W=i.scalingMaximize;var j=i.scalingLegendShow;var K=i.scalingLegendDisplace;var X=i.scalingLegendSign;var Y=Mt["b"].Utils.Calculator.resolveQvVars(e.scalingGroup);var Z=i.listContent;var Q=i.edit;var q=i.mandatory;var J=i.maxLength;var ee=i.saveName;var te=i.number;var ie=i.isDate;var ae=i.listContentDefault;var ne=i.transport?i.transport:nt.BACKEND;var re=i.commonTable?i.commonTable:null;var oe={name:n,representations:s,positions:v,sequence:b,stack:T,notation:M,concept:c,outlier:O,outlierLabel:A,outlierOperator:_,outlierSymbols:L,outlierStyle:I,valueLabel:D,valueLabelFormulaArray:R,valueLabelUnits:k,legend:V,connector:z,legendInGrid:$,referenceUsed:y,valueLabelBackground:U,valueLabelType:H,valueLabelOverlapSelf:G,scalingMaximize:W,scalingLegendSign:X,scalingLegendShow:j,scalingLegendDisplace:K,scalingGroup:Y,showRestAsValue:i.showRestAsValue,showSubtotalAsValue:i.showSubtotalAsValue,showTotalAsValue:i.showTotalAsValue,axisMid:x,reference:d,referenceConcept:m,listContent:Z,edit:Q,mandatory:q,maxLength:J,saveName:ee,number:te,isDate:ie,listContentDefault:ae,transport:ne,commonTable:re,addKeyVariable:i.addKeyVariable};return oe}function changeRepresentationTypesForInlineComments(e,t){var i=Mt["b"].Models.Actions.ModelActions.ContextModel.getContextContentById(C,e.id.split(".").pop());if(i.inlineCommentType!==undefined){if(le.instanceOf==="ChartModel"){t.availRepresentations=["structureRepresentationType.0"];t.availRepresentationsTL=["-"]}else if(le.instanceOf==="TimeChartModel"){t.availRepresentations=["timeRepresentationType.0"];t.availRepresentationsTL=["-"]}else{switch(i.inlineCommentType){case"list":t.availRepresentations=["tableRepresentationType.0","tableRepresentationType.8"];t.availRepresentationsTL=["-","List"];break;case"comment":t.availRepresentations=["tableRepresentationType.0","tableRepresentationType.9"];t.availRepresentationsTL=["-","Comment"];break;case"flag":t.availRepresentations=["tableRepresentationType.0","tableRepresentationType.10"];t.availRepresentationsTL=["-","Flag"];break}}if(t.availRepresentations.indexOf(t.currSelected)===-1){t.currSelected=t.currSelected.split(".")[0]+".0"}}return t}B.updateAllExpressionCollectionObjects=function(){for(var e in it){B.updateExpressionCollectionObject(e,false)}B.updateExpressionCollectionReferenceObject()};B.updateExpressionCollectionReferenceObject=function(){if(le.instanceOf!=="TableModel"){var e=Pe[document.getElementById("select##_##stackType").selectedIndex]==="%";for(var t=0;t<We.length;t++){var i=We[t];var a=it[i.id];var n=a.stack.currSelected!==false?true:false;var r=document.getElementById("select##"+i.id+"##reference");var o=a.reference;for(var l=0;l<We.length;l++){var s=it[We[l].id];var d=We[l].id.split(".").pop();if(i.id===We[l].id){continue}if(i.scalingGroup===We[l].scalingGroup&&a.representations.currSelected!==de.timeRepresentation.NONE&&a.representations.currSelected!==de.structureRepresentation.NONE&&s.representations.currSelected!==de.timeRepresentation.VALUE&&(!e||s.stack.currSelected===false&&!n)){if(o.availReferencesIds.indexOf(d)===-1){if(n===false||s.stack.currSelected===false){o.availReferences.push(We[l].name);o.availReferencesIds.push(d);var c=document.createElement("option");Mt["b"].$(c).html(We[l].name);r.appendChild(c)}}else{if(n===true&&s.stack.currSelected!==false){B.removeReferenceEntries(o,l,r)}}}else{B.removeReferenceEntries(o,l,r)}}}B.setReferencesAndDisableEnableElements()}};B.removeReferenceEntries=function(e,t,i){var a=e.availReferencesIds.indexOf(We[t].id.split(".").pop());if(a!==-1){e.availReferences.splice(a,1);e.availReferencesIds.splice(a,1);if(e.availReferencesIds.indexOf(e.currSelected)===-1){e.currSelected=ge;i.selectedIndex=0}i.options.remove(a)}};B.setReferencesAndDisableEnableElements=function(){var e=999999;var t=undefined;var i=undefined;var a=undefined;for(var n in it){var r=it[n];if(r.stack.currSelected!==false&&r.stack.currSelected<e){e=r.stack.currSelected;t=r.reference.currSelected;i=n;a=r.scalingGroup}}for(var n in it){var o=document.getElementById("select##"+n+"##reference");var l=document.getElementById("select##"+n+"##stack");var r=it[n];var s=r.reference;if(r.representations.currSelected===de.timeRepresentation.VALUE||r.representations.currSelected===de.structureRepresentation.VALUE){o.setAttribute("disabled","disabled");o.selectedIndex=0;r.reference.currSelected=r.reference.availReferencesIds[o.selectedIndex];continue}if(r.representations.currSelected===de.timeRepresentation.COLUMN||r.representations.currSelected===de.structureRepresentation.BAR){if(a!==undefined&&r.scalingGroup!==a){l.selectedIndex=0;l.setAttribute("disabled","disabled");r.stack.currSelected=false;var d=document.getElementById("select##"+n+"##valueLabelType");if(d){var c=Z.slice(0);c.splice(3,1);c.splice(2,1);B.updateDropboxElements(d,c,r.valueLabelType,Y,Z,le)}}else{l.removeAttribute("disabled")}}if(n!==i){if(r.stack.currSelected!==false&&s.availReferencesIds.indexOf(t)!==-1){s.currSelected=t;o.selectedIndex=s.availReferencesIds.indexOf(s.currSelected);if(s.currSelected===ge){o.removeAttribute("disabled")}else{o.setAttribute("disabled","disabled")}}else{if(o.value===ge){o.removeAttribute("disabled")}}}else{o.removeAttribute("disabled")}}};B.updateExpressionCollectionObject=function(e,t){B.typeChange(le,e,false);var i=document.getElementById("select##"+e+"##notation");var a=document.getElementById("select##"+e+"##representation");var n=document.getElementById("select##"+e+"##referenceConcept");if(n!==null){B.referenceConceptChange(a,n,i,true)}B.activateDeactivateButton(e)};B.getActiveExpressions=function(){var e=[];for(var t in it){if(it[t].representations.currSelected!==de.timeRepresentation.NONE&&it[t].representations.currSelected!==de.structureRepresentation.NONE&&it[t].representations.currSelected!==de.tableRepresentation.NONE){e.push({id:t,name:it[t].name})}}return e};B.getActiveTab=function(){return Mt["b"].$(U).tabs("option","selected")};B.setActiveTab=function(e){return Mt["b"].$(U).tabs("option","selected",e)};B.temporaryChangeSelection=function(e){var t=e.target.id;var i=document.getElementById(t);var a=t.split("##");var n=a[1];var r=a[2];var o=it[n];switch(r){case"representation":var l=o.representations;var s=i.selectedIndex;l.currSelected=l.availRepresentations[s];B.updateExpressionCollectionObject(n,true);B.setRowHighlightRepresentation(n);B.updateExpressionCollectionReferenceObject();if(O){O()}break;case"position":var l=o.positions;var s=i.selectedIndex;l.currSelected=l.availPositions[s];break;case"stack":var l=o.stack;var s=i.selectedIndex;l.currSelected=l.availStack[s];if(l.currSelected===false){var d=document.getElementById("select##"+n+"##reference");d.selectedIndex=0;o.reference.currSelected=o.reference.availReferencesIds[d.selectedIndex]}B.handleStackReferenceExpressions(r,o,n);B.updateExpressionCollectionReferenceObject();break;case"sequence":var l=o.sequence;var s=i.selectedIndex;l.currSelected=l.availSequence[s];break;case"notation":var l=o.notation;var s=i.selectedIndex;l.currSelected=l.availNotations[s];break;case"concept":var l=o.concept;var s=i.selectedIndex;l.currSelected=l.availConcepts[s];break;case"referenceConcept":var l=o.referenceConcept;var s=i.selectedIndex;l.currSelected=l.availConceptsRef[s];break;case"reference":var l=o.reference;var s=i.selectedIndex;l.currSelected=l.availReferencesIds[s];B.handleStackReferenceExpressions(r,o,n);B.setReferencesAndDisableEnableElements();B.checkReferences(l,o);break;case"outlier":case"outlierLabel":break;case"valueLabel":var l=o.valueLabel;var s=i.selectedIndex;if(le.instanceOf==="TableModel"){l.currSelected=w[s]+".Always"}else{var c=document.getElementById("select##"+n+"##valueLabelCollisionD").checked?".Dynamic":".Always";l.currSelected=w[s]+c}break;case"valueLabelType":var l=o.valueLabelType;var s=i.selectedIndex;l.currSelected=Y[s];break;case"valueLabelCollisionD":var l=o.valueLabel;var s=document.getElementById("select##"+n+"##valueLabel").selectedIndex;var c=i.checked?".Dynamic":".Always";l.currSelected=w[s]+c;break;case"valueLabelUnitsD":var l=o.valueLabelUnits;l.currSelected=i.checked;break;case"valueLabelBackground":var l=o.valueLabelBackground;var s=i.selectedIndex;l.currSelected=K[s];break;case"legend":var l=o.legend;var s=i.selectedIndex;if(st){var c=st[document.getElementById("select##"+n+"##legendCollision").selectedIndex];l.currSelected=W[s]+"."+c}else{l.currSelected=W[s]}break;case"legendCollision":var l=o.legend;var s=document.getElementById("select##"+n+"##legend").selectedIndex;var c=st[i.selectedIndex];l.currSelected=W[s]+"."+c;if(i.selectedIndex!==0){document.getElementById("select##"+n+"##legendInGrid").checked=false}break;case"connector":var l=o.connector;var s=i.selectedIndex;l.currSelected=$e[s];break;case"legendInGrid":if(i.checked){document.getElementById("select##"+n+"##legendCollision").selectedIndex=0;var l=o.legend;var s=document.getElementById("select##"+n+"##legend").selectedIndex;var c=st[0];l.currSelected=W[s]+"."+c}break;case"scalingMaximize":var u=o.scalingGroup;for(var p in it){var g=it[p];if(g.scalingGroup===u){document.getElementById("select##"+p+"##scalingMaximize").checked=e.target.checked}}break;case"scalingLegendShow":case"scalingLegendSign":case"scalingLegendDisplace":break;default:}};B.temporaryChangeInlineCommentSelection=function(e){var t=this.id;var i=document.getElementById(t);var a=t.split("##");var n=a[1];var r=it[n];var o=r.representations;var l=i.selectedIndex;o.currSelected=o.availRepresentations[l];r.type=o.currSelected;B.updateInputTab(this);updateInlineCommentHighlightRow(r)};function updateInlineCommentHighlightRow(e){var t=document.getElementById(e.id+"##general");if(g===e.id){return}if(e.representations.currSelected.split(".").pop()==="0"){Mt["b"].$(Mt["b"].$(t),Mt["b"].$(t)).css("background-color","#ffffff")}else{Mt["b"].$(Mt["b"].$(t),Mt["b"].$(t)).css("background-color","rgb(232,232,232)")}}B.handleReferenceFromStack=function(e,t,i){var a=9999999;var n=undefined;var r=undefined;for(var o in it){var l=it[o];if(l.stack.currSelected!==false){if(e==="reference"){if(o===i){r=l.reference.currSelected}}else{if(o!==i){r=l.reference.currSelected}}if(l.stack.currSelected<a){a=l.stack.currSelected;n=l;var s=document.getElementById("select##"+o+"##reference")}}}if(r!==undefined){if(i.split(".").pop()!==r){if(n!==undefined){if(t.stack.currSelected!==false){n.reference.currSelected=r;s.selectedIndex=n.reference.availReferencesIds.indexOf(n.reference.currSelected)}}}else{alert(se.getTranslation("ALERT_CHECK_REFERENCE_ITSELF"))}}};B.handleReferenceToStack=function(){var e=0;var t=[];var i=[];var a=[];for(var n in it){var r=it[n];if(r.stack.currSelected!==false){e++;t.push(n.split(".").pop())}}for(var n in it){if(it[n].reference.currSelected!==ge){if(t.indexOf(it[n].reference.currSelected)!==-1){i.push(it[n]);a.push(n)}}}var o=e>=2?B.getHighestStackExpr():undefined;for(var l=0;l<i.length;l++){if(o!==undefined&&i[l].reference.currSelected!==ge){i[l].reference.currSelected=o;var s=document.getElementById("select##"+a[l]+"##reference");var d=i[l].reference.availReferences[i[l].reference.availReferencesIds.indexOf(i[l].reference.currSelected)];for(var c=0;c<s.options.length;c++){if(s.options[c].text===d){s.selectedIndex=c}}}}};B.handleStackReferenceExpressions=function(e,t,i){B.handleReferenceFromStack(e,t,i);B.handleReferenceToStack()};B.getHighestStackExpr=function(){var e=undefined;var t=undefined;for(var i in it){var a=it[i];if(a.stack.currSelected!==false&&t===undefined){e=a.stack.currSelected;t=i.split(".").pop()}else{if(a.stack.currSelected!==false){if(a.stack.currSelected>e){e=a.stack.currSelected;t=i.split(".").pop()}}}}return t};B.checkReferences=function(e,t){var i=false;var a=false;var n=0;var r=undefined;var o=undefined;while(n<Object.keys(it).length){for(var l in it){if(e!==undefined){if(r===undefined){r=e.currSelected}}else{if(r===undefined){r=it[l].reference.currSelected;var t=it[l]}}if(r===pe){r=ge}if(t.name===it[l].name){o=l}if(r===ge){n++;i=a=true;r=undefined}if(l.split(".").pop()===r){n++;i=true;var r=it[l].reference.currSelected}}}if(i===false||a===false){alert(se.getTranslation("ALERT_CHECK_REFERENCE"));if(e===undefined||t.stack.currSelected!==false){for(var l in it){var t=it[l];var s=document.getElementById("select##"+l+"##reference");if(t.stack.currSelected!==false){s.selectedIndex=0;s.removeAttribute("disabled");t.reference.currSelected=t.reference.availReferencesIds[s.selectedIndex]}}}else{var s=document.getElementById("select##"+o+"##reference");s.selectedIndex=0;e.currSelected=e.availReferencesIds[s.selectedIndex]}}};B.openFunctionDialogStack=function(e){P=e.target.id;P=P.replace("select##","");P=P.replace("##functionButton","");var t="Stack(";for(var i=0;i<le.expressions.length;i++){t+=le.expressions[i].name;if(i+1>=le.expressions.length){t+=") "}else{t+=", "}}var a={extension:y,cid:C.cid,parentDialog:B,title:t,expressionObject:le,functionTarget:P,type:"valueLabelStack"};r=new Mt["b"].UI.ValueLabelShowFormulaDialog(a);r.open(e.target)};B.openFunctionDialog=function(e){P=e.target.id;P=P.replace("select##","");P=P.replace("##functionButton","");var t=it[P];var i=Mt["b"].Models.Actions.ModelActions.ContextModel.getContextContentById(C,P.split(".").pop());var a=t.name+" ("+i.displayId+")";var n={extension:y,cid:C.cid,parentDialog:B,title:a,expressionObject:t,functionTarget:P,type:"valueLabel"};r=new Mt["b"].UI.ValueLabelShowFormulaDialog(n);r.open(e.target)};B.changeSelection=function(e){var t=le.expressions;le.expressions=[];if(le.stackMode){le.stackMode=false}var i=0;for(var a=0;a<We.length;a++){var n=We[a];var r=n.id;var o=it[r];if(le.instanceOf==="TimeChartModel"){n.labelPosition=o.positions.currSelected}else if(le.instanceOf==="ChartModel"){n.currPosition=o.positions.currSelected}if(le.instanceOf==="ChartModel"||le.instanceOf==="TimeChartModel"){n.sequence=o.sequence.currSelected}else{n.sequence=1}n.representation=o.representations.currSelected;var l=t.findIndex(function(e){return e.id===n.id});l=t[l];var s=l&&l.saveName&&l.saveName.toLowerCase()!==M.toLowerCase()?l.saveName:r.split(".").pop().replace("expr","");n.saveName=o.saveName&&o.saveName.toLowerCase()===M.toLowerCase()?null:o.saveName;var d=n.saveName&&n.saveName.toLowerCase()!==M.toLowerCase()?n.saveName:r.split(".").pop().replace("expr","");if(le.instanceOf==="TableModel"&&checkValue(d,r)&&s!==d){if(o.commonTable){E.updateSaveNamesCommon(d,s,n.representation,o.commonTable,le,o)}else{E.updateSaveNamesInline(d,s,n.representation,y,le,o)}}if(le.instanceOf==="TableModel"){if(o.commonTable){E.updateCreatedCommonCommentsListContent(d,o.commonTable,o.listContent,n.representation);E.updateCreateCommonCommentsTransport(d,o.commonTable,n.representation,o.transport)}else{var c=Mt["b"].DataObjects.ContextRepo.getContextAndExtensionByCid(C.cid).extension;E.updateCreatedInlineCommentsListContent(d,c,o.listContent,n.representation);E.updateCreateInlineCommentsTransport(d,c,n.representation,o.transport)}}n.edit=o.edit;n.listContent=o.listContent;n.maxLength=o.maxLength;n.mandatory=o.mandatory;n.isDate=o.isDate;n.number=o.number;n.listContentDefault=o.listContentDefault;n.transport=o.transport;n.commonTable=o.commonTable;n.addKeyVariable=o.addKeyVariable;n.concept=o.concept.currSelected;n.referenceConcept=o.referenceConcept.currSelected;n.referenceUsed=o.referenceUsed;n.notationTypeId=o.notation.currSelected;n.axisNotation=o.notation.currSelected===ce.AXIS||o.notation.currSelected===ce.ELEMENT_AXIS;n.reference=o.reference.currSelected;var u=w[document.getElementById("select##"+r+"##valueLabel").selectedIndex];if(le.instanceOf==="TableModel"){var p=".Always";n.valueRowLabelPosition=W[document.getElementById("select##"+r+"##legend").selectedIndex]}else{var p=document.getElementById("select##"+r+"##valueLabelCollisionD").checked?".Always":".Dynamic";var g=W[document.getElementById("select##"+r+"##legend").selectedIndex];var h=st[document.getElementById("select##"+r+"##legendCollision").selectedIndex];n.valueRowLabelPosition=g+"."+h;n.legendInGrid=document.getElementById("select##"+r+"##legendInGrid").checked;n.connector=o.connector.currSelected;n.valueLabelOverlapSelf=document.getElementById("select##"+r+"##valueLabelCollisionSelfD").checked}n.valueLabelOpt=u+p;n.valueLabelBackground=o.valueLabelBackground.currSelected;n.units=document.getElementById("select##"+r+"##valueLabelUnitsD").checked;n.valueLabelType=Y[document.getElementById("select##"+r+"##valueLabelType").selectedIndex];n.showRestAsValue=document.getElementById("select##"+r+"##showRestAsValue").checked;n.showSubtotalAsValue=document.getElementById("select##"+r+"##showSubtotalAsValue").checked;n.showTotalAsValue=document.getElementById("select##"+r+"##showTotalAsValue").checked;n.valueLabelFormulaArray=[];for(var f=0;f<o.valueLabelFormulaArray.length;f++){n.valueLabelFormulaArray.push(o.valueLabelFormulaArray[f])}var m=et.encode(document.getElementById("select##"+r+"##outlier").value);n.outlier=m;n.outlierLabel=Q[document.getElementById("select##"+r+"##outlierLabel").selectedIndex];n.outlierOperator=J[document.getElementById("select##"+r+"##outlierOperator").selectedIndex];n.outlierStyle=ee[document.getElementById("select##"+r+"##outlierStyle").selectedIndex];n.outlierSymbols=document.getElementById("select##"+r+"##outlierSymbols").checked;n.scalingMaximize=document.getElementById("select##"+r+"##scalingMaximize").checked;n.scalingLegendShow=je[document.getElementById("select##"+r+"##scalingLegendShow").selectedIndex];n.scalingLegendDisplace=Xe[document.getElementById("select##"+r+"##scalingLegendDisplace").selectedIndex];n.scalingLegendSign=document.getElementById("select##"+r+"##scalingLegendSign").checked;if(o.representations.currSelected!==de.timeRepresentation.NONE&&o.representations.currSelected!==de.structureRepresentation.NONE&&o.representations.currSelected!==de.tableRepresentation.NONE){var v=new _t["a"];v.id=r;v.biColumnId=n.biColumnId;v.name=n.name;v.representation=n.representation;if(le.instanceOf==="TimeChartModel"){v.labelPosition=n.labelPosition}else if(le.instanceOf==="ChartModel"){v.currPosition=n.currPosition}else if(le.instanceOf==="TableModel"){v.axisMid=document.getElementById("select##"+r+"##axisMid").checked}v.sequence=n.sequence;v.notation=n.notationTypeId;v.axisNotation=n.axisNotation;v.concept=n.concept;v.referenceConcept=n.referenceConcept;v.reference=n.reference;v.referenceUsed=n.referenceUsed;v.valueLabelOpt=n.valueLabelOpt;v.valueLabelBackground=n.valueLabelBackground;v.units=n.units;v.valueLabelType=n.valueLabelType;v.valueLabelFormulaArray=[];for(var f=0;f<n.valueLabelFormulaArray.length;f++){v.valueLabelFormulaArray.push(n.valueLabelFormulaArray[f])}v.valueRowLabelPosition=n.valueRowLabelPosition;if(le.instanceOf!=="TableModel"){v.legendInGrid=n.legendInGrid;v.connector=n.connector;v.valueLabelOverlapSelf=n.valueLabelOverlapSelf}v.outlier=n.outlier=m;v.outlierLabel=n.outlierLabel;v.outlierOperator=n.outlierOperator;v.outlierStyle=n.outlierStyle;v.outlierSymbols=n.outlierSymbols;v.scalingMaximize=n.scalingMaximize;v.scalingLegendShow=n.scalingLegendShow;v.scalingLegendDisplace=n.scalingLegendDisplace;v.scalingLegendSign=n.scalingLegendSign;v.isStack=o.isStack;if(le.instanceOf!=="TableModel"){if(o.stack.currSelected===null||o.stack.currSelected===false||o.stack.currSelected===undefined){v.isStack=false;v.stackOrder=false}else{v.isStack=true;v.stackOrder=o.stack.currSelected;i++;le.stackMode=i>=2}}else{le.stackMode=false;v.isStack=false;v.stackOrder=false}v.saveName=n.saveName;v.edit=n.edit;v.showRestAsValue=n.showRestAsValue;v.showSubtotalAsValue=n.showSubtotalAsValue;v.showTotalAsValue=n.showTotalAsValue;v.maxLength=n.maxLength;v.listContent=n.listContent;v.mandatory=n.mandatory;v.isDate=n.isDate;v.number=n.number;v.type=n.type;v.listContentDefault=n.listContentDefault;v.transport=n.transport;v.commonTable=n.commonTable;v.addKeyVariable=n.addKeyVariable;Mt["b"].Models.Actions.ExtendedModelActions.AnyChartModel.addExpression(le,v)}}if(le.stackMode){if(le.instanceOf==="ChartModel"){var b=Ze}else{var b=qe}le.stackType=Pe[document.getElementById("select##_##stackType").selectedIndex];le.stackLabelPosition=b[document.getElementById("select##_##stackPosition").selectedIndex];le.stackLabelAlignment=$[document.getElementById("select##_##stackLabelAlignment").selectedIndex];le.stackLabelVisibility=document.getElementById("select##_##stackLabelVisibility").checked;le.stackLabelUnits=document.getElementById("select##_##stackLabelUnits").checked;var u=w[document.getElementById("select##_##stackShowLabel").selectedIndex];var p=document.getElementById("select##_##stackCollisionD").checked?".Always":".Dynamic";le.stackShowLabel=u+p;le.stackLabelOverlapSelf=document.getElementById("select##_##stackCollisionSelfD").checked;le.stackLine=we[document.getElementById("select##_##stackLine").selectedIndex];if(le.stackMode===true){for(var a=0;a<le.valueLabelFormulaArray.length;a++){var T=0;var x;for(var f=0;f<le.expressions.length;f++){if(le.expressions[f].stackOrder>T){T=le.expressions[f].stackOrder;x=le.expressions[f].id.split(".")[2]}}le.valueLabelFormulaArray[a].id=x}}}if(!e){y.paint()}return true};B.freeResources=function(){var e=document.getElementById("valueLabelShowFormulaDialog");if(e!==null){if(r!==null){r.close()}}Mt["b"].$(document.getElementById("HiCoKeyVariableSelectBox")).remove()};B.okay=function(){B.changeSelection();B.close()};B.apply=function(){B.changeSelection()};B.close=function(){c.close();y.setMode(Mt["b"].Utils.Enums.EMode.DEFAULT)}};Mt["b"].UI=Mt["b"].UI||{};Mt["b"].UI.XLSExporterDialog=function(e){var l=this;var s=e;var y=Mt["b"].DataObjects.RuntimeDO;var a=y.getTranslation("EXPORT_AS_XLS");var n=s.getCanvasDO().getDOMElement();var C=[];var S=Mt["b"].DataObjects.ContextRepo.getAllContexts();var M="12px";var r=null;var o=null;l.open=function(){var e="xlsExporterDialog";var t=[{text:y.getTranslation("OKAY"),id:"xlsExporterOkayButton",click:l.okay},{text:y.getTranslation("CANCEL"),id:"xlsExporterCancelButton",click:l.close}];var i=new Mt["b"].UI.HiCoDialogDefinition(e,a,t);M=i.getFontSize();i.setParentDomElement(n.parentNode);i.setHeight(300);i.setWidth(480);i.setPosition({});i.setResizable(true);i.setModal(true);i.setTooltip(y.getTranslation("HELP_EXPORT_EXCEL"));o=new Mt["b"].UI.HiCoDialog(i);r=o.getDialogDiv();o.setCSS();r.appendChild(fillContent());checkOKEnable()};l.okay=function(){var e=[];var t=[];for(var i=0;i<S.length;i++){var a=S[i];var n=document.getElementById("CHK_SINGLE_"+i);if(n!==undefined&&n!==null){if(n.checked===true){e.push(a);var r=document.getElementById("SELECT_SINGLE_"+i);if(r!==undefined&&r!==null){t.push(C[i][r.selectedIndex])}else{t.push(";none")}}}}if(e.length>0){var o={extension:s,contexts:e,charts:t};s.getController().dispatch("createXLS",o)}l.close()};l.close=function(){o.close()};function fillContent(){var e=document.createElement("div");var t=document.createElement("table");var i=document.createElement("tr");var a=document.createElement("td");Mt["b"].Utils.DOM.createSpan(a,"&nbsp;","space1");var n=Mt["b"].Utils.DOM.createIconButton(a,"selectAllButton","","",M,pe["a"].imgPath+"selectAll.png",y.getTranslation("SELECT_ALL"));n.setAttribute("title",y.getTranslation("HELP_EXPORT_EXCEL_CHECKALL"));Mt["b"].$(n).click(function(e){for(var t=0;t<S.length;t++){var i=document.getElementById("CHK_SINGLE_"+t);if(i!==undefined&&i!==null){i.checked=true}}checkOKEnable()});Mt["b"].Utils.DOM.createSpan(a,"&nbsp;&nbsp;","space2");var r=Mt["b"].Utils.DOM.createIconButton(a,"deselectAllButton","","",M,pe["a"].imgPath+"deselectAll.png",y.getTranslation("DESELECT_ALL"));r.setAttribute("title",y.getTranslation("HELP_EXPORT_EXCEL_CHECKNONE"));Mt["b"].$(r).click(function(e){for(var t=0;t<S.length;t++){var i=document.getElementById("CHK_SINGLE_"+t);if(i!==undefined&&i!==null){i.checked=false}}checkOKEnable()});i.appendChild(a);t.appendChild(i);var o=document.createElement("tr");var l=document.createElement("td");Mt["b"].Utils.DOM.createSpan(l,"Context","CONTEXT_HEADER");o.appendChild(l);var s=document.createElement("td");Mt["b"].Utils.DOM.createSpan(s,"Extension - Chart","CONTEXT_HEADER");o.appendChild(s);t.appendChild(o);for(var d=0;d<S.length;d++){var c=[];var u=S[d];var p=document.createElement("tr");var g=document.createElement("td");var h=Mt["b"].Utils.DOM.createCheckBoxWithLabel(g,"CHK_SINGLE_"+d,"CONTEXT_SINGLE",u.name,false);h.checkBox.setAttribute("title",y.getTranslation("HELP_EXPORT_EXCEL_CHECKCONTEXT"));h.label.setAttribute("title",y.getTranslation("HELP_EXPORT_EXCEL_CHECKCONTEXT"));Mt["b"].$(h.checkBox).click(function(e){checkOKEnable()});p.appendChild(g);var f=document.createElement("td");var m=findAllTablesForContext(u);var v=[];var b=[];for(var T=0;T<m.length;T++){var x=m[T];v.push(x.extensionNameId?x.extensionNameId+" - "+x.chartNameId:x.chartNameId);b.push(x.extensionId+";"+x.chartId);c.push(x.extensionId+";"+x.chartId)}var E=b.length===2?b[1]:b[0];Mt["b"].Utils.DOM.createSelectBox(f,"SELECT_SINGLE_"+d,b,v,E,M,30);if(b.length===1){f.firstElementChild.disabled="disabled"}p.appendChild(f);t.appendChild(p);C.push(c)}e.appendChild(t);return e}function findAllTablesForContext(e){var t=[],i=Mt["b"].DataObjects.DocumentDO.getAllExtensions();t.push({extensionId:"",contextId:"none",chartId:"none"});for(var a=0;a<i.length;a++){var n=i[a];var r=[];Mt["b"].Models.Actions.ViewModelActions.General.getAllCharts(n.getController().getRootModel().firstObjectGrid,r);for(var o=0;o<r.length;o++){var l=r[o];if(l.extendedModel.contextId===e.cid){t.push({extensionId:n.getId(),chartId:l.id,extensionNameId:n.getTitle()||n.getId(),chartNameId:l.name||l.id})}}}return t}function checkOKEnable(){var e=0;for(var t=0;t<S.length;t++){var i=document.getElementById("CHK_SINGLE_"+t);if(i!==undefined&&i!==null){if(i.checked===true){e++}}}enableOkayButton(e!==0)}function enableOkayButton(e){if(e===true){Mt["b"].$("#xlsExporterOkayButton").removeAttr("disabled");Mt["b"].$("#xlsExporterOkayButton").css("color","#000000")}else{Mt["b"].$("#xlsExporterOkayButton").attr("disabled",true);Mt["b"].$("#xlsExporterOkayButton").css("color","#BBBBBB")}}};var Be=i(635);var ke=i(271);var Ue=i(129);var He=i(73);var Ge=i(227);var Ve=i(72);var $e=Mt["b"].Models.Actions.ViewModelActions={General:{getAllCharts:function(e,t){if(!e||!e.children){return[]}var i=e.children;for(var a=0;a<i.length;a++){var n=i[a];if(n.instanceOf==="ContainerModel"){var r="";if(n.extendedModel!==null){r=n.extendedModel.instanceOf}if(r==="ChartModel"||r==="TimeChartModel"||r==="TableModel"){t.push(n)}else{Mt["b"].Models.Actions.ViewModelActions.General.getAllCharts(n,t)}}}},getAllChartsByChartProperty:function(e,t){if(!e||!e.children){return}var i=e.children;for(var a=0;a<i.length;a++){var n=i[a];if(n.instanceOf==="ContainerModel"){if(n.charts){t.push(n)}else if(n.extendedModel&&(n.extendedModel.instanceOf==="ContainerGridModel"||n.extendedModel.instanceOf==="MultipleContainerModel")){Mt["b"].Models.Actions.ViewModelActions.General.getAllChartsByChartProperty(n,t)}}}},getAllChartsByType:function(e,t,i){if(!e||!e.children){return[]}var a=e.children;for(var n=0;n<a.length;n++){var r=a[n];if(r.instanceOf==="ContainerModel"){var o="";if(r.extendedModel!==null){o=r.extendedModel.instanceOf}if(o===i){t.push(r)}else{Mt["b"].Models.Actions.ViewModelActions.General.getAllChartsByType(r,t,i)}}}},getAllSingleChartsByType:function(e,n){var r=[];function search(e){if(!e||e.instanceOf!=="ContainerModel"){return}for(var t=0;t<e.children.length;t++){var i=e.children[t],a=i.extendedModel?i.extendedModel.instanceOf:"";if(a===n){r.push(i)}else if(a==="ContainerGridModel"){search(i)}}}e.extendedModel&&e.extendedModel.instanceOf==="ContainerGridModel"&&search(e);return r},getHighlightState:function(e){var t=e.model;var i="",a="",n="";if(t.instanceOf!=="CompareModel"){if(t.isHighlighted){i="DELETE";a="minus-circle"}else{i="ADD";a="plus-circle"}}else{var r=e.extension.getController().getRootModel();var o=t.id.split(".")[0];var l=o.replace("tableContainer","chart").replace("containerModel","");var s=Object(Ve["d"])(r,l);var d=Mt["b"].DataObjects.RuntimeDO;var c=Mt["b"].Utils.Constants.TypeValues.indicator;var u=d.getParameterParsed("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH");var p=d.getParameterParsed("FACTOR_HIGHLIGHT_ELLIPSE_HEIGHT");var g=Mt["b"].Models.Actions.ViewModelActions.General.getAbsolutePositionWithScrolling(s,r);var h={clientX:e.position.x,clientY:e.position.y};h=Mt["b"].Utils.DOM.getPositionOnExtension(e.extension,h);if(t.absolute.legend!==c.NONE){var f=t.absolute.position,m=t.absolute.dimension;var v={width:m.width*u*2,height:m.height*p};var b={width:v.width-m.width,height:v.height-m.height};var T=intersect(f.x-b.width/2+g.x,f.x-b.width/2+g.x+m.width+b.width,h.x);var x=intersect(f.y-b.height/2+g.y,f.y-b.height/2+g.y+m.height+b.height,h.y);if(T&&x){n=c.ABSOLUTE;if(t.absolute.isHighlighted){i="DELETE";a="minus-circle"}}}if(!i){if(t.text.legend!==c.NONE&&t.text.text!==""){var f=t.text.position,m=t.text.dimension;var v={width:m.width*u*2,height:m.height*p};var b={width:v.width-m.width,height:v.height-m.height};var T=intersect(f.x-b.width/2+g.x,f.x-b.width/2+g.x+m.width+b.width,h.x);var x=intersect(f.y-b.height/2+g.y,f.y-b.height/2+g.y+m.height+b.height,h.y);if(T&&x){n=c.TEXT;if(t.text.isHighlighted){i="DELETE";a="minus-circle"}}}}if(!i){if(t.percent.legend!==c.NONE){var f=t.percent.position,m=t.percent.dimension;var v={width:m.width*u*2,height:m.height*p};var b={width:v.width-m.width,height:v.height-m.height};var T=intersect(f.x-b.width/2+g.x,f.x-b.width/2+g.x+m.width+b.width,h.x);var x=intersect(f.y-b.height/2+g.y,f.y-b.height/2+g.y+m.height+b.height,h.y);if(T&&x){n=c.PERCENT;if(t.percent.isHighlighted){i="DELETE";a="minus-circle"}}}}if(!i){i="ADD";a="plus-circle"}}return{commandText:i,thumbnail:a,type:n};function intersect(e,t,i){return e<i&&i<t||e===i||t===i}},getHighlightEdit:function(e){var t=e.model,i=Mt["b"].Utils.Constants.TypeValues.indicator.NONE;var a="",n="";if(t.isHighlighted||t.instanceOf==="CompareModel"&&(t.absolute.legend!==i&&t.absolute.isHighlighted||t.percent.legend!==i&&t.percent.isHighlighted||t.text.legend!==i&&t.text.isHighlighted&&t.text.text!=="")){a="EDIT";n="pencil-square-o"}return{commandText:a,thumbnail:n}},getNewHighlightId:function(e){var t=0;for(var i=0;i<e.length;i++){var a=e[i].id;a=parseInt(a.split(".").pop());if(t<=a){t=a+1}}return t},getDocumentModeText:function(){if(Mt["b"].DataObjects.DocumentDO.getSettings().documentMode.value==="DESIGN"){return{commandText:"SHOW_TEXT",thumbnail:"eye"}}return{commandText:"EDIT_TEXT",thumbnail:"pencil-square-o"}},getAbsolutePosition:function(e,t){var i=Object(Ve["f"])(t.firstObjectGrid,e);var a=e.position.x,n=e.position.y;for(var r=0;r<i.length;r++){var o=i[r],l=o.border,s=o.padding;a+=o.position.x+l.left.width+s.left;n+=o.position.y+l.top.width+s.top}return{x:a,y:n}},getAbsolutePositionWithScrolling:function(e,t){var i=Object(Ve["f"])(t.firstObjectGrid,e),a=e.scrollingData,n=e.position.x+(e.border?e.border.left.width:0)+(e.padding?e.padding.left:0)-(a&&!isNaN(a.scrollLeft)?a.scrollLeft:0),r=e.position.y+(e.border?e.border.top.width:0)+(e.padding?e.padding.top:0)-(a&&!isNaN(a.scrollTop)?a.scrollTop:0);for(var o=0;o<i.length;o++){var l=i[o],s=l.border,d=l.padding,c=l.scrollingData;n+=l.position.x+s.left.width+d.left-(!c||isNaN(c.scrollLeft)?0:c.scrollLeft);r+=l.position.y+s.top.width+d.top-(!c||isNaN(c.scrollTop)?0:c.scrollTop)}return{x:n,y:r}}},AxisModel:{},BackGroundModel:{},BarModel:{getFixateScalingGroupContextmenuItem:function(e){var t=e.model;var i=e.extension;var a=i.getController().getRootModel();var n=t.id.split(".")[0];var r=Object(Ve["d"])(a,n);var o=Mt["b"].DataObjects.ContextRepo.getContextByCid(r.extendedModel.contextId);var l="";var s="";if(o){var d=Mt["b"].Models.Actions.ModelActions.ContextModel.getContextContentById(o,t.dataId_expr);if(d){var c=new Mt["b"].Utils.Calculator(null);if(Mt["b"].DataObjects.DocumentDO.getScalingGroups()[d.scalingGroup]!==undefined&&Mt["b"].DataObjects.DocumentDO.getScalingGroups()[d.scalingGroup].auto===true){l=Ot["a"].getTranslation("FIXATE")+' "'+c.decode(d.scalingGroup)+'"';s="lock"}else{l=Ot["a"].getTranslation("UNFIXATE")+' "'+c.decode(d.scalingGroup)+'"';s="unlock"}}}return{commandText:l,thumbnail:s,needsTranslation:false}},getFixateAllGroupsContextmenuItem:function(e){var t=e.model;var i=e.extension;var a=i.getController().getRootModel();var n=t.id.split(".")[0];var r=Object(Ve["d"])(a,n);var o=Mt["b"].DataObjects.ContextRepo.getContextByCid(r.extendedModel.contextId);var l="";var s="";if(o){var d=Mt["b"].Models.Actions.ModelActions.ContextModel.getContextContentById(o,t.dataId_expr);if(d){var c=Mt["b"].DataObjects.DocumentDO.getScalingGroups();if(c){if(c[d.scalingGroup]!==undefined&&c[d.scalingGroup].auto===true){l="FIXATEALL";s="lock"}else{l="UNFIXATEALL";s="unlock"}}}}return{commandText:l,thumbnail:s}},isScalingGroupFixable:function(e,t){var i=t.getController().getRootModel();var a=e.id.split(".")[0];var n=Object(Ve["d"])(i,a);var r=n.extendedModel;var o=Mt["b"].DataObjects.ContextRepo.getContextByCid(r.contextId);if(o===null){return false}var l=Mt["b"].Models.Actions.ModelActions.ContextModel.getContextContentById(o,e.dataId_expr);if(l===null){return false}var s;for(var d=0;d<r.expressions.length;d++){if(r.expressions[d].id===l.id){s=r.expressions[d];break}}if(s.scalingMaximize||s.isStack&&r.stackMode&&r.stackType==="%"){return false}var c=Mt["b"].DataObjects.DocumentDO.getScalingGroups();var u=l.scalingGroup;return!c[u]}},CompareModel:{getDifferenceData:function(e,t,n){var i=Mt["b"].DataObjects.DocumentDO.getDocSettings();var r=Mt["b"].Utils.Constants.TypeValues.indicator;var a=e.compareFrom;var o=e.compareTo;var l,s;var d,c="",u;var p=0,g="",h=true;function getReferenceValue(e,t,i){var a;if(e===r.AXIS||i===r.AXIS){a=0}else if(e.instanceOf==="TimeWaterfallModel"||e.instanceOf==="StructureWaterfallModel"){a=e.relativeValue-(t===r.START?e.value:0)}else if(n&&e.isStack&&n.extendedModel.stackMode){a=e.stackModel.startOn+(t===r.START?0:e.value)}else{a=t===r.START?0:e.value}return a}l=getReferenceValue(a,e.compareFromStart,e.compareFromCat);s=getReferenceValue(o,e.compareToStart,e.compareToCat);d=s-l;if(l===0){p=Number.NaN;g="N/A";h=false}else if(l<0){p=(s-l)/-l}else{p=(s-l)/l}if(e.customIsPositive===false){d=-d;if(l!==0){p=-p}}u=d>=0;if(l!==0){h=p>=0}if(e.absolute.legend!==r.NONE){var f={numberFormat:{decimal:ot["a"].numberFormatCompareValueDecimals,decimalSeparator:i.decimalSep.value,decimalThousandSeparator:i.thousandSep.value,negativeStyle:i.negativeStyle.value}};var m=1;var v=0;var b,T;if(a===r.AXIS){b=o.dataId_dim;T=o.dataId_expr}else{b=a.dataId_dim;T=a.dataId_expr}var x=Mt["b"].Models.Actions.DataModelActions.getDimensionNodeByPath(t.dataModel,b);for(var E=0;E<x.nodes.length;E++){if(x.nodes[E].key===T){v=Mt["b"].Models.Actions.ModelActions.RuleEntryModel.resolveDisplayedDecimals(x.nodes[E].usedRuledEntry);m=Mt["b"].Models.Actions.ModelActions.RuleEntryModel.resolveFactor(x.nodes[E].usedRuledEntry);break}}c=Mt["b"].Utils.Format.NumberFormat.formatNumber(d,f,m,false,v);var y="";var C="";if(a!==r.AXIS){var S=Mt["b"].Models.Actions.ModelActions.ContextModel.getExpressionByShortId(t,a.dataId_expr);y=Mt["b"].Utils.Calculator.resolveQvVars(S.scalingGroup)}if(o!==r.AXIS){var S=Mt["b"].Models.Actions.ModelActions.ContextModel.getExpressionByShortId(t,o.dataId_expr);C=Mt["b"].Utils.Calculator.resolveQvVars(S.scalingGroup)}if(y.indexOf("%")!==-1||C.indexOf("%")!==-1){c+=" pp"}if(u){c="+"+c}}if(e.percent.legend!==r.NONE&&!isNaN(p)){var M={numberFormat:{decimal:ot["a"].numberFormatCompareValueDecimals,decimalSeparator:i.decimalSep.value,decimalThousandSeparator:i.thousandSep.value,negativeStyle:i.negativeStyle.value}};g=Mt["b"].Utils.Format.NumberFormat.formatNumber(p,M,.01)+"%";if(h){g="+"+g}}return{textAbsolute:c,isPositiveAbsolute:u,textPercent:g,isPositivePercent:h,realValue:d}},setText:function(e,t,i){if(e.compareFrom&&e.compareTo){var a=Mt["b"].Models.Actions.ViewModelActions.CompareModel.getDifferenceData(e,t,i);e.absolute.text=a.textAbsolute;e.absolute.real=a.realValue;e.positive=a.isPositiveAbsolute;e.percent.text="("+a.textPercent+")";if(e.text.legend!=="none"){var n=e.text.originalText?e.text.originalText:e.text.text;if(n.indexOf("$")>-1){e.text.originalText=n;var r=new Mt["b"].Utils.Format.LabelFormatter;n=r.parseLabel(n).replace(/ /g," ")}e.text.text=n}}},getNewId:function(e){var t=0;for(var i=0;i<e.length;i++){var a=e[i].id;a=parseInt(a.split(".")[1].match(/\d+/g));if(t<=a){t=a+1}}return t}},ContainerModel:{init:M["a"].init,addChild:function(e,t,i){if(i){e.children.unshift(t)}else{e.children.push(t)}},removeChild:function(e,t){for(var i=0;i<e.children.length;i++){if(e.children[i].id===t){e.children=e.children.splice(i-1,1)}}},flipChildren:M["a"].flipChildren,getChildById:function(e,t){for(var i=0;i<e.children.length;i++){if(e.children[i].id===t){return e.children[i]}}return null},getChildIndexById:function(e,t){for(var i=0;i<e.children.length;i++){if(e.children[i].id===t){return i}}return-1},getActiveChart:function(e){var t=Mt["b"].Models.Actions.ViewModelActions.ContainerModel.getActiveChartIndex(e);return t===-1?null:e.charts[t].model},getActiveChartIndex:function(e){if(!e||!e.charts||e.charts.length===0){return-1}else if(e.charts.length===1){return 0}var t=new Mt["b"].Utils.Calculator;var i={};t.addQvVariables(i,true);for(var a=0;a<e.charts.length;a++){if(t.calculateFomulaCFM(t,e.charts[a],i,e.charts[a].formula,null,false)===1){return a}}return-1},isInMultipleIfGrid:function(e){var t=e.model;if(t.extendedModel.instanceOf==="ContainerGridModel"){var i=Object(Ve["f"])(e.extension.getController().getRootModel().firstObjectGrid,t);return{isValid:i[0]!=undefined&&i[0].extendedModel!=null&&i[0].extendedModel.instanceOf==="MultipleContainerModel"}}return{isValid:true}},getCycleGroupContextmenuItem:function(e){var t={isValid:false,entries:[]};var i=e.model;if(!i||!i.extendedModel||i.instanceOf!=="ContainerModel"){return t}var a=i.extendedModel;var r;if(a.instanceOf==="ChartModel"||a.instanceOf==="TimeChartModel"||a.instanceOf==="TableModel"){r=Mt["b"].DataObjects.ContextRepo.getContextByCid(a.contextId);if(!r){return t}}var n="";for(var o=0;o<r.rows.length;o++){var l=r.rows[o];if(l.dimensionType==="cyclic"){if(t.entries.length===0){t.isValid=true}else{t.entries.push(separatorGenerator("SeparatorCycle"+o))}var s=l.groupActualLevel===0?l.groupMembers.length-1:l.groupActualLevel-1;t.entries.push(entryGenerator("SWITCH_BACKWARD"+n,o,s,"undo"));var d=l.groupActualLevel===l.groupMembers.length-1?0:l.groupActualLevel+1;t.entries.push(entryGenerator("SWITCH_FORWARD"+n,o,d,"repeat"));n+=" ";var c=l.groupMembers;for(var u=0;u<c.length;u++){var p=c[u];if(u!==l.groupActualLevel){t.entries.push(entryGenerator(p.nameInternal?p.nameInternal:p.name,o,u,undefined,false))}}}}function entryGenerator(e,t,i,a,n){return{name:e,level:"Consumer",models:["ContainerModel"],extendedModels:[],attributes:[],parameters:{contextId:r.cid,dimensionIdx:t,level:i},thumbnail:a||"",height:a?"11px":undefined,width:a?"7px":undefined,action:"updateQVDrillLevel",needsTranslation:n}}function separatorGenerator(e){return{name:e,level:"Consumer",models:["ContainerModel"],extendedModels:[],attributes:[],thumbnail:""}}return t},containsTextModels:function(e){var a=null;function detectTextContainer(e){var t=e.extendedModel;if(t&&t.instanceOf==="ContainerCommentGridModel"){a="comment"}else if(!t&&!e.charts||t&&t.instanceOf==="ContainerGridModel"){for(var i=0;i<e.children.length;i++){if(e.children[i].instanceOf==="ContainerModel"){detectTextContainer(e.children[i]);if(a==="comment"){break}}}}}if(e&&e.instanceOf==="ContainerModel"){detectTextContainer(e)}return a},hasInlineComments:function(e){var t=e.model;if(t.extendedModel.instanceOf==="TableModel"){for(var i=0;i<t.children.length;++i){if(t.children[i].instanceOf==="InlineModel"){return true}}}return false},isInlineCommentsReleaseOn:function(e){var t=e.model.extendedModel;return{isValid:t.instanceOf==="TableModel"&&t.input.releaseVariable}},isSaveAllNotAllowed:function(e,t){var i=Mt["b"].DataObjects.DocumentDO.getVariableById(t.extendedModel.input.saveVariable);var a=null;if(i){if(!isNaN(parseInt(i.value))&&isFinite(i.value)){a=parseInt(i.value)}else{a=i.value.toLowerCase()}}return a!=null&&a!==1&&a!==true&&a!=="true"||!i},applyDefaultTextBorderStyles:function(e){if(e.extendedModel&&!e.border.bottom.width){if(e.extendedModel.textType===Mt["b"].Utils.Constants.TypeValues.commentTextTypes.TITLE){e.border.bottom.width=Mt["b"].Utils.Calculator.Converter.mm2pixGlobalFont("MMPT_TITLE_BOTTOM_BORDER_SIZE");e.border.bottom.color=Mt["b"].DataObjects.RuntimeDO.getParameter("COLOR_TITLE_TITLE_BOTTOM_BORDER")}else if(e.extendedModel.textType===Mt["b"].Utils.Constants.TypeValues.commentTextTypes.SUBTITLE){e.border.bottom.width=Mt["b"].Utils.Calculator.Converter.mm2pixGlobalFont("MMPT_SUBTITLE_BOTTOM_BORDER_SIZE");e.border.bottom.color=Mt["b"].DataObjects.RuntimeDO.getParameter("COLOR_SUBTITLE_BOTTOM_BORDER")}}}},LabelModel:{setFontSize:function(e,t){e.fontSize=Mt["b"].Utils.Calculator.Converter.pt2pix(t)},getBox:function(e){var t=e.position.x;if(e.textAnchor==="middle"){t-=Math.round(e.dimension.width/2)}else if(e.textAnchor==="end"){t-=e.dimension.width}return{x:t,y:e.position.y,width:e.dimension.width,height:e.dimension.height}},isCommentReference:function(e){if(e.id.indexOf("commentReference")!==-1){return true}}},NeedleModel:{},StructureWaterfallModel:{},InlineCommentModel:{rewriteLabelToWidth:function(e,t,i,a){var n=Mt["b"].DataObjects.DocumentDO.getPainter();var r=n.measureTextDim(e,l).width;if(r<=t){return e}var o="";var l="";var s=Mt["b"].Utils.DOM.createTextArrayFromHTML(e);var d=0,c=[],u=0,p=0;var g=0;var h=false;for(var f=0,m=s[g].length;f<m;f++){l=s[g][f].bold?"bold ":"normal ";l+=s[g][f].italic?"italic ":"";l+=i;var v="";for(var b=0,T=s[g][f].text.length;b<T;b++){v+=s[g][f].text.charAt(b);d=n.measureTextDim(v+"...",l).width;if(d+u>t){v=v.slice(0,v.length-1);h=true;break}}c.push({text:v,bold:s[g][f].bold,underline:s[g][f].underline,italic:s[g][f].italic});if(h){break}u+=n.measureTextDim(v,l).width}h=false;for(var g=0,x=c.length;g<x;g++){if(p+c[g].text.length>=a){var E=a-p;c[g].text=c[g].text.substr(0,E);c[g].text+="...";h=true}if(c[g].bold){o+="<b>"}if(c[g].italic){o+="<i>"}if(c[g].underline){o+="<u>"}if(g===x-1&&!h){o+=c[g].text+"..."}else{o+=c[g].text}if(c[g].underline){o+="</u>"}if(c[g].italic){o+="</i>"}if(c[g].bold){o+="</b>"}if(h){break}p+=c[g].text.length}return o},rewriteLabelToWidthBinary:function(e,t,i){var a=Mt["b"].DataObjects.DocumentDO.getPainter();var n=e;var r=e;var o=a.measureTextDim(n,i).width;if(o>t){var l=0;var s;var d=n.length;var c=Math.floor((d-l)/2);while(c>=1){s=l+c;n=e.substring(0,s);o=a.measureTextDim(n+"...",i).width;if(o>t){d=s;c=Math.floor((d-l)/2)}else{l=s;c=Math.floor((d-l)/2)}}r=e.substring(0,l);r=r+"...";if(r==="..."){r=""}}return r}}};i.d(t,"HiCo",function(){return Mt["b"]});i(1211)},1209:function(e,t,i){var a=i(1210);if(typeof a==="string")a=[[e.i,a,""]];var n;var r;var o={hmr:true};o.transform=n;o.insertInto=undefined;var l=i(90)(a,o);if(a.locals)e.exports=a.locals;if(false){}},1210:function(e,t,i){t=e.exports=i(89)(false);t.push([e.i,".tc-preview .cell-initial {\n  pointer-events: none;\n}\n.hico-semantic.cell-initial {\n  min-width: 0;\n  text-align: center;\n  height: 100%;\n  background: rgba(0, 0, 0, 0.01);\n  display: flex;\n  flex-direction: column;\n  justify-content: center;\n  align-items: center;\n  margin: 1px;\n}\n.hico-semantic.cell-initial > .cell-initial-buttons button.ui.button {\n  margin-top: .25em;\n  margin-bottom: .25em;\n}\n",""])},1211:function(e,t,i){var a={"./Background.png":1212,"./Border.png":1213,"./HiCo_Zeit_Heute.png":1214,"./HiCo_Zeit_Vergangenheit.png":1215,"./HiCo_Zeit_Vorvergangenheit.png":1216,"./HiCo_Zeit_Zukunft.png":1217,"./Pattern.png":1218,"./absolute_active.png":1219,"./absolute_inactive.png":1220,"./add_rest_active.png":1221,"./add_rest_inactive.png":1222,"./add_small.png":1223,"./add_small_inactive.png":1224,"./add_total_active.png":1225,"./add_total_inactive.png":1226,"./align_center.png":1227,"./align_left.png":1228,"./align_right.png":1229,"./arrow_up.png":1230,"./arrow_up_active.png":1231,"./ascending.png":1232,"./ascending_active.png":1233,"./backend.png":1234,"./bold.gif":1235,"./bold_nm.png":1236,"./bullet_arrow_right.png":1237,"./cell_cell.png":1238,"./cell_cell_grey.png":1239,"./cell_left.png":1240,"./cell_left_grey.png":1241,"./cell_top.png":1242,"./cell_top_grey.png":1243,"./chevron_left_small.png":1244,"./circle_info.png":1245,"./circle_question_mark.png":1246,"./copy.png":1247,"./cross.png":1248,"./cycle.png":1249,"./date.png":1250,"./delete.png":1251,"./delete_small.png":1252,"./delete_small_grey.png":1253,"./descending.png":1254,"./descending_active.png":1255,"./deselectAll.png":1256,"./disk.png":1257,"./dropDown.ico":1258,"./duplication.png":1259,"./edit.png":1260,"./envelope.png":1261,"./eye.png":1262,"./eye_gray.png":1263,"./favicon.png":1264,"./favicon_inactive.png":1265,"./file.png":1266,"./floppy_disk.png":1267,"./glasses.png":1268,"./help.png":1269,"./helpdoc.png":1270,"./helptooltips.png":1271,"./hicologo.png":1272,"./hicologo_inactive.png":1273,"./highlight_element.png":1274,"./highlight_element_grey.png":1275,"./highlight_label.png":1276,"./highlight_label_grey.png":1277,"./highlight_position.png":1278,"./highlight_position_grey.png":1279,"./highlight_text.png":1280,"./highlight_text_grey.png":1281,"./invisible.png":1282,"./italic.gif":1283,"./italic_nm.png":1284,"./left_arrow.png":1285,"./link.png":1286,"./loadingChart.gif":1287,"./lock.png":1288,"./logo.png":1289,"./mouse_left_click.png":1290,"./mouse_left_click_small.png":1291,"./mouse_right_click.png":1292,"./mouse_right_click_small.png":1293,"./move.png":1294,"./notation.png":1295,"./notation_grey.png":1296,"./notation_inactive.png":1297,"./numbers.png":1298,"./off.png":1299,"./off_inactive.png":1300,"./on.png":1301,"./on_inactive.png":1302,"./order_auto_HI.png":1303,"./order_auto_N.png":1304,"./order_bottom_HI.png":1305,"./order_bottom_N.png":1306,"./order_sort_HI.png":1307,"./order_sort_N.png":1308,"./order_top_HI.png":1309,"./order_top_N.png":1310,"./page_white_copy.png":1311,"./page_white_copy_small.png":1312,"./paste.png":1313,"./pencil.png":1314,"./pencil_gray.png":1315,"./percent_active.png":1316,"./percent_inactive.png":1317,"./pin.png":1318,"./pin_active.png":1319,"./refresh_small.png":1320,"./restart.png":1321,"./right_arrow.png":1322,"./scissors.png":1323,"./selectAll.png":1324,"./sort_arrow_down.png":1325,"./sort_arrow_up.png":1326,"./sort_down1.png":1327,"./sort_keyfigure.png":1328,"./sort_none.png":1329,"./sort_self.png":1330,"./sort_up1.png":1331,"./spin-button.png":1332,"./spin-down.png":1333,"./spin-up.png":1334,"./stack.png":1335,"./stack_grey.png":1336,"./structure.png":1337,"./switchContext.png":1338,"./table.png":1339,"./text_active.png":1340,"./text_align_bottom.png":1341,"./text_align_bottom_grey.png":1342,"./text_align_center.png":1343,"./text_align_center_grey.png":1344,"./text_align_center_tb_grey.png":1345,"./text_align_left.png":1346,"./text_align_left_grey.png":1347,"./text_align_left_tb_grey.png":1348,"./text_align_mid.png":1349,"./text_align_mid_grey.png":1350,"./text_align_right.png":1351,"./text_align_right_grey.png":1352,"./text_align_right_tb_grey.png":1353,"./text_align_top.png":1354,"./text_align_top_grey.png":1355,"./text_bold.png":1356,"./text_inactive.png":1357,"./text_italic.png":1358,"./text_underline.png":1359,"./tick.png":1360,"./time.png":1361,"./totals_position_cell.png":1362,"./totals_position_cell_grey.png":1363,"./totals_position_left.png":1364,"./totals_position_left_grey.png":1365,"./totals_position_none.png":1366,"./totals_position_none_grey.png":1367,"./totals_position_right.png":1368,"./totals_position_right_grey.png":1369,"./trueChart-icon.svg":1370,"./truechart_logo_dark.svg":1371,"./truechart_logo_light.svg":1372,"./ui-active_state_1x400.png":1373,"./ui-bg_flat_0_aaaaaa_40x100.png":1374,"./ui-bg_glass_55_fbf9ee_1x400.png":1375,"./ui-bg_glass_75_dadada_1x400.png":1376,"./ui-bg_glass_75_e6e6e6_1x400.png":1377,"./ui-bg_inset-soft_95_fef1ec_1x100.png":1378,"./ui-icons_222222_256x240.png":1379,"./ui-icons_2e83ff_256x240.png":1380,"./ui-icons_454545_256x240.png":1381,"./ui-icons_cd0a0a_256x240.png":1382,"./ui-normal_state_1x400.png":1383,"./unlock.png":1384,"./user.png":1385,"./visible.png":1386};function webpackContext(e){var t=webpackContextResolve(e);return i(t)}function webpackContextResolve(e){var t=a[e];if(!(t+1)){var i=new Error("Cannot find module '"+e+"'");i.code="MODULE_NOT_FOUND";throw i}return t}webpackContext.keys=function webpackContextKeys(){return Object.keys(a)};webpackContext.resolve=webpackContextResolve;e.exports=webpackContext;webpackContext.id=1211},1212:function(e,t,i){e.exports=i.p+"img/Background.png"},1213:function(e,t,i){e.exports=i.p+"img/Border.png"},1214:function(e,t,i){e.exports=i.p+"img/HiCo_Zeit_Heute.png"},1215:function(e,t,i){e.exports=i.p+"img/HiCo_Zeit_Vergangenheit.png"},1216:function(e,t,i){e.exports=i.p+"img/HiCo_Zeit_Vorvergangenheit.png"},1217:function(e,t,i){e.exports=i.p+"img/HiCo_Zeit_Zukunft.png"},1218:function(e,t,i){e.exports=i.p+"img/Pattern.png"},1219:function(e,t,i){e.exports=i.p+"img/absolute_active.png"},1220:function(e,t,i){e.exports=i.p+"img/absolute_inactive.png"},1221:function(e,t,i){e.exports=i.p+"img/add_rest_active.png"},1222:function(e,t,i){e.exports=i.p+"img/add_rest_inactive.png"},1223:function(e,t,i){e.exports=i.p+"img/add_small.png"},1224:function(e,t,i){e.exports=i.p+"img/add_small_inactive.png"},1225:function(e,t,i){e.exports=i.p+"img/add_total_active.png"},1226:function(e,t,i){e.exports=i.p+"img/add_total_inactive.png"},1227:function(e,t,i){e.exports=i.p+"img/align_center.png"},1228:function(e,t,i){e.exports=i.p+"img/align_left.png"},1229:function(e,t,i){e.exports=i.p+"img/align_right.png"},1230:function(e,t,i){e.exports=i.p+"img/arrow_up.png"},1231:function(e,t,i){e.exports=i.p+"img/arrow_up_active.png"},1232:function(e,t,i){e.exports=i.p+"img/ascending.png"},1233:function(e,t,i){e.exports=i.p+"img/ascending_active.png"},1234:function(e,t,i){e.exports=i.p+"img/backend.png"},1235:function(e,t,i){e.exports=i.p+"img/bold.gif"},1236:function(e,t,i){e.exports=i.p+"img/bold_nm.png"},1237:function(e,t,i){e.exports=i.p+"img/bullet_arrow_right.png"},1238:function(e,t,i){e.exports=i.p+"img/cell_cell.png"},1239:function(e,t,i){e.exports=i.p+"img/cell_cell_grey.png"},1240:function(e,t,i){e.exports=i.p+"img/cell_left.png"},1241:function(e,t,i){e.exports=i.p+"img/cell_left_grey.png"},1242:function(e,t,i){e.exports=i.p+"img/cell_top.png"},1243:function(e,t,i){e.exports=i.p+"img/cell_top_grey.png"},1244:function(e,t,i){e.exports=i.p+"img/chevron_left_small.png"},1245:function(e,t,i){e.exports=i.p+"img/circle_info.png"},1246:function(e,t,i){e.exports=i.p+"img/circle_question_mark.png"},1247:function(e,t,i){e.exports=i.p+"img/copy.png"},1248:function(e,t,i){e.exports=i.p+"img/cross.png"},1249:function(e,t,i){e.exports=i.p+"img/cycle.png"},1250:function(e,t,i){e.exports=i.p+"img/date.png"},1251:function(e,t,i){e.exports=i.p+"img/delete.png"},1252:function(e,t,i){e.exports=i.p+"img/delete_small.png"},1253:function(e,t,i){e.exports=i.p+"img/delete_small_grey.png"},1254:function(e,t,i){e.exports=i.p+"img/descending.png"},1255:function(e,t,i){e.exports=i.p+"img/descending_active.png"},1256:function(e,t,i){e.exports=i.p+"img/deselectAll.png"},1257:function(e,t,i){e.exports=i.p+"img/disk.png"},1258:function(e,t,i){e.exports=i.p+"img/dropDown.ico"},1259:function(e,t,i){e.exports=i.p+"img/duplication.png"},1260:function(e,t,i){e.exports=i.p+"img/edit.png"},1261:function(e,t,i){e.exports=i.p+"img/envelope.png"},1262:function(e,t,i){e.exports=i.p+"img/eye.png"},1263:function(e,t,i){e.exports=i.p+"img/eye_gray.png"},1264:function(e,t,i){e.exports=i.p+"img/favicon.png"},1265:function(e,t,i){e.exports=i.p+"img/favicon_inactive.png"},1266:function(e,t,i){e.exports=i.p+"img/file.png"},1267:function(e,t,i){e.exports=i.p+"img/floppy_disk.png"},1268:function(e,t,i){e.exports=i.p+"img/glasses.png"},1269:function(e,t,i){e.exports=i.p+"img/help.png"},1270:function(e,t,i){e.exports=i.p+"img/helpdoc.png"},1271:function(e,t,i){e.exports=i.p+"img/helptooltips.png"},1272:function(e,t,i){e.exports=i.p+"img/hicologo.png"},1273:function(e,t,i){e.exports=i.p+"img/hicologo_inactive.png"},1274:function(e,t,i){e.exports=i.p+"img/highlight_element.png"},1275:function(e,t,i){e.exports=i.p+"img/highlight_element_grey.png"},1276:function(e,t,i){e.exports=i.p+"img/highlight_label.png"},1277:function(e,t,i){e.exports=i.p+"img/highlight_label_grey.png"},1278:function(e,t,i){e.exports=i.p+"img/highlight_position.png"},1279:function(e,t,i){e.exports=i.p+"img/highlight_position_grey.png"},1280:function(e,t,i){e.exports=i.p+"img/highlight_text.png"},1281:function(e,t,i){e.exports=i.p+"img/highlight_text_grey.png"},1282:function(e,t,i){e.exports=i.p+"img/invisible.png"},1283:function(e,t,i){e.exports=i.p+"img/italic.gif"},1284:function(e,t,i){e.exports=i.p+"img/italic_nm.png"},1285:function(e,t,i){e.exports=i.p+"img/left_arrow.png"},1286:function(e,t,i){e.exports=i.p+"img/link.png"},1287:function(e,t,i){e.exports=i.p+"img/loadingChart.gif"},1288:function(e,t,i){e.exports=i.p+"img/lock.png"},1289:function(e,t,i){e.exports=i.p+"img/logo.png"},1290:function(e,t,i){e.exports=i.p+"img/mouse_left_click.png"},1291:function(e,t,i){e.exports=i.p+"img/mouse_left_click_small.png"},1292:function(e,t,i){e.exports=i.p+"img/mouse_right_click.png"},1293:function(e,t,i){e.exports=i.p+"img/mouse_right_click_small.png"},1294:function(e,t,i){e.exports=i.p+"img/move.png"},1295:function(e,t,i){e.exports=i.p+"img/notation.png"},1296:function(e,t,i){e.exports=i.p+"img/notation_grey.png"},1297:function(e,t,i){e.exports=i.p+"img/notation_inactive.png"},1298:function(e,t,i){e.exports=i.p+"img/numbers.png"},1299:function(e,t,i){e.exports=i.p+"img/off.png"},1300:function(e,t,i){e.exports=i.p+"img/off_inactive.png"},1301:function(e,t,i){e.exports=i.p+"img/on.png"},1302:function(e,t,i){e.exports=i.p+"img/on_inactive.png"},1303:function(e,t,i){e.exports=i.p+"img/order_auto_HI.png"},1304:function(e,t,i){e.exports=i.p+"img/order_auto_N.png"},1305:function(e,t,i){e.exports=i.p+"img/order_bottom_HI.png"},1306:function(e,t,i){e.exports=i.p+"img/order_bottom_N.png"},1307:function(e,t,i){e.exports=i.p+"img/order_sort_HI.png"},1308:function(e,t,i){e.exports=i.p+"img/order_sort_N.png"},1309:function(e,t,i){e.exports=i.p+"img/order_top_HI.png"},1310:function(e,t,i){e.exports=i.p+"img/order_top_N.png"},1311:function(e,t,i){e.exports=i.p+"img/page_white_copy.png"},1312:function(e,t,i){e.exports=i.p+"img/page_white_copy_small.png"},1313:function(e,t,i){e.exports=i.p+"img/paste.png"},1314:function(e,t,i){e.exports=i.p+"img/pencil.png"},1315:function(e,t,i){e.exports=i.p+"img/pencil_gray.png"},1316:function(e,t,i){e.exports=i.p+"img/percent_active.png"},1317:function(e,t,i){e.exports=i.p+"img/percent_inactive.png"},1318:function(e,t,i){e.exports=i.p+"img/pin.png"},1319:function(e,t,i){e.exports=i.p+"img/pin_active.png"},1320:function(e,t,i){e.exports=i.p+"img/refresh_small.png"},1321:function(e,t,i){e.exports=i.p+"img/restart.png"},1322:function(e,t,i){e.exports=i.p+"img/right_arrow.png"},1323:function(e,t,i){e.exports=i.p+"img/scissors.png"},1324:function(e,t,i){e.exports=i.p+"img/selectAll.png"},1325:function(e,t,i){e.exports=i.p+"img/sort_arrow_down.png"},1326:function(e,t,i){e.exports=i.p+"img/sort_arrow_up.png"},1327:function(e,t,i){e.exports=i.p+"img/sort_down1.png"},1328:function(e,t,i){e.exports=i.p+"img/sort_keyfigure.png"},1329:function(e,t,i){e.exports=i.p+"img/sort_none.png"},1330:function(e,t,i){e.exports=i.p+"img/sort_self.png"},1331:function(e,t,i){e.exports=i.p+"img/sort_up1.png"},1332:function(e,t,i){e.exports=i.p+"img/spin-button.png"},1333:function(e,t,i){e.exports=i.p+"img/spin-down.png"},1334:function(e,t,i){e.exports=i.p+"img/spin-up.png"},1335:function(e,t,i){e.exports=i.p+"img/stack.png"},1336:function(e,t,i){e.exports=i.p+"img/stack_grey.png"},1337:function(e,t,i){e.exports=i.p+"img/structure.png"},1338:function(e,t,i){e.exports=i.p+"img/switchContext.png"},1339:function(e,t,i){e.exports=i.p+"img/table.png"},1340:function(e,t,i){e.exports=i.p+"img/text_active.png"},1341:function(e,t,i){e.exports=i.p+"img/text_align_bottom.png"},1342:function(e,t,i){e.exports=i.p+"img/text_align_bottom_grey.png"},1343:function(e,t,i){e.exports=i.p+"img/text_align_center.png"},1344:function(e,t,i){e.exports=i.p+"img/text_align_center_grey.png"},1345:function(e,t,i){e.exports=i.p+"img/text_align_center_tb_grey.png"},1346:function(e,t,i){e.exports=i.p+"img/text_align_left.png"},1347:function(e,t,i){e.exports=i.p+"img/text_align_left_grey.png"},1348:function(e,t,i){e.exports=i.p+"img/text_align_left_tb_grey.png"},1349:function(e,t,i){e.exports=i.p+"img/text_align_mid.png"},1350:function(e,t,i){e.exports=i.p+"img/text_align_mid_grey.png"},1351:function(e,t,i){e.exports=i.p+"img/text_align_right.png"},1352:function(e,t,i){e.exports=i.p+"img/text_align_right_grey.png"},1353:function(e,t,i){e.exports=i.p+"img/text_align_right_tb_grey.png"},1354:function(e,t,i){e.exports=i.p+"img/text_align_top.png"},1355:function(e,t,i){e.exports=i.p+"img/text_align_top_grey.png"},1356:function(e,t,i){e.exports=i.p+"img/text_bold.png"},1357:function(e,t,i){e.exports=i.p+"img/text_inactive.png"},1358:function(e,t,i){e.exports=i.p+"img/text_italic.png"},1359:function(e,t,i){e.exports=i.p+"img/text_underline.png"},1360:function(e,t,i){e.exports=i.p+"img/tick.png"},1361:function(e,t,i){e.exports=i.p+"img/time.png"},1362:function(e,t,i){e.exports=i.p+"img/totals_position_cell.png"},1363:function(e,t,i){e.exports=i.p+"img/totals_position_cell_grey.png"},1364:function(e,t,i){e.exports=i.p+"img/totals_position_left.png"},1365:function(e,t,i){e.exports=i.p+"img/totals_position_left_grey.png"},1366:function(e,t,i){e.exports=i.p+"img/totals_position_none.png"},1367:function(e,t,i){e.exports=i.p+"img/totals_position_none_grey.png"},1368:function(e,t,i){e.exports=i.p+"img/totals_position_right.png"},1369:function(e,t,i){e.exports=i.p+"img/totals_position_right_grey.png"},1370:function(e,t,i){e.exports=i.p+"img/trueChart-icon.svg"},1371:function(e,t,i){e.exports=i.p+"img/truechart_logo_dark.svg"},1372:function(e,t,i){e.exports=i.p+"img/truechart_logo_light.svg"},1373:function(e,t,i){e.exports=i.p+"img/ui-active_state_1x400.png"},1374:function(e,t,i){e.exports=i.p+"img/ui-bg_flat_0_aaaaaa_40x100.png"},1375:function(e,t,i){e.exports=i.p+"img/ui-bg_glass_55_fbf9ee_1x400.png"},1376:function(e,t,i){e.exports=i.p+"img/ui-bg_glass_75_dadada_1x400.png"},1377:function(e,t,i){e.exports=i.p+"img/ui-bg_glass_75_e6e6e6_1x400.png"},1378:function(e,t,i){e.exports=i.p+"img/ui-bg_inset-soft_95_fef1ec_1x100.png"},1379:function(e,t,i){e.exports=i.p+"img/ui-icons_222222_256x240.png"},1380:function(e,t,i){e.exports=i.p+"img/ui-icons_2e83ff_256x240.png"},1381:function(e,t,i){e.exports=i.p+"img/ui-icons_454545_256x240.png"},1382:function(e,t,i){e.exports=i.p+"img/ui-icons_cd0a0a_256x240.png"},1383:function(e,t,i){e.exports=i.p+"img/ui-normal_state_1x400.png"},1384:function(e,t,i){e.exports=i.p+"img/unlock.png"},1385:function(e,t,i){e.exports=i.p+"img/user.png"},1386:function(e,t,i){e.exports=i.p+"img/visible.png"}}]);